[libjogl2-java] 01/04: Imported Upstream version 2.2.0

Tony Mancill tmancill at moszumanska.debian.org
Mon Nov 3 14:57:30 UTC 2014


This is an automated email from the git hooks/post-receive script.

tmancill pushed a commit to branch master
in repository libjogl2-java.

commit 95ba73730fd9d4bf3649fe11526503a5e481dbdd
Author: tony mancill <tmancill at debian.org>
Date:   Wed Sep 3 21:59:01 2014 -0700

    Imported Upstream version 2.2.0
---
 .classpath                                         |    8 +
 .gitmodules                                        |    3 +
 LICENSE.txt                                        |   68 +-
 doc/HowToBuild.html                                |   43 +-
 doc/NEWT-Overview.html                             |   56 +
 doc/NewUI-Req01.txt                                |    2 +-
 doc/deployment/JOGL-DEPLOYMENT.html                |    6 +-
 doc/wiki/FAQ.xml                                   |    2 +-
 etc/profile.jogl                                   |   27 +-
 jnlp-files/atomic/jogl-awt.jnlp                    |    2 +-
 jnlp-files/atomic/jogl-noawt.jnlp                  |    2 +-
 jnlp-files/atomic/nativewindow-awt.jnlp            |    2 +-
 jnlp-files/atomic/nativewindow-noawt.jnlp          |    2 +-
 jnlp-files/atomic/newt-awt-jogl.jnlp               |    2 +-
 jnlp-files/atomic/newt-awt.jnlp                    |    2 +-
 jnlp-files/atomic/newt-noawt-jogl.jnlp             |    2 +-
 jnlp-files/atomic/newt-noawt.jnlp                  |    2 +-
 ...unner-newt-GraphTextDemo01-applet3-napplet.html |    4 +-
 ...applet-runner-newt-GraphTextDemo01-napplet.html |    4 +-
 .../jogl-applet-runner-newt-GraphTextDemo01.html   |    4 +-
 ...pplet-runner-newt-GraphTextDemo01b-napplet.html |    4 +-
 ...er-newt-GraphUISceneDemo01-applet3-napplet.html |    2 +
 ...let-runner-newt-GraphUISceneDemo01-napplet.html |   14 +-
 ...jogl-applet-runner-newt-GraphUISceneDemo01.html |    2 +
 ...let-runner-newt-GraphUISceneDemo02-napplet.html |   70 +
 ...let-runner-newt-GraphUISceneDemo03-napplet.html |   70 +
 ...let-runner-newt-GraphUISceneDemo04-napplet.html |   70 +
 ...plet-runner-newt-MovieCube-applet3-napplet.html |    4 +-
 .../jogl-applet-runner-newt-MovieCube-napplet.html |    4 +-
 jnlp-files/jogl-applet-runner-newt-MovieCube.html  |    4 +-
 jnlp-files/jogl-test-applets.html                  |    7 +-
 make/build-common.xml                              |  192 +-
 make/build-jogl.xml                                |   56 +-
 make/build-nativewindow.xml                        |   28 +-
 make/build-newt.xml                                |   24 +-
 make/build-oculusvr.xml                            |  721 ++++
 make/build-test.xml                                |   34 +-
 make/build.xml                                     |   66 +-
 make/config/jogl/cgl-macosx-CustomJavaCode.java    |    6 +-
 make/config/jogl/gl-es3-impl.cfg                   |    4 -
 make/config/jogl/gl-if-CustomJavaCode-es3.java     |    4 -
 .../config/jogl/gl-impl-CustomJavaCode-common.java |   16 -
 make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java |    8 -
 make/config/jogl/gl-impl-CustomJavaCode-gles3.java |    8 -
 make/config/jogl/glu-CustomJavaCode-base.java      |   20 +-
 make/config/jogl/glu-CustomJavaCode-gl2.java       |   17 +-
 make/config/jogl/glu-CustomJavaCode-gl2es1.java    |    8 +-
 make/config/jogl/glu-base.cfg                      |    1 +
 make/config/jogl/glu-gl2.cfg                       |    1 +
 make/config/jogl/glu-gl2es1.cfg                    |    1 +
 make/config/jogl/glx-CustomCCode.c                 |   75 +-
 make/config/jogl/glx-x11.cfg                       |    1 +
 make/config/nativewindow/jawt-common.cfg           |    5 +-
 make/config/oculusvr/oculusvr-common.cfg           |   55 +
 .../oculusvr/oculusvr-ovr-CustomJavaCode.java      |   33 +
 make/config/oculusvr/oculusvr.c                    |    5 +
 make/config/oculusvr/oculusvr.cfg                  |   18 +
 make/joglversion-all-natives                       |   19 +
 make/joglversion-natives                           |   19 +
 make/nativewindowversion-natives                   |   19 +
 make/newtversion-natives                           |   19 +
 make/oculusvrversion                               |   19 +
 make/oculusvrversion-natives                       |   19 +
 make/resources/android/AndroidManifest-test.xml    |   14 +-
 make/resources/android/res-test/values/strings.xml |    3 +-
 .../assets/jogl/util/data/av/test-ntsc01-28x16.png |  Bin 0 -> 396 bytes
 .../util/data/av => misc}/test-ntsc01-57x32.png    |  Bin
 make/scripts/adb-launch-activity.sh                |    5 +-
 make/scripts/lstjars.sh                            |    4 +-
 make/scripts/make.jogl.all.generic.sh              |   29 +
 make/scripts/make.jogl.all.linux-x86_64.sh         |    1 +
 make/scripts/make.jogl.all.macosx-clang.sh         |   30 -
 make/scripts/make.jogl.all.win64.bat               |    2 +-
 make/scripts/setenv-jogl.sh                        |   16 +-
 make/scripts/tests-osx-x64.sh                      |    3 +-
 make/scripts/tests-win.bat                         |   13 +-
 make/scripts/tests-x32-dbg.bat                     |    8 +-
 make/scripts/tests-x32.bat                         |    2 +-
 make/scripts/tests-x64-custom.sh                   |    2 +-
 make/scripts/tests-x64-dbg.bat                     |    7 +-
 make/scripts/tests-x64.bat                         |    2 +-
 make/scripts/tests-x64.sh                          |   13 +-
 make/scripts/tests.sh                              |  171 +-
 .../libavcodec/avcodec.h                           | 4277 -------------------
 .../lavc55_lavf55_lavu52_lavr01/libavcodec/avfft.h |  116 -
 .../lavc55_lavf55_lavu52_lavr01/libavcodec/vdpau.h |  160 -
 .../libavcodec/version.h                           |   77 -
 .../lavc55_lavf55_lavu52_lavr01/libavcodec/xvmc.h  |  168 -
 .../libavformat/avformat.h                         | 1708 --------
 .../lavc55_lavf55_lavu52_lavr01/libavformat/avio.h |  433 --
 .../libavformat/version.h                          |   52 -
 .../libavresample/version.h                        |   52 -
 .../libavutil/attributes.h                         |  122 -
 .../lavc55_lavf55_lavu52_lavr01/libavutil/avutil.h |  308 --
 .../lavc55_lavf55_lavu52_lavr01/libavutil/bswap.h  |  109 -
 .../libavutil/channel_layout.h                     |  182 -
 .../lavc55_lavf55_lavu52_lavr01/libavutil/common.h |  405 --
 .../lavc55_lavf55_lavu52_lavr01/libavutil/cpu.h    |   84 -
 .../lavc55_lavf55_lavu52_lavr01/libavutil/dict.h   |  146 -
 .../lavc55_lavf55_lavu52_lavr01/libavutil/error.h  |   83 -
 .../lavc55_lavf55_lavu52_lavr01/libavutil/frame.h  |  491 ---
 .../libavutil/intfloat_readwrite.h                 |   40 -
 .../lavc55_lavf55_lavu52_lavr01/libavutil/log.h    |  173 -
 .../lavc55_lavf55_lavu52_lavr01/libavutil/mem.h    |  209 -
 .../libavutil/old_pix_fmts.h                       |  132 -
 .../libavutil/pixdesc.h                            |  276 --
 .../lavc55_lavf55_lavu52_lavr01/libavutil/pixfmt.h |  277 --
 .../libavutil/version.h                            |   96 -
 .../libswresample/swresample.h                     |  311 --
 .../libswresample/version.h                        |   45 -
 .../libavcodec/avcodec.h                           | 4356 ++++++++++++++++++++
 .../lavc55_lavf55_lavu53_lavr01/libavcodec/avfft.h |  118 +
 .../libavcodec/dxva2.h                             |    0
 .../libavcodec/vaapi.h                             |    0
 .../libavcodec/vda.h                               |    0
 .../lavc55_lavf55_lavu53_lavr01/libavcodec/vdpau.h |  189 +
 .../libavcodec/version.h                           |  127 +
 .../lavc55_lavf55_lavu53_lavr01/libavcodec/xvmc.h  |  174 +
 .../libavformat/avformat.h                         | 1869 +++++++++
 .../lavc55_lavf55_lavu53_lavr01/libavformat/avio.h |  439 ++
 .../libavformat/version.h                          |   55 +
 .../libavresample/avresample.h                     |    0
 .../libavresample/version.h                        |   54 +
 .../libavutil/adler32.h                            |    0
 .../libavutil/aes.h                                |    0
 .../libavutil/attributes.h                         |  126 +
 .../libavutil/audio_fifo.h                         |    0
 .../libavutil/audioconvert.h                       |    0
 .../libavutil/avassert.h                           |    0
 .../libavutil/avconfig.h                           |    0
 .../libavutil/avstring.h                           |    0
 .../lavc55_lavf55_lavu53_lavr01/libavutil/avutil.h |  284 ++
 .../libavutil/base64.h                             |    0
 .../libavutil/blowfish.h                           |    0
 .../lavc55_lavf55_lavu53_lavr01/libavutil/bswap.h  |  111 +
 .../libavutil/buffer.h                             |    0
 .../libavutil/channel_layout.h                     |  186 +
 .../lavc55_lavf55_lavu53_lavr01/libavutil/common.h |  406 ++
 .../lavc55_lavf55_lavu53_lavr01/libavutil/cpu.h    |   87 +
 .../libavutil/crc.h                                |    0
 .../lavc55_lavf55_lavu53_lavr01/libavutil/dict.h   |  146 +
 .../libavutil/downmix_info.h                       |  114 +
 .../lavc55_lavf55_lavu53_lavr01/libavutil/error.h  |   82 +
 .../libavutil/eval.h                               |    0
 .../libavutil/fifo.h                               |    0
 .../libavutil/file.h                               |    0
 .../lavc55_lavf55_lavu53_lavr01/libavutil/frame.h  |  552 +++
 .../libavutil/hmac.h                               |    0
 .../libavutil/imgutils.h                           |    0
 .../libavutil/intfloat.h                           |    0
 .../libavutil/intreadwrite.h                       |    0
 .../libavutil/lfg.h                                |    0
 .../lavc55_lavf55_lavu53_lavr01/libavutil/log.h    |  262 ++
 .../libavutil/lzo.h                                |    0
 .../lavc55_lavf55_lavu53_lavr01/libavutil/macros.h |   48 +
 .../libavutil/mathematics.h                        |    0
 .../libavutil/md5.h                                |    0
 .../lavc55_lavf55_lavu53_lavr01/libavutil/mem.h    |  265 ++
 .../libavutil/old_pix_fmts.h                       |  134 +
 .../libavutil/opt.h                                |    0
 .../libavutil/parseutils.h                         |    0
 .../libavutil/pixdesc.h                            |  276 ++
 .../lavc55_lavf55_lavu53_lavr01/libavutil/pixfmt.h |  283 ++
 .../libavutil/random_seed.h                        |    0
 .../libavutil/rational.h                           |    0
 .../libavutil/samplefmt.h                          |    0
 .../libavutil/sha.h                                |    0
 .../libavutil/stereo3d.h                           |  147 +
 .../libavutil/time.h                               |    0
 .../libavutil/version.h                            |  116 +
 .../libavutil/xtea.h                               |    0
 .../libswresample/swresample.h                     |  318 ++
 .../libswresample/version.h                        |   45 +
 make/stub_includes/opengl/macosx-window-system.h   |    3 +-
 make/stub_includes/win32/wingdi.h                  |    6 +-
 .../com/jogamp/audio/windows/waveout/Audio.java    |    6 +-
 .../com/jogamp/audio/windows/waveout/Mixer.java    |   76 +-
 .../jogamp/audio/windows/waveout/SoundBuffer.java  |   24 +-
 .../com/jogamp/audio/windows/waveout/Track.java    |   20 +-
 .../com/jogamp/audio/windows/waveout/Vec3f.java    |   58 +-
 .../gluegen/opengl/BuildComposablePipeline.java    |  420 +-
 .../jogamp/gluegen/opengl/BuildStaticGLInfo.java   |   76 +-
 .../com/jogamp/gluegen/opengl/GLConfiguration.java |   92 +-
 .../com/jogamp/gluegen/opengl/GLEmitter.java       |  106 +-
 .../gluegen/opengl/GLJavaMethodBindingEmitter.java |   26 +-
 .../jogamp/gluegen/opengl/ant/StaticGLGenTask.java |   22 +-
 .../opengl/nativesig/NativeSignatureEmitter.java   |   54 +-
 .../NativeSignatureJavaMethodBindingEmitter.java   |   46 +-
 .../gluegen/runtime/opengl/GLNameResolver.java     |   74 +-
 .../runtime/opengl/GLProcAddressResolver.java      |    8 +-
 .../com/jogamp/graph/curve/OutlineShape.java       |  498 ++-
 .../com/jogamp/graph/curve/OutlineShapeXForm.java  |   16 +
 .../classes/com/jogamp/graph/curve/Region.java     |  411 +-
 .../com/jogamp/graph/curve/opengl/GLRegion.java    |  144 +-
 .../jogamp/graph/curve/opengl/RegionRenderer.java  |  532 ++-
 .../com/jogamp/graph/curve/opengl/RenderState.java |  320 +-
 .../com/jogamp/graph/curve/opengl/Renderer.java    |  302 --
 .../jogamp/graph/curve/opengl/TextRegionUtil.java  |  351 ++
 .../jogamp/graph/curve/opengl/TextRenderer.java    |  193 -
 .../com/jogamp/graph/curve/tess/Triangulator.java  |   24 +-
 src/jogl/classes/com/jogamp/graph/font/Font.java   |  125 +-
 .../classes/com/jogamp/graph/font/FontFactory.java |   31 +-
 .../classes/com/jogamp/graph/font/FontSet.java     |   24 +-
 .../classes/com/jogamp/graph/geom/Outline.java     |  150 +-
 .../classes/com/jogamp/graph/geom/SVertex.java     |  224 +
 .../classes/com/jogamp/graph/geom/Triangle.java    |   76 +-
 src/jogl/classes/com/jogamp/graph/geom/Vertex.java |    6 +-
 .../com/jogamp/graph/geom/opengl/SVertex.java      |  201 -
 src/jogl/classes/com/jogamp/opengl/FBObject.java   |  681 ++-
 .../com/jogamp/opengl/GLAutoDrawableDelegate.java  |   26 +-
 .../com/jogamp/opengl/GLEventListenerState.java    |  505 ++-
 .../classes/com/jogamp/opengl/GLExtensions.java    |    1 +
 .../com/jogamp/opengl/GLRendererQuirks.java        |   54 +-
 .../classes/com/jogamp/opengl/JoglVersion.java     |   26 +-
 .../opengl/cg/CgDynamicLibraryBundleInfo.java      |    6 +-
 .../classes/com/jogamp/opengl/cg/CgException.java  |    6 +-
 .../classes/com/jogamp/opengl/math/Binary16.java   |   24 +-
 .../classes/com/jogamp/opengl/math/Binary32.java   |    2 +-
 .../classes/com/jogamp/opengl/math/Binary64.java   |    6 +-
 .../classes/com/jogamp/opengl/math/FixedPoint.java |    8 +-
 .../classes/com/jogamp/opengl/math/FloatUtil.java  | 2249 ++++++++--
 .../com/jogamp/opengl/math/FovHVHalves.java        |  182 +
 .../classes/com/jogamp/opengl/math/Matrix4.java    |  152 +
 .../classes/com/jogamp/opengl/math/Quaternion.java | 1267 ++++--
 src/jogl/classes/com/jogamp/opengl/math/Ray.java   |   57 +
 .../classes/com/jogamp/opengl/math/VectorUtil.java | 1131 ++++-
 .../com/jogamp/opengl/math/geom/AABBox.java        |  540 ++-
 .../com/jogamp/opengl/math/geom/Frustum.java       |   62 +-
 .../classes/com/jogamp/opengl/swt/GLCanvas.java    |  209 +-
 .../com/jogamp/opengl/util/AWTAnimatorImpl.java    |   48 +-
 .../classes/com/jogamp/opengl/util/Animator.java   |   63 +-
 .../com/jogamp/opengl/util/AnimatorBase.java       |  112 +-
 .../jogamp/opengl/util/CustomGLEventListener.java  |   63 +
 .../jogamp/opengl/util/DefaultAnimatorImpl.java    |   19 +-
 .../com/jogamp/opengl/util/FPSAnimator.java        |   86 +-
 .../com/jogamp/opengl/util/GLArrayDataClient.java  |   76 +-
 .../com/jogamp/opengl/util/GLArrayDataServer.java  |  146 +-
 .../com/jogamp/opengl/util/GLArrayDataWrapper.java |   58 +-
 .../classes/com/jogamp/opengl/util/GLBuffers.java  |  148 +-
 .../com/jogamp/opengl/util/GLDrawableUtil.java     |  436 +-
 .../com/jogamp/opengl/util/GLPixelBuffer.java      |   35 +-
 .../jogamp/opengl/util/GLPixelStorageModes.java    |  268 +-
 .../com/jogamp/opengl/util/GLReadBufferUtil.java   |   29 +-
 src/jogl/classes/com/jogamp/opengl/util/Gamma.java |  116 +-
 .../com/jogamp/opengl/util/ImmModeSink.java        |  255 +-
 .../classes/com/jogamp/opengl/util/PMVMatrix.java  |  682 ++-
 .../com/jogamp/opengl/util/PNGPixelRect.java       |    2 +-
 .../com/jogamp/opengl/util/RandomTileRenderer.java |   13 +-
 .../classes/com/jogamp/opengl/util/TGAWriter.java  |  116 -
 .../com/jogamp/opengl/util/TileRenderer.java       |   23 +-
 .../com/jogamp/opengl/util/TileRendererBase.java   |   31 +-
 .../classes/com/jogamp/opengl/util/TimeFrameI.java |    6 +-
 .../com/jogamp/opengl/util/av/AudioSink.java       |   46 +-
 .../jogamp/opengl/util/av/AudioSinkFactory.java    |    6 +-
 .../com/jogamp/opengl/util/av/GLMediaPlayer.java   |    7 +-
 .../opengl/util/av/GLMediaPlayerFactory.java       |    4 +-
 .../jogamp/opengl/util/awt/AWTGLPixelBuffer.java   |   27 +-
 .../opengl/util/awt/AWTGLReadBufferUtil.java       |   17 +-
 .../com/jogamp/opengl/util/awt/ImageUtil.java      |   16 +-
 .../com/jogamp/opengl/util/awt/Overlay.java        |   28 +-
 .../com/jogamp/opengl/util/awt/Screenshot.java     |  414 --
 .../com/jogamp/opengl/util/awt/TextRenderer.java   |  428 +-
 .../jogamp/opengl/util/awt/TextureRenderer.java    |  133 +-
 .../com/jogamp/opengl/util/gl2/BitmapCharRec.java  |   12 +-
 .../com/jogamp/opengl/util/gl2/BitmapFontRec.java  |    8 +-
 .../com/jogamp/opengl/util/gl2/CoordRec.java       |    2 +-
 .../classes/com/jogamp/opengl/util/gl2/GLUT.java   |  371 +-
 .../opengl/util/gl2/GLUTStrokeMonoRoman.java       |  680 +--
 .../jogamp/opengl/util/gl2/GLUTStrokeRoman.java    |  618 +--
 .../com/jogamp/opengl/util/gl2/StrokeCharRec.java  |    8 +-
 .../com/jogamp/opengl/util/gl2/StrokeFontRec.java  |   10 +-
 .../com/jogamp/opengl/util/gl2/StrokeRec.java      |    4 +-
 .../com/jogamp/opengl/util/glsl/ShaderCode.java    |  179 +-
 .../com/jogamp/opengl/util/glsl/ShaderProgram.java |   59 +-
 .../com/jogamp/opengl/util/glsl/ShaderState.java   |  165 +-
 .../com/jogamp/opengl/util/glsl/ShaderUtil.java    |   96 +-
 .../opengl/util/glsl/fixedfunc/FixedFuncUtil.java  |    6 +-
 .../jogamp/opengl/util/glsl/sdk/CompileShader.java |   48 +-
 .../opengl/util/glsl/sdk/CompileShaderNVidia.java  |    4 +-
 .../com/jogamp/opengl/util/packrect/Level.java     |   54 +-
 .../com/jogamp/opengl/util/packrect/LevelSet.java  |   52 +-
 .../com/jogamp/opengl/util/packrect/Rect.java      |   14 +-
 .../opengl/util/packrect/RectanglePacker.java      |   54 +-
 .../jogamp/opengl/util/stereo/EyeParameter.java    |   68 +
 .../com/jogamp/opengl/util/stereo/EyePose.java     |   69 +
 .../opengl/util/stereo/StereoClientRenderer.java   |  263 ++
 .../jogamp/opengl/util/stereo/StereoDevice.java    |  160 +
 .../opengl/util/stereo/StereoDeviceFactory.java    |   99 +
 .../opengl/util/stereo/StereoDeviceRenderer.java   |  243 ++
 .../opengl/util/stereo/StereoGLEventListener.java  |   74 +
 .../com/jogamp/opengl/util/stereo/StereoUtil.java  |  125 +
 .../jogamp/opengl/util/texture/ImageSequence.java  |  190 +
 .../com/jogamp/opengl/util/texture/Texture.java    |  173 +-
 .../jogamp/opengl/util/texture/TextureCoords.java  |   14 +-
 .../jogamp/opengl/util/texture/TextureData.java    |  129 +-
 .../com/jogamp/opengl/util/texture/TextureIO.java  |  372 +-
 .../opengl/util/texture/TextureSequence.java       |   31 +-
 .../jogamp/opengl/util/texture/TextureState.java   |   14 +-
 .../opengl/util/texture/awt/AWTTextureData.java    |   52 +-
 .../opengl/util/texture/awt/AWTTextureIO.java      |   28 +-
 .../jogamp/opengl/util/texture/spi/DDSImage.java   |  143 +-
 .../jogamp/opengl/util/texture/spi/JPEGImage.java  |   20 +-
 .../opengl/util/texture/spi/LEDataInputStream.java |   54 +-
 .../util/texture/spi/LEDataOutputStream.java       |   30 +-
 .../util/texture/spi/NetPbmTextureWriter.java      |   22 +-
 .../jogamp/opengl/util/texture/spi/SGIImage.java   |  128 +-
 .../jogamp/opengl/util/texture/spi/TGAImage.java   |   76 +-
 .../util/texture/spi/awt/IIOTextureProvider.java   |   36 +-
 .../util/texture/spi/awt/IIOTextureWriter.java     |   26 +-
 src/jogl/classes/javax/media/opengl/DebugGL2.java  |    2 +-
 src/jogl/classes/javax/media/opengl/DebugGL3.java  |    2 +-
 .../classes/javax/media/opengl/DebugGL3bc.java     |    2 +-
 src/jogl/classes/javax/media/opengl/DebugGL4.java  |    2 +-
 .../classes/javax/media/opengl/DebugGLES2.java     |    2 +-
 .../media/opengl/DefaultGLCapabilitiesChooser.java |   16 +-
 .../javax/media/opengl/GLAnimatorControl.java      |   52 +
 .../classes/javax/media/opengl/GLAutoDrawable.java |  112 +-
 src/jogl/classes/javax/media/opengl/GLBase.java    |   22 +-
 .../javax/media/opengl/GLBufferStorage.java        |   20 +-
 .../classes/javax/media/opengl/GLCapabilities.java |   46 +-
 src/jogl/classes/javax/media/opengl/GLContext.java |  210 +-
 .../classes/javax/media/opengl/GLDebugMessage.java |   90 +-
 .../classes/javax/media/opengl/GLDrawable.java     |   47 +-
 .../javax/media/opengl/GLDrawableFactory.java      |  215 +-
 .../javax/media/opengl/GLEventListener.java        |   26 +-
 .../classes/javax/media/opengl/GLException.java    |   26 +-
 .../classes/javax/media/opengl/GLFBODrawable.java  |   59 +-
 .../media/opengl/GLOffscreenAutoDrawable.java      |   10 +-
 src/jogl/classes/javax/media/opengl/GLPbuffer.java |   62 -
 .../javax/media/opengl/GLPipelineFactory.java      |   26 +-
 src/jogl/classes/javax/media/opengl/GLProfile.java |  244 +-
 .../javax/media/opengl/GLSharedContextSetter.java  |   16 +-
 .../classes/javax/media/opengl/GLUniformData.java  |   92 +-
 src/jogl/classes/javax/media/opengl/Threading.java |   50 +-
 src/jogl/classes/javax/media/opengl/TraceGL2.java  |    2 +-
 src/jogl/classes/javax/media/opengl/TraceGL3.java  |    2 +-
 .../classes/javax/media/opengl/TraceGL3bc.java     |    2 +-
 src/jogl/classes/javax/media/opengl/TraceGL4.java  |    2 +-
 .../classes/javax/media/opengl/TraceGLES2.java     |    2 +-
 .../classes/javax/media/opengl/awt/GLCanvas.java   |  416 +-
 .../classes/javax/media/opengl/awt/GLJPanel.java   |  640 +--
 .../javax/media/opengl/fixedfunc/GLMatrixFunc.java |    4 +-
 .../media/opengl/fixedfunc/GLPointerFuncUtil.java  |    4 +-
 .../opengl/glu/GLUtessellatorCallbackAdapter.java  |   30 +-
 .../jogamp/graph/curve/opengl/RegionFactory.java   |   74 -
 .../graph/curve/opengl/RegionRendererImpl01.java   |  100 -
 .../jogamp/graph/curve/opengl/RenderStateImpl.java |   73 -
 .../graph/curve/opengl/TextRendererImpl01.java     |  108 -
 .../jogamp/graph/curve/opengl/VBORegion2PES2.java  |  343 --
 .../graph/curve/opengl/VBORegion2PMSAAES2.java     |  586 +++
 .../graph/curve/opengl/VBORegion2PVBAAES2.java     |  700 ++++
 .../jogamp/graph/curve/opengl/VBORegionSPES2.java  |  305 +-
 .../graph/curve/opengl/shader/AttributeNames.java  |   19 +-
 .../graph/curve/opengl/shader/UniformNames.java    |   11 +-
 .../graph/curve/opengl/shader/attributes.glsl      |   23 +-
 .../opengl/shader/curverenderer01-1pass-weight.fp  |   55 -
 .../curve/opengl/shader/curverenderer01-1pass.fp   |   49 -
 .../opengl/shader/curverenderer01-2pass-weight.fp  |   97 -
 .../curve/opengl/shader/curverenderer01-2pass.fp   |   91 -
 .../shader/curverenderer01-pass1-curve_lineAA.glsl |   19 +
 .../shader/curverenderer01-pass1-curve_simple.glsl |   36 +
 .../curverenderer01-pass1-curve_simple.orig.glsl   |   47 +
 .../shader/curverenderer01-pass1-curve_weight.glsl |   32 +
 .../curve/opengl/shader/curverenderer01-pass1.vp   |   33 +
 .../opengl/shader/curverenderer01-pass2-msaa.glsl  |   10 +
 .../curverenderer01-pass2-vbaa_allprop01.glsl      |  113 +
 .../curverenderer01-pass2-vbaa_bforce_even.glsl    |   96 +
 .../curverenderer01-pass2-vbaa_bforce_odd.glsl     |   87 +
 .../curverenderer01-pass2-vbaa_flipquad.glsl       |   41 +
 .../curverenderer01-pass2-vbaa_flipquad2.glsl      |   41 +
 .../curverenderer01-pass2-vbaa_flipquad3.glsl      |  109 +
 .../shader/curverenderer01-pass2-vbaa_fxaa3.glsl   |   56 +
 .../curverenderer01-pass2-vbaa_poles_bilin1.glsl   |   91 +
 .../curverenderer01-pass2-vbaa_polesequal.glsl     |   49 +
 .../curverenderer01-pass2-vbaa_polesprop01.glsl    |   65 +
 .../curverenderer01-pass2-vbaa_quincunx.glsl       |   28 +
 .../shader/curverenderer01-pass2-vbaa_rgss.glsl    |   25 +
 .../curve/opengl/shader/curverenderer01-pass2.vp   |   17 +
 .../opengl/shader/curverenderer01-segment-head.fp  |   16 +
 .../curve/opengl/shader/curverenderer01-single.vp  |   33 +
 .../graph/curve/opengl/shader/curverenderer01.vp   |   17 -
 .../jogamp/graph/curve/opengl/shader/uniforms.glsl |   25 +-
 .../jogamp/graph/curve/opengl/shader/varyings.glsl |   13 +-
 .../jogamp/graph/curve/tess/CDTriangulator2D.java  |  170 +-
 .../graph/curve/tess/CDTriangulator2DExpAddOn.java |  340 ++
 .../jogamp/graph/curve/tess/GraphOutline.java      |    6 +-
 .../jogamp/graph/curve/tess/GraphVertex.java       |   26 +-
 .../classes/jogamp/graph/curve/tess/HEdge.java     |   28 +-
 src/jogl/classes/jogamp/graph/curve/tess/Loop.java |  100 +-
 .../jogamp/graph/curve/text/GlyphShape.java        |   99 -
 .../jogamp/graph/curve/text/GlyphString.java       |  213 -
 src/jogl/classes/jogamp/graph/font/FontInt.java    |   47 -
 .../classes/jogamp/graph/font/JavaFontLoader.java  |    8 +-
 .../jogamp/graph/font/UbuntuFontLoader.java        |   14 +-
 .../jogamp/graph/font/typecast/TypecastFont.java   |  184 +-
 .../font/typecast/TypecastFontConstructor.java     |    6 +-
 .../jogamp/graph/font/typecast/TypecastGlyph.java  |  151 +-
 .../graph/font/typecast/TypecastHMetrics.java      |   32 +-
 .../graph/font/typecast/TypecastRenderer.java      |  305 +-
 .../graph/font/typecast/ot/Disassembler.java       |   22 +-
 .../jogamp/graph/font/typecast/ot/Fixed.java       |   10 +-
 .../jogamp/graph/font/typecast/ot/Mnemonic.java    |    4 +-
 .../jogamp/graph/font/typecast/ot/OTFont.java      |   28 +-
 .../graph/font/typecast/ot/OTFontCollection.java   |   26 +-
 .../jogamp/graph/font/typecast/ot/OTGlyph.java     |   26 +-
 .../jogamp/graph/font/typecast/ot/Point.java       |    7 +-
 .../graph/font/typecast/ot/mac/ResourceData.java   |    6 +-
 .../graph/font/typecast/ot/mac/ResourceFile.java   |   14 +-
 .../graph/font/typecast/ot/mac/ResourceHeader.java |   10 +-
 .../graph/font/typecast/ot/mac/ResourceMap.java    |   29 +-
 .../font/typecast/ot/mac/ResourceReference.java    |   18 +-
 .../graph/font/typecast/ot/mac/ResourceType.java   |   16 +-
 .../graph/font/typecast/ot/table/BaseTable.java    |  209 +-
 .../graph/font/typecast/ot/table/CffTable.java     |  194 +-
 .../font/typecast/ot/table/CharstringType2.java    |   62 +-
 .../graph/font/typecast/ot/table/ClassDef.java     |    4 +-
 .../font/typecast/ot/table/ClassDefFormat1.java    |    8 +-
 .../font/typecast/ot/table/ClassDefFormat2.java    |    6 +-
 .../graph/font/typecast/ot/table/CmapFormat.java   |   12 +-
 .../graph/font/typecast/ot/table/CmapFormat0.java  |    8 +-
 .../graph/font/typecast/ot/table/CmapFormat2.java  |   26 +-
 .../graph/font/typecast/ot/table/CmapFormat4.java  |   48 +-
 .../graph/font/typecast/ot/table/CmapFormat6.java  |    6 +-
 .../font/typecast/ot/table/CmapFormatUnknown.java  |    6 +-
 .../font/typecast/ot/table/CmapIndexEntry.java     |   14 +-
 .../graph/font/typecast/ot/table/CmapTable.java    |   18 +-
 .../graph/font/typecast/ot/table/Coverage.java     |    4 +-
 .../font/typecast/ot/table/CoverageFormat1.java    |    8 +-
 .../font/typecast/ot/table/CoverageFormat2.java    |   10 +-
 .../graph/font/typecast/ot/table/CvtTable.java     |   10 +-
 .../graph/font/typecast/ot/table/Device.java       |   10 +-
 .../font/typecast/ot/table/DirectoryEntry.java     |   12 +-
 .../graph/font/typecast/ot/table/DsigEntry.java    |    8 +-
 .../graph/font/typecast/ot/table/DsigTable.java    |   16 +-
 .../graph/font/typecast/ot/table/Feature.java      |   10 +-
 .../graph/font/typecast/ot/table/FeatureList.java  |   16 +-
 .../font/typecast/ot/table/FeatureRecord.java      |    6 +-
 .../graph/font/typecast/ot/table/FpgmTable.java    |    4 +-
 .../graph/font/typecast/ot/table/GaspRange.java    |    8 +-
 .../graph/font/typecast/ot/table/GaspTable.java    |   12 +-
 .../font/typecast/ot/table/GlyfCompositeComp.java  |   24 +-
 .../typecast/ot/table/GlyfCompositeDescript.java   |   69 +-
 .../graph/font/typecast/ot/table/GlyfDescript.java |   18 +-
 .../font/typecast/ot/table/GlyfSimpleDescript.java |   38 +-
 .../graph/font/typecast/ot/table/GlyfTable.java    |   30 +-
 .../graph/font/typecast/ot/table/GposTable.java    |   12 +-
 .../graph/font/typecast/ot/table/GsubTable.java    |   30 +-
 .../graph/font/typecast/ot/table/HdmxTable.java    |   28 +-
 .../graph/font/typecast/ot/table/HeadTable.java    |   40 +-
 .../graph/font/typecast/ot/table/HheaTable.java    |   30 +-
 .../graph/font/typecast/ot/table/HmtxTable.java    |   18 +-
 .../jogamp/graph/font/typecast/ot/table/ID.java    |    8 +-
 .../graph/font/typecast/ot/table/KernSubtable.java |   10 +-
 .../typecast/ot/table/KernSubtableFormat0.java     |   14 +-
 .../typecast/ot/table/KernSubtableFormat2.java     |   12 +-
 .../graph/font/typecast/ot/table/KernTable.java    |   12 +-
 .../graph/font/typecast/ot/table/KerningPair.java  |    8 +-
 .../graph/font/typecast/ot/table/LangSys.java      |   14 +-
 .../font/typecast/ot/table/LangSysRecord.java      |    6 +-
 .../graph/font/typecast/ot/table/Ligature.java     |   10 +-
 .../graph/font/typecast/ot/table/LigatureSet.java  |    8 +-
 .../font/typecast/ot/table/LigatureSubst.java      |    4 +-
 .../typecast/ot/table/LigatureSubstFormat1.java    |   14 +-
 .../graph/font/typecast/ot/table/LocaTable.java    |   16 +-
 .../graph/font/typecast/ot/table/Lookup.java       |   14 +-
 .../graph/font/typecast/ot/table/LookupList.java   |   16 +-
 .../graph/font/typecast/ot/table/LtshTable.java    |   12 +-
 .../graph/font/typecast/ot/table/MaxpTable.java    |    8 +-
 .../graph/font/typecast/ot/table/NameRecord.java   |   22 +-
 .../graph/font/typecast/ot/table/NameTable.java    |   20 +-
 .../graph/font/typecast/ot/table/Os2Table.java     |   70 +-
 .../graph/font/typecast/ot/table/Panose.java       |    4 +-
 .../graph/font/typecast/ot/table/PcltTable.java    |   34 +-
 .../graph/font/typecast/ot/table/PostTable.java    |   36 +-
 .../graph/font/typecast/ot/table/PrepTable.java    |    4 +-
 .../graph/font/typecast/ot/table/Program.java      |    2 +-
 .../graph/font/typecast/ot/table/RangeRecord.java  |   12 +-
 .../graph/font/typecast/ot/table/Script.java       |   10 +-
 .../graph/font/typecast/ot/table/ScriptList.java   |   14 +-
 .../graph/font/typecast/ot/table/ScriptRecord.java |    6 +-
 .../font/typecast/ot/table/SignatureBlock.java     |   12 +-
 .../graph/font/typecast/ot/table/SingleSubst.java  |    4 +-
 .../font/typecast/ot/table/SingleSubstFormat1.java |   12 +-
 .../font/typecast/ot/table/SingleSubstFormat2.java |   14 +-
 .../graph/font/typecast/ot/table/TTCHeader.java    |   20 +-
 .../font/typecast/ot/table/TableDirectory.java     |   10 +-
 .../font/typecast/ot/table/TableException.java     |    2 +-
 .../graph/font/typecast/ot/table/TableFactory.java |    8 +-
 .../graph/font/typecast/ot/table/VdmxTable.java    |   54 +-
 .../graph/font/typecast/ot/table/VheaTable.java    |   30 +-
 .../graph/font/typecast/ot/table/VmtxTable.java    |   18 +-
 .../graph/font/typecast/t2/T2Interpreter.java      |  388 +-
 .../graph/font/typecast/tt/engine/Interpreter.java |  217 +-
 .../graph/font/typecast/tt/engine/Parser.java      |   40 +-
 .../jogamp/graph/geom/plane/AffineTransform.java   |  383 +-
 .../classes/jogamp/graph/geom/plane/Crossing.java  |  210 +-
 .../geom/plane/IllegalPathStateException.java      |    2 +-
 .../plane/NoninvertibleTransformException.java     |    2 +-
 .../classes/jogamp/graph/geom/plane/Path2D.java    |   80 +-
 src/jogl/classes/jogamp/opengl/Debug.java          |   58 +-
 .../opengl/DesktopGLDynamicLibraryBundleInfo.java  |    2 +-
 .../opengl/DesktopGLDynamicLookupHelper.java       |    4 +-
 .../jogamp/opengl/ExtensionAvailabilityCache.java  |   21 +-
 src/jogl/classes/jogamp/opengl/FPSCounterImpl.java |    6 +-
 .../classes/jogamp/opengl/GLAutoDrawableBase.java  |  166 +-
 .../jogamp/opengl/GLBufferObjectTracker.java       |   65 +-
 .../jogamp/opengl/GLBufferStateTracker.java        |   23 +-
 src/jogl/classes/jogamp/opengl/GLContextImpl.java  |  257 +-
 .../classes/jogamp/opengl/GLContextShareSet.java   |   10 +-
 .../jogamp/opengl/GLDebugMessageHandler.java       |   37 +-
 .../jogamp/opengl/GLDrawableFactoryImpl.java       |  288 +-
 .../classes/jogamp/opengl/GLDrawableHelper.java    |  391 +-
 src/jogl/classes/jogamp/opengl/GLDrawableImpl.java |   27 +-
 .../jogamp/opengl/GLDynamicLookupHelper.java       |    2 +-
 .../classes/jogamp/opengl/GLFBODrawableImpl.java   |  160 +-
 .../opengl/GLGraphicsConfigurationFactory.java     |    6 +-
 .../jogamp/opengl/GLGraphicsConfigurationUtil.java |   30 +-
 .../jogamp/opengl/GLOffscreenAutoDrawableImpl.java |   31 +-
 src/jogl/classes/jogamp/opengl/GLPbufferImpl.java  |  105 -
 src/jogl/classes/jogamp/opengl/GLRunnableTask.java |   10 +-
 src/jogl/classes/jogamp/opengl/GLStateTracker.java |   23 +-
 .../classes/jogamp/opengl/GLVersionNumber.java     |   12 +-
 src/jogl/classes/jogamp/opengl/GLWorkerThread.java |   26 +-
 .../jogamp/opengl/ListenerSyncedImplStub.java      |    6 +-
 src/jogl/classes/jogamp/opengl/MemoryObject.java   |  103 -
 src/jogl/classes/jogamp/opengl/ProjectFloat.java   |  739 +---
 .../jogamp/opengl/SharedResourceRunner.java        |   38 +-
 src/jogl/classes/jogamp/opengl/SystemUtil.java     |    4 +-
 src/jogl/classes/jogamp/opengl/ThreadingImpl.java  |   85 +-
 .../android/av/AndroidGLMediaPlayerAPI14.java      |   76 +-
 .../jogamp/opengl/awt/AWTThreadingPlugin.java      |    6 +-
 .../classes/jogamp/opengl/awt/AWTTilePainter.java  |   36 +-
 src/jogl/classes/jogamp/opengl/awt/AWTUtil.java    |    6 +-
 src/jogl/classes/jogamp/opengl/awt/Java2D.java     |  117 +-
 .../classes/jogamp/opengl/awt/VersionApplet.java   |   34 +-
 .../jogamp/opengl/cg/CgPackagePlaceholder.java     |    5 +
 .../egl/DesktopES2DynamicLibraryBundleInfo.java    |    6 +-
 src/jogl/classes/jogamp/opengl/egl/EGLContext.java |   42 +-
 .../classes/jogamp/opengl/egl/EGLDisplayUtil.java  |   28 +-
 .../classes/jogamp/opengl/egl/EGLDrawable.java     |   10 +-
 .../jogamp/opengl/egl/EGLDrawableFactory.java      |  128 +-
 .../opengl/egl/EGLDummyUpstreamSurfaceHook.java    |   10 +-
 .../opengl/egl/EGLDynamicLibraryBundleInfo.java    |   11 +-
 .../jogamp/opengl/egl/EGLExternalContext.java      |    2 +-
 .../jogamp/opengl/egl/EGLGLCapabilities.java       |   14 +-
 .../opengl/egl/EGLGraphicsConfiguration.java       |   26 +-
 .../egl/EGLGraphicsConfigurationFactory.java       |   50 +-
 .../jogamp/opengl/egl/EGLOnscreenDrawable.java     |    6 +-
 .../jogamp/opengl/egl/EGLPbufferDrawable.java      |    6 +-
 .../jogamp/opengl/egl/EGLUpstreamSurfaceHook.java  |   47 +-
 .../jogamp/opengl/egl/EGLWrappedSurface.java       |    8 +-
 .../classes/jogamp/opengl/gl2/ProjectDouble.java   |  325 +-
 .../classes/jogamp/opengl/glu/GLUquadricImpl.java  |  130 +-
 src/jogl/classes/jogamp/opengl/glu/Glue.java       |    4 +-
 .../classes/jogamp/opengl/glu/error/Error.java     |    2 +-
 .../opengl/glu/gl2/nurbs/GL2CurveEvaluator.java    |   51 +-
 .../opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java  |   63 +-
 .../opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java      |  163 +-
 .../jogamp/opengl/glu/mipmap/BuildMipmap.java      |  920 +++--
 .../jogamp/opengl/glu/mipmap/Extract1010102.java   |   12 +-
 .../jogamp/opengl/glu/mipmap/Extract1555rev.java   |   12 +-
 .../opengl/glu/mipmap/Extract2101010rev.java       |   12 +-
 .../jogamp/opengl/glu/mipmap/Extract233rev.java    |   12 +-
 .../jogamp/opengl/glu/mipmap/Extract332.java       |   12 +-
 .../jogamp/opengl/glu/mipmap/Extract4444.java      |   12 +-
 .../jogamp/opengl/glu/mipmap/Extract4444rev.java   |   12 +-
 .../jogamp/opengl/glu/mipmap/Extract5551.java      |   12 +-
 .../jogamp/opengl/glu/mipmap/Extract565.java       |   10 +-
 .../jogamp/opengl/glu/mipmap/Extract565rev.java    |   10 +-
 .../jogamp/opengl/glu/mipmap/Extract8888.java      |   12 +-
 .../jogamp/opengl/glu/mipmap/Extract8888rev.java   |   12 +-
 .../jogamp/opengl/glu/mipmap/ExtractFloat.java     |    4 +-
 .../jogamp/opengl/glu/mipmap/ExtractSByte.java     |    8 +-
 .../jogamp/opengl/glu/mipmap/ExtractSInt.java      |    6 +-
 .../jogamp/opengl/glu/mipmap/ExtractSShort.java    |    6 +-
 .../jogamp/opengl/glu/mipmap/ExtractUByte.java     |    6 +-
 .../jogamp/opengl/glu/mipmap/ExtractUInt.java      |    6 +-
 .../jogamp/opengl/glu/mipmap/ExtractUShort.java    |    6 +-
 .../jogamp/opengl/glu/mipmap/HalveImage.java       |  311 +-
 .../classes/jogamp/opengl/glu/mipmap/Image.java    |  325 +-
 .../classes/jogamp/opengl/glu/mipmap/Mipmap.java   |  372 +-
 .../opengl/glu/mipmap/PixelStorageModes.java       |   32 +-
 .../jogamp/opengl/glu/mipmap/ScaleInternal.java    |  188 +-
 .../jogamp/opengl/glu/mipmap/Type_Widget.java      |   34 +-
 src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java  |    8 +-
 .../jogamp/opengl/glu/nurbs/ArcSdirSorter.java     |    4 +-
 .../jogamp/opengl/glu/nurbs/ArcTdirSorter.java     |    4 +-
 .../jogamp/opengl/glu/nurbs/ArcTesselator.java     |    8 +-
 .../classes/jogamp/opengl/glu/nurbs/Backend.java   |   20 +-
 src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java  |    6 +-
 .../jogamp/opengl/glu/nurbs/CArrayOfArcs.java      |   24 +-
 .../jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java  |   16 +-
 .../jogamp/opengl/glu/nurbs/CArrayOfFloats.java    |   24 +-
 .../opengl/glu/nurbs/CArrayOfQuiltspecs.java       |   18 +-
 .../classes/jogamp/opengl/glu/nurbs/Curve.java     |   58 +-
 .../classes/jogamp/opengl/glu/nurbs/Curvelist.java |    2 +-
 .../jogamp/opengl/glu/nurbs/DisplayList.java       |    2 +-
 .../classes/jogamp/opengl/glu/nurbs/Flist.java     |    6 +-
 .../classes/jogamp/opengl/glu/nurbs/Knotspec.java  |   74 +-
 .../jogamp/opengl/glu/nurbs/Knotvector.java        |    8 +-
 .../classes/jogamp/opengl/glu/nurbs/Mapdesc.java   |   35 +-
 .../classes/jogamp/opengl/glu/nurbs/Maplist.java   |   19 +-
 .../jogamp/opengl/glu/nurbs/O_nurbscurve.java      |    2 +-
 .../jogamp/opengl/glu/nurbs/O_nurbssurface.java    |    4 +-
 .../classes/jogamp/opengl/glu/nurbs/Patch.java     |    2 +-
 .../classes/jogamp/opengl/glu/nurbs/Patchlist.java |    7 +-
 .../classes/jogamp/opengl/glu/nurbs/Property.java  |    2 +-
 .../classes/jogamp/opengl/glu/nurbs/PwlArc.java    |    6 +-
 .../classes/jogamp/opengl/glu/nurbs/Quilt.java     |   36 +-
 .../jogamp/opengl/glu/nurbs/Renderhints.java       |    2 +-
 .../jogamp/opengl/glu/nurbs/Splinespec.java        |   22 +-
 .../jogamp/opengl/glu/nurbs/Subdivider.java        |  205 +-
 .../jogamp/opengl/glu/registry/Registry.java       |    4 +-
 .../jogamp/opengl/glu/tessellator/Dict.java        |   26 +-
 .../jogamp/opengl/glu/tessellator/GLUhalfEdge.java |    2 +-
 .../opengl/glu/tessellator/GLUtessellatorImpl.java |   51 +-
 .../jogamp/opengl/glu/tessellator/Geom.java        |   46 +-
 .../jogamp/opengl/glu/tessellator/Mesh.java        |   96 +-
 .../jogamp/opengl/glu/tessellator/Normal.java      |   25 +-
 .../jogamp/opengl/glu/tessellator/PriorityQ.java   |    4 +-
 .../opengl/glu/tessellator/PriorityQHeap.java      |   44 +-
 .../opengl/glu/tessellator/PriorityQSort.java      |   29 +-
 .../jogamp/opengl/glu/tessellator/Render.java      |   48 +-
 .../jogamp/opengl/glu/tessellator/Sweep.java       |  159 +-
 .../jogamp/opengl/glu/tessellator/TessMono.java    |   14 +-
 .../jogamp/opengl/macosx/cgl/MacOSXCGLContext.java |  162 +-
 .../opengl/macosx/cgl/MacOSXCGLDrawable.java       |   12 +-
 .../macosx/cgl/MacOSXCGLDrawableFactory.java       |   74 +-
 .../cgl/MacOSXCGLDynamicLibraryBundleInfo.java     |    2 +-
 .../macosx/cgl/MacOSXCGLGraphicsConfiguration.java |   26 +-
 .../cgl/MacOSXCGLGraphicsConfigurationFactory.java |   12 +-
 .../macosx/cgl/MacOSXExternalCGLContext.java       |   26 +-
 .../macosx/cgl/MacOSXOffscreenCGLDrawable.java     |    6 +-
 .../macosx/cgl/MacOSXOnscreenCGLDrawable.java      |    4 +-
 .../macosx/cgl/MacOSXPbufferCGLDrawable.java       |   45 +-
 .../MacOSXAWTCGLGraphicsConfigurationFactory.java  |   14 +-
 .../jogamp/opengl/openal/av/ALAudioSink.java       |  191 +-
 .../jogamp/opengl/openal/av/ALDummyUsage.java      |    6 +-
 .../opengl/util/GLArrayHandlerInterleaved.java     |   10 +-
 .../jogamp/opengl/util/GLDataArrayHandler.java     |    8 +-
 .../jogamp/opengl/util/GLFixedArrayHandler.java    |    8 +-
 .../opengl/util/GLFixedArrayHandlerFlat.java       |    8 +-
 .../jogamp/opengl/util/GLVBOArrayHandler.java      |    4 +-
 .../jogamp/opengl/util/av/AudioSampleFormat.java   |   64 +
 .../jogamp/opengl/util/av/EGLMediaPlayerImpl.java  |   16 +-
 .../jogamp/opengl/util/av/GLMediaPlayerImpl.java   |  331 +-
 .../jogamp/opengl/util/av/JavaSoundAudioSink.java  |   43 +-
 .../jogamp/opengl/util/av/NullAudioSink.java       |   84 +-
 .../jogamp/opengl/util/av/NullGLMediaPlayer.java   |   32 +-
 .../jogamp/opengl/util/av/VideoPixelFormat.java    |  191 +
 .../av/impl/FFMPEGDynamicLibraryBundleInfo.java    |   25 +-
 .../opengl/util/av/impl/FFMPEGMediaPlayer.java     |  134 +-
 .../jogamp/opengl/util/av/impl/FFMPEGNatives.java  |  201 +-
 .../opengl/util/av/impl/FFMPEGStaticNatives.java   |    2 +-
 .../opengl/util/av/impl/OMXGLMediaPlayer.java      |   32 +-
 .../jogamp/opengl/util/glsl/GLSLArrayHandler.java  |   24 +-
 .../opengl/util/glsl/GLSLArrayHandlerFlat.java     |    8 +-
 .../util/glsl/GLSLArrayHandlerInterleaved.java     |   10 +-
 .../jogamp/opengl/util/glsl/GLSLTextureRaster.java |   19 +-
 .../opengl/util/glsl/fixedfunc/FixedFuncHook.java  |  173 +-
 .../util/glsl/fixedfunc/FixedFuncPipeline.java     |  145 +-
 .../jogamp/opengl/util/jpeg/JPEGDecoder.java       |  131 +-
 .../jogamp/opengl/util/pngj/FilterType.java        |    6 +-
 .../opengl/util/pngj/FilterWriteStrategy.java      |   16 +-
 .../classes/jogamp/opengl/util/pngj/ImageInfo.java |    8 +-
 .../classes/jogamp/opengl/util/pngj/ImageLine.java |   18 +-
 .../jogamp/opengl/util/pngj/ImageLineHelper.java   |   94 +-
 .../jogamp/opengl/util/pngj/ImageLines.java        |   14 +-
 .../jogamp/opengl/util/pngj/PngDeinterlacer.java   |   28 +-
 .../jogamp/opengl/util/pngj/PngHelperInternal.java |  114 +-
 .../opengl/util/pngj/PngIDatChunkInputStream.java  |   22 +-
 .../opengl/util/pngj/PngIDatChunkOutputStream.java |    8 +-
 .../classes/jogamp/opengl/util/pngj/PngReader.java |  114 +-
 .../classes/jogamp/opengl/util/pngj/PngWriter.java |  102 +-
 .../opengl/util/pngj/PngjBadCrcException.java      |    6 +-
 .../jogamp/opengl/util/pngj/PngjException.java     |    6 +-
 .../opengl/util/pngj/PngjExceptionInternal.java    |    6 +-
 .../opengl/util/pngj/PngjInputException.java       |    6 +-
 .../opengl/util/pngj/PngjOutputException.java      |    6 +-
 .../opengl/util/pngj/PngjUnsupportedException.java |    6 +-
 .../opengl/util/pngj/ProgressiveOutputStream.java  |   12 +-
 .../opengl/util/pngj/chunks/ChunkHelper.java       |   64 +-
 .../jogamp/opengl/util/pngj/chunks/ChunkRaw.java   |   10 +-
 .../jogamp/opengl/util/pngj/chunks/ChunksList.java |   20 +-
 .../util/pngj/chunks/ChunksListForWrite.java       |   24 +-
 .../jogamp/opengl/util/pngj/chunks/PngChunk.java   |   36 +-
 .../opengl/util/pngj/chunks/PngChunkBKGD.java      |   16 +-
 .../opengl/util/pngj/chunks/PngChunkCHRM.java      |   12 +-
 .../opengl/util/pngj/chunks/PngChunkGAMA.java      |   16 +-
 .../opengl/util/pngj/chunks/PngChunkHIST.java      |   12 +-
 .../opengl/util/pngj/chunks/PngChunkICCP.java      |   20 +-
 .../opengl/util/pngj/chunks/PngChunkIDAT.java      |    6 +-
 .../opengl/util/pngj/chunks/PngChunkIEND.java      |    8 +-
 .../opengl/util/pngj/chunks/PngChunkIHDR.java      |   26 +-
 .../opengl/util/pngj/chunks/PngChunkITXT.java      |   26 +-
 .../opengl/util/pngj/chunks/PngChunkMultiple.java  |    2 +-
 .../opengl/util/pngj/chunks/PngChunkOFFS.java      |   16 +-
 .../opengl/util/pngj/chunks/PngChunkPHYS.java      |   24 +-
 .../opengl/util/pngj/chunks/PngChunkPLTE.java      |   28 +-
 .../opengl/util/pngj/chunks/PngChunkSBIT.java      |   14 +-
 .../opengl/util/pngj/chunks/PngChunkSPLT.java      |   26 +-
 .../opengl/util/pngj/chunks/PngChunkSRGB.java      |   10 +-
 .../opengl/util/pngj/chunks/PngChunkSTER.java      |   14 +-
 .../opengl/util/pngj/chunks/PngChunkSingle.java    |    6 +-
 .../opengl/util/pngj/chunks/PngChunkSkipped.java   |    6 +-
 .../opengl/util/pngj/chunks/PngChunkTEXT.java      |   12 +-
 .../opengl/util/pngj/chunks/PngChunkTIME.java      |   16 +-
 .../opengl/util/pngj/chunks/PngChunkTRNS.java      |   20 +-
 .../opengl/util/pngj/chunks/PngChunkTextVar.java   |    4 +-
 .../opengl/util/pngj/chunks/PngChunkUNKNOWN.java   |   14 +-
 .../opengl/util/pngj/chunks/PngChunkZTXT.java      |   22 +-
 .../opengl/util/pngj/chunks/PngMetadata.java       |   45 +-
 .../jogamp/opengl/util/stereo/DistortionMesh.java  |   95 +
 .../opengl/util/stereo/GenericStereoDevice.java    |  468 +++
 .../util/stereo/GenericStereoDeviceFactory.java    |   43 +
 .../util/stereo/GenericStereoDeviceRenderer.java   |  605 +++
 .../opengl/util/stereo/ScaleAndOffset2D.java       |  107 +
 .../opengl/util/stereo/shader/dist01_chroma.fp     |   26 +
 .../opengl/util/stereo/shader/dist01_chroma.vp     |   33 +
 .../opengl/util/stereo/shader/dist01_plain.fp      |   22 +
 .../opengl/util/stereo/shader/dist01_plain.vp      |   27 +
 .../opengl/util/stereo/shader/dist01_timewarp.vp   |   44 +
 .../util/stereo/shader/dist01_timewarp_chroma.vp   |   65 +
 .../opengl/windows/wgl/WGLGLCapabilities.java      |   10 +-
 .../classes/jogamp/opengl/windows/wgl/WGLUtil.java |   14 +-
 .../windows/wgl/WindowsBitmapWGLDrawable.java      |   14 +-
 .../windows/wgl/WindowsExternalWGLContext.java     |   16 +-
 .../windows/wgl/WindowsExternalWGLDrawable.java    |   17 +-
 .../windows/wgl/WindowsOnscreenWGLDrawable.java    |    4 +-
 .../windows/wgl/WindowsPbufferWGLDrawable.java     |   32 +-
 .../opengl/windows/wgl/WindowsWGLContext.java      |   99 +-
 .../opengl/windows/wgl/WindowsWGLDrawable.java     |   12 +-
 .../windows/wgl/WindowsWGLDrawableFactory.java     |  355 +-
 .../wgl/WindowsWGLDynamicLibraryBundleInfo.java    |    4 +-
 .../wgl/WindowsWGLGraphicsConfiguration.java       |  116 +-
 .../WindowsWGLGraphicsConfigurationFactory.java    |   62 +-
 .../WindowsAWTWGLGraphicsConfigurationFactory.java |   30 +-
 .../classes/jogamp/opengl/x11/glx/GLXUtil.java     |   38 +-
 .../opengl/x11/glx/X11ExternalGLXContext.java      |   26 +-
 .../opengl/x11/glx/X11ExternalGLXDrawable.java     |   24 +-
 .../jogamp/opengl/x11/glx/X11GLCapabilities.java   |    8 +-
 .../jogamp/opengl/x11/glx/X11GLXContext.java       |  123 +-
 .../jogamp/opengl/x11/glx/X11GLXDrawable.java      |    6 +-
 .../opengl/x11/glx/X11GLXDrawableFactory.java      |  219 +-
 .../x11/glx/X11GLXDynamicLibraryBundleInfo.java    |    4 +-
 .../x11/glx/X11GLXGraphicsConfiguration.java       |   60 +-
 .../glx/X11GLXGraphicsConfigurationFactory.java    |   78 +-
 .../opengl/x11/glx/X11OnscreenGLXDrawable.java     |    8 +-
 .../opengl/x11/glx/X11PbufferGLXDrawable.java      |   14 +-
 .../opengl/x11/glx/X11PixmapGLXDrawable.java       |   28 +-
 src/jogl/native/libav/ffmpeg_impl_template.c       |    6 +-
 ...vr01.c => ffmpeg_lavc55_lavf55_lavu53_lavr01.c} |    0
 .../macosx/MacOSXWindowSystemInterface-calayer.m   |   95 +-
 .../DelegatedUpstreamSurfaceHookMutableSize.java   |    8 +-
 ...elegatedUpstreamSurfaceHookWithSurfaceSize.java |   29 +-
 .../nativewindow/MutableGraphicsConfiguration.java |    8 +-
 .../jogamp/nativewindow/NativeWindowVersion.java   |    4 +-
 .../UpstreamSurfaceHookMutableSize.java            |   40 +-
 .../UpstreamSurfaceHookMutableSizePos.java         |   36 -
 .../UpstreamWindowHookMutableSizePos.java          |   56 +
 .../nativewindow/awt/AWTGraphicsConfiguration.java |   28 +-
 .../jogamp/nativewindow/awt/AWTGraphicsDevice.java |    6 +-
 .../jogamp/nativewindow/awt/AWTGraphicsScreen.java |   18 +-
 .../jogamp/nativewindow/awt/AWTPrintLifecycle.java |   10 +-
 .../nativewindow/awt/AWTWindowClosingProtocol.java |    6 +-
 .../jogamp/nativewindow/awt/AppContextInfo.java    |  199 +
 .../nativewindow/awt/DirectDataBufferInt.java      |   26 +-
 .../com/jogamp/nativewindow/awt/JAWTWindow.java    |  194 +-
 .../jogamp/nativewindow/egl/EGLGraphicsDevice.java |    4 +-
 .../nativewindow/macosx/MacOSXGraphicsDevice.java  |    2 +-
 .../com/jogamp/nativewindow/swt/SWTAccessor.java   |   78 +-
 .../windows/WindowsGraphicsDevice.java             |    4 +-
 .../nativewindow/x11/X11GraphicsConfiguration.java |    8 +-
 .../jogamp/nativewindow/x11/X11GraphicsDevice.java |   12 +-
 .../jogamp/nativewindow/x11/X11GraphicsScreen.java |    4 +-
 .../javax/media/nativewindow/Capabilities.java     |   40 +-
 .../nativewindow/DefaultCapabilitiesChooser.java   |   10 +-
 .../nativewindow/DefaultGraphicsConfiguration.java |   19 +-
 .../media/nativewindow/DefaultGraphicsDevice.java  |   19 +-
 .../media/nativewindow/DefaultGraphicsScreen.java  |    6 +-
 .../nativewindow/GraphicsConfigurationFactory.java |   40 +-
 .../javax/media/nativewindow/NativeSurface.java    |   62 +-
 .../media/nativewindow/NativeSurfaceHolder.java    |   41 +
 .../javax/media/nativewindow/NativeWindow.java     |  119 +-
 .../media/nativewindow/NativeWindowException.java  |    6 +-
 .../media/nativewindow/NativeWindowFactory.java    |   72 +-
 .../javax/media/nativewindow/ProxySurface.java     |    8 +-
 .../javax/media/nativewindow/ScalableSurface.java  |   97 +
 .../media/nativewindow/UpstreamSurfaceHook.java    |   24 +-
 .../javax/media/nativewindow/VisualIDHolder.java   |    8 +-
 .../javax/media/nativewindow/util/Dimension.java   |   24 +-
 .../javax/media/nativewindow/util/Insets.java      |   57 +-
 .../media/nativewindow/util/InsetsImmutable.java   |   17 +-
 .../javax/media/nativewindow/util/PixelFormat.java |    2 +-
 .../media/nativewindow/util/PixelFormatUtil.java   |   18 +-
 .../javax/media/nativewindow/util/Point.java       |   54 +-
 .../javax/media/nativewindow/util/Rectangle.java   |   66 +-
 .../javax/media/nativewindow/util/SurfaceSize.java |   11 +-
 .../classes/jogamp/nativewindow/Debug.java         |   58 +-
 .../DefaultGraphicsConfigurationFactoryImpl.java   |    2 +-
 .../jogamp/nativewindow/NWJNILibLoader.java        |    2 +-
 .../nativewindow/NativeWindowFactoryImpl.java      |   10 +-
 .../jogamp/nativewindow/ProxySurfaceImpl.java      |   39 +-
 .../nativewindow/SharedResourceToolkitLock.java    |   22 +-
 .../jogamp/nativewindow/SurfaceScaleUtils.java     |  172 +
 .../jogamp/nativewindow/SurfaceUpdatedHelper.java  |   10 +-
 .../jogamp/nativewindow/WrappedSurface.java        |   85 +-
 .../classes/jogamp/nativewindow/WrappedWindow.java |   46 +-
 .../classes/jogamp/nativewindow/awt/AWTMisc.java   |   20 +-
 .../jogamp/nativewindow/jawt/JAWTJNILibLoader.java |    2 +-
 .../classes/jogamp/nativewindow/jawt/JAWTUtil.java |  141 +-
 .../nativewindow/jawt/macosx/MacOSXJAWTWindow.java |  164 +-
 .../jawt/windows/Win32SunJDKReflection.java        |   16 +-
 .../jawt/windows/WindowsJAWTWindow.java            |   11 +-
 .../nativewindow/jawt/x11/X11JAWTWindow.java       |   11 +-
 .../nativewindow/jawt/x11/X11SunJDKReflection.java |   14 +-
 .../macosx/OSXDummyUpstreamSurfaceHook.java        |   12 +-
 .../jogamp/nativewindow/macosx/OSXUtil.java        |  149 +-
 .../windows/GDIDummyUpstreamSurfaceHook.java       |   10 +-
 .../jogamp/nativewindow/windows/GDISurface.java    |   21 +-
 .../jogamp/nativewindow/windows/GDIUtil.java       |   18 +-
 .../nativewindow/windows/RegisteredClass.java      |    2 +-
 .../windows/RegisteredClassFactory.java            |    4 +-
 .../jogamp/nativewindow/x11/X11Capabilities.java   |    6 +-
 .../x11/X11DummyUpstreamSurfaceHook.java           |   10 +-
 .../x11/X11GraphicsConfigurationFactory.java       |   28 +-
 .../classes/jogamp/nativewindow/x11/X11Util.java   |   46 +-
 .../awt/X11AWTGraphicsConfigurationFactory.java    |   10 +-
 src/nativewindow/native/macosx/OSXmisc.m           |  216 +-
 src/nativewindow/native/win32/GDImisc.c            |  104 +
 src/newt/classes/com/jogamp/newt/Display.java      |   22 +-
 .../classes/com/jogamp/newt/MonitorDevice.java     |  134 +-
 src/newt/classes/com/jogamp/newt/MonitorMode.java  |   34 +-
 src/newt/classes/com/jogamp/newt/NewtFactory.java  |   89 +-
 src/newt/classes/com/jogamp/newt/NewtVersion.java  |    4 +-
 src/newt/classes/com/jogamp/newt/Screen.java       |   72 +-
 src/newt/classes/com/jogamp/newt/Window.java       |  161 +-
 .../classes/com/jogamp/newt/awt/NewtCanvasAWT.java |  149 +-
 .../jogamp/newt/awt/applet/JOGLNewtApplet1Run.java |   14 +-
 .../jogamp/newt/event/DoubleTapScrollGesture.java  |   18 +-
 .../com/jogamp/newt/event/GestureHandler.java      |   16 +-
 .../classes/com/jogamp/newt/event/InputEvent.java  |   26 +-
 .../classes/com/jogamp/newt/event/KeyAdapter.java  |    4 +-
 .../classes/com/jogamp/newt/event/KeyEvent.java    |   14 +-
 .../com/jogamp/newt/event/MonitorEvent.java        |    4 +-
 .../com/jogamp/newt/event/MouseAdapter.java        |   16 +-
 .../classes/com/jogamp/newt/event/MouseEvent.java  |  101 +-
 .../com/jogamp/newt/event/MouseListener.java       |   34 +-
 .../classes/com/jogamp/newt/event/NEWTEvent.java   |   10 +-
 .../com/jogamp/newt/event/NEWTEventFiFo.java       |    4 +-
 .../classes/com/jogamp/newt/event/OutputEvent.java |    2 +-
 .../com/jogamp/newt/event/PinchToZoomGesture.java  |   54 +-
 .../com/jogamp/newt/event/TraceKeyAdapter.java     |    6 +-
 .../com/jogamp/newt/event/TraceMouseAdapter.java   |   18 +-
 .../com/jogamp/newt/event/TraceWindowAdapter.java  |   16 +-
 .../com/jogamp/newt/event/WindowAdapter.java       |   14 +-
 .../classes/com/jogamp/newt/event/WindowEvent.java |    4 +-
 .../com/jogamp/newt/event/WindowUpdateEvent.java   |    2 +-
 .../com/jogamp/newt/event/awt/AWTAdapter.java      |  109 +-
 .../com/jogamp/newt/event/awt/AWTKeyAdapter.java   |   32 +-
 .../com/jogamp/newt/event/awt/AWTMouseAdapter.java |   78 +-
 .../jogamp/newt/event/awt/AWTWindowAdapter.java    |  114 +-
 .../classes/com/jogamp/newt/opengl/GLWindow.java   |  233 +-
 .../classes/com/jogamp/newt/swt/NewtCanvasSWT.java |  153 +-
 src/newt/classes/com/jogamp/newt/util/EDTUtil.java |    4 +-
 .../classes/com/jogamp/newt/util/MainThread.java   |   41 +-
 .../com/jogamp/newt/util/MonitorModeUtil.java      |   28 +-
 .../newt/util/applet/JOGLNewtApplet3Run.java       |   29 +-
 .../newt/util/applet/JOGLNewtAppletBase.java       |   63 +-
 .../jogamp/newt/util/applet/VersionApplet3.java    |   32 +-
 src/newt/classes/jogamp/newt/Debug.java            |   58 +-
 src/newt/classes/jogamp/newt/DefaultEDTUtil.java   |   34 +-
 src/newt/classes/jogamp/newt/DisplayImpl.java      |   46 +-
 .../classes/jogamp/newt/MonitorDeviceImpl.java     |   15 +-
 src/newt/classes/jogamp/newt/MonitorModeProps.java |  139 +-
 src/newt/classes/jogamp/newt/NEWTJNILibLoader.java |    4 +-
 src/newt/classes/jogamp/newt/OffscreenWindow.java  |   18 +-
 src/newt/classes/jogamp/newt/PointerIconImpl.java  |    8 +-
 src/newt/classes/jogamp/newt/ScreenImpl.java       |  143 +-
 .../classes/jogamp/newt/ScreenMonitorState.java    |   32 +-
 src/newt/classes/jogamp/newt/WindowImpl.java       |  803 ++--
 .../classes/jogamp/newt/awt/NewtFactoryAWT.java    |   10 +-
 .../jogamp/newt/awt/event/AWTNewtEventFactory.java |   60 +-
 .../newt/awt/event/AWTParentWindowAdapter.java     |   22 +-
 src/newt/classes/jogamp/newt/driver/PNGIcon.java   |    2 +-
 .../jogamp/newt/driver/android/DisplayDriver.java  |    2 +-
 .../classes/jogamp/newt/driver/android/MD.java     |   36 +-
 .../newt/driver/android/NewtBaseActivity.java      |  136 +-
 .../newt/driver/android/NewtVersionActivity.java   |   32 +-
 .../android/NewtVersionActivityLauncher.java       |    2 +-
 .../jogamp/newt/driver/android/ScreenDriver.java   |   32 +-
 .../jogamp/newt/driver/android/WindowDriver.java   |   94 +-
 .../android/event/AndroidNewtEventFactory.java     |  186 +-
 .../android/event/AndroidNewtEventTranslator.java  |   30 +-
 .../classes/jogamp/newt/driver/awt/AWTCanvas.java  |   47 +-
 .../classes/jogamp/newt/driver/awt/AWTEDTUtil.java |   35 +-
 .../jogamp/newt/driver/awt/DisplayDriver.java      |    4 +-
 .../jogamp/newt/driver/awt/ScreenDriver.java       |   28 +-
 .../jogamp/newt/driver/awt/WindowDriver.java       |   50 +-
 .../jogamp/newt/driver/bcm/egl/DisplayDriver.java  |    2 +-
 .../jogamp/newt/driver/bcm/egl/ScreenDriver.java   |   20 +-
 .../jogamp/newt/driver/bcm/egl/WindowDriver.java   |   21 +-
 .../newt/driver/bcm/vc/iv/DisplayDriver.java       |   10 +-
 .../jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java |   26 +-
 .../jogamp/newt/driver/bcm/vc/iv/WindowDriver.java |   14 +-
 .../newt/driver/intel/gdl/DisplayDriver.java       |    4 +-
 .../jogamp/newt/driver/intel/gdl/ScreenDriver.java |   24 +-
 .../jogamp/newt/driver/intel/gdl/WindowDriver.java |   16 +-
 .../jogamp/newt/driver/kd/DisplayDriver.java       |    2 +-
 .../jogamp/newt/driver/kd/ScreenDriver.java        |   26 +-
 .../jogamp/newt/driver/kd/WindowDriver.java        |   18 +-
 .../newt/driver/linux/LinuxEventDeviceTracker.java |   58 +-
 .../newt/driver/linux/LinuxMouseTracker.java       |   46 +-
 .../jogamp/newt/driver/macosx/DisplayDriver.java   |    8 +-
 .../jogamp/newt/driver/macosx/MacKeyUtil.java      |    2 +-
 .../jogamp/newt/driver/macosx/ScreenDriver.java    |  148 +-
 .../jogamp/newt/driver/macosx/WindowDriver.java    |  350 +-
 .../jogamp/newt/driver/opengl/JoglUtilPNGIcon.java |    2 +-
 .../jogamp/newt/driver/windows/DisplayDriver.java  |   12 +-
 .../jogamp/newt/driver/windows/ScreenDriver.java   |   26 +-
 .../jogamp/newt/driver/windows/WindowDriver.java   |   42 +-
 .../jogamp/newt/driver/x11/DisplayDriver.java      |   16 +-
 .../classes/jogamp/newt/driver/x11/RandR11.java    |   41 +-
 .../classes/jogamp/newt/driver/x11/RandR13.java    |   14 +-
 .../jogamp/newt/driver/x11/ScreenDriver.java       |   49 +-
 .../jogamp/newt/driver/x11/WindowDriver.java       |   60 +-
 .../classes/jogamp/newt/event/NEWTEventTask.java   |    8 +-
 src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java   |   50 +-
 .../jogamp/newt/swt/event/SWTNewtEventFactory.java |  103 +-
 src/newt/native/MacWindow.m                        |  187 +-
 src/newt/native/NewtMacWindow.h                    |    5 +
 src/newt/native/NewtMacWindow.m                    |  114 +-
 src/newt/native/ScreenMode.h                       |    3 +-
 src/newt/native/WindowsWindow.c                    |   12 +-
 src/newt/native/X11RandR13.c                       |   12 +-
 .../oculusvr/OVRDynamicLibraryBundleInfo.java      |  113 +
 .../classes/com/jogamp/oculusvr/OVRException.java  |   57 +
 .../classes/com/jogamp/oculusvr/OVRVersion.java    |  155 +
 .../jogamp/opengl/oculusvr/OVRStereoDevice.java    |  219 +
 .../opengl/oculusvr/OVRStereoDeviceFactory.java    |   62 +
 .../opengl/oculusvr/OVRStereoDeviceRenderer.java   |  604 +++
 .../classes/jogamp/opengl/oculusvr/OVRUtil.java    |  173 +
 .../jogamp/opengl/oculusvr/shader/dist01_chroma.fp |   26 +
 .../jogamp/opengl/oculusvr/shader/dist01_chroma.vp |   33 +
 .../jogamp/opengl/oculusvr/shader/dist01_plain.fp  |   22 +
 .../jogamp/opengl/oculusvr/shader/dist01_plain.vp  |   27 +
 .../opengl/oculusvr/shader/dist01_timewarp.vp      |   44 +
 .../oculusvr/shader/dist01_timewarp_chroma.vp      |   65 +
 src/oculusvr/native/OVRImplMisc.cpp                |   30 +
 .../jogamp/opengl/test/android/LauncherUtil.java   |  188 +-
 .../opengl/test/android/MovieCubeActivity0.java    |  167 -
 .../opengl/test/android/MovieCubeActivity0a.java   |  167 +
 .../opengl/test/android/MovieCubeActivity0b.java   |  169 +
 .../test/android/MovieCubeActivityLauncher0.java   |   88 -
 .../test/android/MovieCubeActivityLauncher0a.java  |   86 +
 .../test/android/MovieCubeActivityLauncher0b.java  |   86 +
 .../test/android/MovieCubeActivityLauncher1a.java  |    9 +-
 .../test/android/MovieCubeActivityLauncher1b.java  |    9 +-
 .../opengl/test/android/MovieSimpleActivity0.java  |   60 +-
 .../opengl/test/android/MovieSimpleActivity1.java  |  129 +-
 .../android/MovieSimpleActivityLauncher00b.java    |   11 +-
 .../android/MovieSimpleActivityLauncher00c.java    |   11 +-
 .../android/MovieSimpleActivityLauncher01a.java    |    8 +-
 .../android/MovieSimpleActivityLauncher01b.java    |    8 +-
 .../android/MovieSimpleActivityLauncher02.java     |    8 +-
 .../opengl/test/android/NEWTElektronActivity.java  |   32 +-
 .../test/android/NEWTElektronActivityLauncher.java |   14 +-
 .../opengl/test/android/NEWTGearsES1Activity.java  |   32 +-
 .../test/android/NEWTGearsES1ActivityLauncher.java |   14 +-
 .../opengl/test/android/NEWTGearsES2Activity.java  |   20 +-
 .../test/android/NEWTGearsES2ActivityLauncher.java |   24 +-
 .../android/NEWTGearsES2ECTActivityLauncher.java   |   26 +-
 .../NEWTGearsES2RGB565ActivityLauncher.java        |   24 +-
 .../test/android/NEWTGearsES2TransActivity.java    |   40 +-
 .../android/NEWTGearsES2TransActivityLauncher.java |   20 +-
 .../opengl/test/android/NEWTGraphUI1pActivity.java |   32 +-
 .../android/NEWTGraphUI1pActivityLauncher.java     |   16 +-
 .../opengl/test/android/NEWTGraphUI2pActivity.java |   34 +-
 .../android/NEWTGraphUI2pActivityLauncher.java     |   16 +-
 .../test/android/NEWTRedSquareES1Activity.java     |   32 +-
 .../android/NEWTRedSquareES1ActivityLauncher.java  |   16 +-
 .../test/android/NEWTRedSquareES2Activity.java     |   42 +-
 .../android/NEWTRedSquareES2ActivityLauncher.java  |   10 +-
 .../opengl/test/bugs/Bug427GLJPanelTest1.java      |   33 +-
 .../opengl/test/bugs/Bug735Inv0AppletAWT.java      |  260 +-
 .../opengl/test/bugs/Bug735Inv1AppletAWT.java      |  264 +-
 .../opengl/test/bugs/Bug735Inv2AppletAWT.java      |  142 +-
 .../opengl/test/bugs/Bug735Inv3AppletAWT.java      |  102 +-
 .../com/jogamp/opengl/test/bugs/Bug735Inv4AWT.java |   90 +-
 .../DemoBug910ExtendedAWTAppletLifecycleCheck.java |   57 +-
 .../com/jogamp/opengl/test/bugs/Issue326Test1.java |   48 +-
 .../com/jogamp/opengl/test/bugs/Issue326Test2.java |   39 +-
 .../com/jogamp/opengl/test/bugs/Issue344Base.java  |   47 +-
 .../com/jogamp/opengl/test/bugs/Issue344Test1.java |    4 +-
 .../com/jogamp/opengl/test/bugs/Issue344Test2.java |    2 +-
 .../com/jogamp/opengl/test/bugs/Issue344Test3.java |    2 +-
 .../com/jogamp/opengl/test/bugs/Issue344Test4.java |    2 +-
 .../test/junit/graph/TestRegionRendererNEWT01.java |  246 +-
 .../test/junit/graph/TestTextRendererNEWT00.java   |  433 +-
 .../test/junit/graph/TestTextRendererNEWT01.java   |  152 +-
 .../test/junit/graph/TestTextRendererNEWT10.java   |  129 +-
 .../test/junit/graph/TextRendererGLELBase.java     |  248 +-
 .../junit/graph/demos/GPURegionGLListener01.java   |   77 +-
 .../junit/graph/demos/GPURegionGLListener02.java   |  132 +-
 .../test/junit/graph/demos/GPURegionNewtDemo.java  |  156 +
 .../junit/graph/demos/GPURegionNewtDemo01.java     |   98 -
 .../junit/graph/demos/GPURegionNewtDemo02.java     |   93 -
 .../demos/GPURegionRendererListenerBase01.java     |   52 -
 .../graph/demos/GPURendererListenerBase01.java     |  224 +-
 .../junit/graph/demos/GPUTextGLListener0A.java     |   45 +-
 .../test/junit/graph/demos/GPUTextNewtDemo.java    |  153 +
 .../test/junit/graph/demos/GPUTextNewtDemo01.java  |   90 -
 .../test/junit/graph/demos/GPUTextNewtDemo02.java  |   99 -
 .../graph/demos/GPUTextRendererListenerBase01.java |  356 +-
 .../junit/graph/demos/GPUUISceneGLListener02.java  |    9 +
 .../junit/graph/demos/GPUUISceneGLListener04.java  |    7 +
 .../junit/graph/demos/GPUUISceneGLListener0A.java  | 1182 ++++--
 .../graph/demos/GPUUISceneNewtCanvasAWTDemo.java   |  189 +
 .../test/junit/graph/demos/GPUUISceneNewtDemo.java |  154 +
 .../junit/graph/demos/GPUUISceneNewtDemo01.java    |   48 -
 .../junit/graph/demos/GPUUISceneNewtDemo02.java    |   49 -
 .../opengl/test/junit/graph/demos/MSAATool.java    |   65 +-
 .../junit/graph/demos/button-pressed-145x53.png    |  Bin 0 -> 8603 bytes
 .../junit/graph/demos/button-released-145x53.png   |  Bin 0 -> 9429 bytes
 .../test/junit/graph/demos/ui/CrossHair.java       |  110 +
 .../graph/demos/ui/GLEventListenerButton.java      |  132 +
 .../test/junit/graph/demos/ui/ImageSeqButton.java  |   63 +
 .../opengl/test/junit/graph/demos/ui/Label.java    |   86 +-
 .../opengl/test/junit/graph/demos/ui/Label0.java   |  105 +
 .../test/junit/graph/demos/ui/LabelButton.java     |  174 +
 .../junit/graph/demos/ui/MediaPlayerButton.java    |  131 +
 .../opengl/test/junit/graph/demos/ui/RIButton.java |  271 --
 .../test/junit/graph/demos/ui/RoundButton.java     |  135 +
 .../junit/graph/demos/ui/SceneUIController.java    |  618 ++-
 .../junit/graph/demos/ui/TextureSeqButton.java     |   79 +
 .../test/junit/graph/demos/ui/UIGLListener01.java  |   99 +-
 .../junit/graph/demos/ui/UIListenerBase01.java     |  181 +-
 .../test/junit/graph/demos/ui/UINewtDemo01.java    |   38 +-
 .../opengl/test/junit/graph/demos/ui/UIShape.java  |  573 ++-
 .../test/junit/graph/demos/ui/UITextShape.java     |   37 -
 .../test/junit/graph/demos/ui/opengl/UIRegion.java |   77 -
 .../test/junit/jogl/acore/GLReadBuffer00Base.java  |   32 +-
 .../junit/jogl/acore/InitConcurrentBaseNEWT.java   |  103 +-
 .../jogl/acore/TestAWTCloseX11DisplayBug565.java   |   20 +-
 .../acore/TestAddRemove01GLCanvasSwingAWT.java     |   97 +-
 .../TestAddRemove02GLWindowNewtCanvasAWT.java      |   91 +-
 .../jogl/acore/TestAddRemove03GLWindowNEWT.java    |   40 +-
 .../acore/TestBug669RecursiveGLContext01NEWT.java  |   50 +-
 .../acore/TestBug669RecursiveGLContext02NEWT.java  |   38 +-
 .../junit/jogl/acore/TestBug692GL3VAONEWT.java     |  124 +-
 .../junit/jogl/acore/TestCPUSourcingAPINEWT.java   |   39 +-
 .../jogl/acore/TestFBOAutoDrawableDeadlockAWT.java |   10 +-
 .../jogl/acore/TestFBOAutoDrawableFactoryNEWT.java |  178 +-
 .../test/junit/jogl/acore/TestFBOMRTNEWT01.java    |  103 +-
 .../junit/jogl/acore/TestFBOMix2DemosES2NEWT.java  |  102 +-
 ...tFBOOffThreadSharedContextMix2DemosES2NEWT.java |   58 +-
 .../TestFBOOnThreadSharedContext1DemoES2NEWT.java  |   50 +-
 .../jogl/acore/TestGLAutoDrawableDelegateNEWT.java |   17 +-
 ...estGLAutoDrawableDelegateOnOffscrnCapsNEWT.java |  127 +-
 ...estGLAutoDrawableFactoryES2OffscrnCapsNEWT.java |   16 +-
 ...estGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java |   16 +-
 ...TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java |   14 +-
 ...TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java |  111 +-
 ...estGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java |  133 +-
 ...LAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java |  123 +-
 .../jogl/acore/TestGLContextSurfaceLockNEWT.java   |  111 +-
 .../test/junit/jogl/acore/TestGLDebug00NEWT.java   |  171 +-
 .../test/junit/jogl/acore/TestGLDebug01NEWT.java   |  123 +-
 .../junit/jogl/acore/TestGLException01NEWT.java    |  412 ++
 .../jogl/acore/TestGLExtensionQueryOffscreen.java  |   36 +-
 .../junit/jogl/acore/TestGLMesaBug651NEWT.java     |   99 +-
 .../junit/jogl/acore/TestGLMesaBug658NEWT.java     |   42 +-
 .../test/junit/jogl/acore/TestGLPointsNEWT.java    |   64 +-
 .../test/junit/jogl/acore/TestGLProfile00NEWT.java |    8 +-
 .../test/junit/jogl/acore/TestGLProfile01NEWT.java |   39 +-
 .../jogl/acore/TestGLReadBuffer01GLCanvasAWT.java  |   32 +-
 .../jogl/acore/TestGLReadBuffer01GLJPanelAWT.java  |   32 +-
 .../jogl/acore/TestGLReadBuffer01GLWindowNEWT.java |   30 +-
 .../jogl/acore/TestGLVersionParsing00NEWT.java     |   42 +-
 .../test/junit/jogl/acore/TestGPUMemSec01NEWT.java |  206 +-
 .../junit/jogl/acore/TestInitConcurrent01NEWT.java |    6 +-
 .../junit/jogl/acore/TestInitConcurrent02NEWT.java |   26 +-
 .../jogl/acore/TestMainVersionGLCanvasAWT.java     |   16 +-
 .../jogl/acore/TestMainVersionGLWindowNEWT.java    |   16 +-
 .../junit/jogl/acore/TestMapBufferRead01NEWT.java  |   16 +-
 .../jogl/acore/TestNEWTCloseX11DisplayBug565.java  |   42 +-
 .../test/junit/jogl/acore/TestNVSwapGroupNEWT.java |   54 +-
 .../acore/TestOffscreenLayer01GLCanvasAWT.java     |   78 +-
 .../acore/TestOffscreenLayer02NewtCanvasAWT.java   |   72 +-
 .../junit/jogl/acore/TestPBufferDeadlockAWT.java   |   42 +-
 .../junit/jogl/acore/TestSharedContextListAWT.java |   16 +-
 .../jogl/acore/TestSharedContextListNEWT.java      |   22 +-
 .../jogl/acore/TestSharedContextListNEWT2.java     |   38 +-
 .../jogl/acore/TestSharedContextNewtAWTBug523.java |  220 +-
 .../jogl/acore/TestSharedContextVBOES1NEWT.java    |   24 +-
 .../jogl/acore/TestSharedContextVBOES2AWT3.java    |   34 +-
 .../jogl/acore/TestSharedContextVBOES2AWT3b.java   |   14 +-
 .../jogl/acore/TestSharedContextVBOES2NEWT0.java   |   27 +-
 .../jogl/acore/TestSharedContextVBOES2NEWT1.java   |   56 +-
 .../jogl/acore/TestSharedContextVBOES2NEWT2.java   |   38 +-
 .../jogl/acore/TestSharedContextVBOES2NEWT3.java   |   44 +-
 .../jogl/acore/TestSharedContextVBOES2SWT3.java    |   12 +-
 .../acore/TestSharedContextWithJTabbedPaneAWT.java |   55 +-
 .../junit/jogl/acore/TestShutdownCompleteAWT.java  |    8 +-
 .../junit/jogl/acore/TestShutdownCompleteNEWT.java |   14 +-
 .../junit/jogl/acore/TestVersionSemanticsNOUI.java |  114 +
 .../junit/jogl/acore/TestX11DefaultDisplay.java    |   44 +-
 .../jogl/acore/anim/Bug898AnimatorFromEDTAWT.java  |   20 +-
 .../TestAWTCardLayoutAnimatorStartStopBug532.java  |   13 +-
 .../jogl/acore/anim/TestAnimatorGLJPanel01AWT.java |   26 +-
 .../acore/anim/TestAnimatorGLWindow01NEWT.java     |   22 +-
 .../jogl/acore/ect/ExclusiveContextBase00.java     |  147 +-
 .../jogl/acore/ect/ExclusiveContextBase00AWT.java  |   70 +-
 .../jogl/acore/ect/ExclusiveContextBase00NEWT.java |   38 +-
 .../jogl/acore/ect/ExclusiveContextBase10.java     |   87 +-
 .../jogl/acore/ect/ExclusiveContextBase10AWT.java  |   70 +-
 .../jogl/acore/ect/ExclusiveContextBase10NEWT.java |   38 +-
 .../ect/TestExclusiveContext01VSyncAnimAWT.java    |   20 +-
 .../ect/TestExclusiveContext01VSyncAnimNEWT.java   |   16 +-
 .../ect/TestExclusiveContext02FPSAnimAWT.java      |   20 +-
 .../ect/TestExclusiveContext02FPSAnimNEWT.java     |   20 +-
 .../ect/TestExclusiveContext11VSyncAnimNEWT.java   |   16 +-
 .../ect/TestExclusiveContext12FPSAnimNEWT.java     |   20 +-
 .../acore/glels/GLContextDrawableSwitchBase.java   |  291 --
 .../acore/glels/GLContextDrawableSwitchBase0.java  |  264 ++
 .../acore/glels/GLContextDrawableSwitchBase1.java  |  291 ++
 .../TestBug722GLContextDrawableSwitchNewt2AWT.java |   60 +-
 .../glels/TestGLContextDrawableSwitch01NEWT.java   |  158 +-
 .../glels/TestGLContextDrawableSwitch02AWT.java    |  121 +-
 .../glels/TestGLContextDrawableSwitch02NEWT.java   |  100 +
 .../glels/TestGLContextDrawableSwitch10NEWT.java   |   98 +-
 .../TestGLContextDrawableSwitch11NewtAWT.java      |   50 +-
 .../glels/TestGLContextDrawableSwitch12AWT.java    |   54 +-
 .../TestGLContextDrawableSwitch13Newt2AWT.java     |  195 +
 .../TestGLContextDrawableSwitch21Newt2AWT.java     |  195 -
 .../jogl/awt/ManualHiDPIBufferedImage01AWT.java    |   71 +
 .../opengl/test/junit/jogl/awt/TestAWT01GLn.java   |   42 +-
 .../junit/jogl/awt/TestAWT02WindowClosing.java     |   28 +-
 .../jogl/awt/TestAWT03GLCanvasRecreate01.java      |   22 +-
 .../junit/jogl/awt/TestBug460GLCanvasNPEAWT.java   |   20 +-
 .../awt/TestBug461FBOSupersamplingSwingAWT.java    |   38 +-
 .../TestBug461PBufferSupersamplingSwingAWT.java    |   95 +-
 .../opengl/test/junit/jogl/awt/TestBug551AWT.java  |   38 +-
 .../opengl/test/junit/jogl/awt/TestBug572AWT.java  |    8 +-
 .../opengl/test/junit/jogl/awt/TestBug611AWT.java  |   24 +-
 .../jogl/awt/TestBug642JSplitPaneMixHwLw01AWT.java |   78 +-
 .../awt/TestBug664GLCanvasSetVisibleSwingAWT.java  |   25 +-
 .../jogl/awt/TestBug675BeansInDesignTimeAWT.java   |    2 +-
 .../TestBug816GLCanvasFrameHoppingB849B889AWT.java |   20 +-
 ...estBug816JTabbedPanelVisibilityB849B878AWT.java |   14 +-
 .../jogl/awt/TestBug816OSXCALayerPos01AWT.java     |   39 +-
 .../jogl/awt/TestBug816OSXCALayerPos02AWT.java     |   12 +-
 .../awt/TestBug816OSXCALayerPos03aB729AWT.java     |    8 +-
 .../awt/TestBug816OSXCALayerPos03bB849AWT.java     |    8 +-
 .../awt/TestBug816OSXCALayerPos03cB849AWT.java     |    8 +-
 .../jogl/awt/TestBug816OSXCALayerPos04aAWT.java    |   48 +-
 .../jogl/awt/TestBug816OSXCALayerPos04bAWT.java    |   48 +-
 .../awt/TestGLCanvasAWTActionDeadlock00AWT.java    |   98 +-
 .../awt/TestGLCanvasAWTActionDeadlock01AWT.java    |  130 +-
 .../awt/TestGLCanvasAWTActionDeadlock02AWT.java    |   82 +-
 .../junit/jogl/awt/TestGLJPanelResize01AWT.java    |   10 +-
 .../jogl/awt/TestGLJPanelTextureStateAWT.java      |  201 +-
 .../jogl/awt/TestIsRealizedConcurrency01AWT.java   |   26 +-
 .../jogl/awt/TestJScrollPaneMixHwLw01AWT.java      |   72 +-
 .../test/junit/jogl/awt/TestSwingAWT01GLn.java     |   28 +-
 .../TestAWTTextRendererUseVertexArrayBug464.java   |   58 +-
 .../awt/text/TextRendererGLEventListener01.java    |   52 +-
 .../jogl/awt/text/TextRendererTraceGL2Mock01.java  |   46 +-
 .../test/junit/jogl/caps/MultisampleChooser01.java |   10 +-
 .../junit/jogl/caps/TestBug605FlippedImageAWT.java |   47 +-
 .../jogl/caps/TestBug605FlippedImageNEWT.java      |   27 +-
 .../junit/jogl/caps/TestMultisampleES1AWT.java     |   20 +-
 .../junit/jogl/caps/TestMultisampleES1NEWT.java    |   36 +-
 .../junit/jogl/caps/TestMultisampleES2NEWT.java    |   36 +-
 .../test/junit/jogl/caps/TestTranslucencyAWT.java  |   44 +-
 .../test/junit/jogl/caps/TestTranslucencyNEWT.java |   52 +-
 .../test/junit/jogl/demos/GLFinishOnDisplay.java   |   55 +-
 .../opengl/test/junit/jogl/demos/GearsObject.java  |   30 +-
 .../opengl/test/junit/jogl/demos/PointsDemo.java   |   12 +-
 .../junit/jogl/demos/TextureDraw01Accessor.java    |   12 +-
 .../junit/jogl/demos/TextureSequenceDemo01.java    |  123 -
 .../opengl/test/junit/jogl/demos/es1/GearsES1.java |   88 +-
 .../test/junit/jogl/demos/es1/GearsObjectES1.java  |   21 +-
 .../junit/jogl/demos/es1/MultisampleDemoES1.java   |   33 +-
 .../test/junit/jogl/demos/es1/OlympicES1.java      |  110 +-
 .../test/junit/jogl/demos/es1/OneTriangle.java     |   29 +-
 .../test/junit/jogl/demos/es1/PointsDemoES1.java   |   74 +-
 .../test/junit/jogl/demos/es1/RedSquareES1.java    |   42 +-
 .../jogl/demos/es1/newt/TestGearsES1NEWT.java      |   32 +-
 .../jogl/demos/es1/newt/TestOlympicES1NEWT.java    |   40 +-
 .../jogl/demos/es1/newt/TestRedSquareES1NEWT.java  |   30 +-
 .../jogl/demos/es2/ElektronenMultiplizierer.java   |  215 +-
 .../test/junit/jogl/demos/es2/FBOMix2DemosES2.java |  223 +-
 .../opengl/test/junit/jogl/demos/es2/GearsES2.java |  237 +-
 .../test/junit/jogl/demos/es2/GearsObjectES2.java  |   28 +-
 .../test/junit/jogl/demos/es2/LandscapeES2.java    |  137 +-
 .../test/junit/jogl/demos/es2/Mix2TexturesES2.java |  147 +-
 .../junit/jogl/demos/es2/MultisampleDemoES2.java   |   58 +-
 .../test/junit/jogl/demos/es2/PointsDemoES2.java   |   88 +-
 .../test/junit/jogl/demos/es2/RedSquareES2.java    |   98 +-
 .../junit/jogl/demos/es2/RedSquareMappedES2.java   |   48 +-
 .../jogl/demos/es2/TextureDraw01ES2Listener.java   |  133 +-
 .../demos/es2/TextureDraw02ES2ListenerFBO.java     |  197 +-
 .../jogl/demos/es2/TextureSequenceCubeES2.java     |   92 +-
 .../junit/jogl/demos/es2/av/CrossFadePlayer.java   |   38 +-
 .../test/junit/jogl/demos/es2/av/MovieCube.java    |  165 +-
 .../junit/jogl/demos/es2/av/MovieSBSStereo.java    |  872 ++++
 .../test/junit/jogl/demos/es2/av/MovieSimple.java  |  230 +-
 .../jogl/demos/es2/awt/Bug816AppletGLCanvas01.java |   38 +-
 .../demos/es2/awt/Bug816AppletGLCanvas02a.java     |   12 +-
 .../demos/es2/awt/Bug816AppletGLCanvas02b.java     |   12 +-
 .../es2/awt/Bug816AppletOSXCALayerPos03a.java      |   26 +-
 .../es2/awt/Bug816AppletOSXCALayerPos03b.java      |   26 +-
 .../jogl/demos/es2/awt/Bug848AppletGLCanvas01.java |    8 +-
 .../junit/jogl/demos/es2/awt/TestGearsES2AWT.java  |  212 +-
 .../demos/es2/awt/TestGearsES2GLJPanelAWT.java     |  131 +-
 .../demos/es2/awt/TestGearsES2GLJPanelsAWT.java    |   96 +-
 .../es2/newt/TestElektronenMultipliziererNEWT.java |   36 +-
 .../jogl/demos/es2/newt/TestGearsES2NEWT.java      |  156 +-
 .../demos/es2/newt/TestGearsES2NewtCanvasAWT.java  |  227 +-
 .../demos/es2/newt/TestGearsES2NewtCanvasSWT.java  |  101 +-
 .../jogl/demos/es2/newt/TestLandscapeES2NEWT.java  |   41 +-
 .../es2/newt/TestLandscapeES2NewtCanvasAWT.java    |   75 +-
 .../jogl/demos/es2/newt/TestRedSquareES2NEWT.java  |   13 +-
 .../jogl/demos/es2/shader/RedSquareShader.java     |    8 +-
 .../junit/jogl/demos/es2/swt/TestGearsES2SWT.java  |   23 +-
 .../opengl/test/junit/jogl/demos/gl2/Gears.java    |  139 +-
 .../opengl/test/junit/jogl/demos/gl2/Teapot.java   |   59 +-
 .../jogl/demos/gl2/TextureDraw01GL2Listener.java   |   52 +-
 .../jogl/demos/gl2/awt/Bug818GLJPanelApplet.java   |  138 +-
 .../jogl/demos/gl2/awt/TestGLJPanelAWTBug450.java  |   47 +-
 .../junit/jogl/demos/gl2/awt/TestGearsAWT.java     |   43 +-
 .../demos/gl2/awt/TestGearsAWTAnalyzeBug455.java   |   56 +-
 .../jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java   |   49 +-
 .../junit/jogl/demos/gl2/newt/TestGearsNEWT.java   |   28 +-
 .../demos/gl2/newt/TestGearsNewtAWTWrapper.java    |   53 +-
 .../junit/jogl/demos/gl2/newt/TestTeapotNEWT.java  |   24 +-
 .../jogl/demos/gl3/GeomShader01TextureGL3.java     |  115 +-
 .../gl3/newt/TestGeomShader01TextureGL3NEWT.java   |   50 +-
 .../test/junit/jogl/glsl/GLSLMiscHelper.java       |   92 +-
 .../junit/jogl/glsl/TestGLSLShaderState01NEWT.java |  262 +-
 .../junit/jogl/glsl/TestGLSLShaderState02NEWT.java |  172 +-
 .../test/junit/jogl/glsl/TestGLSLSimple01NEWT.java |   30 +-
 .../test/junit/jogl/glsl/TestRulerNEWT01.java      |  314 +-
 .../jogl/glsl/TestShaderCompilationBug459AWT.java  |   79 +-
 .../TestTransformFeedbackVaryingsBug407NEWT.java   |   71 +-
 .../jogl/glu/TestBug365TextureGenerateMipMaps.java |  146 +-
 .../jogl/glu/TestBug463ScaleImageMemoryAWT.java    |   70 +-
 .../TestBug694ScaleImageUnpackBufferSizeAWT.java   |   75 +-
 .../test/junit/jogl/math/TestBinary16NOUI.java     |    2 +-
 .../math/TestFloatUtil01MatrixMatrixMultNOUI.java  |  116 -
 .../test/junit/jogl/math/TestFloatUtil01NOUI.java  |  282 ++
 .../math/TestFloatUtil02MatrixMatrixMultNOUI.java  |  116 +
 .../jogl/math/TestFloatUtil03InversionNOUI.java    |  262 ++
 .../jogl/math/TestGluUnprojectDoubleNOUI.java      |   16 +-
 .../junit/jogl/math/TestGluUnprojectFloatNOUI.java |   82 +-
 .../test/junit/jogl/math/TestPMVMatrix01NEWT.java  |  190 +-
 .../test/junit/jogl/math/TestPMVMatrix02NOUI.java  |   20 +-
 .../test/junit/jogl/math/TestPMVMatrix03NOUI.java  |  153 +-
 .../test/junit/jogl/math/TestQuaternion01NOUI.java |  817 ++++
 ...TestSwingAWTRobotUsageBeforeJOGLInitBug411.java |   88 +-
 .../test/junit/jogl/offscreen/ReadBuffer2File.java |   20 +-
 .../junit/jogl/offscreen/ReadBuffer2Screen.java    |   56 +-
 .../test/junit/jogl/offscreen/ReadBufferBase.java  |   24 +-
 .../test/junit/jogl/offscreen/Surface2File.java    |   30 +-
 .../offscreen/TestOffscreen01GLPBufferNEWT.java    |   78 +-
 .../jogl/offscreen/TestOffscreen02BitmapNEWT.java  |   58 +-
 .../test/junit/jogl/offscreen/WindowUtilNEWT.java  |   28 +-
 .../jogl/perf/TestPerf001GLJPanelInit01AWT.java    |   47 +-
 .../jogl/perf/TestPerf001GLJPanelInit02AWT.java    |   47 +-
 .../jogl/perf/TestPerf001GLWindowInit03NEWT.java   |   31 +-
 .../junit/jogl/perf/TestPerf001RawInit00NEWT.java  |    2 +-
 .../test/junit/jogl/stereo/StereoDemo01.java       |  366 ++
 .../jogl/swt/TestBug672NewtCanvasSWTSashForm.java  |   37 +-
 .../TestBug672NewtCanvasSWTSashFormComposite.java  |   37 +-
 .../TestNewtCanvasSWTBug628ResizeDeadlockAWT.java  |   55 +-
 .../test/junit/jogl/swt/TestNewtCanvasSWTGLn.java  |   20 +-
 .../junit/jogl/swt/TestSWTAccessor03AWTGLn.java    |   60 +-
 .../junit/jogl/swt/TestSWTBug643AsyncExec.java     |   20 +-
 .../jogl/swt/TestSWTEclipseGLCanvas01GLn.java      |   48 +-
 .../junit/jogl/swt/TestSWTJOGLGLCanvas01GLn.java   |   20 +-
 .../test/junit/jogl/tile/OffscreenPrintable.java   |   64 +-
 .../test/junit/jogl/tile/OnscreenPrintable.java    |   60 +-
 .../opengl/test/junit/jogl/tile/PrintableBase.java |   22 +-
 .../tile/TestRandomTiledRendering2GL2NEWT.java     |   24 +-
 .../jogl/tile/TestRandomTiledRendering3GL2AWT.java |   84 +-
 .../junit/jogl/tile/TestTiledPrintingGearsAWT.java |   88 +-
 .../jogl/tile/TestTiledPrintingGearsNewtAWT.java   |   86 +-
 .../jogl/tile/TestTiledPrintingGearsSwingAWT.java  |   45 +-
 .../jogl/tile/TestTiledPrintingGearsSwingAWT2.java |   53 +-
 .../tile/TestTiledPrintingNIOImageSwingAWT.java    |   74 +-
 .../jogl/tile/TestTiledRendering1GL2NEWT.java      |  118 +-
 .../junit/jogl/tile/TestTiledRendering2NEWT.java   |   50 +-
 .../test/junit/jogl/tile/TiledPrintingAWTBase.java |   84 +-
 .../test/junit/jogl/tile/TransparentPanel.java     |   14 +-
 .../junit/jogl/util/DemoGL2ES1ImmModeSink.java     |   45 +-
 .../test/junit/jogl/util/DemoGL2ES1Plain.java      |   81 +-
 .../jogl/util/DemoGL2ES1TextureImmModeSink.java    |   48 +-
 .../junit/jogl/util/DemoGL2ES2ImmModeSink.java     |   64 +-
 .../util/TestES1FixedFunctionPipelineNEWT.java     |   22 +-
 .../junit/jogl/util/TestImmModeSinkES1NEWT.java    |   46 +-
 .../junit/jogl/util/TestImmModeSinkES2NEWT.java    |   40 +-
 .../texture/TestBug362DDSImageCreateFromData.java  |   48 +-
 ...7GLReadBufferUtilGLCTXDefFormatTypeES2NEWT.java |   30 +-
 .../TestGLReadBufferUtilTextureIOWrite01AWT.java   |   46 +-
 .../TestGLReadBufferUtilTextureIOWrite01NEWT.java  |   44 +-
 .../TestGLReadBufferUtilTextureIOWrite02AWT.java   |   52 +-
 .../TestGLReadBufferUtilTextureIOWrite02NEWT.java  |   44 +-
 .../jogl/util/texture/TestJPEGImage01NEWT.java     |   50 +-
 .../texture/TestJPEGJoglAWTBenchmarkNewtAWT.java   |   26 +-
 .../texture/TestJPEGJoglAWTCompareNewtAWT.java     |  146 +-
 .../util/texture/TestJPEGTextureFromFileNEWT.java  |  142 +-
 .../jogl/util/texture/TestPNGPixelRect00NEWT.java  |    6 +-
 .../jogl/util/texture/TestPNGPixelRect01NEWT.java  |   14 +-
 .../util/texture/TestPNGTextureFromFileAWT.java    |   89 +-
 .../util/texture/TestPNGTextureFromFileNEWT.java   |  130 +-
 .../util/texture/TestPixelFormatUtil00NEWT.java    |    8 +-
 .../util/texture/TestPixelFormatUtil01NEWT.java    |    4 +-
 .../util/texture/TestTGATextureFromFileNEWT.java   |   77 +-
 .../junit/jogl/util/texture/TestTexture01AWT.java  |   58 +-
 .../junit/jogl/util/texture/TestTexture02AWT.java  |   46 +-
 .../util/texture/TestTextureSequence01AWT.java     |   59 +-
 .../util/texture/TestTextureSequence01NEWT.java    |   39 +-
 .../jogl/util/texture/bug982.rle32.256x256.tga     |  Bin 0 -> 30510 bytes
 .../newt/DemoCreateAndDisposeOnCloseNEWT.java      |   18 +-
 .../opengl/test/junit/newt/TestCloseNewtAWT.java   |   25 +-
 .../junit/newt/TestDisplayLifecycle01NEWT.java     |   35 +-
 .../junit/newt/TestDisplayLifecycle02NEWT.java     |   57 +-
 .../test/junit/newt/TestEventSourceNotAWTBug.java  |   16 +-
 .../newt/TestGLWindowInvisiblePointer01NEWT.java   |   30 +-
 .../junit/newt/TestGLWindowWarpPointer01NEWT.java  |   72 +-
 .../test/junit/newt/TestGLWindows00NEWT.java       |   34 +-
 .../test/junit/newt/TestGLWindows01NEWT.java       |  102 +-
 .../junit/newt/TestGLWindows02NEWTAnimated.java    |  115 +-
 .../junit/newt/TestGLWindows03NEWTAnimResize.java  |   14 +-
 .../test/junit/newt/TestListenerCom01AWT.java      |   38 +-
 .../test/junit/newt/TestRemoteGLWindows01NEWT.java |   46 +-
 .../test/junit/newt/TestRemoteWindow01NEWT.java    |   42 +-
 .../junit/newt/TestWindowClosingProtocol01AWT.java |   37 +-
 .../newt/TestWindowClosingProtocol02NEWT.java      |   18 +-
 .../newt/TestWindowClosingProtocol03NewtAWT.java   |   42 +-
 .../opengl/test/junit/newt/TestWindows01NEWT.java  |   68 +-
 .../opengl/test/junit/newt/WindowEventCom1.java    |   18 +-
 .../opengl/test/junit/newt/WindowEventCom2.java    |   22 +-
 .../opengl/test/junit/newt/WindowEventCom3.java    |   18 +-
 .../junit/newt/event/BaseNewtEventModifiers.java   |   89 +-
 .../event/TestNewtEventModifiersAWTCanvas.java     |   20 +-
 .../event/TestNewtEventModifiersNEWTWindowAWT.java |   18 +-
 .../event/TestNewtEventModifiersNewtCanvasAWT.java |   26 +-
 .../TestNewtEventModifiersNewtCanvasSWTAWT.java    |   42 +-
 .../newt/event/TestNewtKeyCodeModifiersAWT.java    |  126 +-
 .../test/junit/newt/event/TestNewtKeyCodesAWT.java |   30 +-
 .../newt/event/TestNewtKeyEventAutoRepeatAWT.java  |   28 +-
 .../junit/newt/event/TestNewtKeyEventOrderAWT.java |   92 +-
 .../TestNewtKeyPressReleaseUnmaskRepeatAWT.java    |   82 +-
 .../event/TestParentingFocus01SwingAWTRobot.java   |   36 +-
 .../event/TestParentingFocus02SwingAWTRobot.java   |   57 +-
 .../event/TestParentingFocus03KeyTraversalAWT.java |   42 +-
 .../junit/newt/mm/ManualScreenMode03aNEWT.java     |   61 +-
 .../test/junit/newt/mm/TestScreenMode00aNEWT.java  |   77 +-
 .../test/junit/newt/mm/TestScreenMode00bNEWT.java  |   50 +-
 .../test/junit/newt/mm/TestScreenMode00cNEWT.java  |   94 +-
 .../test/junit/newt/mm/TestScreenMode01aNEWT.java  |  115 +-
 .../test/junit/newt/mm/TestScreenMode01bNEWT.java  |  106 +-
 .../test/junit/newt/mm/TestScreenMode01cNEWT.java  |  130 +-
 .../test/junit/newt/mm/TestScreenMode01dNEWT.java  |  164 +-
 .../test/junit/newt/mm/TestScreenMode02aNEWT.java  |   76 +-
 .../test/junit/newt/mm/TestScreenMode02bNEWT.java  |   78 +-
 .../test/junit/newt/parenting/GLRunnableDummy.java |   14 +-
 .../test/junit/newt/parenting/KeyAction.java       |   18 +-
 .../parenting/NewtAWTReparentingKeyAdapter.java    |   20 +-
 .../junit/newt/parenting/TestParenting01NEWT.java  |   50 +-
 .../junit/newt/parenting/TestParenting01aAWT.java  |   40 +-
 .../junit/newt/parenting/TestParenting01aSWT.java  |   40 +-
 .../junit/newt/parenting/TestParenting01bAWT.java  |   18 +-
 .../junit/newt/parenting/TestParenting01cAWT.java  |   34 +-
 .../newt/parenting/TestParenting01cSwingAWT.java   |   97 +-
 .../junit/newt/parenting/TestParenting01dAWT.java  |   12 +-
 .../junit/newt/parenting/TestParenting02AWT.java   |   20 +-
 .../junit/newt/parenting/TestParenting02NEWT.java  |   46 +-
 .../junit/newt/parenting/TestParenting03AWT.java   |   22 +-
 .../junit/newt/parenting/TestParenting04AWT.java   |   48 +-
 .../junit/newt/parenting/TestParenting04SWT.java   |   68 +-
 .../TestTranslucentChildWindowBug632NEWT.java      |   62 +-
 .../parenting/TestTranslucentParentingAWT.java     |   44 +-
 .../test/junit/newt/parenting/WindowAction.java    |   16 +-
 .../opengl/test/junit/util/AWTFocusAdapter.java    |   28 +-
 .../opengl/test/junit/util/AWTKeyAdapter.java      |   12 +-
 .../opengl/test/junit/util/AWTMouseAdapter.java    |   10 +-
 .../opengl/test/junit/util/AWTRobotUtil.java       |  189 +-
 .../test/junit/util/AWTWindowFocusAdapter.java     |   26 +-
 .../jogamp/opengl/test/junit/util/DumpGLInfo.java  |   10 +-
 .../opengl/test/junit/util/EventCountAdapter.java  |   12 +-
 .../test/junit/util/EventCountAdapterUtil.java     |   18 +-
 .../test/junit/util/FocusEventCountAdapter.java    |   10 +-
 .../test/junit/util/GLEventListenerCounter.java    |    8 +-
 .../opengl/test/junit/util/GLSLSimpleProgram.java  |   30 +-
 .../test/junit/util/KeyEventCountAdapter.java      |   14 +-
 .../jogamp/opengl/test/junit/util/MiscUtils.java   |   50 +-
 .../opengl/test/junit/util/NEWTFocusAdapter.java   |   38 +-
 .../opengl/test/junit/util/NEWTGLContext.java      |   88 +-
 .../opengl/test/junit/util/NEWTKeyAdapter.java     |   12 +-
 .../jogamp/opengl/test/junit/util/NEWTKeyUtil.java |   24 +-
 .../opengl/test/junit/util/NEWTMouseAdapter.java   |   10 +-
 .../jogamp/opengl/test/junit/util/QuitAdapter.java |    8 +-
 .../jogamp/opengl/test/junit/util/UITestCase.java  |   79 +-
 .../test/junit/util/ValidateLockListener.java      |   26 +-
 src/test/jogamp/newt/WindowImplAccess.java         |   12 +-
 1408 files changed, 70220 insertions(+), 46091 deletions(-)

diff --git a/.classpath b/.classpath
index b0ed782..abf6785 100644
--- a/.classpath
+++ b/.classpath
@@ -26,6 +26,13 @@
 			<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="jogl/build/newt/obj"/>
 		</attributes>
 	</classpathentry>
+	<classpathentry kind="src" output="build/oculusvr/gensrc/classes" path="build/oculusvr/gensrc/classes">
+		<attributes>
+			<attribute name="org.eclipse.jdt.launching.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY" value="jogl/build/oculusvr/obj"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" path="src/oculusvr/classes"/>
+	<classpathentry kind="src" path="oculusvr-sdk/jogl/src/classes"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/gluegen"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Ant"/>
@@ -34,5 +41,6 @@
 	<classpathentry combineaccessrules="false" kind="src" path="/joal"/>
 	<classpathentry kind="lib" path="/gluegen/make/lib/junit.jar" sourcepath="/gluegen/make/lib/junit-sources.jar"/>
 	<classpathentry kind="lib" path="make/lib/plugin3/plugin3-public.jar" sourcepath="make/lib/plugin3/plugin3-public-src.zip"/>
+	<classpathentry kind="lib" path="/gluegen/make/lib/semantic-versioning/semver.jar" sourcepath="/gluegen/make/lib/semantic-versioning/semver-src.zip"/>
 	<classpathentry kind="output" path="build/eclipse-classes"/>
 </classpath>
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..9f61a9a
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "oculusvr-sdk"]
+	path = oculusvr-sdk
+	url = ../oculusvr-sdk.git
diff --git a/LICENSE.txt b/LICENSE.txt
index 6da9f54..8083843 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,6 +1,14 @@
-The JOGL source code is mostly licensed under the New BSD 2-clause license,
+The JOGL source code is mostly licensed under the 'New BSD 2-Clause License',
 however it contains other licensed material as well.
 
+Other licensed material is compatible with the 'New BSD 2-Clause License',
+if not stated otherwise.
+
+'New BSD 2-Clause License' incompatible materials are optional, they are:
+
+    A.7) The JOGL source tree _may_ contain code from Oculus VR, Inc.
+         which is covered by it's own permissive Oculus VR Rift SDK Software License.
+
 Below you find a detailed list of licenses used in this project.
 
 +++
@@ -246,7 +254,7 @@ A.3) The JOGL source tree contains code from David Schweinsberg
 
    Typecast is a font development environment for OpenType font technology.
 
-   <http://typecast.dev.java.net/>
+   <https://java.net/projects/typecast>
 
    Author: David Schweinsberg
 
@@ -363,3 +371,59 @@ A.6) The JOGL source tree contains code from Hernan J. Gonzalez and Shawn Hartso
     src/jogl/classes/jogamp/opengl/util/pngj/**
 
 
+A.7) The JOGL source tree _may_ contain code from Oculus VR, Inc.
+     which is covered by it's own permissive Oculus VR Rift SDK Software License.
+
+    This code _can_ be included to produce a binding 
+    and hence support for the Oculus VR Rift.
+
+    The code is included _and_ it's build artifacts will be released,
+    if the git sub-module oculusvr-sdk is included in the jogl source repository
+    as true for current official JogAmp builds and releases!
+
+    If using JogAmp JOGL builds with oculusvr-sdk support, 
+    but the user prefers to _not_ use it for license or other reasons,
+    the user can simply remove the artifacts 'jar/atomics/oculusvr*jar'.
+    No other produced artifact is affected.
+
+    While the Oculus VR Rift SDK Software License is permissive,
+    it's differences to the New BSD license shall be mentioned, see below!
+
+    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+    Copyright © 2014 Oculus VR, Inc. All rights reserved.
+
+    Oculus VR, Inc. Software Development Kit License Agreement
+    
+    Human-Readable Summary:
+
+     - You are Free to:
+
+        - Use, modify, and distribute the Oculus VR Rift SDK in source and binary
+          form with your applications/software.
+
+     - With the Following Restrictions:
+
+        - You can only distribute or re-distribute the source code to LibOVR in
+          whole, not in part.
+
+        - Modifications to the Oculus VR Rift SDK in source or binary form must
+          be shared with Oculus VR.
+
+        - If your applications cause health and safety issues, you may lose your
+          right to use the Oculus VR Rift SDK, including LibOVR.
+
+        - The Oculus VR Rift SDK may not be used to interface with unapproved commercial
+          virtual reality mobile or non-mobile products or hardware.
+
+     - This human-readable Summary is not a license. It is simply a convenient
+       reference for understanding the full Oculus VR Rift SDK License Agreement.
+       The Summary is written as a user-friendly interface to the full Oculus VR Rift
+       SDK License below. This Summary itself has no legal value, and its contents do
+       not appear in the actual license.
+
+       Full-length Legal Copy may be found at:
+         http://www.oculusvr.com/licenses/LICENSE-3.1
+         http://jogamp.org/git/?p=oculusvr-sdk.git;a=blob;f=LICENSE.txt;hb=HEAD
+         Or within this repository: oculusvr-sdk/LICENSE.txt
+
diff --git a/doc/HowToBuild.html b/doc/HowToBuild.html
index 8b5d27e..0abcdb1 100644
--- a/doc/HowToBuild.html
+++ b/doc/HowToBuild.html
@@ -56,7 +56,7 @@
                                     (not yet tested)</li>
                             </ul>
                         </li>
-                        <li> <b><a href="http://ant.apache.org/">Ant</a></b> 1.8.0 or later</li>
+                        <li> <b><a href="http://ant.apache.org/">Ant</a></b> 1.8.2 or later</li>
                         <li> <b><a href="http://www.kernel.org/pub/software/scm/git/docs/">Git</a></b> 1.6.0 or later<br/>
                             <ul>
                                 <li> Use your Unix distribution's version, if available, or</li>
@@ -78,7 +78,11 @@
                             <ul>
                                 <li> <b>Debian</b> 5.00 or later
                                     <ul>
+                                        <li>openjdk-7-jre</li>
+                                        <li>openjdk-7-jdk</li>
+                                        <li>ant</li>
                                         <li>git</li>
+                                        <li>p7zip-full</li>
                                         <li>gcc</li>
                                         <li>libgl1-mesa-dev</li>
                                         <li>libglu1-mesa-dev</li>
@@ -92,26 +96,41 @@
                                         <li>libxrandr-dev</li>
                                         <li>libxrender-dev</li>
                                         <li>libxcursor-dev</li>
+                                        <li>libudev-dev</li>
                                         <li>Optional: Your card vendor's proprietary driver</li>
                                     </ul>
                                     One liner install command:
                                     <pre>
-apt-get install git-all gcc libgl1-mesa-dev libglu1-mesa-dev xorg-dev libice-dev libsm-dev libx11-dev libxext-dev libxxf86vm-dev libxinerama-dev libxrandr-dev libxrender-dev libxcursor-dev libc6-dev g++ libstdc++6 libstdc++6-4.7-dev
+apt-get install openjdk-7-jre openjdk-7-jdk ant git-all p7zip-full gcc libgl1-mesa-dev libglu1-mesa-dev xorg-dev libice-dev libsm-dev libx11-dev libxext-dev libxxf86vm-dev libxinerama-dev libxrandr-dev libxrender-dev libxcursor-dev libudev-dev libc6-dev g++ libstdc++6 libstdc++6-4.7-dev
                                     </pre>
                                     Optional: Add <i>kernel</i> build utilities:
                                     <pre>
 apt-get install kernel-package build-essential 
                                     </pre>
-                                    Optional: Add <i>multiarch</i> i386 next to amd64, requires Debian 7.00 or later:
-                                    <pre>
+                                    Optional: Add <i>multiarch</i> i386 next to amd64 
+                                    <ul>
+                                      <li><b>Debian</b> 7.00
+                                        <pre>
 dpkg --add-architecture i386
 apt-get update
-apt-get install ia32-libs ia32-libs-gtk gcc-multilib lib32gcc1 lib32gomp1 lib32itm1 lib32quadmath0 libc6-i386 libc6-dev-i386 g++-multilib lib32stdc++6
-                                    </pre>
+apt-get install ia32-libs ia32-libs-gtk gcc-multilib lib32gcc1 lib32gomp1 lib32itm1 lib32quadmath0 libc6-i386 llibudev0:i386 ibc6-dev-i386 g++-multilib lib32stdc++6 openjdk-7-jre:i386 openjdk-7-jdk:i386
+                                        </pre></li>
+
+                                      <li><b>Debian</b> 8.00
+                                        <pre>
+dpkg --add-architecture i386
+apt-get update
+apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 gcc-multilib lib32gcc1 lib32gomp1 lib32itm1 lib32quadmath0 libudev1:i386 libc6-i386 libc6-dev-i386 g++-multilib lib32stdc++6 openjdk-7-jre:i386 openjdk-7-jdk:i386
+                                        </pre></li>
+                                    </ul>
                                 </li>
                                 <li> <b>OpenSuSE</b> 10.2 or later
                                     <ul>
+                                        <li>openjdk-7-jre</li>
+                                        <li>openjdk-7-jdk</li>
+                                        <li>ant</li>
                                         <li>git</li>
+                                        <li>p7zip-full</li>
                                         <li>gcc</li>
                                         <li>x11-devel</li>
                                         <li>mesa-devel</li>
@@ -119,7 +138,11 @@ apt-get install ia32-libs ia32-libs-gtk gcc-multilib lib32gcc1 lib32gomp1 lib32i
                                 </li>
                                 <li> <b>CentOS / Red Hat Enterprise Linux</b> 5.4 or later<br/>
                                     <ul>
+                                        <li>openjdk-7-jre</li>
+                                        <li>openjdk-7-jdk</li>
+                                        <li>ant</li>
                                         <li>git</li>
+                                        <li>p7zip-full</li>
                                         <li>gcc</li>
                                         <li>mesa-libGL-devel</li>
                                         <li>xorg-x11-proto-devel</li>
@@ -135,6 +158,7 @@ apt-get install ia32-libs ia32-libs-gtk gcc-multilib lib32gcc1 lib32gomp1 lib32i
                                         <li>libXrandr-devel</li>
                                         <li>libXrender-devel</li>
                                         <li>libXcursor-devel</li>
+                                        <li>libudev-devel</li>
                                         <li>Optional: Your card vendor's proprietary driver</li>
                                     </ul>
                                 </li>
@@ -214,7 +238,7 @@ apt-get install ia32-libs ia32-libs-gtk gcc-multilib lib32gcc1 lib32gomp1 lib32i
                             It is crucial that you checkout the source code under a common root directory:
                             <pre>
     /home/dude/projects/jogamp> git clone git://jogamp.org/srv/scm/gluegen.git gluegen
-    /home/dude/projects/jogamp> git clone git://jogamp.org/srv/scm/jogl.git jogl
+    /home/dude/projects/jogamp> git clone --recurse-submodules git://jogamp.org/srv/scm/jogl.git jogl
                             </pre>
                             Now you should have following directory structure:
                             <pre>
@@ -222,6 +246,11 @@ apt-get install ia32-libs ia32-libs-gtk gcc-multilib lib32gcc1 lib32gomp1 lib32i
     /home/dude/projects/jogamp/gluegen
     /home/dude/projects/jogamp/jogl
                             </pre>
+                            Note: In case you do not get the JOGL sources with <i>-recurse-submodules</i>,
+                            you will miss the following features:
+                            <ul>
+                              <li>OculusVR Support</li>
+                            </ul>
                         </li>
 
                         <li> <b>Unset your CLASSPATH environment variable:</b> <br/>
diff --git a/doc/NEWT-Overview.html b/doc/NEWT-Overview.html
index 4f8f718..953f95b 100644
--- a/doc/NEWT-Overview.html
+++ b/doc/NEWT-Overview.html
@@ -113,6 +113,62 @@ See it <a href="/deployment/jogamp-next/jogl-test-applets.html"><i>alive</i> her
     [<a href="">v2.0-rc3</a>]
 -->
 
+<h4>Native Window Reparenting Details</h4>
+
+NEWT's reparenting algorithm only issues a <i>destroy</i> if:
+<ul>
+  <li>Becomes CHILD-Window
+  <ul>
+    <li>new parent window is not realized yet, 
+      i.e. parent's window handle is null</li>
+
+    <li>forceRecreate</li>
+
+    <li>moving to a new incompatible screen/device</li>
+  </ul></li>
+
+  <li>Becomes TOP-Level-Window
+  <ul> 
+    <li>forceRecreate</li>
+  </ul></li>
+
+  <li>reparenting failed</li>
+</ul>
+
+In case <i>destroy</i> is issued, recreation will follow
+as soon as the new parent window handle becomes available
+or the instant if becoming a top-level window.
+
+<p>
+In case <i>destroy</i> must be issued, the hint <i>REPARENT_HINT_BECOMES_VISIBLE</i>
+will preserve the GLState at destroy, see below.
+</p>
+
+<p>
+To avoid <i>destroy</i> <b>and</b> the GLState preservation,
+the NEWT window shall simply be reparented before 
+parent's destruction. This is true for 'window hopping' 
+as well as child->top transition.
+
+See TestParenting04AWT for example ..
+</p>
+
+
+<h5>Using GLState Preservation</h5>
+
+A preserved GLState will be recovered when the resource gets recreated,
+e.g. the parent window becomes visible again.
+This mechanism exists to sooth the <i>destroy</i> case.
+
+See: GLStateKeeper, GLEventListenerState
+
+Regularly Used in the following use cases:
+<ul>
+  <li>OSX CALayer/Top-Level NEWT reparenting</li>
+  <li>Android GLState preservation: 'Home Button', 'Rotation' ..</li>
+</ul>
+
+
 <h4>How to pass user input back to the rendering loop ?</h4>
 
 The following example shows you how to use a fifo to pipe events from the EDT (listener) to the rendering loop.
diff --git a/doc/NewUI-Req01.txt b/doc/NewUI-Req01.txt
index 67af76d..e93cc5e 100644
--- a/doc/NewUI-Req01.txt
+++ b/doc/NewUI-Req01.txt
@@ -61,6 +61,6 @@ rendered UI elements, the application may add on a 2D place in the scene
 and propagates events to the UI TK event dispatcher.
 
 Additionally we could just offer such a 'realizer' adapter for simple applications,
-ie render the UI textures and propagating catched events on it's plane.
+ie render the UI textures and propagating caught events on it's plane.
 
 
diff --git a/doc/deployment/JOGL-DEPLOYMENT.html b/doc/deployment/JOGL-DEPLOYMENT.html
index 81a028e..1c504a1 100644
--- a/doc/deployment/JOGL-DEPLOYMENT.html
+++ b/doc/deployment/JOGL-DEPLOYMENT.html
@@ -227,13 +227,13 @@
                     <ul>
                         <li>Mandatory:<br/>
                             <ul>
-                                <li>nativewindow-core.jar</li>
-                                <li>jogl-core.jar</li>
+                                <li>nativewindow.jar</li>
+                                <li>jogl.jar</li>
                             </ul></li>
 
                         <li>Newt (optional):<br/>
                             <ul>
-                                <li>newt-core.jar</li>
+                                <li>newt.jar</li>
                                 <li>newt-ogl.jar  (to use NEWT with JOGL)</li>
                             </ul></li>
                     </ul>
diff --git a/doc/wiki/FAQ.xml b/doc/wiki/FAQ.xml
index d01413d..5539ff0 100644
--- a/doc/wiki/FAQ.xml
+++ b/doc/wiki/FAQ.xml
@@ -224,7 +224,7 @@ Note: A bug on MacOSX is known, launching 2 JOGL applets in 2 tabs.
    <param name="progressbar" value="true">
    <param name="jnlpNumExtensions" value="1">
    <param name="jnlpExtension1"
-          value="http://download.java.net/media/jogl/jsr-231-2.x-webstart/jogl-core.jnlp">
+          value="http://download.java.net/media/jogl/jsr-231-2.x-webstart/jogl.jnlp">
    <param name="java_arguments" value="-Dsun.java2d.noddraw=true">
    <param name="jnlp_href" value="applet-gears.jnlp">
 </applet>
diff --git a/etc/profile.jogl b/etc/profile.jogl
index 16b3a3d..31cff13 100755
--- a/etc/profile.jogl
+++ b/etc/profile.jogl
@@ -44,11 +44,19 @@ JOGL_JAR_ALL_NOAWT="jogl-all-noawt.jar"
 JOGL_JAR_ALL_MOBILE="jogl-all-mobile.jar"
 JOGL_JAR_SWT="atomic/jogl-swt.jar"
 
-JOGL_LIB_ALL="libnativewindow_x11.so libnativewindow_awt.so libjogl_desktop.so libjogl_mobile.so libjogl_cg.so libnewt.so"
-JOGL_LIB_ALL_NOAWT="libnativewindow_x11.so libjogl_desktop.so libjogl_mobile.so libjogl_cg.so libnewt.so"
-JOGL_LIB_ALL_MOBILE="libjogl_mobile.so libnewt.so"
+JOGL_JAR_OCULUSVR="atomic/oculusvr.jar"
 
-export JOGL_JAR_ALL JOGL_JAR_ALL_NOAWT JOGL_JAR_ALL_MOBILE
+JOGL_LIB_ALL="libnativewindow_x11.so libnativewindow_awt.so libjogl_desktop.so libjogl_mobile.so libjogl_cg.so libnewt.so liboculusvr.so"
+JOGL_LIB_ALL_NOAWT="libnativewindow_x11.so libjogl_desktop.so libjogl_mobile.so libjogl_cg.so libnewt.so liboculusvr.so"
+JOGL_LIB_ALL_MOBILE="libjogl_mobile.so libnewt.so liboculusvr.so"
+
+ATOMICS_NATIVEWINDOW="atomic/nativewindow-core.jar atomic/nativewindow-os-x11.jar atomic/nativewindow-os-win.jar atomic/nativewindow-os-osx.jar"
+#ATOMICS_JOGL="atomic/jogl-core.jar atomic/jogl-gldesktop.jar atomic/jogl-util.jar atomic/jogl-os-x11.jar atomic/jogl-os-win.jar atomic/jogl-os-osx.jar "
+ATOMICS_JOGL="atomic/jogl-core.jar atomic/jogl-gldesktop.jar atomic/jogl-os-x11.jar atomic/jogl-os-win.jar atomic/jogl-os-osx.jar "
+ATOMICS_NEWT="atomic/newt-core.jar atomic/newt-ogl.jar atomic/newt-driver-x11.jar atomic/newt-driver-win.jar atomic/newt-driver-osx.jar atomic/newt-driver-bcm-vc.jar"
+JOGL_JAR_ATOMICS_NOAWT="$ATOMICS_NATIVEWINDOW $ATOMICS_JOGL $ATOMICS_NEWT"
+
+export JOGL_JAR_ALL JOGL_JAR_ALL_NOAWT JOGL_JAR_ALL_MOBILE JOGL_JAR_ATOMICS_NOAWT
 export JOGL_LIB_ALL JOGL_LIB_ALL_NOAWT JOGL_LIB_ALL_MOBILE
 
 THISDIR=`dirname $0`
@@ -81,11 +89,12 @@ export JOGL_BUILD_DIR
 JOGL_LIB_DIR="$JOGL_BUILD_DIR"/lib
 export JOGL_LIB_DIR
 
-JOGL_ALL_AWT_CLASSPATH=$(concat_jogl_list "$JOGL_BUILD_DIR" $JOGL_JAR_ALL $JOGL_TEST)
-JOGL_ALL_NOAWT_CLASSPATH=$(concat_jogl_list "$JOGL_BUILD_DIR" $JOGL_JAR_ALL_NOAWT $JOGL_TEST)
-JOGL_MOBILE_CLASSPATH=$(concat_jogl_list "$JOGL_BUILD_DIR" $JOGL_JAR_ALL_MOBILE $JOGL_TEST)
-JOGL_SWT_CLASSPATH=$(concat_jogl_list "$JOGL_BUILD_DIR" $JOGL_JAR_SWT $JOGL_TEST)
-export JOGL_ALL_AWT_CLASSPATH JOGL_ALL_NOAWT_CLASSPATH JOGL_MOBILE_CLASSPATH JOGL_SWT_CLASSPATH
+JOGL_ALL_AWT_CLASSPATH=$(concat_jogl_list "$JOGL_BUILD_DIR" $JOGL_JAR_ALL $JOGL_JAR_OCULUSVR $JOGL_TEST)
+JOGL_ALL_NOAWT_CLASSPATH=$(concat_jogl_list "$JOGL_BUILD_DIR" $JOGL_JAR_ALL_NOAWT $JOGL_JAR_OCULUSVR $JOGL_TEST)
+JOGL_MOBILE_CLASSPATH=$(concat_jogl_list "$JOGL_BUILD_DIR" $JOGL_JAR_ALL_MOBILE $JOGL_JAR_OCULUSVR $JOGL_TEST)
+JOGL_ATOMICS_NOAWT_CLASSPATH=$(concat_jogl_list "$JOGL_BUILD_DIR" $JOGL_JAR_ATOMICS_NOAWT $JOGL_JAR_OCULUSVR $JOGL_TEST)
+JOGL_SWT_CLASSPATH=$(concat_jogl_list "$JOGL_BUILD_DIR" $JOGL_JAR_SWT $JOGL_JAR_OCULUSVR $JOGL_TEST)
+export JOGL_ALL_AWT_CLASSPATH JOGL_ALL_NOAWT_CLASSPATH JOGL_MOBILE_CLASSPATH JOGL_ATOMICS_NOAWT_CLASSPATH JOGL_SWT_CLASSPATH
 
 if [ ! -z "$JOGL_PROFILE" ] ; then
     case "$JOGL_PROFILE" in
diff --git a/jnlp-files/atomic/jogl-awt.jnlp b/jnlp-files/atomic/jogl-awt.jnlp
index 8f15a6c..528632e 100644
--- a/jnlp-files/atomic/jogl-awt.jnlp
+++ b/jnlp-files/atomic/jogl-awt.jnlp
@@ -14,7 +14,7 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="jar/atomic/jogl-core.jar" />
+      <jar href="jar/atomic/jogl.jar" />
       <jar href="jar/atomic/jogl-sdk.jar" />
       <jar href="jar/atomic/jogl-util.jar" />
       <jar href="jar/atomic/jogl-awt.jar" />
diff --git a/jnlp-files/atomic/jogl-noawt.jnlp b/jnlp-files/atomic/jogl-noawt.jnlp
index 91a1fe8..15f1ac8 100644
--- a/jnlp-files/atomic/jogl-noawt.jnlp
+++ b/jnlp-files/atomic/jogl-noawt.jnlp
@@ -14,7 +14,7 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="jar/atomic/jogl-core.jar" />
+      <jar href="jar/atomic/jogl.jar" />
       <jar href="jar/atomic/jogl-sdk.jar" />
       <jar href="jar/atomic/jogl-util.jar" />
       <jar href="jar/atomic/jogl-glutess.jar" />
diff --git a/jnlp-files/atomic/nativewindow-awt.jnlp b/jnlp-files/atomic/nativewindow-awt.jnlp
index a993ab1..7bcac3c 100644
--- a/jnlp-files/atomic/nativewindow-awt.jnlp
+++ b/jnlp-files/atomic/nativewindow-awt.jnlp
@@ -14,7 +14,7 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="jar/atomic/nativewindow-core.jar" />
+      <jar href="jar/atomic/nativewindow.jar" />
       <jar href="jar/atomic/nativewindow-awt.jar"/>
       <extension name="gluegen-rt"   href="GLUEGEN_CODEBASE_TAG/gluegen-rt.jnlp" />
     </resources>
diff --git a/jnlp-files/atomic/nativewindow-noawt.jnlp b/jnlp-files/atomic/nativewindow-noawt.jnlp
index 5cd4872..30d5bac 100644
--- a/jnlp-files/atomic/nativewindow-noawt.jnlp
+++ b/jnlp-files/atomic/nativewindow-noawt.jnlp
@@ -14,7 +14,7 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="jar/atomic/nativewindow-core.jar" />
+      <jar href="jar/atomic/nativewindow.jar" />
       <extension name="gluegen-rt"   href="GLUEGEN_CODEBASE_TAG/gluegen-rt.jnlp" />
     </resources>
 
diff --git a/jnlp-files/atomic/newt-awt-jogl.jnlp b/jnlp-files/atomic/newt-awt-jogl.jnlp
index 0a43128..27be5b4 100644
--- a/jnlp-files/atomic/newt-awt-jogl.jnlp
+++ b/jnlp-files/atomic/newt-awt-jogl.jnlp
@@ -14,7 +14,7 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="jar/atomic/newt-core.jar" />
+      <jar href="jar/atomic/newt.jar" />
       <jar href="jar/atomic/newt-ogl.jar" />
       <jar href="jar/atomic/newt-awt.jar" />
       <extension name="jogl-awt" href="JOGL_CODEBASE_TAG/jogl-awt.jnlp" />
diff --git a/jnlp-files/atomic/newt-awt.jnlp b/jnlp-files/atomic/newt-awt.jnlp
index 6e46b82..2edaf21 100644
--- a/jnlp-files/atomic/newt-awt.jnlp
+++ b/jnlp-files/atomic/newt-awt.jnlp
@@ -14,7 +14,7 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="jar/atomic/newt-core.jar" />
+      <jar href="jar/atomic/newt.jar" />
       <jar href="jar/atomic/newt-awt.jar" />
       <extension name="nativewindow-awt" href="JOGL_CODEBASE_TAG/nativewindow-awt.jnlp" />
     </resources>
diff --git a/jnlp-files/atomic/newt-noawt-jogl.jnlp b/jnlp-files/atomic/newt-noawt-jogl.jnlp
index 5b671ed..302d369 100644
--- a/jnlp-files/atomic/newt-noawt-jogl.jnlp
+++ b/jnlp-files/atomic/newt-noawt-jogl.jnlp
@@ -14,7 +14,7 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="jar/atomic/newt-core.jar" />
+      <jar href="jar/atomic/newt.jar" />
       <jar href="jar/atomic/newt-ogl.jar" />
       <extension name="jogl-noawt" href="JOGL_CODEBASE_TAG/jogl-noawt.jnlp" />
     </resources>
diff --git a/jnlp-files/atomic/newt-noawt.jnlp b/jnlp-files/atomic/newt-noawt.jnlp
index 1161d7a..a69e4a9 100644
--- a/jnlp-files/atomic/newt-noawt.jnlp
+++ b/jnlp-files/atomic/newt-noawt.jnlp
@@ -14,7 +14,7 @@
       <all-permissions/>
   </security>
     <resources>
-      <jar href="jar/atomic/newt-core.jar" />
+      <jar href="jar/atomic/newt.jar" />
       <extension name="nativewindow" href="JOGL_CODEBASE_TAG/nativewindow-noawt.jnlp" />
     </resources>
 
diff --git a/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01-applet3-napplet.html b/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01-applet3-napplet.html
index 6bfc9a4..0ff71c9 100644
--- a/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01-applet3-napplet.html
+++ b/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01-applet3-napplet.html
@@ -20,7 +20,7 @@ JOGL Applet3 Graph Text Demo 01
    <param name="gl_profile" value="GL2ES2">
    <param name="gl_swap_interval" value="1">
    <param name="gl_alpha" value="4">
-   <param name="gl_multisamplebuffer" value="4">
+   <param name="gl_multisamplebuffer" value="0">
    <param name="gl_nodefaultkeyListener" value="true">
    <param name="gl_debug" value="false">
    <param name="gl_trace" value="false">
@@ -36,7 +36,7 @@ JOGL Applet3 Graph Text Demo 01
           gl_profile="GL2ES2"
           gl_swap_interval="1"
           gl_alpha="4"
-          gl_multisamplebuffer="4"
+          gl_multisamplebuffer="0"
           gl_nodefaultkeyListener="true"
           gl_debug="false"
           gl_trace="false">
diff --git a/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01-napplet.html b/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01-napplet.html
index 28fed66..4264367 100644
--- a/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01-napplet.html
+++ b/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01-napplet.html
@@ -20,7 +20,7 @@ JOGL Graph Text Demo 01
    <param name="gl_profile" value="GL2ES2">
    <param name="gl_swap_interval" value="1">
    <param name="gl_alpha" value="4">
-   <param name="gl_multisamplebuffer" value="4">
+   <param name="gl_multisamplebuffer" value="0">
    <param name="gl_nodefaultkeyListener" value="true">
    <param name="gl_debug" value="false">
    <param name="gl_trace" value="false">
@@ -36,7 +36,7 @@ JOGL Graph Text Demo 01
           gl_profile="GL2ES2"
           gl_swap_interval="1"
           gl_alpha="4"
-          gl_multisamplebuffer="4"
+          gl_multisamplebuffer="0"
           gl_nodefaultkeyListener="true"
           gl_debug="false"
           gl_trace="false">
diff --git a/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01.html b/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01.html
index fc00b73..1b4213c 100644
--- a/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01.html
+++ b/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01.html
@@ -20,7 +20,7 @@ JOGL Graph Text Demo 01
    <param name="gl_profile" value="GL2ES2">
    <param name="gl_swap_interval" value="1">
    <param name="gl_alpha" value="4">
-   <param name="gl_multisamplebuffer" value="4">
+   <param name="gl_multisamplebuffer" value="0">
    <param name="gl_nodefaultkeyListener" value="true">
    <param name="gl_debug" value="false">
    <param name="gl_trace" value="false">
@@ -37,7 +37,7 @@ JOGL Graph Text Demo 01
           gl_profile="GL2ES2"
           gl_swap_interval="1"
           gl_alpha="4"
-          gl_multisamplebuffer="4"
+          gl_multisamplebuffer="0"
           gl_nodefaultkeyListener="true"
           gl_debug="false"
           gl_trace="false"
diff --git a/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01b-napplet.html b/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01b-napplet.html
index cf0723e..2baa095 100644
--- a/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01b-napplet.html
+++ b/jnlp-files/jogl-applet-runner-newt-GraphTextDemo01b-napplet.html
@@ -21,7 +21,7 @@ JOGL Graph Text Demo 01b (w/ atomic/jogl-fonts-p0.jar in path)
    <param name="gl_profile" value="GL2ES2">
    <param name="gl_swap_interval" value="1">
    <param name="gl_alpha" value="4">
-   <param name="gl_multisamplebuffer" value="4">
+   <param name="gl_multisamplebuffer" value="0">
    <param name="gl_nodefaultkeyListener" value="true">
    <param name="gl_debug" value="false">
    <param name="gl_trace" value="false">
@@ -38,7 +38,7 @@ JOGL Graph Text Demo 01b (w/ atomic/jogl-fonts-p0.jar in path)
           gl_profile="GL2ES2"
           gl_swap_interval="1"
           gl_alpha="4"
-          gl_multisamplebuffer="4"
+          gl_multisamplebuffer="0"
           gl_nodefaultkeyListener="true"
           gl_debug="false"
           gl_trace="false">
diff --git a/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo01-applet3-napplet.html b/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo01-applet3-napplet.html
index 4e7cf93..a1f8997 100644
--- a/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo01-applet3-napplet.html
+++ b/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo01-applet3-napplet.html
@@ -14,6 +14,7 @@ JOGL Applet3 Graph UI-Scene Demo 01
       width="640" height="480">
    <param name="code" value="com.jogamp.newt.util.applet.JOGLNewtApplet3Run">
    <param name="archive" value="jar/gluegen-rt.jar,
+                                jar/joal.jar,
                                 jar/jogl-all-noawt.jar,
                                 jar/jogl-test.jar">
    <param name="gl_event_listener_class" value="com.jogamp.opengl.test.junit.graph.demos.GPUUISceneGLListener0A">
@@ -29,6 +30,7 @@ JOGL Applet3 Graph UI-Scene Demo 01
           type="application/x-java-applet;version=1.6"
           pluginspage="http://java.sun.com/javase/downloads/ea.jsp"
           archive="jar/gluegen-rt.jar,
+                   jar/joal.jar,
                    jar/jogl-all-noawt.jar,
                    jar/jogl-test.jar"
           gl_event_listener_class="com.jogamp.opengl.test.junit.graph.demos.GPUUISceneGLListener0A"
diff --git a/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo01-napplet.html b/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo01-napplet.html
index 66f02da..c0e8ff4 100644
--- a/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo01-napplet.html
+++ b/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo01-napplet.html
@@ -1,41 +1,43 @@
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 <html>
 <head>
-<title>JOGL Graph UI-Scene Demo 01 (NApplet)</title>
+<title>JOGL Graph UI-Scene Demo 01 No-AA (NApplet)</title>
 </head>
 <body  BGCOLOR="#ffffff">
 
 <P>
-JOGL Graph UI-Scene Demo 01
+JOGL Graph UI-Scene Demo 01 No-AA
 </P>
 
 <P>
 <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
-      width="640" height="480">
+      width="800" height="400">
    <param name="code" value="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run">
    <param name="archive" value="jar/gluegen-rt.jar,
+                                jar/joal.jar,
                                 jar/jogl-all.jar,
                                 jar/jogl-test.jar">
    <param name="gl_event_listener_class" value="com.jogamp.opengl.test.junit.graph.demos.GPUUISceneGLListener0A">
    <param name="gl_profile" value="GL2ES2">
    <param name="gl_swap_interval" value="1">
    <param name="gl_alpha" value="4">
-   <param name="gl_multisamplebuffer" value="4">
+   <param name="gl_multisamplebuffer" value="0">
    <param name="gl_debug" value="false">
    <param name="gl_trace" value="false">
    <comment>
      <embed code="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run"
-          width="640" height="480"
+          width="800" height="400"
           type="application/x-java-applet;version=1.6"
           pluginspage="http://java.sun.com/javase/downloads/ea.jsp"
           archive="jar/gluegen-rt.jar,
+                   jar/joal.jar,
                    jar/jogl-all.jar,
                    jar/jogl-test.jar"
           gl_event_listener_class="com.jogamp.opengl.test.junit.graph.demos.GPUUISceneGLListener0A"
           gl_profile="GL2ES2"
           gl_swap_interval="1"
           gl_alpha="4"
-          gl_multisamplebuffer="4"
+          gl_multisamplebuffer="0"
           gl_debug="false"
           gl_trace="false">
         <noembed>Sorry, no Java support detected.</noembed>
diff --git a/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo01.html b/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo01.html
index 3efc951..8c9e378 100644
--- a/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo01.html
+++ b/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo01.html
@@ -14,6 +14,7 @@ JOGL Graph UI-Scene Demo 01
       width="640" height="480">
    <param name="code" value="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run">
    <param name="archive" value="jar/gluegen-rt.jar,
+                                jar/joal.jar,
                                 jar/jogl-all.jar,
                                 jar/jogl-test.jar">
    <param name="gl_event_listener_class" value="com.jogamp.opengl.test.junit.graph.demos.GPUUISceneGLListener0A">
@@ -30,6 +31,7 @@ JOGL Graph UI-Scene Demo 01
           type="application/x-java-applet;version=1.6"
           pluginspage="http://java.sun.com/javase/downloads/ea.jsp"
           archive="jar/gluegen-rt.jar,
+                   jar/joal.jar,
                    jar/jogl-all.jar,
                    jar/jogl-test.jar"
           gl_event_listener_class="com.jogamp.opengl.test.junit.graph.demos.GPUUISceneGLListener0A"
diff --git a/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo02-napplet.html b/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo02-napplet.html
new file mode 100644
index 0000000..b82b828
--- /dev/null
+++ b/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo02-napplet.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>JOGL Graph UI-Scene Demo 01 MSAA-4 (NApplet)</title>
+</head>
+<body  BGCOLOR="#ffffff">
+
+<P>
+JOGL Graph UI-Scene Demo 01 MSAA-4
+</P>
+
+<P>
+<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
+      width="800" height="400">
+   <param name="code" value="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run">
+   <param name="archive" value="jar/gluegen-rt.jar,
+                                jar/joal.jar,
+                                jar/jogl-all.jar,
+                                jar/jogl-test.jar">
+   <param name="gl_event_listener_class" value="com.jogamp.opengl.test.junit.graph.demos.GPUUISceneGLListener0A>
+   <param name="gl_profile" value="GL2ES2">
+   <param name="gl_swap_interval" value="1">
+   <param name="gl_alpha" value="4">
+   <param name="gl_multisamplebuffer" value="4">
+   <param name="gl_debug" value="false">
+   <param name="gl_trace" value="false">
+   <comment>
+     <embed code="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run"
+          width="800" height="400"
+          type="application/x-java-applet;version=1.6"
+          pluginspage="http://java.sun.com/javase/downloads/ea.jsp"
+          archive="jar/gluegen-rt.jar,
+                   jar/joal.jar,
+                   jar/jogl-all.jar,
+                   jar/jogl-test.jar"
+          gl_event_listener_class="com.jogamp.opengl.test.junit.graph.demos.GPUUISceneGLListener02"
+          gl_profile="GL2ES2"
+          gl_swap_interval="1"
+          gl_alpha="4"
+          gl_multisamplebuffer="4"
+          gl_debug="false"
+          gl_trace="false">
+        <noembed>Sorry, no Java support detected.</noembed>
+     </embed>
+   </comment>
+</object>
+
+</P>
+
+<P>
+Graph UI-Scene Demo Keys:<br>
+<ul>
+    <li> none - use mouse </li>
+</ul>
+</P>
+<P>
+JOGL NEWT JNLP Applet Runner Special Keys:<br>
+<ul>
+    <li> d - toggle decoration </li>
+    <li> f - toggle fullscreen </li>
+    <li> r - in/out browser window </li>
+    <li> a - on/off always-on-top </li>
+    <li> c - change mouse pointer </li>
+    <li> i - invisible mouse pointer </li>
+    <li> w - warp mouse pointer to center </li>
+</ul>
+</P>
+
+</body>
+</html>
diff --git a/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo03-napplet.html b/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo03-napplet.html
new file mode 100644
index 0000000..e84e92c
--- /dev/null
+++ b/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo03-napplet.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>JOGL Graph UI-Scene Demo 01 VBAA (NApplet)</title>
+</head>
+<body  BGCOLOR="#ffffff">
+
+<P>
+JOGL Graph UI-Scene Demo 01 VBAA
+</P>
+
+<P>
+<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
+      width="800" height="400">
+   <param name="code" value="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run">
+   <param name="archive" value="jar/gluegen-rt.jar,
+                                jar/joal.jar,
+                                jar/jogl-all.jar,
+                                jar/jogl-test.jar">
+   <param name="gl_event_listener_class" value="com.jogamp.opengl.test.junit.graph.demos.GPUUISceneGLListener02>
+   <param name="gl_profile" value="GL2ES2">
+   <param name="gl_swap_interval" value="1">
+   <param name="gl_alpha" value="4">
+   <param name="gl_multisamplebuffer" value="0">
+   <param name="gl_debug" value="false">
+   <param name="gl_trace" value="false">
+   <comment>
+     <embed code="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run"
+          width="800" height="400"
+          type="application/x-java-applet;version=1.6"
+          pluginspage="http://java.sun.com/javase/downloads/ea.jsp"
+          archive="jar/gluegen-rt.jar,
+                   jar/joal.jar,
+                   jar/jogl-all.jar,
+                   jar/jogl-test.jar"
+          gl_event_listener_class="com.jogamp.opengl.test.junit.graph.demos.GPUUISceneGLListener02"
+          gl_profile="GL2ES2"
+          gl_swap_interval="1"
+          gl_alpha="4"
+          gl_multisamplebuffer="0"
+          gl_debug="false"
+          gl_trace="false">
+        <noembed>Sorry, no Java support detected.</noembed>
+     </embed>
+   </comment>
+</object>
+
+</P>
+
+<P>
+Graph UI-Scene Demo Keys:<br>
+<ul>
+    <li> none - use mouse </li>
+</ul>
+</P>
+<P>
+JOGL NEWT JNLP Applet Runner Special Keys:<br>
+<ul>
+    <li> d - toggle decoration </li>
+    <li> f - toggle fullscreen </li>
+    <li> r - in/out browser window </li>
+    <li> a - on/off always-on-top </li>
+    <li> c - change mouse pointer </li>
+    <li> i - invisible mouse pointer </li>
+    <li> w - warp mouse pointer to center </li>
+</ul>
+</P>
+
+</body>
+</html>
diff --git a/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo04-napplet.html b/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo04-napplet.html
new file mode 100644
index 0000000..db4be72
--- /dev/null
+++ b/jnlp-files/jogl-applet-runner-newt-GraphUISceneDemo04-napplet.html
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html>
+<head>
+<title>JOGL Graph UI-Scene Demo 01 Auto-AA (NApplet)</title>
+</head>
+<body  BGCOLOR="#ffffff">
+
+<P>
+JOGL Graph UI-Scene Demo 01 Auto-AA (VBAA for < 200 dpi)
+</P>
+
+<P>
+<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
+      width="800" height="400">
+   <param name="code" value="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run">
+   <param name="archive" value="jar/gluegen-rt.jar,
+                                jar/joal.jar,
+                                jar/jogl-all.jar,
+                                jar/jogl-test.jar">
+   <param name="gl_event_listener_class" value="com.jogamp.opengl.test.junit.graph.demos.GPUUISceneGLListener04>
+   <param name="gl_profile" value="GL2ES2">
+   <param name="gl_swap_interval" value="1">
+   <param name="gl_alpha" value="4">
+   <param name="gl_multisamplebuffer" value="0">
+   <param name="gl_debug" value="false">
+   <param name="gl_trace" value="false">
+   <comment>
+     <embed code="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run"
+          width="800" height="400"
+          type="application/x-java-applet;version=1.6"
+          pluginspage="http://java.sun.com/javase/downloads/ea.jsp"
+          archive="jar/gluegen-rt.jar,
+                   jar/joal.jar,
+                   jar/jogl-all.jar,
+                   jar/jogl-test.jar"
+          gl_event_listener_class="com.jogamp.opengl.test.junit.graph.demos.GPUUISceneGLListener04"
+          gl_profile="GL2ES2"
+          gl_swap_interval="1"
+          gl_alpha="4"
+          gl_multisamplebuffer="0"
+          gl_debug="false"
+          gl_trace="false">
+        <noembed>Sorry, no Java support detected.</noembed>
+     </embed>
+   </comment>
+</object>
+
+</P>
+
+<P>
+Graph UI-Scene Demo Keys:<br>
+<ul>
+    <li> none - use mouse </li>
+</ul>
+</P>
+<P>
+JOGL NEWT JNLP Applet Runner Special Keys:<br>
+<ul>
+    <li> d - toggle decoration </li>
+    <li> f - toggle fullscreen </li>
+    <li> r - in/out browser window </li>
+    <li> a - on/off always-on-top </li>
+    <li> c - change mouse pointer </li>
+    <li> i - invisible mouse pointer </li>
+    <li> w - warp mouse pointer to center </li>
+</ul>
+</P>
+
+</body>
+</html>
diff --git a/jnlp-files/jogl-applet-runner-newt-MovieCube-applet3-napplet.html b/jnlp-files/jogl-applet-runner-newt-MovieCube-applet3-napplet.html
index 590bf30..ac7e582 100644
--- a/jnlp-files/jogl-applet-runner-newt-MovieCube-applet3-napplet.html
+++ b/jnlp-files/jogl-applet-runner-newt-MovieCube-applet3-napplet.html
@@ -11,7 +11,7 @@ JogAmp's Applet3 MovieCube - GLMediaPlayer Demo 01
 
 <P>
 <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
-      width="510" height="300">
+      width="800" height="600">
    <param name="code" value="com.jogamp.newt.util.applet.JOGLNewtApplet3Run">
    <param name="archive" value="jar/gluegen-rt.jar,
                                 jar/joal.jar,
@@ -24,7 +24,7 @@ JogAmp's Applet3 MovieCube - GLMediaPlayer Demo 01
    <param name="gl_trace" value="false">
    <comment>
      <embed code="com.jogamp.newt.util.applet.JOGLNewtApplet3Run"
-          width="510" height="300"
+          width="800" height="600"
           type="application/x-java-applet;version=1.6"
           pluginspage="http://java.sun.com/javase/downloads/ea.jsp"
           archive="jar/gluegen-rt.jar,
diff --git a/jnlp-files/jogl-applet-runner-newt-MovieCube-napplet.html b/jnlp-files/jogl-applet-runner-newt-MovieCube-napplet.html
index 3630a15..c0e9bd2 100644
--- a/jnlp-files/jogl-applet-runner-newt-MovieCube-napplet.html
+++ b/jnlp-files/jogl-applet-runner-newt-MovieCube-napplet.html
@@ -11,7 +11,7 @@ JogAmp's MovieCube - GLMediaPlayer Demo 01
 
 <P>
 <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
-      width="510" height="300">
+      width="800" height="600">
    <param name="code" value="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run">
    <param name="archive" value="jar/gluegen-rt.jar,
                                 jar/joal.jar,
@@ -24,7 +24,7 @@ JogAmp's MovieCube - GLMediaPlayer Demo 01
    <param name="gl_trace" value="false">
    <comment>
      <embed code="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run"
-          width="510" height="300"
+          width="800" height="600"
           type="application/x-java-applet;version=1.6"
           pluginspage="http://java.sun.com/javase/downloads/ea.jsp"
           archive="jar/gluegen-rt.jar,
diff --git a/jnlp-files/jogl-applet-runner-newt-MovieCube.html b/jnlp-files/jogl-applet-runner-newt-MovieCube.html
index ba9a25c..0de7b41 100644
--- a/jnlp-files/jogl-applet-runner-newt-MovieCube.html
+++ b/jnlp-files/jogl-applet-runner-newt-MovieCube.html
@@ -11,7 +11,7 @@ JogAmp's MovieCube - GLMediaPlayer Demo 01
 
 <P>
 <object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
-      width="510" height="300">
+      width="800" height="600">
    <param name="code" value="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run">
    <param name="archive" value="jar/gluegen-rt.jar,
                                 jar/joal.jar,
@@ -25,7 +25,7 @@ JogAmp's MovieCube - GLMediaPlayer Demo 01
    <param name="jnlp_href" value="jogl-applet-runner-newt.jnlp">
    <comment>
      <embed code="com.jogamp.newt.awt.applet.JOGLNewtApplet1Run"
-          width="510" height="300"
+          width="800" height="600"
           type="application/x-java-applet;version=1.6"
           pluginspage="http://java.sun.com/javase/downloads/ea.jsp"
           archive="jar/gluegen-rt.jar,
diff --git a/jnlp-files/jogl-test-applets.html b/jnlp-files/jogl-test-applets.html
index 106a56a..55db0ca 100644
--- a/jnlp-files/jogl-test-applets.html
+++ b/jnlp-files/jogl-test-applets.html
@@ -140,8 +140,11 @@ See Legend below table
                 </a>
             </td>
             <td>
-                <a href="jogl-applet-runner-newt-GraphUISceneDemo01-napplet.html">NApplet</a><br/>
-                <a href="jogl-applet-runner-newt-GraphUISceneDemo01.html">Dual</a><br/>
+                <a href="jogl-applet-runner-newt-GraphUISceneDemo04-napplet.html">Auto</a><br/>
+                <a href="jogl-applet-runner-newt-GraphUISceneDemo03-napplet.html">VBAA</a><br/>
+                <a href="jogl-applet-runner-newt-GraphUISceneDemo02-napplet.html">MSAA</a><br/>
+                <a href="jogl-applet-runner-newt-GraphUISceneDemo01-napplet.html">NONE</a><br/>
+                <!-- a href="jogl-applet-runner-newt-GraphUISceneDemo01.html">Dual</a><br/ -->
             </td>
             <td>
                 Demonstration of GPU accelerated Text and UI rendering and interaction
diff --git a/make/build-common.xml b/make/build-common.xml
index 1a5703a..d0eb515 100644
--- a/make/build-common.xml
+++ b/make/build-common.xml
@@ -55,6 +55,7 @@
         <property name="src"                        value="${project.root}/src" />
         <property name="lib"                        value="${build}/lib" />
         <property name="jar"                        value="${build}/jar" />
+        <property name="jar-atomic"                 value="${build}/jar/atomic" />
 
         <property name="all.srcj.path" value="${src}/nativewindow/classes;${src}/jogl/classes;${src}/newt/classes" />
         <!-- No generated classes for Newt at the present time -->
@@ -209,8 +210,6 @@
         <property name="build.gluegen"              value="${gluegen.root}/${rootrel.build}" />
         <property name="obj.gluegen"                value="${build.gluegen}/obj"/>
         <property name="gluegen.jar"                value="${build.gluegen}/gluegen.jar" />
-        <property name="ant.jar"                    value="${ant.home}/lib/ant.jar" />
-        <property name="ant-junit.jar"              value="${ant.home}/lib/ant-junit.jar" />
 
         <property name="build.joal"                 value="${joal.root}/${rootrel.build}" /> <!-- optional -->
 
@@ -230,9 +229,21 @@
         <property name="build.newt"                 value="${build}/newt" />
         <property name="obj.newt"                   value="${build.newt}/obj"/>
 
-        <property name="results.test"              value="${build}/test/results" />
-        <property name="build.test"                value="${build}/test/build" />
-        <property name="obj.test"                  value="${build.test}/obj"/>
+        <property name="oculusvr.make"              value="." />
+        <property name="oculusvr.build.xml"         value="${oculusvr.make}/build-oculusvr.xml" />
+        <property name="build.oculusvr"             value="${build}/oculusvr" />
+        <property name="obj.oculusvr"               value="${build.oculusvr}/obj"/>
+        <property name="rootrel.obj.oculusvr"       value="${rootrel.build}/oculusvr/obj"/>
+
+        <property name="rootrel.oculusvr.sdk"       value="oculusvr-sdk"/>
+        <property name="rel.oculusvr.sdk"           value="${project.root}/${rootrel.oculusvr.sdk}"/>
+        <condition property="oculusvr.sdk.available">
+            <available file="${rel.oculusvr.sdk}/LibOVR/Src/OVR_CAPI.h"/>
+        </condition>
+
+        <property name="results.test"               value="${build}/test/results" />
+        <property name="build.test"                 value="${build}/test/build" />
+        <property name="obj.test"                   value="${build.test}/obj"/>
 
         <condition property="obj.custom" value="${custom.libdir}${path.separator}" else="">
           <isset property="custom.libdir"/>
@@ -240,11 +251,14 @@
 
         <property name="obj.all.paths"              value="${obj.custom}${obj.gluegen}${path.separator}${obj.nativewindow}${path.separator}${obj.jogl}${path.separator}${obj.newt}${path.separator}${obj.test}" />
 
+        <!-- Add the GlueGen task to ANT -->
         <path id="gluegen.classpath">
           <pathelement location="${gluegen.jar}" />
           <pathelement location="${antlr.jar}" />
         </path>
-
+        <taskdef name="gluegen" classname="com.jogamp.gluegen.ant.GlueGenTask"
+                 classpathref="gluegen.classpath" />
+        
         <property name="gluegen-gl.jar"             value="${build.jogl}/gluegen-gl.jar" />
 
         <path id="gluegen-gl.classpath">
@@ -254,54 +268,54 @@
 
         <!-- Atomic JavaSE JARS -->
 
-        <property name="nativewindow-core.jar"         value="${build.nativewindow}/nativewindow-core.jar" />
-        <property name="nativewindow-awt.jar"          value="${build.nativewindow}/nativewindow-awt.jar"  />
-        <property name="nativewindow-os-x11.jar"       value="${build.nativewindow}/nativewindow-os-x11.jar"  />
-        <property name="nativewindow-os-win.jar"       value="${build.nativewindow}/nativewindow-os-win.jar"  />
-        <property name="nativewindow-os-osx.jar"       value="${build.nativewindow}/nativewindow-os-osx.jar"  />
+        <property name="nativewindow.jar"        value="${build.nativewindow}/nativewindow.jar" />
+        <property name="nativewindow-awt.jar"    value="${build.nativewindow}/nativewindow-awt.jar"  />
+        <property name="nativewindow-os-x11.jar" value="${build.nativewindow}/nativewindow-os-x11.jar"  />
+        <property name="nativewindow-os-win.jar" value="${build.nativewindow}/nativewindow-os-win.jar"  />
+        <property name="nativewindow-os-osx.jar" value="${build.nativewindow}/nativewindow-os-osx.jar"  />
 
         <path id="nativewindow_all_atoms.classpath">
-            <pathelement location="${nativewindow-core.jar}" />
+            <pathelement location="${nativewindow.jar}" />
             <pathelement location="${nativewindow-awt.jar}" />
             <pathelement location="${nativewindow-os-x11.jar}" />
             <pathelement location="${nativewindow-os-win.jar}" />
             <pathelement location="${nativewindow-os-osx.jar}" />
         </path>
         <path id="nativewindow_all-noawt_atoms.classpath">
-            <pathelement location="${nativewindow-core.jar}" />
+            <pathelement location="${nativewindow.jar}" />
             <pathelement location="${nativewindow-os-x11.jar}" />
             <pathelement location="${nativewindow-os-win.jar}" />
             <pathelement location="${nativewindow-os-osx.jar}" />
         </path>
         <path id="nativewindow_core_atoms.classpath">
-            <pathelement location="${nativewindow-core.jar}" />
+            <pathelement location="${nativewindow.jar}" />
         </path>
         
-        <property name="jogl-core.jar"                  value="${build.jogl}/jogl-core.jar" />
-        <property name="jogl-sdk.jar"                   value="${build.jogl}/jogl-sdk.jar" />
-        <property name="jogl-glmobile.jar"              value="${build.jogl}/jogl-glmobile.jar" />
-        <property name="jogl-glmobile-dbg.jar"          value="${build.jogl}/jogl-glmobile-dbg.jar" />
-        <property name="jogl-util.jar"                  value="${build.jogl}/jogl-util.jar" />
-        <property name="jogl-util-graph.jar"            value="${build.jogl}/jogl-util-graph.jar" />
-        <property name="jogl-util-graph-fonts-p0.jar"   value="${build.jogl}/jogl-fonts-p0.jar" />
-        <property name="jogl-util-fixedfuncemu.jar"     value="${build.jogl}/jogl-util-fixedfuncemu.jar" />
-        <property name="jogl-awt.jar"                   value="${build.jogl}/jogl-awt.jar" />
-        <property name="jogl-swt.jar"                   value="${build.jogl}/jogl-swt.jar" />
-        <property name="jogl-util-awt.jar"              value="${build.jogl}/jogl-util-awt.jar" />
-        <property name="jogl-os-x11.jar"                value="${build.jogl}/jogl-os-x11.jar" />
-        <property name="jogl-os-win.jar"                value="${build.jogl}/jogl-os-win.jar" />
-        <property name="jogl-os-osx.jar"                value="${build.jogl}/jogl-os-osx.jar" />
-        <property name="jogl-os-android.jar"            value="${build.jogl}/jogl-os-android.jar" />
-        <property name="jogl-gldesktop.jar"             value="${build.jogl}/jogl-gldesktop.jar" />
-        <property name="jogl-gldesktop-dbg.jar"         value="${build.jogl}/jogl-gldesktop-dbg.jar" />
-        <property name="jogl-glu.jar"                   value="${build.jogl}/jogl-glu.jar" />
-        <property name="jogl-glu-gldesktop.jar"         value="${build.jogl}/jogl-glu-gldesktop.jar" />
-        <property name="jogl-util-gldesktop.jar"        value="${build.jogl}/jogl-util-gldesktop.jar" />
-        <property name="jogl-omx.jar"                   value="${build.jogl}/jogl-omx.jar" />
-        <property name="jogl-cg.jar"                    value="${build.jogl}/jogl-cg.jar" />
+        <property name="jogl.jar"                     value="${build.jogl}/jogl.jar" />
+        <property name="jogl-sdk.jar"                 value="${build.jogl}/jogl-sdk.jar" />
+        <property name="jogl-glmobile.jar"            value="${build.jogl}/jogl-glmobile.jar" />
+        <property name="jogl-glmobile-dbg.jar"        value="${build.jogl}/jogl-glmobile-dbg.jar" />
+        <property name="jogl-util.jar"                value="${build.jogl}/jogl-util.jar" />
+        <property name="jogl-util-graph.jar"          value="${build.jogl}/jogl-util-graph.jar" />
+        <property name="jogl-util-graph-fonts-p0.jar" value="${build.jogl}/jogl-fonts-p0.jar" />
+        <property name="jogl-util-fixedfuncemu.jar"   value="${build.jogl}/jogl-util-fixedfuncemu.jar" />
+        <property name="jogl-awt.jar"                 value="${build.jogl}/jogl-awt.jar" />
+        <property name="jogl-swt.jar"                 value="${build.jogl}/jogl-swt.jar" />
+        <property name="jogl-util-awt.jar"            value="${build.jogl}/jogl-util-awt.jar" />
+        <property name="jogl-os-x11.jar"              value="${build.jogl}/jogl-os-x11.jar" />
+        <property name="jogl-os-win.jar"              value="${build.jogl}/jogl-os-win.jar" />
+        <property name="jogl-os-osx.jar"              value="${build.jogl}/jogl-os-osx.jar" />
+        <property name="jogl-os-android.jar"          value="${build.jogl}/jogl-os-android.jar" />
+        <property name="jogl-gldesktop.jar"           value="${build.jogl}/jogl-gldesktop.jar" />
+        <property name="jogl-gldesktop-dbg.jar"       value="${build.jogl}/jogl-gldesktop-dbg.jar" />
+        <property name="jogl-glu.jar"                 value="${build.jogl}/jogl-glu.jar" />
+        <property name="jogl-glu-gldesktop.jar"       value="${build.jogl}/jogl-glu-gldesktop.jar" />
+        <property name="jogl-util-gldesktop.jar"      value="${build.jogl}/jogl-util-gldesktop.jar" />
+        <property name="jogl-omx.jar"                 value="${build.jogl}/jogl-omx.jar" />
+        <property name="jogl-cg.jar"                  value="${build.jogl}/jogl-cg.jar" />
 
         <path id="jogl_all_atoms.classpath">
-            <pathelement location="${jogl-core.jar}" />
+            <pathelement location="${jogl.jar}" />
             <pathelement location="${jogl-sdk.jar}" />
             <pathelement location="${jogl-glmobile.jar}" />
             <pathelement location="${jogl-glmobile-dbg.jar}" />
@@ -322,7 +336,7 @@
             <pathelement location="${jogl-omx.jar}" />
         </path>
         <path id="jogl_all-noawt_atoms.classpath">
-            <pathelement location="${jogl-core.jar}" />
+            <pathelement location="${jogl.jar}" />
             <pathelement location="${jogl-sdk.jar}" />
             <pathelement location="${jogl-glmobile.jar}" />
             <pathelement location="${jogl-glmobile-dbg.jar}" />
@@ -340,7 +354,7 @@
             <pathelement location="${jogl-omx.jar}" />
         </path>
         <path id="jogl_all-mobile_atoms.classpath">
-            <pathelement location="${jogl-core.jar}" />
+            <pathelement location="${jogl.jar}" />
             <pathelement location="${jogl-glmobile.jar}" />
             <pathelement location="${jogl-glmobile-dbg.jar}" />
             <pathelement location="${jogl-util.jar}" />
@@ -351,7 +365,7 @@
             <pathelement location="${jogl-omx.jar}" />
         </path>
         <path id="jogl_all-android_atoms.classpath">
-            <pathelement location="${jogl-core.jar}" />
+            <pathelement location="${jogl.jar}" />
             <pathelement location="${jogl-glmobile.jar}" />
             <pathelement location="${jogl-glmobile-dbg.jar}" />
             <pathelement location="${jogl-util.jar}" />
@@ -362,24 +376,24 @@
             <pathelement location="${jogl-omx.jar}" />
         </path>
         <!-- 
-            ${jogl-core.jar} ${jogl-glu.jar} ${jogl-glu-gldesktop.jar} ${jogl-os-x11.jar} ${jogl-os-win.jar} ${jogl-os-osx.jar} ${jogl-gldesktop.jar} ${jogl-gldesktop-dbg.jar} ${jogl-glmobile.jar} ${jogl-glmobile-dbg.jar} ${jogl-omx.jar} ${jogl-util.jar} ${jogl-util-graph.jar} ${jogl-util-gldesktop.jar} ${jogl-util-awt.jar} ${jogl-util-fixedfuncemu.jar} ${jogl-sdk.jar} -->
-
-        <property name="newt-core.jar"                  value="${build.newt}/newt-core.jar" />
-        <property name="newt-ogl.jar"                   value="${build.newt}/newt-ogl.jar" />
-        <property name="newt-awt.jar"                   value="${build.newt}/newt-awt.jar" />
-        <property name="newt-swt.jar"                   value="${build.newt}/newt-swt.jar" />
-        <property name="newt-event.jar"                 value="${build.newt}/newt-event.jar" />              <!-- using NEWT events w/o NEWT -->
-        <property name="newt-driver-linux.jar"          value="${build.newt}/newt-driver-linux.jar" />
-        <property name="newt-driver-x11.jar"            value="${build.newt}/newt-driver-x11.jar" />
-        <property name="newt-driver-win.jar"            value="${build.newt}/newt-driver-win.jar" />
-        <property name="newt-driver-osx.jar"            value="${build.newt}/newt-driver-osx.jar" />
-        <property name="newt-driver-android.jar"        value="${build.newt}/newt-driver-android.jar" />     <!-- excluded from all -->
-        <property name="newt-driver-kd.jar"             value="${build.newt}/newt-driver-kd.jar" />          <!-- excluded from all -->
-        <property name="newt-driver-intelgdl.jar"       value="${build.newt}/newt-driver-intelgdl.jar" />    <!-- excluded from all -->
-        <property name="newt-driver-bcm-old.jar"        value="${build.newt}/newt-driver-bcm-old.jar" />     <!-- excluded from all -->
-        <property name="newt-driver-bcm-vc.jar"         value="${build.newt}/newt-driver-bcm-vc.jar" />
+            ${jogl.jar} ${jogl-glu.jar} ${jogl-glu-gldesktop.jar} ${jogl-os-x11.jar} ${jogl-os-win.jar} ${jogl-os-osx.jar} ${jogl-gldesktop.jar} ${jogl-gldesktop-dbg.jar} ${jogl-glmobile.jar} ${jogl-glmobile-dbg.jar} ${jogl-omx.jar} ${jogl-util.jar} ${jogl-util-graph.jar} ${jogl-util-gldesktop.jar} ${jogl-util-awt.jar} ${jogl-util-fixedfuncemu.jar} ${jogl-sdk.jar} -->
+
+        <property name="newt.jar"                 value="${build.newt}/newt.jar" />
+        <property name="newt-ogl.jar"             value="${build.newt}/newt-ogl.jar" />
+        <property name="newt-awt.jar"             value="${build.newt}/newt-awt.jar" />
+        <property name="newt-swt.jar"             value="${build.newt}/newt-swt.jar" />
+        <property name="newt-event.jar"           value="${build.newt}/newt-event.jar" />              <!-- using NEWT events w/o NEWT -->
+        <property name="newt-driver-linux.jar"    value="${build.newt}/newt-driver-linux.jar" />
+        <property name="newt-driver-x11.jar"      value="${build.newt}/newt-driver-x11.jar" />
+        <property name="newt-driver-win.jar"      value="${build.newt}/newt-driver-win.jar" />
+        <property name="newt-driver-osx.jar"      value="${build.newt}/newt-driver-osx.jar" />
+        <property name="newt-driver-android.jar"  value="${build.newt}/newt-driver-android.jar" />     <!-- excluded from all -->
+        <property name="newt-driver-kd.jar"       value="${build.newt}/newt-driver-kd.jar" />          <!-- excluded from all -->
+        <property name="newt-driver-intelgdl.jar" value="${build.newt}/newt-driver-intelgdl.jar" />    <!-- excluded from all -->
+        <property name="newt-driver-bcm-old.jar"  value="${build.newt}/newt-driver-bcm-old.jar" />     <!-- excluded from all -->
+        <property name="newt-driver-bcm-vc.jar"   value="${build.newt}/newt-driver-bcm-vc.jar" />
         <path id="newt_all_atoms.classpath">
-            <pathelement location="${newt-core.jar}" />
+            <pathelement location="${newt.jar}" />
             <pathelement location="${newt-ogl.jar}" />
             <pathelement location="${newt-awt.jar}" />
             <pathelement location="${newt-swt.jar}" />
@@ -390,7 +404,7 @@
             <pathelement location="${newt-driver-bcm-vc.jar}" />
         </path>
         <path id="newt_all-noawt_atoms.classpath">
-            <pathelement location="${newt-core.jar}" />
+            <pathelement location="${newt.jar}" />
             <pathelement location="${newt-ogl.jar}" />
             <pathelement location="${newt-driver-linux.jar}" />
             <pathelement location="${newt-driver-x11.jar}" />
@@ -399,7 +413,7 @@
             <pathelement location="${newt-driver-bcm-vc.jar}" />
         </path>
         <path id="newt_all-mobile_atoms.classpath">
-            <pathelement location="${newt-core.jar}" />
+            <pathelement location="${newt.jar}" />
             <pathelement location="${newt-ogl.jar}" />
             <pathelement location="${newt-driver-linux.jar}" />
             <pathelement location="${newt-driver-x11.jar}" />
@@ -407,14 +421,20 @@
             <pathelement location="${newt-driver-bcm-vc.jar}" />
         </path>
         <path id="newt_all-android_atoms.classpath">
-            <pathelement location="${newt-core.jar}" />
+            <pathelement location="${newt.jar}" />
             <pathelement location="${newt-ogl.jar}" />
             <pathelement location="${newt-driver-android.jar}" />
         </path>
 
+        <property name="oculusvr.jar"                   value="${jar-atomic}/oculusvr.jar" />
+        <path id="oculusvr_all_atoms.classpath">
+            <pathelement location="${oculusvr.jar}" />
+        </path>
+
         <!-- JavaSE combinations -->
         <property name="gluegen-rt.jar"                 value="${build.gluegen}/gluegen-rt.jar" />
         <property name="gluegen-rt-android.jar"         value="${build.gluegen}/gluegen-rt-android.jar" />
+        <property name="gluegen-test-util.jar"          value="${build.gluegen}/gluegen-test-util.jar" />
         <property name="jogl-test.jar"                  value="${jar}/jogl-test.jar"/>
         <property name="jogl-test-android.jar"          value="${jar}/jogl-test-android.jar"/>
         <property name="jogl-test-android.apk"          value="${jar}/jogl-test-android.apk"/>
@@ -485,11 +505,29 @@
             <pathelement location="${junit.jar}" />
             <pathelement location="${ant.jar}" />
             <pathelement location="${ant-junit.jar}" />
+            <pathelement location="${ant-junit4.jar}" />
+            <pathelement location="${semver.jar}" />
+            <pathelement location="${gluegen-rt.jar}" />
+            <pathelement location="${gluegen-test-util.jar}" />
+            <pathelement location="${swt.jar}" />
+            <path refid="nativewindow_all_atoms.classpath" />
+            <path refid="jogl_all_atoms.classpath" />
+            <path refid="newt_all_atoms.classpath" />
+        </path>
+
+        <path id="junit_jogl_newt_oculusvr.compile.classpath">
+            <pathelement location="${junit.jar}" />
+            <pathelement location="${ant.jar}" />
+            <pathelement location="${ant-junit.jar}" />
+            <pathelement location="${ant-junit4.jar}" />
+            <pathelement location="${semver.jar}" />
             <pathelement location="${gluegen-rt.jar}" />
+            <pathelement location="${gluegen-test-util.jar}" />
             <pathelement location="${swt.jar}" />
             <path refid="nativewindow_all_atoms.classpath" />
             <path refid="jogl_all_atoms.classpath" />
             <path refid="newt_all_atoms.classpath" />
+            <path refid="oculusvr_all_atoms.classpath"/>
         </path>
 
         <path id="junit_jogl_newt_android.compile.classpath">
@@ -497,7 +535,10 @@
             <pathelement location="${junit.jar}" />
             <pathelement location="${ant.jar}" />
             <pathelement location="${ant-junit.jar}" />
+            <pathelement location="${ant-junit4.jar}" />
+            <pathelement location="${semver.jar}" />
             <pathelement location="${gluegen-rt-android.jar}" />
+            <pathelement location="${gluegen-test-util.jar}" />
             <pathelement location="${swt.jar}" />
             <path refid="nativewindow_all_atoms.classpath" />
             <path refid="jogl_all_atoms.classpath" />
@@ -511,6 +552,7 @@
             <pathelement location="${gluegen-rt.jar}" />
             <pathelement location="${swt.jar}" />
             <pathelement location="${jogl-all.jar}" />
+            <pathelement location="${oculusvr.jar}" />
         </path>
 
         <!-- Test Run w/ AWT .. -->
@@ -518,54 +560,70 @@
             <pathelement location="${junit.jar}" />
             <pathelement location="${ant.jar}" />
             <pathelement location="${ant-junit.jar}" />
+            <pathelement location="${ant-junit4.jar}" />
+            <pathelement location="${semver.jar}" />
             <pathelement location="${gluegen-rt.jar}" />
+            <pathelement location="${gluegen-test-util.jar}" />
             <pathelement location="${jogl-all.jar}" />
+            <pathelement location="${oculusvr.jar}" />
             <pathelement location="${jogl-test.jar}" />
         </path>
         <property name="junit_jogl_awt.run.jars"
-                  value="${junit.jar}${path.separator}${ant.jar}${path.separator}${ant-junit.jar}${path.separator}${gluegen-rt.jar}${path.separator}${jogl-all.jar}${path.separator}${jogl-test.jar}"/>
-        <property name="junit_jogl_awt.run.remote.jars" value="${junit.jar}${path.separator}${env.TARGET_ANT_HOME}/lib/ant.jar${path.separator}${env.TARGET_ANT_HOME}/lib/ant-junit.jar${path.separator}${gluegen-rt.jar}${path.separator}${jogl-all.jar}${path.separator}${jogl-test.jar}"/>
+                  value="${junit.jar}${path.separator}${ant.jar}${path.separator}${ant-junit.jar}${path.separator}${ant-junit4.jar}${path.separator}${semver.jar}${path.separator}${gluegen-rt.jar}${path.separator}${gluegen-test-util.jar}${path.separator}${jogl-all.jar}${path.separator}${oculusvr.jar}${path.separator}${jogl-test.jar}"/>
+        <property name="junit_jogl_awt.run.remote.jars" value="${junit.jar}${path.separator}${env.TARGET_ANT_HOME}/lib/ant.jar${path.separator}${env.TARGET_ANT_HOME}/lib/ant-junit.jar${path.separator}${env.TARGET_ANT_HOME}/lib/ant-junit4.jar${path.separator}${semver.jar}${path.separator}${gluegen-rt.jar}${path.separator}${gluegen-test-util.jar}${path.separator}${jogl-all.jar}${path.separator}${oculusvr.jar}${path.separator}${jogl-test.jar}"/>
 
         <!-- Test Run w/o AWT .. -->
         <path id="junit_jogl_noawt.run.classpath">
             <pathelement location="${junit.jar}" />
             <pathelement location="${ant.jar}" />
             <pathelement location="${ant-junit.jar}" />
+            <pathelement location="${ant-junit4.jar}" />
+            <pathelement location="${semver.jar}" />
             <pathelement location="${gluegen-rt.jar}" />
+            <pathelement location="${gluegen-test-util.jar}" />
             <pathelement location="${jogl-all-noawt.jar}" />
+            <pathelement location="${oculusvr.jar}" />
             <pathelement location="${jogl-test.jar}" />
         </path>
         <property name="junit_jogl_noawt.run.jars"
-                  value="${junit.jar}${path.separator}${ant.jar}${path.separator}${ant-junit.jar}${path.separator}${gluegen-rt.jar}${path.separator}${jogl-all-noawt.jar}${path.separator}${jogl-test.jar}"/>
-        <property name="junit_jogl_noawt.run.remote.jars" value="${junit.jar}${path.separator}${env.TARGET_ANT_HOME}/lib/ant.jar${path.separator}${env.TARGET_ANT_HOME}/lib/ant-junit.jar${path.separator}${gluegen-rt.jar}${path.separator}${jogl-all-noawt.jar}${path.separator}${jogl-test.jar}"/>
+                  value="${junit.jar}${path.separator}${ant.jar}${path.separator}${ant-junit.jar}${path.separator}${ant-junit4.jar}${path.separator}${semver.jar}${path.separator}${gluegen-rt.jar}${path.separator}${gluegen-test-util.jar}${path.separator}${jogl-all-noawt.jar}${path.separator}${oculusvr.jar}${path.separator}${jogl-test.jar}"/>
+        <property name="junit_jogl_noawt.run.remote.jars" value="${junit.jar}${path.separator}${env.TARGET_ANT_HOME}/lib/ant.jar${path.separator}${env.TARGET_ANT_HOME}/lib/ant-junit.jar${path.separator}${env.TARGET_ANT_HOME}/lib/ant-junit4.jar${path.separator}${semver.jar}${path.separator}${gluegen-rt.jar}${path.separator}${gluegen-test-util.jar}${path.separator}${jogl-all-noawt.jar}${path.separator}${oculusvr.jar}${path.separator}${jogl-test.jar}"/>
 
         <!-- Test Run w/ SWT .. -->
         <path id="junit_jogl_swt.run.classpath">
           <pathelement location="${junit.jar}" />
           <pathelement location="${ant.jar}" />
           <pathelement location="${ant-junit.jar}" />
+          <pathelement location="${ant-junit4.jar}" />
+          <pathelement location="${semver.jar}" />
           <pathelement location="${gluegen-rt.jar}" />
+          <pathelement location="${gluegen-test-util.jar}" />
           <pathelement location="${swt.jar}" />
           <pathelement location="${jogl-all.jar}" />
+          <pathelement location="${oculusvr.jar}" />
           <pathelement location="${jogl-test.jar}" />
         </path>
         <property name="junit_jogl_swt.run.jars"
-                  value="${junit.jar}${path.separator}${ant.jar}${path.separator}${ant-junit.jar}${path.separator}${gluegen-rt.jar}${path.separator}${swt.jar}${path.separator}${jogl-all.jar}${path.separator}${jogl-test.jar}"/>
+                  value="${junit.jar}${path.separator}${ant.jar}${path.separator}${ant-junit.jar}${path.separator}${ant-junit4.jar}${path.separator}${semver.jar}${path.separator}${gluegen-rt.jar}${path.separator}${gluegen-test-util.jar}${path.separator}${swt.jar}${path.separator}${jogl-all.jar}${path.separator}${oculusvr.jar}${path.separator}${jogl-test.jar}"/>
 
         <!-- Test Run w/ Android [w/o AWT] .. -->
         <path id="junit_jogl_android.run.classpath">
             <pathelement location="${junit.jar}" />
             <pathelement location="${ant.jar}" />
             <pathelement location="${ant-junit.jar}" />
+            <pathelement location="${ant-junit4.jar}" />
             <pathelement location="${android.jar}" />
+            <pathelement location="${semver.jar}" />
             <pathelement location="${gluegen-rt-android.jar}" />
+            <pathelement location="${gluegen-test-util.jar}" />
             <pathelement location="${jogl-all-android.jar}" />
+            <pathelement location="${oculusvr.jar}" />
             <pathelement location="${jogl-test.jar}" />
         </path>
         <property name="junit_jogl_android.run.jars"
-                  value="${junit.jar}${path.separator}${ant.jar}${path.separator}${ant-junit.jar}${path.separator}${gluegen-rt-android.jar}${path.separator}${jogl-all-android.jar}${path.separator}${jogl-test.jar}"/>
+                  value="${junit.jar}${path.separator}${ant.jar}${path.separator}${ant-junit.jar}${path.separator}${ant-junit4.jar}${path.separator}${semver.jar}${path.separator}${gluegen-rt-android.jar}${path.separator}${gluegen-test-util.jar}${path.separator}${jogl-all-android.jar}${path.separator}${oculusvr.jar}${path.separator}${jogl-test.jar}"/>
         <property name="junit.run.remote.apks" 
-                  value="${gluegen.root}/${rootrel.build}/jogamp.android-launcher.apk${path.separator}${ant-junit-all.apk}${path.separator}${gluegen.root}/${rootrel.build}/gluegen-rt-android-${android.abi}.apk${path.separator}${jogl-all-android.apk}${path.separator}${jogl-test.apk}"/>
+                  value="${gluegen.root}/${rootrel.build}/jogamp.android-launcher.apk${path.separator}${ant-junit-all.apk}${path.separator}${gluegen.root}/${rootrel.build}/gluegen-rt-android-${android.abi}.apk${path.separator}${jogl-all-android.apk}${path.separator}${oculusvr.jar}${path.separator}${jogl-test.apk}"/>
 
         <!-- Dummy extra CLASSPATH value, maybe overwritten -->  
         <property name="junit_extra_classpath" value=""/>
diff --git a/make/build-jogl.xml b/make/build-jogl.xml
index 4cdb93f..4efe992 100644
--- a/make/build-jogl.xml
+++ b/make/build-jogl.xml
@@ -93,7 +93,7 @@
 
         <property name="java.part.core" 
                   value="${java.part.gluegen-gl-rt} javax/media/opengl/* javax/media/opengl/fixedfunc/* com/jogamp/opengl/* com/jogamp/opengl/math/** jogamp/opengl/* ${java.part.core.util}"/>
-        <property name="java.part.core.exclude" value="javax/media/opengl/Debug* javax/media/opengl/Trace* com/jogamp/opengl/util/AWTAnimatorImpl*"/>
+        <property name="java.part.core.exclude" value="javax/media/opengl/Debug* javax/media/opengl/Trace* com/jogamp/opengl/util/AWTAnimatorImpl* com/jogamp/opengl/util/PNG*"/>
 
         <property name="java.part.nv-cg"
                   value="com/jogamp/opengl/cg com/jogamp/opengl/cg/* jogamp/opengl/cg/*"/>
@@ -153,7 +153,7 @@
                   value="com/jogamp/opengl/**/swt/**"/>
 
         <property name="java.part.util"
-                  value="com/jogamp/opengl/util/texture/** com/jogamp/opengl/util/av/* com/jogamp/opengl/util/packrect/** jogamp/opengl/util/av/** jogamp/opengl/util/jpeg/** jogamp/opengl/util/pngj/**"/>
+                  value="com/jogamp/opengl/util/texture/** com/jogamp/opengl/util/av/* com/jogamp/opengl/util/packrect/** com/jogamp/opengl/util/PNG* com/jogamp/opengl/util/stereo/** jogamp/opengl/util/av/** jogamp/opengl/util/jpeg/** jogamp/opengl/util/pngj/** jogamp/opengl/util/stereo/**"/>
 
         <property name="java.part.util.awt"
                   value="com/jogamp/opengl/util/**/awt/**"/>
@@ -173,6 +173,9 @@
         <property name="java.part.core.shadercode"
                   value="jogamp/opengl/shader/* jogamp/opengl/shader/bin/**"/>
 
+        <property name="java.part.util.shadercode"
+                  value="jogamp/opengl/util/stereo/shader/*"/>
+
         <property name="java.part.util.graph.shadercode"
                   value="jogamp/graph/curve/opengl/shader/* jogamp/graph/curve/opengl/shader/bin/**"/>
 
@@ -183,7 +186,7 @@
                   value="jogamp/opengl/util/glsl/fixedfunc/shaders/* jogamp/opengl/util/glsl/fixedfunc/shaders/bin/**"/>
 
         <property name="java.part.nonjava" 
-                  value="${java.part.core.shadercode} ${java.part.util.fixedfuncemu.shadercode} ${java.part.util.graph.shadercode} ${java.part.util.graph.fonts}"/>
+                  value="${java.part.core.shadercode} ${java.part.util.shadercode} ${java.part.util.fixedfuncemu.shadercode} ${java.part.util.graph.shadercode} ${java.part.util.graph.fonts}"/>
 
         <property name="java.part.all-desktop" 
                   value="${java.part.sdk} ${java.part.glx} ${java.part.wgl} ${java.part.cgl} ${java.part.gldesktop} ${java.part.glu.gldesktop} ${java.part.util.gldesktop}"/>
@@ -822,9 +825,7 @@
                      includes="${java.part.gluegen-gl-rt} ${java.part.gluegen-gl}"/>
         </jar>
 
-        <!-- Add the GlueGen and BuildStaticGLInfo tasks to ANT -->
-        <taskdef name="gluegen" classname="com.jogamp.gluegen.ant.GlueGenTask"
-                 classpathref="gluegen.classpath" />
+        <!-- Add the BuildStaticGLInfo tasks to ANT -->
         <taskdef name="staticglgen" classname="com.jogamp.gluegen.opengl.ant.StaticGLGenTask"
                  classpathref="gluegen-gl.classpath" />
     </target>
@@ -1510,7 +1511,7 @@
         <patternset id="c.obj.files.ffmpeg.inject">
           <include name="${rootrel.obj.joglsub}/ffmpeg_lavc53_lavf53_lavu51.*"/>
           <include name="${rootrel.obj.joglsub}/ffmpeg_lavc54_lavf54_lavu52_lavr01.*"/>
-          <include name="${rootrel.obj.joglsub}/ffmpeg_lavc55_lavf55_lavu52_lavr01.*"/>
+          <include name="${rootrel.obj.joglsub}/ffmpeg_lavc55_lavf55_lavu53_lavr01.*"/>
         </patternset>
 
         <patternset id="c.src.files.jogl.desktop">
@@ -1665,7 +1666,7 @@
                compiler.cfg.id="${compiler.cfg.id}"
                linker.cfg.id="${linker.cfg.id.os}"/>
 
-      <c.build.ffmpeg version.lav="lavc55_lavf55_lavu52_lavr01"
+      <c.build.ffmpeg version.lav="lavc55_lavf55_lavu53_lavr01"
                output.lib.name="jogl_ffmpegv10"
                compiler.cfg.id="${compiler.cfg.id}"
                linker.cfg.id="${linker.cfg.id.os}"/>
@@ -1721,7 +1722,7 @@
             <srcfileset dir="${src.java}"
                      includes="${java.part.nonjava}"/>
             <targetfileset dir="."
-                     includes="${jogl-core.jar} ${jogl-util.jar} ${jogl-util-graph.jar} ${jogl-util-fixedfuncemu.jar}" />
+                     includes="${jogl.jar} ${jogl-util.jar} ${jogl-util-graph.jar} ${jogl-util-fixedfuncemu.jar}" />
         </dependset>
     </target>
     <target name="build-jars" depends="build-jars-dependset,build-jars-javase" />
@@ -1740,6 +1741,18 @@
                 <filter token="JAR_CODEBASE_TAG" value="${jogamp.jar.codebase}"/>
             </filterset>
         </copy>
+        <copy file="${manifestfile}-natives"
+            tofile="${build.jogl}/manifest-natives.mf"
+            overwrite="true">
+            <filterset>
+                <filter token="VERSION" value="${jogamp.version}"/>
+                <filter token="BUILD_VERSION" value="${jogl.version}"/>
+                <filter token="SCM_BRANCH" value="${jogl.build.branch}"/>
+                <filter token="SCM_COMMIT" value="${jogl.build.commit}"/>
+                <filter token="BASEVERSION" value="${jogamp.version.base}"/>
+                <filter token="JAR_CODEBASE_TAG" value="${jogamp.jar.codebase}"/>
+            </filterset>
+        </copy>
     </target>
 
     <target name="build-jars-os-desktop-javase" depends="setup-manifestfile">
@@ -1816,7 +1829,7 @@
 
     <target name="build-jars-javase" depends="setup-manifestfile, build-jars-android, build-jars-mobile-javase, 
                                               build-jars-desktop-javase, build-jars-awt-javase, build-jars-swt-javase">
-        <jar manifest="${build.jogl}/manifest.mf" destfile="${jogl-core.jar}" filesonly="true">
+        <jar manifest="${build.jogl}/manifest.mf" destfile="${jogl.jar}" filesonly="true">
             <fileset dir="${classes}"
                      includes="${java.part.core}"
                      excludes="${java.part.core.exclude}"/>
@@ -1856,17 +1869,18 @@
             <fileset dir="${classes}"
                      includes="${java.part.nv-cg}"/>
         </jar>
-        <jar manifest="${build.jogl}/manifest.mf" destfile="${build.jogl}/jogl-natives-${os.and.arch}.jar" filesonly="true">
-            <fileset dir="${obj.jogl}">
-              <include name="*.${native.library.suffix}" />
-              <exclude name="*jogl_cg.${native.library.suffix}" />
-            </fileset>
-        </jar>
-        <jar manifest="${build.jogl}/manifest.mf" destfile="${build.jogl}/jogl-cg-natives-${os.and.arch}.jar" filesonly="true">
-            <fileset dir="${obj.jogl}">
-              <include name="*jogl_cg.${native.library.suffix}" />
-            </fileset>
-        </jar>
+        <native.tag.jar objdir="${obj.jogl}"
+                        nativejarfile="${build.jogl}/jogl-natives-${os.and.arch}.jar"
+                        manifestfile="${build.jogl}/manifest-natives.mf"
+                        module="opengl"
+                        includelibs="*.${native.library.suffix}" 
+                        excludelibs="*jogl_cg.${native.library.suffix}" />
+
+        <native.tag.jar objdir="${obj.jogl}"
+                        nativejarfile="${build.jogl}/jogl-cg-natives-${os.and.arch}.jar"
+                        manifestfile="${build.jogl}/manifest-natives.mf"
+                        module="cg"
+                        includelibs="*jogl_cg.${native.library.suffix}" />
     </target>
 
     <!-- ================================================================== -->
diff --git a/make/build-nativewindow.xml b/make/build-nativewindow.xml
index b0c49b0..76fc5a2 100644
--- a/make/build-nativewindow.xml
+++ b/make/build-nativewindow.xml
@@ -265,10 +265,6 @@
       -->
     <target name="java.generate" depends="init, common.gluegen.build, java.generate.check" unless="java.generate.skip">
 
-        <!-- Add the GlueGen task to ANT -->
-        <taskdef name="gluegen" classname="com.jogamp.gluegen.ant.GlueGenTask"
-                 classpathref="gluegen.classpath" />
-                 
         <!-- Use the GlueGen task to generate the Java files -->
 
         <antcall target="java.generate.cleantemp" inheritRefs="true" />
@@ -799,6 +795,18 @@
               <filter token="JAR_CODEBASE_TAG" value="${jogamp.jar.codebase}"/>
           </filterset>
         </copy>
+        <copy file="${manifestfile}-natives"
+          tofile="${build.nativewindow}/manifest-natives.mf"
+          overwrite="true">
+          <filterset>
+              <filter token="VERSION" value="${jogamp.version}"/>
+              <filter token="BUILD_VERSION" value="${jogl.version}"/>
+              <filter token="SCM_BRANCH" value="${jogl.build.branch}"/>
+              <filter token="SCM_COMMIT" value="${jogl.build.commit}"/>
+              <filter token="BASEVERSION" value="${jogamp.version.base}"/>
+              <filter token="JAR_CODEBASE_TAG" value="${jogamp.jar.codebase}"/>
+          </filterset>
+        </copy>
     </target>
 
     <target name="build-jars-awt" depends="setup-manifestfile" unless="setup.noAWT">
@@ -831,16 +839,16 @@
     </target>
 
     <target name="build-jars-javase" depends="setup-manifestfile,build-jars-awt,build-jars-x11,build-jars-windows,build-jars-macosx">
-        <jar manifest="${build.nativewindow}/manifest.mf" destfile="${nativewindow-core.jar}" filesonly="true">
+        <jar manifest="${build.nativewindow}/manifest.mf" destfile="${nativewindow.jar}" filesonly="true">
             <fileset dir="${classes}"
                      includes="${java.part.core}"
                      excludes="${java.part.awt} ${java.part.x11} ${java.part.windows}"/>
         </jar>
-        <jar manifest="${build.nativewindow}/manifest.mf" destfile="${build.nativewindow}/nativewindow-natives-${os.and.arch}.jar" filesonly="true">
-            <fileset dir="${obj.nativewindow}">
-              <include name="*.${native.library.suffix}" />
-            </fileset>
-        </jar>
+        <native.tag.jar objdir="${obj.nativewindow}"
+                        nativejarfile="${build.nativewindow}/nativewindow-natives-${os.and.arch}.jar"
+                        manifestfile="${build.nativewindow}/manifest-natives.mf"
+                        module="nativewindow"
+                        includelibs="*.${native.library.suffix}" />
     </target>
 
     <!-- ================================================================== -->
diff --git a/make/build-newt.xml b/make/build-newt.xml
index dd0ccc1..4a5997b 100644
--- a/make/build-newt.xml
+++ b/make/build-newt.xml
@@ -745,6 +745,18 @@
               <filter token="JAR_CODEBASE_TAG" value="${jogamp.jar.codebase}"/>
           </filterset>
         </copy>
+        <copy file="${manifestfile}-natives"
+          tofile="${build.newt}/manifest-natives.mf"
+          overwrite="true">
+          <filterset>
+              <filter token="VERSION" value="${jogamp.version}"/>
+              <filter token="BUILD_VERSION" value="${jogl.version}"/>
+              <filter token="SCM_BRANCH" value="${jogl.build.branch}"/>
+              <filter token="SCM_COMMIT" value="${jogl.build.commit}"/>
+              <filter token="BASEVERSION" value="${jogamp.version.base}"/>
+              <filter token="JAR_CODEBASE_TAG" value="${jogamp.jar.codebase}"/>
+          </filterset>
+        </copy>
     </target>
 
     <target name="build-jars-awt" depends="setup-manifestfile" unless="setup.noAWT">
@@ -804,7 +816,7 @@
     </target>
 
     <target name="build-jars-javase" depends="setup-manifestfile,build-jars-opengl,build-jars-awt,build-jars-swt,build-jars-driver">
-        <jar manifest="${build.newt}/manifest.mf" destfile="${newt-core.jar}" filesonly="true">
+        <jar manifest="${build.newt}/manifest.mf" destfile="${newt.jar}" filesonly="true">
             <fileset dir="${classes}"
                      includes="${java.part.core}"/>
             <fileset dir="resources/assets" includes="newt/data/**" />
@@ -829,11 +841,11 @@
     </target>
 
     <target name="build-jars-native" depends="gluegen.cpptasks.detect.os,setup-manifestfile">
-        <jar manifest="${build.newt}/manifest.mf" destfile="${build.newt}/newt-natives-${os.and.arch}.jar" filesonly="true">
-            <fileset dir="${obj.newt}">
-              <include name="*.${native.library.suffix}" />
-            </fileset>
-        </jar>
+        <native.tag.jar objdir="${obj.newt}"
+                        nativejarfile="${build.newt}/newt-natives-${os.and.arch}.jar"
+                        manifestfile="${build.newt}/manifest-natives.mf"
+                        module="newt"
+                        includelibs="*.${native.library.suffix}" />
     </target>
 
     <!-- ================================================================== -->
diff --git a/make/build-oculusvr.xml b/make/build-oculusvr.xml
new file mode 100644
index 0000000..aa03083
--- /dev/null
+++ b/make/build-oculusvr.xml
@@ -0,0 +1,721 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+   -->
+<project name="OculusVR" basedir="." default="all">
+
+    <import file="build-common.xml"/>
+
+    <!-- needed for outofdate task -->
+    <taskdef resource="net/sf/antcontrib/antlib.xml">
+      <classpath> <pathelement location="${ant-contrib.jar}"/> </classpath>
+    </taskdef>
+
+    <!-- ================================================================== -->
+    <!-- 
+       - Base initialization and detection of operating system.
+      -->
+    <target name="partitioning.setup" depends="common.init">
+        <property name="java.part.oculusvr" 
+                  value="com/jogamp/oculusvr/**"/>
+        <property name="java.part.opengl.oculusvr" 
+                  value="com/jogamp/opengl/oculusvr/** jogamp/opengl/oculusvr/**"/>
+        <property name="java.part.oculusvr.exclude" 
+                  value="" />
+        <property name="java.part.oculusvr.shadercode"
+                  value="jogamp/opengl/oculusvr/shader/**"/>
+        <property name="java.part.nonjava" 
+                  value="${java.part.oculusvr.shadercode}"/>
+    </target>
+
+    <!-- ================================================================== -->
+    <!-- 
+       - Declare all paths and user defined variables.
+      -->
+    <target name="init" depends="declare.common">
+        <!-- Create the required output directories. -->
+        <mkdir dir="${src.generated.java}" />
+        <mkdir dir="${src.generated.c}" />
+        <mkdir dir="${classes}" />
+        <mkdir dir="${obj.oculusvr}" />
+    </target>
+
+    <target name="declare.common" description="Declare properties" depends="partitioning.setup">
+        <property name="config.oculusvr"          value="${config}/oculusvr" />
+
+        <property name="rootrel.src.java"         value="src/oculusvr/classes" />
+        <property name="rootrel.src.c"            value="src/oculusvr/native" />
+
+        <property name="rootrel.src.generated"    value="${rootrel.build}/oculusvr/gensrc" />
+        <property name="rootrel.generated.c"      value="${rootrel.src.generated}/native/oculusvr" />
+
+        <!-- The source directories. -->
+        <property name="src.java"                 value="${project.root}/${rootrel.src.java}" />
+        <property name="src.ovr.java"             value="${rel.oculusvr.sdk}/jogl/src/classes" />
+        <property name="src.c"                    value="${project.root}/${rootrel.src.c}" />
+        
+        <!-- The generated source directories. -->
+        <property name="src.generated"            value="${build.oculusvr}/gensrc" />
+        <property name="src.generated.java"       value="${src.generated}/classes" />
+        <property name="src.generated.c"          value="${src.generated}/native/oculusvr" />
+        
+        <!-- The compiler output directories. -->
+        <property name="classes"                  value="${build.oculusvr}/classes" />
+
+        <!-- The OculusVR headers from which Java files are generated -->
+        <property name="stub.includes.ovr"        value="${rel.oculusvr.sdk}/LibOVR/Src" />
+        <property name="stub.includes.all.ovr"    value="${stub.includes.ovr},${stub.includes.ovr}/CAPI" />
+
+        <echo message="rel.oculusvr.sdk      ${rel.oculusvr.sdk}" />
+        <echo message="stub.includes.ovr     ${stub.includes.ovr}" />
+        <echo message="stub.includes.all.ovr ${stub.includes.all.ovr}"/>
+
+        <fileset id="stub.includes.dependencies.fileset.1" dir="${stub.includes.ovr}">
+            <include name="**" />
+        </fileset>
+        <!-- echo message="stub.includes.dependencies.fileset.1 ${toString:stub.includes.dependencies.fileset.1}"/ -->
+        <fileset id="stub.includes.dependencies.fileset.2" file="${gluegen.jar}" />
+        <fileset id="stub.includes.dependencies.fileset.3" dir="${config.oculusvr}">
+            <include name="*.cfg" />
+            <include name="*.java" />
+            <include name="*.c" />
+        </fileset>
+        
+        <!-- The javadoc dirs. -->
+        <property name="javadoc" value="${project.root}/javadoc_oculusvr" />
+        <property name="javadoc.windowtitle" value="OculusVR API Specification -- Version ${jogamp.version.base}" />
+        <property name="javadoc.overview" value="doc/oculusvr/spec-overview.html" />
+        <property name="javadoc.packagenames" value="com.jogamp.oculusvr.*" />
+
+        <property name="javadoc.dev.packagenames" value="${javadoc.packagenames},jogamp.opengl.*,com.jogamp.gluegen,com.jogamp.gluegen.runtime" />
+
+        <condition property="oculusvr.build.enabled">
+            <isset property="oculusvr.sdk.available"/>
+        </condition>
+
+        <condition property="c.build.supported">
+          <and>
+              <isset property="oculusvr.build.enabled"/>
+              <or>
+                  <isset property="isLinuxX86"/>
+                  <isset property="isLinuxAMD64"/>
+                  <!-- isset property="isAndroid"/-->
+                  <isset property="isWindowsX86"/>
+                  <isset property="isWindowsAMD64"/>
+                  <isset property="isOSX"/>
+              </or>
+              <not>
+                  <isset property="c.build.oculusvr.skip"/>
+              </not>
+          </and>
+        </condition>
+        <echo message="oculusvr.sdk.available ${oculusvr.sdk.available}" />
+        <echo message="oculusvr.build.enabled ${oculusvr.build.enabled}" />
+        <echo message="c.build.supported ${c.build.supported}" />
+    </target>
+    
+    <!-- ================================================================== -->
+    <!--
+       - Check to see whether we need to rebuild the generated sources.
+      -->
+    <target name="java.generate.check">
+        <!-- Blow away all target files if any dependencies are violated
+             (the uptodate task doesn't allow arbitrary source and target filesets but should) -->
+             <!--
+        <dependset>
+            <srcfileset refid="stub.includes.dependencies.fileset.1" />
+            <srcfileset refid="stub.includes.dependencies.fileset.2" />
+            <srcfileset refid="stub.includes.dependencies.fileset.3" />
+            <targetfileset dir="${src.generated}">
+                <include name="**/*.java" />
+                <include name="**/*.c" />
+            </targetfileset>
+        </dependset>
+        -->
+
+        <!-- Now check for the presence of one well-known file -->
+        <uptodate property="java.generate.skip.ovr"
+                  targetfile="${src.generated.java}/com/jogamp/opengl/oculusvr/OVR.java">
+            <srcfiles refid="stub.includes.dependencies.fileset.1" />
+            <srcfiles refid="stub.includes.dependencies.fileset.2" />
+            <srcfiles refid="stub.includes.dependencies.fileset.3" />
+        </uptodate>
+
+        <condition property="java.generate.skip">
+          <and>
+              <isset property="java.generate.skip.ovr"/>
+          </and>
+        </condition>
+
+        <!--property name="java.generate.skip" value="true"/-->
+    </target>
+
+    <target name="java.generate" depends="init, common.gluegen.build, java.generate.check" unless="java.generate.skip">
+        <echo message="Generating OVR" />
+        <gluegen src="${config.oculusvr}/oculusvr.c"
+                 outputRootDir="${build.oculusvr}"
+                 config="${config.oculusvr}/oculusvr.cfg"
+                 literalInclude="${stub.includes.gluegen.gg},${stub.includes.all.ovr}"
+                 emitter="com.jogamp.gluegen.JavaEmitter"
+                 debug="false"
+                 dumpCPP="false">
+            <classpath refid="gluegen.classpath" />
+        </gluegen>
+        <!--
+                 emitter="com.jogamp.gluegen.procaddress.ProcAddressEmitter"
+                 -->
+    </target>
+
+    <!-- ================================================================== -->
+
+    <target name="java.compile" depends="java.generate">
+        <!-- Pure non JOGL OculusVR part -->
+        <javac destdir="${classes}"
+               excludes="${java.part.oculusvr.exclude} ${java.part.opengl.oculusvr}"
+               fork="yes"
+               includeAntRuntime="false"
+               memoryMaximumSize="${javac.memorymax}"
+               encoding="UTF-8"
+               source="${target.sourcelevel}" 
+               target="${target.targetlevel}" 
+               bootclasspath="${target.rt.jar}"
+               debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+            <classpath refid="nativewindow_gluegen.classpath"/>
+            <src path="${src.java}" />
+            <src path="${src.generated.java}" />
+        </javac>
+        <!-- Add JOGL OculusVR part -->
+        <javac destdir="${classes}"
+               excludes="${java.part.oculusvr.exclude}"
+               fork="yes"
+               includeAntRuntime="false"
+               memoryMaximumSize="${javac.memorymax}"
+               encoding="UTF-8"
+               source="${target.sourcelevel}" 
+               target="${target.targetlevel}" 
+               bootclasspath="${target.rt.jar}"
+               debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+            <classpath refid="jogl_nativewindow_gluegen.classpath"/>
+            <src path="${src.java}" />
+            <src path="${src.ovr.java}" />
+            <src path="${src.generated.java}" />
+        </javac>
+        <!-- make shadercode and fonts available in classpath -->
+        <copy todir="${classes}">
+            <fileset dir="${src.java}"
+                     includes="${java.part.nonjava}"
+                     excludes="**/*.java"/>
+        </copy>
+    </target>
+
+    <!-- ================================================================== -->
+    <!-- 
+       - Compile the native C code for OculusVR
+      -->
+
+    <target name="c.configure.1" depends="gluegen.cpptasks.detect.os,gluegen.cpptasks.setup.compiler">
+      <!-- compiler configuration -->
+      <!-- Note that we can use the base setups in the gluegen-cpptasks for most of these -->
+
+      <compiler id="compiler.cfg.freebsd.oculusvr" extends="compiler.cfg.freebsd">
+        <!-- Need to force X11R6 headers on to include path after stub_includes -->
+        <includepath path="/usr/local/include" />
+      </compiler>
+
+      <compiler id="compiler.cfg.linux.armv6.oculusvr.x11" extends="compiler.cfg.linux.armv6">
+        <!-- Need to force /usr/include headers on to include path (after all others), due to crosscompiler usage -->
+        <compilerarg value="-idirafter" />
+        <compilerarg value="/usr/include" />
+      </compiler>
+
+      <!-- linker configuration -->
+ 
+      <linker id="linker.cfg.macosx.oculusvr" extends="linker.cfg.macosx">
+        <linkerarg value="-weak_framework" />
+        <linkerarg value="AppKit" />
+        <linkerarg value="-weak_framework" />
+        <linkerarg value="IOKit" />
+        <!--linkerarg value="-weak_framework" />
+        <linkerarg value="OpenGL" /-->
+      </linker>
+
+    </target>
+
+    <target name="c.configure.win32.vc" if="isVCFamily">
+      <echo message="Win32.VC" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.win32.msvc" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.win32.msvc" />
+    </target>
+    
+    <target name="c.configure.win32.mingw" if="isMingW32">
+      <echo message="Win32.MingW" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.win32.mingw" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.win32.mingw" />
+    </target>
+
+    <target name="c.configure.win64.mingw" if="isMingW64">
+      <echo message="Win64.MingW" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.win64.mingw" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.win64.mingw" />
+    </target>
+
+    <target name="c.configure.linux.x86" if="isLinuxX86">
+      <echo message="Linux.x86" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.linux.x86" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.linux.x86" />
+    </target>
+    
+    <target name="c.configure.linux.amd64" if="isLinuxAMD64">
+      <echo message="Linux.AMD64" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.linux.amd64" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.linux.amd64" />
+    </target>
+    
+    <target name="c.configure.linux.armv6" if="isLinuxARMv6">
+      <echo message="Linux.armv6" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.linux.armv6.oculusvr.x11" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.linux.armv6" />
+    </target>
+    
+    <target name="c.configure.linux.ia64" if="isLinuxIA64">
+      <echo message="Linux.IA64" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.linux" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.linux" />
+    </target>
+    
+    <target name="c.configure.linux.hppa" if="isLinuxHppa">
+      <echo message="Linux.HPPA" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.linux" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.linux" />
+    </target>
+    
+    <target name="c.configure.linux.mips" if="isLinuxMips">
+      <echo message="Linux.MIPS" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.linux" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.linux" />
+    </target>
+    
+    <target name="c.configure.linux.mipsel" if="isLinuxMipsel">
+      <echo message="Linux.MIPSEL" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.linux" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.linux" />
+    </target>
+    
+    <target name="c.configure.linux.ppc" if="isLinuxPpc">
+      <echo message="Linux.PPC" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.linux" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.linux" />
+    </target>
+
+    <target name="c.configure.linux.s390" if="isLinuxs390">
+      <echo message="Linux.S390" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.linux" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.linux" />
+    </target>
+
+    <target name="c.configure.linux.sparc" if="isLinuxSparc">
+      <echo message="Linux.SPARC" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.linux" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.linux" />
+    </target>
+
+    <target name="c.configure.linux" depends="c.configure.linux.armv6,c.configure.linux.x86,c.configure.linux.amd64,c.configure.linux.ia64,c.configure.linux.hppa,c.configure.linux.mips,c.configure.linux.mipsel,c.configure.linux.ppc,c.configure.linux.s390,c.configure.linux.sparc,c.configure.x11" if="isLinux" />
+
+    <target name="c.configure.android" if="isAndroid">
+      <echo message="Android" />
+      <property name="compiler.cfg.id"                      value="compiler.cfg.android" />
+      <property name="linker.cfg.id.os"                     value="linker.cfg.android" />
+    </target>
+    
+    <target name="c.configure.solaris32" depends="c.configure.x11" if="isSolaris32Bit">
+      <echo message="Solaris" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.solaris" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.solarisx11" />
+    </target>
+  
+ 
+    <target name="c.configure.solaris.sparcv9" depends="c.configure.x11" if="isSolarisSparcv9">
+      <echo message="SolarisSparcv9" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.solaris.sparcv9" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.solaris.sparcv9" />
+    </target>
+   
+
+    <target name="c.configure.solaris.amd64" depends="c.configure.x11" if="isSolarisAMD64">
+      <echo message="SolarisAMD64" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.solaris.amd64" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.solaris.amd64" />
+    </target>
+   
+    <target name="c.configure.freebsd.x86" depends="c.configure.x11" if="isFreeBSDX86">
+      <echo message="FreeBSD" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.freebsd.oculusvr" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.freebsd" />
+    </target>
+
+    <target name="c.configure.freebsd.amd64" depends="c.configure.x11" if="isFreeBSDAMD64">
+      <echo message="FreeBSD" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.freebsd.oculusvr" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.freebsd.amd64" />
+    </target>
+
+    <target name="c.configure.freebsd" depends="c.configure.freebsd.x86,c.configure.freebsd.amd64,c.configure.x11" if="isFreeBSD" />
+
+    <target name="c.configure.hpux" depends="c.configure.x11" if="isHPUX">
+      <echo message="HP-UX" />
+      <property name="compiler.cfg.id"                     value="compiler.cfg.hpux" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.hpux" />
+    </target>
+
+    <target name="c.configure.win32" depends="c.configure.win32.vc,c.configure.win32.mingw,c.configure.win64.mingw" if="isWindows" />
+
+    <target name="c.configure.x11" if="isX11" />
+
+    <target name="c.configure.macosx" if="isOSX">
+      <property name="compiler.cfg.id"                     value="compiler.cfg.macosx" />
+      <property name="linker.cfg.id.os"                    value="linker.cfg.macosx.oculusvr" />
+    </target>
+    
+    <target name="c.configure.2" depends="c.configure.win32,c.configure.linux,c.configure.android,c.configure.solaris32,c.configure.solaris.sparcv9,c.configure.solaris.amd64,c.configure.macosx,c.configure.freebsd,c.configure.hpux" />
+
+    <target name="c.configure" depends="c.configure.1,c.configure.2" />
+
+    <target name="rename.mingw.dll" if="isMingW">
+        <move file="${src}" tofile="${dest}" />
+    </target>
+
+    <target name="rename.dylib" if="isOSX">
+        <move file="${src}" tofile="${dest}" />
+    </target>
+
+    <macrodef name="c.build">
+      <attribute name="compiler.cfg.id" />
+      <attribute name="linker.cfg.id" />
+      <attribute name="output.lib.name" />
+      <attribute name="c.compiler.use-jawt" default="false"/>
+      <sequential>
+        <echo message="Output lib name = @{output.lib.name}" />
+
+        <condition property="c.compiler.use-debug"><istrue value="${c.compiler.debug}"/></condition>
+
+        <patternset id="c.src.files.oculusvr.c">
+            <include name="${rootrel.generated.c}/ovrDistortionMesh_JNI.c"/>
+            <include name="${rootrel.generated.c}/ovrHmdDesc_JNI.c"/>
+            <include name="${rootrel.generated.c}/OVR_JNI.c"/>
+        </patternset>
+        <patternset id="c.src.files.oculusvr.cpp">
+            <include name="${rootrel.src.c}/OVRImplMisc.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_CAPI.cpp"/>
+            <!-- include name="${rootrel.oculusvr.sdk}/LibOVR/Src/CAPI/CAPI_DistortionRenderer.cpp"/-->
+            <!-- include name="${rootrel.oculusvr.sdk}/LibOVR/Src/CAPI/GL/CAPI_GL_DistortionRenderer.cpp"/-->
+            <!-- include name="${rootrel.oculusvr.sdk}/LibOVR/Src/CAPI/GL/CAPI_GL_Util.cpp"/-->
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/CAPI/CAPI_FrameTimeManager.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/CAPI/CAPI_GlobalState.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/CAPI/CAPI_HMDRenderState.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/CAPI/CAPI_HMDState.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_DeviceHandle.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_DeviceImpl.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_JSON.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_LatencyTestImpl.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Profile.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_SensorCalibration.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_SensorFilter.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_SensorFusion.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_SensorImpl.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Sensor2Impl.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_SensorImpl_Common.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_SensorTimeFilter.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Stereo.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_ThreadCommandQueue.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_Alg.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_Allocator.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_Atomic.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_File.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_FileFILE.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_Log.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_Math.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Recording.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_RefCount.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_Std.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_String.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_String_FormatUtil.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_String_PathUtil.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_SysFile.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_System.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_Timer.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_UTF8Util.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Util/Util_LatencyTest.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Util/Util_LatencyTest2.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Util/Util_Render_Stereo.cpp"/>
+            <include name="${rootrel.oculusvr.sdk}/3rdParty/TinyXml/tinyxml2.cpp"/>
+
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_ThreadsPthread.cpp" if="isLinux"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Linux_HIDDevice.cpp"       if="isLinux"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Linux_SensorDevice.cpp"    if="isLinux"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Linux_DeviceManager.cpp"   if="isLinux"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Linux_HMDDevice.cpp"       if="isLinux"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Linux_SensorDevice.cpp"    if="isLinux"/>
+            <include name="${rootrel.oculusvr.sdk}/3rdParty/EDID/edid.cpp"                   if="isLinux"/>
+
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_ThreadsWinAPI.cpp"  if="isWindows"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Win32_DeviceManager.cpp"   if="isWindows"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Win32_DeviceStatus.cpp"    if="isWindows"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Win32_HIDDevice.cpp"       if="isWindows"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Win32_HMDDevice.cpp"       if="isWindows"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_Win32_SensorDevice.cpp"    if="isWindows"/>
+
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/Kernel/OVR_ThreadsPthread.cpp" if="isOSX"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_OSX_DeviceManager.cpp"     if="isOSX"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_OSX_HIDDevice.cpp"         if="isOSX"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_OSX_HMDDevice.cpp"         if="isOSX"/>
+            <include name="${rootrel.oculusvr.sdk}/LibOVR/Src/OVR_OSX_SensorDevice.cpp"      if="isOSX"/>
+        </patternset>
+
+        <echo message="Compiling @{output.lib.name}" />
+
+      	<!-- have to wrap cc task with outofdate, because otherwise cc links a new library
+      	     even when no files have been compiled -->
+        <outofdate>
+          <sourcefiles>
+            <fileset dir="${project.root}"><patternset refid="c.src.files.oculusvr.c"/></fileset>
+            <fileset dir="${project.root}"><patternset refid="c.src.files.oculusvr.cpp"/></fileset>
+          </sourcefiles>
+          <targetfiles>
+            <fileset dir="${obj.oculusvr}" includes="lib@{output.lib.name}.so"/>
+            <fileset dir="${obj.oculusvr}" includes="@{output.lib.name}.dll"/>
+            <fileset dir="${obj.oculusvr}" includes="lib@{output.lib.name}.jnilib"/>
+          </targetfiles>
+          <sequential>
+            <!-- C Compilation -->
+            <cc outtype="static" 
+                objdir="${obj.oculusvr}" 
+                optimize="${c.compiler.optimise}" 
+                debug="${c.compiler.debug}"
+                multithreaded="true" 
+                exceptions="false" 
+                rtti="false">   
+      
+              <fileset dir="${project.root}">
+                <patternset refid="c.src.files.oculusvr.c"/>
+              </fileset>
+      
+              <compiler extends="@{compiler.cfg.id}" >
+                <sysincludepath path="${java.includes.dir}"/>
+                <sysincludepath path="${java.includes.dir.platform}"/>
+                <sysincludepath path="${stub.includes.gluegen.cc}"/>
+                <includepath path="${stub.includes.ovr}"/>
+                <includepath path="${stub.includes.ovr}/CAPI"/>
+      
+                <!-- This is for the generated headers for handwritten C code -->
+                <includepath path="${src.c}"/>
+                <includepath path="${src.generated.c}" />
+              </compiler>
+            </cc>
+            <!-- C++ Compilation -->
+            <cc outtype="static" 
+                objdir="${obj.oculusvr}" 
+                optimize="${c.compiler.optimise}" 
+                debug="${c.compiler.debug}"
+                multithreaded="true" 
+                exceptions="false" 
+                rtti="false">   
+      
+              <fileset dir="${project.root}">
+                <patternset refid="c.src.files.oculusvr.cpp"/>
+              </fileset>
+      
+              <compiler extends="@{compiler.cfg.id}" >
+                <sysincludepath path="${java.includes.dir}"/>
+                <sysincludepath path="${java.includes.dir.platform}"/>
+                <sysincludepath path="${stub.includes.gluegen.cc}"/>
+                <includepath path="${stub.includes.ovr}"/>
+                <includepath path="${stub.includes.ovr}/CAPI"/>
+      
+                <!-- This is for the generated headers for handwritten C code -->
+                <includepath path="${src.c}"/>
+                <includepath path="${src.generated.c}" />
+
+                <compilerarg location="start" value="-x"                       if="isCLANG"/>
+                <compilerarg location="start" value="c++"                      if="isCLANG"/>
+
+                <compilerarg value="-fno-rtti"/>
+
+                <compilerarg value="-municode"                                 if="isMingW"/>
+                <compilerarg value="-DUNICODE"                                 if="isMingW"/>
+                <compilerarg value="-D_UNICODE"                                if="isMingW"/>
+              </compiler>
+            </cc>
+            <!-- Linkage -->
+            <cc outtype="shared" 
+                objdir="${obj.oculusvr}" 
+                outfile="${obj.oculusvr}/@{output.lib.name}"
+                optimize="${c.compiler.optimise}" 
+                debug="${c.compiler.debug}"
+                multithreaded="true" 
+                exceptions="false" 
+                rtti="false">   
+      
+              <fileset dir="${project.root}"
+                includes="${rootrel.obj.oculusvr}/*.o"/>
+      
+              <linker extends="@{linker.cfg.id}">
+                <syslibset libs="setupapi, winmm"                              if="isWindows"/>
+                <syslibset libs="gdi32, kernel32"                              if="isWindows"/>
+
+                <syslibset libs="X11 Xrandr udev m"                            if="isLinux" unless="isLinuxARMv6" />
+                <syslibset dir="${env.TARGET_PLATFORM_ROOT}/usr/lib" 
+                           libs="X11 Xrandr udev m"                            if="isLinuxARMv6" />
+
+                <syslibset dir="/usr/local/lib" libs="X11 Xrandr udev m"       if="isFreeBSD"/>
+                <syslibset dir="/usr/lib" libs="X11 Xrandr udev m"             if="isHPUX"/>
+                <syslibset dir="/usr/lib/amd64" libs="X11 Xrandr udev m"       if="isSolaris32Bit"/>
+                <syslibset dir="/usr/lib/amd64" libs="X11 Xrandr udev m"       if="isSolarisAMD64"/>
+                <syslibset dir="/usr/lib/sparcv9" libs="X11 Xrandr udev m"     if="isSolarisSparcv9"/>
+
+                <!-- syslibset libs="stdc++"
+                     Don't link dynamic 
+                     Static link directive must be at the end! -->
+                <linkerarg location="end" value="-Wl,-Bstatic"                 if="isGCC"/>
+                <linkerarg location="end" value="-lstdc++" />
+                <linkerarg location="end" value="-Wl,-Bdynamic"                if="isGCC"/>
+
+              </linker>
+            </cc>
+    
+            <!-- FIXME: this is a hack; the cpptask should have an option to change the
+                 suffix or at least understand the override from dylib to jnilib -->
+            <antcall target="rename.dylib" inheritRefs="true">
+                <param name="src"  value="${obj.oculusvr}/lib@{output.lib.name}.dylib" />
+                <param name="dest" value="${obj.oculusvr}/lib@{output.lib.name}.jnilib" />
+            </antcall>
+    
+            <!-- FIXME: this is a hack; the cpptask should have an option to change the
+                 suffix or at least understand the override from dylib to jnilib -->
+            <antcall target="rename.mingw.dll" inheritRefs="true">
+                <param name="src"  value="${obj.oculusvr}/lib@{output.lib.name}.so" />
+                <param name="dest" value="${obj.oculusvr}/@{output.lib.name}.dll" />
+            </antcall>
+
+            <!-- this stripping may be called more than once on the same library dir,
+                 but that should cause no harm, and doing it here inside outofdate
+                 prevents the JARs from always being rebuilt even if no source code changes -->
+            <antcall target="gluegen.cpptasks.striplibs" inheritRefs="true">
+                <param name="libdir" value="${obj.oculusvr}"/>
+            </antcall>
+
+          </sequential>
+        </outofdate>
+      </sequential>
+    </macrodef>  
+
+    <target name="c.build" depends="c.configure" if="c.build.supported">
+      <c.build output.lib.name="oculusvr"
+               compiler.cfg.id="${compiler.cfg.id}"
+               linker.cfg.id="${linker.cfg.id.os}"/>
+    </target>
+
+    <!-- ================================================================== -->
+    <!--
+       - Build the oculusvr.jar files.
+      -->
+    <target name="build-jars-dependset" depends="init,gluegen.cpptasks.detect.os" >
+        <dependset>
+            <srcfileset dir="${src.java}"/>
+            <srcfileset dir="${src.ovr.java}"/>
+            <targetfileset dir="." includes="${build.oculusvr}/oculusvr.jar" />
+        </dependset>
+    </target>
+    <target name="build-jars" depends="build-jars-dependset,build-jars-javase" />
+
+    <target name="setup-manifestfile" depends="common.init">
+        <property name="manifestfile" value="oculusvrversion"/>
+        <copy file="${manifestfile}"
+            tofile="${build.oculusvr}/manifest.mf"
+            overwrite="true">
+            <filterset>
+                <filter token="VERSION" value="${jogamp.version}"/>
+                <filter token="BUILD_VERSION" value="${jogl.version}"/>
+                <filter token="SCM_BRANCH" value="${jogl.build.branch}"/>
+                <filter token="SCM_COMMIT" value="${jogl.build.commit}"/>
+                <filter token="BASEVERSION" value="${jogamp.version.base}"/>
+                <filter token="JAR_CODEBASE_TAG" value="${jogamp.jar.codebase}"/>
+            </filterset>
+        </copy>
+        <copy file="${manifestfile}-natives"
+            tofile="${build.oculusvr}/manifest-natives.mf"
+            overwrite="true">
+            <filterset>
+                <filter token="VERSION" value="${jogamp.version}"/>
+                <filter token="BUILD_VERSION" value="${jogl.version}"/>
+                <filter token="SCM_BRANCH" value="${jogl.build.branch}"/>
+                <filter token="SCM_COMMIT" value="${jogl.build.commit}"/>
+                <filter token="BASEVERSION" value="${jogamp.version.base}"/>
+                <filter token="JAR_CODEBASE_TAG" value="${jogamp.jar.codebase}"/>
+            </filterset>
+        </copy>
+    </target>
+
+    <target name="build-jars-javase" depends="setup-manifestfile">
+        <jar manifest="${build.oculusvr}/manifest.mf" destfile="${build.oculusvr}/oculusvr.jar" filesonly="true">
+            <fileset dir="${classes}"
+                     includes="${java.part.oculusvr} ${java.part.opengl.oculusvr}"
+                     excludes="${java.part.oculusvr.exclude}"/>
+        </jar>
+        <native.tag.jar objdir="${obj.oculusvr}"
+                        nativejarfile="${build.oculusvr}/oculusvr-natives-${os.and.arch}.jar"
+                        manifestfile="${build.oculusvr}/manifest-natives.mf"
+                        module="oculusvr"
+                        includelibs="*oculusvr.${native.library.suffix}" />
+    </target>
+
+    <!-- ================================================================== -->
+    <!--
+       - Build the Javadocs for the sources.
+       - NOTE:  these are not entirely correct as the javadocs targets depend 
+       -        on the platform specific build targets.  To circumvent any 
+       -        errors, ensure that the source is built first.
+      -->
+    <target name="javadoc" depends="init">
+        <javadoc packagenames="${javadoc.packagenames}"
+                 sourcepath="${src.java};${src.ovr.java};${src.generated.java}"        
+                 destdir="${javadoc}" windowtitle="${javadoc.windowtitle}"
+                 overview="${javadoc.overview}" 
+                 encoding="UTF-8"
+                 source="${target.sourcelevel}"
+                 maxmemory="${javac.memorymax}"
+                 linkoffline="${javadoc.link} 142-packages"
+                 bottom="" >
+          <classpath refid="nativewindow_gluegen.classpath"/>
+          <taglet name="net.highteq.nativetaglet.NativeTaglet" path="${gluegen.jar}" />
+        </javadoc>
+    </target>
+
+    <!-- ================================================================== -->
+    <!--
+       - Clean up all that is built.
+      -->
+    <target name="clean" description="Remove all build products" depends="declare.common">
+        <delete includeEmptyDirs="true" quiet="true">
+            <fileset dir="${build.oculusvr}" />
+            <fileset dir="${javadoc}" />
+        </delete>
+    </target>
+
+    <!-- ================================================================== -->
+    <!--
+       - Build everything.
+      -->
+    <target name="all" 
+            description="Build OculusVR JAR file(s) and native libraries." 
+            depends="init" if="oculusvr.build.enabled">
+        <antcall target="all.impl" inheritRefs="true" />
+    </target>
+    <target name="all.impl" 
+            description="Build OculusVR JAR file(s) and native libraries." 
+            depends="java.compile,c.build,build-jars,generate.version.txt"/>
+
+    <target name="generate.version.txt" depends="init">
+        <!-- Create a version.txt file indicating which version we just built -->
+        <echo message="${oculusvr.version}" file="${build.oculusvr}/version.txt" />
+    </target>
+
+</project>
diff --git a/make/build-test.xml b/make/build-test.xml
index 2ae39d8..88d40bc 100644
--- a/make/build-test.xml
+++ b/make/build-test.xml
@@ -28,6 +28,7 @@
 
         <property name="java.part.test.all"   value="com/jogamp/** jogamp/**"/>
         <property name="java.part.test.android" value="com/jogamp/opengl/test/android/**"/>
+        <property name="java.part.test.oculusvr" value="com/jogamp/opengl/test/junit/jogl/stereo/ovr/**"/>
         <property name="java.dir.test"        value="com/jogamp/opengl/test"/>
         <property name="java.dir.junit"       value="${java.dir.test}/junit"/>
         <property name="java.dir.bugs"        value="${java.dir.test}/bugs"/>
@@ -53,6 +54,7 @@
             <fileset dir="." includes="*.png" />
             <fileset dir="." includes="*.pam" />
             <fileset dir="." includes="*.tga" />
+            <fileset dir="." includes="hs_err_pid*.log" />
             <fileset file="${jogl-test.jar}" />
         </delete>
     </target>
@@ -61,10 +63,10 @@
     <!--
        - Build/run tests/junit.
       -->
-    <target name="test.compile.javase">
-        <!-- Perform the junit pass Java SE compile -->
+
+    <target name="test.compile.javase.generic">
         <javac destdir="${classes}"
-               excludes="${java.part.test.android}"
+               excludes="${java.part.test.android} ${java.part.test.oculusvr}"
                fork="yes"
                includeAntRuntime="false"
                memoryMaximumSize="${javac.memorymax}"
@@ -76,6 +78,24 @@
             <classpath refid="junit_jogl_newt.compile.classpath"/>
             <src path="${src.test}" />
         </javac>
+    </target>
+    <target name="test.compile.javase.oculusvr" if="oculusvr.sdk.available">
+        <javac destdir="${classes}"
+               includes="${java.part.test.oculusvr}"
+               excludes="${java.part.test.android}"
+               fork="yes"
+               includeAntRuntime="false"
+               memoryMaximumSize="${javac.memorymax}"
+               encoding="UTF-8"
+               source="${target.sourcelevel}" 
+               target="${target.targetlevel}" 
+               bootclasspath="${target.rt.jar}"
+               debug="${javacdebug}" debuglevel="${javacdebuglevel}">
+            <classpath refid="junit_jogl_newt_oculusvr.compile.classpath"/>
+            <src path="${src.test}" />
+        </javac>
+    </target>
+    <target name="test.compile.javase" depends="test.compile.javase.generic, test.compile.javase.oculusvr">
         <copy file="joglversion-test"
             tofile="${build.test}/manifest-test.mf"
             overwrite="true">
@@ -103,6 +123,7 @@
     <target name="test.compile.android" if="android-jars.available">
         <!-- Perform the junit pass Java Android compile -->
         <javac destdir="${classes}"
+               excludes="${java.part.test.oculusvr}"
                fork="yes"
                includeAntRuntime="false"
                memoryMaximumSize="${javac.memorymax}"
@@ -744,6 +765,7 @@
             <fileset dir="." includes="*.png" />
             <fileset dir="." includes="*.pam" />
             <fileset dir="." includes="*.tga" />
+            <fileset dir="." includes="hs_err_pid*.log" />
         </move>
         <move todir="${build}/test/results-x32">
             <fileset dir="${results.test}" includes="**" />
@@ -770,6 +792,7 @@
             <fileset dir="." includes="*.png" />
             <fileset dir="." includes="*.pam" />
             <fileset dir="." includes="*.tga" />
+            <fileset dir="." includes="hs_err_pid*.log" />
         </move>
         <move todir="${build}/test/results-java7">
             <fileset dir="${results.test}" includes="**" />
@@ -1105,6 +1128,7 @@ ${line.separator}
             <fileset dir="." includes="*.png" />
             <fileset dir="." includes="*.pam" />
             <fileset dir="." includes="*.tga" />
+            <fileset dir="." includes="hs_err_pid*.log" />
         </delete>
         <mkdir dir="${results.test}" />
     </target>
@@ -1124,6 +1148,7 @@ ${line.separator}
             <fileset dir="." includes="*.png" />
             <fileset dir="." includes="*.pam" />
             <fileset dir="." includes="*.tga" />
+            <fileset dir="." includes="hs_err_pid*.log" />
         </move>
         <antcall target="test-zip-archive" inheritRefs="true" inheritAll="true"/>
     </target>
@@ -1136,6 +1161,7 @@ ${line.separator}
             <fileset dir="." includes="*.png" />
             <fileset dir="." includes="*.pam" />
             <fileset dir="." includes="*.tga" />
+            <fileset dir="." includes="hs_err_pid*.log" />
         </move>
         <antcall target="test-zip-archive" inheritRefs="true" inheritAll="true"/>
     </target>
@@ -1148,6 +1174,7 @@ ${line.separator}
             <fileset dir="." includes="*.png" />
             <fileset dir="." includes="*.pam" />
             <fileset dir="." includes="*.tga" />
+            <fileset dir="." includes="hs_err_pid*.log" />
         </move>
         <antcall target="test-zip-archive" inheritRefs="true" inheritAll="true"/>
     </target>
@@ -1160,6 +1187,7 @@ ${line.separator}
             <fileset dir="." includes="*.png" />
             <fileset dir="." includes="*.pam" />
             <fileset dir="." includes="*.tga" />
+            <fileset dir="." includes="hs_err_pid*.log" />
         </move>
         <antcall target="test-zip-archive" inheritRefs="true" inheritAll="true"/>
     </target>
diff --git a/make/build.xml b/make/build.xml
index a7ba217..f572ee5 100644
--- a/make/build.xml
+++ b/make/build.xml
@@ -8,13 +8,13 @@
        - Main build target.
       -->
 
-    <target name="all" description="Build nativewindow, jogl and newt projects, incl. all junit tests " depends="init,build.nativewindow,build.jogl,build.newt,one.dir,tag.build,test.compile,developer-zip-archive" />
+    <target name="all" description="Build nativewindow, jogl and newt projects, incl. all junit tests " depends="init,build.nativewindow,build.jogl,build.newt,build.oculusvr,one.dir,tag.build,test.compile,developer-zip-archive" />
 
-    <target name="all.debug" description="Debug build nativewindow, jogl and newt projects, incl. all junit tests " depends="init.debug,build.nativewindow,build.jogl,build.newt,one.dir,tag.build,test.compile,developer-zip-archive" />
+    <target name="all.debug" description="Debug build nativewindow, jogl and newt projects, incl. all junit tests " depends="init.debug,build.nativewindow,build.jogl,build.newt,build.oculusvr,one.dir,tag.build,test.compile,developer-zip-archive" />
 
-    <target name="all.but-archives" description="Build nativewindow, jogl and newt projects, incl. all junit tests " depends="init,build.nativewindow,build.jogl,build.newt,one.dir,tag.build,test.compile" />
+    <target name="all.but-archives" description="Build nativewindow, jogl and newt projects, incl. all junit tests " depends="init,build.nativewindow,build.jogl,build.newt,build.oculusvr,one.dir,tag.build,test.compile" />
 
-    <target name="all.ide" description="Debug IDE build nativewindow, jogl and newt projects, including all junit tests, but don't tag the build or create archives" depends="init.debug,build.nativewindow,build.jogl,build.newt,one.dir,test.compile" />
+    <target name="all.ide" description="Debug IDE build nativewindow, jogl and newt projects, including all junit tests, but don't tag the build or create archives" depends="init.debug,build.nativewindow,build.jogl,build.newt,build.oculusvr,one.dir,test.compile" />
 
     <target name="test.compile">
       <ant antfile="build-test.xml" target="test.compile" inheritRefs="true" inheritAll="true"/>
@@ -47,10 +47,10 @@
 
     <target name="clean" depends="init">
         <ant antfile="${nativewindow.build.xml}" dir="${nativewindow.make}" target="clean" inheritRefs="true" inheritAll="true"/>
-        <ant antfile="${jogl.build.xml}" dir="${jogl.make}" target="clean" inheritRefs="true" inheritAll="true"/>
-        <ant antfile="${newt.build.xml}" dir="${newt.make}" target="clean" inheritRefs="true" inheritAll="true"/>
-        <ant antfile="${newt.build.xml}" dir="${newt.make}" target="clean" inheritRefs="true" inheritAll="true"/>
-        <ant antfile="build-test.xml"                       target="clean" inheritRefs="true" inheritAll="true"/>
+        <ant antfile="${jogl.build.xml}"     dir="${jogl.make}"     target="clean" inheritRefs="true" inheritAll="true"/>
+        <ant antfile="${newt.build.xml}"     dir="${newt.make}"     target="clean" inheritRefs="true" inheritAll="true"/>
+        <ant antfile="${oculusvr.build.xml}" dir="${oculusvr.make}" target="clean" inheritRefs="true" inheritAll="true"/>
+        <ant antfile="build-test.xml"                               target="clean" inheritRefs="true" inheritAll="true"/>
         <delete includeEmptyDirs="true" quiet="true" failonerror="false">
             <fileset dir="${build}" />
             <fileset dir="." includes="*.tga" />
@@ -79,12 +79,17 @@
         <ant antfile="${newt.build.xml}" dir="${newt.make}" target="all" inheritRefs="true" inheritAll="true"/>
     </target>
 
+    <target name="build.oculusvr" depends="init" if="oculusvr.sdk.available">
+        <ant antfile="${oculusvr.build.xml}" dir="${oculusvr.make}" target="all" inheritRefs="true" inheritAll="true"/>
+    </target>
+
     <target name="one.lib.dir" depends="init,gluegen.cpptasks.detect.os" unless="one.dir.skip">
         <mkdir dir="${lib}" />
         <copy todir="${lib}">
             <fileset dir="${build}/jogl/obj" includes="*.${native.library.suffix}" />
             <fileset dir="${build}/nativewindow/obj" includes="*.${native.library.suffix}" />
             <fileset dir="${build}/newt/obj" includes="*.${native.library.suffix}" />
+            <!-- fileset dir="${build}/oculusvr/obj" includes="*.${native.library.suffix}" /-->
         </copy>
     </target>
 
@@ -95,6 +100,7 @@
             <fileset dir="${build.jogl}" includes="*.jar" />
             <fileset dir="${build.nativewindow}" includes="*.jar" />
             <fileset dir="${build.newt}" includes="*.jar" />
+            <fileset dir="${build.oculusvr}" includes="*.jar" erroronmissingdir="false"/> <!-- optional -->
         </copy>
 
         <copy file="joglversion-all"
@@ -109,6 +115,18 @@
                 <filter token="JAR_CODEBASE_TAG" value="${jogamp.jar.codebase}"/>
             </filterset>
         </copy>
+        <copy file="joglversion-all-natives"
+            tofile="${build}/manifest-all-natives.mf"
+            overwrite="true">
+            <filterset>
+                <filter token="VERSION" value="${jogamp.version}"/>
+                <filter token="BUILD_VERSION" value="${jogl.version}"/>
+                <filter token="SCM_BRANCH" value="${jogl.build.branch}"/>
+                <filter token="SCM_COMMIT" value="${jogl.build.commit}"/>
+                <filter token="BASEVERSION" value="${jogamp.version.base}"/>
+                <filter token="JAR_CODEBASE_TAG" value="${jogamp.jar.codebase}"/>
+            </filterset>
+        </copy>
     </target>
 
     <target name="one.jar.dir.android" depends="one.jar.dir.prep" if="android-jars.available" unless="one.dir.skip">
@@ -130,6 +148,7 @@
                     <path refid="nativewindow_all_atoms.classpath"/>
                     <path refid="jogl_all_atoms.classpath"/>
                     <path refid="newt_all_atoms.classpath"/>
+                    <!-- path refid="oculusvr_all_atoms.classpath"/-->
                 </zips>
             </archives>
         </jar>
@@ -139,6 +158,7 @@
                     <path refid="nativewindow_all-noawt_atoms.classpath"/>
                     <path refid="jogl_all-noawt_atoms.classpath"/>
                     <path refid="newt_all-noawt_atoms.classpath"/>
+                    <!-- path refid="oculusvr_all_atoms.classpath"/-->
                 </zips>
             </archives>
         </jar>
@@ -148,15 +168,20 @@
                     <path refid="nativewindow_all-noawt_atoms.classpath"/>
                     <path refid="jogl_all-mobile_atoms.classpath"/>
                     <path refid="newt_all-mobile_atoms.classpath"/>
+                    <!-- path refid="oculusvr_all_atoms.classpath"/-->
                 </zips>
             </archives>
         </jar>
-        <jar manifest="${build}/manifest-all.mf" destfile="${jar}/jogl-all-natives-${os.and.arch}.jar" filesonly="true">
-            <fileset dir="${lib}">
-              <include name="*.${native.library.suffix}" />
-              <exclude name="*jogl_cg.${native.library.suffix}" />
-            </fileset>
-        </jar>
+        <native.tag.jar objdir="${lib}"
+                        nativejarfile="${jar}/jogl-all-natives-${os.and.arch}.jar"
+                        manifestfile="${build}/manifest-all-natives.mf"
+                        module="opengl"
+                        includelibs="*.${native.library.suffix}" 
+                        excludelibs="*jogl_cg.${native.library.suffix}" />
+        <!-- Produce duplicates for diff 'all' configuration, since non-native-jar aliasing (Bug 1023/Bug 1024) -->
+        <copy file="${jar}/jogl-all-natives-${os.and.arch}.jar" tofile="${jar}/jogl-all-noawt-natives-${os.and.arch}.jar" />
+        <copy file="${jar}/jogl-all-natives-${os.and.arch}.jar" tofile="${jar}/jogl-all-mobile-natives-${os.and.arch}.jar" />
+        <copy file="${jar}/jogl-all-natives-${os.and.arch}.jar" tofile="${jar}/jogl-all-android-natives-${os.and.arch}.jar" />
     </target>
 
     <target name="android.package.jogl.skip.check" depends="init,gluegen.cpptasks.detect.os">
@@ -196,11 +221,15 @@
         <srcfiles dir="${build.jogl}" includes="*.jar"/>
         <srcfiles dir="${build.newt}" includes="*.jar"/>
       </uptodate>
+      <uptodate property="one.dir.skip.oculusvr" targetfile="${oculusvr.jar}">
+        <srcfiles dir="${build.oculusvr}" includes="*.jar"/>
+      </uptodate>
       <condition property="one.dir.skip">
           <and>
               <isset property="one.dir.skip.native"/>
               <isset property="one.dir.skip.all"/>
               <isset property="one.dir.skip.android"/>
+              <isset property="one.dir.skip.oculusvr"/>
           </and>
       </condition>
     </target>
@@ -234,12 +263,18 @@
         <!--delete includeEmptyDirs="true" quiet="true" failonerror="false">
             <fileset dir="${build}" includes="jogl-java-src.zip" />
         </delete-->
+        <mkdir dir="${build}/oculusvr/gensrc/classes"/> <!-- just in case it was _not_ build -->
         <zip destfile="${build}/jogl-java-src.zip" level="0">
             <fileset dir="${src}/nativewindow/classes"/>
             <fileset dir="${build}/nativewindow/gensrc/classes"/>
             <fileset dir="${src}/jogl/classes"/>
             <fileset dir="${build}/jogl/gensrc/classes"/>
             <fileset dir="${src}/newt/classes"/>
+            <fileset dir="${src}/oculusvr/classes"/>
+            <fileset dir="${build}/oculusvr/gensrc/classes"/>
+        </zip>
+        <zip destfile="${build}/jogl-test-java-src.zip" level="0">
+            <fileset dir="${src}/test"/>
         </zip>
     </target>
 
@@ -281,6 +316,7 @@
         <copy todir="${archive}">
             <fileset dir="${build}">
                 <include name="jogl-java-src.zip"/>
+                <include name="jogl-test-java-src.zip"/>
             </fileset>
         </copy>
         <archive.7z destfile="${build}/${archive.name}.7z"
@@ -366,7 +402,7 @@
         <property name="javadoc.spec.packagenames" value="javax.media.opengl.*" />
 
         <property name="javadoc.windowtitle" value="JOGL, NativeWindow and NEWT APIs" />
-        <property name="javadoc.packagenames" value="${javadoc.nw.spec.packagenames}, ${javadoc.spec.packagenames}, com.jogamp.opengl.*, com.jogamp.nativewindow.*, com.jogamp.newt.*" />
+        <property name="javadoc.packagenames" value="${javadoc.nw.spec.packagenames}, ${javadoc.spec.packagenames}, com.jogamp.opengl.*, com.jogamp.nativewindow.*, com.jogamp.newt.* com.jogamp.oculusvr.*" />
 
         <property name="javadoc.dev.packagenames" value="${javadoc.packagenames}, com.jogamp.opengl.*, com.jogamp.nativewindow.*, com.jogamp.newt.*, com.jogamp.gluegen.opengl.*, com.jogamp.gluegen.runtime.opengl.*, jogamp.nativewindow.*, jogamp.opengl.*, jogamp.newt.*" />
 
diff --git a/make/config/jogl/cgl-macosx-CustomJavaCode.java b/make/config/jogl/cgl-macosx-CustomJavaCode.java
index ab1d44b..fc3ce1c 100644
--- a/make/config/jogl/cgl-macosx-CustomJavaCode.java
+++ b/make/config/jogl/cgl-macosx-CustomJavaCode.java
@@ -11,8 +11,10 @@
  * </p>
  */
 public static long createNSOpenGLLayer(final long ctx, final int gl3ShaderProgramName, final long fmt, final long p, 
-                                       final int texID, final boolean opaque, final int texWidth, final int texHeight) {
-   return createNSOpenGLLayerImpl(ctx, gl3ShaderProgramName, fmt, p, texID, opaque, texWidth, texHeight);
+                                       final int texID, final boolean opaque, 
+                                       final int texWidth, final int texHeight, 
+                                       final int winWidth, final int winHeight) {
+   return createNSOpenGLLayerImpl(ctx, gl3ShaderProgramName, fmt, p, texID, opaque, texWidth, texHeight, winWidth, winHeight);
 }
 
 /**
diff --git a/make/config/jogl/gl-es3-impl.cfg b/make/config/jogl/gl-es3-impl.cfg
index 2e5e36e..9682e49 100644
--- a/make/config/jogl/gl-es3-impl.cfg
+++ b/make/config/jogl/gl-es3-impl.cfg
@@ -48,12 +48,8 @@ TagNativeBinding true
 
 # Add PixelStorei StateTracker
 #
-# Add input validation to glPixelStorei, just to be sure.
 CustomJavaCode GLES3Impl private static final int params_offset = 0; // just a helper for JavaPrologue ..
 
-JavaPrologue glPixelStorei if (pname != GL_PACK_ALIGNMENT && pname != GL_UNPACK_ALIGNMENT) {
-JavaPrologue glPixelStorei     throw new GLException("Unsupported pixel store parameter name 0x" + Integer.toHexString(pname));
-JavaPrologue glPixelStorei }
 JavaPrologue glPixelStorei glStateTracker.setInt(pname, param);
 
 JavaPrologue glGetIntegerv if ( glStateTracker.getInt(pname, params, params_offset) ) { return; }
diff --git a/make/config/jogl/gl-if-CustomJavaCode-es3.java b/make/config/jogl/gl-if-CustomJavaCode-es3.java
index 3f976d5..88c557f 100644
--- a/make/config/jogl/gl-if-CustomJavaCode-es3.java
+++ b/make/config/jogl/gl-if-CustomJavaCode-es3.java
@@ -8,11 +8,7 @@ public static final long GL_TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFFL ;
 /** Part of <code>GL_ARB_shader_image_load_store</code> */
 public static final int GL_ALL_BARRIER_BITS = 0xFFFFFFFF ;
 
-/** @deprecated Avoid original GL API namespace conflict. Use {@link #isPBOPackBound()} */
-public boolean glIsPBOPackBound();
 public boolean isPBOPackBound();
 
-/** @deprecated Avoid original GL API namespace conflict. Use {@link #isPBOUnpackBound()} */
-public boolean glIsPBOUnpackBound();
 public boolean isPBOUnpackBound();
 
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-common.java b/make/config/jogl/gl-impl-CustomJavaCode-common.java
index f024635..a2ca129 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-common.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-common.java
@@ -5,37 +5,21 @@
     private final GLProfile glProfile;
 
     @Override
-    public final int glGetBoundBuffer(int target) {
-        return getBoundBuffer(target);
-    }
-    @Override
     public final int getBoundBuffer(int target) {
         return bufferStateTracker.getBoundBufferObject(target, this);
     }
 
     @Override
-    public final long glGetBufferSize(int bufferName) {
-        return bufferObjectTracker.getBufferSize(bufferName);
-    }
-    @Override
     public final GLBufferStorage getBufferStorage(int bufferName) {
         return bufferObjectTracker.getBufferStorage(bufferName);
     }
 
     @Override
-    public final boolean glIsVBOArrayBound() {
-        return isVBOArrayBound();
-    }
-    @Override
     public final boolean isVBOArrayBound() {
         return checkArrayVBOBound(false);
     }
 
     @Override
-    public final boolean glIsVBOElementArrayBound() {
-        return isVBOElementArrayBound();
-    }
-    @Override
     public final boolean isVBOElementArrayBound() {
         return checkElementVBOBound(false);
     }
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
index f0adb53..a8b5f83 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
@@ -426,19 +426,11 @@ private final boolean checkPackPBOBound(boolean throwException) {
 }
 
 @Override
-public final boolean glIsPBOPackBound() {
-    return isPBOPackBound();
-}
- at Override
 public final boolean isPBOPackBound() {
     return checkPackPBOBound(false);
 }
 
 @Override
-public final boolean glIsPBOUnpackBound() {
-    return isPBOUnpackBound();
-}
- at Override
 public final boolean isPBOUnpackBound() {
     return checkUnpackPBOBound(false);
 }
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles3.java b/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
index a5c0d19..42adca4 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
@@ -329,19 +329,11 @@ private final boolean checkPackPBOBound(boolean throwException) {
 }
 
 @Override
-public final boolean glIsPBOPackBound() {
-    return isPBOPackBound();
-}
- at Override
 public final boolean isPBOPackBound() {
     return checkPackPBOBound(false);
 }
 
 @Override
-public final boolean glIsPBOUnpackBound() {
-    return isPBOUnpackBound();
-}
- at Override
 public final boolean isPBOUnpackBound() {
     return checkUnpackPBOBound(false);
 }
diff --git a/make/config/jogl/glu-CustomJavaCode-base.java b/make/config/jogl/glu-CustomJavaCode-base.java
index 21d6277..e8047d9 100644
--- a/make/config/jogl/glu-CustomJavaCode-base.java
+++ b/make/config/jogl/glu-CustomJavaCode-base.java
@@ -83,11 +83,16 @@ static {
     Class _gl2Class=null;
     Class _gl2es1Class=null;
     try {
-        _gl2Class = Class.forName("javax.media.opengl.glu.gl2.GLUgl2");
-        _gl2es1Class = Class.forName("javax.media.opengl.glu.gl2es1.GLUgl2es1");
+        final ClassLoader cl = GLU.class.getClassLoader();
+        _gl2Class = Class.forName("javax.media.opengl.glu.gl2.GLUgl2", false, cl);
+        _gl2es1Class = Class.forName("javax.media.opengl.glu.gl2es1.GLUgl2es1", false, cl);
     } catch (Throwable t) {}
     gl2Class = _gl2Class;
     gl2es1Class = _gl2es1Class;
+    /** Not required nor forced
+    if( !initializeImpl() ) {
+        throw new RuntimeException("Initialization failure");
+    } */
 }
 
 /**
@@ -123,14 +128,7 @@ public static final GLU createGLU(GL gl) throws GLException {
 
 public GLU()
 {
-  this.project = new ProjectFloat();
-}
-
-public void destroy() {
-  if(null!=this.project) {
-      this.project.destroy();
-      this.project=null;
-  }
+  project = new ProjectFloat();
 }
 
 public static final GL getCurrentGL() throws GLException {
@@ -1310,7 +1308,7 @@ public final void gluSphere(GLUquadric quad, double radius, int slices, int stac
 // Projection routines
 //
 
-private ProjectFloat project;
+private final ProjectFloat project;
 
 public void gluOrtho2D(float left, float right, float bottom, float top) {
   project.gluOrtho2D(getCurrentGL().getGL2ES1(), left, right, bottom, top);
diff --git a/make/config/jogl/glu-CustomJavaCode-gl2.java b/make/config/jogl/glu-CustomJavaCode-gl2.java
index 4dcb569..d7ba58d 100644
--- a/make/config/jogl/glu-CustomJavaCode-gl2.java
+++ b/make/config/jogl/glu-CustomJavaCode-gl2.java
@@ -7,6 +7,10 @@ static {
         if (val != null && !val.toLowerCase().equals("false")) {
           useJavaMipmapCode = false;
         }
+        /** Not required nor forced
+        if( !initializeImpl() ) {
+            throw new RuntimeException("Initialization failure");
+        } */
         return null;
       }
     });
@@ -31,18 +35,9 @@ static {
 
 public GLUgl2()
 {
-  this.project = new ProjectDouble();
+  project = new ProjectDouble();
 }
 
-public void destroy() {
-  if(null!=this.project) {
-      this.project.destroy();
-      this.project=null;
-  }
-  super.destroy();
-}
-
-
 //----------------------------------------------------------------------
 // Utility routines
 //
@@ -132,7 +127,7 @@ public final boolean isFunctionAvailable(String gluFunctionName)
 // Projection routines
 //
 
-private ProjectDouble project;
+private final ProjectDouble project;
 
 public final void gluOrtho2D(float left, float right, float bottom, float top) {
   project.gluOrtho2D(getCurrentGL2(), (double)left, (double)right, (double)bottom, (double)top);
diff --git a/make/config/jogl/glu-CustomJavaCode-gl2es1.java b/make/config/jogl/glu-CustomJavaCode-gl2es1.java
index 203d1ee..41a7e5b 100644
--- a/make/config/jogl/glu-CustomJavaCode-gl2es1.java
+++ b/make/config/jogl/glu-CustomJavaCode-gl2es1.java
@@ -8,6 +8,10 @@ static {
         if (val != null && !val.toLowerCase().equals("false")) {
           useJavaMipmapCode = false;
         }
+        // Not required nor forced
+        // if( !initializeImpl() ) {
+        //     throw new RuntimeException("Initialization failure");
+        // }
         return null;
       }
     });
@@ -36,10 +40,6 @@ public GLUgl2es1()
   super();
 }
 
-public void destroy() {
-  super.destroy();
-}
-
 //----------------------------------------------------------------------
 // Utility routines
 //
diff --git a/make/config/jogl/glu-base.cfg b/make/config/jogl/glu-base.cfg
index f4021d6..05aa211 100644
--- a/make/config/jogl/glu-base.cfg
+++ b/make/config/jogl/glu-base.cfg
@@ -18,6 +18,7 @@ Ignore gluScaleImage
 
 # Custom Java code for GLU class
 IncludeAs CustomJavaCode GLU glu-CustomJavaCode-base.java
+ManualStaticInitCall GLU
 
 # Imports for the Error and Registry classes
 Import jogamp.opengl.glu.error.Error
diff --git a/make/config/jogl/glu-gl2.cfg b/make/config/jogl/glu-gl2.cfg
index a634e31..696e070 100644
--- a/make/config/jogl/glu-gl2.cfg
+++ b/make/config/jogl/glu-gl2.cfg
@@ -34,6 +34,7 @@ CustomCCode #include <GL/glu.h>
 
 # Custom Java code for GLU class
 IncludeAs CustomJavaCode GLUgl2 glu-CustomJavaCode-gl2.java
+ManualStaticInitCall GLUgl2
 
 # GLU needs access to the GLUtesselatorImpl class for GLUtesselator,
 # to the Mipmap class for scaling and mipmap generation,
diff --git a/make/config/jogl/glu-gl2es1.cfg b/make/config/jogl/glu-gl2es1.cfg
index fa70113..ef9405f 100644
--- a/make/config/jogl/glu-gl2es1.cfg
+++ b/make/config/jogl/glu-gl2es1.cfg
@@ -18,6 +18,7 @@ Ignore gluScaleImage
 
 # Custom Java code for GLU class
 IncludeAs CustomJavaCode GLUgl2es1 glu-CustomJavaCode-gl2es1.java
+ManualStaticInitCall GLUgl2es1
 
 Import javax.media.opengl.GLES1
 Import jogamp.opengl.glu.mipmap.Mipmap
diff --git a/make/config/jogl/glx-CustomCCode.c b/make/config/jogl/glx-CustomCCode.c
index b077c65..7216e5b 100644
--- a/make/config/jogl/glx-CustomCCode.c
+++ b/make/config/jogl/glx-CustomCCode.c
@@ -17,51 +17,8 @@
 /* We expect glXGetProcAddressARB to be defined */
 extern void (*glXGetProcAddressARB(const GLubyte *procname))();
 
-static const char * clazzNameBuffers = "com/jogamp/common/nio/Buffers";
-static const char * clazzNameBuffersStaticCstrName = "copyByteBuffer";
-static const char * clazzNameBuffersStaticCstrSignature = "(Ljava/nio/ByteBuffer;)Ljava/nio/ByteBuffer;";
-static const char * clazzNameByteBuffer = "java/nio/ByteBuffer";
-static jclass clazzBuffers = NULL;
-static jmethodID cstrBuffers = NULL;
-static jclass clazzByteBuffer = NULL;
-
-static void _initClazzAccess(JNIEnv *env) {
-    jclass c;
-
-    if(NULL!=cstrBuffers) return ;
-
-    c = (*env)->FindClass(env, clazzNameBuffers);
-    if(NULL==c) {
-        fprintf(stderr, "FatalError: Java_jogamp_opengl_x11_glx_GLX: can't find %s\n", clazzNameBuffers);
-        (*env)->FatalError(env, clazzNameBuffers);
-    }
-    clazzBuffers = (jclass)(*env)->NewGlobalRef(env, c);
-    if(NULL==clazzBuffers) {
-        fprintf(stderr, "FatalError: Java_jogamp_opengl_x11_glx_GLX: can't use %s\n", clazzNameBuffers);
-        (*env)->FatalError(env, clazzNameBuffers);
-    }
-    c = (*env)->FindClass(env, clazzNameByteBuffer);
-    if(NULL==c) {
-        fprintf(stderr, "FatalError: Java_jogamp_opengl_x11_glx_GLX: can't find %s\n", clazzNameByteBuffer);
-        (*env)->FatalError(env, clazzNameByteBuffer);
-    }
-    clazzByteBuffer = (jclass)(*env)->NewGlobalRef(env, c);
-    if(NULL==c) {
-        fprintf(stderr, "FatalError: Java_jogamp_opengl_x11_glx_GLX: can't use %s\n", clazzNameByteBuffer);
-        (*env)->FatalError(env, clazzNameByteBuffer);
-    }
-
-    cstrBuffers = (*env)->GetStaticMethodID(env, clazzBuffers, 
-                            clazzNameBuffersStaticCstrName, clazzNameBuffersStaticCstrSignature);
-    if(NULL==cstrBuffers) {
-        fprintf(stderr, "FatalError: Java_jogamp_opengl_x11_glx_GLX:: can't create %s.%s %s\n",
-            clazzNameBuffers,
-            clazzNameBuffersStaticCstrName, clazzNameBuffersStaticCstrSignature);
-        (*env)->FatalError(env, clazzNameBuffersStaticCstrName);
-    }
-}
-
-/*   Java->C glue code:
+/**
+ * Java->C glue code:
  *   Java package: jogamp.opengl.x11.glx.GLX
  *    Java method: int glXGetFBConfigAttributes(long dpy, long config, IntBuffer attributes, IntBuffer values)
  */
@@ -96,19 +53,13 @@ Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXGetVisualFromFBConfig(JNIEnv *env, j
   typedef XVisualInfo* (APIENTRY*_local_PFNGLXGETVISUALFROMFBCONFIG)(Display *  dpy, GLXFBConfig config);
   _local_PFNGLXGETVISUALFROMFBCONFIG ptr_glXGetVisualFromFBConfig;
   XVisualInfo *  _res;
-  jobject jbyteSource;
   jobject jbyteCopy;
   ptr_glXGetVisualFromFBConfig = (_local_PFNGLXGETVISUALFROMFBCONFIG) (intptr_t) procAddress;
   assert(ptr_glXGetVisualFromFBConfig != NULL);
   _res = (* ptr_glXGetVisualFromFBConfig) ((Display *) (intptr_t) dpy, (GLXFBConfig) (intptr_t) config);
   if (_res == NULL) return NULL;
 
-  _initClazzAccess(env);
-
-  jbyteSource = (*env)->NewDirectByteBuffer(env, _res, sizeof(XVisualInfo));
-  jbyteCopy   = (*env)->CallStaticObjectMethod(env, clazzBuffers, cstrBuffers, jbyteSource);
-
-  (*env)->DeleteLocalRef(env, jbyteSource);
+  jbyteCopy   = JVMUtil_NewDirectByteBufferCopy(env, _res, sizeof(XVisualInfo));
   XFree(_res);
 
   return jbyteCopy;
@@ -127,7 +78,6 @@ Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXChooseFBConfig(JNIEnv *env, jclass _
   int * _nitems_ptr = NULL;
   GLXFBConfig *  _res;
   int count, i;
-  jobject jbyteSource;
   jobject jbyteCopy;
     if ( NULL != attribList ) {
         _attribList_ptr = (int *) (((char*) (*env)->GetDirectBufferAddress(env, attribList)) + attribList_byte_offset);
@@ -158,11 +108,8 @@ Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXChooseFBConfig(JNIEnv *env, jclass _
     }
   }
   // fprintf(stderr, "glXChooseFBConfig.X: Count %d\n", count);
-  _initClazzAccess(env);
 
-  jbyteSource = (*env)->NewDirectByteBuffer(env, _res, count * sizeof(GLXFBConfig));
-  jbyteCopy   = (*env)->CallStaticObjectMethod(env, clazzBuffers, cstrBuffers, jbyteSource);
-  (*env)->DeleteLocalRef(env, jbyteSource);
+  jbyteCopy   = JVMUtil_NewDirectByteBufferCopy(env, _res, count * sizeof(GLXFBConfig));
   XFree(_res);
 
   return jbyteCopy;
@@ -180,7 +127,6 @@ Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXGetFBConfigs(JNIEnv *env, jclass _un
   int * _nelements_ptr = NULL;
   GLXFBConfig *  _res;
   int count, i;
-  jobject jbyteSource;
   jobject jbyteCopy;
     if ( NULL != nelements ) {
         _nelements_ptr = (int *) (((char*) (*env)->GetDirectBufferAddress(env, nelements)) + nelements_byte_offset);
@@ -206,11 +152,8 @@ Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXGetFBConfigs(JNIEnv *env, jclass _un
        i++;
     }
   }
-  _initClazzAccess(env);
 
-  jbyteSource = (*env)->NewDirectByteBuffer(env, _res, count * sizeof(GLXFBConfig));
-  jbyteCopy   = (*env)->CallStaticObjectMethod(env, clazzBuffers, cstrBuffers, jbyteSource);
-  (*env)->DeleteLocalRef(env, jbyteSource);
+  jbyteCopy   = JVMUtil_NewDirectByteBufferCopy(env, _res, count * sizeof(GLXFBConfig));
   XFree(_res);
 
   return jbyteCopy;
@@ -228,7 +171,6 @@ Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXChooseVisual(JNIEnv *env, jclass _un
   _local_PFNGLXCHOOSEVISUALPROC ptr_glXChooseVisual;
   int * _attribList_ptr = NULL;
   XVisualInfo *  _res;
-  jobject jbyteSource;
   jobject jbyteCopy;
     if ( NULL != attribList ) {
         _attribList_ptr = (int *) (((char*) (*env)->GetDirectBufferAddress(env, attribList)) + attribList_byte_offset);
@@ -238,12 +180,7 @@ Java_jogamp_opengl_x11_glx_GLX_dispatch_1glXChooseVisual(JNIEnv *env, jclass _un
   _res = (* ptr_glXChooseVisual) ((Display *) (intptr_t) dpy, (int) screen, (int *) _attribList_ptr);
   if (NULL == _res) return NULL;
 
-  _initClazzAccess(env);
-
-  jbyteSource = (*env)->NewDirectByteBuffer(env, _res, sizeof(XVisualInfo));
-  jbyteCopy   = (*env)->CallStaticObjectMethod(env, clazzBuffers, cstrBuffers, jbyteSource);
-
-  (*env)->DeleteLocalRef(env, jbyteSource);
+  jbyteCopy   = JVMUtil_NewDirectByteBufferCopy(env, _res, sizeof(XVisualInfo));
   XFree(_res);
 
   return jbyteCopy;
diff --git a/make/config/jogl/glx-x11.cfg b/make/config/jogl/glx-x11.cfg
index 1c138c8..6a5bdc4 100644
--- a/make/config/jogl/glx-x11.cfg
+++ b/make/config/jogl/glx-x11.cfg
@@ -32,6 +32,7 @@ CustomJavaCode GLX public  static GLXProcAddressTable getGLXProcAddressTable() {
 
 IncludeAs CustomJavaCode GLX glx-CustomJavaCode.java
 IncludeAs CustomCCode        glx-CustomCCode.c
+ForceStaticInitCode GLX
 
 ArgumentIsString XOpenDisplay 0
 
diff --git a/make/config/nativewindow/jawt-common.cfg b/make/config/nativewindow/jawt-common.cfg
index 55f3f36..41129e6 100644
--- a/make/config/nativewindow/jawt-common.cfg
+++ b/make/config/nativewindow/jawt-common.cfg
@@ -10,10 +10,11 @@ HierarchicalNativeOutput false
 Opaque boolean jboolean
 Opaque long struct jawt_DrawingSurface*
 
-ReturnValueCapacity GetDrawingSurface sizeof(JAWT_DrawingSurface)
-ReturnValueCapacity GetDrawingSurfaceInfo sizeof(JAWT_DrawingSurfaceInfo)
+ReturnValueCapacity JAWT.GetDrawingSurface sizeof(JAWT_DrawingSurface)
+ReturnValueCapacity JAWT_DrawingSurface.GetDrawingSurfaceInfo sizeof(JAWT_DrawingSurfaceInfo)
 
 IgnoreField JAWT GetComponent
+IgnoreField JAWT_DrawingSurface target
 IgnoreField JAWT_DrawingSurfaceInfo platformInfo
 
 IncludeAs CustomJavaCode JAWT jawt-CustomJavaCode.java
diff --git a/make/config/oculusvr/oculusvr-common.cfg b/make/config/oculusvr/oculusvr-common.cfg
new file mode 100644
index 0000000..24f535d
--- /dev/null
+++ b/make/config/oculusvr/oculusvr-common.cfg
@@ -0,0 +1,55 @@
+Package com.jogamp.oculusvr
+
+# Specify output directories
+HierarchicalNativeOutput false
+JavaOutputDir gensrc/classes
+NativeOutputDir gensrc/native/oculusvr
+
+# Raise OVRException instead of RuntimeException in glue code
+RuntimeExceptionType OVRException
+
+# We utilize OvrHmdContext as specified below as a 'typesafe' opaque instance,
+# which is typedefed to ovrHmd - hence no type-unsafe opaque 'long' is required.
+#   typedef struct ovrHmdStruct {
+#   } OvrHmdContext;
+#Opaque long ovrHmd
+
+# Mappings for data types
+Opaque boolean ovrBool
+
+# Not implemented in SDK !?
+Ignore ovrHmd_ProcessLatencyTest
+
+# Not native sized: CType['uintptr_t *', size [fixed false, lnx64 64], [array*1]]
+Ignore ovrRenderAPIConfig.PlatformData
+# Not native sized: CType['uintptr_t *', size [fixed false, lnx64 64], [array*1]]
+Ignore ovrTexture.PlatformData
+
+# These routines use or return strings
+ReturnsString ovrHmd_GetLastError
+ReturnsString ovrHmd_GetLatencyTestResult
+ReturnsString ovrHmd_GetString
+
+ReturnsString ovrHmdDesc.ProductName
+ReturnsString ovrHmdDesc.Manufacturer
+ReturnsString ovrHmdDesc.DisplayDeviceName
+ReturnsString ovrSensorDesc.SerialNumber
+
+ReturnedArrayLength ovrHmdDesc.Handle 1
+ReturnedArrayLength ovrDistortionMesh.pVertexData getVertexCount()
+ReturnedArrayLength ovrDistortionMesh.pIndexData getIndexCount()
+
+ReturnValueCapacity ovrHmd_Create sizeof(ovrHmd)
+ReturnValueCapacity ovrHmd_CreateDebug sizeof(ovrHmd)
+
+JavaPrologue ovr_Initialize if( !isAvailable() ) { return false; }
+JavaPrologue ovrHmd_Create if( !isAvailable() ) { return null; }
+JavaPrologue ovrHmd_CreateDebug if( !isAvailable() ) { return null; }
+
+ArgumentIsString ovrHmd_GetFloat 1
+ArgumentIsString ovrHmd_SetFloat 1
+ArgumentIsString ovrHmd_GetFloatArray 1
+ArgumentIsString ovrHmd_SetFloatArray 1
+ArgumentIsString ovrHmd_GetArraySize 1
+
+
diff --git a/make/config/oculusvr/oculusvr-ovr-CustomJavaCode.java b/make/config/oculusvr/oculusvr-ovr-CustomJavaCode.java
new file mode 100644
index 0000000..281610a
--- /dev/null
+++ b/make/config/oculusvr/oculusvr-ovr-CustomJavaCode.java
@@ -0,0 +1,33 @@
+
+    static final DynamicLibraryBundle dynamicLookupHelper;
+
+    static {
+        dynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DynamicLibraryBundle>() {
+                    public DynamicLibraryBundle run() {
+                        final DynamicLibraryBundle bundle =  new DynamicLibraryBundle(new OVRDynamicLibraryBundleInfo());
+                        if(null==bundle) {
+                          throw new RuntimeException("Null DynamicLibraryBundle");
+                        }
+                        /** No native tool library to load
+                        if(!bundle.isToolLibLoaded()) {
+                          System.err.println("Couln't load native OVR/JNI glue library");
+                          return null;
+                        } */
+                        if(!bundle.isLibComplete()) {
+                          System.err.println("Couln't load native OVR/JNI glue library");
+                          return null;
+                        }
+                        if( !initializeImpl() ) {
+                          System.err.println("Native initialization failure of OVR/JNI glue library");
+                          return null;
+                        }
+                        return bundle;
+                    } } );
+    }
+
+    /**
+     * Accessor.
+     * @returns true if OVR library is available on this machine.
+     */
+    public static boolean isAvailable() { return dynamicLookupHelper != null; }
+
diff --git a/make/config/oculusvr/oculusvr.c b/make/config/oculusvr/oculusvr.c
new file mode 100644
index 0000000..7486ce3
--- /dev/null
+++ b/make/config/oculusvr/oculusvr.c
@@ -0,0 +1,5 @@
+
+typedef struct ovrHmdStruct {
+} OvrHmdContext;
+
+#include "OVR_CAPI.h"
diff --git a/make/config/oculusvr/oculusvr.cfg b/make/config/oculusvr/oculusvr.cfg
new file mode 100644
index 0000000..11e1ee7
--- /dev/null
+++ b/make/config/oculusvr/oculusvr.cfg
@@ -0,0 +1,18 @@
+# This .cfg file is used to generate the JOAL interface.
+Include oculusvr-common.cfg
+
+Style AllStatic
+JavaClass OVR
+
+Import com.jogamp.oculusvr.*
+Import java.security.AccessController
+Import java.security.PrivilegedAction
+
+IncludeAs CustomJavaCode OVR oculusvr-ovr-CustomJavaCode.java
+ManualStaticInitCall OVR
+
+# Provide #includes to native code
+CustomCCode typedef struct ovrHmdStruct {
+CustomCCode } OvrHmdContext;
+CustomCCode #include <OVR_CAPI.h>
+
diff --git a/make/joglversion-all-natives b/make/joglversion-all-natives
new file mode 100644
index 0000000..a45262a
--- /dev/null
+++ b/make/joglversion-all-natives
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Application-Name: Java Bindings for OpenGL
+Specification-Title: Java Bindings for OpenGL API Specification
+Specification-Version: @BASEVERSION@
+Specification-Vendor: JogAmp Community
+Implementation-Title: Java Bindings for OpenGL Runtime Environment
+Implementation-Version: @VERSION@
+Implementation-Build: @BUILD_VERSION@
+Implementation-Branch: @SCM_BRANCH@
+Implementation-Commit: @SCM_COMMIT@
+Implementation-Vendor: JogAmp Community
+Implementation-URL: http://jogamp.org/
+Extension-Name: jogamp.nativetag.opengl
+Implementation-Vendor-Id: com.jogamp
+Trusted-Library: true
+Permissions: all-permissions
+Application-Library-Allowable-Codebase: *
+ at JAR_CODEBASE_TAG@
+
diff --git a/make/joglversion-natives b/make/joglversion-natives
new file mode 100644
index 0000000..a45262a
--- /dev/null
+++ b/make/joglversion-natives
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Application-Name: Java Bindings for OpenGL
+Specification-Title: Java Bindings for OpenGL API Specification
+Specification-Version: @BASEVERSION@
+Specification-Vendor: JogAmp Community
+Implementation-Title: Java Bindings for OpenGL Runtime Environment
+Implementation-Version: @VERSION@
+Implementation-Build: @BUILD_VERSION@
+Implementation-Branch: @SCM_BRANCH@
+Implementation-Commit: @SCM_COMMIT@
+Implementation-Vendor: JogAmp Community
+Implementation-URL: http://jogamp.org/
+Extension-Name: jogamp.nativetag.opengl
+Implementation-Vendor-Id: com.jogamp
+Trusted-Library: true
+Permissions: all-permissions
+Application-Library-Allowable-Codebase: *
+ at JAR_CODEBASE_TAG@
+
diff --git a/make/nativewindowversion-natives b/make/nativewindowversion-natives
new file mode 100644
index 0000000..ccdfbe1
--- /dev/null
+++ b/make/nativewindowversion-natives
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Application-Name: Native Window Interface
+Specification-Title: Native Window Interface API Specification
+Specification-Version: @BASEVERSION@
+Specification-Vendor: JogAmp Community
+Implementation-Title: Native Window Interface Runtime Environment
+Implementation-Version: @VERSION@
+Implementation-Build: @BUILD_VERSION@
+Implementation-Branch: @SCM_BRANCH@
+Implementation-Commit: @SCM_COMMIT@
+Implementation-Vendor: JogAmp Community
+Implementation-URL: http://jogamp.org/
+Extension-Name: jogamp.nativetag.nativewindow
+Implementation-Vendor-Id: com.jogamp
+Trusted-Library: true
+Permissions: all-permissions
+Application-Library-Allowable-Codebase: *
+ at JAR_CODEBASE_TAG@
+
diff --git a/make/newtversion-natives b/make/newtversion-natives
new file mode 100644
index 0000000..c058451
--- /dev/null
+++ b/make/newtversion-natives
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Application-Name: NEWT
+Specification-Title: NEWT API Specification
+Specification-Version: @BASEVERSION@
+Specification-Vendor: JogAmp Community
+Implementation-Title: NEWT Runtime Environment
+Implementation-Version: @VERSION@
+Implementation-Build: @BUILD_VERSION@
+Implementation-Branch: @SCM_BRANCH@
+Implementation-Commit: @SCM_COMMIT@
+Implementation-Vendor: JogAmp Community
+Implementation-URL: http://jogamp.org/
+Extension-Name: jogamp.nativetag.newt
+Implementation-Vendor-Id: com.jogamp
+Trusted-Library: true
+Permissions: all-permissions
+Application-Library-Allowable-Codebase: *
+ at JAR_CODEBASE_TAG@
+
diff --git a/make/oculusvrversion b/make/oculusvrversion
new file mode 100644
index 0000000..dc89121
--- /dev/null
+++ b/make/oculusvrversion
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Application-Name: Java Bindings for OculusVR
+Specification-Title: Java Bindings for OculusVR API Specification
+Specification-Version: @BASEVERSION@
+Specification-Vendor: JogAmp Community
+Implementation-Title: Java Bindings for OculusVR Runtime Environment
+Implementation-Version: @VERSION@
+Implementation-Build: @BUILD_VERSION@
+Implementation-Branch: @SCM_BRANCH@
+Implementation-Commit: @SCM_COMMIT@
+Implementation-Vendor: JogAmp Community
+Implementation-URL: http://jogamp.org/
+Extension-Name: com.jogamp.oculusvr
+Implementation-Vendor-Id: com.jogamp
+Trusted-Library: true
+Permissions: all-permissions
+Application-Library-Allowable-Codebase: *
+ at JAR_CODEBASE_TAG@
+
diff --git a/make/oculusvrversion-natives b/make/oculusvrversion-natives
new file mode 100644
index 0000000..25e3c2f
--- /dev/null
+++ b/make/oculusvrversion-natives
@@ -0,0 +1,19 @@
+Manifest-Version: 1.0
+Application-Name: Java Bindings for OculusVR
+Specification-Title: Java Bindings for OculusVR API Specification
+Specification-Version: @BASEVERSION@
+Specification-Vendor: JogAmp Community
+Implementation-Title: Java Bindings for OculusVR Runtime Environment
+Implementation-Version: @VERSION@
+Implementation-Build: @BUILD_VERSION@
+Implementation-Branch: @SCM_BRANCH@
+Implementation-Commit: @SCM_COMMIT@
+Implementation-Vendor: JogAmp Community
+Implementation-URL: http://jogamp.org/
+Extension-Name: jogamp.nativetag.oculusvr
+Implementation-Vendor-Id: com.jogamp
+Trusted-Library: true
+Permissions: all-permissions
+Application-Library-Allowable-Codebase: *
+ at JAR_CODEBASE_TAG@
+
diff --git a/make/resources/android/AndroidManifest-test.xml b/make/resources/android/AndroidManifest-test.xml
index 0251eb5..916f34e 100644
--- a/make/resources/android/AndroidManifest-test.xml
+++ b/make/resources/android/AndroidManifest-test.xml
@@ -171,8 +171,18 @@
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
         </activity>
-        <activity android:name="com.jogamp.opengl.test.android.MovieCubeActivityLauncher0"
-                  android:label="@string/activity_moviecube0_name"
+        <activity android:name="com.jogamp.opengl.test.android.MovieCubeActivityLauncher0a"
+                  android:label="@string/activity_moviecube0a_name"
+                  android:description="@string/activity_moviecube_descr"
+                  android:theme="@android:style/Theme.NoDisplay"
+                  >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.LAUNCHER" />
+            </intent-filter>
+        </activity>
+        <activity android:name="com.jogamp.opengl.test.android.MovieCubeActivityLauncher0b"
+                  android:label="@string/activity_moviecube0b_name"
                   android:description="@string/activity_moviecube_descr"
                   android:theme="@android:style/Theme.NoDisplay"
                   >
diff --git a/make/resources/android/res-test/values/strings.xml b/make/resources/android/res-test/values/strings.xml
index 072cf47..0d9acaa 100644
--- a/make/resources/android/res-test/values/strings.xml
+++ b/make/resources/android/res-test/values/strings.xml
@@ -29,7 +29,8 @@
     <string name="activity_moviesimple1b_name">MovieSimple1b</string>
     <string name="activity_moviesimple2_name">MovieSimple2</string>
     <string name="activity_moviesimple_descr">MovieSimple</string>
-    <string name="activity_moviecube0_name">MovieCube0</string>
+    <string name="activity_moviecube0a_name">MovieCube0</string>
+    <string name="activity_moviecube0b_name">MovieCube1</string>
     <string name="activity_moviecube1a_name">CamCube0</string>
     <string name="activity_moviecube1b_name">CamCube1</string>
     <string name="activity_moviecube_descr">MovieCube</string>
diff --git a/make/resources/assets/jogl/util/data/av/test-ntsc01-28x16.png b/make/resources/assets/jogl/util/data/av/test-ntsc01-28x16.png
new file mode 100644
index 0000000..4601a21
Binary files /dev/null and b/make/resources/assets/jogl/util/data/av/test-ntsc01-28x16.png differ
diff --git a/make/resources/assets/jogl/util/data/av/test-ntsc01-57x32.png b/make/resources/misc/test-ntsc01-57x32.png
similarity index 100%
rename from make/resources/assets/jogl/util/data/av/test-ntsc01-57x32.png
rename to make/resources/misc/test-ntsc01-57x32.png
diff --git a/make/scripts/adb-launch-activity.sh b/make/scripts/adb-launch-activity.sh
index 401bd51..89acc3c 100644
--- a/make/scripts/adb-launch-activity.sh
+++ b/make/scripts/adb-launch-activity.sh
@@ -3,7 +3,10 @@
 #ANAME="com.jogamp.opengl.test/com.jogamp.opengl.test.android.NEWTGenericActivity"
 #ANAME="com.jogamp.android.launcher/com.jogamp.android.launcher.NEWTLauncherActivity2"
 #ANAME="com.jogamp.opengl.test/com.jogamp.opengl.test.android.NEWTGearsES2ActivityLauncher"
-ANAME="com.jogamp.opengl.test/com.jogamp.opengl.test.android.MovieCubeActivityLauncher0"
+ANAME="com.jogamp.opengl.test/com.jogamp.opengl.test.android.MovieCubeActivityLauncher0a"
+#ANAME="com.jogamp.opengl.test/com.jogamp.opengl.test.android.MovieCubeActivityLauncher0b"
+#ANAME="com.jogamp.opengl.test/com.jogamp.opengl.test.android.NEWTGraphUI1pActivityLauncher"
+#ANAME="com.jogamp.opengl.test/com.jogamp.opengl.test.android.NEWTGraphUI2pActivityLauncher"
 
 adb $* shell "setprop log.redirect-stdio true ; setprop log.redirect-stderr true ; \
               am start -a android.intent.action.MAIN -n $ANAME"
diff --git a/make/scripts/lstjars.sh b/make/scripts/lstjars.sh
index 2cb4e1b..d515013 100755
--- a/make/scripts/lstjars.sh
+++ b/make/scripts/lstjars.sh
@@ -45,7 +45,7 @@ function listdeployment() {
     echo
 
     echo JOGL Min X11 Min egl es1 es2
-    report gluegen-rt.$JAR_SUFFIX atomic/jogl-core.$JAR_SUFFIX atomic/jogl-glmobile.$JAR_SUFFIX atomic/jogl-util.$JAR_SUFFIX atomic/nativewindow-core.$JAR_SUFFIX atomic/newt-core.$JAR_SUFFIX atomic/nativewindow-os-x11.$JAR_SUFFIX atomic/newt-driver-x11.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_mobile.so.gz libnativewindow_x11.so.gz libnewt.so.gz
+    report gluegen-rt.$JAR_SUFFIX atomic/jogl.$JAR_SUFFIX atomic/jogl-glmobile.$JAR_SUFFIX atomic/jogl-util.$JAR_SUFFIX atomic/nativewindow.$JAR_SUFFIX atomic/newt.$JAR_SUFFIX atomic/nativewindow-os-x11.$JAR_SUFFIX atomic/newt-driver-x11.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_mobile.so.gz libnativewindow_x11.so.gz libnewt.so.gz
     echo
 
     echo JOGL Android - mobile egl es1 es2
@@ -53,7 +53,7 @@ function listdeployment() {
     echo
 
     echo JOGL Min Android/Mobile Min egl es1 es2
-    report gluegen-rt-android.$JAR_SUFFIX atomic/jogl-core.$JAR_SUFFIX atomic/jogl-glmobile.$JAR_SUFFIX atomic/jogl-os-android.$JAR_SUFFIX atomic/jogl-util.$JAR_SUFFIX atomic/nativewindow-core.$JAR_SUFFIX atomic/newt-core.$JAR_SUFFIX atomic/newt-driver-android.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_mobile.so.gz
+    report gluegen-rt-android.$JAR_SUFFIX atomic/jogl.$JAR_SUFFIX atomic/jogl-glmobile.$JAR_SUFFIX atomic/jogl-os-android.$JAR_SUFFIX atomic/jogl-util.$JAR_SUFFIX atomic/nativewindow.$JAR_SUFFIX atomic/newt.$JAR_SUFFIX atomic/newt-driver-android.$JAR_SUFFIX libgluegen-rt.so.gz libjogl_mobile.so.gz
     echo
 }
 
diff --git a/make/scripts/make.jogl.all.generic.sh b/make/scripts/make.jogl.all.generic.sh
new file mode 100755
index 0000000..9a2cbf4
--- /dev/null
+++ b/make/scripts/make.jogl.all.generic.sh
@@ -0,0 +1,29 @@
+#! /bin/sh
+
+#    -Dc.compiler.debug=true \
+
+#    -Dgluegen.cpptasks.detected.os=true \
+#    -DisUnix=true \
+#    -DisLinux=true \
+#    -DisLinuxAMD64=true \
+#    -DisX11=true \
+#
+#    -Dtarget.sourcelevel=1.6 \
+#    -Dtarget.targetlevel=1.6 \
+#    -Dtarget.rt.jar=/opt-share/jre1.6.0_30/lib/rt.jar \
+#
+#    -Dsetup.addNativeOpenMAX=true \
+#    -Dsetup.addNativeKD=true \
+
+
+export SOURCE_LEVEL=1.6
+export TARGET_LEVEL=1.6
+export TARGET_RT_JAR=/opt-share/jre1.6.0_30/lib/rt.jar
+
+#export JOGAMP_JAR_CODEBASE="Codebase: *.jogamp.org"
+export JOGAMP_JAR_CODEBASE="Codebase: *.goethel.localnet"
+
+# BUILD_ARCHIVE=true \
+ant  \
+    $* 2>&1 | tee make.jogl.all.generic.log
+
diff --git a/make/scripts/make.jogl.all.linux-x86_64.sh b/make/scripts/make.jogl.all.linux-x86_64.sh
index 2488a7d..9e8d529 100755
--- a/make/scripts/make.jogl.all.linux-x86_64.sh
+++ b/make/scripts/make.jogl.all.linux-x86_64.sh
@@ -18,6 +18,7 @@ if [ "$1" = "-libdir" ] ; then
 fi
 
 #    -Dc.compiler.debug=true \
+#    -Djavacdebuglevel="source,lines,vars" \
 
 #    -Dgluegen.cpptasks.detected.os=true \
 #    -DisUnix=true \
diff --git a/make/scripts/make.jogl.all.macosx-clang.sh b/make/scripts/make.jogl.all.macosx-clang.sh
deleted file mode 100755
index 6b25396..0000000
--- a/make/scripts/make.jogl.all.macosx-clang.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#! /bin/sh
-
-if [ -e /opt-share/etc/profile.ant ] ; then
-    . /opt-share/etc/profile.ant
-fi
-
-JAVA_HOME=`/usr/libexec/java_home -version 1.7`
-#JAVA_HOME=`/usr/libexec/java_home -version 1.6`
-PATH=$JAVA_HOME/bin:$PATH
-export JAVA_HOME PATH
-
-#    -Dc.compiler.debug=true \
-#    -Djavacdebug="true" \
-#    -Djavacdebuglevel="source,lines,vars" \
-#
-
-export SOURCE_LEVEL=1.6
-export TARGET_LEVEL=1.6
-export TARGET_RT_JAR=/opt-share/jre1.6.0_30/lib/rt.jar
-
-export GLUEGEN_PROPERTIES_FILE="../../gluegen/make/lib/gluegen-xcode_clang.properties"
-# or -Dgcc.compat.compiler=xcode.clang
-
-#export JOGAMP_JAR_CODEBASE="Codebase: *.jogamp.org"
-export JOGAMP_JAR_CODEBASE="Codebase: *.goethel.localnet"
-
-ant \
-    -Dc.compiler.debug=true \
-    -Drootrel.build=build-macosx \
-    $* 2>&1 | tee make.jogl.all.macosx.log
diff --git a/make/scripts/make.jogl.all.win64.bat b/make/scripts/make.jogl.all.win64.bat
index 5e36c26..6efa62b 100755
--- a/make/scripts/make.jogl.all.win64.bat
+++ b/make/scripts/make.jogl.all.win64.bat
@@ -19,4 +19,4 @@ set TARGET_RT_JAR=c:\jre1.6.0_30\lib\rt.jar
 REM set JOGAMP_JAR_CODEBASE=Codebase: *.jogamp.org
 set JOGAMP_JAR_CODEBASE=Codebase: *.goethel.localnet
 
-ant -Dc.compiler.debug=true -Drootrel.build=build-win64 %1 %2 %3 %4 %5 %6 %7 %8 %9 > make.jogl.all.win64.log 2>&1
+ant -Drootrel.build=build-win64 %1 %2 %3 %4 %5 %6 %7 %8 %9 > make.jogl.all.win64.log 2>&1
diff --git a/make/scripts/setenv-jogl.sh b/make/scripts/setenv-jogl.sh
index dc121a5..bbaf518 100755
--- a/make/scripts/setenv-jogl.sh
+++ b/make/scripts/setenv-jogl.sh
@@ -53,8 +53,11 @@ if [ ! -e "$GLUEGEN_BUILDDIR" ] ; then
     exit
 fi
 GLUEGEN_JAR="$GLUEGEN_BUILDDIR"/gluegen-rt.jar
+GLUEGEN_ALT_JAR="$GLUEGEN_BUILDDIR"/gluegen-rt-alt.jar
+GLUEGEN_TESTUTIL_JAR="$GLUEGEN_BUILDDIR"/gluegen-test-util.jar
 GLUEGEN_OS="$GLUEGEN_BUILDDIR"/obj
 JUNIT_JAR="$GLUEGEN_DIR"/make/lib/junit.jar
+SEMVER_JAR="$GLUEGEN_DIR"/make/lib/semantic-versioning/semver.jar
 
 joalpf=`find ../../joal -name joal.iml`
 if [ -z "$joalpf" ] ; then
@@ -104,12 +107,15 @@ CP_SEP=:
 
 LIB=$THISDIR/lib
 
-JOGAMP_ALL_AWT_CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_ALL_AWT_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS"
-JOGAMP_ALL_NOAWT_CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_ALL_NOAWT_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS"
-JOGAMP_MOBILE_CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_MOBILE_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS"
-export JOGAMP_ALL_AWT_CLASSPATH JOGAMP_ALL_NOAWT_CLASSPATH JOGAMP_MOBILE_CLASSPATH
+JOGAMP_ALL_AWT_CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_ALL_AWT_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS":"$SEMVER_JAR":"$GLUEGEN_TESTUTIL_JAR"
+JOGAMP_ALL_NOAWT_CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_ALL_NOAWT_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS":"$SEMVER_JAR":"$GLUEGEN_TESTUTIL_JAR"
+JOGAMP_MOBILE_CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_MOBILE_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS":"$SEMVER_JAR":"$GLUEGEN_TESTUTIL_JAR"
+JOGAMP_ATOMICS_NOAWT_CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_ATOMICS_NOAWT_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS":"$SEMVER_JAR":"$GLUEGEN_TESTUTIL_JAR"
+JOGAMP_ALL_NOAWT_ALT_CLASSPATH=.:"$GLUEGEN_ALT_JAR":"$JOAL_JAR":"$JOGL_ALL_NOAWT_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS":"$SEMVER_JAR":"$GLUEGEN_TESTUTIL_JAR"
+JOGAMP_MOBILE_ALT_CLASSPATH=.:"$GLUEGEN_ALT_JAR":"$JOAL_JAR":"$JOGL_MOBILE_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS":"$SEMVER_JAR":"$GLUEGEN_TESTUTIL_JAR"
+export JOGAMP_ALL_AWT_CLASSPATH JOGAMP_ALL_NOAWT_CLASSPATH JOGAMP_MOBILE_CLASSPATH JOGAMP_ATOMICS_NOAWT_CLASSPATH JOGAMP_ALL_NOAWT_ALT_CLASSPATH JOGAMP_MOBILE_ALT_CLASSPATH
 
-CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS"
+CLASSPATH=.:"$GLUEGEN_JAR":"$JOAL_JAR":"$JOGL_CLASSPATH":"$SWT_CLASSPATH":"$JUNIT_JAR":"$ANT_JARS":"$SEMVER_JAR":"$GLUEGEN_TESTUTIL_JAR"
 export CLASSPATH
 
 # We use TempJarCache per default now!
diff --git a/make/scripts/tests-osx-x64.sh b/make/scripts/tests-osx-x64.sh
index 5d9cd6f..3828806 100755
--- a/make/scripts/tests-osx-x64.sh
+++ b/make/scripts/tests-osx-x64.sh
@@ -1,6 +1,7 @@
 #! /bin/bash
 
-export DYLD_LIBRARY_PATH=/usr/local/libav:$DYLD_LIBRARY_PATH
+#export DYLD_LIBRARY_PATH=$HOME/ffmpeg-0.8_0.9/lib:$DYLD_LIBRARY_PATH
+export DYLD_LIBRARY_PATH=$HOME/ffmpeg-2.2.3/lib:$DYLD_LIBRARY_PATH
 
 JAVA_HOME=`/usr/libexec/java_home -version 1.7`
 #JAVA_HOME=`/usr/libexec/java_home -version 1.7.0_25`
diff --git a/make/scripts/tests-win.bat b/make/scripts/tests-win.bat
index df5ec49..fb6e847 100755
--- a/make/scripts/tests-win.bat
+++ b/make/scripts/tests-win.bat
@@ -2,6 +2,7 @@ REM scripts\java-win.bat jogamp.newt.awt.opengl.VersionApplet
 REM scripts\java-win.bat com.jogamp.newt.opengl.GLWindow
 REM scripts\java-win.bat javax.media.opengl.awt.GLCanvas
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestMainVersionGLWindowNEWT %*
+REM scripts\java-win.bat com.jogamp.oculusvr.OVRVersion %*
 
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNewtAWTWrapper %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.newt.TestGearsNEWT -time 30000
@@ -10,6 +11,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGe
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT -vsync -time 4000 -x 10 -y 10 -width 100 -height 100 -screen 0
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT -vsync -time 40000 -width 100 -height 100 -screen 0 %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.gl2.awt.TestGearsAWT -time 5000
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelsAWT %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.demos.es2.awt.DemoGLJPanelPerf02AWT %*
@@ -64,6 +66,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestFBOAutoDraw
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestFBOMix2DemosES2NEWT %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestFBOMRTNEWT01 %*
 
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableDelegateNEWT %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableDelegateOnOffscrnCapsNEWT %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT %*
@@ -74,8 +77,9 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestFBOAutoDraw
 
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile01NEWT %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile02NEWT %*
-REM scripts\java-win.bat  com.jogamp.opengl.test.junit.jogl.acore.TestGLContextDrawableSwitch01NEWT %*
-REM scripts\java-win.bat  com.jogamp.opengl.test.junit.jogl.acore.TestGLContextDrawableSwitch11NEWT %*
+scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.glels.TestGLContextDrawableSwitch02AWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLContextDrawableSwitch01NEWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLContextDrawableSwitch11NEWT %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLDebug00NEWT %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLDebug01NEWT %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestGPUMemSec01NEWT %*
@@ -97,7 +101,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.anim.TestAnimat
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.anim.TestAWTCardLayoutAnimatorStartStopBug532 %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.anim.Bug898AnimatorFromEDTAWT %*
 
-scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLReadBuffer01GLJPanelAWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLReadBuffer01GLJPanelAWT %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.acore.TestGLReadBuffer01GLWindowNEWT %*
 
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.awt.TestSwingAWT01GLn
@@ -111,6 +115,7 @@ REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.awt.TestJScrollPaneMi
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.awt.TestBug642JSplitPaneMixHwLw01AWT %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.awt.TestIsRealizedConcurrency01AWT %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.awt.TestGLJPanelResize01AWT %*
+REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.awt.TestGLJPanelTextureStateAWT %*
 
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.newt.TestSwingAWTRobotUsageBeforeJOGLInitBug411
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.glsl.TestTransformFeedbackVaryingsBug407NEWT
@@ -179,7 +184,7 @@ REM scripts\java-win.bat testawt com.jogamp.opengl.test.junit.jogl.caps.TestMult
 REM scripts\java-win.bat testnoawt com.jogamp.opengl.test.junit.jogl.caps.TestMultisampleES1NEWT %*
 REM scripts\java-win.bat testnoawt com.jogamp.opengl.test.junit.jogl.caps.TestMultisampleES2NEWT %*
 REM scripts\java-win.bat testawt com.jogamp.opengl.test.junit.jogl.caps.TestTranslucencyAWT %*
-REM scripts\java-win.bat  com.jogamp.opengl.test.junit.jogl.caps.TestTranslucencyNEWT %*
+scripts\java-win.bat  com.jogamp.opengl.test.junit.jogl.caps.TestTranslucencyNEWT %*
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.newt.parenting.TestTranslucentChildWindowBug632NEWT %*
 
 REM scripts\java-win.bat com.jogamp.opengl.test.junit.jogl.awt.TestBug461OffscreenSupersamplingSwingAWT
diff --git a/make/scripts/tests-x32-dbg.bat b/make/scripts/tests-x32-dbg.bat
index 93069c0..a37dd7b 100755
--- a/make/scripts/tests-x32-dbg.bat
+++ b/make/scripts/tests-x32-dbg.bat
@@ -20,14 +20,16 @@ set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;%FFMPEG_LIB%;%PATH%
 REM set LIB_DIR=%BLD_DIR%\lib;..\..\gluegen\%BLD_SUB%\obj
 set LIB_DIR=
 
-set CP_ALL=.;%BLD_DIR%\jar\jogl-all.jar;%BLD_DIR%\jar\jogl-test.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86\swt-debug.jar
+set CP_ALL=.;%BLD_DIR%\jar\jogl-all.jar;%BLD_DIR%\jar\atomic\oculusvr.jar;%BLD_DIR%\jar\jogl-test.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86\swt-debug.jar
 
 echo CP_ALL %CP_ALL%
 
 REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.GLContext" "-Djogl.debug.FBObject" "-Djogl.enable.ANGLE"
 REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.EGLDrawableFactory.DontQuery"
 REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.EGLDrawableFactory.QueryNativeTK"
-REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all"
+REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogl.debug.windows.cpu_affinity_mode=0" "-Djogl.debug.GLContext.TraceSwitch" "-Djogl.debug.GLContext"
+REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogl.debug.GLContext.TraceSwitch" "-Djogl.debug.GLContext"
+REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.windows.cpu_affinity_mode=0"
 REM set D_ARGS="-Djogamp.debug.IOUtil" "-Djogl.debug.GLSLCode" "-Djogl.debug.GLMediaPlayer"
 REM set D_ARGS="-Djogl.debug.ExtensionAvailabilityCache" "-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogamp.debug.ProcAddressHelper=true" "-Djogamp.debug.NativeLibrary=true" "-Djogamp.debug.NativeLibrary.Lookup=true"
 REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogamp.debug.NativeLibrary=true"
@@ -41,7 +43,7 @@ REM set D_ARGS="-Djogl.debug.DebugGL" "-Djogl.debug.TraceGL" "-Djogl.debug=all"
 REM set D_ARGS="-Dnewt.debug.Window" "-Dnewt.debug.Display" "-Dnewt.test.Window.reparent.incompatible=true"
 REM set D_ARGS="-Dnewt.debug.Window.MouseEvent"
 REM set D_ARGS="-Dnewt.debug.Window.KeyEvent"
-set D_ARGS="-Djogl.debug.GLMediaPlayer" "-Djogl.debug.GLMediaPlayer.Native"
+REM set D_ARGS="-Djogl.debug.GLMediaPlayer" "-Djogl.debug.GLMediaPlayer.Native"
 REM set D_ARGS="-Xcheck:jni" "-Xint" "-verbose:jni"
 
 set X_ARGS="-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true"
diff --git a/make/scripts/tests-x32.bat b/make/scripts/tests-x32.bat
index c8ead0a..4111385 100755
--- a/make/scripts/tests-x32.bat
+++ b/make/scripts/tests-x32.bat
@@ -21,7 +21,7 @@ set BLD_DIR=..\%BLD_SUB%
 REM set LIB_DIR=..\..\gluegen\%BLD_SUB%\obj;%BLD_DIR%\lib
 set LIB_DIR=
 
-set CP_ALL=.;%BLD_DIR%\jar\jogl-all.jar;%BLD_DIR%\jar\jogl-test.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86\swt-debug.jar
+set CP_ALL=.;%BLD_DIR%\jar\jogl-all.jar;%BLD_DIR%\jar\atomic\oculusvr.jar;%BLD_DIR%\jar\jogl-test.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86\swt-debug.jar
 
 echo CP_ALL %CP_ALL%
 
diff --git a/make/scripts/tests-x64-custom.sh b/make/scripts/tests-x64-custom.sh
index 482afbb..87f330d 100755
--- a/make/scripts/tests-x64-custom.sh
+++ b/make/scripts/tests-x64-custom.sh
@@ -2,7 +2,7 @@
 
 SDIR=`dirname $0` 
 
-#export LD_LIBRARY_PATH=/home/sven/libav/lib:$LD_LIBRARY_PATH
+#export LD_LIBRARY_PATH=$HOME/libav/lib:$LD_LIBRARY_PATH
 
 #if [ -e $SDIR/../../../gluegen/make/scripts/setenv-build-jogl-x86_64.sh ] ; then
 #    . $SDIR/../../../gluegen/make/scripts/setenv-build-jogl-x86_64.sh
diff --git a/make/scripts/tests-x64-dbg.bat b/make/scripts/tests-x64-dbg.bat
index b3ebc03..f18072b 100755
--- a/make/scripts/tests-x64-dbg.bat
+++ b/make/scripts/tests-x64-dbg.bat
@@ -16,7 +16,7 @@ REM set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;c:\mingw\bin;%PATH%
 REM set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;%PROJECT_ROOT%\make\lib\external\PVRVFrame\OGLES-2.0\Windows_x86_64;%PATH%
 set PATH=%JAVA_HOME%\bin;%ANT_PATH%\bin;%FFMPEG_LIB%;%PATH%
 
-set CP_ALL=.;%BLD_DIR%\jar\jogl-all.jar;%BLD_DIR%\jar\jogl-test.jar;..\..\joal\%BLD_SUB%\joal.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86_64\swt-debug.jar
+set CP_ALL=.;%BLD_DIR%\jar\jogl-all.jar;%BLD_DIR%\jar\atomic\oculusvr.jar;%BLD_DIR%\jar\jogl-test.jar;..\..\joal\%BLD_SUB%\joal.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86_64\swt-debug.jar
 
 echo CP_ALL %CP_ALL%
 
@@ -24,6 +24,11 @@ REM set D_ARGS="-Djogamp.debug=all"
 REM set D_ARGS="-Djogl.debug=all" "-Dnativewindow.debug=all"
 REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all"
 REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogamp.debug=all" "-Djogl.debug.EGLDrawableFactory.DontQuery"
+REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogl.debug.windows.cpu_affinity_mode=0" "-Djogl.debug.GLContext.TraceSwitch" "-Djogl.debug.GLContext"
+REM set D_ARGS="-Djogl.debug=all" "-Dnewt.debug=all" "-Dnativewindow.debug=all" "-Djogl.debug.GLContext.TraceSwitch" "-Djogl.debug.GLContext"
+REM set D_ARGS="-Djogl.disable.opengles"
+REM set D_ARGS="-Djogl.disable.openglcore"
+REM set D_ARGS="-Djogl.disable.openglarbcontext"
 REM set D_ARGS="-Dnativewindow.debug.GDIUtil" "-Dnativewindow.debug.RegisteredClass"
 REM set D_ARGS="-Djogl.debug.GLContext" "-Djogl.debug.FBObject"
 REM set D_ARGS="-Djogl.debug.GLDrawable" "-Djogl.debug.EGLDrawableFactory.DontQuery"
diff --git a/make/scripts/tests-x64.bat b/make/scripts/tests-x64.bat
index ac74f4c..f13ea2e 100755
--- a/make/scripts/tests-x64.bat
+++ b/make/scripts/tests-x64.bat
@@ -16,7 +16,7 @@ set BLD_DIR=..\%BLD_SUB%
 REM set LIB_DIR=%BLD_DIR%\lib;..\..\gluegen\%BLD_SUB%\obj
 set LIB_DIR=
 
-set CP_ALL=.;%BLD_DIR%\jar\jogl-all.jar;%BLD_DIR%\jar\jogl-test.jar;..\..\joal\%BLD_SUB%\joal.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86_64\swt-debug.jar
+set CP_ALL=.;%BLD_DIR%\jar\jogl-all.jar;%BLD_DIR%\jar\atomic\oculusvr.jar;%BLD_DIR%\jar\jogl-test.jar;..\..\joal\%BLD_SUB%\joal.jar;..\..\gluegen\%BLD_SUB%\gluegen-rt.jar;..\..\gluegen\make\lib\junit.jar;%ANT_PATH%\lib\ant.jar;%ANT_PATH%\lib\ant-junit.jar;%BLD_DIR%\..\make\lib\swt\win32-win32-x86_64\swt-debug.jar
 echo CP_ALL %CP_ALL%
 
 set X_ARGS="-Dsun.java2d.noddraw=true" "-Dsun.awt.noerasebackground=true"
diff --git a/make/scripts/tests-x64.sh b/make/scripts/tests-x64.sh
index fe2fc49..421b912 100755
--- a/make/scripts/tests-x64.sh
+++ b/make/scripts/tests-x64.sh
@@ -2,14 +2,15 @@
 
 SDIR=`dirname $0` 
 
-#export LD_LIBRARY_PATH=/home/sven/libav-0.8/lib:$LD_LIBRARY_PATH
-#export LD_LIBRARY_PATH=/home/sven/ffmpeg-0.10/lib:$LD_LIBRARY_PATH
+#export LD_LIBRARY_PATH=$HOME/libav-0.8/lib:$LD_LIBRARY_PATH
+#export LD_LIBRARY_PATH=$HOME/ffmpeg-0.10/lib:$LD_LIBRARY_PATH
 
-#export LD_LIBRARY_PATH=/home/sven/libav-9.x/lib:$LD_LIBRARY_PATH
-export LD_LIBRARY_PATH=/home/sven/ffmpeg-1.2/lib:$LD_LIBRARY_PATH
+#export LD_LIBRARY_PATH=$HOME/libav-9.x/lib:$LD_LIBRARY_PATH
+#export LD_LIBRARY_PATH=$HOME/ffmpeg-1.2/lib:$LD_LIBRARY_PATH
 
-#export LD_LIBRARY_PATH=/home/sven/libav-10.x/lib:$LD_LIBRARY_PATH
-#export LD_LIBRARY_PATH=/home/sven/ffmpeg-2.x/lib:$LD_LIBRARY_PATH
+#export LD_LIBRARY_PATH=$HOME/libav-10.1/lib:$LD_LIBRARY_PATH
+#export LD_LIBRARY_PATH=$HOME/ffmpeg-2.2.2/lib:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH=$HOME/ffmpeg-2.2.3/lib:$LD_LIBRARY_PATH
 
 if [ -e $SDIR/../../../gluegen/make/scripts/setenv-build-jogl-x86_64.sh ] ; then
     . $SDIR/../../../gluegen/make/scripts/setenv-build-jogl-x86_64.sh
diff --git a/make/scripts/tests.sh b/make/scripts/tests.sh
index 18f488b..1e229ec 100644
--- a/make/scripts/tests.sh
+++ b/make/scripts/tests.sh
@@ -42,20 +42,20 @@ if [ $MOSX -eq 1 ] ; then
     MOSX_MT=1
 fi
 
-#export LD_LIBRARY_PATH=$spath/../lib/external/PVRVFrame/OGLES-2.0/Linux_x86_64:$LD_LIBRARY_PATH
-#export LD_LIBRARY_PATH=$spath/../lib/external/PVRVFrame/OGLES-2.0/Linux_x86_32:$LD_LIBRARY_PATH
+#export LD_LIBRARY_PATH=$spath/../../EXTERNAL/PVRVFrame/OGLES-2.0/Linux_x86_64:$LD_LIBRARY_PATH
+#export LD_LIBRARY_PATH=$spath/../../EXTERNAL/PVRVFrame/OGLES-2.0/Linux_x86_32:$LD_LIBRARY_PATH
 #export LD_LIBRARY_PATH=/usr/local/projects/Xorg.modular/build-x86_64/lib:$LD_LIBRARY_PATH
 #export LD_LIBRARY_PATH=/opt-linux-x86_64/x11lib-1.3:$LD_LIBRARY_PATH
 #export LD_LIBRARY_PATH=/opt-linux-x86_64/mesa-7.8.1/lib64:$LD_LIBRARY_PATH
 #export LD_LIBRARY_PATH=/usr/lib/mesa:/usr/lib32/mesa:$LD_LIBRARY_PATH
 #export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/mesa:/usr/lib/i386-linux-gnu/mesa:$LD_LIBRARY_PATH
 #export LIBGL_DRIVERS_PATH=/usr/lib/x86_64-linux-gnu/dri:/usr/lib/i386-linux-gnu/dri
-#export LD_LIBRARY_PATH=`pwd`/lib/external/mesa_git/x86_64-linux-gnu:$LD_LIBRARY_PATH
-#export LIBGL_DRIVERS_PATH=`pwd`/lib/external/mesa_git/x86_64-linux-gnu/dri
-#export LD_LIBRARY_PATH=`pwd`/lib/external/mesa_901/x86_64-linux-gnu:$LD_LIBRARY_PATH
-#export LIBGL_DRIVERS_PATH=`pwd`/lib/external/mesa_901/x86_64-linux-gnu/dri
-#export LD_LIBRARY_PATH=`pwd`/lib/external/mesa_900/x86_64-linux-gnu:$LD_LIBRARY_PATH
-#export LIBGL_DRIVERS_PATH=`pwd`/lib/external/mesa_900/x86_64-linux-gnu/dri
+#export LD_LIBRARY_PATH=`pwd`/../../EXTERNAL/mesa_git/x86_64-linux-gnu:$LD_LIBRARY_PATH
+#export LIBGL_DRIVERS_PATH=`pwd`/../../EXTERNAL/mesa_git/x86_64-linux-gnu/dri
+#export LD_LIBRARY_PATH=`pwd`/../../EXTERNAL/mesa_901/x86_64-linux-gnu:$LD_LIBRARY_PATH
+#export LIBGL_DRIVERS_PATH=`pwd`/../../EXTERNAL/mesa_901/x86_64-linux-gnu/dri
+#export LD_LIBRARY_PATH=`pwd`/../../EXTERNAL/mesa_900/x86_64-linux-gnu:$LD_LIBRARY_PATH
+#export LIBGL_DRIVERS_PATH=`pwd`/../../EXTERNAL/mesa_900/x86_64-linux-gnu/dri
 
 #export LIBGL_DEBUG=verbose 
 #export MESA_DEBUG=true 
@@ -80,7 +80,6 @@ echo LIBGL_DEBUG: $LIBGL_DEBUG 2>&1 | tee -a java-run.log
 echo LIBGL_ALWAYS_INDIRECT: $LIBGL_ALWAYS_INDIRECT 2>&1 | tee -a java-run.log
 echo LIBGL_ALWAYS_SOFTWARE: $LIBGL_ALWAYS_SOFTWARE 2>&1 | tee -a java-run.log
 echo SWT_CLASSPATH: $SWT_CLASSPATH 2>&1 | tee -a java-run.log
-echo "$javaexe" $javaxargs $X_ARGS $D_ARGS $* 2>&1 | tee -a java-run.log
 echo MacOsX $MOSX
 
 function jrun() {
@@ -92,6 +91,7 @@ function jrun() {
     #D_ARGS="-Djogl.debug.DebugGL"
     #D_ARGS="-Djogl.debug.TraceGL"
     #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL"
+    #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all"
 
     #D_ARGS="-Djogamp.debug=all"
     #D_ARGS="-Dnativewindow.debug=all"
@@ -100,6 +100,12 @@ function jrun() {
     #D_ARGS="-Djogl.debug=all -Dnewt.debug=all"
     #D_ARGS="-Djogl.debug=all -Dnativewindow.debug=all"
     #D_ARGS="-Djogamp.debug=all -Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all"
+
+    #D_ARGS="-Djogamp.debug.NativeLibrary=true -Djogamp.debug.JNILibLoader=true"
+    #D_ARGS="-Djogamp.debug.ProcAddressHelper -Djogamp.debug.NativeLibrary -Djogamp.debug.NativeLibrary.Lookup -Djogamp.debug.JNILibLoader -Djogamp.debug.TempJarCache -Djogamp.debug.JarUtil"
+    #D_ARGS="-Djogl.debug.GLContext -Djogamp.debug.NativeLibrary -Djogamp.debug.JNILibLoader -Djogl.debug.DebugGL -Djogl.debug.GLDebugMessageHandler"
+    #D_ARGS="-Djogamp.debug.ProcAddressHelper -Djogamp.debug.NativeLibrary -Djogamp.debug.NativeLibrary.Lookup -Djogamp.debug.JNILibLoader -Djogamp.debug.TempJarCache -Djogamp.debug.JarUtil"
+
     #D_ARGS="-Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all"
     #D_ARGS="-Dnativewindow.debug=all -Dnewt.debug.Window"
     #D_ARGS="-Djogl.debug=all -Dnativewindow.debug=all -Dnewt.debug=all -Djogamp.debug.Lock"
@@ -110,6 +116,8 @@ function jrun() {
     #D_ARGS="-Dnativewindow.debug.X11Util.ATI_HAS_NO_XCLOSEDISPLAY_BUG"
     #D_ARGS="-Dnativewindow.debug.X11Util.ATI_HAS_NO_MULTITHREADING_BUG"
     #D_ARGS="-Djogl.disable.opengles"
+    #D_ARGS="-Djogl.disable.openglcore"
+    #D_ARGS="-Djogl.disable.openglarbcontext"
     #D_ARGS="-Djogl.debug.DebugGL -Dnewt.debug.Window"
     #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.FBObject"
     #D_ARGS="-Djogl.debug.FBObject -Djogl.debug.TraceGL -Djogl.debug.GLBufferStateTracker"
@@ -119,6 +127,7 @@ function jrun() {
     #D_ARGS="-Djogl.debug.GLBufferObjectTracker"
     #D_ARGS="-Djogl.debug.GLBufferObjectTracker -Djogl.debug.GLArrayData -Djogl.debug.TraceGL -Djogl.debug.DebugGL"
     #D_ARGS="-Djogl.debug.GLSLCode"
+    #D_ARGS="-Djogl.debug.GLSLCode -Djogl.debug.TraceGL"
     #D_ARGS="-Djogl.debug.GLSLCode -Djogl.debug.DebugGL"
     #D_ARGS="-Djogl.debug.GLContext -Dnativewindow.debug.JAWT -Dnewt.debug.Window"
     #D_ARGS="-Dnativewindow.debug.JAWT -Djogl.debug.GLCanvas"
@@ -126,6 +135,7 @@ function jrun() {
     #D_ARGS="-Dnativewindow.debug.JAWT"
     #D_ARGS="-Djogl.debug.GLContext.TraceSwitch"
     #D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLContext.TraceSwitch"
+    #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL -Djogl.debug.FixedFuncPipeline -Djogl.debug.GLSLState -Djogl.debug.GLSLCode"
     #D_ARGS="-Djogl.debug.FixedFuncPipeline -Djogl.debug.GLSLCode"
     #D_ARGS="-Djogl.debug.FixedFuncPipeline -Djogl.debug.GLSLState"
     #D_ARGS="-Djogl.debug.FixedFuncPipeline"
@@ -139,6 +149,7 @@ function jrun() {
     #D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLDrawable"
     #D_ARGS="-Djogl.debug.GLContext.NoProfileAliasing"
     #D_ARGS="-Djogl.debug.GLDrawable -Dnativewindow.debug.X11Util -Dnativewindow.debug.NativeWindow -Dnewt.debug.Display -Dnewt.debug.Screen -Dnewt.debug.Window"
+    #D_ARGS="-Djogl.debug.Animator"
     #D_ARGS="-Djogl.debug.Animator -Djogl.debug.GLDrawable -Dnativewindow.debug.NativeWindow"
     #D_ARGS="-Djogl.debug=all -Dnewt.debug=all"
     #D_ARGS="-Djogl.debug.GLDrawable -Djogl.debug.GLContext -Djogl.debug.GLCanvas"
@@ -149,27 +160,23 @@ function jrun() {
     #D_ARGS="-Djogl.debug.GLDebugMessageHandler -Djogl.debug.DebugGL"
     #D_ARGS="-Djogl.debug.GLDebugMessageHandler -Djogl.debug.TraceGL -Djogl.debug.DebugGL -Djogl.debug.GLSLCode -Djogl.debug.GLSLState"
     #D_ARGS="-Djogl.debug.GLDebugMessageHandler -Djogl.debug.DebugGL -Djogl.debug.TraceGL"
-    #D_ARGS="-Djogamp.debug.NativeLibrary"
     #D_ARGS="-Djogl.1thread=false -Djogl.debug.Threading"
     #D_ARGS="-Djogl.1thread=true -Djogl.debug.Threading"
     #D_ARGS="-Djogl.debug.DebugGL -Djogl.debug.TraceGL -Djogl.debug.GLContext.TraceSwitch -Djogl.debug=all"
-    #D_ARGS="-Djogl.debug.AudioSink"
     #D_ARGS="-Djogl.debug.GLArrayData"
     #D_ARGS="-Dnewt.debug.Screen -Dnewt.debug.Window"
+    #D_ARGS="-Dnewt.debug.Window"
     #D_ARGS="-Dnewt.debug.Screen"
     #D_ARGS="-Dnewt.test.Screen.disableRandR13"
     #D_ARGS="-Dnewt.test.Screen.disableScreenMode -Dnewt.debug.Screen"
     #D_ARGS="-Dnewt.debug.Screen -Djogl.debug.Animator"
-    #D_ARGS="-Djogamp.debug.ProcAddressHelper -Djogamp.debug.NativeLibrary -Djogamp.debug.NativeLibrary.Lookup -Djogamp.debug.JNILibLoader -Djogamp.debug.TempJarCache -Djogamp.debug.JarUtil"
     #D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLProfile"
     #D_ARGS="-Djogl.debug.GLProfile"
-    #D_ARGS="-Djogl.debug.GLContext -Djogamp.debug.NativeLibrary -Djogamp.debug.JNILibLoader -Djogl.debug.DebugGL -Djogl.debug.GLDebugMessageHandler"
     #D_ARGS="-Dnewt.debug.MainThread"
     #D_ARGS="-Dnativewindow.debug.GraphicsConfiguration -Dnativewindow.debug.NativeWindow"
     #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Animator -Djogl.debug.GLDrawable -Djogl.debug.GLContext -Djogl.debug.GLContext.TraceSwitch"
     #D_ARGS="-Djogl.debug.GLContext -Djogl.debug.ExtensionAvailabilityCache"
     #D_ARGS="-Djogl.debug.EGLDrawableFactory.QueryNativeTK -Djogl.debug.GLDrawable"
-    #D_ARGS="-Djogamp.debug.ProcAddressHelper -Djogamp.debug.NativeLibrary -Djogamp.debug.NativeLibrary.Lookup -Djogamp.debug.JNILibLoader -Djogamp.debug.TempJarCache -Djogamp.debug.JarUtil"
     #D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLProfile -Djogl.debug.GLDrawable -Djogl.debug.EGLDisplayUtil -Dnativewindow.debug.GraphicsDevice"
     #D_ARGS="-Djogl.debug.GLContext -Djogl.debug.GLProfile -Djogl.debug.GLDrawable -Djogl.debug.EGLDisplayUtil -Djogl.debug.EGLDrawableFactory.QueryNativeTK"
     #D_ARGS="-Djogl.debug.EGLDisplayUtil -Dnativewindow.debug.GraphicsConfiguration -Djogl.debug.GLDrawable"
@@ -192,6 +199,7 @@ function jrun() {
     #D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=600000 -Djogamp.debug.Lock -Djogamp.debug.Lock.TraceLock -Dnativewindow.debug.ToolkitLock.TraceLock"
     #D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=600000 -Djogamp.debug.Lock -Dnativewindow.debug.X11Util"
     #D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=600000 -Dnativewindow.debug.X11Util"
+    #D_ARGS="-Djogamp.common.utils.locks.Lock.timeout=600000"
     #D_ARGS="-Dnewt.debug.EDT -Djogamp.common.utils.locks.Lock.timeout=600000 -Djogl.debug.Animator -Dnewt.debug.Display -Dnewt.debug.Screen"
     #D_ARGS="-Dnewt.debug.Window -Djogamp.common.utils.locks.Lock.timeout=600000"
     #D_ARGS="-Dnewt.debug=all -Djogamp.common.utils.locks.Lock.timeout=600000"
@@ -205,7 +213,7 @@ function jrun() {
     #D_ARGS="-Dnewt.debug.EDT"
     #D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Display -Dnewt.debug.EDT -Djogl.debug.GLContext"
     #D_ARGS="-Dnewt.debug.Window -Djogl.debug.Animator -Dnewt.debug.Screen"
-    #D_ARGS="-Dnativewindow.debug.JAWT -Dnewt.debug.Window"
+    #D_ARGS="-Dnativewindow.debug.JAWT -Dnewt.debug.Window -Djogl.debug.GLJPanel -Djogl.debug.GLCanvas"
     #D_ARGS="-Dnewt.debug.Window.KeyEvent"
     #D_ARGS="-Dnewt.debug.Window.MouseEvent"
     #D_ARGS="-Dnewt.debug.Window.MouseEvent -Dnewt.debug.Window.KeyEvent"
@@ -216,10 +224,13 @@ function jrun() {
     #D_ARGS="-Dnewt.debug.Window -Dnewt.debug.Window.MouseEvent -Dnewt.debug.Window.KeyEvent"
     #D_ARGS="-Dnewt.debug.Window"
     #D_ARGS="-Xprof"
+    #D_ARGS="-Dnativewindow.debug=all -Djogl.debug=all -Dnewt.debug=all"
     #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel"
-    #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel -Djogl.debug.GLJPanel.Viewport"
     #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel -Djogl.gljpanel.noglsl"
-    #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel -Djogl.gljpanel.noglsl -Djogl.gljpanel.awtverticalflip"
+    #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel -Djogl.debug.FBObject.MaxTextureSize=512"
+    #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel -Djogl.gljpanel.noglsl -Djogl.debug.FBObject.MaxTextureSize=512"
+    #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel -Dnativewindow.awt.nohidpi"
+    #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Java2D -Djogl.debug.GLJPanel -Djogl.debug.GLJPanel.Viewport"
     #D_ARGS="-Djogl.debug.GLJPanel -Djogl.debug.DebugGL"
     #D_ARGS="-Djogl.gljpanel.noverticalflip"
     #D_ARGS="-Djogl.debug.GLCanvas -Djogl.debug.Animator"
@@ -229,6 +240,16 @@ function jrun() {
     #D_ARGS="-Dnativewindow.osx.calayer.bugfree"
     #D_ARGS="-Dnativewindow.debug.ToolkitLock"
     #D_ARGS="-Djogl.debug.graph.curve"
+    #D_ARGS="-Djogl.debug.graph.curve -Djogl.debug.GLSLCode -Djogl.debug.DebugGL -Djogl.debug.TraceGL"
+    #D_ARGS="-Djogl.debug.graph.curve"
+    #D_ARGS="-Djogl.debug.graph.curve -Djogl.debug.GLSLCode"
+    #D_ARGS="-Djogl.debug.DebugGL"
+    #D_ARGS="-Djogl.debug.graph.curve -Djogl.debug.graph.curve.Instance -Djogl.debug.GLSLCode"
+    #D_ARGS="-Djogl.debug.GLSLCode -Djogl.debug.graph.curve.triangulation.LINE_AA -Djogl.debug.graph.curve.Triangulation -Djogl.debug.graph.font.Renderer"
+    #D_ARGS="-Djogl.debug.graph.font.Renderer"
+    #D_ARGS="-Djogl.debug.GLSLCode -Djogl.debug.graph.curve.vbaa.resizeLowerBoundary=100"
+    #D_ARGS="-Djogl.debug.GLSLCode"
+    #D_ARGS="-Djogl.debug.graph.curve.instance"
     #D_ARGS="-Djogl.debug.graph.curve -Djogl.debug.GLSLCode -Djogl.debug.TraceGL"
     #D_ARGS="-Djogl.debug.graph.curve -Djogl.debug.GLSLState"
     #D_ARGS="-Djogamp.debug.TempJarCache -Djogamp.debug.JarUtil -Djogamp.debug.IOUtil"
@@ -250,37 +271,48 @@ function jrun() {
     #X_ARGS="-Dsun.java2d.noddraw=True -Dsun.java2d.opengl=True -Dsun.java2d.xrender=false"
     #X_ARGS="-Dsun.java2d.noddraw=True -Dsun.java2d.opengl=false -Dsun.java2d.xrender=false"
     #X_ARGS="-verbose:jni"
+    #X_ARGS="-Xcheck:jni"
+    #X_ARGS="-Xcheck:jni -verbose:jni"
     #X_ARGS="-Xrs"
     #X_ARGS="-Dsun.awt.disableMixing=true"
     #D_ARGS="-Djogamp.debug.IOUtil -Djogl.debug.GLSLCode -Djogl.debug.GLMediaPlayer"
-    #D_ARGS="-Djogl.debug.AudioSink"
-    #D_ARGS="-Djogl.debug.AudioSink.trace"
+    #D_ARGS="-Djogl.debug.AudioSink -Djoal.openal.lib=system"
+    #D_ARGS="-Djogl.debug.AudioSink -Djogl.debug.AudioSink.trace"
+    #D_ARGS="-Djogl.debug.AudioSink -Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLMediaPlayer.Native"
-    #D_ARGS="-Djogl.debug.GLMediaPlayer"
+    #D_ARGS="-Djogl.debug.GLMediaPlayer -Djogl.debug.GLSLCode"
     #D_ARGS="-Djogl.debug.GLMediaPlayer.StreamWorker.delay=25 -Djogl.debug.GLMediaPlayer"
     #D_ARGS="-Djogl.debug.GLMediaPlayer.Native"
+    #D_ARGS="-Djogl.debug.StereoDevice -Djogl.debug.StereoDevice.DumpData"
+    D_ARGS="-Djogl.debug.StereoDevice"
 
     if [ $awton -eq 1 ] ; then
-        export CLASSPATH=$JOGAMP_ALL_AWT_CLASSPATH
-        echo CLASSPATH $CLASSPATH
+        export USE_CLASSPATH=$JOGAMP_ALL_AWT_CLASSPATH
+        echo USE_CLASSPATH $USE_CLASSPATH
         X_ARGS="-Djava.awt.headless=false $X_ARGS"
+    elif [ $swton -eq 1 ] ; then
+        export USE_CLASSPATH=$JOGAMP_ALL_AWT_CLASSPATH
+        echo USE_CLASSPATH $USE_CLASSPATH
+        X_ARGS="-Djava.awt.headless=true $X_ARGS"
+    elif [ $awton -eq -1 ] ; then
+        export USE_CLASSPATH=$JOGAMP_ATOMICS_NOAWT_CLASSPATH
     else
-        export CLASSPATH=$JOGAMP_ALL_AWT_CLASSPATH
-        #export CLASSPATH=$JOGAMP_ALL_NOAWT_CLASSPATH
-        #export CLASSPATH=$JOGAMP_MOBILE_CLASSPATH
-        #export CLASSPATH=.:$GLUEGEN_JAR:$JOGL_BUILD_DIR/jar/atomic/jogl-core.jar:$JOGL_BUILD_DIR/jar/atomic/jogl-gldesktop.jar:$JOGL_BUILD_DIR/jar/atomic/jogl-os-x11.jar:$JOGL_BUILD_DIR/jar/atomic/jogl-util.jar:$JOGL_BUILD_DIR/jar/atomic/nativewindow-core.jar:$JOGL_BUILD_DIR/jar/atomic/nativewindow-os-x11.jar:$JOGL_BUILD_DIR/jar/atomic/newt-core.jar:$JOGL_BUILD_DIR/jar/atomic/newt-driver-x11.jar:$JOGL_BUILD_DIR/jar/atomic/newt-ogl.jar:$JOGL_BUILD_DIR/jar/jogl-test.jar:$SWT_CLASSPATH:$JU [...]
+        #export USE_CLASSPATH=$JOGAMP_ALL_AWT_CLASSPATH
+        export USE_CLASSPATH=$JOGAMP_ALL_NOAWT_CLASSPATH
+        #export USE_CLASSPATH=$JOGAMP_MOBILE_CLASSPATH
+        #export USE_CLASSPATH=.:$GLUEGEN_JAR:$JOGL_BUILD_DIR/jar/atomic/jogl.jar:$JOGL_BUILD_DIR/jar/atomic/jogl-gldesktop.jar:$JOGL_BUILD_DIR/jar/atomic/jogl-os-x11.jar:$JOGL_BUILD_DIR/jar/atomic/jogl-util.jar:$JOGL_BUILD_DIR/jar/atomic/nativewindow.jar:$JOGL_BUILD_DIR/jar/atomic/nativewindow-os-x11.jar:$JOGL_BUILD_DIR/jar/atomic/newt.jar:$JOGL_BUILD_DIR/jar/atomic/newt-driver-x11.jar:$JOGL_BUILD_DIR/jar/atomic/newt-ogl.jar:$JOGL_BUILD_DIR/jar/jogl-test.jar:$SWT_CLASSPATH:$JUNIT_JAR:$ANT_JARS
         X_ARGS="-Djava.awt.headless=true $X_ARGS"
     fi
     if [ $swton -eq 1 ] ; then
-        export CLASSPATH=$CLASSPATH:$JOGL_SWT_CLASSPATH
+        export USE_CLASSPATH=$USE_CLASSPATH:$JOGL_SWT_CLASSPATH
     fi
     if [ ! -z "$CUSTOM_CLASSPATH" ] ; then
-        export CLASSPATH=$CUSTOM_CLASSPATH:$CLASSPATH
+        export USE_CLASSPATH=$CUSTOM_CLASSPATH:$USE_CLASSPATH
     fi
     #Test NEWT Broadcom ..
-    #export CLASSPATH=$JOGL_BUILD_DIR/jar/atomic/newt.driver.broadcomegl.jar::$CLASSPATH
+    #export USE_CLASSPATH=$JOGL_BUILD_DIR/jar/atomic/newt.driver.broadcomegl.jar::$USE_CLASSPATH
     #X_ARGS="-Dnativewindow.ws.name=jogamp.newt.driver.broadcom.egl $X_ARGS"
-    echo CLASSPATH $CLASSPATH
+    echo USE_CLASSPATH $USE_CLASSPATH
     if [ $MOSX_MT -eq 1 ] ; then
         if [ $awton -eq 0 -a $swton -eq 0 ] ; then
             # No AWT, No SWT -> Preserve Main-Thread
@@ -296,29 +328,37 @@ function jrun() {
     echo
     echo "Test Start: $*"
     echo
-    echo "$javaexe" $javaxargs $X_ARGS $D_ARGS $C_ARG $*
-    #gdb --args "$javaexe" $javaxargs $X_ARGS $D_ARGS $C_ARG $*
-    "$javaexe" $javaxargs $X_ARGS $D_ARGS $C_ARG $*
+    # export __GL_THREADED_OPTIMIZATIONS=1
+    echo __GL_THREADED_OPTIMIZATIONS $__GL_THREADED_OPTIMIZATIONS
+    echo
+    echo "$javaexe" $javaxargs $X_ARGS -cp $USE_CLASSPATH $D_ARGS $C_ARG $*
+    #gdb --args "$javaexe" $javaxargs $X_ARGS -cp $USE_CLASSPATH $D_ARGS $C_ARG $*
+    "$javaexe" $javaxargs $X_ARGS -cp $USE_CLASSPATH $D_ARGS $C_ARG $*
+    #strace $javaexe $javaxargs $X_ARGS -cp $USE_CLASSPATH $D_ARGS $C_ARG $*
     echo
     echo "Test End: $*"
     echo
 }
 
+function testnoawtatomics() {
+    jrun -1 0 $* 2>&1 | tee -a java-run.log
+}
+
 function testnoawt() {
-    jrun 0 0 $* 2>&1 | tee -a java-run.log
+    jrun  0 0 $* 2>&1 | tee -a java-run.log
 }
 
 function testawt() {
     MOSX_MT=0
-    jrun 1 0 $* 2>&1 | tee -a java-run.log
+    jrun  1 0 $* 2>&1 | tee -a java-run.log
 }
 
 function testswt() {
-    jrun 0 1 $* 2>&1 | tee -a java-run.log
+    jrun  0 1 $* 2>&1 | tee -a java-run.log
 }
 
 function testawtswt() {
-    jrun 1 1 $* 2>&1 | tee -a java-run.log
+    jrun  1 1 $* 2>&1 | tee -a java-run.log
 }
 
 #
@@ -329,12 +369,32 @@ function testawtswt() {
 #testnoawt com.jogamp.nativewindow.NativeWindowVersion $*
 #testnoawt com.jogamp.opengl.JoglVersion $*
 #testnoawt com.jogamp.newt.NewtVersion $*
+#testnoawt com.jogamp.oculusvr.OVRVersion $*
+
 #testnoawt com.jogamp.newt.opengl.GLWindow $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLVersionParsing00NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestMainVersionGLWindowNEWT $*
 #testawt com.jogamp.opengl.test.junit.jogl.acore.TestMainVersionGLCanvasAWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile00NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLProfile01NEWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestVersionSemanticsNOUI $*
+
+#
+# Stereo
+#
+testnoawt com.jogamp.opengl.test.junit.jogl.stereo.StereoDemo01 $*
+
+#
+# HiDPI
+#
+#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.glsl.TestRulerNEWT01 $*
+#testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUUISceneNewtDemo $*
+#testawt com.jogamp.opengl.test.junit.graph.demos.GPUUISceneNewtCanvasAWTDemo $*
+#testawt com.jogamp.opengl.test.junit.jogl.awt.ManualHiDPIBufferedImage01AWT $*
 
 #
 # demos (any TK, more user driven tests)
@@ -344,6 +404,7 @@ function testawtswt() {
 #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es1.newt.TestRedSquareES1NEWT $*
 #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2AWT $*
 #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelAWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.awt.ManualHiDPIBufferedImage01AWT $*
 #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.awt.TestGearsES2GLJPanelsAWT $*
 #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasAWT $*
 #testawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NewtCanvasAWT $*
@@ -351,6 +412,7 @@ function testawtswt() {
 #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestLandscapeES2NEWT $*
 #testawtswt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestElektronenMultipliziererNEWT $*
+#testnoawtatomics com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestRedSquareES2NEWT $*
 #testswt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NewtCanvasSWT $*
@@ -396,13 +458,16 @@ function testawtswt() {
 #
 # CORE [NEWT + AWT] (testnoawt and testawt)
 #
+#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestFloatUtil01NOUI $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestFloatUtil02MatrixMatrixMultNOUI $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestFloatUtil03InversionNOUI $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.math.TestPMVMatrix01NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.math.TestPMVMatrix02NOUI $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.math.TestPMVMatrix03NOUI $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.math.TestGluUnprojectFloatNOUI $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.math.TestGluUnprojectDoubleNOUI $*
-#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestFloatUtil01MatrixMatrixMultNOUI $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.math.TestBinary16NOUI $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.math.TestQuaternion01NOUI $*
 
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestShutdownCompleteNEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestInitConcurrent01NEWT $*
@@ -411,12 +476,11 @@ function testawtswt() {
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLDebug00NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLDebug01NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGPUMemSec01NEWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLException01NEWT $*
 
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestMapBufferRead01NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestRedSquareES2NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
-#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBOES2NEWT0 $*
-#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBOES2NEWT3 $*
 
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestBug669RecursiveGLContext01NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestBug669RecursiveGLContext02NEWT $*
@@ -433,7 +497,7 @@ function testawtswt() {
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBOES2NEWT3 $*
 #testawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBOES2AWT3 $*
 #testawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBOES2AWT3b $*
-#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBOES2SWT3 $*
+#testswt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextVBOES2SWT3 $*
 #testawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextWithJTabbedPaneAWT $*
 #testawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextNewtAWTBug523 $*
 #testawt com.jogamp.opengl.test.junit.jogl.acore.TestSharedContextListAWT $*
@@ -475,6 +539,7 @@ function testawtswt() {
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext11VSyncAnimNEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.ect.TestExclusiveContext12FPSAnimNEWT $*
 
+#testawt com.jogamp.opengl.test.junit.jogl.acore.glels.TestGLContextDrawableSwitch02NEWT $*
 #testawt com.jogamp.opengl.test.junit.jogl.acore.glels.TestGLContextDrawableSwitch02AWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.glels.TestGLContextDrawableSwitch01NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.glels.TestGLContextDrawableSwitch10NEWT $*
@@ -498,7 +563,7 @@ function testawtswt() {
 #testawt com.jogamp.opengl.test.junit.jogl.acore.anim.Bug898AnimatorFromEDTAWT $*
 
 #testawt com.jogamp.opengl.test.junit.jogl.acore.TestGLReadBuffer01GLJPanelAWT $*
-testawt com.jogamp.opengl.test.junit.jogl.acore.TestGLReadBuffer01GLCanvasAWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.acore.TestGLReadBuffer01GLCanvasAWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLReadBuffer01GLWindowNEWT $*
 
 #
@@ -516,6 +581,7 @@ testawt com.jogamp.opengl.test.junit.jogl.acore.TestGLReadBuffer01GLCanvasAWT $*
 #testnoawt com.jogamp.opengl.test.junit.newt.TestGLWindowInvisiblePointer01NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.newt.TestDisplayLifecycle01NEWT
 #testnoawt com.jogamp.opengl.test.junit.newt.TestDisplayLifecycle02NEWT
+#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.newt.TestGearsES2NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode00aNEWT $*
 #testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode00bNEWT $*
 #testnoawt com.jogamp.opengl.test.junit.newt.mm.TestScreenMode00cNEWT $*
@@ -653,7 +719,7 @@ testawt com.jogamp.opengl.test.junit.jogl.acore.TestGLReadBuffer01GLCanvasAWT $*
 #testawt com.jogamp.opengl.test.junit.jogl.caps.TestTranslucencyNEWT $*
 #testnoawt com.jogamp.opengl.test.junit.newt.parenting.TestTranslucentChildWindowBug632NEWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.caps.TestBug605FlippedImageNEWT $*
-#testnoawt com.jogamp.opengl.test.junit.jogl.caps.TestBug605FlippedImageAWT $*
+#testawt com.jogamp.opengl.test.junit.jogl.caps.TestBug605FlippedImageAWT $*
 #testawt com.jogamp.opengl.test.junit.jogl.glsl.TestShaderCompilationBug459AWT
 
 #testnoawt com.jogamp.opengl.test.junit.newt.DemoCreateAndDisposeOnCloseNEWT $*
@@ -708,6 +774,7 @@ testawt com.jogamp.opengl.test.junit.jogl.acore.TestGLReadBuffer01GLCanvasAWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.util.texture.TestPixelFormatUtil01NEWT $*
 #testawt com.jogamp.opengl.test.junit.jogl.util.texture.TestPNGTextureFromFileAWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.util.texture.TestPNGTextureFromFileNEWT $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.util.texture.TestTGATextureFromFileNEWT $*
 #testawt com.jogamp.opengl.test.junit.jogl.util.texture.TestGLReadBufferUtilTextureIOWrite01AWT $*
 #testnoawt com.jogamp.opengl.test.junit.jogl.util.texture.TestGLReadBufferUtilTextureIOWrite01NEWT $*
 #testawt com.jogamp.opengl.test.junit.jogl.util.texture.TestGLReadBufferUtilTextureIOWrite02AWT $*
@@ -729,17 +796,19 @@ testawt com.jogamp.opengl.test.junit.jogl.acore.TestGLReadBuffer01GLCanvasAWT $*
 #
 # Graph
 #
-#testnoawt com.jogamp.opengl.test.junit.graph.TestTextRendererNEWT10 $*
-#testnoawt com.jogamp.opengl.test.junit.graph.TestTextRendererNEWT00 $*
 #testnoawt com.jogamp.opengl.test.junit.graph.TestRegionRendererNEWT01 $*
+#testnoawt com.jogamp.opengl.test.junit.graph.TestTextRendererNEWT00 $*
 #testnoawt com.jogamp.opengl.test.junit.graph.TestTextRendererNEWT01 $*
+#testnoawt com.jogamp.opengl.test.junit.graph.TestTextRendererNEWT10 $*
 #testnoawt com.jogamp.opengl.test.junit.graph.demos.ui.UINewtDemo01 $*
-#testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUTextNewtDemo01 $*
-#testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUTextNewtDemo02 $*
-#testnoawt com.jogamp.opengl.test.junit.graph.demos.GPURegionNewtDemo01 $*
-#testnoawt com.jogamp.opengl.test.junit.graph.demos.GPURegionNewtDemo02 $*
-#testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUUISceneNewtDemo01 $*
-#testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUUISceneNewtDemo02 $*
+#testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUTextNewtDemo $*
+#testnoawt com.jogamp.opengl.test.junit.graph.demos.GPURegionNewtDemo $*
+#testnoawt com.jogamp.opengl.test.junit.graph.demos.GPUUISceneNewtDemo $*
+#testawt com.jogamp.opengl.test.junit.graph.demos.GPUUISceneNewtCanvasAWTDemo $*
+
+#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple $*
+#testnoawt com.jogamp.opengl.test.junit.jogl.acore.TestGLReadBuffer01GLWindowNEWT $*
 
 #
 # OSX bugs
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/avcodec.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/avcodec.h
deleted file mode 100644
index caf8284..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/avcodec.h
+++ /dev/null
@@ -1,4277 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AVCODEC_H
-#define AVCODEC_AVCODEC_H
-
-/**
- * @file
- * @ingroup libavc
- * Libavcodec external API header
- */
-
-#include <errno.h>
-#include "libavutil/samplefmt.h"
-#include "libavutil/attributes.h"
-#include "libavutil/avutil.h"
-#include "libavutil/buffer.h"
-#include "libavutil/cpu.h"
-#include "libavutil/dict.h"
-#include "libavutil/frame.h"
-#include "libavutil/log.h"
-#include "libavutil/pixfmt.h"
-#include "libavutil/rational.h"
-
-#include "libavcodec/version.h"
-/**
- * @defgroup libavc Encoding/Decoding Library
- * @{
- *
- * @defgroup lavc_decoding Decoding
- * @{
- * @}
- *
- * @defgroup lavc_encoding Encoding
- * @{
- * @}
- *
- * @defgroup lavc_codec Codecs
- * @{
- * @defgroup lavc_codec_native Native Codecs
- * @{
- * @}
- * @defgroup lavc_codec_wrappers External library wrappers
- * @{
- * @}
- * @defgroup lavc_codec_hwaccel Hardware Accelerators bridge
- * @{
- * @}
- * @}
- * @defgroup lavc_internal Internal
- * @{
- * @}
- * @}
- *
- */
-
-/**
- * @defgroup lavc_core Core functions/structures.
- * @ingroup libavc
- *
- * Basic definitions, functions for querying libavcodec capabilities,
- * allocating core structures, etc.
- * @{
- */
-
-
-/**
- * Identify the syntax and semantics of the bitstream.
- * The principle is roughly:
- * Two decoders with the same ID can decode the same streams.
- * Two encoders with the same ID can encode compatible streams.
- * There may be slight deviations from the principle due to implementation
- * details.
- *
- * If you add a codec ID to this list, add it so that
- * 1. no value of a existing codec ID changes (that would break ABI),
- * 2. it is as close as possible to similar codecs.
- *
- * After adding new codec IDs, do not forget to add an entry to the codec
- * descriptor list and bump libavcodec minor version.
- */
-enum AVCodecID {
-    AV_CODEC_ID_NONE,
-
-    /* video codecs */
-    AV_CODEC_ID_MPEG1VIDEO,
-    AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
-    AV_CODEC_ID_MPEG2VIDEO_XVMC,
-    AV_CODEC_ID_H261,
-    AV_CODEC_ID_H263,
-    AV_CODEC_ID_RV10,
-    AV_CODEC_ID_RV20,
-    AV_CODEC_ID_MJPEG,
-    AV_CODEC_ID_MJPEGB,
-    AV_CODEC_ID_LJPEG,
-    AV_CODEC_ID_SP5X,
-    AV_CODEC_ID_JPEGLS,
-    AV_CODEC_ID_MPEG4,
-    AV_CODEC_ID_RAWVIDEO,
-    AV_CODEC_ID_MSMPEG4V1,
-    AV_CODEC_ID_MSMPEG4V2,
-    AV_CODEC_ID_MSMPEG4V3,
-    AV_CODEC_ID_WMV1,
-    AV_CODEC_ID_WMV2,
-    AV_CODEC_ID_H263P,
-    AV_CODEC_ID_H263I,
-    AV_CODEC_ID_FLV1,
-    AV_CODEC_ID_SVQ1,
-    AV_CODEC_ID_SVQ3,
-    AV_CODEC_ID_DVVIDEO,
-    AV_CODEC_ID_HUFFYUV,
-    AV_CODEC_ID_CYUV,
-    AV_CODEC_ID_H264,
-    AV_CODEC_ID_INDEO3,
-    AV_CODEC_ID_VP3,
-    AV_CODEC_ID_THEORA,
-    AV_CODEC_ID_ASV1,
-    AV_CODEC_ID_ASV2,
-    AV_CODEC_ID_FFV1,
-    AV_CODEC_ID_4XM,
-    AV_CODEC_ID_VCR1,
-    AV_CODEC_ID_CLJR,
-    AV_CODEC_ID_MDEC,
-    AV_CODEC_ID_ROQ,
-    AV_CODEC_ID_INTERPLAY_VIDEO,
-    AV_CODEC_ID_XAN_WC3,
-    AV_CODEC_ID_XAN_WC4,
-    AV_CODEC_ID_RPZA,
-    AV_CODEC_ID_CINEPAK,
-    AV_CODEC_ID_WS_VQA,
-    AV_CODEC_ID_MSRLE,
-    AV_CODEC_ID_MSVIDEO1,
-    AV_CODEC_ID_IDCIN,
-    AV_CODEC_ID_8BPS,
-    AV_CODEC_ID_SMC,
-    AV_CODEC_ID_FLIC,
-    AV_CODEC_ID_TRUEMOTION1,
-    AV_CODEC_ID_VMDVIDEO,
-    AV_CODEC_ID_MSZH,
-    AV_CODEC_ID_ZLIB,
-    AV_CODEC_ID_QTRLE,
-    AV_CODEC_ID_TSCC,
-    AV_CODEC_ID_ULTI,
-    AV_CODEC_ID_QDRAW,
-    AV_CODEC_ID_VIXL,
-    AV_CODEC_ID_QPEG,
-    AV_CODEC_ID_PNG,
-    AV_CODEC_ID_PPM,
-    AV_CODEC_ID_PBM,
-    AV_CODEC_ID_PGM,
-    AV_CODEC_ID_PGMYUV,
-    AV_CODEC_ID_PAM,
-    AV_CODEC_ID_FFVHUFF,
-    AV_CODEC_ID_RV30,
-    AV_CODEC_ID_RV40,
-    AV_CODEC_ID_VC1,
-    AV_CODEC_ID_WMV3,
-    AV_CODEC_ID_LOCO,
-    AV_CODEC_ID_WNV1,
-    AV_CODEC_ID_AASC,
-    AV_CODEC_ID_INDEO2,
-    AV_CODEC_ID_FRAPS,
-    AV_CODEC_ID_TRUEMOTION2,
-    AV_CODEC_ID_BMP,
-    AV_CODEC_ID_CSCD,
-    AV_CODEC_ID_MMVIDEO,
-    AV_CODEC_ID_ZMBV,
-    AV_CODEC_ID_AVS,
-    AV_CODEC_ID_SMACKVIDEO,
-    AV_CODEC_ID_NUV,
-    AV_CODEC_ID_KMVC,
-    AV_CODEC_ID_FLASHSV,
-    AV_CODEC_ID_CAVS,
-    AV_CODEC_ID_JPEG2000,
-    AV_CODEC_ID_VMNC,
-    AV_CODEC_ID_VP5,
-    AV_CODEC_ID_VP6,
-    AV_CODEC_ID_VP6F,
-    AV_CODEC_ID_TARGA,
-    AV_CODEC_ID_DSICINVIDEO,
-    AV_CODEC_ID_TIERTEXSEQVIDEO,
-    AV_CODEC_ID_TIFF,
-    AV_CODEC_ID_GIF,
-    AV_CODEC_ID_DXA,
-    AV_CODEC_ID_DNXHD,
-    AV_CODEC_ID_THP,
-    AV_CODEC_ID_SGI,
-    AV_CODEC_ID_C93,
-    AV_CODEC_ID_BETHSOFTVID,
-    AV_CODEC_ID_PTX,
-    AV_CODEC_ID_TXD,
-    AV_CODEC_ID_VP6A,
-    AV_CODEC_ID_AMV,
-    AV_CODEC_ID_VB,
-    AV_CODEC_ID_PCX,
-    AV_CODEC_ID_SUNRAST,
-    AV_CODEC_ID_INDEO4,
-    AV_CODEC_ID_INDEO5,
-    AV_CODEC_ID_MIMIC,
-    AV_CODEC_ID_RL2,
-    AV_CODEC_ID_ESCAPE124,
-    AV_CODEC_ID_DIRAC,
-    AV_CODEC_ID_BFI,
-    AV_CODEC_ID_CMV,
-    AV_CODEC_ID_MOTIONPIXELS,
-    AV_CODEC_ID_TGV,
-    AV_CODEC_ID_TGQ,
-    AV_CODEC_ID_TQI,
-    AV_CODEC_ID_AURA,
-    AV_CODEC_ID_AURA2,
-    AV_CODEC_ID_V210X,
-    AV_CODEC_ID_TMV,
-    AV_CODEC_ID_V210,
-    AV_CODEC_ID_DPX,
-    AV_CODEC_ID_MAD,
-    AV_CODEC_ID_FRWU,
-    AV_CODEC_ID_FLASHSV2,
-    AV_CODEC_ID_CDGRAPHICS,
-    AV_CODEC_ID_R210,
-    AV_CODEC_ID_ANM,
-    AV_CODEC_ID_BINKVIDEO,
-    AV_CODEC_ID_IFF_ILBM,
-    AV_CODEC_ID_IFF_BYTERUN1,
-    AV_CODEC_ID_KGV1,
-    AV_CODEC_ID_YOP,
-    AV_CODEC_ID_VP8,
-    AV_CODEC_ID_PICTOR,
-    AV_CODEC_ID_ANSI,
-    AV_CODEC_ID_A64_MULTI,
-    AV_CODEC_ID_A64_MULTI5,
-    AV_CODEC_ID_R10K,
-    AV_CODEC_ID_MXPEG,
-    AV_CODEC_ID_LAGARITH,
-    AV_CODEC_ID_PRORES,
-    AV_CODEC_ID_JV,
-    AV_CODEC_ID_DFA,
-    AV_CODEC_ID_WMV3IMAGE,
-    AV_CODEC_ID_VC1IMAGE,
-    AV_CODEC_ID_UTVIDEO,
-    AV_CODEC_ID_BMV_VIDEO,
-    AV_CODEC_ID_VBLE,
-    AV_CODEC_ID_DXTORY,
-    AV_CODEC_ID_V410,
-    AV_CODEC_ID_XWD,
-    AV_CODEC_ID_CDXL,
-    AV_CODEC_ID_XBM,
-    AV_CODEC_ID_ZEROCODEC,
-    AV_CODEC_ID_MSS1,
-    AV_CODEC_ID_MSA1,
-    AV_CODEC_ID_TSCC2,
-    AV_CODEC_ID_MTS2,
-    AV_CODEC_ID_CLLC,
-    AV_CODEC_ID_MSS2,
-    AV_CODEC_ID_VP9,
-    AV_CODEC_ID_AIC,
-    AV_CODEC_ID_ESCAPE130,
-    AV_CODEC_ID_G2M,
-
-    /* various PCM "codecs" */
-    AV_CODEC_ID_FIRST_AUDIO = 0x10000,     ///< A dummy id pointing at the start of audio codecs
-    AV_CODEC_ID_PCM_S16LE = 0x10000,
-    AV_CODEC_ID_PCM_S16BE,
-    AV_CODEC_ID_PCM_U16LE,
-    AV_CODEC_ID_PCM_U16BE,
-    AV_CODEC_ID_PCM_S8,
-    AV_CODEC_ID_PCM_U8,
-    AV_CODEC_ID_PCM_MULAW,
-    AV_CODEC_ID_PCM_ALAW,
-    AV_CODEC_ID_PCM_S32LE,
-    AV_CODEC_ID_PCM_S32BE,
-    AV_CODEC_ID_PCM_U32LE,
-    AV_CODEC_ID_PCM_U32BE,
-    AV_CODEC_ID_PCM_S24LE,
-    AV_CODEC_ID_PCM_S24BE,
-    AV_CODEC_ID_PCM_U24LE,
-    AV_CODEC_ID_PCM_U24BE,
-    AV_CODEC_ID_PCM_S24DAUD,
-    AV_CODEC_ID_PCM_ZORK,
-    AV_CODEC_ID_PCM_S16LE_PLANAR,
-    AV_CODEC_ID_PCM_DVD,
-    AV_CODEC_ID_PCM_F32BE,
-    AV_CODEC_ID_PCM_F32LE,
-    AV_CODEC_ID_PCM_F64BE,
-    AV_CODEC_ID_PCM_F64LE,
-    AV_CODEC_ID_PCM_BLURAY,
-    AV_CODEC_ID_PCM_LXF,
-    AV_CODEC_ID_S302M,
-    AV_CODEC_ID_PCM_S8_PLANAR,
-
-    /* various ADPCM codecs */
-    AV_CODEC_ID_ADPCM_IMA_QT = 0x11000,
-    AV_CODEC_ID_ADPCM_IMA_WAV,
-    AV_CODEC_ID_ADPCM_IMA_DK3,
-    AV_CODEC_ID_ADPCM_IMA_DK4,
-    AV_CODEC_ID_ADPCM_IMA_WS,
-    AV_CODEC_ID_ADPCM_IMA_SMJPEG,
-    AV_CODEC_ID_ADPCM_MS,
-    AV_CODEC_ID_ADPCM_4XM,
-    AV_CODEC_ID_ADPCM_XA,
-    AV_CODEC_ID_ADPCM_ADX,
-    AV_CODEC_ID_ADPCM_EA,
-    AV_CODEC_ID_ADPCM_G726,
-    AV_CODEC_ID_ADPCM_CT,
-    AV_CODEC_ID_ADPCM_SWF,
-    AV_CODEC_ID_ADPCM_YAMAHA,
-    AV_CODEC_ID_ADPCM_SBPRO_4,
-    AV_CODEC_ID_ADPCM_SBPRO_3,
-    AV_CODEC_ID_ADPCM_SBPRO_2,
-    AV_CODEC_ID_ADPCM_THP,
-    AV_CODEC_ID_ADPCM_IMA_AMV,
-    AV_CODEC_ID_ADPCM_EA_R1,
-    AV_CODEC_ID_ADPCM_EA_R3,
-    AV_CODEC_ID_ADPCM_EA_R2,
-    AV_CODEC_ID_ADPCM_IMA_EA_SEAD,
-    AV_CODEC_ID_ADPCM_IMA_EA_EACS,
-    AV_CODEC_ID_ADPCM_EA_XAS,
-    AV_CODEC_ID_ADPCM_EA_MAXIS_XA,
-    AV_CODEC_ID_ADPCM_IMA_ISS,
-    AV_CODEC_ID_ADPCM_G722,
-    AV_CODEC_ID_ADPCM_IMA_APC,
-
-    /* AMR */
-    AV_CODEC_ID_AMR_NB = 0x12000,
-    AV_CODEC_ID_AMR_WB,
-
-    /* RealAudio codecs*/
-    AV_CODEC_ID_RA_144 = 0x13000,
-    AV_CODEC_ID_RA_288,
-
-    /* various DPCM codecs */
-    AV_CODEC_ID_ROQ_DPCM = 0x14000,
-    AV_CODEC_ID_INTERPLAY_DPCM,
-    AV_CODEC_ID_XAN_DPCM,
-    AV_CODEC_ID_SOL_DPCM,
-
-    /* audio codecs */
-    AV_CODEC_ID_MP2 = 0x15000,
-    AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
-    AV_CODEC_ID_AAC,
-    AV_CODEC_ID_AC3,
-    AV_CODEC_ID_DTS,
-    AV_CODEC_ID_VORBIS,
-    AV_CODEC_ID_DVAUDIO,
-    AV_CODEC_ID_WMAV1,
-    AV_CODEC_ID_WMAV2,
-    AV_CODEC_ID_MACE3,
-    AV_CODEC_ID_MACE6,
-    AV_CODEC_ID_VMDAUDIO,
-    AV_CODEC_ID_FLAC,
-    AV_CODEC_ID_MP3ADU,
-    AV_CODEC_ID_MP3ON4,
-    AV_CODEC_ID_SHORTEN,
-    AV_CODEC_ID_ALAC,
-    AV_CODEC_ID_WESTWOOD_SND1,
-    AV_CODEC_ID_GSM, ///< as in Berlin toast format
-    AV_CODEC_ID_QDM2,
-    AV_CODEC_ID_COOK,
-    AV_CODEC_ID_TRUESPEECH,
-    AV_CODEC_ID_TTA,
-    AV_CODEC_ID_SMACKAUDIO,
-    AV_CODEC_ID_QCELP,
-    AV_CODEC_ID_WAVPACK,
-    AV_CODEC_ID_DSICINAUDIO,
-    AV_CODEC_ID_IMC,
-    AV_CODEC_ID_MUSEPACK7,
-    AV_CODEC_ID_MLP,
-    AV_CODEC_ID_GSM_MS, /* as found in WAV */
-    AV_CODEC_ID_ATRAC3,
-#if FF_API_VOXWARE
-    AV_CODEC_ID_VOXWARE,
-#endif
-    AV_CODEC_ID_APE,
-    AV_CODEC_ID_NELLYMOSER,
-    AV_CODEC_ID_MUSEPACK8,
-    AV_CODEC_ID_SPEEX,
-    AV_CODEC_ID_WMAVOICE,
-    AV_CODEC_ID_WMAPRO,
-    AV_CODEC_ID_WMALOSSLESS,
-    AV_CODEC_ID_ATRAC3P,
-    AV_CODEC_ID_EAC3,
-    AV_CODEC_ID_SIPR,
-    AV_CODEC_ID_MP1,
-    AV_CODEC_ID_TWINVQ,
-    AV_CODEC_ID_TRUEHD,
-    AV_CODEC_ID_MP4ALS,
-    AV_CODEC_ID_ATRAC1,
-    AV_CODEC_ID_BINKAUDIO_RDFT,
-    AV_CODEC_ID_BINKAUDIO_DCT,
-    AV_CODEC_ID_AAC_LATM,
-    AV_CODEC_ID_QDMC,
-    AV_CODEC_ID_CELT,
-    AV_CODEC_ID_G723_1,
-    AV_CODEC_ID_G729,
-    AV_CODEC_ID_8SVX_EXP,
-    AV_CODEC_ID_8SVX_FIB,
-    AV_CODEC_ID_BMV_AUDIO,
-    AV_CODEC_ID_RALF,
-    AV_CODEC_ID_IAC,
-    AV_CODEC_ID_ILBC,
-    AV_CODEC_ID_OPUS,
-    AV_CODEC_ID_COMFORT_NOISE,
-    AV_CODEC_ID_TAK,
-    AV_CODEC_ID_METASOUND,
-
-    /* subtitle codecs */
-    AV_CODEC_ID_FIRST_SUBTITLE = 0x17000,          ///< A dummy ID pointing at the start of subtitle codecs.
-    AV_CODEC_ID_DVD_SUBTITLE = 0x17000,
-    AV_CODEC_ID_DVB_SUBTITLE,
-    AV_CODEC_ID_TEXT,  ///< raw UTF-8 text
-    AV_CODEC_ID_XSUB,
-    AV_CODEC_ID_SSA,
-    AV_CODEC_ID_MOV_TEXT,
-    AV_CODEC_ID_HDMV_PGS_SUBTITLE,
-    AV_CODEC_ID_DVB_TELETEXT,
-    AV_CODEC_ID_SRT,
-
-    /* other specific kind of codecs (generally used for attachments) */
-    AV_CODEC_ID_FIRST_UNKNOWN = 0x18000,           ///< A dummy ID pointing at the start of various fake codecs.
-    AV_CODEC_ID_TTF = 0x18000,
-
-    AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
-
-    AV_CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
-                                * stream (only used by libavformat) */
-    AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
-                                * stream (only used by libavformat) */
-    AV_CODEC_ID_FFMETADATA = 0x21000,   ///< Dummy codec for streams containing only metadata information.
-};
-
-/**
- * This struct describes the properties of a single codec described by an
- * AVCodecID.
- * @see avcodec_get_descriptor()
- */
-typedef struct AVCodecDescriptor {
-    enum AVCodecID     id;
-    enum AVMediaType type;
-    /**
-     * Name of the codec described by this descriptor. It is non-empty and
-     * unique for each codec descriptor. It should contain alphanumeric
-     * characters and '_' only.
-     */
-    const char      *name;
-    /**
-     * A more descriptive name for this codec. May be NULL.
-     */
-    const char *long_name;
-    /**
-     * Codec properties, a combination of AV_CODEC_PROP_* flags.
-     */
-    int             props;
-} AVCodecDescriptor;
-
-/**
- * Codec uses only intra compression.
- * Video codecs only.
- */
-#define AV_CODEC_PROP_INTRA_ONLY    (1 << 0)
-/**
- * Codec supports lossy compression. Audio and video codecs only.
- * @note a codec may support both lossy and lossless
- * compression modes
- */
-#define AV_CODEC_PROP_LOSSY         (1 << 1)
-/**
- * Codec supports lossless compression. Audio and video codecs only.
- */
-#define AV_CODEC_PROP_LOSSLESS      (1 << 2)
-
-/**
- * @ingroup lavc_decoding
- * Required number of additionally allocated bytes at the end of the input bitstream for decoding.
- * This is mainly needed because some optimized bitstream readers read
- * 32 or 64 bit at once and could read over the end.<br>
- * Note: If the first 23 bits of the additional bytes are not 0, then damaged
- * MPEG bitstreams could cause overread and segfault.
- */
-#define FF_INPUT_BUFFER_PADDING_SIZE 8
-
-/**
- * @ingroup lavc_encoding
- * minimum encoding buffer size
- * Used to avoid some checks during header writing.
- */
-#define FF_MIN_BUFFER_SIZE 16384
-
-
-/**
- * @ingroup lavc_encoding
- * motion estimation type.
- */
-enum Motion_Est_ID {
-    ME_ZERO = 1,    ///< no search, that is use 0,0 vector whenever one is needed
-    ME_FULL,
-    ME_LOG,
-    ME_PHODS,
-    ME_EPZS,        ///< enhanced predictive zonal search
-    ME_X1,          ///< reserved for experiments
-    ME_HEX,         ///< hexagon based search
-    ME_UMH,         ///< uneven multi-hexagon search
-    ME_TESA,        ///< transformed exhaustive search algorithm
-};
-
-/**
- * @ingroup lavc_decoding
- */
-enum AVDiscard{
-    /* We leave some space between them for extensions (drop some
-     * keyframes for intra-only or drop just some bidir frames). */
-    AVDISCARD_NONE    =-16, ///< discard nothing
-    AVDISCARD_DEFAULT =  0, ///< discard useless packets like 0 size packets in avi
-    AVDISCARD_NONREF  =  8, ///< discard all non reference
-    AVDISCARD_BIDIR   = 16, ///< discard all bidirectional frames
-    AVDISCARD_NONKEY  = 32, ///< discard all frames except keyframes
-    AVDISCARD_ALL     = 48, ///< discard all
-};
-
-enum AVColorPrimaries{
-    AVCOL_PRI_BT709       = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
-    AVCOL_PRI_UNSPECIFIED = 2,
-    AVCOL_PRI_BT470M      = 4,
-    AVCOL_PRI_BT470BG     = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
-    AVCOL_PRI_SMPTE170M   = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
-    AVCOL_PRI_SMPTE240M   = 7, ///< functionally identical to above
-    AVCOL_PRI_FILM        = 8,
-    AVCOL_PRI_NB             , ///< Not part of ABI
-};
-
-enum AVColorTransferCharacteristic{
-    AVCOL_TRC_BT709       = 1, ///< also ITU-R BT1361
-    AVCOL_TRC_UNSPECIFIED = 2,
-    AVCOL_TRC_GAMMA22     = 4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
-    AVCOL_TRC_GAMMA28     = 5, ///< also ITU-R BT470BG
-    AVCOL_TRC_SMPTE240M   = 7,
-    AVCOL_TRC_NB             , ///< Not part of ABI
-};
-
-enum AVColorSpace{
-    AVCOL_SPC_RGB         = 0,
-    AVCOL_SPC_BT709       = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
-    AVCOL_SPC_UNSPECIFIED = 2,
-    AVCOL_SPC_FCC         = 4,
-    AVCOL_SPC_BT470BG     = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
-    AVCOL_SPC_SMPTE170M   = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
-    AVCOL_SPC_SMPTE240M   = 7,
-    AVCOL_SPC_YCOCG       = 8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
-    AVCOL_SPC_NB             , ///< Not part of ABI
-};
-
-enum AVColorRange{
-    AVCOL_RANGE_UNSPECIFIED = 0,
-    AVCOL_RANGE_MPEG        = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges
-    AVCOL_RANGE_JPEG        = 2, ///< the normal     2^n-1   "JPEG" YUV ranges
-    AVCOL_RANGE_NB             , ///< Not part of ABI
-};
-
-/**
- *  X   X      3 4 X      X are luma samples,
- *             1 2        1-6 are possible chroma positions
- *  X   X      5 6 X      0 is undefined/unknown position
- */
-enum AVChromaLocation{
-    AVCHROMA_LOC_UNSPECIFIED = 0,
-    AVCHROMA_LOC_LEFT        = 1, ///< mpeg2/4, h264 default
-    AVCHROMA_LOC_CENTER      = 2, ///< mpeg1, jpeg, h263
-    AVCHROMA_LOC_TOPLEFT     = 3, ///< DV
-    AVCHROMA_LOC_TOP         = 4,
-    AVCHROMA_LOC_BOTTOMLEFT  = 5,
-    AVCHROMA_LOC_BOTTOM      = 6,
-    AVCHROMA_LOC_NB             , ///< Not part of ABI
-};
-
-enum AVAudioServiceType {
-    AV_AUDIO_SERVICE_TYPE_MAIN              = 0,
-    AV_AUDIO_SERVICE_TYPE_EFFECTS           = 1,
-    AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2,
-    AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED  = 3,
-    AV_AUDIO_SERVICE_TYPE_DIALOGUE          = 4,
-    AV_AUDIO_SERVICE_TYPE_COMMENTARY        = 5,
-    AV_AUDIO_SERVICE_TYPE_EMERGENCY         = 6,
-    AV_AUDIO_SERVICE_TYPE_VOICE_OVER        = 7,
-    AV_AUDIO_SERVICE_TYPE_KARAOKE           = 8,
-    AV_AUDIO_SERVICE_TYPE_NB                   , ///< Not part of ABI
-};
-
-/**
- * @ingroup lavc_encoding
- */
-typedef struct RcOverride{
-    int start_frame;
-    int end_frame;
-    int qscale; // If this is 0 then quality_factor will be used instead.
-    float quality_factor;
-} RcOverride;
-
-#define FF_MAX_B_FRAMES 16
-
-/* encoding support
-   These flags can be passed in AVCodecContext.flags before initialization.
-   Note: Not everything is supported yet.
-*/
-
-/**
- * Allow decoders to produce frames with data planes that are not aligned
- * to CPU requirements (e.g. due to cropping).
- */
-#define CODEC_FLAG_UNALIGNED 0x0001
-#define CODEC_FLAG_QSCALE 0x0002  ///< Use fixed qscale.
-#define CODEC_FLAG_4MV    0x0004  ///< 4 MV per MB allowed / advanced prediction for H.263.
-#define CODEC_FLAG_QPEL   0x0010  ///< Use qpel MC.
-#define CODEC_FLAG_GMC    0x0020  ///< Use GMC.
-#define CODEC_FLAG_MV0    0x0040  ///< Always try a MB with MV=<0,0>.
-/**
- * The parent program guarantees that the input for B-frames containing
- * streams is not written to for at least s->max_b_frames+1 frames, if
- * this is not set the input will be copied.
- */
-#define CODEC_FLAG_INPUT_PRESERVED 0x0100
-#define CODEC_FLAG_PASS1           0x0200   ///< Use internal 2pass ratecontrol in first pass mode.
-#define CODEC_FLAG_PASS2           0x0400   ///< Use internal 2pass ratecontrol in second pass mode.
-#define CODEC_FLAG_GRAY            0x2000   ///< Only decode/encode grayscale.
-#define CODEC_FLAG_EMU_EDGE        0x4000   ///< Don't draw edges.
-#define CODEC_FLAG_PSNR            0x8000   ///< error[?] variables will be set during encoding.
-#define CODEC_FLAG_TRUNCATED       0x00010000 /** Input bitstream might be truncated at a random
-                                                  location instead of only at frame boundaries. */
-#define CODEC_FLAG_NORMALIZE_AQP  0x00020000 ///< Normalize adaptive quantization.
-#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
-#define CODEC_FLAG_LOW_DELAY      0x00080000 ///< Force low delay.
-#define CODEC_FLAG_GLOBAL_HEADER  0x00400000 ///< Place global headers in extradata instead of every keyframe.
-#define CODEC_FLAG_BITEXACT       0x00800000 ///< Use only bitexact stuff (except (I)DCT).
-/* Fx : Flag for h263+ extra options */
-#define CODEC_FLAG_AC_PRED        0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
-#define CODEC_FLAG_LOOP_FILTER    0x00000800 ///< loop filter
-#define CODEC_FLAG_INTERLACED_ME  0x20000000 ///< interlaced motion estimation
-#define CODEC_FLAG_CLOSED_GOP     0x80000000
-#define CODEC_FLAG2_FAST          0x00000001 ///< Allow non spec compliant speedup tricks.
-#define CODEC_FLAG2_NO_OUTPUT     0x00000004 ///< Skip bitstream encoding.
-#define CODEC_FLAG2_LOCAL_HEADER  0x00000008 ///< Place global headers at every keyframe instead of in extradata.
-#define CODEC_FLAG2_IGNORE_CROP   0x00010000 ///< Discard cropping information from SPS.
-
-#define CODEC_FLAG2_CHUNKS        0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
-
-/* Unsupported options :
- *              Syntax Arithmetic coding (SAC)
- *              Reference Picture Selection
- *              Independent Segment Decoding */
-/* /Fx */
-/* codec capabilities */
-
-#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback.
-/**
- * Codec uses get_buffer() for allocating buffers and supports custom allocators.
- * If not set, it might not use get_buffer() at all or use operations that
- * assume the buffer was allocated by avcodec_default_get_buffer.
- */
-#define CODEC_CAP_DR1             0x0002
-#define CODEC_CAP_TRUNCATED       0x0008
-/* Codec can export data for HW decoding (XvMC). */
-#define CODEC_CAP_HWACCEL         0x0010
-/**
- * Encoder or decoder requires flushing with NULL input at the end in order to
- * give the complete and correct output.
- *
- * NOTE: If this flag is not set, the codec is guaranteed to never be fed with
- *       with NULL data. The user can still send NULL data to the public encode
- *       or decode function, but libavcodec will not pass it along to the codec
- *       unless this flag is set.
- *
- * Decoders:
- * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL,
- * avpkt->size=0 at the end to get the delayed data until the decoder no longer
- * returns frames.
- *
- * Encoders:
- * The encoder needs to be fed with NULL data at the end of encoding until the
- * encoder no longer returns data.
- *
- * NOTE: For encoders implementing the AVCodec.encode2() function, setting this
- *       flag also means that the encoder must set the pts and duration for
- *       each output packet. If this flag is not set, the pts and duration will
- *       be determined by libavcodec from the input frame.
- */
-#define CODEC_CAP_DELAY           0x0020
-/**
- * Codec can be fed a final frame with a smaller size.
- * This can be used to prevent truncation of the last audio samples.
- */
-#define CODEC_CAP_SMALL_LAST_FRAME 0x0040
-#if FF_API_CAP_VDPAU
-/**
- * Codec can export data for HW decoding (VDPAU).
- */
-#define CODEC_CAP_HWACCEL_VDPAU    0x0080
-#endif
-/**
- * Codec can output multiple frames per AVPacket
- * Normally demuxers return one frame at a time, demuxers which do not do
- * are connected to a parser to split what they return into proper frames.
- * This flag is reserved to the very rare category of codecs which have a
- * bitstream that cannot be split into frames without timeconsuming
- * operations like full decoding. Demuxers carring such bitstreams thus
- * may return multiple frames in a packet. This has many disadvantages like
- * prohibiting stream copy in many cases thus it should only be considered
- * as a last resort.
- */
-#define CODEC_CAP_SUBFRAMES        0x0100
-/**
- * Codec is experimental and is thus avoided in favor of non experimental
- * encoders
- */
-#define CODEC_CAP_EXPERIMENTAL     0x0200
-/**
- * Codec should fill in channel configuration and samplerate instead of container
- */
-#define CODEC_CAP_CHANNEL_CONF     0x0400
-/**
- * Codec is able to deal with negative linesizes
- */
-#define CODEC_CAP_NEG_LINESIZES    0x0800
-/**
- * Codec supports frame-level multithreading.
- */
-#define CODEC_CAP_FRAME_THREADS    0x1000
-/**
- * Codec supports slice-based (or partition-based) multithreading.
- */
-#define CODEC_CAP_SLICE_THREADS    0x2000
-/**
- * Codec supports changed parameters at any point.
- */
-#define CODEC_CAP_PARAM_CHANGE     0x4000
-/**
- * Codec supports avctx->thread_count == 0 (auto).
- */
-#define CODEC_CAP_AUTO_THREADS     0x8000
-/**
- * Audio encoder supports receiving a different number of samples in each call.
- */
-#define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
-
-//The following defines may change, don't expect compatibility if you use them.
-#define MB_TYPE_INTRA4x4   0x0001
-#define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
-#define MB_TYPE_INTRA_PCM  0x0004 //FIXME H.264-specific
-#define MB_TYPE_16x16      0x0008
-#define MB_TYPE_16x8       0x0010
-#define MB_TYPE_8x16       0x0020
-#define MB_TYPE_8x8        0x0040
-#define MB_TYPE_INTERLACED 0x0080
-#define MB_TYPE_DIRECT2    0x0100 //FIXME
-#define MB_TYPE_ACPRED     0x0200
-#define MB_TYPE_GMC        0x0400
-#define MB_TYPE_SKIP       0x0800
-#define MB_TYPE_P0L0       0x1000
-#define MB_TYPE_P1L0       0x2000
-#define MB_TYPE_P0L1       0x4000
-#define MB_TYPE_P1L1       0x8000
-#define MB_TYPE_L0         (MB_TYPE_P0L0 | MB_TYPE_P1L0)
-#define MB_TYPE_L1         (MB_TYPE_P0L1 | MB_TYPE_P1L1)
-#define MB_TYPE_L0L1       (MB_TYPE_L0   | MB_TYPE_L1)
-#define MB_TYPE_QUANT      0x00010000
-#define MB_TYPE_CBP        0x00020000
-//Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
-
-/**
- * Pan Scan area.
- * This specifies the area which should be displayed.
- * Note there may be multiple such areas for one frame.
- */
-typedef struct AVPanScan{
-    /**
-     * id
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    int id;
-
-    /**
-     * width and height in 1/16 pel
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    int width;
-    int height;
-
-    /**
-     * position of the top left corner in 1/16 pel for up to 3 fields/frames
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    int16_t position[3][2];
-}AVPanScan;
-
-#define FF_QSCALE_TYPE_MPEG1 0
-#define FF_QSCALE_TYPE_MPEG2 1
-#define FF_QSCALE_TYPE_H264  2
-#define FF_QSCALE_TYPE_VP56  3
-
-#if FF_API_GET_BUFFER
-#define FF_BUFFER_TYPE_INTERNAL 1
-#define FF_BUFFER_TYPE_USER     2 ///< direct rendering buffers (image is (de)allocated by user)
-#define FF_BUFFER_TYPE_SHARED   4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared.
-#define FF_BUFFER_TYPE_COPY     8 ///< Just a (modified) copy of some other buffer, don't deallocate anything.
-
-#define FF_BUFFER_HINTS_VALID    0x01 // Buffer hints value is meaningful (if 0 ignore).
-#define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
-#define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
-#define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
-#endif
-
-/**
- * The decoder will keep a reference to the frame and may reuse it later.
- */
-#define AV_GET_BUFFER_FLAG_REF (1 << 0)
-
-/**
- * @defgroup lavc_packet AVPacket
- *
- * Types and functions for working with AVPacket.
- * @{
- */
-enum AVPacketSideDataType {
-    AV_PKT_DATA_PALETTE,
-    AV_PKT_DATA_NEW_EXTRADATA,
-
-    /**
-     * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
-     * @code
-     * u32le param_flags
-     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
-     *     s32le channel_count
-     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
-     *     u64le channel_layout
-     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
-     *     s32le sample_rate
-     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
-     *     s32le width
-     *     s32le height
-     * @endcode
-     */
-    AV_PKT_DATA_PARAM_CHANGE,
-
-    /**
-     * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of
-     * structures with info about macroblocks relevant to splitting the
-     * packet into smaller packets on macroblock edges (e.g. as for RFC 2190).
-     * That is, it does not necessarily contain info about all macroblocks,
-     * as long as the distance between macroblocks in the info is smaller
-     * than the target payload size.
-     * Each MB info structure is 12 bytes, and is laid out as follows:
-     * @code
-     * u32le bit offset from the start of the packet
-     * u8    current quantizer at the start of the macroblock
-     * u8    GOB number
-     * u16le macroblock address within the GOB
-     * u8    horizontal MV predictor
-     * u8    vertical MV predictor
-     * u8    horizontal MV predictor for block number 3
-     * u8    vertical MV predictor for block number 3
-     * @endcode
-     */
-    AV_PKT_DATA_H263_MB_INFO,
-};
-
-/**
- * This structure stores compressed data. It is typically exported by demuxers
- * and then passed as input to decoders, or received as output from encoders and
- * then passed to muxers.
- *
- * For video, it should typically contain one compressed frame. For audio it may
- * contain several compressed frames.
- *
- * AVPacket is one of the few structs in Libav, whose size is a part of public
- * ABI. Thus it may be allocated on stack and no new fields can be added to it
- * without libavcodec and libavformat major bump.
- *
- * The semantics of data ownership depends on the buf or destruct (deprecated)
- * fields. If either is set, the packet data is dynamically allocated and is
- * valid indefinitely until av_free_packet() is called (which in turn calls
- * av_buffer_unref()/the destruct callback to free the data). If neither is set,
- * the packet data is typically backed by some static buffer somewhere and is
- * only valid for a limited time (e.g. until the next read call when demuxing).
- *
- * The side data is always allocated with av_malloc() and is freed in
- * av_free_packet().
- */
-typedef struct AVPacket {
-    /**
-     * A reference to the reference-counted buffer where the packet data is
-     * stored.
-     * May be NULL, then the packet data is not reference-counted.
-     */
-    AVBufferRef *buf;
-    /**
-     * Presentation timestamp in AVStream->time_base units; the time at which
-     * the decompressed packet will be presented to the user.
-     * Can be AV_NOPTS_VALUE if it is not stored in the file.
-     * pts MUST be larger or equal to dts as presentation cannot happen before
-     * decompression, unless one wants to view hex dumps. Some formats misuse
-     * the terms dts and pts/cts to mean something different. Such timestamps
-     * must be converted to true pts/dts before they are stored in AVPacket.
-     */
-    int64_t pts;
-    /**
-     * Decompression timestamp in AVStream->time_base units; the time at which
-     * the packet is decompressed.
-     * Can be AV_NOPTS_VALUE if it is not stored in the file.
-     */
-    int64_t dts;
-    uint8_t *data;
-    int   size;
-    int   stream_index;
-    /**
-     * A combination of AV_PKT_FLAG values
-     */
-    int   flags;
-    /**
-     * Additional packet data that can be provided by the container.
-     * Packet can contain several types of side information.
-     */
-    struct {
-        uint8_t *data;
-        int      size;
-        enum AVPacketSideDataType type;
-    } *side_data;
-    int side_data_elems;
-
-    /**
-     * Duration of this packet in AVStream->time_base units, 0 if unknown.
-     * Equals next_pts - this_pts in presentation order.
-     */
-    int   duration;
-#if FF_API_DESTRUCT_PACKET
-    attribute_deprecated
-    void  (*destruct)(struct AVPacket *);
-    attribute_deprecated
-    void  *priv;
-#endif
-    int64_t pos;                            ///< byte position in stream, -1 if unknown
-
-    /**
-     * Time difference in AVStream->time_base units from the pts of this
-     * packet to the point at which the output from the decoder has converged
-     * independent from the availability of previous frames. That is, the
-     * frames are virtually identical no matter if decoding started from
-     * the very first frame or from this keyframe.
-     * Is AV_NOPTS_VALUE if unknown.
-     * This field is not the display duration of the current packet.
-     * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
-     * set.
-     *
-     * The purpose of this field is to allow seeking in streams that have no
-     * keyframes in the conventional sense. It corresponds to the
-     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
-     * essential for some types of subtitle streams to ensure that all
-     * subtitles are correctly displayed after seeking.
-     */
-    int64_t convergence_duration;
-} AVPacket;
-#define AV_PKT_FLAG_KEY     0x0001 ///< The packet contains a keyframe
-#define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted
-
-enum AVSideDataParamChangeFlags {
-    AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT  = 0x0001,
-    AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002,
-    AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE    = 0x0004,
-    AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS     = 0x0008,
-};
-/**
- * @}
- */
-
-struct AVCodecInternal;
-
-enum AVFieldOrder {
-    AV_FIELD_UNKNOWN,
-    AV_FIELD_PROGRESSIVE,
-    AV_FIELD_TT,          //< Top coded_first, top displayed first
-    AV_FIELD_BB,          //< Bottom coded first, bottom displayed first
-    AV_FIELD_TB,          //< Top coded first, bottom displayed first
-    AV_FIELD_BT,          //< Bottom coded first, top displayed first
-};
-
-/**
- * main external API structure.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVCodecContext) must not be used outside libav*.
- */
-typedef struct AVCodecContext {
-    /**
-     * information on struct for av_log
-     * - set by avcodec_alloc_context3
-     */
-    const AVClass *av_class;
-    int log_level_offset;
-
-    enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
-    const struct AVCodec  *codec;
-    char             codec_name[32];
-    enum AVCodecID     codec_id; /* see AV_CODEC_ID_xxx */
-
-    /**
-     * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
-     * This is used to work around some encoder bugs.
-     * A demuxer should set this to what is stored in the field used to identify the codec.
-     * If there are multiple such fields in a container then the demuxer should choose the one
-     * which maximizes the information about the used codec.
-     * If the codec tag field in a container is larger than 32 bits then the demuxer should
-     * remap the longer ID to 32 bits with a table or other structure. Alternatively a new
-     * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated
-     * first.
-     * - encoding: Set by user, if not then the default based on codec_id will be used.
-     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
-     */
-    unsigned int codec_tag;
-
-    /**
-     * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
-     * This is used to work around some encoder bugs.
-     * - encoding: unused
-     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
-     */
-    unsigned int stream_codec_tag;
-
-    void *priv_data;
-
-    /**
-     * Private context used for internal data.
-     *
-     * Unlike priv_data, this is not codec-specific. It is used in general
-     * libavcodec functions.
-     */
-    struct AVCodecInternal *internal;
-
-    /**
-     * Private data of the user, can be used to carry app specific stuff.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    void *opaque;
-
-    /**
-     * the average bitrate
-     * - encoding: Set by user; unused for constant quantizer encoding.
-     * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
-     */
-    int bit_rate;
-
-    /**
-     * number of bits the bitstream is allowed to diverge from the reference.
-     *           the reference can be CBR (for CBR pass1) or VBR (for pass2)
-     * - encoding: Set by user; unused for constant quantizer encoding.
-     * - decoding: unused
-     */
-    int bit_rate_tolerance;
-
-    /**
-     * Global quality for codecs which cannot change it per frame.
-     * This should be proportional to MPEG-1/2/4 qscale.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int global_quality;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int compression_level;
-#define FF_COMPRESSION_DEFAULT -1
-
-    /**
-     * CODEC_FLAG_*.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int flags;
-
-    /**
-     * CODEC_FLAG2_*
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int flags2;
-
-    /**
-     * some codecs need / can use extradata like Huffman tables.
-     * mjpeg: Huffman tables
-     * rv10: additional flags
-     * mpeg4: global headers (they can be in the bitstream or here)
-     * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
-     * than extradata_size to avoid prolems if it is read with the bitstream reader.
-     * The bytewise contents of extradata must not depend on the architecture or CPU endianness.
-     * - encoding: Set/allocated/freed by libavcodec.
-     * - decoding: Set/allocated/freed by user.
-     */
-    uint8_t *extradata;
-    int extradata_size;
-
-    /**
-     * This is the fundamental unit of time (in seconds) in terms
-     * of which frame timestamps are represented. For fixed-fps content,
-     * timebase should be 1/framerate and timestamp increments should be
-     * identically 1.
-     * - encoding: MUST be set by user.
-     * - decoding: Set by libavcodec.
-     */
-    AVRational time_base;
-
-    /**
-     * For some codecs, the time base is closer to the field rate than the frame rate.
-     * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
-     * if no telecine is used ...
-     *
-     * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
-     */
-    int ticks_per_frame;
-
-    /**
-     * Codec delay.
-     *
-     * Video:
-     *   Number of frames the decoded output will be delayed relative to the
-     *   encoded input.
-     *
-     * Audio:
-     *   For encoding, this is the number of "priming" samples added to the
-     *   beginning of the stream. The decoded output will be delayed by this
-     *   many samples relative to the input to the encoder. Note that this
-     *   field is purely informational and does not directly affect the pts
-     *   output by the encoder, which should always be based on the actual
-     *   presentation time, including any delay.
-     *   For decoding, this is the number of samples the decoder needs to
-     *   output before the decoder's output is valid. When seeking, you should
-     *   start decoding this many samples prior to your desired seek point.
-     *
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec.
-     */
-    int delay;
-
-
-    /* video only */
-    /**
-     * picture width / height.
-     * - encoding: MUST be set by user.
-     * - decoding: May be set by the user before opening the decoder if known e.g.
-     *             from the container. Some decoders will require the dimensions
-     *             to be set by the caller. During decoding, the decoder may
-     *             overwrite those values as required.
-     */
-    int width, height;
-
-    /**
-     * Bitstream width / height, may be different from width/height e.g. when
-     * the decoded frame is cropped before being output.
-     * - encoding: unused
-     * - decoding: May be set by the user before opening the decoder if known
-     *             e.g. from the container. During decoding, the decoder may
-     *             overwrite those values as required.
-     */
-    int coded_width, coded_height;
-
-#define FF_ASPECT_EXTENDED 15
-
-    /**
-     * the number of pictures in a group of pictures, or 0 for intra_only
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int gop_size;
-
-    /**
-     * Pixel format, see AV_PIX_FMT_xxx.
-     * May be set by the demuxer if known from headers.
-     * May be overriden by the decoder if it knows better.
-     * - encoding: Set by user.
-     * - decoding: Set by user if known, overridden by libavcodec if known
-     */
-    enum AVPixelFormat pix_fmt;
-
-    /**
-     * Motion estimation algorithm used for video coding.
-     * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
-     * 8 (umh), 10 (tesa) [7, 8, 10 are x264 specific]
-     * - encoding: MUST be set by user.
-     * - decoding: unused
-     */
-    int me_method;
-
-    /**
-     * If non NULL, 'draw_horiz_band' is called by the libavcodec
-     * decoder to draw a horizontal band. It improves cache usage. Not
-     * all codecs can do that. You must check the codec capabilities
-     * beforehand.
-     * When multithreading is used, it may be called from multiple threads
-     * at the same time; threads might draw different parts of the same AVFrame,
-     * or multiple AVFrames, and there is no guarantee that slices will be drawn
-     * in order.
-     * The function is also used by hardware acceleration APIs.
-     * It is called at least once during frame decoding to pass
-     * the data needed for hardware render.
-     * In that mode instead of pixel data, AVFrame points to
-     * a structure specific to the acceleration API. The application
-     * reads the structure and can change some fields to indicate progress
-     * or mark state.
-     * - encoding: unused
-     * - decoding: Set by user.
-     * @param height the height of the slice
-     * @param y the y position of the slice
-     * @param type 1->top field, 2->bottom field, 3->frame
-     * @param offset offset into the AVFrame.data from which the slice should be read
-     */
-    void (*draw_horiz_band)(struct AVCodecContext *s,
-                            const AVFrame *src, int offset[AV_NUM_DATA_POINTERS],
-                            int y, int type, int height);
-
-    /**
-     * callback to negotiate the pixelFormat
-     * @param fmt is the list of formats which are supported by the codec,
-     * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
-     * The first is always the native one.
-     * @return the chosen format
-     * - encoding: unused
-     * - decoding: Set by user, if not set the native format will be chosen.
-     */
-    enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
-
-    /**
-     * maximum number of B-frames between non-B-frames
-     * Note: The output will be delayed by max_b_frames+1 relative to the input.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_b_frames;
-
-    /**
-     * qscale factor between IP and B-frames
-     * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
-     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float b_quant_factor;
-
-    /** obsolete FIXME remove */
-    int rc_strategy;
-#define FF_RC_STRATEGY_XVID 1
-
-    int b_frame_strategy;
-
-    /**
-     * qscale offset between IP and B-frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float b_quant_offset;
-
-    /**
-     * Size of the frame reordering buffer in the decoder.
-     * For MPEG-2 it is 1 IPB or 0 low delay IP.
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec.
-     */
-    int has_b_frames;
-
-    /**
-     * 0-> h263 quant 1-> mpeg quant
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mpeg_quant;
-
-    /**
-     * qscale factor between P and I-frames
-     * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset).
-     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float i_quant_factor;
-
-    /**
-     * qscale offset between P and I-frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float i_quant_offset;
-
-    /**
-     * luminance masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float lumi_masking;
-
-    /**
-     * temporary complexity masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float temporal_cplx_masking;
-
-    /**
-     * spatial complexity masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float spatial_cplx_masking;
-
-    /**
-     * p block masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float p_masking;
-
-    /**
-     * darkness masking (0-> disabled)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float dark_masking;
-
-    /**
-     * slice count
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by user (or 0).
-     */
-    int slice_count;
-    /**
-     * prediction method (needed for huffyuv)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int prediction_method;
-#define FF_PRED_LEFT   0
-#define FF_PRED_PLANE  1
-#define FF_PRED_MEDIAN 2
-
-    /**
-     * slice offsets in the frame in bytes
-     * - encoding: Set/allocated by libavcodec.
-     * - decoding: Set/allocated by user (or NULL).
-     */
-    int *slice_offset;
-
-    /**
-     * sample aspect ratio (0 if unknown)
-     * That is the width of a pixel divided by the height of the pixel.
-     * Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    AVRational sample_aspect_ratio;
-
-    /**
-     * motion estimation comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_cmp;
-    /**
-     * subpixel motion estimation comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_sub_cmp;
-    /**
-     * macroblock comparison function (not supported yet)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_cmp;
-    /**
-     * interlaced DCT comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int ildct_cmp;
-#define FF_CMP_SAD    0
-#define FF_CMP_SSE    1
-#define FF_CMP_SATD   2
-#define FF_CMP_DCT    3
-#define FF_CMP_PSNR   4
-#define FF_CMP_BIT    5
-#define FF_CMP_RD     6
-#define FF_CMP_ZERO   7
-#define FF_CMP_VSAD   8
-#define FF_CMP_VSSE   9
-#define FF_CMP_NSSE   10
-#define FF_CMP_DCTMAX 13
-#define FF_CMP_DCT264 14
-#define FF_CMP_CHROMA 256
-
-    /**
-     * ME diamond size & shape
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int dia_size;
-
-    /**
-     * amount of previous MV predictors (2a+1 x 2a+1 square)
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int last_predictor_count;
-
-    /**
-     * prepass for motion estimation
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int pre_me;
-
-    /**
-     * motion estimation prepass comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_pre_cmp;
-
-    /**
-     * ME prepass diamond size & shape
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int pre_dia_size;
-
-    /**
-     * subpel ME quality
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_subpel_quality;
-
-    /**
-     * DTG active format information (additional aspect ratio
-     * information only used in DVB MPEG-2 transport streams)
-     * 0 if not set.
-     *
-     * - encoding: unused
-     * - decoding: Set by decoder.
-     */
-    int dtg_active_format;
-#define FF_DTG_AFD_SAME         8
-#define FF_DTG_AFD_4_3          9
-#define FF_DTG_AFD_16_9         10
-#define FF_DTG_AFD_14_9         11
-#define FF_DTG_AFD_4_3_SP_14_9  13
-#define FF_DTG_AFD_16_9_SP_14_9 14
-#define FF_DTG_AFD_SP_4_3       15
-
-    /**
-     * maximum motion estimation search range in subpel units
-     * If 0 then no limit.
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_range;
-
-    /**
-     * intra quantizer bias
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int intra_quant_bias;
-#define FF_DEFAULT_QUANT_BIAS 999999
-
-    /**
-     * inter quantizer bias
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int inter_quant_bias;
-
-    /**
-     * slice flags
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int slice_flags;
-#define SLICE_FLAG_CODED_ORDER    0x0001 ///< draw_horiz_band() is called in coded order instead of display
-#define SLICE_FLAG_ALLOW_FIELD    0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
-#define SLICE_FLAG_ALLOW_PLANE    0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
-
-    /**
-     * XVideo Motion Acceleration
-     * - encoding: forbidden
-     * - decoding: set by decoder
-     */
-    int xvmc_acceleration;
-
-    /**
-     * macroblock decision mode
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_decision;
-#define FF_MB_DECISION_SIMPLE 0        ///< uses mb_cmp
-#define FF_MB_DECISION_BITS   1        ///< chooses the one which needs the fewest bits
-#define FF_MB_DECISION_RD     2        ///< rate distortion
-
-    /**
-     * custom intra quantization matrix
-     * - encoding: Set by user, can be NULL.
-     * - decoding: Set by libavcodec.
-     */
-    uint16_t *intra_matrix;
-
-    /**
-     * custom inter quantization matrix
-     * - encoding: Set by user, can be NULL.
-     * - decoding: Set by libavcodec.
-     */
-    uint16_t *inter_matrix;
-
-    /**
-     * scene change detection threshold
-     * 0 is default, larger means fewer detected scene changes.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int scenechange_threshold;
-
-    /**
-     * noise reduction strength
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int noise_reduction;
-
-    /**
-     * Motion estimation threshold below which no motion estimation is
-     * performed, but instead the user specified motion vectors are used.
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_threshold;
-
-    /**
-     * Macroblock threshold below which the user specified macroblock types will be used.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_threshold;
-
-    /**
-     * precision of the intra DC coefficient - 8
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int intra_dc_precision;
-
-    /**
-     * Number of macroblock rows at the top which are skipped.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int skip_top;
-
-    /**
-     * Number of macroblock rows at the bottom which are skipped.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int skip_bottom;
-
-    /**
-     * Border processing masking, raises the quantizer for mbs on the borders
-     * of the picture.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float border_masking;
-
-    /**
-     * minimum MB lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_lmin;
-
-    /**
-     * maximum MB lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mb_lmax;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int me_penalty_compensation;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int bidir_refine;
-
-    /**
-     *
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int brd_scale;
-
-    /**
-     * minimum GOP size
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int keyint_min;
-
-    /**
-     * number of reference frames
-     * - encoding: Set by user.
-     * - decoding: Set by lavc.
-     */
-    int refs;
-
-    /**
-     * chroma qp offset from luma
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int chromaoffset;
-
-    /**
-     * Multiplied by qscale for each frame and added to scene_change_score.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int scenechange_factor;
-
-    /**
-     *
-     * Note: Value depends upon the compare function used for fullpel ME.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int mv0_threshold;
-
-    /**
-     * Adjust sensitivity of b_frame_strategy 1.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int b_sensitivity;
-
-    /**
-     * Chromaticity coordinates of the source primaries.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorPrimaries color_primaries;
-
-    /**
-     * Color Transfer Characteristic.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorTransferCharacteristic color_trc;
-
-    /**
-     * YUV colorspace type.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorSpace colorspace;
-
-    /**
-     * MPEG vs JPEG YUV range.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVColorRange color_range;
-
-    /**
-     * This defines the location of chroma samples.
-     * - encoding: Set by user
-     * - decoding: Set by libavcodec
-     */
-    enum AVChromaLocation chroma_sample_location;
-
-    /**
-     * Number of slices.
-     * Indicates number of picture subdivisions. Used for parallelized
-     * decoding.
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    int slices;
-
-    /** Field order
-     * - encoding: set by libavcodec
-     * - decoding: Set by libavcodec
-     */
-    enum AVFieldOrder field_order;
-
-    /* audio only */
-    int sample_rate; ///< samples per second
-    int channels;    ///< number of audio channels
-
-    /**
-     * audio sample format
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    enum AVSampleFormat sample_fmt;  ///< sample format
-
-    /* The following data should not be initialized. */
-    /**
-     * Number of samples per channel in an audio frame.
-     *
-     * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame
-     *   except the last must contain exactly frame_size samples per channel.
-     *   May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the
-     *   frame size is not restricted.
-     * - decoding: may be set by some decoders to indicate constant frame size
-     */
-    int frame_size;
-
-    /**
-     * Frame counter, set by libavcodec.
-     *
-     * - decoding: total number of frames returned from the decoder so far.
-     * - encoding: total number of frames passed to the encoder so far.
-     *
-     *   @note the counter is not incremented if encoding/decoding resulted in
-     *   an error.
-     */
-    int frame_number;
-
-    /**
-     * number of bytes per packet if constant and known or 0
-     * Used by some WAV based audio codecs.
-     */
-    int block_align;
-
-    /**
-     * Audio cutoff bandwidth (0 means "automatic")
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int cutoff;
-
-#if FF_API_REQUEST_CHANNELS
-    /**
-     * Decoder should decode to this many channels if it can (0 for default)
-     * - encoding: unused
-     * - decoding: Set by user.
-     * @deprecated Deprecated in favor of request_channel_layout.
-     */
-    attribute_deprecated int request_channels;
-#endif
-
-    /**
-     * Audio channel layout.
-     * - encoding: set by user.
-     * - decoding: set by libavcodec.
-     */
-    uint64_t channel_layout;
-
-    /**
-     * Request decoder to use this channel layout if it can (0 for default)
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    uint64_t request_channel_layout;
-
-    /**
-     * Type of service that the audio stream conveys.
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-    enum AVAudioServiceType audio_service_type;
-
-    /**
-     * Used to request a sample format from the decoder.
-     * - encoding: unused.
-     * - decoding: Set by user.
-     */
-    enum AVSampleFormat request_sample_fmt;
-
-#if FF_API_GET_BUFFER
-    /**
-     * Called at the beginning of each frame to get a buffer for it.
-     *
-     * The function will set AVFrame.data[], AVFrame.linesize[].
-     * AVFrame.extended_data[] must also be set, but it should be the same as
-     * AVFrame.data[] except for planar audio with more channels than can fit
-     * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as
-     * many data pointers as it can hold.
-     *
-     * if CODEC_CAP_DR1 is not set then get_buffer() must call
-     * avcodec_default_get_buffer() instead of providing buffers allocated by
-     * some other means.
-     *
-     * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't
-     * need it. avcodec_default_get_buffer() aligns the output buffer properly,
-     * but if get_buffer() is overridden then alignment considerations should
-     * be taken into account.
-     *
-     * @see avcodec_default_get_buffer()
-     *
-     * Video:
-     *
-     * If pic.reference is set then the frame will be read later by libavcodec.
-     * avcodec_align_dimensions2() should be used to find the required width and
-     * height, as they normally need to be rounded up to the next multiple of 16.
-     *
-     * If frame multithreading is used and thread_safe_callbacks is set,
-     * it may be called from a different thread, but not from more than one at
-     * once. Does not need to be reentrant.
-     *
-     * @see release_buffer(), reget_buffer()
-     * @see avcodec_align_dimensions2()
-     *
-     * Audio:
-     *
-     * Decoders request a buffer of a particular size by setting
-     * AVFrame.nb_samples prior to calling get_buffer(). The decoder may,
-     * however, utilize only part of the buffer by setting AVFrame.nb_samples
-     * to a smaller value in the output frame.
-     *
-     * Decoders cannot use the buffer after returning from
-     * avcodec_decode_audio4(), so they will not call release_buffer(), as it
-     * is assumed to be released immediately upon return. In some rare cases,
-     * a decoder may need to call get_buffer() more than once in a single
-     * call to avcodec_decode_audio4(). In that case, when get_buffer() is
-     * called again after it has already been called once, the previously
-     * acquired buffer is assumed to be released at that time and may not be
-     * reused by the decoder.
-     *
-     * As a convenience, av_samples_get_buffer_size() and
-     * av_samples_fill_arrays() in libavutil may be used by custom get_buffer()
-     * functions to find the required data size and to fill data pointers and
-     * linesize. In AVFrame.linesize, only linesize[0] may be set for audio
-     * since all planes must be the same size.
-     *
-     * @see av_samples_get_buffer_size(), av_samples_fill_arrays()
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec, user can override.
-     *
-     * @deprecated use get_buffer2()
-     */
-    attribute_deprecated
-    int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
-    /**
-     * Called to release buffers which were allocated with get_buffer.
-     * A released buffer can be reused in get_buffer().
-     * pic.data[*] must be set to NULL.
-     * May be called from a different thread if frame multithreading is used,
-     * but not by more than one thread at once, so does not need to be reentrant.
-     * - encoding: unused
-     * - decoding: Set by libavcodec, user can override.
-     *
-     * @deprecated custom freeing callbacks should be set from get_buffer2()
-     */
-    attribute_deprecated
-    void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
-
-    /**
-     * Called at the beginning of a frame to get cr buffer for it.
-     * Buffer type (size, hints) must be the same. libavcodec won't check it.
-     * libavcodec will pass previous buffer in pic, function should return
-     * same buffer or new buffer with old frame "painted" into it.
-     * If pic.data[0] == NULL must behave like get_buffer().
-     * if CODEC_CAP_DR1 is not set then reget_buffer() must call
-     * avcodec_default_reget_buffer() instead of providing buffers allocated by
-     * some other means.
-     * - encoding: unused
-     * - decoding: Set by libavcodec, user can override.
-     */
-    attribute_deprecated
-    int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
-#endif
-
-    /**
-     * This callback is called at the beginning of each frame to get data
-     * buffer(s) for it. There may be one contiguous buffer for all the data or
-     * there may be a buffer per each data plane or anything in between. What
-     * this means is, you may set however many entries in buf[] you feel necessary.
-     * Each buffer must be reference-counted using the AVBuffer API (see description
-     * of buf[] below).
-     *
-     * The following fields will be set in the frame before this callback is
-     * called:
-     * - format
-     * - width, height (video only)
-     * - sample_rate, channel_layout, nb_samples (audio only)
-     * Their values may differ from the corresponding values in
-     * AVCodecContext. This callback must use the frame values, not the codec
-     * context values, to calculate the required buffer size.
-     *
-     * This callback must fill the following fields in the frame:
-     * - data[]
-     * - linesize[]
-     * - extended_data:
-     *   * if the data is planar audio with more than 8 channels, then this
-     *     callback must allocate and fill extended_data to contain all pointers
-     *     to all data planes. data[] must hold as many pointers as it can.
-     *     extended_data must be allocated with av_malloc() and will be freed in
-     *     av_frame_unref().
-     *   * otherwise exended_data must point to data
-     * - buf[] must contain one or more pointers to AVBufferRef structures. Each of
-     *   the frame's data and extended_data pointers must be contained in these. That
-     *   is, one AVBufferRef for each allocated chunk of memory, not necessarily one
-     *   AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(),
-     *   and av_buffer_ref().
-     * - extended_buf and nb_extended_buf must be allocated with av_malloc() by
-     *   this callback and filled with the extra buffers if there are more
-     *   buffers than buf[] can hold. extended_buf will be freed in
-     *   av_frame_unref().
-     *
-     * If CODEC_CAP_DR1 is not set then get_buffer2() must call
-     * avcodec_default_get_buffer2() instead of providing buffers allocated by
-     * some other means.
-     *
-     * Each data plane must be aligned to the maximum required by the target
-     * CPU.
-     *
-     * @see avcodec_default_get_buffer2()
-     *
-     * Video:
-     *
-     * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused
-     * (read and/or written to if it is writable) later by libavcodec.
-     *
-     * If CODEC_FLAG_EMU_EDGE is not set in s->flags, the buffer must contain an
-     * edge of the size returned by avcodec_get_edge_width() on all sides.
-     *
-     * avcodec_align_dimensions2() should be used to find the required width and
-     * height, as they normally need to be rounded up to the next multiple of 16.
-     *
-     * If frame multithreading is used and thread_safe_callbacks is set,
-     * this callback may be called from a different thread, but not from more
-     * than one at once. Does not need to be reentrant.
-     *
-     * @see avcodec_align_dimensions2()
-     *
-     * Audio:
-     *
-     * Decoders request a buffer of a particular size by setting
-     * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may,
-     * however, utilize only part of the buffer by setting AVFrame.nb_samples
-     * to a smaller value in the output frame.
-     *
-     * As a convenience, av_samples_get_buffer_size() and
-     * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2()
-     * functions to find the required data size and to fill data pointers and
-     * linesize. In AVFrame.linesize, only linesize[0] may be set for audio
-     * since all planes must be the same size.
-     *
-     * @see av_samples_get_buffer_size(), av_samples_fill_arrays()
-     *
-     * - encoding: unused
-     * - decoding: Set by libavcodec, user can override.
-     */
-    int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags);
-
-    /**
-     * If non-zero, the decoded audio and video frames returned from
-     * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted
-     * and are valid indefinitely. The caller must free them with
-     * av_frame_unref() when they are not needed anymore.
-     * Otherwise, the decoded frames must not be freed by the caller and are
-     * only valid until the next decode call.
-     *
-     * - encoding: unused
-     * - decoding: set by the caller before avcodec_open2().
-     */
-    int refcounted_frames;
-
-    /* - encoding parameters */
-    float qcompress;  ///< amount of qscale change between easy & hard scenes (0.0-1.0)
-    float qblur;      ///< amount of qscale smoothing over time (0.0-1.0)
-
-    /**
-     * minimum quantizer
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int qmin;
-
-    /**
-     * maximum quantizer
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int qmax;
-
-    /**
-     * maximum quantizer difference between frames
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_qdiff;
-
-    /**
-     * ratecontrol qmin qmax limiting method
-     * 0-> clipping, 1-> use a nice continuous function to limit qscale wthin qmin/qmax.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float rc_qsquish;
-
-    float rc_qmod_amp;
-    int rc_qmod_freq;
-
-    /**
-     * decoder bitstream buffer size
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_buffer_size;
-
-    /**
-     * ratecontrol override, see RcOverride
-     * - encoding: Allocated/set/freed by user.
-     * - decoding: unused
-     */
-    int rc_override_count;
-    RcOverride *rc_override;
-
-    /**
-     * rate control equation
-     * - encoding: Set by user
-     * - decoding: unused
-     */
-    const char *rc_eq;
-
-    /**
-     * maximum bitrate
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_max_rate;
-
-    /**
-     * minimum bitrate
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_min_rate;
-
-    float rc_buffer_aggressivity;
-
-    /**
-     * initial complexity for pass1 ratecontrol
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    float rc_initial_cplx;
-
-    /**
-     * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow.
-     * - encoding: Set by user.
-     * - decoding: unused.
-     */
-    float rc_max_available_vbv_use;
-
-    /**
-     * Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow.
-     * - encoding: Set by user.
-     * - decoding: unused.
-     */
-    float rc_min_vbv_overflow_use;
-
-    /**
-     * Number of bits which should be loaded into the rc buffer before decoding starts.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int rc_initial_buffer_occupancy;
-
-#define FF_CODER_TYPE_VLC       0
-#define FF_CODER_TYPE_AC        1
-#define FF_CODER_TYPE_RAW       2
-#define FF_CODER_TYPE_RLE       3
-#define FF_CODER_TYPE_DEFLATE   4
-    /**
-     * coder type
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int coder_type;
-
-    /**
-     * context model
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int context_model;
-
-    /**
-     * minimum Lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int lmin;
-
-    /**
-     * maximum Lagrange multipler
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int lmax;
-
-    /**
-     * frame skip threshold
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_threshold;
-
-    /**
-     * frame skip factor
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_factor;
-
-    /**
-     * frame skip exponent
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_exp;
-
-    /**
-     * frame skip comparison function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int frame_skip_cmp;
-
-    /**
-     * trellis RD quantization
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int trellis;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int min_prediction_order;
-
-    /**
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int max_prediction_order;
-
-    /**
-     * GOP timecode frame start number, in non drop frame format
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int64_t timecode_frame_start;
-
-    /* The RTP callback: This function is called    */
-    /* every time the encoder has a packet to send. */
-    /* It depends on the encoder if the data starts */
-    /* with a Start Code (it should). H.263 does.   */
-    /* mb_nb contains the number of macroblocks     */
-    /* encoded in the RTP payload.                  */
-    void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
-
-    int rtp_payload_size;   /* The size of the RTP payload: the coder will  */
-                            /* do its best to deliver a chunk with size     */
-                            /* below rtp_payload_size, the chunk will start */
-                            /* with a start code on some codecs like H.263. */
-                            /* This doesn't take account of any particular  */
-                            /* headers inside the transmitted RTP payload.  */
-
-    /* statistics, used for 2-pass encoding */
-    int mv_bits;
-    int header_bits;
-    int i_tex_bits;
-    int p_tex_bits;
-    int i_count;
-    int p_count;
-    int skip_count;
-    int misc_bits;
-
-    /**
-     * number of bits used for the previously encoded frame
-     * - encoding: Set by libavcodec.
-     * - decoding: unused
-     */
-    int frame_bits;
-
-    /**
-     * pass1 encoding statistics output buffer
-     * - encoding: Set by libavcodec.
-     * - decoding: unused
-     */
-    char *stats_out;
-
-    /**
-     * pass2 encoding statistics input buffer
-     * Concatenated stuff from stats_out of pass1 should be placed here.
-     * - encoding: Allocated/set/freed by user.
-     * - decoding: unused
-     */
-    char *stats_in;
-
-    /**
-     * Work around bugs in encoders which sometimes cannot be detected automatically.
-     * - encoding: Set by user
-     * - decoding: Set by user
-     */
-    int workaround_bugs;
-#define FF_BUG_AUTODETECT       1  ///< autodetection
-#define FF_BUG_OLD_MSMPEG4      2
-#define FF_BUG_XVID_ILACE       4
-#define FF_BUG_UMP4             8
-#define FF_BUG_NO_PADDING       16
-#define FF_BUG_AMV              32
-#define FF_BUG_AC_VLC           0  ///< Will be removed, libavcodec can now handle these non-compliant files by default.
-#define FF_BUG_QPEL_CHROMA      64
-#define FF_BUG_STD_QPEL         128
-#define FF_BUG_QPEL_CHROMA2     256
-#define FF_BUG_DIRECT_BLOCKSIZE 512
-#define FF_BUG_EDGE             1024
-#define FF_BUG_HPEL_CHROMA      2048
-#define FF_BUG_DC_CLIP          4096
-#define FF_BUG_MS               8192 ///< Work around various bugs in Microsoft's broken decoders.
-#define FF_BUG_TRUNCATED       16384
-
-    /**
-     * strictly follow the standard (MPEG4, ...).
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     * Setting this to STRICT or higher means the encoder and decoder will
-     * generally do stupid things, whereas setting it to unofficial or lower
-     * will mean the encoder might produce output that is not supported by all
-     * spec-compliant decoders. Decoders don't differentiate between normal,
-     * unofficial and experimental (that is, they always try to decode things
-     * when they can) unless they are explicitly asked to behave stupidly
-     * (=strictly conform to the specs)
-     */
-    int strict_std_compliance;
-#define FF_COMPLIANCE_VERY_STRICT   2 ///< Strictly conform to an older more strict version of the spec or reference software.
-#define FF_COMPLIANCE_STRICT        1 ///< Strictly conform to all the things in the spec no matter what consequences.
-#define FF_COMPLIANCE_NORMAL        0
-#define FF_COMPLIANCE_UNOFFICIAL   -1 ///< Allow unofficial extensions
-#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
-
-    /**
-     * error concealment flags
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int error_concealment;
-#define FF_EC_GUESS_MVS   1
-#define FF_EC_DEBLOCK     2
-
-    /**
-     * debug
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int debug;
-#define FF_DEBUG_PICT_INFO   1
-#define FF_DEBUG_RC          2
-#define FF_DEBUG_BITSTREAM   4
-#define FF_DEBUG_MB_TYPE     8
-#define FF_DEBUG_QP          16
-#define FF_DEBUG_MV          32
-#define FF_DEBUG_DCT_COEFF   0x00000040
-#define FF_DEBUG_SKIP        0x00000080
-#define FF_DEBUG_STARTCODE   0x00000100
-#define FF_DEBUG_PTS         0x00000200
-#define FF_DEBUG_ER          0x00000400
-#define FF_DEBUG_MMCO        0x00000800
-#define FF_DEBUG_BUGS        0x00001000
-#define FF_DEBUG_VIS_QP      0x00002000
-#define FF_DEBUG_VIS_MB_TYPE 0x00004000
-#define FF_DEBUG_BUFFERS     0x00008000
-#define FF_DEBUG_THREADS     0x00010000
-
-    /**
-     * debug
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int debug_mv;
-#define FF_DEBUG_VIS_MV_P_FOR  0x00000001 //visualize forward predicted MVs of P frames
-#define FF_DEBUG_VIS_MV_B_FOR  0x00000002 //visualize forward predicted MVs of B frames
-#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
-
-    /**
-     * Error recognition; may misdetect some more or less valid parts as errors.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int err_recognition;
-#define AV_EF_CRCCHECK  (1<<0)
-#define AV_EF_BITSTREAM (1<<1)
-#define AV_EF_BUFFER    (1<<2)
-#define AV_EF_EXPLODE   (1<<3)
-
-    /**
-     * opaque 64bit number (generally a PTS) that will be reordered and
-     * output in AVFrame.reordered_opaque
-     * @deprecated in favor of pkt_pts
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int64_t reordered_opaque;
-
-    /**
-     * Hardware accelerator in use
-     * - encoding: unused.
-     * - decoding: Set by libavcodec
-     */
-    struct AVHWAccel *hwaccel;
-
-    /**
-     * Hardware accelerator context.
-     * For some hardware accelerators, a global context needs to be
-     * provided by the user. In that case, this holds display-dependent
-     * data Libav cannot instantiate itself. Please refer to the
-     * Libav HW accelerator documentation to know how to fill this
-     * is. e.g. for VA API, this is a struct vaapi_context.
-     * - encoding: unused
-     * - decoding: Set by user
-     */
-    void *hwaccel_context;
-
-    /**
-     * error
-     * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR.
-     * - decoding: unused
-     */
-    uint64_t error[AV_NUM_DATA_POINTERS];
-
-    /**
-     * DCT algorithm, see FF_DCT_* below
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int dct_algo;
-#define FF_DCT_AUTO    0
-#define FF_DCT_FASTINT 1
-#define FF_DCT_INT     2
-#define FF_DCT_MMX     3
-#define FF_DCT_ALTIVEC 5
-#define FF_DCT_FAAN    6
-
-    /**
-     * IDCT algorithm, see FF_IDCT_* below.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int idct_algo;
-#define FF_IDCT_AUTO          0
-#define FF_IDCT_INT           1
-#define FF_IDCT_SIMPLE        2
-#define FF_IDCT_SIMPLEMMX     3
-#define FF_IDCT_ARM           7
-#define FF_IDCT_ALTIVEC       8
-#define FF_IDCT_SH4           9
-#define FF_IDCT_SIMPLEARM     10
-#define FF_IDCT_IPP           13
-#define FF_IDCT_XVIDMMX       14
-#define FF_IDCT_SIMPLEARMV5TE 16
-#define FF_IDCT_SIMPLEARMV6   17
-#define FF_IDCT_SIMPLEVIS     18
-#define FF_IDCT_FAAN          20
-#define FF_IDCT_SIMPLENEON    22
-#define FF_IDCT_SIMPLEALPHA   23
-
-    /**
-     * bits per sample/pixel from the demuxer (needed for huffyuv).
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by user.
-     */
-     int bits_per_coded_sample;
-
-    /**
-     * Bits per sample/pixel of internal libavcodec pixel/sample format.
-     * - encoding: set by user.
-     * - decoding: set by libavcodec.
-     */
-    int bits_per_raw_sample;
-
-#if FF_API_LOWRES
-    /**
-     * low resolution decoding, 1-> 1/2 size, 2->1/4 size
-     * - encoding: unused
-     * - decoding: Set by user.
-     *
-     * @deprecated use decoder private options instead
-     */
-    attribute_deprecated int lowres;
-#endif
-
-    /**
-     * the picture in the bitstream
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec.
-     */
-    AVFrame *coded_frame;
-
-    /**
-     * thread count
-     * is used to decide how many independent tasks should be passed to execute()
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int thread_count;
-
-    /**
-     * Which multithreading methods to use.
-     * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread,
-     * so clients which cannot provide future frames should not use it.
-     *
-     * - encoding: Set by user, otherwise the default is used.
-     * - decoding: Set by user, otherwise the default is used.
-     */
-    int thread_type;
-#define FF_THREAD_FRAME   1 ///< Decode more than one frame at once
-#define FF_THREAD_SLICE   2 ///< Decode more than one part of a single frame at once
-
-    /**
-     * Which multithreading methods are in use by the codec.
-     * - encoding: Set by libavcodec.
-     * - decoding: Set by libavcodec.
-     */
-    int active_thread_type;
-
-    /**
-     * Set by the client if its custom get_buffer() callback can be called
-     * synchronously from another thread, which allows faster multithreaded decoding.
-     * draw_horiz_band() will be called from other threads regardless of this setting.
-     * Ignored if the default get_buffer() is used.
-     * - encoding: Set by user.
-     * - decoding: Set by user.
-     */
-    int thread_safe_callbacks;
-
-    /**
-     * The codec may call this to execute several independent things.
-     * It will return only after finishing all tasks.
-     * The user may replace this with some multithreaded implementation,
-     * the default implementation will execute the parts serially.
-     * @param count the number of things to execute
-     * - encoding: Set by libavcodec, user can override.
-     * - decoding: Set by libavcodec, user can override.
-     */
-    int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
-
-    /**
-     * The codec may call this to execute several independent things.
-     * It will return only after finishing all tasks.
-     * The user may replace this with some multithreaded implementation,
-     * the default implementation will execute the parts serially.
-     * Also see avcodec_thread_init and e.g. the --enable-pthread configure option.
-     * @param c context passed also to func
-     * @param count the number of things to execute
-     * @param arg2 argument passed unchanged to func
-     * @param ret return values of executed functions, must have space for "count" values. May be NULL.
-     * @param func function that will be called count times, with jobnr from 0 to count-1.
-     *             threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no
-     *             two instances of func executing at the same time will have the same threadnr.
-     * @return always 0 currently, but code should handle a future improvement where when any call to func
-     *         returns < 0 no further calls to func may be done and < 0 is returned.
-     * - encoding: Set by libavcodec, user can override.
-     * - decoding: Set by libavcodec, user can override.
-     */
-    int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
-
-    /**
-     * thread opaque
-     * Can be used by execute() to store some per AVCodecContext stuff.
-     * - encoding: set by execute()
-     * - decoding: set by execute()
-     */
-    void *thread_opaque;
-
-    /**
-     * noise vs. sse weight for the nsse comparsion function
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-     int nsse_weight;
-
-    /**
-     * profile
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-     int profile;
-#define FF_PROFILE_UNKNOWN -99
-#define FF_PROFILE_RESERVED -100
-
-#define FF_PROFILE_AAC_MAIN 0
-#define FF_PROFILE_AAC_LOW  1
-#define FF_PROFILE_AAC_SSR  2
-#define FF_PROFILE_AAC_LTP  3
-#define FF_PROFILE_AAC_HE   4
-#define FF_PROFILE_AAC_HE_V2 28
-#define FF_PROFILE_AAC_LD   22
-#define FF_PROFILE_AAC_ELD  38
-#define FF_PROFILE_MPEG2_AAC_LOW 128
-#define FF_PROFILE_MPEG2_AAC_HE  131
-
-#define FF_PROFILE_DTS         20
-#define FF_PROFILE_DTS_ES      30
-#define FF_PROFILE_DTS_96_24   40
-#define FF_PROFILE_DTS_HD_HRA  50
-#define FF_PROFILE_DTS_HD_MA   60
-
-#define FF_PROFILE_MPEG2_422    0
-#define FF_PROFILE_MPEG2_HIGH   1
-#define FF_PROFILE_MPEG2_SS     2
-#define FF_PROFILE_MPEG2_SNR_SCALABLE  3
-#define FF_PROFILE_MPEG2_MAIN   4
-#define FF_PROFILE_MPEG2_SIMPLE 5
-
-#define FF_PROFILE_H264_CONSTRAINED  (1<<9)  // 8+1; constraint_set1_flag
-#define FF_PROFILE_H264_INTRA        (1<<11) // 8+3; constraint_set3_flag
-
-#define FF_PROFILE_H264_BASELINE             66
-#define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
-#define FF_PROFILE_H264_MAIN                 77
-#define FF_PROFILE_H264_EXTENDED             88
-#define FF_PROFILE_H264_HIGH                 100
-#define FF_PROFILE_H264_HIGH_10              110
-#define FF_PROFILE_H264_HIGH_10_INTRA        (110|FF_PROFILE_H264_INTRA)
-#define FF_PROFILE_H264_HIGH_422             122
-#define FF_PROFILE_H264_HIGH_422_INTRA       (122|FF_PROFILE_H264_INTRA)
-#define FF_PROFILE_H264_HIGH_444             144
-#define FF_PROFILE_H264_HIGH_444_PREDICTIVE  244
-#define FF_PROFILE_H264_HIGH_444_INTRA       (244|FF_PROFILE_H264_INTRA)
-#define FF_PROFILE_H264_CAVLC_444            44
-
-#define FF_PROFILE_VC1_SIMPLE   0
-#define FF_PROFILE_VC1_MAIN     1
-#define FF_PROFILE_VC1_COMPLEX  2
-#define FF_PROFILE_VC1_ADVANCED 3
-
-#define FF_PROFILE_MPEG4_SIMPLE                     0
-#define FF_PROFILE_MPEG4_SIMPLE_SCALABLE            1
-#define FF_PROFILE_MPEG4_CORE                       2
-#define FF_PROFILE_MPEG4_MAIN                       3
-#define FF_PROFILE_MPEG4_N_BIT                      4
-#define FF_PROFILE_MPEG4_SCALABLE_TEXTURE           5
-#define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION      6
-#define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE     7
-#define FF_PROFILE_MPEG4_HYBRID                     8
-#define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME         9
-#define FF_PROFILE_MPEG4_CORE_SCALABLE             10
-#define FF_PROFILE_MPEG4_ADVANCED_CODING           11
-#define FF_PROFILE_MPEG4_ADVANCED_CORE             12
-#define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
-#define FF_PROFILE_MPEG4_SIMPLE_STUDIO             14
-#define FF_PROFILE_MPEG4_ADVANCED_SIMPLE           15
-
-#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0   0
-#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1   1
-#define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION  2
-#define FF_PROFILE_JPEG2000_DCINEMA_2K              3
-#define FF_PROFILE_JPEG2000_DCINEMA_4K              4
-
-    /**
-     * level
-     * - encoding: Set by user.
-     * - decoding: Set by libavcodec.
-     */
-     int level;
-#define FF_LEVEL_UNKNOWN -99
-
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    enum AVDiscard skip_loop_filter;
-
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    enum AVDiscard skip_idct;
-
-    /**
-     *
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    enum AVDiscard skip_frame;
-
-    /**
-     * Header containing style information for text subtitles.
-     * For SUBTITLE_ASS subtitle type, it should contain the whole ASS
-     * [Script Info] and [V4+ Styles] section, plus the [Events] line and
-     * the Format line following. It shouldn't include any Dialogue line.
-     * - encoding: Set/allocated/freed by user (before avcodec_open2())
-     * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2())
-     */
-    uint8_t *subtitle_header;
-    int subtitle_header_size;
-
-    /**
-     * Simulates errors in the bitstream to test error concealment.
-     * - encoding: Set by user.
-     * - decoding: unused
-     */
-    int error_rate;
-
-    /**
-     * Current packet as passed into the decoder, to avoid having
-     * to pass the packet into every function. Currently only valid
-     * inside lavc and get/release_buffer callbacks.
-     * - decoding: set by avcodec_decode_*, read by get_buffer() for setting pkt_pts
-     * - encoding: unused
-     */
-    AVPacket *pkt;
-
-    /**
-     * VBV delay coded in the last frame (in periods of a 27 MHz clock).
-     * Used for compliant TS muxing.
-     * - encoding: Set by libavcodec.
-     * - decoding: unused.
-     */
-    uint64_t vbv_delay;
-} AVCodecContext;
-
-/**
- * AVProfile.
- */
-typedef struct AVProfile {
-    int profile;
-    const char *name; ///< short name for the profile
-} AVProfile;
-
-typedef struct AVCodecDefault AVCodecDefault;
-
-struct AVSubtitle;
-
-/**
- * AVCodec.
- */
-typedef struct AVCodec {
-    /**
-     * Name of the codec implementation.
-     * The name is globally unique among encoders and among decoders (but an
-     * encoder and a decoder can share the same name).
-     * This is the primary way to find a codec from the user perspective.
-     */
-    const char *name;
-    /**
-     * Descriptive name for the codec, meant to be more human readable than name.
-     * You should use the NULL_IF_CONFIG_SMALL() macro to define it.
-     */
-    const char *long_name;
-    enum AVMediaType type;
-    enum AVCodecID id;
-    /**
-     * Codec capabilities.
-     * see CODEC_CAP_*
-     */
-    int capabilities;
-    const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
-    const enum AVPixelFormat *pix_fmts;     ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
-    const int *supported_samplerates;       ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
-    const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
-    const uint64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
-    attribute_deprecated uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
-    const AVClass *priv_class;              ///< AVClass for the private context
-    const AVProfile *profiles;              ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
-
-    /*****************************************************************
-     * No fields below this line are part of the public API. They
-     * may not be used outside of libavcodec and can be changed and
-     * removed at will.
-     * New public fields should be added right above.
-     *****************************************************************
-     */
-    int priv_data_size;
-    struct AVCodec *next;
-    /**
-     * @name Frame-level threading support functions
-     * @{
-     */
-    /**
-     * If defined, called on thread contexts when they are created.
-     * If the codec allocates writable tables in init(), re-allocate them here.
-     * priv_data will be set to a copy of the original.
-     */
-    int (*init_thread_copy)(AVCodecContext *);
-    /**
-     * Copy necessary context variables from a previous thread context to the current one.
-     * If not defined, the next thread will start automatically; otherwise, the codec
-     * must call ff_thread_finish_setup().
-     *
-     * dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
-     */
-    int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src);
-    /** @} */
-
-    /**
-     * Private codec-specific defaults.
-     */
-    const AVCodecDefault *defaults;
-
-    /**
-     * Initialize codec static data, called from avcodec_register().
-     */
-    void (*init_static_data)(struct AVCodec *codec);
-
-    int (*init)(AVCodecContext *);
-    int (*encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size,
-                      const struct AVSubtitle *sub);
-    /**
-     * Encode data to an AVPacket.
-     *
-     * @param      avctx          codec context
-     * @param      avpkt          output AVPacket (may contain a user-provided buffer)
-     * @param[in]  frame          AVFrame containing the raw data to be encoded
-     * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a
-     *                            non-empty packet was returned in avpkt.
-     * @return 0 on success, negative error code on failure
-     */
-    int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame,
-                   int *got_packet_ptr);
-    int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
-    int (*close)(AVCodecContext *);
-    /**
-     * Flush buffers.
-     * Will be called when seeking
-     */
-    void (*flush)(AVCodecContext *);
-} AVCodec;
-
-/**
- * AVHWAccel.
- */
-typedef struct AVHWAccel {
-    /**
-     * Name of the hardware accelerated codec.
-     * The name is globally unique among encoders and among decoders (but an
-     * encoder and a decoder can share the same name).
-     */
-    const char *name;
-
-    /**
-     * Type of codec implemented by the hardware accelerator.
-     *
-     * See AVMEDIA_TYPE_xxx
-     */
-    enum AVMediaType type;
-
-    /**
-     * Codec implemented by the hardware accelerator.
-     *
-     * See AV_CODEC_ID_xxx
-     */
-    enum AVCodecID id;
-
-    /**
-     * Supported pixel format.
-     *
-     * Only hardware accelerated formats are supported here.
-     */
-    enum AVPixelFormat pix_fmt;
-
-    /**
-     * Hardware accelerated codec capabilities.
-     * see FF_HWACCEL_CODEC_CAP_*
-     */
-    int capabilities;
-
-    struct AVHWAccel *next;
-
-    /**
-     * Called at the beginning of each frame or field picture.
-     *
-     * Meaningful frame information (codec specific) is guaranteed to
-     * be parsed at this point. This function is mandatory.
-     *
-     * Note that buf can be NULL along with buf_size set to 0.
-     * Otherwise, this means the whole frame is available at this point.
-     *
-     * @param avctx the codec context
-     * @param buf the frame data buffer base
-     * @param buf_size the size of the frame in bytes
-     * @return zero if successful, a negative value otherwise
-     */
-    int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
-
-    /**
-     * Callback for each slice.
-     *
-     * Meaningful slice information (codec specific) is guaranteed to
-     * be parsed at this point. This function is mandatory.
-     *
-     * @param avctx the codec context
-     * @param buf the slice data buffer base
-     * @param buf_size the size of the slice in bytes
-     * @return zero if successful, a negative value otherwise
-     */
-    int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
-
-    /**
-     * Called at the end of each frame or field picture.
-     *
-     * The whole picture is parsed at this point and can now be sent
-     * to the hardware accelerator. This function is mandatory.
-     *
-     * @param avctx the codec context
-     * @return zero if successful, a negative value otherwise
-     */
-    int (*end_frame)(AVCodecContext *avctx);
-
-    /**
-     * Size of HW accelerator private data.
-     *
-     * Private data is allocated with av_mallocz() before
-     * AVCodecContext.get_buffer() and deallocated after
-     * AVCodecContext.release_buffer().
-     */
-    int priv_data_size;
-} AVHWAccel;
-
-/**
- * @defgroup lavc_picture AVPicture
- *
- * Functions for working with AVPicture
- * @{
- */
-
-/**
- * four components are given, that's all.
- * the last component is alpha
- */
-typedef struct AVPicture {
-    uint8_t *data[AV_NUM_DATA_POINTERS];
-    int linesize[AV_NUM_DATA_POINTERS];     ///< number of bytes per line
-} AVPicture;
-
-/**
- * @}
- */
-
-#define AVPALETTE_SIZE 1024
-#define AVPALETTE_COUNT 256
-
-enum AVSubtitleType {
-    SUBTITLE_NONE,
-
-    SUBTITLE_BITMAP,                ///< A bitmap, pict will be set
-
-    /**
-     * Plain text, the text field must be set by the decoder and is
-     * authoritative. ass and pict fields may contain approximations.
-     */
-    SUBTITLE_TEXT,
-
-    /**
-     * Formatted text, the ass field must be set by the decoder and is
-     * authoritative. pict and text fields may contain approximations.
-     */
-    SUBTITLE_ASS,
-};
-
-#define AV_SUBTITLE_FLAG_FORCED 0x00000001
-
-typedef struct AVSubtitleRect {
-    int x;         ///< top left corner  of pict, undefined when pict is not set
-    int y;         ///< top left corner  of pict, undefined when pict is not set
-    int w;         ///< width            of pict, undefined when pict is not set
-    int h;         ///< height           of pict, undefined when pict is not set
-    int nb_colors; ///< number of colors in pict, undefined when pict is not set
-
-    /**
-     * data+linesize for the bitmap of this subtitle.
-     * can be set for text/ass as well once they where rendered
-     */
-    AVPicture pict;
-    enum AVSubtitleType type;
-
-    char *text;                     ///< 0 terminated plain UTF-8 text
-
-    /**
-     * 0 terminated ASS/SSA compatible event line.
-     * The pressentation of this is unaffected by the other values in this
-     * struct.
-     */
-    char *ass;
-    int flags;
-} AVSubtitleRect;
-
-typedef struct AVSubtitle {
-    uint16_t format; /* 0 = graphics */
-    uint32_t start_display_time; /* relative to packet pts, in ms */
-    uint32_t end_display_time; /* relative to packet pts, in ms */
-    unsigned num_rects;
-    AVSubtitleRect **rects;
-    int64_t pts;    ///< Same as packet pts, in AV_TIME_BASE
-} AVSubtitle;
-
-/**
- * If c is NULL, returns the first registered codec,
- * if c is non-NULL, returns the next registered codec after c,
- * or NULL if c is the last one.
- */
-AVCodec *av_codec_next(const AVCodec *c);
-
-/**
- * Return the LIBAVCODEC_VERSION_INT constant.
- */
-unsigned avcodec_version(void);
-
-/**
- * Return the libavcodec build-time configuration.
- */
-const char *avcodec_configuration(void);
-
-/**
- * Return the libavcodec license.
- */
-const char *avcodec_license(void);
-
-/**
- * Register the codec codec and initialize libavcodec.
- *
- * @warning either this function or avcodec_register_all() must be called
- * before any other libavcodec functions.
- *
- * @see avcodec_register_all()
- */
-void avcodec_register(AVCodec *codec);
-
-/**
- * Register all the codecs, parsers and bitstream filters which were enabled at
- * configuration time. If you do not call this function you can select exactly
- * which formats you want to support, by using the individual registration
- * functions.
- *
- * @see avcodec_register
- * @see av_register_codec_parser
- * @see av_register_bitstream_filter
- */
-void avcodec_register_all(void);
-
-/**
- * Allocate an AVCodecContext and set its fields to default values.  The
- * resulting struct can be deallocated by calling avcodec_close() on it followed
- * by av_free().
- *
- * @param codec if non-NULL, allocate private data and initialize defaults
- *              for the given codec. It is illegal to then call avcodec_open2()
- *              with a different codec.
- *              If NULL, then the codec-specific defaults won't be initialized,
- *              which may result in suboptimal default settings (this is
- *              important mainly for encoders, e.g. libx264).
- *
- * @return An AVCodecContext filled with default values or NULL on failure.
- * @see avcodec_get_context_defaults
- */
-AVCodecContext *avcodec_alloc_context3(const AVCodec *codec);
-
-/**
- * Set the fields of the given AVCodecContext to default values corresponding
- * to the given codec (defaults may be codec-dependent).
- *
- * Do not call this function if a non-NULL codec has been passed
- * to avcodec_alloc_context3() that allocated this AVCodecContext.
- * If codec is non-NULL, it is illegal to call avcodec_open2() with a
- * different codec on this AVCodecContext.
- */
-int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec);
-
-/**
- * Get the AVClass for AVCodecContext. It can be used in combination with
- * AV_OPT_SEARCH_FAKE_OBJ for examining options.
- *
- * @see av_opt_find().
- */
-const AVClass *avcodec_get_class(void);
-
-/**
- * Copy the settings of the source AVCodecContext into the destination
- * AVCodecContext. The resulting destination codec context will be
- * unopened, i.e. you are required to call avcodec_open2() before you
- * can use this AVCodecContext to decode/encode video/audio data.
- *
- * @param dest target codec context, should be initialized with
- *             avcodec_alloc_context3(), but otherwise uninitialized
- * @param src source codec context
- * @return AVERROR() on error (e.g. memory allocation error), 0 on success
- */
-int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
-
-/**
- * Allocate an AVFrame and set its fields to default values.  The resulting
- * struct must be freed using avcodec_free_frame().
- *
- * @return An AVFrame filled with default values or NULL on failure.
- * @see avcodec_get_frame_defaults
- */
-AVFrame *avcodec_alloc_frame(void);
-
-/**
- * Set the fields of the given AVFrame to default values.
- *
- * @param frame The AVFrame of which the fields should be set to default values.
- */
-void avcodec_get_frame_defaults(AVFrame *frame);
-
-/**
- * Free the frame and any dynamically allocated objects in it,
- * e.g. extended_data.
- *
- * @param frame frame to be freed. The pointer will be set to NULL.
- *
- * @warning this function does NOT free the data buffers themselves
- * (it does not know how, since they might have been allocated with
- *  a custom get_buffer()).
- */
-void avcodec_free_frame(AVFrame **frame);
-
-/**
- * Initialize the AVCodecContext to use the given AVCodec. Prior to using this
- * function the context has to be allocated with avcodec_alloc_context3().
- *
- * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(),
- * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for
- * retrieving a codec.
- *
- * @warning This function is not thread safe!
- *
- * @code
- * avcodec_register_all();
- * av_dict_set(&opts, "b", "2.5M", 0);
- * codec = avcodec_find_decoder(AV_CODEC_ID_H264);
- * if (!codec)
- *     exit(1);
- *
- * context = avcodec_alloc_context3(codec);
- *
- * if (avcodec_open2(context, codec, opts) < 0)
- *     exit(1);
- * @endcode
- *
- * @param avctx The context to initialize.
- * @param codec The codec to open this context for. If a non-NULL codec has been
- *              previously passed to avcodec_alloc_context3() or
- *              avcodec_get_context_defaults3() for this context, then this
- *              parameter MUST be either NULL or equal to the previously passed
- *              codec.
- * @param options A dictionary filled with AVCodecContext and codec-private options.
- *                On return this object will be filled with options that were not found.
- *
- * @return zero on success, a negative value on error
- * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(),
- *      av_dict_set(), av_opt_find().
- */
-int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
-
-/**
- * Close a given AVCodecContext and free all the data associated with it
- * (but not the AVCodecContext itself).
- *
- * Calling this function on an AVCodecContext that hasn't been opened will free
- * the codec-specific data allocated in avcodec_alloc_context3() /
- * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will
- * do nothing.
- */
-int avcodec_close(AVCodecContext *avctx);
-
-/**
- * Free all allocated data in the given subtitle struct.
- *
- * @param sub AVSubtitle to free.
- */
-void avsubtitle_free(AVSubtitle *sub);
-
-/**
- * @}
- */
-
-/**
- * @addtogroup lavc_packet
- * @{
- */
-
-#if FF_API_DESTRUCT_PACKET
-/**
- * Default packet destructor.
- * @deprecated use the AVBuffer API instead
- */
-attribute_deprecated
-void av_destruct_packet(AVPacket *pkt);
-#endif
-
-/**
- * Initialize optional fields of a packet with default values.
- *
- * Note, this does not touch the data and size members, which have to be
- * initialized separately.
- *
- * @param pkt packet
- */
-void av_init_packet(AVPacket *pkt);
-
-/**
- * Allocate the payload of a packet and initialize its fields with
- * default values.
- *
- * @param pkt packet
- * @param size wanted payload size
- * @return 0 if OK, AVERROR_xxx otherwise
- */
-int av_new_packet(AVPacket *pkt, int size);
-
-/**
- * Reduce packet size, correctly zeroing padding
- *
- * @param pkt packet
- * @param size new size
- */
-void av_shrink_packet(AVPacket *pkt, int size);
-
-/**
- * Increase packet size, correctly zeroing padding
- *
- * @param pkt packet
- * @param grow_by number of bytes by which to increase the size of the packet
- */
-int av_grow_packet(AVPacket *pkt, int grow_by);
-
-/**
- * Initialize a reference-counted packet from av_malloc()ed data.
- *
- * @param pkt packet to be initialized. This function will set the data, size,
- *        buf and destruct fields, all others are left untouched.
- * @param data Data allocated by av_malloc() to be used as packet data. If this
- *        function returns successfully, the data is owned by the underlying AVBuffer.
- *        The caller may not access the data through other means.
- * @param size size of data in bytes, without the padding. I.e. the full buffer
- *        size is assumed to be size + FF_INPUT_BUFFER_PADDING_SIZE.
- *
- * @return 0 on success, a negative AVERROR on error
- */
-int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size);
-
-/**
- * @warning This is a hack - the packet memory allocation stuff is broken. The
- * packet is allocated if it was not really allocated.
- */
-int av_dup_packet(AVPacket *pkt);
-
-/**
- * Free a packet.
- *
- * @param pkt packet to free
- */
-void av_free_packet(AVPacket *pkt);
-
-/**
- * Allocate new information of a packet.
- *
- * @param pkt packet
- * @param type side information type
- * @param size side information size
- * @return pointer to fresh allocated data or NULL otherwise
- */
-uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
-                                 int size);
-
-/**
- * Shrink the already allocated side data buffer
- *
- * @param pkt packet
- * @param type side information type
- * @param size new side information size
- * @return 0 on success, < 0 on failure
- */
-int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
-                               int size);
-
-/**
- * Get side information from packet.
- *
- * @param pkt packet
- * @param type desired side information type
- * @param size pointer for side information size to store (optional)
- * @return pointer to data if present or NULL otherwise
- */
-uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
-                                 int *size);
-
-/**
- * Convenience function to free all the side data stored.
- * All the other fields stay untouched.
- *
- * @param pkt packet
- */
-void av_packet_free_side_data(AVPacket *pkt);
-
-/**
- * Setup a new reference to the data described by a given packet
- *
- * If src is reference-counted, setup dst as a new reference to the
- * buffer in src. Otherwise allocate a new buffer in dst and copy the
- * data from src into it.
- *
- * All the other fields are copied from src.
- *
- * @see av_packet_unref
- *
- * @param dst Destination packet
- * @param src Source packet
- *
- * @return 0 on success, a negative AVERROR on error.
- */
-int av_packet_ref(AVPacket *dst, AVPacket *src);
-
-/**
- * Wipe the packet.
- *
- * Unreference the buffer referenced by the packet and reset the
- * remaining packet fields to their default values.
- *
- * @param pkt The packet to be unreferenced.
- */
-void av_packet_unref(AVPacket *pkt);
-
-/**
- * Move every field in src to dst and reset src.
- *
- * @see av_packet_unref
- *
- * @param src Source packet, will be reset
- * @param dst Destination packet
- */
-void av_packet_move_ref(AVPacket *dst, AVPacket *src);
-
-/**
- * Copy only "properties" fields from src to dst.
- *
- * Properties for the purpose of this function are all the fields
- * beside those related to the packet data (buf, data, size)
- *
- * @param dst Destination packet
- * @param src Source packet
- *
- * @return 0 on success AVERROR on failure.
- *
- */
-int av_packet_copy_props(AVPacket *dst, const AVPacket *src);
-
-/**
- * @}
- */
-
-/**
- * @addtogroup lavc_decoding
- * @{
- */
-
-/**
- * Find a registered decoder with a matching codec ID.
- *
- * @param id AVCodecID of the requested decoder
- * @return A decoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_decoder(enum AVCodecID id);
-
-/**
- * Find a registered decoder with the specified name.
- *
- * @param name name of the requested decoder
- * @return A decoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_decoder_by_name(const char *name);
-
-#if FF_API_GET_BUFFER
-attribute_deprecated int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
-attribute_deprecated void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
-attribute_deprecated int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
-#endif
-
-/**
- * The default callback for AVCodecContext.get_buffer2(). It is made public so
- * it can be called by custom get_buffer2() implementations for decoders without
- * CODEC_CAP_DR1 set.
- */
-int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags);
-
-/**
- * Return the amount of padding in pixels which the get_buffer callback must
- * provide around the edge of the image for codecs which do not have the
- * CODEC_FLAG_EMU_EDGE flag.
- *
- * @return Required padding in pixels.
- */
-unsigned avcodec_get_edge_width(void);
-
-/**
- * Modify width and height values so that they will result in a memory
- * buffer that is acceptable for the codec if you do not use any horizontal
- * padding.
- *
- * May only be used if a codec with CODEC_CAP_DR1 has been opened.
- * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
- * according to avcodec_get_edge_width() before.
- */
-void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
-
-/**
- * Modify width and height values so that they will result in a memory
- * buffer that is acceptable for the codec if you also ensure that all
- * line sizes are a multiple of the respective linesize_align[i].
- *
- * May only be used if a codec with CODEC_CAP_DR1 has been opened.
- * If CODEC_FLAG_EMU_EDGE is not set, the dimensions must have been increased
- * according to avcodec_get_edge_width() before.
- */
-void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
-                               int linesize_align[AV_NUM_DATA_POINTERS]);
-
-/**
- * Decode the audio frame of size avpkt->size from avpkt->data into frame.
- *
- * Some decoders may support multiple frames in a single AVPacket. Such
- * decoders would then just decode the first frame. In this case,
- * avcodec_decode_audio4 has to be called again with an AVPacket containing
- * the remaining data in order to decode the second frame, etc...
- * Even if no frames are returned, the packet needs to be fed to the decoder
- * with remaining data until it is completely consumed or an error occurs.
- *
- * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE
- *          larger than the actual read bytes because some optimized bitstream
- *          readers read 32 or 64 bits at once and could read over the end.
- *
- * @note You might have to align the input buffer. The alignment requirements
- *       depend on the CPU and the decoder.
- *
- * @param      avctx the codec context
- * @param[out] frame The AVFrame in which to store decoded audio samples.
- *                   The decoder will allocate a buffer for the decoded frame by
- *                   calling the AVCodecContext.get_buffer2() callback.
- *                   When AVCodecContext.refcounted_frames is set to 1, the frame is
- *                   reference counted and the returned reference belongs to the
- *                   caller. The caller must release the frame using av_frame_unref()
- *                   when the frame is no longer needed. The caller may safely write
- *                   to the frame if av_frame_is_writable() returns 1.
- *                   When AVCodecContext.refcounted_frames is set to 0, the returned
- *                   reference belongs to the decoder and is valid only until the
- *                   next call to this function or until closing the decoder.
- *                   The caller may not write to it.
- * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is
- *                           non-zero.
- * @param[in]  avpkt The input AVPacket containing the input buffer.
- *                   At least avpkt->data and avpkt->size should be set. Some
- *                   decoders might also require additional fields to be set.
- * @return A negative error code is returned if an error occurred during
- *         decoding, otherwise the number of bytes consumed from the input
- *         AVPacket is returned.
- */
-int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
-                          int *got_frame_ptr, AVPacket *avpkt);
-
-/**
- * Decode the video frame of size avpkt->size from avpkt->data into picture.
- * Some decoders may support multiple frames in a single AVPacket, such
- * decoders would then just decode the first frame.
- *
- * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
- * the actual read bytes because some optimized bitstream readers read 32 or 64
- * bits at once and could read over the end.
- *
- * @warning The end of the input buffer buf should be set to 0 to ensure that
- * no overreading happens for damaged MPEG streams.
- *
- * @note You might have to align the input buffer avpkt->data.
- * The alignment requirements depend on the CPU: on some CPUs it isn't
- * necessary at all, on others it won't work at all if not aligned and on others
- * it will work but it will have an impact on performance.
- *
- * In practice, avpkt->data should have 4 byte alignment at minimum.
- *
- * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay
- * between input and output, these need to be fed with avpkt->data=NULL,
- * avpkt->size=0 at the end to return the remaining frames.
- *
- * @param avctx the codec context
- * @param[out] picture The AVFrame in which the decoded video frame will be stored.
- *             Use av_frame_alloc() to get an AVFrame. The codec will
- *             allocate memory for the actual bitmap by calling the
- *             AVCodecContext.get_buffer2() callback.
- *             When AVCodecContext.refcounted_frames is set to 1, the frame is
- *             reference counted and the returned reference belongs to the
- *             caller. The caller must release the frame using av_frame_unref()
- *             when the frame is no longer needed. The caller may safely write
- *             to the frame if av_frame_is_writable() returns 1.
- *             When AVCodecContext.refcounted_frames is set to 0, the returned
- *             reference belongs to the decoder and is valid only until the
- *             next call to this function or until closing the decoder. The
- *             caller may not write to it.
- *
- * @param[in] avpkt The input AVpacket containing the input buffer.
- *            You can create such packet with av_init_packet() and by then setting
- *            data and size, some decoders might in addition need other fields like
- *            flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least
- *            fields possible.
- * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
- * @return On error a negative value is returned, otherwise the number of bytes
- * used or zero if no frame could be decompressed.
- */
-int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
-                         int *got_picture_ptr,
-                         AVPacket *avpkt);
-
-/**
- * Decode a subtitle message.
- * Return a negative value on error, otherwise return the number of bytes used.
- * If no subtitle could be decompressed, got_sub_ptr is zero.
- * Otherwise, the subtitle is stored in *sub.
- * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for
- * simplicity, because the performance difference is expect to be negligible
- * and reusing a get_buffer written for video codecs would probably perform badly
- * due to a potentially very different allocation pattern.
- *
- * @param avctx the codec context
- * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be
-                   freed with avsubtitle_free if *got_sub_ptr is set.
- * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero.
- * @param[in] avpkt The input AVPacket containing the input buffer.
- */
-int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
-                            int *got_sub_ptr,
-                            AVPacket *avpkt);
-
-/**
- * @defgroup lavc_parsing Frame parsing
- * @{
- */
-
-enum AVPictureStructure {
-    AV_PICTURE_STRUCTURE_UNKNOWN,      //< unknown
-    AV_PICTURE_STRUCTURE_TOP_FIELD,    //< coded as top field
-    AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field
-    AV_PICTURE_STRUCTURE_FRAME,        //< coded as frame
-};
-
-typedef struct AVCodecParserContext {
-    void *priv_data;
-    struct AVCodecParser *parser;
-    int64_t frame_offset; /* offset of the current frame */
-    int64_t cur_offset; /* current offset
-                           (incremented by each av_parser_parse()) */
-    int64_t next_frame_offset; /* offset of the next frame */
-    /* video info */
-    int pict_type; /* XXX: Put it back in AVCodecContext. */
-    /**
-     * This field is used for proper frame duration computation in lavf.
-     * It signals, how much longer the frame duration of the current frame
-     * is compared to normal frame duration.
-     *
-     * frame_duration = (1 + repeat_pict) * time_base
-     *
-     * It is used by codecs like H.264 to display telecined material.
-     */
-    int repeat_pict; /* XXX: Put it back in AVCodecContext. */
-    int64_t pts;     /* pts of the current frame */
-    int64_t dts;     /* dts of the current frame */
-
-    /* private data */
-    int64_t last_pts;
-    int64_t last_dts;
-    int fetch_timestamp;
-
-#define AV_PARSER_PTS_NB 4
-    int cur_frame_start_index;
-    int64_t cur_frame_offset[AV_PARSER_PTS_NB];
-    int64_t cur_frame_pts[AV_PARSER_PTS_NB];
-    int64_t cur_frame_dts[AV_PARSER_PTS_NB];
-
-    int flags;
-#define PARSER_FLAG_COMPLETE_FRAMES           0x0001
-#define PARSER_FLAG_ONCE                      0x0002
-/// Set if the parser has a valid file offset
-#define PARSER_FLAG_FETCHED_OFFSET            0x0004
-
-    int64_t offset;      ///< byte offset from starting packet start
-    int64_t cur_frame_end[AV_PARSER_PTS_NB];
-
-    /**
-     * Set by parser to 1 for key frames and 0 for non-key frames.
-     * It is initialized to -1, so if the parser doesn't set this flag,
-     * old-style fallback using AV_PICTURE_TYPE_I picture type as key frames
-     * will be used.
-     */
-    int key_frame;
-
-    /**
-     * Time difference in stream time base units from the pts of this
-     * packet to the point at which the output from the decoder has converged
-     * independent from the availability of previous frames. That is, the
-     * frames are virtually identical no matter if decoding started from
-     * the very first frame or from this keyframe.
-     * Is AV_NOPTS_VALUE if unknown.
-     * This field is not the display duration of the current frame.
-     * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
-     * set.
-     *
-     * The purpose of this field is to allow seeking in streams that have no
-     * keyframes in the conventional sense. It corresponds to the
-     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
-     * essential for some types of subtitle streams to ensure that all
-     * subtitles are correctly displayed after seeking.
-     */
-    int64_t convergence_duration;
-
-    // Timestamp generation support:
-    /**
-     * Synchronization point for start of timestamp generation.
-     *
-     * Set to >0 for sync point, 0 for no sync point and <0 for undefined
-     * (default).
-     *
-     * For example, this corresponds to presence of H.264 buffering period
-     * SEI message.
-     */
-    int dts_sync_point;
-
-    /**
-     * Offset of the current timestamp against last timestamp sync point in
-     * units of AVCodecContext.time_base.
-     *
-     * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
-     * contain a valid timestamp offset.
-     *
-     * Note that the timestamp of sync point has usually a nonzero
-     * dts_ref_dts_delta, which refers to the previous sync point. Offset of
-     * the next frame after timestamp sync point will be usually 1.
-     *
-     * For example, this corresponds to H.264 cpb_removal_delay.
-     */
-    int dts_ref_dts_delta;
-
-    /**
-     * Presentation delay of current frame in units of AVCodecContext.time_base.
-     *
-     * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
-     * contain valid non-negative timestamp delta (presentation time of a frame
-     * must not lie in the past).
-     *
-     * This delay represents the difference between decoding and presentation
-     * time of the frame.
-     *
-     * For example, this corresponds to H.264 dpb_output_delay.
-     */
-    int pts_dts_delta;
-
-    /**
-     * Position of the packet in file.
-     *
-     * Analogous to cur_frame_pts/dts
-     */
-    int64_t cur_frame_pos[AV_PARSER_PTS_NB];
-
-    /**
-     * Byte position of currently parsed frame in stream.
-     */
-    int64_t pos;
-
-    /**
-     * Previous frame byte position.
-     */
-    int64_t last_pos;
-
-    /**
-     * Duration of the current frame.
-     * For audio, this is in units of 1 / AVCodecContext.sample_rate.
-     * For all other types, this is in units of AVCodecContext.time_base.
-     */
-    int duration;
-
-    enum AVFieldOrder field_order;
-
-    /**
-     * Indicate whether a picture is coded as a frame, top field or bottom field.
-     *
-     * For example, H.264 field_pic_flag equal to 0 corresponds to
-     * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag
-     * equal to 1 and bottom_field_flag equal to 0 corresponds to
-     * AV_PICTURE_STRUCTURE_TOP_FIELD.
-     */
-    enum AVPictureStructure picture_structure;
-
-    /**
-     * Picture number incremented in presentation or output order.
-     * This field may be reinitialized at the first picture of a new sequence.
-     *
-     * For example, this corresponds to H.264 PicOrderCnt.
-     */
-    int output_picture_number;
-} AVCodecParserContext;
-
-typedef struct AVCodecParser {
-    int codec_ids[5]; /* several codec IDs are permitted */
-    int priv_data_size;
-    int (*parser_init)(AVCodecParserContext *s);
-    int (*parser_parse)(AVCodecParserContext *s,
-                        AVCodecContext *avctx,
-                        const uint8_t **poutbuf, int *poutbuf_size,
-                        const uint8_t *buf, int buf_size);
-    void (*parser_close)(AVCodecParserContext *s);
-    int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
-    struct AVCodecParser *next;
-} AVCodecParser;
-
-AVCodecParser *av_parser_next(AVCodecParser *c);
-
-void av_register_codec_parser(AVCodecParser *parser);
-AVCodecParserContext *av_parser_init(int codec_id);
-
-/**
- * Parse a packet.
- *
- * @param s             parser context.
- * @param avctx         codec context.
- * @param poutbuf       set to pointer to parsed buffer or NULL if not yet finished.
- * @param poutbuf_size  set to size of parsed buffer or zero if not yet finished.
- * @param buf           input buffer.
- * @param buf_size      input length, to signal EOF, this should be 0 (so that the last frame can be output).
- * @param pts           input presentation timestamp.
- * @param dts           input decoding timestamp.
- * @param pos           input byte position in stream.
- * @return the number of bytes of the input bitstream used.
- *
- * Example:
- * @code
- *   while(in_len){
- *       len = av_parser_parse2(myparser, AVCodecContext, &data, &size,
- *                                        in_data, in_len,
- *                                        pts, dts, pos);
- *       in_data += len;
- *       in_len  -= len;
- *
- *       if(size)
- *          decode_frame(data, size);
- *   }
- * @endcode
- */
-int av_parser_parse2(AVCodecParserContext *s,
-                     AVCodecContext *avctx,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size,
-                     int64_t pts, int64_t dts,
-                     int64_t pos);
-
-/**
- * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed
- * @deprecated use AVBitstreamFilter
- */
-int av_parser_change(AVCodecParserContext *s,
-                     AVCodecContext *avctx,
-                     uint8_t **poutbuf, int *poutbuf_size,
-                     const uint8_t *buf, int buf_size, int keyframe);
-void av_parser_close(AVCodecParserContext *s);
-
-/**
- * @}
- * @}
- */
-
-/**
- * @addtogroup lavc_encoding
- * @{
- */
-
-/**
- * Find a registered encoder with a matching codec ID.
- *
- * @param id AVCodecID of the requested encoder
- * @return An encoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_encoder(enum AVCodecID id);
-
-/**
- * Find a registered encoder with the specified name.
- *
- * @param name name of the requested encoder
- * @return An encoder if one was found, NULL otherwise.
- */
-AVCodec *avcodec_find_encoder_by_name(const char *name);
-
-/**
- * Encode a frame of audio.
- *
- * Takes input samples from frame and writes the next output packet, if
- * available, to avpkt. The output packet does not necessarily contain data for
- * the most recent frame, as encoders can delay, split, and combine input frames
- * internally as needed.
- *
- * @param avctx     codec context
- * @param avpkt     output AVPacket.
- *                  The user can supply an output buffer by setting
- *                  avpkt->data and avpkt->size prior to calling the
- *                  function, but if the size of the user-provided data is not
- *                  large enough, encoding will fail. All other AVPacket fields
- *                  will be reset by the encoder using av_init_packet(). If
- *                  avpkt->data is NULL, the encoder will allocate it.
- *                  The encoder will set avpkt->size to the size of the
- *                  output packet.
- *
- *                  If this function fails or produces no output, avpkt will be
- *                  freed using av_free_packet() (i.e. avpkt->destruct will be
- *                  called to free the user supplied buffer).
- * @param[in] frame AVFrame containing the raw audio data to be encoded.
- *                  May be NULL when flushing an encoder that has the
- *                  CODEC_CAP_DELAY capability set.
- *                  If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame
- *                  can have any number of samples.
- *                  If it is not set, frame->nb_samples must be equal to
- *                  avctx->frame_size for all frames except the last.
- *                  The final frame may be smaller than avctx->frame_size.
- * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the
- *                            output packet is non-empty, and to 0 if it is
- *                            empty. If the function returns an error, the
- *                            packet can be assumed to be invalid, and the
- *                            value of got_packet_ptr is undefined and should
- *                            not be used.
- * @return          0 on success, negative error code on failure
- */
-int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
-                          const AVFrame *frame, int *got_packet_ptr);
-
-/**
- * Encode a frame of video.
- *
- * Takes input raw video data from frame and writes the next output packet, if
- * available, to avpkt. The output packet does not necessarily contain data for
- * the most recent frame, as encoders can delay and reorder input frames
- * internally as needed.
- *
- * @param avctx     codec context
- * @param avpkt     output AVPacket.
- *                  The user can supply an output buffer by setting
- *                  avpkt->data and avpkt->size prior to calling the
- *                  function, but if the size of the user-provided data is not
- *                  large enough, encoding will fail. All other AVPacket fields
- *                  will be reset by the encoder using av_init_packet(). If
- *                  avpkt->data is NULL, the encoder will allocate it.
- *                  The encoder will set avpkt->size to the size of the
- *                  output packet. The returned data (if any) belongs to the
- *                  caller, he is responsible for freeing it.
- *
- *                  If this function fails or produces no output, avpkt will be
- *                  freed using av_free_packet() (i.e. avpkt->destruct will be
- *                  called to free the user supplied buffer).
- * @param[in] frame AVFrame containing the raw video data to be encoded.
- *                  May be NULL when flushing an encoder that has the
- *                  CODEC_CAP_DELAY capability set.
- * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the
- *                            output packet is non-empty, and to 0 if it is
- *                            empty. If the function returns an error, the
- *                            packet can be assumed to be invalid, and the
- *                            value of got_packet_ptr is undefined and should
- *                            not be used.
- * @return          0 on success, negative error code on failure
- */
-int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
-                          const AVFrame *frame, int *got_packet_ptr);
-
-int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
-                            const AVSubtitle *sub);
-
-
-/**
- * @}
- */
-
-/**
- * @addtogroup lavc_picture
- * @{
- */
-
-/**
- * Allocate memory for a picture.  Call avpicture_free() to free it.
- *
- * @see avpicture_fill()
- *
- * @param picture the picture to be filled in
- * @param pix_fmt the format of the picture
- * @param width the width of the picture
- * @param height the height of the picture
- * @return zero if successful, a negative value if not
- */
-int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height);
-
-/**
- * Free a picture previously allocated by avpicture_alloc().
- * The data buffer used by the AVPicture is freed, but the AVPicture structure
- * itself is not.
- *
- * @param picture the AVPicture to be freed
- */
-void avpicture_free(AVPicture *picture);
-
-/**
- * Fill in the AVPicture fields.
- * The fields of the given AVPicture are filled in by using the 'ptr' address
- * which points to the image data buffer. Depending on the specified picture
- * format, one or multiple image data pointers and line sizes will be set.
- * If a planar format is specified, several pointers will be set pointing to
- * the different picture planes and the line sizes of the different planes
- * will be stored in the lines_sizes array.
- * Call with ptr == NULL to get the required size for the ptr buffer.
- *
- * To allocate the buffer and fill in the AVPicture fields in one call,
- * use avpicture_alloc().
- *
- * @param picture AVPicture whose fields are to be filled in
- * @param ptr Buffer which will contain or contains the actual image data
- * @param pix_fmt The format in which the picture data is stored.
- * @param width the width of the image in pixels
- * @param height the height of the image in pixels
- * @return size of the image data in bytes
- */
-int avpicture_fill(AVPicture *picture, uint8_t *ptr,
-                   enum AVPixelFormat pix_fmt, int width, int height);
-
-/**
- * Copy pixel data from an AVPicture into a buffer.
- * The data is stored compactly, without any gaps for alignment or padding
- * which may be applied by avpicture_fill().
- *
- * @see avpicture_get_size()
- *
- * @param[in] src AVPicture containing image data
- * @param[in] pix_fmt The format in which the picture data is stored.
- * @param[in] width the width of the image in pixels.
- * @param[in] height the height of the image in pixels.
- * @param[out] dest A buffer into which picture data will be copied.
- * @param[in] dest_size The size of 'dest'.
- * @return The number of bytes written to dest, or a negative value (error code) on error.
- */
-int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
-                     int width, int height,
-                     unsigned char *dest, int dest_size);
-
-/**
- * Calculate the size in bytes that a picture of the given width and height
- * would occupy if stored in the given picture format.
- * Note that this returns the size of a compact representation as generated
- * by avpicture_layout(), which can be smaller than the size required for e.g.
- * avpicture_fill().
- *
- * @param pix_fmt the given picture format
- * @param width the width of the image
- * @param height the height of the image
- * @return Image data size in bytes or -1 on error (e.g. too large dimensions).
- */
-int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
-
-#if FF_API_DEINTERLACE
-/**
- *  deinterlace - if not supported return -1
- *
- * @deprecated - use yadif (in libavfilter) instead
- */
-attribute_deprecated
-int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
-                          enum AVPixelFormat pix_fmt, int width, int height);
-#endif
-/**
- * Copy image src to dst. Wraps av_picture_data_copy() above.
- */
-void av_picture_copy(AVPicture *dst, const AVPicture *src,
-                     enum AVPixelFormat pix_fmt, int width, int height);
-
-/**
- * Crop image top and left side.
- */
-int av_picture_crop(AVPicture *dst, const AVPicture *src,
-                    enum AVPixelFormat pix_fmt, int top_band, int left_band);
-
-/**
- * Pad image.
- */
-int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
-            int padtop, int padbottom, int padleft, int padright, int *color);
-
-/**
- * @}
- */
-
-/**
- * @defgroup lavc_misc Utility functions
- * @ingroup libavc
- *
- * Miscellaneous utility functions related to both encoding and decoding
- * (or neither).
- * @{
- */
-
-/**
- * @defgroup lavc_misc_pixfmt Pixel formats
- *
- * Functions for working with pixel formats.
- * @{
- */
-
-/**
- * @deprecated Use av_pix_fmt_get_chroma_sub_sample
- */
-
-void attribute_deprecated avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift);
-
-/**
- * Return a value representing the fourCC code associated to the
- * pixel format pix_fmt, or 0 if no associated fourCC code can be
- * found.
- */
-unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt);
-
-#define FF_LOSS_RESOLUTION  0x0001 /**< loss due to resolution change */
-#define FF_LOSS_DEPTH       0x0002 /**< loss due to color depth change */
-#define FF_LOSS_COLORSPACE  0x0004 /**< loss due to color space conversion */
-#define FF_LOSS_ALPHA       0x0008 /**< loss of alpha bits */
-#define FF_LOSS_COLORQUANT  0x0010 /**< loss due to color quantization */
-#define FF_LOSS_CHROMA      0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
-
-/**
- * Compute what kind of losses will occur when converting from one specific
- * pixel format to another.
- * When converting from one pixel format to another, information loss may occur.
- * For example, when converting from RGB24 to GRAY, the color information will
- * be lost. Similarly, other losses occur when converting from some formats to
- * other formats. These losses can involve loss of chroma, but also loss of
- * resolution, loss of color depth, loss due to the color space conversion, loss
- * of the alpha bits or loss due to color quantization.
- * avcodec_get_fix_fmt_loss() informs you about the various types of losses
- * which will occur when converting from one pixel format to another.
- *
- * @param[in] dst_pix_fmt destination pixel format
- * @param[in] src_pix_fmt source pixel format
- * @param[in] has_alpha Whether the source pixel format alpha channel is used.
- * @return Combination of flags informing you what kind of losses will occur.
- */
-int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
-                             int has_alpha);
-
-/**
- * Find the best pixel format to convert to given a certain source pixel
- * format.  When converting from one pixel format to another, information loss
- * may occur.  For example, when converting from RGB24 to GRAY, the color
- * information will be lost. Similarly, other losses occur when converting from
- * some formats to other formats. avcodec_find_best_pix_fmt2() searches which of
- * the given pixel formats should be used to suffer the least amount of loss.
- * The pixel formats from which it chooses one, are determined by the
- * pix_fmt_list parameter.
- *
- *
- * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from
- * @param[in] src_pix_fmt source pixel format
- * @param[in] has_alpha Whether the source pixel format alpha channel is used.
- * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
- * @return The best pixel format to convert to or -1 if none was found.
- */
-enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
-                                              enum AVPixelFormat src_pix_fmt,
-                                              int has_alpha, int *loss_ptr);
-
-enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
-
-/**
- * @}
- */
-
-void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
-
-/**
- * Put a string representing the codec tag codec_tag in buf.
- *
- * @param buf_size size in bytes of buf
- * @return the length of the string that would have been generated if
- * enough space had been available, excluding the trailing null
- */
-size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag);
-
-void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
-
-/**
- * Return a name for the specified profile, if available.
- *
- * @param codec the codec that is searched for the given profile
- * @param profile the profile value for which a name is requested
- * @return A name for the profile if found, NULL otherwise.
- */
-const char *av_get_profile_name(const AVCodec *codec, int profile);
-
-int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
-int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
-//FIXME func typedef
-
-/**
- * Fill audio frame data and linesize.
- * AVFrame extended_data channel pointers are allocated if necessary for
- * planar audio.
- *
- * @param frame       the AVFrame
- *                    frame->nb_samples must be set prior to calling the
- *                    function. This function fills in frame->data,
- *                    frame->extended_data, frame->linesize[0].
- * @param nb_channels channel count
- * @param sample_fmt  sample format
- * @param buf         buffer to use for frame data
- * @param buf_size    size of buffer
- * @param align       plane size sample alignment (0 = default)
- * @return            0 on success, negative error code on failure
- */
-int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
-                             enum AVSampleFormat sample_fmt, const uint8_t *buf,
-                             int buf_size, int align);
-
-/**
- * Flush buffers, should be called when seeking or when switching to a different stream.
- */
-void avcodec_flush_buffers(AVCodecContext *avctx);
-
-/**
- * Return codec bits per sample.
- *
- * @param[in] codec_id the codec
- * @return Number of bits per sample or zero if unknown for the given codec.
- */
-int av_get_bits_per_sample(enum AVCodecID codec_id);
-
-/**
- * Return codec bits per sample.
- * Only return non-zero if the bits per sample is exactly correct, not an
- * approximation.
- *
- * @param[in] codec_id the codec
- * @return Number of bits per sample or zero if unknown for the given codec.
- */
-int av_get_exact_bits_per_sample(enum AVCodecID codec_id);
-
-/**
- * Return audio frame duration.
- *
- * @param avctx        codec context
- * @param frame_bytes  size of the frame, or 0 if unknown
- * @return             frame duration, in samples, if known. 0 if not able to
- *                     determine.
- */
-int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes);
-
-
-typedef struct AVBitStreamFilterContext {
-    void *priv_data;
-    struct AVBitStreamFilter *filter;
-    AVCodecParserContext *parser;
-    struct AVBitStreamFilterContext *next;
-} AVBitStreamFilterContext;
-
-
-typedef struct AVBitStreamFilter {
-    const char *name;
-    int priv_data_size;
-    int (*filter)(AVBitStreamFilterContext *bsfc,
-                  AVCodecContext *avctx, const char *args,
-                  uint8_t **poutbuf, int *poutbuf_size,
-                  const uint8_t *buf, int buf_size, int keyframe);
-    void (*close)(AVBitStreamFilterContext *bsfc);
-    struct AVBitStreamFilter *next;
-} AVBitStreamFilter;
-
-void av_register_bitstream_filter(AVBitStreamFilter *bsf);
-AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
-int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
-                               AVCodecContext *avctx, const char *args,
-                               uint8_t **poutbuf, int *poutbuf_size,
-                               const uint8_t *buf, int buf_size, int keyframe);
-void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
-
-AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
-
-/* memory */
-
-/**
- * Reallocate the given block if it is not large enough, otherwise do nothing.
- *
- * @see av_realloc
- */
-void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
-
-/**
- * Allocate a buffer, reusing the given one if large enough.
- *
- * Contrary to av_fast_realloc the current buffer contents might not be
- * preserved and on error the old buffer is freed, thus no special
- * handling to avoid memleaks is necessary.
- *
- * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer
- * @param size size of the buffer *ptr points to
- * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and
- *                 *size 0 if an error occurred.
- */
-void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
-
-/**
- * Allocate a buffer with padding, reusing the given one if large enough.
- *
- * Same behaviour av_fast_malloc but the buffer has additional
- * FF_INPUT_PADDING_SIZE at the end which will always memset to 0.
- *
- */
-void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size);
-
-/**
- * Encode extradata length to a buffer. Used by xiph codecs.
- *
- * @param s buffer to write to; must be at least (v/255+1) bytes long
- * @param v size of extradata in bytes
- * @return number of bytes written to the buffer.
- */
-unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
-
-#if FF_API_MISSING_SAMPLE
-/**
- * Log a generic warning message about a missing feature. This function is
- * intended to be used internally by Libav (libavcodec, libavformat, etc.)
- * only, and would normally not be used by applications.
- * @param[in] avc a pointer to an arbitrary struct of which the first field is
- * a pointer to an AVClass struct
- * @param[in] feature string containing the name of the missing feature
- * @param[in] want_sample indicates if samples are wanted which exhibit this feature.
- * If want_sample is non-zero, additional verbage will be added to the log
- * message which tells the user how to report samples to the development
- * mailing list.
- * @deprecated Use avpriv_report_missing_feature() instead.
- */
-attribute_deprecated
-void av_log_missing_feature(void *avc, const char *feature, int want_sample);
-
-/**
- * Log a generic warning message asking for a sample. This function is
- * intended to be used internally by Libav (libavcodec, libavformat, etc.)
- * only, and would normally not be used by applications.
- * @param[in] avc a pointer to an arbitrary struct of which the first field is
- * a pointer to an AVClass struct
- * @param[in] msg string containing an optional message, or NULL if no message
- * @deprecated Use avpriv_request_sample() instead.
- */
-attribute_deprecated
-void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3);
-#endif /* FF_API_MISSING_SAMPLE */
-
-/**
- * Register the hardware accelerator hwaccel.
- */
-void av_register_hwaccel(AVHWAccel *hwaccel);
-
-/**
- * If hwaccel is NULL, returns the first registered hardware accelerator,
- * if hwaccel is non-NULL, returns the next registered hardware accelerator
- * after hwaccel, or NULL if hwaccel is the last one.
- */
-AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
-
-
-/**
- * Lock operation used by lockmgr
- */
-enum AVLockOp {
-  AV_LOCK_CREATE,  ///< Create a mutex
-  AV_LOCK_OBTAIN,  ///< Lock the mutex
-  AV_LOCK_RELEASE, ///< Unlock the mutex
-  AV_LOCK_DESTROY, ///< Free mutex resources
-};
-
-/**
- * Register a user provided lock manager supporting the operations
- * specified by AVLockOp. mutex points to a (void *) where the
- * lockmgr should store/get a pointer to a user allocated mutex. It's
- * NULL upon AV_LOCK_CREATE and != NULL for all other ops.
- *
- * @param cb User defined callback. Note: Libav may invoke calls to this
- *           callback during the call to av_lockmgr_register().
- *           Thus, the application must be prepared to handle that.
- *           If cb is set to NULL the lockmgr will be unregistered.
- *           Also note that during unregistration the previously registered
- *           lockmgr callback may also be invoked.
- */
-int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
-
-/**
- * Get the type of the given codec.
- */
-enum AVMediaType avcodec_get_type(enum AVCodecID codec_id);
-
-/**
- * @return a positive value if s is open (i.e. avcodec_open2() was called on it
- * with no corresponding avcodec_close()), 0 otherwise.
- */
-int avcodec_is_open(AVCodecContext *s);
-
-/**
- * @return a non-zero number if codec is an encoder, zero otherwise
- */
-int av_codec_is_encoder(const AVCodec *codec);
-
-/**
- * @return a non-zero number if codec is a decoder, zero otherwise
- */
-int av_codec_is_decoder(const AVCodec *codec);
-
-/**
- * @return descriptor for given codec ID or NULL if no descriptor exists.
- */
-const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id);
-
-/**
- * Iterate over all codec descriptors known to libavcodec.
- *
- * @param prev previous descriptor. NULL to get the first descriptor.
- *
- * @return next descriptor or NULL after the last descriptor
- */
-const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev);
-
-/**
- * @return codec descriptor with the given name or NULL if no such descriptor
- *         exists.
- */
-const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name);
-
-/**
- * @}
- */
-
-#endif /* AVCODEC_AVCODEC_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/avfft.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/avfft.h
deleted file mode 100644
index b896182..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/avfft.h
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_AVFFT_H
-#define AVCODEC_AVFFT_H
-
-/**
- * @file
- * @ingroup lavc_fft
- * FFT functions
- */
-
-/**
- * @defgroup lavc_fft FFT functions
- * @ingroup lavc_misc
- *
- * @{
- */
-
-typedef float FFTSample;
-
-typedef struct FFTComplex {
-    FFTSample re, im;
-} FFTComplex;
-
-typedef struct FFTContext FFTContext;
-
-/**
- * Set up a complex FFT.
- * @param nbits           log2 of the length of the input array
- * @param inverse         if 0 perform the forward transform, if 1 perform the inverse
- */
-FFTContext *av_fft_init(int nbits, int inverse);
-
-/**
- * Do the permutation needed BEFORE calling ff_fft_calc().
- */
-void av_fft_permute(FFTContext *s, FFTComplex *z);
-
-/**
- * Do a complex FFT with the parameters defined in av_fft_init(). The
- * input data must be permuted before. No 1.0/sqrt(n) normalization is done.
- */
-void av_fft_calc(FFTContext *s, FFTComplex *z);
-
-void av_fft_end(FFTContext *s);
-
-FFTContext *av_mdct_init(int nbits, int inverse, double scale);
-void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
-void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);
-void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
-void av_mdct_end(FFTContext *s);
-
-/* Real Discrete Fourier Transform */
-
-enum RDFTransformType {
-    DFT_R2C,
-    IDFT_C2R,
-    IDFT_R2C,
-    DFT_C2R,
-};
-
-typedef struct RDFTContext RDFTContext;
-
-/**
- * Set up a real FFT.
- * @param nbits           log2 of the length of the input array
- * @param trans           the type of transform
- */
-RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
-void av_rdft_calc(RDFTContext *s, FFTSample *data);
-void av_rdft_end(RDFTContext *s);
-
-/* Discrete Cosine Transform */
-
-typedef struct DCTContext DCTContext;
-
-enum DCTTransformType {
-    DCT_II = 0,
-    DCT_III,
-    DCT_I,
-    DST_I,
-};
-
-/**
- * Set up DCT.
- * @param nbits           size of the input array:
- *                        (1 << nbits)     for DCT-II, DCT-III and DST-I
- *                        (1 << nbits) + 1 for DCT-I
- *
- * @note the first element of the input of DST-I is ignored
- */
-DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
-void av_dct_calc(DCTContext *s, FFTSample *data);
-void av_dct_end (DCTContext *s);
-
-/**
- * @}
- */
-
-#endif /* AVCODEC_AVFFT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vdpau.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vdpau.h
deleted file mode 100644
index 8bedea5..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vdpau.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * The Video Decode and Presentation API for UNIX (VDPAU) is used for
- * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1.
- *
- * Copyright (C) 2008 NVIDIA
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VDPAU_H
-#define AVCODEC_VDPAU_H
-
-/**
- * @file
- * @ingroup lavc_codec_hwaccel_vdpau
- * Public libavcodec VDPAU header.
- */
-
-
-/**
- * @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer
- * @ingroup lavc_codec_hwaccel
- *
- * VDPAU hardware acceleration has two modules
- * - VDPAU decoding
- * - VDPAU presentation
- *
- * The VDPAU decoding module parses all headers using Libav
- * parsing mechanisms and uses VDPAU for the actual decoding.
- *
- * As per the current implementation, the actual decoding
- * and rendering (API calls) are done as part of the VDPAU
- * presentation (vo_vdpau.c) module.
- *
- * @{
- */
-
-#include <vdpau/vdpau.h>
-#include <vdpau/vdpau_x11.h>
-
-#if FF_API_BUFS_VDPAU
-union AVVDPAUPictureInfo {
-    VdpPictureInfoH264        h264;
-    VdpPictureInfoMPEG1Or2    mpeg;
-    VdpPictureInfoVC1          vc1;
-    VdpPictureInfoMPEG4Part2 mpeg4;
-};
-#endif
-
-/**
- * This structure is used to share data between the libavcodec library and
- * the client video application.
- * The user shall zero-allocate the structure and make it available as
- * AVCodecContext.hwaccel_context. Members can be set by the user once
- * during initialization or through each AVCodecContext.get_buffer()
- * function call. In any case, they must be valid prior to calling
- * decoding functions.
- */
-typedef struct AVVDPAUContext {
-    /**
-     * VDPAU decoder handle
-     *
-     * Set by user.
-     */
-    VdpDecoder decoder;
-
-    /**
-     * VDPAU decoder render callback
-     *
-     * Set by the user.
-     */
-    VdpDecoderRender *render;
-
-#if FF_API_BUFS_VDPAU
-    /**
-     * VDPAU picture information
-     *
-     * Set by libavcodec.
-     */
-    attribute_deprecated
-    union AVVDPAUPictureInfo info;
-
-    /**
-     * Allocated size of the bitstream_buffers table.
-     *
-     * Set by libavcodec.
-     */
-    attribute_deprecated
-    int bitstream_buffers_allocated;
-
-    /**
-     * Useful bitstream buffers in the bitstream buffers table.
-     *
-     * Set by libavcodec.
-     */
-    attribute_deprecated
-    int bitstream_buffers_used;
-
-   /**
-     * Table of bitstream buffers.
-     * The user is responsible for freeing this buffer using av_freep().
-     *
-     * Set by libavcodec.
-     */
-    attribute_deprecated
-    VdpBitstreamBuffer *bitstream_buffers;
-#endif
-} AVVDPAUContext;
-
-#if FF_API_CAP_VDPAU
-/** @brief The videoSurface is used for rendering. */
-#define FF_VDPAU_STATE_USED_FOR_RENDER 1
-
-/**
- * @brief The videoSurface is needed for reference/prediction.
- * The codec manipulates this.
- */
-#define FF_VDPAU_STATE_USED_FOR_REFERENCE 2
-
-/**
- * @brief This structure is used as a callback between the Libav
- * decoder (vd_) and presentation (vo_) module.
- * This is used for defining a video frame containing surface,
- * picture parameter, bitstream information etc which are passed
- * between the Libav decoder and its clients.
- */
-struct vdpau_render_state {
-    VdpVideoSurface surface; ///< Used as rendered surface, never changed.
-
-    int state; ///< Holds FF_VDPAU_STATE_* values.
-
-    /** picture parameter information for all supported codecs */
-    union AVVDPAUPictureInfo info;
-
-    /** Describe size/location of the compressed video data.
-        Set to 0 when freeing bitstream_buffers. */
-    int bitstream_buffers_allocated;
-    int bitstream_buffers_used;
-    /** The user is responsible for freeing this buffer using av_freep(). */
-    VdpBitstreamBuffer *bitstream_buffers;
-};
-#endif
-
-/* @}*/
-
-#endif /* AVCODEC_VDPAU_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/version.h
deleted file mode 100644
index 1c6efe6..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/version.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_VERSION_H
-#define AVCODEC_VERSION_H
-
-/**
- * @file
- * @ingroup libavc
- * Libavcodec version macros.
- */
-
-#define LIBAVCODEC_VERSION_MAJOR 55
-#define LIBAVCODEC_VERSION_MINOR 17
-#define LIBAVCODEC_VERSION_MICRO  0
-
-#define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
-                                               LIBAVCODEC_VERSION_MINOR, \
-                                               LIBAVCODEC_VERSION_MICRO)
-#define LIBAVCODEC_VERSION      AV_VERSION(LIBAVCODEC_VERSION_MAJOR,    \
-                                           LIBAVCODEC_VERSION_MINOR,    \
-                                           LIBAVCODEC_VERSION_MICRO)
-#define LIBAVCODEC_BUILD        LIBAVCODEC_VERSION_INT
-
-#define LIBAVCODEC_IDENT        "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
-
-/**
- * FF_API_* defines may be placed below to indicate public API that will be
- * dropped at a future version bump. The defines themselves are not part of
- * the public API and may change, break or disappear at any time.
- */
-
-#ifndef FF_API_REQUEST_CHANNELS
-#define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_DEINTERLACE
-#define FF_API_DEINTERLACE       (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_DESTRUCT_PACKET
-#define FF_API_DESTRUCT_PACKET   (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_GET_BUFFER
-#define FF_API_GET_BUFFER        (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_MISSING_SAMPLE
-#define FF_API_MISSING_SAMPLE    (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_LOWRES
-#define FF_API_LOWRES            (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_CAP_VDPAU
-#define FF_API_CAP_VDPAU         (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_BUFS_VDPAU
-#define FF_API_BUFS_VDPAU        (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-#ifndef FF_API_VOXWARE
-#define FF_API_VOXWARE           (LIBAVCODEC_VERSION_MAJOR < 56)
-#endif
-
-#endif /* AVCODEC_VERSION_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/xvmc.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/xvmc.h
deleted file mode 100644
index 1f77e4e..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/xvmc.h
+++ /dev/null
@@ -1,168 +0,0 @@
-/*
- * Copyright (C) 2003 Ivan Kalvachev
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVCODEC_XVMC_H
-#define AVCODEC_XVMC_H
-
-/**
- * @file
- * @ingroup lavc_codec_hwaccel_xvmc
- * Public libavcodec XvMC header.
- */
-
-#include <X11/extensions/XvMC.h>
-
-#include "avcodec.h"
-
-/**
- * @defgroup lavc_codec_hwaccel_xvmc XvMC
- * @ingroup lavc_codec_hwaccel
- *
- * @{
- */
-
-#define AV_XVMC_ID                    0x1DC711C0  /**< special value to ensure that regular pixel routines haven't corrupted the struct
-                                                       the number is 1337 speak for the letters IDCT MCo (motion compensation) */
-
-struct xvmc_pix_fmt {
-    /** The field contains the special constant value AV_XVMC_ID.
-        It is used as a test that the application correctly uses the API,
-        and that there is no corruption caused by pixel routines.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             xvmc_id;
-
-    /** Pointer to the block array allocated by XvMCCreateBlocks().
-        The array has to be freed by XvMCDestroyBlocks().
-        Each group of 64 values represents one data block of differential
-        pixel information (in MoCo mode) or coefficients for IDCT.
-        - application - set the pointer during initialization
-        - libavcodec  - fills coefficients/pixel data into the array
-    */
-    short*          data_blocks;
-
-    /** Pointer to the macroblock description array allocated by
-        XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks().
-        - application - set the pointer during initialization
-        - libavcodec  - fills description data into the array
-    */
-    XvMCMacroBlock* mv_blocks;
-
-    /** Number of macroblock descriptions that can be stored in the mv_blocks
-        array.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             allocated_mv_blocks;
-
-    /** Number of blocks that can be stored at once in the data_blocks array.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             allocated_data_blocks;
-
-    /** Indicate that the hardware would interpret data_blocks as IDCT
-        coefficients and perform IDCT on them.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             idct;
-
-    /** In MoCo mode it indicates that intra macroblocks are assumed to be in
-        unsigned format; same as the XVMC_INTRA_UNSIGNED flag.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    int             unsigned_intra;
-
-    /** Pointer to the surface allocated by XvMCCreateSurface().
-        It has to be freed by XvMCDestroySurface() on application exit.
-        It identifies the frame and its state on the video hardware.
-        - application - set during initialization
-        - libavcodec  - unchanged
-    */
-    XvMCSurface*    p_surface;
-
-/** Set by the decoder before calling ff_draw_horiz_band(),
-    needed by the XvMCRenderSurface function. */
-//@{
-    /** Pointer to the surface used as past reference
-        - application - unchanged
-        - libavcodec  - set
-    */
-    XvMCSurface*    p_past_surface;
-
-    /** Pointer to the surface used as future reference
-        - application - unchanged
-        - libavcodec  - set
-    */
-    XvMCSurface*    p_future_surface;
-
-    /** top/bottom field or frame
-        - application - unchanged
-        - libavcodec  - set
-    */
-    unsigned int    picture_structure;
-
-    /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
-        - application - unchanged
-        - libavcodec  - set
-    */
-    unsigned int    flags;
-//}@
-
-    /** Number of macroblock descriptions in the mv_blocks array
-        that have already been passed to the hardware.
-        - application - zeroes it on get_buffer().
-                        A successful ff_draw_horiz_band() may increment it
-                        with filled_mb_block_num or zero both.
-        - libavcodec  - unchanged
-    */
-    int             start_mv_blocks_num;
-
-    /** Number of new macroblock descriptions in the mv_blocks array (after
-        start_mv_blocks_num) that are filled by libavcodec and have to be
-        passed to the hardware.
-        - application - zeroes it on get_buffer() or after successful
-                        ff_draw_horiz_band().
-        - libavcodec  - increment with one of each stored MB
-    */
-    int             filled_mv_blocks_num;
-
-    /** Number of the next free data block; one data block consists of
-        64 short values in the data_blocks array.
-        All blocks before this one have already been claimed by placing their
-        position into the corresponding block description structure field,
-        that are part of the mv_blocks array.
-        - application - zeroes it on get_buffer().
-                        A successful ff_draw_horiz_band() may zero it together
-                        with start_mb_blocks_num.
-        - libavcodec  - each decoded macroblock increases it by the number
-                        of coded blocks it contains.
-    */
-    int             next_free_data_block_num;
-};
-
-/**
- * @}
- */
-
-#endif /* AVCODEC_XVMC_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/avformat.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/avformat.h
deleted file mode 100644
index 1399de0..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/avformat.h
+++ /dev/null
@@ -1,1708 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_AVFORMAT_H
-#define AVFORMAT_AVFORMAT_H
-
-/**
- * @file
- * @ingroup libavf
- * Main libavformat public API header
- */
-
-/**
- * @defgroup libavf I/O and Muxing/Demuxing Library
- * @{
- *
- * Libavformat (lavf) is a library for dealing with various media container
- * formats. Its main two purposes are demuxing - i.e. splitting a media file
- * into component streams, and the reverse process of muxing - writing supplied
- * data in a specified container format. It also has an @ref lavf_io
- * "I/O module" which supports a number of protocols for accessing the data (e.g.
- * file, tcp, http and others). Before using lavf, you need to call
- * av_register_all() to register all compiled muxers, demuxers and protocols.
- * Unless you are absolutely sure you won't use libavformat's network
- * capabilities, you should also call avformat_network_init().
- *
- * A supported input format is described by an AVInputFormat struct, conversely
- * an output format is described by AVOutputFormat. You can iterate over all
- * registered input/output formats using the av_iformat_next() /
- * av_oformat_next() functions. The protocols layer is not part of the public
- * API, so you can only get the names of supported protocols with the
- * avio_enum_protocols() function.
- *
- * Main lavf structure used for both muxing and demuxing is AVFormatContext,
- * which exports all information about the file being read or written. As with
- * most Libav structures, its size is not part of public ABI, so it cannot be
- * allocated on stack or directly with av_malloc(). To create an
- * AVFormatContext, use avformat_alloc_context() (some functions, like
- * avformat_open_input() might do that for you).
- *
- * Most importantly an AVFormatContext contains:
- * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat
- * "output" format. It is either autodetected or set by user for input;
- * always set by user for output.
- * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all
- * elementary streams stored in the file. AVStreams are typically referred to
- * using their index in this array.
- * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or
- * set by user for input, always set by user for output (unless you are dealing
- * with an AVFMT_NOFILE format).
- *
- * @section lavf_options Passing options to (de)muxers
- * Lavf allows to configure muxers and demuxers using the @ref avoptions
- * mechanism. Generic (format-independent) libavformat options are provided by
- * AVFormatContext, they can be examined from a user program by calling
- * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass
- * from avformat_get_class()). Private (format-specific) options are provided by
- * AVFormatContext.priv_data if and only if AVInputFormat.priv_class /
- * AVOutputFormat.priv_class of the corresponding format struct is non-NULL.
- * Further options may be provided by the @ref AVFormatContext.pb "I/O context",
- * if its AVClass is non-NULL, and the protocols layer. See the discussion on
- * nesting in @ref avoptions documentation to learn how to access those.
- *
- * @defgroup lavf_decoding Demuxing
- * @{
- * Demuxers read a media file and split it into chunks of data (@em packets). A
- * @ref AVPacket "packet" contains one or more encoded frames which belongs to a
- * single elementary stream. In the lavf API this process is represented by the
- * avformat_open_input() function for opening a file, av_read_frame() for
- * reading a single packet and finally avformat_close_input(), which does the
- * cleanup.
- *
- * @section lavf_decoding_open Opening a media file
- * The minimum information required to open a file is its URL or filename, which
- * is passed to avformat_open_input(), as in the following code:
- * @code
- * const char    *url = "in.mp3";
- * AVFormatContext *s = NULL;
- * int ret = avformat_open_input(&s, url, NULL, NULL);
- * if (ret < 0)
- *     abort();
- * @endcode
- * The above code attempts to allocate an AVFormatContext, open the
- * specified file (autodetecting the format) and read the header, exporting the
- * information stored there into s. Some formats do not have a header or do not
- * store enough information there, so it is recommended that you call the
- * avformat_find_stream_info() function which tries to read and decode a few
- * frames to find missing information.
- *
- * In some cases you might want to preallocate an AVFormatContext yourself with
- * avformat_alloc_context() and do some tweaking on it before passing it to
- * avformat_open_input(). One such case is when you want to use custom functions
- * for reading input data instead of lavf internal I/O layer.
- * To do that, create your own AVIOContext with avio_alloc_context(), passing
- * your reading callbacks to it. Then set the @em pb field of your
- * AVFormatContext to newly created AVIOContext.
- *
- * Since the format of the opened file is in general not known until after
- * avformat_open_input() has returned, it is not possible to set demuxer private
- * options on a preallocated context. Instead, the options should be passed to
- * avformat_open_input() wrapped in an AVDictionary:
- * @code
- * AVDictionary *options = NULL;
- * av_dict_set(&options, "video_size", "640x480", 0);
- * av_dict_set(&options, "pixel_format", "rgb24", 0);
- *
- * if (avformat_open_input(&s, url, NULL, &options) < 0)
- *     abort();
- * av_dict_free(&options);
- * @endcode
- * This code passes the private options 'video_size' and 'pixel_format' to the
- * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it
- * cannot know how to interpret raw video data otherwise. If the format turns
- * out to be something different than raw video, those options will not be
- * recognized by the demuxer and therefore will not be applied. Such unrecognized
- * options are then returned in the options dictionary (recognized options are
- * consumed). The calling program can handle such unrecognized options as it
- * wishes, e.g.
- * @code
- * AVDictionaryEntry *e;
- * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) {
- *     fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key);
- *     abort();
- * }
- * @endcode
- *
- * After you have finished reading the file, you must close it with
- * avformat_close_input(). It will free everything associated with the file.
- *
- * @section lavf_decoding_read Reading from an opened file
- * Reading data from an opened AVFormatContext is done by repeatedly calling
- * av_read_frame() on it. Each call, if successful, will return an AVPacket
- * containing encoded data for one AVStream, identified by
- * AVPacket.stream_index. This packet may be passed straight into the libavcodec
- * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or
- * avcodec_decode_subtitle2() if the caller wishes to decode the data.
- *
- * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be
- * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for
- * pts/dts, 0 for duration) if the stream does not provide them. The timing
- * information will be in AVStream.time_base units, i.e. it has to be
- * multiplied by the timebase to convert them to seconds.
- *
- * If AVPacket.buf is set on the returned packet, then the packet is
- * allocated dynamically and the user may keep it indefinitely.
- * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a
- * static storage somewhere inside the demuxer and the packet is only valid
- * until the next av_read_frame() call or closing the file. If the caller
- * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy
- * of it.
- * In both cases, the packet must be freed with av_free_packet() when it is no
- * longer needed.
- *
- * @section lavf_decoding_seek Seeking
- * @}
- *
- * @defgroup lavf_encoding Muxing
- * @{
- * @}
- *
- * @defgroup lavf_io I/O Read/Write
- * @{
- * @}
- *
- * @defgroup lavf_codec Demuxers
- * @{
- * @defgroup lavf_codec_native Native Demuxers
- * @{
- * @}
- * @defgroup lavf_codec_wrappers External library wrappers
- * @{
- * @}
- * @}
- * @defgroup lavf_protos I/O Protocols
- * @{
- * @}
- * @defgroup lavf_internal Internal
- * @{
- * @}
- * @}
- *
- */
-
-#include <time.h>
-#include <stdio.h>  /* FILE */
-#include "libavcodec/avcodec.h"
-#include "libavutil/dict.h"
-#include "libavutil/log.h"
-
-#include "avio.h"
-#include "libavformat/version.h"
-
-struct AVFormatContext;
-
-
-/**
- * @defgroup metadata_api Public Metadata API
- * @{
- * @ingroup libavf
- * The metadata API allows libavformat to export metadata tags to a client
- * application when demuxing. Conversely it allows a client application to
- * set metadata when muxing.
- *
- * Metadata is exported or set as pairs of key/value strings in the 'metadata'
- * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs
- * using the @ref lavu_dict "AVDictionary" API. Like all strings in Libav,
- * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata
- * exported by demuxers isn't checked to be valid UTF-8 in most cases.
- *
- * Important concepts to keep in mind:
- * -  Keys are unique; there can never be 2 tags with the same key. This is
- *    also meant semantically, i.e., a demuxer should not knowingly produce
- *    several keys that are literally different but semantically identical.
- *    E.g., key=Author5, key=Author6. In this example, all authors must be
- *    placed in the same tag.
- * -  Metadata is flat, not hierarchical; there are no subtags. If you
- *    want to store, e.g., the email address of the child of producer Alice
- *    and actor Bob, that could have key=alice_and_bobs_childs_email_address.
- * -  Several modifiers can be applied to the tag name. This is done by
- *    appending a dash character ('-') and the modifier name in the order
- *    they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng.
- *    -  language -- a tag whose value is localized for a particular language
- *       is appended with the ISO 639-2/B 3-letter language code.
- *       For example: Author-ger=Michael, Author-eng=Mike
- *       The original/default language is in the unqualified "Author" tag.
- *       A demuxer should set a default if it sets any translated tag.
- *    -  sorting  -- a modified version of a tag that should be used for
- *       sorting will have '-sort' appended. E.g. artist="The Beatles",
- *       artist-sort="Beatles, The".
- *
- * -  Demuxers attempt to export metadata in a generic format, however tags
- *    with no generic equivalents are left as they are stored in the container.
- *    Follows a list of generic tag names:
- *
- @verbatim
- album        -- name of the set this work belongs to
- album_artist -- main creator of the set/album, if different from artist.
-                 e.g. "Various Artists" for compilation albums.
- artist       -- main creator of the work
- comment      -- any additional description of the file.
- composer     -- who composed the work, if different from artist.
- copyright    -- name of copyright holder.
- creation_time-- date when the file was created, preferably in ISO 8601.
- date         -- date when the work was created, preferably in ISO 8601.
- disc         -- number of a subset, e.g. disc in a multi-disc collection.
- encoder      -- name/settings of the software/hardware that produced the file.
- encoded_by   -- person/group who created the file.
- filename     -- original name of the file.
- genre        -- <self-evident>.
- language     -- main language in which the work is performed, preferably
-                 in ISO 639-2 format. Multiple languages can be specified by
-                 separating them with commas.
- performer    -- artist who performed the work, if different from artist.
-                 E.g for "Also sprach Zarathustra", artist would be "Richard
-                 Strauss" and performer "London Philharmonic Orchestra".
- publisher    -- name of the label/publisher.
- service_name     -- name of the service in broadcasting (channel name).
- service_provider -- name of the service provider in broadcasting.
- title        -- name of the work.
- track        -- number of this work in the set, can be in form current/total.
- variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of
- @endverbatim
- *
- * Look in the examples section for an application example how to use the Metadata API.
- *
- * @}
- */
-
-/* packet functions */
-
-
-/**
- * Allocate and read the payload of a packet and initialize its
- * fields with default values.
- *
- * @param pkt packet
- * @param size desired payload size
- * @return >0 (read size) if OK, AVERROR_xxx otherwise
- */
-int av_get_packet(AVIOContext *s, AVPacket *pkt, int size);
-
-
-/**
- * Read data and append it to the current content of the AVPacket.
- * If pkt->size is 0 this is identical to av_get_packet.
- * Note that this uses av_grow_packet and thus involves a realloc
- * which is inefficient. Thus this function should only be used
- * when there is no reasonable way to know (an upper bound of)
- * the final size.
- *
- * @param pkt packet
- * @param size amount of data to read
- * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data
- *         will not be lost even if an error occurs.
- */
-int av_append_packet(AVIOContext *s, AVPacket *pkt, int size);
-
-/*************************************************/
-/* fractional numbers for exact pts handling */
-
-/**
- * The exact value of the fractional number is: 'val + num / den'.
- * num is assumed to be 0 <= num < den.
- */
-typedef struct AVFrac {
-    int64_t val, num, den;
-} AVFrac;
-
-/*************************************************/
-/* input/output formats */
-
-struct AVCodecTag;
-
-/**
- * This structure contains the data a format has to probe a file.
- */
-typedef struct AVProbeData {
-    const char *filename;
-    unsigned char *buf; /**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. */
-    int buf_size;       /**< Size of buf except extra allocated bytes */
-} AVProbeData;
-
-#define AVPROBE_SCORE_EXTENSION  50 ///< score for file extension
-#define AVPROBE_SCORE_MAX       100 ///< maximum score
-
-#define AVPROBE_PADDING_SIZE 32             ///< extra allocated bytes at the end of the probe buffer
-
-/// Demuxer will use avio_open, no opened file should be provided by the caller.
-#define AVFMT_NOFILE        0x0001
-#define AVFMT_NEEDNUMBER    0x0002 /**< Needs '%d' in filename. */
-#define AVFMT_SHOW_IDS      0x0008 /**< Show format stream IDs numbers. */
-#define AVFMT_RAWPICTURE    0x0020 /**< Format wants AVPicture structure for
-                                      raw picture data. */
-#define AVFMT_GLOBALHEADER  0x0040 /**< Format wants global header. */
-#define AVFMT_NOTIMESTAMPS  0x0080 /**< Format does not need / have any timestamps. */
-#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */
-#define AVFMT_TS_DISCONT    0x0200 /**< Format allows timestamp discontinuities. Note, muxers always require valid (monotone) timestamps */
-#define AVFMT_VARIABLE_FPS  0x0400 /**< Format allows variable fps. */
-#define AVFMT_NODIMENSIONS  0x0800 /**< Format does not need width/height */
-#define AVFMT_NOSTREAMS     0x1000 /**< Format does not require any streams */
-#define AVFMT_NOBINSEARCH   0x2000 /**< Format does not allow to fall back on binary search via read_timestamp */
-#define AVFMT_NOGENSEARCH   0x4000 /**< Format does not allow to fall back on generic search */
-#define AVFMT_NO_BYTE_SEEK  0x8000 /**< Format does not allow seeking by bytes */
-#define AVFMT_ALLOW_FLUSH  0x10000 /**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. */
-#define AVFMT_TS_NONSTRICT 0x20000 /**< Format does not require strictly
-                                        increasing timestamps, but they must
-                                        still be monotonic */
-#define AVFMT_TS_NEGATIVE  0x40000 /**< Format allows muxing negative
-                                        timestamps. If not set the timestamp
-                                        will be shifted in av_write_frame and
-                                        av_interleaved_write_frame so they
-                                        start from 0. */
-
-/**
- * @addtogroup lavf_encoding
- * @{
- */
-typedef struct AVOutputFormat {
-    const char *name;
-    /**
-     * Descriptive name for the format, meant to be more human-readable
-     * than name. You should use the NULL_IF_CONFIG_SMALL() macro
-     * to define it.
-     */
-    const char *long_name;
-    const char *mime_type;
-    const char *extensions; /**< comma-separated filename extensions */
-    /* output support */
-    enum AVCodecID audio_codec;    /**< default audio codec */
-    enum AVCodecID video_codec;    /**< default video codec */
-    enum AVCodecID subtitle_codec; /**< default subtitle codec */
-    /**
-     * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE,
-     * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS,
-     * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH,
-     * AVFMT_TS_NONSTRICT
-     */
-    int flags;
-
-    /**
-     * List of supported codec_id-codec_tag pairs, ordered by "better
-     * choice first". The arrays are all terminated by AV_CODEC_ID_NONE.
-     */
-    const struct AVCodecTag * const *codec_tag;
-
-
-    const AVClass *priv_class; ///< AVClass for the private context
-
-    /*****************************************************************
-     * No fields below this line are part of the public API. They
-     * may not be used outside of libavformat and can be changed and
-     * removed at will.
-     * New public fields should be added right above.
-     *****************************************************************
-     */
-    struct AVOutputFormat *next;
-    /**
-     * size of private data so that it can be allocated in the wrapper
-     */
-    int priv_data_size;
-
-    int (*write_header)(struct AVFormatContext *);
-    /**
-     * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
-     * pkt can be NULL in order to flush data buffered in the muxer.
-     * When flushing, return 0 if there still is more data to flush,
-     * or 1 if everything was flushed and there is no more buffered
-     * data.
-     */
-    int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
-    int (*write_trailer)(struct AVFormatContext *);
-    /**
-     * Currently only used to set pixel format if not YUV420P.
-     */
-    int (*interleave_packet)(struct AVFormatContext *, AVPacket *out,
-                             AVPacket *in, int flush);
-    /**
-     * Test if the given codec can be stored in this container.
-     *
-     * @return 1 if the codec is supported, 0 if it is not.
-     *         A negative number if unknown.
-     */
-    int (*query_codec)(enum AVCodecID id, int std_compliance);
-} AVOutputFormat;
-/**
- * @}
- */
-
-/**
- * @addtogroup lavf_decoding
- * @{
- */
-typedef struct AVInputFormat {
-    /**
-     * A comma separated list of short names for the format. New names
-     * may be appended with a minor bump.
-     */
-    const char *name;
-
-    /**
-     * Descriptive name for the format, meant to be more human-readable
-     * than name. You should use the NULL_IF_CONFIG_SMALL() macro
-     * to define it.
-     */
-    const char *long_name;
-
-    /**
-     * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS,
-     * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH,
-     * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK.
-     */
-    int flags;
-
-    /**
-     * If extensions are defined, then no probe is done. You should
-     * usually not use extension format guessing because it is not
-     * reliable enough
-     */
-    const char *extensions;
-
-    const struct AVCodecTag * const *codec_tag;
-
-    const AVClass *priv_class; ///< AVClass for the private context
-
-    /*****************************************************************
-     * No fields below this line are part of the public API. They
-     * may not be used outside of libavformat and can be changed and
-     * removed at will.
-     * New public fields should be added right above.
-     *****************************************************************
-     */
-    struct AVInputFormat *next;
-
-    /**
-     * Raw demuxers store their codec ID here.
-     */
-    int raw_codec_id;
-
-    /**
-     * Size of private data so that it can be allocated in the wrapper.
-     */
-    int priv_data_size;
-
-    /**
-     * Tell if a given file has a chance of being parsed as this format.
-     * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes
-     * big so you do not have to check for that unless you need more.
-     */
-    int (*read_probe)(AVProbeData *);
-
-    /**
-     * Read the format header and initialize the AVFormatContext
-     * structure. Return 0 if OK. Only used in raw format right
-     * now. 'avformat_new_stream' should be called to create new streams.
-     */
-    int (*read_header)(struct AVFormatContext *);
-
-    /**
-     * Read one packet and put it in 'pkt'. pts and flags are also
-     * set. 'avformat_new_stream' can be called only if the flag
-     * AVFMTCTX_NOHEADER is used and only in the calling thread (not in a
-     * background thread).
-     * @return 0 on success, < 0 on error.
-     *         When returning an error, pkt must not have been allocated
-     *         or must be freed before returning
-     */
-    int (*read_packet)(struct AVFormatContext *, AVPacket *pkt);
-
-    /**
-     * Close the stream. The AVFormatContext and AVStreams are not
-     * freed by this function
-     */
-    int (*read_close)(struct AVFormatContext *);
-
-    /**
-     * Seek to a given timestamp relative to the frames in
-     * stream component stream_index.
-     * @param stream_index Must not be -1.
-     * @param flags Selects which direction should be preferred if no exact
-     *              match is available.
-     * @return >= 0 on success (but not necessarily the new offset)
-     */
-    int (*read_seek)(struct AVFormatContext *,
-                     int stream_index, int64_t timestamp, int flags);
-
-    /**
-     * Get the next timestamp in stream[stream_index].time_base units.
-     * @return the timestamp or AV_NOPTS_VALUE if an error occurred
-     */
-    int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index,
-                              int64_t *pos, int64_t pos_limit);
-
-    /**
-     * Start/resume playing - only meaningful if using a network-based format
-     * (RTSP).
-     */
-    int (*read_play)(struct AVFormatContext *);
-
-    /**
-     * Pause playing - only meaningful if using a network-based format
-     * (RTSP).
-     */
-    int (*read_pause)(struct AVFormatContext *);
-
-    /**
-     * Seek to timestamp ts.
-     * Seeking will be done so that the point from which all active streams
-     * can be presented successfully will be closest to ts and within min/max_ts.
-     * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
-     */
-    int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
-} AVInputFormat;
-/**
- * @}
- */
-
-enum AVStreamParseType {
-    AVSTREAM_PARSE_NONE,
-    AVSTREAM_PARSE_FULL,       /**< full parsing and repack */
-    AVSTREAM_PARSE_HEADERS,    /**< Only parse headers, do not repack. */
-    AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on a packet boundary */
-    AVSTREAM_PARSE_FULL_ONCE,  /**< full parsing and repack of the first frame only, only implemented for H.264 currently */
-};
-
-typedef struct AVIndexEntry {
-    int64_t pos;
-    int64_t timestamp;
-#define AVINDEX_KEYFRAME 0x0001
-    int flags:2;
-    int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment).
-    int min_distance;         /**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. */
-} AVIndexEntry;
-
-#define AV_DISPOSITION_DEFAULT   0x0001
-#define AV_DISPOSITION_DUB       0x0002
-#define AV_DISPOSITION_ORIGINAL  0x0004
-#define AV_DISPOSITION_COMMENT   0x0008
-#define AV_DISPOSITION_LYRICS    0x0010
-#define AV_DISPOSITION_KARAOKE   0x0020
-
-/**
- * Track should be used during playback by default.
- * Useful for subtitle track that should be displayed
- * even when user did not explicitly ask for subtitles.
- */
-#define AV_DISPOSITION_FORCED    0x0040
-#define AV_DISPOSITION_HEARING_IMPAIRED  0x0080  /**< stream for hearing impaired audiences */
-#define AV_DISPOSITION_VISUAL_IMPAIRED   0x0100  /**< stream for visual impaired audiences */
-#define AV_DISPOSITION_CLEAN_EFFECTS     0x0200  /**< stream without voice */
-/**
- * The stream is stored in the file as an attached picture/"cover art" (e.g.
- * APIC frame in ID3v2). The single packet associated with it will be returned
- * among the first few packets read from the file unless seeking takes place.
- * It can also be accessed at any time in AVStream.attached_pic.
- */
-#define AV_DISPOSITION_ATTACHED_PIC      0x0400
-
-/**
- * Stream structure.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVStream) must not be used outside libav*.
- */
-typedef struct AVStream {
-    int index;    /**< stream index in AVFormatContext */
-    /**
-     * Format-specific stream ID.
-     * decoding: set by libavformat
-     * encoding: set by the user, replaced by libavformat if left unset
-     */
-    int id;
-    /**
-     * Codec context associated with this stream. Allocated and freed by
-     * libavformat.
-     *
-     * - decoding: The demuxer exports codec information stored in the headers
-     *             here.
-     * - encoding: The user sets codec information, the muxer writes it to the
-     *             output. Mandatory fields as specified in AVCodecContext
-     *             documentation must be set even if this AVCodecContext is
-     *             not actually used for encoding.
-     */
-    AVCodecContext *codec;
-    void *priv_data;
-
-    /**
-     * encoding: pts generation when outputting stream
-     */
-    struct AVFrac pts;
-
-    /**
-     * This is the fundamental unit of time (in seconds) in terms
-     * of which frame timestamps are represented.
-     *
-     * decoding: set by libavformat
-     * encoding: set by libavformat in avformat_write_header. The muxer may use the
-     * user-provided value of @ref AVCodecContext.time_base "codec->time_base"
-     * as a hint.
-     */
-    AVRational time_base;
-
-    /**
-     * Decoding: pts of the first frame of the stream, in stream time base.
-     * Only set this if you are absolutely 100% sure that the value you set
-     * it to really is the pts of the first frame.
-     * This may be undefined (AV_NOPTS_VALUE).
-     */
-    int64_t start_time;
-
-    /**
-     * Decoding: duration of the stream, in stream time base.
-     * If a source file does not specify a duration, but does specify
-     * a bitrate, this value will be estimated from bitrate and file size.
-     */
-    int64_t duration;
-
-    int64_t nb_frames;                 ///< number of frames in this stream if known or 0
-
-    int disposition; /**< AV_DISPOSITION_* bit field */
-
-    enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed.
-
-    /**
-     * sample aspect ratio (0 if unknown)
-     * - encoding: Set by user.
-     * - decoding: Set by libavformat.
-     */
-    AVRational sample_aspect_ratio;
-
-    AVDictionary *metadata;
-
-    /**
-     * Average framerate
-     */
-    AVRational avg_frame_rate;
-
-    /**
-     * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet
-     * will contain the attached picture.
-     *
-     * decoding: set by libavformat, must not be modified by the caller.
-     * encoding: unused
-     */
-    AVPacket attached_pic;
-
-    /*****************************************************************
-     * All fields below this line are not part of the public API. They
-     * may not be used outside of libavformat and can be changed and
-     * removed at will.
-     * New public fields should be added right above.
-     *****************************************************************
-     */
-
-    /**
-     * Stream information used internally by av_find_stream_info()
-     */
-#define MAX_STD_TIMEBASES (60*12+5)
-    struct {
-        int nb_decoded_frames;
-        int found_decoder;
-
-        /**
-         * Those are used for average framerate estimation.
-         */
-        int64_t fps_first_dts;
-        int     fps_first_dts_idx;
-        int64_t fps_last_dts;
-        int     fps_last_dts_idx;
-
-    } *info;
-
-    int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */
-
-    // Timestamp generation support:
-    /**
-     * Timestamp corresponding to the last dts sync point.
-     *
-     * Initialized when AVCodecParserContext.dts_sync_point >= 0 and
-     * a DTS is received from the underlying container. Otherwise set to
-     * AV_NOPTS_VALUE by default.
-     */
-    int64_t reference_dts;
-    int64_t first_dts;
-    int64_t cur_dts;
-    int64_t last_IP_pts;
-    int last_IP_duration;
-
-    /**
-     * Number of packets to buffer for codec probing
-     */
-#define MAX_PROBE_PACKETS 2500
-    int probe_packets;
-
-    /**
-     * Number of frames that have been demuxed during av_find_stream_info()
-     */
-    int codec_info_nb_frames;
-
-    /* av_read_frame() support */
-    enum AVStreamParseType need_parsing;
-    struct AVCodecParserContext *parser;
-
-    /**
-     * last packet in packet_buffer for this stream when muxing.
-     */
-    struct AVPacketList *last_in_packet_buffer;
-    AVProbeData probe_data;
-#define MAX_REORDER_DELAY 16
-    int64_t pts_buffer[MAX_REORDER_DELAY+1];
-
-    AVIndexEntry *index_entries; /**< Only used if the format does not
-                                    support seeking natively. */
-    int nb_index_entries;
-    unsigned int index_entries_allocated_size;
-} AVStream;
-
-#define AV_PROGRAM_RUNNING 1
-
-/**
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVProgram) must not be used outside libav*.
- */
-typedef struct AVProgram {
-    int            id;
-    int            flags;
-    enum AVDiscard discard;        ///< selects which program to discard and which to feed to the caller
-    unsigned int   *stream_index;
-    unsigned int   nb_stream_indexes;
-    AVDictionary *metadata;
-} AVProgram;
-
-#define AVFMTCTX_NOHEADER      0x0001 /**< signal that no header is present
-                                         (streams are added dynamically) */
-
-typedef struct AVChapter {
-    int id;                 ///< unique ID to identify the chapter
-    AVRational time_base;   ///< time base in which the start/end timestamps are specified
-    int64_t start, end;     ///< chapter start/end time in time_base units
-    AVDictionary *metadata;
-} AVChapter;
-
-/**
- * Format I/O context.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVFormatContext) must not be used outside libav*, use
- * avformat_alloc_context() to create an AVFormatContext.
- */
-typedef struct AVFormatContext {
-    /**
-     * A class for logging and AVOptions. Set by avformat_alloc_context().
-     * Exports (de)muxer private options if they exist.
-     */
-    const AVClass *av_class;
-
-    /**
-     * Can only be iformat or oformat, not both at the same time.
-     *
-     * decoding: set by avformat_open_input().
-     * encoding: set by the user.
-     */
-    struct AVInputFormat *iformat;
-    struct AVOutputFormat *oformat;
-
-    /**
-     * Format private data. This is an AVOptions-enabled struct
-     * if and only if iformat/oformat.priv_class is not NULL.
-     */
-    void *priv_data;
-
-    /**
-     * I/O context.
-     *
-     * decoding: either set by the user before avformat_open_input() (then
-     * the user must close it manually) or set by avformat_open_input().
-     * encoding: set by the user.
-     *
-     * Do NOT set this field if AVFMT_NOFILE flag is set in
-     * iformat/oformat.flags. In such a case, the (de)muxer will handle
-     * I/O in some other way and this field will be NULL.
-     */
-    AVIOContext *pb;
-
-    /* stream info */
-    int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
-
-    /**
-     * A list of all streams in the file. New streams are created with
-     * avformat_new_stream().
-     *
-     * decoding: streams are created by libavformat in avformat_open_input().
-     * If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also
-     * appear in av_read_frame().
-     * encoding: streams are created by the user before avformat_write_header().
-     */
-    unsigned int nb_streams;
-    AVStream **streams;
-
-    char filename[1024]; /**< input or output filename */
-
-    /**
-     * Decoding: position of the first frame of the component, in
-     * AV_TIME_BASE fractional seconds. NEVER set this value directly:
-     * It is deduced from the AVStream values.
-     */
-    int64_t start_time;
-
-    /**
-     * Decoding: duration of the stream, in AV_TIME_BASE fractional
-     * seconds. Only set this value if you know none of the individual stream
-     * durations and also do not set any of them. This is deduced from the
-     * AVStream values if not set.
-     */
-    int64_t duration;
-
-    /**
-     * Decoding: total stream bitrate in bit/s, 0 if not
-     * available. Never set it directly if the file_size and the
-     * duration are known as Libav can compute it automatically.
-     */
-    int bit_rate;
-
-    unsigned int packet_size;
-    int max_delay;
-
-    int flags;
-#define AVFMT_FLAG_GENPTS       0x0001 ///< Generate missing pts even if it requires parsing future frames.
-#define AVFMT_FLAG_IGNIDX       0x0002 ///< Ignore index.
-#define AVFMT_FLAG_NONBLOCK     0x0004 ///< Do not block when reading packets from input.
-#define AVFMT_FLAG_IGNDTS       0x0008 ///< Ignore DTS on frames that contain both DTS & PTS
-#define AVFMT_FLAG_NOFILLIN     0x0010 ///< Do not infer any values from other values, just return what is stored in the container
-#define AVFMT_FLAG_NOPARSE      0x0020 ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled
-#define AVFMT_FLAG_NOBUFFER     0x0040 ///< Do not buffer frames when possible
-#define AVFMT_FLAG_CUSTOM_IO    0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it.
-#define AVFMT_FLAG_DISCARD_CORRUPT  0x0100 ///< Discard frames marked corrupted
-
-    /**
-     * decoding: size of data to probe; encoding: unused.
-     */
-    unsigned int probesize;
-
-    /**
-     * decoding: maximum time (in AV_TIME_BASE units) during which the input should
-     * be analyzed in avformat_find_stream_info().
-     */
-    int max_analyze_duration;
-
-    const uint8_t *key;
-    int keylen;
-
-    unsigned int nb_programs;
-    AVProgram **programs;
-
-    /**
-     * Forced video codec_id.
-     * Demuxing: Set by user.
-     */
-    enum AVCodecID video_codec_id;
-
-    /**
-     * Forced audio codec_id.
-     * Demuxing: Set by user.
-     */
-    enum AVCodecID audio_codec_id;
-
-    /**
-     * Forced subtitle codec_id.
-     * Demuxing: Set by user.
-     */
-    enum AVCodecID subtitle_codec_id;
-
-    /**
-     * Maximum amount of memory in bytes to use for the index of each stream.
-     * If the index exceeds this size, entries will be discarded as
-     * needed to maintain a smaller size. This can lead to slower or less
-     * accurate seeking (depends on demuxer).
-     * Demuxers for which a full in-memory index is mandatory will ignore
-     * this.
-     * muxing  : unused
-     * demuxing: set by user
-     */
-    unsigned int max_index_size;
-
-    /**
-     * Maximum amount of memory in bytes to use for buffering frames
-     * obtained from realtime capture devices.
-     */
-    unsigned int max_picture_buffer;
-
-    unsigned int nb_chapters;
-    AVChapter **chapters;
-
-    AVDictionary *metadata;
-
-    /**
-     * Start time of the stream in real world time, in microseconds
-     * since the unix epoch (00:00 1st January 1970). That is, pts=0
-     * in the stream was captured at this real world time.
-     * - encoding: Set by user.
-     * - decoding: Unused.
-     */
-    int64_t start_time_realtime;
-
-    /**
-     * decoding: number of frames used to probe fps
-     */
-    int fps_probe_size;
-
-    /**
-     * Error recognition; higher values will detect more errors but may
-     * misdetect some more or less valid parts as errors.
-     * - encoding: unused
-     * - decoding: Set by user.
-     */
-    int error_recognition;
-
-    /**
-     * Custom interrupt callbacks for the I/O layer.
-     *
-     * decoding: set by the user before avformat_open_input().
-     * encoding: set by the user before avformat_write_header()
-     * (mainly useful for AVFMT_NOFILE formats). The callback
-     * should also be passed to avio_open2() if it's used to
-     * open the file.
-     */
-    AVIOInterruptCB interrupt_callback;
-
-    /**
-     * Flags to enable debugging.
-     */
-    int debug;
-#define FF_FDEBUG_TS        0x0001
-    /*****************************************************************
-     * All fields below this line are not part of the public API. They
-     * may not be used outside of libavformat and can be changed and
-     * removed at will.
-     * New public fields should be added right above.
-     *****************************************************************
-     */
-
-    /**
-     * This buffer is only needed when packets were already buffered but
-     * not decoded, for example to get the codec parameters in MPEG
-     * streams.
-     */
-    struct AVPacketList *packet_buffer;
-    struct AVPacketList *packet_buffer_end;
-
-    /* av_seek_frame() support */
-    int64_t data_offset; /**< offset of the first packet */
-
-    /**
-     * Raw packets from the demuxer, prior to parsing and decoding.
-     * This buffer is used for buffering packets until the codec can
-     * be identified, as parsing cannot be done without knowing the
-     * codec.
-     */
-    struct AVPacketList *raw_packet_buffer;
-    struct AVPacketList *raw_packet_buffer_end;
-    /**
-     * Packets split by the parser get queued here.
-     */
-    struct AVPacketList *parse_queue;
-    struct AVPacketList *parse_queue_end;
-    /**
-     * Remaining size available for raw_packet_buffer, in bytes.
-     */
-#define RAW_PACKET_BUFFER_SIZE 2500000
-    int raw_packet_buffer_remaining_size;
-
-    /**
-     * Offset to remap timestamps to be non-negative.
-     * Expressed in timebase units.
-     */
-    int64_t offset;
-
-    /**
-     * Timebase for the timestamp offset.
-     */
-    AVRational offset_timebase;
-
-} AVFormatContext;
-
-typedef struct AVPacketList {
-    AVPacket pkt;
-    struct AVPacketList *next;
-} AVPacketList;
-
-
-/**
- * @defgroup lavf_core Core functions
- * @ingroup libavf
- *
- * Functions for querying libavformat capabilities, allocating core structures,
- * etc.
- * @{
- */
-
-/**
- * Return the LIBAVFORMAT_VERSION_INT constant.
- */
-unsigned avformat_version(void);
-
-/**
- * Return the libavformat build-time configuration.
- */
-const char *avformat_configuration(void);
-
-/**
- * Return the libavformat license.
- */
-const char *avformat_license(void);
-
-/**
- * Initialize libavformat and register all the muxers, demuxers and
- * protocols. If you do not call this function, then you can select
- * exactly which formats you want to support.
- *
- * @see av_register_input_format()
- * @see av_register_output_format()
- * @see av_register_protocol()
- */
-void av_register_all(void);
-
-void av_register_input_format(AVInputFormat *format);
-void av_register_output_format(AVOutputFormat *format);
-
-/**
- * Do global initialization of network components. This is optional,
- * but recommended, since it avoids the overhead of implicitly
- * doing the setup for each session.
- *
- * Calling this function will become mandatory if using network
- * protocols at some major version bump.
- */
-int avformat_network_init(void);
-
-/**
- * Undo the initialization done by avformat_network_init.
- */
-int avformat_network_deinit(void);
-
-/**
- * If f is NULL, returns the first registered input format,
- * if f is non-NULL, returns the next registered input format after f
- * or NULL if f is the last one.
- */
-AVInputFormat  *av_iformat_next(AVInputFormat  *f);
-
-/**
- * If f is NULL, returns the first registered output format,
- * if f is non-NULL, returns the next registered output format after f
- * or NULL if f is the last one.
- */
-AVOutputFormat *av_oformat_next(AVOutputFormat *f);
-
-/**
- * Allocate an AVFormatContext.
- * avformat_free_context() can be used to free the context and everything
- * allocated by the framework within it.
- */
-AVFormatContext *avformat_alloc_context(void);
-
-/**
- * Free an AVFormatContext and all its streams.
- * @param s context to free
- */
-void avformat_free_context(AVFormatContext *s);
-
-/**
- * Get the AVClass for AVFormatContext. It can be used in combination with
- * AV_OPT_SEARCH_FAKE_OBJ for examining options.
- *
- * @see av_opt_find().
- */
-const AVClass *avformat_get_class(void);
-
-/**
- * Add a new stream to a media file.
- *
- * When demuxing, it is called by the demuxer in read_header(). If the
- * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also
- * be called in read_packet().
- *
- * When muxing, should be called by the user before avformat_write_header().
- *
- * @param c If non-NULL, the AVCodecContext corresponding to the new stream
- * will be initialized to use this codec. This is needed for e.g. codec-specific
- * defaults to be set, so codec should be provided if it is known.
- *
- * @return newly created stream or NULL on error.
- */
-AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c);
-
-AVProgram *av_new_program(AVFormatContext *s, int id);
-
-/**
- * @}
- */
-
-
-/**
- * @addtogroup lavf_decoding
- * @{
- */
-
-/**
- * Find AVInputFormat based on the short name of the input format.
- */
-AVInputFormat *av_find_input_format(const char *short_name);
-
-/**
- * Guess the file format.
- *
- * @param is_opened Whether the file is already opened; determines whether
- *                  demuxers with or without AVFMT_NOFILE are probed.
- */
-AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
-
-/**
- * Guess the file format.
- *
- * @param is_opened Whether the file is already opened; determines whether
- *                  demuxers with or without AVFMT_NOFILE are probed.
- * @param score_max A probe score larger that this is required to accept a
- *                  detection, the variable is set to the actual detection
- *                  score afterwards.
- *                  If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended
- *                  to retry with a larger probe buffer.
- */
-AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max);
-
-/**
- * Probe a bytestream to determine the input format. Each time a probe returns
- * with a score that is too low, the probe buffer size is increased and another
- * attempt is made. When the maximum probe size is reached, the input format
- * with the highest score is returned.
- *
- * @param pb the bytestream to probe
- * @param fmt the input format is put here
- * @param filename the filename of the stream
- * @param logctx the log context
- * @param offset the offset within the bytestream to probe from
- * @param max_probe_size the maximum probe buffer size (zero for default)
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code otherwise
- */
-int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
-                          const char *filename, void *logctx,
-                          unsigned int offset, unsigned int max_probe_size);
-
-/**
- * Open an input stream and read the header. The codecs are not opened.
- * The stream must be closed with avformat_close_input().
- *
- * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context).
- *           May be a pointer to NULL, in which case an AVFormatContext is allocated by this
- *           function and written into ps.
- *           Note that a user-supplied AVFormatContext will be freed on failure.
- * @param filename Name of the stream to open.
- * @param fmt If non-NULL, this parameter forces a specific input format.
- *            Otherwise the format is autodetected.
- * @param options  A dictionary filled with AVFormatContext and demuxer-private options.
- *                 On return this parameter will be destroyed and replaced with a dict containing
- *                 options that were not found. May be NULL.
- *
- * @return 0 on success, a negative AVERROR on failure.
- *
- * @note If you want to use custom IO, preallocate the format context and set its pb field.
- */
-int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options);
-
-/**
- * Read packets of a media file to get stream information. This
- * is useful for file formats with no headers such as MPEG. This
- * function also computes the real framerate in case of MPEG-2 repeat
- * frame mode.
- * The logical file position is not changed by this function;
- * examined packets may be buffered for later processing.
- *
- * @param ic media file handle
- * @param options  If non-NULL, an ic.nb_streams long array of pointers to
- *                 dictionaries, where i-th member contains options for
- *                 codec corresponding to i-th stream.
- *                 On return each dictionary will be filled with options that were not found.
- * @return >=0 if OK, AVERROR_xxx on error
- *
- * @note this function isn't guaranteed to open all the codecs, so
- *       options being non-empty at return is a perfectly normal behavior.
- *
- * @todo Let the user decide somehow what information is needed so that
- *       we do not waste time getting stuff the user does not need.
- */
-int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options);
-
-/**
- * Find the "best" stream in the file.
- * The best stream is determined according to various heuristics as the most
- * likely to be what the user expects.
- * If the decoder parameter is non-NULL, av_find_best_stream will find the
- * default decoder for the stream's codec; streams for which no decoder can
- * be found are ignored.
- *
- * @param ic                media file handle
- * @param type              stream type: video, audio, subtitles, etc.
- * @param wanted_stream_nb  user-requested stream number,
- *                          or -1 for automatic selection
- * @param related_stream    try to find a stream related (eg. in the same
- *                          program) to this one, or -1 if none
- * @param decoder_ret       if non-NULL, returns the decoder for the
- *                          selected stream
- * @param flags             flags; none are currently defined
- * @return  the non-negative stream number in case of success,
- *          AVERROR_STREAM_NOT_FOUND if no stream with the requested type
- *          could be found,
- *          AVERROR_DECODER_NOT_FOUND if streams were found but no decoder
- * @note  If av_find_best_stream returns successfully and decoder_ret is not
- *        NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec.
- */
-int av_find_best_stream(AVFormatContext *ic,
-                        enum AVMediaType type,
-                        int wanted_stream_nb,
-                        int related_stream,
-                        AVCodec **decoder_ret,
-                        int flags);
-
-/**
- * Return the next frame of a stream.
- * This function returns what is stored in the file, and does not validate
- * that what is there are valid frames for the decoder. It will split what is
- * stored in the file into frames and return one for each call. It will not
- * omit invalid data between valid frames so as to give the decoder the maximum
- * information possible for decoding.
- *
- * If pkt->buf is NULL, then the packet is valid until the next
- * av_read_frame() or until avformat_close_input(). Otherwise the packet
- * is valid indefinitely. In both cases the packet must be freed with
- * av_free_packet when it is no longer needed. For video, the packet contains
- * exactly one frame. For audio, it contains an integer number of frames if each
- * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames
- * have a variable size (e.g. MPEG audio), then it contains one frame.
- *
- * pkt->pts, pkt->dts and pkt->duration are always set to correct
- * values in AVStream.time_base units (and guessed if the format cannot
- * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format
- * has B-frames, so it is better to rely on pkt->dts if you do not
- * decompress the payload.
- *
- * @return 0 if OK, < 0 on error or end of file
- */
-int av_read_frame(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Seek to the keyframe at timestamp.
- * 'timestamp' in 'stream_index'.
- * @param stream_index If stream_index is (-1), a default
- * stream is selected, and timestamp is automatically converted
- * from AV_TIME_BASE units to the stream specific time_base.
- * @param timestamp Timestamp in AVStream.time_base units
- *        or, if no stream is specified, in AV_TIME_BASE units.
- * @param flags flags which select direction and seeking mode
- * @return >= 0 on success
- */
-int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp,
-                  int flags);
-
-/**
- * Seek to timestamp ts.
- * Seeking will be done so that the point from which all active streams
- * can be presented successfully will be closest to ts and within min/max_ts.
- * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
- *
- * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and
- * are the file position (this may not be supported by all demuxers).
- * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames
- * in the stream with stream_index (this may not be supported by all demuxers).
- * Otherwise all timestamps are in units of the stream selected by stream_index
- * or if stream_index is -1, in AV_TIME_BASE units.
- * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as
- * keyframes (this may not be supported by all demuxers).
- *
- * @param stream_index index of the stream which is used as time base reference
- * @param min_ts smallest acceptable timestamp
- * @param ts target timestamp
- * @param max_ts largest acceptable timestamp
- * @param flags flags
- * @return >=0 on success, error code otherwise
- *
- * @note This is part of the new seek API which is still under construction.
- *       Thus do not use this yet. It may change at any time, do not expect
- *       ABI compatibility yet!
- */
-int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
-
-/**
- * Start playing a network-based stream (e.g. RTSP stream) at the
- * current position.
- */
-int av_read_play(AVFormatContext *s);
-
-/**
- * Pause a network-based stream (e.g. RTSP stream).
- *
- * Use av_read_play() to resume it.
- */
-int av_read_pause(AVFormatContext *s);
-
-/**
- * Close an opened input AVFormatContext. Free it and all its contents
- * and set *s to NULL.
- */
-void avformat_close_input(AVFormatContext **s);
-/**
- * @}
- */
-
-#define AVSEEK_FLAG_BACKWARD 1 ///< seek backward
-#define AVSEEK_FLAG_BYTE     2 ///< seeking based on position in bytes
-#define AVSEEK_FLAG_ANY      4 ///< seek to any frame, even non-keyframes
-#define AVSEEK_FLAG_FRAME    8 ///< seeking based on frame number
-
-/**
- * @addtogroup lavf_encoding
- * @{
- */
-/**
- * Allocate the stream private data and write the stream header to
- * an output media file.
- *
- * @param s Media file handle, must be allocated with avformat_alloc_context().
- *          Its oformat field must be set to the desired output format;
- *          Its pb field must be set to an already opened AVIOContext.
- * @param options  An AVDictionary filled with AVFormatContext and muxer-private options.
- *                 On return this parameter will be destroyed and replaced with a dict containing
- *                 options that were not found. May be NULL.
- *
- * @return 0 on success, negative AVERROR on failure.
- *
- * @see av_opt_find, av_dict_set, avio_open, av_oformat_next.
- */
-int avformat_write_header(AVFormatContext *s, AVDictionary **options);
-
-/**
- * Write a packet to an output media file.
- *
- * The packet shall contain one audio or video frame.
- * The packet must be correctly interleaved according to the container
- * specification, if not then av_interleaved_write_frame must be used.
- *
- * @param s media file handle
- * @param pkt The packet, which contains the stream_index, buf/buf_size,
- *            dts/pts, ...
- *            This can be NULL (at any time, not just at the end), in
- *            order to immediately flush data buffered within the muxer,
- *            for muxers that buffer up data internally before writing it
- *            to the output.
- * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush
- */
-int av_write_frame(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Write a packet to an output media file ensuring correct interleaving.
- *
- * The packet must contain one audio or video frame.
- * If the packets are already correctly interleaved, the application should
- * call av_write_frame() instead as it is slightly faster. It is also important
- * to keep in mind that completely non-interleaved input will need huge amounts
- * of memory to interleave with this, so it is preferable to interleave at the
- * demuxer level.
- *
- * @param s media file handle
- * @param pkt The packet containing the data to be written. pkt->buf must be set
- * to a valid AVBufferRef describing the packet data. Libavformat takes
- * ownership of this reference and will unref it when it sees fit. The caller
- * must not access the data through this reference after this function returns.
- * This can be NULL (at any time, not just at the end), to flush the
- * interleaving queues.
- * Packet's @ref AVPacket.stream_index "stream_index" field must be set to the
- * index of the corresponding stream in @ref AVFormatContext.streams
- * "s.streams".
- * It is very strongly recommended that timing information (@ref AVPacket.pts
- * "pts", @ref AVPacket.dts "dts" @ref AVPacket.duration "duration") is set to
- * correct values.
- *
- * @return 0 on success, a negative AVERROR on error.
- */
-int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
-
-/**
- * Write the stream trailer to an output media file and free the
- * file private data.
- *
- * May only be called after a successful call to avformat_write_header.
- *
- * @param s media file handle
- * @return 0 if OK, AVERROR_xxx on error
- */
-int av_write_trailer(AVFormatContext *s);
-
-/**
- * Return the output format in the list of registered output formats
- * which best matches the provided parameters, or return NULL if
- * there is no match.
- *
- * @param short_name if non-NULL checks if short_name matches with the
- * names of the registered formats
- * @param filename if non-NULL checks if filename terminates with the
- * extensions of the registered formats
- * @param mime_type if non-NULL checks if mime_type matches with the
- * MIME type of the registered formats
- */
-AVOutputFormat *av_guess_format(const char *short_name,
-                                const char *filename,
-                                const char *mime_type);
-
-/**
- * Guess the codec ID based upon muxer and filename.
- */
-enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
-                            const char *filename, const char *mime_type,
-                            enum AVMediaType type);
-
-/**
- * @}
- */
-
-
-/**
- * @defgroup lavf_misc Utility functions
- * @ingroup libavf
- * @{
- *
- * Miscellaneous utility functions related to both muxing and demuxing
- * (or neither).
- */
-
-/**
- * Send a nice hexadecimal dump of a buffer to the specified file stream.
- *
- * @param f The file stream pointer where the dump should be sent to.
- * @param buf buffer
- * @param size buffer size
- *
- * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2
- */
-void av_hex_dump(FILE *f, const uint8_t *buf, int size);
-
-/**
- * Send a nice hexadecimal dump of a buffer to the log.
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- * pointer to an AVClass struct.
- * @param level The importance level of the message, lower values signifying
- * higher importance.
- * @param buf buffer
- * @param size buffer size
- *
- * @see av_hex_dump, av_pkt_dump2, av_pkt_dump_log2
- */
-void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size);
-
-/**
- * Send a nice dump of a packet to the specified file stream.
- *
- * @param f The file stream pointer where the dump should be sent to.
- * @param pkt packet to dump
- * @param dump_payload True if the payload must be displayed, too.
- * @param st AVStream that the packet belongs to
- */
-void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st);
-
-
-/**
- * Send a nice dump of a packet to the log.
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- * pointer to an AVClass struct.
- * @param level The importance level of the message, lower values signifying
- * higher importance.
- * @param pkt packet to dump
- * @param dump_payload True if the payload must be displayed, too.
- * @param st AVStream that the packet belongs to
- */
-void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload,
-                      AVStream *st);
-
-/**
- * Get the AVCodecID for the given codec tag tag.
- * If no codec id is found returns AV_CODEC_ID_NONE.
- *
- * @param tags list of supported codec_id-codec_tag pairs, as stored
- * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
- */
-enum AVCodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned int tag);
-
-/**
- * Get the codec tag for the given codec id id.
- * If no codec tag is found returns 0.
- *
- * @param tags list of supported codec_id-codec_tag pairs, as stored
- * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
- */
-unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum AVCodecID id);
-
-int av_find_default_stream_index(AVFormatContext *s);
-
-/**
- * Get the index for a specific timestamp.
- * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond
- *                 to the timestamp which is <= the requested one, if backward
- *                 is 0, then it will be >=
- *              if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise
- * @return < 0 if no such timestamp could be found
- */
-int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags);
-
-/**
- * Add an index entry into a sorted list. Update the entry if the list
- * already contains it.
- *
- * @param timestamp timestamp in the time base of the given stream
- */
-int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp,
-                       int size, int distance, int flags);
-
-
-/**
- * Split a URL string into components.
- *
- * The pointers to buffers for storing individual components may be null,
- * in order to ignore that component. Buffers for components not found are
- * set to empty strings. If the port is not found, it is set to a negative
- * value.
- *
- * @param proto the buffer for the protocol
- * @param proto_size the size of the proto buffer
- * @param authorization the buffer for the authorization
- * @param authorization_size the size of the authorization buffer
- * @param hostname the buffer for the host name
- * @param hostname_size the size of the hostname buffer
- * @param port_ptr a pointer to store the port number in
- * @param path the buffer for the path
- * @param path_size the size of the path buffer
- * @param url the URL to split
- */
-void av_url_split(char *proto,         int proto_size,
-                  char *authorization, int authorization_size,
-                  char *hostname,      int hostname_size,
-                  int *port_ptr,
-                  char *path,          int path_size,
-                  const char *url);
-
-
-void av_dump_format(AVFormatContext *ic,
-                    int index,
-                    const char *url,
-                    int is_output);
-
-/**
- * Return in 'buf' the path with '%d' replaced by a number.
- *
- * Also handles the '%0nd' format where 'n' is the total number
- * of digits and '%%'.
- *
- * @param buf destination buffer
- * @param buf_size destination buffer size
- * @param path numbered sequence string
- * @param number frame number
- * @return 0 if OK, -1 on format error
- */
-int av_get_frame_filename(char *buf, int buf_size,
-                          const char *path, int number);
-
-/**
- * Check whether filename actually is a numbered sequence generator.
- *
- * @param filename possible numbered sequence string
- * @return 1 if a valid numbered sequence string, 0 otherwise
- */
-int av_filename_number_test(const char *filename);
-
-/**
- * Generate an SDP for an RTP session.
- *
- * Note, this overwrites the id values of AVStreams in the muxer contexts
- * for getting unique dynamic payload types.
- *
- * @param ac array of AVFormatContexts describing the RTP streams. If the
- *           array is composed by only one context, such context can contain
- *           multiple AVStreams (one AVStream per RTP stream). Otherwise,
- *           all the contexts in the array (an AVCodecContext per RTP stream)
- *           must contain only one AVStream.
- * @param n_files number of AVCodecContexts contained in ac
- * @param buf buffer where the SDP will be stored (must be allocated by
- *            the caller)
- * @param size the size of the buffer
- * @return 0 if OK, AVERROR_xxx on error
- */
-int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size);
-
-/**
- * Return a positive value if the given filename has one of the given
- * extensions, 0 otherwise.
- *
- * @param extensions a comma-separated list of filename extensions
- */
-int av_match_ext(const char *filename, const char *extensions);
-
-/**
- * Test if the given container can store a codec.
- *
- * @param std_compliance standards compliance level, one of FF_COMPLIANCE_*
- *
- * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot.
- *         A negative number if this information is not available.
- */
-int avformat_query_codec(AVOutputFormat *ofmt, enum AVCodecID codec_id, int std_compliance);
-
-/**
- * @defgroup riff_fourcc RIFF FourCCs
- * @{
- * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are
- * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the
- * following code:
- * @code
- * uint32_t tag = MKTAG('H', '2', '6', '4');
- * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 };
- * enum AVCodecID id = av_codec_get_id(table, tag);
- * @endcode
- */
-/**
- * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID.
- */
-const struct AVCodecTag *avformat_get_riff_video_tags(void);
-/**
- * @return the table mapping RIFF FourCCs for audio to AVCodecID.
- */
-const struct AVCodecTag *avformat_get_riff_audio_tags(void);
-/**
- * @}
- */
-
-/**
- * @}
- */
-
-#endif /* AVFORMAT_AVFORMAT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/avio.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/avio.h
deleted file mode 100644
index b6d3cb3..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/avio.h
+++ /dev/null
@@ -1,433 +0,0 @@
-/*
- * copyright (c) 2001 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-#ifndef AVFORMAT_AVIO_H
-#define AVFORMAT_AVIO_H
-
-/**
- * @file
- * @ingroup lavf_io
- * Buffered I/O operations
- */
-
-#include <stdint.h>
-
-#include "libavutil/common.h"
-#include "libavutil/dict.h"
-#include "libavutil/log.h"
-
-#include "libavformat/version.h"
-
-
-#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
-
-/**
- * Callback for checking whether to abort blocking functions.
- * AVERROR_EXIT is returned in this case by the interrupted
- * function. During blocking operations, callback is called with
- * opaque as parameter. If the callback returns 1, the
- * blocking operation will be aborted.
- *
- * No members can be added to this struct without a major bump, if
- * new elements have been added after this struct in AVFormatContext
- * or AVIOContext.
- */
-typedef struct AVIOInterruptCB {
-    int (*callback)(void*);
-    void *opaque;
-} AVIOInterruptCB;
-
-/**
- * Bytestream IO Context.
- * New fields can be added to the end with minor version bumps.
- * Removal, reordering and changes to existing fields require a major
- * version bump.
- * sizeof(AVIOContext) must not be used outside libav*.
- *
- * @note None of the function pointers in AVIOContext should be called
- *       directly, they should only be set by the client application
- *       when implementing custom I/O. Normally these are set to the
- *       function pointers specified in avio_alloc_context()
- */
-typedef struct AVIOContext {
-    /**
-     * A class for private options.
-     *
-     * If this AVIOContext is created by avio_open2(), av_class is set and
-     * passes the options down to protocols.
-     *
-     * If this AVIOContext is manually allocated, then av_class may be set by
-     * the caller.
-     *
-     * warning -- this field can be NULL, be sure to not pass this AVIOContext
-     * to any av_opt_* functions in that case.
-     */
-    const AVClass *av_class;
-    unsigned char *buffer;  /**< Start of the buffer. */
-    int buffer_size;        /**< Maximum buffer size */
-    unsigned char *buf_ptr; /**< Current position in the buffer */
-    unsigned char *buf_end; /**< End of the data, may be less than
-                                 buffer+buffer_size if the read function returned
-                                 less data than requested, e.g. for streams where
-                                 no more data has been received yet. */
-    void *opaque;           /**< A private pointer, passed to the read/write/seek/...
-                                 functions. */
-    int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
-    int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
-    int64_t (*seek)(void *opaque, int64_t offset, int whence);
-    int64_t pos;            /**< position in the file of the current buffer */
-    int must_flush;         /**< true if the next seek should flush */
-    int eof_reached;        /**< true if eof reached */
-    int write_flag;         /**< true if open for writing */
-    int max_packet_size;
-    unsigned long checksum;
-    unsigned char *checksum_ptr;
-    unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
-    int error;              /**< contains the error code or 0 if no error happened */
-    /**
-     * Pause or resume playback for network streaming protocols - e.g. MMS.
-     */
-    int (*read_pause)(void *opaque, int pause);
-    /**
-     * Seek to a given timestamp in stream with the specified stream_index.
-     * Needed for some network streaming protocols which don't support seeking
-     * to byte position.
-     */
-    int64_t (*read_seek)(void *opaque, int stream_index,
-                         int64_t timestamp, int flags);
-    /**
-     * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
-     */
-    int seekable;
-} AVIOContext;
-
-/* unbuffered I/O */
-
-/**
- * Return AVIO_FLAG_* access flags corresponding to the access permissions
- * of the resource in url, or a negative value corresponding to an
- * AVERROR code in case of failure. The returned access flags are
- * masked by the value in flags.
- *
- * @note This function is intrinsically unsafe, in the sense that the
- * checked resource may change its existence or permission status from
- * one call to another. Thus you should not trust the returned value,
- * unless you are sure that no other processes are accessing the
- * checked resource.
- */
-int avio_check(const char *url, int flags);
-
-/**
- * Allocate and initialize an AVIOContext for buffered I/O. It must be later
- * freed with av_free().
- *
- * @param buffer Memory block for input/output operations via AVIOContext.
- *        The buffer must be allocated with av_malloc() and friends.
- * @param buffer_size The buffer size is very important for performance.
- *        For protocols with fixed blocksize it should be set to this blocksize.
- *        For others a typical size is a cache page, e.g. 4kb.
- * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise.
- * @param opaque An opaque pointer to user-specific data.
- * @param read_packet  A function for refilling the buffer, may be NULL.
- * @param write_packet A function for writing the buffer contents, may be NULL.
- * @param seek A function for seeking to specified byte position, may be NULL.
- *
- * @return Allocated AVIOContext or NULL on failure.
- */
-AVIOContext *avio_alloc_context(
-                  unsigned char *buffer,
-                  int buffer_size,
-                  int write_flag,
-                  void *opaque,
-                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
-                  int64_t (*seek)(void *opaque, int64_t offset, int whence));
-
-void avio_w8(AVIOContext *s, int b);
-void avio_write(AVIOContext *s, const unsigned char *buf, int size);
-void avio_wl64(AVIOContext *s, uint64_t val);
-void avio_wb64(AVIOContext *s, uint64_t val);
-void avio_wl32(AVIOContext *s, unsigned int val);
-void avio_wb32(AVIOContext *s, unsigned int val);
-void avio_wl24(AVIOContext *s, unsigned int val);
-void avio_wb24(AVIOContext *s, unsigned int val);
-void avio_wl16(AVIOContext *s, unsigned int val);
-void avio_wb16(AVIOContext *s, unsigned int val);
-
-/**
- * Write a NULL-terminated string.
- * @return number of bytes written.
- */
-int avio_put_str(AVIOContext *s, const char *str);
-
-/**
- * Convert an UTF-8 string to UTF-16LE and write it.
- * @return number of bytes written.
- */
-int avio_put_str16le(AVIOContext *s, const char *str);
-
-/**
- * Passing this as the "whence" parameter to a seek function causes it to
- * return the filesize without seeking anywhere. Supporting this is optional.
- * If it is not supported then the seek function will return <0.
- */
-#define AVSEEK_SIZE 0x10000
-
-/**
- * Oring this flag as into the "whence" parameter to a seek function causes it to
- * seek by any means (like reopening and linear reading) or other normally unreasonble
- * means that can be extreemly slow.
- * This may be ignored by the seek code.
- */
-#define AVSEEK_FORCE 0x20000
-
-/**
- * fseek() equivalent for AVIOContext.
- * @return new position or AVERROR.
- */
-int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
-
-/**
- * Skip given number of bytes forward
- * @return new position or AVERROR.
- */
-static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
-{
-    return avio_seek(s, offset, SEEK_CUR);
-}
-
-/**
- * ftell() equivalent for AVIOContext.
- * @return position or AVERROR.
- */
-static av_always_inline int64_t avio_tell(AVIOContext *s)
-{
-    return avio_seek(s, 0, SEEK_CUR);
-}
-
-/**
- * Get the filesize.
- * @return filesize or AVERROR
- */
-int64_t avio_size(AVIOContext *s);
-
-/** @warning currently size is limited */
-int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
-
-void avio_flush(AVIOContext *s);
-
-
-/**
- * Read size bytes from AVIOContext into buf.
- * @return number of bytes read or AVERROR
- */
-int avio_read(AVIOContext *s, unsigned char *buf, int size);
-
-/**
- * @name Functions for reading from AVIOContext
- * @{
- *
- * @note return 0 if EOF, so you cannot use it if EOF handling is
- *       necessary
- */
-int          avio_r8  (AVIOContext *s);
-unsigned int avio_rl16(AVIOContext *s);
-unsigned int avio_rl24(AVIOContext *s);
-unsigned int avio_rl32(AVIOContext *s);
-uint64_t     avio_rl64(AVIOContext *s);
-unsigned int avio_rb16(AVIOContext *s);
-unsigned int avio_rb24(AVIOContext *s);
-unsigned int avio_rb32(AVIOContext *s);
-uint64_t     avio_rb64(AVIOContext *s);
-/**
- * @}
- */
-
-/**
- * Read a string from pb into buf. The reading will terminate when either
- * a NULL character was encountered, maxlen bytes have been read, or nothing
- * more can be read from pb. The result is guaranteed to be NULL-terminated, it
- * will be truncated if buf is too small.
- * Note that the string is not interpreted or validated in any way, it
- * might get truncated in the middle of a sequence for multi-byte encodings.
- *
- * @return number of bytes read (is always <= maxlen).
- * If reading ends on EOF or error, the return value will be one more than
- * bytes actually read.
- */
-int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen);
-
-/**
- * Read a UTF-16 string from pb and convert it to UTF-8.
- * The reading will terminate when either a null or invalid character was
- * encountered or maxlen bytes have been read.
- * @return number of bytes read (is always <= maxlen)
- */
-int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen);
-int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
-
-
-/**
- * @name URL open modes
- * The flags argument to avio_open must be one of the following
- * constants, optionally ORed with other flags.
- * @{
- */
-#define AVIO_FLAG_READ  1                                      /**< read-only */
-#define AVIO_FLAG_WRITE 2                                      /**< write-only */
-#define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE)  /**< read-write pseudo flag */
-/**
- * @}
- */
-
-/**
- * Use non-blocking mode.
- * If this flag is set, operations on the context will return
- * AVERROR(EAGAIN) if they can not be performed immediately.
- * If this flag is not set, operations on the context will never return
- * AVERROR(EAGAIN).
- * Note that this flag does not affect the opening/connecting of the
- * context. Connecting a protocol will always block if necessary (e.g. on
- * network protocols) but never hang (e.g. on busy devices).
- * Warning: non-blocking protocols is work-in-progress; this flag may be
- * silently ignored.
- */
-#define AVIO_FLAG_NONBLOCK 8
-
-/**
- * Create and initialize a AVIOContext for accessing the
- * resource indicated by url.
- * @note When the resource indicated by url has been opened in
- * read+write mode, the AVIOContext can be used only for writing.
- *
- * @param s Used to return the pointer to the created AVIOContext.
- * In case of failure the pointed to value is set to NULL.
- * @param flags flags which control how the resource indicated by url
- * is to be opened
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int avio_open(AVIOContext **s, const char *url, int flags);
-
-/**
- * Create and initialize a AVIOContext for accessing the
- * resource indicated by url.
- * @note When the resource indicated by url has been opened in
- * read+write mode, the AVIOContext can be used only for writing.
- *
- * @param s Used to return the pointer to the created AVIOContext.
- * In case of failure the pointed to value is set to NULL.
- * @param flags flags which control how the resource indicated by url
- * is to be opened
- * @param int_cb an interrupt callback to be used at the protocols level
- * @param options  A dictionary filled with protocol-private options. On return
- * this parameter will be destroyed and replaced with a dict containing options
- * that were not found. May be NULL.
- * @return 0 in case of success, a negative value corresponding to an
- * AVERROR code in case of failure
- */
-int avio_open2(AVIOContext **s, const char *url, int flags,
-               const AVIOInterruptCB *int_cb, AVDictionary **options);
-
-/**
- * Close the resource accessed by the AVIOContext s and free it.
- * This function can only be used if s was opened by avio_open().
- *
- * The internal buffer is automatically flushed before closing the
- * resource.
- *
- * @return 0 on success, an AVERROR < 0 on error.
- * @see avio_closep
- */
-int avio_close(AVIOContext *s);
-
-/**
- * Close the resource accessed by the AVIOContext *s, free it
- * and set the pointer pointing to it to NULL.
- * This function can only be used if s was opened by avio_open().
- *
- * The internal buffer is automatically flushed before closing the
- * resource.
- *
- * @return 0 on success, an AVERROR < 0 on error.
- * @see avio_close
- */
-int avio_closep(AVIOContext **s);
-
-
-/**
- * Open a write only memory stream.
- *
- * @param s new IO context
- * @return zero if no error.
- */
-int avio_open_dyn_buf(AVIOContext **s);
-
-/**
- * Return the written size and a pointer to the buffer. The buffer
- * must be freed with av_free().
- * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
- *
- * @param s IO context
- * @param pbuffer pointer to a byte buffer
- * @return the length of the byte buffer
- */
-int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
-
-/**
- * Iterate through names of available protocols.
- *
- * @param opaque A private pointer representing current protocol.
- *        It must be a pointer to NULL on first iteration and will
- *        be updated by successive calls to avio_enum_protocols.
- * @param output If set to 1, iterate over output protocols,
- *               otherwise over input protocols.
- *
- * @return A static string containing the name of current protocol or NULL
- */
-const char *avio_enum_protocols(void **opaque, int output);
-
-/**
- * Pause and resume playing - only meaningful if using a network streaming
- * protocol (e.g. MMS).
- * @param pause 1 for pause, 0 for resume
- */
-int     avio_pause(AVIOContext *h, int pause);
-
-/**
- * Seek to a given timestamp relative to some component stream.
- * Only meaningful if using a network streaming protocol (e.g. MMS.).
- * @param stream_index The stream index that the timestamp is relative to.
- *        If stream_index is (-1) the timestamp should be in AV_TIME_BASE
- *        units from the beginning of the presentation.
- *        If a stream_index >= 0 is used and the protocol does not support
- *        seeking based on component streams, the call will fail with ENOTSUP.
- * @param timestamp timestamp in AVStream.time_base units
- *        or if there is no stream specified then in AV_TIME_BASE units.
- * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
- *        and AVSEEK_FLAG_ANY. The protocol may silently ignore
- *        AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
- *        fail with ENOTSUP if used and not supported.
- * @return >= 0 on success
- * @see AVInputFormat::read_seek
- */
-int64_t avio_seek_time(AVIOContext *h, int stream_index,
-                       int64_t timestamp, int flags);
-
-#endif /* AVFORMAT_AVIO_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/version.h
deleted file mode 100644
index ac675ce..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavformat/version.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Version macros.
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVFORMAT_VERSION_H
-#define AVFORMAT_VERSION_H
-
-/**
- * @file
- * @ingroup libavf
- * Libavformat version macros
- */
-
-#include "libavutil/avutil.h"
-
-#define LIBAVFORMAT_VERSION_MAJOR 55
-#define LIBAVFORMAT_VERSION_MINOR  3
-#define LIBAVFORMAT_VERSION_MICRO  0
-
-#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
-                                               LIBAVFORMAT_VERSION_MINOR, \
-                                               LIBAVFORMAT_VERSION_MICRO)
-#define LIBAVFORMAT_VERSION     AV_VERSION(LIBAVFORMAT_VERSION_MAJOR,   \
-                                           LIBAVFORMAT_VERSION_MINOR,   \
-                                           LIBAVFORMAT_VERSION_MICRO)
-#define LIBAVFORMAT_BUILD       LIBAVFORMAT_VERSION_INT
-
-#define LIBAVFORMAT_IDENT       "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
-
-/**
- * FF_API_* defines may be placed below to indicate public API that will be
- * dropped at a future version bump. The defines themselves are not part of
- * the public API and may change, break or disappear at any time.
- */
-
-#endif /* AVFORMAT_VERSION_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavresample/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavresample/version.h
deleted file mode 100644
index 3cc4441..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavresample/version.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVRESAMPLE_VERSION_H
-#define AVRESAMPLE_VERSION_H
-
-/**
- * @file
- * @ingroup lavr
- * Libavresample version macros.
- */
-
-#define LIBAVRESAMPLE_VERSION_MAJOR  1
-#define LIBAVRESAMPLE_VERSION_MINOR  1
-#define LIBAVRESAMPLE_VERSION_MICRO  0
-
-#define LIBAVRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBAVRESAMPLE_VERSION_MAJOR, \
-                                                  LIBAVRESAMPLE_VERSION_MINOR, \
-                                                  LIBAVRESAMPLE_VERSION_MICRO)
-#define LIBAVRESAMPLE_VERSION          AV_VERSION(LIBAVRESAMPLE_VERSION_MAJOR, \
-                                                  LIBAVRESAMPLE_VERSION_MINOR, \
-                                                  LIBAVRESAMPLE_VERSION_MICRO)
-#define LIBAVRESAMPLE_BUILD        LIBAVRESAMPLE_VERSION_INT
-
-#define LIBAVRESAMPLE_IDENT        "Lavr" AV_STRINGIFY(LIBAVRESAMPLE_VERSION)
-
-/**
- * FF_API_* defines may be placed below to indicate public API that will be
- * dropped at a future version bump. The defines themselves are not part of
- * the public API and may change, break or disappear at any time.
- */
-
-#ifndef FF_API_RESAMPLE_CLOSE_OPEN
-#define FF_API_RESAMPLE_CLOSE_OPEN (LIBAVRESAMPLE_VERSION_MAJOR < 2)
-#endif
-
-#endif /* AVRESAMPLE_VERSION_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/attributes.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/attributes.h
deleted file mode 100644
index 292a0a1..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/attributes.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Macro definitions for various function/variable attributes
- */
-
-#ifndef AVUTIL_ATTRIBUTES_H
-#define AVUTIL_ATTRIBUTES_H
-
-#ifdef __GNUC__
-#    define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
-#else
-#    define AV_GCC_VERSION_AT_LEAST(x,y) 0
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define av_always_inline __attribute__((always_inline)) inline
-#elif defined(_MSC_VER)
-#    define av_always_inline __forceinline
-#else
-#    define av_always_inline inline
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define av_noinline __attribute__((noinline))
-#else
-#    define av_noinline
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define av_pure __attribute__((pure))
-#else
-#    define av_pure
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(2,6)
-#    define av_const __attribute__((const))
-#else
-#    define av_const
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(4,3)
-#    define av_cold __attribute__((cold))
-#else
-#    define av_cold
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(4,1)
-#    define av_flatten __attribute__((flatten))
-#else
-#    define av_flatten
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define attribute_deprecated __attribute__((deprecated))
-#else
-#    define attribute_deprecated
-#endif
-
-#if defined(__GNUC__)
-#    define av_unused __attribute__((unused))
-#else
-#    define av_unused
-#endif
-
-/**
- * Mark a variable as used and prevent the compiler from optimizing it
- * away.  This is useful for variables accessed only from inline
- * assembler without the compiler being aware.
- */
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-#    define av_used __attribute__((used))
-#else
-#    define av_used
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(3,3)
-#   define av_alias __attribute__((may_alias))
-#else
-#   define av_alias
-#endif
-
-#if defined(__GNUC__) && !defined(__ICC)
-#    define av_uninit(x) x=x
-#else
-#    define av_uninit(x) x
-#endif
-
-#ifdef __GNUC__
-#    define av_builtin_constant_p __builtin_constant_p
-#    define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
-#else
-#    define av_builtin_constant_p(x) 0
-#    define av_printf_format(fmtpos, attrpos)
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(2,5)
-#    define av_noreturn __attribute__((noreturn))
-#else
-#    define av_noreturn
-#endif
-
-#endif /* AVUTIL_ATTRIBUTES_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avutil.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avutil.h
deleted file mode 100644
index ddb34a1..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avutil.h
+++ /dev/null
@@ -1,308 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_AVUTIL_H
-#define AVUTIL_AVUTIL_H
-
-/**
- * @file
- * external API header
- */
-
-/**
- * @mainpage
- *
- * @section libav_intro Introduction
- *
- * This document describes the usage of the different libraries
- * provided by Libav.
- *
- * @li @ref libavc "libavcodec" encoding/decoding library
- * @li @ref lavfi "libavfilter" graph-based frame editing library
- * @li @ref libavf "libavformat" I/O and muxing/demuxing library
- * @li @ref lavd "libavdevice" special devices muxing/demuxing library
- * @li @ref lavu "libavutil" common utility library
- * @li @ref lavr "libavresample" audio resampling, format conversion and mixing
- * @li @subpage libswscale  color conversion and scaling library
- *
- * @section libav_versioning Versioning and compatibility
- *
- * Each of the Libav libraries contains a version.h header, which defines a
- * major, minor and micro version number with the
- * <em>LIBRARYNAME_VERSION_{MAJOR,MINOR,MICRO}</em> macros. The major version
- * number is incremented with backward incompatible changes - e.g. removing
- * parts of the public API, reordering public struct members, etc. The minor
- * version number is incremented for backward compatible API changes or major
- * new features - e.g. adding a new public function or a new decoder. The micro
- * version number is incremented for smaller changes that a calling program
- * might still want to check for - e.g. changing behavior in a previously
- * unspecified situation.
- *
- * Libav guarantees backward API and ABI compatibility for each library as long
- * as its major version number is unchanged. This means that no public symbols
- * will be removed or renamed. Types and names of the public struct members and
- * values of public macros and enums will remain the same (unless they were
- * explicitly declared as not part of the public API). Documented behavior will
- * not change.
- *
- * In other words, any correct program that works with a given Libav snapshot
- * should work just as well without any changes with any later snapshot with the
- * same major versions. This applies to both rebuilding the program against new
- * Libav versions or to replacing the dynamic Libav libraries that a program
- * links against.
- *
- * However, new public symbols may be added and new members may be appended to
- * public structs whose size is not part of public ABI (most public structs in
- * Libav). New macros and enum values may be added. Behavior in undocumented
- * situations may change slightly (and be documented). All those are accompanied
- * by an entry in doc/APIchanges and incrementing either the minor or micro
- * version number.
- */
-
-/**
- * @defgroup lavu Common utility functions
- *
- * @brief
- * libavutil contains the code shared across all the other Libav
- * libraries
- *
- * @note In order to use the functions provided by avutil you must include
- * the specific header.
- *
- * @{
- *
- * @defgroup lavu_crypto Crypto and Hashing
- *
- * @{
- * @}
- *
- * @defgroup lavu_math Maths
- * @{
- *
- * @}
- *
- * @defgroup lavu_string String Manipulation
- *
- * @{
- *
- * @}
- *
- * @defgroup lavu_mem Memory Management
- *
- * @{
- *
- * @}
- *
- * @defgroup lavu_data Data Structures
- * @{
- *
- * @}
- *
- * @defgroup lavu_audio Audio related
- *
- * @{
- *
- * @}
- *
- * @defgroup lavu_error Error Codes
- *
- * @{
- *
- * @}
- *
- * @defgroup lavu_misc Other
- *
- * @{
- *
- * @defgroup lavu_internal Internal
- *
- * Not exported functions, for internal usage only
- *
- * @{
- *
- * @}
- */
-
-
-/**
- * @defgroup preproc_misc Preprocessor String Macros
- *
- * String manipulation macros
- *
- * @{
- */
-
-#define AV_STRINGIFY(s)         AV_TOSTRING(s)
-#define AV_TOSTRING(s) #s
-
-#define AV_GLUE(a, b) a ## b
-#define AV_JOIN(a, b) AV_GLUE(a, b)
-
-#define AV_PRAGMA(s) _Pragma(#s)
-
-/**
- * @}
- */
-
-/**
- * @defgroup version_utils Library Version Macros
- *
- * Useful to check and match library version in order to maintain
- * backward compatibility.
- *
- * @{
- */
-
-#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
-#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
-#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
-
-/**
- * @}
- */
-
-/**
- * @addtogroup lavu_ver
- * @{
- */
-
-/**
- * Return the LIBAVUTIL_VERSION_INT constant.
- */
-unsigned avutil_version(void);
-
-/**
- * Return the libavutil build-time configuration.
- */
-const char *avutil_configuration(void);
-
-/**
- * Return the libavutil license.
- */
-const char *avutil_license(void);
-
-/**
- * @}
- */
-
-/**
- * @addtogroup lavu_media Media Type
- * @brief Media Type
- */
-
-enum AVMediaType {
-    AVMEDIA_TYPE_UNKNOWN = -1,  ///< Usually treated as AVMEDIA_TYPE_DATA
-    AVMEDIA_TYPE_VIDEO,
-    AVMEDIA_TYPE_AUDIO,
-    AVMEDIA_TYPE_DATA,          ///< Opaque data information usually continuous
-    AVMEDIA_TYPE_SUBTITLE,
-    AVMEDIA_TYPE_ATTACHMENT,    ///< Opaque data information usually sparse
-    AVMEDIA_TYPE_NB
-};
-
-/**
- * @defgroup lavu_const Constants
- * @{
- *
- * @defgroup lavu_enc Encoding specific
- *
- * @note those definition should move to avcodec
- * @{
- */
-
-#define FF_LAMBDA_SHIFT 7
-#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
-#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
-#define FF_LAMBDA_MAX (256*128-1)
-
-#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
-
-/**
- * @}
- * @defgroup lavu_time Timestamp specific
- *
- * Libav internal timebase and timestamp definitions
- *
- * @{
- */
-
-/**
- * @brief Undefined timestamp value
- *
- * Usually reported by demuxer that work on containers that do not provide
- * either pts or dts.
- */
-
-#define AV_NOPTS_VALUE          INT64_C(0x8000000000000000)
-
-/**
- * Internal time base represented as integer
- */
-
-#define AV_TIME_BASE            1000000
-
-/**
- * Internal time base represented as fractional value
- */
-
-#define AV_TIME_BASE_Q          (AVRational){1, AV_TIME_BASE}
-
-/**
- * @}
- * @}
- * @defgroup lavu_picture Image related
- *
- * AVPicture types, pixel formats and basic image planes manipulation.
- *
- * @{
- */
-
-enum AVPictureType {
-    AV_PICTURE_TYPE_I = 1, ///< Intra
-    AV_PICTURE_TYPE_P,     ///< Predicted
-    AV_PICTURE_TYPE_B,     ///< Bi-dir predicted
-    AV_PICTURE_TYPE_S,     ///< S(GMC)-VOP MPEG4
-    AV_PICTURE_TYPE_SI,    ///< Switching Intra
-    AV_PICTURE_TYPE_SP,    ///< Switching Predicted
-    AV_PICTURE_TYPE_BI,    ///< BI type
-};
-
-/**
- * Return a single letter to describe the given picture type
- * pict_type.
- *
- * @param[in] pict_type the picture type @return a single character
- * representing the picture type, '?' if pict_type is unknown
- */
-char av_get_picture_type_char(enum AVPictureType pict_type);
-
-/**
- * @}
- */
-
-#include "error.h"
-#include "version.h"
-
-/**
- * @}
- * @}
- */
-
-#endif /* AVUTIL_AVUTIL_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/bswap.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/bswap.h
deleted file mode 100644
index 8a350e1..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/bswap.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * byte swapping routines
- */
-
-#ifndef AVUTIL_BSWAP_H
-#define AVUTIL_BSWAP_H
-
-#include <stdint.h>
-#include "libavutil/avconfig.h"
-#include "attributes.h"
-
-#ifdef HAVE_AV_CONFIG_H
-
-#include "config.h"
-
-#if   ARCH_ARM
-#   include "arm/bswap.h"
-#elif ARCH_AVR32
-#   include "avr32/bswap.h"
-#elif ARCH_BFIN
-#   include "bfin/bswap.h"
-#elif ARCH_SH4
-#   include "sh4/bswap.h"
-#elif ARCH_X86
-#   include "x86/bswap.h"
-#endif
-
-#endif /* HAVE_AV_CONFIG_H */
-
-#define AV_BSWAP16C(x) (((x) << 8 & 0xff00)  | ((x) >> 8 & 0x00ff))
-#define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16))
-#define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32))
-
-#define AV_BSWAPC(s, x) AV_BSWAP##s##C(x)
-
-#ifndef av_bswap16
-static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
-{
-    x= (x>>8) | (x<<8);
-    return x;
-}
-#endif
-
-#ifndef av_bswap32
-static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
-{
-    return AV_BSWAP32C(x);
-}
-#endif
-
-#ifndef av_bswap64
-static inline uint64_t av_const av_bswap64(uint64_t x)
-{
-    return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);
-}
-#endif
-
-// be2ne ... big-endian to native-endian
-// le2ne ... little-endian to native-endian
-
-#if AV_HAVE_BIGENDIAN
-#define av_be2ne16(x) (x)
-#define av_be2ne32(x) (x)
-#define av_be2ne64(x) (x)
-#define av_le2ne16(x) av_bswap16(x)
-#define av_le2ne32(x) av_bswap32(x)
-#define av_le2ne64(x) av_bswap64(x)
-#define AV_BE2NEC(s, x) (x)
-#define AV_LE2NEC(s, x) AV_BSWAPC(s, x)
-#else
-#define av_be2ne16(x) av_bswap16(x)
-#define av_be2ne32(x) av_bswap32(x)
-#define av_be2ne64(x) av_bswap64(x)
-#define av_le2ne16(x) (x)
-#define av_le2ne32(x) (x)
-#define av_le2ne64(x) (x)
-#define AV_BE2NEC(s, x) AV_BSWAPC(s, x)
-#define AV_LE2NEC(s, x) (x)
-#endif
-
-#define AV_BE2NE16C(x) AV_BE2NEC(16, x)
-#define AV_BE2NE32C(x) AV_BE2NEC(32, x)
-#define AV_BE2NE64C(x) AV_BE2NEC(64, x)
-#define AV_LE2NE16C(x) AV_LE2NEC(16, x)
-#define AV_LE2NE32C(x) AV_LE2NEC(32, x)
-#define AV_LE2NE64C(x) AV_LE2NEC(64, x)
-
-#endif /* AVUTIL_BSWAP_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/channel_layout.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/channel_layout.h
deleted file mode 100644
index 15b6887..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/channel_layout.h
+++ /dev/null
@@ -1,182 +0,0 @@
-/*
- * Copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- * Copyright (c) 2008 Peter Ross
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_CHANNEL_LAYOUT_H
-#define AVUTIL_CHANNEL_LAYOUT_H
-
-#include <stdint.h>
-
-/**
- * @file
- * audio channel layout utility functions
- */
-
-/**
- * @addtogroup lavu_audio
- * @{
- */
-
-/**
- * @defgroup channel_masks Audio channel masks
- * @{
- */
-#define AV_CH_FRONT_LEFT             0x00000001
-#define AV_CH_FRONT_RIGHT            0x00000002
-#define AV_CH_FRONT_CENTER           0x00000004
-#define AV_CH_LOW_FREQUENCY          0x00000008
-#define AV_CH_BACK_LEFT              0x00000010
-#define AV_CH_BACK_RIGHT             0x00000020
-#define AV_CH_FRONT_LEFT_OF_CENTER   0x00000040
-#define AV_CH_FRONT_RIGHT_OF_CENTER  0x00000080
-#define AV_CH_BACK_CENTER            0x00000100
-#define AV_CH_SIDE_LEFT              0x00000200
-#define AV_CH_SIDE_RIGHT             0x00000400
-#define AV_CH_TOP_CENTER             0x00000800
-#define AV_CH_TOP_FRONT_LEFT         0x00001000
-#define AV_CH_TOP_FRONT_CENTER       0x00002000
-#define AV_CH_TOP_FRONT_RIGHT        0x00004000
-#define AV_CH_TOP_BACK_LEFT          0x00008000
-#define AV_CH_TOP_BACK_CENTER        0x00010000
-#define AV_CH_TOP_BACK_RIGHT         0x00020000
-#define AV_CH_STEREO_LEFT            0x20000000  ///< Stereo downmix.
-#define AV_CH_STEREO_RIGHT           0x40000000  ///< See AV_CH_STEREO_LEFT.
-#define AV_CH_WIDE_LEFT              0x0000000080000000ULL
-#define AV_CH_WIDE_RIGHT             0x0000000100000000ULL
-#define AV_CH_SURROUND_DIRECT_LEFT   0x0000000200000000ULL
-#define AV_CH_SURROUND_DIRECT_RIGHT  0x0000000400000000ULL
-#define AV_CH_LOW_FREQUENCY_2        0x0000000800000000ULL
-
-/** Channel mask value used for AVCodecContext.request_channel_layout
-    to indicate that the user requests the channel order of the decoder output
-    to be the native codec channel order. */
-#define AV_CH_LAYOUT_NATIVE          0x8000000000000000ULL
-
-/**
- * @}
- * @defgroup channel_mask_c Audio channel convenience macros
- * @{
- * */
-#define AV_CH_LAYOUT_MONO              (AV_CH_FRONT_CENTER)
-#define AV_CH_LAYOUT_STEREO            (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
-#define AV_CH_LAYOUT_2POINT1           (AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY)
-#define AV_CH_LAYOUT_2_1               (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER)
-#define AV_CH_LAYOUT_SURROUND          (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER)
-#define AV_CH_LAYOUT_3POINT1           (AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY)
-#define AV_CH_LAYOUT_4POINT0           (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER)
-#define AV_CH_LAYOUT_4POINT1           (AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY)
-#define AV_CH_LAYOUT_2_2               (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
-#define AV_CH_LAYOUT_QUAD              (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
-#define AV_CH_LAYOUT_5POINT0           (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
-#define AV_CH_LAYOUT_5POINT1           (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY)
-#define AV_CH_LAYOUT_5POINT0_BACK      (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
-#define AV_CH_LAYOUT_5POINT1_BACK      (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY)
-#define AV_CH_LAYOUT_6POINT0           (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER)
-#define AV_CH_LAYOUT_6POINT0_FRONT     (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
-#define AV_CH_LAYOUT_HEXAGONAL         (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER)
-#define AV_CH_LAYOUT_6POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER)
-#define AV_CH_LAYOUT_6POINT1_BACK      (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER)
-#define AV_CH_LAYOUT_6POINT1_FRONT     (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY)
-#define AV_CH_LAYOUT_7POINT0           (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
-#define AV_CH_LAYOUT_7POINT0_FRONT     (AV_CH_LAYOUT_5POINT0|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
-#define AV_CH_LAYOUT_7POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
-#define AV_CH_LAYOUT_7POINT1_WIDE      (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
-#define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
-#define AV_CH_LAYOUT_OCTAGONAL         (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
-#define AV_CH_LAYOUT_STEREO_DOWNMIX    (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
-
-enum AVMatrixEncoding {
-    AV_MATRIX_ENCODING_NONE,
-    AV_MATRIX_ENCODING_DOLBY,
-    AV_MATRIX_ENCODING_DPLII,
-    AV_MATRIX_ENCODING_NB
-};
-
-/**
- * @}
- */
-
-/**
- * Return a channel layout id that matches name, or 0 if no match is found.
- *
- * name can be one or several of the following notations,
- * separated by '+' or '|':
- * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0,
- *   5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix);
- * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC,
- *   SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR);
- * - a number of channels, in decimal, optionally followed by 'c', yielding
- *   the default channel layout for that number of channels (@see
- *   av_get_default_channel_layout);
- * - a channel layout mask, in hexadecimal starting with "0x" (see the
- *   AV_CH_* macros).
- *
- * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7"
- */
-uint64_t av_get_channel_layout(const char *name);
-
-/**
- * Return a description of a channel layout.
- * If nb_channels is <= 0, it is guessed from the channel_layout.
- *
- * @param buf put here the string containing the channel layout
- * @param buf_size size in bytes of the buffer
- */
-void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout);
-
-/**
- * Return the number of channels in the channel layout.
- */
-int av_get_channel_layout_nb_channels(uint64_t channel_layout);
-
-/**
- * Return default channel layout for a given number of channels.
- */
-uint64_t av_get_default_channel_layout(int nb_channels);
-
-/**
- * Get the index of a channel in channel_layout.
- *
- * @param channel a channel layout describing exactly one channel which must be
- *                present in channel_layout.
- *
- * @return index of channel in channel_layout on success, a negative AVERROR
- *         on error.
- */
-int av_get_channel_layout_channel_index(uint64_t channel_layout,
-                                        uint64_t channel);
-
-/**
- * Get the channel with the given index in channel_layout.
- */
-uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index);
-
-/**
- * Get the name of a given channel.
- *
- * @return channel name on success, NULL on error.
- */
-const char *av_get_channel_name(uint64_t channel);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_CHANNEL_LAYOUT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/common.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/common.h
deleted file mode 100644
index caa6b19..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/common.h
+++ /dev/null
@@ -1,405 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * common internal and external API header
- */
-
-#ifndef AVUTIL_COMMON_H
-#define AVUTIL_COMMON_H
-
-#include <errno.h>
-#include <inttypes.h>
-#include <limits.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include "attributes.h"
-#include "version.h"
-#include "libavutil/avconfig.h"
-
-#if AV_HAVE_BIGENDIAN
-#   define AV_NE(be, le) (be)
-#else
-#   define AV_NE(be, le) (le)
-#endif
-
-//rounded division & shift
-#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
-/* assume b>0 */
-#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
-#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
-#define FFSIGN(a) ((a) > 0 ? 1 : -1)
-
-#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
-#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
-#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
-#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
-
-#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
-#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
-#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
-
-/* misc math functions */
-
-#if FF_API_AV_REVERSE
-extern attribute_deprecated const uint8_t av_reverse[256];
-#endif
-
-#ifdef HAVE_AV_CONFIG_H
-#   include "config.h"
-#   include "intmath.h"
-#endif
-
-/* Pull in unguarded fallback defines at the end of this file. */
-#include "common.h"
-
-#ifndef av_log2
-av_const int av_log2(unsigned v);
-#endif
-
-#ifndef av_log2_16bit
-av_const int av_log2_16bit(unsigned v);
-#endif
-
-/**
- * Clip a signed integer value into the amin-amax range.
- * @param a value to clip
- * @param amin minimum value of the clip range
- * @param amax maximum value of the clip range
- * @return clipped value
- */
-static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
-{
-    if      (a < amin) return amin;
-    else if (a > amax) return amax;
-    else               return a;
-}
-
-/**
- * Clip a signed integer value into the 0-255 range.
- * @param a value to clip
- * @return clipped value
- */
-static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
-{
-    if (a&(~0xFF)) return (-a)>>31;
-    else           return a;
-}
-
-/**
- * Clip a signed integer value into the -128,127 range.
- * @param a value to clip
- * @return clipped value
- */
-static av_always_inline av_const int8_t av_clip_int8_c(int a)
-{
-    if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F;
-    else                  return a;
-}
-
-/**
- * Clip a signed integer value into the 0-65535 range.
- * @param a value to clip
- * @return clipped value
- */
-static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
-{
-    if (a&(~0xFFFF)) return (-a)>>31;
-    else             return a;
-}
-
-/**
- * Clip a signed integer value into the -32768,32767 range.
- * @param a value to clip
- * @return clipped value
- */
-static av_always_inline av_const int16_t av_clip_int16_c(int a)
-{
-    if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
-    else                      return a;
-}
-
-/**
- * Clip a signed 64-bit integer value into the -2147483648,2147483647 range.
- * @param a value to clip
- * @return clipped value
- */
-static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
-{
-    if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
-    else                                         return a;
-}
-
-/**
- * Clip a signed integer to an unsigned power of two range.
- * @param  a value to clip
- * @param  p bit position to clip at
- * @return clipped value
- */
-static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
-{
-    if (a & ~((1<<p) - 1)) return -a >> 31 & ((1<<p) - 1);
-    else                   return  a;
-}
-
-/**
- * Add two signed 32-bit values with saturation.
- *
- * @param  a one value
- * @param  b another value
- * @return sum with signed saturation
- */
-static av_always_inline int av_sat_add32_c(int a, int b)
-{
-    return av_clipl_int32((int64_t)a + b);
-}
-
-/**
- * Add a doubled value to another value with saturation at both stages.
- *
- * @param  a first value
- * @param  b value doubled and added to a
- * @return sum with signed saturation
- */
-static av_always_inline int av_sat_dadd32_c(int a, int b)
-{
-    return av_sat_add32(a, av_sat_add32(b, b));
-}
-
-/**
- * Clip a float value into the amin-amax range.
- * @param a value to clip
- * @param amin minimum value of the clip range
- * @param amax maximum value of the clip range
- * @return clipped value
- */
-static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
-{
-    if      (a < amin) return amin;
-    else if (a > amax) return amax;
-    else               return a;
-}
-
-/** Compute ceil(log2(x)).
- * @param x value used to compute ceil(log2(x))
- * @return computed ceiling of log2(x)
- */
-static av_always_inline av_const int av_ceil_log2_c(int x)
-{
-    return av_log2((x - 1) << 1);
-}
-
-/**
- * Count number of bits set to one in x
- * @param x value to count bits of
- * @return the number of bits set to one in x
- */
-static av_always_inline av_const int av_popcount_c(uint32_t x)
-{
-    x -= (x >> 1) & 0x55555555;
-    x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
-    x = (x + (x >> 4)) & 0x0F0F0F0F;
-    x += x >> 8;
-    return (x + (x >> 16)) & 0x3F;
-}
-
-/**
- * Count number of bits set to one in x
- * @param x value to count bits of
- * @return the number of bits set to one in x
- */
-static av_always_inline av_const int av_popcount64_c(uint64_t x)
-{
-    return av_popcount(x) + av_popcount(x >> 32);
-}
-
-#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
-#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
-
-/**
- * Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
- *
- * @param val      Output value, must be an lvalue of type uint32_t.
- * @param GET_BYTE Expression reading one byte from the input.
- *                 Evaluated up to 7 times (4 for the currently
- *                 assigned Unicode range).  With a memory buffer
- *                 input, this could be *ptr++.
- * @param ERROR    Expression to be evaluated on invalid input,
- *                 typically a goto statement.
- */
-#define GET_UTF8(val, GET_BYTE, ERROR)\
-    val= GET_BYTE;\
-    {\
-        uint32_t top = (val & 128) >> 1;\
-        if ((val & 0xc0) == 0x80)\
-            ERROR\
-        while (val & top) {\
-            int tmp= GET_BYTE - 128;\
-            if(tmp>>6)\
-                ERROR\
-            val= (val<<6) + tmp;\
-            top <<= 5;\
-        }\
-        val &= (top << 1) - 1;\
-    }
-
-/**
- * Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form.
- *
- * @param val       Output value, must be an lvalue of type uint32_t.
- * @param GET_16BIT Expression returning two bytes of UTF-16 data converted
- *                  to native byte order.  Evaluated one or two times.
- * @param ERROR     Expression to be evaluated on invalid input,
- *                  typically a goto statement.
- */
-#define GET_UTF16(val, GET_16BIT, ERROR)\
-    val = GET_16BIT;\
-    {\
-        unsigned int hi = val - 0xD800;\
-        if (hi < 0x800) {\
-            val = GET_16BIT - 0xDC00;\
-            if (val > 0x3FFU || hi > 0x3FFU)\
-                ERROR\
-            val += (hi<<10) + 0x10000;\
-        }\
-    }\
-
-/**
- * @def PUT_UTF8(val, tmp, PUT_BYTE)
- * Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
- * @param val is an input-only argument and should be of type uint32_t. It holds
- * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
- * val is given as a function it is executed only once.
- * @param tmp is a temporary variable and should be of type uint8_t. It
- * represents an intermediate value during conversion that is to be
- * output by PUT_BYTE.
- * @param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
- * It could be a function or a statement, and uses tmp as the input byte.
- * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
- * executed up to 4 times for values in the valid UTF-8 range and up to
- * 7 times in the general case, depending on the length of the converted
- * Unicode character.
- */
-#define PUT_UTF8(val, tmp, PUT_BYTE)\
-    {\
-        int bytes, shift;\
-        uint32_t in = val;\
-        if (in < 0x80) {\
-            tmp = in;\
-            PUT_BYTE\
-        } else {\
-            bytes = (av_log2(in) + 4) / 5;\
-            shift = (bytes - 1) * 6;\
-            tmp = (256 - (256 >> bytes)) | (in >> shift);\
-            PUT_BYTE\
-            while (shift >= 6) {\
-                shift -= 6;\
-                tmp = 0x80 | ((in >> shift) & 0x3f);\
-                PUT_BYTE\
-            }\
-        }\
-    }
-
-/**
- * @def PUT_UTF16(val, tmp, PUT_16BIT)
- * Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
- * @param val is an input-only argument and should be of type uint32_t. It holds
- * a UCS-4 encoded Unicode character that is to be converted to UTF-16. If
- * val is given as a function it is executed only once.
- * @param tmp is a temporary variable and should be of type uint16_t. It
- * represents an intermediate value during conversion that is to be
- * output by PUT_16BIT.
- * @param PUT_16BIT writes the converted UTF-16 data to any proper destination
- * in desired endianness. It could be a function or a statement, and uses tmp
- * as the input byte.  For example, PUT_BYTE could be "*output++ = tmp;"
- * PUT_BYTE will be executed 1 or 2 times depending on input character.
- */
-#define PUT_UTF16(val, tmp, PUT_16BIT)\
-    {\
-        uint32_t in = val;\
-        if (in < 0x10000) {\
-            tmp = in;\
-            PUT_16BIT\
-        } else {\
-            tmp = 0xD800 | ((in - 0x10000) >> 10);\
-            PUT_16BIT\
-            tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\
-            PUT_16BIT\
-        }\
-    }\
-
-
-
-#include "mem.h"
-
-#ifdef HAVE_AV_CONFIG_H
-#    include "internal.h"
-#endif /* HAVE_AV_CONFIG_H */
-
-#endif /* AVUTIL_COMMON_H */
-
-/*
- * The following definitions are outside the multiple inclusion guard
- * to ensure they are immediately available in intmath.h.
- */
-
-#ifndef av_ceil_log2
-#   define av_ceil_log2     av_ceil_log2_c
-#endif
-#ifndef av_clip
-#   define av_clip          av_clip_c
-#endif
-#ifndef av_clip_uint8
-#   define av_clip_uint8    av_clip_uint8_c
-#endif
-#ifndef av_clip_int8
-#   define av_clip_int8     av_clip_int8_c
-#endif
-#ifndef av_clip_uint16
-#   define av_clip_uint16   av_clip_uint16_c
-#endif
-#ifndef av_clip_int16
-#   define av_clip_int16    av_clip_int16_c
-#endif
-#ifndef av_clipl_int32
-#   define av_clipl_int32   av_clipl_int32_c
-#endif
-#ifndef av_clip_uintp2
-#   define av_clip_uintp2   av_clip_uintp2_c
-#endif
-#ifndef av_sat_add32
-#   define av_sat_add32     av_sat_add32_c
-#endif
-#ifndef av_sat_dadd32
-#   define av_sat_dadd32    av_sat_dadd32_c
-#endif
-#ifndef av_clipf
-#   define av_clipf         av_clipf_c
-#endif
-#ifndef av_popcount
-#   define av_popcount      av_popcount_c
-#endif
-#ifndef av_popcount64
-#   define av_popcount64    av_popcount64_c
-#endif
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/cpu.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/cpu.h
deleted file mode 100644
index 8f2af28..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/cpu.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_CPU_H
-#define AVUTIL_CPU_H
-
-#include "version.h"
-
-#define AV_CPU_FLAG_FORCE    0x80000000 /* force usage of selected flags (OR) */
-
-    /* lower 16 bits - CPU features */
-#define AV_CPU_FLAG_MMX          0x0001 ///< standard MMX
-#define AV_CPU_FLAG_MMXEXT       0x0002 ///< SSE integer functions or AMD MMX ext
-#if FF_API_CPU_FLAG_MMX2
-#define AV_CPU_FLAG_MMX2         0x0002 ///< SSE integer functions or AMD MMX ext
-#endif
-#define AV_CPU_FLAG_3DNOW        0x0004 ///< AMD 3DNOW
-#define AV_CPU_FLAG_SSE          0x0008 ///< SSE functions
-#define AV_CPU_FLAG_SSE2         0x0010 ///< PIV SSE2 functions
-#define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster
-#define AV_CPU_FLAG_3DNOWEXT     0x0020 ///< AMD 3DNowExt
-#define AV_CPU_FLAG_SSE3         0x0040 ///< Prescott SSE3 functions
-#define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster
-#define AV_CPU_FLAG_SSSE3        0x0080 ///< Conroe SSSE3 functions
-#define AV_CPU_FLAG_ATOM     0x10000000 ///< Atom processor, some SSSE3 instructions are slower
-#define AV_CPU_FLAG_SSE4         0x0100 ///< Penryn SSE4.1 functions
-#define AV_CPU_FLAG_SSE42        0x0200 ///< Nehalem SSE4.2 functions
-#define AV_CPU_FLAG_AVX          0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used
-#define AV_CPU_FLAG_XOP          0x0400 ///< Bulldozer XOP functions
-#define AV_CPU_FLAG_FMA4         0x0800 ///< Bulldozer FMA4 functions
-#define AV_CPU_FLAG_CMOV         0x1000 ///< i686 cmov
-
-#define AV_CPU_FLAG_ALTIVEC      0x0001 ///< standard
-
-#define AV_CPU_FLAG_ARMV5TE      (1 << 0)
-#define AV_CPU_FLAG_ARMV6        (1 << 1)
-#define AV_CPU_FLAG_ARMV6T2      (1 << 2)
-#define AV_CPU_FLAG_VFP          (1 << 3)
-#define AV_CPU_FLAG_VFPV3        (1 << 4)
-#define AV_CPU_FLAG_NEON         (1 << 5)
-
-/**
- * Return the flags which specify extensions supported by the CPU.
- */
-int av_get_cpu_flags(void);
-
-/**
- * Set a mask on flags returned by av_get_cpu_flags().
- * This function is mainly useful for testing.
- *
- * @warning this function is not thread safe.
- */
-void av_set_cpu_flags_mask(int mask);
-
-/**
- * Parse CPU flags from a string.
- *
- * @return a combination of AV_CPU_* flags, negative on error.
- */
-int av_parse_cpu_flags(const char *s);
-
-/**
- * @return the number of logical CPU cores present.
- */
-int av_cpu_count(void);
-
-#endif /* AVUTIL_CPU_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/dict.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/dict.h
deleted file mode 100644
index ab23f26..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/dict.h
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * Public dictionary API.
- */
-
-#ifndef AVUTIL_DICT_H
-#define AVUTIL_DICT_H
-
-/**
- * @addtogroup lavu_dict AVDictionary
- * @ingroup lavu_data
- *
- * @brief Simple key:value store
- *
- * @{
- * Dictionaries are used for storing key:value pairs. To create
- * an AVDictionary, simply pass an address of a NULL pointer to
- * av_dict_set(). NULL can be used as an empty dictionary wherever
- * a pointer to an AVDictionary is required.
- * Use av_dict_get() to retrieve an entry or iterate over all
- * entries and finally av_dict_free() to free the dictionary
- * and all its contents.
- *
- * @code
- * AVDictionary *d = NULL;                // "create" an empty dictionary
- * av_dict_set(&d, "foo", "bar", 0);      // add an entry
- *
- * char *k = av_strdup("key");            // if your strings are already allocated,
- * char *v = av_strdup("value");          // you can avoid copying them like this
- * av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
- *
- * AVDictionaryEntry *t = NULL;
- * while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) {
- *     <....>                             // iterate over all entries in d
- * }
- *
- * av_dict_free(&d);
- * @endcode
- *
- */
-
-#define AV_DICT_MATCH_CASE      1
-#define AV_DICT_IGNORE_SUFFIX   2
-#define AV_DICT_DONT_STRDUP_KEY 4   /**< Take ownership of a key that's been
-                                         allocated with av_malloc() and children. */
-#define AV_DICT_DONT_STRDUP_VAL 8   /**< Take ownership of a value that's been
-                                         allocated with av_malloc() and chilren. */
-#define AV_DICT_DONT_OVERWRITE 16   ///< Don't overwrite existing entries.
-#define AV_DICT_APPEND         32   /**< If the entry already exists, append to it.  Note that no
-                                      delimiter is added, the strings are simply concatenated. */
-
-typedef struct AVDictionaryEntry {
-    char *key;
-    char *value;
-} AVDictionaryEntry;
-
-typedef struct AVDictionary AVDictionary;
-
-/**
- * Get a dictionary entry with matching key.
- *
- * @param prev Set to the previous matching element to find the next.
- *             If set to NULL the first matching element is returned.
- * @param flags Allows case as well as suffix-insensitive comparisons.
- * @return Found entry or NULL, changing key or value leads to undefined behavior.
- */
-AVDictionaryEntry *
-av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
-
-/**
- * Get number of entries in dictionary.
- *
- * @param m dictionary
- * @return  number of entries in dictionary
- */
-int av_dict_count(const AVDictionary *m);
-
-/**
- * Set the given entry in *pm, overwriting an existing entry.
- *
- * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL
- * a dictionary struct is allocated and put in *pm.
- * @param key entry key to add to *pm (will be av_strduped depending on flags)
- * @param value entry value to add to *pm (will be av_strduped depending on flags).
- *        Passing a NULL value will cause an existing entry to be deleted.
- * @return >= 0 on success otherwise an error code <0
- */
-int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags);
-
-/**
- * Parse the key/value pairs list and add to a dictionary.
- *
- * @param key_val_sep  a 0-terminated list of characters used to separate
- *                     key from value
- * @param pairs_sep    a 0-terminated list of characters used to separate
- *                     two pairs from each other
- * @param flags        flags to use when adding to dictionary.
- *                     AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL
- *                     are ignored since the key/value tokens will always
- *                     be duplicated.
- * @return             0 on success, negative AVERROR code on failure
- */
-int av_dict_parse_string(AVDictionary **pm, const char *str,
-                         const char *key_val_sep, const char *pairs_sep,
-                         int flags);
-
-/**
- * Copy entries from one AVDictionary struct into another.
- * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL,
- *            this function will allocate a struct for you and put it in *dst
- * @param src pointer to source AVDictionary struct
- * @param flags flags to use when setting entries in *dst
- * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
- */
-void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags);
-
-/**
- * Free all the memory allocated for an AVDictionary struct
- * and all keys and values.
- */
-void av_dict_free(AVDictionary **m);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_DICT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/error.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/error.h
deleted file mode 100644
index 3dfd880..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/error.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * error code definitions
- */
-
-#ifndef AVUTIL_ERROR_H
-#define AVUTIL_ERROR_H
-
-#include <errno.h>
-#include <stddef.h>
-#include "avutil.h"
-
-/**
- * @addtogroup lavu_error
- *
- * @{
- */
-
-
-/* error handling */
-#if EDOM > 0
-#define AVERROR(e) (-(e))   ///< Returns a negative error code from a POSIX error code, to return from library functions.
-#define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value.
-#else
-/* Some platforms have E* and errno already negated. */
-#define AVERROR(e) (e)
-#define AVUNERROR(e) (e)
-#endif
-
-#define AVERROR_BSF_NOT_FOUND      (-0x39acbd08) ///< Bitstream filter not found
-#define AVERROR_DECODER_NOT_FOUND  (-0x3cbabb08) ///< Decoder not found
-#define AVERROR_DEMUXER_NOT_FOUND  (-0x32babb08) ///< Demuxer not found
-#define AVERROR_ENCODER_NOT_FOUND  (-0x3cb1ba08) ///< Encoder not found
-#define AVERROR_EOF                (-0x5fb9b0bb) ///< End of file
-#define AVERROR_EXIT               (-0x2bb6a7bb) ///< Immediate exit was requested; the called function should not be restarted
-#define AVERROR_FILTER_NOT_FOUND   (-0x33b6b908) ///< Filter not found
-#define AVERROR_INVALIDDATA        (-0x3ebbb1b7) ///< Invalid data found when processing input
-#define AVERROR_MUXER_NOT_FOUND    (-0x27aab208) ///< Muxer not found
-#define AVERROR_OPTION_NOT_FOUND   (-0x2bafb008) ///< Option not found
-#define AVERROR_PATCHWELCOME       (-0x3aa8beb0) ///< Not yet implemented in Libav, patches welcome
-#define AVERROR_PROTOCOL_NOT_FOUND (-0x30adaf08) ///< Protocol not found
-#define AVERROR_STREAM_NOT_FOUND   (-0x2dabac08) ///< Stream not found
-#define AVERROR_BUG                (-0x5fb8aabe) ///< Bug detected, please report the issue
-#define AVERROR_UNKNOWN            (-0x31b4b1ab) ///< Unknown error, typically from an external library
-#define AVERROR_EXPERIMENTAL       (-0x2bb2afa8) ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it.
-
-/**
- * Put a description of the AVERROR code errnum in errbuf.
- * In case of failure the global variable errno is set to indicate the
- * error. Even in case of failure av_strerror() will print a generic
- * error message indicating the errnum provided to errbuf.
- *
- * @param errnum      error code to describe
- * @param errbuf      buffer to which description is written
- * @param errbuf_size the size in bytes of errbuf
- * @return 0 on success, a negative value if a description for errnum
- * cannot be found
- */
-int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_ERROR_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/frame.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/frame.h
deleted file mode 100644
index d71948d..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/frame.h
+++ /dev/null
@@ -1,491 +0,0 @@
-/*
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_FRAME_H
-#define AVUTIL_FRAME_H
-
-#include <stdint.h>
-
-#include "libavcodec/version.h"
-
-#include "avutil.h"
-#include "buffer.h"
-#include "dict.h"
-#include "rational.h"
-#include "samplefmt.h"
-
-enum AVFrameSideDataType {
-    /**
-     * The data is the AVPanScan struct defined in libavcodec.
-     */
-    AV_FRAME_DATA_PANSCAN,
-};
-
-typedef struct AVFrameSideData {
-    enum AVFrameSideDataType type;
-    uint8_t *data;
-    int      size;
-    AVDictionary *metadata;
-} AVFrameSideData;
-
-/**
- * This structure describes decoded (raw) audio or video data.
- *
- * AVFrame must be allocated using av_frame_alloc(). Not that this only
- * allocates the AVFrame itself, the buffers for the data must be managed
- * through other means (see below).
- * AVFrame must be freed with av_frame_free().
- *
- * AVFrame is typically allocated once and then reused multiple times to hold
- * different data (e.g. a single AVFrame to hold frames received from a
- * decoder). In such a case, av_frame_unref() will free any references held by
- * the frame and reset it to its original clean state before it
- * is reused again.
- *
- * The data described by an AVFrame is usually reference counted through the
- * AVBuffer API. The underlying buffer references are stored in AVFrame.buf /
- * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at
- * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case,
- * every single data plane must be contained in one of the buffers in
- * AVFrame.buf or AVFrame.extended_buf.
- * There may be a single buffer for all the data, or one separate buffer for
- * each plane, or anything in between.
- *
- * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added
- * to the end with a minor bump.
- */
-typedef struct AVFrame {
-#define AV_NUM_DATA_POINTERS 8
-    /**
-     * pointer to the picture/channel planes.
-     * This might be different from the first allocated byte
-     */
-    uint8_t *data[AV_NUM_DATA_POINTERS];
-
-    /**
-     * For video, size in bytes of each picture line.
-     * For audio, size in bytes of each plane.
-     *
-     * For audio, only linesize[0] may be set. For planar audio, each channel
-     * plane must be the same size.
-     */
-    int linesize[AV_NUM_DATA_POINTERS];
-
-    /**
-     * pointers to the data planes/channels.
-     *
-     * For video, this should simply point to data[].
-     *
-     * For planar audio, each channel has a separate data pointer, and
-     * linesize[0] contains the size of each channel buffer.
-     * For packed audio, there is just one data pointer, and linesize[0]
-     * contains the total size of the buffer for all channels.
-     *
-     * Note: Both data and extended_data should always be set in a valid frame,
-     * but for planar audio with more channels that can fit in data,
-     * extended_data must be used in order to access all channels.
-     */
-    uint8_t **extended_data;
-
-    /**
-     * width and height of the video frame
-     */
-    int width, height;
-
-    /**
-     * number of audio samples (per channel) described by this frame
-     */
-    int nb_samples;
-
-    /**
-     * format of the frame, -1 if unknown or unset
-     * Values correspond to enum AVPixelFormat for video frames,
-     * enum AVSampleFormat for audio)
-     */
-    int format;
-
-    /**
-     * 1 -> keyframe, 0-> not
-     */
-    int key_frame;
-
-    /**
-     * Picture type of the frame.
-     */
-    enum AVPictureType pict_type;
-
-#if FF_API_AVFRAME_LAVC
-    attribute_deprecated
-    uint8_t *base[AV_NUM_DATA_POINTERS];
-#endif
-
-    /**
-     * Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
-     */
-    AVRational sample_aspect_ratio;
-
-    /**
-     * Presentation timestamp in time_base units (time when frame should be shown to user).
-     */
-    int64_t pts;
-
-    /**
-     * PTS copied from the AVPacket that was decoded to produce this frame.
-     */
-    int64_t pkt_pts;
-
-    /**
-     * DTS copied from the AVPacket that triggered returning this frame.
-     */
-    int64_t pkt_dts;
-
-    /**
-     * picture number in bitstream order
-     */
-    int coded_picture_number;
-    /**
-     * picture number in display order
-     */
-    int display_picture_number;
-
-    /**
-     * quality (between 1 (good) and FF_LAMBDA_MAX (bad))
-     */
-    int quality;
-
-#if FF_API_AVFRAME_LAVC
-    attribute_deprecated
-    int reference;
-
-    /**
-     * QP table
-     */
-    attribute_deprecated
-    int8_t *qscale_table;
-    /**
-     * QP store stride
-     */
-    attribute_deprecated
-    int qstride;
-
-    attribute_deprecated
-    int qscale_type;
-
-    /**
-     * mbskip_table[mb]>=1 if MB didn't change
-     * stride= mb_width = (width+15)>>4
-     */
-    attribute_deprecated
-    uint8_t *mbskip_table;
-
-    /**
-     * motion vector table
-     * @code
-     * example:
-     * int mv_sample_log2= 4 - motion_subsample_log2;
-     * int mb_width= (width+15)>>4;
-     * int mv_stride= (mb_width << mv_sample_log2) + 1;
-     * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];
-     * @endcode
-     */
-    attribute_deprecated
-    int16_t (*motion_val[2])[2];
-
-    /**
-     * macroblock type table
-     * mb_type_base + mb_width + 2
-     */
-    attribute_deprecated
-    uint32_t *mb_type;
-
-    /**
-     * DCT coefficients
-     */
-    attribute_deprecated
-    short *dct_coeff;
-
-    /**
-     * motion reference frame index
-     * the order in which these are stored can depend on the codec.
-     */
-    attribute_deprecated
-    int8_t *ref_index[2];
-#endif
-
-    /**
-     * for some private data of the user
-     */
-    void *opaque;
-
-    /**
-     * error
-     */
-    uint64_t error[AV_NUM_DATA_POINTERS];
-
-#if FF_API_AVFRAME_LAVC
-    attribute_deprecated
-    int type;
-#endif
-
-    /**
-     * When decoding, this signals how much the picture must be delayed.
-     * extra_delay = repeat_pict / (2*fps)
-     */
-    int repeat_pict;
-
-    /**
-     * The content of the picture is interlaced.
-     */
-    int interlaced_frame;
-
-    /**
-     * If the content is interlaced, is top field displayed first.
-     */
-    int top_field_first;
-
-    /**
-     * Tell user application that palette has changed from previous frame.
-     */
-    int palette_has_changed;
-
-#if FF_API_AVFRAME_LAVC
-    attribute_deprecated
-    int buffer_hints;
-
-    /**
-     * Pan scan.
-     */
-    attribute_deprecated
-    struct AVPanScan *pan_scan;
-#endif
-
-    /**
-     * reordered opaque 64bit (generally an integer or a double precision float
-     * PTS but can be anything).
-     * The user sets AVCodecContext.reordered_opaque to represent the input at
-     * that time,
-     * the decoder reorders values as needed and sets AVFrame.reordered_opaque
-     * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque
-     * @deprecated in favor of pkt_pts
-     */
-    int64_t reordered_opaque;
-
-#if FF_API_AVFRAME_LAVC
-    /**
-     * @deprecated this field is unused
-     */
-    attribute_deprecated void *hwaccel_picture_private;
-
-    attribute_deprecated
-    struct AVCodecContext *owner;
-    attribute_deprecated
-    void *thread_opaque;
-
-    /**
-     * log2 of the size of the block which a single vector in motion_val represents:
-     * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)
-     */
-    attribute_deprecated
-    uint8_t motion_subsample_log2;
-#endif
-
-    /**
-     * Sample rate of the audio data.
-     */
-    int sample_rate;
-
-    /**
-     * Channel layout of the audio data.
-     */
-    uint64_t channel_layout;
-
-    /**
-     * AVBuffer references backing the data for this frame. If all elements of
-     * this array are NULL, then this frame is not reference counted.
-     *
-     * There may be at most one AVBuffer per data plane, so for video this array
-     * always contains all the references. For planar audio with more than
-     * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in
-     * this array. Then the extra AVBufferRef pointers are stored in the
-     * extended_buf array.
-     */
-    AVBufferRef *buf[AV_NUM_DATA_POINTERS];
-
-    /**
-     * For planar audio which requires more than AV_NUM_DATA_POINTERS
-     * AVBufferRef pointers, this array will hold all the references which
-     * cannot fit into AVFrame.buf.
-     *
-     * Note that this is different from AVFrame.extended_data, which always
-     * contains all the pointers. This array only contains the extra pointers,
-     * which cannot fit into AVFrame.buf.
-     *
-     * This array is always allocated using av_malloc() by whoever constructs
-     * the frame. It is freed in av_frame_unref().
-     */
-    AVBufferRef **extended_buf;
-    /**
-     * Number of elements in extended_buf.
-     */
-    int        nb_extended_buf;
-
-    AVFrameSideData **side_data;
-    int            nb_side_data;
-} AVFrame;
-
-/**
- * Allocate an AVFrame and set its fields to default values.  The resulting
- * struct must be freed using av_frame_free().
- *
- * @return An AVFrame filled with default values or NULL on failure.
- *
- * @note this only allocates the AVFrame itself, not the data buffers. Those
- * must be allocated through other means, e.g. with av_frame_get_buffer() or
- * manually.
- */
-AVFrame *av_frame_alloc(void);
-
-/**
- * Free the frame and any dynamically allocated objects in it,
- * e.g. extended_data. If the frame is reference counted, it will be
- * unreferenced first.
- *
- * @param frame frame to be freed. The pointer will be set to NULL.
- */
-void av_frame_free(AVFrame **frame);
-
-/**
- * Setup a new reference to the data described by an given frame.
- *
- * Copy frame properties from src to dst and create a new reference for each
- * AVBufferRef from src.
- *
- * If src is not reference counted, new buffers are allocated and the data is
- * copied.
- *
- * @return 0 on success, a negative AVERROR on error
- */
-int av_frame_ref(AVFrame *dst, AVFrame *src);
-
-/**
- * Create a new frame that references the same data as src.
- *
- * This is a shortcut for av_frame_alloc()+av_frame_ref().
- *
- * @return newly created AVFrame on success, NULL on error.
- */
-AVFrame *av_frame_clone(AVFrame *src);
-
-/**
- * Unreference all the buffers referenced by frame and reset the frame fields.
- */
-void av_frame_unref(AVFrame *frame);
-
-/**
- * Move everythnig contained in src to dst and reset src.
- */
-void av_frame_move_ref(AVFrame *dst, AVFrame *src);
-
-/**
- * Allocate new buffer(s) for audio or video data.
- *
- * The following fields must be set on frame before calling this function:
- * - format (pixel format for video, sample format for audio)
- * - width and height for video
- * - nb_samples and channel_layout for audio
- *
- * This function will fill AVFrame.data and AVFrame.buf arrays and, if
- * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf.
- * For planar formats, one buffer will be allocated for each plane.
- *
- * @param frame frame in which to store the new buffers.
- * @param align required buffer size alignment
- *
- * @return 0 on success, a negative AVERROR on error.
- */
-int av_frame_get_buffer(AVFrame *frame, int align);
-
-/**
- * Check if the frame data is writable.
- *
- * @return A positive value if the frame data is writable (which is true if and
- * only if each of the underlying buffers has only one reference, namely the one
- * stored in this frame). Return 0 otherwise.
- *
- * If 1 is returned the answer is valid until av_buffer_ref() is called on any
- * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly).
- *
- * @see av_frame_make_writable(), av_buffer_is_writable()
- */
-int av_frame_is_writable(AVFrame *frame);
-
-/**
- * Ensure that the frame data is writable, avoiding data copy if possible.
- *
- * Do nothing if the frame is writable, allocate new buffers and copy the data
- * if it is not.
- *
- * @return 0 on success, a negative AVERROR on error.
- *
- * @see av_frame_is_writable(), av_buffer_is_writable(),
- * av_buffer_make_writable()
- */
-int av_frame_make_writable(AVFrame *frame);
-
-/**
- * Copy only "metadata" fields from src to dst.
- *
- * Metadata for the purpose of this function are those fields that do not affect
- * the data layout in the buffers.  E.g. pts, sample rate (for audio) or sample
- * aspect ratio (for video), but not width/height or channel layout.
- * Side data is also copied.
- */
-int av_frame_copy_props(AVFrame *dst, const AVFrame *src);
-
-/**
- * Get the buffer reference a given data plane is stored in.
- *
- * @param plane index of the data plane of interest in frame->extended_data.
- *
- * @return the buffer reference that contains the plane or NULL if the input
- * frame is not valid.
- */
-AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane);
-
-/**
- * Add a new side data to a frame.
- *
- * @param frame a frame to which the side data should be added
- * @param type type of the added side data
- * @param size size of the side data
- *
- * @return newly added side data on success, NULL on error
- */
-AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
-                                        enum AVFrameSideDataType type,
-                                        int size);
-
-/**
- * @return a pointer to the side data of a given type on success, NULL if there
- * is no side data with such type in this frame.
- */
-AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
-                                        enum AVFrameSideDataType type);
-
-#endif /* AVUTIL_FRAME_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat_readwrite.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat_readwrite.h
deleted file mode 100644
index f093b92..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat_readwrite.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * copyright (c) 2005 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_INTFLOAT_READWRITE_H
-#define AVUTIL_INTFLOAT_READWRITE_H
-
-#include <stdint.h>
-#include "attributes.h"
-
-/* IEEE 80 bits extended float */
-typedef struct AVExtFloat  {
-    uint8_t exponent[2];
-    uint8_t mantissa[8];
-} AVExtFloat;
-
-attribute_deprecated double av_int2dbl(int64_t v) av_const;
-attribute_deprecated float av_int2flt(int32_t v) av_const;
-attribute_deprecated double av_ext2dbl(const AVExtFloat ext) av_const;
-attribute_deprecated int64_t av_dbl2int(double d) av_const;
-attribute_deprecated int32_t av_flt2int(float d) av_const;
-attribute_deprecated AVExtFloat av_dbl2ext(double d) av_const;
-
-#endif /* AVUTIL_INTFLOAT_READWRITE_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/log.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/log.h
deleted file mode 100644
index 7b17330..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/log.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_LOG_H
-#define AVUTIL_LOG_H
-
-#include <stdarg.h>
-#include "avutil.h"
-#include "attributes.h"
-
-/**
- * Describe the class of an AVClass context structure. That is an
- * arbitrary struct of which the first field is a pointer to an
- * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
- */
-typedef struct AVClass {
-    /**
-     * The name of the class; usually it is the same name as the
-     * context structure type to which the AVClass is associated.
-     */
-    const char* class_name;
-
-    /**
-     * A pointer to a function which returns the name of a context
-     * instance ctx associated with the class.
-     */
-    const char* (*item_name)(void* ctx);
-
-    /**
-     * a pointer to the first option specified in the class if any or NULL
-     *
-     * @see av_set_default_options()
-     */
-    const struct AVOption *option;
-
-    /**
-     * LIBAVUTIL_VERSION with which this structure was created.
-     * This is used to allow fields to be added without requiring major
-     * version bumps everywhere.
-     */
-
-    int version;
-
-    /**
-     * Offset in the structure where log_level_offset is stored.
-     * 0 means there is no such variable
-     */
-    int log_level_offset_offset;
-
-    /**
-     * Offset in the structure where a pointer to the parent context for
-     * logging is stored. For example a decoder could pass its AVCodecContext
-     * to eval as such a parent context, which an av_log() implementation
-     * could then leverage to display the parent context.
-     * The offset can be NULL.
-     */
-    int parent_log_context_offset;
-
-    /**
-     * Return next AVOptions-enabled child or NULL
-     */
-    void* (*child_next)(void *obj, void *prev);
-
-    /**
-     * Return an AVClass corresponding to the next potential
-     * AVOptions-enabled child.
-     *
-     * The difference between child_next and this is that
-     * child_next iterates over _already existing_ objects, while
-     * child_class_next iterates over _all possible_ children.
-     */
-    const struct AVClass* (*child_class_next)(const struct AVClass *prev);
-} AVClass;
-
-/* av_log API */
-
-#define AV_LOG_QUIET    -8
-
-/**
- * Something went really wrong and we will crash now.
- */
-#define AV_LOG_PANIC     0
-
-/**
- * Something went wrong and recovery is not possible.
- * For example, no header was found for a format which depends
- * on headers or an illegal combination of parameters is used.
- */
-#define AV_LOG_FATAL     8
-
-/**
- * Something went wrong and cannot losslessly be recovered.
- * However, not all future data is affected.
- */
-#define AV_LOG_ERROR    16
-
-/**
- * Something somehow does not look correct. This may or may not
- * lead to problems. An example would be the use of '-vstrict -2'.
- */
-#define AV_LOG_WARNING  24
-
-#define AV_LOG_INFO     32
-#define AV_LOG_VERBOSE  40
-
-/**
- * Stuff which is only useful for libav* developers.
- */
-#define AV_LOG_DEBUG    48
-
-/**
- * Send the specified message to the log if the level is less than or equal
- * to the current av_log_level. By default, all logging messages are sent to
- * stderr. This behavior can be altered by setting a different av_vlog callback
- * function.
- *
- * @param avcl A pointer to an arbitrary struct of which the first field is a
- * pointer to an AVClass struct.
- * @param level The importance level of the message, lower values signifying
- * higher importance.
- * @param fmt The format string (printf-compatible) that specifies how
- * subsequent arguments are converted to output.
- * @see av_vlog
- */
-void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
-
-void av_vlog(void *avcl, int level, const char *fmt, va_list);
-int av_log_get_level(void);
-void av_log_set_level(int);
-void av_log_set_callback(void (*)(void*, int, const char*, va_list));
-void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl);
-const char* av_default_item_name(void* ctx);
-
-/**
- * av_dlog macros
- * Useful to print debug messages that shouldn't get compiled in normally.
- */
-
-#ifdef DEBUG
-#    define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
-#else
-#    define av_dlog(pctx, ...)
-#endif
-
-/**
- * Skip repeated messages, this requires the user app to use av_log() instead of
- * (f)printf as the 2 would otherwise interfere and lead to
- * "Last message repeated x times" messages below (f)printf messages with some
- * bad luck.
- * Also to receive the last, "last repeated" line if any, the user app must
- * call av_log(NULL, AV_LOG_QUIET, ""); at the end
- */
-#define AV_LOG_SKIP_REPEATED 1
-void av_log_set_flags(int arg);
-
-#endif /* AVUTIL_LOG_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mem.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mem.h
deleted file mode 100644
index 8a4fcd9..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mem.h
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-/**
- * @file
- * memory handling functions
- */
-
-#ifndef AVUTIL_MEM_H
-#define AVUTIL_MEM_H
-
-#include <limits.h>
-#include <stdint.h>
-
-#include "attributes.h"
-#include "avutil.h"
-
-/**
- * @addtogroup lavu_mem
- * @{
- */
-
-
-#if defined(__ICC) && __ICC < 1200 || defined(__SUNPRO_C)
-    #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
-    #define DECLARE_ASM_CONST(n,t,v)    const t __attribute__ ((aligned (n))) v
-#elif defined(__TI_COMPILER_VERSION__)
-    #define DECLARE_ALIGNED(n,t,v)                      \
-        AV_PRAGMA(DATA_ALIGN(v,n))                      \
-        t __attribute__((aligned(n))) v
-    #define DECLARE_ASM_CONST(n,t,v)                    \
-        AV_PRAGMA(DATA_ALIGN(v,n))                      \
-        static const t __attribute__((aligned(n))) v
-#elif defined(__GNUC__)
-    #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
-    #define DECLARE_ASM_CONST(n,t,v)    static const t av_used __attribute__ ((aligned (n))) v
-#elif defined(_MSC_VER)
-    #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
-    #define DECLARE_ASM_CONST(n,t,v)    __declspec(align(n)) static const t v
-#else
-    #define DECLARE_ALIGNED(n,t,v)      t v
-    #define DECLARE_ASM_CONST(n,t,v)    static const t v
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(3,1)
-    #define av_malloc_attrib __attribute__((__malloc__))
-#else
-    #define av_malloc_attrib
-#endif
-
-#if AV_GCC_VERSION_AT_LEAST(4,3)
-    #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
-#else
-    #define av_alloc_size(...)
-#endif
-
-/**
- * Allocate a block of size bytes with alignment suitable for all
- * memory accesses (including vectors if available on the CPU).
- * @param size Size in bytes for the memory block to be allocated.
- * @return Pointer to the allocated block, NULL if the block cannot
- * be allocated.
- * @see av_mallocz()
- */
-void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
-
-/**
- * Helper function to allocate a block of size * nmemb bytes with
- * using av_malloc()
- * @param nmemb Number of elements
- * @param size Size of the single element
- * @return Pointer to the allocated block, NULL if the block cannot
- * be allocated.
- * @see av_malloc()
- */
-av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size)
-{
-    if (size <= 0 || nmemb >= INT_MAX / size)
-        return NULL;
-    return av_malloc(nmemb * size);
-}
-
-/**
- * Allocate or reallocate a block of memory.
- * If ptr is NULL and size > 0, allocate a new block. If
- * size is zero, free the memory block pointed to by ptr.
- * @param ptr Pointer to a memory block already allocated with
- * av_malloc(z)() or av_realloc() or NULL.
- * @param size Size in bytes for the memory block to be allocated or
- * reallocated.
- * @return Pointer to a newly reallocated block or NULL if the block
- * cannot be reallocated or the function is used to free the memory block.
- * @see av_fast_realloc()
- */
-void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
-
-/**
- * Allocate or reallocate an array.
- * If ptr is NULL and nmemb > 0, allocate a new block. If
- * nmemb is zero, free the memory block pointed to by ptr.
- * @param ptr Pointer to a memory block already allocated with
- * av_malloc(z)() or av_realloc() or NULL.
- * @param nmemb Number of elements
- * @param size Size of the single element
- * @return Pointer to a newly reallocated block or NULL if the block
- * cannot be reallocated or the function is used to free the memory block.
- */
-av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size);
-
-/**
- * Allocate or reallocate an array.
- * If *ptr is NULL and nmemb > 0, allocate a new block. If
- * nmemb is zero, free the memory block pointed to by ptr.
- * @param ptr Pointer to a pointer to a memory block already allocated
- * with av_malloc(z)() or av_realloc(), or pointer to a pointer to NULL.
- * The pointer is updated on success, or freed on failure.
- * @param nmemb Number of elements
- * @param size Size of the single element
- * @return Zero on success, an AVERROR error code on failure.
- */
-av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
-
-/**
- * Free a memory block which has been allocated with av_malloc(z)() or
- * av_realloc().
- * @param ptr Pointer to the memory block which should be freed.
- * @note ptr = NULL is explicitly allowed.
- * @note It is recommended that you use av_freep() instead.
- * @see av_freep()
- */
-void av_free(void *ptr);
-
-/**
- * Allocate a block of size bytes with alignment suitable for all
- * memory accesses (including vectors if available on the CPU) and
- * zero all the bytes of the block.
- * @param size Size in bytes for the memory block to be allocated.
- * @return Pointer to the allocated block, NULL if it cannot be allocated.
- * @see av_malloc()
- */
-void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
-
-/**
- * Helper function to allocate a block of size * nmemb bytes with
- * using av_mallocz()
- * @param nmemb Number of elements
- * @param size Size of the single element
- * @return Pointer to the allocated block, NULL if the block cannot
- * be allocated.
- * @see av_mallocz()
- * @see av_malloc_array()
- */
-av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
-{
-    if (size <= 0 || nmemb >= INT_MAX / size)
-        return NULL;
-    return av_mallocz(nmemb * size);
-}
-
-/**
- * Duplicate the string s.
- * @param s string to be duplicated
- * @return Pointer to a newly allocated string containing a
- * copy of s or NULL if the string cannot be allocated.
- */
-char *av_strdup(const char *s) av_malloc_attrib;
-
-/**
- * Free a memory block which has been allocated with av_malloc(z)() or
- * av_realloc() and set the pointer pointing to it to NULL.
- * @param ptr Pointer to the pointer to the memory block which should
- * be freed.
- * @see av_free()
- */
-void av_freep(void *ptr);
-
-/**
- * @brief deliberately overlapping memcpy implementation
- * @param dst destination buffer
- * @param back how many bytes back we start (the initial size of the overlapping window)
- * @param cnt number of bytes to copy, must be >= 0
- *
- * cnt > back is valid, this will copy the bytes we just copied,
- * thus creating a repeating pattern with a period length of back.
- */
-void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_MEM_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/old_pix_fmts.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/old_pix_fmts.h
deleted file mode 100644
index a0ae06b..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/old_pix_fmts.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_OLD_PIX_FMTS_H
-#define AVUTIL_OLD_PIX_FMTS_H
-
-/*
- * This header exists to prevent new pixel formats from being accidentally added
- * to the deprecated list.
- * Do not include it directly. It will be removed on next major bump
- *
- * Do not add new items to this list. Use the AVPixelFormat enum instead.
- */
-    PIX_FMT_NONE = AV_PIX_FMT_NONE,
-    PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
-    PIX_FMT_YUYV422,   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
-    PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
-    PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
-    PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
-    PIX_FMT_YUV444P,   ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
-    PIX_FMT_YUV410P,   ///< planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
-    PIX_FMT_YUV411P,   ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
-    PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
-    PIX_FMT_MONOWHITE, ///<        Y        ,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
-    PIX_FMT_MONOBLACK, ///<        Y        ,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
-    PIX_FMT_PAL8,      ///< 8 bit with PIX_FMT_RGB32 palette
-    PIX_FMT_YUVJ420P,  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
-    PIX_FMT_YUVJ422P,  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
-    PIX_FMT_YUVJ444P,  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
-    PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
-    PIX_FMT_XVMC_MPEG2_IDCT,
-    PIX_FMT_UYVY422,   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
-    PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
-    PIX_FMT_BGR8,      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
-    PIX_FMT_BGR4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
-    PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
-    PIX_FMT_RGB8,      ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
-    PIX_FMT_RGB4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
-    PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb)
-    PIX_FMT_NV12,      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
-    PIX_FMT_NV21,      ///< as above, but U and V bytes are swapped
-
-    PIX_FMT_ARGB,      ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
-    PIX_FMT_RGBA,      ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
-    PIX_FMT_ABGR,      ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
-    PIX_FMT_BGRA,      ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
-
-    PIX_FMT_GRAY16BE,  ///<        Y        , 16bpp, big-endian
-    PIX_FMT_GRAY16LE,  ///<        Y        , 16bpp, little-endian
-    PIX_FMT_YUV440P,   ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
-    PIX_FMT_YUVJ440P,  ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
-    PIX_FMT_YUVA420P,  ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
-#if FF_API_VDPAU
-    PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-#endif
-    PIX_FMT_RGB48BE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
-    PIX_FMT_RGB48LE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
-
-    PIX_FMT_RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
-    PIX_FMT_RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
-    PIX_FMT_RGB555BE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
-    PIX_FMT_RGB555LE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
-
-    PIX_FMT_BGR565BE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
-    PIX_FMT_BGR565LE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
-    PIX_FMT_BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
-    PIX_FMT_BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
-
-    PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
-    PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
-    PIX_FMT_VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-
-    PIX_FMT_YUV420P16LE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    PIX_FMT_YUV420P16BE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    PIX_FMT_YUV422P16LE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-    PIX_FMT_YUV422P16BE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    PIX_FMT_YUV444P16LE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-    PIX_FMT_YUV444P16BE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-#if FF_API_VDPAU
-    PIX_FMT_VDPAU_MPEG4,  ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-#endif
-    PIX_FMT_DXVA2_VLD,    ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
-
-    PIX_FMT_RGB444LE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
-    PIX_FMT_RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
-    PIX_FMT_BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
-    PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
-    PIX_FMT_Y400A,     ///< 8bit gray, 8bit alpha
-    PIX_FMT_BGR48BE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
-    PIX_FMT_BGR48LE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
-    PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-    PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-    PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-    PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-    PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-    PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-    PIX_FMT_VDA_VLD,    ///< hardware decoding through VDA
-    PIX_FMT_GBRP,      ///< planar GBR 4:4:4 24bpp
-    PIX_FMT_GBRP9BE,   ///< planar GBR 4:4:4 27bpp, big endian
-    PIX_FMT_GBRP9LE,   ///< planar GBR 4:4:4 27bpp, little endian
-    PIX_FMT_GBRP10BE,  ///< planar GBR 4:4:4 30bpp, big endian
-    PIX_FMT_GBRP10LE,  ///< planar GBR 4:4:4 30bpp, little endian
-    PIX_FMT_GBRP16BE,  ///< planar GBR 4:4:4 48bpp, big endian
-    PIX_FMT_GBRP16LE,  ///< planar GBR 4:4:4 48bpp, little endian
-    PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
-
-#endif /* AVUTIL_OLD_PIX_FMTS_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixdesc.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixdesc.h
deleted file mode 100644
index b1ba03f..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixdesc.h
+++ /dev/null
@@ -1,276 +0,0 @@
-/*
- * pixel format descriptor
- * Copyright (c) 2009 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_PIXDESC_H
-#define AVUTIL_PIXDESC_H
-
-#include <inttypes.h>
-
-#include "attributes.h"
-#include "pixfmt.h"
-
-typedef struct AVComponentDescriptor{
-    uint16_t plane        :2;            ///< which of the 4 planes contains the component
-
-    /**
-     * Number of elements between 2 horizontally consecutive pixels minus 1.
-     * Elements are bits for bitstream formats, bytes otherwise.
-     */
-    uint16_t step_minus1  :3;
-
-    /**
-     * Number of elements before the component of the first pixel plus 1.
-     * Elements are bits for bitstream formats, bytes otherwise.
-     */
-    uint16_t offset_plus1 :3;
-    uint16_t shift        :3;            ///< number of least significant bits that must be shifted away to get the value
-    uint16_t depth_minus1 :4;            ///< number of bits in the component minus 1
-}AVComponentDescriptor;
-
-/**
- * Descriptor that unambiguously describes how the bits of a pixel are
- * stored in the up to 4 data planes of an image. It also stores the
- * subsampling factors and number of components.
- *
- * @note This is separate of the colorspace (RGB, YCbCr, YPbPr, JPEG-style YUV
- *       and all the YUV variants) AVPixFmtDescriptor just stores how values
- *       are stored not what these values represent.
- */
-typedef struct AVPixFmtDescriptor{
-    const char *name;
-    uint8_t nb_components;      ///< The number of components each pixel has, (1-4)
-
-    /**
-     * Amount to shift the luma width right to find the chroma width.
-     * For YV12 this is 1 for example.
-     * chroma_width = -((-luma_width) >> log2_chroma_w)
-     * The note above is needed to ensure rounding up.
-     * This value only refers to the chroma components.
-     */
-    uint8_t log2_chroma_w;      ///< chroma_width = -((-luma_width )>>log2_chroma_w)
-
-    /**
-     * Amount to shift the luma height right to find the chroma height.
-     * For YV12 this is 1 for example.
-     * chroma_height= -((-luma_height) >> log2_chroma_h)
-     * The note above is needed to ensure rounding up.
-     * This value only refers to the chroma components.
-     */
-    uint8_t log2_chroma_h;
-    uint8_t flags;
-
-    /**
-     * Parameters that describe how pixels are packed. If the format
-     * has chroma components, they must be stored in comp[1] and
-     * comp[2].
-     */
-    AVComponentDescriptor comp[4];
-}AVPixFmtDescriptor;
-
-/**
- * Pixel format is big-endian.
- */
-#define AV_PIX_FMT_FLAG_BE           (1 << 0)
-/**
- * Pixel format has a palette in data[1], values are indexes in this palette.
- */
-#define AV_PIX_FMT_FLAG_PAL          (1 << 1)
-/**
- * All values of a component are bit-wise packed end to end.
- */
-#define AV_PIX_FMT_FLAG_BITSTREAM    (1 << 2)
-/**
- * Pixel format is an HW accelerated format.
- */
-#define AV_PIX_FMT_FLAG_HWACCEL      (1 << 3)
-/**
- * At least one pixel component is not in the first data plane.
- */
-#define AV_PIX_FMT_FLAG_PLANAR       (1 << 4)
-/**
- * The pixel format contains RGB-like data (as opposed to YUV/grayscale).
- */
-#define AV_PIX_FMT_FLAG_RGB          (1 << 5)
-/**
- * The pixel format is "pseudo-paletted". This means that Libav treats it as
- * paletted internally, but the palette is generated by the decoder and is not
- * stored in the file.
- */
-#define AV_PIX_FMT_FLAG_PSEUDOPAL    (1 << 6)
-/**
- * The pixel format has an alpha channel.
- */
-#define AV_PIX_FMT_FLAG_ALPHA        (1 << 7)
-
-#if FF_API_PIX_FMT
-/**
- * @deprecate use the AV_PIX_FMT_FLAG_* flags
- */
-#define PIX_FMT_BE        AV_PIX_FMT_FLAG_BE
-#define PIX_FMT_PAL       AV_PIX_FMT_FLAG_PAL
-#define PIX_FMT_BITSTREAM AV_PIX_FMT_FLAG_BITSTREAM
-#define PIX_FMT_HWACCEL   AV_PIX_FMT_FLAG_HWACCEL
-#define PIX_FMT_PLANAR    AV_PIX_FMT_FLAG_PLANAR
-#define PIX_FMT_RGB       AV_PIX_FMT_FLAG_RGB
-#define PIX_FMT_PSEUDOPAL AV_PIX_FMT_FLAG_PSEUDOPAL
-#define PIX_FMT_ALPHA     AV_PIX_FMT_FLAG_ALPHA
-#endif
-
-#if FF_API_PIX_FMT_DESC
-/**
- * The array of all the pixel format descriptors.
- */
-extern attribute_deprecated const AVPixFmtDescriptor av_pix_fmt_descriptors[];
-#endif
-
-/**
- * Read a line from an image, and write the values of the
- * pixel format component c to dst.
- *
- * @param data the array containing the pointers to the planes of the image
- * @param linesize the array containing the linesizes of the image
- * @param desc the pixel format descriptor for the image
- * @param x the horizontal coordinate of the first pixel to read
- * @param y the vertical coordinate of the first pixel to read
- * @param w the width of the line to read, that is the number of
- * values to write to dst
- * @param read_pal_component if not zero and the format is a paletted
- * format writes the values corresponding to the palette
- * component c in data[1] to dst, rather than the palette indexes in
- * data[0]. The behavior is undefined if the format is not paletted.
- */
-void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
-                        const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
-
-/**
- * Write the values from src to the pixel format component c of an
- * image line.
- *
- * @param src array containing the values to write
- * @param data the array containing the pointers to the planes of the
- * image to write into. It is supposed to be zeroed.
- * @param linesize the array containing the linesizes of the image
- * @param desc the pixel format descriptor for the image
- * @param x the horizontal coordinate of the first pixel to write
- * @param y the vertical coordinate of the first pixel to write
- * @param w the width of the line to write, that is the number of
- * values to write to the image line
- */
-void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
-                         const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
-
-/**
- * Return the pixel format corresponding to name.
- *
- * If there is no pixel format with name name, then looks for a
- * pixel format with the name corresponding to the native endian
- * format of name.
- * For example in a little-endian system, first looks for "gray16",
- * then for "gray16le".
- *
- * Finally if no pixel format has been found, returns PIX_FMT_NONE.
- */
-enum AVPixelFormat av_get_pix_fmt(const char *name);
-
-/**
- * Return the short name for a pixel format, NULL in case pix_fmt is
- * unknown.
- *
- * @see av_get_pix_fmt(), av_get_pix_fmt_string()
- */
-const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt);
-
-/**
- * Print in buf the string corresponding to the pixel format with
- * number pix_fmt, or an header if pix_fmt is negative.
- *
- * @param buf the buffer where to write the string
- * @param buf_size the size of buf
- * @param pix_fmt the number of the pixel format to print the
- * corresponding info string, or a negative value to print the
- * corresponding header.
- */
-char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt);
-
-/**
- * Return the number of bits per pixel used by the pixel format
- * described by pixdesc. Note that this is not the same as the number
- * of bits per sample.
- *
- * The returned number of bits refers to the number of bits actually
- * used for storing the pixel information, that is padding bits are
- * not counted.
- */
-int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
-
-/**
- * @return a pixel format descriptor for provided pixel format or NULL if
- * this pixel format is unknown.
- */
-const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt);
-
-/**
- * Iterate over all pixel format descriptors known to libavutil.
- *
- * @param prev previous descriptor. NULL to get the first descriptor.
- *
- * @return next descriptor or NULL after the last descriptor
- */
-const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev);
-
-/**
- * @return an AVPixelFormat id described by desc, or AV_PIX_FMT_NONE if desc
- * is not a valid pointer to a pixel format descriptor.
- */
-enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc);
-
-/**
- * Utility function to access log2_chroma_w log2_chroma_h from
- * the pixel format AVPixFmtDescriptor.
- *
- * @param[in]  pix_fmt the pixel format
- * @param[out] h_shift store log2_chroma_h
- * @param[out] v_shift store log2_chroma_w
- *
- * @return 0 on success, AVERROR(ENOSYS) on invalid or unknown pixel format
- */
-int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
-                                     int *h_shift, int *v_shift);
-
-/**
- * @return number of planes in pix_fmt, a negative AVERROR if pix_fmt is not a
- * valid pixel format.
- */
-int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt);
-
-
-/**
- * Utility function to swap the endianness of a pixel format.
- *
- * @param[in]  pix_fmt the pixel format
- *
- * @return pixel format with swapped endianness if it exists,
- * otherwise AV_PIX_FMT_NONE
- */
-enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt);
-
-
-#endif /* AVUTIL_PIXDESC_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixfmt.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixfmt.h
deleted file mode 100644
index 77305ca..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/pixfmt.h
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
- *
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_PIXFMT_H
-#define AVUTIL_PIXFMT_H
-
-/**
- * @file
- * pixel format definitions
- *
- */
-
-#include "libavutil/avconfig.h"
-#include "libavutil/version.h"
-
-/**
- * Pixel format.
- *
- * @note
- * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
- * color is put together as:
- *  (A << 24) | (R << 16) | (G << 8) | B
- * This is stored as BGRA on little-endian CPU architectures and ARGB on
- * big-endian CPUs.
- *
- * @par
- * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
- * image data is stored in AVFrame.data[0]. The palette is transported in
- * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
- * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
- * also endian-specific). Note also that the individual RGB palette
- * components stored in AVFrame.data[1] should be in the range 0..255.
- * This is important as many custom PAL8 video codecs that were designed
- * to run on the IBM VGA graphics adapter use 6-bit palette components.
- *
- * @par
- * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like
- * for pal8. This palette is filled in automatically by the function
- * allocating the picture.
- *
- * @note
- * Make sure that all newly added big-endian formats have pix_fmt & 1 == 1
- * and that all newly added little-endian formats have pix_fmt & 1 == 0.
- * This allows simpler detection of big vs little-endian.
- */
-enum AVPixelFormat {
-    AV_PIX_FMT_NONE = -1,
-    AV_PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
-    AV_PIX_FMT_YUYV422,   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
-    AV_PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
-    AV_PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
-    AV_PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
-    AV_PIX_FMT_YUV444P,   ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
-    AV_PIX_FMT_YUV410P,   ///< planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
-    AV_PIX_FMT_YUV411P,   ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
-    AV_PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
-    AV_PIX_FMT_MONOWHITE, ///<        Y        ,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
-    AV_PIX_FMT_MONOBLACK, ///<        Y        ,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
-    AV_PIX_FMT_PAL8,      ///< 8 bit with PIX_FMT_RGB32 palette
-    AV_PIX_FMT_YUVJ420P,  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
-    AV_PIX_FMT_YUVJ422P,  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
-    AV_PIX_FMT_YUVJ444P,  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
-    AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
-    AV_PIX_FMT_XVMC_MPEG2_IDCT,
-    AV_PIX_FMT_UYVY422,   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
-    AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
-    AV_PIX_FMT_BGR8,      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
-    AV_PIX_FMT_BGR4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
-    AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
-    AV_PIX_FMT_RGB8,      ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
-    AV_PIX_FMT_RGB4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
-    AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb)
-    AV_PIX_FMT_NV12,      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
-    AV_PIX_FMT_NV21,      ///< as above, but U and V bytes are swapped
-
-    AV_PIX_FMT_ARGB,      ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
-    AV_PIX_FMT_RGBA,      ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
-    AV_PIX_FMT_ABGR,      ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
-    AV_PIX_FMT_BGRA,      ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
-
-    AV_PIX_FMT_GRAY16BE,  ///<        Y        , 16bpp, big-endian
-    AV_PIX_FMT_GRAY16LE,  ///<        Y        , 16bpp, little-endian
-    AV_PIX_FMT_YUV440P,   ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
-    AV_PIX_FMT_YUVJ440P,  ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
-    AV_PIX_FMT_YUVA420P,  ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
-#if FF_API_VDPAU
-    AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-    AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-#endif
-    AV_PIX_FMT_RGB48BE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
-    AV_PIX_FMT_RGB48LE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
-
-    AV_PIX_FMT_RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
-    AV_PIX_FMT_RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
-    AV_PIX_FMT_RGB555BE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
-    AV_PIX_FMT_RGB555LE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
-
-    AV_PIX_FMT_BGR565BE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
-    AV_PIX_FMT_BGR565LE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
-    AV_PIX_FMT_BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
-    AV_PIX_FMT_BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
-
-    AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
-    AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
-    AV_PIX_FMT_VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-
-    AV_PIX_FMT_YUV420P16LE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    AV_PIX_FMT_YUV420P16BE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    AV_PIX_FMT_YUV422P16LE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-    AV_PIX_FMT_YUV422P16BE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    AV_PIX_FMT_YUV444P16LE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-    AV_PIX_FMT_YUV444P16BE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-#if FF_API_VDPAU
-    AV_PIX_FMT_VDPAU_MPEG4,  ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-#endif
-    AV_PIX_FMT_DXVA2_VLD,    ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
-
-    AV_PIX_FMT_RGB444LE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
-    AV_PIX_FMT_RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
-    AV_PIX_FMT_BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
-    AV_PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
-    AV_PIX_FMT_Y400A,     ///< 8bit gray, 8bit alpha
-    AV_PIX_FMT_BGR48BE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
-    AV_PIX_FMT_BGR48LE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
-    AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-    AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-    AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-    AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-    AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-    AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-    AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-    AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-    AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-    AV_PIX_FMT_VDA_VLD,    ///< hardware decoding through VDA
-    AV_PIX_FMT_GBRP,      ///< planar GBR 4:4:4 24bpp
-    AV_PIX_FMT_GBRP9BE,   ///< planar GBR 4:4:4 27bpp, big-endian
-    AV_PIX_FMT_GBRP9LE,   ///< planar GBR 4:4:4 27bpp, little-endian
-    AV_PIX_FMT_GBRP10BE,  ///< planar GBR 4:4:4 30bpp, big-endian
-    AV_PIX_FMT_GBRP10LE,  ///< planar GBR 4:4:4 30bpp, little-endian
-    AV_PIX_FMT_GBRP16BE,  ///< planar GBR 4:4:4 48bpp, big-endian
-    AV_PIX_FMT_GBRP16LE,  ///< planar GBR 4:4:4 48bpp, little-endian
-    AV_PIX_FMT_YUVA422P,  ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
-    AV_PIX_FMT_YUVA444P,  ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
-    AV_PIX_FMT_YUVA420P9BE,  ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
-    AV_PIX_FMT_YUVA420P9LE,  ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian
-    AV_PIX_FMT_YUVA422P9BE,  ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
-    AV_PIX_FMT_YUVA422P9LE,  ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
-    AV_PIX_FMT_YUVA444P9BE,  ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
-    AV_PIX_FMT_YUVA444P9LE,  ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
-    AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
-    AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
-    AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
-    AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
-    AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
-    AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
-    AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
-    AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
-    AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
-    AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
-    AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
-    AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
-    AV_PIX_FMT_VDPAU,     ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface
-    AV_PIX_FMT_XYZ12LE,      ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0
-    AV_PIX_FMT_XYZ12BE,      ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0
-    AV_PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
-
-#if FF_API_PIX_FMT
-#include "old_pix_fmts.h"
-#endif
-};
-
-#if AV_HAVE_BIGENDIAN
-#   define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##be
-#else
-#   define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##le
-#endif
-
-#define AV_PIX_FMT_RGB32   AV_PIX_FMT_NE(ARGB, BGRA)
-#define AV_PIX_FMT_RGB32_1 AV_PIX_FMT_NE(RGBA, ABGR)
-#define AV_PIX_FMT_BGR32   AV_PIX_FMT_NE(ABGR, RGBA)
-#define AV_PIX_FMT_BGR32_1 AV_PIX_FMT_NE(BGRA, ARGB)
-
-#define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE)
-#define AV_PIX_FMT_RGB48  AV_PIX_FMT_NE(RGB48BE,  RGB48LE)
-#define AV_PIX_FMT_RGB565 AV_PIX_FMT_NE(RGB565BE, RGB565LE)
-#define AV_PIX_FMT_RGB555 AV_PIX_FMT_NE(RGB555BE, RGB555LE)
-#define AV_PIX_FMT_RGB444 AV_PIX_FMT_NE(RGB444BE, RGB444LE)
-#define AV_PIX_FMT_BGR48  AV_PIX_FMT_NE(BGR48BE,  BGR48LE)
-#define AV_PIX_FMT_BGR565 AV_PIX_FMT_NE(BGR565BE, BGR565LE)
-#define AV_PIX_FMT_BGR555 AV_PIX_FMT_NE(BGR555BE, BGR555LE)
-#define AV_PIX_FMT_BGR444 AV_PIX_FMT_NE(BGR444BE, BGR444LE)
-
-#define AV_PIX_FMT_YUV420P9  AV_PIX_FMT_NE(YUV420P9BE , YUV420P9LE)
-#define AV_PIX_FMT_YUV422P9  AV_PIX_FMT_NE(YUV422P9BE , YUV422P9LE)
-#define AV_PIX_FMT_YUV444P9  AV_PIX_FMT_NE(YUV444P9BE , YUV444P9LE)
-#define AV_PIX_FMT_YUV420P10 AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
-#define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
-#define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE)
-#define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
-#define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
-#define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
-
-#define AV_PIX_FMT_GBRP9     AV_PIX_FMT_NE(GBRP9BE ,    GBRP9LE)
-#define AV_PIX_FMT_GBRP10    AV_PIX_FMT_NE(GBRP10BE,    GBRP10LE)
-#define AV_PIX_FMT_GBRP16    AV_PIX_FMT_NE(GBRP16BE,    GBRP16LE)
-
-#define AV_PIX_FMT_YUVA420P9  AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE)
-#define AV_PIX_FMT_YUVA422P9  AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE)
-#define AV_PIX_FMT_YUVA444P9  AV_PIX_FMT_NE(YUVA444P9BE , YUVA444P9LE)
-#define AV_PIX_FMT_YUVA420P10 AV_PIX_FMT_NE(YUVA420P10BE, YUVA420P10LE)
-#define AV_PIX_FMT_YUVA422P10 AV_PIX_FMT_NE(YUVA422P10BE, YUVA422P10LE)
-#define AV_PIX_FMT_YUVA444P10 AV_PIX_FMT_NE(YUVA444P10BE, YUVA444P10LE)
-#define AV_PIX_FMT_YUVA420P16 AV_PIX_FMT_NE(YUVA420P16BE, YUVA420P16LE)
-#define AV_PIX_FMT_YUVA422P16 AV_PIX_FMT_NE(YUVA422P16BE, YUVA422P16LE)
-#define AV_PIX_FMT_YUVA444P16 AV_PIX_FMT_NE(YUVA444P16BE, YUVA444P16LE)
-
-#define AV_PIX_FMT_XYZ12      AV_PIX_FMT_NE(XYZ12BE, XYZ12LE)
-
-#if FF_API_PIX_FMT
-#define PixelFormat AVPixelFormat
-
-#define PIX_FMT_NE(be, le) AV_PIX_FMT_NE(be, le)
-
-#define PIX_FMT_RGB32   AV_PIX_FMT_RGB32
-#define PIX_FMT_RGB32_1 AV_PIX_FMT_RGB32_1
-#define PIX_FMT_BGR32   AV_PIX_FMT_BGR32
-#define PIX_FMT_BGR32_1 AV_PIX_FMT_BGR32_1
-
-#define PIX_FMT_GRAY16 AV_PIX_FMT_GRAY16
-#define PIX_FMT_RGB48  AV_PIX_FMT_RGB48
-#define PIX_FMT_RGB565 AV_PIX_FMT_RGB565
-#define PIX_FMT_RGB555 AV_PIX_FMT_RGB555
-#define PIX_FMT_RGB444 AV_PIX_FMT_RGB444
-#define PIX_FMT_BGR48  AV_PIX_FMT_BGR48
-#define PIX_FMT_BGR565 AV_PIX_FMT_BGR565
-#define PIX_FMT_BGR555 AV_PIX_FMT_BGR555
-#define PIX_FMT_BGR444 AV_PIX_FMT_BGR444
-
-#define PIX_FMT_YUV420P9  AV_PIX_FMT_YUV420P9
-#define PIX_FMT_YUV422P9  AV_PIX_FMT_YUV422P9
-#define PIX_FMT_YUV444P9  AV_PIX_FMT_YUV444P9
-#define PIX_FMT_YUV420P10 AV_PIX_FMT_YUV420P10
-#define PIX_FMT_YUV422P10 AV_PIX_FMT_YUV422P10
-#define PIX_FMT_YUV444P10 AV_PIX_FMT_YUV444P10
-#define PIX_FMT_YUV420P16 AV_PIX_FMT_YUV420P16
-#define PIX_FMT_YUV422P16 AV_PIX_FMT_YUV422P16
-#define PIX_FMT_YUV444P16 AV_PIX_FMT_YUV444P16
-
-#define PIX_FMT_GBRP9  AV_PIX_FMT_GBRP9
-#define PIX_FMT_GBRP10 AV_PIX_FMT_GBRP10
-#define PIX_FMT_GBRP16 AV_PIX_FMT_GBRP16
-#endif
-
-#endif /* AVUTIL_PIXFMT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/version.h
deleted file mode 100644
index c760d8d..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/version.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * This file is part of Libav.
- *
- * Libav is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * Libav is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with Libav; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef AVUTIL_VERSION_H
-#define AVUTIL_VERSION_H
-
-#include "avutil.h"
-
-/**
- * @file
- * @ingroup lavu
- * Libavutil version macros
- */
-
-/**
- * @defgroup lavu_ver Version and Build diagnostics
- *
- * Macros and function useful to check at compiletime and at runtime
- * which version of libavutil is in use.
- *
- * @{
- */
-
-#define LIBAVUTIL_VERSION_MAJOR 52
-#define LIBAVUTIL_VERSION_MINOR 14
-#define LIBAVUTIL_VERSION_MICRO  0
-
-#define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
-                                               LIBAVUTIL_VERSION_MINOR, \
-                                               LIBAVUTIL_VERSION_MICRO)
-#define LIBAVUTIL_VERSION       AV_VERSION(LIBAVUTIL_VERSION_MAJOR,     \
-                                           LIBAVUTIL_VERSION_MINOR,     \
-                                           LIBAVUTIL_VERSION_MICRO)
-#define LIBAVUTIL_BUILD         LIBAVUTIL_VERSION_INT
-
-#define LIBAVUTIL_IDENT         "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
-
-/**
- * @}
- *
- * @defgroup depr_guards Deprecation guards
- * FF_API_* defines may be placed below to indicate public API that will be
- * dropped at a future version bump. The defines themselves are not part of
- * the public API and may change, break or disappear at any time.
- *
- * @{
- */
-
-#ifndef FF_API_PIX_FMT
-#define FF_API_PIX_FMT                  (LIBAVUTIL_VERSION_MAJOR < 53)
-#endif
-#ifndef FF_API_CONTEXT_SIZE
-#define FF_API_CONTEXT_SIZE             (LIBAVUTIL_VERSION_MAJOR < 53)
-#endif
-#ifndef FF_API_PIX_FMT_DESC
-#define FF_API_PIX_FMT_DESC             (LIBAVUTIL_VERSION_MAJOR < 53)
-#endif
-#ifndef FF_API_AV_REVERSE
-#define FF_API_AV_REVERSE               (LIBAVUTIL_VERSION_MAJOR < 53)
-#endif
-#ifndef FF_API_AUDIOCONVERT
-#define FF_API_AUDIOCONVERT             (LIBAVUTIL_VERSION_MAJOR < 53)
-#endif
-#ifndef FF_API_CPU_FLAG_MMX2
-#define FF_API_CPU_FLAG_MMX2            (LIBAVUTIL_VERSION_MAJOR < 53)
-#endif
-#ifndef FF_API_LLS_PRIVATE
-#define FF_API_LLS_PRIVATE              (LIBAVUTIL_VERSION_MAJOR < 53)
-#endif
-#ifndef FF_API_AVFRAME_LAVC
-#define FF_API_AVFRAME_LAVC             (LIBAVUTIL_VERSION_MAJOR < 53)
-#endif
-#ifndef FF_API_VDPAU
-#define FF_API_VDPAU                    (LIBAVUTIL_VERSION_MAJOR < 53)
-#endif
-
-/**
- * @}
- */
-
-#endif /* AVUTIL_VERSION_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/swresample.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/swresample.h
deleted file mode 100644
index 95e8a5a..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/swresample.h
+++ /dev/null
@@ -1,311 +0,0 @@
-/*
- * Copyright (C) 2011-2013 Michael Niedermayer (michaelni at gmx.at)
- *
- * This file is part of libswresample
- *
- * libswresample is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * libswresample is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with libswresample; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef SWRESAMPLE_SWRESAMPLE_H
-#define SWRESAMPLE_SWRESAMPLE_H
-
-/**
- * @file
- * @ingroup lswr
- * libswresample public header
- */
-
-/**
- * @defgroup lswr Libswresample
- * @{
- *
- * Libswresample (lswr) is a library that handles audio resampling, sample
- * format conversion and mixing.
- *
- * Interaction with lswr is done through SwrContext, which is
- * allocated with swr_alloc() or swr_alloc_set_opts(). It is opaque, so all parameters
- * must be set with the @ref avoptions API.
- *
- * For example the following code will setup conversion from planar float sample
- * format to interleaved signed 16-bit integer, downsampling from 48kHz to
- * 44.1kHz and downmixing from 5.1 channels to stereo (using the default mixing
- * matrix):
- * @code
- * SwrContext *swr = swr_alloc();
- * av_opt_set_int(swr, "in_channel_layout",  AV_CH_LAYOUT_5POINT1, 0);
- * av_opt_set_int(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO,  0);
- * av_opt_set_int(swr, "in_sample_rate",     48000,                0);
- * av_opt_set_int(swr, "out_sample_rate",    44100,                0);
- * av_opt_set_sample_fmt(swr, "in_sample_fmt",  AV_SAMPLE_FMT_FLTP, 0);
- * av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16,  0);
- * @endcode
- *
- * Once all values have been set, it must be initialized with swr_init(). If
- * you need to change the conversion parameters, you can change the parameters
- * as described above, or by using swr_alloc_set_opts(), then call swr_init()
- * again.
- *
- * The conversion itself is done by repeatedly calling swr_convert().
- * Note that the samples may get buffered in swr if you provide insufficient
- * output space or if sample rate conversion is done, which requires "future"
- * samples. Samples that do not require future input can be retrieved at any
- * time by using swr_convert() (in_count can be set to 0).
- * At the end of conversion the resampling buffer can be flushed by calling
- * swr_convert() with NULL in and 0 in_count.
- *
- * The delay between input and output, can at any time be found by using
- * swr_get_delay().
- *
- * The following code demonstrates the conversion loop assuming the parameters
- * from above and caller-defined functions get_input() and handle_output():
- * @code
- * uint8_t **input;
- * int in_samples;
- *
- * while (get_input(&input, &in_samples)) {
- *     uint8_t *output;
- *     int out_samples = av_rescale_rnd(swr_get_delay(swr, 48000) +
- *                                      in_samples, 44100, 48000, AV_ROUND_UP);
- *     av_samples_alloc(&output, NULL, 2, out_samples,
- *                      AV_SAMPLE_FMT_S16, 0);
- *     out_samples = swr_convert(swr, &output, out_samples,
- *                                      input, in_samples);
- *     handle_output(output, out_samples);
- *     av_freep(&output);
- *  }
- *  @endcode
- *
- * When the conversion is finished, the conversion
- * context and everything associated with it must be freed with swr_free().
- * There will be no memory leak if the data is not completely flushed before
- * swr_free().
- */
-
-#include <stdint.h>
-#include "libavutil/samplefmt.h"
-
-#include "libswresample/version.h"
-
-#if LIBSWRESAMPLE_VERSION_MAJOR < 1
-#define SWR_CH_MAX 32   ///< Maximum number of channels
-#endif
-
-#define SWR_FLAG_RESAMPLE 1 ///< Force resampling even if equal sample rate
-//TODO use int resample ?
-//long term TODO can we enable this dynamically?
-
-enum SwrDitherType {
-    SWR_DITHER_NONE = 0,
-    SWR_DITHER_RECTANGULAR,
-    SWR_DITHER_TRIANGULAR,
-    SWR_DITHER_TRIANGULAR_HIGHPASS,
-
-    SWR_DITHER_NS = 64,         ///< not part of API/ABI
-    SWR_DITHER_NS_LIPSHITZ,
-    SWR_DITHER_NS_F_WEIGHTED,
-    SWR_DITHER_NS_MODIFIED_E_WEIGHTED,
-    SWR_DITHER_NS_IMPROVED_E_WEIGHTED,
-    SWR_DITHER_NS_SHIBATA,
-    SWR_DITHER_NS_LOW_SHIBATA,
-    SWR_DITHER_NS_HIGH_SHIBATA,
-    SWR_DITHER_NB,              ///< not part of API/ABI
-};
-
-/** Resampling Engines */
-enum SwrEngine {
-    SWR_ENGINE_SWR,             /**< SW Resampler */
-    SWR_ENGINE_SOXR,            /**< SoX Resampler */
-    SWR_ENGINE_NB,              ///< not part of API/ABI
-};
-
-/** Resampling Filter Types */
-enum SwrFilterType {
-    SWR_FILTER_TYPE_CUBIC,              /**< Cubic */
-    SWR_FILTER_TYPE_BLACKMAN_NUTTALL,   /**< Blackman Nuttall Windowed Sinc */
-    SWR_FILTER_TYPE_KAISER,             /**< Kaiser Windowed Sinc */
-};
-
-typedef struct SwrContext SwrContext;
-
-/**
- * Get the AVClass for swrContext. It can be used in combination with
- * AV_OPT_SEARCH_FAKE_OBJ for examining options.
- *
- * @see av_opt_find().
- */
-const AVClass *swr_get_class(void);
-
-/**
- * Allocate SwrContext.
- *
- * If you use this function you will need to set the parameters (manually or
- * with swr_alloc_set_opts()) before calling swr_init().
- *
- * @see swr_alloc_set_opts(), swr_init(), swr_free()
- * @return NULL on error, allocated context otherwise
- */
-struct SwrContext *swr_alloc(void);
-
-/**
- * Initialize context after user parameters have been set.
- *
- * @return AVERROR error code in case of failure.
- */
-int swr_init(struct SwrContext *s);
-
-/**
- * Allocate SwrContext if needed and set/reset common parameters.
- *
- * This function does not require s to be allocated with swr_alloc(). On the
- * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters
- * on the allocated context.
- *
- * @param s               Swr context, can be NULL
- * @param out_ch_layout   output channel layout (AV_CH_LAYOUT_*)
- * @param out_sample_fmt  output sample format (AV_SAMPLE_FMT_*).
- * @param out_sample_rate output sample rate (frequency in Hz)
- * @param in_ch_layout    input channel layout (AV_CH_LAYOUT_*)
- * @param in_sample_fmt   input sample format (AV_SAMPLE_FMT_*).
- * @param in_sample_rate  input sample rate (frequency in Hz)
- * @param log_offset      logging level offset
- * @param log_ctx         parent logging context, can be NULL
- *
- * @see swr_init(), swr_free()
- * @return NULL on error, allocated context otherwise
- */
-struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
-                                      int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
-                                      int64_t  in_ch_layout, enum AVSampleFormat  in_sample_fmt, int  in_sample_rate,
-                                      int log_offset, void *log_ctx);
-
-/**
- * Free the given SwrContext and set the pointer to NULL.
- */
-void swr_free(struct SwrContext **s);
-
-/**
- * Convert audio.
- *
- * in and in_count can be set to 0 to flush the last few samples out at the
- * end.
- *
- * If more input is provided than output space then the input will be buffered.
- * You can avoid this buffering by providing more output space than input.
- * Convertion will run directly without copying whenever possible.
- *
- * @param s         allocated Swr context, with parameters set
- * @param out       output buffers, only the first one need be set in case of packed audio
- * @param out_count amount of space available for output in samples per channel
- * @param in        input buffers, only the first one need to be set in case of packed audio
- * @param in_count  number of input samples available in one channel
- *
- * @return number of samples output per channel, negative value on error
- */
-int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
-                                const uint8_t **in , int in_count);
-
-/**
- * Convert the next timestamp from input to output
- * timestamps are in 1/(in_sample_rate * out_sample_rate) units.
- *
- * @note There are 2 slightly differently behaving modes.
- *       First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX)
- *              in this case timestamps will be passed through with delays compensated
- *       Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX)
- *              in this case the output timestamps will match output sample numbers
- *
- * @param pts   timestamp for the next input sample, INT64_MIN if unknown
- * @return the output timestamp for the next output sample
- */
-int64_t swr_next_pts(struct SwrContext *s, int64_t pts);
-
-/**
- * Activate resampling compensation.
- */
-int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance);
-
-/**
- * Set a customized input channel mapping.
- *
- * @param s           allocated Swr context, not yet initialized
- * @param channel_map customized input channel mapping (array of channel
- *                    indexes, -1 for a muted channel)
- * @return AVERROR error code in case of failure.
- */
-int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
-
-/**
- * Set a customized remix matrix.
- *
- * @param s       allocated Swr context, not yet initialized
- * @param matrix  remix coefficients; matrix[i + stride * o] is
- *                the weight of input channel i in output channel o
- * @param stride  offset between lines of the matrix
- * @return  AVERROR error code in case of failure.
- */
-int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride);
-
-/**
- * Drops the specified number of output samples.
- */
-int swr_drop_output(struct SwrContext *s, int count);
-
-/**
- * Injects the specified number of silence samples.
- */
-int swr_inject_silence(struct SwrContext *s, int count);
-
-/**
- * Gets the delay the next input sample will experience relative to the next output sample.
- *
- * Swresample can buffer data if more input has been provided than available
- * output space, also converting between sample rates needs a delay.
- * This function returns the sum of all such delays.
- * The exact delay is not necessarily an integer value in either input or
- * output sample rate. Especially when downsampling by a large value, the
- * output sample rate may be a poor choice to represent the delay, similarly
- * for upsampling and the input sample rate.
- *
- * @param s     swr context
- * @param base  timebase in which the returned delay will be
- *              if its set to 1 the returned delay is in seconds
- *              if its set to 1000 the returned delay is in milli seconds
- *              if its set to the input sample rate then the returned delay is in input samples
- *              if its set to the output sample rate then the returned delay is in output samples
- *              an exact rounding free delay can be found by using LCM(in_sample_rate, out_sample_rate)
- * @returns     the delay in 1/base units.
- */
-int64_t swr_get_delay(struct SwrContext *s, int64_t base);
-
-/**
- * Return the LIBSWRESAMPLE_VERSION_INT constant.
- */
-unsigned swresample_version(void);
-
-/**
- * Return the swr build-time configuration.
- */
-const char *swresample_configuration(void);
-
-/**
- * Return the swr license.
- */
-const char *swresample_license(void);
-
-/**
- * @}
- */
-
-#endif /* SWRESAMPLE_SWRESAMPLE_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/version.h
deleted file mode 100644
index df9df48..0000000
--- a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libswresample/version.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Version macros.
- *
- * This file is part of libswresample
- *
- * libswresample is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * libswresample is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with libswresample; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef SWR_VERSION_H
-#define SWR_VERSION_H
-
-/**
- * @file
- * Libswresample version macros
- */
-
-#include "libavutil/avutil.h"
-
-#define LIBSWRESAMPLE_VERSION_MAJOR 0
-#define LIBSWRESAMPLE_VERSION_MINOR 17
-#define LIBSWRESAMPLE_VERSION_MICRO 102
-
-#define LIBSWRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
-                                                  LIBSWRESAMPLE_VERSION_MINOR, \
-                                                  LIBSWRESAMPLE_VERSION_MICRO)
-#define LIBSWRESAMPLE_VERSION      AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \
-                                              LIBSWRESAMPLE_VERSION_MINOR, \
-                                              LIBSWRESAMPLE_VERSION_MICRO)
-#define LIBSWRESAMPLE_BUILD        LIBSWRESAMPLE_VERSION_INT
-
-#define LIBSWRESAMPLE_IDENT        "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION)
-
-#endif /* SWR_VERSION_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/avcodec.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/avcodec.h
new file mode 100644
index 0000000..244f47b
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/avcodec.h
@@ -0,0 +1,4356 @@
+/*
+ * copyright (c) 2001 Fabrice Bellard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_AVCODEC_H
+#define AVCODEC_AVCODEC_H
+
+/**
+ * @file
+ * @ingroup libavc
+ * Libavcodec external API header
+ */
+
+#include <errno.h>
+#include "libavutil/samplefmt.h"
+#include "libavutil/attributes.h"
+#include "libavutil/avutil.h"
+#include "libavutil/buffer.h"
+#include "libavutil/cpu.h"
+#include "libavutil/dict.h"
+#include "libavutil/frame.h"
+#include "libavutil/log.h"
+#include "libavutil/pixfmt.h"
+#include "libavutil/rational.h"
+
+#include "version.h"
+
+#if FF_API_FAST_MALLOC
+// to provide fast_*alloc
+#include "libavutil/mem.h"
+#endif
+
+/**
+ * @defgroup libavc Encoding/Decoding Library
+ * @{
+ *
+ * @defgroup lavc_decoding Decoding
+ * @{
+ * @}
+ *
+ * @defgroup lavc_encoding Encoding
+ * @{
+ * @}
+ *
+ * @defgroup lavc_codec Codecs
+ * @{
+ * @defgroup lavc_codec_native Native Codecs
+ * @{
+ * @}
+ * @defgroup lavc_codec_wrappers External library wrappers
+ * @{
+ * @}
+ * @defgroup lavc_codec_hwaccel Hardware Accelerators bridge
+ * @{
+ * @}
+ * @}
+ * @defgroup lavc_internal Internal
+ * @{
+ * @}
+ * @}
+ *
+ */
+
+/**
+ * @defgroup lavc_core Core functions/structures.
+ * @ingroup libavc
+ *
+ * Basic definitions, functions for querying libavcodec capabilities,
+ * allocating core structures, etc.
+ * @{
+ */
+
+
+/**
+ * Identify the syntax and semantics of the bitstream.
+ * The principle is roughly:
+ * Two decoders with the same ID can decode the same streams.
+ * Two encoders with the same ID can encode compatible streams.
+ * There may be slight deviations from the principle due to implementation
+ * details.
+ *
+ * If you add a codec ID to this list, add it so that
+ * 1. no value of a existing codec ID changes (that would break ABI),
+ * 2. it is as close as possible to similar codecs.
+ *
+ * After adding new codec IDs, do not forget to add an entry to the codec
+ * descriptor list and bump libavcodec minor version.
+ */
+enum AVCodecID {
+    AV_CODEC_ID_NONE,
+
+    /* video codecs */
+    AV_CODEC_ID_MPEG1VIDEO,
+    AV_CODEC_ID_MPEG2VIDEO, ///< preferred ID for MPEG-1/2 video decoding
+#if FF_API_XVMC
+    AV_CODEC_ID_MPEG2VIDEO_XVMC,
+#endif /* FF_API_XVMC */
+    AV_CODEC_ID_H261,
+    AV_CODEC_ID_H263,
+    AV_CODEC_ID_RV10,
+    AV_CODEC_ID_RV20,
+    AV_CODEC_ID_MJPEG,
+    AV_CODEC_ID_MJPEGB,
+    AV_CODEC_ID_LJPEG,
+    AV_CODEC_ID_SP5X,
+    AV_CODEC_ID_JPEGLS,
+    AV_CODEC_ID_MPEG4,
+    AV_CODEC_ID_RAWVIDEO,
+    AV_CODEC_ID_MSMPEG4V1,
+    AV_CODEC_ID_MSMPEG4V2,
+    AV_CODEC_ID_MSMPEG4V3,
+    AV_CODEC_ID_WMV1,
+    AV_CODEC_ID_WMV2,
+    AV_CODEC_ID_H263P,
+    AV_CODEC_ID_H263I,
+    AV_CODEC_ID_FLV1,
+    AV_CODEC_ID_SVQ1,
+    AV_CODEC_ID_SVQ3,
+    AV_CODEC_ID_DVVIDEO,
+    AV_CODEC_ID_HUFFYUV,
+    AV_CODEC_ID_CYUV,
+    AV_CODEC_ID_H264,
+    AV_CODEC_ID_INDEO3,
+    AV_CODEC_ID_VP3,
+    AV_CODEC_ID_THEORA,
+    AV_CODEC_ID_ASV1,
+    AV_CODEC_ID_ASV2,
+    AV_CODEC_ID_FFV1,
+    AV_CODEC_ID_4XM,
+    AV_CODEC_ID_VCR1,
+    AV_CODEC_ID_CLJR,
+    AV_CODEC_ID_MDEC,
+    AV_CODEC_ID_ROQ,
+    AV_CODEC_ID_INTERPLAY_VIDEO,
+    AV_CODEC_ID_XAN_WC3,
+    AV_CODEC_ID_XAN_WC4,
+    AV_CODEC_ID_RPZA,
+    AV_CODEC_ID_CINEPAK,
+    AV_CODEC_ID_WS_VQA,
+    AV_CODEC_ID_MSRLE,
+    AV_CODEC_ID_MSVIDEO1,
+    AV_CODEC_ID_IDCIN,
+    AV_CODEC_ID_8BPS,
+    AV_CODEC_ID_SMC,
+    AV_CODEC_ID_FLIC,
+    AV_CODEC_ID_TRUEMOTION1,
+    AV_CODEC_ID_VMDVIDEO,
+    AV_CODEC_ID_MSZH,
+    AV_CODEC_ID_ZLIB,
+    AV_CODEC_ID_QTRLE,
+    AV_CODEC_ID_TSCC,
+    AV_CODEC_ID_ULTI,
+    AV_CODEC_ID_QDRAW,
+    AV_CODEC_ID_VIXL,
+    AV_CODEC_ID_QPEG,
+    AV_CODEC_ID_PNG,
+    AV_CODEC_ID_PPM,
+    AV_CODEC_ID_PBM,
+    AV_CODEC_ID_PGM,
+    AV_CODEC_ID_PGMYUV,
+    AV_CODEC_ID_PAM,
+    AV_CODEC_ID_FFVHUFF,
+    AV_CODEC_ID_RV30,
+    AV_CODEC_ID_RV40,
+    AV_CODEC_ID_VC1,
+    AV_CODEC_ID_WMV3,
+    AV_CODEC_ID_LOCO,
+    AV_CODEC_ID_WNV1,
+    AV_CODEC_ID_AASC,
+    AV_CODEC_ID_INDEO2,
+    AV_CODEC_ID_FRAPS,
+    AV_CODEC_ID_TRUEMOTION2,
+    AV_CODEC_ID_BMP,
+    AV_CODEC_ID_CSCD,
+    AV_CODEC_ID_MMVIDEO,
+    AV_CODEC_ID_ZMBV,
+    AV_CODEC_ID_AVS,
+    AV_CODEC_ID_SMACKVIDEO,
+    AV_CODEC_ID_NUV,
+    AV_CODEC_ID_KMVC,
+    AV_CODEC_ID_FLASHSV,
+    AV_CODEC_ID_CAVS,
+    AV_CODEC_ID_JPEG2000,
+    AV_CODEC_ID_VMNC,
+    AV_CODEC_ID_VP5,
+    AV_CODEC_ID_VP6,
+    AV_CODEC_ID_VP6F,
+    AV_CODEC_ID_TARGA,
+    AV_CODEC_ID_DSICINVIDEO,
+    AV_CODEC_ID_TIERTEXSEQVIDEO,
+    AV_CODEC_ID_TIFF,
+    AV_CODEC_ID_GIF,
+    AV_CODEC_ID_DXA,
+    AV_CODEC_ID_DNXHD,
+    AV_CODEC_ID_THP,
+    AV_CODEC_ID_SGI,
+    AV_CODEC_ID_C93,
+    AV_CODEC_ID_BETHSOFTVID,
+    AV_CODEC_ID_PTX,
+    AV_CODEC_ID_TXD,
+    AV_CODEC_ID_VP6A,
+    AV_CODEC_ID_AMV,
+    AV_CODEC_ID_VB,
+    AV_CODEC_ID_PCX,
+    AV_CODEC_ID_SUNRAST,
+    AV_CODEC_ID_INDEO4,
+    AV_CODEC_ID_INDEO5,
+    AV_CODEC_ID_MIMIC,
+    AV_CODEC_ID_RL2,
+    AV_CODEC_ID_ESCAPE124,
+    AV_CODEC_ID_DIRAC,
+    AV_CODEC_ID_BFI,
+    AV_CODEC_ID_CMV,
+    AV_CODEC_ID_MOTIONPIXELS,
+    AV_CODEC_ID_TGV,
+    AV_CODEC_ID_TGQ,
+    AV_CODEC_ID_TQI,
+    AV_CODEC_ID_AURA,
+    AV_CODEC_ID_AURA2,
+    AV_CODEC_ID_V210X,
+    AV_CODEC_ID_TMV,
+    AV_CODEC_ID_V210,
+    AV_CODEC_ID_DPX,
+    AV_CODEC_ID_MAD,
+    AV_CODEC_ID_FRWU,
+    AV_CODEC_ID_FLASHSV2,
+    AV_CODEC_ID_CDGRAPHICS,
+    AV_CODEC_ID_R210,
+    AV_CODEC_ID_ANM,
+    AV_CODEC_ID_BINKVIDEO,
+    AV_CODEC_ID_IFF_ILBM,
+    AV_CODEC_ID_IFF_BYTERUN1,
+    AV_CODEC_ID_KGV1,
+    AV_CODEC_ID_YOP,
+    AV_CODEC_ID_VP8,
+    AV_CODEC_ID_PICTOR,
+    AV_CODEC_ID_ANSI,
+    AV_CODEC_ID_A64_MULTI,
+    AV_CODEC_ID_A64_MULTI5,
+    AV_CODEC_ID_R10K,
+    AV_CODEC_ID_MXPEG,
+    AV_CODEC_ID_LAGARITH,
+    AV_CODEC_ID_PRORES,
+    AV_CODEC_ID_JV,
+    AV_CODEC_ID_DFA,
+    AV_CODEC_ID_WMV3IMAGE,
+    AV_CODEC_ID_VC1IMAGE,
+    AV_CODEC_ID_UTVIDEO,
+    AV_CODEC_ID_BMV_VIDEO,
+    AV_CODEC_ID_VBLE,
+    AV_CODEC_ID_DXTORY,
+    AV_CODEC_ID_V410,
+    AV_CODEC_ID_XWD,
+    AV_CODEC_ID_CDXL,
+    AV_CODEC_ID_XBM,
+    AV_CODEC_ID_ZEROCODEC,
+    AV_CODEC_ID_MSS1,
+    AV_CODEC_ID_MSA1,
+    AV_CODEC_ID_TSCC2,
+    AV_CODEC_ID_MTS2,
+    AV_CODEC_ID_CLLC,
+    AV_CODEC_ID_MSS2,
+    AV_CODEC_ID_VP9,
+    AV_CODEC_ID_AIC,
+    AV_CODEC_ID_ESCAPE130,
+    AV_CODEC_ID_G2M,
+    AV_CODEC_ID_WEBP,
+    AV_CODEC_ID_HNM4_VIDEO,
+    AV_CODEC_ID_HEVC,
+    AV_CODEC_ID_FIC,
+
+    /* various PCM "codecs" */
+    AV_CODEC_ID_FIRST_AUDIO = 0x10000,     ///< A dummy id pointing at the start of audio codecs
+    AV_CODEC_ID_PCM_S16LE = 0x10000,
+    AV_CODEC_ID_PCM_S16BE,
+    AV_CODEC_ID_PCM_U16LE,
+    AV_CODEC_ID_PCM_U16BE,
+    AV_CODEC_ID_PCM_S8,
+    AV_CODEC_ID_PCM_U8,
+    AV_CODEC_ID_PCM_MULAW,
+    AV_CODEC_ID_PCM_ALAW,
+    AV_CODEC_ID_PCM_S32LE,
+    AV_CODEC_ID_PCM_S32BE,
+    AV_CODEC_ID_PCM_U32LE,
+    AV_CODEC_ID_PCM_U32BE,
+    AV_CODEC_ID_PCM_S24LE,
+    AV_CODEC_ID_PCM_S24BE,
+    AV_CODEC_ID_PCM_U24LE,
+    AV_CODEC_ID_PCM_U24BE,
+    AV_CODEC_ID_PCM_S24DAUD,
+    AV_CODEC_ID_PCM_ZORK,
+    AV_CODEC_ID_PCM_S16LE_PLANAR,
+    AV_CODEC_ID_PCM_DVD,
+    AV_CODEC_ID_PCM_F32BE,
+    AV_CODEC_ID_PCM_F32LE,
+    AV_CODEC_ID_PCM_F64BE,
+    AV_CODEC_ID_PCM_F64LE,
+    AV_CODEC_ID_PCM_BLURAY,
+    AV_CODEC_ID_PCM_LXF,
+    AV_CODEC_ID_S302M,
+    AV_CODEC_ID_PCM_S8_PLANAR,
+    AV_CODEC_ID_PCM_S24LE_PLANAR,
+    AV_CODEC_ID_PCM_S32LE_PLANAR,
+
+    /* various ADPCM codecs */
+    AV_CODEC_ID_ADPCM_IMA_QT = 0x11000,
+    AV_CODEC_ID_ADPCM_IMA_WAV,
+    AV_CODEC_ID_ADPCM_IMA_DK3,
+    AV_CODEC_ID_ADPCM_IMA_DK4,
+    AV_CODEC_ID_ADPCM_IMA_WS,
+    AV_CODEC_ID_ADPCM_IMA_SMJPEG,
+    AV_CODEC_ID_ADPCM_MS,
+    AV_CODEC_ID_ADPCM_4XM,
+    AV_CODEC_ID_ADPCM_XA,
+    AV_CODEC_ID_ADPCM_ADX,
+    AV_CODEC_ID_ADPCM_EA,
+    AV_CODEC_ID_ADPCM_G726,
+    AV_CODEC_ID_ADPCM_CT,
+    AV_CODEC_ID_ADPCM_SWF,
+    AV_CODEC_ID_ADPCM_YAMAHA,
+    AV_CODEC_ID_ADPCM_SBPRO_4,
+    AV_CODEC_ID_ADPCM_SBPRO_3,
+    AV_CODEC_ID_ADPCM_SBPRO_2,
+    AV_CODEC_ID_ADPCM_THP,
+    AV_CODEC_ID_ADPCM_IMA_AMV,
+    AV_CODEC_ID_ADPCM_EA_R1,
+    AV_CODEC_ID_ADPCM_EA_R3,
+    AV_CODEC_ID_ADPCM_EA_R2,
+    AV_CODEC_ID_ADPCM_IMA_EA_SEAD,
+    AV_CODEC_ID_ADPCM_IMA_EA_EACS,
+    AV_CODEC_ID_ADPCM_EA_XAS,
+    AV_CODEC_ID_ADPCM_EA_MAXIS_XA,
+    AV_CODEC_ID_ADPCM_IMA_ISS,
+    AV_CODEC_ID_ADPCM_G722,
+    AV_CODEC_ID_ADPCM_IMA_APC,
+
+    /* AMR */
+    AV_CODEC_ID_AMR_NB = 0x12000,
+    AV_CODEC_ID_AMR_WB,
+
+    /* RealAudio codecs*/
+    AV_CODEC_ID_RA_144 = 0x13000,
+    AV_CODEC_ID_RA_288,
+
+    /* various DPCM codecs */
+    AV_CODEC_ID_ROQ_DPCM = 0x14000,
+    AV_CODEC_ID_INTERPLAY_DPCM,
+    AV_CODEC_ID_XAN_DPCM,
+    AV_CODEC_ID_SOL_DPCM,
+
+    /* audio codecs */
+    AV_CODEC_ID_MP2 = 0x15000,
+    AV_CODEC_ID_MP3, ///< preferred ID for decoding MPEG audio layer 1, 2 or 3
+    AV_CODEC_ID_AAC,
+    AV_CODEC_ID_AC3,
+    AV_CODEC_ID_DTS,
+    AV_CODEC_ID_VORBIS,
+    AV_CODEC_ID_DVAUDIO,
+    AV_CODEC_ID_WMAV1,
+    AV_CODEC_ID_WMAV2,
+    AV_CODEC_ID_MACE3,
+    AV_CODEC_ID_MACE6,
+    AV_CODEC_ID_VMDAUDIO,
+    AV_CODEC_ID_FLAC,
+    AV_CODEC_ID_MP3ADU,
+    AV_CODEC_ID_MP3ON4,
+    AV_CODEC_ID_SHORTEN,
+    AV_CODEC_ID_ALAC,
+    AV_CODEC_ID_WESTWOOD_SND1,
+    AV_CODEC_ID_GSM, ///< as in Berlin toast format
+    AV_CODEC_ID_QDM2,
+    AV_CODEC_ID_COOK,
+    AV_CODEC_ID_TRUESPEECH,
+    AV_CODEC_ID_TTA,
+    AV_CODEC_ID_SMACKAUDIO,
+    AV_CODEC_ID_QCELP,
+    AV_CODEC_ID_WAVPACK,
+    AV_CODEC_ID_DSICINAUDIO,
+    AV_CODEC_ID_IMC,
+    AV_CODEC_ID_MUSEPACK7,
+    AV_CODEC_ID_MLP,
+    AV_CODEC_ID_GSM_MS, /* as found in WAV */
+    AV_CODEC_ID_ATRAC3,
+#if FF_API_VOXWARE
+    AV_CODEC_ID_VOXWARE,
+#endif
+    AV_CODEC_ID_APE,
+    AV_CODEC_ID_NELLYMOSER,
+    AV_CODEC_ID_MUSEPACK8,
+    AV_CODEC_ID_SPEEX,
+    AV_CODEC_ID_WMAVOICE,
+    AV_CODEC_ID_WMAPRO,
+    AV_CODEC_ID_WMALOSSLESS,
+    AV_CODEC_ID_ATRAC3P,
+    AV_CODEC_ID_EAC3,
+    AV_CODEC_ID_SIPR,
+    AV_CODEC_ID_MP1,
+    AV_CODEC_ID_TWINVQ,
+    AV_CODEC_ID_TRUEHD,
+    AV_CODEC_ID_MP4ALS,
+    AV_CODEC_ID_ATRAC1,
+    AV_CODEC_ID_BINKAUDIO_RDFT,
+    AV_CODEC_ID_BINKAUDIO_DCT,
+    AV_CODEC_ID_AAC_LATM,
+    AV_CODEC_ID_QDMC,
+    AV_CODEC_ID_CELT,
+    AV_CODEC_ID_G723_1,
+    AV_CODEC_ID_G729,
+    AV_CODEC_ID_8SVX_EXP,
+    AV_CODEC_ID_8SVX_FIB,
+    AV_CODEC_ID_BMV_AUDIO,
+    AV_CODEC_ID_RALF,
+    AV_CODEC_ID_IAC,
+    AV_CODEC_ID_ILBC,
+    AV_CODEC_ID_OPUS,
+    AV_CODEC_ID_COMFORT_NOISE,
+    AV_CODEC_ID_TAK,
+    AV_CODEC_ID_METASOUND,
+
+    /* subtitle codecs */
+    AV_CODEC_ID_FIRST_SUBTITLE = 0x17000,          ///< A dummy ID pointing at the start of subtitle codecs.
+    AV_CODEC_ID_DVD_SUBTITLE = 0x17000,
+    AV_CODEC_ID_DVB_SUBTITLE,
+    AV_CODEC_ID_TEXT,  ///< raw UTF-8 text
+    AV_CODEC_ID_XSUB,
+    AV_CODEC_ID_SSA,
+    AV_CODEC_ID_MOV_TEXT,
+    AV_CODEC_ID_HDMV_PGS_SUBTITLE,
+    AV_CODEC_ID_DVB_TELETEXT,
+    AV_CODEC_ID_SRT,
+
+    /* other specific kind of codecs (generally used for attachments) */
+    AV_CODEC_ID_FIRST_UNKNOWN = 0x18000,           ///< A dummy ID pointing at the start of various fake codecs.
+    AV_CODEC_ID_TTF = 0x18000,
+
+    AV_CODEC_ID_PROBE = 0x19000, ///< codec_id is not known (like AV_CODEC_ID_NONE) but lavf should attempt to identify it
+
+    AV_CODEC_ID_MPEG2TS = 0x20000, /**< _FAKE_ codec to indicate a raw MPEG-2 TS
+                                * stream (only used by libavformat) */
+    AV_CODEC_ID_MPEG4SYSTEMS = 0x20001, /**< _FAKE_ codec to indicate a MPEG-4 Systems
+                                * stream (only used by libavformat) */
+    AV_CODEC_ID_FFMETADATA = 0x21000,   ///< Dummy codec for streams containing only metadata information.
+};
+
+/**
+ * This struct describes the properties of a single codec described by an
+ * AVCodecID.
+ * @see avcodec_get_descriptor()
+ */
+typedef struct AVCodecDescriptor {
+    enum AVCodecID     id;
+    enum AVMediaType type;
+    /**
+     * Name of the codec described by this descriptor. It is non-empty and
+     * unique for each codec descriptor. It should contain alphanumeric
+     * characters and '_' only.
+     */
+    const char      *name;
+    /**
+     * A more descriptive name for this codec. May be NULL.
+     */
+    const char *long_name;
+    /**
+     * Codec properties, a combination of AV_CODEC_PROP_* flags.
+     */
+    int             props;
+} AVCodecDescriptor;
+
+/**
+ * Codec uses only intra compression.
+ * Video codecs only.
+ */
+#define AV_CODEC_PROP_INTRA_ONLY    (1 << 0)
+/**
+ * Codec supports lossy compression. Audio and video codecs only.
+ * @note a codec may support both lossy and lossless
+ * compression modes
+ */
+#define AV_CODEC_PROP_LOSSY         (1 << 1)
+/**
+ * Codec supports lossless compression. Audio and video codecs only.
+ */
+#define AV_CODEC_PROP_LOSSLESS      (1 << 2)
+
+/**
+ * @ingroup lavc_decoding
+ * Required number of additionally allocated bytes at the end of the input bitstream for decoding.
+ * This is mainly needed because some optimized bitstream readers read
+ * 32 or 64 bit at once and could read over the end.<br>
+ * Note: If the first 23 bits of the additional bytes are not 0, then damaged
+ * MPEG bitstreams could cause overread and segfault.
+ */
+#define FF_INPUT_BUFFER_PADDING_SIZE 8
+
+/**
+ * @ingroup lavc_encoding
+ * minimum encoding buffer size
+ * Used to avoid some checks during header writing.
+ */
+#define FF_MIN_BUFFER_SIZE 16384
+
+
+/**
+ * @ingroup lavc_encoding
+ * motion estimation type.
+ */
+enum Motion_Est_ID {
+    ME_ZERO = 1,    ///< no search, that is use 0,0 vector whenever one is needed
+    ME_FULL,
+    ME_LOG,
+    ME_PHODS,
+    ME_EPZS,        ///< enhanced predictive zonal search
+    ME_X1,          ///< reserved for experiments
+    ME_HEX,         ///< hexagon based search
+    ME_UMH,         ///< uneven multi-hexagon search
+    ME_TESA,        ///< transformed exhaustive search algorithm
+};
+
+/**
+ * @ingroup lavc_decoding
+ */
+enum AVDiscard{
+    /* We leave some space between them for extensions (drop some
+     * keyframes for intra-only or drop just some bidir frames). */
+    AVDISCARD_NONE    =-16, ///< discard nothing
+    AVDISCARD_DEFAULT =  0, ///< discard useless packets like 0 size packets in avi
+    AVDISCARD_NONREF  =  8, ///< discard all non reference
+    AVDISCARD_BIDIR   = 16, ///< discard all bidirectional frames
+    AVDISCARD_NONKEY  = 32, ///< discard all frames except keyframes
+    AVDISCARD_ALL     = 48, ///< discard all
+};
+
+enum AVColorPrimaries{
+    AVCOL_PRI_BT709       = 1, ///< also ITU-R BT1361 / IEC 61966-2-4 / SMPTE RP177 Annex B
+    AVCOL_PRI_UNSPECIFIED = 2,
+    AVCOL_PRI_BT470M      = 4,
+    AVCOL_PRI_BT470BG     = 5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM
+    AVCOL_PRI_SMPTE170M   = 6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC
+    AVCOL_PRI_SMPTE240M   = 7, ///< functionally identical to above
+    AVCOL_PRI_FILM        = 8,
+    AVCOL_PRI_BT2020      = 9, ///< ITU-R BT2020
+    AVCOL_PRI_NB             , ///< Not part of ABI
+};
+
+enum AVColorTransferCharacteristic{
+    AVCOL_TRC_BT709        =  1, ///< also ITU-R BT1361
+    AVCOL_TRC_UNSPECIFIED  =  2,
+    AVCOL_TRC_GAMMA22      =  4, ///< also ITU-R BT470M / ITU-R BT1700 625 PAL & SECAM
+    AVCOL_TRC_GAMMA28      =  5, ///< also ITU-R BT470BG
+    AVCOL_TRC_SMPTE170M    =  6, ///< also ITU-R BT601-6 525 or 625 / ITU-R BT1358 525 or 625 / ITU-R BT1700 NTSC
+    AVCOL_TRC_SMPTE240M    =  7,
+    AVCOL_TRC_LINEAR       =  8, ///< "Linear transfer characteristics"
+    AVCOL_TRC_LOG          =  9, ///< "Logarithmic transfer characteristic (100:1 range)"
+    AVCOL_TRC_LOG_SQRT     = 10, ///< "Logarithmic transfer characteristic (100 * Sqrt( 10 ) : 1 range)"
+    AVCOL_TRC_IEC61966_2_4 = 11, ///< IEC 61966-2-4
+    AVCOL_TRC_BT1361_ECG   = 12, ///< ITU-R BT1361 Extended Colour Gamut
+    AVCOL_TRC_IEC61966_2_1 = 13, ///< IEC 61966-2-1 (sRGB or sYCC)
+    AVCOL_TRC_BT2020_10    = 14, ///< ITU-R BT2020 for 10 bit system
+    AVCOL_TRC_BT2020_12    = 15, ///< ITU-R BT2020 for 12 bit system
+    AVCOL_TRC_NB               , ///< Not part of ABI
+};
+
+enum AVColorSpace{
+    AVCOL_SPC_RGB         =  0,
+    AVCOL_SPC_BT709       =  1, ///< also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
+    AVCOL_SPC_UNSPECIFIED =  2,
+    AVCOL_SPC_FCC         =  4,
+    AVCOL_SPC_BT470BG     =  5, ///< also ITU-R BT601-6 625 / ITU-R BT1358 625 / ITU-R BT1700 625 PAL & SECAM / IEC 61966-2-4 xvYCC601
+    AVCOL_SPC_SMPTE170M   =  6, ///< also ITU-R BT601-6 525 / ITU-R BT1358 525 / ITU-R BT1700 NTSC / functionally identical to above
+    AVCOL_SPC_SMPTE240M   =  7,
+    AVCOL_SPC_YCOCG       =  8, ///< Used by Dirac / VC-2 and H.264 FRext, see ITU-T SG16
+    AVCOL_SPC_BT2020_NCL  =  9, ///< ITU-R BT2020 non-constant luminance system
+    AVCOL_SPC_BT2020_CL   = 10, ///< ITU-R BT2020 constant luminance system
+    AVCOL_SPC_NB              , ///< Not part of ABI
+};
+
+enum AVColorRange{
+    AVCOL_RANGE_UNSPECIFIED = 0,
+    AVCOL_RANGE_MPEG        = 1, ///< the normal 219*2^(n-8) "MPEG" YUV ranges
+    AVCOL_RANGE_JPEG        = 2, ///< the normal     2^n-1   "JPEG" YUV ranges
+    AVCOL_RANGE_NB             , ///< Not part of ABI
+};
+
+/**
+ *  X   X      3 4 X      X are luma samples,
+ *             1 2        1-6 are possible chroma positions
+ *  X   X      5 6 X      0 is undefined/unknown position
+ */
+enum AVChromaLocation{
+    AVCHROMA_LOC_UNSPECIFIED = 0,
+    AVCHROMA_LOC_LEFT        = 1, ///< mpeg2/4, h264 default
+    AVCHROMA_LOC_CENTER      = 2, ///< mpeg1, jpeg, h263
+    AVCHROMA_LOC_TOPLEFT     = 3, ///< DV
+    AVCHROMA_LOC_TOP         = 4,
+    AVCHROMA_LOC_BOTTOMLEFT  = 5,
+    AVCHROMA_LOC_BOTTOM      = 6,
+    AVCHROMA_LOC_NB             , ///< Not part of ABI
+};
+
+enum AVAudioServiceType {
+    AV_AUDIO_SERVICE_TYPE_MAIN              = 0,
+    AV_AUDIO_SERVICE_TYPE_EFFECTS           = 1,
+    AV_AUDIO_SERVICE_TYPE_VISUALLY_IMPAIRED = 2,
+    AV_AUDIO_SERVICE_TYPE_HEARING_IMPAIRED  = 3,
+    AV_AUDIO_SERVICE_TYPE_DIALOGUE          = 4,
+    AV_AUDIO_SERVICE_TYPE_COMMENTARY        = 5,
+    AV_AUDIO_SERVICE_TYPE_EMERGENCY         = 6,
+    AV_AUDIO_SERVICE_TYPE_VOICE_OVER        = 7,
+    AV_AUDIO_SERVICE_TYPE_KARAOKE           = 8,
+    AV_AUDIO_SERVICE_TYPE_NB                   , ///< Not part of ABI
+};
+
+/**
+ * @ingroup lavc_encoding
+ */
+typedef struct RcOverride{
+    int start_frame;
+    int end_frame;
+    int qscale; // If this is 0 then quality_factor will be used instead.
+    float quality_factor;
+} RcOverride;
+
+#if FF_API_MAX_BFRAMES
+/**
+ * @deprecated there is no libavcodec-wide limit on the number of B-frames
+ */
+#define FF_MAX_B_FRAMES 16
+#endif
+
+/* encoding support
+   These flags can be passed in AVCodecContext.flags before initialization.
+   Note: Not everything is supported yet.
+*/
+
+/**
+ * Allow decoders to produce frames with data planes that are not aligned
+ * to CPU requirements (e.g. due to cropping).
+ */
+#define CODEC_FLAG_UNALIGNED 0x0001
+#define CODEC_FLAG_QSCALE 0x0002  ///< Use fixed qscale.
+#define CODEC_FLAG_4MV    0x0004  ///< 4 MV per MB allowed / advanced prediction for H.263.
+#define CODEC_FLAG_OUTPUT_CORRUPT 0x0008 ///< Output even those frames that might be corrupted
+#define CODEC_FLAG_QPEL   0x0010  ///< Use qpel MC.
+#define CODEC_FLAG_GMC    0x0020  ///< Use GMC.
+#define CODEC_FLAG_MV0    0x0040  ///< Always try a MB with MV=<0,0>.
+/**
+ * The parent program guarantees that the input for B-frames containing
+ * streams is not written to for at least s->max_b_frames+1 frames, if
+ * this is not set the input will be copied.
+ */
+#define CODEC_FLAG_INPUT_PRESERVED 0x0100
+#define CODEC_FLAG_PASS1           0x0200   ///< Use internal 2pass ratecontrol in first pass mode.
+#define CODEC_FLAG_PASS2           0x0400   ///< Use internal 2pass ratecontrol in second pass mode.
+#define CODEC_FLAG_GRAY            0x2000   ///< Only decode/encode grayscale.
+#if FF_API_EMU_EDGE
+/**
+ * @deprecated edges are not used/required anymore. I.e. this flag is now always
+ * set.
+ */
+#define CODEC_FLAG_EMU_EDGE        0x4000
+#endif
+#define CODEC_FLAG_PSNR            0x8000   ///< error[?] variables will be set during encoding.
+#define CODEC_FLAG_TRUNCATED       0x00010000 /** Input bitstream might be truncated at a random
+                                                  location instead of only at frame boundaries. */
+#define CODEC_FLAG_NORMALIZE_AQP  0x00020000 ///< Normalize adaptive quantization.
+#define CODEC_FLAG_INTERLACED_DCT 0x00040000 ///< Use interlaced DCT.
+#define CODEC_FLAG_LOW_DELAY      0x00080000 ///< Force low delay.
+#define CODEC_FLAG_GLOBAL_HEADER  0x00400000 ///< Place global headers in extradata instead of every keyframe.
+#define CODEC_FLAG_BITEXACT       0x00800000 ///< Use only bitexact stuff (except (I)DCT).
+/* Fx : Flag for h263+ extra options */
+#define CODEC_FLAG_AC_PRED        0x01000000 ///< H.263 advanced intra coding / MPEG-4 AC prediction
+#define CODEC_FLAG_LOOP_FILTER    0x00000800 ///< loop filter
+#define CODEC_FLAG_INTERLACED_ME  0x20000000 ///< interlaced motion estimation
+#define CODEC_FLAG_CLOSED_GOP     0x80000000
+#define CODEC_FLAG2_FAST          0x00000001 ///< Allow non spec compliant speedup tricks.
+#define CODEC_FLAG2_NO_OUTPUT     0x00000004 ///< Skip bitstream encoding.
+#define CODEC_FLAG2_LOCAL_HEADER  0x00000008 ///< Place global headers at every keyframe instead of in extradata.
+#define CODEC_FLAG2_IGNORE_CROP   0x00010000 ///< Discard cropping information from SPS.
+
+#define CODEC_FLAG2_CHUNKS        0x00008000 ///< Input bitstream might be truncated at a packet boundaries instead of only at frame boundaries.
+
+/* Unsupported options :
+ *              Syntax Arithmetic coding (SAC)
+ *              Reference Picture Selection
+ *              Independent Segment Decoding */
+/* /Fx */
+/* codec capabilities */
+
+#define CODEC_CAP_DRAW_HORIZ_BAND 0x0001 ///< Decoder can use draw_horiz_band callback.
+/**
+ * Codec uses get_buffer() for allocating buffers and supports custom allocators.
+ * If not set, it might not use get_buffer() at all or use operations that
+ * assume the buffer was allocated by avcodec_default_get_buffer.
+ */
+#define CODEC_CAP_DR1             0x0002
+#define CODEC_CAP_TRUNCATED       0x0008
+#if FF_API_XVMC
+/* Codec can export data for HW decoding (XvMC). */
+#define CODEC_CAP_HWACCEL         0x0010
+#endif /* FF_API_XVMC */
+/**
+ * Encoder or decoder requires flushing with NULL input at the end in order to
+ * give the complete and correct output.
+ *
+ * NOTE: If this flag is not set, the codec is guaranteed to never be fed with
+ *       with NULL data. The user can still send NULL data to the public encode
+ *       or decode function, but libavcodec will not pass it along to the codec
+ *       unless this flag is set.
+ *
+ * Decoders:
+ * The decoder has a non-zero delay and needs to be fed with avpkt->data=NULL,
+ * avpkt->size=0 at the end to get the delayed data until the decoder no longer
+ * returns frames.
+ *
+ * Encoders:
+ * The encoder needs to be fed with NULL data at the end of encoding until the
+ * encoder no longer returns data.
+ *
+ * NOTE: For encoders implementing the AVCodec.encode2() function, setting this
+ *       flag also means that the encoder must set the pts and duration for
+ *       each output packet. If this flag is not set, the pts and duration will
+ *       be determined by libavcodec from the input frame.
+ */
+#define CODEC_CAP_DELAY           0x0020
+/**
+ * Codec can be fed a final frame with a smaller size.
+ * This can be used to prevent truncation of the last audio samples.
+ */
+#define CODEC_CAP_SMALL_LAST_FRAME 0x0040
+#if FF_API_CAP_VDPAU
+/**
+ * Codec can export data for HW decoding (VDPAU).
+ */
+#define CODEC_CAP_HWACCEL_VDPAU    0x0080
+#endif
+/**
+ * Codec can output multiple frames per AVPacket
+ * Normally demuxers return one frame at a time, demuxers which do not do
+ * are connected to a parser to split what they return into proper frames.
+ * This flag is reserved to the very rare category of codecs which have a
+ * bitstream that cannot be split into frames without timeconsuming
+ * operations like full decoding. Demuxers carring such bitstreams thus
+ * may return multiple frames in a packet. This has many disadvantages like
+ * prohibiting stream copy in many cases thus it should only be considered
+ * as a last resort.
+ */
+#define CODEC_CAP_SUBFRAMES        0x0100
+/**
+ * Codec is experimental and is thus avoided in favor of non experimental
+ * encoders
+ */
+#define CODEC_CAP_EXPERIMENTAL     0x0200
+/**
+ * Codec should fill in channel configuration and samplerate instead of container
+ */
+#define CODEC_CAP_CHANNEL_CONF     0x0400
+#if FF_API_NEG_LINESIZES
+/**
+ * @deprecated no codecs use this capability
+ */
+#define CODEC_CAP_NEG_LINESIZES    0x0800
+#endif
+/**
+ * Codec supports frame-level multithreading.
+ */
+#define CODEC_CAP_FRAME_THREADS    0x1000
+/**
+ * Codec supports slice-based (or partition-based) multithreading.
+ */
+#define CODEC_CAP_SLICE_THREADS    0x2000
+/**
+ * Codec supports changed parameters at any point.
+ */
+#define CODEC_CAP_PARAM_CHANGE     0x4000
+/**
+ * Codec supports avctx->thread_count == 0 (auto).
+ */
+#define CODEC_CAP_AUTO_THREADS     0x8000
+/**
+ * Audio encoder supports receiving a different number of samples in each call.
+ */
+#define CODEC_CAP_VARIABLE_FRAME_SIZE 0x10000
+
+#if FF_API_MB_TYPE
+//The following defines may change, don't expect compatibility if you use them.
+#define MB_TYPE_INTRA4x4   0x0001
+#define MB_TYPE_INTRA16x16 0x0002 //FIXME H.264-specific
+#define MB_TYPE_INTRA_PCM  0x0004 //FIXME H.264-specific
+#define MB_TYPE_16x16      0x0008
+#define MB_TYPE_16x8       0x0010
+#define MB_TYPE_8x16       0x0020
+#define MB_TYPE_8x8        0x0040
+#define MB_TYPE_INTERLACED 0x0080
+#define MB_TYPE_DIRECT2    0x0100 //FIXME
+#define MB_TYPE_ACPRED     0x0200
+#define MB_TYPE_GMC        0x0400
+#define MB_TYPE_SKIP       0x0800
+#define MB_TYPE_P0L0       0x1000
+#define MB_TYPE_P1L0       0x2000
+#define MB_TYPE_P0L1       0x4000
+#define MB_TYPE_P1L1       0x8000
+#define MB_TYPE_L0         (MB_TYPE_P0L0 | MB_TYPE_P1L0)
+#define MB_TYPE_L1         (MB_TYPE_P0L1 | MB_TYPE_P1L1)
+#define MB_TYPE_L0L1       (MB_TYPE_L0   | MB_TYPE_L1)
+#define MB_TYPE_QUANT      0x00010000
+#define MB_TYPE_CBP        0x00020000
+//Note bits 24-31 are reserved for codec specific use (h264 ref0, mpeg1 0mv, ...)
+#endif
+
+/**
+ * Pan Scan area.
+ * This specifies the area which should be displayed.
+ * Note there may be multiple such areas for one frame.
+ */
+typedef struct AVPanScan{
+    /**
+     * id
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    int id;
+
+    /**
+     * width and height in 1/16 pel
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    int width;
+    int height;
+
+    /**
+     * position of the top left corner in 1/16 pel for up to 3 fields/frames
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    int16_t position[3][2];
+}AVPanScan;
+
+#if FF_API_QSCALE_TYPE
+#define FF_QSCALE_TYPE_MPEG1 0
+#define FF_QSCALE_TYPE_MPEG2 1
+#define FF_QSCALE_TYPE_H264  2
+#define FF_QSCALE_TYPE_VP56  3
+#endif
+
+#if FF_API_GET_BUFFER
+#define FF_BUFFER_TYPE_INTERNAL 1
+#define FF_BUFFER_TYPE_USER     2 ///< direct rendering buffers (image is (de)allocated by user)
+#define FF_BUFFER_TYPE_SHARED   4 ///< Buffer from somewhere else; don't deallocate image (data/base), all other tables are not shared.
+#define FF_BUFFER_TYPE_COPY     8 ///< Just a (modified) copy of some other buffer, don't deallocate anything.
+
+#define FF_BUFFER_HINTS_VALID    0x01 // Buffer hints value is meaningful (if 0 ignore).
+#define FF_BUFFER_HINTS_READABLE 0x02 // Codec will read from buffer.
+#define FF_BUFFER_HINTS_PRESERVE 0x04 // User must not alter buffer content.
+#define FF_BUFFER_HINTS_REUSABLE 0x08 // Codec will reuse the buffer (update).
+#endif
+
+/**
+ * The decoder will keep a reference to the frame and may reuse it later.
+ */
+#define AV_GET_BUFFER_FLAG_REF (1 << 0)
+
+/**
+ * @defgroup lavc_packet AVPacket
+ *
+ * Types and functions for working with AVPacket.
+ * @{
+ */
+enum AVPacketSideDataType {
+    AV_PKT_DATA_PALETTE,
+    AV_PKT_DATA_NEW_EXTRADATA,
+
+    /**
+     * An AV_PKT_DATA_PARAM_CHANGE side data packet is laid out as follows:
+     * @code
+     * u32le param_flags
+     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT)
+     *     s32le channel_count
+     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT)
+     *     u64le channel_layout
+     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE)
+     *     s32le sample_rate
+     * if (param_flags & AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS)
+     *     s32le width
+     *     s32le height
+     * @endcode
+     */
+    AV_PKT_DATA_PARAM_CHANGE,
+
+    /**
+     * An AV_PKT_DATA_H263_MB_INFO side data packet contains a number of
+     * structures with info about macroblocks relevant to splitting the
+     * packet into smaller packets on macroblock edges (e.g. as for RFC 2190).
+     * That is, it does not necessarily contain info about all macroblocks,
+     * as long as the distance between macroblocks in the info is smaller
+     * than the target payload size.
+     * Each MB info structure is 12 bytes, and is laid out as follows:
+     * @code
+     * u32le bit offset from the start of the packet
+     * u8    current quantizer at the start of the macroblock
+     * u8    GOB number
+     * u16le macroblock address within the GOB
+     * u8    horizontal MV predictor
+     * u8    vertical MV predictor
+     * u8    horizontal MV predictor for block number 3
+     * u8    vertical MV predictor for block number 3
+     * @endcode
+     */
+    AV_PKT_DATA_H263_MB_INFO,
+};
+
+/**
+ * This structure stores compressed data. It is typically exported by demuxers
+ * and then passed as input to decoders, or received as output from encoders and
+ * then passed to muxers.
+ *
+ * For video, it should typically contain one compressed frame. For audio it may
+ * contain several compressed frames.
+ *
+ * AVPacket is one of the few structs in Libav, whose size is a part of public
+ * ABI. Thus it may be allocated on stack and no new fields can be added to it
+ * without libavcodec and libavformat major bump.
+ *
+ * The semantics of data ownership depends on the buf or destruct (deprecated)
+ * fields. If either is set, the packet data is dynamically allocated and is
+ * valid indefinitely until av_free_packet() is called (which in turn calls
+ * av_buffer_unref()/the destruct callback to free the data). If neither is set,
+ * the packet data is typically backed by some static buffer somewhere and is
+ * only valid for a limited time (e.g. until the next read call when demuxing).
+ *
+ * The side data is always allocated with av_malloc() and is freed in
+ * av_free_packet().
+ */
+typedef struct AVPacket {
+    /**
+     * A reference to the reference-counted buffer where the packet data is
+     * stored.
+     * May be NULL, then the packet data is not reference-counted.
+     */
+    AVBufferRef *buf;
+    /**
+     * Presentation timestamp in AVStream->time_base units; the time at which
+     * the decompressed packet will be presented to the user.
+     * Can be AV_NOPTS_VALUE if it is not stored in the file.
+     * pts MUST be larger or equal to dts as presentation cannot happen before
+     * decompression, unless one wants to view hex dumps. Some formats misuse
+     * the terms dts and pts/cts to mean something different. Such timestamps
+     * must be converted to true pts/dts before they are stored in AVPacket.
+     */
+    int64_t pts;
+    /**
+     * Decompression timestamp in AVStream->time_base units; the time at which
+     * the packet is decompressed.
+     * Can be AV_NOPTS_VALUE if it is not stored in the file.
+     */
+    int64_t dts;
+    uint8_t *data;
+    int   size;
+    int   stream_index;
+    /**
+     * A combination of AV_PKT_FLAG values
+     */
+    int   flags;
+    /**
+     * Additional packet data that can be provided by the container.
+     * Packet can contain several types of side information.
+     */
+    struct {
+        uint8_t *data;
+        int      size;
+        enum AVPacketSideDataType type;
+    } *side_data;
+    int side_data_elems;
+
+    /**
+     * Duration of this packet in AVStream->time_base units, 0 if unknown.
+     * Equals next_pts - this_pts in presentation order.
+     */
+    int   duration;
+#if FF_API_DESTRUCT_PACKET
+    attribute_deprecated
+    void  (*destruct)(struct AVPacket *);
+    attribute_deprecated
+    void  *priv;
+#endif
+    int64_t pos;                            ///< byte position in stream, -1 if unknown
+
+    /**
+     * Time difference in AVStream->time_base units from the pts of this
+     * packet to the point at which the output from the decoder has converged
+     * independent from the availability of previous frames. That is, the
+     * frames are virtually identical no matter if decoding started from
+     * the very first frame or from this keyframe.
+     * Is AV_NOPTS_VALUE if unknown.
+     * This field is not the display duration of the current packet.
+     * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
+     * set.
+     *
+     * The purpose of this field is to allow seeking in streams that have no
+     * keyframes in the conventional sense. It corresponds to the
+     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
+     * essential for some types of subtitle streams to ensure that all
+     * subtitles are correctly displayed after seeking.
+     */
+    int64_t convergence_duration;
+} AVPacket;
+#define AV_PKT_FLAG_KEY     0x0001 ///< The packet contains a keyframe
+#define AV_PKT_FLAG_CORRUPT 0x0002 ///< The packet content is corrupted
+
+enum AVSideDataParamChangeFlags {
+    AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_COUNT  = 0x0001,
+    AV_SIDE_DATA_PARAM_CHANGE_CHANNEL_LAYOUT = 0x0002,
+    AV_SIDE_DATA_PARAM_CHANGE_SAMPLE_RATE    = 0x0004,
+    AV_SIDE_DATA_PARAM_CHANGE_DIMENSIONS     = 0x0008,
+};
+/**
+ * @}
+ */
+
+struct AVCodecInternal;
+
+enum AVFieldOrder {
+    AV_FIELD_UNKNOWN,
+    AV_FIELD_PROGRESSIVE,
+    AV_FIELD_TT,          //< Top coded_first, top displayed first
+    AV_FIELD_BB,          //< Bottom coded first, bottom displayed first
+    AV_FIELD_TB,          //< Top coded first, bottom displayed first
+    AV_FIELD_BT,          //< Bottom coded first, top displayed first
+};
+
+/**
+ * main external API structure.
+ * New fields can be added to the end with minor version bumps.
+ * Removal, reordering and changes to existing fields require a major
+ * version bump.
+ * sizeof(AVCodecContext) must not be used outside libav*.
+ */
+typedef struct AVCodecContext {
+    /**
+     * information on struct for av_log
+     * - set by avcodec_alloc_context3
+     */
+    const AVClass *av_class;
+    int log_level_offset;
+
+    enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
+    const struct AVCodec  *codec;
+    char             codec_name[32];
+    enum AVCodecID     codec_id; /* see AV_CODEC_ID_xxx */
+
+    /**
+     * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
+     * This is used to work around some encoder bugs.
+     * A demuxer should set this to what is stored in the field used to identify the codec.
+     * If there are multiple such fields in a container then the demuxer should choose the one
+     * which maximizes the information about the used codec.
+     * If the codec tag field in a container is larger than 32 bits then the demuxer should
+     * remap the longer ID to 32 bits with a table or other structure. Alternatively a new
+     * extra_codec_tag + size could be added but for this a clear advantage must be demonstrated
+     * first.
+     * - encoding: Set by user, if not then the default based on codec_id will be used.
+     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
+     */
+    unsigned int codec_tag;
+
+    /**
+     * fourcc from the AVI stream header (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A').
+     * This is used to work around some encoder bugs.
+     * - encoding: unused
+     * - decoding: Set by user, will be converted to uppercase by libavcodec during init.
+     */
+    unsigned int stream_codec_tag;
+
+    void *priv_data;
+
+    /**
+     * Private context used for internal data.
+     *
+     * Unlike priv_data, this is not codec-specific. It is used in general
+     * libavcodec functions.
+     */
+    struct AVCodecInternal *internal;
+
+    /**
+     * Private data of the user, can be used to carry app specific stuff.
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    void *opaque;
+
+    /**
+     * the average bitrate
+     * - encoding: Set by user; unused for constant quantizer encoding.
+     * - decoding: Set by libavcodec. 0 or some bitrate if this info is available in the stream.
+     */
+    int bit_rate;
+
+    /**
+     * number of bits the bitstream is allowed to diverge from the reference.
+     *           the reference can be CBR (for CBR pass1) or VBR (for pass2)
+     * - encoding: Set by user; unused for constant quantizer encoding.
+     * - decoding: unused
+     */
+    int bit_rate_tolerance;
+
+    /**
+     * Global quality for codecs which cannot change it per frame.
+     * This should be proportional to MPEG-1/2/4 qscale.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int global_quality;
+
+    /**
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int compression_level;
+#define FF_COMPRESSION_DEFAULT -1
+
+    /**
+     * CODEC_FLAG_*.
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int flags;
+
+    /**
+     * CODEC_FLAG2_*
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int flags2;
+
+    /**
+     * some codecs need / can use extradata like Huffman tables.
+     * mjpeg: Huffman tables
+     * rv10: additional flags
+     * mpeg4: global headers (they can be in the bitstream or here)
+     * The allocated memory should be FF_INPUT_BUFFER_PADDING_SIZE bytes larger
+     * than extradata_size to avoid prolems if it is read with the bitstream reader.
+     * The bytewise contents of extradata must not depend on the architecture or CPU endianness.
+     * - encoding: Set/allocated/freed by libavcodec.
+     * - decoding: Set/allocated/freed by user.
+     */
+    uint8_t *extradata;
+    int extradata_size;
+
+    /**
+     * This is the fundamental unit of time (in seconds) in terms
+     * of which frame timestamps are represented. For fixed-fps content,
+     * timebase should be 1/framerate and timestamp increments should be
+     * identically 1.
+     * - encoding: MUST be set by user.
+     * - decoding: Set by libavcodec.
+     */
+    AVRational time_base;
+
+    /**
+     * For some codecs, the time base is closer to the field rate than the frame rate.
+     * Most notably, H.264 and MPEG-2 specify time_base as half of frame duration
+     * if no telecine is used ...
+     *
+     * Set to time_base ticks per frame. Default 1, e.g., H.264/MPEG-2 set it to 2.
+     */
+    int ticks_per_frame;
+
+    /**
+     * Codec delay.
+     *
+     * Video:
+     *   Number of frames the decoded output will be delayed relative to the
+     *   encoded input.
+     *
+     * Audio:
+     *   For encoding, this is the number of "priming" samples added to the
+     *   beginning of the stream. The decoded output will be delayed by this
+     *   many samples relative to the input to the encoder. Note that this
+     *   field is purely informational and does not directly affect the pts
+     *   output by the encoder, which should always be based on the actual
+     *   presentation time, including any delay.
+     *   For decoding, this is the number of samples the decoder needs to
+     *   output before the decoder's output is valid. When seeking, you should
+     *   start decoding this many samples prior to your desired seek point.
+     *
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by libavcodec.
+     */
+    int delay;
+
+
+    /* video only */
+    /**
+     * picture width / height.
+     * - encoding: MUST be set by user.
+     * - decoding: May be set by the user before opening the decoder if known e.g.
+     *             from the container. Some decoders will require the dimensions
+     *             to be set by the caller. During decoding, the decoder may
+     *             overwrite those values as required.
+     */
+    int width, height;
+
+    /**
+     * Bitstream width / height, may be different from width/height e.g. when
+     * the decoded frame is cropped before being output.
+     * - encoding: unused
+     * - decoding: May be set by the user before opening the decoder if known
+     *             e.g. from the container. During decoding, the decoder may
+     *             overwrite those values as required.
+     */
+    int coded_width, coded_height;
+
+#if FF_API_ASPECT_EXTENDED
+#define FF_ASPECT_EXTENDED 15
+#endif
+
+    /**
+     * the number of pictures in a group of pictures, or 0 for intra_only
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int gop_size;
+
+    /**
+     * Pixel format, see AV_PIX_FMT_xxx.
+     * May be set by the demuxer if known from headers.
+     * May be overriden by the decoder if it knows better.
+     * - encoding: Set by user.
+     * - decoding: Set by user if known, overridden by libavcodec if known
+     */
+    enum AVPixelFormat pix_fmt;
+
+    /**
+     * Motion estimation algorithm used for video coding.
+     * 1 (zero), 2 (full), 3 (log), 4 (phods), 5 (epzs), 6 (x1), 7 (hex),
+     * 8 (umh), 10 (tesa) [7, 8, 10 are x264 specific]
+     * - encoding: MUST be set by user.
+     * - decoding: unused
+     */
+    int me_method;
+
+    /**
+     * If non NULL, 'draw_horiz_band' is called by the libavcodec
+     * decoder to draw a horizontal band. It improves cache usage. Not
+     * all codecs can do that. You must check the codec capabilities
+     * beforehand.
+     * When multithreading is used, it may be called from multiple threads
+     * at the same time; threads might draw different parts of the same AVFrame,
+     * or multiple AVFrames, and there is no guarantee that slices will be drawn
+     * in order.
+     * The function is also used by hardware acceleration APIs.
+     * It is called at least once during frame decoding to pass
+     * the data needed for hardware render.
+     * In that mode instead of pixel data, AVFrame points to
+     * a structure specific to the acceleration API. The application
+     * reads the structure and can change some fields to indicate progress
+     * or mark state.
+     * - encoding: unused
+     * - decoding: Set by user.
+     * @param height the height of the slice
+     * @param y the y position of the slice
+     * @param type 1->top field, 2->bottom field, 3->frame
+     * @param offset offset into the AVFrame.data from which the slice should be read
+     */
+    void (*draw_horiz_band)(struct AVCodecContext *s,
+                            const AVFrame *src, int offset[AV_NUM_DATA_POINTERS],
+                            int y, int type, int height);
+
+    /**
+     * callback to negotiate the pixelFormat
+     * @param fmt is the list of formats which are supported by the codec,
+     * it is terminated by -1 as 0 is a valid format, the formats are ordered by quality.
+     * The first is always the native one.
+     * @return the chosen format
+     * - encoding: unused
+     * - decoding: Set by user, if not set the native format will be chosen.
+     */
+    enum AVPixelFormat (*get_format)(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
+
+    /**
+     * maximum number of B-frames between non-B-frames
+     * Note: The output will be delayed by max_b_frames+1 relative to the input.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int max_b_frames;
+
+    /**
+     * qscale factor between IP and B-frames
+     * If > 0 then the last P-frame quantizer will be used (q= lastp_q*factor+offset).
+     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float b_quant_factor;
+
+    /** obsolete FIXME remove */
+    int rc_strategy;
+#define FF_RC_STRATEGY_XVID 1
+
+    int b_frame_strategy;
+
+    /**
+     * qscale offset between IP and B-frames
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float b_quant_offset;
+
+    /**
+     * Size of the frame reordering buffer in the decoder.
+     * For MPEG-2 it is 1 IPB or 0 low delay IP.
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by libavcodec.
+     */
+    int has_b_frames;
+
+    /**
+     * 0-> h263 quant 1-> mpeg quant
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mpeg_quant;
+
+    /**
+     * qscale factor between P and I-frames
+     * If > 0 then the last p frame quantizer will be used (q= lastp_q*factor+offset).
+     * If < 0 then normal ratecontrol will be done (q= -normal_q*factor+offset).
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float i_quant_factor;
+
+    /**
+     * qscale offset between P and I-frames
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float i_quant_offset;
+
+    /**
+     * luminance masking (0-> disabled)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float lumi_masking;
+
+    /**
+     * temporary complexity masking (0-> disabled)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float temporal_cplx_masking;
+
+    /**
+     * spatial complexity masking (0-> disabled)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float spatial_cplx_masking;
+
+    /**
+     * p block masking (0-> disabled)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float p_masking;
+
+    /**
+     * darkness masking (0-> disabled)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float dark_masking;
+
+    /**
+     * slice count
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by user (or 0).
+     */
+    int slice_count;
+    /**
+     * prediction method (needed for huffyuv)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+     int prediction_method;
+#define FF_PRED_LEFT   0
+#define FF_PRED_PLANE  1
+#define FF_PRED_MEDIAN 2
+
+    /**
+     * slice offsets in the frame in bytes
+     * - encoding: Set/allocated by libavcodec.
+     * - decoding: Set/allocated by user (or NULL).
+     */
+    int *slice_offset;
+
+    /**
+     * sample aspect ratio (0 if unknown)
+     * That is the width of a pixel divided by the height of the pixel.
+     * Numerator and denominator must be relatively prime and smaller than 256 for some video standards.
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    AVRational sample_aspect_ratio;
+
+    /**
+     * motion estimation comparison function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_cmp;
+    /**
+     * subpixel motion estimation comparison function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_sub_cmp;
+    /**
+     * macroblock comparison function (not supported yet)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mb_cmp;
+    /**
+     * interlaced DCT comparison function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int ildct_cmp;
+#define FF_CMP_SAD    0
+#define FF_CMP_SSE    1
+#define FF_CMP_SATD   2
+#define FF_CMP_DCT    3
+#define FF_CMP_PSNR   4
+#define FF_CMP_BIT    5
+#define FF_CMP_RD     6
+#define FF_CMP_ZERO   7
+#define FF_CMP_VSAD   8
+#define FF_CMP_VSSE   9
+#define FF_CMP_NSSE   10
+#define FF_CMP_DCTMAX 13
+#define FF_CMP_DCT264 14
+#define FF_CMP_CHROMA 256
+
+    /**
+     * ME diamond size & shape
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int dia_size;
+
+    /**
+     * amount of previous MV predictors (2a+1 x 2a+1 square)
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int last_predictor_count;
+
+    /**
+     * prepass for motion estimation
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int pre_me;
+
+    /**
+     * motion estimation prepass comparison function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_pre_cmp;
+
+    /**
+     * ME prepass diamond size & shape
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int pre_dia_size;
+
+    /**
+     * subpel ME quality
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_subpel_quality;
+
+    /**
+     * DTG active format information (additional aspect ratio
+     * information only used in DVB MPEG-2 transport streams)
+     * 0 if not set.
+     *
+     * - encoding: unused
+     * - decoding: Set by decoder.
+     */
+    int dtg_active_format;
+#define FF_DTG_AFD_SAME         8
+#define FF_DTG_AFD_4_3          9
+#define FF_DTG_AFD_16_9         10
+#define FF_DTG_AFD_14_9         11
+#define FF_DTG_AFD_4_3_SP_14_9  13
+#define FF_DTG_AFD_16_9_SP_14_9 14
+#define FF_DTG_AFD_SP_4_3       15
+
+    /**
+     * maximum motion estimation search range in subpel units
+     * If 0 then no limit.
+     *
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_range;
+
+    /**
+     * intra quantizer bias
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int intra_quant_bias;
+#define FF_DEFAULT_QUANT_BIAS 999999
+
+    /**
+     * inter quantizer bias
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int inter_quant_bias;
+
+    /**
+     * slice flags
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int slice_flags;
+#define SLICE_FLAG_CODED_ORDER    0x0001 ///< draw_horiz_band() is called in coded order instead of display
+#define SLICE_FLAG_ALLOW_FIELD    0x0002 ///< allow draw_horiz_band() with field slices (MPEG2 field pics)
+#define SLICE_FLAG_ALLOW_PLANE    0x0004 ///< allow draw_horiz_band() with 1 component at a time (SVQ1)
+
+#if FF_API_XVMC
+    /**
+     * XVideo Motion Acceleration
+     * - encoding: forbidden
+     * - decoding: set by decoder
+     * @deprecated XvMC support is slated for removal.
+     */
+    attribute_deprecated int xvmc_acceleration;
+#endif /* FF_API_XVMC */
+
+    /**
+     * macroblock decision mode
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mb_decision;
+#define FF_MB_DECISION_SIMPLE 0        ///< uses mb_cmp
+#define FF_MB_DECISION_BITS   1        ///< chooses the one which needs the fewest bits
+#define FF_MB_DECISION_RD     2        ///< rate distortion
+
+    /**
+     * custom intra quantization matrix
+     * - encoding: Set by user, can be NULL.
+     * - decoding: Set by libavcodec.
+     */
+    uint16_t *intra_matrix;
+
+    /**
+     * custom inter quantization matrix
+     * - encoding: Set by user, can be NULL.
+     * - decoding: Set by libavcodec.
+     */
+    uint16_t *inter_matrix;
+
+    /**
+     * scene change detection threshold
+     * 0 is default, larger means fewer detected scene changes.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int scenechange_threshold;
+
+    /**
+     * noise reduction strength
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int noise_reduction;
+
+    /**
+     * Motion estimation threshold below which no motion estimation is
+     * performed, but instead the user specified motion vectors are used.
+     *
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_threshold;
+
+    /**
+     * Macroblock threshold below which the user specified macroblock types will be used.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mb_threshold;
+
+    /**
+     * precision of the intra DC coefficient - 8
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int intra_dc_precision;
+
+    /**
+     * Number of macroblock rows at the top which are skipped.
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int skip_top;
+
+    /**
+     * Number of macroblock rows at the bottom which are skipped.
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int skip_bottom;
+
+    /**
+     * Border processing masking, raises the quantizer for mbs on the borders
+     * of the picture.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float border_masking;
+
+    /**
+     * minimum MB lagrange multipler
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mb_lmin;
+
+    /**
+     * maximum MB lagrange multipler
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mb_lmax;
+
+    /**
+     *
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int me_penalty_compensation;
+
+    /**
+     *
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int bidir_refine;
+
+    /**
+     *
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int brd_scale;
+
+    /**
+     * minimum GOP size
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int keyint_min;
+
+    /**
+     * number of reference frames
+     * - encoding: Set by user.
+     * - decoding: Set by lavc.
+     */
+    int refs;
+
+    /**
+     * chroma qp offset from luma
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int chromaoffset;
+
+    /**
+     * Multiplied by qscale for each frame and added to scene_change_score.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int scenechange_factor;
+
+    /**
+     *
+     * Note: Value depends upon the compare function used for fullpel ME.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int mv0_threshold;
+
+    /**
+     * Adjust sensitivity of b_frame_strategy 1.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int b_sensitivity;
+
+    /**
+     * Chromaticity coordinates of the source primaries.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    enum AVColorPrimaries color_primaries;
+
+    /**
+     * Color Transfer Characteristic.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    enum AVColorTransferCharacteristic color_trc;
+
+    /**
+     * YUV colorspace type.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    enum AVColorSpace colorspace;
+
+    /**
+     * MPEG vs JPEG YUV range.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    enum AVColorRange color_range;
+
+    /**
+     * This defines the location of chroma samples.
+     * - encoding: Set by user
+     * - decoding: Set by libavcodec
+     */
+    enum AVChromaLocation chroma_sample_location;
+
+    /**
+     * Number of slices.
+     * Indicates number of picture subdivisions. Used for parallelized
+     * decoding.
+     * - encoding: Set by user
+     * - decoding: unused
+     */
+    int slices;
+
+    /** Field order
+     * - encoding: set by libavcodec
+     * - decoding: Set by libavcodec
+     */
+    enum AVFieldOrder field_order;
+
+    /* audio only */
+    int sample_rate; ///< samples per second
+    int channels;    ///< number of audio channels
+
+    /**
+     * audio sample format
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    enum AVSampleFormat sample_fmt;  ///< sample format
+
+    /* The following data should not be initialized. */
+    /**
+     * Number of samples per channel in an audio frame.
+     *
+     * - encoding: set by libavcodec in avcodec_open2(). Each submitted frame
+     *   except the last must contain exactly frame_size samples per channel.
+     *   May be 0 when the codec has CODEC_CAP_VARIABLE_FRAME_SIZE set, then the
+     *   frame size is not restricted.
+     * - decoding: may be set by some decoders to indicate constant frame size
+     */
+    int frame_size;
+
+    /**
+     * Frame counter, set by libavcodec.
+     *
+     * - decoding: total number of frames returned from the decoder so far.
+     * - encoding: total number of frames passed to the encoder so far.
+     *
+     *   @note the counter is not incremented if encoding/decoding resulted in
+     *   an error.
+     */
+    int frame_number;
+
+    /**
+     * number of bytes per packet if constant and known or 0
+     * Used by some WAV based audio codecs.
+     */
+    int block_align;
+
+    /**
+     * Audio cutoff bandwidth (0 means "automatic")
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int cutoff;
+
+#if FF_API_REQUEST_CHANNELS
+    /**
+     * Decoder should decode to this many channels if it can (0 for default)
+     * - encoding: unused
+     * - decoding: Set by user.
+     * @deprecated Deprecated in favor of request_channel_layout.
+     */
+    attribute_deprecated int request_channels;
+#endif
+
+    /**
+     * Audio channel layout.
+     * - encoding: set by user.
+     * - decoding: set by libavcodec.
+     */
+    uint64_t channel_layout;
+
+    /**
+     * Request decoder to use this channel layout if it can (0 for default)
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    uint64_t request_channel_layout;
+
+    /**
+     * Type of service that the audio stream conveys.
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+    enum AVAudioServiceType audio_service_type;
+
+    /**
+     * Used to request a sample format from the decoder.
+     * - encoding: unused.
+     * - decoding: Set by user.
+     */
+    enum AVSampleFormat request_sample_fmt;
+
+#if FF_API_GET_BUFFER
+    /**
+     * Called at the beginning of each frame to get a buffer for it.
+     *
+     * The function will set AVFrame.data[], AVFrame.linesize[].
+     * AVFrame.extended_data[] must also be set, but it should be the same as
+     * AVFrame.data[] except for planar audio with more channels than can fit
+     * in AVFrame.data[]. In that case, AVFrame.data[] shall still contain as
+     * many data pointers as it can hold.
+     *
+     * if CODEC_CAP_DR1 is not set then get_buffer() must call
+     * avcodec_default_get_buffer() instead of providing buffers allocated by
+     * some other means.
+     *
+     * AVFrame.data[] should be 32- or 16-byte-aligned unless the CPU doesn't
+     * need it. avcodec_default_get_buffer() aligns the output buffer properly,
+     * but if get_buffer() is overridden then alignment considerations should
+     * be taken into account.
+     *
+     * @see avcodec_default_get_buffer()
+     *
+     * Video:
+     *
+     * If pic.reference is set then the frame will be read later by libavcodec.
+     * avcodec_align_dimensions2() should be used to find the required width and
+     * height, as they normally need to be rounded up to the next multiple of 16.
+     *
+     * If frame multithreading is used and thread_safe_callbacks is set,
+     * it may be called from a different thread, but not from more than one at
+     * once. Does not need to be reentrant.
+     *
+     * @see release_buffer(), reget_buffer()
+     * @see avcodec_align_dimensions2()
+     *
+     * Audio:
+     *
+     * Decoders request a buffer of a particular size by setting
+     * AVFrame.nb_samples prior to calling get_buffer(). The decoder may,
+     * however, utilize only part of the buffer by setting AVFrame.nb_samples
+     * to a smaller value in the output frame.
+     *
+     * Decoders cannot use the buffer after returning from
+     * avcodec_decode_audio4(), so they will not call release_buffer(), as it
+     * is assumed to be released immediately upon return. In some rare cases,
+     * a decoder may need to call get_buffer() more than once in a single
+     * call to avcodec_decode_audio4(). In that case, when get_buffer() is
+     * called again after it has already been called once, the previously
+     * acquired buffer is assumed to be released at that time and may not be
+     * reused by the decoder.
+     *
+     * As a convenience, av_samples_get_buffer_size() and
+     * av_samples_fill_arrays() in libavutil may be used by custom get_buffer()
+     * functions to find the required data size and to fill data pointers and
+     * linesize. In AVFrame.linesize, only linesize[0] may be set for audio
+     * since all planes must be the same size.
+     *
+     * @see av_samples_get_buffer_size(), av_samples_fill_arrays()
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec, user can override.
+     *
+     * @deprecated use get_buffer2()
+     */
+    attribute_deprecated
+    int (*get_buffer)(struct AVCodecContext *c, AVFrame *pic);
+
+    /**
+     * Called to release buffers which were allocated with get_buffer.
+     * A released buffer can be reused in get_buffer().
+     * pic.data[*] must be set to NULL.
+     * May be called from a different thread if frame multithreading is used,
+     * but not by more than one thread at once, so does not need to be reentrant.
+     * - encoding: unused
+     * - decoding: Set by libavcodec, user can override.
+     *
+     * @deprecated custom freeing callbacks should be set from get_buffer2()
+     */
+    attribute_deprecated
+    void (*release_buffer)(struct AVCodecContext *c, AVFrame *pic);
+
+    /**
+     * Called at the beginning of a frame to get cr buffer for it.
+     * Buffer type (size, hints) must be the same. libavcodec won't check it.
+     * libavcodec will pass previous buffer in pic, function should return
+     * same buffer or new buffer with old frame "painted" into it.
+     * If pic.data[0] == NULL must behave like get_buffer().
+     * if CODEC_CAP_DR1 is not set then reget_buffer() must call
+     * avcodec_default_reget_buffer() instead of providing buffers allocated by
+     * some other means.
+     * - encoding: unused
+     * - decoding: Set by libavcodec, user can override.
+     */
+    attribute_deprecated
+    int (*reget_buffer)(struct AVCodecContext *c, AVFrame *pic);
+#endif
+
+    /**
+     * This callback is called at the beginning of each frame to get data
+     * buffer(s) for it. There may be one contiguous buffer for all the data or
+     * there may be a buffer per each data plane or anything in between. What
+     * this means is, you may set however many entries in buf[] you feel necessary.
+     * Each buffer must be reference-counted using the AVBuffer API (see description
+     * of buf[] below).
+     *
+     * The following fields will be set in the frame before this callback is
+     * called:
+     * - format
+     * - width, height (video only)
+     * - sample_rate, channel_layout, nb_samples (audio only)
+     * Their values may differ from the corresponding values in
+     * AVCodecContext. This callback must use the frame values, not the codec
+     * context values, to calculate the required buffer size.
+     *
+     * This callback must fill the following fields in the frame:
+     * - data[]
+     * - linesize[]
+     * - extended_data:
+     *   * if the data is planar audio with more than 8 channels, then this
+     *     callback must allocate and fill extended_data to contain all pointers
+     *     to all data planes. data[] must hold as many pointers as it can.
+     *     extended_data must be allocated with av_malloc() and will be freed in
+     *     av_frame_unref().
+     *   * otherwise exended_data must point to data
+     * - buf[] must contain one or more pointers to AVBufferRef structures. Each of
+     *   the frame's data and extended_data pointers must be contained in these. That
+     *   is, one AVBufferRef for each allocated chunk of memory, not necessarily one
+     *   AVBufferRef per data[] entry. See: av_buffer_create(), av_buffer_alloc(),
+     *   and av_buffer_ref().
+     * - extended_buf and nb_extended_buf must be allocated with av_malloc() by
+     *   this callback and filled with the extra buffers if there are more
+     *   buffers than buf[] can hold. extended_buf will be freed in
+     *   av_frame_unref().
+     *
+     * If CODEC_CAP_DR1 is not set then get_buffer2() must call
+     * avcodec_default_get_buffer2() instead of providing buffers allocated by
+     * some other means.
+     *
+     * Each data plane must be aligned to the maximum required by the target
+     * CPU.
+     *
+     * @see avcodec_default_get_buffer2()
+     *
+     * Video:
+     *
+     * If AV_GET_BUFFER_FLAG_REF is set in flags then the frame may be reused
+     * (read and/or written to if it is writable) later by libavcodec.
+     *
+     * avcodec_align_dimensions2() should be used to find the required width and
+     * height, as they normally need to be rounded up to the next multiple of 16.
+     *
+     * If frame multithreading is used and thread_safe_callbacks is set,
+     * this callback may be called from a different thread, but not from more
+     * than one at once. Does not need to be reentrant.
+     *
+     * @see avcodec_align_dimensions2()
+     *
+     * Audio:
+     *
+     * Decoders request a buffer of a particular size by setting
+     * AVFrame.nb_samples prior to calling get_buffer2(). The decoder may,
+     * however, utilize only part of the buffer by setting AVFrame.nb_samples
+     * to a smaller value in the output frame.
+     *
+     * As a convenience, av_samples_get_buffer_size() and
+     * av_samples_fill_arrays() in libavutil may be used by custom get_buffer2()
+     * functions to find the required data size and to fill data pointers and
+     * linesize. In AVFrame.linesize, only linesize[0] may be set for audio
+     * since all planes must be the same size.
+     *
+     * @see av_samples_get_buffer_size(), av_samples_fill_arrays()
+     *
+     * - encoding: unused
+     * - decoding: Set by libavcodec, user can override.
+     */
+    int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags);
+
+    /**
+     * If non-zero, the decoded audio and video frames returned from
+     * avcodec_decode_video2() and avcodec_decode_audio4() are reference-counted
+     * and are valid indefinitely. The caller must free them with
+     * av_frame_unref() when they are not needed anymore.
+     * Otherwise, the decoded frames must not be freed by the caller and are
+     * only valid until the next decode call.
+     *
+     * - encoding: unused
+     * - decoding: set by the caller before avcodec_open2().
+     */
+    int refcounted_frames;
+
+    /* - encoding parameters */
+    float qcompress;  ///< amount of qscale change between easy & hard scenes (0.0-1.0)
+    float qblur;      ///< amount of qscale smoothing over time (0.0-1.0)
+
+    /**
+     * minimum quantizer
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int qmin;
+
+    /**
+     * maximum quantizer
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int qmax;
+
+    /**
+     * maximum quantizer difference between frames
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int max_qdiff;
+
+    /**
+     * ratecontrol qmin qmax limiting method
+     * 0-> clipping, 1-> use a nice continuous function to limit qscale wthin qmin/qmax.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float rc_qsquish;
+
+    float rc_qmod_amp;
+    int rc_qmod_freq;
+
+    /**
+     * decoder bitstream buffer size
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int rc_buffer_size;
+
+    /**
+     * ratecontrol override, see RcOverride
+     * - encoding: Allocated/set/freed by user.
+     * - decoding: unused
+     */
+    int rc_override_count;
+    RcOverride *rc_override;
+
+    /**
+     * rate control equation
+     * - encoding: Set by user
+     * - decoding: unused
+     */
+    const char *rc_eq;
+
+    /**
+     * maximum bitrate
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int rc_max_rate;
+
+    /**
+     * minimum bitrate
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int rc_min_rate;
+
+    float rc_buffer_aggressivity;
+
+    /**
+     * initial complexity for pass1 ratecontrol
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    float rc_initial_cplx;
+
+    /**
+     * Ratecontrol attempt to use, at maximum, <value> of what can be used without an underflow.
+     * - encoding: Set by user.
+     * - decoding: unused.
+     */
+    float rc_max_available_vbv_use;
+
+    /**
+     * Ratecontrol attempt to use, at least, <value> times the amount needed to prevent a vbv overflow.
+     * - encoding: Set by user.
+     * - decoding: unused.
+     */
+    float rc_min_vbv_overflow_use;
+
+    /**
+     * Number of bits which should be loaded into the rc buffer before decoding starts.
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int rc_initial_buffer_occupancy;
+
+#define FF_CODER_TYPE_VLC       0
+#define FF_CODER_TYPE_AC        1
+#define FF_CODER_TYPE_RAW       2
+#define FF_CODER_TYPE_RLE       3
+#define FF_CODER_TYPE_DEFLATE   4
+    /**
+     * coder type
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int coder_type;
+
+    /**
+     * context model
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int context_model;
+
+    /**
+     * minimum Lagrange multipler
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int lmin;
+
+    /**
+     * maximum Lagrange multipler
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int lmax;
+
+    /**
+     * frame skip threshold
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int frame_skip_threshold;
+
+    /**
+     * frame skip factor
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int frame_skip_factor;
+
+    /**
+     * frame skip exponent
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int frame_skip_exp;
+
+    /**
+     * frame skip comparison function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int frame_skip_cmp;
+
+    /**
+     * trellis RD quantization
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int trellis;
+
+    /**
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int min_prediction_order;
+
+    /**
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int max_prediction_order;
+
+    /**
+     * GOP timecode frame start number, in non drop frame format
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int64_t timecode_frame_start;
+
+    /* The RTP callback: This function is called    */
+    /* every time the encoder has a packet to send. */
+    /* It depends on the encoder if the data starts */
+    /* with a Start Code (it should). H.263 does.   */
+    /* mb_nb contains the number of macroblocks     */
+    /* encoded in the RTP payload.                  */
+    void (*rtp_callback)(struct AVCodecContext *avctx, void *data, int size, int mb_nb);
+
+    int rtp_payload_size;   /* The size of the RTP payload: the coder will  */
+                            /* do its best to deliver a chunk with size     */
+                            /* below rtp_payload_size, the chunk will start */
+                            /* with a start code on some codecs like H.263. */
+                            /* This doesn't take account of any particular  */
+                            /* headers inside the transmitted RTP payload.  */
+
+    /* statistics, used for 2-pass encoding */
+    int mv_bits;
+    int header_bits;
+    int i_tex_bits;
+    int p_tex_bits;
+    int i_count;
+    int p_count;
+    int skip_count;
+    int misc_bits;
+
+    /**
+     * number of bits used for the previously encoded frame
+     * - encoding: Set by libavcodec.
+     * - decoding: unused
+     */
+    int frame_bits;
+
+    /**
+     * pass1 encoding statistics output buffer
+     * - encoding: Set by libavcodec.
+     * - decoding: unused
+     */
+    char *stats_out;
+
+    /**
+     * pass2 encoding statistics input buffer
+     * Concatenated stuff from stats_out of pass1 should be placed here.
+     * - encoding: Allocated/set/freed by user.
+     * - decoding: unused
+     */
+    char *stats_in;
+
+    /**
+     * Work around bugs in encoders which sometimes cannot be detected automatically.
+     * - encoding: Set by user
+     * - decoding: Set by user
+     */
+    int workaround_bugs;
+#define FF_BUG_AUTODETECT       1  ///< autodetection
+#if FF_API_OLD_MSMPEG4
+#define FF_BUG_OLD_MSMPEG4      2
+#endif
+#define FF_BUG_XVID_ILACE       4
+#define FF_BUG_UMP4             8
+#define FF_BUG_NO_PADDING       16
+#define FF_BUG_AMV              32
+#if FF_API_AC_VLC
+#define FF_BUG_AC_VLC           0  ///< Will be removed, libavcodec can now handle these non-compliant files by default.
+#endif
+#define FF_BUG_QPEL_CHROMA      64
+#define FF_BUG_STD_QPEL         128
+#define FF_BUG_QPEL_CHROMA2     256
+#define FF_BUG_DIRECT_BLOCKSIZE 512
+#define FF_BUG_EDGE             1024
+#define FF_BUG_HPEL_CHROMA      2048
+#define FF_BUG_DC_CLIP          4096
+#define FF_BUG_MS               8192 ///< Work around various bugs in Microsoft's broken decoders.
+#define FF_BUG_TRUNCATED       16384
+
+    /**
+     * strictly follow the standard (MPEG4, ...).
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     * Setting this to STRICT or higher means the encoder and decoder will
+     * generally do stupid things, whereas setting it to unofficial or lower
+     * will mean the encoder might produce output that is not supported by all
+     * spec-compliant decoders. Decoders don't differentiate between normal,
+     * unofficial and experimental (that is, they always try to decode things
+     * when they can) unless they are explicitly asked to behave stupidly
+     * (=strictly conform to the specs)
+     */
+    int strict_std_compliance;
+#define FF_COMPLIANCE_VERY_STRICT   2 ///< Strictly conform to an older more strict version of the spec or reference software.
+#define FF_COMPLIANCE_STRICT        1 ///< Strictly conform to all the things in the spec no matter what consequences.
+#define FF_COMPLIANCE_NORMAL        0
+#define FF_COMPLIANCE_UNOFFICIAL   -1 ///< Allow unofficial extensions
+#define FF_COMPLIANCE_EXPERIMENTAL -2 ///< Allow nonstandardized experimental things.
+
+    /**
+     * error concealment flags
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int error_concealment;
+#define FF_EC_GUESS_MVS   1
+#define FF_EC_DEBLOCK     2
+
+    /**
+     * debug
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int debug;
+#define FF_DEBUG_PICT_INFO   1
+#define FF_DEBUG_RC          2
+#define FF_DEBUG_BITSTREAM   4
+#define FF_DEBUG_MB_TYPE     8
+#define FF_DEBUG_QP          16
+#if FF_API_DEBUG_MV
+/**
+ * @deprecated this option does nothing
+ */
+#define FF_DEBUG_MV          32
+#endif
+#define FF_DEBUG_DCT_COEFF   0x00000040
+#define FF_DEBUG_SKIP        0x00000080
+#define FF_DEBUG_STARTCODE   0x00000100
+#define FF_DEBUG_PTS         0x00000200
+#define FF_DEBUG_ER          0x00000400
+#define FF_DEBUG_MMCO        0x00000800
+#define FF_DEBUG_BUGS        0x00001000
+#if FF_API_DEBUG_MV
+#define FF_DEBUG_VIS_QP      0x00002000
+#define FF_DEBUG_VIS_MB_TYPE 0x00004000
+#endif
+#define FF_DEBUG_BUFFERS     0x00008000
+#define FF_DEBUG_THREADS     0x00010000
+
+#if FF_API_DEBUG_MV
+    /**
+     * @deprecated this option does not have any effect
+     */
+    attribute_deprecated
+    int debug_mv;
+#define FF_DEBUG_VIS_MV_P_FOR  0x00000001 //visualize forward predicted MVs of P frames
+#define FF_DEBUG_VIS_MV_B_FOR  0x00000002 //visualize forward predicted MVs of B frames
+#define FF_DEBUG_VIS_MV_B_BACK 0x00000004 //visualize backward predicted MVs of B frames
+#endif
+
+    /**
+     * Error recognition; may misdetect some more or less valid parts as errors.
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int err_recognition;
+
+/**
+ * Verify checksums embedded in the bitstream (could be of either encoded or
+ * decoded data, depending on the codec) and print an error message on mismatch.
+ * If AV_EF_EXPLODE is also set, a mismatching checksum will result in the
+ * decoder returning an error.
+ */
+#define AV_EF_CRCCHECK  (1<<0)
+#define AV_EF_BITSTREAM (1<<1)
+#define AV_EF_BUFFER    (1<<2)
+#define AV_EF_EXPLODE   (1<<3)
+
+    /**
+     * opaque 64bit number (generally a PTS) that will be reordered and
+     * output in AVFrame.reordered_opaque
+     * @deprecated in favor of pkt_pts
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    int64_t reordered_opaque;
+
+    /**
+     * Hardware accelerator in use
+     * - encoding: unused.
+     * - decoding: Set by libavcodec
+     */
+    struct AVHWAccel *hwaccel;
+
+    /**
+     * Hardware accelerator context.
+     * For some hardware accelerators, a global context needs to be
+     * provided by the user. In that case, this holds display-dependent
+     * data Libav cannot instantiate itself. Please refer to the
+     * Libav HW accelerator documentation to know how to fill this
+     * is. e.g. for VA API, this is a struct vaapi_context.
+     * - encoding: unused
+     * - decoding: Set by user
+     */
+    void *hwaccel_context;
+
+    /**
+     * error
+     * - encoding: Set by libavcodec if flags&CODEC_FLAG_PSNR.
+     * - decoding: unused
+     */
+    uint64_t error[AV_NUM_DATA_POINTERS];
+
+    /**
+     * DCT algorithm, see FF_DCT_* below
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+    int dct_algo;
+#define FF_DCT_AUTO    0
+#define FF_DCT_FASTINT 1
+#define FF_DCT_INT     2
+#define FF_DCT_MMX     3
+#define FF_DCT_ALTIVEC 5
+#define FF_DCT_FAAN    6
+
+    /**
+     * IDCT algorithm, see FF_IDCT_* below.
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int idct_algo;
+#define FF_IDCT_AUTO          0
+#define FF_IDCT_INT           1
+#define FF_IDCT_SIMPLE        2
+#define FF_IDCT_SIMPLEMMX     3
+#define FF_IDCT_ARM           7
+#define FF_IDCT_ALTIVEC       8
+#define FF_IDCT_SH4           9
+#define FF_IDCT_SIMPLEARM     10
+#define FF_IDCT_IPP           13
+#define FF_IDCT_XVIDMMX       14
+#define FF_IDCT_SIMPLEARMV5TE 16
+#define FF_IDCT_SIMPLEARMV6   17
+#define FF_IDCT_SIMPLEVIS     18
+#define FF_IDCT_FAAN          20
+#define FF_IDCT_SIMPLENEON    22
+#if FF_API_ARCH_ALPHA
+#define FF_IDCT_SIMPLEALPHA   23
+#endif
+
+    /**
+     * bits per sample/pixel from the demuxer (needed for huffyuv).
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by user.
+     */
+     int bits_per_coded_sample;
+
+    /**
+     * Bits per sample/pixel of internal libavcodec pixel/sample format.
+     * - encoding: set by user.
+     * - decoding: set by libavcodec.
+     */
+    int bits_per_raw_sample;
+
+#if FF_API_LOWRES
+    /**
+     * low resolution decoding, 1-> 1/2 size, 2->1/4 size
+     * - encoding: unused
+     * - decoding: Set by user.
+     *
+     * @deprecated use decoder private options instead
+     */
+    attribute_deprecated int lowres;
+#endif
+
+    /**
+     * the picture in the bitstream
+     * - encoding: Set by libavcodec.
+     * - decoding: unused
+     */
+    AVFrame *coded_frame;
+
+    /**
+     * thread count
+     * is used to decide how many independent tasks should be passed to execute()
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int thread_count;
+
+    /**
+     * Which multithreading methods to use.
+     * Use of FF_THREAD_FRAME will increase decoding delay by one frame per thread,
+     * so clients which cannot provide future frames should not use it.
+     *
+     * - encoding: Set by user, otherwise the default is used.
+     * - decoding: Set by user, otherwise the default is used.
+     */
+    int thread_type;
+#define FF_THREAD_FRAME   1 ///< Decode more than one frame at once
+#define FF_THREAD_SLICE   2 ///< Decode more than one part of a single frame at once
+
+    /**
+     * Which multithreading methods are in use by the codec.
+     * - encoding: Set by libavcodec.
+     * - decoding: Set by libavcodec.
+     */
+    int active_thread_type;
+
+    /**
+     * Set by the client if its custom get_buffer() callback can be called
+     * synchronously from another thread, which allows faster multithreaded decoding.
+     * draw_horiz_band() will be called from other threads regardless of this setting.
+     * Ignored if the default get_buffer() is used.
+     * - encoding: Set by user.
+     * - decoding: Set by user.
+     */
+    int thread_safe_callbacks;
+
+    /**
+     * The codec may call this to execute several independent things.
+     * It will return only after finishing all tasks.
+     * The user may replace this with some multithreaded implementation,
+     * the default implementation will execute the parts serially.
+     * @param count the number of things to execute
+     * - encoding: Set by libavcodec, user can override.
+     * - decoding: Set by libavcodec, user can override.
+     */
+    int (*execute)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg), void *arg2, int *ret, int count, int size);
+
+    /**
+     * The codec may call this to execute several independent things.
+     * It will return only after finishing all tasks.
+     * The user may replace this with some multithreaded implementation,
+     * the default implementation will execute the parts serially.
+     * Also see avcodec_thread_init and e.g. the --enable-pthread configure option.
+     * @param c context passed also to func
+     * @param count the number of things to execute
+     * @param arg2 argument passed unchanged to func
+     * @param ret return values of executed functions, must have space for "count" values. May be NULL.
+     * @param func function that will be called count times, with jobnr from 0 to count-1.
+     *             threadnr will be in the range 0 to c->thread_count-1 < MAX_THREADS and so that no
+     *             two instances of func executing at the same time will have the same threadnr.
+     * @return always 0 currently, but code should handle a future improvement where when any call to func
+     *         returns < 0 no further calls to func may be done and < 0 is returned.
+     * - encoding: Set by libavcodec, user can override.
+     * - decoding: Set by libavcodec, user can override.
+     */
+    int (*execute2)(struct AVCodecContext *c, int (*func)(struct AVCodecContext *c2, void *arg, int jobnr, int threadnr), void *arg2, int *ret, int count);
+
+#if FF_API_THREAD_OPAQUE
+    /**
+     * @deprecated this field should not be used from outside of lavc
+     */
+    attribute_deprecated
+    void *thread_opaque;
+#endif
+
+    /**
+     * noise vs. sse weight for the nsse comparsion function
+     * - encoding: Set by user.
+     * - decoding: unused
+     */
+     int nsse_weight;
+
+    /**
+     * profile
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+     int profile;
+#define FF_PROFILE_UNKNOWN -99
+#define FF_PROFILE_RESERVED -100
+
+#define FF_PROFILE_AAC_MAIN 0
+#define FF_PROFILE_AAC_LOW  1
+#define FF_PROFILE_AAC_SSR  2
+#define FF_PROFILE_AAC_LTP  3
+#define FF_PROFILE_AAC_HE   4
+#define FF_PROFILE_AAC_HE_V2 28
+#define FF_PROFILE_AAC_LD   22
+#define FF_PROFILE_AAC_ELD  38
+#define FF_PROFILE_MPEG2_AAC_LOW 128
+#define FF_PROFILE_MPEG2_AAC_HE  131
+
+#define FF_PROFILE_DTS         20
+#define FF_PROFILE_DTS_ES      30
+#define FF_PROFILE_DTS_96_24   40
+#define FF_PROFILE_DTS_HD_HRA  50
+#define FF_PROFILE_DTS_HD_MA   60
+
+#define FF_PROFILE_MPEG2_422    0
+#define FF_PROFILE_MPEG2_HIGH   1
+#define FF_PROFILE_MPEG2_SS     2
+#define FF_PROFILE_MPEG2_SNR_SCALABLE  3
+#define FF_PROFILE_MPEG2_MAIN   4
+#define FF_PROFILE_MPEG2_SIMPLE 5
+
+#define FF_PROFILE_H264_CONSTRAINED  (1<<9)  // 8+1; constraint_set1_flag
+#define FF_PROFILE_H264_INTRA        (1<<11) // 8+3; constraint_set3_flag
+
+#define FF_PROFILE_H264_BASELINE             66
+#define FF_PROFILE_H264_CONSTRAINED_BASELINE (66|FF_PROFILE_H264_CONSTRAINED)
+#define FF_PROFILE_H264_MAIN                 77
+#define FF_PROFILE_H264_EXTENDED             88
+#define FF_PROFILE_H264_HIGH                 100
+#define FF_PROFILE_H264_HIGH_10              110
+#define FF_PROFILE_H264_HIGH_10_INTRA        (110|FF_PROFILE_H264_INTRA)
+#define FF_PROFILE_H264_HIGH_422             122
+#define FF_PROFILE_H264_HIGH_422_INTRA       (122|FF_PROFILE_H264_INTRA)
+#define FF_PROFILE_H264_HIGH_444             144
+#define FF_PROFILE_H264_HIGH_444_PREDICTIVE  244
+#define FF_PROFILE_H264_HIGH_444_INTRA       (244|FF_PROFILE_H264_INTRA)
+#define FF_PROFILE_H264_CAVLC_444            44
+
+#define FF_PROFILE_VC1_SIMPLE   0
+#define FF_PROFILE_VC1_MAIN     1
+#define FF_PROFILE_VC1_COMPLEX  2
+#define FF_PROFILE_VC1_ADVANCED 3
+
+#define FF_PROFILE_MPEG4_SIMPLE                     0
+#define FF_PROFILE_MPEG4_SIMPLE_SCALABLE            1
+#define FF_PROFILE_MPEG4_CORE                       2
+#define FF_PROFILE_MPEG4_MAIN                       3
+#define FF_PROFILE_MPEG4_N_BIT                      4
+#define FF_PROFILE_MPEG4_SCALABLE_TEXTURE           5
+#define FF_PROFILE_MPEG4_SIMPLE_FACE_ANIMATION      6
+#define FF_PROFILE_MPEG4_BASIC_ANIMATED_TEXTURE     7
+#define FF_PROFILE_MPEG4_HYBRID                     8
+#define FF_PROFILE_MPEG4_ADVANCED_REAL_TIME         9
+#define FF_PROFILE_MPEG4_CORE_SCALABLE             10
+#define FF_PROFILE_MPEG4_ADVANCED_CODING           11
+#define FF_PROFILE_MPEG4_ADVANCED_CORE             12
+#define FF_PROFILE_MPEG4_ADVANCED_SCALABLE_TEXTURE 13
+#define FF_PROFILE_MPEG4_SIMPLE_STUDIO             14
+#define FF_PROFILE_MPEG4_ADVANCED_SIMPLE           15
+
+#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_0   0
+#define FF_PROFILE_JPEG2000_CSTREAM_RESTRICTION_1   1
+#define FF_PROFILE_JPEG2000_CSTREAM_NO_RESTRICTION  2
+#define FF_PROFILE_JPEG2000_DCINEMA_2K              3
+#define FF_PROFILE_JPEG2000_DCINEMA_4K              4
+
+
+#define FF_PROFILE_HEVC_MAIN                        1
+#define FF_PROFILE_HEVC_MAIN_10                     2
+#define FF_PROFILE_HEVC_MAIN_STILL_PICTURE          3
+
+    /**
+     * level
+     * - encoding: Set by user.
+     * - decoding: Set by libavcodec.
+     */
+     int level;
+#define FF_LEVEL_UNKNOWN -99
+
+    /**
+     *
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    enum AVDiscard skip_loop_filter;
+
+    /**
+     *
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    enum AVDiscard skip_idct;
+
+    /**
+     *
+     * - encoding: unused
+     * - decoding: Set by user.
+     */
+    enum AVDiscard skip_frame;
+
+    /**
+     * Header containing style information for text subtitles.
+     * For SUBTITLE_ASS subtitle type, it should contain the whole ASS
+     * [Script Info] and [V4+ Styles] section, plus the [Events] line and
+     * the Format line following. It shouldn't include any Dialogue line.
+     * - encoding: Set/allocated/freed by user (before avcodec_open2())
+     * - decoding: Set/allocated/freed by libavcodec (by avcodec_open2())
+     */
+    uint8_t *subtitle_header;
+    int subtitle_header_size;
+
+#if FF_API_ERROR_RATE
+    /**
+     * @deprecated use the 'error_rate' private AVOption of the mpegvideo
+     * encoders
+     */
+    attribute_deprecated
+    int error_rate;
+#endif
+
+#if FF_API_CODEC_PKT
+    /**
+     * @deprecated this field is not supposed to be accessed from outside lavc
+     */
+    attribute_deprecated
+    AVPacket *pkt;
+#endif
+
+    /**
+     * VBV delay coded in the last frame (in periods of a 27 MHz clock).
+     * Used for compliant TS muxing.
+     * - encoding: Set by libavcodec.
+     * - decoding: unused.
+     */
+    uint64_t vbv_delay;
+} AVCodecContext;
+
+/**
+ * AVProfile.
+ */
+typedef struct AVProfile {
+    int profile;
+    const char *name; ///< short name for the profile
+} AVProfile;
+
+typedef struct AVCodecDefault AVCodecDefault;
+
+struct AVSubtitle;
+
+/**
+ * AVCodec.
+ */
+typedef struct AVCodec {
+    /**
+     * Name of the codec implementation.
+     * The name is globally unique among encoders and among decoders (but an
+     * encoder and a decoder can share the same name).
+     * This is the primary way to find a codec from the user perspective.
+     */
+    const char *name;
+    /**
+     * Descriptive name for the codec, meant to be more human readable than name.
+     * You should use the NULL_IF_CONFIG_SMALL() macro to define it.
+     */
+    const char *long_name;
+    enum AVMediaType type;
+    enum AVCodecID id;
+    /**
+     * Codec capabilities.
+     * see CODEC_CAP_*
+     */
+    int capabilities;
+    const AVRational *supported_framerates; ///< array of supported framerates, or NULL if any, array is terminated by {0,0}
+    const enum AVPixelFormat *pix_fmts;     ///< array of supported pixel formats, or NULL if unknown, array is terminated by -1
+    const int *supported_samplerates;       ///< array of supported audio samplerates, or NULL if unknown, array is terminated by 0
+    const enum AVSampleFormat *sample_fmts; ///< array of supported sample formats, or NULL if unknown, array is terminated by -1
+    const uint64_t *channel_layouts;         ///< array of support channel layouts, or NULL if unknown. array is terminated by 0
+#if FF_API_LOWRES
+    attribute_deprecated uint8_t max_lowres; ///< maximum value for lowres supported by the decoder
+#endif
+    const AVClass *priv_class;              ///< AVClass for the private context
+    const AVProfile *profiles;              ///< array of recognized profiles, or NULL if unknown, array is terminated by {FF_PROFILE_UNKNOWN}
+
+    /*****************************************************************
+     * No fields below this line are part of the public API. They
+     * may not be used outside of libavcodec and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
+    int priv_data_size;
+    struct AVCodec *next;
+    /**
+     * @name Frame-level threading support functions
+     * @{
+     */
+    /**
+     * If defined, called on thread contexts when they are created.
+     * If the codec allocates writable tables in init(), re-allocate them here.
+     * priv_data will be set to a copy of the original.
+     */
+    int (*init_thread_copy)(AVCodecContext *);
+    /**
+     * Copy necessary context variables from a previous thread context to the current one.
+     * If not defined, the next thread will start automatically; otherwise, the codec
+     * must call ff_thread_finish_setup().
+     *
+     * dst and src will (rarely) point to the same context, in which case memcpy should be skipped.
+     */
+    int (*update_thread_context)(AVCodecContext *dst, const AVCodecContext *src);
+    /** @} */
+
+    /**
+     * Private codec-specific defaults.
+     */
+    const AVCodecDefault *defaults;
+
+    /**
+     * Initialize codec static data, called from avcodec_register().
+     */
+    void (*init_static_data)(struct AVCodec *codec);
+
+    int (*init)(AVCodecContext *);
+    int (*encode_sub)(AVCodecContext *, uint8_t *buf, int buf_size,
+                      const struct AVSubtitle *sub);
+    /**
+     * Encode data to an AVPacket.
+     *
+     * @param      avctx          codec context
+     * @param      avpkt          output AVPacket (may contain a user-provided buffer)
+     * @param[in]  frame          AVFrame containing the raw data to be encoded
+     * @param[out] got_packet_ptr encoder sets to 0 or 1 to indicate that a
+     *                            non-empty packet was returned in avpkt.
+     * @return 0 on success, negative error code on failure
+     */
+    int (*encode2)(AVCodecContext *avctx, AVPacket *avpkt, const AVFrame *frame,
+                   int *got_packet_ptr);
+    int (*decode)(AVCodecContext *, void *outdata, int *outdata_size, AVPacket *avpkt);
+    int (*close)(AVCodecContext *);
+    /**
+     * Flush buffers.
+     * Will be called when seeking
+     */
+    void (*flush)(AVCodecContext *);
+} AVCodec;
+
+/**
+ * AVHWAccel.
+ */
+typedef struct AVHWAccel {
+    /**
+     * Name of the hardware accelerated codec.
+     * The name is globally unique among encoders and among decoders (but an
+     * encoder and a decoder can share the same name).
+     */
+    const char *name;
+
+    /**
+     * Type of codec implemented by the hardware accelerator.
+     *
+     * See AVMEDIA_TYPE_xxx
+     */
+    enum AVMediaType type;
+
+    /**
+     * Codec implemented by the hardware accelerator.
+     *
+     * See AV_CODEC_ID_xxx
+     */
+    enum AVCodecID id;
+
+    /**
+     * Supported pixel format.
+     *
+     * Only hardware accelerated formats are supported here.
+     */
+    enum AVPixelFormat pix_fmt;
+
+    /**
+     * Hardware accelerated codec capabilities.
+     * see FF_HWACCEL_CODEC_CAP_*
+     */
+    int capabilities;
+
+    struct AVHWAccel *next;
+
+    /**
+     * Called at the beginning of each frame or field picture.
+     *
+     * Meaningful frame information (codec specific) is guaranteed to
+     * be parsed at this point. This function is mandatory.
+     *
+     * Note that buf can be NULL along with buf_size set to 0.
+     * Otherwise, this means the whole frame is available at this point.
+     *
+     * @param avctx the codec context
+     * @param buf the frame data buffer base
+     * @param buf_size the size of the frame in bytes
+     * @return zero if successful, a negative value otherwise
+     */
+    int (*start_frame)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
+
+    /**
+     * Callback for each slice.
+     *
+     * Meaningful slice information (codec specific) is guaranteed to
+     * be parsed at this point. This function is mandatory.
+     *
+     * @param avctx the codec context
+     * @param buf the slice data buffer base
+     * @param buf_size the size of the slice in bytes
+     * @return zero if successful, a negative value otherwise
+     */
+    int (*decode_slice)(AVCodecContext *avctx, const uint8_t *buf, uint32_t buf_size);
+
+    /**
+     * Called at the end of each frame or field picture.
+     *
+     * The whole picture is parsed at this point and can now be sent
+     * to the hardware accelerator. This function is mandatory.
+     *
+     * @param avctx the codec context
+     * @return zero if successful, a negative value otherwise
+     */
+    int (*end_frame)(AVCodecContext *avctx);
+
+    /**
+     * Size of HW accelerator private data.
+     *
+     * Private data is allocated with av_mallocz() before
+     * AVCodecContext.get_buffer() and deallocated after
+     * AVCodecContext.release_buffer().
+     */
+    int priv_data_size;
+} AVHWAccel;
+
+/**
+ * @defgroup lavc_picture AVPicture
+ *
+ * Functions for working with AVPicture
+ * @{
+ */
+
+/**
+ * four components are given, that's all.
+ * the last component is alpha
+ */
+typedef struct AVPicture {
+    uint8_t *data[AV_NUM_DATA_POINTERS];
+    int linesize[AV_NUM_DATA_POINTERS];     ///< number of bytes per line
+} AVPicture;
+
+/**
+ * @}
+ */
+
+#define AVPALETTE_SIZE 1024
+#define AVPALETTE_COUNT 256
+
+enum AVSubtitleType {
+    SUBTITLE_NONE,
+
+    SUBTITLE_BITMAP,                ///< A bitmap, pict will be set
+
+    /**
+     * Plain text, the text field must be set by the decoder and is
+     * authoritative. ass and pict fields may contain approximations.
+     */
+    SUBTITLE_TEXT,
+
+    /**
+     * Formatted text, the ass field must be set by the decoder and is
+     * authoritative. pict and text fields may contain approximations.
+     */
+    SUBTITLE_ASS,
+};
+
+#define AV_SUBTITLE_FLAG_FORCED 0x00000001
+
+typedef struct AVSubtitleRect {
+    int x;         ///< top left corner  of pict, undefined when pict is not set
+    int y;         ///< top left corner  of pict, undefined when pict is not set
+    int w;         ///< width            of pict, undefined when pict is not set
+    int h;         ///< height           of pict, undefined when pict is not set
+    int nb_colors; ///< number of colors in pict, undefined when pict is not set
+
+    /**
+     * data+linesize for the bitmap of this subtitle.
+     * can be set for text/ass as well once they where rendered
+     */
+    AVPicture pict;
+    enum AVSubtitleType type;
+
+    char *text;                     ///< 0 terminated plain UTF-8 text
+
+    /**
+     * 0 terminated ASS/SSA compatible event line.
+     * The pressentation of this is unaffected by the other values in this
+     * struct.
+     */
+    char *ass;
+    int flags;
+} AVSubtitleRect;
+
+typedef struct AVSubtitle {
+    uint16_t format; /* 0 = graphics */
+    uint32_t start_display_time; /* relative to packet pts, in ms */
+    uint32_t end_display_time; /* relative to packet pts, in ms */
+    unsigned num_rects;
+    AVSubtitleRect **rects;
+    int64_t pts;    ///< Same as packet pts, in AV_TIME_BASE
+} AVSubtitle;
+
+/**
+ * If c is NULL, returns the first registered codec,
+ * if c is non-NULL, returns the next registered codec after c,
+ * or NULL if c is the last one.
+ */
+AVCodec *av_codec_next(const AVCodec *c);
+
+/**
+ * Return the LIBAVCODEC_VERSION_INT constant.
+ */
+unsigned avcodec_version(void);
+
+/**
+ * Return the libavcodec build-time configuration.
+ */
+const char *avcodec_configuration(void);
+
+/**
+ * Return the libavcodec license.
+ */
+const char *avcodec_license(void);
+
+/**
+ * Register the codec codec and initialize libavcodec.
+ *
+ * @warning either this function or avcodec_register_all() must be called
+ * before any other libavcodec functions.
+ *
+ * @see avcodec_register_all()
+ */
+void avcodec_register(AVCodec *codec);
+
+/**
+ * Register all the codecs, parsers and bitstream filters which were enabled at
+ * configuration time. If you do not call this function you can select exactly
+ * which formats you want to support, by using the individual registration
+ * functions.
+ *
+ * @see avcodec_register
+ * @see av_register_codec_parser
+ * @see av_register_bitstream_filter
+ */
+void avcodec_register_all(void);
+
+/**
+ * Allocate an AVCodecContext and set its fields to default values.  The
+ * resulting struct can be deallocated by calling avcodec_close() on it followed
+ * by av_free().
+ *
+ * @param codec if non-NULL, allocate private data and initialize defaults
+ *              for the given codec. It is illegal to then call avcodec_open2()
+ *              with a different codec.
+ *              If NULL, then the codec-specific defaults won't be initialized,
+ *              which may result in suboptimal default settings (this is
+ *              important mainly for encoders, e.g. libx264).
+ *
+ * @return An AVCodecContext filled with default values or NULL on failure.
+ * @see avcodec_get_context_defaults
+ */
+AVCodecContext *avcodec_alloc_context3(const AVCodec *codec);
+
+/**
+ * Set the fields of the given AVCodecContext to default values corresponding
+ * to the given codec (defaults may be codec-dependent).
+ *
+ * Do not call this function if a non-NULL codec has been passed
+ * to avcodec_alloc_context3() that allocated this AVCodecContext.
+ * If codec is non-NULL, it is illegal to call avcodec_open2() with a
+ * different codec on this AVCodecContext.
+ */
+int avcodec_get_context_defaults3(AVCodecContext *s, const AVCodec *codec);
+
+/**
+ * Get the AVClass for AVCodecContext. It can be used in combination with
+ * AV_OPT_SEARCH_FAKE_OBJ for examining options.
+ *
+ * @see av_opt_find().
+ */
+const AVClass *avcodec_get_class(void);
+
+/**
+ * Copy the settings of the source AVCodecContext into the destination
+ * AVCodecContext. The resulting destination codec context will be
+ * unopened, i.e. you are required to call avcodec_open2() before you
+ * can use this AVCodecContext to decode/encode video/audio data.
+ *
+ * @param dest target codec context, should be initialized with
+ *             avcodec_alloc_context3(), but otherwise uninitialized
+ * @param src source codec context
+ * @return AVERROR() on error (e.g. memory allocation error), 0 on success
+ */
+int avcodec_copy_context(AVCodecContext *dest, const AVCodecContext *src);
+
+#if FF_API_AVFRAME_LAVC
+/**
+ * @deprecated use av_frame_alloc()
+ */
+attribute_deprecated
+AVFrame *avcodec_alloc_frame(void);
+
+/**
+ * Set the fields of the given AVFrame to default values.
+ *
+ * @param frame The AVFrame of which the fields should be set to default values.
+ *
+ * @deprecated use av_frame_unref()
+ */
+attribute_deprecated
+void avcodec_get_frame_defaults(AVFrame *frame);
+
+/**
+ * Free the frame and any dynamically allocated objects in it,
+ * e.g. extended_data.
+ *
+ * @param frame frame to be freed. The pointer will be set to NULL.
+ *
+ * @warning this function does NOT free the data buffers themselves
+ * (it does not know how, since they might have been allocated with
+ *  a custom get_buffer()).
+ *
+ * @deprecated use av_frame_free()
+ */
+attribute_deprecated
+void avcodec_free_frame(AVFrame **frame);
+#endif
+
+/**
+ * Initialize the AVCodecContext to use the given AVCodec. Prior to using this
+ * function the context has to be allocated with avcodec_alloc_context3().
+ *
+ * The functions avcodec_find_decoder_by_name(), avcodec_find_encoder_by_name(),
+ * avcodec_find_decoder() and avcodec_find_encoder() provide an easy way for
+ * retrieving a codec.
+ *
+ * @warning This function is not thread safe!
+ *
+ * @code
+ * avcodec_register_all();
+ * av_dict_set(&opts, "b", "2.5M", 0);
+ * codec = avcodec_find_decoder(AV_CODEC_ID_H264);
+ * if (!codec)
+ *     exit(1);
+ *
+ * context = avcodec_alloc_context3(codec);
+ *
+ * if (avcodec_open2(context, codec, opts) < 0)
+ *     exit(1);
+ * @endcode
+ *
+ * @param avctx The context to initialize.
+ * @param codec The codec to open this context for. If a non-NULL codec has been
+ *              previously passed to avcodec_alloc_context3() or
+ *              avcodec_get_context_defaults3() for this context, then this
+ *              parameter MUST be either NULL or equal to the previously passed
+ *              codec.
+ * @param options A dictionary filled with AVCodecContext and codec-private options.
+ *                On return this object will be filled with options that were not found.
+ *
+ * @return zero on success, a negative value on error
+ * @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(),
+ *      av_dict_set(), av_opt_find().
+ */
+int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
+
+/**
+ * Close a given AVCodecContext and free all the data associated with it
+ * (but not the AVCodecContext itself).
+ *
+ * Calling this function on an AVCodecContext that hasn't been opened will free
+ * the codec-specific data allocated in avcodec_alloc_context3() /
+ * avcodec_get_context_defaults3() with a non-NULL codec. Subsequent calls will
+ * do nothing.
+ */
+int avcodec_close(AVCodecContext *avctx);
+
+/**
+ * Free all allocated data in the given subtitle struct.
+ *
+ * @param sub AVSubtitle to free.
+ */
+void avsubtitle_free(AVSubtitle *sub);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavc_packet
+ * @{
+ */
+
+#if FF_API_DESTRUCT_PACKET
+/**
+ * Default packet destructor.
+ * @deprecated use the AVBuffer API instead
+ */
+attribute_deprecated
+void av_destruct_packet(AVPacket *pkt);
+#endif
+
+/**
+ * Initialize optional fields of a packet with default values.
+ *
+ * Note, this does not touch the data and size members, which have to be
+ * initialized separately.
+ *
+ * @param pkt packet
+ */
+void av_init_packet(AVPacket *pkt);
+
+/**
+ * Allocate the payload of a packet and initialize its fields with
+ * default values.
+ *
+ * @param pkt packet
+ * @param size wanted payload size
+ * @return 0 if OK, AVERROR_xxx otherwise
+ */
+int av_new_packet(AVPacket *pkt, int size);
+
+/**
+ * Reduce packet size, correctly zeroing padding
+ *
+ * @param pkt packet
+ * @param size new size
+ */
+void av_shrink_packet(AVPacket *pkt, int size);
+
+/**
+ * Increase packet size, correctly zeroing padding
+ *
+ * @param pkt packet
+ * @param grow_by number of bytes by which to increase the size of the packet
+ */
+int av_grow_packet(AVPacket *pkt, int grow_by);
+
+/**
+ * Initialize a reference-counted packet from av_malloc()ed data.
+ *
+ * @param pkt packet to be initialized. This function will set the data, size,
+ *        buf and destruct fields, all others are left untouched.
+ * @param data Data allocated by av_malloc() to be used as packet data. If this
+ *        function returns successfully, the data is owned by the underlying AVBuffer.
+ *        The caller may not access the data through other means.
+ * @param size size of data in bytes, without the padding. I.e. the full buffer
+ *        size is assumed to be size + FF_INPUT_BUFFER_PADDING_SIZE.
+ *
+ * @return 0 on success, a negative AVERROR on error
+ */
+int av_packet_from_data(AVPacket *pkt, uint8_t *data, int size);
+
+/**
+ * @warning This is a hack - the packet memory allocation stuff is broken. The
+ * packet is allocated if it was not really allocated.
+ */
+int av_dup_packet(AVPacket *pkt);
+
+/**
+ * Free a packet.
+ *
+ * @param pkt packet to free
+ */
+void av_free_packet(AVPacket *pkt);
+
+/**
+ * Allocate new information of a packet.
+ *
+ * @param pkt packet
+ * @param type side information type
+ * @param size side information size
+ * @return pointer to fresh allocated data or NULL otherwise
+ */
+uint8_t* av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
+                                 int size);
+
+/**
+ * Shrink the already allocated side data buffer
+ *
+ * @param pkt packet
+ * @param type side information type
+ * @param size new side information size
+ * @return 0 on success, < 0 on failure
+ */
+int av_packet_shrink_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
+                               int size);
+
+/**
+ * Get side information from packet.
+ *
+ * @param pkt packet
+ * @param type desired side information type
+ * @param size pointer for side information size to store (optional)
+ * @return pointer to data if present or NULL otherwise
+ */
+uint8_t* av_packet_get_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
+                                 int *size);
+
+/**
+ * Convenience function to free all the side data stored.
+ * All the other fields stay untouched.
+ *
+ * @param pkt packet
+ */
+void av_packet_free_side_data(AVPacket *pkt);
+
+/**
+ * Setup a new reference to the data described by a given packet
+ *
+ * If src is reference-counted, setup dst as a new reference to the
+ * buffer in src. Otherwise allocate a new buffer in dst and copy the
+ * data from src into it.
+ *
+ * All the other fields are copied from src.
+ *
+ * @see av_packet_unref
+ *
+ * @param dst Destination packet
+ * @param src Source packet
+ *
+ * @return 0 on success, a negative AVERROR on error.
+ */
+int av_packet_ref(AVPacket *dst, AVPacket *src);
+
+/**
+ * Wipe the packet.
+ *
+ * Unreference the buffer referenced by the packet and reset the
+ * remaining packet fields to their default values.
+ *
+ * @param pkt The packet to be unreferenced.
+ */
+void av_packet_unref(AVPacket *pkt);
+
+/**
+ * Move every field in src to dst and reset src.
+ *
+ * @see av_packet_unref
+ *
+ * @param src Source packet, will be reset
+ * @param dst Destination packet
+ */
+void av_packet_move_ref(AVPacket *dst, AVPacket *src);
+
+/**
+ * Copy only "properties" fields from src to dst.
+ *
+ * Properties for the purpose of this function are all the fields
+ * beside those related to the packet data (buf, data, size)
+ *
+ * @param dst Destination packet
+ * @param src Source packet
+ *
+ * @return 0 on success AVERROR on failure.
+ *
+ */
+int av_packet_copy_props(AVPacket *dst, const AVPacket *src);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavc_decoding
+ * @{
+ */
+
+/**
+ * Find a registered decoder with a matching codec ID.
+ *
+ * @param id AVCodecID of the requested decoder
+ * @return A decoder if one was found, NULL otherwise.
+ */
+AVCodec *avcodec_find_decoder(enum AVCodecID id);
+
+/**
+ * Find a registered decoder with the specified name.
+ *
+ * @param name name of the requested decoder
+ * @return A decoder if one was found, NULL otherwise.
+ */
+AVCodec *avcodec_find_decoder_by_name(const char *name);
+
+#if FF_API_GET_BUFFER
+attribute_deprecated int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic);
+attribute_deprecated void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic);
+attribute_deprecated int avcodec_default_reget_buffer(AVCodecContext *s, AVFrame *pic);
+#endif
+
+/**
+ * The default callback for AVCodecContext.get_buffer2(). It is made public so
+ * it can be called by custom get_buffer2() implementations for decoders without
+ * CODEC_CAP_DR1 set.
+ */
+int avcodec_default_get_buffer2(AVCodecContext *s, AVFrame *frame, int flags);
+
+#if FF_API_EMU_EDGE
+/**
+ * Return the amount of padding in pixels which the get_buffer callback must
+ * provide around the edge of the image for codecs which do not have the
+ * CODEC_FLAG_EMU_EDGE flag.
+ *
+ * @return Required padding in pixels.
+ *
+ * @deprecated CODEC_FLAG_EMU_EDGE is deprecated, so this function is no longer
+ * needed
+ */
+attribute_deprecated
+unsigned avcodec_get_edge_width(void);
+#endif
+
+/**
+ * Modify width and height values so that they will result in a memory
+ * buffer that is acceptable for the codec if you do not use any horizontal
+ * padding.
+ *
+ * May only be used if a codec with CODEC_CAP_DR1 has been opened.
+ */
+void avcodec_align_dimensions(AVCodecContext *s, int *width, int *height);
+
+/**
+ * Modify width and height values so that they will result in a memory
+ * buffer that is acceptable for the codec if you also ensure that all
+ * line sizes are a multiple of the respective linesize_align[i].
+ *
+ * May only be used if a codec with CODEC_CAP_DR1 has been opened.
+ */
+void avcodec_align_dimensions2(AVCodecContext *s, int *width, int *height,
+                               int linesize_align[AV_NUM_DATA_POINTERS]);
+
+/**
+ * Decode the audio frame of size avpkt->size from avpkt->data into frame.
+ *
+ * Some decoders may support multiple frames in a single AVPacket. Such
+ * decoders would then just decode the first frame and the return value would be
+ * less than the packet size. In this case, avcodec_decode_audio4 has to be
+ * called again with an AVPacket containing the remaining data in order to
+ * decode the second frame, etc...  Even if no frames are returned, the packet
+ * needs to be fed to the decoder with remaining data until it is completely
+ * consumed or an error occurs.
+ *
+ * Some decoders (those marked with CODEC_CAP_DELAY) have a delay between input
+ * and output. This means that for some packets they will not immediately
+ * produce decoded output and need to be flushed at the end of decoding to get
+ * all the decoded data. Flushing is done by calling this function with packets
+ * with avpkt->data set to NULL and avpkt->size set to 0 until it stops
+ * returning samples. It is safe to flush even those decoders that are not
+ * marked with CODEC_CAP_DELAY, then no samples will be returned.
+ *
+ * @warning The input buffer, avpkt->data must be FF_INPUT_BUFFER_PADDING_SIZE
+ *          larger than the actual read bytes because some optimized bitstream
+ *          readers read 32 or 64 bits at once and could read over the end.
+ *
+ * @param      avctx the codec context
+ * @param[out] frame The AVFrame in which to store decoded audio samples.
+ *                   The decoder will allocate a buffer for the decoded frame by
+ *                   calling the AVCodecContext.get_buffer2() callback.
+ *                   When AVCodecContext.refcounted_frames is set to 1, the frame is
+ *                   reference counted and the returned reference belongs to the
+ *                   caller. The caller must release the frame using av_frame_unref()
+ *                   when the frame is no longer needed. The caller may safely write
+ *                   to the frame if av_frame_is_writable() returns 1.
+ *                   When AVCodecContext.refcounted_frames is set to 0, the returned
+ *                   reference belongs to the decoder and is valid only until the
+ *                   next call to this function or until closing or flushing the
+ *                   decoder. The caller may not write to it.
+ * @param[out] got_frame_ptr Zero if no frame could be decoded, otherwise it is
+ *                           non-zero. Note that this field being set to zero
+ *                           does not mean that an error has occurred. For
+ *                           decoders with CODEC_CAP_DELAY set, no given decode
+ *                           call is guaranteed to produce a frame.
+ * @param[in]  avpkt The input AVPacket containing the input buffer.
+ *                   At least avpkt->data and avpkt->size should be set. Some
+ *                   decoders might also require additional fields to be set.
+ * @return A negative error code is returned if an error occurred during
+ *         decoding, otherwise the number of bytes consumed from the input
+ *         AVPacket is returned.
+ */
+int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame,
+                          int *got_frame_ptr, AVPacket *avpkt);
+
+/**
+ * Decode the video frame of size avpkt->size from avpkt->data into picture.
+ * Some decoders may support multiple frames in a single AVPacket, such
+ * decoders would then just decode the first frame.
+ *
+ * @warning The input buffer must be FF_INPUT_BUFFER_PADDING_SIZE larger than
+ * the actual read bytes because some optimized bitstream readers read 32 or 64
+ * bits at once and could read over the end.
+ *
+ * @warning The end of the input buffer buf should be set to 0 to ensure that
+ * no overreading happens for damaged MPEG streams.
+ *
+ * @note Codecs which have the CODEC_CAP_DELAY capability set have a delay
+ * between input and output, these need to be fed with avpkt->data=NULL,
+ * avpkt->size=0 at the end to return the remaining frames.
+ *
+ * @param avctx the codec context
+ * @param[out] picture The AVFrame in which the decoded video frame will be stored.
+ *             Use av_frame_alloc() to get an AVFrame. The codec will
+ *             allocate memory for the actual bitmap by calling the
+ *             AVCodecContext.get_buffer2() callback.
+ *             When AVCodecContext.refcounted_frames is set to 1, the frame is
+ *             reference counted and the returned reference belongs to the
+ *             caller. The caller must release the frame using av_frame_unref()
+ *             when the frame is no longer needed. The caller may safely write
+ *             to the frame if av_frame_is_writable() returns 1.
+ *             When AVCodecContext.refcounted_frames is set to 0, the returned
+ *             reference belongs to the decoder and is valid only until the
+ *             next call to this function or until closing or flushing the
+ *             decoder. The caller may not write to it.
+ *
+ * @param[in] avpkt The input AVpacket containing the input buffer.
+ *            You can create such packet with av_init_packet() and by then setting
+ *            data and size, some decoders might in addition need other fields like
+ *            flags&AV_PKT_FLAG_KEY. All decoders are designed to use the least
+ *            fields possible.
+ * @param[in,out] got_picture_ptr Zero if no frame could be decompressed, otherwise, it is nonzero.
+ * @return On error a negative value is returned, otherwise the number of bytes
+ * used or zero if no frame could be decompressed.
+ */
+int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
+                         int *got_picture_ptr,
+                         AVPacket *avpkt);
+
+/**
+ * Decode a subtitle message.
+ * Return a negative value on error, otherwise return the number of bytes used.
+ * If no subtitle could be decompressed, got_sub_ptr is zero.
+ * Otherwise, the subtitle is stored in *sub.
+ * Note that CODEC_CAP_DR1 is not available for subtitle codecs. This is for
+ * simplicity, because the performance difference is expect to be negligible
+ * and reusing a get_buffer written for video codecs would probably perform badly
+ * due to a potentially very different allocation pattern.
+ *
+ * @param avctx the codec context
+ * @param[out] sub The AVSubtitle in which the decoded subtitle will be stored, must be
+                   freed with avsubtitle_free if *got_sub_ptr is set.
+ * @param[in,out] got_sub_ptr Zero if no subtitle could be decompressed, otherwise, it is nonzero.
+ * @param[in] avpkt The input AVPacket containing the input buffer.
+ */
+int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
+                            int *got_sub_ptr,
+                            AVPacket *avpkt);
+
+/**
+ * @defgroup lavc_parsing Frame parsing
+ * @{
+ */
+
+enum AVPictureStructure {
+    AV_PICTURE_STRUCTURE_UNKNOWN,      //< unknown
+    AV_PICTURE_STRUCTURE_TOP_FIELD,    //< coded as top field
+    AV_PICTURE_STRUCTURE_BOTTOM_FIELD, //< coded as bottom field
+    AV_PICTURE_STRUCTURE_FRAME,        //< coded as frame
+};
+
+typedef struct AVCodecParserContext {
+    void *priv_data;
+    struct AVCodecParser *parser;
+    int64_t frame_offset; /* offset of the current frame */
+    int64_t cur_offset; /* current offset
+                           (incremented by each av_parser_parse()) */
+    int64_t next_frame_offset; /* offset of the next frame */
+    /* video info */
+    int pict_type; /* XXX: Put it back in AVCodecContext. */
+    /**
+     * This field is used for proper frame duration computation in lavf.
+     * It signals, how much longer the frame duration of the current frame
+     * is compared to normal frame duration.
+     *
+     * frame_duration = (1 + repeat_pict) * time_base
+     *
+     * It is used by codecs like H.264 to display telecined material.
+     */
+    int repeat_pict; /* XXX: Put it back in AVCodecContext. */
+    int64_t pts;     /* pts of the current frame */
+    int64_t dts;     /* dts of the current frame */
+
+    /* private data */
+    int64_t last_pts;
+    int64_t last_dts;
+    int fetch_timestamp;
+
+#define AV_PARSER_PTS_NB 4
+    int cur_frame_start_index;
+    int64_t cur_frame_offset[AV_PARSER_PTS_NB];
+    int64_t cur_frame_pts[AV_PARSER_PTS_NB];
+    int64_t cur_frame_dts[AV_PARSER_PTS_NB];
+
+    int flags;
+#define PARSER_FLAG_COMPLETE_FRAMES           0x0001
+#define PARSER_FLAG_ONCE                      0x0002
+/// Set if the parser has a valid file offset
+#define PARSER_FLAG_FETCHED_OFFSET            0x0004
+
+    int64_t offset;      ///< byte offset from starting packet start
+    int64_t cur_frame_end[AV_PARSER_PTS_NB];
+
+    /**
+     * Set by parser to 1 for key frames and 0 for non-key frames.
+     * It is initialized to -1, so if the parser doesn't set this flag,
+     * old-style fallback using AV_PICTURE_TYPE_I picture type as key frames
+     * will be used.
+     */
+    int key_frame;
+
+    /**
+     * Time difference in stream time base units from the pts of this
+     * packet to the point at which the output from the decoder has converged
+     * independent from the availability of previous frames. That is, the
+     * frames are virtually identical no matter if decoding started from
+     * the very first frame or from this keyframe.
+     * Is AV_NOPTS_VALUE if unknown.
+     * This field is not the display duration of the current frame.
+     * This field has no meaning if the packet does not have AV_PKT_FLAG_KEY
+     * set.
+     *
+     * The purpose of this field is to allow seeking in streams that have no
+     * keyframes in the conventional sense. It corresponds to the
+     * recovery point SEI in H.264 and match_time_delta in NUT. It is also
+     * essential for some types of subtitle streams to ensure that all
+     * subtitles are correctly displayed after seeking.
+     */
+    int64_t convergence_duration;
+
+    // Timestamp generation support:
+    /**
+     * Synchronization point for start of timestamp generation.
+     *
+     * Set to >0 for sync point, 0 for no sync point and <0 for undefined
+     * (default).
+     *
+     * For example, this corresponds to presence of H.264 buffering period
+     * SEI message.
+     */
+    int dts_sync_point;
+
+    /**
+     * Offset of the current timestamp against last timestamp sync point in
+     * units of AVCodecContext.time_base.
+     *
+     * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
+     * contain a valid timestamp offset.
+     *
+     * Note that the timestamp of sync point has usually a nonzero
+     * dts_ref_dts_delta, which refers to the previous sync point. Offset of
+     * the next frame after timestamp sync point will be usually 1.
+     *
+     * For example, this corresponds to H.264 cpb_removal_delay.
+     */
+    int dts_ref_dts_delta;
+
+    /**
+     * Presentation delay of current frame in units of AVCodecContext.time_base.
+     *
+     * Set to INT_MIN when dts_sync_point unused. Otherwise, it must
+     * contain valid non-negative timestamp delta (presentation time of a frame
+     * must not lie in the past).
+     *
+     * This delay represents the difference between decoding and presentation
+     * time of the frame.
+     *
+     * For example, this corresponds to H.264 dpb_output_delay.
+     */
+    int pts_dts_delta;
+
+    /**
+     * Position of the packet in file.
+     *
+     * Analogous to cur_frame_pts/dts
+     */
+    int64_t cur_frame_pos[AV_PARSER_PTS_NB];
+
+    /**
+     * Byte position of currently parsed frame in stream.
+     */
+    int64_t pos;
+
+    /**
+     * Previous frame byte position.
+     */
+    int64_t last_pos;
+
+    /**
+     * Duration of the current frame.
+     * For audio, this is in units of 1 / AVCodecContext.sample_rate.
+     * For all other types, this is in units of AVCodecContext.time_base.
+     */
+    int duration;
+
+    enum AVFieldOrder field_order;
+
+    /**
+     * Indicate whether a picture is coded as a frame, top field or bottom field.
+     *
+     * For example, H.264 field_pic_flag equal to 0 corresponds to
+     * AV_PICTURE_STRUCTURE_FRAME. An H.264 picture with field_pic_flag
+     * equal to 1 and bottom_field_flag equal to 0 corresponds to
+     * AV_PICTURE_STRUCTURE_TOP_FIELD.
+     */
+    enum AVPictureStructure picture_structure;
+
+    /**
+     * Picture number incremented in presentation or output order.
+     * This field may be reinitialized at the first picture of a new sequence.
+     *
+     * For example, this corresponds to H.264 PicOrderCnt.
+     */
+    int output_picture_number;
+} AVCodecParserContext;
+
+typedef struct AVCodecParser {
+    int codec_ids[5]; /* several codec IDs are permitted */
+    int priv_data_size;
+    int (*parser_init)(AVCodecParserContext *s);
+    int (*parser_parse)(AVCodecParserContext *s,
+                        AVCodecContext *avctx,
+                        const uint8_t **poutbuf, int *poutbuf_size,
+                        const uint8_t *buf, int buf_size);
+    void (*parser_close)(AVCodecParserContext *s);
+    int (*split)(AVCodecContext *avctx, const uint8_t *buf, int buf_size);
+    struct AVCodecParser *next;
+} AVCodecParser;
+
+AVCodecParser *av_parser_next(AVCodecParser *c);
+
+void av_register_codec_parser(AVCodecParser *parser);
+AVCodecParserContext *av_parser_init(int codec_id);
+
+/**
+ * Parse a packet.
+ *
+ * @param s             parser context.
+ * @param avctx         codec context.
+ * @param poutbuf       set to pointer to parsed buffer or NULL if not yet finished.
+ * @param poutbuf_size  set to size of parsed buffer or zero if not yet finished.
+ * @param buf           input buffer.
+ * @param buf_size      input length, to signal EOF, this should be 0 (so that the last frame can be output).
+ * @param pts           input presentation timestamp.
+ * @param dts           input decoding timestamp.
+ * @param pos           input byte position in stream.
+ * @return the number of bytes of the input bitstream used.
+ *
+ * Example:
+ * @code
+ *   while(in_len){
+ *       len = av_parser_parse2(myparser, AVCodecContext, &data, &size,
+ *                                        in_data, in_len,
+ *                                        pts, dts, pos);
+ *       in_data += len;
+ *       in_len  -= len;
+ *
+ *       if(size)
+ *          decode_frame(data, size);
+ *   }
+ * @endcode
+ */
+int av_parser_parse2(AVCodecParserContext *s,
+                     AVCodecContext *avctx,
+                     uint8_t **poutbuf, int *poutbuf_size,
+                     const uint8_t *buf, int buf_size,
+                     int64_t pts, int64_t dts,
+                     int64_t pos);
+
+/**
+ * @return 0 if the output buffer is a subset of the input, 1 if it is allocated and must be freed
+ * @deprecated use AVBitstreamFilter
+ */
+int av_parser_change(AVCodecParserContext *s,
+                     AVCodecContext *avctx,
+                     uint8_t **poutbuf, int *poutbuf_size,
+                     const uint8_t *buf, int buf_size, int keyframe);
+void av_parser_close(AVCodecParserContext *s);
+
+/**
+ * @}
+ * @}
+ */
+
+/**
+ * @addtogroup lavc_encoding
+ * @{
+ */
+
+/**
+ * Find a registered encoder with a matching codec ID.
+ *
+ * @param id AVCodecID of the requested encoder
+ * @return An encoder if one was found, NULL otherwise.
+ */
+AVCodec *avcodec_find_encoder(enum AVCodecID id);
+
+/**
+ * Find a registered encoder with the specified name.
+ *
+ * @param name name of the requested encoder
+ * @return An encoder if one was found, NULL otherwise.
+ */
+AVCodec *avcodec_find_encoder_by_name(const char *name);
+
+/**
+ * Encode a frame of audio.
+ *
+ * Takes input samples from frame and writes the next output packet, if
+ * available, to avpkt. The output packet does not necessarily contain data for
+ * the most recent frame, as encoders can delay, split, and combine input frames
+ * internally as needed.
+ *
+ * @param avctx     codec context
+ * @param avpkt     output AVPacket.
+ *                  The user can supply an output buffer by setting
+ *                  avpkt->data and avpkt->size prior to calling the
+ *                  function, but if the size of the user-provided data is not
+ *                  large enough, encoding will fail. All other AVPacket fields
+ *                  will be reset by the encoder using av_init_packet(). If
+ *                  avpkt->data is NULL, the encoder will allocate it.
+ *                  The encoder will set avpkt->size to the size of the
+ *                  output packet.
+ *
+ *                  If this function fails or produces no output, avpkt will be
+ *                  freed using av_free_packet() (i.e. avpkt->destruct will be
+ *                  called to free the user supplied buffer).
+ * @param[in] frame AVFrame containing the raw audio data to be encoded.
+ *                  May be NULL when flushing an encoder that has the
+ *                  CODEC_CAP_DELAY capability set.
+ *                  If CODEC_CAP_VARIABLE_FRAME_SIZE is set, then each frame
+ *                  can have any number of samples.
+ *                  If it is not set, frame->nb_samples must be equal to
+ *                  avctx->frame_size for all frames except the last.
+ *                  The final frame may be smaller than avctx->frame_size.
+ * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the
+ *                            output packet is non-empty, and to 0 if it is
+ *                            empty. If the function returns an error, the
+ *                            packet can be assumed to be invalid, and the
+ *                            value of got_packet_ptr is undefined and should
+ *                            not be used.
+ * @return          0 on success, negative error code on failure
+ */
+int avcodec_encode_audio2(AVCodecContext *avctx, AVPacket *avpkt,
+                          const AVFrame *frame, int *got_packet_ptr);
+
+/**
+ * Encode a frame of video.
+ *
+ * Takes input raw video data from frame and writes the next output packet, if
+ * available, to avpkt. The output packet does not necessarily contain data for
+ * the most recent frame, as encoders can delay and reorder input frames
+ * internally as needed.
+ *
+ * @param avctx     codec context
+ * @param avpkt     output AVPacket.
+ *                  The user can supply an output buffer by setting
+ *                  avpkt->data and avpkt->size prior to calling the
+ *                  function, but if the size of the user-provided data is not
+ *                  large enough, encoding will fail. All other AVPacket fields
+ *                  will be reset by the encoder using av_init_packet(). If
+ *                  avpkt->data is NULL, the encoder will allocate it.
+ *                  The encoder will set avpkt->size to the size of the
+ *                  output packet. The returned data (if any) belongs to the
+ *                  caller, he is responsible for freeing it.
+ *
+ *                  If this function fails or produces no output, avpkt will be
+ *                  freed using av_free_packet() (i.e. avpkt->destruct will be
+ *                  called to free the user supplied buffer).
+ * @param[in] frame AVFrame containing the raw video data to be encoded.
+ *                  May be NULL when flushing an encoder that has the
+ *                  CODEC_CAP_DELAY capability set.
+ * @param[out] got_packet_ptr This field is set to 1 by libavcodec if the
+ *                            output packet is non-empty, and to 0 if it is
+ *                            empty. If the function returns an error, the
+ *                            packet can be assumed to be invalid, and the
+ *                            value of got_packet_ptr is undefined and should
+ *                            not be used.
+ * @return          0 on success, negative error code on failure
+ */
+int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
+                          const AVFrame *frame, int *got_packet_ptr);
+
+int avcodec_encode_subtitle(AVCodecContext *avctx, uint8_t *buf, int buf_size,
+                            const AVSubtitle *sub);
+
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavc_picture
+ * @{
+ */
+
+/**
+ * Allocate memory for a picture.  Call avpicture_free() to free it.
+ *
+ * @see avpicture_fill()
+ *
+ * @param picture the picture to be filled in
+ * @param pix_fmt the format of the picture
+ * @param width the width of the picture
+ * @param height the height of the picture
+ * @return zero if successful, a negative value if not
+ */
+int avpicture_alloc(AVPicture *picture, enum AVPixelFormat pix_fmt, int width, int height);
+
+/**
+ * Free a picture previously allocated by avpicture_alloc().
+ * The data buffer used by the AVPicture is freed, but the AVPicture structure
+ * itself is not.
+ *
+ * @param picture the AVPicture to be freed
+ */
+void avpicture_free(AVPicture *picture);
+
+/**
+ * Fill in the AVPicture fields.
+ * The fields of the given AVPicture are filled in by using the 'ptr' address
+ * which points to the image data buffer. Depending on the specified picture
+ * format, one or multiple image data pointers and line sizes will be set.
+ * If a planar format is specified, several pointers will be set pointing to
+ * the different picture planes and the line sizes of the different planes
+ * will be stored in the lines_sizes array.
+ * Call with ptr == NULL to get the required size for the ptr buffer.
+ *
+ * To allocate the buffer and fill in the AVPicture fields in one call,
+ * use avpicture_alloc().
+ *
+ * @param picture AVPicture whose fields are to be filled in
+ * @param ptr Buffer which will contain or contains the actual image data
+ * @param pix_fmt The format in which the picture data is stored.
+ * @param width the width of the image in pixels
+ * @param height the height of the image in pixels
+ * @return size of the image data in bytes
+ */
+int avpicture_fill(AVPicture *picture, uint8_t *ptr,
+                   enum AVPixelFormat pix_fmt, int width, int height);
+
+/**
+ * Copy pixel data from an AVPicture into a buffer.
+ * The data is stored compactly, without any gaps for alignment or padding
+ * which may be applied by avpicture_fill().
+ *
+ * @see avpicture_get_size()
+ *
+ * @param[in] src AVPicture containing image data
+ * @param[in] pix_fmt The format in which the picture data is stored.
+ * @param[in] width the width of the image in pixels.
+ * @param[in] height the height of the image in pixels.
+ * @param[out] dest A buffer into which picture data will be copied.
+ * @param[in] dest_size The size of 'dest'.
+ * @return The number of bytes written to dest, or a negative value (error code) on error.
+ */
+int avpicture_layout(const AVPicture* src, enum AVPixelFormat pix_fmt,
+                     int width, int height,
+                     unsigned char *dest, int dest_size);
+
+/**
+ * Calculate the size in bytes that a picture of the given width and height
+ * would occupy if stored in the given picture format.
+ * Note that this returns the size of a compact representation as generated
+ * by avpicture_layout(), which can be smaller than the size required for e.g.
+ * avpicture_fill().
+ *
+ * @param pix_fmt the given picture format
+ * @param width the width of the image
+ * @param height the height of the image
+ * @return Image data size in bytes or -1 on error (e.g. too large dimensions).
+ */
+int avpicture_get_size(enum AVPixelFormat pix_fmt, int width, int height);
+
+#if FF_API_DEINTERLACE
+/**
+ *  deinterlace - if not supported return -1
+ *
+ * @deprecated - use yadif (in libavfilter) instead
+ */
+attribute_deprecated
+int avpicture_deinterlace(AVPicture *dst, const AVPicture *src,
+                          enum AVPixelFormat pix_fmt, int width, int height);
+#endif
+/**
+ * Copy image src to dst. Wraps av_picture_data_copy() above.
+ */
+void av_picture_copy(AVPicture *dst, const AVPicture *src,
+                     enum AVPixelFormat pix_fmt, int width, int height);
+
+/**
+ * Crop image top and left side.
+ */
+int av_picture_crop(AVPicture *dst, const AVPicture *src,
+                    enum AVPixelFormat pix_fmt, int top_band, int left_band);
+
+/**
+ * Pad image.
+ */
+int av_picture_pad(AVPicture *dst, const AVPicture *src, int height, int width, enum AVPixelFormat pix_fmt,
+            int padtop, int padbottom, int padleft, int padright, int *color);
+
+/**
+ * @}
+ */
+
+/**
+ * @defgroup lavc_misc Utility functions
+ * @ingroup libavc
+ *
+ * Miscellaneous utility functions related to both encoding and decoding
+ * (or neither).
+ * @{
+ */
+
+/**
+ * @defgroup lavc_misc_pixfmt Pixel formats
+ *
+ * Functions for working with pixel formats.
+ * @{
+ */
+
+/**
+ * @deprecated Use av_pix_fmt_get_chroma_sub_sample
+ */
+
+void attribute_deprecated avcodec_get_chroma_sub_sample(enum AVPixelFormat pix_fmt, int *h_shift, int *v_shift);
+
+/**
+ * Return a value representing the fourCC code associated to the
+ * pixel format pix_fmt, or 0 if no associated fourCC code can be
+ * found.
+ */
+unsigned int avcodec_pix_fmt_to_codec_tag(enum AVPixelFormat pix_fmt);
+
+#define FF_LOSS_RESOLUTION  0x0001 /**< loss due to resolution change */
+#define FF_LOSS_DEPTH       0x0002 /**< loss due to color depth change */
+#define FF_LOSS_COLORSPACE  0x0004 /**< loss due to color space conversion */
+#define FF_LOSS_ALPHA       0x0008 /**< loss of alpha bits */
+#define FF_LOSS_COLORQUANT  0x0010 /**< loss due to color quantization */
+#define FF_LOSS_CHROMA      0x0020 /**< loss of chroma (e.g. RGB to gray conversion) */
+
+/**
+ * Compute what kind of losses will occur when converting from one specific
+ * pixel format to another.
+ * When converting from one pixel format to another, information loss may occur.
+ * For example, when converting from RGB24 to GRAY, the color information will
+ * be lost. Similarly, other losses occur when converting from some formats to
+ * other formats. These losses can involve loss of chroma, but also loss of
+ * resolution, loss of color depth, loss due to the color space conversion, loss
+ * of the alpha bits or loss due to color quantization.
+ * avcodec_get_fix_fmt_loss() informs you about the various types of losses
+ * which will occur when converting from one pixel format to another.
+ *
+ * @param[in] dst_pix_fmt destination pixel format
+ * @param[in] src_pix_fmt source pixel format
+ * @param[in] has_alpha Whether the source pixel format alpha channel is used.
+ * @return Combination of flags informing you what kind of losses will occur.
+ */
+int avcodec_get_pix_fmt_loss(enum AVPixelFormat dst_pix_fmt, enum AVPixelFormat src_pix_fmt,
+                             int has_alpha);
+
+/**
+ * Find the best pixel format to convert to given a certain source pixel
+ * format.  When converting from one pixel format to another, information loss
+ * may occur.  For example, when converting from RGB24 to GRAY, the color
+ * information will be lost. Similarly, other losses occur when converting from
+ * some formats to other formats. avcodec_find_best_pix_fmt2() searches which of
+ * the given pixel formats should be used to suffer the least amount of loss.
+ * The pixel formats from which it chooses one, are determined by the
+ * pix_fmt_list parameter.
+ *
+ *
+ * @param[in] pix_fmt_list AV_PIX_FMT_NONE terminated array of pixel formats to choose from
+ * @param[in] src_pix_fmt source pixel format
+ * @param[in] has_alpha Whether the source pixel format alpha channel is used.
+ * @param[out] loss_ptr Combination of flags informing you what kind of losses will occur.
+ * @return The best pixel format to convert to or -1 if none was found.
+ */
+enum AVPixelFormat avcodec_find_best_pix_fmt2(enum AVPixelFormat *pix_fmt_list,
+                                              enum AVPixelFormat src_pix_fmt,
+                                              int has_alpha, int *loss_ptr);
+
+enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *s, const enum AVPixelFormat * fmt);
+
+/**
+ * @}
+ */
+
+#if FF_API_SET_DIMENSIONS
+/**
+ * @deprecated this function is not supposed to be used from outside of lavc
+ */
+attribute_deprecated
+void avcodec_set_dimensions(AVCodecContext *s, int width, int height);
+#endif
+
+/**
+ * Put a string representing the codec tag codec_tag in buf.
+ *
+ * @param buf       buffer to place codec tag in
+ * @param buf_size size in bytes of buf
+ * @param codec_tag codec tag to assign
+ * @return the length of the string that would have been generated if
+ * enough space had been available, excluding the trailing null
+ */
+size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_tag);
+
+void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
+
+/**
+ * Return a name for the specified profile, if available.
+ *
+ * @param codec the codec that is searched for the given profile
+ * @param profile the profile value for which a name is requested
+ * @return A name for the profile if found, NULL otherwise.
+ */
+const char *av_get_profile_name(const AVCodec *codec, int profile);
+
+int avcodec_default_execute(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2),void *arg, int *ret, int count, int size);
+int avcodec_default_execute2(AVCodecContext *c, int (*func)(AVCodecContext *c2, void *arg2, int, int),void *arg, int *ret, int count);
+//FIXME func typedef
+
+/**
+ * Fill audio frame data and linesize.
+ * AVFrame extended_data channel pointers are allocated if necessary for
+ * planar audio.
+ *
+ * @param frame       the AVFrame
+ *                    frame->nb_samples must be set prior to calling the
+ *                    function. This function fills in frame->data,
+ *                    frame->extended_data, frame->linesize[0].
+ * @param nb_channels channel count
+ * @param sample_fmt  sample format
+ * @param buf         buffer to use for frame data
+ * @param buf_size    size of buffer
+ * @param align       plane size sample alignment (0 = default)
+ * @return            0 on success, negative error code on failure
+ */
+int avcodec_fill_audio_frame(AVFrame *frame, int nb_channels,
+                             enum AVSampleFormat sample_fmt, const uint8_t *buf,
+                             int buf_size, int align);
+
+/**
+ * Reset the internal decoder state / flush internal buffers. Should be called
+ * e.g. when seeking or when switching to a different stream.
+ *
+ * @note when refcounted frames are not used (i.e. avctx->refcounted_frames is 0),
+ * this invalidates the frames previously returned from the decoder. When
+ * refcounted frames are used, the decoder just releases any references it might
+ * keep internally, but the caller's reference remains valid.
+ */
+void avcodec_flush_buffers(AVCodecContext *avctx);
+
+/**
+ * Return codec bits per sample.
+ *
+ * @param[in] codec_id the codec
+ * @return Number of bits per sample or zero if unknown for the given codec.
+ */
+int av_get_bits_per_sample(enum AVCodecID codec_id);
+
+/**
+ * Return codec bits per sample.
+ * Only return non-zero if the bits per sample is exactly correct, not an
+ * approximation.
+ *
+ * @param[in] codec_id the codec
+ * @return Number of bits per sample or zero if unknown for the given codec.
+ */
+int av_get_exact_bits_per_sample(enum AVCodecID codec_id);
+
+/**
+ * Return audio frame duration.
+ *
+ * @param avctx        codec context
+ * @param frame_bytes  size of the frame, or 0 if unknown
+ * @return             frame duration, in samples, if known. 0 if not able to
+ *                     determine.
+ */
+int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes);
+
+
+typedef struct AVBitStreamFilterContext {
+    void *priv_data;
+    struct AVBitStreamFilter *filter;
+    AVCodecParserContext *parser;
+    struct AVBitStreamFilterContext *next;
+} AVBitStreamFilterContext;
+
+
+typedef struct AVBitStreamFilter {
+    const char *name;
+    int priv_data_size;
+    int (*filter)(AVBitStreamFilterContext *bsfc,
+                  AVCodecContext *avctx, const char *args,
+                  uint8_t **poutbuf, int *poutbuf_size,
+                  const uint8_t *buf, int buf_size, int keyframe);
+    void (*close)(AVBitStreamFilterContext *bsfc);
+    struct AVBitStreamFilter *next;
+} AVBitStreamFilter;
+
+void av_register_bitstream_filter(AVBitStreamFilter *bsf);
+AVBitStreamFilterContext *av_bitstream_filter_init(const char *name);
+int av_bitstream_filter_filter(AVBitStreamFilterContext *bsfc,
+                               AVCodecContext *avctx, const char *args,
+                               uint8_t **poutbuf, int *poutbuf_size,
+                               const uint8_t *buf, int buf_size, int keyframe);
+void av_bitstream_filter_close(AVBitStreamFilterContext *bsf);
+
+AVBitStreamFilter *av_bitstream_filter_next(AVBitStreamFilter *f);
+
+/* memory */
+
+/**
+ * Allocate a buffer with padding, reusing the given one if large enough.
+ *
+ * Same behaviour av_fast_malloc but the buffer has additional
+ * FF_INPUT_PADDING_SIZE at the end which will always memset to 0.
+ *
+ */
+void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size);
+
+/**
+ * Encode extradata length to a buffer. Used by xiph codecs.
+ *
+ * @param s buffer to write to; must be at least (v/255+1) bytes long
+ * @param v size of extradata in bytes
+ * @return number of bytes written to the buffer.
+ */
+unsigned int av_xiphlacing(unsigned char *s, unsigned int v);
+
+#if FF_API_MISSING_SAMPLE
+/**
+ * Log a generic warning message about a missing feature. This function is
+ * intended to be used internally by Libav (libavcodec, libavformat, etc.)
+ * only, and would normally not be used by applications.
+ * @param[in] avc a pointer to an arbitrary struct of which the first field is
+ * a pointer to an AVClass struct
+ * @param[in] feature string containing the name of the missing feature
+ * @param[in] want_sample indicates if samples are wanted which exhibit this feature.
+ * If want_sample is non-zero, additional verbage will be added to the log
+ * message which tells the user how to report samples to the development
+ * mailing list.
+ * @deprecated Use avpriv_report_missing_feature() instead.
+ */
+attribute_deprecated
+void av_log_missing_feature(void *avc, const char *feature, int want_sample);
+
+/**
+ * Log a generic warning message asking for a sample. This function is
+ * intended to be used internally by Libav (libavcodec, libavformat, etc.)
+ * only, and would normally not be used by applications.
+ * @param[in] avc a pointer to an arbitrary struct of which the first field is
+ * a pointer to an AVClass struct
+ * @param[in] msg string containing an optional message, or NULL if no message
+ * @deprecated Use avpriv_request_sample() instead.
+ */
+attribute_deprecated
+void av_log_ask_for_sample(void *avc, const char *msg, ...) av_printf_format(2, 3);
+#endif /* FF_API_MISSING_SAMPLE */
+
+/**
+ * Register the hardware accelerator hwaccel.
+ */
+void av_register_hwaccel(AVHWAccel *hwaccel);
+
+/**
+ * If hwaccel is NULL, returns the first registered hardware accelerator,
+ * if hwaccel is non-NULL, returns the next registered hardware accelerator
+ * after hwaccel, or NULL if hwaccel is the last one.
+ */
+AVHWAccel *av_hwaccel_next(AVHWAccel *hwaccel);
+
+
+/**
+ * Lock operation used by lockmgr
+ */
+enum AVLockOp {
+  AV_LOCK_CREATE,  ///< Create a mutex
+  AV_LOCK_OBTAIN,  ///< Lock the mutex
+  AV_LOCK_RELEASE, ///< Unlock the mutex
+  AV_LOCK_DESTROY, ///< Free mutex resources
+};
+
+/**
+ * Register a user provided lock manager supporting the operations
+ * specified by AVLockOp. mutex points to a (void *) where the
+ * lockmgr should store/get a pointer to a user allocated mutex. It's
+ * NULL upon AV_LOCK_CREATE and != NULL for all other ops.
+ *
+ * @param cb User defined callback. Note: Libav may invoke calls to this
+ *           callback during the call to av_lockmgr_register().
+ *           Thus, the application must be prepared to handle that.
+ *           If cb is set to NULL the lockmgr will be unregistered.
+ *           Also note that during unregistration the previously registered
+ *           lockmgr callback may also be invoked.
+ */
+int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
+
+/**
+ * Get the type of the given codec.
+ */
+enum AVMediaType avcodec_get_type(enum AVCodecID codec_id);
+
+/**
+ * @return a positive value if s is open (i.e. avcodec_open2() was called on it
+ * with no corresponding avcodec_close()), 0 otherwise.
+ */
+int avcodec_is_open(AVCodecContext *s);
+
+/**
+ * @return a non-zero number if codec is an encoder, zero otherwise
+ */
+int av_codec_is_encoder(const AVCodec *codec);
+
+/**
+ * @return a non-zero number if codec is a decoder, zero otherwise
+ */
+int av_codec_is_decoder(const AVCodec *codec);
+
+/**
+ * @return descriptor for given codec ID or NULL if no descriptor exists.
+ */
+const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id);
+
+/**
+ * Iterate over all codec descriptors known to libavcodec.
+ *
+ * @param prev previous descriptor. NULL to get the first descriptor.
+ *
+ * @return next descriptor or NULL after the last descriptor
+ */
+const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev);
+
+/**
+ * @return codec descriptor with the given name or NULL if no such descriptor
+ *         exists.
+ */
+const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name);
+
+/**
+ * @}
+ */
+
+#endif /* AVCODEC_AVCODEC_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/avfft.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/avfft.h
new file mode 100644
index 0000000..e2e727d
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/avfft.h
@@ -0,0 +1,118 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_AVFFT_H
+#define AVCODEC_AVFFT_H
+
+/**
+ * @file
+ * @ingroup lavc_fft
+ * FFT functions
+ */
+
+/**
+ * @defgroup lavc_fft FFT functions
+ * @ingroup lavc_misc
+ *
+ * @{
+ */
+
+typedef float FFTSample;
+
+typedef struct FFTComplex {
+    FFTSample re, im;
+} FFTComplex;
+
+typedef struct FFTContext FFTContext;
+
+/**
+ * Set up a complex FFT.
+ * @param nbits           log2 of the length of the input array
+ * @param inverse         if 0 perform the forward transform, if 1 perform the inverse
+ */
+FFTContext *av_fft_init(int nbits, int inverse);
+
+/**
+ * Do the permutation needed BEFORE calling ff_fft_calc().
+ */
+void av_fft_permute(FFTContext *s, FFTComplex *z);
+
+/**
+ * Do a complex FFT with the parameters defined in av_fft_init(). The
+ * input data must be permuted before. No 1.0/sqrt(n) normalization is done.
+ */
+void av_fft_calc(FFTContext *s, FFTComplex *z);
+
+void av_fft_end(FFTContext *s);
+
+FFTContext *av_mdct_init(int nbits, int inverse, double scale);
+void av_imdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
+void av_imdct_half(FFTContext *s, FFTSample *output, const FFTSample *input);
+void av_mdct_calc(FFTContext *s, FFTSample *output, const FFTSample *input);
+void av_mdct_end(FFTContext *s);
+
+/* Real Discrete Fourier Transform */
+
+enum RDFTransformType {
+    DFT_R2C,
+    IDFT_C2R,
+    IDFT_R2C,
+    DFT_C2R,
+};
+
+typedef struct RDFTContext RDFTContext;
+
+/**
+ * Set up a real FFT.
+ * @param nbits           log2 of the length of the input array
+ * @param trans           the type of transform
+ */
+RDFTContext *av_rdft_init(int nbits, enum RDFTransformType trans);
+void av_rdft_calc(RDFTContext *s, FFTSample *data);
+void av_rdft_end(RDFTContext *s);
+
+/* Discrete Cosine Transform */
+
+typedef struct DCTContext DCTContext;
+
+enum DCTTransformType {
+    DCT_II = 0,
+    DCT_III,
+    DCT_I,
+    DST_I,
+};
+
+/**
+ * Set up DCT.
+ *
+ * @param nbits           size of the input array:
+ *                        (1 << nbits)     for DCT-II, DCT-III and DST-I
+ *                        (1 << nbits) + 1 for DCT-I
+ * @param type            the type of transform
+ *
+ * @note the first element of the input of DST-I is ignored
+ */
+DCTContext *av_dct_init(int nbits, enum DCTTransformType type);
+void av_dct_calc(DCTContext *s, FFTSample *data);
+void av_dct_end (DCTContext *s);
+
+/**
+ * @}
+ */
+
+#endif /* AVCODEC_AVFFT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/dxva2.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/dxva2.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/dxva2.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/dxva2.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vaapi.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/vaapi.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vaapi.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/vaapi.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vda.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/vda.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavcodec/vda.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/vda.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/vdpau.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/vdpau.h
new file mode 100644
index 0000000..75cb1bf
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/vdpau.h
@@ -0,0 +1,189 @@
+/*
+ * The Video Decode and Presentation API for UNIX (VDPAU) is used for
+ * hardware-accelerated decoding of MPEG-1/2, H.264 and VC-1.
+ *
+ * Copyright (C) 2008 NVIDIA
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_VDPAU_H
+#define AVCODEC_VDPAU_H
+
+/**
+ * @file
+ * @ingroup lavc_codec_hwaccel_vdpau
+ * Public libavcodec VDPAU header.
+ */
+
+
+/**
+ * @defgroup lavc_codec_hwaccel_vdpau VDPAU Decoder and Renderer
+ * @ingroup lavc_codec_hwaccel
+ *
+ * VDPAU hardware acceleration has two modules
+ * - VDPAU decoding
+ * - VDPAU presentation
+ *
+ * The VDPAU decoding module parses all headers using Libav
+ * parsing mechanisms and uses VDPAU for the actual decoding.
+ *
+ * As per the current implementation, the actual decoding
+ * and rendering (API calls) are done as part of the VDPAU
+ * presentation (vo_vdpau.c) module.
+ *
+ * @{
+ */
+
+#include <vdpau/vdpau.h>
+#include <vdpau/vdpau_x11.h>
+
+#include "libavutil/attributes.h"
+
+#include "avcodec.h"
+#include "version.h"
+
+#if FF_API_BUFS_VDPAU
+union AVVDPAUPictureInfo {
+    VdpPictureInfoH264        h264;
+    VdpPictureInfoMPEG1Or2    mpeg;
+    VdpPictureInfoVC1          vc1;
+    VdpPictureInfoMPEG4Part2 mpeg4;
+};
+#endif
+
+/**
+ * This structure is used to share data between the libavcodec library and
+ * the client video application.
+ * The user shall zero-allocate the structure and make it available as
+ * AVCodecContext.hwaccel_context. Members can be set by the user once
+ * during initialization or through each AVCodecContext.get_buffer()
+ * function call. In any case, they must be valid prior to calling
+ * decoding functions.
+ *
+ * The size of this structure is not a part of the public ABI and must not
+ * be used outside of libavcodec. Use av_vdpau_alloc_context() to allocate an
+ * AVVDPAUContext.
+ */
+typedef struct AVVDPAUContext {
+    /**
+     * VDPAU decoder handle
+     *
+     * Set by user.
+     */
+    VdpDecoder decoder;
+
+    /**
+     * VDPAU decoder render callback
+     *
+     * Set by the user.
+     */
+    VdpDecoderRender *render;
+
+#if FF_API_BUFS_VDPAU
+    /**
+     * VDPAU picture information
+     *
+     * Set by libavcodec.
+     */
+    attribute_deprecated
+    union AVVDPAUPictureInfo info;
+
+    /**
+     * Allocated size of the bitstream_buffers table.
+     *
+     * Set by libavcodec.
+     */
+    attribute_deprecated
+    int bitstream_buffers_allocated;
+
+    /**
+     * Useful bitstream buffers in the bitstream buffers table.
+     *
+     * Set by libavcodec.
+     */
+    attribute_deprecated
+    int bitstream_buffers_used;
+
+   /**
+     * Table of bitstream buffers.
+     * The user is responsible for freeing this buffer using av_freep().
+     *
+     * Set by libavcodec.
+     */
+    attribute_deprecated
+    VdpBitstreamBuffer *bitstream_buffers;
+#endif
+} AVVDPAUContext;
+
+/**
+ * Allocate an AVVDPAUContext.
+ *
+ * @return Newly-allocated AVVDPAUContext or NULL on failure.
+ */
+AVVDPAUContext *av_vdpau_alloc_context(void);
+
+/**
+ * Get a decoder profile that should be used for initializing a VDPAU decoder.
+ * Should be called from the AVCodecContext.get_format() callback.
+ *
+ * @param avctx the codec context being used for decoding the stream
+ * @param profile a pointer into which the result will be written on success.
+ *                The contents of profile are undefined if this function returns
+ *                an error.
+ *
+ * @return 0 on success (non-negative), a negative AVERROR on failure.
+ */
+int av_vdpau_get_profile(AVCodecContext *avctx, VdpDecoderProfile *profile);
+
+#if FF_API_CAP_VDPAU
+/** @brief The videoSurface is used for rendering. */
+#define FF_VDPAU_STATE_USED_FOR_RENDER 1
+
+/**
+ * @brief The videoSurface is needed for reference/prediction.
+ * The codec manipulates this.
+ */
+#define FF_VDPAU_STATE_USED_FOR_REFERENCE 2
+
+/**
+ * @brief This structure is used as a callback between the Libav
+ * decoder (vd_) and presentation (vo_) module.
+ * This is used for defining a video frame containing surface,
+ * picture parameter, bitstream information etc which are passed
+ * between the Libav decoder and its clients.
+ */
+struct vdpau_render_state {
+    VdpVideoSurface surface; ///< Used as rendered surface, never changed.
+
+    int state; ///< Holds FF_VDPAU_STATE_* values.
+
+    /** picture parameter information for all supported codecs */
+    union AVVDPAUPictureInfo info;
+
+    /** Describe size/location of the compressed video data.
+        Set to 0 when freeing bitstream_buffers. */
+    int bitstream_buffers_allocated;
+    int bitstream_buffers_used;
+    /** The user is responsible for freeing this buffer using av_freep(). */
+    VdpBitstreamBuffer *bitstream_buffers;
+};
+#endif
+
+/* @}*/
+
+#endif /* AVCODEC_VDPAU_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/version.h
new file mode 100644
index 0000000..cdd5a61
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/version.h
@@ -0,0 +1,127 @@
+/*
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_VERSION_H
+#define AVCODEC_VERSION_H
+
+/**
+ * @file
+ * @ingroup libavc
+ * Libavcodec version macros.
+ */
+
+#include "libavutil/version.h"
+
+#define LIBAVCODEC_VERSION_MAJOR 55
+#define LIBAVCODEC_VERSION_MINOR 34
+#define LIBAVCODEC_VERSION_MICRO  1
+
+#define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
+                                               LIBAVCODEC_VERSION_MINOR, \
+                                               LIBAVCODEC_VERSION_MICRO)
+#define LIBAVCODEC_VERSION      AV_VERSION(LIBAVCODEC_VERSION_MAJOR,    \
+                                           LIBAVCODEC_VERSION_MINOR,    \
+                                           LIBAVCODEC_VERSION_MICRO)
+#define LIBAVCODEC_BUILD        LIBAVCODEC_VERSION_INT
+
+#define LIBAVCODEC_IDENT        "Lavc" AV_STRINGIFY(LIBAVCODEC_VERSION)
+
+/**
+ * FF_API_* defines may be placed below to indicate public API that will be
+ * dropped at a future version bump. The defines themselves are not part of
+ * the public API and may change, break or disappear at any time.
+ */
+
+#ifndef FF_API_REQUEST_CHANNELS
+#define FF_API_REQUEST_CHANNELS (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_DEINTERLACE
+#define FF_API_DEINTERLACE       (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_DESTRUCT_PACKET
+#define FF_API_DESTRUCT_PACKET   (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_GET_BUFFER
+#define FF_API_GET_BUFFER        (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_MISSING_SAMPLE
+#define FF_API_MISSING_SAMPLE    (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_LOWRES
+#define FF_API_LOWRES            (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_CAP_VDPAU
+#define FF_API_CAP_VDPAU         (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_BUFS_VDPAU
+#define FF_API_BUFS_VDPAU        (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_VOXWARE
+#define FF_API_VOXWARE           (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_SET_DIMENSIONS
+#define FF_API_SET_DIMENSIONS    (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_DEBUG_MV
+#define FF_API_DEBUG_MV          (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_AC_VLC
+#define FF_API_AC_VLC            (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_OLD_MSMPEG4
+#define FF_API_OLD_MSMPEG4       (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_ASPECT_EXTENDED
+#define FF_API_ASPECT_EXTENDED   (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_THREAD_OPAQUE
+#define FF_API_THREAD_OPAQUE     (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_CODEC_PKT
+#define FF_API_CODEC_PKT         (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_ARCH_ALPHA
+#define FF_API_ARCH_ALPHA        (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_XVMC
+#define FF_API_XVMC              (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_ERROR_RATE
+#define FF_API_ERROR_RATE        (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_QSCALE_TYPE
+#define FF_API_QSCALE_TYPE       (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_MB_TYPE
+#define FF_API_MB_TYPE           (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_MAX_BFRAMES
+#define FF_API_MAX_BFRAMES       (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_FAST_MALLOC
+#define FF_API_FAST_MALLOC       (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_NEG_LINESIZES
+#define FF_API_NEG_LINESIZES     (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+#ifndef FF_API_EMU_EDGE
+#define FF_API_EMU_EDGE          (LIBAVCODEC_VERSION_MAJOR < 56)
+#endif
+
+#endif /* AVCODEC_VERSION_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/xvmc.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/xvmc.h
new file mode 100644
index 0000000..950ed18
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavcodec/xvmc.h
@@ -0,0 +1,174 @@
+/*
+ * Copyright (C) 2003 Ivan Kalvachev
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVCODEC_XVMC_H
+#define AVCODEC_XVMC_H
+
+/**
+ * @file
+ * @ingroup lavc_codec_hwaccel_xvmc
+ * Public libavcodec XvMC header.
+ */
+
+#include <X11/extensions/XvMC.h>
+
+#include "libavutil/attributes.h"
+#include "version.h"
+#include "avcodec.h"
+
+#if FF_API_XVMC
+
+/**
+ * @defgroup lavc_codec_hwaccel_xvmc XvMC
+ * @ingroup lavc_codec_hwaccel
+ *
+ * @{
+ */
+
+#define AV_XVMC_ID                    0x1DC711C0  /**< special value to ensure that regular pixel routines haven't corrupted the struct
+                                                       the number is 1337 speak for the letters IDCT MCo (motion compensation) */
+
+attribute_deprecated struct xvmc_pix_fmt {
+    /** The field contains the special constant value AV_XVMC_ID.
+        It is used as a test that the application correctly uses the API,
+        and that there is no corruption caused by pixel routines.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    int             xvmc_id;
+
+    /** Pointer to the block array allocated by XvMCCreateBlocks().
+        The array has to be freed by XvMCDestroyBlocks().
+        Each group of 64 values represents one data block of differential
+        pixel information (in MoCo mode) or coefficients for IDCT.
+        - application - set the pointer during initialization
+        - libavcodec  - fills coefficients/pixel data into the array
+    */
+    short*          data_blocks;
+
+    /** Pointer to the macroblock description array allocated by
+        XvMCCreateMacroBlocks() and freed by XvMCDestroyMacroBlocks().
+        - application - set the pointer during initialization
+        - libavcodec  - fills description data into the array
+    */
+    XvMCMacroBlock* mv_blocks;
+
+    /** Number of macroblock descriptions that can be stored in the mv_blocks
+        array.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    int             allocated_mv_blocks;
+
+    /** Number of blocks that can be stored at once in the data_blocks array.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    int             allocated_data_blocks;
+
+    /** Indicate that the hardware would interpret data_blocks as IDCT
+        coefficients and perform IDCT on them.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    int             idct;
+
+    /** In MoCo mode it indicates that intra macroblocks are assumed to be in
+        unsigned format; same as the XVMC_INTRA_UNSIGNED flag.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    int             unsigned_intra;
+
+    /** Pointer to the surface allocated by XvMCCreateSurface().
+        It has to be freed by XvMCDestroySurface() on application exit.
+        It identifies the frame and its state on the video hardware.
+        - application - set during initialization
+        - libavcodec  - unchanged
+    */
+    XvMCSurface*    p_surface;
+
+/** Set by the decoder before calling ff_draw_horiz_band(),
+    needed by the XvMCRenderSurface function. */
+//@{
+    /** Pointer to the surface used as past reference
+        - application - unchanged
+        - libavcodec  - set
+    */
+    XvMCSurface*    p_past_surface;
+
+    /** Pointer to the surface used as future reference
+        - application - unchanged
+        - libavcodec  - set
+    */
+    XvMCSurface*    p_future_surface;
+
+    /** top/bottom field or frame
+        - application - unchanged
+        - libavcodec  - set
+    */
+    unsigned int    picture_structure;
+
+    /** XVMC_SECOND_FIELD - 1st or 2nd field in the sequence
+        - application - unchanged
+        - libavcodec  - set
+    */
+    unsigned int    flags;
+//}@
+
+    /** Number of macroblock descriptions in the mv_blocks array
+        that have already been passed to the hardware.
+        - application - zeroes it on get_buffer().
+                        A successful ff_draw_horiz_band() may increment it
+                        with filled_mb_block_num or zero both.
+        - libavcodec  - unchanged
+    */
+    int             start_mv_blocks_num;
+
+    /** Number of new macroblock descriptions in the mv_blocks array (after
+        start_mv_blocks_num) that are filled by libavcodec and have to be
+        passed to the hardware.
+        - application - zeroes it on get_buffer() or after successful
+                        ff_draw_horiz_band().
+        - libavcodec  - increment with one of each stored MB
+    */
+    int             filled_mv_blocks_num;
+
+    /** Number of the next free data block; one data block consists of
+        64 short values in the data_blocks array.
+        All blocks before this one have already been claimed by placing their
+        position into the corresponding block description structure field,
+        that are part of the mv_blocks array.
+        - application - zeroes it on get_buffer().
+                        A successful ff_draw_horiz_band() may zero it together
+                        with start_mb_blocks_num.
+        - libavcodec  - each decoded macroblock increases it by the number
+                        of coded blocks it contains.
+    */
+    int             next_free_data_block_num;
+};
+
+/**
+ * @}
+ */
+
+#endif /* FF_API_XVMC */
+
+#endif /* AVCODEC_XVMC_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavformat/avformat.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavformat/avformat.h
new file mode 100644
index 0000000..ec9c262
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavformat/avformat.h
@@ -0,0 +1,1869 @@
+/*
+ * copyright (c) 2001 Fabrice Bellard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVFORMAT_AVFORMAT_H
+#define AVFORMAT_AVFORMAT_H
+
+/**
+ * @file
+ * @ingroup libavf
+ * Main libavformat public API header
+ */
+
+/**
+ * @defgroup libavf I/O and Muxing/Demuxing Library
+ * @{
+ *
+ * Libavformat (lavf) is a library for dealing with various media container
+ * formats. Its main two purposes are demuxing - i.e. splitting a media file
+ * into component streams, and the reverse process of muxing - writing supplied
+ * data in a specified container format. It also has an @ref lavf_io
+ * "I/O module" which supports a number of protocols for accessing the data (e.g.
+ * file, tcp, http and others). Before using lavf, you need to call
+ * av_register_all() to register all compiled muxers, demuxers and protocols.
+ * Unless you are absolutely sure you won't use libavformat's network
+ * capabilities, you should also call avformat_network_init().
+ *
+ * A supported input format is described by an AVInputFormat struct, conversely
+ * an output format is described by AVOutputFormat. You can iterate over all
+ * registered input/output formats using the av_iformat_next() /
+ * av_oformat_next() functions. The protocols layer is not part of the public
+ * API, so you can only get the names of supported protocols with the
+ * avio_enum_protocols() function.
+ *
+ * Main lavf structure used for both muxing and demuxing is AVFormatContext,
+ * which exports all information about the file being read or written. As with
+ * most Libav structures, its size is not part of public ABI, so it cannot be
+ * allocated on stack or directly with av_malloc(). To create an
+ * AVFormatContext, use avformat_alloc_context() (some functions, like
+ * avformat_open_input() might do that for you).
+ *
+ * Most importantly an AVFormatContext contains:
+ * @li the @ref AVFormatContext.iformat "input" or @ref AVFormatContext.oformat
+ * "output" format. It is either autodetected or set by user for input;
+ * always set by user for output.
+ * @li an @ref AVFormatContext.streams "array" of AVStreams, which describe all
+ * elementary streams stored in the file. AVStreams are typically referred to
+ * using their index in this array.
+ * @li an @ref AVFormatContext.pb "I/O context". It is either opened by lavf or
+ * set by user for input, always set by user for output (unless you are dealing
+ * with an AVFMT_NOFILE format).
+ *
+ * @section lavf_options Passing options to (de)muxers
+ * Lavf allows to configure muxers and demuxers using the @ref avoptions
+ * mechanism. Generic (format-independent) libavformat options are provided by
+ * AVFormatContext, they can be examined from a user program by calling
+ * av_opt_next() / av_opt_find() on an allocated AVFormatContext (or its AVClass
+ * from avformat_get_class()). Private (format-specific) options are provided by
+ * AVFormatContext.priv_data if and only if AVInputFormat.priv_class /
+ * AVOutputFormat.priv_class of the corresponding format struct is non-NULL.
+ * Further options may be provided by the @ref AVFormatContext.pb "I/O context",
+ * if its AVClass is non-NULL, and the protocols layer. See the discussion on
+ * nesting in @ref avoptions documentation to learn how to access those.
+ *
+ * @defgroup lavf_decoding Demuxing
+ * @{
+ * Demuxers read a media file and split it into chunks of data (@em packets). A
+ * @ref AVPacket "packet" contains one or more encoded frames which belongs to a
+ * single elementary stream. In the lavf API this process is represented by the
+ * avformat_open_input() function for opening a file, av_read_frame() for
+ * reading a single packet and finally avformat_close_input(), which does the
+ * cleanup.
+ *
+ * @section lavf_decoding_open Opening a media file
+ * The minimum information required to open a file is its URL or filename, which
+ * is passed to avformat_open_input(), as in the following code:
+ * @code
+ * const char    *url = "in.mp3";
+ * AVFormatContext *s = NULL;
+ * int ret = avformat_open_input(&s, url, NULL, NULL);
+ * if (ret < 0)
+ *     abort();
+ * @endcode
+ * The above code attempts to allocate an AVFormatContext, open the
+ * specified file (autodetecting the format) and read the header, exporting the
+ * information stored there into s. Some formats do not have a header or do not
+ * store enough information there, so it is recommended that you call the
+ * avformat_find_stream_info() function which tries to read and decode a few
+ * frames to find missing information.
+ *
+ * In some cases you might want to preallocate an AVFormatContext yourself with
+ * avformat_alloc_context() and do some tweaking on it before passing it to
+ * avformat_open_input(). One such case is when you want to use custom functions
+ * for reading input data instead of lavf internal I/O layer.
+ * To do that, create your own AVIOContext with avio_alloc_context(), passing
+ * your reading callbacks to it. Then set the @em pb field of your
+ * AVFormatContext to newly created AVIOContext.
+ *
+ * Since the format of the opened file is in general not known until after
+ * avformat_open_input() has returned, it is not possible to set demuxer private
+ * options on a preallocated context. Instead, the options should be passed to
+ * avformat_open_input() wrapped in an AVDictionary:
+ * @code
+ * AVDictionary *options = NULL;
+ * av_dict_set(&options, "video_size", "640x480", 0);
+ * av_dict_set(&options, "pixel_format", "rgb24", 0);
+ *
+ * if (avformat_open_input(&s, url, NULL, &options) < 0)
+ *     abort();
+ * av_dict_free(&options);
+ * @endcode
+ * This code passes the private options 'video_size' and 'pixel_format' to the
+ * demuxer. They would be necessary for e.g. the rawvideo demuxer, since it
+ * cannot know how to interpret raw video data otherwise. If the format turns
+ * out to be something different than raw video, those options will not be
+ * recognized by the demuxer and therefore will not be applied. Such unrecognized
+ * options are then returned in the options dictionary (recognized options are
+ * consumed). The calling program can handle such unrecognized options as it
+ * wishes, e.g.
+ * @code
+ * AVDictionaryEntry *e;
+ * if (e = av_dict_get(options, "", NULL, AV_DICT_IGNORE_SUFFIX)) {
+ *     fprintf(stderr, "Option %s not recognized by the demuxer.\n", e->key);
+ *     abort();
+ * }
+ * @endcode
+ *
+ * After you have finished reading the file, you must close it with
+ * avformat_close_input(). It will free everything associated with the file.
+ *
+ * @section lavf_decoding_read Reading from an opened file
+ * Reading data from an opened AVFormatContext is done by repeatedly calling
+ * av_read_frame() on it. Each call, if successful, will return an AVPacket
+ * containing encoded data for one AVStream, identified by
+ * AVPacket.stream_index. This packet may be passed straight into the libavcodec
+ * decoding functions avcodec_decode_video2(), avcodec_decode_audio4() or
+ * avcodec_decode_subtitle2() if the caller wishes to decode the data.
+ *
+ * AVPacket.pts, AVPacket.dts and AVPacket.duration timing information will be
+ * set if known. They may also be unset (i.e. AV_NOPTS_VALUE for
+ * pts/dts, 0 for duration) if the stream does not provide them. The timing
+ * information will be in AVStream.time_base units, i.e. it has to be
+ * multiplied by the timebase to convert them to seconds.
+ *
+ * If AVPacket.buf is set on the returned packet, then the packet is
+ * allocated dynamically and the user may keep it indefinitely.
+ * Otherwise, if AVPacket.buf is NULL, the packet data is backed by a
+ * static storage somewhere inside the demuxer and the packet is only valid
+ * until the next av_read_frame() call or closing the file. If the caller
+ * requires a longer lifetime, av_dup_packet() will make an av_malloc()ed copy
+ * of it.
+ * In both cases, the packet must be freed with av_free_packet() when it is no
+ * longer needed.
+ *
+ * @section lavf_decoding_seek Seeking
+ * @}
+ *
+ * @defgroup lavf_encoding Muxing
+ * @{
+ * Muxers take encoded data in the form of @ref AVPacket "AVPackets" and write
+ * it into files or other output bytestreams in the specified container format.
+ *
+ * The main API functions for muxing are avformat_write_header() for writing the
+ * file header, av_write_frame() / av_interleaved_write_frame() for writing the
+ * packets and av_write_trailer() for finalizing the file.
+ *
+ * At the beginning of the muxing process, the caller must first call
+ * avformat_alloc_context() to create a muxing context. The caller then sets up
+ * the muxer by filling the various fields in this context:
+ *
+ * - The @ref AVFormatContext.oformat "oformat" field must be set to select the
+ *   muxer that will be used.
+ * - Unless the format is of the AVFMT_NOFILE type, the @ref AVFormatContext.pb
+ *   "pb" field must be set to an opened IO context, either returned from
+ *   avio_open2() or a custom one.
+ * - Unless the format is of the AVFMT_NOSTREAMS type, at least one stream must
+ *   be created with the avformat_new_stream() function. The caller should fill
+ *   the @ref AVStream.codec "stream codec context" information, such as the
+ *   codec @ref AVCodecContext.codec_type "type", @ref AVCodecContext.codec_id
+ *   "id" and other parameters (e.g. width / height, the pixel or sample format,
+ *   etc.) as known. The @ref AVCodecContext.time_base "codec timebase" should
+ *   be set to the timebase that the caller desires to use for this stream (note
+ *   that the timebase actually used by the muxer can be different, as will be
+ *   described later).
+ * - The caller may fill in additional information, such as @ref
+ *   AVFormatContext.metadata "global" or @ref AVStream.metadata "per-stream"
+ *   metadata, @ref AVFormatContext.chapters "chapters", @ref
+ *   AVFormatContext.programs "programs", etc. as described in the
+ *   AVFormatContext documentation. Whether such information will actually be
+ *   stored in the output depends on what the container format and the muxer
+ *   support.
+ *
+ * When the muxing context is fully set up, the caller must call
+ * avformat_write_header() to initialize the muxer internals and write the file
+ * header. Whether anything actually is written to the IO context at this step
+ * depends on the muxer, but this function must always be called. Any muxer
+ * private options must be passed in the options parameter to this function.
+ *
+ * The data is then sent to the muxer by repeatedly calling av_write_frame() or
+ * av_interleaved_write_frame() (consult those functions' documentation for
+ * discussion on the difference between them; only one of them may be used with
+ * a single muxing context, they should not be mixed). Do note that the timing
+ * information on the packets sent to the muxer must be in the corresponding
+ * AVStream's timebase. That timebase is set by the muxer (in the
+ * avformat_write_header() step) and may be different from the timebase the
+ * caller set on the codec context.
+ *
+ * Once all the data has been written, the caller must call av_write_trailer()
+ * to flush any buffered packets and finalize the output file, then close the IO
+ * context (if any) and finally free the muxing context with
+ * avformat_free_context().
+ * @}
+ *
+ * @defgroup lavf_io I/O Read/Write
+ * @{
+ * @}
+ *
+ * @defgroup lavf_codec Demuxers
+ * @{
+ * @defgroup lavf_codec_native Native Demuxers
+ * @{
+ * @}
+ * @defgroup lavf_codec_wrappers External library wrappers
+ * @{
+ * @}
+ * @}
+ * @defgroup lavf_protos I/O Protocols
+ * @{
+ * @}
+ * @defgroup lavf_internal Internal
+ * @{
+ * @}
+ * @}
+ *
+ */
+
+#include <time.h>
+#include <stdio.h>  /* FILE */
+#include "libavcodec/avcodec.h"
+#include "libavutil/dict.h"
+#include "libavutil/log.h"
+
+#include "avio.h"
+#include "libavformat/version.h"
+
+struct AVFormatContext;
+
+
+/**
+ * @defgroup metadata_api Public Metadata API
+ * @{
+ * @ingroup libavf
+ * The metadata API allows libavformat to export metadata tags to a client
+ * application when demuxing. Conversely it allows a client application to
+ * set metadata when muxing.
+ *
+ * Metadata is exported or set as pairs of key/value strings in the 'metadata'
+ * fields of the AVFormatContext, AVStream, AVChapter and AVProgram structs
+ * using the @ref lavu_dict "AVDictionary" API. Like all strings in Libav,
+ * metadata is assumed to be UTF-8 encoded Unicode. Note that metadata
+ * exported by demuxers isn't checked to be valid UTF-8 in most cases.
+ *
+ * Important concepts to keep in mind:
+ * -  Keys are unique; there can never be 2 tags with the same key. This is
+ *    also meant semantically, i.e., a demuxer should not knowingly produce
+ *    several keys that are literally different but semantically identical.
+ *    E.g., key=Author5, key=Author6. In this example, all authors must be
+ *    placed in the same tag.
+ * -  Metadata is flat, not hierarchical; there are no subtags. If you
+ *    want to store, e.g., the email address of the child of producer Alice
+ *    and actor Bob, that could have key=alice_and_bobs_childs_email_address.
+ * -  Several modifiers can be applied to the tag name. This is done by
+ *    appending a dash character ('-') and the modifier name in the order
+ *    they appear in the list below -- e.g. foo-eng-sort, not foo-sort-eng.
+ *    -  language -- a tag whose value is localized for a particular language
+ *       is appended with the ISO 639-2/B 3-letter language code.
+ *       For example: Author-ger=Michael, Author-eng=Mike
+ *       The original/default language is in the unqualified "Author" tag.
+ *       A demuxer should set a default if it sets any translated tag.
+ *    -  sorting  -- a modified version of a tag that should be used for
+ *       sorting will have '-sort' appended. E.g. artist="The Beatles",
+ *       artist-sort="Beatles, The".
+ *
+ * -  Demuxers attempt to export metadata in a generic format, however tags
+ *    with no generic equivalents are left as they are stored in the container.
+ *    Follows a list of generic tag names:
+ *
+ @verbatim
+ album        -- name of the set this work belongs to
+ album_artist -- main creator of the set/album, if different from artist.
+                 e.g. "Various Artists" for compilation albums.
+ artist       -- main creator of the work
+ comment      -- any additional description of the file.
+ composer     -- who composed the work, if different from artist.
+ copyright    -- name of copyright holder.
+ creation_time-- date when the file was created, preferably in ISO 8601.
+ date         -- date when the work was created, preferably in ISO 8601.
+ disc         -- number of a subset, e.g. disc in a multi-disc collection.
+ encoder      -- name/settings of the software/hardware that produced the file.
+ encoded_by   -- person/group who created the file.
+ filename     -- original name of the file.
+ genre        -- <self-evident>.
+ language     -- main language in which the work is performed, preferably
+                 in ISO 639-2 format. Multiple languages can be specified by
+                 separating them with commas.
+ performer    -- artist who performed the work, if different from artist.
+                 E.g for "Also sprach Zarathustra", artist would be "Richard
+                 Strauss" and performer "London Philharmonic Orchestra".
+ publisher    -- name of the label/publisher.
+ service_name     -- name of the service in broadcasting (channel name).
+ service_provider -- name of the service provider in broadcasting.
+ title        -- name of the work.
+ track        -- number of this work in the set, can be in form current/total.
+ variant_bitrate -- the total bitrate of the bitrate variant that the current stream is part of
+ @endverbatim
+ *
+ * Look in the examples section for an application example how to use the Metadata API.
+ *
+ * @}
+ */
+
+/* packet functions */
+
+
+/**
+ * Allocate and read the payload of a packet and initialize its
+ * fields with default values.
+ *
+ * @param s    associated IO context
+ * @param pkt packet
+ * @param size desired payload size
+ * @return >0 (read size) if OK, AVERROR_xxx otherwise
+ */
+int av_get_packet(AVIOContext *s, AVPacket *pkt, int size);
+
+
+/**
+ * Read data and append it to the current content of the AVPacket.
+ * If pkt->size is 0 this is identical to av_get_packet.
+ * Note that this uses av_grow_packet and thus involves a realloc
+ * which is inefficient. Thus this function should only be used
+ * when there is no reasonable way to know (an upper bound of)
+ * the final size.
+ *
+ * @param s    associated IO context
+ * @param pkt packet
+ * @param size amount of data to read
+ * @return >0 (read size) if OK, AVERROR_xxx otherwise, previous data
+ *         will not be lost even if an error occurs.
+ */
+int av_append_packet(AVIOContext *s, AVPacket *pkt, int size);
+
+/*************************************************/
+/* fractional numbers for exact pts handling */
+
+/**
+ * The exact value of the fractional number is: 'val + num / den'.
+ * num is assumed to be 0 <= num < den.
+ */
+typedef struct AVFrac {
+    int64_t val, num, den;
+} AVFrac;
+
+/*************************************************/
+/* input/output formats */
+
+struct AVCodecTag;
+
+/**
+ * This structure contains the data a format has to probe a file.
+ */
+typedef struct AVProbeData {
+    const char *filename;
+    unsigned char *buf; /**< Buffer must have AVPROBE_PADDING_SIZE of extra allocated bytes filled with zero. */
+    int buf_size;       /**< Size of buf except extra allocated bytes */
+} AVProbeData;
+
+#define AVPROBE_SCORE_EXTENSION  50 ///< score for file extension
+#define AVPROBE_SCORE_MAX       100 ///< maximum score
+
+#define AVPROBE_PADDING_SIZE 32             ///< extra allocated bytes at the end of the probe buffer
+
+/// Demuxer will use avio_open, no opened file should be provided by the caller.
+#define AVFMT_NOFILE        0x0001
+#define AVFMT_NEEDNUMBER    0x0002 /**< Needs '%d' in filename. */
+#define AVFMT_SHOW_IDS      0x0008 /**< Show format stream IDs numbers. */
+#define AVFMT_RAWPICTURE    0x0020 /**< Format wants AVPicture structure for
+                                      raw picture data. */
+#define AVFMT_GLOBALHEADER  0x0040 /**< Format wants global header. */
+#define AVFMT_NOTIMESTAMPS  0x0080 /**< Format does not need / have any timestamps. */
+#define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */
+#define AVFMT_TS_DISCONT    0x0200 /**< Format allows timestamp discontinuities. Note, muxers always require valid (monotone) timestamps */
+#define AVFMT_VARIABLE_FPS  0x0400 /**< Format allows variable fps. */
+#define AVFMT_NODIMENSIONS  0x0800 /**< Format does not need width/height */
+#define AVFMT_NOSTREAMS     0x1000 /**< Format does not require any streams */
+#define AVFMT_NOBINSEARCH   0x2000 /**< Format does not allow to fall back on binary search via read_timestamp */
+#define AVFMT_NOGENSEARCH   0x4000 /**< Format does not allow to fall back on generic search */
+#define AVFMT_NO_BYTE_SEEK  0x8000 /**< Format does not allow seeking by bytes */
+#define AVFMT_ALLOW_FLUSH  0x10000 /**< Format allows flushing. If not set, the muxer will not receive a NULL packet in the write_packet function. */
+#define AVFMT_TS_NONSTRICT 0x20000 /**< Format does not require strictly
+                                        increasing timestamps, but they must
+                                        still be monotonic */
+#define AVFMT_TS_NEGATIVE  0x40000 /**< Format allows muxing negative
+                                        timestamps. If not set the timestamp
+                                        will be shifted in av_write_frame and
+                                        av_interleaved_write_frame so they
+                                        start from 0. */
+
+/**
+ * @addtogroup lavf_encoding
+ * @{
+ */
+typedef struct AVOutputFormat {
+    const char *name;
+    /**
+     * Descriptive name for the format, meant to be more human-readable
+     * than name. You should use the NULL_IF_CONFIG_SMALL() macro
+     * to define it.
+     */
+    const char *long_name;
+    const char *mime_type;
+    const char *extensions; /**< comma-separated filename extensions */
+    /* output support */
+    enum AVCodecID audio_codec;    /**< default audio codec */
+    enum AVCodecID video_codec;    /**< default video codec */
+    enum AVCodecID subtitle_codec; /**< default subtitle codec */
+    /**
+     * can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_RAWPICTURE,
+     * AVFMT_GLOBALHEADER, AVFMT_NOTIMESTAMPS, AVFMT_VARIABLE_FPS,
+     * AVFMT_NODIMENSIONS, AVFMT_NOSTREAMS, AVFMT_ALLOW_FLUSH,
+     * AVFMT_TS_NONSTRICT
+     */
+    int flags;
+
+    /**
+     * List of supported codec_id-codec_tag pairs, ordered by "better
+     * choice first". The arrays are all terminated by AV_CODEC_ID_NONE.
+     */
+    const struct AVCodecTag * const *codec_tag;
+
+
+    const AVClass *priv_class; ///< AVClass for the private context
+
+    /*****************************************************************
+     * No fields below this line are part of the public API. They
+     * may not be used outside of libavformat and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
+    struct AVOutputFormat *next;
+    /**
+     * size of private data so that it can be allocated in the wrapper
+     */
+    int priv_data_size;
+
+    int (*write_header)(struct AVFormatContext *);
+    /**
+     * Write a packet. If AVFMT_ALLOW_FLUSH is set in flags,
+     * pkt can be NULL in order to flush data buffered in the muxer.
+     * When flushing, return 0 if there still is more data to flush,
+     * or 1 if everything was flushed and there is no more buffered
+     * data.
+     */
+    int (*write_packet)(struct AVFormatContext *, AVPacket *pkt);
+    int (*write_trailer)(struct AVFormatContext *);
+    /**
+     * Currently only used to set pixel format if not YUV420P.
+     */
+    int (*interleave_packet)(struct AVFormatContext *, AVPacket *out,
+                             AVPacket *in, int flush);
+    /**
+     * Test if the given codec can be stored in this container.
+     *
+     * @return 1 if the codec is supported, 0 if it is not.
+     *         A negative number if unknown.
+     */
+    int (*query_codec)(enum AVCodecID id, int std_compliance);
+} AVOutputFormat;
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavf_decoding
+ * @{
+ */
+typedef struct AVInputFormat {
+    /**
+     * A comma separated list of short names for the format. New names
+     * may be appended with a minor bump.
+     */
+    const char *name;
+
+    /**
+     * Descriptive name for the format, meant to be more human-readable
+     * than name. You should use the NULL_IF_CONFIG_SMALL() macro
+     * to define it.
+     */
+    const char *long_name;
+
+    /**
+     * Can use flags: AVFMT_NOFILE, AVFMT_NEEDNUMBER, AVFMT_SHOW_IDS,
+     * AVFMT_GENERIC_INDEX, AVFMT_TS_DISCONT, AVFMT_NOBINSEARCH,
+     * AVFMT_NOGENSEARCH, AVFMT_NO_BYTE_SEEK.
+     */
+    int flags;
+
+    /**
+     * If extensions are defined, then no probe is done. You should
+     * usually not use extension format guessing because it is not
+     * reliable enough
+     */
+    const char *extensions;
+
+    const struct AVCodecTag * const *codec_tag;
+
+    const AVClass *priv_class; ///< AVClass for the private context
+
+    /*****************************************************************
+     * No fields below this line are part of the public API. They
+     * may not be used outside of libavformat and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
+    struct AVInputFormat *next;
+
+    /**
+     * Raw demuxers store their codec ID here.
+     */
+    int raw_codec_id;
+
+    /**
+     * Size of private data so that it can be allocated in the wrapper.
+     */
+    int priv_data_size;
+
+    /**
+     * Tell if a given file has a chance of being parsed as this format.
+     * The buffer provided is guaranteed to be AVPROBE_PADDING_SIZE bytes
+     * big so you do not have to check for that unless you need more.
+     */
+    int (*read_probe)(AVProbeData *);
+
+    /**
+     * Read the format header and initialize the AVFormatContext
+     * structure. Return 0 if OK. Only used in raw format right
+     * now. 'avformat_new_stream' should be called to create new streams.
+     */
+    int (*read_header)(struct AVFormatContext *);
+
+    /**
+     * Read one packet and put it in 'pkt'. pts and flags are also
+     * set. 'avformat_new_stream' can be called only if the flag
+     * AVFMTCTX_NOHEADER is used and only in the calling thread (not in a
+     * background thread).
+     * @return 0 on success, < 0 on error.
+     *         When returning an error, pkt must not have been allocated
+     *         or must be freed before returning
+     */
+    int (*read_packet)(struct AVFormatContext *, AVPacket *pkt);
+
+    /**
+     * Close the stream. The AVFormatContext and AVStreams are not
+     * freed by this function
+     */
+    int (*read_close)(struct AVFormatContext *);
+
+    /**
+     * Seek to a given timestamp relative to the frames in
+     * stream component stream_index.
+     * @param stream_index Must not be -1.
+     * @param flags Selects which direction should be preferred if no exact
+     *              match is available.
+     * @return >= 0 on success (but not necessarily the new offset)
+     */
+    int (*read_seek)(struct AVFormatContext *,
+                     int stream_index, int64_t timestamp, int flags);
+
+    /**
+     * Get the next timestamp in stream[stream_index].time_base units.
+     * @return the timestamp or AV_NOPTS_VALUE if an error occurred
+     */
+    int64_t (*read_timestamp)(struct AVFormatContext *s, int stream_index,
+                              int64_t *pos, int64_t pos_limit);
+
+    /**
+     * Start/resume playing - only meaningful if using a network-based format
+     * (RTSP).
+     */
+    int (*read_play)(struct AVFormatContext *);
+
+    /**
+     * Pause playing - only meaningful if using a network-based format
+     * (RTSP).
+     */
+    int (*read_pause)(struct AVFormatContext *);
+
+    /**
+     * Seek to timestamp ts.
+     * Seeking will be done so that the point from which all active streams
+     * can be presented successfully will be closest to ts and within min/max_ts.
+     * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
+     */
+    int (*read_seek2)(struct AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
+} AVInputFormat;
+/**
+ * @}
+ */
+
+enum AVStreamParseType {
+    AVSTREAM_PARSE_NONE,
+    AVSTREAM_PARSE_FULL,       /**< full parsing and repack */
+    AVSTREAM_PARSE_HEADERS,    /**< Only parse headers, do not repack. */
+    AVSTREAM_PARSE_TIMESTAMPS, /**< full parsing and interpolation of timestamps for frames not starting on a packet boundary */
+    AVSTREAM_PARSE_FULL_ONCE,  /**< full parsing and repack of the first frame only, only implemented for H.264 currently */
+};
+
+typedef struct AVIndexEntry {
+    int64_t pos;
+    int64_t timestamp;
+#define AVINDEX_KEYFRAME 0x0001
+    int flags:2;
+    int size:30; //Yeah, trying to keep the size of this small to reduce memory requirements (it is 24 vs. 32 bytes due to possible 8-byte alignment).
+    int min_distance;         /**< Minimum distance between this and the previous keyframe, used to avoid unneeded searching. */
+} AVIndexEntry;
+
+#define AV_DISPOSITION_DEFAULT   0x0001
+#define AV_DISPOSITION_DUB       0x0002
+#define AV_DISPOSITION_ORIGINAL  0x0004
+#define AV_DISPOSITION_COMMENT   0x0008
+#define AV_DISPOSITION_LYRICS    0x0010
+#define AV_DISPOSITION_KARAOKE   0x0020
+
+/**
+ * Track should be used during playback by default.
+ * Useful for subtitle track that should be displayed
+ * even when user did not explicitly ask for subtitles.
+ */
+#define AV_DISPOSITION_FORCED    0x0040
+#define AV_DISPOSITION_HEARING_IMPAIRED  0x0080  /**< stream for hearing impaired audiences */
+#define AV_DISPOSITION_VISUAL_IMPAIRED   0x0100  /**< stream for visual impaired audiences */
+#define AV_DISPOSITION_CLEAN_EFFECTS     0x0200  /**< stream without voice */
+/**
+ * The stream is stored in the file as an attached picture/"cover art" (e.g.
+ * APIC frame in ID3v2). The single packet associated with it will be returned
+ * among the first few packets read from the file unless seeking takes place.
+ * It can also be accessed at any time in AVStream.attached_pic.
+ */
+#define AV_DISPOSITION_ATTACHED_PIC      0x0400
+
+/**
+ * Stream structure.
+ * New fields can be added to the end with minor version bumps.
+ * Removal, reordering and changes to existing fields require a major
+ * version bump.
+ * sizeof(AVStream) must not be used outside libav*.
+ */
+typedef struct AVStream {
+    int index;    /**< stream index in AVFormatContext */
+    /**
+     * Format-specific stream ID.
+     * decoding: set by libavformat
+     * encoding: set by the user, replaced by libavformat if left unset
+     */
+    int id;
+    /**
+     * Codec context associated with this stream. Allocated and freed by
+     * libavformat.
+     *
+     * - decoding: The demuxer exports codec information stored in the headers
+     *             here.
+     * - encoding: The user sets codec information, the muxer writes it to the
+     *             output. Mandatory fields as specified in AVCodecContext
+     *             documentation must be set even if this AVCodecContext is
+     *             not actually used for encoding.
+     */
+    AVCodecContext *codec;
+    void *priv_data;
+
+    /**
+     * encoding: pts generation when outputting stream
+     */
+    struct AVFrac pts;
+
+    /**
+     * This is the fundamental unit of time (in seconds) in terms
+     * of which frame timestamps are represented.
+     *
+     * decoding: set by libavformat
+     * encoding: set by libavformat in avformat_write_header. The muxer may use the
+     * user-provided value of @ref AVCodecContext.time_base "codec->time_base"
+     * as a hint.
+     */
+    AVRational time_base;
+
+    /**
+     * Decoding: pts of the first frame of the stream, in stream time base.
+     * Only set this if you are absolutely 100% sure that the value you set
+     * it to really is the pts of the first frame.
+     * This may be undefined (AV_NOPTS_VALUE).
+     */
+    int64_t start_time;
+
+    /**
+     * Decoding: duration of the stream, in stream time base.
+     * If a source file does not specify a duration, but does specify
+     * a bitrate, this value will be estimated from bitrate and file size.
+     */
+    int64_t duration;
+
+    int64_t nb_frames;                 ///< number of frames in this stream if known or 0
+
+    int disposition; /**< AV_DISPOSITION_* bit field */
+
+    enum AVDiscard discard; ///< Selects which packets can be discarded at will and do not need to be demuxed.
+
+    /**
+     * sample aspect ratio (0 if unknown)
+     * - encoding: Set by user.
+     * - decoding: Set by libavformat.
+     */
+    AVRational sample_aspect_ratio;
+
+    AVDictionary *metadata;
+
+    /**
+     * Average framerate
+     */
+    AVRational avg_frame_rate;
+
+    /**
+     * For streams with AV_DISPOSITION_ATTACHED_PIC disposition, this packet
+     * will contain the attached picture.
+     *
+     * decoding: set by libavformat, must not be modified by the caller.
+     * encoding: unused
+     */
+    AVPacket attached_pic;
+
+    /*****************************************************************
+     * All fields below this line are not part of the public API. They
+     * may not be used outside of libavformat and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
+
+    /**
+     * Stream information used internally by av_find_stream_info()
+     */
+#define MAX_STD_TIMEBASES (60*12+5)
+    struct {
+        int nb_decoded_frames;
+        int found_decoder;
+
+        /**
+         * Those are used for average framerate estimation.
+         */
+        int64_t fps_first_dts;
+        int     fps_first_dts_idx;
+        int64_t fps_last_dts;
+        int     fps_last_dts_idx;
+
+    } *info;
+
+    int pts_wrap_bits; /**< number of bits in pts (used for wrapping control) */
+
+#if FF_API_REFERENCE_DTS
+    /* a hack to keep ABI compatibility for avconv, which accesses parser even
+     * though it should not */
+    int64_t do_not_use;
+#endif
+    // Timestamp generation support:
+    int64_t first_dts;
+    int64_t cur_dts;
+    int64_t last_IP_pts;
+    int last_IP_duration;
+
+    /**
+     * Number of packets to buffer for codec probing
+     */
+#define MAX_PROBE_PACKETS 2500
+    int probe_packets;
+
+    /**
+     * Number of frames that have been demuxed during av_find_stream_info()
+     */
+    int codec_info_nb_frames;
+
+    /* av_read_frame() support */
+    enum AVStreamParseType need_parsing;
+    struct AVCodecParserContext *parser;
+
+    /**
+     * last packet in packet_buffer for this stream when muxing.
+     */
+    struct AVPacketList *last_in_packet_buffer;
+    AVProbeData probe_data;
+#define MAX_REORDER_DELAY 16
+    int64_t pts_buffer[MAX_REORDER_DELAY+1];
+
+    AVIndexEntry *index_entries; /**< Only used if the format does not
+                                    support seeking natively. */
+    int nb_index_entries;
+    unsigned int index_entries_allocated_size;
+} AVStream;
+
+#define AV_PROGRAM_RUNNING 1
+
+/**
+ * New fields can be added to the end with minor version bumps.
+ * Removal, reordering and changes to existing fields require a major
+ * version bump.
+ * sizeof(AVProgram) must not be used outside libav*.
+ */
+typedef struct AVProgram {
+    int            id;
+    int            flags;
+    enum AVDiscard discard;        ///< selects which program to discard and which to feed to the caller
+    unsigned int   *stream_index;
+    unsigned int   nb_stream_indexes;
+    AVDictionary *metadata;
+} AVProgram;
+
+#define AVFMTCTX_NOHEADER      0x0001 /**< signal that no header is present
+                                         (streams are added dynamically) */
+
+typedef struct AVChapter {
+    int id;                 ///< unique ID to identify the chapter
+    AVRational time_base;   ///< time base in which the start/end timestamps are specified
+    int64_t start, end;     ///< chapter start/end time in time_base units
+    AVDictionary *metadata;
+} AVChapter;
+
+typedef struct AVFormatInternal AVFormatInternal;
+
+/**
+ * Format I/O context.
+ * New fields can be added to the end with minor version bumps.
+ * Removal, reordering and changes to existing fields require a major
+ * version bump.
+ * sizeof(AVFormatContext) must not be used outside libav*, use
+ * avformat_alloc_context() to create an AVFormatContext.
+ */
+typedef struct AVFormatContext {
+    /**
+     * A class for logging and @ref avoptions. Set by avformat_alloc_context().
+     * Exports (de)muxer private options if they exist.
+     */
+    const AVClass *av_class;
+
+    /**
+     * The input container format.
+     *
+     * Demuxing only, set by avformat_open_input().
+     */
+    struct AVInputFormat *iformat;
+
+    /**
+     * The output container format.
+     *
+     * Muxing only, must be set by the caller before avformat_write_header().
+     */
+    struct AVOutputFormat *oformat;
+
+    /**
+     * Format private data. This is an AVOptions-enabled struct
+     * if and only if iformat/oformat.priv_class is not NULL.
+     *
+     * - muxing: set by avformat_write_header()
+     * - demuxing: set by avformat_open_input()
+     */
+    void *priv_data;
+
+    /**
+     * I/O context.
+     *
+     * - demuxing: either set by the user before avformat_open_input() (then
+     *             the user must close it manually) or set by avformat_open_input().
+     * - muxing: set by the user before avformat_write_header(). The caller must
+     *           take care of closing / freeing the IO context.
+     *
+     * Do NOT set this field if AVFMT_NOFILE flag is set in
+     * iformat/oformat.flags. In such a case, the (de)muxer will handle
+     * I/O in some other way and this field will be NULL.
+     */
+    AVIOContext *pb;
+
+    /* stream info */
+    int ctx_flags; /**< Format-specific flags, see AVFMTCTX_xx */
+
+    /**
+     * Number of elements in AVFormatContext.streams.
+     *
+     * Set by avformat_new_stream(), must not be modified by any other code.
+     */
+    unsigned int nb_streams;
+    /**
+     * A list of all streams in the file. New streams are created with
+     * avformat_new_stream().
+     *
+     * - demuxing: streams are created by libavformat in avformat_open_input().
+     *             If AVFMTCTX_NOHEADER is set in ctx_flags, then new streams may also
+     *             appear in av_read_frame().
+     * - muxing: streams are created by the user before avformat_write_header().
+     *
+     * Freed by libavformat in avformat_free_context().
+     */
+    AVStream **streams;
+
+    /**
+     * input or output filename
+     *
+     * - demuxing: set by avformat_open_input()
+     * - muxing: may be set by the caller before avformat_write_header()
+     */
+    char filename[1024];
+
+    /**
+     * Position of the first frame of the component, in
+     * AV_TIME_BASE fractional seconds. NEVER set this value directly:
+     * It is deduced from the AVStream values.
+     *
+     * Demuxing only, set by libavformat.
+     */
+    int64_t start_time;
+
+    /**
+     * Duration of the stream, in AV_TIME_BASE fractional
+     * seconds. Only set this value if you know none of the individual stream
+     * durations and also do not set any of them. This is deduced from the
+     * AVStream values if not set.
+     *
+     * Demuxing only, set by libavformat.
+     */
+    int64_t duration;
+
+    /**
+     * Total stream bitrate in bit/s, 0 if not
+     * available. Never set it directly if the file_size and the
+     * duration are known as Libav can compute it automatically.
+     */
+    int bit_rate;
+
+    unsigned int packet_size;
+    int max_delay;
+
+    int flags;
+#define AVFMT_FLAG_GENPTS       0x0001 ///< Generate missing pts even if it requires parsing future frames.
+#define AVFMT_FLAG_IGNIDX       0x0002 ///< Ignore index.
+#define AVFMT_FLAG_NONBLOCK     0x0004 ///< Do not block when reading packets from input.
+#define AVFMT_FLAG_IGNDTS       0x0008 ///< Ignore DTS on frames that contain both DTS & PTS
+#define AVFMT_FLAG_NOFILLIN     0x0010 ///< Do not infer any values from other values, just return what is stored in the container
+#define AVFMT_FLAG_NOPARSE      0x0020 ///< Do not use AVParsers, you also must set AVFMT_FLAG_NOFILLIN as the fillin code works on frames and no parsing -> no frames. Also seeking to frames can not work if parsing to find frame boundaries has been disabled
+#define AVFMT_FLAG_NOBUFFER     0x0040 ///< Do not buffer frames when possible
+#define AVFMT_FLAG_CUSTOM_IO    0x0080 ///< The caller has supplied a custom AVIOContext, don't avio_close() it.
+#define AVFMT_FLAG_DISCARD_CORRUPT  0x0100 ///< Discard frames marked corrupted
+#define AVFMT_FLAG_FLUSH_PACKETS    0x0200 ///< Flush the AVIOContext every packet.
+
+    /**
+     * Maximum size of the data read from input for determining
+     * the input container format.
+     * Demuxing only, set by the caller before avformat_open_input().
+     */
+    unsigned int probesize;
+
+    /**
+     * Maximum duration (in AV_TIME_BASE units) of the data read
+     * from input in avformat_find_stream_info().
+     * Demuxing only, set by the caller before avformat_find_stream_info().
+     */
+    int max_analyze_duration;
+
+    const uint8_t *key;
+    int keylen;
+
+    unsigned int nb_programs;
+    AVProgram **programs;
+
+    /**
+     * Forced video codec_id.
+     * Demuxing: Set by user.
+     */
+    enum AVCodecID video_codec_id;
+
+    /**
+     * Forced audio codec_id.
+     * Demuxing: Set by user.
+     */
+    enum AVCodecID audio_codec_id;
+
+    /**
+     * Forced subtitle codec_id.
+     * Demuxing: Set by user.
+     */
+    enum AVCodecID subtitle_codec_id;
+
+    /**
+     * Maximum amount of memory in bytes to use for the index of each stream.
+     * If the index exceeds this size, entries will be discarded as
+     * needed to maintain a smaller size. This can lead to slower or less
+     * accurate seeking (depends on demuxer).
+     * Demuxers for which a full in-memory index is mandatory will ignore
+     * this.
+     * - muxing: unused
+     * - demuxing: set by user
+     */
+    unsigned int max_index_size;
+
+    /**
+     * Maximum amount of memory in bytes to use for buffering frames
+     * obtained from realtime capture devices.
+     */
+    unsigned int max_picture_buffer;
+
+    /**
+     * Number of chapters in AVChapter array.
+     * When muxing, chapters are normally written in the file header,
+     * so nb_chapters should normally be initialized before write_header
+     * is called. Some muxers (e.g. mov and mkv) can also write chapters
+     * in the trailer.  To write chapters in the trailer, nb_chapters
+     * must be zero when write_header is called and non-zero when
+     * write_trailer is called.
+     * - muxing: set by user
+     * - demuxing: set by libavformat
+     */
+    unsigned int nb_chapters;
+    AVChapter **chapters;
+
+    /**
+     * Metadata that applies to the whole file.
+     *
+     * - demuxing: set by libavformat in avformat_open_input()
+     * - muxing: may be set by the caller before avformat_write_header()
+     *
+     * Freed by libavformat in avformat_free_context().
+     */
+    AVDictionary *metadata;
+
+    /**
+     * Start time of the stream in real world time, in microseconds
+     * since the Unix epoch (00:00 1st January 1970). That is, pts=0 in the
+     * stream was captured at this real world time.
+     * Muxing only, set by the caller before avformat_write_header().
+     */
+    int64_t start_time_realtime;
+
+    /**
+     * The number of frames used for determining the framerate in
+     * avformat_find_stream_info().
+     * Demuxing only, set by the caller before avformat_find_stream_info().
+     */
+    int fps_probe_size;
+
+    /**
+     * Error recognition; higher values will detect more errors but may
+     * misdetect some more or less valid parts as errors.
+     * Demuxing only, set by the caller before avformat_open_input().
+     */
+    int error_recognition;
+
+    /**
+     * Custom interrupt callbacks for the I/O layer.
+     *
+     * demuxing: set by the user before avformat_open_input().
+     * muxing: set by the user before avformat_write_header()
+     * (mainly useful for AVFMT_NOFILE formats). The callback
+     * should also be passed to avio_open2() if it's used to
+     * open the file.
+     */
+    AVIOInterruptCB interrupt_callback;
+
+    /**
+     * Flags to enable debugging.
+     */
+    int debug;
+#define FF_FDEBUG_TS        0x0001
+
+    /**
+     * Maximum buffering duration for interleaving.
+     *
+     * To ensure all the streams are interleaved correctly,
+     * av_interleaved_write_frame() will wait until it has at least one packet
+     * for each stream before actually writing any packets to the output file.
+     * When some streams are "sparse" (i.e. there are large gaps between
+     * successive packets), this can result in excessive buffering.
+     *
+     * This field specifies the maximum difference between the timestamps of the
+     * first and the last packet in the muxing queue, above which libavformat
+     * will output a packet regardless of whether it has queued a packet for all
+     * the streams.
+     *
+     * Muxing only, set by the caller before avformat_write_header().
+     */
+    int64_t max_interleave_delta;
+
+    /*****************************************************************
+     * All fields below this line are not part of the public API. They
+     * may not be used outside of libavformat and can be changed and
+     * removed at will.
+     * New public fields should be added right above.
+     *****************************************************************
+     */
+
+    /**
+     * This buffer is only needed when packets were already buffered but
+     * not decoded, for example to get the codec parameters in MPEG
+     * streams.
+     */
+    struct AVPacketList *packet_buffer;
+    struct AVPacketList *packet_buffer_end;
+
+    /* av_seek_frame() support */
+    int64_t data_offset; /**< offset of the first packet */
+
+    /**
+     * Raw packets from the demuxer, prior to parsing and decoding.
+     * This buffer is used for buffering packets until the codec can
+     * be identified, as parsing cannot be done without knowing the
+     * codec.
+     */
+    struct AVPacketList *raw_packet_buffer;
+    struct AVPacketList *raw_packet_buffer_end;
+    /**
+     * Packets split by the parser get queued here.
+     */
+    struct AVPacketList *parse_queue;
+    struct AVPacketList *parse_queue_end;
+    /**
+     * Remaining size available for raw_packet_buffer, in bytes.
+     */
+#define RAW_PACKET_BUFFER_SIZE 2500000
+    int raw_packet_buffer_remaining_size;
+
+    /**
+     * Offset to remap timestamps to be non-negative.
+     * Expressed in timebase units.
+     */
+    int64_t offset;
+
+    /**
+     * Timebase for the timestamp offset.
+     */
+    AVRational offset_timebase;
+
+    /**
+     * An opaque field for libavformat internal usage.
+     * Must not be accessed in any way by callers.
+     */
+    AVFormatInternal *internal;
+} AVFormatContext;
+
+typedef struct AVPacketList {
+    AVPacket pkt;
+    struct AVPacketList *next;
+} AVPacketList;
+
+
+/**
+ * @defgroup lavf_core Core functions
+ * @ingroup libavf
+ *
+ * Functions for querying libavformat capabilities, allocating core structures,
+ * etc.
+ * @{
+ */
+
+/**
+ * Return the LIBAVFORMAT_VERSION_INT constant.
+ */
+unsigned avformat_version(void);
+
+/**
+ * Return the libavformat build-time configuration.
+ */
+const char *avformat_configuration(void);
+
+/**
+ * Return the libavformat license.
+ */
+const char *avformat_license(void);
+
+/**
+ * Initialize libavformat and register all the muxers, demuxers and
+ * protocols. If you do not call this function, then you can select
+ * exactly which formats you want to support.
+ *
+ * @see av_register_input_format()
+ * @see av_register_output_format()
+ * @see av_register_protocol()
+ */
+void av_register_all(void);
+
+void av_register_input_format(AVInputFormat *format);
+void av_register_output_format(AVOutputFormat *format);
+
+/**
+ * Do global initialization of network components. This is optional,
+ * but recommended, since it avoids the overhead of implicitly
+ * doing the setup for each session.
+ *
+ * Calling this function will become mandatory if using network
+ * protocols at some major version bump.
+ */
+int avformat_network_init(void);
+
+/**
+ * Undo the initialization done by avformat_network_init.
+ */
+int avformat_network_deinit(void);
+
+/**
+ * If f is NULL, returns the first registered input format,
+ * if f is non-NULL, returns the next registered input format after f
+ * or NULL if f is the last one.
+ */
+AVInputFormat  *av_iformat_next(AVInputFormat  *f);
+
+/**
+ * If f is NULL, returns the first registered output format,
+ * if f is non-NULL, returns the next registered output format after f
+ * or NULL if f is the last one.
+ */
+AVOutputFormat *av_oformat_next(AVOutputFormat *f);
+
+/**
+ * Allocate an AVFormatContext.
+ * avformat_free_context() can be used to free the context and everything
+ * allocated by the framework within it.
+ */
+AVFormatContext *avformat_alloc_context(void);
+
+/**
+ * Free an AVFormatContext and all its streams.
+ * @param s context to free
+ */
+void avformat_free_context(AVFormatContext *s);
+
+/**
+ * Get the AVClass for AVFormatContext. It can be used in combination with
+ * AV_OPT_SEARCH_FAKE_OBJ for examining options.
+ *
+ * @see av_opt_find().
+ */
+const AVClass *avformat_get_class(void);
+
+/**
+ * Add a new stream to a media file.
+ *
+ * When demuxing, it is called by the demuxer in read_header(). If the
+ * flag AVFMTCTX_NOHEADER is set in s.ctx_flags, then it may also
+ * be called in read_packet().
+ *
+ * When muxing, should be called by the user before avformat_write_header().
+ *
+ * @param s media file handle
+ * @param c If non-NULL, the AVCodecContext corresponding to the new stream
+ * will be initialized to use this codec. This is needed for e.g. codec-specific
+ * defaults to be set, so codec should be provided if it is known.
+ *
+ * @return newly created stream or NULL on error.
+ */
+AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c);
+
+AVProgram *av_new_program(AVFormatContext *s, int id);
+
+/**
+ * @}
+ */
+
+
+/**
+ * @addtogroup lavf_decoding
+ * @{
+ */
+
+/**
+ * Find AVInputFormat based on the short name of the input format.
+ */
+AVInputFormat *av_find_input_format(const char *short_name);
+
+/**
+ * Guess the file format.
+ *
+ * @param pd        data to be probed
+ * @param is_opened Whether the file is already opened; determines whether
+ *                  demuxers with or without AVFMT_NOFILE are probed.
+ */
+AVInputFormat *av_probe_input_format(AVProbeData *pd, int is_opened);
+
+/**
+ * Guess the file format.
+ *
+ * @param pd        data to be probed
+ * @param is_opened Whether the file is already opened; determines whether
+ *                  demuxers with or without AVFMT_NOFILE are probed.
+ * @param score_max A probe score larger that this is required to accept a
+ *                  detection, the variable is set to the actual detection
+ *                  score afterwards.
+ *                  If the score is <= AVPROBE_SCORE_MAX / 4 it is recommended
+ *                  to retry with a larger probe buffer.
+ */
+AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max);
+
+/**
+ * Probe a bytestream to determine the input format. Each time a probe returns
+ * with a score that is too low, the probe buffer size is increased and another
+ * attempt is made. When the maximum probe size is reached, the input format
+ * with the highest score is returned.
+ *
+ * @param pb the bytestream to probe
+ * @param fmt the input format is put here
+ * @param filename the filename of the stream
+ * @param logctx the log context
+ * @param offset the offset within the bytestream to probe from
+ * @param max_probe_size the maximum probe buffer size (zero for default)
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code otherwise
+ */
+int av_probe_input_buffer(AVIOContext *pb, AVInputFormat **fmt,
+                          const char *filename, void *logctx,
+                          unsigned int offset, unsigned int max_probe_size);
+
+/**
+ * Open an input stream and read the header. The codecs are not opened.
+ * The stream must be closed with avformat_close_input().
+ *
+ * @param ps Pointer to user-supplied AVFormatContext (allocated by avformat_alloc_context).
+ *           May be a pointer to NULL, in which case an AVFormatContext is allocated by this
+ *           function and written into ps.
+ *           Note that a user-supplied AVFormatContext will be freed on failure.
+ * @param filename Name of the stream to open.
+ * @param fmt If non-NULL, this parameter forces a specific input format.
+ *            Otherwise the format is autodetected.
+ * @param options  A dictionary filled with AVFormatContext and demuxer-private options.
+ *                 On return this parameter will be destroyed and replaced with a dict containing
+ *                 options that were not found. May be NULL.
+ *
+ * @return 0 on success, a negative AVERROR on failure.
+ *
+ * @note If you want to use custom IO, preallocate the format context and set its pb field.
+ */
+int avformat_open_input(AVFormatContext **ps, const char *filename, AVInputFormat *fmt, AVDictionary **options);
+
+/**
+ * Read packets of a media file to get stream information. This
+ * is useful for file formats with no headers such as MPEG. This
+ * function also computes the real framerate in case of MPEG-2 repeat
+ * frame mode.
+ * The logical file position is not changed by this function;
+ * examined packets may be buffered for later processing.
+ *
+ * @param ic media file handle
+ * @param options  If non-NULL, an ic.nb_streams long array of pointers to
+ *                 dictionaries, where i-th member contains options for
+ *                 codec corresponding to i-th stream.
+ *                 On return each dictionary will be filled with options that were not found.
+ * @return >=0 if OK, AVERROR_xxx on error
+ *
+ * @note this function isn't guaranteed to open all the codecs, so
+ *       options being non-empty at return is a perfectly normal behavior.
+ *
+ * @todo Let the user decide somehow what information is needed so that
+ *       we do not waste time getting stuff the user does not need.
+ */
+int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options);
+
+/**
+ * Find the "best" stream in the file.
+ * The best stream is determined according to various heuristics as the most
+ * likely to be what the user expects.
+ * If the decoder parameter is non-NULL, av_find_best_stream will find the
+ * default decoder for the stream's codec; streams for which no decoder can
+ * be found are ignored.
+ *
+ * @param ic                media file handle
+ * @param type              stream type: video, audio, subtitles, etc.
+ * @param wanted_stream_nb  user-requested stream number,
+ *                          or -1 for automatic selection
+ * @param related_stream    try to find a stream related (eg. in the same
+ *                          program) to this one, or -1 if none
+ * @param decoder_ret       if non-NULL, returns the decoder for the
+ *                          selected stream
+ * @param flags             flags; none are currently defined
+ * @return  the non-negative stream number in case of success,
+ *          AVERROR_STREAM_NOT_FOUND if no stream with the requested type
+ *          could be found,
+ *          AVERROR_DECODER_NOT_FOUND if streams were found but no decoder
+ * @note  If av_find_best_stream returns successfully and decoder_ret is not
+ *        NULL, then *decoder_ret is guaranteed to be set to a valid AVCodec.
+ */
+int av_find_best_stream(AVFormatContext *ic,
+                        enum AVMediaType type,
+                        int wanted_stream_nb,
+                        int related_stream,
+                        AVCodec **decoder_ret,
+                        int flags);
+
+/**
+ * Return the next frame of a stream.
+ * This function returns what is stored in the file, and does not validate
+ * that what is there are valid frames for the decoder. It will split what is
+ * stored in the file into frames and return one for each call. It will not
+ * omit invalid data between valid frames so as to give the decoder the maximum
+ * information possible for decoding.
+ *
+ * If pkt->buf is NULL, then the packet is valid until the next
+ * av_read_frame() or until avformat_close_input(). Otherwise the packet
+ * is valid indefinitely. In both cases the packet must be freed with
+ * av_free_packet when it is no longer needed. For video, the packet contains
+ * exactly one frame. For audio, it contains an integer number of frames if each
+ * frame has a known fixed size (e.g. PCM or ADPCM data). If the audio frames
+ * have a variable size (e.g. MPEG audio), then it contains one frame.
+ *
+ * pkt->pts, pkt->dts and pkt->duration are always set to correct
+ * values in AVStream.time_base units (and guessed if the format cannot
+ * provide them). pkt->pts can be AV_NOPTS_VALUE if the video format
+ * has B-frames, so it is better to rely on pkt->dts if you do not
+ * decompress the payload.
+ *
+ * @return 0 if OK, < 0 on error or end of file
+ */
+int av_read_frame(AVFormatContext *s, AVPacket *pkt);
+
+/**
+ * Seek to the keyframe at timestamp.
+ * 'timestamp' in 'stream_index'.
+ *
+ * @param s media file handle
+ * @param stream_index If stream_index is (-1), a default
+ * stream is selected, and timestamp is automatically converted
+ * from AV_TIME_BASE units to the stream specific time_base.
+ * @param timestamp Timestamp in AVStream.time_base units
+ *        or, if no stream is specified, in AV_TIME_BASE units.
+ * @param flags flags which select direction and seeking mode
+ * @return >= 0 on success
+ */
+int av_seek_frame(AVFormatContext *s, int stream_index, int64_t timestamp,
+                  int flags);
+
+/**
+ * Seek to timestamp ts.
+ * Seeking will be done so that the point from which all active streams
+ * can be presented successfully will be closest to ts and within min/max_ts.
+ * Active streams are all streams that have AVStream.discard < AVDISCARD_ALL.
+ *
+ * If flags contain AVSEEK_FLAG_BYTE, then all timestamps are in bytes and
+ * are the file position (this may not be supported by all demuxers).
+ * If flags contain AVSEEK_FLAG_FRAME, then all timestamps are in frames
+ * in the stream with stream_index (this may not be supported by all demuxers).
+ * Otherwise all timestamps are in units of the stream selected by stream_index
+ * or if stream_index is -1, in AV_TIME_BASE units.
+ * If flags contain AVSEEK_FLAG_ANY, then non-keyframes are treated as
+ * keyframes (this may not be supported by all demuxers).
+ *
+ * @param s media file handle
+ * @param stream_index index of the stream which is used as time base reference
+ * @param min_ts smallest acceptable timestamp
+ * @param ts target timestamp
+ * @param max_ts largest acceptable timestamp
+ * @param flags flags
+ * @return >=0 on success, error code otherwise
+ *
+ * @note This is part of the new seek API which is still under construction.
+ *       Thus do not use this yet. It may change at any time, do not expect
+ *       ABI compatibility yet!
+ */
+int avformat_seek_file(AVFormatContext *s, int stream_index, int64_t min_ts, int64_t ts, int64_t max_ts, int flags);
+
+/**
+ * Start playing a network-based stream (e.g. RTSP stream) at the
+ * current position.
+ */
+int av_read_play(AVFormatContext *s);
+
+/**
+ * Pause a network-based stream (e.g. RTSP stream).
+ *
+ * Use av_read_play() to resume it.
+ */
+int av_read_pause(AVFormatContext *s);
+
+/**
+ * Close an opened input AVFormatContext. Free it and all its contents
+ * and set *s to NULL.
+ */
+void avformat_close_input(AVFormatContext **s);
+/**
+ * @}
+ */
+
+#define AVSEEK_FLAG_BACKWARD 1 ///< seek backward
+#define AVSEEK_FLAG_BYTE     2 ///< seeking based on position in bytes
+#define AVSEEK_FLAG_ANY      4 ///< seek to any frame, even non-keyframes
+#define AVSEEK_FLAG_FRAME    8 ///< seeking based on frame number
+
+/**
+ * @addtogroup lavf_encoding
+ * @{
+ */
+/**
+ * Allocate the stream private data and write the stream header to
+ * an output media file.
+ *
+ * @param s Media file handle, must be allocated with avformat_alloc_context().
+ *          Its oformat field must be set to the desired output format;
+ *          Its pb field must be set to an already opened AVIOContext.
+ * @param options  An AVDictionary filled with AVFormatContext and muxer-private options.
+ *                 On return this parameter will be destroyed and replaced with a dict containing
+ *                 options that were not found. May be NULL.
+ *
+ * @return 0 on success, negative AVERROR on failure.
+ *
+ * @see av_opt_find, av_dict_set, avio_open, av_oformat_next.
+ */
+int avformat_write_header(AVFormatContext *s, AVDictionary **options);
+
+/**
+ * Write a packet to an output media file.
+ *
+ * This function passes the packet directly to the muxer, without any buffering
+ * or reordering. The caller is responsible for correctly interleaving the
+ * packets if the format requires it. Callers that want libavformat to handle
+ * the interleaving should call av_interleaved_write_frame() instead of this
+ * function.
+ *
+ * @param s media file handle
+ * @param pkt The packet containing the data to be written. Note that unlike
+ *            av_interleaved_write_frame(), this function does not take
+ *            ownership of the packet passed to it (though some muxers may make
+ *            an internal reference to the input packet).
+ *            <br>
+ *            This parameter can be NULL (at any time, not just at the end), in
+ *            order to immediately flush data buffered within the muxer, for
+ *            muxers that buffer up data internally before writing it to the
+ *            output.
+ *            <br>
+ *            Packet's @ref AVPacket.stream_index "stream_index" field must be
+ *            set to the index of the corresponding stream in @ref
+ *            AVFormatContext.streams "s->streams". It is very strongly
+ *            recommended that timing information (@ref AVPacket.pts "pts", @ref
+ *            AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to
+ *            correct values.
+ * @return < 0 on error, = 0 if OK, 1 if flushed and there is no more data to flush
+ *
+ * @see av_interleaved_write_frame()
+ */
+int av_write_frame(AVFormatContext *s, AVPacket *pkt);
+
+/**
+ * Write a packet to an output media file ensuring correct interleaving.
+ *
+ * This function will buffer the packets internally as needed to make sure the
+ * packets in the output file are properly interleaved in the order of
+ * increasing dts. Callers doing their own interleaving should call
+ * av_write_frame() instead of this function.
+ *
+ * @param s media file handle
+ * @param pkt The packet containing the data to be written.
+ *            <br>
+ *            If the packet is reference-counted, this function will take
+ *            ownership of this reference and unreference it later when it sees
+ *            fit.
+ *            The caller must not access the data through this reference after
+ *            this function returns. If the packet is not reference-counted,
+ *            libavformat will make a copy.
+ *            <br>
+ *            This parameter can be NULL (at any time, not just at the end), to
+ *            flush the interleaving queues.
+ *            <br>
+ *            Packet's @ref AVPacket.stream_index "stream_index" field must be
+ *            set to the index of the corresponding stream in @ref
+ *            AVFormatContext.streams "s->streams". It is very strongly
+ *            recommended that timing information (@ref AVPacket.pts "pts", @ref
+ *            AVPacket.dts "dts", @ref AVPacket.duration "duration") is set to
+ *            correct values.
+ *
+ * @return 0 on success, a negative AVERROR on error. Libavformat will always
+ *         take care of freeing the packet, even if this function fails.
+ *
+ * @see av_write_frame(), AVFormatContext.max_interleave_delta
+ */
+int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt);
+
+/**
+ * Write the stream trailer to an output media file and free the
+ * file private data.
+ *
+ * May only be called after a successful call to avformat_write_header.
+ *
+ * @param s media file handle
+ * @return 0 if OK, AVERROR_xxx on error
+ */
+int av_write_trailer(AVFormatContext *s);
+
+/**
+ * Return the output format in the list of registered output formats
+ * which best matches the provided parameters, or return NULL if
+ * there is no match.
+ *
+ * @param short_name if non-NULL checks if short_name matches with the
+ * names of the registered formats
+ * @param filename if non-NULL checks if filename terminates with the
+ * extensions of the registered formats
+ * @param mime_type if non-NULL checks if mime_type matches with the
+ * MIME type of the registered formats
+ */
+AVOutputFormat *av_guess_format(const char *short_name,
+                                const char *filename,
+                                const char *mime_type);
+
+/**
+ * Guess the codec ID based upon muxer and filename.
+ */
+enum AVCodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
+                            const char *filename, const char *mime_type,
+                            enum AVMediaType type);
+
+/**
+ * @}
+ */
+
+
+/**
+ * @defgroup lavf_misc Utility functions
+ * @ingroup libavf
+ * @{
+ *
+ * Miscellaneous utility functions related to both muxing and demuxing
+ * (or neither).
+ */
+
+/**
+ * Send a nice hexadecimal dump of a buffer to the specified file stream.
+ *
+ * @param f The file stream pointer where the dump should be sent to.
+ * @param buf buffer
+ * @param size buffer size
+ *
+ * @see av_hex_dump_log, av_pkt_dump2, av_pkt_dump_log2
+ */
+void av_hex_dump(FILE *f, const uint8_t *buf, int size);
+
+/**
+ * Send a nice hexadecimal dump of a buffer to the log.
+ *
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
+ * pointer to an AVClass struct.
+ * @param level The importance level of the message, lower values signifying
+ * higher importance.
+ * @param buf buffer
+ * @param size buffer size
+ *
+ * @see av_hex_dump, av_pkt_dump2, av_pkt_dump_log2
+ */
+void av_hex_dump_log(void *avcl, int level, const uint8_t *buf, int size);
+
+/**
+ * Send a nice dump of a packet to the specified file stream.
+ *
+ * @param f The file stream pointer where the dump should be sent to.
+ * @param pkt packet to dump
+ * @param dump_payload True if the payload must be displayed, too.
+ * @param st AVStream that the packet belongs to
+ */
+void av_pkt_dump2(FILE *f, AVPacket *pkt, int dump_payload, AVStream *st);
+
+
+/**
+ * Send a nice dump of a packet to the log.
+ *
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
+ * pointer to an AVClass struct.
+ * @param level The importance level of the message, lower values signifying
+ * higher importance.
+ * @param pkt packet to dump
+ * @param dump_payload True if the payload must be displayed, too.
+ * @param st AVStream that the packet belongs to
+ */
+void av_pkt_dump_log2(void *avcl, int level, AVPacket *pkt, int dump_payload,
+                      AVStream *st);
+
+/**
+ * Get the AVCodecID for the given codec tag tag.
+ * If no codec id is found returns AV_CODEC_ID_NONE.
+ *
+ * @param tags list of supported codec_id-codec_tag pairs, as stored
+ * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
+ * @param tag  codec tag to match to a codec ID
+ */
+enum AVCodecID av_codec_get_id(const struct AVCodecTag * const *tags, unsigned int tag);
+
+/**
+ * Get the codec tag for the given codec id id.
+ * If no codec tag is found returns 0.
+ *
+ * @param tags list of supported codec_id-codec_tag pairs, as stored
+ * in AVInputFormat.codec_tag and AVOutputFormat.codec_tag
+ * @param id   codec ID to match to a codec tag
+ */
+unsigned int av_codec_get_tag(const struct AVCodecTag * const *tags, enum AVCodecID id);
+
+int av_find_default_stream_index(AVFormatContext *s);
+
+/**
+ * Get the index for a specific timestamp.
+ *
+ * @param st        stream that the timestamp belongs to
+ * @param timestamp timestamp to retrieve the index for
+ * @param flags if AVSEEK_FLAG_BACKWARD then the returned index will correspond
+ *                 to the timestamp which is <= the requested one, if backward
+ *                 is 0, then it will be >=
+ *              if AVSEEK_FLAG_ANY seek to any frame, only keyframes otherwise
+ * @return < 0 if no such timestamp could be found
+ */
+int av_index_search_timestamp(AVStream *st, int64_t timestamp, int flags);
+
+/**
+ * Add an index entry into a sorted list. Update the entry if the list
+ * already contains it.
+ *
+ * @param timestamp timestamp in the time base of the given stream
+ */
+int av_add_index_entry(AVStream *st, int64_t pos, int64_t timestamp,
+                       int size, int distance, int flags);
+
+
+/**
+ * Split a URL string into components.
+ *
+ * The pointers to buffers for storing individual components may be null,
+ * in order to ignore that component. Buffers for components not found are
+ * set to empty strings. If the port is not found, it is set to a negative
+ * value.
+ *
+ * @param proto the buffer for the protocol
+ * @param proto_size the size of the proto buffer
+ * @param authorization the buffer for the authorization
+ * @param authorization_size the size of the authorization buffer
+ * @param hostname the buffer for the host name
+ * @param hostname_size the size of the hostname buffer
+ * @param port_ptr a pointer to store the port number in
+ * @param path the buffer for the path
+ * @param path_size the size of the path buffer
+ * @param url the URL to split
+ */
+void av_url_split(char *proto,         int proto_size,
+                  char *authorization, int authorization_size,
+                  char *hostname,      int hostname_size,
+                  int *port_ptr,
+                  char *path,          int path_size,
+                  const char *url);
+
+
+void av_dump_format(AVFormatContext *ic,
+                    int index,
+                    const char *url,
+                    int is_output);
+
+/**
+ * Return in 'buf' the path with '%d' replaced by a number.
+ *
+ * Also handles the '%0nd' format where 'n' is the total number
+ * of digits and '%%'.
+ *
+ * @param buf destination buffer
+ * @param buf_size destination buffer size
+ * @param path numbered sequence string
+ * @param number frame number
+ * @return 0 if OK, -1 on format error
+ */
+int av_get_frame_filename(char *buf, int buf_size,
+                          const char *path, int number);
+
+/**
+ * Check whether filename actually is a numbered sequence generator.
+ *
+ * @param filename possible numbered sequence string
+ * @return 1 if a valid numbered sequence string, 0 otherwise
+ */
+int av_filename_number_test(const char *filename);
+
+/**
+ * Generate an SDP for an RTP session.
+ *
+ * Note, this overwrites the id values of AVStreams in the muxer contexts
+ * for getting unique dynamic payload types.
+ *
+ * @param ac array of AVFormatContexts describing the RTP streams. If the
+ *           array is composed by only one context, such context can contain
+ *           multiple AVStreams (one AVStream per RTP stream). Otherwise,
+ *           all the contexts in the array (an AVCodecContext per RTP stream)
+ *           must contain only one AVStream.
+ * @param n_files number of AVCodecContexts contained in ac
+ * @param buf buffer where the SDP will be stored (must be allocated by
+ *            the caller)
+ * @param size the size of the buffer
+ * @return 0 if OK, AVERROR_xxx on error
+ */
+int av_sdp_create(AVFormatContext *ac[], int n_files, char *buf, int size);
+
+/**
+ * Return a positive value if the given filename has one of the given
+ * extensions, 0 otherwise.
+ *
+ * @param filename   file name to check against the given extensions
+ * @param extensions a comma-separated list of filename extensions
+ */
+int av_match_ext(const char *filename, const char *extensions);
+
+/**
+ * Test if the given container can store a codec.
+ *
+ * @param ofmt           container to check for compatibility
+ * @param codec_id       codec to potentially store in container
+ * @param std_compliance standards compliance level, one of FF_COMPLIANCE_*
+ *
+ * @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot.
+ *         A negative number if this information is not available.
+ */
+int avformat_query_codec(AVOutputFormat *ofmt, enum AVCodecID codec_id, int std_compliance);
+
+/**
+ * @defgroup riff_fourcc RIFF FourCCs
+ * @{
+ * Get the tables mapping RIFF FourCCs to libavcodec AVCodecIDs. The tables are
+ * meant to be passed to av_codec_get_id()/av_codec_get_tag() as in the
+ * following code:
+ * @code
+ * uint32_t tag = MKTAG('H', '2', '6', '4');
+ * const struct AVCodecTag *table[] = { avformat_get_riff_video_tags(), 0 };
+ * enum AVCodecID id = av_codec_get_id(table, tag);
+ * @endcode
+ */
+/**
+ * @return the table mapping RIFF FourCCs for video to libavcodec AVCodecID.
+ */
+const struct AVCodecTag *avformat_get_riff_video_tags(void);
+/**
+ * @return the table mapping RIFF FourCCs for audio to AVCodecID.
+ */
+const struct AVCodecTag *avformat_get_riff_audio_tags(void);
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+#endif /* AVFORMAT_AVFORMAT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavformat/avio.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavformat/avio.h
new file mode 100644
index 0000000..3360e82
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavformat/avio.h
@@ -0,0 +1,439 @@
+/*
+ * copyright (c) 2001 Fabrice Bellard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+#ifndef AVFORMAT_AVIO_H
+#define AVFORMAT_AVIO_H
+
+/**
+ * @file
+ * @ingroup lavf_io
+ * Buffered I/O operations
+ */
+
+#include <stdint.h>
+
+#include "libavutil/common.h"
+#include "libavutil/dict.h"
+#include "libavutil/log.h"
+
+#include "libavformat/version.h"
+
+
+#define AVIO_SEEKABLE_NORMAL 0x0001 /**< Seeking works like for a local file */
+
+/**
+ * Callback for checking whether to abort blocking functions.
+ * AVERROR_EXIT is returned in this case by the interrupted
+ * function. During blocking operations, callback is called with
+ * opaque as parameter. If the callback returns 1, the
+ * blocking operation will be aborted.
+ *
+ * No members can be added to this struct without a major bump, if
+ * new elements have been added after this struct in AVFormatContext
+ * or AVIOContext.
+ */
+typedef struct AVIOInterruptCB {
+    int (*callback)(void*);
+    void *opaque;
+} AVIOInterruptCB;
+
+/**
+ * Bytestream IO Context.
+ * New fields can be added to the end with minor version bumps.
+ * Removal, reordering and changes to existing fields require a major
+ * version bump.
+ * sizeof(AVIOContext) must not be used outside libav*.
+ *
+ * @note None of the function pointers in AVIOContext should be called
+ *       directly, they should only be set by the client application
+ *       when implementing custom I/O. Normally these are set to the
+ *       function pointers specified in avio_alloc_context()
+ */
+typedef struct AVIOContext {
+    /**
+     * A class for private options.
+     *
+     * If this AVIOContext is created by avio_open2(), av_class is set and
+     * passes the options down to protocols.
+     *
+     * If this AVIOContext is manually allocated, then av_class may be set by
+     * the caller.
+     *
+     * warning -- this field can be NULL, be sure to not pass this AVIOContext
+     * to any av_opt_* functions in that case.
+     */
+    const AVClass *av_class;
+    unsigned char *buffer;  /**< Start of the buffer. */
+    int buffer_size;        /**< Maximum buffer size */
+    unsigned char *buf_ptr; /**< Current position in the buffer */
+    unsigned char *buf_end; /**< End of the data, may be less than
+                                 buffer+buffer_size if the read function returned
+                                 less data than requested, e.g. for streams where
+                                 no more data has been received yet. */
+    void *opaque;           /**< A private pointer, passed to the read/write/seek/...
+                                 functions. */
+    int (*read_packet)(void *opaque, uint8_t *buf, int buf_size);
+    int (*write_packet)(void *opaque, uint8_t *buf, int buf_size);
+    int64_t (*seek)(void *opaque, int64_t offset, int whence);
+    int64_t pos;            /**< position in the file of the current buffer */
+    int must_flush;         /**< true if the next seek should flush */
+    int eof_reached;        /**< true if eof reached */
+    int write_flag;         /**< true if open for writing */
+    int max_packet_size;
+    unsigned long checksum;
+    unsigned char *checksum_ptr;
+    unsigned long (*update_checksum)(unsigned long checksum, const uint8_t *buf, unsigned int size);
+    int error;              /**< contains the error code or 0 if no error happened */
+    /**
+     * Pause or resume playback for network streaming protocols - e.g. MMS.
+     */
+    int (*read_pause)(void *opaque, int pause);
+    /**
+     * Seek to a given timestamp in stream with the specified stream_index.
+     * Needed for some network streaming protocols which don't support seeking
+     * to byte position.
+     */
+    int64_t (*read_seek)(void *opaque, int stream_index,
+                         int64_t timestamp, int flags);
+    /**
+     * A combination of AVIO_SEEKABLE_ flags or 0 when the stream is not seekable.
+     */
+    int seekable;
+} AVIOContext;
+
+/* unbuffered I/O */
+
+/**
+ * Return AVIO_FLAG_* access flags corresponding to the access permissions
+ * of the resource in url, or a negative value corresponding to an
+ * AVERROR code in case of failure. The returned access flags are
+ * masked by the value in flags.
+ *
+ * @note This function is intrinsically unsafe, in the sense that the
+ * checked resource may change its existence or permission status from
+ * one call to another. Thus you should not trust the returned value,
+ * unless you are sure that no other processes are accessing the
+ * checked resource.
+ */
+int avio_check(const char *url, int flags);
+
+/**
+ * Allocate and initialize an AVIOContext for buffered I/O. It must be later
+ * freed with av_free().
+ *
+ * @param buffer Memory block for input/output operations via AVIOContext.
+ *        The buffer must be allocated with av_malloc() and friends.
+ * @param buffer_size The buffer size is very important for performance.
+ *        For protocols with fixed blocksize it should be set to this blocksize.
+ *        For others a typical size is a cache page, e.g. 4kb.
+ * @param write_flag Set to 1 if the buffer should be writable, 0 otherwise.
+ * @param opaque An opaque pointer to user-specific data.
+ * @param read_packet  A function for refilling the buffer, may be NULL.
+ * @param write_packet A function for writing the buffer contents, may be NULL.
+ * @param seek A function for seeking to specified byte position, may be NULL.
+ *
+ * @return Allocated AVIOContext or NULL on failure.
+ */
+AVIOContext *avio_alloc_context(
+                  unsigned char *buffer,
+                  int buffer_size,
+                  int write_flag,
+                  void *opaque,
+                  int (*read_packet)(void *opaque, uint8_t *buf, int buf_size),
+                  int (*write_packet)(void *opaque, uint8_t *buf, int buf_size),
+                  int64_t (*seek)(void *opaque, int64_t offset, int whence));
+
+void avio_w8(AVIOContext *s, int b);
+void avio_write(AVIOContext *s, const unsigned char *buf, int size);
+void avio_wl64(AVIOContext *s, uint64_t val);
+void avio_wb64(AVIOContext *s, uint64_t val);
+void avio_wl32(AVIOContext *s, unsigned int val);
+void avio_wb32(AVIOContext *s, unsigned int val);
+void avio_wl24(AVIOContext *s, unsigned int val);
+void avio_wb24(AVIOContext *s, unsigned int val);
+void avio_wl16(AVIOContext *s, unsigned int val);
+void avio_wb16(AVIOContext *s, unsigned int val);
+
+/**
+ * Write a NULL-terminated string.
+ * @return number of bytes written.
+ */
+int avio_put_str(AVIOContext *s, const char *str);
+
+/**
+ * Convert an UTF-8 string to UTF-16LE and write it.
+ * @return number of bytes written.
+ */
+int avio_put_str16le(AVIOContext *s, const char *str);
+
+/**
+ * Passing this as the "whence" parameter to a seek function causes it to
+ * return the filesize without seeking anywhere. Supporting this is optional.
+ * If it is not supported then the seek function will return <0.
+ */
+#define AVSEEK_SIZE 0x10000
+
+/**
+ * Oring this flag as into the "whence" parameter to a seek function causes it to
+ * seek by any means (like reopening and linear reading) or other normally unreasonble
+ * means that can be extreemly slow.
+ * This may be ignored by the seek code.
+ */
+#define AVSEEK_FORCE 0x20000
+
+/**
+ * fseek() equivalent for AVIOContext.
+ * @return new position or AVERROR.
+ */
+int64_t avio_seek(AVIOContext *s, int64_t offset, int whence);
+
+/**
+ * Skip given number of bytes forward
+ * @return new position or AVERROR.
+ */
+static av_always_inline int64_t avio_skip(AVIOContext *s, int64_t offset)
+{
+    return avio_seek(s, offset, SEEK_CUR);
+}
+
+/**
+ * ftell() equivalent for AVIOContext.
+ * @return position or AVERROR.
+ */
+static av_always_inline int64_t avio_tell(AVIOContext *s)
+{
+    return avio_seek(s, 0, SEEK_CUR);
+}
+
+/**
+ * Get the filesize.
+ * @return filesize or AVERROR
+ */
+int64_t avio_size(AVIOContext *s);
+
+/** @warning currently size is limited */
+int avio_printf(AVIOContext *s, const char *fmt, ...) av_printf_format(2, 3);
+
+void avio_flush(AVIOContext *s);
+
+
+/**
+ * Read size bytes from AVIOContext into buf.
+ * @return number of bytes read or AVERROR
+ */
+int avio_read(AVIOContext *s, unsigned char *buf, int size);
+
+/**
+ * @name Functions for reading from AVIOContext
+ * @{
+ *
+ * @note return 0 if EOF, so you cannot use it if EOF handling is
+ *       necessary
+ */
+int          avio_r8  (AVIOContext *s);
+unsigned int avio_rl16(AVIOContext *s);
+unsigned int avio_rl24(AVIOContext *s);
+unsigned int avio_rl32(AVIOContext *s);
+uint64_t     avio_rl64(AVIOContext *s);
+unsigned int avio_rb16(AVIOContext *s);
+unsigned int avio_rb24(AVIOContext *s);
+unsigned int avio_rb32(AVIOContext *s);
+uint64_t     avio_rb64(AVIOContext *s);
+/**
+ * @}
+ */
+
+/**
+ * Read a string from pb into buf. The reading will terminate when either
+ * a NULL character was encountered, maxlen bytes have been read, or nothing
+ * more can be read from pb. The result is guaranteed to be NULL-terminated, it
+ * will be truncated if buf is too small.
+ * Note that the string is not interpreted or validated in any way, it
+ * might get truncated in the middle of a sequence for multi-byte encodings.
+ *
+ * @return number of bytes read (is always <= maxlen).
+ * If reading ends on EOF or error, the return value will be one more than
+ * bytes actually read.
+ */
+int avio_get_str(AVIOContext *pb, int maxlen, char *buf, int buflen);
+
+/**
+ * Read a UTF-16 string from pb and convert it to UTF-8.
+ * The reading will terminate when either a null or invalid character was
+ * encountered or maxlen bytes have been read.
+ * @return number of bytes read (is always <= maxlen)
+ */
+int avio_get_str16le(AVIOContext *pb, int maxlen, char *buf, int buflen);
+int avio_get_str16be(AVIOContext *pb, int maxlen, char *buf, int buflen);
+
+
+/**
+ * @name URL open modes
+ * The flags argument to avio_open must be one of the following
+ * constants, optionally ORed with other flags.
+ * @{
+ */
+#define AVIO_FLAG_READ  1                                      /**< read-only */
+#define AVIO_FLAG_WRITE 2                                      /**< write-only */
+#define AVIO_FLAG_READ_WRITE (AVIO_FLAG_READ|AVIO_FLAG_WRITE)  /**< read-write pseudo flag */
+/**
+ * @}
+ */
+
+/**
+ * Use non-blocking mode.
+ * If this flag is set, operations on the context will return
+ * AVERROR(EAGAIN) if they can not be performed immediately.
+ * If this flag is not set, operations on the context will never return
+ * AVERROR(EAGAIN).
+ * Note that this flag does not affect the opening/connecting of the
+ * context. Connecting a protocol will always block if necessary (e.g. on
+ * network protocols) but never hang (e.g. on busy devices).
+ * Warning: non-blocking protocols is work-in-progress; this flag may be
+ * silently ignored.
+ */
+#define AVIO_FLAG_NONBLOCK 8
+
+/**
+ * Create and initialize a AVIOContext for accessing the
+ * resource indicated by url.
+ * @note When the resource indicated by url has been opened in
+ * read+write mode, the AVIOContext can be used only for writing.
+ *
+ * @param s Used to return the pointer to the created AVIOContext.
+ * In case of failure the pointed to value is set to NULL.
+ * @param url resource to access
+ * @param flags flags which control how the resource indicated by url
+ * is to be opened
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code in case of failure
+ */
+int avio_open(AVIOContext **s, const char *url, int flags);
+
+/**
+ * Create and initialize a AVIOContext for accessing the
+ * resource indicated by url.
+ * @note When the resource indicated by url has been opened in
+ * read+write mode, the AVIOContext can be used only for writing.
+ *
+ * @param s Used to return the pointer to the created AVIOContext.
+ * In case of failure the pointed to value is set to NULL.
+ * @param url resource to access
+ * @param flags flags which control how the resource indicated by url
+ * is to be opened
+ * @param int_cb an interrupt callback to be used at the protocols level
+ * @param options  A dictionary filled with protocol-private options. On return
+ * this parameter will be destroyed and replaced with a dict containing options
+ * that were not found. May be NULL.
+ * @return 0 in case of success, a negative value corresponding to an
+ * AVERROR code in case of failure
+ */
+int avio_open2(AVIOContext **s, const char *url, int flags,
+               const AVIOInterruptCB *int_cb, AVDictionary **options);
+
+/**
+ * Close the resource accessed by the AVIOContext s and free it.
+ * This function can only be used if s was opened by avio_open().
+ *
+ * The internal buffer is automatically flushed before closing the
+ * resource.
+ *
+ * @return 0 on success, an AVERROR < 0 on error.
+ * @see avio_closep
+ */
+int avio_close(AVIOContext *s);
+
+/**
+ * Close the resource accessed by the AVIOContext *s, free it
+ * and set the pointer pointing to it to NULL.
+ * This function can only be used if s was opened by avio_open().
+ *
+ * The internal buffer is automatically flushed before closing the
+ * resource.
+ *
+ * @return 0 on success, an AVERROR < 0 on error.
+ * @see avio_close
+ */
+int avio_closep(AVIOContext **s);
+
+
+/**
+ * Open a write only memory stream.
+ *
+ * @param s new IO context
+ * @return zero if no error.
+ */
+int avio_open_dyn_buf(AVIOContext **s);
+
+/**
+ * Return the written size and a pointer to the buffer. The buffer
+ * must be freed with av_free().
+ * Padding of FF_INPUT_BUFFER_PADDING_SIZE is added to the buffer.
+ *
+ * @param s IO context
+ * @param pbuffer pointer to a byte buffer
+ * @return the length of the byte buffer
+ */
+int avio_close_dyn_buf(AVIOContext *s, uint8_t **pbuffer);
+
+/**
+ * Iterate through names of available protocols.
+ *
+ * @param opaque A private pointer representing current protocol.
+ *        It must be a pointer to NULL on first iteration and will
+ *        be updated by successive calls to avio_enum_protocols.
+ * @param output If set to 1, iterate over output protocols,
+ *               otherwise over input protocols.
+ *
+ * @return A static string containing the name of current protocol or NULL
+ */
+const char *avio_enum_protocols(void **opaque, int output);
+
+/**
+ * Pause and resume playing - only meaningful if using a network streaming
+ * protocol (e.g. MMS).
+ *
+ * @param h     IO context from which to call the read_pause function pointer
+ * @param pause 1 for pause, 0 for resume
+ */
+int     avio_pause(AVIOContext *h, int pause);
+
+/**
+ * Seek to a given timestamp relative to some component stream.
+ * Only meaningful if using a network streaming protocol (e.g. MMS.).
+ *
+ * @param h IO context from which to call the seek function pointers
+ * @param stream_index The stream index that the timestamp is relative to.
+ *        If stream_index is (-1) the timestamp should be in AV_TIME_BASE
+ *        units from the beginning of the presentation.
+ *        If a stream_index >= 0 is used and the protocol does not support
+ *        seeking based on component streams, the call will fail with ENOTSUP.
+ * @param timestamp timestamp in AVStream.time_base units
+ *        or if there is no stream specified then in AV_TIME_BASE units.
+ * @param flags Optional combination of AVSEEK_FLAG_BACKWARD, AVSEEK_FLAG_BYTE
+ *        and AVSEEK_FLAG_ANY. The protocol may silently ignore
+ *        AVSEEK_FLAG_BACKWARD and AVSEEK_FLAG_ANY, but AVSEEK_FLAG_BYTE will
+ *        fail with ENOTSUP if used and not supported.
+ * @return >= 0 on success
+ * @see AVInputFormat::read_seek
+ */
+int64_t avio_seek_time(AVIOContext *h, int stream_index,
+                       int64_t timestamp, int flags);
+
+#endif /* AVFORMAT_AVIO_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavformat/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavformat/version.h
new file mode 100644
index 0000000..3d1e21f
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavformat/version.h
@@ -0,0 +1,55 @@
+/*
+ * Version macros.
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVFORMAT_VERSION_H
+#define AVFORMAT_VERSION_H
+
+/**
+ * @file
+ * @ingroup libavf
+ * Libavformat version macros
+ */
+
+#include "libavutil/version.h"
+
+#define LIBAVFORMAT_VERSION_MAJOR 55
+#define LIBAVFORMAT_VERSION_MINOR 12
+#define LIBAVFORMAT_VERSION_MICRO  0
+
+#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
+                                               LIBAVFORMAT_VERSION_MINOR, \
+                                               LIBAVFORMAT_VERSION_MICRO)
+#define LIBAVFORMAT_VERSION     AV_VERSION(LIBAVFORMAT_VERSION_MAJOR,   \
+                                           LIBAVFORMAT_VERSION_MINOR,   \
+                                           LIBAVFORMAT_VERSION_MICRO)
+#define LIBAVFORMAT_BUILD       LIBAVFORMAT_VERSION_INT
+
+#define LIBAVFORMAT_IDENT       "Lavf" AV_STRINGIFY(LIBAVFORMAT_VERSION)
+
+/**
+ * FF_API_* defines may be placed below to indicate public API that will be
+ * dropped at a future version bump. The defines themselves are not part of
+ * the public API and may change, break or disappear at any time.
+ */
+#ifndef FF_API_REFERENCE_DTS
+#define FF_API_REFERENCE_DTS            (LIBAVFORMAT_VERSION_MAJOR < 56)
+#endif
+
+#endif /* AVFORMAT_VERSION_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavresample/avresample.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavresample/avresample.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavresample/avresample.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavresample/avresample.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavresample/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavresample/version.h
new file mode 100644
index 0000000..fce5770
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavresample/version.h
@@ -0,0 +1,54 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVRESAMPLE_VERSION_H
+#define AVRESAMPLE_VERSION_H
+
+/**
+ * @file
+ * @ingroup lavr
+ * Libavresample version macros.
+ */
+
+#include "libavutil/version.h"
+
+#define LIBAVRESAMPLE_VERSION_MAJOR  1
+#define LIBAVRESAMPLE_VERSION_MINOR  1
+#define LIBAVRESAMPLE_VERSION_MICRO  0
+
+#define LIBAVRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBAVRESAMPLE_VERSION_MAJOR, \
+                                                  LIBAVRESAMPLE_VERSION_MINOR, \
+                                                  LIBAVRESAMPLE_VERSION_MICRO)
+#define LIBAVRESAMPLE_VERSION          AV_VERSION(LIBAVRESAMPLE_VERSION_MAJOR, \
+                                                  LIBAVRESAMPLE_VERSION_MINOR, \
+                                                  LIBAVRESAMPLE_VERSION_MICRO)
+#define LIBAVRESAMPLE_BUILD        LIBAVRESAMPLE_VERSION_INT
+
+#define LIBAVRESAMPLE_IDENT        "Lavr" AV_STRINGIFY(LIBAVRESAMPLE_VERSION)
+
+/**
+ * FF_API_* defines may be placed below to indicate public API that will be
+ * dropped at a future version bump. The defines themselves are not part of
+ * the public API and may change, break or disappear at any time.
+ */
+
+#ifndef FF_API_RESAMPLE_CLOSE_OPEN
+#define FF_API_RESAMPLE_CLOSE_OPEN (LIBAVRESAMPLE_VERSION_MAJOR < 2)
+#endif
+
+#endif /* AVRESAMPLE_VERSION_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/adler32.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/adler32.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/adler32.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/adler32.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/aes.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/aes.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/aes.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/aes.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/attributes.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/attributes.h
new file mode 100644
index 0000000..d7f2bb5
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/attributes.h
@@ -0,0 +1,126 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Macro definitions for various function/variable attributes
+ */
+
+#ifndef AVUTIL_ATTRIBUTES_H
+#define AVUTIL_ATTRIBUTES_H
+
+#ifdef __GNUC__
+#    define AV_GCC_VERSION_AT_LEAST(x,y) (__GNUC__ > x || __GNUC__ == x && __GNUC_MINOR__ >= y)
+#else
+#    define AV_GCC_VERSION_AT_LEAST(x,y) 0
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define av_always_inline __attribute__((always_inline)) inline
+#elif defined(_MSC_VER)
+#    define av_always_inline __forceinline
+#else
+#    define av_always_inline inline
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define av_noinline __attribute__((noinline))
+#elif defined(_MSC_VER)
+#    define av_noinline __declspec(noinline)
+#else
+#    define av_noinline
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define av_pure __attribute__((pure))
+#else
+#    define av_pure
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(2,6)
+#    define av_const __attribute__((const))
+#else
+#    define av_const
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(4,3)
+#    define av_cold __attribute__((cold))
+#else
+#    define av_cold
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(4,1) && !defined(__llvm__)
+#    define av_flatten __attribute__((flatten))
+#else
+#    define av_flatten
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define attribute_deprecated __attribute__((deprecated))
+#elif defined(_MSC_VER)
+#    define attribute_deprecated __declspec(deprecated)
+#else
+#    define attribute_deprecated
+#endif
+
+#if defined(__GNUC__)
+#    define av_unused __attribute__((unused))
+#else
+#    define av_unused
+#endif
+
+/**
+ * Mark a variable as used and prevent the compiler from optimizing it
+ * away.  This is useful for variables accessed only from inline
+ * assembler without the compiler being aware.
+ */
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+#    define av_used __attribute__((used))
+#else
+#    define av_used
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,3)
+#   define av_alias __attribute__((may_alias))
+#else
+#   define av_alias
+#endif
+
+#if defined(__GNUC__) && !defined(__ICC)
+#    define av_uninit(x) x=x
+#else
+#    define av_uninit(x) x
+#endif
+
+#ifdef __GNUC__
+#    define av_builtin_constant_p __builtin_constant_p
+#    define av_printf_format(fmtpos, attrpos) __attribute__((__format__(__printf__, fmtpos, attrpos)))
+#else
+#    define av_builtin_constant_p(x) 0
+#    define av_printf_format(fmtpos, attrpos)
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(2,5)
+#    define av_noreturn __attribute__((noreturn))
+#else
+#    define av_noreturn
+#endif
+
+#endif /* AVUTIL_ATTRIBUTES_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/audio_fifo.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/audio_fifo.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/audio_fifo.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/audio_fifo.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/audioconvert.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/audioconvert.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/audioconvert.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/audioconvert.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avassert.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/avassert.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avassert.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/avassert.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avconfig.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/avconfig.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avconfig.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/avconfig.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avstring.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/avstring.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/avstring.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/avstring.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/avutil.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/avutil.h
new file mode 100644
index 0000000..a0d35d1
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/avutil.h
@@ -0,0 +1,284 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_AVUTIL_H
+#define AVUTIL_AVUTIL_H
+
+/**
+ * @file
+ * external API header
+ */
+
+/**
+ * @mainpage
+ *
+ * @section libav_intro Introduction
+ *
+ * This document describes the usage of the different libraries
+ * provided by Libav.
+ *
+ * @li @ref libavc "libavcodec" encoding/decoding library
+ * @li @ref lavfi "libavfilter" graph-based frame editing library
+ * @li @ref libavf "libavformat" I/O and muxing/demuxing library
+ * @li @ref lavd "libavdevice" special devices muxing/demuxing library
+ * @li @ref lavu "libavutil" common utility library
+ * @li @ref lavr "libavresample" audio resampling, format conversion and mixing
+ * @li @ref libsws "libswscale"  color conversion and scaling library
+ *
+ * @section libav_versioning Versioning and compatibility
+ *
+ * Each of the Libav libraries contains a version.h header, which defines a
+ * major, minor and micro version number with the
+ * <em>LIBRARYNAME_VERSION_{MAJOR,MINOR,MICRO}</em> macros. The major version
+ * number is incremented with backward incompatible changes - e.g. removing
+ * parts of the public API, reordering public struct members, etc. The minor
+ * version number is incremented for backward compatible API changes or major
+ * new features - e.g. adding a new public function or a new decoder. The micro
+ * version number is incremented for smaller changes that a calling program
+ * might still want to check for - e.g. changing behavior in a previously
+ * unspecified situation.
+ *
+ * Libav guarantees backward API and ABI compatibility for each library as long
+ * as its major version number is unchanged. This means that no public symbols
+ * will be removed or renamed. Types and names of the public struct members and
+ * values of public macros and enums will remain the same (unless they were
+ * explicitly declared as not part of the public API). Documented behavior will
+ * not change.
+ *
+ * In other words, any correct program that works with a given Libav snapshot
+ * should work just as well without any changes with any later snapshot with the
+ * same major versions. This applies to both rebuilding the program against new
+ * Libav versions or to replacing the dynamic Libav libraries that a program
+ * links against.
+ *
+ * However, new public symbols may be added and new members may be appended to
+ * public structs whose size is not part of public ABI (most public structs in
+ * Libav). New macros and enum values may be added. Behavior in undocumented
+ * situations may change slightly (and be documented). All those are accompanied
+ * by an entry in doc/APIchanges and incrementing either the minor or micro
+ * version number.
+ */
+
+/**
+ * @defgroup lavu Common utility functions
+ *
+ * @brief
+ * libavutil contains the code shared across all the other Libav
+ * libraries
+ *
+ * @note In order to use the functions provided by avutil you must include
+ * the specific header.
+ *
+ * @{
+ *
+ * @defgroup lavu_crypto Crypto and Hashing
+ *
+ * @{
+ * @}
+ *
+ * @defgroup lavu_math Maths
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_string String Manipulation
+ *
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_mem Memory Management
+ *
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_data Data Structures
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_audio Audio related
+ *
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_error Error Codes
+ *
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_log Logging Facility
+ *
+ * @{
+ *
+ * @}
+ *
+ * @defgroup lavu_misc Other
+ *
+ * @{
+ *
+ * @defgroup lavu_internal Internal
+ *
+ * Not exported functions, for internal usage only
+ *
+ * @{
+ *
+ * @}
+ *
+ * @defgroup preproc_misc Preprocessor String Macros
+ *
+ * @{
+ *
+ * @}
+ */
+
+
+/**
+ * @addtogroup lavu_ver
+ * @{
+ */
+
+/**
+ * Return the LIBAVUTIL_VERSION_INT constant.
+ */
+unsigned avutil_version(void);
+
+/**
+ * Return the libavutil build-time configuration.
+ */
+const char *avutil_configuration(void);
+
+/**
+ * Return the libavutil license.
+ */
+const char *avutil_license(void);
+
+/**
+ * @}
+ */
+
+/**
+ * @addtogroup lavu_media Media Type
+ * @brief Media Type
+ */
+
+enum AVMediaType {
+    AVMEDIA_TYPE_UNKNOWN = -1,  ///< Usually treated as AVMEDIA_TYPE_DATA
+    AVMEDIA_TYPE_VIDEO,
+    AVMEDIA_TYPE_AUDIO,
+    AVMEDIA_TYPE_DATA,          ///< Opaque data information usually continuous
+    AVMEDIA_TYPE_SUBTITLE,
+    AVMEDIA_TYPE_ATTACHMENT,    ///< Opaque data information usually sparse
+    AVMEDIA_TYPE_NB
+};
+
+/**
+ * @defgroup lavu_const Constants
+ * @{
+ *
+ * @defgroup lavu_enc Encoding specific
+ *
+ * @note those definition should move to avcodec
+ * @{
+ */
+
+#define FF_LAMBDA_SHIFT 7
+#define FF_LAMBDA_SCALE (1<<FF_LAMBDA_SHIFT)
+#define FF_QP2LAMBDA 118 ///< factor to convert from H.263 QP to lambda
+#define FF_LAMBDA_MAX (256*128-1)
+
+#define FF_QUALITY_SCALE FF_LAMBDA_SCALE //FIXME maybe remove
+
+/**
+ * @}
+ * @defgroup lavu_time Timestamp specific
+ *
+ * Libav internal timebase and timestamp definitions
+ *
+ * @{
+ */
+
+/**
+ * @brief Undefined timestamp value
+ *
+ * Usually reported by demuxer that work on containers that do not provide
+ * either pts or dts.
+ */
+
+#define AV_NOPTS_VALUE          INT64_C(0x8000000000000000)
+
+/**
+ * Internal time base represented as integer
+ */
+
+#define AV_TIME_BASE            1000000
+
+/**
+ * Internal time base represented as fractional value
+ */
+
+#define AV_TIME_BASE_Q          (AVRational){1, AV_TIME_BASE}
+
+/**
+ * @}
+ * @}
+ * @defgroup lavu_picture Image related
+ *
+ * AVPicture types, pixel formats and basic image planes manipulation.
+ *
+ * @{
+ */
+
+enum AVPictureType {
+    AV_PICTURE_TYPE_I = 1, ///< Intra
+    AV_PICTURE_TYPE_P,     ///< Predicted
+    AV_PICTURE_TYPE_B,     ///< Bi-dir predicted
+    AV_PICTURE_TYPE_S,     ///< S(GMC)-VOP MPEG4
+    AV_PICTURE_TYPE_SI,    ///< Switching Intra
+    AV_PICTURE_TYPE_SP,    ///< Switching Predicted
+    AV_PICTURE_TYPE_BI,    ///< BI type
+};
+
+/**
+ * Return a single letter to describe the given picture type
+ * pict_type.
+ *
+ * @param[in] pict_type the picture type @return a single character
+ * representing the picture type, '?' if pict_type is unknown
+ */
+char av_get_picture_type_char(enum AVPictureType pict_type);
+
+/**
+ * @}
+ */
+
+#include "error.h"
+#include "version.h"
+#include "macros.h"
+
+/**
+ * @}
+ * @}
+ */
+
+#endif /* AVUTIL_AVUTIL_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/base64.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/base64.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/base64.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/base64.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/blowfish.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/blowfish.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/blowfish.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/blowfish.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/bswap.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/bswap.h
new file mode 100644
index 0000000..93a6016
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/bswap.h
@@ -0,0 +1,111 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * byte swapping routines
+ */
+
+#ifndef AVUTIL_BSWAP_H
+#define AVUTIL_BSWAP_H
+
+#include <stdint.h>
+#include "libavutil/avconfig.h"
+#include "attributes.h"
+
+#ifdef HAVE_AV_CONFIG_H
+
+#include "config.h"
+
+#if   ARCH_AARCH64
+#   include "aarch64/bswap.h"
+#elif ARCH_ARM
+#   include "arm/bswap.h"
+#elif ARCH_AVR32
+#   include "avr32/bswap.h"
+#elif ARCH_BFIN
+#   include "bfin/bswap.h"
+#elif ARCH_SH4
+#   include "sh4/bswap.h"
+#elif ARCH_X86
+#   include "x86/bswap.h"
+#endif
+
+#endif /* HAVE_AV_CONFIG_H */
+
+#define AV_BSWAP16C(x) (((x) << 8 & 0xff00)  | ((x) >> 8 & 0x00ff))
+#define AV_BSWAP32C(x) (AV_BSWAP16C(x) << 16 | AV_BSWAP16C((x) >> 16))
+#define AV_BSWAP64C(x) (AV_BSWAP32C(x) << 32 | AV_BSWAP32C((x) >> 32))
+
+#define AV_BSWAPC(s, x) AV_BSWAP##s##C(x)
+
+#ifndef av_bswap16
+static av_always_inline av_const uint16_t av_bswap16(uint16_t x)
+{
+    x= (x>>8) | (x<<8);
+    return x;
+}
+#endif
+
+#ifndef av_bswap32
+static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
+{
+    return AV_BSWAP32C(x);
+}
+#endif
+
+#ifndef av_bswap64
+static inline uint64_t av_const av_bswap64(uint64_t x)
+{
+    return (uint64_t)av_bswap32(x) << 32 | av_bswap32(x >> 32);
+}
+#endif
+
+// be2ne ... big-endian to native-endian
+// le2ne ... little-endian to native-endian
+
+#if AV_HAVE_BIGENDIAN
+#define av_be2ne16(x) (x)
+#define av_be2ne32(x) (x)
+#define av_be2ne64(x) (x)
+#define av_le2ne16(x) av_bswap16(x)
+#define av_le2ne32(x) av_bswap32(x)
+#define av_le2ne64(x) av_bswap64(x)
+#define AV_BE2NEC(s, x) (x)
+#define AV_LE2NEC(s, x) AV_BSWAPC(s, x)
+#else
+#define av_be2ne16(x) av_bswap16(x)
+#define av_be2ne32(x) av_bswap32(x)
+#define av_be2ne64(x) av_bswap64(x)
+#define av_le2ne16(x) (x)
+#define av_le2ne32(x) (x)
+#define av_le2ne64(x) (x)
+#define AV_BE2NEC(s, x) AV_BSWAPC(s, x)
+#define AV_LE2NEC(s, x) (x)
+#endif
+
+#define AV_BE2NE16C(x) AV_BE2NEC(16, x)
+#define AV_BE2NE32C(x) AV_BE2NEC(32, x)
+#define AV_BE2NE64C(x) AV_BE2NEC(64, x)
+#define AV_LE2NE16C(x) AV_LE2NEC(16, x)
+#define AV_LE2NE32C(x) AV_LE2NEC(32, x)
+#define AV_LE2NE64C(x) AV_LE2NEC(64, x)
+
+#endif /* AVUTIL_BSWAP_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/buffer.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/buffer.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/buffer.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/buffer.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/channel_layout.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/channel_layout.h
new file mode 100644
index 0000000..6a1f830
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/channel_layout.h
@@ -0,0 +1,186 @@
+/*
+ * Copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ * Copyright (c) 2008 Peter Ross
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_CHANNEL_LAYOUT_H
+#define AVUTIL_CHANNEL_LAYOUT_H
+
+#include <stdint.h>
+
+/**
+ * @file
+ * audio channel layout utility functions
+ */
+
+/**
+ * @addtogroup lavu_audio
+ * @{
+ */
+
+/**
+ * @defgroup channel_masks Audio channel masks
+ * @{
+ */
+#define AV_CH_FRONT_LEFT             0x00000001
+#define AV_CH_FRONT_RIGHT            0x00000002
+#define AV_CH_FRONT_CENTER           0x00000004
+#define AV_CH_LOW_FREQUENCY          0x00000008
+#define AV_CH_BACK_LEFT              0x00000010
+#define AV_CH_BACK_RIGHT             0x00000020
+#define AV_CH_FRONT_LEFT_OF_CENTER   0x00000040
+#define AV_CH_FRONT_RIGHT_OF_CENTER  0x00000080
+#define AV_CH_BACK_CENTER            0x00000100
+#define AV_CH_SIDE_LEFT              0x00000200
+#define AV_CH_SIDE_RIGHT             0x00000400
+#define AV_CH_TOP_CENTER             0x00000800
+#define AV_CH_TOP_FRONT_LEFT         0x00001000
+#define AV_CH_TOP_FRONT_CENTER       0x00002000
+#define AV_CH_TOP_FRONT_RIGHT        0x00004000
+#define AV_CH_TOP_BACK_LEFT          0x00008000
+#define AV_CH_TOP_BACK_CENTER        0x00010000
+#define AV_CH_TOP_BACK_RIGHT         0x00020000
+#define AV_CH_STEREO_LEFT            0x20000000  ///< Stereo downmix.
+#define AV_CH_STEREO_RIGHT           0x40000000  ///< See AV_CH_STEREO_LEFT.
+#define AV_CH_WIDE_LEFT              0x0000000080000000ULL
+#define AV_CH_WIDE_RIGHT             0x0000000100000000ULL
+#define AV_CH_SURROUND_DIRECT_LEFT   0x0000000200000000ULL
+#define AV_CH_SURROUND_DIRECT_RIGHT  0x0000000400000000ULL
+#define AV_CH_LOW_FREQUENCY_2        0x0000000800000000ULL
+
+/** Channel mask value used for AVCodecContext.request_channel_layout
+    to indicate that the user requests the channel order of the decoder output
+    to be the native codec channel order. */
+#define AV_CH_LAYOUT_NATIVE          0x8000000000000000ULL
+
+/**
+ * @}
+ * @defgroup channel_mask_c Audio channel convenience macros
+ * @{
+ * */
+#define AV_CH_LAYOUT_MONO              (AV_CH_FRONT_CENTER)
+#define AV_CH_LAYOUT_STEREO            (AV_CH_FRONT_LEFT|AV_CH_FRONT_RIGHT)
+#define AV_CH_LAYOUT_2POINT1           (AV_CH_LAYOUT_STEREO|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_2_1               (AV_CH_LAYOUT_STEREO|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_SURROUND          (AV_CH_LAYOUT_STEREO|AV_CH_FRONT_CENTER)
+#define AV_CH_LAYOUT_3POINT1           (AV_CH_LAYOUT_SURROUND|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_4POINT0           (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_4POINT1           (AV_CH_LAYOUT_4POINT0|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_2_2               (AV_CH_LAYOUT_STEREO|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
+#define AV_CH_LAYOUT_QUAD              (AV_CH_LAYOUT_STEREO|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_5POINT0           (AV_CH_LAYOUT_SURROUND|AV_CH_SIDE_LEFT|AV_CH_SIDE_RIGHT)
+#define AV_CH_LAYOUT_5POINT1           (AV_CH_LAYOUT_5POINT0|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_5POINT0_BACK      (AV_CH_LAYOUT_SURROUND|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_5POINT1_BACK      (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_6POINT0           (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_6POINT0_FRONT     (AV_CH_LAYOUT_2_2|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
+#define AV_CH_LAYOUT_HEXAGONAL         (AV_CH_LAYOUT_5POINT0_BACK|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_6POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_6POINT1_BACK      (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_BACK_CENTER)
+#define AV_CH_LAYOUT_6POINT1_FRONT     (AV_CH_LAYOUT_6POINT0_FRONT|AV_CH_LOW_FREQUENCY)
+#define AV_CH_LAYOUT_7POINT0           (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_7POINT0_FRONT     (AV_CH_LAYOUT_5POINT0|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
+#define AV_CH_LAYOUT_7POINT1           (AV_CH_LAYOUT_5POINT1|AV_CH_BACK_LEFT|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_7POINT1_WIDE      (AV_CH_LAYOUT_5POINT1|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
+#define AV_CH_LAYOUT_7POINT1_WIDE_BACK (AV_CH_LAYOUT_5POINT1_BACK|AV_CH_FRONT_LEFT_OF_CENTER|AV_CH_FRONT_RIGHT_OF_CENTER)
+#define AV_CH_LAYOUT_OCTAGONAL         (AV_CH_LAYOUT_5POINT0|AV_CH_BACK_LEFT|AV_CH_BACK_CENTER|AV_CH_BACK_RIGHT)
+#define AV_CH_LAYOUT_STEREO_DOWNMIX    (AV_CH_STEREO_LEFT|AV_CH_STEREO_RIGHT)
+
+enum AVMatrixEncoding {
+    AV_MATRIX_ENCODING_NONE,
+    AV_MATRIX_ENCODING_DOLBY,
+    AV_MATRIX_ENCODING_DPLII,
+    AV_MATRIX_ENCODING_DPLIIX,
+    AV_MATRIX_ENCODING_DPLIIZ,
+    AV_MATRIX_ENCODING_DOLBYEX,
+    AV_MATRIX_ENCODING_DOLBYHEADPHONE,
+    AV_MATRIX_ENCODING_NB
+};
+
+/**
+ * @}
+ */
+
+/**
+ * Return a channel layout id that matches name, or 0 if no match is found.
+ *
+ * name can be one or several of the following notations,
+ * separated by '+' or '|':
+ * - the name of an usual channel layout (mono, stereo, 4.0, quad, 5.0,
+ *   5.0(side), 5.1, 5.1(side), 7.1, 7.1(wide), downmix);
+ * - the name of a single channel (FL, FR, FC, LFE, BL, BR, FLC, FRC, BC,
+ *   SL, SR, TC, TFL, TFC, TFR, TBL, TBC, TBR, DL, DR);
+ * - a number of channels, in decimal, optionally followed by 'c', yielding
+ *   the default channel layout for that number of channels (@see
+ *   av_get_default_channel_layout);
+ * - a channel layout mask, in hexadecimal starting with "0x" (see the
+ *   AV_CH_* macros).
+ *
+ * Example: "stereo+FC" = "2+FC" = "2c+1c" = "0x7"
+ */
+uint64_t av_get_channel_layout(const char *name);
+
+/**
+ * Return a description of a channel layout.
+ * If nb_channels is <= 0, it is guessed from the channel_layout.
+ *
+ * @param buf put here the string containing the channel layout
+ * @param buf_size size in bytes of the buffer
+ */
+void av_get_channel_layout_string(char *buf, int buf_size, int nb_channels, uint64_t channel_layout);
+
+/**
+ * Return the number of channels in the channel layout.
+ */
+int av_get_channel_layout_nb_channels(uint64_t channel_layout);
+
+/**
+ * Return default channel layout for a given number of channels.
+ */
+uint64_t av_get_default_channel_layout(int nb_channels);
+
+/**
+ * Get the index of a channel in channel_layout.
+ *
+ * @param channel a channel layout describing exactly one channel which must be
+ *                present in channel_layout.
+ *
+ * @return index of channel in channel_layout on success, a negative AVERROR
+ *         on error.
+ */
+int av_get_channel_layout_channel_index(uint64_t channel_layout,
+                                        uint64_t channel);
+
+/**
+ * Get the channel with the given index in channel_layout.
+ */
+uint64_t av_channel_layout_extract_channel(uint64_t channel_layout, int index);
+
+/**
+ * Get the name of a given channel.
+ *
+ * @return channel name on success, NULL on error.
+ */
+const char *av_get_channel_name(uint64_t channel);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_CHANNEL_LAYOUT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/common.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/common.h
new file mode 100644
index 0000000..eb40e12
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/common.h
@@ -0,0 +1,406 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * common internal and external API header
+ */
+
+#ifndef AVUTIL_COMMON_H
+#define AVUTIL_COMMON_H
+
+#include <errno.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <math.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "attributes.h"
+#include "version.h"
+#include "libavutil/avconfig.h"
+
+#if AV_HAVE_BIGENDIAN
+#   define AV_NE(be, le) (be)
+#else
+#   define AV_NE(be, le) (le)
+#endif
+
+//rounded division & shift
+#define RSHIFT(a,b) ((a) > 0 ? ((a) + ((1<<(b))>>1))>>(b) : ((a) + ((1<<(b))>>1)-1)>>(b))
+/* assume b>0 */
+#define ROUNDED_DIV(a,b) (((a)>0 ? (a) + ((b)>>1) : (a) - ((b)>>1))/(b))
+#define FFABS(a) ((a) >= 0 ? (a) : (-(a)))
+#define FFSIGN(a) ((a) > 0 ? 1 : -1)
+
+#define FFMAX(a,b) ((a) > (b) ? (a) : (b))
+#define FFMAX3(a,b,c) FFMAX(FFMAX(a,b),c)
+#define FFMIN(a,b) ((a) > (b) ? (b) : (a))
+#define FFMIN3(a,b,c) FFMIN(FFMIN(a,b),c)
+
+#define FFSWAP(type,a,b) do{type SWAP_tmp= b; b= a; a= SWAP_tmp;}while(0)
+#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
+#define FFALIGN(x, a) (((x)+(a)-1)&~((a)-1))
+
+/* misc math functions */
+
+#if FF_API_AV_REVERSE
+extern attribute_deprecated const uint8_t av_reverse[256];
+#endif
+
+#ifdef HAVE_AV_CONFIG_H
+#   include "config.h"
+#   include "intmath.h"
+#endif
+
+/* Pull in unguarded fallback defines at the end of this file. */
+#include "common.h"
+
+#ifndef av_log2
+av_const int av_log2(unsigned v);
+#endif
+
+#ifndef av_log2_16bit
+av_const int av_log2_16bit(unsigned v);
+#endif
+
+/**
+ * Clip a signed integer value into the amin-amax range.
+ * @param a value to clip
+ * @param amin minimum value of the clip range
+ * @param amax maximum value of the clip range
+ * @return clipped value
+ */
+static av_always_inline av_const int av_clip_c(int a, int amin, int amax)
+{
+    if      (a < amin) return amin;
+    else if (a > amax) return amax;
+    else               return a;
+}
+
+/**
+ * Clip a signed integer value into the 0-255 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const uint8_t av_clip_uint8_c(int a)
+{
+    if (a&(~0xFF)) return (-a)>>31;
+    else           return a;
+}
+
+/**
+ * Clip a signed integer value into the -128,127 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const int8_t av_clip_int8_c(int a)
+{
+    if ((a+0x80) & ~0xFF) return (a>>31) ^ 0x7F;
+    else                  return a;
+}
+
+/**
+ * Clip a signed integer value into the 0-65535 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const uint16_t av_clip_uint16_c(int a)
+{
+    if (a&(~0xFFFF)) return (-a)>>31;
+    else             return a;
+}
+
+/**
+ * Clip a signed integer value into the -32768,32767 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const int16_t av_clip_int16_c(int a)
+{
+    if ((a+0x8000) & ~0xFFFF) return (a>>31) ^ 0x7FFF;
+    else                      return a;
+}
+
+/**
+ * Clip a signed 64-bit integer value into the -2147483648,2147483647 range.
+ * @param a value to clip
+ * @return clipped value
+ */
+static av_always_inline av_const int32_t av_clipl_int32_c(int64_t a)
+{
+    if ((a+0x80000000u) & ~UINT64_C(0xFFFFFFFF)) return (a>>63) ^ 0x7FFFFFFF;
+    else                                         return a;
+}
+
+/**
+ * Clip a signed integer to an unsigned power of two range.
+ * @param  a value to clip
+ * @param  p bit position to clip at
+ * @return clipped value
+ */
+static av_always_inline av_const unsigned av_clip_uintp2_c(int a, int p)
+{
+    if (a & ~((1<<p) - 1)) return -a >> 31 & ((1<<p) - 1);
+    else                   return  a;
+}
+
+/**
+ * Add two signed 32-bit values with saturation.
+ *
+ * @param  a one value
+ * @param  b another value
+ * @return sum with signed saturation
+ */
+static av_always_inline int av_sat_add32_c(int a, int b)
+{
+    return av_clipl_int32((int64_t)a + b);
+}
+
+/**
+ * Add a doubled value to another value with saturation at both stages.
+ *
+ * @param  a first value
+ * @param  b value doubled and added to a
+ * @return sum with signed saturation
+ */
+static av_always_inline int av_sat_dadd32_c(int a, int b)
+{
+    return av_sat_add32(a, av_sat_add32(b, b));
+}
+
+/**
+ * Clip a float value into the amin-amax range.
+ * @param a value to clip
+ * @param amin minimum value of the clip range
+ * @param amax maximum value of the clip range
+ * @return clipped value
+ */
+static av_always_inline av_const float av_clipf_c(float a, float amin, float amax)
+{
+    if      (a < amin) return amin;
+    else if (a > amax) return amax;
+    else               return a;
+}
+
+/** Compute ceil(log2(x)).
+ * @param x value used to compute ceil(log2(x))
+ * @return computed ceiling of log2(x)
+ */
+static av_always_inline av_const int av_ceil_log2_c(int x)
+{
+    return av_log2((x - 1) << 1);
+}
+
+/**
+ * Count number of bits set to one in x
+ * @param x value to count bits of
+ * @return the number of bits set to one in x
+ */
+static av_always_inline av_const int av_popcount_c(uint32_t x)
+{
+    x -= (x >> 1) & 0x55555555;
+    x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
+    x = (x + (x >> 4)) & 0x0F0F0F0F;
+    x += x >> 8;
+    return (x + (x >> 16)) & 0x3F;
+}
+
+/**
+ * Count number of bits set to one in x
+ * @param x value to count bits of
+ * @return the number of bits set to one in x
+ */
+static av_always_inline av_const int av_popcount64_c(uint64_t x)
+{
+    return av_popcount(x) + av_popcount(x >> 32);
+}
+
+#define MKTAG(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((unsigned)(d) << 24))
+#define MKBETAG(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((unsigned)(a) << 24))
+
+/**
+ * Convert a UTF-8 character (up to 4 bytes) to its 32-bit UCS-4 encoded form.
+ *
+ * @param val      Output value, must be an lvalue of type uint32_t.
+ * @param GET_BYTE Expression reading one byte from the input.
+ *                 Evaluated up to 7 times (4 for the currently
+ *                 assigned Unicode range).  With a memory buffer
+ *                 input, this could be *ptr++.
+ * @param ERROR    Expression to be evaluated on invalid input,
+ *                 typically a goto statement.
+ */
+#define GET_UTF8(val, GET_BYTE, ERROR)\
+    val= GET_BYTE;\
+    {\
+        uint32_t top = (val & 128) >> 1;\
+        if ((val & 0xc0) == 0x80)\
+            ERROR\
+        while (val & top) {\
+            int tmp= GET_BYTE - 128;\
+            if(tmp>>6)\
+                ERROR\
+            val= (val<<6) + tmp;\
+            top <<= 5;\
+        }\
+        val &= (top << 1) - 1;\
+    }
+
+/**
+ * Convert a UTF-16 character (2 or 4 bytes) to its 32-bit UCS-4 encoded form.
+ *
+ * @param val       Output value, must be an lvalue of type uint32_t.
+ * @param GET_16BIT Expression returning two bytes of UTF-16 data converted
+ *                  to native byte order.  Evaluated one or two times.
+ * @param ERROR     Expression to be evaluated on invalid input,
+ *                  typically a goto statement.
+ */
+#define GET_UTF16(val, GET_16BIT, ERROR)\
+    val = GET_16BIT;\
+    {\
+        unsigned int hi = val - 0xD800;\
+        if (hi < 0x800) {\
+            val = GET_16BIT - 0xDC00;\
+            if (val > 0x3FFU || hi > 0x3FFU)\
+                ERROR\
+            val += (hi<<10) + 0x10000;\
+        }\
+    }\
+
+/**
+ * @def PUT_UTF8(val, tmp, PUT_BYTE)
+ * Convert a 32-bit Unicode character to its UTF-8 encoded form (up to 4 bytes long).
+ * @param val is an input-only argument and should be of type uint32_t. It holds
+ * a UCS-4 encoded Unicode character that is to be converted to UTF-8. If
+ * val is given as a function it is executed only once.
+ * @param tmp is a temporary variable and should be of type uint8_t. It
+ * represents an intermediate value during conversion that is to be
+ * output by PUT_BYTE.
+ * @param PUT_BYTE writes the converted UTF-8 bytes to any proper destination.
+ * It could be a function or a statement, and uses tmp as the input byte.
+ * For example, PUT_BYTE could be "*output++ = tmp;" PUT_BYTE will be
+ * executed up to 4 times for values in the valid UTF-8 range and up to
+ * 7 times in the general case, depending on the length of the converted
+ * Unicode character.
+ */
+#define PUT_UTF8(val, tmp, PUT_BYTE)\
+    {\
+        int bytes, shift;\
+        uint32_t in = val;\
+        if (in < 0x80) {\
+            tmp = in;\
+            PUT_BYTE\
+        } else {\
+            bytes = (av_log2(in) + 4) / 5;\
+            shift = (bytes - 1) * 6;\
+            tmp = (256 - (256 >> bytes)) | (in >> shift);\
+            PUT_BYTE\
+            while (shift >= 6) {\
+                shift -= 6;\
+                tmp = 0x80 | ((in >> shift) & 0x3f);\
+                PUT_BYTE\
+            }\
+        }\
+    }
+
+/**
+ * @def PUT_UTF16(val, tmp, PUT_16BIT)
+ * Convert a 32-bit Unicode character to its UTF-16 encoded form (2 or 4 bytes).
+ * @param val is an input-only argument and should be of type uint32_t. It holds
+ * a UCS-4 encoded Unicode character that is to be converted to UTF-16. If
+ * val is given as a function it is executed only once.
+ * @param tmp is a temporary variable and should be of type uint16_t. It
+ * represents an intermediate value during conversion that is to be
+ * output by PUT_16BIT.
+ * @param PUT_16BIT writes the converted UTF-16 data to any proper destination
+ * in desired endianness. It could be a function or a statement, and uses tmp
+ * as the input byte.  For example, PUT_BYTE could be "*output++ = tmp;"
+ * PUT_BYTE will be executed 1 or 2 times depending on input character.
+ */
+#define PUT_UTF16(val, tmp, PUT_16BIT)\
+    {\
+        uint32_t in = val;\
+        if (in < 0x10000) {\
+            tmp = in;\
+            PUT_16BIT\
+        } else {\
+            tmp = 0xD800 | ((in - 0x10000) >> 10);\
+            PUT_16BIT\
+            tmp = 0xDC00 | ((in - 0x10000) & 0x3FF);\
+            PUT_16BIT\
+        }\
+    }\
+
+
+
+#include "mem.h"
+
+#ifdef HAVE_AV_CONFIG_H
+#    include "internal.h"
+#endif /* HAVE_AV_CONFIG_H */
+
+#endif /* AVUTIL_COMMON_H */
+
+/*
+ * The following definitions are outside the multiple inclusion guard
+ * to ensure they are immediately available in intmath.h.
+ */
+
+#ifndef av_ceil_log2
+#   define av_ceil_log2     av_ceil_log2_c
+#endif
+#ifndef av_clip
+#   define av_clip          av_clip_c
+#endif
+#ifndef av_clip_uint8
+#   define av_clip_uint8    av_clip_uint8_c
+#endif
+#ifndef av_clip_int8
+#   define av_clip_int8     av_clip_int8_c
+#endif
+#ifndef av_clip_uint16
+#   define av_clip_uint16   av_clip_uint16_c
+#endif
+#ifndef av_clip_int16
+#   define av_clip_int16    av_clip_int16_c
+#endif
+#ifndef av_clipl_int32
+#   define av_clipl_int32   av_clipl_int32_c
+#endif
+#ifndef av_clip_uintp2
+#   define av_clip_uintp2   av_clip_uintp2_c
+#endif
+#ifndef av_sat_add32
+#   define av_sat_add32     av_sat_add32_c
+#endif
+#ifndef av_sat_dadd32
+#   define av_sat_dadd32    av_sat_dadd32_c
+#endif
+#ifndef av_clipf
+#   define av_clipf         av_clipf_c
+#endif
+#ifndef av_popcount
+#   define av_popcount      av_popcount_c
+#endif
+#ifndef av_popcount64
+#   define av_popcount64    av_popcount64_c
+#endif
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/cpu.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/cpu.h
new file mode 100644
index 0000000..29036e3
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/cpu.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2000, 2001, 2002 Fabrice Bellard
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_CPU_H
+#define AVUTIL_CPU_H
+
+#include "version.h"
+
+#define AV_CPU_FLAG_FORCE    0x80000000 /* force usage of selected flags (OR) */
+
+    /* lower 16 bits - CPU features */
+#define AV_CPU_FLAG_MMX          0x0001 ///< standard MMX
+#define AV_CPU_FLAG_MMXEXT       0x0002 ///< SSE integer functions or AMD MMX ext
+#if FF_API_CPU_FLAG_MMX2
+#define AV_CPU_FLAG_MMX2         0x0002 ///< SSE integer functions or AMD MMX ext
+#endif
+#define AV_CPU_FLAG_3DNOW        0x0004 ///< AMD 3DNOW
+#define AV_CPU_FLAG_SSE          0x0008 ///< SSE functions
+#define AV_CPU_FLAG_SSE2         0x0010 ///< PIV SSE2 functions
+#define AV_CPU_FLAG_SSE2SLOW 0x40000000 ///< SSE2 supported, but usually not faster
+                                        ///< than regular MMX/SSE (e.g. Core1)
+#define AV_CPU_FLAG_3DNOWEXT     0x0020 ///< AMD 3DNowExt
+#define AV_CPU_FLAG_SSE3         0x0040 ///< Prescott SSE3 functions
+#define AV_CPU_FLAG_SSE3SLOW 0x20000000 ///< SSE3 supported, but usually not faster
+                                        ///< than regular MMX/SSE (e.g. Core1)
+#define AV_CPU_FLAG_SSSE3        0x0080 ///< Conroe SSSE3 functions
+#define AV_CPU_FLAG_ATOM     0x10000000 ///< Atom processor, some SSSE3 instructions are slower
+#define AV_CPU_FLAG_SSE4         0x0100 ///< Penryn SSE4.1 functions
+#define AV_CPU_FLAG_SSE42        0x0200 ///< Nehalem SSE4.2 functions
+#define AV_CPU_FLAG_AVX          0x4000 ///< AVX functions: requires OS support even if YMM registers aren't used
+#define AV_CPU_FLAG_XOP          0x0400 ///< Bulldozer XOP functions
+#define AV_CPU_FLAG_FMA4         0x0800 ///< Bulldozer FMA4 functions
+#define AV_CPU_FLAG_CMOV         0x1000 ///< i686 cmov
+#define AV_CPU_FLAG_AVX2         0x8000 ///< AVX2 functions: requires OS support even if YMM registers aren't used
+
+#define AV_CPU_FLAG_ALTIVEC      0x0001 ///< standard
+
+#define AV_CPU_FLAG_ARMV5TE      (1 << 0)
+#define AV_CPU_FLAG_ARMV6        (1 << 1)
+#define AV_CPU_FLAG_ARMV6T2      (1 << 2)
+#define AV_CPU_FLAG_VFP          (1 << 3)
+#define AV_CPU_FLAG_VFPV3        (1 << 4)
+#define AV_CPU_FLAG_NEON         (1 << 5)
+
+/**
+ * Return the flags which specify extensions supported by the CPU.
+ */
+int av_get_cpu_flags(void);
+
+/**
+ * Set a mask on flags returned by av_get_cpu_flags().
+ * This function is mainly useful for testing.
+ *
+ * @warning this function is not thread safe.
+ */
+void av_set_cpu_flags_mask(int mask);
+
+/**
+ * Parse CPU flags from a string.
+ *
+ * @return a combination of AV_CPU_* flags, negative on error.
+ */
+int av_parse_cpu_flags(const char *s);
+
+/**
+ * @return the number of logical CPU cores present.
+ */
+int av_cpu_count(void);
+
+#endif /* AVUTIL_CPU_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/crc.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/crc.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/crc.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/crc.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/dict.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/dict.h
new file mode 100644
index 0000000..e0a91ae
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/dict.h
@@ -0,0 +1,146 @@
+/*
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * Public dictionary API.
+ */
+
+#ifndef AVUTIL_DICT_H
+#define AVUTIL_DICT_H
+
+/**
+ * @addtogroup lavu_dict AVDictionary
+ * @ingroup lavu_data
+ *
+ * @brief Simple key:value store
+ *
+ * @{
+ * Dictionaries are used for storing key:value pairs. To create
+ * an AVDictionary, simply pass an address of a NULL pointer to
+ * av_dict_set(). NULL can be used as an empty dictionary wherever
+ * a pointer to an AVDictionary is required.
+ * Use av_dict_get() to retrieve an entry or iterate over all
+ * entries and finally av_dict_free() to free the dictionary
+ * and all its contents.
+ *
+ @code
+   AVDictionary *d = NULL;           // "create" an empty dictionary
+   AVDictionaryEntry *t = NULL;
+
+   av_dict_set(&d, "foo", "bar", 0); // add an entry
+
+   char *k = av_strdup("key");       // if your strings are already allocated,
+   char *v = av_strdup("value");     // you can avoid copying them like this
+   av_dict_set(&d, k, v, AV_DICT_DONT_STRDUP_KEY | AV_DICT_DONT_STRDUP_VAL);
+
+   while (t = av_dict_get(d, "", t, AV_DICT_IGNORE_SUFFIX)) {
+       <....>                             // iterate over all entries in d
+   }
+   av_dict_free(&d);
+ @endcode
+ *
+ */
+
+#define AV_DICT_MATCH_CASE      1
+#define AV_DICT_IGNORE_SUFFIX   2
+#define AV_DICT_DONT_STRDUP_KEY 4   /**< Take ownership of a key that's been
+                                         allocated with av_malloc() and children. */
+#define AV_DICT_DONT_STRDUP_VAL 8   /**< Take ownership of a value that's been
+                                         allocated with av_malloc() and chilren. */
+#define AV_DICT_DONT_OVERWRITE 16   ///< Don't overwrite existing entries.
+#define AV_DICT_APPEND         32   /**< If the entry already exists, append to it.  Note that no
+                                      delimiter is added, the strings are simply concatenated. */
+
+typedef struct AVDictionaryEntry {
+    char *key;
+    char *value;
+} AVDictionaryEntry;
+
+typedef struct AVDictionary AVDictionary;
+
+/**
+ * Get a dictionary entry with matching key.
+ *
+ * @param prev Set to the previous matching element to find the next.
+ *             If set to NULL the first matching element is returned.
+ * @param flags Allows case as well as suffix-insensitive comparisons.
+ * @return Found entry or NULL, changing key or value leads to undefined behavior.
+ */
+AVDictionaryEntry *
+av_dict_get(AVDictionary *m, const char *key, const AVDictionaryEntry *prev, int flags);
+
+/**
+ * Get number of entries in dictionary.
+ *
+ * @param m dictionary
+ * @return  number of entries in dictionary
+ */
+int av_dict_count(const AVDictionary *m);
+
+/**
+ * Set the given entry in *pm, overwriting an existing entry.
+ *
+ * @param pm pointer to a pointer to a dictionary struct. If *pm is NULL
+ * a dictionary struct is allocated and put in *pm.
+ * @param key entry key to add to *pm (will be av_strduped depending on flags)
+ * @param value entry value to add to *pm (will be av_strduped depending on flags).
+ *        Passing a NULL value will cause an existing entry to be deleted.
+ * @return >= 0 on success otherwise an error code <0
+ */
+int av_dict_set(AVDictionary **pm, const char *key, const char *value, int flags);
+
+/**
+ * Parse the key/value pairs list and add to a dictionary.
+ *
+ * @param key_val_sep  a 0-terminated list of characters used to separate
+ *                     key from value
+ * @param pairs_sep    a 0-terminated list of characters used to separate
+ *                     two pairs from each other
+ * @param flags        flags to use when adding to dictionary.
+ *                     AV_DICT_DONT_STRDUP_KEY and AV_DICT_DONT_STRDUP_VAL
+ *                     are ignored since the key/value tokens will always
+ *                     be duplicated.
+ * @return             0 on success, negative AVERROR code on failure
+ */
+int av_dict_parse_string(AVDictionary **pm, const char *str,
+                         const char *key_val_sep, const char *pairs_sep,
+                         int flags);
+
+/**
+ * Copy entries from one AVDictionary struct into another.
+ * @param dst pointer to a pointer to a AVDictionary struct. If *dst is NULL,
+ *            this function will allocate a struct for you and put it in *dst
+ * @param src pointer to source AVDictionary struct
+ * @param flags flags to use when setting entries in *dst
+ * @note metadata is read using the AV_DICT_IGNORE_SUFFIX flag
+ */
+void av_dict_copy(AVDictionary **dst, AVDictionary *src, int flags);
+
+/**
+ * Free all the memory allocated for an AVDictionary struct
+ * and all keys and values.
+ */
+void av_dict_free(AVDictionary **m);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_DICT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/downmix_info.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/downmix_info.h
new file mode 100644
index 0000000..69969f6
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/downmix_info.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2014 Tim Walker <tdskywalker at gmail.com>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_DOWNMIX_INFO_H
+#define AVUTIL_DOWNMIX_INFO_H
+
+#include "frame.h"
+
+/**
+ * @file
+ * audio downmix medatata
+ */
+
+/**
+ * @addtogroup lavu_audio
+ * @{
+ */
+
+/**
+ * @defgroup downmix_info Audio downmix metadata
+ * @{
+ */
+
+/**
+ * Possible downmix types.
+ */
+enum AVDownmixType {
+    AV_DOWNMIX_TYPE_UNKNOWN, /**< Not indicated. */
+    AV_DOWNMIX_TYPE_LORO,    /**< Lo/Ro 2-channel downmix (Stereo). */
+    AV_DOWNMIX_TYPE_LTRT,    /**< Lt/Rt 2-channel downmix, Dolby Surround compatible. */
+    AV_DOWNMIX_TYPE_DPLII,   /**< Lt/Rt 2-channel downmix, Dolby Pro Logic II compatible. */
+    AV_DOWNMIX_TYPE_NB       /**< Number of downmix types. Not part of ABI. */
+};
+
+/**
+ * This structure describes optional metadata relevant to a downmix procedure.
+ *
+ * All fields are set by the decoder to the value indicated in the audio
+ * bitstream (if present), or to a "sane" default otherwise.
+ */
+typedef struct AVDownmixInfo {
+    /**
+     * Type of downmix preferred by the mastering engineer.
+     */
+    enum AVDownmixType preferred_downmix_type;
+
+    /**
+     * Absolute scale factor representing the nominal level of the center
+     * channel during a regular downmix.
+     */
+    double center_mix_level;
+
+    /**
+     * Absolute scale factor representing the nominal level of the center
+     * channel during an Lt/Rt compatible downmix.
+     */
+    double center_mix_level_ltrt;
+
+    /**
+     * Absolute scale factor representing the nominal level of the surround
+     * channels during a regular downmix.
+     */
+    double surround_mix_level;
+
+    /**
+     * Absolute scale factor representing the nominal level of the surround
+     * channels during an Lt/Rt compatible downmix.
+     */
+    double surround_mix_level_ltrt;
+
+    /**
+     * Absolute scale factor representing the level at which the LFE data is
+     * mixed into L/R channels during downmixing.
+     */
+    double lfe_mix_level;
+} AVDownmixInfo;
+
+/**
+ * Get a frame's AV_FRAME_DATA_DOWNMIX_INFO side data for editing.
+ *
+ * The side data is created and added to the frame if it's absent.
+ *
+ * @param frame the frame for which the side data is to be obtained.
+ *
+ * @return the AVDownmixInfo structure to be edited by the caller.
+ */
+AVDownmixInfo *av_downmix_info_update_side_data(AVFrame *frame);
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_DOWNMIX_INFO_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/error.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/error.h
new file mode 100644
index 0000000..268a032
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/error.h
@@ -0,0 +1,82 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * error code definitions
+ */
+
+#ifndef AVUTIL_ERROR_H
+#define AVUTIL_ERROR_H
+
+#include <errno.h>
+#include <stddef.h>
+
+/**
+ * @addtogroup lavu_error
+ *
+ * @{
+ */
+
+
+/* error handling */
+#if EDOM > 0
+#define AVERROR(e) (-(e))   ///< Returns a negative error code from a POSIX error code, to return from library functions.
+#define AVUNERROR(e) (-(e)) ///< Returns a POSIX error code from a library function error return value.
+#else
+/* Some platforms have E* and errno already negated. */
+#define AVERROR(e) (e)
+#define AVUNERROR(e) (e)
+#endif
+
+#define AVERROR_BSF_NOT_FOUND      (-0x39acbd08) ///< Bitstream filter not found
+#define AVERROR_DECODER_NOT_FOUND  (-0x3cbabb08) ///< Decoder not found
+#define AVERROR_DEMUXER_NOT_FOUND  (-0x32babb08) ///< Demuxer not found
+#define AVERROR_ENCODER_NOT_FOUND  (-0x3cb1ba08) ///< Encoder not found
+#define AVERROR_EOF                (-0x5fb9b0bb) ///< End of file
+#define AVERROR_EXIT               (-0x2bb6a7bb) ///< Immediate exit was requested; the called function should not be restarted
+#define AVERROR_FILTER_NOT_FOUND   (-0x33b6b908) ///< Filter not found
+#define AVERROR_INVALIDDATA        (-0x3ebbb1b7) ///< Invalid data found when processing input
+#define AVERROR_MUXER_NOT_FOUND    (-0x27aab208) ///< Muxer not found
+#define AVERROR_OPTION_NOT_FOUND   (-0x2bafb008) ///< Option not found
+#define AVERROR_PATCHWELCOME       (-0x3aa8beb0) ///< Not yet implemented in Libav, patches welcome
+#define AVERROR_PROTOCOL_NOT_FOUND (-0x30adaf08) ///< Protocol not found
+#define AVERROR_STREAM_NOT_FOUND   (-0x2dabac08) ///< Stream not found
+#define AVERROR_BUG                (-0x5fb8aabe) ///< Bug detected, please report the issue
+#define AVERROR_UNKNOWN            (-0x31b4b1ab) ///< Unknown error, typically from an external library
+#define AVERROR_EXPERIMENTAL       (-0x2bb2afa8) ///< Requested feature is flagged experimental. Set strict_std_compliance if you really want to use it.
+
+/**
+ * Put a description of the AVERROR code errnum in errbuf.
+ * In case of failure the global variable errno is set to indicate the
+ * error. Even in case of failure av_strerror() will print a generic
+ * error message indicating the errnum provided to errbuf.
+ *
+ * @param errnum      error code to describe
+ * @param errbuf      buffer to which description is written
+ * @param errbuf_size the size in bytes of errbuf
+ * @return 0 on success, a negative value if a description for errnum
+ * cannot be found
+ */
+int av_strerror(int errnum, char *errbuf, size_t errbuf_size);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_ERROR_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/eval.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/eval.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/eval.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/eval.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/fifo.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/fifo.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/fifo.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/fifo.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/file.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/file.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/file.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/file.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/frame.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/frame.h
new file mode 100644
index 0000000..63ed219
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/frame.h
@@ -0,0 +1,552 @@
+/*
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * @ingroup lavu_frame
+ * reference-counted frame API
+ */
+
+#ifndef AVUTIL_FRAME_H
+#define AVUTIL_FRAME_H
+
+#include <stdint.h>
+
+#include "avutil.h"
+#include "buffer.h"
+#include "dict.h"
+#include "rational.h"
+#include "samplefmt.h"
+#include "version.h"
+
+
+/**
+ * @defgroup lavu_frame AVFrame
+ * @ingroup lavu_data
+ *
+ * @{
+ * AVFrame is an abstraction for reference-counted raw multimedia data.
+ */
+
+enum AVFrameSideDataType {
+    /**
+     * The data is the AVPanScan struct defined in libavcodec.
+     */
+    AV_FRAME_DATA_PANSCAN,
+    /**
+     * ATSC A53 Part 4 Closed Captions.
+     * A53 CC bitstream is stored as uint8_t in AVFrameSideData.data.
+     * The number of bytes of CC data is AVFrameSideData.size.
+     */
+    AV_FRAME_DATA_A53_CC,
+    /**
+     * Stereoscopic 3d metadata.
+     * The data is the AVStereo3D struct defined in libavutil/stereo3d.h.
+     */
+    AV_FRAME_DATA_STEREO3D,
+    /**
+     * The data is the AVMatrixEncoding enum defined in libavutil/channel_layout.h.
+     */
+    AV_FRAME_DATA_MATRIXENCODING,
+    /**
+     * Metadata relevant to a downmix procedure.
+     * The data is the AVDownmixInfo struct defined in libavutil/downmix_info.h.
+     */
+    AV_FRAME_DATA_DOWNMIX_INFO,
+};
+
+typedef struct AVFrameSideData {
+    enum AVFrameSideDataType type;
+    uint8_t *data;
+    int      size;
+    AVDictionary *metadata;
+} AVFrameSideData;
+
+/**
+ * This structure describes decoded (raw) audio or video data.
+ *
+ * AVFrame must be allocated using av_frame_alloc(). Note that this only
+ * allocates the AVFrame itself, the buffers for the data must be managed
+ * through other means (see below).
+ * AVFrame must be freed with av_frame_free().
+ *
+ * AVFrame is typically allocated once and then reused multiple times to hold
+ * different data (e.g. a single AVFrame to hold frames received from a
+ * decoder). In such a case, av_frame_unref() will free any references held by
+ * the frame and reset it to its original clean state before it
+ * is reused again.
+ *
+ * The data described by an AVFrame is usually reference counted through the
+ * AVBuffer API. The underlying buffer references are stored in AVFrame.buf /
+ * AVFrame.extended_buf. An AVFrame is considered to be reference counted if at
+ * least one reference is set, i.e. if AVFrame.buf[0] != NULL. In such a case,
+ * every single data plane must be contained in one of the buffers in
+ * AVFrame.buf or AVFrame.extended_buf.
+ * There may be a single buffer for all the data, or one separate buffer for
+ * each plane, or anything in between.
+ *
+ * sizeof(AVFrame) is not a part of the public ABI, so new fields may be added
+ * to the end with a minor bump.
+ */
+typedef struct AVFrame {
+#define AV_NUM_DATA_POINTERS 8
+    /**
+     * pointer to the picture/channel planes.
+     * This might be different from the first allocated byte
+     */
+    uint8_t *data[AV_NUM_DATA_POINTERS];
+
+    /**
+     * For video, size in bytes of each picture line.
+     * For audio, size in bytes of each plane.
+     *
+     * For audio, only linesize[0] may be set. For planar audio, each channel
+     * plane must be the same size.
+     *
+     * @note The linesize may be larger than the size of usable data -- there
+     * may be extra padding present for performance reasons.
+     */
+    int linesize[AV_NUM_DATA_POINTERS];
+
+    /**
+     * pointers to the data planes/channels.
+     *
+     * For video, this should simply point to data[].
+     *
+     * For planar audio, each channel has a separate data pointer, and
+     * linesize[0] contains the size of each channel buffer.
+     * For packed audio, there is just one data pointer, and linesize[0]
+     * contains the total size of the buffer for all channels.
+     *
+     * Note: Both data and extended_data should always be set in a valid frame,
+     * but for planar audio with more channels that can fit in data,
+     * extended_data must be used in order to access all channels.
+     */
+    uint8_t **extended_data;
+
+    /**
+     * width and height of the video frame
+     */
+    int width, height;
+
+    /**
+     * number of audio samples (per channel) described by this frame
+     */
+    int nb_samples;
+
+    /**
+     * format of the frame, -1 if unknown or unset
+     * Values correspond to enum AVPixelFormat for video frames,
+     * enum AVSampleFormat for audio)
+     */
+    int format;
+
+    /**
+     * 1 -> keyframe, 0-> not
+     */
+    int key_frame;
+
+    /**
+     * Picture type of the frame.
+     */
+    enum AVPictureType pict_type;
+
+#if FF_API_AVFRAME_LAVC
+    attribute_deprecated
+    uint8_t *base[AV_NUM_DATA_POINTERS];
+#endif
+
+    /**
+     * Sample aspect ratio for the video frame, 0/1 if unknown/unspecified.
+     */
+    AVRational sample_aspect_ratio;
+
+    /**
+     * Presentation timestamp in time_base units (time when frame should be shown to user).
+     */
+    int64_t pts;
+
+    /**
+     * PTS copied from the AVPacket that was decoded to produce this frame.
+     */
+    int64_t pkt_pts;
+
+    /**
+     * DTS copied from the AVPacket that triggered returning this frame.
+     */
+    int64_t pkt_dts;
+
+    /**
+     * picture number in bitstream order
+     */
+    int coded_picture_number;
+    /**
+     * picture number in display order
+     */
+    int display_picture_number;
+
+    /**
+     * quality (between 1 (good) and FF_LAMBDA_MAX (bad))
+     */
+    int quality;
+
+#if FF_API_AVFRAME_LAVC
+    attribute_deprecated
+    int reference;
+
+    /**
+     * QP table
+     */
+    attribute_deprecated
+    int8_t *qscale_table;
+    /**
+     * QP store stride
+     */
+    attribute_deprecated
+    int qstride;
+
+    attribute_deprecated
+    int qscale_type;
+
+    /**
+     * mbskip_table[mb]>=1 if MB didn't change
+     * stride= mb_width = (width+15)>>4
+     */
+    attribute_deprecated
+    uint8_t *mbskip_table;
+
+    /**
+     * motion vector table
+     * @code
+     * example:
+     * int mv_sample_log2= 4 - motion_subsample_log2;
+     * int mb_width= (width+15)>>4;
+     * int mv_stride= (mb_width << mv_sample_log2) + 1;
+     * motion_val[direction][x + y*mv_stride][0->mv_x, 1->mv_y];
+     * @endcode
+     */
+    attribute_deprecated
+    int16_t (*motion_val[2])[2];
+
+    /**
+     * macroblock type table
+     * mb_type_base + mb_width + 2
+     */
+    attribute_deprecated
+    uint32_t *mb_type;
+
+    /**
+     * DCT coefficients
+     */
+    attribute_deprecated
+    short *dct_coeff;
+
+    /**
+     * motion reference frame index
+     * the order in which these are stored can depend on the codec.
+     */
+    attribute_deprecated
+    int8_t *ref_index[2];
+#endif
+
+    /**
+     * for some private data of the user
+     */
+    void *opaque;
+
+    /**
+     * error
+     */
+    uint64_t error[AV_NUM_DATA_POINTERS];
+
+#if FF_API_AVFRAME_LAVC
+    attribute_deprecated
+    int type;
+#endif
+
+    /**
+     * When decoding, this signals how much the picture must be delayed.
+     * extra_delay = repeat_pict / (2*fps)
+     */
+    int repeat_pict;
+
+    /**
+     * The content of the picture is interlaced.
+     */
+    int interlaced_frame;
+
+    /**
+     * If the content is interlaced, is top field displayed first.
+     */
+    int top_field_first;
+
+    /**
+     * Tell user application that palette has changed from previous frame.
+     */
+    int palette_has_changed;
+
+#if FF_API_AVFRAME_LAVC
+    attribute_deprecated
+    int buffer_hints;
+
+    /**
+     * Pan scan.
+     */
+    attribute_deprecated
+    struct AVPanScan *pan_scan;
+#endif
+
+    /**
+     * reordered opaque 64bit (generally an integer or a double precision float
+     * PTS but can be anything).
+     * The user sets AVCodecContext.reordered_opaque to represent the input at
+     * that time,
+     * the decoder reorders values as needed and sets AVFrame.reordered_opaque
+     * to exactly one of the values provided by the user through AVCodecContext.reordered_opaque
+     * @deprecated in favor of pkt_pts
+     */
+    int64_t reordered_opaque;
+
+#if FF_API_AVFRAME_LAVC
+    /**
+     * @deprecated this field is unused
+     */
+    attribute_deprecated void *hwaccel_picture_private;
+
+    attribute_deprecated
+    struct AVCodecContext *owner;
+    attribute_deprecated
+    void *thread_opaque;
+
+    /**
+     * log2 of the size of the block which a single vector in motion_val represents:
+     * (4->16x16, 3->8x8, 2-> 4x4, 1-> 2x2)
+     */
+    attribute_deprecated
+    uint8_t motion_subsample_log2;
+#endif
+
+    /**
+     * Sample rate of the audio data.
+     */
+    int sample_rate;
+
+    /**
+     * Channel layout of the audio data.
+     */
+    uint64_t channel_layout;
+
+    /**
+     * AVBuffer references backing the data for this frame. If all elements of
+     * this array are NULL, then this frame is not reference counted.
+     *
+     * There may be at most one AVBuffer per data plane, so for video this array
+     * always contains all the references. For planar audio with more than
+     * AV_NUM_DATA_POINTERS channels, there may be more buffers than can fit in
+     * this array. Then the extra AVBufferRef pointers are stored in the
+     * extended_buf array.
+     */
+    AVBufferRef *buf[AV_NUM_DATA_POINTERS];
+
+    /**
+     * For planar audio which requires more than AV_NUM_DATA_POINTERS
+     * AVBufferRef pointers, this array will hold all the references which
+     * cannot fit into AVFrame.buf.
+     *
+     * Note that this is different from AVFrame.extended_data, which always
+     * contains all the pointers. This array only contains the extra pointers,
+     * which cannot fit into AVFrame.buf.
+     *
+     * This array is always allocated using av_malloc() by whoever constructs
+     * the frame. It is freed in av_frame_unref().
+     */
+    AVBufferRef **extended_buf;
+    /**
+     * Number of elements in extended_buf.
+     */
+    int        nb_extended_buf;
+
+    AVFrameSideData **side_data;
+    int            nb_side_data;
+
+/**
+ * @defgroup lavu_frame_flags AV_FRAME_FLAGS
+ * Flags describing additional frame properties.
+ *
+ * @{
+ */
+
+/**
+ * The frame data may be corrupted, e.g. due to decoding errors.
+ */
+#define AV_FRAME_FLAG_CORRUPT       (1 << 0)
+/**
+ * @}
+ */
+
+    /**
+     * Frame flags, a combination of @ref lavu_frame_flags
+     */
+    int flags;
+} AVFrame;
+
+/**
+ * Allocate an AVFrame and set its fields to default values.  The resulting
+ * struct must be freed using av_frame_free().
+ *
+ * @return An AVFrame filled with default values or NULL on failure.
+ *
+ * @note this only allocates the AVFrame itself, not the data buffers. Those
+ * must be allocated through other means, e.g. with av_frame_get_buffer() or
+ * manually.
+ */
+AVFrame *av_frame_alloc(void);
+
+/**
+ * Free the frame and any dynamically allocated objects in it,
+ * e.g. extended_data. If the frame is reference counted, it will be
+ * unreferenced first.
+ *
+ * @param frame frame to be freed. The pointer will be set to NULL.
+ */
+void av_frame_free(AVFrame **frame);
+
+/**
+ * Set up a new reference to the data described by the source frame.
+ *
+ * Copy frame properties from src to dst and create a new reference for each
+ * AVBufferRef from src.
+ *
+ * If src is not reference counted, new buffers are allocated and the data is
+ * copied.
+ *
+ * @return 0 on success, a negative AVERROR on error
+ */
+int av_frame_ref(AVFrame *dst, const AVFrame *src);
+
+/**
+ * Create a new frame that references the same data as src.
+ *
+ * This is a shortcut for av_frame_alloc()+av_frame_ref().
+ *
+ * @return newly created AVFrame on success, NULL on error.
+ */
+AVFrame *av_frame_clone(const AVFrame *src);
+
+/**
+ * Unreference all the buffers referenced by frame and reset the frame fields.
+ */
+void av_frame_unref(AVFrame *frame);
+
+/**
+ * Move everythnig contained in src to dst and reset src.
+ */
+void av_frame_move_ref(AVFrame *dst, AVFrame *src);
+
+/**
+ * Allocate new buffer(s) for audio or video data.
+ *
+ * The following fields must be set on frame before calling this function:
+ * - format (pixel format for video, sample format for audio)
+ * - width and height for video
+ * - nb_samples and channel_layout for audio
+ *
+ * This function will fill AVFrame.data and AVFrame.buf arrays and, if
+ * necessary, allocate and fill AVFrame.extended_data and AVFrame.extended_buf.
+ * For planar formats, one buffer will be allocated for each plane.
+ *
+ * @param frame frame in which to store the new buffers.
+ * @param align required buffer size alignment
+ *
+ * @return 0 on success, a negative AVERROR on error.
+ */
+int av_frame_get_buffer(AVFrame *frame, int align);
+
+/**
+ * Check if the frame data is writable.
+ *
+ * @return A positive value if the frame data is writable (which is true if and
+ * only if each of the underlying buffers has only one reference, namely the one
+ * stored in this frame). Return 0 otherwise.
+ *
+ * If 1 is returned the answer is valid until av_buffer_ref() is called on any
+ * of the underlying AVBufferRefs (e.g. through av_frame_ref() or directly).
+ *
+ * @see av_frame_make_writable(), av_buffer_is_writable()
+ */
+int av_frame_is_writable(AVFrame *frame);
+
+/**
+ * Ensure that the frame data is writable, avoiding data copy if possible.
+ *
+ * Do nothing if the frame is writable, allocate new buffers and copy the data
+ * if it is not.
+ *
+ * @return 0 on success, a negative AVERROR on error.
+ *
+ * @see av_frame_is_writable(), av_buffer_is_writable(),
+ * av_buffer_make_writable()
+ */
+int av_frame_make_writable(AVFrame *frame);
+
+/**
+ * Copy only "metadata" fields from src to dst.
+ *
+ * Metadata for the purpose of this function are those fields that do not affect
+ * the data layout in the buffers.  E.g. pts, sample rate (for audio) or sample
+ * aspect ratio (for video), but not width/height or channel layout.
+ * Side data is also copied.
+ */
+int av_frame_copy_props(AVFrame *dst, const AVFrame *src);
+
+/**
+ * Get the buffer reference a given data plane is stored in.
+ *
+ * @param plane index of the data plane of interest in frame->extended_data.
+ *
+ * @return the buffer reference that contains the plane or NULL if the input
+ * frame is not valid.
+ */
+AVBufferRef *av_frame_get_plane_buffer(AVFrame *frame, int plane);
+
+/**
+ * Add a new side data to a frame.
+ *
+ * @param frame a frame to which the side data should be added
+ * @param type type of the added side data
+ * @param size size of the side data
+ *
+ * @return newly added side data on success, NULL on error
+ */
+AVFrameSideData *av_frame_new_side_data(AVFrame *frame,
+                                        enum AVFrameSideDataType type,
+                                        int size);
+
+/**
+ * @return a pointer to the side data of a given type on success, NULL if there
+ * is no side data with such type in this frame.
+ */
+AVFrameSideData *av_frame_get_side_data(const AVFrame *frame,
+                                        enum AVFrameSideDataType type);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_FRAME_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/hmac.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/hmac.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/hmac.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/hmac.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/imgutils.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/imgutils.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/imgutils.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/imgutils.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/intfloat.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intfloat.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/intfloat.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intreadwrite.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/intreadwrite.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/intreadwrite.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/intreadwrite.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lfg.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/lfg.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lfg.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/lfg.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/log.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/log.h
new file mode 100644
index 0000000..6d26b67
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/log.h
@@ -0,0 +1,262 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_LOG_H
+#define AVUTIL_LOG_H
+
+#include <stdarg.h>
+#include "avutil.h"
+#include "attributes.h"
+
+/**
+ * Describe the class of an AVClass context structure. That is an
+ * arbitrary struct of which the first field is a pointer to an
+ * AVClass struct (e.g. AVCodecContext, AVFormatContext etc.).
+ */
+typedef struct AVClass {
+    /**
+     * The name of the class; usually it is the same name as the
+     * context structure type to which the AVClass is associated.
+     */
+    const char* class_name;
+
+    /**
+     * A pointer to a function which returns the name of a context
+     * instance ctx associated with the class.
+     */
+    const char* (*item_name)(void* ctx);
+
+    /**
+     * a pointer to the first option specified in the class if any or NULL
+     *
+     * @see av_set_default_options()
+     */
+    const struct AVOption *option;
+
+    /**
+     * LIBAVUTIL_VERSION with which this structure was created.
+     * This is used to allow fields to be added without requiring major
+     * version bumps everywhere.
+     */
+
+    int version;
+
+    /**
+     * Offset in the structure where log_level_offset is stored.
+     * 0 means there is no such variable
+     */
+    int log_level_offset_offset;
+
+    /**
+     * Offset in the structure where a pointer to the parent context for
+     * logging is stored. For example a decoder could pass its AVCodecContext
+     * to eval as such a parent context, which an av_log() implementation
+     * could then leverage to display the parent context.
+     * The offset can be NULL.
+     */
+    int parent_log_context_offset;
+
+    /**
+     * Return next AVOptions-enabled child or NULL
+     */
+    void* (*child_next)(void *obj, void *prev);
+
+    /**
+     * Return an AVClass corresponding to the next potential
+     * AVOptions-enabled child.
+     *
+     * The difference between child_next and this is that
+     * child_next iterates over _already existing_ objects, while
+     * child_class_next iterates over _all possible_ children.
+     */
+    const struct AVClass* (*child_class_next)(const struct AVClass *prev);
+} AVClass;
+
+/**
+ * @addtogroup lavu_log
+ *
+ * @{
+ *
+ * @defgroup lavu_log_constants Logging Constants
+ *
+ * @{
+ */
+
+/**
+ * Print no output.
+ */
+#define AV_LOG_QUIET    -8
+
+/**
+ * Something went really wrong and we will crash now.
+ */
+#define AV_LOG_PANIC     0
+
+/**
+ * Something went wrong and recovery is not possible.
+ * For example, no header was found for a format which depends
+ * on headers or an illegal combination of parameters is used.
+ */
+#define AV_LOG_FATAL     8
+
+/**
+ * Something went wrong and cannot losslessly be recovered.
+ * However, not all future data is affected.
+ */
+#define AV_LOG_ERROR    16
+
+/**
+ * Something somehow does not look correct. This may or may not
+ * lead to problems. An example would be the use of '-vstrict -2'.
+ */
+#define AV_LOG_WARNING  24
+
+/**
+ * Standard information.
+ */
+#define AV_LOG_INFO     32
+
+/**
+ * Detailed information.
+ */
+#define AV_LOG_VERBOSE  40
+
+/**
+ * Stuff which is only useful for libav* developers.
+ */
+#define AV_LOG_DEBUG    48
+
+/**
+ * @}
+ */
+
+/**
+ * Send the specified message to the log if the level is less than or equal
+ * to the current av_log_level. By default, all logging messages are sent to
+ * stderr. This behavior can be altered by setting a different logging callback
+ * function.
+ * @see av_log_set_callback
+ *
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
+ *        pointer to an AVClass struct.
+ * @param level The importance level of the message expressed using a @ref
+ *        lavu_log_constants "Logging Constant".
+ * @param fmt The format string (printf-compatible) that specifies how
+ *        subsequent arguments are converted to output.
+ */
+void av_log(void *avcl, int level, const char *fmt, ...) av_printf_format(3, 4);
+
+
+/**
+ * Send the specified message to the log if the level is less than or equal
+ * to the current av_log_level. By default, all logging messages are sent to
+ * stderr. This behavior can be altered by setting a different logging callback
+ * function.
+ * @see av_log_set_callback
+ *
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
+ *        pointer to an AVClass struct.
+ * @param level The importance level of the message expressed using a @ref
+ *        lavu_log_constants "Logging Constant".
+ * @param fmt The format string (printf-compatible) that specifies how
+ *        subsequent arguments are converted to output.
+ * @param vl The arguments referenced by the format string.
+ */
+void av_vlog(void *avcl, int level, const char *fmt, va_list vl);
+
+/**
+ * Get the current log level
+ *
+ * @see lavu_log_constants
+ *
+ * @return Current log level
+ */
+int av_log_get_level(void);
+
+/**
+ * Set the log level
+ *
+ * @see lavu_log_constants
+ *
+ * @param level Logging level
+ */
+void av_log_set_level(int level);
+
+/**
+ * Set the logging callback
+ *
+ * @see av_log_default_callback
+ *
+ * @param callback A logging function with a compatible signature.
+ */
+void av_log_set_callback(void (*callback)(void*, int, const char*, va_list));
+
+/**
+ * Default logging callback
+ *
+ * It prints the message to stderr, optionally colorizing it.
+ *
+ * @param avcl A pointer to an arbitrary struct of which the first field is a
+ *        pointer to an AVClass struct.
+ * @param level The importance level of the message expressed using a @ref
+ *        lavu_log_constants "Logging Constant".
+ * @param fmt The format string (printf-compatible) that specifies how
+ *        subsequent arguments are converted to output.
+ * @param vl The arguments referenced by the format string.
+ */
+void av_log_default_callback(void *avcl, int level, const char *fmt,
+                             va_list vl);
+
+/**
+ * Return the context name
+ *
+ * @param  ctx The AVClass context
+ *
+ * @return The AVClass class_name
+ */
+const char* av_default_item_name(void* ctx);
+
+/**
+ * av_dlog macros
+ * Useful to print debug messages that shouldn't get compiled in normally.
+ */
+
+#ifdef DEBUG
+#    define av_dlog(pctx, ...) av_log(pctx, AV_LOG_DEBUG, __VA_ARGS__)
+#else
+#    define av_dlog(pctx, ...)
+#endif
+
+/**
+ * Skip repeated messages, this requires the user app to use av_log() instead of
+ * (f)printf as the 2 would otherwise interfere and lead to
+ * "Last message repeated x times" messages below (f)printf messages with some
+ * bad luck.
+ * Also to receive the last, "last repeated" line if any, the user app must
+ * call av_log(NULL, AV_LOG_QUIET, ""); at the end
+ */
+#define AV_LOG_SKIP_REPEATED 1
+void av_log_set_flags(int arg);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_LOG_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lzo.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/lzo.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/lzo.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/lzo.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/macros.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/macros.h
new file mode 100644
index 0000000..bf3eb9b
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/macros.h
@@ -0,0 +1,48 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * @ingroup lavu
+ * Utility Preprocessor macros
+ */
+
+#ifndef AVUTIL_MACROS_H
+#define AVUTIL_MACROS_H
+
+/**
+ * @addtogroup preproc_misc Preprocessor String Macros
+ *
+ * String manipulation macros
+ *
+ * @{
+ */
+
+#define AV_STRINGIFY(s)         AV_TOSTRING(s)
+#define AV_TOSTRING(s) #s
+
+#define AV_GLUE(a, b) a ## b
+#define AV_JOIN(a, b) AV_GLUE(a, b)
+
+/**
+ * @}
+ */
+
+#define AV_PRAGMA(s) _Pragma(#s)
+
+#endif /* AVUTIL_MACROS_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mathematics.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/mathematics.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/mathematics.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/mathematics.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/md5.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/md5.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/md5.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/md5.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/mem.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/mem.h
new file mode 100644
index 0000000..4a5e362
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/mem.h
@@ -0,0 +1,265 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+/**
+ * @file
+ * memory handling functions
+ */
+
+#ifndef AVUTIL_MEM_H
+#define AVUTIL_MEM_H
+
+#include <limits.h>
+#include <stdint.h>
+
+#include "attributes.h"
+#include "avutil.h"
+
+/**
+ * @addtogroup lavu_mem
+ * @{
+ */
+
+
+#if defined(__ICC) && __ICC < 1200 || defined(__SUNPRO_C)
+    #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
+    #define DECLARE_ASM_CONST(n,t,v)    const t __attribute__ ((aligned (n))) v
+#elif defined(__TI_COMPILER_VERSION__)
+    #define DECLARE_ALIGNED(n,t,v)                      \
+        AV_PRAGMA(DATA_ALIGN(v,n))                      \
+        t __attribute__((aligned(n))) v
+    #define DECLARE_ASM_CONST(n,t,v)                    \
+        AV_PRAGMA(DATA_ALIGN(v,n))                      \
+        static const t __attribute__((aligned(n))) v
+#elif defined(__GNUC__)
+    #define DECLARE_ALIGNED(n,t,v)      t __attribute__ ((aligned (n))) v
+    #define DECLARE_ASM_CONST(n,t,v)    static const t av_used __attribute__ ((aligned (n))) v
+#elif defined(_MSC_VER)
+    #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
+    #define DECLARE_ASM_CONST(n,t,v)    __declspec(align(n)) static const t v
+#else
+    #define DECLARE_ALIGNED(n,t,v)      t v
+    #define DECLARE_ASM_CONST(n,t,v)    static const t v
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(3,1)
+    #define av_malloc_attrib __attribute__((__malloc__))
+#else
+    #define av_malloc_attrib
+#endif
+
+#if AV_GCC_VERSION_AT_LEAST(4,3)
+    #define av_alloc_size(...) __attribute__((alloc_size(__VA_ARGS__)))
+#else
+    #define av_alloc_size(...)
+#endif
+
+/**
+ * Allocate a block of size bytes with alignment suitable for all
+ * memory accesses (including vectors if available on the CPU).
+ * @param size Size in bytes for the memory block to be allocated.
+ * @return Pointer to the allocated block, NULL if the block cannot
+ * be allocated.
+ * @see av_mallocz()
+ */
+void *av_malloc(size_t size) av_malloc_attrib av_alloc_size(1);
+
+/**
+ * Allocate a block of size * nmemb bytes with av_malloc().
+ * @param nmemb Number of elements
+ * @param size Size of the single element
+ * @return Pointer to the allocated block, NULL if the block cannot
+ * be allocated.
+ * @see av_malloc()
+ */
+av_alloc_size(1, 2) static inline void *av_malloc_array(size_t nmemb, size_t size)
+{
+    if (!size || nmemb >= INT_MAX / size)
+        return NULL;
+    return av_malloc(nmemb * size);
+}
+
+/**
+ * Allocate or reallocate a block of memory.
+ * If ptr is NULL and size > 0, allocate a new block. If
+ * size is zero, free the memory block pointed to by ptr.
+ * @param ptr Pointer to a memory block already allocated with
+ * av_realloc() or NULL.
+ * @param size Size in bytes of the memory block to be allocated or
+ * reallocated.
+ * @return Pointer to a newly-reallocated block or NULL if the block
+ * cannot be reallocated or the function is used to free the memory block.
+ * @warning Pointers originating from the av_malloc() family of functions must
+ *          not be passed to av_realloc(). The former can be implemented using
+ *          memalign() (or other functions), and there is no guarantee that
+ *          pointers from such functions can be passed to realloc() at all.
+ *          The situation is undefined according to POSIX and may crash with
+ *          some libc implementations.
+ * @see av_fast_realloc()
+ */
+void *av_realloc(void *ptr, size_t size) av_alloc_size(2);
+
+/**
+ * Allocate or reallocate a block of memory.
+ * If *ptr is NULL and size > 0, allocate a new block. If
+ * size is zero, free the memory block pointed to by ptr.
+ * @param   ptr Pointer to a pointer to a memory block already allocated
+ *          with av_realloc(), or pointer to a pointer to NULL.
+ *          The pointer is updated on success, or freed on failure.
+ * @param   size Size in bytes for the memory block to be allocated or
+ *          reallocated
+ * @return  Zero on success, an AVERROR error code on failure.
+ * @warning Pointers originating from the av_malloc() family of functions must
+ *          not be passed to av_reallocp(). The former can be implemented using
+ *          memalign() (or other functions), and there is no guarantee that
+ *          pointers from such functions can be passed to realloc() at all.
+ *          The situation is undefined according to POSIX and may crash with
+ *          some libc implementations.
+ */
+int av_reallocp(void *ptr, size_t size);
+
+/**
+ * Allocate or reallocate an array.
+ * If ptr is NULL and nmemb > 0, allocate a new block. If
+ * nmemb is zero, free the memory block pointed to by ptr.
+ * @param ptr Pointer to a memory block already allocated with
+ * av_realloc() or NULL.
+ * @param nmemb Number of elements
+ * @param size Size of the single element
+ * @return Pointer to a newly-reallocated block or NULL if the block
+ * cannot be reallocated or the function is used to free the memory block.
+ * @warning Pointers originating from the av_malloc() family of functions must
+ *          not be passed to av_realloc(). The former can be implemented using
+ *          memalign() (or other functions), and there is no guarantee that
+ *          pointers from such functions can be passed to realloc() at all.
+ *          The situation is undefined according to POSIX and may crash with
+ *          some libc implementations.
+ */
+av_alloc_size(2, 3) void *av_realloc_array(void *ptr, size_t nmemb, size_t size);
+
+/**
+ * Allocate or reallocate an array through a pointer to a pointer.
+ * If *ptr is NULL and nmemb > 0, allocate a new block. If
+ * nmemb is zero, free the memory block pointed to by ptr.
+ * @param ptr Pointer to a pointer to a memory block already allocated
+ * with av_realloc(), or pointer to a pointer to NULL.
+ * The pointer is updated on success, or freed on failure.
+ * @param nmemb Number of elements
+ * @param size Size of the single element
+ * @return Zero on success, an AVERROR error code on failure.
+ * @warning Pointers originating from the av_malloc() family of functions must
+ *          not be passed to av_realloc(). The former can be implemented using
+ *          memalign() (or other functions), and there is no guarantee that
+ *          pointers from such functions can be passed to realloc() at all.
+ *          The situation is undefined according to POSIX and may crash with
+ *          some libc implementations.
+ */
+av_alloc_size(2, 3) int av_reallocp_array(void *ptr, size_t nmemb, size_t size);
+
+/**
+ * Free a memory block which has been allocated with av_malloc(z)() or
+ * av_realloc().
+ * @param ptr Pointer to the memory block which should be freed.
+ * @note ptr = NULL is explicitly allowed.
+ * @note It is recommended that you use av_freep() instead.
+ * @see av_freep()
+ */
+void av_free(void *ptr);
+
+/**
+ * Allocate a block of size bytes with alignment suitable for all
+ * memory accesses (including vectors if available on the CPU) and
+ * zero all the bytes of the block.
+ * @param size Size in bytes for the memory block to be allocated.
+ * @return Pointer to the allocated block, NULL if it cannot be allocated.
+ * @see av_malloc()
+ */
+void *av_mallocz(size_t size) av_malloc_attrib av_alloc_size(1);
+
+/**
+ * Allocate a block of size * nmemb bytes with av_mallocz().
+ * @param nmemb Number of elements
+ * @param size Size of the single element
+ * @return Pointer to the allocated block, NULL if the block cannot
+ * be allocated.
+ * @see av_mallocz()
+ * @see av_malloc_array()
+ */
+av_alloc_size(1, 2) static inline void *av_mallocz_array(size_t nmemb, size_t size)
+{
+    if (!size || nmemb >= INT_MAX / size)
+        return NULL;
+    return av_mallocz(nmemb * size);
+}
+
+/**
+ * Duplicate the string s.
+ * @param s string to be duplicated
+ * @return Pointer to a newly-allocated string containing a
+ * copy of s or NULL if the string cannot be allocated.
+ */
+char *av_strdup(const char *s) av_malloc_attrib;
+
+/**
+ * Free a memory block which has been allocated with av_malloc(z)() or
+ * av_realloc() and set the pointer pointing to it to NULL.
+ * @param ptr Pointer to the pointer to the memory block which should
+ * be freed.
+ * @see av_free()
+ */
+void av_freep(void *ptr);
+
+/**
+ * deliberately overlapping memcpy implementation
+ * @param dst destination buffer
+ * @param back how many bytes back we start (the initial size of the overlapping window)
+ * @param cnt number of bytes to copy, must be >= 0
+ *
+ * cnt > back is valid, this will copy the bytes we just copied,
+ * thus creating a repeating pattern with a period length of back.
+ */
+void av_memcpy_backptr(uint8_t *dst, int back, int cnt);
+
+/**
+ * Reallocate the given block if it is not large enough, otherwise do nothing.
+ *
+ * @see av_realloc
+ */
+void *av_fast_realloc(void *ptr, unsigned int *size, size_t min_size);
+
+/**
+ * Allocate a buffer, reusing the given one if large enough.
+ *
+ * Contrary to av_fast_realloc the current buffer contents might not be
+ * preserved and on error the old buffer is freed, thus no special
+ * handling to avoid memleaks is necessary.
+ *
+ * @param ptr pointer to pointer to already allocated buffer, overwritten with pointer to new buffer
+ * @param size size of the buffer *ptr points to
+ * @param min_size minimum size of *ptr buffer after returning, *ptr will be NULL and
+ *                 *size 0 if an error occurred.
+ */
+void av_fast_malloc(void *ptr, unsigned int *size, size_t min_size);
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_MEM_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/old_pix_fmts.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/old_pix_fmts.h
new file mode 100644
index 0000000..d3e1e5b
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/old_pix_fmts.h
@@ -0,0 +1,134 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_OLD_PIX_FMTS_H
+#define AVUTIL_OLD_PIX_FMTS_H
+
+/*
+ * This header exists to prevent new pixel formats from being accidentally added
+ * to the deprecated list.
+ * Do not include it directly. It will be removed on next major bump
+ *
+ * Do not add new items to this list. Use the AVPixelFormat enum instead.
+ */
+    PIX_FMT_NONE = AV_PIX_FMT_NONE,
+    PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
+    PIX_FMT_YUYV422,   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
+    PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
+    PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
+    PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
+    PIX_FMT_YUV444P,   ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
+    PIX_FMT_YUV410P,   ///< planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
+    PIX_FMT_YUV411P,   ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
+    PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
+    PIX_FMT_MONOWHITE, ///<        Y        ,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
+    PIX_FMT_MONOBLACK, ///<        Y        ,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
+    PIX_FMT_PAL8,      ///< 8 bit with PIX_FMT_RGB32 palette
+    PIX_FMT_YUVJ420P,  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
+    PIX_FMT_YUVJ422P,  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
+    PIX_FMT_YUVJ444P,  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
+#if FF_API_XVMC
+    PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
+    PIX_FMT_XVMC_MPEG2_IDCT,
+#endif /* FF_API_XVMC */
+    PIX_FMT_UYVY422,   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
+    PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
+    PIX_FMT_BGR8,      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
+    PIX_FMT_BGR4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+    PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
+    PIX_FMT_RGB8,      ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
+    PIX_FMT_RGB4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+    PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb)
+    PIX_FMT_NV12,      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
+    PIX_FMT_NV21,      ///< as above, but U and V bytes are swapped
+
+    PIX_FMT_ARGB,      ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
+    PIX_FMT_RGBA,      ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
+    PIX_FMT_ABGR,      ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
+    PIX_FMT_BGRA,      ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
+
+    PIX_FMT_GRAY16BE,  ///<        Y        , 16bpp, big-endian
+    PIX_FMT_GRAY16LE,  ///<        Y        , 16bpp, little-endian
+    PIX_FMT_YUV440P,   ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
+    PIX_FMT_YUVJ440P,  ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
+    PIX_FMT_YUVA420P,  ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
+#if FF_API_VDPAU
+    PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+#endif
+    PIX_FMT_RGB48BE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
+    PIX_FMT_RGB48LE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
+
+    PIX_FMT_RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
+    PIX_FMT_RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
+    PIX_FMT_RGB555BE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
+    PIX_FMT_RGB555LE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
+
+    PIX_FMT_BGR565BE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
+    PIX_FMT_BGR565LE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
+    PIX_FMT_BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
+    PIX_FMT_BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
+
+    PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
+    PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
+    PIX_FMT_VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+
+    PIX_FMT_YUV420P16LE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    PIX_FMT_YUV420P16BE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    PIX_FMT_YUV422P16LE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    PIX_FMT_YUV422P16BE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    PIX_FMT_YUV444P16LE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    PIX_FMT_YUV444P16BE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+#if FF_API_VDPAU
+    PIX_FMT_VDPAU_MPEG4,  ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+#endif
+    PIX_FMT_DXVA2_VLD,    ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
+
+    PIX_FMT_RGB444LE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
+    PIX_FMT_RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
+    PIX_FMT_BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
+    PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
+    PIX_FMT_Y400A,     ///< 8bit gray, 8bit alpha
+    PIX_FMT_BGR48BE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
+    PIX_FMT_BGR48LE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
+    PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    PIX_FMT_VDA_VLD,    ///< hardware decoding through VDA
+    PIX_FMT_GBRP,      ///< planar GBR 4:4:4 24bpp
+    PIX_FMT_GBRP9BE,   ///< planar GBR 4:4:4 27bpp, big endian
+    PIX_FMT_GBRP9LE,   ///< planar GBR 4:4:4 27bpp, little endian
+    PIX_FMT_GBRP10BE,  ///< planar GBR 4:4:4 30bpp, big endian
+    PIX_FMT_GBRP10LE,  ///< planar GBR 4:4:4 30bpp, little endian
+    PIX_FMT_GBRP16BE,  ///< planar GBR 4:4:4 48bpp, big endian
+    PIX_FMT_GBRP16LE,  ///< planar GBR 4:4:4 48bpp, little endian
+    PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
+
+#endif /* AVUTIL_OLD_PIX_FMTS_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/opt.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/opt.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/opt.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/opt.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/parseutils.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/parseutils.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/parseutils.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/parseutils.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/pixdesc.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/pixdesc.h
new file mode 100644
index 0000000..e5a16f4
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/pixdesc.h
@@ -0,0 +1,276 @@
+/*
+ * pixel format descriptor
+ * Copyright (c) 2009 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_PIXDESC_H
+#define AVUTIL_PIXDESC_H
+
+#include <inttypes.h>
+
+#include "attributes.h"
+#include "pixfmt.h"
+
+typedef struct AVComponentDescriptor{
+    uint16_t plane        :2;            ///< which of the 4 planes contains the component
+
+    /**
+     * Number of elements between 2 horizontally consecutive pixels minus 1.
+     * Elements are bits for bitstream formats, bytes otherwise.
+     */
+    uint16_t step_minus1  :3;
+
+    /**
+     * Number of elements before the component of the first pixel plus 1.
+     * Elements are bits for bitstream formats, bytes otherwise.
+     */
+    uint16_t offset_plus1 :3;
+    uint16_t shift        :3;            ///< number of least significant bits that must be shifted away to get the value
+    uint16_t depth_minus1 :4;            ///< number of bits in the component minus 1
+}AVComponentDescriptor;
+
+/**
+ * Descriptor that unambiguously describes how the bits of a pixel are
+ * stored in the up to 4 data planes of an image. It also stores the
+ * subsampling factors and number of components.
+ *
+ * @note This is separate of the colorspace (RGB, YCbCr, YPbPr, JPEG-style YUV
+ *       and all the YUV variants) AVPixFmtDescriptor just stores how values
+ *       are stored not what these values represent.
+ */
+typedef struct AVPixFmtDescriptor{
+    const char *name;
+    uint8_t nb_components;      ///< The number of components each pixel has, (1-4)
+
+    /**
+     * Amount to shift the luma width right to find the chroma width.
+     * For YV12 this is 1 for example.
+     * chroma_width = -((-luma_width) >> log2_chroma_w)
+     * The note above is needed to ensure rounding up.
+     * This value only refers to the chroma components.
+     */
+    uint8_t log2_chroma_w;      ///< chroma_width = -((-luma_width )>>log2_chroma_w)
+
+    /**
+     * Amount to shift the luma height right to find the chroma height.
+     * For YV12 this is 1 for example.
+     * chroma_height= -((-luma_height) >> log2_chroma_h)
+     * The note above is needed to ensure rounding up.
+     * This value only refers to the chroma components.
+     */
+    uint8_t log2_chroma_h;
+    uint8_t flags;
+
+    /**
+     * Parameters that describe how pixels are packed. If the format
+     * has chroma components, they must be stored in comp[1] and
+     * comp[2].
+     */
+    AVComponentDescriptor comp[4];
+}AVPixFmtDescriptor;
+
+/**
+ * Pixel format is big-endian.
+ */
+#define AV_PIX_FMT_FLAG_BE           (1 << 0)
+/**
+ * Pixel format has a palette in data[1], values are indexes in this palette.
+ */
+#define AV_PIX_FMT_FLAG_PAL          (1 << 1)
+/**
+ * All values of a component are bit-wise packed end to end.
+ */
+#define AV_PIX_FMT_FLAG_BITSTREAM    (1 << 2)
+/**
+ * Pixel format is an HW accelerated format.
+ */
+#define AV_PIX_FMT_FLAG_HWACCEL      (1 << 3)
+/**
+ * At least one pixel component is not in the first data plane.
+ */
+#define AV_PIX_FMT_FLAG_PLANAR       (1 << 4)
+/**
+ * The pixel format contains RGB-like data (as opposed to YUV/grayscale).
+ */
+#define AV_PIX_FMT_FLAG_RGB          (1 << 5)
+/**
+ * The pixel format is "pseudo-paletted". This means that Libav treats it as
+ * paletted internally, but the palette is generated by the decoder and is not
+ * stored in the file.
+ */
+#define AV_PIX_FMT_FLAG_PSEUDOPAL    (1 << 6)
+/**
+ * The pixel format has an alpha channel.
+ */
+#define AV_PIX_FMT_FLAG_ALPHA        (1 << 7)
+
+#if FF_API_PIX_FMT
+/**
+ * @deprecated use the AV_PIX_FMT_FLAG_* flags
+ */
+#define PIX_FMT_BE        AV_PIX_FMT_FLAG_BE
+#define PIX_FMT_PAL       AV_PIX_FMT_FLAG_PAL
+#define PIX_FMT_BITSTREAM AV_PIX_FMT_FLAG_BITSTREAM
+#define PIX_FMT_HWACCEL   AV_PIX_FMT_FLAG_HWACCEL
+#define PIX_FMT_PLANAR    AV_PIX_FMT_FLAG_PLANAR
+#define PIX_FMT_RGB       AV_PIX_FMT_FLAG_RGB
+#define PIX_FMT_PSEUDOPAL AV_PIX_FMT_FLAG_PSEUDOPAL
+#define PIX_FMT_ALPHA     AV_PIX_FMT_FLAG_ALPHA
+#endif
+
+#if FF_API_PIX_FMT_DESC
+/**
+ * The array of all the pixel format descriptors.
+ */
+extern attribute_deprecated const AVPixFmtDescriptor av_pix_fmt_descriptors[];
+#endif
+
+/**
+ * Read a line from an image, and write the values of the
+ * pixel format component c to dst.
+ *
+ * @param data the array containing the pointers to the planes of the image
+ * @param linesize the array containing the linesizes of the image
+ * @param desc the pixel format descriptor for the image
+ * @param x the horizontal coordinate of the first pixel to read
+ * @param y the vertical coordinate of the first pixel to read
+ * @param w the width of the line to read, that is the number of
+ * values to write to dst
+ * @param read_pal_component if not zero and the format is a paletted
+ * format writes the values corresponding to the palette
+ * component c in data[1] to dst, rather than the palette indexes in
+ * data[0]. The behavior is undefined if the format is not paletted.
+ */
+void av_read_image_line(uint16_t *dst, const uint8_t *data[4], const int linesize[4],
+                        const AVPixFmtDescriptor *desc, int x, int y, int c, int w, int read_pal_component);
+
+/**
+ * Write the values from src to the pixel format component c of an
+ * image line.
+ *
+ * @param src array containing the values to write
+ * @param data the array containing the pointers to the planes of the
+ * image to write into. It is supposed to be zeroed.
+ * @param linesize the array containing the linesizes of the image
+ * @param desc the pixel format descriptor for the image
+ * @param x the horizontal coordinate of the first pixel to write
+ * @param y the vertical coordinate of the first pixel to write
+ * @param w the width of the line to write, that is the number of
+ * values to write to the image line
+ */
+void av_write_image_line(const uint16_t *src, uint8_t *data[4], const int linesize[4],
+                         const AVPixFmtDescriptor *desc, int x, int y, int c, int w);
+
+/**
+ * Return the pixel format corresponding to name.
+ *
+ * If there is no pixel format with name name, then looks for a
+ * pixel format with the name corresponding to the native endian
+ * format of name.
+ * For example in a little-endian system, first looks for "gray16",
+ * then for "gray16le".
+ *
+ * Finally if no pixel format has been found, returns PIX_FMT_NONE.
+ */
+enum AVPixelFormat av_get_pix_fmt(const char *name);
+
+/**
+ * Return the short name for a pixel format, NULL in case pix_fmt is
+ * unknown.
+ *
+ * @see av_get_pix_fmt(), av_get_pix_fmt_string()
+ */
+const char *av_get_pix_fmt_name(enum AVPixelFormat pix_fmt);
+
+/**
+ * Print in buf the string corresponding to the pixel format with
+ * number pix_fmt, or an header if pix_fmt is negative.
+ *
+ * @param buf the buffer where to write the string
+ * @param buf_size the size of buf
+ * @param pix_fmt the number of the pixel format to print the
+ * corresponding info string, or a negative value to print the
+ * corresponding header.
+ */
+char *av_get_pix_fmt_string (char *buf, int buf_size, enum AVPixelFormat pix_fmt);
+
+/**
+ * Return the number of bits per pixel used by the pixel format
+ * described by pixdesc. Note that this is not the same as the number
+ * of bits per sample.
+ *
+ * The returned number of bits refers to the number of bits actually
+ * used for storing the pixel information, that is padding bits are
+ * not counted.
+ */
+int av_get_bits_per_pixel(const AVPixFmtDescriptor *pixdesc);
+
+/**
+ * @return a pixel format descriptor for provided pixel format or NULL if
+ * this pixel format is unknown.
+ */
+const AVPixFmtDescriptor *av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt);
+
+/**
+ * Iterate over all pixel format descriptors known to libavutil.
+ *
+ * @param prev previous descriptor. NULL to get the first descriptor.
+ *
+ * @return next descriptor or NULL after the last descriptor
+ */
+const AVPixFmtDescriptor *av_pix_fmt_desc_next(const AVPixFmtDescriptor *prev);
+
+/**
+ * @return an AVPixelFormat id described by desc, or AV_PIX_FMT_NONE if desc
+ * is not a valid pointer to a pixel format descriptor.
+ */
+enum AVPixelFormat av_pix_fmt_desc_get_id(const AVPixFmtDescriptor *desc);
+
+/**
+ * Utility function to access log2_chroma_w log2_chroma_h from
+ * the pixel format AVPixFmtDescriptor.
+ *
+ * @param[in]  pix_fmt the pixel format
+ * @param[out] h_shift store log2_chroma_h
+ * @param[out] v_shift store log2_chroma_w
+ *
+ * @return 0 on success, AVERROR(ENOSYS) on invalid or unknown pixel format
+ */
+int av_pix_fmt_get_chroma_sub_sample(enum AVPixelFormat pix_fmt,
+                                     int *h_shift, int *v_shift);
+
+/**
+ * @return number of planes in pix_fmt, a negative AVERROR if pix_fmt is not a
+ * valid pixel format.
+ */
+int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt);
+
+
+/**
+ * Utility function to swap the endianness of a pixel format.
+ *
+ * @param[in]  pix_fmt the pixel format
+ *
+ * @return pixel format with swapped endianness if it exists,
+ * otherwise AV_PIX_FMT_NONE
+ */
+enum AVPixelFormat av_pix_fmt_swap_endianness(enum AVPixelFormat pix_fmt);
+
+
+#endif /* AVUTIL_PIXDESC_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/pixfmt.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/pixfmt.h
new file mode 100644
index 0000000..0d6e0a3
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/pixfmt.h
@@ -0,0 +1,283 @@
+/*
+ * copyright (c) 2006 Michael Niedermayer <michaelni at gmx.at>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_PIXFMT_H
+#define AVUTIL_PIXFMT_H
+
+/**
+ * @file
+ * pixel format definitions
+ *
+ */
+
+#include "libavutil/avconfig.h"
+#include "version.h"
+
+/**
+ * Pixel format.
+ *
+ * @note
+ * PIX_FMT_RGB32 is handled in an endian-specific manner. An RGBA
+ * color is put together as:
+ *  (A << 24) | (R << 16) | (G << 8) | B
+ * This is stored as BGRA on little-endian CPU architectures and ARGB on
+ * big-endian CPUs.
+ *
+ * @par
+ * When the pixel format is palettized RGB (PIX_FMT_PAL8), the palettized
+ * image data is stored in AVFrame.data[0]. The palette is transported in
+ * AVFrame.data[1], is 1024 bytes long (256 4-byte entries) and is
+ * formatted the same as in PIX_FMT_RGB32 described above (i.e., it is
+ * also endian-specific). Note also that the individual RGB palette
+ * components stored in AVFrame.data[1] should be in the range 0..255.
+ * This is important as many custom PAL8 video codecs that were designed
+ * to run on the IBM VGA graphics adapter use 6-bit palette components.
+ *
+ * @par
+ * For all the 8bit per pixel formats, an RGB32 palette is in data[1] like
+ * for pal8. This palette is filled in automatically by the function
+ * allocating the picture.
+ *
+ * @note
+ * Make sure that all newly added big-endian formats have pix_fmt & 1 == 1
+ * and that all newly added little-endian formats have pix_fmt & 1 == 0.
+ * This allows simpler detection of big vs little-endian.
+ */
+enum AVPixelFormat {
+    AV_PIX_FMT_NONE = -1,
+    AV_PIX_FMT_YUV420P,   ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
+    AV_PIX_FMT_YUYV422,   ///< packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr
+    AV_PIX_FMT_RGB24,     ///< packed RGB 8:8:8, 24bpp, RGBRGB...
+    AV_PIX_FMT_BGR24,     ///< packed RGB 8:8:8, 24bpp, BGRBGR...
+    AV_PIX_FMT_YUV422P,   ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
+    AV_PIX_FMT_YUV444P,   ///< planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples)
+    AV_PIX_FMT_YUV410P,   ///< planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples)
+    AV_PIX_FMT_YUV411P,   ///< planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples)
+    AV_PIX_FMT_GRAY8,     ///<        Y        ,  8bpp
+    AV_PIX_FMT_MONOWHITE, ///<        Y        ,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb
+    AV_PIX_FMT_MONOBLACK, ///<        Y        ,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb
+    AV_PIX_FMT_PAL8,      ///< 8 bit with PIX_FMT_RGB32 palette
+    AV_PIX_FMT_YUVJ420P,  ///< planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV420P and setting color_range
+    AV_PIX_FMT_YUVJ422P,  ///< planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV422P and setting color_range
+    AV_PIX_FMT_YUVJ444P,  ///< planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of PIX_FMT_YUV444P and setting color_range
+#if FF_API_XVMC
+    AV_PIX_FMT_XVMC_MPEG2_MC,///< XVideo Motion Acceleration via common packet passing
+    AV_PIX_FMT_XVMC_MPEG2_IDCT,
+#endif /* FF_API_XVMC */
+    AV_PIX_FMT_UYVY422,   ///< packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1
+    AV_PIX_FMT_UYYVYY411, ///< packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3
+    AV_PIX_FMT_BGR8,      ///< packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb)
+    AV_PIX_FMT_BGR4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+    AV_PIX_FMT_BGR4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb)
+    AV_PIX_FMT_RGB8,      ///< packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb)
+    AV_PIX_FMT_RGB4,      ///< packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits
+    AV_PIX_FMT_RGB4_BYTE, ///< packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb)
+    AV_PIX_FMT_NV12,      ///< planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V)
+    AV_PIX_FMT_NV21,      ///< as above, but U and V bytes are swapped
+
+    AV_PIX_FMT_ARGB,      ///< packed ARGB 8:8:8:8, 32bpp, ARGBARGB...
+    AV_PIX_FMT_RGBA,      ///< packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
+    AV_PIX_FMT_ABGR,      ///< packed ABGR 8:8:8:8, 32bpp, ABGRABGR...
+    AV_PIX_FMT_BGRA,      ///< packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
+
+    AV_PIX_FMT_GRAY16BE,  ///<        Y        , 16bpp, big-endian
+    AV_PIX_FMT_GRAY16LE,  ///<        Y        , 16bpp, little-endian
+    AV_PIX_FMT_YUV440P,   ///< planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples)
+    AV_PIX_FMT_YUVJ440P,  ///< planar YUV 4:4:0 full scale (JPEG), deprecated in favor of PIX_FMT_YUV440P and setting color_range
+    AV_PIX_FMT_YUVA420P,  ///< planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples)
+#if FF_API_VDPAU
+    AV_PIX_FMT_VDPAU_H264,///< H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    AV_PIX_FMT_VDPAU_MPEG1,///< MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    AV_PIX_FMT_VDPAU_MPEG2,///< MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    AV_PIX_FMT_VDPAU_WMV3,///< WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    AV_PIX_FMT_VDPAU_VC1, ///< VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+#endif
+    AV_PIX_FMT_RGB48BE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian
+    AV_PIX_FMT_RGB48LE,   ///< packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian
+
+    AV_PIX_FMT_RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
+    AV_PIX_FMT_RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
+    AV_PIX_FMT_RGB555BE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
+    AV_PIX_FMT_RGB555LE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
+
+    AV_PIX_FMT_BGR565BE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
+    AV_PIX_FMT_BGR565LE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
+    AV_PIX_FMT_BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
+    AV_PIX_FMT_BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
+
+    AV_PIX_FMT_VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
+    AV_PIX_FMT_VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
+    AV_PIX_FMT_VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+
+    AV_PIX_FMT_YUV420P16LE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    AV_PIX_FMT_YUV420P16BE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    AV_PIX_FMT_YUV422P16LE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    AV_PIX_FMT_YUV422P16BE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    AV_PIX_FMT_YUV444P16LE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    AV_PIX_FMT_YUV444P16BE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+#if FF_API_VDPAU
+    AV_PIX_FMT_VDPAU_MPEG4,  ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+#endif
+    AV_PIX_FMT_DXVA2_VLD,    ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
+
+    AV_PIX_FMT_RGB444LE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
+    AV_PIX_FMT_RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
+    AV_PIX_FMT_BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
+    AV_PIX_FMT_BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
+    AV_PIX_FMT_Y400A,     ///< 8bit gray, 8bit alpha
+    AV_PIX_FMT_BGR48BE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
+    AV_PIX_FMT_BGR48LE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
+    AV_PIX_FMT_YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    AV_PIX_FMT_YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    AV_PIX_FMT_YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    AV_PIX_FMT_YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    AV_PIX_FMT_YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    AV_PIX_FMT_YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    AV_PIX_FMT_YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    AV_PIX_FMT_YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    AV_PIX_FMT_YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    AV_PIX_FMT_YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    AV_PIX_FMT_YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    AV_PIX_FMT_YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    AV_PIX_FMT_VDA_VLD,    ///< hardware decoding through VDA
+    AV_PIX_FMT_GBRP,      ///< planar GBR 4:4:4 24bpp
+    AV_PIX_FMT_GBRP9BE,   ///< planar GBR 4:4:4 27bpp, big-endian
+    AV_PIX_FMT_GBRP9LE,   ///< planar GBR 4:4:4 27bpp, little-endian
+    AV_PIX_FMT_GBRP10BE,  ///< planar GBR 4:4:4 30bpp, big-endian
+    AV_PIX_FMT_GBRP10LE,  ///< planar GBR 4:4:4 30bpp, little-endian
+    AV_PIX_FMT_GBRP16BE,  ///< planar GBR 4:4:4 48bpp, big-endian
+    AV_PIX_FMT_GBRP16LE,  ///< planar GBR 4:4:4 48bpp, little-endian
+    AV_PIX_FMT_YUVA422P,  ///< planar YUV 4:2:2 24bpp, (1 Cr & Cb sample per 2x1 Y & A samples)
+    AV_PIX_FMT_YUVA444P,  ///< planar YUV 4:4:4 32bpp, (1 Cr & Cb sample per 1x1 Y & A samples)
+    AV_PIX_FMT_YUVA420P9BE,  ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), big-endian
+    AV_PIX_FMT_YUVA420P9LE,  ///< planar YUV 4:2:0 22.5bpp, (1 Cr & Cb sample per 2x2 Y & A samples), little-endian
+    AV_PIX_FMT_YUVA422P9BE,  ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), big-endian
+    AV_PIX_FMT_YUVA422P9LE,  ///< planar YUV 4:2:2 27bpp, (1 Cr & Cb sample per 2x1 Y & A samples), little-endian
+    AV_PIX_FMT_YUVA444P9BE,  ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), big-endian
+    AV_PIX_FMT_YUVA444P9LE,  ///< planar YUV 4:4:4 36bpp, (1 Cr & Cb sample per 1x1 Y & A samples), little-endian
+    AV_PIX_FMT_YUVA420P10BE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
+    AV_PIX_FMT_YUVA420P10LE, ///< planar YUV 4:2:0 25bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
+    AV_PIX_FMT_YUVA422P10BE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
+    AV_PIX_FMT_YUVA422P10LE, ///< planar YUV 4:2:2 30bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
+    AV_PIX_FMT_YUVA444P10BE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
+    AV_PIX_FMT_YUVA444P10LE, ///< planar YUV 4:4:4 40bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
+    AV_PIX_FMT_YUVA420P16BE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, big-endian)
+    AV_PIX_FMT_YUVA420P16LE, ///< planar YUV 4:2:0 40bpp, (1 Cr & Cb sample per 2x2 Y & A samples, little-endian)
+    AV_PIX_FMT_YUVA422P16BE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, big-endian)
+    AV_PIX_FMT_YUVA422P16LE, ///< planar YUV 4:2:2 48bpp, (1 Cr & Cb sample per 2x1 Y & A samples, little-endian)
+    AV_PIX_FMT_YUVA444P16BE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, big-endian)
+    AV_PIX_FMT_YUVA444P16LE, ///< planar YUV 4:4:4 64bpp, (1 Cr & Cb sample per 1x1 Y & A samples, little-endian)
+    AV_PIX_FMT_VDPAU,     ///< HW acceleration through VDPAU, Picture.data[3] contains a VdpVideoSurface
+    AV_PIX_FMT_XYZ12LE,      ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as little-endian, the 4 lower bits are set to 0
+    AV_PIX_FMT_XYZ12BE,      ///< packed XYZ 4:4:4, 36 bpp, (msb) 12X, 12Y, 12Z (lsb), the 2-byte value for each X/Y/Z is stored as big-endian, the 4 lower bits are set to 0
+    AV_PIX_FMT_NV16,         ///< interleaved chroma YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
+    AV_PIX_FMT_NV20LE,       ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    AV_PIX_FMT_NV20BE,       ///< interleaved chroma YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    AV_PIX_FMT_NB,        ///< number of pixel formats, DO NOT USE THIS if you want to link with shared libav* because the number of formats might differ between versions
+
+#if FF_API_PIX_FMT
+#include "old_pix_fmts.h"
+#endif
+};
+
+#if AV_HAVE_BIGENDIAN
+#   define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##be
+#else
+#   define AV_PIX_FMT_NE(be, le) AV_PIX_FMT_##le
+#endif
+
+#define AV_PIX_FMT_RGB32   AV_PIX_FMT_NE(ARGB, BGRA)
+#define AV_PIX_FMT_RGB32_1 AV_PIX_FMT_NE(RGBA, ABGR)
+#define AV_PIX_FMT_BGR32   AV_PIX_FMT_NE(ABGR, RGBA)
+#define AV_PIX_FMT_BGR32_1 AV_PIX_FMT_NE(BGRA, ARGB)
+
+#define AV_PIX_FMT_GRAY16 AV_PIX_FMT_NE(GRAY16BE, GRAY16LE)
+#define AV_PIX_FMT_RGB48  AV_PIX_FMT_NE(RGB48BE,  RGB48LE)
+#define AV_PIX_FMT_RGB565 AV_PIX_FMT_NE(RGB565BE, RGB565LE)
+#define AV_PIX_FMT_RGB555 AV_PIX_FMT_NE(RGB555BE, RGB555LE)
+#define AV_PIX_FMT_RGB444 AV_PIX_FMT_NE(RGB444BE, RGB444LE)
+#define AV_PIX_FMT_BGR48  AV_PIX_FMT_NE(BGR48BE,  BGR48LE)
+#define AV_PIX_FMT_BGR565 AV_PIX_FMT_NE(BGR565BE, BGR565LE)
+#define AV_PIX_FMT_BGR555 AV_PIX_FMT_NE(BGR555BE, BGR555LE)
+#define AV_PIX_FMT_BGR444 AV_PIX_FMT_NE(BGR444BE, BGR444LE)
+
+#define AV_PIX_FMT_YUV420P9  AV_PIX_FMT_NE(YUV420P9BE , YUV420P9LE)
+#define AV_PIX_FMT_YUV422P9  AV_PIX_FMT_NE(YUV422P9BE , YUV422P9LE)
+#define AV_PIX_FMT_YUV444P9  AV_PIX_FMT_NE(YUV444P9BE , YUV444P9LE)
+#define AV_PIX_FMT_YUV420P10 AV_PIX_FMT_NE(YUV420P10BE, YUV420P10LE)
+#define AV_PIX_FMT_YUV422P10 AV_PIX_FMT_NE(YUV422P10BE, YUV422P10LE)
+#define AV_PIX_FMT_YUV444P10 AV_PIX_FMT_NE(YUV444P10BE, YUV444P10LE)
+#define AV_PIX_FMT_YUV420P16 AV_PIX_FMT_NE(YUV420P16BE, YUV420P16LE)
+#define AV_PIX_FMT_YUV422P16 AV_PIX_FMT_NE(YUV422P16BE, YUV422P16LE)
+#define AV_PIX_FMT_YUV444P16 AV_PIX_FMT_NE(YUV444P16BE, YUV444P16LE)
+
+#define AV_PIX_FMT_GBRP9     AV_PIX_FMT_NE(GBRP9BE ,    GBRP9LE)
+#define AV_PIX_FMT_GBRP10    AV_PIX_FMT_NE(GBRP10BE,    GBRP10LE)
+#define AV_PIX_FMT_GBRP16    AV_PIX_FMT_NE(GBRP16BE,    GBRP16LE)
+
+#define AV_PIX_FMT_YUVA420P9  AV_PIX_FMT_NE(YUVA420P9BE , YUVA420P9LE)
+#define AV_PIX_FMT_YUVA422P9  AV_PIX_FMT_NE(YUVA422P9BE , YUVA422P9LE)
+#define AV_PIX_FMT_YUVA444P9  AV_PIX_FMT_NE(YUVA444P9BE , YUVA444P9LE)
+#define AV_PIX_FMT_YUVA420P10 AV_PIX_FMT_NE(YUVA420P10BE, YUVA420P10LE)
+#define AV_PIX_FMT_YUVA422P10 AV_PIX_FMT_NE(YUVA422P10BE, YUVA422P10LE)
+#define AV_PIX_FMT_YUVA444P10 AV_PIX_FMT_NE(YUVA444P10BE, YUVA444P10LE)
+#define AV_PIX_FMT_YUVA420P16 AV_PIX_FMT_NE(YUVA420P16BE, YUVA420P16LE)
+#define AV_PIX_FMT_YUVA422P16 AV_PIX_FMT_NE(YUVA422P16BE, YUVA422P16LE)
+#define AV_PIX_FMT_YUVA444P16 AV_PIX_FMT_NE(YUVA444P16BE, YUVA444P16LE)
+
+#define AV_PIX_FMT_XYZ12      AV_PIX_FMT_NE(XYZ12BE, XYZ12LE)
+#define AV_PIX_FMT_NV20       AV_PIX_FMT_NE(NV20BE,  NV20LE)
+
+#if FF_API_PIX_FMT
+#define PixelFormat AVPixelFormat
+
+#define PIX_FMT_NE(be, le) AV_PIX_FMT_NE(be, le)
+
+#define PIX_FMT_RGB32   AV_PIX_FMT_RGB32
+#define PIX_FMT_RGB32_1 AV_PIX_FMT_RGB32_1
+#define PIX_FMT_BGR32   AV_PIX_FMT_BGR32
+#define PIX_FMT_BGR32_1 AV_PIX_FMT_BGR32_1
+
+#define PIX_FMT_GRAY16 AV_PIX_FMT_GRAY16
+#define PIX_FMT_RGB48  AV_PIX_FMT_RGB48
+#define PIX_FMT_RGB565 AV_PIX_FMT_RGB565
+#define PIX_FMT_RGB555 AV_PIX_FMT_RGB555
+#define PIX_FMT_RGB444 AV_PIX_FMT_RGB444
+#define PIX_FMT_BGR48  AV_PIX_FMT_BGR48
+#define PIX_FMT_BGR565 AV_PIX_FMT_BGR565
+#define PIX_FMT_BGR555 AV_PIX_FMT_BGR555
+#define PIX_FMT_BGR444 AV_PIX_FMT_BGR444
+
+#define PIX_FMT_YUV420P9  AV_PIX_FMT_YUV420P9
+#define PIX_FMT_YUV422P9  AV_PIX_FMT_YUV422P9
+#define PIX_FMT_YUV444P9  AV_PIX_FMT_YUV444P9
+#define PIX_FMT_YUV420P10 AV_PIX_FMT_YUV420P10
+#define PIX_FMT_YUV422P10 AV_PIX_FMT_YUV422P10
+#define PIX_FMT_YUV444P10 AV_PIX_FMT_YUV444P10
+#define PIX_FMT_YUV420P16 AV_PIX_FMT_YUV420P16
+#define PIX_FMT_YUV422P16 AV_PIX_FMT_YUV422P16
+#define PIX_FMT_YUV444P16 AV_PIX_FMT_YUV444P16
+
+#define PIX_FMT_GBRP9  AV_PIX_FMT_GBRP9
+#define PIX_FMT_GBRP10 AV_PIX_FMT_GBRP10
+#define PIX_FMT_GBRP16 AV_PIX_FMT_GBRP16
+#endif
+
+#endif /* AVUTIL_PIXFMT_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/random_seed.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/random_seed.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/random_seed.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/random_seed.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/rational.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/rational.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/rational.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/rational.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/samplefmt.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/samplefmt.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/samplefmt.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/samplefmt.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/sha.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/sha.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/sha.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/sha.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/stereo3d.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/stereo3d.h
new file mode 100644
index 0000000..695d6f1
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/stereo3d.h
@@ -0,0 +1,147 @@
+/*
+ * Copyright (c) 2013 Vittorio Giovara <vittorio.giovara at gmail.com>
+ *
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+#include "frame.h"
+
+/**
+ * List of possible 3D Types
+ */
+enum AVStereo3DType {
+    /**
+     * Video is not stereoscopic (and metadata has to be there).
+     */
+    AV_STEREO3D_2D,
+
+    /**
+     * Views are next to each other.
+     *
+     *    LLLLRRRR
+     *    LLLLRRRR
+     *    LLLLRRRR
+     *    ...
+     */
+    AV_STEREO3D_SIDEBYSIDE,
+
+    /**
+     * Views are on top of each other.
+     *
+     *    LLLLLLLL
+     *    LLLLLLLL
+     *    RRRRRRRR
+     *    RRRRRRRR
+     */
+    AV_STEREO3D_TOPBOTTOM,
+
+    /**
+     * Views are alternated temporally.
+     *
+     *     frame0   frame1   frame2   ...
+     *    LLLLLLLL RRRRRRRR LLLLLLLL
+     *    LLLLLLLL RRRRRRRR LLLLLLLL
+     *    LLLLLLLL RRRRRRRR LLLLLLLL
+     *    ...      ...      ...
+     */
+    AV_STEREO3D_FRAMESEQUENCE,
+
+    /**
+     * Views are packed in a checkerboard-like structure per pixel.
+     *
+     *    LRLRLRLR
+     *    RLRLRLRL
+     *    LRLRLRLR
+     *    ...
+     */
+    AV_STEREO3D_CHECKERBOARD,
+
+    /**
+     * Views are next to each other, but when upscaling
+     * apply a checkerboard pattern.
+     *
+     *     LLLLRRRR          L L L L    R R R R
+     *     LLLLRRRR    =>     L L L L  R R R R
+     *     LLLLRRRR          L L L L    R R R R
+     *     LLLLRRRR           L L L L  R R R R
+     */
+    AV_STEREO3D_SIDEBYSIDE_QUINCUNX,
+
+    /**
+     * Views are packed per line, as if interlaced.
+     *
+     *    LLLLLLLL
+     *    RRRRRRRR
+     *    LLLLLLLL
+     *    ...
+     */
+    AV_STEREO3D_LINES,
+
+    /**
+     * Views are packed per column.
+     *
+     *    LRLRLRLR
+     *    LRLRLRLR
+     *    LRLRLRLR
+     *    ...
+     */
+    AV_STEREO3D_COLUMNS,
+};
+
+
+/**
+ * Inverted views, Right/Bottom represents the left view.
+ */
+#define AV_STEREO3D_FLAG_INVERT     (1 << 0)
+
+/**
+ * Stereo 3D type: this structure describes how two videos are packed
+ * within a single video surface, with additional information as needed.
+ *
+ * @note The struct must be allocated with av_stereo3d_alloc() and
+ *       its size is not a part of the public ABI.
+ */
+typedef struct AVStereo3D {
+    /**
+     * How views are packed within the video.
+     */
+    enum AVStereo3DType type;
+
+    /**
+     * Additional information about the frame packing.
+     */
+    int flags;
+} AVStereo3D;
+
+/**
+ * Allocate an AVStereo3D structure and set its fields to default values.
+ * The resulting struct can be freed using av_freep().
+ *
+ * @return An AVStereo3D filled with default values or NULL on failure.
+ */
+AVStereo3D *av_stereo3d_alloc(void);
+
+/**
+ * Allocate a complete AVFrameSideData and add it to the frame.
+ *
+ * @param frame The frame which side data is added to.
+ *
+ * @return The AVStereo3D structure to be filled by caller.
+ */
+AVStereo3D *av_stereo3d_create_side_data(AVFrame *frame);
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/time.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/time.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/time.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/time.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/version.h
new file mode 100644
index 0000000..5196a67
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/version.h
@@ -0,0 +1,116 @@
+/*
+ * This file is part of Libav.
+ *
+ * Libav is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * Libav is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Libav; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef AVUTIL_VERSION_H
+#define AVUTIL_VERSION_H
+
+#include "macros.h"
+
+/**
+ * @defgroup version_utils Library Version Macros
+ *
+ * Useful to check and match library version in order to maintain
+ * backward compatibility.
+ *
+ * @{
+ */
+
+#define AV_VERSION_INT(a, b, c) (a<<16 | b<<8 | c)
+#define AV_VERSION_DOT(a, b, c) a ##.## b ##.## c
+#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
+
+/**
+ * @}
+ */
+
+/**
+ * @file
+ * @ingroup lavu
+ * Libavutil version macros
+ */
+
+/**
+ * @defgroup lavu_ver Version and Build diagnostics
+ *
+ * Macros and function useful to check at compiletime and at runtime
+ * which version of libavutil is in use.
+ *
+ * @{
+ */
+
+#define LIBAVUTIL_VERSION_MAJOR 53
+#define LIBAVUTIL_VERSION_MINOR  3
+#define LIBAVUTIL_VERSION_MICRO  0
+
+#define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
+                                               LIBAVUTIL_VERSION_MINOR, \
+                                               LIBAVUTIL_VERSION_MICRO)
+#define LIBAVUTIL_VERSION       AV_VERSION(LIBAVUTIL_VERSION_MAJOR,     \
+                                           LIBAVUTIL_VERSION_MINOR,     \
+                                           LIBAVUTIL_VERSION_MICRO)
+#define LIBAVUTIL_BUILD         LIBAVUTIL_VERSION_INT
+
+#define LIBAVUTIL_IDENT         "Lavu" AV_STRINGIFY(LIBAVUTIL_VERSION)
+
+/**
+ * @}
+ *
+ * @defgroup depr_guards Deprecation guards
+ * FF_API_* defines may be placed below to indicate public API that will be
+ * dropped at a future version bump. The defines themselves are not part of
+ * the public API and may change, break or disappear at any time.
+ *
+ * @{
+ */
+
+#ifndef FF_API_PIX_FMT
+#define FF_API_PIX_FMT                  (LIBAVUTIL_VERSION_MAJOR < 54)
+#endif
+#ifndef FF_API_CONTEXT_SIZE
+#define FF_API_CONTEXT_SIZE             (LIBAVUTIL_VERSION_MAJOR < 54)
+#endif
+#ifndef FF_API_PIX_FMT_DESC
+#define FF_API_PIX_FMT_DESC             (LIBAVUTIL_VERSION_MAJOR < 54)
+#endif
+#ifndef FF_API_AV_REVERSE
+#define FF_API_AV_REVERSE               (LIBAVUTIL_VERSION_MAJOR < 54)
+#endif
+#ifndef FF_API_AUDIOCONVERT
+#define FF_API_AUDIOCONVERT             (LIBAVUTIL_VERSION_MAJOR < 54)
+#endif
+#ifndef FF_API_CPU_FLAG_MMX2
+#define FF_API_CPU_FLAG_MMX2            (LIBAVUTIL_VERSION_MAJOR < 54)
+#endif
+#ifndef FF_API_LLS_PRIVATE
+#define FF_API_LLS_PRIVATE              (LIBAVUTIL_VERSION_MAJOR < 54)
+#endif
+#ifndef FF_API_AVFRAME_LAVC
+#define FF_API_AVFRAME_LAVC             (LIBAVUTIL_VERSION_MAJOR < 54)
+#endif
+#ifndef FF_API_VDPAU
+#define FF_API_VDPAU                    (LIBAVUTIL_VERSION_MAJOR < 54)
+#endif
+#ifndef FF_API_XVMC
+#define FF_API_XVMC                     (LIBAVUTIL_VERSION_MAJOR < 54)
+#endif
+
+/**
+ * @}
+ */
+
+#endif /* AVUTIL_VERSION_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/xtea.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/xtea.h
similarity index 100%
rename from make/stub_includes/libav/lavc55_lavf55_lavu52_lavr01/libavutil/xtea.h
rename to make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libavutil/xtea.h
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libswresample/swresample.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libswresample/swresample.h
new file mode 100644
index 0000000..4ba008e
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libswresample/swresample.h
@@ -0,0 +1,318 @@
+/*
+ * Copyright (C) 2011-2013 Michael Niedermayer (michaelni at gmx.at)
+ *
+ * This file is part of libswresample
+ *
+ * libswresample is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * libswresample is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with libswresample; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef SWRESAMPLE_SWRESAMPLE_H
+#define SWRESAMPLE_SWRESAMPLE_H
+
+/**
+ * @file
+ * @ingroup lswr
+ * libswresample public header
+ */
+
+/**
+ * @defgroup lswr Libswresample
+ * @{
+ *
+ * Libswresample (lswr) is a library that handles audio resampling, sample
+ * format conversion and mixing.
+ *
+ * Interaction with lswr is done through SwrContext, which is
+ * allocated with swr_alloc() or swr_alloc_set_opts(). It is opaque, so all parameters
+ * must be set with the @ref avoptions API.
+ *
+ * For example the following code will setup conversion from planar float sample
+ * format to interleaved signed 16-bit integer, downsampling from 48kHz to
+ * 44.1kHz and downmixing from 5.1 channels to stereo (using the default mixing
+ * matrix):
+ * @code
+ * SwrContext *swr = swr_alloc();
+ * av_opt_set_channel_layout(swr, "in_channel_layout",  AV_CH_LAYOUT_5POINT1, 0);
+ * av_opt_set_channel_layout(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO,  0);
+ * av_opt_set_int(swr, "in_sample_rate",     48000,                0);
+ * av_opt_set_int(swr, "out_sample_rate",    44100,                0);
+ * av_opt_set_sample_fmt(swr, "in_sample_fmt",  AV_SAMPLE_FMT_FLTP, 0);
+ * av_opt_set_sample_fmt(swr, "out_sample_fmt", AV_SAMPLE_FMT_S16,  0);
+ * @endcode
+ *
+ * Once all values have been set, it must be initialized with swr_init(). If
+ * you need to change the conversion parameters, you can change the parameters
+ * as described above, or by using swr_alloc_set_opts(), then call swr_init()
+ * again.
+ *
+ * The conversion itself is done by repeatedly calling swr_convert().
+ * Note that the samples may get buffered in swr if you provide insufficient
+ * output space or if sample rate conversion is done, which requires "future"
+ * samples. Samples that do not require future input can be retrieved at any
+ * time by using swr_convert() (in_count can be set to 0).
+ * At the end of conversion the resampling buffer can be flushed by calling
+ * swr_convert() with NULL in and 0 in_count.
+ *
+ * The delay between input and output, can at any time be found by using
+ * swr_get_delay().
+ *
+ * The following code demonstrates the conversion loop assuming the parameters
+ * from above and caller-defined functions get_input() and handle_output():
+ * @code
+ * uint8_t **input;
+ * int in_samples;
+ *
+ * while (get_input(&input, &in_samples)) {
+ *     uint8_t *output;
+ *     int out_samples = av_rescale_rnd(swr_get_delay(swr, 48000) +
+ *                                      in_samples, 44100, 48000, AV_ROUND_UP);
+ *     av_samples_alloc(&output, NULL, 2, out_samples,
+ *                      AV_SAMPLE_FMT_S16, 0);
+ *     out_samples = swr_convert(swr, &output, out_samples,
+ *                                      input, in_samples);
+ *     handle_output(output, out_samples);
+ *     av_freep(&output);
+ * }
+ * @endcode
+ *
+ * When the conversion is finished, the conversion
+ * context and everything associated with it must be freed with swr_free().
+ * There will be no memory leak if the data is not completely flushed before
+ * swr_free().
+ */
+
+#include <stdint.h>
+#include "libavutil/samplefmt.h"
+
+#include "libswresample/version.h"
+
+#if LIBSWRESAMPLE_VERSION_MAJOR < 1
+#define SWR_CH_MAX 32   ///< Maximum number of channels
+#endif
+
+#define SWR_FLAG_RESAMPLE 1 ///< Force resampling even if equal sample rate
+//TODO use int resample ?
+//long term TODO can we enable this dynamically?
+
+enum SwrDitherType {
+    SWR_DITHER_NONE = 0,
+    SWR_DITHER_RECTANGULAR,
+    SWR_DITHER_TRIANGULAR,
+    SWR_DITHER_TRIANGULAR_HIGHPASS,
+
+    SWR_DITHER_NS = 64,         ///< not part of API/ABI
+    SWR_DITHER_NS_LIPSHITZ,
+    SWR_DITHER_NS_F_WEIGHTED,
+    SWR_DITHER_NS_MODIFIED_E_WEIGHTED,
+    SWR_DITHER_NS_IMPROVED_E_WEIGHTED,
+    SWR_DITHER_NS_SHIBATA,
+    SWR_DITHER_NS_LOW_SHIBATA,
+    SWR_DITHER_NS_HIGH_SHIBATA,
+    SWR_DITHER_NB,              ///< not part of API/ABI
+};
+
+/** Resampling Engines */
+enum SwrEngine {
+    SWR_ENGINE_SWR,             /**< SW Resampler */
+    SWR_ENGINE_SOXR,            /**< SoX Resampler */
+    SWR_ENGINE_NB,              ///< not part of API/ABI
+};
+
+/** Resampling Filter Types */
+enum SwrFilterType {
+    SWR_FILTER_TYPE_CUBIC,              /**< Cubic */
+    SWR_FILTER_TYPE_BLACKMAN_NUTTALL,   /**< Blackman Nuttall Windowed Sinc */
+    SWR_FILTER_TYPE_KAISER,             /**< Kaiser Windowed Sinc */
+};
+
+typedef struct SwrContext SwrContext;
+
+/**
+ * Get the AVClass for swrContext. It can be used in combination with
+ * AV_OPT_SEARCH_FAKE_OBJ for examining options.
+ *
+ * @see av_opt_find().
+ */
+const AVClass *swr_get_class(void);
+
+/**
+ * Allocate SwrContext.
+ *
+ * If you use this function you will need to set the parameters (manually or
+ * with swr_alloc_set_opts()) before calling swr_init().
+ *
+ * @see swr_alloc_set_opts(), swr_init(), swr_free()
+ * @return NULL on error, allocated context otherwise
+ */
+struct SwrContext *swr_alloc(void);
+
+/**
+ * Initialize context after user parameters have been set.
+ *
+ * @return AVERROR error code in case of failure.
+ */
+int swr_init(struct SwrContext *s);
+
+/**
+ * Check whether an swr context has been initialized or not.
+ *
+ * @return positive if it has been initialized, 0 if not initialized
+ */
+int swr_is_initialized(struct SwrContext *s);
+
+/**
+ * Allocate SwrContext if needed and set/reset common parameters.
+ *
+ * This function does not require s to be allocated with swr_alloc(). On the
+ * other hand, swr_alloc() can use swr_alloc_set_opts() to set the parameters
+ * on the allocated context.
+ *
+ * @param s               Swr context, can be NULL
+ * @param out_ch_layout   output channel layout (AV_CH_LAYOUT_*)
+ * @param out_sample_fmt  output sample format (AV_SAMPLE_FMT_*).
+ * @param out_sample_rate output sample rate (frequency in Hz)
+ * @param in_ch_layout    input channel layout (AV_CH_LAYOUT_*)
+ * @param in_sample_fmt   input sample format (AV_SAMPLE_FMT_*).
+ * @param in_sample_rate  input sample rate (frequency in Hz)
+ * @param log_offset      logging level offset
+ * @param log_ctx         parent logging context, can be NULL
+ *
+ * @see swr_init(), swr_free()
+ * @return NULL on error, allocated context otherwise
+ */
+struct SwrContext *swr_alloc_set_opts(struct SwrContext *s,
+                                      int64_t out_ch_layout, enum AVSampleFormat out_sample_fmt, int out_sample_rate,
+                                      int64_t  in_ch_layout, enum AVSampleFormat  in_sample_fmt, int  in_sample_rate,
+                                      int log_offset, void *log_ctx);
+
+/**
+ * Free the given SwrContext and set the pointer to NULL.
+ */
+void swr_free(struct SwrContext **s);
+
+/**
+ * Convert audio.
+ *
+ * in and in_count can be set to 0 to flush the last few samples out at the
+ * end.
+ *
+ * If more input is provided than output space then the input will be buffered.
+ * You can avoid this buffering by providing more output space than input.
+ * Convertion will run directly without copying whenever possible.
+ *
+ * @param s         allocated Swr context, with parameters set
+ * @param out       output buffers, only the first one need be set in case of packed audio
+ * @param out_count amount of space available for output in samples per channel
+ * @param in        input buffers, only the first one need to be set in case of packed audio
+ * @param in_count  number of input samples available in one channel
+ *
+ * @return number of samples output per channel, negative value on error
+ */
+int swr_convert(struct SwrContext *s, uint8_t **out, int out_count,
+                                const uint8_t **in , int in_count);
+
+/**
+ * Convert the next timestamp from input to output
+ * timestamps are in 1/(in_sample_rate * out_sample_rate) units.
+ *
+ * @note There are 2 slightly differently behaving modes.
+ *       First is when automatic timestamp compensation is not used, (min_compensation >= FLT_MAX)
+ *              in this case timestamps will be passed through with delays compensated
+ *       Second is when automatic timestamp compensation is used, (min_compensation < FLT_MAX)
+ *              in this case the output timestamps will match output sample numbers
+ *
+ * @param pts   timestamp for the next input sample, INT64_MIN if unknown
+ * @return the output timestamp for the next output sample
+ */
+int64_t swr_next_pts(struct SwrContext *s, int64_t pts);
+
+/**
+ * Activate resampling compensation.
+ */
+int swr_set_compensation(struct SwrContext *s, int sample_delta, int compensation_distance);
+
+/**
+ * Set a customized input channel mapping.
+ *
+ * @param s           allocated Swr context, not yet initialized
+ * @param channel_map customized input channel mapping (array of channel
+ *                    indexes, -1 for a muted channel)
+ * @return AVERROR error code in case of failure.
+ */
+int swr_set_channel_mapping(struct SwrContext *s, const int *channel_map);
+
+/**
+ * Set a customized remix matrix.
+ *
+ * @param s       allocated Swr context, not yet initialized
+ * @param matrix  remix coefficients; matrix[i + stride * o] is
+ *                the weight of input channel i in output channel o
+ * @param stride  offset between lines of the matrix
+ * @return  AVERROR error code in case of failure.
+ */
+int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride);
+
+/**
+ * Drops the specified number of output samples.
+ */
+int swr_drop_output(struct SwrContext *s, int count);
+
+/**
+ * Injects the specified number of silence samples.
+ */
+int swr_inject_silence(struct SwrContext *s, int count);
+
+/**
+ * Gets the delay the next input sample will experience relative to the next output sample.
+ *
+ * Swresample can buffer data if more input has been provided than available
+ * output space, also converting between sample rates needs a delay.
+ * This function returns the sum of all such delays.
+ * The exact delay is not necessarily an integer value in either input or
+ * output sample rate. Especially when downsampling by a large value, the
+ * output sample rate may be a poor choice to represent the delay, similarly
+ * for upsampling and the input sample rate.
+ *
+ * @param s     swr context
+ * @param base  timebase in which the returned delay will be
+ *              if its set to 1 the returned delay is in seconds
+ *              if its set to 1000 the returned delay is in milli seconds
+ *              if its set to the input sample rate then the returned delay is in input samples
+ *              if its set to the output sample rate then the returned delay is in output samples
+ *              an exact rounding free delay can be found by using LCM(in_sample_rate, out_sample_rate)
+ * @returns     the delay in 1/base units.
+ */
+int64_t swr_get_delay(struct SwrContext *s, int64_t base);
+
+/**
+ * Return the LIBSWRESAMPLE_VERSION_INT constant.
+ */
+unsigned swresample_version(void);
+
+/**
+ * Return the swr build-time configuration.
+ */
+const char *swresample_configuration(void);
+
+/**
+ * Return the swr license.
+ */
+const char *swresample_license(void);
+
+/**
+ * @}
+ */
+
+#endif /* SWRESAMPLE_SWRESAMPLE_H */
diff --git a/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libswresample/version.h b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libswresample/version.h
new file mode 100644
index 0000000..3a92875
--- /dev/null
+++ b/make/stub_includes/libav/lavc55_lavf55_lavu53_lavr01/libswresample/version.h
@@ -0,0 +1,45 @@
+/*
+ * Version macros.
+ *
+ * This file is part of libswresample
+ *
+ * libswresample is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * libswresample is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with libswresample; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef SWR_VERSION_H
+#define SWR_VERSION_H
+
+/**
+ * @file
+ * Libswresample version macros
+ */
+
+#include "libavutil/avutil.h"
+
+#define LIBSWRESAMPLE_VERSION_MAJOR 0
+#define LIBSWRESAMPLE_VERSION_MINOR 18
+#define LIBSWRESAMPLE_VERSION_MICRO 100
+
+#define LIBSWRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
+                                                  LIBSWRESAMPLE_VERSION_MINOR, \
+                                                  LIBSWRESAMPLE_VERSION_MICRO)
+#define LIBSWRESAMPLE_VERSION      AV_VERSION(LIBSWRESAMPLE_VERSION_MAJOR, \
+                                              LIBSWRESAMPLE_VERSION_MINOR, \
+                                              LIBSWRESAMPLE_VERSION_MICRO)
+#define LIBSWRESAMPLE_BUILD        LIBSWRESAMPLE_VERSION_INT
+
+#define LIBSWRESAMPLE_IDENT        "SwR" AV_STRINGIFY(LIBSWRESAMPLE_VERSION)
+
+#endif /* SWR_VERSION_H */
diff --git a/make/stub_includes/opengl/macosx-window-system.h b/make/stub_includes/opengl/macosx-window-system.h
index 2bfe86a..96643fc 100644
--- a/make/stub_includes/opengl/macosx-window-system.h
+++ b/make/stub_includes/opengl/macosx-window-system.h
@@ -56,7 +56,8 @@ void setContextPBuffer(NSOpenGLContext* ctx, NSOpenGLPixelBuffer* pBuffer);
 void setContextTextureImageToPBuffer(NSOpenGLContext* ctx, NSOpenGLPixelBuffer* pBuffer, GLenum colorBuffer);
 Bool isNSOpenGLPixelBuffer(uint64_t object);
 
-NSOpenGLLayer* createNSOpenGLLayer(NSOpenGLContext* ctx, int gl3ShaderProgramName, NSOpenGLPixelFormat* fmt, NSOpenGLPixelBuffer* p, uint32_t texID, Bool opaque, int texWidth, int texHeight);
+NSOpenGLLayer* createNSOpenGLLayer(NSOpenGLContext* ctx, int gl3ShaderProgramName, NSOpenGLPixelFormat* fmt, NSOpenGLPixelBuffer* p, uint32_t texID, Bool opaque, 
+                                   int texWidth, int texHeight, int winWidth, int winHeight);
 void setNSOpenGLLayerEnabled(NSOpenGLLayer* layer, Bool enable);
 void setNSOpenGLLayerSwapInterval(NSOpenGLLayer* layer, int interval);
 void waitUntilNSOpenGLLayerIsReady(NSOpenGLLayer* layer, long to_micros);
diff --git a/make/stub_includes/win32/wingdi.h b/make/stub_includes/win32/wingdi.h
index 7a88582..e252b3b 100644
--- a/make/stub_includes/win32/wingdi.h
+++ b/make/stub_includes/win32/wingdi.h
@@ -48,8 +48,10 @@ WINUSERAPI HWND WINAPI GetParent(HWND hWnd);
 WINUSERAPI HWND WINAPI SetParent(HWND hWndChild,HWND hWndNewParent);
 
 WINUSERAPI HANDLE WINAPI GetCurrentProcess(void);
-WINUSERAPI BOOL WINAPI GetProcessAffinityMask(HANDLE hProcess,PDWORD_PTR lpProcessAffinityMask,PDWORD_PTR lpSystemAffinityMask);
-WINUSERAPI BOOL WINAPI SetProcessAffinityMask(HANDLE hProcess,DWORD_PTR dwProcessAffinityMask);
+WINUSERAPI HANDLE WINAPI GetCurrentThread(void);
+WINUSERAPI BOOL WINAPI GetProcessAffinityMask(HANDLE hProcess, PDWORD_PTR lpProcessAffinityMask, PDWORD_PTR lpSystemAffinityMask);
+WINUSERAPI BOOL WINAPI SetProcessAffinityMask(HANDLE hProcess, DWORD_PTR dwProcessAffinityMask);
+WINUSERAPI DWORD_PTR WINAPI SetThreadAffinityMask(HANDLE hThread, DWORD_PTR dwThreadAffinityMask);
 
 
 // Routines for changing gamma ramp of display device
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java
index 83f5e4e..fef9d61 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Audio.java
@@ -36,7 +36,7 @@ import java.io.*;
 
 public class Audio {
     private static Audio instance = null;
-    private Mixer mixer;
+    private final Mixer mixer;
 
     public synchronized static Audio getInstance() {
         if (instance == null) {
@@ -53,9 +53,9 @@ public class Audio {
         return mixer;
     }
 
-    public Track newTrack(File file) throws IOException
+    public Track newTrack(final File file) throws IOException
     {
-        Track res = new Track(file);
+        final Track res = new Track(file);
         mixer.add(res);
         return res;
     }
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java
index b36fd26..bbfe72b 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Mixer.java
@@ -48,12 +48,12 @@ public class Mixer {
     private volatile boolean shutdownDone;
 
     // Windows Event object
-    private long event;
+    private final long event;
 
     private volatile ArrayList<Track> tracks = new ArrayList<Track>();
 
-    private Vec3f leftSpeakerPosition  = new Vec3f(-1, 0, 0);
-    private Vec3f rightSpeakerPosition = new Vec3f( 1, 0, 0);
+    private final Vec3f leftSpeakerPosition  = new Vec3f(-1, 0, 0);
+    private final Vec3f rightSpeakerPosition = new Vec3f( 1, 0, 0);
 
     private float falloffFactor = 1.0f;
 
@@ -64,7 +64,7 @@ public class Mixer {
     private Mixer() {
         event = CreateEvent();
         new FillerThread().start();
-        MixerThread m = new MixerThread();
+        final MixerThread m = new MixerThread();
         m.setPriority(Thread.MAX_PRIORITY - 1);
         m.start();
     }
@@ -73,14 +73,14 @@ public class Mixer {
         return mixer;
     }
 
-    synchronized void add(Track track) {
-        ArrayList<Track> newTracks = new ArrayList<Track>(tracks);
+    synchronized void add(final Track track) {
+        final ArrayList<Track> newTracks = new ArrayList<Track>(tracks);
         newTracks.add(track);
         tracks = newTracks;
     }
 
-    synchronized void remove(Track track) {
-        ArrayList<Track> newTracks = new ArrayList<Track>(tracks);
+    synchronized void remove(final Track track) {
+        final ArrayList<Track> newTracks = new ArrayList<Track>(tracks);
         newTracks.remove(track);
         tracks = newTracks;
     }
@@ -88,14 +88,14 @@ public class Mixer {
     // NOTE: due to a bug on the APX device, we only have mono sounds,
     // so we currently only pay attention to the position of the left
     // speaker
-    public void setLeftSpeakerPosition(float x, float y, float z) {
+    public void setLeftSpeakerPosition(final float x, final float y, final float z) {
         leftSpeakerPosition.set(x, y, z);
     }
 
     // NOTE: due to a bug on the APX device, we only have mono sounds,
     // so we currently only pay attention to the position of the left
     // speaker
-    public void setRightSpeakerPosition(float x, float y, float z) {
+    public void setRightSpeakerPosition(final float x, final float y, final float z) {
         rightSpeakerPosition.set(x, y, z);
     }
 
@@ -109,7 +109,7 @@ public class Mixer {
   falloffFactor + r^2
 </PRE>
 */
-    public void setFalloffFactor(float factor) {
+    public void setFalloffFactor(final float factor) {
         falloffFactor = factor;
     }
 
@@ -119,7 +119,7 @@ public class Mixer {
             SetEvent(event);
             try {
                 shutdownLock.wait();
-            } catch (InterruptedException e) {
+            } catch (final InterruptedException e) {
             }
         }
     }
@@ -132,13 +132,13 @@ public class Mixer {
         @Override
         public void run() {
             while (!shutdown) {
-                List<Track> curTracks = tracks;
+                final List<Track> curTracks = tracks;
 
-                for (Iterator<Track> iter = curTracks.iterator(); iter.hasNext(); ) {
-                    Track track = iter.next();
+                for (final Iterator<Track> iter = curTracks.iterator(); iter.hasNext(); ) {
+                    final Track track = iter.next();
                     try {
                         track.fill();
-                    } catch (IOException e) {
+                    } catch (final IOException e) {
                         e.printStackTrace();
                         remove(track);
                     }
@@ -147,7 +147,7 @@ public class Mixer {
                 try {
                     // Run ten times per second
                     Thread.sleep(100);
-                } catch (InterruptedException e) {
+                } catch (final InterruptedException e) {
                     e.printStackTrace();
                 }
             }
@@ -158,7 +158,7 @@ public class Mixer {
         // Temporary mixing buffer
         // Interleaved left and right channels
         float[] mixingBuffer;
-        private Vec3f temp = new Vec3f();
+        private final Vec3f temp = new Vec3f();
 
         MixerThread() {
             super("Mixer Thread");
@@ -171,7 +171,7 @@ public class Mixer {
         public void run() {
             while (!shutdown) {
                 // Get the next buffer
-                long mixerBuffer = getNextMixerBuffer();
+                final long mixerBuffer = getNextMixerBuffer();
                 if (mixerBuffer != 0) {
                     ByteBuffer buf = getMixerBufferData(mixerBuffer);
 
@@ -203,27 +203,27 @@ public class Mixer {
 
                     // This assertion should be in place if we have stereo
                     if ((mixingBuffer.length % 2) != 0) {
-                        String msg = "FATAL ERROR: odd number of samples in the mixing buffer";
+                        final String msg = "FATAL ERROR: odd number of samples in the mixing buffer";
                         System.out.println(msg);
                         throw new InternalError(msg);
                     }
 
                     // Run down all of the registered tracks mixing them in
-                    List<Track> curTracks = tracks;
+                    final List<Track> curTracks = tracks;
 
-                    for (Iterator<Track> iter = curTracks.iterator(); iter.hasNext(); ) {
-                        Track track = iter.next();
+                    for (final Iterator<Track> iter = curTracks.iterator(); iter.hasNext(); ) {
+                        final Track track = iter.next();
                         // Consider only playing tracks
                         if (track.isPlaying()) {
                             // First recompute its gain
-                            Vec3f pos = track.getPosition();
-                            float leftGain  = gain(pos, leftSpeakerPosition);
-                            float rightGain = gain(pos, rightSpeakerPosition);
+                            final Vec3f pos = track.getPosition();
+                            final float leftGain  = gain(pos, leftSpeakerPosition);
+                            final float rightGain = gain(pos, rightSpeakerPosition);
                             // Now mix it in
                             int i = 0;
                             while (i < mixingBuffer.length) {
                                 if (track.hasNextSample()) {
-                                    float sample = track.nextSample();
+                                    final float sample = track.nextSample();
                                     mixingBuffer[i++] = sample * leftGain;
                                     mixingBuffer[i++] = sample * rightGain;
                                 } else {
@@ -240,7 +240,7 @@ public class Mixer {
                     // Now that we have our data, send it down to the card
                     int outPos = 0;
                     for (int i = 0; i < mixingBuffer.length; i++) {
-                        short val = (short) mixingBuffer[i];
+                        final short val = (short) mixingBuffer[i];
                         buf.put(outPos++, (byte)  val);
                         buf.put(outPos++, (byte) (val >> 8));
                     }
@@ -279,9 +279,9 @@ public class Mixer {
         //    falloffFactor
         // -------------------
         // falloffFactor + r^2
-        private float gain(Vec3f pos, Vec3f speakerPos) {
+        private float gain(final Vec3f pos, final Vec3f speakerPos) {
             temp.sub(pos, speakerPos);
-            float dotp = temp.dot(temp);
+            final float dotp = temp.dot(temp);
             return (falloffFactor / (falloffFactor + dotp));
         }
     }
@@ -321,8 +321,8 @@ public class Mixer {
     private static Constructor directByteBufferConstructor;
     private static Map createdBuffers = new HashMap(); // Map Long, ByteBuffer
 
-    private static ByteBuffer newDirectByteBuffer(long address, long capacity) {
-        Long key = new Long(address);
+    private static ByteBuffer newDirectByteBuffer(final long address, final long capacity) {
+        final Long key = Long.valueOf(address);
         ByteBuffer buf = (ByteBuffer) createdBuffers.get(key);
         if (buf == null) {
             buf = newDirectByteBufferImpl(address, capacity);
@@ -332,17 +332,17 @@ public class Mixer {
         }
         return buf;
     }
-    private static ByteBuffer newDirectByteBufferImpl(long address, long capacity) {
+    private static ByteBuffer newDirectByteBufferImpl(final long address, final long capacity) {
         if (directByteBufferClass == null) {
             try {
                 directByteBufferClass = Class.forName("java.nio.DirectByteBuffer");
-                byte[] tmp = new byte[0];
+                final byte[] tmp = new byte[0];
                 directByteBufferConstructor =
                     directByteBufferClass.getDeclaredConstructor(new Class[] { Integer.TYPE,
                                                                                tmp.getClass(),
                                                                                Integer.TYPE });
                 directByteBufferConstructor.setAccessible(true);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
             }
         }
@@ -351,11 +351,11 @@ public class Mixer {
             try {
                 return (ByteBuffer)
                     directByteBufferConstructor.newInstance(new Object[] {
-                            new Integer((int) capacity),
+                            Integer.valueOf((int) capacity),
                             null,
-                            new Integer((int) address)
+                            Integer.valueOf((int) address)
                         });
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
             }
         }
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java
index 0134655..18698f5 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/SoundBuffer.java
@@ -35,16 +35,16 @@ package com.jogamp.audio.windows.waveout;
 import java.io.*;
 
 class SoundBuffer {
-    private byte[] data;
-    private boolean needsByteSwap;
+    private final byte[] data;
+    private final boolean needsByteSwap;
     private int numBytes;
-    private int bytesPerSample;
+    private final int bytesPerSample;
     private int numSamples;
     private boolean playing;
     private boolean empty;
 
     // Note: needsByteSwap argument makes assumptions about the format
-    SoundBuffer(int size, int bytesPerSample, boolean needsByteSwap) {
+    SoundBuffer(final int size, final int bytesPerSample, final boolean needsByteSwap) {
         this.bytesPerSample = bytesPerSample;
         this.needsByteSwap = needsByteSwap;
         data = new byte[size * bytesPerSample];
@@ -55,7 +55,7 @@ class SoundBuffer {
         return playing;
     }
 
-    void playing(boolean playing) {
+    void playing(final boolean playing) {
         this.playing = playing;
     }
 
@@ -63,11 +63,11 @@ class SoundBuffer {
         return empty;
     }
 
-    void empty(boolean empty) {
+    void empty(final boolean empty) {
         this.empty = empty;
     }
 
-    void fill(InputStream input) throws IOException {
+    void fill(final InputStream input) throws IOException {
         synchronized(this) {
             if (playing) {
                 throw new IllegalStateException("Can not fill a buffer that is playing");
@@ -75,7 +75,7 @@ class SoundBuffer {
         }
 
         empty(true);
-        int num = input.read(data);
+        final int num = input.read(data);
         if (num > 0) {
             numBytes = num;
             numSamples = numBytes / bytesPerSample;
@@ -96,8 +96,8 @@ class SoundBuffer {
     // This is called by the mixer and must be extremely fast
     // FIXME: may want to reconsider use of floating point at this point
     // FIXME: assumes all sounds are of the same format to avoid normalization
-    float getSample(int sample) {
-        int startByte = sample * bytesPerSample;
+    float getSample(final int sample) {
+        final int startByte = sample * bytesPerSample;
         // FIXME: assumes no more than 4 bytes per sample
         int res = 0;
         if (needsByteSwap) {
@@ -106,7 +106,7 @@ class SoundBuffer {
                 res |= (data[i] & 0xff);
             }
         } else {
-            int endByte = startByte + bytesPerSample - 1;
+            final int endByte = startByte + bytesPerSample - 1;
             for (int i = startByte; i <= endByte; i++) {
                 res <<= 8;
                 res |= (data[i] & 0xff);
@@ -119,6 +119,6 @@ class SoundBuffer {
             res = (byte) res;
         }
 
-        return (float) res;
+        return res;
     }
 }
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java
index 98a7874..5e55786 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Track.java
@@ -56,7 +56,7 @@ public class Track {
     // If we're playing the file, this is its input stream
     private InputStream input;
     // Keep around the file name
-    private File file;
+    private final File file;
     // Whether we're playing this sound
     private boolean playing;
     // Whether we're looping this sound
@@ -64,7 +64,7 @@ public class Track {
     // The position of this sound; defaults to being at the origin
     private volatile Vec3f position = new Vec3f();
 
-    Track(File file) throws IOException {
+    Track(final File file) throws IOException {
         if (!file.getName().endsWith(".rawsound")) {
             throw new IOException("Unsupported file format (currently supports only raw sounds)");
         }
@@ -96,7 +96,7 @@ public class Track {
                 openInput();
                 // Fill it immediately
                 fill();
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 e.printStackTrace();
                 return;
             }
@@ -109,7 +109,7 @@ public class Track {
         return playing;
     }
 
-    public synchronized void setLooping(boolean looping) {
+    public synchronized void setLooping(final boolean looping) {
         this.looping = looping;
     }
 
@@ -117,7 +117,7 @@ public class Track {
         return looping;
     }
 
-    public void setPosition(float x, float y, float z) {
+    public void setPosition(final float x, final float y, final float z) {
         position = new Vec3f(x, y, z);
     }
 
@@ -125,7 +125,7 @@ public class Track {
         if (input == null) {
             return;
         }
-        SoundBuffer curBuffer = fillingBuffer;
+        final SoundBuffer curBuffer = fillingBuffer;
         if (!curBuffer.empty()) {
             return;
         }
@@ -152,7 +152,7 @@ public class Track {
     private float leftGain;
     private float rightGain;
 
-    void setLeftGain(float leftGain) {
+    void setLeftGain(final float leftGain) {
         this.leftGain = leftGain;
     }
 
@@ -160,7 +160,7 @@ public class Track {
         return leftGain;
     }
 
-    void setRightGain(float rightGain) {
+    void setRightGain(final float rightGain) {
         this.rightGain = rightGain;
     }
 
@@ -180,7 +180,7 @@ public class Track {
 
     // This is called by the mixer and must be extremely fast
     float nextSample() {
-        float res = activeBuffer.getSample(samplePosition++);
+        final float res = activeBuffer.getSample(samplePosition++);
         ++samplesRead;
         if (!hasNextSample()) {
             swapBuffers();
@@ -193,7 +193,7 @@ public class Track {
     }
 
     synchronized void swapBuffers() {
-        SoundBuffer tmp = activeBuffer;
+        final SoundBuffer tmp = activeBuffer;
         activeBuffer = fillingBuffer;
         fillingBuffer = tmp;
         fillingBuffer.empty(true);
diff --git a/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java b/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java
index 79fb801..831b25c 100644
--- a/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java
+++ b/src/jogl/classes/com/jogamp/audio/windows/waveout/Vec3f.java
@@ -48,11 +48,11 @@ class Vec3f {
 
   public Vec3f() {}
 
-  public Vec3f(Vec3f arg) {
+  public Vec3f(final Vec3f arg) {
     set(arg);
   }
 
-  public Vec3f(float x, float y, float z) {
+  public Vec3f(final float x, final float y, final float z) {
     set(x, y, z);
   }
 
@@ -60,18 +60,18 @@ class Vec3f {
     return new Vec3f(this);
   }
 
-  public void set(Vec3f arg) {
+  public void set(final Vec3f arg) {
     set(arg.x, arg.y, arg.z);
   }
 
-  public void set(float x, float y, float z) {
+  public void set(final float x, final float y, final float z) {
     this.x = x;
     this.y = y;
     this.z = z;
   }
 
   /** Sets the ith component, 0 <= i < 3 */
-  public void set(int i, float val) {
+  public void set(final int i, final float val) {
     switch (i) {
     case 0: x = val; break;
     case 1: y = val; break;
@@ -81,7 +81,7 @@ class Vec3f {
   }
 
   /** Gets the ith component, 0 <= i < 3 */
-  public float get(int i) {
+  public float get(final int i) {
     switch (i) {
     case 0: return x;
     case 1: return y;
@@ -94,11 +94,11 @@ class Vec3f {
   public float y() { return y; }
   public float z() { return z; }
 
-  public void setX(float x) { this.x = x; }
-  public void setY(float y) { this.y = y; }
-  public void setZ(float z) { this.z = z; }
+  public void setX(final float x) { this.x = x; }
+  public void setY(final float y) { this.y = y; }
+  public void setZ(final float z) { this.z = z; }
 
-  public float dot(Vec3f arg) {
+  public float dot(final Vec3f arg) {
     return x * arg.x + y * arg.y + z * arg.z;
   }
 
@@ -111,87 +111,87 @@ class Vec3f {
   }
 
   public void normalize() {
-    float len = length();
+    final float len = length();
     if (len == 0.0f) return;
     scale(1.0f / len);
   }
 
   /** Returns this * val; creates new vector */
-  public Vec3f times(float val) {
-    Vec3f tmp = new Vec3f(this);
+  public Vec3f times(final float val) {
+    final Vec3f tmp = new Vec3f(this);
     tmp.scale(val);
     return tmp;
   }
 
   /** this = this * val */
-  public void scale(float val) {
+  public void scale(final float val) {
     x *= val;
     y *= val;
     z *= val;
   }
 
   /** Returns this + arg; creates new vector */
-  public Vec3f plus(Vec3f arg) {
-    Vec3f tmp = new Vec3f();
+  public Vec3f plus(final Vec3f arg) {
+    final Vec3f tmp = new Vec3f();
     tmp.add(this, arg);
     return tmp;
   }
 
   /** this = this + b */
-  public void add(Vec3f b) {
+  public void add(final Vec3f b) {
     add(this, b);
   }
 
   /** this = a + b */
-  public void add(Vec3f a, Vec3f b) {
+  public void add(final Vec3f a, final Vec3f b) {
     x = a.x + b.x;
     y = a.y + b.y;
     z = a.z + b.z;
   }
 
   /** Returns this + s * arg; creates new vector */
-  public Vec3f addScaled(float s, Vec3f arg) {
-    Vec3f tmp = new Vec3f();
+  public Vec3f addScaled(final float s, final Vec3f arg) {
+    final Vec3f tmp = new Vec3f();
     tmp.addScaled(this, s, arg);
     return tmp;
   }
 
   /** this = a + s * b */
-  public void addScaled(Vec3f a, float s, Vec3f b) {
+  public void addScaled(final Vec3f a, final float s, final Vec3f b) {
     x = a.x + s * b.x;
     y = a.y + s * b.y;
     z = a.z + s * b.z;
   }
 
   /** Returns this - arg; creates new vector */
-  public Vec3f minus(Vec3f arg) {
-    Vec3f tmp = new Vec3f();
+  public Vec3f minus(final Vec3f arg) {
+    final Vec3f tmp = new Vec3f();
     tmp.sub(this, arg);
     return tmp;
   }
 
   /** this = this - b */
-  public void sub(Vec3f b) {
+  public void sub(final Vec3f b) {
     sub(this, b);
   }
 
   /** this = a - b */
-  public void sub(Vec3f a, Vec3f b) {
+  public void sub(final Vec3f a, final Vec3f b) {
     x = a.x - b.x;
     y = a.y - b.y;
     z = a.z - b.z;
   }
 
   /** Returns this cross arg; creates new vector */
-  public Vec3f cross(Vec3f arg) {
-    Vec3f tmp = new Vec3f();
+  public Vec3f cross(final Vec3f arg) {
+    final Vec3f tmp = new Vec3f();
     tmp.cross(this, arg);
     return tmp;
   }
 
   /** this = a cross b. NOTE: "this" must be a different vector than
       both a and b. */
-  public void cross(Vec3f a, Vec3f b) {
+  public void cross(final Vec3f a, final Vec3f b) {
     x = a.y * b.z - a.z * b.y;
     y = a.z * b.x - a.x * b.z;
     z = a.x * b.y - a.y * b.x;
@@ -200,7 +200,7 @@ class Vec3f {
   /** Sets each component of this vector to the product of the
       component with the corresponding component of the argument
       vector. */
-  public void componentMul(Vec3f arg) {
+  public void componentMul(final Vec3f arg) {
     x *= arg.x;
     y *= arg.y;
     z *= arg.z;
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
index 023913d..75067a3 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildComposablePipeline.java
@@ -51,6 +51,8 @@ import java.lang.reflect.Method;
 import java.nio.Buffer;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -106,37 +108,37 @@ public class BuildComposablePipeline {
     // Desktop OpenGL and GLES1 have GL_STACK_OVERFLOW and GL_STACK_UNDERFLOW errors
     private boolean hasGL2ES1StackOverflow;
 
-    public static Class<?> getClass(String name) {
+    public static Class<?> getClass(final String name) {
         Class<?> clazz = null;
         try {
             clazz = Class.forName(name);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new RuntimeException(
                     "Could not find class \"" + name + "\"", e);
         }
         return clazz;
     }
 
-    public static Method getMethod(Class<?> clazz, Method m) {
+    public static Method getMethod(final Class<?> clazz, final Method m) {
         Method res = null;
         try {
             res = clazz.getMethod(m.getName(), m.getParameterTypes());
-        } catch (Exception e) {
+        } catch (final Exception e) {
         }
         return res;
     }
 
-    public static void main(String[] args) {
-        String classToComposeAroundName = args[0];
+    public static void main(final String[] args) {
+        final String classToComposeAroundName = args[0];
         Class<?> classPrologOpt, classDownstream;
-        Class<?> classToComposeAround = getClass(classToComposeAroundName);
+        final Class<?> classToComposeAround = getClass(classToComposeAroundName);
 
-        String outputDir = args[1];
+        final String outputDir = args[1];
         String outputPackage, outputName;
         int mode;
 
         if (args.length > 2) {
-            String outputClazzName = args[2];
+            final String outputClazzName = args[2];
             outputPackage = getPackageName(outputClazzName);
             outputName = getBaseClassName(outputClazzName);
             classPrologOpt = getClass(args[3]);
@@ -159,19 +161,19 @@ public class BuildComposablePipeline {
             mode = GEN_DEBUG | GEN_TRACE ;
         }
 
-        BuildComposablePipeline composer =
+        final BuildComposablePipeline composer =
                 new BuildComposablePipeline(mode, outputDir, outputPackage, outputName, classToComposeAround, classPrologOpt, classDownstream);
 
         try {
             composer.emit();
-        } catch (IOException e) {
+        } catch (final IOException e) {
             throw new RuntimeException(
                     "Error generating composable pipeline source files", e);
         }
     }
 
-    protected BuildComposablePipeline(int mode, String outputDir, String outputPackage, String outputName,
-            Class<?> classToComposeAround, Class<?> classPrologOpt, Class<?> classDownstream) {
+    protected BuildComposablePipeline(final int mode, final String outputDir, final String outputPackage, final String outputName,
+            final Class<?> classToComposeAround, final Class<?> classPrologOpt, final Class<?> classDownstream) {
         this.mode = mode;
         this.outputDir = outputDir;
         this.outputPackage = outputPackage;
@@ -186,15 +188,17 @@ public class BuildComposablePipeline {
         }
 
         try {
+            // Keep assignment w/ null comparison for clarification.
+            // If no exception is thrown, return value is always non-null;
             hasImmediateMode =
-                    (classToComposeAround.getMethod("glBegin", new Class<?>[]{Integer.TYPE}) != null);
-        } catch (Exception e) {
+                    null != classToComposeAround.getMethod("glBegin", new Class<?>[]{Integer.TYPE});
+        } catch (final Exception e) {
         }
 
         try {
             hasGL2ES1StackOverflow = hasImmediateMode &&
                     (classToComposeAround.getField("GL_STACK_OVERFLOW") != null);
-        } catch (Exception e) {
+        } catch (final Exception e) {
         }
     }
 
@@ -206,34 +210,44 @@ public class BuildComposablePipeline {
 
         final List<Method> publicMethodsRaw = Arrays.asList(classToComposeAround.getMethods());
 
-        final Set<PlainMethod> publicMethodsPlain = new HashSet<PlainMethod>();
-        for (Iterator<Method> iter = publicMethodsRaw.iterator(); iter.hasNext();) {
+        final Set<PlainMethod> publicMethodsPlainSet = new HashSet<PlainMethod>();
+        for (final Iterator<Method> iter = publicMethodsRaw.iterator(); iter.hasNext();) {
             final Method method = iter.next();
             // Don't hook methods which aren't real GL methods,
             // such as the synthetic "isGL2ES2" "getGL2ES2"
             final String name = method.getName();
-            if ( !name.startsWith("getGL") &&
-                 !name.startsWith("isGL") &&
-                 !name.equals("getDownstreamGL") &&
+            if ( !name.equals("getDownstreamGL") &&
                  !name.equals("toString") ) {
-                final boolean runHooks = name.startsWith("gl") || addedGLHooks.containsKey(name);
-                publicMethodsPlain.add(new PlainMethod(method, runHooks));
+                final boolean syntheticIsGL = name.startsWith("isGL");
+                final boolean syntheticGetGL = name.startsWith("getGL");
+                final boolean runHooks = name.startsWith("gl") || syntheticIsGL || syntheticGetGL || addedGLHooks.containsKey(name);
+                publicMethodsPlainSet.add(new PlainMethod(method, runHooks, syntheticIsGL, syntheticGetGL));
             }
         }
 
+        // sort methods to make them easier to find
+        final List<PlainMethod> publicMethodsPlainSorted = new ArrayList<PlainMethod>();
+        publicMethodsPlainSorted.addAll(publicMethodsPlainSet);
+        Collections.sort(publicMethodsPlainSorted, new Comparator<PlainMethod>() {
+                @Override
+                public int compare(final PlainMethod o1, final PlainMethod o2) {
+                    return o1.getWrappedMethod().getName().compareTo(o2.getWrappedMethod().getName());
+                }
+            });
+
         if (0 != (mode & GEN_DEBUG)) {
-            (new DebugPipeline(outputDir, outputPackage, classToComposeAround, classDownstream)).emit(publicMethodsPlain.iterator());
+            (new DebugPipeline(outputDir, outputPackage, classToComposeAround, classDownstream)).emit(publicMethodsPlainSorted.iterator());
         }
         if (0 != (mode & GEN_TRACE)) {
-            (new TracePipeline(outputDir, outputPackage, classToComposeAround, classDownstream)).emit(publicMethodsPlain.iterator());
+            (new TracePipeline(outputDir, outputPackage, classToComposeAround, classDownstream)).emit(publicMethodsPlainSorted.iterator());
         }
         if (0 != (mode & GEN_CUSTOM)) {
-            (new CustomPipeline(mode, outputDir, outputPackage, outputName, classToComposeAround, classPrologOpt, classDownstream)).emit(publicMethodsPlain.iterator());
+            (new CustomPipeline(mode, outputDir, outputPackage, outputName, classToComposeAround, classPrologOpt, classDownstream)).emit(publicMethodsPlainSorted.iterator());
         }
     }
 
-    public static String getPackageName(String clazzName) {
-        int lastDot = clazzName.lastIndexOf('.');
+    public static String getPackageName(final String clazzName) {
+        final int lastDot = clazzName.lastIndexOf('.');
         if (lastDot == -1) {
             // no package, class is at root level
             return null;
@@ -241,8 +255,8 @@ public class BuildComposablePipeline {
         return clazzName.substring(0, lastDot);
     }
 
-    public static String getBaseClassName(String clazzName) {
-        int lastDot = clazzName.lastIndexOf('.');
+    public static String getBaseClassName(final String clazzName) {
+        final int lastDot = clazzName.lastIndexOf('.');
         if (lastDot == -1) {
             // no package, class is at root level
             return clazzName;
@@ -251,14 +265,18 @@ public class BuildComposablePipeline {
     }
 
     //-------------------------------------------------------
-    protected class PlainMethod {
+    protected static class PlainMethod {
 
-        Method m;
-        boolean runHooks;
+        final Method m;
+        final boolean runHooks;
+        final boolean isSynthethicIsGL;
+        final boolean isSynthethicGetGL;
 
-        PlainMethod(Method m, boolean runHooks) {
+        PlainMethod(final Method m, final boolean runHooks, final boolean isSynthethicIsGL, final boolean isSynthethicGetGL) {
             this.m = m;
             this.runHooks = runHooks;
+            this.isSynthethicIsGL = isSynthethicIsGL;
+            this.isSynthethicGetGL = isSynthethicGetGL;
         }
 
         public Method getWrappedMethod() {
@@ -269,11 +287,15 @@ public class BuildComposablePipeline {
             return runHooks;
         }
 
+        public boolean isSynthetic() { return isSynthethicIsGL || isSynthethicGetGL; }
+        public boolean isSyntheticIsGL() { return isSynthethicIsGL; }
+        public boolean isSyntheticGetGL() { return isSynthethicGetGL; }
+
         @Override
-        public boolean equals(Object obj) {
+        public boolean equals(final Object obj) {
             if (obj instanceof PlainMethod) {
-                PlainMethod b = (PlainMethod) obj;
-                boolean res =
+                final PlainMethod b = (PlainMethod) obj;
+                final boolean res =
                         m.getName().equals(b.m.getName())
                         && m.getModifiers() == b.m.getModifiers()
                         && m.getReturnType().equals(b.m.getReturnType())
@@ -286,7 +308,7 @@ public class BuildComposablePipeline {
         @Override
         public int hashCode() {
             int hash = m.getName().hashCode() ^ m.getModifiers() ^ m.getReturnType().hashCode();
-            Class<?>[] args = m.getParameterTypes();
+            final Class<?>[] args = m.getParameterTypes();
             for (int i = 0; i < args.length; i++) {
                 hash ^= args[i].hashCode();
             }
@@ -295,8 +317,8 @@ public class BuildComposablePipeline {
 
         @Override
         public String toString() {
-            Class<?>[] args = m.getParameterTypes();
-            StringBuilder argsString = new StringBuilder();
+            final Class<?>[] args = m.getParameterTypes();
+            final StringBuilder argsString = new StringBuilder();
             argsString.append("(");
             for (int i = 0; i < args.length; i++) {
                 if (i > 0) {
@@ -307,6 +329,7 @@ public class BuildComposablePipeline {
             argsString.append(")");
             return m.toString()
                     + "\n\tname: " + m.getName()
+                    + "\n\tsynt: isGL " + isSynthethicIsGL+", getGL "+isSynthethicGetGL
                     + "\n\tmods: " + m.getModifiers()
                     + "\n\tretu: " + m.getReturnType()
                     + "\n\targs[" + args.length + "]: " + argsString.toString();
@@ -340,7 +363,7 @@ public class BuildComposablePipeline {
          * @exception IllegalArgumentException if classToComposeAround is not an
          * interface.
          */
-        PipelineEmitter(String outputDir, String outputPackage, Class<?> baseInterfaceClass, Class<?> prologClassOpt, Class<?> downstreamClass) {
+        PipelineEmitter(final String outputDir, final String outputPackage, final Class<?> baseInterfaceClass, final Class<?> prologClassOpt, final Class<?> downstreamClass) {
             this.outputDir = outputDir;
             this.outputPackage = outputPackage;
             this.baseInterfaceClass = baseInterfaceClass;
@@ -357,38 +380,38 @@ public class BuildComposablePipeline {
             }
         }
 
-        public void emit(Iterator<PlainMethod> methodsToWrap) throws IOException {
-            String outputClassName = getOutputName();
+        public void emit(final Iterator<PlainMethod> methodsToWrap) throws IOException {
+            final String outputClassName = getOutputName();
             this.file = new File(outputDir + File.separatorChar + outputClassName + ".java");
-            String parentDir = file.getParent();
+            final String parentDir = file.getParent();
             if (parentDir != null) {
-                File pDirFile = new File(parentDir);
+                final File pDirFile = new File(parentDir);
                 pDirFile.mkdirs();
             }
 
-            PrintWriter output = new PrintWriter(new BufferedWriter(new FileWriter(file)));
+            final PrintWriter output = new PrintWriter(new BufferedWriter(new FileWriter(file)));
 
-            List<Class<?>> baseInterfaces = Arrays.asList(baseInterfaceClass.getInterfaces());
-            HashSet<Class<?>> clazzList = new HashSet<Class<?>>();
+            final List<Class<?>> baseInterfaces = Arrays.asList(baseInterfaceClass.getInterfaces());
+            final HashSet<Class<?>> clazzList = new HashSet<Class<?>>();
             clazzList.add(baseInterfaceClass);
             clazzList.addAll(baseInterfaces);
-            int ifNamesNumber = clazzList.size();
+            final int ifNamesNumber = clazzList.size();
 
             // keep original order ..
             clazzList.clear();
-            String[] ifNames = new String[ifNamesNumber];
+            final String[] ifNames = new String[ifNamesNumber];
             {
                 int i = 0;
 
-                for (Iterator<Class<?>> iter = baseInterfaces.iterator(); iter.hasNext();) {
-                    Class<?> ifClass = iter.next();
+                for (final Iterator<Class<?>> iter = baseInterfaces.iterator(); iter.hasNext();) {
+                    final Class<?> ifClass = iter.next();
                     if (!clazzList.contains(ifClass)) {
                         ifNames[i++] = ifClass.getName();
                         clazzList.add(ifClass);
                     }
                 }
 
-                if (null != baseInterfaceClass && !clazzList.contains(baseInterfaceClass)) {
+                if ( !clazzList.contains(baseInterfaceClass) ) {
                     ifNames[i++] = baseInterfaceClass.getName();
                     clazzList.add(baseInterfaceClass);
                 }
@@ -399,12 +422,12 @@ public class BuildComposablePipeline {
                 clazzList.add(prologClassOpt);
             }
 
-            ArrayList<String> imports = new ArrayList<String>();
+            final ArrayList<String> imports = new ArrayList<String>();
             imports.add("java.io.*");
             imports.add("javax.media.opengl.*");
             imports.add("com.jogamp.gluegen.runtime.*");
             imports.add(Buffer.class.getPackage().getName()+".*");
-            for (Class<?> clasS : clazzList) {
+            for (final Class<?> clasS : clazzList) {
                 imports.add(clasS.getName());
             }
 
@@ -418,7 +441,7 @@ public class BuildComposablePipeline {
                     null,
                     new CodeGenUtils.EmissionCallback() {
                         @Override
-                        public void emit(PrintWriter w) {
+                        public void emit(final PrintWriter w) {
                             emitClassDocComment(w);
                         }
                     });
@@ -427,15 +450,14 @@ public class BuildComposablePipeline {
 
             constructorHook(output);
 
-            emitGLIsMethods(output);
-            emitGLGetMethods(output);
+            emitSyntheticGLMethods(output);
 
             while (methodsToWrap.hasNext()) {
-                PlainMethod pm = methodsToWrap.next();
-                Method m = pm.getWrappedMethod();
+                final PlainMethod pm = methodsToWrap.next();
+                final Method m = pm.getWrappedMethod();
                 emitMethodDocComment(output, m);
                 emitSignature(output, m);
-                emitBody(output, m, pm.runHooks());
+                emitBody(output, pm);
             }
 
             postMethodEmissionHook(output);
@@ -467,25 +489,27 @@ public class BuildComposablePipeline {
             return null;
         }
 
-        protected void emitMethodDocComment(PrintWriter output, Method m) {
+        protected void emitMethodDocComment(final PrintWriter output, final Method m) {
         }
 
-        protected void emitSignature(PrintWriter output, Method m) {
+        protected void emitSignature(final PrintWriter output, final Method m) {
             output.format("  @Override%n  public %s %s(%s)%n",
                           JavaType.createForClass(m.getReturnType()).getName(),
                           m.getName(),
                           getArgListAsString(m, true, true));
         }
 
-        protected void emitBody(PrintWriter output, Method m, boolean runHooks) {
+        protected void emitBody(final PrintWriter output, final PlainMethod pm) {
+            final boolean runHooks = pm.runHooks();
+            final Method m = pm.getWrappedMethod();
             output.println("  {");
-            Class<?> retType = m.getReturnType();
+            final Class<?> retType = m.getReturnType();
 
-            boolean callPreDownstreamHook = runHooks && hasPreDownstreamCallHook(m);
-            boolean callPostDownstreamHook = runHooks && hasPostDownstreamCallHook(m);
-            boolean callDownstream = (null != getMethod(downstreamClass, m))
+            final boolean callPreDownstreamHook = runHooks && hasPreDownstreamCallHook(pm);
+            final boolean callPostDownstreamHook = runHooks && hasPostDownstreamCallHook(pm);
+            final boolean callDownstream = (null != getMethod(downstreamClass, m))
                     && !(0 != (GEN_PROLOG_XOR_DOWNSTREAM & getMode()) && callPreDownstreamHook);
-            boolean hasResult = (retType != Void.TYPE);
+            final boolean hasResult = (retType != Void.TYPE);
 
             if (!callDownstream) {
                 if (!emptyDownstreamAllowed()) {
@@ -512,48 +536,54 @@ public class BuildComposablePipeline {
                         output.print("    return ");
                     }
                 }
-                preDownstreamCallHook(output, m);
+                preDownstreamCallHook(output, pm);
             }
 
             if (callDownstream) {
-                if (hasResult) {
-                    if (callPostDownstreamHook) {
-                        output.print("    " + JavaType.createForClass(retType).getName());
-                        output.print(" _res = ");
-                    } else {
-                        output.print("    return ");
+                if( pm.isSyntheticIsGL() ) {
+                    emitGLIsMethodBody(output, pm);
+                } else if( pm.isSyntheticGetGL() ) {
+                    emitGLGetMethodBody(output, pm);
+                } else {
+                    if (hasResult) {
+                        if (callPostDownstreamHook) {
+                            output.print("    " + JavaType.createForClass(retType).getName());
+                            output.print(" _res = ");
+                        } else {
+                            output.print("    return ");
+                        }
                     }
+                    else {
+                        output.print("    ");
+                    }
+                    output.print(getDownstreamObjectName());
+                    output.print('.');
+                    output.print(m.getName());
+                    output.print('(');
+                    output.print(getArgListAsString(m, false, true));
+                    output.println(");");
                 }
-                else {
-                    output.print("    ");
-                }
-                output.print(getDownstreamObjectName());
-                output.print('.');
-                output.print(m.getName());
-                output.print('(');
-                output.print(getArgListAsString(m, false, true));
-                output.println(");");
             }
 
             if (callPostDownstreamHook) {
-                postDownstreamCallHook(output, m);
+                postDownstreamCallHook(output, pm);
             }
 
             if (hasResult && callDownstream && callPostDownstreamHook) {
                 output.println("    return _res;");
             }
-            output.println("  }");
 
+            output.println("  }");
         }
 
-        protected String getArgListAsString(Method m, boolean includeArgTypes, boolean includeArgNames) {
-            StringBuilder buf = new StringBuilder(256);
+        protected String getArgListAsString(final Method m, final boolean includeArgTypes, final boolean includeArgNames) {
+            final StringBuilder buf = new StringBuilder(256);
             if (!includeArgNames && !includeArgTypes) {
                 throw new IllegalArgumentException(
                         "Cannot generate arglist without both arg types and arg names");
             }
 
-            Class<?>[] argTypes = m.getParameterTypes();
+            final Class<?>[] argTypes = m.getParameterTypes();
             for (int i = 0; i < argTypes.length; ++i) {
                 if (includeArgTypes) {
                     buf.append(JavaType.createForClass(argTypes[i]).getName());
@@ -588,7 +618,7 @@ public class BuildComposablePipeline {
          * Called after the class headers have been generated, but before any
          * method wrappers have been generated.
          */
-        protected void preMethodEmissionHook(PrintWriter output) {
+        protected void preMethodEmissionHook(final PrintWriter output) {
             output.println("  public static final boolean DEBUG = jogamp.opengl.Debug.debug(\"" + getOutputName() + "\");");
         }
 
@@ -601,7 +631,7 @@ public class BuildComposablePipeline {
          * Called after the method wrappers have been generated, but before the
          * closing parenthesis of the class is emitted.
          */
-        protected void postMethodEmissionHook(PrintWriter output) {
+        protected void postMethodEmissionHook(final PrintWriter output) {
             output.println("  @Override");
             output.println("  public String toString() {");
             output.println("    StringBuilder sb = new StringBuilder();");
@@ -617,17 +647,17 @@ public class BuildComposablePipeline {
         /**
          * Called before the pipeline routes the call to the downstream object.
          */
-        protected abstract void preDownstreamCallHook(PrintWriter output, Method m);
+        protected abstract void preDownstreamCallHook(PrintWriter output, PlainMethod pm);
 
-        protected abstract boolean hasPreDownstreamCallHook(Method m);
+        protected abstract boolean hasPreDownstreamCallHook(PlainMethod pm);
 
         /**
          * Called after the pipeline has routed the call to the downstream object,
          * but before the calling function exits or returns a value.
          */
-        protected abstract void postDownstreamCallHook(PrintWriter output, Method m);
+        protected abstract void postDownstreamCallHook(PrintWriter output, PlainMethod pm);
 
-        protected abstract boolean hasPostDownstreamCallHook(Method m);
+        protected abstract boolean hasPostDownstreamCallHook(PlainMethod pm);
 
         protected abstract int getMode();
 
@@ -641,10 +671,17 @@ public class BuildComposablePipeline {
         /**
          * Emits one of the isGL* methods.
          */
-        protected void emitGLIsMethod(PrintWriter output, String type) {
-            output.println("  @Override");
-            output.println("  public final boolean is" + type + "() {");
-            if( 0 != (GEN_GL_IDENTITY_BY_ASSIGNABLE_CLASS & getMode() ) ) {
+        protected void emitGLIsMethodBody(final PrintWriter output, final PlainMethod plainMethod) {
+            final String methodName = plainMethod.getWrappedMethod().getName();
+            final String type = methodName.substring(2);
+
+            if( type.equals("GL") ) {
+                output.println("    return true;");
+            } else if( 0 != ( GEN_GL_IDENTITY_BY_ASSIGNABLE_CLASS & getMode() ) &&
+                       !type.equals("GLES") &&
+                       !type.endsWith("core") &&
+                       !type.endsWith("Compatible") )
+            {
                 final Class<?> clazz = BuildComposablePipeline.getClass("javax.media.opengl." + type);
                 if (clazz.isAssignableFrom(baseInterfaceClass)) {
                     output.println("    return true;");
@@ -654,111 +691,38 @@ public class BuildComposablePipeline {
             } else {
                 output.println("    return " + getDownstreamObjectName() + ".is" + type + "();");
             }
-            output.println("  }");
-        }
-
-        /**
-         * Emits all of the isGL* methods.
-         */
-        protected void emitGLIsMethods(PrintWriter output) {
-            output.println("  @Override");
-            output.println("  public final boolean isGL() {");
-            output.println("    return true;");
-            output.println("  }");
-            emitGLIsMethod(output, "GL4bc");
-            emitGLIsMethod(output, "GL4");
-            emitGLIsMethod(output, "GL3bc");
-            emitGLIsMethod(output, "GL3");
-            emitGLIsMethod(output, "GL2");
-            emitGLIsMethod(output, "GLES1");
-            emitGLIsMethod(output, "GLES2");
-            emitGLIsMethod(output, "GLES3");
-            emitGLIsMethod(output, "GL2ES1");
-            emitGLIsMethod(output, "GL2ES2");
-            emitGLIsMethod(output, "GL2ES3");
-            emitGLIsMethod(output, "GL3ES3");
-            emitGLIsMethod(output, "GL4ES3");
-            emitGLIsMethod(output, "GL2GL3");
-            if( 0 != (GEN_GL_IDENTITY_BY_ASSIGNABLE_CLASS & getMode() ) ) {
-                output.println("  @Override");
-                output.println("  public final boolean isGLES() {");
-                output.println("    return isGLES3() || isGLES2() || isGLES1();");
-                output.println("  }");
-            } else {
-                emitGLIsMethod(output, "GLES");
-            }
-            output.println("  @Override");
-            output.println("  public final boolean isGL4core() {");
-            output.println("    return " + getDownstreamObjectName() + ".isGL4core();");
-            output.println("  }");
-            output.println("  @Override");
-            output.println("  public final boolean isGL3core() {");
-            output.println("    return " + getDownstreamObjectName() + ".isGL3core();");
-            output.println("  }");
-            output.println("  @Override");
-            output.println("  public final boolean isGLcore() {");
-            output.println("    return " + getDownstreamObjectName() + ".isGLcore();");
-            output.println("  }");
-            output.println("  @Override");
-            output.println("  public final boolean isGLES2Compatible() {");
-            output.println("    return " + getDownstreamObjectName() + ".isGLES2Compatible();");
-            output.println("  }");
-            output.println("  @Override");
-            output.println("  public final boolean isGLES3Compatible() {");
-            output.println("    return " + getDownstreamObjectName() + ".isGLES3Compatible();");
-            output.println("  }");
         }
 
         /**
          * Emits one of the getGL* methods.
          */
-        protected void emitGLGetMethod(PrintWriter output, String type) {
-            output.println("  @Override");
-            output.println("  public final javax.media.opengl." + type + " get" + type + "() {");
-            final Class<?> clazz = BuildComposablePipeline.getClass("javax.media.opengl." + type);
-            if (clazz.isAssignableFrom(baseInterfaceClass)) {
-                if( 0 != (GEN_GL_IDENTITY_BY_ASSIGNABLE_CLASS & getMode() ) ) {
-                    output.println("    return this;");
-                } else {
+        protected void emitGLGetMethodBody(final PrintWriter output, final PlainMethod plainMethod) {
+            final String methodName = plainMethod.getWrappedMethod().getName();
+            final String type = methodName.substring(3);
+
+            if( type.equals("GL") ) {
+                output.println("    return this;");
+            } else if( type.equals("GLProfile") ) {
+                output.println("    return " + getDownstreamObjectName() + ".getGLProfile();");
+            } else {
+                final Class<?> clazz = BuildComposablePipeline.getClass("javax.media.opengl." + type);
+                if (clazz.isAssignableFrom(baseInterfaceClass)) {
                     output.println("    if( is" + type + "() ) { return this; }");
                     output.println("    throw new GLException(\"Not a " + type + " implementation\");");
+                } else {
+                    output.println("    throw new GLException(\"Not a " + type + " implementation\");");
                 }
-            } else {
-                output.println("    throw new GLException(\"Not a " + type + " implementation\");");
             }
-            output.println("  }");
         }
 
         /**
-         * Emits all of the getGL* methods.
+         * Emits all synthetic GL* methods, but not isGL* nor getGL*
          */
-        protected void emitGLGetMethods(PrintWriter output) {
-            output.println("  @Override");
-            output.println("  public final javax.media.opengl.GL getGL() {");
-            output.println("    return this;");
-            output.println("  }");
-            emitGLGetMethod(output, "GL4bc");
-            emitGLGetMethod(output, "GL4");
-            emitGLGetMethod(output, "GL3bc");
-            emitGLGetMethod(output, "GL3");
-            emitGLGetMethod(output, "GL2");
-            emitGLGetMethod(output, "GLES1");
-            emitGLGetMethod(output, "GLES2");
-            emitGLGetMethod(output, "GLES3");
-            emitGLGetMethod(output, "GL2ES1");
-            emitGLGetMethod(output, "GL2ES2");
-            emitGLGetMethod(output, "GL2ES3");
-            emitGLGetMethod(output, "GL3ES3");
-            emitGLGetMethod(output, "GL4ES3");
-            emitGLGetMethod(output, "GL2GL3");
+        protected void emitSyntheticGLMethods(final PrintWriter output) {
             output.println("  @Override");
             output.println("  public final GL getDownstreamGL() throws GLException {");
             output.println("    return " + getDownstreamObjectName() + ";");
             output.println("  }");
-            output.println("  @Override");
-            output.println("  public final GLProfile getGLProfile() {");
-            output.println("    return " + getDownstreamObjectName() + ".getGLProfile();");
-            output.println("  }");
         }
     } // end class PipelineEmitter
 
@@ -768,7 +732,7 @@ public class BuildComposablePipeline {
         String className;
         int mode;
 
-        CustomPipeline(int mode, String outputDir, String outputPackage, String outputName, Class<?> baseInterfaceClass, Class<?> prologClassOpt, Class<?> downstreamClass) {
+        CustomPipeline(final int mode, final String outputDir, final String outputPackage, final String outputName, final Class<?> baseInterfaceClass, final Class<?> prologClassOpt, final Class<?> downstreamClass) {
             super(outputDir, outputPackage, baseInterfaceClass, prologClassOpt, downstreamClass);
             className = outputName;
             this.mode = mode;
@@ -795,12 +759,12 @@ public class BuildComposablePipeline {
         }
 
         @Override
-        protected void preMethodEmissionHook(PrintWriter output) {
+        protected void preMethodEmissionHook(final PrintWriter output) {
             super.preMethodEmissionHook(output);
         }
 
         @Override
-        protected void constructorHook(PrintWriter output) {
+        protected void constructorHook(final PrintWriter output) {
             output.print("  public " + getOutputName() + "(");
             output.print(downstreamName + " " + getDownstreamObjectName());
             if (null != prologNameOpt) {
@@ -823,7 +787,7 @@ public class BuildComposablePipeline {
         }
 
         @Override
-        protected void postMethodEmissionHook(PrintWriter output) {
+        protected void postMethodEmissionHook(final PrintWriter output) {
             super.postMethodEmissionHook(output);
             if (null != prologNameOpt) {
                 output.print("  private " + prologNameOpt + " " + getPrologObjectNameOpt() + ";");
@@ -831,7 +795,7 @@ public class BuildComposablePipeline {
         }
 
         @Override
-        protected void emitClassDocComment(PrintWriter output) {
+        protected void emitClassDocComment(final PrintWriter output) {
             output.println("/**");
             output.println(" * Composable pipeline {@link " + outputPackage + "." + outputName + "}, implementing the interface");
             output.println(" * {@link " + baseInterfaceClass.getName() + "}");
@@ -866,12 +830,13 @@ public class BuildComposablePipeline {
         }
 
         @Override
-        protected boolean hasPreDownstreamCallHook(Method m) {
-            return null != getMethod(prologClassOpt, m);
+        protected boolean hasPreDownstreamCallHook(final PlainMethod pm) {
+            return null != getMethod(prologClassOpt, pm.getWrappedMethod());
         }
 
         @Override
-        protected void preDownstreamCallHook(PrintWriter output, Method m) {
+        protected void preDownstreamCallHook(final PrintWriter output, final PlainMethod pm) {
+            final Method m = pm.getWrappedMethod();
             if (null != prologNameOpt) {
                 output.print(getPrologObjectNameOpt());
                 output.print('.');
@@ -883,12 +848,12 @@ public class BuildComposablePipeline {
         }
 
         @Override
-        protected boolean hasPostDownstreamCallHook(Method m) {
+        protected boolean hasPostDownstreamCallHook(final PlainMethod pm) {
             return false;
         }
 
         @Override
-        protected void postDownstreamCallHook(PrintWriter output, Method m) {
+        protected void postDownstreamCallHook(final PrintWriter output, final PlainMethod pm) {
         }
     } // end class CustomPipeline
 
@@ -896,7 +861,7 @@ public class BuildComposablePipeline {
 
         String className;
 
-        DebugPipeline(String outputDir, String outputPackage, Class<?> baseInterfaceClass, Class<?> downstreamClass) {
+        DebugPipeline(final String outputDir, final String outputPackage, final Class<?> baseInterfaceClass, final Class<?> downstreamClass) {
             super(outputDir, outputPackage, baseInterfaceClass, null, downstreamClass);
             className = "Debug" + getBaseInterfaceName();
         }
@@ -922,12 +887,12 @@ public class BuildComposablePipeline {
         }
 
         @Override
-        protected void preMethodEmissionHook(PrintWriter output) {
+        protected void preMethodEmissionHook(final PrintWriter output) {
             super.preMethodEmissionHook(output);
         }
 
         @Override
-        protected void constructorHook(PrintWriter output) {
+        protected void constructorHook(final PrintWriter output) {
             output.print("  public " + getOutputName() + "(");
             output.println(downstreamName + " " + getDownstreamObjectName() + ")");
             output.println("  {");
@@ -947,7 +912,7 @@ public class BuildComposablePipeline {
         }
 
         @Override
-        protected void postMethodEmissionHook(PrintWriter output) {
+        protected void postMethodEmissionHook(final PrintWriter output) {
             super.postMethodEmissionHook(output);
             output.println("  private int checkGLError() {");
             if (hasImmediateMode) {
@@ -1005,7 +970,7 @@ public class BuildComposablePipeline {
         }
 
         @Override
-        protected void emitClassDocComment(PrintWriter output) {
+        protected void emitClassDocComment(final PrintWriter output) {
             output.println("/**");
             output.println(" * <p>");
             output.println(" * Composable pipeline which wraps an underlying {@link GL} implementation,");
@@ -1023,22 +988,23 @@ public class BuildComposablePipeline {
         }
 
         @Override
-        protected boolean hasPreDownstreamCallHook(Method m) {
-            return true;
+        protected boolean hasPreDownstreamCallHook(final PlainMethod pm) {
+            return !pm.isSynthetic();
         }
 
         @Override
-        protected void preDownstreamCallHook(PrintWriter output, Method m) {
+        protected void preDownstreamCallHook(final PrintWriter output, final PlainMethod pm) {
             output.println("    checkContext();");
         }
 
         @Override
-        protected boolean hasPostDownstreamCallHook(Method m) {
-            return true;
+        protected boolean hasPostDownstreamCallHook(final PlainMethod pm) {
+            return !pm.isSynthetic();
         }
 
         @Override
-        protected void postDownstreamCallHook(PrintWriter output, Method m) {
+        protected void postDownstreamCallHook(final PrintWriter output, final PlainMethod pm) {
+            final Method m = pm.getWrappedMethod();
             if (m.getName().equals("glBegin")) {
                 output.println("    insideBeginEndPair = true;");
                 output.println("    // NOTE: can't check glGetError(); it's not allowed inside glBegin/glEnd pair");
@@ -1050,12 +1016,12 @@ public class BuildComposablePipeline {
                 output.println("    final int err = checkGLError();");
                 output.println("    if (err != GL_NO_ERROR) {");
 
-                StringBuilder fmtsb = new StringBuilder();
-                StringBuilder argsb = new StringBuilder();
+                final StringBuilder fmtsb = new StringBuilder();
+                final StringBuilder argsb = new StringBuilder();
 
                 fmtsb.append("\"%s(");
                 argsb.append("\"").append(m.getName()).append("\"");
-                Class<?>[] params = m.getParameterTypes();
+                final Class<?>[] params = m.getParameterTypes();
                 for (int i = 0; i < params.length; i++) {
                     if (i > 0) {
                         fmtsb.append(", ");
@@ -1089,7 +1055,7 @@ public class BuildComposablePipeline {
 
         String className;
 
-        TracePipeline(String outputDir, String outputPackage, Class<?> baseInterfaceClass, Class<?> downstreamClass) {
+        TracePipeline(final String outputDir, final String outputPackage, final Class<?> baseInterfaceClass, final Class<?> downstreamClass) {
             super(outputDir, outputPackage, baseInterfaceClass, null, downstreamClass);
             className = "Trace" + getBaseInterfaceName();
         }
@@ -1115,12 +1081,12 @@ public class BuildComposablePipeline {
         }
 
         @Override
-        protected void preMethodEmissionHook(PrintWriter output) {
+        protected void preMethodEmissionHook(final PrintWriter output) {
             super.preMethodEmissionHook(output);
         }
 
         @Override
-        protected void constructorHook(PrintWriter output) {
+        protected void constructorHook(final PrintWriter output) {
             output.print("  public " + getOutputName() + "(");
             output.println(downstreamName + " " + getDownstreamObjectName() + ", PrintStream " + getOutputStreamName() + ")");
             output.println("  {");
@@ -1136,7 +1102,7 @@ public class BuildComposablePipeline {
         }
 
         @Override
-        protected void postMethodEmissionHook(PrintWriter output) {
+        protected void postMethodEmissionHook(final PrintWriter output) {
             super.postMethodEmissionHook(output);
             output.println("private PrintStream " + getOutputStreamName() + ";");
             output.println("private int indent = 0;");
@@ -1171,7 +1137,7 @@ public class BuildComposablePipeline {
         }
 
         @Override
-        protected void emitClassDocComment(PrintWriter output) {
+        protected void emitClassDocComment(final PrintWriter output) {
             output.println("/**");
             output.println(" * <p>");
             output.println(" * Composable pipeline which wraps an underlying {@link GL} implementation,");
@@ -1189,12 +1155,13 @@ public class BuildComposablePipeline {
         }
 
         @Override
-        protected boolean hasPreDownstreamCallHook(Method m) {
-            return true;
+        protected boolean hasPreDownstreamCallHook(final PlainMethod pm) {
+            return !pm.isSynthetic();
         }
 
         @Override
-        protected void preDownstreamCallHook(PrintWriter output, Method m) {
+        protected void preDownstreamCallHook(final PrintWriter output, final PlainMethod pm) {
+            final Method m = pm.getWrappedMethod();
             if (m.getName().equals("glEnd") || m.getName().equals("glEndList")) {
                 output.println("    indent-=2;");
                 output.println("    printIndent();");
@@ -1208,13 +1175,14 @@ public class BuildComposablePipeline {
         }
 
         @Override
-        protected boolean hasPostDownstreamCallHook(Method m) {
-            return true;
+        protected boolean hasPostDownstreamCallHook(final PlainMethod pm) {
+            return !pm.isSynthetic();
         }
 
         @Override
-        protected void postDownstreamCallHook(PrintWriter output, Method m) {
-            Class<?> ret = m.getReturnType();
+        protected void postDownstreamCallHook(final PrintWriter output, final PlainMethod pm) {
+            final Method m = pm.getWrappedMethod();
+            final Class<?> ret = m.getReturnType();
             if (ret != Void.TYPE) {
                 output.println("    println(\" = \"+_res);");
             } else {
@@ -1230,8 +1198,8 @@ public class BuildComposablePipeline {
         }
     } // end class TracePipeline
 
-    public static final void printFunctionCallString(PrintWriter output, Method m) {
-        Class<?>[] params = m.getParameterTypes();
+    public static final void printFunctionCallString(final PrintWriter output, final Method m) {
+        final Class<?>[] params = m.getParameterTypes();
         output.print("    \"" + m.getName() + "(\"");
         for (int i = 0; i < params.length; i++) {
             output.print("+\"<" + params[i].getName() + ">");
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java
index a5a26d1..3b08b53 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/BuildStaticGLInfo.java
@@ -107,21 +107,21 @@ public class BuildStaticGLInfo {
 
   // Handles function pointer
   protected static final int funcIdentifierGroup = 9;
-  protected static Pattern funcPattern =
+  protected static final Pattern funcPattern =
     Pattern.compile("^(GLAPI|GL_API|GL_APICALL|EGLAPI|extern)?(\\s*)((unsigned|const)\\s+)?(\\w+)(\\s+\\*\\s*|\\s*\\*\\s+|\\s+)?(GLAPIENTRY|GL_APIENTRY|APIENTRY|EGLAPIENTRY|WINAPI)?(\\s*)([ew]?gl\\w+)\\s?(\\(.*)");
 
-  protected static Pattern associationPattern =
+  protected static final Pattern associationPattern =
     Pattern.compile("\\#ifndef ([CEW]?GL[XU]?_[A-Za-z0-9_]+)(.*)");
 
-  protected static Pattern ifPattern =
+  protected static final Pattern ifPattern =
     Pattern.compile("\\#if(.*)");
-  protected static Pattern elsePattern =
+  protected static final Pattern elsePattern =
     Pattern.compile("\\#(elif|else)(.*)");
-  protected static Pattern endifPattern =
+  protected static final Pattern endifPattern =
     Pattern.compile("\\#endif(.*)");
 
   protected static final int defineIdentifierGroup = 1;
-  protected static Pattern definePattern =
+  protected static final Pattern definePattern =
     Pattern.compile("\\#define ([CEW]?GL[XU]?_[A-Za-z0-9_]+)\\s*([A-Za-z0-9_]+)(.*)");
 
   // Maps function / #define names to Set of names of the extensions they're declared in
@@ -138,41 +138,41 @@ public class BuildStaticGLInfo {
      * classes reside, and the remaining arguments are paths to the C header
      * files that should be parsed
      */
-    public static void main(String[] args) throws IOException {
+    public static void main(final String[] args) throws IOException {
         if (args.length > 0 && args[0].equals("-test")) {
-            BuildStaticGLInfo builder = new BuildStaticGLInfo();
+            final BuildStaticGLInfo builder = new BuildStaticGLInfo();
             builder.setDebug(true);
-            String[] newArgs = new String[args.length - 1];
+            final String[] newArgs = new String[args.length - 1];
             System.arraycopy(args, 1, newArgs, 0, args.length - 1);
             builder.parse(newArgs);
             builder.dump();
             System.exit(0);
         }
 
-        String packageName = args[0];
-        String packageDir = args[1];
+        final String packageName = args[0];
+        final String packageDir = args[1];
 
-        String[] cHeaderFilePaths = new String[args.length - 2];
+        final String[] cHeaderFilePaths = new String[args.length - 2];
         System.arraycopy(args, 2, cHeaderFilePaths, 0, cHeaderFilePaths.length);
 
-        BuildStaticGLInfo builder = new BuildStaticGLInfo();
+        final BuildStaticGLInfo builder = new BuildStaticGLInfo();
         try {
             builder.parse(cHeaderFilePaths);
 
-            File file = new File(packageDir + File.separatorChar + "StaticGLInfo.java");
-            String parentDir = file.getParent();
+            final File file = new File(packageDir + File.separatorChar + "StaticGLInfo.java");
+            final String parentDir = file.getParent();
             if (parentDir != null) {
-                File pDirFile = new File(parentDir);
+                final File pDirFile = new File(parentDir);
                 pDirFile.mkdirs();
             }
 
-            PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(file)));
+            final PrintWriter writer = new PrintWriter(new BufferedWriter(new FileWriter(file)));
             builder.emitJavaCode(writer, packageName);
 
             writer.flush();
             writer.close();
-        } catch (Exception e) {
-            StringBuilder buf = new StringBuilder("{ ");
+        } catch (final Exception e) {
+            final StringBuilder buf = new StringBuilder("{ ");
             for (int i = 0; i < cHeaderFilePaths.length; ++i) {
                 buf.append(cHeaderFilePaths[i]);
                 buf.append(" ");
@@ -183,13 +183,13 @@ public class BuildStaticGLInfo {
         }
     }
 
-    public void setDebug(boolean v) {
+    public void setDebug(final boolean v) {
         DEBUG = v;
     }
 
     /** Parses the supplied C header files and adds the function
     associations contained therein to the internal map. */
-    public void parse(String[] cHeaderFilePaths) throws IOException {
+    public void parse(final String[] cHeaderFilePaths) throws IOException {
         for (int i = 0; i < cHeaderFilePaths.length; i++) {
             parse(cHeaderFilePaths[i]);
         }
@@ -197,8 +197,8 @@ public class BuildStaticGLInfo {
 
     /** Parses the supplied C header file and adds the function
     associations contained therein to the internal map. */
-    public void parse(String cHeaderFilePath) throws IOException {
-        BufferedReader reader = new BufferedReader(new FileReader(cHeaderFilePath));
+    public void parse(final String cHeaderFilePath) throws IOException {
+        final BufferedReader reader = new BufferedReader(new FileReader(cHeaderFilePath));
         String line, activeAssociation = null;
         Matcher m = null;
         int block = 0;
@@ -264,23 +264,23 @@ public class BuildStaticGLInfo {
     }
 
     public void dump() {
-        for (String name : extensionToDeclarationMap.keySet()) {
-            Set<String> decls = extensionToDeclarationMap.get(name);
+        for (final String name : extensionToDeclarationMap.keySet()) {
+            final Set<String> decls = extensionToDeclarationMap.get(name);
             System.out.println("<" + name + "> :");
-            List<String> l = new ArrayList<String>();
+            final List<String> l = new ArrayList<String>();
             l.addAll(decls);
             Collections.sort(l);
-            for (String str : l) {
+            for (final String str : l) {
                 System.out.println("  <" + str + ">");
             }
         }
     }
 
-    public Set<String> getExtension(String identifier) {
+    public Set<String> getExtension(final String identifier) {
         return declarationToExtensionMap.get(identifier);
     }
 
-    public Set<String> getDeclarations(String extension) {
+    public Set<String> getDeclarations(final String extension) {
         return extensionToDeclarationMap.get(extension);
     }
 
@@ -288,7 +288,7 @@ public class BuildStaticGLInfo {
         return extensionToDeclarationMap.keySet();
     }
 
-    public void emitJavaCode(PrintWriter output, String packageName) {
+    public void emitJavaCode(final PrintWriter output, final String packageName) {
         output.println("package " + packageName + ";");
         output.println();
         output.println("import java.util.*;");
@@ -340,7 +340,7 @@ public class BuildStaticGLInfo {
 
         // Compute max capacity
         int maxCapacity = 0;
-        for (String name : declarationToExtensionMap.keySet()) {
+        for (final String name : declarationToExtensionMap.keySet()) {
             if (!name.startsWith("GL")) {
                 ++maxCapacity;
             }
@@ -348,17 +348,17 @@ public class BuildStaticGLInfo {
 
         output.println("    funcToAssocMap = new HashMap(" + maxCapacity + "); // approximate max capacity");
         output.println("    String group;");
-        ArrayList<String> sets = new ArrayList<String>(extensionToDeclarationMap.keySet());
+        final ArrayList<String> sets = new ArrayList<String>(extensionToDeclarationMap.keySet());
         Collections.sort(sets);
-        for (String groupName : sets) {
-            Set<String> funcs = extensionToDeclarationMap.get(groupName);
-            List<String> l = new ArrayList<String>();
+        for (final String groupName : sets) {
+            final Set<String> funcs = extensionToDeclarationMap.get(groupName);
+            final List<String> l = new ArrayList<String>();
             l.addAll(funcs);
             Collections.sort(l);
-            Iterator<String> funcIter = l.iterator();
+            final Iterator<String> funcIter = l.iterator();
             boolean printedHeader = false;
             while (funcIter.hasNext()) {
-                String funcName = funcIter.next();
+                final String funcName = funcIter.next();
                 if (!funcName.startsWith("GL")) {
                     if (!printedHeader) {
                         output.println();
@@ -380,7 +380,7 @@ public class BuildStaticGLInfo {
     //----------------------------------------------------------------------
     // Internals only below this point
     //
-    protected void addAssociation(String identifier, String association) {
+    protected void addAssociation(final String identifier, final String association) {
         Set<String> extensions = declarationToExtensionMap.get(identifier);
         if(null == extensions) {
             extensions = new HashSet<String>();
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
index f1a32fa..5da45ab 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
@@ -59,17 +59,17 @@ import java.util.StringTokenizer;
 public class GLConfiguration extends ProcAddressConfiguration {
 
     // The following data members support ignoring an entire extension at a time
-    private List<String> glHeaders = new ArrayList<String>();
-    private Set<String> ignoredExtensions = new HashSet<String>();
-    private Set<String> forcedExtensions = new HashSet<String>();
-    private Set<String> extensionsRenamedIntoCore = new HashSet<String>();
+    private final List<String> glHeaders = new ArrayList<String>();
+    private final Set<String> ignoredExtensions = new HashSet<String>();
+    private final Set<String> forcedExtensions = new HashSet<String>();
+    private final Set<String> extensionsRenamedIntoCore = new HashSet<String>();
     private BuildStaticGLInfo glInfo;
 
     // Maps function names to the kind of buffer object it deals with
-    private Map<String, GLEmitter.BufferObjectKind> bufferObjectKinds = new HashMap<String, GLEmitter.BufferObjectKind>();
-    private Set<String> bufferObjectOnly = new HashSet<String>();
-    private GLEmitter emitter;
-    private Set<String> dropUniqVendorExtensions = new HashSet<String>();
+    private final Map<String, GLEmitter.BufferObjectKind> bufferObjectKinds = new HashMap<String, GLEmitter.BufferObjectKind>();
+    private final Set<String> bufferObjectOnly = new HashSet<String>();
+    private final GLEmitter emitter;
+    private final Set<String> dropUniqVendorExtensions = new HashSet<String>();
 
     // This directive is off by default but can help automatically
     // indicate which extensions have been folded into the core OpenGL
@@ -77,52 +77,52 @@ public class GLConfiguration extends ProcAddressConfiguration {
     private boolean autoUnifyExtensions = false;
     private boolean allowNonGLExtensions = false;
 
-    public GLConfiguration(GLEmitter emitter) {
+    public GLConfiguration(final GLEmitter emitter) {
         super();
         this.emitter = emitter;
         try {
             setProcAddressNameExpr("PFN $UPPERCASE({0}) PROC");
-        } catch (NoSuchElementException e) {
+        } catch (final NoSuchElementException e) {
             throw new RuntimeException("Error configuring ProcAddressNameExpr", e);
         }
     }
 
     @Override
-    protected void dispatch(String cmd, StringTokenizer tok, File file, String filename, int lineNo) throws IOException {
+    protected void dispatch(final String cmd, final StringTokenizer tok, final File file, final String filename, final int lineNo) throws IOException {
         if (cmd.equalsIgnoreCase("IgnoreExtension")) {
-            String sym = readString("IgnoreExtension", tok, filename, lineNo);
+            final String sym = readString("IgnoreExtension", tok, filename, lineNo);
             ignoredExtensions.add(sym);
         } else if (cmd.equalsIgnoreCase("ForceExtension")) {
-            String sym = readString("ForceExtension", tok, filename, lineNo);
+            final String sym = readString("ForceExtension", tok, filename, lineNo);
             forcedExtensions.add(sym);
         } else if (cmd.equalsIgnoreCase("RenameExtensionIntoCore")) {
-            String sym = readString("RenameExtensionIntoCore", tok, filename, lineNo);
+            final String sym = readString("RenameExtensionIntoCore", tok, filename, lineNo);
             extensionsRenamedIntoCore.add(sym);
         } else if (cmd.equalsIgnoreCase("AllowNonGLExtensions")) {
             allowNonGLExtensions = readBoolean("AllowNonGLExtensions", tok, filename, lineNo).booleanValue();
         } else if (cmd.equalsIgnoreCase("AutoUnifyExtensions")) {
             autoUnifyExtensions = readBoolean("AutoUnifyExtensions", tok, filename, lineNo).booleanValue();
         } else if (cmd.equalsIgnoreCase("GLHeader")) {
-            String sym = readString("GLHeader", tok, filename, lineNo);
+            final String sym = readString("GLHeader", tok, filename, lineNo);
             glHeaders.add(sym);
         } else if (cmd.equalsIgnoreCase("BufferObjectKind")) {
             readBufferObjectKind(tok, filename, lineNo);
         } else if (cmd.equalsIgnoreCase("BufferObjectOnly")) {
-            String sym = readString("BufferObjectOnly", tok, filename, lineNo);
+            final String sym = readString("BufferObjectOnly", tok, filename, lineNo);
             bufferObjectOnly.add(sym);
         } else if (cmd.equalsIgnoreCase("DropUniqVendorExtensions")) {
-            String sym = readString("DropUniqVendorExtensions", tok, filename, lineNo);
+            final String sym = readString("DropUniqVendorExtensions", tok, filename, lineNo);
             dropUniqVendorExtensions.add(sym);
         } else {
             super.dispatch(cmd, tok, file, filename, lineNo);
         }
     }
 
-    protected void readBufferObjectKind(StringTokenizer tok, String filename, int lineNo) {
+    protected void readBufferObjectKind(final StringTokenizer tok, final String filename, final int lineNo) {
         try {
-            String kindString = tok.nextToken();
+            final String kindString = tok.nextToken();
             GLEmitter.BufferObjectKind kind = null;
-            String target = tok.nextToken();
+            final String target = tok.nextToken();
             if (kindString.equalsIgnoreCase("UnpackPixel")) {
                 kind = GLEmitter.BufferObjectKind.UNPACK_PIXEL;
             } else if (kindString.equalsIgnoreCase("PackPixel")) {
@@ -140,7 +140,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
             }
 
             bufferObjectKinds.put(target, kind);
-        } catch (NoSuchElementException e) {
+        } catch (final NoSuchElementException e) {
             throw new RuntimeException("Error parsing \"BufferObjectKind\" command at line " + lineNo
                     + " in file \"" + filename + "\"", e);
         }
@@ -150,10 +150,10 @@ public class GLConfiguration extends ProcAddressConfiguration {
     automatically generates prologue code for functions associated
     with buffer objects. */
     @Override
-    public List<String> javaPrologueForMethod(MethodBinding binding, boolean forImplementingMethodCall, boolean eraseBufferAndArrayTypes) {
+    public List<String> javaPrologueForMethod(final MethodBinding binding, final boolean forImplementingMethodCall, final boolean eraseBufferAndArrayTypes) {
 
         List<String> res = super.javaPrologueForMethod(binding, forImplementingMethodCall, eraseBufferAndArrayTypes);
-        GLEmitter.BufferObjectKind kind = getBufferObjectKind(binding.getName());
+        final GLEmitter.BufferObjectKind kind = getBufferObjectKind(binding.getName());
         if (kind != null) {
             // Need to generate appropriate prologue based on both buffer
             // object kind and whether this variant of the MethodBinding
@@ -161,7 +161,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
             //
             // NOTE we MUST NOT mutate the array returned from the super
             // call!
-            ArrayList<String> res2 = new ArrayList<String>();
+            final ArrayList<String> res2 = new ArrayList<String>();
             if (res != null) {
                 res2.addAll(res);
             }
@@ -196,8 +196,8 @@ public class GLConfiguration extends ProcAddressConfiguration {
             // Must also filter out bogus rangeCheck directives for VBO/PBO
             // variants
             if (emitter.isBufferObjectMethodBinding(binding)) {
-                for (Iterator<String> iter = res.iterator(); iter.hasNext();) {
-                    String line = iter.next();
+                for (final Iterator<String> iter = res.iterator(); iter.hasNext();) {
+                    final String line = iter.next();
                     if (line.indexOf("Buffers.rangeCheck") >= 0) {
                         iter.remove();
                     }
@@ -211,22 +211,22 @@ public class GLConfiguration extends ProcAddressConfiguration {
     @Override
     public void dumpIgnores() {
         System.err.println("GL Ignored extensions: ");
-        for (String str : ignoredExtensions) {
+        for (final String str : ignoredExtensions) {
             System.err.println("\t" + str);
         }
         System.err.println("GL Forced extensions: ");
-        for (String str : forcedExtensions) {
+        for (final String str : forcedExtensions) {
             System.err.println("\t" + str);
         }
         super.dumpIgnores();
     }
 
-    protected boolean shouldIgnoreExtension(String symbol, boolean criteria) {
+    protected boolean shouldIgnoreExtension(final String symbol, final boolean criteria) {
         if (criteria && glInfo != null) {
             final Set<String> extensionNames = glInfo.getExtension(symbol);
             if( null != extensionNames ) {
                 boolean ignoredExtension = false;
-                for(Iterator<String> i=extensionNames.iterator(); !ignoredExtension && i.hasNext(); ) {
+                for(final Iterator<String> i=extensionNames.iterator(); !ignoredExtension && i.hasNext(); ) {
                     final String extensionName = i.next();
                     if ( extensionName != null && ignoredExtensions.contains(extensionName) ) {
                         if (DEBUG_IGNORES) {
@@ -245,7 +245,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
                     if( ignoredExtension ) {
                         final Set<String> origSymbols = getRenamedJavaSymbols( symbol );
                         if(null != origSymbols) {
-                            for(String origSymbol : origSymbols) {
+                            for(final String origSymbol : origSymbols) {
                                 if( shouldForceExtension( origSymbol, true, symbol ) ) {
                                     ignoredExtension = false;
                                     break;
@@ -258,11 +258,11 @@ public class GLConfiguration extends ProcAddressConfiguration {
                     return true;
                 }
             }
-            boolean isGLEnum = GLNameResolver.isGLEnumeration(symbol);
-            boolean isGLFunc = GLNameResolver.isGLFunction(symbol);
+            final boolean isGLEnum = GLNameResolver.isGLEnumeration(symbol);
+            final boolean isGLFunc = GLNameResolver.isGLFunction(symbol);
             if (isGLFunc || isGLEnum) {
                 if (GLNameResolver.isExtensionVEN(symbol, isGLFunc)) {
-                    String extSuffix = GLNameResolver.getExtensionSuffix(symbol, isGLFunc);
+                    final String extSuffix = GLNameResolver.getExtensionSuffix(symbol, isGLFunc);
                     if (getDropUniqVendorExtensions(extSuffix)) {
                         if (DEBUG_IGNORES) {
                             System.err.println("Ignore UniqVendorEXT: " + symbol + ", vendor " + extSuffix);
@@ -279,7 +279,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
         if (criteria && glInfo != null) {
             final Set<String> extensionNames = glInfo.getExtension(symbol);
             if( null != extensionNames ) {
-                for(Iterator<String> i=extensionNames.iterator(); i.hasNext(); ) {
+                for(final Iterator<String> i=extensionNames.iterator(); i.hasNext(); ) {
                     final String extensionName = i.next();
                     if ( extensionName != null && forcedExtensions.contains(extensionName) ) {
                         if (DEBUG_IGNORES) {
@@ -299,20 +299,20 @@ public class GLConfiguration extends ProcAddressConfiguration {
     }
 
     @Override
-    public boolean shouldIgnoreInInterface(String symbol) {
+    public boolean shouldIgnoreInInterface(final String symbol) {
         return shouldIgnoreInInterface(symbol, true);
     }
 
-    public boolean shouldIgnoreInInterface(String symbol, boolean checkEXT) {
+    public boolean shouldIgnoreInInterface(final String symbol, final boolean checkEXT) {
         return shouldIgnoreExtension(symbol, checkEXT) || super.shouldIgnoreInInterface(symbol);
     }
 
     @Override
-    public boolean shouldIgnoreInImpl(String symbol) {
+    public boolean shouldIgnoreInImpl(final String symbol) {
         return shouldIgnoreInImpl(symbol, true);
     }
 
-    public boolean shouldIgnoreInImpl(String symbol, boolean checkEXT) {
+    public boolean shouldIgnoreInImpl(final String symbol, final boolean checkEXT) {
         return shouldIgnoreExtension(symbol, checkEXT) || super.shouldIgnoreInImpl(symbol);
     }
 
@@ -330,32 +330,32 @@ public class GLConfiguration extends ProcAddressConfiguration {
     }
 
     /** shall the non unified (uniq) vendor extensions be dropped ?  */
-    public boolean getDropUniqVendorExtensions(String extName) {
+    public boolean getDropUniqVendorExtensions(final String extName) {
         return dropUniqVendorExtensions.contains(extName);
     }
 
     /** Returns the kind of buffer object this function deals with, or
     null if none. */
-    GLEmitter.BufferObjectKind getBufferObjectKind(String name) {
+    GLEmitter.BufferObjectKind getBufferObjectKind(final String name) {
         return bufferObjectKinds.get(name);
     }
 
-    public boolean isBufferObjectFunction(String name) {
+    public boolean isBufferObjectFunction(final String name) {
         return (getBufferObjectKind(name) != null);
     }
 
-    public boolean isBufferObjectOnly(String name) {
+    public boolean isBufferObjectOnly(final String name) {
         return bufferObjectOnly.contains(name);
     }
 
     /** Parses any GL headers specified in the configuration file for
     the purpose of being able to ignore an extension at a time. */
-    public void parseGLHeaders(GlueEmitterControls controls) throws IOException {
+    public void parseGLHeaders(final GlueEmitterControls controls) throws IOException {
         if (!glHeaders.isEmpty()) {
             glInfo = new BuildStaticGLInfo();
             glInfo.setDebug(GlueGen.debug());
-            for (String file : glHeaders) {
-                String fullPath = controls.findHeaderFile(file);
+            for (final String file : glHeaders) {
+                final String fullPath = controls.findHeaderFile(file);
                 if (fullPath == null) {
                     throw new IOException("Unable to locate header file \"" + file + "\"");
                 }
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
index 547382e..bc230c8 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
@@ -72,12 +72,12 @@ public class GLEmitter extends ProcAddressEmitter {
 
     // Keeps track of which MethodBindings were created for handling
     // Buffer Object variants. Used as a Set rather than a Map.
-    private Map<MethodBinding, MethodBinding> bufferObjectMethodBindings = new IdentityHashMap<MethodBinding, MethodBinding>();
+    private final Map<MethodBinding, MethodBinding> bufferObjectMethodBindings = new IdentityHashMap<MethodBinding, MethodBinding>();
 
     enum BufferObjectKind { UNPACK_PIXEL, PACK_PIXEL, ARRAY, ELEMENT, INDIRECT}
 
     @Override
-    public void beginEmission(GlueEmitterControls controls) throws IOException {
+    public void beginEmission(final GlueEmitterControls controls) throws IOException {
         getGLConfig().parseGLHeaders(controls);
         renameExtensionsIntoCore();
         if (getGLConfig().getAutoUnifyExtensions()) {
@@ -93,30 +93,30 @@ public class GLEmitter extends ProcAddressEmitter {
         // already in the core namespace in desktop OpenGL. It builds upon
         // renaming mechanisms that are built elsewhere.
 
-        GLConfiguration config = getGLConfig();
-        Set<String> extensionsRenamedIntoCore = config.getExtensionsRenamedIntoCore();
-        BuildStaticGLInfo glInfo = config.getGLInfo();
+        final GLConfiguration config = getGLConfig();
+        final Set<String> extensionsRenamedIntoCore = config.getExtensionsRenamedIntoCore();
+        final BuildStaticGLInfo glInfo = config.getGLInfo();
         if (null == glInfo) {
             if (extensionsRenamedIntoCore.size() > 0) {
                 throw new RuntimeException("ExtensionRenamedIntoCore (num: " + extensionsRenamedIntoCore.size() + "), but no GLHeader");
             }
             return;
         }
-        for (String extension : extensionsRenamedIntoCore) {
+        for (final String extension : extensionsRenamedIntoCore) {
             if(JavaConfiguration.DEBUG_RENAMES) {
                 System.err.println("<RenameExtensionIntoCore: "+extension+" BEGIN");
             }
-            Set<String> declarations = glInfo.getDeclarations(extension);
+            final Set<String> declarations = glInfo.getDeclarations(extension);
             if (declarations != null) {
-                for (Iterator<String> iterator = declarations.iterator(); iterator.hasNext();) {
-                    String decl = iterator.next();
-                    boolean isGLFunction = GLNameResolver.isGLFunction(decl);
+                for (final Iterator<String> iterator = declarations.iterator(); iterator.hasNext();) {
+                    final String decl = iterator.next();
+                    final boolean isGLFunction = GLNameResolver.isGLFunction(decl);
                     boolean isGLEnumeration = false;
                     if (!isGLFunction) {
                         isGLEnumeration = GLNameResolver.isGLEnumeration(decl);
                     }
                     if (isGLFunction || isGLEnumeration) {
-                        String renamed = GLNameResolver.normalize(decl, isGLFunction);
+                        final String renamed = GLNameResolver.normalize(decl, isGLFunction);
                         if (!renamed.equals(decl)) {
                             config.addJavaSymbolRename(decl, renamed);
                         }
@@ -135,8 +135,8 @@ public class GLEmitter extends ProcAddressEmitter {
         private List<FunctionSymbol> functions;
 
         @Override
-        public void filterSymbols(List<ConstantDefinition> constants,
-                List<FunctionSymbol> functions) {
+        public void filterSymbols(final List<ConstantDefinition> constants,
+                final List<FunctionSymbol> functions) {
             this.constants = constants;
             this.functions = functions;
             doWork();
@@ -153,17 +153,17 @@ public class GLEmitter extends ProcAddressEmitter {
         }
 
         private void doWork() {
-            BuildStaticGLInfo glInfo = getGLConfig().getGLInfo();
+            final BuildStaticGLInfo glInfo = getGLConfig().getGLInfo();
             if (glInfo == null) {
                 return;
             }
             // Try to retain a "good" ordering for these symbols
-            Map<String, ConstantDefinition> constantMap = new LinkedHashMap<String, ConstantDefinition>();
-            for (ConstantDefinition def : constants) {
+            final Map<String, ConstantDefinition> constantMap = new LinkedHashMap<String, ConstantDefinition>();
+            for (final ConstantDefinition def : constants) {
                 constantMap.put(def.getName(), def);
             }
-            Map<String, FunctionSymbol> functionMap = new LinkedHashMap<String, FunctionSymbol>();
-            for (FunctionSymbol sym : functions) {
+            final Map<String, FunctionSymbol> functionMap = new LinkedHashMap<String, FunctionSymbol>();
+            for (final FunctionSymbol sym : functions) {
                 functionMap.put(sym.getName(), sym);
             }
 
@@ -175,15 +175,15 @@ public class GLEmitter extends ProcAddressEmitter {
             // that doesn't support the core version of these APIs, the runtime
             // will take care of looking up the extension version of these entry
             // points.
-            Set<String> extensionNames = glInfo.getExtensions();
+            final Set<String> extensionNames = glInfo.getExtensions();
 
-            for (String extension : extensionNames) {
-                Set<String> declarations = glInfo.getDeclarations(extension);
+            for (final String extension : extensionNames) {
+                final Set<String> declarations = glInfo.getDeclarations(extension);
                 boolean isExtension = true;
                 boolean shouldUnify = true;
                 String cause = null;
-                for (String decl : declarations) {
-                    boolean isFunc = !decl.startsWith("GL_");
+                for (final String decl : declarations) {
+                    final boolean isFunc = !decl.startsWith("GL_");
                     if (!GLNameResolver.isExtension(decl, isFunc)) {
                         isExtension = false;
                         break;
@@ -202,7 +202,7 @@ public class GLEmitter extends ProcAddressEmitter {
                         }
                     }
                     cause = decl;
-                    String unifiedName = GLNameResolver.normalize(decl, isFunc);
+                    final String unifiedName = GLNameResolver.normalize(decl, isFunc);
                     // NOTE that we look up the unified name in the
                     // BuildStaticGLInfo's notion of the APIs -- since
                     // we might not be emitting glue code for the
@@ -225,8 +225,8 @@ public class GLEmitter extends ProcAddressEmitter {
                 }
                 if (isExtension) {
                     if (shouldUnify) {
-                        for (String decl : declarations) {
-                            boolean isFunc = !decl.startsWith("GL_");
+                        for (final String decl : declarations) {
+                            final boolean isFunc = !decl.startsWith("GL_");
                             if (isFunc) {
                                 functionMap.remove(decl);
                             } else {
@@ -244,7 +244,7 @@ public class GLEmitter extends ProcAddressEmitter {
         }
     }
 
-    private void unifyExtensions(GlueEmitterControls controls) {
+    private void unifyExtensions(final GlueEmitterControls controls) {
         controls.runSymbolFilter(new ExtensionUnifier());
     }
 
@@ -264,7 +264,7 @@ public class GLEmitter extends ProcAddressEmitter {
     inform the CMethodBindingEmitter that it is overloaded in this
     case (though we default to true currently). */
     @Override
-    protected List<MethodBinding> expandMethodBinding(MethodBinding binding) {
+    protected List<MethodBinding> expandMethodBinding(final MethodBinding binding) {
         final GLConfiguration glConfig = getGLConfig();
         final List<MethodBinding> bindings = super.expandMethodBinding(binding);
 
@@ -322,7 +322,7 @@ public class GLEmitter extends ProcAddressEmitter {
     }
 
     @Override
-    protected boolean needsModifiedEmitters(FunctionSymbol sym) {
+    protected boolean needsModifiedEmitters(final FunctionSymbol sym) {
         if ((!needsProcAddressWrapper(sym) && !needsBufferObjectVariant(sym))
                 || getConfig().isUnimplemented(sym.getName())) {
             return false;
@@ -331,22 +331,22 @@ public class GLEmitter extends ProcAddressEmitter {
         return true;
     }
 
-    public boolean isBufferObjectMethodBinding(MethodBinding binding) {
+    public boolean isBufferObjectMethodBinding(final MethodBinding binding) {
         return bufferObjectMethodBindings.containsKey(binding);
     }
 
     @Override
-    public void emitDefine(ConstantDefinition def, String optionalComment) throws Exception {
-        BuildStaticGLInfo glInfo = getGLConfig().getGLInfo();
+    public void emitDefine(final ConstantDefinition def, final String optionalComment) throws Exception {
+        final BuildStaticGLInfo glInfo = getGLConfig().getGLInfo();
         if (null == glInfo) {
             throw new Exception("No GLInfo for: " + def);
         }
-        String symbolRenamed = def.getName();
-        StringBuilder newComment = new StringBuilder();
+        final String symbolRenamed = def.getName();
+        final StringBuilder newComment = new StringBuilder();
         newComment.append("Part of ");
         if (0 == addExtensionsOfSymbols2Buffer(newComment, ", ", "; ", symbolRenamed, def.getAliasedNames())) {
             if (def.isEnum()) {
-                String enumName = def.getEnumName();
+                final String enumName = def.getEnumName();
                 if (null != enumName) {
                     newComment.append(enumName);
                 } else {
@@ -362,7 +362,7 @@ public class GLEmitter extends ProcAddressEmitter {
                     // ...
                     // #endif
                     if (JavaConfiguration.DEBUG_IGNORES) {
-                        StringBuilder sb = new StringBuilder();
+                        final StringBuilder sb = new StringBuilder();
                         JavaEmitter.addStrings2Buffer(sb, ", ", symbolRenamed, def.getAliasedNames());
                         System.err.println("Dropping marker: " + sb.toString());
                     }
@@ -379,12 +379,12 @@ public class GLEmitter extends ProcAddressEmitter {
         super.emitDefine(def, newComment.toString());
     }
 
-    private int addExtensionListOfSymbol2Buffer(BuildStaticGLInfo glInfo, StringBuilder buf, String sep1, String name) {
+    private int addExtensionListOfSymbol2Buffer(final BuildStaticGLInfo glInfo, final StringBuilder buf, final String sep1, final String name) {
         int num = 0;
-        Set<String> extensionNames = glInfo.getExtension(name);
+        final Set<String> extensionNames = glInfo.getExtension(name);
         if(null!=extensionNames) {
-            for(Iterator<String> i=extensionNames.iterator(); i.hasNext(); ) {
-                String extensionName = i.next();
+            for(final Iterator<String> i=extensionNames.iterator(); i.hasNext(); ) {
+                final String extensionName = i.next();
                 if (null != extensionName) {
                     buf.append("<code>");
                     buf.append(extensionName);
@@ -398,19 +398,19 @@ public class GLEmitter extends ProcAddressEmitter {
         }
         return num;
     }
-    private int addExtensionListOfAliasedSymbols2Buffer(BuildStaticGLInfo glInfo, StringBuilder buf, String sep1, String sep2, String name, Collection<String> exclude) {
+    private int addExtensionListOfAliasedSymbols2Buffer(final BuildStaticGLInfo glInfo, final StringBuilder buf, final String sep1, final String sep2, final String name, final Collection<String> exclude) {
         int num = 0;
         if(null != name) {
             num += addExtensionListOfSymbol2Buffer(glInfo, buf, sep1, name); // extensions of given name
             boolean needsSep2 = 0<num;
-            Set<String> origNames = cfg.getRenamedJavaSymbols(name);
+            final Set<String> origNames = cfg.getRenamedJavaSymbols(name);
             if(null != origNames) {
-                for(String origName : origNames) {
+                for(final String origName : origNames) {
                     if(!exclude.contains(origName)) {
                         if (needsSep2) {
                             buf.append(sep2); // diff-name seperator
                         }
-                        int num2 = addExtensionListOfSymbol2Buffer(glInfo, buf, sep1, origName); // extensions of orig-name
+                        final int num2 = addExtensionListOfSymbol2Buffer(glInfo, buf, sep1, origName); // extensions of orig-name
                         needsSep2 = num<num2;
                         num += num2;
                     }
@@ -420,8 +420,8 @@ public class GLEmitter extends ProcAddressEmitter {
         return num;
     }
 
-    public int addExtensionsOfSymbols2Buffer(StringBuilder buf, String sep1, String sep2, String first, Collection<String> col) {
-        BuildStaticGLInfo glInfo = getGLConfig().getGLInfo();
+    public int addExtensionsOfSymbols2Buffer(StringBuilder buf, final String sep1, final String sep2, final String first, final Collection<String> col) {
+        final BuildStaticGLInfo glInfo = getGLConfig().getGLInfo();
         if (null == glInfo) {
             throw new RuntimeException("No GLInfo for: " + first);
         }
@@ -432,11 +432,11 @@ public class GLEmitter extends ProcAddressEmitter {
 
         num += addExtensionListOfAliasedSymbols2Buffer(glInfo, buf, sep1, sep2, first, col);
         boolean needsSep2 = 0<num;
-        for(Iterator<String> iter = col.iterator(); iter.hasNext(); ) {
+        for(final Iterator<String> iter = col.iterator(); iter.hasNext(); ) {
             if(needsSep2) {
                 buf.append(sep2); // diff-name seperator
             }
-            int num2 = addExtensionListOfAliasedSymbols2Buffer(glInfo, buf, sep1, sep2, iter.next(), col);
+            final int num2 = addExtensionListOfAliasedSymbols2Buffer(glInfo, buf, sep1, sep2, iter.next(), col);
             needsSep2 = num<num2;
             num += num2;
         }
@@ -447,12 +447,12 @@ public class GLEmitter extends ProcAddressEmitter {
     // Internals only below this point
     //
     @Override
-    protected void generateModifiedEmitters(JavaMethodBindingEmitter baseJavaEmitter, List<FunctionEmitter> emitters) {
-        List<FunctionEmitter> superEmitters = new ArrayList<FunctionEmitter>();
+    protected void generateModifiedEmitters(final JavaMethodBindingEmitter baseJavaEmitter, final List<FunctionEmitter> emitters) {
+        final List<FunctionEmitter> superEmitters = new ArrayList<FunctionEmitter>();
         super.generateModifiedEmitters(baseJavaEmitter, superEmitters);
 
         // See whether this is one of the Buffer Object variants
-        boolean bufferObjectVariant = bufferObjectMethodBindings.containsKey(baseJavaEmitter.getBinding());
+        final boolean bufferObjectVariant = bufferObjectMethodBindings.containsKey(baseJavaEmitter.getBinding());
 
         for (FunctionEmitter emitter : superEmitters) {
             if (emitter instanceof ProcAddressJavaMethodBindingEmitter) {
@@ -462,7 +462,7 @@ public class GLEmitter extends ProcAddressEmitter {
         }
     }
 
-    protected boolean needsBufferObjectVariant(FunctionSymbol sym) {
+    protected boolean needsBufferObjectVariant(final FunctionSymbol sym) {
         return getGLConfig().isBufferObjectFunction(sym.getName());
     }
 
@@ -475,7 +475,7 @@ public class GLEmitter extends ProcAddressEmitter {
      */
     @Override
     protected void endProcAddressTable() throws Exception {
-        PrintWriter w = tableWriter;
+        final PrintWriter w = tableWriter;
 
         w.println("  @Override");
         w.println("  protected boolean isFunctionAvailableImpl(String functionNameUsr) throws IllegalArgumentException  {");
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java
index 389d35f..d491a37 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLJavaMethodBindingEmitter.java
@@ -58,8 +58,8 @@ public class GLJavaMethodBindingEmitter extends ProcAddressJavaMethodBindingEmit
     protected GLEmitter glEmitter;
     protected CommentEmitter glCommentEmitter = new GLCommentEmitter();
 
-    public GLJavaMethodBindingEmitter(JavaMethodBindingEmitter methodToWrap, boolean callThroughProcAddress,
-            String getProcAddressTableExpr, boolean changeNameAndArguments, boolean bufferObjectVariant, GLEmitter emitter) {
+    public GLJavaMethodBindingEmitter(final JavaMethodBindingEmitter methodToWrap, final boolean callThroughProcAddress,
+            final String getProcAddressTableExpr, final boolean changeNameAndArguments, final boolean bufferObjectVariant, final GLEmitter emitter) {
 
         super(methodToWrap, callThroughProcAddress, getProcAddressTableExpr, changeNameAndArguments, emitter);
         this.bufferObjectVariant = bufferObjectVariant;
@@ -67,20 +67,20 @@ public class GLJavaMethodBindingEmitter extends ProcAddressJavaMethodBindingEmit
         setCommentEmitter(glCommentEmitter);
     }
 
-    public GLJavaMethodBindingEmitter(ProcAddressJavaMethodBindingEmitter methodToWrap, GLEmitter emitter, boolean bufferObjectVariant) {
+    public GLJavaMethodBindingEmitter(final ProcAddressJavaMethodBindingEmitter methodToWrap, final GLEmitter emitter, final boolean bufferObjectVariant) {
         super(methodToWrap);
         this.bufferObjectVariant = bufferObjectVariant;
         this.glEmitter = emitter;
         setCommentEmitter(glCommentEmitter);
     }
 
-    public GLJavaMethodBindingEmitter(GLJavaMethodBindingEmitter methodToWrap) {
+    public GLJavaMethodBindingEmitter(final GLJavaMethodBindingEmitter methodToWrap) {
         this(methodToWrap, methodToWrap.glEmitter, methodToWrap.bufferObjectVariant);
     }
 
     @Override
-    protected String getArgumentName(int i) {
-        String name = super.getArgumentName(i);
+    protected String getArgumentName(final int i) {
+        final String name = super.getArgumentName(i);
 
         if (!bufferObjectVariant) {
             return name;
@@ -89,8 +89,8 @@ public class GLJavaMethodBindingEmitter extends ProcAddressJavaMethodBindingEmit
         // Emitters for VBO/PBO-related routines change the outgoing
         // argument name for the buffer
         if (binding.getJavaArgumentType(i).isLong()) {
-            Type cType = binding.getCArgumentType(i);
-            Type targetType = cType.asPointer().getTargetType();
+            final Type cType = binding.getCArgumentType(i);
+            final Type targetType = cType.asPointer().getTargetType();
             if (cType.isPointer() && (targetType.isVoid() || targetType.isPrimitive())) {
                 return name + "_buffer_offset";
             }
@@ -102,10 +102,10 @@ public class GLJavaMethodBindingEmitter extends ProcAddressJavaMethodBindingEmit
     protected class GLCommentEmitter extends JavaMethodBindingEmitter.DefaultCommentEmitter {
 
         @Override
-        protected void emitBindingCSignature(MethodBinding binding, PrintWriter writer) {
+        protected void emitBindingCSignature(final MethodBinding binding, final PrintWriter writer) {
 
-            String symbolRenamed = binding.getName();
-            StringBuilder newComment = new StringBuilder();
+            final String symbolRenamed = binding.getName();
+            final StringBuilder newComment = new StringBuilder();
 
             final FunctionSymbol funcSym = binding.getCSymbol();
             writer.print("<code> ");
@@ -117,9 +117,9 @@ public class GLJavaMethodBindingEmitter extends ProcAddressJavaMethodBindingEmit
                 if (glEmitter.getGLConfig().getAllowNonGLExtensions()) {
                     newComment.append("CORE FUNC");
                 } else {
-                    StringBuilder sb = new StringBuilder();
+                    final StringBuilder sb = new StringBuilder();
                     JavaEmitter.addStrings2Buffer(sb, ", ", symbolRenamed, binding.getAliasedNames());
-                    RuntimeException ex = new RuntimeException("Couldn't find extension to: " + binding + " ; " + sb.toString());
+                    final RuntimeException ex = new RuntimeException("Couldn't find extension to: " + binding + " ; " + sb.toString());
                     glEmitter.getGLConfig().getGLInfo().dump();
                     // glEmitter.getGLConfig().dumpRenames();
                     throw ex;
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java b/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java
index 21946ea..66819a8 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/ant/StaticGLGenTask.java
@@ -78,7 +78,7 @@ public class StaticGLGenTask extends Task
      * <p>The {@link org.apache.tools.ant.types.CommandlineJava} that is used
      * to execute {@link com.jogamp.gluegen.opengl.BuildStaticGLInfo}.</p>
      */
-    private CommandlineJava glgenCommandline;
+    private final CommandlineJava glgenCommandline;
 
     // =========================================================================
     /**
@@ -94,7 +94,7 @@ public class StaticGLGenTask extends Task
     /**
      * <p>The {@link org.apache.tools.ant.types.FileSet} of GL headers.</p>
      */
-    private FileSet headerSet = new FileSet();
+    private final FileSet headerSet = new FileSet();
 
     // =========================================================================
     /**
@@ -117,7 +117,7 @@ public class StaticGLGenTask extends Task
      *
      * @param  packageName the name of the package for the generated files
      */
-    public void setPackage(String packageName)
+    public void setPackage(final String packageName)
     {
         log( ("Setting package name to: " + packageName), Project.MSG_VERBOSE);
         this.packageName = packageName;
@@ -128,7 +128,7 @@ public class StaticGLGenTask extends Task
      *
      * @param  directory the output directory
      */
-    public void setOutputDir(String directory)
+    public void setOutputDir(final String directory)
     {
         log( ("Setting output directory to: " + directory),
               Project.MSG_VERBOSE);
@@ -163,7 +163,7 @@ public class StaticGLGenTask extends Task
      *
      * @param  headers the string containing the header patterns
      */
-    public void setHeaders(String headers)
+    public void setHeaders(final String headers)
     {
         headerSet.setIncludes(headers);
     }
@@ -236,7 +236,7 @@ public class StaticGLGenTask extends Task
      * @return <code>true</code> if the string is valid.  <code>false</code>
      *         otherwise.
      */
-    private boolean isValid(String string)
+    private boolean isValid(final String string)
     {
         // check for null
         if(string == null)
@@ -265,8 +265,8 @@ public class StaticGLGenTask extends Task
 
         // add the header -files- from the FileSet
         headerSet.setDir(getProject().getBaseDir());
-        DirectoryScanner directoryScanner = headerSet.getDirectoryScanner(getProject());
-        String[] directoryFiles = directoryScanner.getIncludedFiles();
+        final DirectoryScanner directoryScanner = headerSet.getDirectoryScanner(getProject());
+        final String[] directoryFiles = directoryScanner.getIncludedFiles();
         for(int i=0; i<directoryFiles.length; i++)
         {
             glgenCommandline.createArgument().setValue(directoryFiles[i]);
@@ -279,11 +279,11 @@ public class StaticGLGenTask extends Task
      *
      * @throws BuildException
      */
-    private int execute(String[] command)
+    private int execute(final String[] command)
         throws BuildException
     {
         // create the object that will perform the command execution
-        Execute execute = new Execute(new LogStreamHandler(this, Project.MSG_INFO,
+        final Execute execute = new Execute(new LogStreamHandler(this, Project.MSG_INFO,
                                                            Project.MSG_WARN),
                                       null);
 
@@ -296,7 +296,7 @@ public class StaticGLGenTask extends Task
         try
         {
             return execute.execute();
-        } catch(IOException ioe)
+        } catch(final IOException ioe)
         {
             throw new BuildException(ioe, location);
         }
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java
index 4ac9ae3..de9e3ed 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureEmitter.java
@@ -61,14 +61,14 @@ import java.util.Set;
 public class NativeSignatureEmitter extends GLEmitter {
 
     @Override
-    protected List<? extends FunctionEmitter> generateMethodBindingEmitters(Set<MethodBinding> methodBindingSet, FunctionSymbol sym) throws Exception {
+    protected List<? extends FunctionEmitter> generateMethodBindingEmitters(final Set<MethodBinding> methodBindingSet, final FunctionSymbol sym) throws Exception {
 
         // Allow superclass to do most of the work for us
-        List<? extends FunctionEmitter> res = super.generateMethodBindingEmitters(methodBindingSet, sym);
+        final List<? extends FunctionEmitter> res = super.generateMethodBindingEmitters(methodBindingSet, sym);
 
         // Filter out all non-JavaMethodBindingEmitters
-        for (Iterator<? extends FunctionEmitter> iter = res.iterator(); iter.hasNext();) {
-            FunctionEmitter emitter = iter.next();
+        for (final Iterator<? extends FunctionEmitter> iter = res.iterator(); iter.hasNext();) {
+            final FunctionEmitter emitter = iter.next();
             if (!(emitter instanceof JavaMethodBindingEmitter)) {
                 iter.remove();
             }
@@ -78,13 +78,13 @@ public class NativeSignatureEmitter extends GLEmitter {
             return res;
         }
 
-        PrintWriter writer = (getConfig().allStatic() ? javaWriter() : javaImplWriter());
+        final PrintWriter writer = (getConfig().allStatic() ? javaWriter() : javaImplWriter());
 
-        List<FunctionEmitter> processed = new ArrayList<FunctionEmitter>();
+        final List<FunctionEmitter> processed = new ArrayList<FunctionEmitter>();
 
         // First, filter out all emitters going to the "other" (public) writer
-        for (Iterator<? extends FunctionEmitter> iter = res.iterator(); iter.hasNext();) {
-            FunctionEmitter emitter = iter.next();
+        for (final Iterator<? extends FunctionEmitter> iter = res.iterator(); iter.hasNext();) {
+            final FunctionEmitter emitter = iter.next();
             if (emitter.getDefaultOutput() != writer) {
                 processed.add(emitter);
                 iter.remove();
@@ -93,12 +93,12 @@ public class NativeSignatureEmitter extends GLEmitter {
 
         // Now process all of the remaining emitters sorted by MethodBinding
         while (!res.isEmpty()) {
-            List<JavaMethodBindingEmitter> emittersForBinding = new ArrayList<JavaMethodBindingEmitter>();
-            JavaMethodBindingEmitter emitter = (JavaMethodBindingEmitter) res.remove(0);
+            final List<JavaMethodBindingEmitter> emittersForBinding = new ArrayList<JavaMethodBindingEmitter>();
+            final JavaMethodBindingEmitter emitter = (JavaMethodBindingEmitter) res.remove(0);
             emittersForBinding.add(emitter);
-            MethodBinding binding = emitter.getBinding();
-            for (Iterator<? extends FunctionEmitter> iter = res.iterator(); iter.hasNext();) {
-                JavaMethodBindingEmitter emitter2 = (JavaMethodBindingEmitter) iter.next();
+            final MethodBinding binding = emitter.getBinding();
+            for (final Iterator<? extends FunctionEmitter> iter = res.iterator(); iter.hasNext();) {
+                final JavaMethodBindingEmitter emitter2 = (JavaMethodBindingEmitter) iter.next();
                 if (emitter2.getBinding() == binding) {
                     emittersForBinding.add(emitter2);
                     iter.remove();
@@ -111,17 +111,17 @@ public class NativeSignatureEmitter extends GLEmitter {
         return processed;
     }
 
-    protected void generateNativeSignatureEmitters(MethodBinding binding, List<JavaMethodBindingEmitter> allEmitters) {
+    protected void generateNativeSignatureEmitters(final MethodBinding binding, final List<JavaMethodBindingEmitter> allEmitters) {
 
         if (allEmitters.isEmpty()) {
             return;
         }
 
-        PrintWriter writer = (getConfig().allStatic() ? javaWriter() : javaImplWriter());
+        final PrintWriter writer = (getConfig().allStatic() ? javaWriter() : javaImplWriter());
 
         // Give ourselves the chance to interpose on the generation of all code to keep things simple
-        List<JavaMethodBindingEmitter> newEmitters = new ArrayList<JavaMethodBindingEmitter>();
-        for (JavaMethodBindingEmitter javaEmitter : allEmitters) {
+        final List<JavaMethodBindingEmitter> newEmitters = new ArrayList<JavaMethodBindingEmitter>();
+        for (final JavaMethodBindingEmitter javaEmitter : allEmitters) {
             NativeSignatureJavaMethodBindingEmitter newEmitter = null;
             if (javaEmitter instanceof GLJavaMethodBindingEmitter) {
                 newEmitter = new NativeSignatureJavaMethodBindingEmitter((GLJavaMethodBindingEmitter) javaEmitter);
@@ -138,11 +138,11 @@ public class NativeSignatureEmitter extends GLEmitter {
         // been called with signatureOnly both true and false.
         if (signatureContainsStrings(binding) && !haveEmitterWithBody(allEmitters)) {
             // This basically handles glGetString but also any similar methods
-            NativeSignatureJavaMethodBindingEmitter javaEmitter = findEmitterWithWriter(allEmitters, writer);
+            final NativeSignatureJavaMethodBindingEmitter javaEmitter = findEmitterWithWriter(allEmitters, writer);
 
             // First, we need to clone this emitter to produce the native
             // entry point
-            NativeSignatureJavaMethodBindingEmitter emitter = new NativeSignatureJavaMethodBindingEmitter(javaEmitter);
+            final NativeSignatureJavaMethodBindingEmitter emitter = new NativeSignatureJavaMethodBindingEmitter(javaEmitter);
             emitter.removeModifier(JavaMethodBindingEmitter.PUBLIC);
             emitter.addModifier(JavaMethodBindingEmitter.PRIVATE);
             emitter.setForImplementingMethodCall(true);
@@ -158,22 +158,22 @@ public class NativeSignatureEmitter extends GLEmitter {
         }
     }
 
-    protected boolean signatureContainsStrings(MethodBinding binding) {
+    protected boolean signatureContainsStrings(final MethodBinding binding) {
         for (int i = 0; i < binding.getNumArguments(); i++) {
-            JavaType type = binding.getJavaArgumentType(i);
+            final JavaType type = binding.getJavaArgumentType(i);
             if (type.isString() || type.isStringArray()) {
                 return true;
             }
         }
-        JavaType retType = binding.getJavaReturnType();
+        final JavaType retType = binding.getJavaReturnType();
         if (retType.isString() || retType.isStringArray()) {
             return true;
         }
         return false;
     }
 
-    protected boolean haveEmitterWithBody(List<JavaMethodBindingEmitter> allEmitters) {
-        for (JavaMethodBindingEmitter emitter : allEmitters) {
+    protected boolean haveEmitterWithBody(final List<JavaMethodBindingEmitter> allEmitters) {
+        for (final JavaMethodBindingEmitter emitter : allEmitters) {
             if (!emitter.signatureOnly()) {
                 return true;
             }
@@ -181,9 +181,9 @@ public class NativeSignatureEmitter extends GLEmitter {
         return false;
     }
 
-    protected NativeSignatureJavaMethodBindingEmitter findEmitterWithWriter(List<JavaMethodBindingEmitter> allEmitters, PrintWriter writer) {
-        for (JavaMethodBindingEmitter jemitter : allEmitters) {
-            NativeSignatureJavaMethodBindingEmitter emitter = (NativeSignatureJavaMethodBindingEmitter)jemitter;
+    protected NativeSignatureJavaMethodBindingEmitter findEmitterWithWriter(final List<JavaMethodBindingEmitter> allEmitters, final PrintWriter writer) {
+        for (final JavaMethodBindingEmitter jemitter : allEmitters) {
+            final NativeSignatureJavaMethodBindingEmitter emitter = (NativeSignatureJavaMethodBindingEmitter)jemitter;
             if (emitter.getDefaultOutput() == writer) {
                 return emitter;
             }
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java
index 6d9d6f2..86080d8 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/nativesig/NativeSignatureJavaMethodBindingEmitter.java
@@ -53,31 +53,31 @@ import java.io.PrintWriter;
 /** Review: This Package/Class is not used and subject to be deleted. */
 public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBindingEmitter {
 
-  public NativeSignatureJavaMethodBindingEmitter(GLJavaMethodBindingEmitter methodToWrap) {
+  public NativeSignatureJavaMethodBindingEmitter(final GLJavaMethodBindingEmitter methodToWrap) {
     super(methodToWrap);
   }
 
-  public NativeSignatureJavaMethodBindingEmitter(ProcAddressJavaMethodBindingEmitter methodToWrap, GLEmitter emitter, boolean bufferObjectVariant) {
+  public NativeSignatureJavaMethodBindingEmitter(final ProcAddressJavaMethodBindingEmitter methodToWrap, final GLEmitter emitter, final boolean bufferObjectVariant) {
     super(methodToWrap, emitter, bufferObjectVariant);
   }
 
-  public NativeSignatureJavaMethodBindingEmitter(JavaMethodBindingEmitter methodToWrap, NativeSignatureEmitter emitter) {
+  public NativeSignatureJavaMethodBindingEmitter(final JavaMethodBindingEmitter methodToWrap, final NativeSignatureEmitter emitter) {
     super(methodToWrap, false, null, false, false, emitter);
   }
 
     @Override
-  protected void emitSignature(PrintWriter writer) {
+  protected void emitSignature(final PrintWriter writer) {
     writer.print(getBaseIndentString());
     emitNativeSignatureAnnotation(writer);
     super.emitSignature(writer);
   }
 
-  protected void emitNativeSignatureAnnotation(PrintWriter writer) {
+  protected void emitNativeSignatureAnnotation(final PrintWriter writer) {
     if (hasModifier(JavaMethodBindingEmitter.NATIVE)) {
       // Emit everything as a leaf for now
       // FIXME: make this configurable
       writer.print("@NativeSignature(\"l");
-      MethodBinding binding = getBinding();
+      final MethodBinding binding = getBinding();
       if (callThroughProcAddress) {
         writer.print("p");
       }
@@ -94,7 +94,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
     }
   }
 
-  protected void emitNativeSignatureElement(PrintWriter writer, JavaType type, Type cType, int index) {
+  protected void emitNativeSignatureElement(final PrintWriter writer, final JavaType type, final Type cType, final int index) {
     if (type.isVoid()) {
       if (index > 0) {
         throw new InternalError("Error parsing arguments -- void should not be seen aside from argument 0");
@@ -107,7 +107,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
     } else if (type.isPrimitiveArray()) {
       writer.print("MO");
     } else if (type.isPrimitive()) {
-      Class<?> clazz = type.getJavaClass();
+      final Class<?> clazz = type.getJavaClass();
       if      (clazz == Byte.TYPE)      { writer.print("B"); }
       else if (clazz == Character.TYPE) { writer.print("C"); }
       else if (clazz == Double.TYPE)    { writer.print("D"); }
@@ -132,9 +132,9 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
   }
 
   @Override
-  protected String getReturnTypeString(boolean skipArray) {
+  protected String getReturnTypeString(final boolean skipArray) {
     if (isForImplementingMethodCall()) {
-      JavaType returnType = getBinding().getJavaReturnType();
+      final JavaType returnType = getBinding().getJavaReturnType();
       if (returnType.isString() || returnType.isNIOByteBuffer()) {
         // Treat these as addresses
         return "long";
@@ -144,10 +144,10 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
   }
 
   @Override
-  protected void emitPreCallSetup(MethodBinding binding, PrintWriter writer) {
+  protected void emitPreCallSetup(final MethodBinding binding, final PrintWriter writer) {
     super.emitPreCallSetup(binding, writer);
     for (int i = 0; i < binding.getNumArguments(); i++) {
-      JavaType type = binding.getJavaArgumentType(i);
+      final JavaType type = binding.getJavaArgumentType(i);
       if (type.isNIOBuffer() && !useNIODirectOnly ) {
         // Emit declarations for variables holding primitive arrays as type Object
         // We don't know 100% sure we're going to use these at this point in the code, though
@@ -160,12 +160,12 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
     }
   }
 
-  protected String getNIOBufferArrayName(int argNumber) {
+  protected String getNIOBufferArrayName(final int argNumber) {
     return "__buffer_array_" + argNumber;
   }
 
   @Override
-  protected int emitArguments(PrintWriter writer)
+  protected int emitArguments(final PrintWriter writer)
   {
     boolean needComma = false;
     int numEmitted = 0;
@@ -191,7 +191,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
     }
 
     for (int i = 0; i < binding.getNumArguments(); i++) {
-      JavaType type = binding.getJavaArgumentType(i);
+      final JavaType type = binding.getJavaArgumentType(i);
       if (type.isVoid()) {
         // Make sure this is the only param to the method; if it isn't,
         // there's something wrong with our parsing of the headers.
@@ -246,9 +246,9 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
   }
 
   @Override
-  protected void emitReturnVariableSetupAndCall(MethodBinding binding, PrintWriter writer) {
+  protected void emitReturnVariableSetupAndCall(final MethodBinding binding, final PrintWriter writer) {
     writer.print("    ");
-    JavaType returnType = binding.getJavaReturnType();
+    final JavaType returnType = binding.getJavaReturnType();
     boolean needsResultAssignment = false;
 
     if (!returnType.isVoid()) {
@@ -344,7 +344,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
     }
   }
 
-  protected int emitCallArguments(MethodBinding binding, PrintWriter writer, boolean direct) {
+  protected int emitCallArguments(final MethodBinding binding, final PrintWriter writer, final boolean direct) {
     // Note that we override this completely because we both need to
     // move the potential location of the outgoing proc address as
     // well as change the way we pass out Buffers, arrays, Strings, etc.
@@ -368,7 +368,7 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
       ++numArgsEmitted;
     }
     for (int i = 0; i < binding.getNumArguments(); i++) {
-      JavaType type = binding.getJavaArgumentType(i);
+      final JavaType type = binding.getJavaArgumentType(i);
       if (type.isJNIEnv() || binding.isArgumentThisPointer(i)) {
         // Don't need to expose these at the Java level
         continue;
@@ -460,9 +460,9 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
   }
 
   @Override
-  protected void emitCallResultReturn(MethodBinding binding, PrintWriter writer) {
+  protected void emitCallResultReturn(final MethodBinding binding, final PrintWriter writer) {
     for (int i = 0; i < binding.getNumArguments(); i++) {
-      JavaType type = binding.getJavaArgumentType(i);
+      final JavaType type = binding.getJavaArgumentType(i);
       if (type.isString()) {
         writer.println(";");
         writer.println("    BuffersInternal.freeCString(" + binding.getArgumentName(i) + "_c_str);");
@@ -475,14 +475,14 @@ public class NativeSignatureJavaMethodBindingEmitter extends GLJavaMethodBinding
 
   @Override
   public String getName() {
-    String res = super.getName();
+    final String res = super.getName();
     if (forImplementingMethodCall && bufferObjectVariant) {
       return res + "BufObj";
     }
     return res;
   }
 
-  protected String getImplMethodName(boolean direct) {
+  protected String getImplMethodName(final boolean direct) {
     String name = null;
     if (direct) {
       name = binding.getName() + "$0";
diff --git a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java
index 9b57a2f..d400381 100644
--- a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java
+++ b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLNameResolver.java
@@ -47,44 +47,44 @@ public class GLNameResolver {
     //        if exist as an ARB extension with the same value.
     // Pass-3 Emit
 
-    public static final String[] extensionsARB = { "ARB", "GL2", "OES", "KHR", "OML" };
-    public static final String[] extensionsVEN = { "3DFX",
-                                                   "AMD",
-                                                   "ANGLE",
-                                                   "ARM",
-                                                   "APPLE",
-                                                   "ATI",
-                                                   "EXT",
-                                                   "HI",
-                                                   "HP",
-                                                   "IBM",
-                                                   "IMG",
-                                                   "MESA",
-                                                   "MESAX",
-                                                   "NV",
-                                                   "QCOM",
-                                                   "SGI",
-                                                   "SGIS",
-                                                   "SGIX",
-                                                   "SUN",
-                                                   "VIV",
-                                                   "WIN"
-                                                   };
+    private static final String[] extensionsARB = { "ARB", "GL2", "OES", "KHR", "OML" };
+    private static final String[] extensionsVEN = { "3DFX",
+                                                    "AMD",
+                                                    "ANGLE",
+                                                    "ARM",
+                                                    "APPLE",
+                                                    "ATI",
+                                                    "EXT",
+                                                    "HI",
+                                                    "HP",
+                                                    "IBM",
+                                                    "IMG",
+                                                    "MESA",
+                                                    "MESAX",
+                                                    "NV",
+                                                    "QCOM",
+                                                    "SGI",
+                                                    "SGIS",
+                                                    "SGIX",
+                                                    "SUN",
+                                                    "VIV",
+                                                    "WIN"
+    };
 
 
-    public static final boolean isGLFunction(String str) {
+    public static final boolean isGLFunction(final String str) {
         return str.startsWith("gl")  || /* str.startsWith("glu") || str.startsWith("glX") || */
                str.startsWith("egl") || str.startsWith("wgl") || str.startsWith("agl") ||
                str.startsWith("cgl") ;
     }
 
-    public static final boolean isGLEnumeration(String str) {
+    public static final boolean isGLEnumeration(final String str) {
         return str.startsWith("GL_")  || str.startsWith("GLU_") || str.startsWith("GLX_") ||
                str.startsWith("EGL_") || str.startsWith("WGL_") || str.startsWith("AGL_") ||
                str.startsWith("CGL_") ;
     }
 
-    public static final int getExtensionIdx(String[] extensions, String str, boolean isGLFunc) {
+    public static final int getExtensionIdx(final String[] extensions, final String str, final boolean isGLFunc) {
         if(isGLFunc) {
             for(int i = extensions.length - 1 ; i>=0 ; i--) {
                 if( str.endsWith(extensions[i]) ) {
@@ -101,11 +101,11 @@ public class GLNameResolver {
         return -1;
     }
 
-    public static final boolean isExtension(String[] extensions, String str, boolean isGLFunc) {
+    public static final boolean isExtension(final String[] extensions, final String str, final boolean isGLFunc) {
         return getExtensionIdx(extensions, str, isGLFunc)>=0;
     }
 
-    public static final String getExtensionSuffix(String str, boolean isGLFunc) {
+    public static final String getExtensionSuffix(final String str, final boolean isGLFunc) {
         int idx = getExtensionIdx(extensionsARB, str, isGLFunc);
         if(idx>=0) {
             return extensionsARB[idx];
@@ -117,7 +117,7 @@ public class GLNameResolver {
         return null;
     }
 
-    public static final String normalize(String[] extensions, String str, boolean isGLFunc) {
+    public static final String normalize(final String[] extensions, String str, final boolean isGLFunc) {
         boolean touched = false;
         for(int i = extensions.length - 1 ; !touched && i>=0 ; i--) {
             if(isGLFunc) {
@@ -136,19 +136,19 @@ public class GLNameResolver {
         }
         return str;
     }
-    public static final String normalizeARB(String str, boolean isGLFunc) {
+    public static final String normalizeARB(final String str, final boolean isGLFunc) {
         return normalize(extensionsARB, str, isGLFunc);
     }
-    public static final boolean isExtensionARB(String str, boolean isGLFunc) {
+    public static final boolean isExtensionARB(final String str, final boolean isGLFunc) {
         return isExtension(extensionsARB, str, isGLFunc);
     }
-    public static final String normalizeVEN(String str, boolean isGLFunc) {
+    public static final String normalizeVEN(final String str, final boolean isGLFunc) {
         return normalize(extensionsVEN, str, isGLFunc);
     }
-    public static final boolean isExtensionVEN(String str, boolean isGLFunc) {
+    public static final boolean isExtensionVEN(final String str, final boolean isGLFunc) {
         return isExtension(extensionsVEN, str, isGLFunc);
     }
-    public static final String normalize(String str, boolean isGLFunc) {
+    public static final String normalize(final String str, final boolean isGLFunc) {
         if (isExtensionARB(str, isGLFunc)) {
             return normalizeARB(str, isGLFunc);
         }
@@ -157,12 +157,12 @@ public class GLNameResolver {
         }
         return str;
     }
-    public static final boolean isExtension(String str, boolean isGLFunc) {
+    public static final boolean isExtension(final String str, final boolean isGLFunc) {
         return isExtension(extensionsARB, str, isGLFunc) ||
                isExtension(extensionsVEN, str, isGLFunc);
     }
 
-    public static final int getFuncNamePermutationNumber(String name) {
+    public static final int getFuncNamePermutationNumber(final String name) {
         if(isExtensionARB(name, true) || isExtensionVEN(name, true)) {
             // no name permutation, if it's already a known extension
             return 1;
@@ -170,7 +170,7 @@ public class GLNameResolver {
         return 1 + extensionsARB.length + extensionsVEN.length;
     }
 
-    public static final String getFuncNamePermutation(String name, int i) {
+    public static final String getFuncNamePermutation(final String name, int i) {
         // identity
         if(i==0) {
             return name;
diff --git a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java
index 3fb315c..23d4fc3 100644
--- a/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java
+++ b/src/jogl/classes/com/jogamp/gluegen/runtime/opengl/GLProcAddressResolver.java
@@ -43,16 +43,16 @@ public class GLProcAddressResolver implements FunctionAddressResolver {
     public static final boolean DEBUG = false;
 
     @Override
-    public long resolve(String name, DynamicLookupHelper lookup) {
+    public long resolve(final String name, final DynamicLookupHelper lookup) {
 
         long newProcAddress = 0;
-        int permutations = GLNameResolver.getFuncNamePermutationNumber(name);
+        final int permutations = GLNameResolver.getFuncNamePermutationNumber(name);
 
         for (int i = 0; 0 == newProcAddress && i < permutations; i++) {
-            String funcName = GLNameResolver.getFuncNamePermutation(name, i);
+            final String funcName = GLNameResolver.getFuncNamePermutation(name, i);
             try {
                 newProcAddress = lookup.dynamicLookupFunction(funcName);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 if (DEBUG) {
                     e.printStackTrace();
                 }
diff --git a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
index 226e57f..e7c452f 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/OutlineShape.java
@@ -29,18 +29,23 @@ package com.jogamp.graph.curve;
 
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.Comparator;
+
+import jogamp.graph.geom.plane.AffineTransform;
 
 import com.jogamp.graph.curve.tess.Triangulation;
 import com.jogamp.graph.curve.tess.Triangulator;
 import com.jogamp.graph.geom.Outline;
 import com.jogamp.graph.geom.Triangle;
 import com.jogamp.graph.geom.Vertex;
+import com.jogamp.opengl.math.FloatUtil;
 import com.jogamp.opengl.math.VectorUtil;
 import com.jogamp.opengl.math.geom.AABBox;
 
 
-/** A Generic shape objects which is defined by a list of Outlines.
- * This Shape can be transformed to Triangulations.
+/**
+ * A Generic shape objects which is defined by a list of Outlines.
+ * This Shape can be transformed to triangulations.
  * The list of triangles generated are render-able by a Region object.
  * The triangulation produced by this Shape will define the
  * closed region defined by the outlines.
@@ -101,34 +106,80 @@ public class OutlineShape implements Comparable<OutlineShape> {
 
         public final int state;
 
-        VerticesState(int state){
+        VerticesState(final int state){
             this.state = state;
         }
     }
 
+    /** Initial {@link #getSharpness()} value, which can be modified via {@link #setSharpness(float)}. */
+    public static final float DEFAULT_SHARPNESS = 0.5f;
+
     public static final int DIRTY_BOUNDS = 1 << 0;
+    /**
+     * Modified shape, requires to update the vertices and triangles, here: vertices.
+     */
+    public static final int DIRTY_VERTICES  = 1 << 1;
+    /**
+     * Modified shape, requires to update the vertices and triangles, here: triangulation.
+     */
+    public static final int DIRTY_TRIANGLES  = 1 << 2;
 
     private final Vertex.Factory<? extends Vertex> vertexFactory;
-    private VerticesState outlineState;
 
     /** The list of {@link Outline}s that are part of this
      *  outline shape.
      */
-    private ArrayList<Outline> outlines;
-    private AABBox bbox;
+    /* pp */ final ArrayList<Outline> outlines;
+
+    private final AABBox bbox;
+    private final ArrayList<Triangle> triangles;
+    private final ArrayList<Vertex> vertices;
+    private int addedVerticeCount;
+
+    private VerticesState outlineState;
 
     /** dirty bits DIRTY_BOUNDS */
     private int dirtyBits;
 
+    private float sharpness;
+
+    private final float[] tmpV1 = new float[3];
+    private final float[] tmpV2 = new float[3];
+    private final float[] tmpV3 = new float[3];
+
     /** Create a new Outline based Shape
      */
-    public OutlineShape(Vertex.Factory<? extends Vertex> factory) {
+    public OutlineShape(final Vertex.Factory<? extends Vertex> factory) {
         this.vertexFactory = factory;
         this.outlines = new ArrayList<Outline>(3);
         this.outlines.add(new Outline());
         this.outlineState = VerticesState.UNDEFINED;
         this.bbox = new AABBox();
+        this.triangles = new ArrayList<Triangle>();
+        this.vertices = new ArrayList<Vertex>();
+        this.addedVerticeCount = 0;
         this.dirtyBits = 0;
+        this.sharpness = DEFAULT_SHARPNESS;
+    }
+
+    /**
+     * Return the number of newly added vertices during {@link #getTriangles(VerticesState)}
+     * while transforming the outlines to {@link VerticesState#QUADRATIC_NURBS} and triangulation.
+     * @see #setIsQuadraticNurbs()
+     */
+    public int getAddedVerticeCount() {
+        return addedVerticeCount;
+    }
+
+    /** Sharpness value, defaults to {@link #DEFAULT_SHARPNESS}. */
+    public float getSharpness() { return sharpness; }
+
+    /** Sets sharpness, defaults to {@link #DEFAULT_SHARPNESS}. */
+    public void setSharpness(final float s) {
+        if( this.sharpness != s ) {
+            clearCache();
+            sharpness=s;
+        }
     }
 
     /** Clears all data and reset all states as if this instance was newly created */
@@ -137,32 +188,45 @@ public class OutlineShape implements Comparable<OutlineShape> {
         outlines.add(new Outline());
         outlineState = VerticesState.UNDEFINED;
         bbox.reset();
+        vertices.clear();
+        triangles.clear();
+        addedVerticeCount = 0;
         dirtyBits = 0;
     }
 
-    /** Returns the associated vertex factory of this outline shape
+    /** Clears cached triangulated data, i.e. {@link #getTriangles(VerticesState)} and {@link #getVertices()}.  */
+    public void clearCache() {
+        vertices.clear();
+        triangles.clear();
+        dirtyBits |= DIRTY_TRIANGLES | DIRTY_VERTICES;
+    }
+
+    /**
+     * Returns the associated vertex factory of this outline shape
      * @return Vertex.Factory object
      */
     public final Vertex.Factory<? extends Vertex> vertexFactory() { return vertexFactory; }
 
-    public int getOutlineNumber() {
+    public final int getOutlineNumber() {
         return outlines.size();
     }
 
-    /** Add a new empty {@link Outline}
+    /**
+     * Add a new empty {@link Outline}
      * to the end of this shape's outline list.
      * <p>If the {@link #getLastOutline()} is empty already, no new one will be added.</p>
      *
      * After a call to this function all new vertices added
      * will belong to the new outline
      */
-    public void addEmptyOutline() {
+    public final void addEmptyOutline() {
         if( !getLastOutline().isEmpty() ) {
             outlines.add(new Outline());
         }
     }
 
-    /** Appends the {@link Outline} element to the end,
+    /**
+     * Appends the {@link Outline} element to the end,
      * ensuring a clean tail.
      *
      * <p>A clean tail is ensured, no double empty Outlines are produced
@@ -171,11 +235,12 @@ public class OutlineShape implements Comparable<OutlineShape> {
      * @param outline Outline object to be added
      * @throws NullPointerException if the  {@link Outline} element is null
      */
-    public void addOutline(Outline outline) throws NullPointerException {
+    public final void addOutline(final Outline outline) throws NullPointerException {
         addOutline(outlines.size(), outline);
     }
 
-    /** Insert the {@link Outline} element at the given {@code position}.
+    /**
+     * Insert the {@link Outline} element at the given {@code position}.
      *
      * <p>If the {@code position} indicates the end of this list,
      * a clean tail is ensured, no double empty Outlines are produced
@@ -186,7 +251,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
      * @throws NullPointerException if the  {@link Outline} element is null
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position > getOutlineNumber())
      */
-    public void addOutline(int position, Outline outline) throws NullPointerException, IndexOutOfBoundsException {
+    public final void addOutline(final int position, final Outline outline) throws NullPointerException, IndexOutOfBoundsException {
         if (null == outline) {
             throw new NullPointerException("outline is null");
         }
@@ -200,6 +265,8 @@ public class OutlineShape implements Comparable<OutlineShape> {
                 if( 0 == ( dirtyBits & DIRTY_BOUNDS ) ) {
                     bbox.resize(outline.getBounds());
                 }
+                // vertices.addAll(outline.getVertices()); // FIXME: can do and remove DIRTY_VERTICES ?
+                dirtyBits |= DIRTY_TRIANGLES | DIRTY_VERTICES;
                 return;
             }
         }
@@ -207,26 +274,29 @@ public class OutlineShape implements Comparable<OutlineShape> {
         if( 0 == ( dirtyBits & DIRTY_BOUNDS ) ) {
             bbox.resize(outline.getBounds());
         }
+        dirtyBits |= DIRTY_TRIANGLES | DIRTY_VERTICES;
     }
 
-    /** Insert the {@link OutlineShape} elements of type {@link Outline}, .. at the end of this shape,
+    /**
+     * Insert the {@link OutlineShape} elements of type {@link Outline}, .. at the end of this shape,
      * using {@link #addOutline(Outline)} for each element.
-     * <p>Closes the current last outline via {@link #closeLastOutline()} before adding the new ones.</p>
+     * <p>Closes the current last outline via {@link #closeLastOutline(boolean)} before adding the new ones.</p>
      * @param outlineShape OutlineShape elements to be added.
      * @throws NullPointerException if the  {@link OutlineShape} is null
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position > getOutlineNumber())
      */
-    public void addOutlineShape(OutlineShape outlineShape) throws NullPointerException {
+    public final void addOutlineShape(final OutlineShape outlineShape) throws NullPointerException {
         if (null == outlineShape) {
             throw new NullPointerException("OutlineShape is null");
         }
-        closeLastOutline();
+        closeLastOutline(true);
         for(int i=0; i<outlineShape.getOutlineNumber(); i++) {
             addOutline(outlineShape.getOutline(i));
         }
     }
 
-    /** Replaces the {@link Outline} element at the given {@code position}.
+    /**
+     * Replaces the {@link Outline} element at the given {@code position}.
      * <p>Sets the bounding box dirty, hence a next call to {@link #getBounds()} will validate it.</p>
      *
      * @param position of the replaced Outline
@@ -234,26 +304,28 @@ public class OutlineShape implements Comparable<OutlineShape> {
      * @throws NullPointerException if the  {@link Outline} element is null
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getOutlineNumber())
      */
-    public void setOutline(int position, Outline outline) throws NullPointerException, IndexOutOfBoundsException {
+    public final void setOutline(final int position, final Outline outline) throws NullPointerException, IndexOutOfBoundsException {
         if (null == outline) {
             throw new NullPointerException("outline is null");
         }
         outlines.set(position, outline);
-        dirtyBits |= DIRTY_BOUNDS;
+        dirtyBits |= DIRTY_BOUNDS | DIRTY_TRIANGLES | DIRTY_VERTICES;
     }
 
-    /** Removes the {@link Outline} element at the given {@code position}.
+    /**
+     * Removes the {@link Outline} element at the given {@code position}.
      * <p>Sets the bounding box dirty, hence a next call to {@link #getBounds()} will validate it.</p>
      *
      * @param position of the to be removed Outline
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getOutlineNumber())
      */
-    public final Outline removeOutline(int position) throws IndexOutOfBoundsException {
-        dirtyBits |= DIRTY_BOUNDS;
+    public final Outline removeOutline(final int position) throws IndexOutOfBoundsException {
+        dirtyBits |= DIRTY_BOUNDS | DIRTY_TRIANGLES | DIRTY_VERTICES;
         return outlines.remove(position);
     }
 
-    /** Get the last added outline to the list
+    /**
+     * Get the last added outline to the list
      * of outlines that define the shape
      * @return the last outline
      */
@@ -261,39 +333,44 @@ public class OutlineShape implements Comparable<OutlineShape> {
         return outlines.get(outlines.size()-1);
     }
 
-    /** @return the {@code Outline} at {@code position}
+    /**
+     * Returns the {@code Outline} at {@code position}
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getOutlineNumber())
      */
-    public Outline getOutline(int position) throws IndexOutOfBoundsException {
+    public final Outline getOutline(final int position) throws IndexOutOfBoundsException {
         return outlines.get(position);
     }
 
-    /** Adds a vertex to the last open outline in the
-     *  shape.
+    /**
+     * Adds a vertex to the last open outline to the shape's tail.
      * @param v the vertex to be added to the OutlineShape
      */
-    public final void addVertex(Vertex v) {
+    public final void addVertex(final Vertex v) {
         final Outline lo = getLastOutline();
         lo.addVertex(v);
         if( 0 == ( dirtyBits & DIRTY_BOUNDS ) ) {
-            bbox.resize(lo.getBounds());
+            bbox.resize(v.getCoord());
         }
+        // vertices.add(v); // FIXME: can do and remove DIRTY_VERTICES ?
+        dirtyBits |= DIRTY_TRIANGLES | DIRTY_VERTICES;
     }
 
-    /** Adds a vertex to the last open outline in the shape.
-     * at {@code position}
+    /**
+     * Adds a vertex to the last open outline to the shape at {@code position}
      * @param position indx at which the vertex will be added
      * @param v the vertex to be added to the OutlineShape
      */
-    public final void addVertex(int position, Vertex v) {
+    public final void addVertex(final int position, final Vertex v) {
         final Outline lo = getLastOutline();
         lo.addVertex(position, v);
         if( 0 == ( dirtyBits & DIRTY_BOUNDS ) ) {
-            bbox.resize(lo.getBounds());
+            bbox.resize(v.getCoord());
         }
+        dirtyBits |= DIRTY_TRIANGLES | DIRTY_VERTICES;
     }
 
-    /** Add a 2D {@link Vertex} to the last outline by defining the coordniate attribute
+    /**
+     * Add a 2D {@link Vertex} to the last outline by defining the coordinate attribute
      * of the vertex. The 2D vertex will be represented as Z=0.
      *
      * @param x the x coordinate
@@ -301,11 +378,12 @@ public class OutlineShape implements Comparable<OutlineShape> {
      * @param onCurve flag if this vertex is on the final curve or defines a curved region
      * of the shape around this vertex.
      */
-    public final void addVertex(float x, float y, boolean onCurve) {
+    public final void addVertex(final float x, final float y, final boolean onCurve) {
         addVertex(vertexFactory.create(x, y, 0f, onCurve));
     }
 
-    /** Add a 3D {@link Vertex} to the last outline by defining the coordniate attribute
+    /**
+     * Add a 3D {@link Vertex} to the last outline by defining the coordniate attribute
      * of the vertex.
      * @param x the x coordinate
      * @param y the y coordinate
@@ -313,11 +391,12 @@ public class OutlineShape implements Comparable<OutlineShape> {
      * @param onCurve flag if this vertex is on the final curve or defines a curved region
      * of the shape around this vertex.
      */
-    public final void addVertex(float x, float y, float z, boolean onCurve) {
+    public final void addVertex(final float x, final float y, final float z, final boolean onCurve) {
         addVertex(vertexFactory.create(x, y, z, onCurve));
     }
 
-    /** Add a vertex to the last outline by passing a float array and specifying the
+    /**
+     * Add a vertex to the last outline by passing a float array and specifying the
      * offset and length in which. The attributes of the vertex are located.
      * The attributes should be continuous (stride = 0).
      * Attributes which value are not set (when length less than 3)
@@ -328,67 +407,69 @@ public class OutlineShape implements Comparable<OutlineShape> {
      * @param onCurve flag if this vertex is on the final curve or defines a curved region
      * of the shape around this vertex.
      */
-    public final void addVertex(float[] coordsBuffer, int offset, int length, boolean onCurve) {
+    public final void addVertex(final float[] coordsBuffer, final int offset, final int length, final boolean onCurve) {
         addVertex(vertexFactory.create(coordsBuffer, offset, length, onCurve));
     }
 
-    /** Closes the last outline in the shape.
-     * <p>If last vertex is not equal to first vertex.
-     * A new temp vertex is added at the end which
-     * is equal to the first.</p>
+    /**
+     * Closes the last outline in the shape.
+     * <p>
+     * Checks whether the last vertex equals to the first of the last outline.
+     * If not equal, it either appends a clone of the first vertex
+     * or prepends a clone of the last vertex, depending on <code>closeTail</code>.
+     * </p>
+     * @param closeTail if true, a clone of the first vertex will be appended,
+     *                  otherwise a clone of the last vertex will be prepended.
      */
-    public void closeLastOutline() {
-        getLastOutline().setClosed(true);
+    public final void closeLastOutline(final boolean closeTail) {
+        if( getLastOutline().setClosed(true) ) {
+            dirtyBits |= DIRTY_TRIANGLES | DIRTY_VERTICES;
+        }
     }
 
     /**
-     * @return the outline's vertices state, {@link OutlineShape.VerticesState}
+     * Return the outline's vertices state, {@link OutlineShape.VerticesState}
      */
     public final VerticesState getOutlineState() {
         return outlineState;
     }
 
-    /** Ensure the outlines represent
-     * the specified destinationType.
-     * and removes all overlaps in boundary triangles
-     * @param destinationType the target outline's vertices state. Currently only
-     * {@link OutlineShape.VerticesState#QUADRATIC_NURBS} are supported.
+    /**
+     * Claim this outline's vertices are all {@link OutlineShape.VerticesState#QUADRATIC_NURBS},
+     * hence no cubic transformations will be performed.
      */
-    public void transformOutlines(VerticesState destinationType) {
-        if(outlineState != destinationType){
-            if(destinationType == VerticesState.QUADRATIC_NURBS){
-                transformOutlines2Quadratic();
-                checkOverlaps();
-            } else {
-                throw new IllegalStateException("destinationType "+destinationType.name()+" not supported (currently "+outlineState.name()+")");
-            }
-        }
+    public final void setIsQuadraticNurbs() {
+        outlineState = VerticesState.QUADRATIC_NURBS;
+        // checkPossibleOverlaps = false;
     }
 
-    private void subdivideTriangle(final Outline outline, Vertex a, Vertex b, Vertex c, int index){
-        float[] v1 = VectorUtil.mid(a.getCoord(), b.getCoord());
-        float[] v3 = VectorUtil.mid(b.getCoord(), c.getCoord());
-        float[] v2 = VectorUtil.mid(v1, v3);
+    private void subdivideTriangle(final Outline outline, final Vertex a, final Vertex b, final Vertex c, final int index){
+        VectorUtil.midVec3(tmpV1, a.getCoord(), b.getCoord());
+        VectorUtil.midVec3(tmpV3, b.getCoord(), c.getCoord());
+        VectorUtil.midVec3(tmpV2, tmpV1, tmpV3);
 
         //drop off-curve vertex to image on the curve
-        b.setCoord(v2, 0, 3);
+        b.setCoord(tmpV2, 0, 3);
         b.setOnCurve(true);
 
-        outline.addVertex(index, vertexFactory.create(v1, 0, 3, false));
-        outline.addVertex(index+2, vertexFactory.create(v3, 0, 3, false));
+        outline.addVertex(index, vertexFactory.create(tmpV1, 0, 3, false));
+        outline.addVertex(index+2, vertexFactory.create(tmpV3, 0, 3, false));
+
+        addedVerticeCount += 2;
     }
 
-    /** Check overlaps between curved triangles
-     *  first check if any vertex in triangle a is in triangle b
-     *  second check if edges of triangle a intersect segments of triangle b
-     *  if any of the two tests is true we divide current triangle
-     *  and add the other to the list of overlaps
+    /**
+     * Check overlaps between curved triangles
+     * first check if any vertex in triangle a is in triangle b
+     * second check if edges of triangle a intersect segments of triangle b
+     * if any of the two tests is true we divide current triangle
+     * and add the other to the list of overlaps
      *
-     *  Loop until overlap array is empty. (check only in first pass)
+     * Loop until overlap array is empty. (check only in first pass)
      */
     private void checkOverlaps() {
-        ArrayList<Vertex> overlaps = new ArrayList<Vertex>(3);
-        int count = getOutlineNumber();
+        final ArrayList<Vertex> overlaps = new ArrayList<Vertex>(3);
+        final int count = getOutlineNumber();
         boolean firstpass = true;
         do {
             for (int cc = 0; cc < count; cc++) {
@@ -399,39 +480,43 @@ public class OutlineShape implements Comparable<OutlineShape> {
                     if ( !currentVertex.isOnCurve()) {
                         final Vertex nextV = outline.getVertex((i+1)%vertexCount);
                         final Vertex prevV = outline.getVertex((i+vertexCount-1)%vertexCount);
-                        Vertex overlap =null;
-
-                        //check for overlap even if already set for subdivision
-                        //ensuring both trianglur overlaps get divided
-                        //for pref. only check in first pass
-                        //second pass to clear the overlaps arrray(reduces precision errors)
-                        if(firstpass) {
-                            overlap = checkTriOverlaps(prevV, currentVertex, nextV);
+                        final Vertex overlap;
+
+                        // check for overlap even if already set for subdivision
+                        // ensuring both triangular overlaps get divided
+                        // for pref. only check in first pass
+                        // second pass to clear the overlaps array(reduces precision errors)
+                        if( firstpass ) {
+                            overlap = checkTriOverlaps0(prevV, currentVertex, nextV);
+                        } else {
+                            overlap = null;
                         }
-                        if(overlaps.contains(currentVertex) || overlap != null) {
+                        if( overlaps.contains(currentVertex) || overlap != null ) {
                             overlaps.remove(currentVertex);
 
                             subdivideTriangle(outline, prevV, currentVertex, nextV, i);
                             i+=3;
                             vertexCount+=2;
+                            addedVerticeCount+=2;
 
                             if(overlap != null && !overlap.isOnCurve()) {
-                                if(!overlaps.contains(overlap))
+                                if(!overlaps.contains(overlap)) {
                                     overlaps.add(overlap);
+                                }
                             }
                         }
                     }
                 }
             }
             firstpass = false;
-        }while(!overlaps.isEmpty());
+        } while( !overlaps.isEmpty() );
     }
 
-    private Vertex checkTriOverlaps(Vertex a, Vertex b, Vertex c) {
-        int count = getOutlineNumber();
+    private Vertex checkTriOverlaps0(final Vertex a, final Vertex b, final Vertex c) {
+        final int count = getOutlineNumber();
         for (int cc = 0; cc < count; cc++) {
             final Outline outline = getOutline(cc);
-            int vertexCount = outline.getVertexCount();
+            final int vertexCount = outline.getVertexCount();
             for(int i=0; i < vertexCount; i++) {
                 final Vertex current = outline.getVertex(i);
                 if(current.isOnCurve() || current == a || current == b || current == c) {
@@ -445,15 +530,47 @@ public class OutlineShape implements Comparable<OutlineShape> {
                     continue;
                 }
 
-                if(VectorUtil.vertexInTriangle(a.getCoord(), b.getCoord(), c.getCoord(), current.getCoord())
-                        || VectorUtil.vertexInTriangle(a.getCoord(), b.getCoord(), c.getCoord(), nextV.getCoord())
-                        || VectorUtil.vertexInTriangle(a.getCoord(), b.getCoord(), c.getCoord(), prevV.getCoord())) {
+                if( VectorUtil.isVec3InTriangle3(a.getCoord(), b.getCoord(), c.getCoord(),
+                                                 current.getCoord(), nextV.getCoord(), prevV.getCoord(),
+                                                 tmpV1, tmpV2, tmpV3) ) {
+                    return current;
+                }
+                if(VectorUtil.testTri2SegIntersection(a, b, c, prevV, current) ||
+                   VectorUtil.testTri2SegIntersection(a, b, c, current, nextV) ||
+                   VectorUtil.testTri2SegIntersection(a, b, c, prevV, nextV) ) {
+                    return current;
+                }
+            }
+        }
+        return null;
+    }
+    @SuppressWarnings("unused")
+    private Vertex checkTriOverlaps1(final Vertex a, final Vertex b, final Vertex c) {
+        final int count = getOutlineNumber();
+        for (int cc = 0; cc < count; cc++) {
+            final Outline outline = getOutline(cc);
+            final int vertexCount = outline.getVertexCount();
+            for(int i=0; i < vertexCount; i++) {
+                final Vertex current = outline.getVertex(i);
+                if(current.isOnCurve() || current == a || current == b || current == c) {
+                    continue;
+                }
+                final Vertex nextV = outline.getVertex((i+1)%vertexCount);
+                final Vertex prevV = outline.getVertex((i+vertexCount-1)%vertexCount);
+
+                //skip neighboring triangles
+                if(prevV == c || nextV == a) {
+                    continue;
+                }
 
+                if( VectorUtil.isVec3InTriangle3(a.getCoord(), b.getCoord(), c.getCoord(),
+                                                 current.getCoord(), nextV.getCoord(), prevV.getCoord(),
+                                                 tmpV1, tmpV2, tmpV3, FloatUtil.EPSILON) ) {
                     return current;
                 }
-                if(VectorUtil.tri2SegIntersection(a, b, c, prevV, current)
-                        || VectorUtil.tri2SegIntersection(a, b, c, current, nextV)
-                        || VectorUtil.tri2SegIntersection(a, b, c, prevV, nextV)) {
+                if(VectorUtil.testTri2SegIntersection(a, b, c, prevV, current, FloatUtil.EPSILON) ||
+                   VectorUtil.testTri2SegIntersection(a, b, c, current, nextV, FloatUtil.EPSILON) ||
+                   VectorUtil.testTri2SegIntersection(a, b, c, prevV, nextV, FloatUtil.EPSILON) ) {
                     return current;
                 }
             }
@@ -461,113 +578,175 @@ public class OutlineShape implements Comparable<OutlineShape> {
         return null;
     }
 
-    private void transformOutlines2Quadratic() {
+    private void cleanupOutlines() {
+        final boolean transformOutlines2Quadratic = VerticesState.QUADRATIC_NURBS != outlineState;
         int count = getOutlineNumber();
         for (int cc = 0; cc < count; cc++) {
             final Outline outline = getOutline(cc);
             int vertexCount = outline.getVertexCount();
 
-            for(int i=0; i < vertexCount; i++) {
-                final Vertex currentVertex = outline.getVertex(i);
-                final Vertex nextVertex = outline.getVertex((i+1)%vertexCount);
-                if ( !currentVertex.isOnCurve() && !nextVertex.isOnCurve() ) {
-                    final float[] newCoords = VectorUtil.mid(currentVertex.getCoord(),
-                            nextVertex.getCoord());
-                    final Vertex v = vertexFactory.create(newCoords, 0, 3, true);
-                    i++;
-                    vertexCount++;
-                    outline.addVertex(i, v);
+            if( transformOutlines2Quadratic ) {
+                for(int i=0; i < vertexCount; i++) {
+                    final Vertex currentVertex = outline.getVertex(i);
+                    final int j = (i+1)%vertexCount;
+                    final Vertex nextVertex = outline.getVertex(j);
+                    if ( !currentVertex.isOnCurve() && !nextVertex.isOnCurve() ) {
+                        VectorUtil.midVec3(tmpV1, currentVertex.getCoord(), nextVertex.getCoord());
+                        System.err.println("XXX: Cubic: "+i+": "+currentVertex+", "+j+": "+nextVertex);
+                        final Vertex v = vertexFactory.create(tmpV1, 0, 3, true);
+                        i++;
+                        vertexCount++;
+                        addedVerticeCount++;
+                        outline.addVertex(i, v);
+                    }
                 }
             }
-            if(vertexCount <= 0) {
+            if( 0 >= vertexCount ) {
                 outlines.remove(outline);
                 cc--;
                 count--;
-                continue;
-            }
-
-            if( vertexCount > 0 ) {
-                if(VectorUtil.checkEquality(outline.getVertex(0).getCoord(),
-                        outline.getLastVertex().getCoord())) {
-                    outline.removeVertex(vertexCount-1);
-                }
+            } else  if( 0 < vertexCount &&
+                        VectorUtil.isVec3Equal( outline.getVertex(0).getCoord(), 0, outline.getLastVertex().getCoord(), 0, FloatUtil.EPSILON )) {
+                outline.removeVertex(vertexCount-1);
             }
         }
         outlineState = VerticesState.QUADRATIC_NURBS;
+        checkOverlaps();
     }
 
-    private void generateVertexIds() {
+    private int generateVertexIds() {
         int maxVertexId = 0;
         for(int i=0; i<outlines.size(); i++) {
             final ArrayList<Vertex> vertices = outlines.get(i).getVertices();
             for(int pos=0; pos<vertices.size(); pos++) {
-                Vertex vert = vertices.get(pos);
-                vert.setId(maxVertexId);
-                maxVertexId++;
+                vertices.get(pos).setId(maxVertexId++);
             }
         }
+        return maxVertexId;
     }
 
-    /** @return the list of concatenated vertices associated with all
-     * {@code Outline}s of this object
+    /**
+     * Return list of concatenated vertices associated with all
+     * {@code Outline}s of this object.
+     * <p>
+     * Vertices are cached until marked dirty.
+     * </p>
+     * <p>
+     * Should always be called <i>after</i> {@link #getTriangles(VerticesState)},
+     * since the latter will mark all cached vertices dirty!
+     * </p>
      */
-    public ArrayList<Vertex> getVertices() {
-        ArrayList<Vertex> vertices = new ArrayList<Vertex>();
-        for(int i=0; i<outlines.size(); i++) {
-            vertices.addAll(outlines.get(i).getVertices());
+    public final ArrayList<Vertex> getVertices() {
+        final boolean updated;
+        if( 0 != ( DIRTY_VERTICES & dirtyBits ) ) {
+            vertices.clear();
+            for(int i=0; i<outlines.size(); i++) {
+                vertices.addAll(outlines.get(i).getVertices());
+            }
+            dirtyBits &= ~DIRTY_VERTICES;
+            updated = true;
+        } else {
+            updated = false;
+        }
+        if(Region.DEBUG_INSTANCE) {
+            System.err.println("OutlineShape.getVertices(): o "+outlines.size()+", v "+vertices.size()+", updated "+updated);
         }
         return vertices;
     }
 
+    private void triangulateImpl() {
+        if( 0 < outlines.size() ) {
+            sortOutlines();
+            generateVertexIds();
+
+            triangles.clear();
+            final Triangulator triangulator2d = Triangulation.create();
+            for(int index = 0; index<outlines.size(); index++) {
+                triangulator2d.addCurve(triangles, outlines.get(index), sharpness);
+            }
+            triangulator2d.generate(triangles);
+            addedVerticeCount += triangulator2d.getAddedVerticeCount();
+            triangulator2d.reset();
+        }
+    }
+
     /**
-     * Triangulate the {@link OutlineShape} generating a list of triangles
+     * Triangulate the {@link OutlineShape} generating a list of triangles,
+     * while {@link #transformOutlines(VerticesState)} beforehand.
+     * <p>
+     * Triangles are cached until marked dirty.
+     * </p>
      * @return an arraylist of triangles representing the filled region
      * which is produced by the combination of the outlines
      */
-    public ArrayList<Triangle> triangulate() {
-        if(outlines.size() == 0){
-            return null;
+    public ArrayList<Triangle> getTriangles(final VerticesState destinationType) {
+        final boolean updated;
+        if(destinationType != VerticesState.QUADRATIC_NURBS) {
+            throw new IllegalStateException("destinationType "+destinationType.name()+" not supported (currently "+outlineState.name()+")");
         }
-        sortOutlines();
-        generateVertexIds();
-
-        Triangulator triangulator2d = Triangulation.create();
-        for(int index = 0; index<outlines.size(); index++) {
-            triangulator2d.addCurve(outlines.get(index));
+        if( 0 != ( DIRTY_TRIANGLES & dirtyBits ) ) {
+            cleanupOutlines();
+            triangulateImpl();
+            updated = true;
+            dirtyBits |= DIRTY_VERTICES;
+            dirtyBits &= ~DIRTY_TRIANGLES;
+        } else {
+            updated = false;
+        }
+        if(Region.DEBUG_INSTANCE) {
+            System.err.println("OutlineShape.getTriangles().X: "+triangles.size()+", updated "+updated);
         }
-
-        ArrayList<Triangle> triangles = triangulator2d.generate();
-        triangulator2d.reset();
-
         return triangles;
     }
 
-    /** Sort the outlines from large
-     *  to small depending on the AABox
+    /**
+     * Return a transformed instance with all {@link Outline}s are copied and transformed.
+     * <p>
+     * Note: Triangulated data is lost in returned instance!
+     * </p>
+     */
+    public final OutlineShape transform(final AffineTransform t) {
+        final OutlineShape newOutlineShape = new OutlineShape(vertexFactory);
+        final int osize = outlines.size();
+        for(int i=0; i<osize; i++) {
+            newOutlineShape.addOutline( outlines.get(i).transform(t, vertexFactory) );
+        }
+        return newOutlineShape;
+    }
+
+    /**
+     * Sort the outlines from large
+     * to small depending on the AABox
      */
     private void sortOutlines() {
-        Collections.sort(outlines);
-        Collections.reverse(outlines);
+        Collections.sort(outlines, reversSizeComparator);
     }
 
-    /** Compare two outline shapes with Bounding Box area
-     * as criteria.
+    private static Comparator<Outline> reversSizeComparator = new Comparator<Outline>() {
+        @Override
+        public int compare(final Outline o1, final Outline o2) {
+            return o2.compareTo(o1); // reverse !
+        } };
+
+    /**
+     * Compare two outline shape's Bounding Box size.
+     * @see AABBox#getSize()
      * @see java.lang.Comparable#compareTo(java.lang.Object)
      */
     @Override
-    public final int compareTo(OutlineShape outline) {
-        float size = getBounds().getSize();
-        float newSize = outline.getBounds().getSize();
-        if(size < newSize){
+    public final int compareTo(final OutlineShape other) {
+        final float thisSize = getBounds().getSize();
+        final float otherSize = other.getBounds().getSize();
+        if( FloatUtil.isEqual(thisSize, otherSize, FloatUtil.EPSILON) ) {
+            return 0;
+        } else if( thisSize < otherSize ){
             return -1;
-        }
-        else if(size > newSize){
+        } else {
             return 1;
         }
-        return 0;
     }
 
-    private final void validateBoundingBox() {
+    private void validateBoundingBox() {
         dirtyBits &= ~DIRTY_BOUNDS;
         bbox.reset();
         for (int i=0; i<outlines.size(); i++) {
@@ -588,7 +767,7 @@ public class OutlineShape implements Comparable<OutlineShape> {
      *                 same outlineState, equal bounds and equal outlines in the same order
      */
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if( obj == this) {
             return true;
         }
@@ -612,4 +791,9 @@ public class OutlineShape implements Comparable<OutlineShape> {
         }
         return true;
     }
+
+    @Override
+    public final int hashCode() {
+        throw new InternalError("hashCode not designed");
+    }
 }
diff --git a/src/jogl/classes/com/jogamp/graph/curve/OutlineShapeXForm.java b/src/jogl/classes/com/jogamp/graph/curve/OutlineShapeXForm.java
new file mode 100644
index 0000000..cf4d384
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/graph/curve/OutlineShapeXForm.java
@@ -0,0 +1,16 @@
+package com.jogamp.graph.curve;
+
+import jogamp.graph.geom.plane.AffineTransform;
+
+public class OutlineShapeXForm {
+    public final OutlineShape shape;
+    private AffineTransform t;
+
+    public OutlineShapeXForm(final OutlineShape shape, final AffineTransform t) {
+        this.shape = shape;
+        this.t = t;
+    }
+
+    public final AffineTransform getTransform() { return t; }
+    public final void setTransform(final AffineTransform t) { this.t = t; }
+}
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/graph/curve/Region.java b/src/jogl/classes/com/jogamp/graph/curve/Region.java
index a977952..350e3ef 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/Region.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/Region.java
@@ -28,164 +28,383 @@
 package com.jogamp.graph.curve;
 
 import java.util.ArrayList;
+import java.util.List;
 
+import jogamp.graph.geom.plane.AffineTransform;
 import jogamp.opengl.Debug;
 
 import com.jogamp.graph.geom.Triangle;
 import com.jogamp.graph.geom.Vertex;
 import com.jogamp.opengl.math.geom.AABBox;
+import com.jogamp.opengl.math.geom.Frustum;
+import com.jogamp.opengl.util.texture.TextureSequence;
 
-/** Abstract Outline shape GL representation
- *  define the method an OutlineShape(s) is
- *  binded rendered.
+/**
+ * Abstract Outline shape representation define the method an OutlineShape(s)
+ * is bound and rendered.
  *
- *  @see GLRegion
+ * @see com.jogamp.graph.curve.opengl.GLRegion
  */
 public abstract class Region {
 
-    /** Debug flag for region impl (graph.curve)
-     */
+    /** Debug flag for region impl (graph.curve) */
     public static final boolean DEBUG = Debug.debug("graph.curve");
+    public static final boolean DEBUG_INSTANCE = Debug.debug("graph.curve.Instance");
+
+    /**
+     * Rendering-Mode bit for {@link #getRenderModes() Region}
+     * <p>
+     * MSAA based Anti-Aliasing, a two pass region rendering, slower and more
+     * resource hungry (FBO), but providing fast MSAA in case
+     * the whole scene is not rendered with MSAA.
+     * </p>
+     */
+    public static final int MSAA_RENDERING_BIT        = 1 <<  0;
+
+    /**
+     * Rendering-Mode bit for {@link #getRenderModes() Region}
+     * <p>
+     * View based Anti-Aliasing, a two pass region rendering, slower and more
+     * resource hungry (FBO), but AA is perfect. Otherwise the default fast one
+     * pass MSAA region rendering is being used.
+     * </p>
+     */
+    public static final int VBAA_RENDERING_BIT        = 1 <<  1;
 
-    public static final boolean DEBUG_INSTANCE = false;
+    /**
+     * Rendering-Mode bit for {@link #getRenderModes() Region}
+     * <p>
+     * Use non uniform weights [0.0 .. 1.9] for curve region rendering.
+     * Otherwise the default weight 1.0 for uniform curve region rendering is
+     * being applied.
+     * </p>
+     */
+    public static final int VARWEIGHT_RENDERING_BIT    = 1 <<  8;
 
-    /** View based Anti-Aliasing, A Two pass region rendering, slower
-     *  and more resource hungry (FBO), but AA is perfect.
-     *  Otherwise the default fast one pass MSAA region rendering is being used.
+    /**
+     * Rendering-Mode bit for {@link #getRenderModes() Region}
+     * <p>
+     * If set, a color channel attribute per vertex is added to the stream,
+     * otherwise only the
+     * {@link com.jogamp.graph.curve.opengl.RegionRenderer#setColorStatic(javax.media.opengl.GL2ES2, float, float, float, float) static color}
+     * is being used.
+     * </p>
      */
-    public static final int VBAA_RENDERING_BIT = 1 << 0;
+    public static final int COLORCHANNEL_RENDERING_BIT = 1 <<  9;
 
-    /** Use non uniform weights [0.0 .. 1.9] for curve region rendering.
-     *  Otherwise the default weight 1.0 for uniform curve region rendering is being applied.
+    /**
+     * Rendering-Mode bit for {@link #getRenderModes() Region}
+     * <p>
+     * If set, a color texture is used to determine the color.
+     * </p>
      */
-    public static final int VARIABLE_CURVE_WEIGHT_BIT = 1 << 1;
+    public static final int COLORTEXTURE_RENDERING_BIT = 1 <<  10;
 
-    public static final int TWO_PASS_DEFAULT_TEXTURE_UNIT = 0;
+    /** Default maximum {@link #getQuality() quality}, {@value}. */
+    public static final int MAX_QUALITY  = 1;
+
+    public static final int DEFAULT_TWO_PASS_TEXTURE_UNIT = 0;
+
+    protected static final int DIRTY_SHAPE    = 1 << 0 ;
+    protected static final int DIRTY_STATE    = 1 << 1 ;
 
     private final int renderModes;
-    private boolean dirty = true;
-    protected int numVertices = 0;
+    private int quality;
+    private int dirty = DIRTY_SHAPE | DIRTY_STATE;
+    private int numVertices = 0;
     protected final AABBox box = new AABBox();
-    protected ArrayList<Triangle> triangles = new ArrayList<Triangle>();
-    protected ArrayList<Vertex> vertices = new ArrayList<Vertex>();
+    protected Frustum frustum = null;
+
+    public static boolean isVBAA(final int renderModes) {
+        return 0 != (renderModes & Region.VBAA_RENDERING_BIT);
+    }
 
-    public static boolean isVBAA(int renderModes) {
-        return 0 != ( renderModes & Region.VBAA_RENDERING_BIT );
+    public static boolean isMSAA(final int renderModes) {
+        return 0 != (renderModes & Region.MSAA_RENDERING_BIT);
     }
 
-    /** Check if render mode capable of non uniform weights
-     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT},
-     * {@link Region#VBAA_RENDERING_BIT}
-     * @return true of capable of non uniform weights
+    public static boolean isTwoPass(final int renderModes) {
+        return 0 != ( renderModes & ( Region.VBAA_RENDERING_BIT | Region.MSAA_RENDERING_BIT) );
+    }
+
+    /**
+     * Returns true if render mode capable of variable weights,
+     * i.e. the bit {@link #VARWEIGHT_RENDERING_BIT} is set,
+     * otherwise false.
+     */
+    public static boolean hasVariableWeight(final int renderModes) {
+        return 0 != (renderModes & Region.VARWEIGHT_RENDERING_BIT);
+    }
+
+    /**
+     * Returns true if render mode has a color channel,
+     * i.e. the bit {@link #COLORCHANNEL_RENDERING_BIT} is set,
+     * otherwise false.
+     */
+    public static boolean hasColorChannel(final int renderModes) {
+        return 0 != (renderModes & Region.COLORCHANNEL_RENDERING_BIT);
+    }
+
+    /**
+     * Returns true if render mode has a color texture,
+     * i.e. the bit {@link #COLORTEXTURE_RENDERING_BIT} is set,
+     * otherwise false.
      */
-    public static boolean isNonUniformWeight(int renderModes) {
-        return 0 != ( renderModes & Region.VARIABLE_CURVE_WEIGHT_BIT );
+    public static boolean hasColorTexture(final int renderModes) {
+        return 0 != (renderModes & Region.COLORTEXTURE_RENDERING_BIT);
+    }
+
+    public static String getRenderModeString(final int renderModes) {
+        final String curveS = hasVariableWeight(renderModes) ? "-curve" : "";
+        final String cChanS = hasColorChannel(renderModes) ? "-cols" : "";
+        final String cTexS = hasColorTexture(renderModes) ? "-ctex" : "";
+        if( Region.isVBAA(renderModes) ) {
+            return "vbaa"+curveS+cChanS+cTexS;
+        } else if( Region.isMSAA(renderModes) ) {
+            return "msaa"+curveS+cChanS+cTexS;
+        } else {
+            return "norm"+curveS+cChanS+cTexS;
+        }
     }
 
-    protected Region(int regionRenderModes) {
+    protected Region(final int regionRenderModes) {
         this.renderModes = regionRenderModes;
+        this.quality = MAX_QUALITY;
     }
 
-    /** Get current Models
-     * @return bit-field of render modes
+    // FIXME: Better handling of impl. buffer growth .. !
+    // protected abstract void setupInitialComponentCount(int attributeCount, int indexCount);
+
+    protected abstract void pushVertex(final float[] coords, final float[] texParams, float[] rgba);
+    protected abstract void pushIndex(int idx);
+
+    /**
+     * Return bit-field of render modes, see {@link com.jogamp.graph.curve.opengl.GLRegion#create(int, TextureSequence)}.
      */
-    public final int getRenderModes() {
-        return renderModes;
+    public final int getRenderModes() { return renderModes; }
+
+    /** See {@link #MAX_QUALITY} */
+    public final int getQuality() { return quality; }
+
+    /** See {@link #MAX_QUALITY} */
+    public final void setQuality(final int q) { quality=q; }
+
+    protected void clearImpl() {
+        dirty = DIRTY_SHAPE | DIRTY_STATE;
+        numVertices = 0;
+        box.reset();
     }
 
-    /** Check if current Region is using VBAA
-     * @return true if capable of two pass rendering - VBAA
+    /**
+     * Returns true if capable of two pass rendering - VBAA, otherwise false.
      */
-    public boolean isVBAA() {
+    public final boolean isVBAA() {
         return Region.isVBAA(renderModes);
     }
 
-    /** Check if current instance uses non uniform weights
-     * @return true if capable of nonuniform weights
+    /**
+     * Returns true if capable of two pass rendering - MSAA, otherwise false.
      */
-    public boolean isNonUniformWeight() {
-        return Region.isNonUniformWeight(renderModes);
+    public final boolean isMSAA() {
+        return Region.isMSAA(renderModes);
     }
 
-    /** Get the current number of vertices associated
-     * with this region. This number is not necessary equal to
-     * the OGL bound number of vertices.
-     * @return vertices count
+    /**
+     * Returns true if capable of variable weights, otherwise false.
      */
-    public final int getNumVertices(){
-        return numVertices;
+    public final boolean hasVariableWeight() {
+        return Region.hasVariableWeight(renderModes);
     }
 
-    /** Adds a {@link Triangle} object to the Region
-     * This triangle will be bound to OGL objects
-     * on the next call to {@code update}
-     * @param tri a triangle object
-     *
-     * @see update(GL2ES2)
+    /**
+     * Returns true if render mode has a color channel,
+     * i.e. the bit {@link #COLORCHANNEL_RENDERING_BIT} is set,
+     * otherwise false.
      */
-    public void addTriangle(Triangle tri) {
-        triangles.add(tri);
-        setDirty(true);
+    public boolean hasColorChannel() {
+        return Region.hasColorChannel(renderModes);
     }
 
-    /** Adds a list of {@link Triangle} objects to the Region
-     * These triangles are to be binded to OGL objects
-     * on the next call to {@code update}
-     * @param tris an arraylist of triangle objects
-     *
-     * @see update(GL2ES2)
+    /**
+     * Returns true if render mode has a color texture,
+     * i.e. the bit {@link #COLORTEXTURE_RENDERING_BIT} is set,
+     * otherwise false.
      */
-    public void addTriangles(ArrayList<Triangle> tris) {
-        triangles.addAll(tris);
-        setDirty(true);
+    public boolean hasColorTexture() {
+        return Region.hasColorTexture(renderModes);
     }
 
-    /** Adds a {@link Vertex} object to the Region
-     * This vertex will be bound to OGL objects
-     * on the next call to {@code update}
-     * @param vert a vertex objects
-     *
-     * @see update(GL2ES2)
+
+    /** See {@link #setFrustum(Frustum)} */
+    public final Frustum getFrustum() { return frustum; }
+
+    /**
+     * Set {@link Frustum} culling for {@link #addOutlineShape(OutlineShape, AffineTransform, float[])}.
      */
-    public void addVertex(Vertex vert) {
-        vertices.add(vert);
+    public final void setFrustum(final Frustum frustum) {
+        this.frustum = frustum;
+    }
+
+    final float[] coordsEx = new float[3];
+
+    private void pushNewVertexImpl(final Vertex vertIn, final AffineTransform transform, final float[] rgba) {
+        if( null != transform ) {
+            final float[] coordsIn = vertIn.getCoord();
+            transform.transform(coordsIn, coordsEx);
+            coordsEx[2] = coordsIn[2];
+            box.resize(coordsEx[0], coordsEx[1], coordsEx[2]);
+            pushVertex(coordsEx, vertIn.getTexCoord(), rgba);
+        } else {
+            box.resize(vertIn.getX(), vertIn.getY(), vertIn.getZ());
+            pushVertex(vertIn.getCoord(), vertIn.getTexCoord(), rgba);
+        }
         numVertices++;
-        setDirty(true);
     }
 
-    /** Adds a list of {@link Vertex} objects to the Region
-     * These vertices are to be binded to OGL objects
-     * on the next call to {@code update}
-     * @param verts an arraylist of vertex objects
-     *
-     * @see update(GL2ES2)
-     */
-    public void addVertices(ArrayList<Vertex> verts) {
-        vertices.addAll(verts);
-        numVertices = vertices.size();
-        setDirty(true);
+    private void pushNewVertexIdxImpl(final Vertex vertIn, final AffineTransform transform, final float[] rgba) {
+        pushIndex(numVertices);
+        pushNewVertexImpl(vertIn, transform, rgba);
     }
 
+    private final AABBox tmpBox = new AABBox();
+
     /**
-     * @return the AxisAligned bounding box of
-     * current region
+     * Add the given {@link OutlineShape} to this region with the given optional {@link AffineTransform}.
+     * <p>
+     * In case {@link #setFrustum(Frustum) frustum culling is set}, the {@link OutlineShape}
+     * is dropped if it's {@link OutlineShape#getBounds() bounding-box} is fully outside of the frustum.
+     * The optional {@link AffineTransform} is applied to the bounding-box beforehand.
+     * </p>
+     * @param rgbaColor TODO
      */
-    public final AABBox getBounds(){
+    public final void addOutlineShape(final OutlineShape shape, final AffineTransform t, final float[] rgbaColor) {
+        if( null != frustum ) {
+            final AABBox shapeBox = shape.getBounds();
+            final AABBox shapeBoxT;
+            if( null != t ) {
+                t.transform(shapeBox, tmpBox);
+                shapeBoxT = tmpBox;
+            } else {
+                shapeBoxT = shapeBox;
+            }
+            if( frustum.isAABBoxOutside(shapeBoxT) ) {
+                if(DEBUG_INSTANCE) {
+                    System.err.println("Region.addOutlineShape(): Dropping outside shapeBoxT: "+shapeBoxT);
+                }
+                return;
+            }
+        }
+        final List<Triangle> trisIn = shape.getTriangles(OutlineShape.VerticesState.QUADRATIC_NURBS);
+        final ArrayList<Vertex> vertsIn = shape.getVertices();
+        if(DEBUG_INSTANCE) {
+            final int addedVerticeCount = shape.getAddedVerticeCount();
+            final int verticeCount = vertsIn.size() + addedVerticeCount;
+            final int indexCount = trisIn.size() * 3;
+            System.err.println("Region.addOutlineShape().0: tris: "+trisIn.size()+", verts "+vertsIn.size()+", transform "+t);
+            System.err.println("Region.addOutlineShape().0: VerticeCount "+vertsIn.size()+" + "+addedVerticeCount+" = "+verticeCount);
+            System.err.println("Region.addOutlineShape().0: IndexCount "+indexCount);
+        }
+        // setupInitialComponentCount(verticeCount, indexCount); // FIXME: Use it ?
+
+        final int idxOffset = numVertices;
+        int vertsVNewIdxCount = 0, vertsTMovIdxCount = 0, vertsTNewIdxCount = 0, tris = 0;
+        final int vertsDupCountV = 0, vertsDupCountT = 0, vertsKnownMovedT = 0;
+        if( vertsIn.size() >= 3 ) {
+            if(DEBUG_INSTANCE) {
+                System.err.println("Region.addOutlineShape(): Processing Vertices");
+            }
+            for(int i=0; i<vertsIn.size(); i++) {
+                pushNewVertexImpl(vertsIn.get(i), t, rgbaColor);
+                vertsVNewIdxCount++;
+            }
+            if(DEBUG_INSTANCE) {
+                System.err.println("Region.addOutlineShape(): Processing Triangles");
+            }
+            for(int i=0; i<trisIn.size(); i++) {
+                final Triangle triIn = trisIn.get(i);
+                if(Region.DEBUG_INSTANCE) {
+                    System.err.println("T["+i+"]: "+triIn);
+                }
+                // triEx.addVertexIndicesOffset(idxOffset);
+                // triangles.add( triEx );
+                final Vertex[] triInVertices = triIn.getVertices();
+                final int tv0Idx = triInVertices[0].getId();
+                if( Integer.MAX_VALUE-idxOffset > tv0Idx ) { // Integer.MAX_VALUE != i0 // FIXME: renderer uses SHORT!
+                    // valid 'known' idx - move by offset
+                    if(Region.DEBUG_INSTANCE) {
+                        System.err.println("T["+i+"]: Moved "+tv0Idx+" + "+idxOffset+" -> "+(tv0Idx+idxOffset));
+                    }
+                    pushIndex(tv0Idx+idxOffset);
+                    pushIndex(triInVertices[1].getId()+idxOffset);
+                    pushIndex(triInVertices[2].getId()+idxOffset);
+                    vertsTMovIdxCount+=3;
+                } else {
+                    // invalid idx - generate new one
+                    if(Region.DEBUG_INSTANCE) {
+                        System.err.println("T["+i+"]: New Idx "+numVertices);
+                    }
+                    pushNewVertexIdxImpl(triInVertices[0], t, rgbaColor);
+                    pushNewVertexIdxImpl(triInVertices[1], t, rgbaColor);
+                    pushNewVertexIdxImpl(triInVertices[2], t, rgbaColor);
+                    vertsTNewIdxCount+=3;
+                }
+                tris++;
+            }
+        }
+        if(DEBUG_INSTANCE) {
+            System.err.println("Region.addOutlineShape().X: idxOffset "+idxOffset+", tris: "+tris+", verts [idx "+vertsTNewIdxCount+", add "+vertsTNewIdxCount+" = "+(vertsVNewIdxCount+vertsTNewIdxCount)+"]");
+            System.err.println("Region.addOutlineShape().X: verts: idx[v-new "+vertsVNewIdxCount+", t-new "+vertsTNewIdxCount+" = "+(vertsVNewIdxCount+vertsTNewIdxCount)+"]");
+            System.err.println("Region.addOutlineShape().X: verts: idx t-moved "+vertsTMovIdxCount+", numVertices "+numVertices);
+            System.err.println("Region.addOutlineShape().X: verts: v-dups "+vertsDupCountV+", t-dups "+vertsDupCountT+", t-known "+vertsKnownMovedT);
+            // int vertsDupCountV = 0, vertsDupCountT = 0;
+            System.err.println("Region.addOutlineShape().X: box "+box);
+        }
+        markShapeDirty();
+    }
+
+    public final void addOutlineShapes(final List<OutlineShape> shapes, final AffineTransform transform, final float[] rgbaColor) {
+        for (int i = 0; i < shapes.size(); i++) {
+            addOutlineShape(shapes.get(i), transform, rgbaColor);
+        }
+    }
+
+    /** @return the AxisAligned bounding box of current region */
+    public final AABBox getBounds() {
         return box;
     }
 
-    /** Check if this region is dirty. A region is marked dirty
-     * when new Vertices, Triangles, and or Lines are added after a
-     * call to update()
-     * @return true if region is Dirty, false otherwise
-     *
-     * @see update(GL2ES2)
+    /**
+     * Mark this region's shape dirty, i.e. it's
+     * Vertices, Triangles, and or Lines changed.
+     */
+    public final void markShapeDirty() {
+        dirty |= DIRTY_SHAPE;
+    }
+    /** Returns true if this region's shape are dirty, see {@link #markShapeDirty()}. */
+    public final boolean isShapeDirty() {
+        return 0 != ( dirty & DIRTY_SHAPE ) ;
+    }
+    /**
+     * Mark this region's state dirty, i.e.
+     * it's render attributes or parameters changed.
+     */
+    public final void markStateDirty() {
+        dirty |= DIRTY_STATE;
+    }
+    /** Returns true if this region's state is dirty, see {@link #markStateDirty()}. */
+    public final boolean isStateDirty() {
+        return 0 != ( dirty & DIRTY_STATE ) ;
+    }
+
+    /**
+     * See {@link #markShapeDirty()} and {@link #markStateDirty()}.
      */
-    public final boolean isDirty() {
-        return dirty;
+    protected final void clearDirtyBits(final int v) {
+        dirty &= ~v;
     }
+    protected final int getDirtyBits() { return dirty; }
 
-    protected final void setDirty(boolean v) {
-        dirty = v;
+    public String toString() {
+        return "Region["+getRenderModeString(this.renderModes)+", q "+quality+", dirty "+dirty+", vertices "+numVertices+", box "+box+"]";
     }
 }
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
index dfb7a95..8f3a10d 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/GLRegion.java
@@ -27,17 +27,16 @@
  */
 package com.jogamp.graph.curve.opengl;
 
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES2;
 
-import java.util.ArrayList;
+import jogamp.graph.curve.opengl.VBORegion2PMSAAES2;
+import jogamp.graph.curve.opengl.VBORegion2PVBAAES2;
+import jogamp.graph.curve.opengl.VBORegionSPES2;
 
-import javax.media.opengl.GL2ES2;
 import com.jogamp.opengl.util.PMVMatrix;
-
-import com.jogamp.graph.curve.OutlineShape;
+import com.jogamp.opengl.util.texture.TextureSequence;
 import com.jogamp.graph.curve.Region;
-import com.jogamp.graph.geom.Triangle;
-import com.jogamp.graph.geom.Vertex;
-import jogamp.graph.curve.opengl.RegionFactory;
 
 /** A GLRegion is the OGL binding of one or more OutlineShapes
  *  Defined by its vertices and generated triangles. The Region
@@ -51,79 +50,100 @@ import jogamp.graph.curve.opengl.RegionFactory;
  */
 public abstract class GLRegion extends Region {
 
-    /** Create an ogl {@link GLRegion} defining the list of {@link OutlineShape}.
-     * Combining the Shapes into single buffers.
-     * @return the resulting Region inclusive the generated region
+    /**
+     * Create a GLRegion using the passed render mode
+     *
+     * <p> In case {@link Region#VBAA_RENDERING_BIT} is being requested the default texture unit
+     * {@link Region#DEFAULT_TWO_PASS_TEXTURE_UNIT} is being used.</p>
+     * @param renderModes bit-field of modes, e.g. {@link Region#VARWEIGHT_RENDERING_BIT}, {@link Region#VBAA_RENDERING_BIT}
+     * @param colorTexSeq optional {@link TextureSequence} for {@link Region#COLORTEXTURE_RENDERING_BIT} rendering mode.
      */
-    public static GLRegion create(OutlineShape[] outlineShapes, int renderModes) {
-        final GLRegion region = RegionFactory.create(renderModes);
-
-        int numVertices = region.getNumVertices();
-
-        for(int index=0; index<outlineShapes.length; index++) {
-            OutlineShape outlineShape = outlineShapes[index];
-            outlineShape.transformOutlines(OutlineShape.VerticesState.QUADRATIC_NURBS);
-
-            ArrayList<Triangle> triangles = outlineShape.triangulate();
-            region.addTriangles(triangles);
-
-            ArrayList<Vertex> vertices = outlineShape.getVertices();
-            for(int pos=0; pos < vertices.size(); pos++){
-                Vertex vert = vertices.get(pos);
-                vert.setId(numVertices++);
-            }
-            region.addVertices(vertices);
+    public static GLRegion create(int renderModes, final TextureSequence colorTexSeq) {
+        if( null != colorTexSeq ) {
+            renderModes |= Region.COLORTEXTURE_RENDERING_BIT;
+        } else if( Region.hasColorTexture(renderModes) ) {
+            throw new IllegalArgumentException("COLORTEXTURE_RENDERING_BIT set but null TextureSequence");
+        }
+        if( isVBAA(renderModes) ) {
+            return new VBORegion2PVBAAES2(renderModes, colorTexSeq, Region.DEFAULT_TWO_PASS_TEXTURE_UNIT);
+        } else if( isMSAA(renderModes) ) {
+            return new VBORegion2PMSAAES2(renderModes, colorTexSeq, Region.DEFAULT_TWO_PASS_TEXTURE_UNIT);
+        } else {
+            return new VBORegionSPES2(renderModes, colorTexSeq);
         }
+    }
+
+    protected final TextureSequence colorTexSeq;
 
-        return region;
+    protected GLRegion(final int renderModes, final TextureSequence colorTexSeq) {
+        super(renderModes);
+        this.colorTexSeq = colorTexSeq;
     }
 
     /**
-     * Create an ogl {@link GLRegion} defining this {@link OutlineShape}
-     * @return the resulting Region.
+     * Updates a graph region by updating the ogl related
+     * objects for use in rendering if {@link #isShapeDirty()}.
+     * <p>Allocates the ogl related data and initializes it the 1st time.<p>
+     * <p>Called by {@link #draw(GL2ES2, RenderState, int, int, int)}.</p>
      */
-    public static GLRegion create(OutlineShape outlineShape, int renderModes) {
-        final GLRegion region = RegionFactory.create(renderModes);
+    protected abstract void updateImpl(final GL2ES2 gl);
 
-        outlineShape.transformOutlines(OutlineShape.VerticesState.QUADRATIC_NURBS);
-        ArrayList<Triangle> triangles = (ArrayList<Triangle>) outlineShape.triangulate();
-        ArrayList<Vertex> vertices = (ArrayList<Vertex>) outlineShape.getVertices();
-        region.addVertices(vertices);
-        region.addTriangles(triangles);
-        return region;
-    }
+    protected abstract void destroyImpl(final GL2ES2 gl);
 
-    protected GLRegion(int renderModes) {
-        super(renderModes);
-    }
+    protected abstract void clearImpl(final GL2ES2 gl);
 
-    /** Updates a graph region by updating the ogl related
-     *  objects for use in rendering if {@link #isDirty()}.
-     *  <p>Allocates the ogl related data and initializes it the 1st time.<p>
-     *  <p>Called by {@link #draw(GL2ES2, RenderState, int, int, int)}.</p>
-     * @param rs TODO
+    /**
+     * Clears all data, i.e. triangles, vertices etc.
      */
-    protected abstract void update(GL2ES2 gl, RenderState rs);
+    public void clear(final GL2ES2 gl) {
+        clearImpl(gl);
+        clearImpl();
+    }
 
-    /** Delete and clean the associated OGL
-     *  objects
+    /**
+     * Delete and clear the associated OGL objects.
      */
-    public abstract void destroy(GL2ES2 gl, RenderState rs);
+    public final void destroy(final GL2ES2 gl) {
+        clear(gl);
+        destroyImpl(gl);
+    }
 
-    /** Renders the associated OGL objects specifying
+    /**
+     * Renders the associated OGL objects specifying
      * current width/hight of window for multi pass rendering
      * of the region.
+     * <p>
+     * User shall consider {@link RegionRenderer#enable(GL2ES2, boolean) enabling}
+     * the renderer beforehand and {@link RegionRenderer#enable(GL2ES2, boolean) disabling}
+     * it afterwards when used in conjunction with other renderer.
+     * </p>
+     * <p>
+     * Users shall also consider setting the {@link GL#glClearColor(float, float, float, float) Clear Color}
+     * appropriately:
+     * <ul>
+     *   <li>If {@link GL#GL_BLEND blending} is enabled, <i>RGB</i> shall be set to text color, otherwise
+     *       blending will reduce the alpha seam's contrast and the font will appear thinner.</li>
+     *   <li>If {@link GL#GL_BLEND blending} is disabled, <i>RGB</i> shall be set to the actual desired background.</li>
+     * </ul>
+     * The <i>alpha</i> component shall be set to zero.
+     * Note: If {@link GL#GL_BLEND blending} is enabled, the
+     * {@link RegionRenderer} might need to be
+     * {@link RegionRenderer#create(RenderState, com.jogamp.graph.curve.opengl.RegionRenderer.GLCallback, com.jogamp.graph.curve.opengl.RegionRenderer.GLCallback) created}
+     * with the appropriate {@link {@link RegionRenderer.GLCallback callbacks}.
+     * </p>
      * @param matrix current {@link PMVMatrix}.
-     * @param rs the RenderState to be used
-     * @param vp_width current screen width
-     * @param vp_height current screen height
-     * @param texWidth desired texture width for multipass-rendering.
-     *        The actual used texture-width is written back when mp rendering is enabled, otherwise the store is untouched.
+     * @param renderer the {@link RegionRenderer} to be used
+     * @param sampleCount desired multisampling sample count for msaa-rendering.
+     *        The actual used scample-count is written back when msaa-rendering is enabled, otherwise the store is untouched.
+     * @see RegionRenderer#enable(GL2ES2, boolean)
      */
-    public final void draw(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int[/*1*/] texWidth) {
-        update(gl, rs);
-        drawImpl(gl, rs, vp_width, vp_height, texWidth);
+    public final void draw(final GL2ES2 gl, final RegionRenderer renderer, final int[/*1*/] sampleCount) {
+        if( isShapeDirty() ) {
+            updateImpl(gl);
+        }
+        drawImpl(gl, renderer, sampleCount);
+        clearDirtyBits(DIRTY_SHAPE|DIRTY_STATE);
     }
 
-    protected abstract void drawImpl(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int[/*1*/] texWidth);
+    protected abstract void drawImpl(final GL2ES2 gl, final RegionRenderer renderer, final int[/*1*/] sampleCount);
 }
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
index f7d4bfd..23b8263 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RegionRenderer.java
@@ -27,58 +27,534 @@
  */
 package com.jogamp.graph.curve.opengl;
 
+import java.io.IOException;
+import java.util.Iterator;
+
+import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GLES2;
 import javax.media.opengl.GLException;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
+
+import jogamp.graph.curve.opengl.shader.AttributeNames;
+import jogamp.graph.curve.opengl.shader.UniformNames;
 
-import com.jogamp.graph.curve.OutlineShape;
+import com.jogamp.opengl.GLExtensions;
+import com.jogamp.opengl.util.glsl.ShaderCode;
+import com.jogamp.opengl.util.glsl.ShaderProgram;
+import com.jogamp.opengl.util.texture.TextureSequence;
+import com.jogamp.opengl.util.PMVMatrix;
+import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.IntObjectHashMap;
 import com.jogamp.graph.curve.Region;
 
-public abstract class RegionRenderer extends Renderer {
+/**
+ * OpenGL {@link Region} renderer
+ * <p>
+ * All OpenGL related operations regarding {@link Region}s
+ * are passed through an instance of this class.
+ * </p>
+ */
+public class RegionRenderer {
+    protected static final boolean DEBUG = Region.DEBUG;
+    protected static final boolean DEBUG_INSTANCE = Region.DEBUG_INSTANCE;
+
+    public interface GLCallback {
+        /**
+         * @param gl a current GL object
+         * @param renderer {@link RegionRenderer} calling this method.
+         */
+        void run(GL gl, RegionRenderer renderer);
+    }
+
+    /**
+     * Default {@link GL#GL_BLEND} <i>enable</i> {@link GLCallback},
+     * turning-off depth writing via {@link GL#glDepthMask(boolean)} if {@link RenderState#BITHINT_GLOBAL_DEPTH_TEST_ENABLED} is set
+     * and turning-on the {@link GL#GL_BLEND} state.
+     * <p>
+     * Implementation also sets {@link RegionRenderer#getRenderState() RenderState}'s {@link RenderState#BITHINT_BLENDING_ENABLED blending bit-hint},
+     * which will cause {@link GLRegion#draw(GL2ES2, RegionRenderer, int[]) GLRegion's draw-method}
+     * to set the proper {@link GL#glBlendFuncSeparate(int, int, int, int) blend-function}
+     * and the clear-color to <i>transparent-black</i> in case of {@link Region#isTwoPass(int) multipass} FBO rendering.
+     * </p>
+     * @see #create(RenderState, GLCallback, GLCallback)
+     * @see #enable(GL2ES2, boolean)
+     */
+    public static final GLCallback defaultBlendEnable = new GLCallback() {
+        @Override
+        public void run(final GL gl, final RegionRenderer renderer) {
+            if( renderer.rs.isHintMaskSet(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED) ) {
+                gl.glDepthMask(false);
+                // gl.glDisable(GL.GL_DEPTH_TEST);
+                // gl.glDepthFunc(GL.GL_ALWAYS);
+            }
+            gl.glEnable(GL.GL_BLEND);
+            gl.glBlendEquation(GL.GL_FUNC_ADD); // default
+            renderer.rs.setHintMask(RenderState.BITHINT_BLENDING_ENABLED);
+        }
+    };
+
+    /**
+     * Default {@link GL#GL_BLEND} <i>disable</i> {@link GLCallback},
+     * simply turning-off the {@link GL#GL_BLEND} state
+     * and turning-on depth writing via {@link GL#glDepthMask(boolean)} if {@link RenderState#BITHINT_GLOBAL_DEPTH_TEST_ENABLED} is set.
+     * <p>
+     * Implementation also clears {@link RegionRenderer#getRenderState() RenderState}'s {@link RenderState#BITHINT_BLENDING_ENABLED blending bit-hint}.
+     * </p>
+     * @see #create(RenderState, GLCallback, GLCallback)
+     * @see #enable(GL2ES2, boolean)
+     */
+    public static final GLCallback defaultBlendDisable = new GLCallback() {
+        @Override
+        public void run(final GL gl, final RegionRenderer renderer) {
+            renderer.rs.clearHintMask(RenderState.BITHINT_BLENDING_ENABLED);
+            gl.glDisable(GL.GL_BLEND);
+            if( renderer.rs.isHintMaskSet(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED) ) {
+                // gl.glEnable(GL.GL_DEPTH_TEST);
+                // gl.glDepthFunc(GL.GL_LESS);
+                gl.glDepthMask(true);
+            }
+        }
+    };
 
     /**
      * Create a Hardware accelerated Region Renderer.
+     * <p>
+     * The optional {@link GLCallback}s <code>enableCallback</code> and <code>disableCallback</code>
+     * maybe used to issue certain tasks at {@link #enable(GL2ES2, boolean)}.<br/>
+     * For example, instances {@link #defaultBlendEnable} and {@link #defaultBlendDisable}
+     * can be utilized to enable and disable {@link GL#GL_BLEND}.
+     * </p>
      * @param rs the used {@link RenderState}
-     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, {@link Region#VBAA_RENDERING_BIT}
+     * @param enableCallback optional {@link GLCallback}, if not <code>null</code> will be issued at
+     *                       {@link #init(GL2ES2, int) init(gl)} and {@link #enable(GL2ES2, boolean) enable(gl, true)}.
+     * @param disableCallback optional {@link GLCallback}, if not <code>null</code> will be issued at
+     *                        {@link #enable(GL2ES2, boolean) enable(gl, false)}.
      * @return an instance of Region Renderer
+     * @see #enable(GL2ES2, boolean)
      */
-    public static RegionRenderer create(RenderState rs, int renderModes) {
-        return new jogamp.graph.curve.opengl.RegionRendererImpl01(rs, renderModes);
+    public static RegionRenderer create(final RenderState rs, final GLCallback enableCallback,
+                                        final GLCallback disableCallback) {
+        return new RegionRenderer(rs, enableCallback, disableCallback);
     }
 
-    protected RegionRenderer(RenderState rs, int renderModes) {
-        super(rs, renderModes);
+    private final RenderState rs;
+
+    private final GLCallback enableCallback;
+    private final GLCallback disableCallback;
+
+    private int vp_width;
+    private int vp_height;
+    private boolean initialized;
+    private boolean vboSupported = false;
+
+    public final boolean isInitialized() { return initialized; }
+
+    /** Return width of current viewport */
+    public final int getWidth() { return vp_width; }
+    /** Return height of current viewport */
+    public final int getHeight() { return vp_height; }
+
+    public final PMVMatrix getMatrix() { return rs.getMatrix(); }
+
+    //////////////////////////////////////
+
+    /**
+     * @param rs the used {@link RenderState}
+     */
+    protected RegionRenderer(final RenderState rs, final GLCallback enableCallback, final GLCallback disableCallback) {
+        this.rs = rs;
+        this.enableCallback = enableCallback;
+        this.disableCallback = disableCallback;
     }
 
+    public final boolean isVBOSupported() { return vboSupported; }
 
-    /** Render an {@link OutlineShape} in 3D space at the position provided
-     *  the triangles of the shapes will be generated, if not yet generated
-     * @param region the OutlineShape to Render.
-     * @param position the initial translation of the outlineShape.
-     * @param texWidth desired texture width for multipass-rendering.
-     *        The actual used texture-width is written back when mp rendering is enabled, otherwise the store is untouched.
-     * @throws Exception if HwRegionRenderer not initialized
+    /**
+     * Initialize shader and bindings for GPU based rendering bound to the given GL object's GLContext
+     * if not initialized yet.
+     * <p>Leaves the renderer enabled, ie ShaderState.</p>
+     * <p>Shall be called by a {@code draw()} method, e.g. {@link RegionRenderer#draw(GL2ES2, Region, int)}</p>
+     *
+     * @param gl referencing the current GLContext to which the ShaderState is bound to
+     * @param renderModes
+     * @throws GLException if initialization failed
      */
-    public final void draw(GL2ES2 gl, Region region, float[] position, int[/*1*/] texWidth) {
-        if(!isInitialized()) {
-            throw new GLException("RegionRenderer: not initialized!");
+    public final void init(final GL2ES2 gl, final int renderModes) throws GLException {
+        if(initialized){
+            return;
         }
-        if( !areRenderModesCompatible(region) ) {
-            throw new GLException("Incompatible render modes, : region modes "+region.getRenderModes()+
-                                  " doesn't contain renderer modes "+this.getRenderModes());
+        vboSupported =  gl.isFunctionAvailable("glGenBuffers") &&
+                        gl.isFunctionAvailable("glBindBuffer") &&
+                        gl.isFunctionAvailable("glBufferData") &&
+                        gl.isFunctionAvailable("glDrawElements") &&
+                        gl.isFunctionAvailable("glVertexAttribPointer") &&
+                        gl.isFunctionAvailable("glDeleteBuffers");
+
+        if(DEBUG) {
+            System.err.println("TextRendererImpl01: VBO Supported = " + isVBOSupported());
         }
-        drawImpl(gl, region, position, texWidth);
+
+        if(!vboSupported){
+            throw new GLException("VBO not supported");
+        }
+
+        rs.attachTo(gl);
+
+        if( null != enableCallback ) {
+            enableCallback.run(gl, this);
+        }
+        initialized = true;
     }
 
+    public final void destroy(final GL2ES2 gl) {
+        if(!initialized){
+            if(DEBUG_INSTANCE) {
+                System.err.println("TextRenderer: Not initialized!");
+            }
+            return;
+        }
+        for(final Iterator<IntObjectHashMap.Entry> i = shaderPrograms.iterator(); i.hasNext(); ) {
+            final ShaderProgram sp = (ShaderProgram) i.next().getValue();
+            sp.destroy(gl);
+        }
+        shaderPrograms.clear();
+        rs.destroy(gl);
+        initialized = false;
+    }
+
+    public final RenderState getRenderState() { return rs; }
+
     /**
-     * Usually just dispatched the draw call to the Region's draw implementation,
-     * e.g. {@link com.jogamp.graph.curve.opengl.GLRegion#draw(GL2ES2, RenderState, int, int, int[]) GLRegion#draw(GL2ES2, RenderState, int, int, int[])}.
+     * Enabling or disabling the {@link #getRenderState() RenderState}'s
+     * {@link RenderState#getShaderProgram() shader program}.
+     * <p>
+     * In case enable and disable {@link GLCallback}s are setup via {@link #create(RenderState, GLCallback, GLCallback)},
+     * they will be called before toggling the shader program.
+     * </p>
+     * @see #create(RenderState, GLCallback, GLCallback)
      */
-    protected abstract void drawImpl(GL2ES2 gl, Region region, float[] position, int[] texWidth);
+    public final void enable(final GL2ES2 gl, final boolean enable) {
+        if( enable ) {
+            if( null != enableCallback ) {
+                enableCallback.run(gl, this);
+            }
+        } else {
+            if( null != disableCallback ) {
+                disableCallback.run(gl, this);
+            }
+        }
+        if( !enable ) {
+            final ShaderProgram sp = rs.getShaderProgram();
+            if( null != sp ) {
+                sp.useProgram(gl, false);
+            }
+        }
+    }
 
-    @Override
-    protected void destroyImpl(GL2ES2 gl) {
-        // nop
+    /** No PMVMatrix operation is performed here. PMVMatrix is marked dirty. */
+    public final void reshapeNotify(final int width, final int height) {
+        this.vp_width = width;
+        this.vp_height = height;
     }
 
+    public final void reshapePerspective(final float angle, final int width, final int height, final float near, final float far) {
+        this.vp_width = width;
+        this.vp_height = height;
+        final float ratio = (float)width/(float)height;
+        final PMVMatrix p = rs.getMatrix();
+        p.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
+        p.glLoadIdentity();
+        p.gluPerspective(angle, ratio, near, far);
+    }
+
+    public final void reshapeOrtho(final int width, final int height, final float near, final float far) {
+        this.vp_width = width;
+        this.vp_height = height;
+        final PMVMatrix p = rs.getMatrix();
+        p.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
+        p.glLoadIdentity();
+        p.glOrthof(0, width, 0, height, near, far);
+    }
+
+    //
+    // Shader Management
+    //
+
+    private static final String SHADER_SRC_SUB = "";
+    private static final String SHADER_BIN_SUB = "bin";
+
+    private static String GLSL_USE_COLOR_CHANNEL = "#define USE_COLOR_CHANNEL 1\n";
+    private static String GLSL_USE_COLOR_TEXTURE = "#define USE_COLOR_TEXTURE 1\n";
+    private static String GLSL_DEF_SAMPLE_COUNT = "#define SAMPLE_COUNT ";
+    private static String GLSL_CONST_SAMPLE_COUNT = "const float sample_count = ";
+    private static String GLSL_MAIN_BEGIN = "void main (void)\n{\n";
+    private static final String gcuTexture2D = "gcuTexture2D";
 
-}
+    private String getVersionedShaderName() {
+        return "curverenderer01";
+    }
+
+    // FIXME: Really required to have sampler2D def. precision ? If not, we can drop getFragmentShaderPrecision(..) and use default ShaderCode ..
+    private static final String es2_precision_fp = "\nprecision mediump float;\nprecision mediump int;\nprecision mediump sampler2D;\n";
+
+    private final String getFragmentShaderPrecision(final GL2ES2 gl) {
+        if( gl.isGLES() ) {
+            return es2_precision_fp;
+        }
+        if( ShaderCode.requiresGL3DefaultPrecision(gl) ) {
+            return ShaderCode.gl3_default_precision_fp;
+        }
+        return null;
+    }
+
+    private static enum ShaderModeSelector1 {
+        /** Pass-1: Curve Simple */
+        PASS1_SIMPLE("curve", "_simple", 0),
+        /** Pass-1: Curve Varying Weight */
+        PASS1_WEIGHT("curve", "_weight", 0),
+        /** Pass-2: MSAA */
+        PASS2_MSAA("msaa", "", 0),
+        /** Pass-2: VBAA Flipquad3, 1 sample */
+        PASS2_VBAA_QUAL0_SAMPLES1("vbaa", "_flipquad3", 1),
+        /** Pass-2: VBAA Flipquad3, 2 samples */
+        PASS2_VBAA_QUAL0_SAMPLES2("vbaa", "_flipquad3", 2),
+        /** Pass-2: VBAA Flipquad3, 4 samples */
+        PASS2_VBAA_QUAL0_SAMPLES4("vbaa", "_flipquad3", 4),
+        /** Pass-2: VBAA Flipquad3, 8 samples */
+        PASS2_VBAA_QUAL0_SAMPLES8("vbaa", "_flipquad3", 8),
+
+        /** Pass-2: VBAA Brute-Force, Odd, 1 samples */
+        PASS2_VBAA_QUAL1_SAMPLES1("vbaa", "_bforce_odd",  1),
+        /** Pass-2: VBAA Brute-Force, Even, 2 samples */
+        PASS2_VBAA_QUAL1_SAMPLES2("vbaa", "_bforce_even", 2),
+        /** Pass-2: VBAA Brute-Force, Odd, 3 samples */
+        PASS2_VBAA_QUAL1_SAMPLES3("vbaa", "_bforce_odd",  3),
+        /** Pass-2: VBAA Brute-Force, Even, 4 samples */
+        PASS2_VBAA_QUAL1_SAMPLES4("vbaa", "_bforce_even", 4),
+        /** Pass-2: VBAA Brute-Force, Odd, 5 samples */
+        PASS2_VBAA_QUAL1_SAMPLES5("vbaa", "_bforce_odd",  5),
+        /** Pass-2: VBAA Brute-Force, Even, 6 samples */
+        PASS2_VBAA_QUAL1_SAMPLES6("vbaa", "_bforce_even", 6),
+        /** Pass-2: VBAA Brute-Force, Odd, 7 samples */
+        PASS2_VBAA_QUAL1_SAMPLES7("vbaa", "_bforce_odd",  7),
+        /** Pass-2: VBAA Brute-Force, Even, 8 samples */
+        PASS2_VBAA_QUAL1_SAMPLES8("vbaa", "_bforce_even", 8);
+
+        public final String tech;
+        public final String sub;
+        public final int sampleCount;
+
+        ShaderModeSelector1(final String tech, final String sub, final int sampleCount) {
+            this.tech = tech;
+            this.sub= sub;
+            this.sampleCount = sampleCount;
+        }
+
+        public static ShaderModeSelector1 selectPass1(final int renderModes) {
+            return Region.hasVariableWeight(renderModes) ? PASS1_WEIGHT : PASS1_SIMPLE;
+        }
+
+        public static ShaderModeSelector1 selectPass2(final int renderModes, final int quality, final int sampleCount) {
+            if( Region.isMSAA(renderModes) ) {
+                return PASS2_MSAA;
+            } else if( Region.isVBAA(renderModes) ) {
+                if( 0 == quality ) {
+                    if( sampleCount < 2 ) {
+                        return PASS2_VBAA_QUAL0_SAMPLES1;
+                    } else if( sampleCount < 4 ) {
+                        return PASS2_VBAA_QUAL0_SAMPLES2;
+                    } else if( sampleCount < 8 ) {
+                        return PASS2_VBAA_QUAL0_SAMPLES4;
+                    } else {
+                        return PASS2_VBAA_QUAL0_SAMPLES8;
+                    }
+                } else {
+                    switch( sampleCount ) {
+                        case 0: // Fall through intended
+                        case 1:  return PASS2_VBAA_QUAL1_SAMPLES1;
+                        case 2:  return PASS2_VBAA_QUAL1_SAMPLES2;
+                        case 3:  return PASS2_VBAA_QUAL1_SAMPLES3;
+                        case 4:  return PASS2_VBAA_QUAL1_SAMPLES4;
+                        case 5:  return PASS2_VBAA_QUAL1_SAMPLES5;
+                        case 6:  return PASS2_VBAA_QUAL1_SAMPLES6;
+                        case 7:  return PASS2_VBAA_QUAL1_SAMPLES7;
+                        default: return PASS2_VBAA_QUAL1_SAMPLES8;
+                    }
+                }
+            } else {
+                return null;
+            }
+        }
+    }
+    private final IntObjectHashMap shaderPrograms = new IntObjectHashMap();
+
+    private static final int HIGH_MASK = Region.COLORCHANNEL_RENDERING_BIT | Region.COLORTEXTURE_RENDERING_BIT;
+    private static final int TWO_PASS_BIT = 1 <<  31;
+
+    /**
+     * @param gl
+     * @param renderModes
+     * @param pass1
+     * @param quality
+     * @param sampleCount
+     * @param colorTexSeq
+     * @return true if a new shader program is being used and hence external uniform-data and -location,
+     *         as well as the attribute-location must be updated, otherwise false.
+     */
+    public final boolean useShaderProgram(final GL2ES2 gl, final int renderModes,
+                                          final boolean pass1, final int quality, final int sampleCount, final TextureSequence colorTexSeq) {
+        final int colorTexSeqHash;
+        if( null != colorTexSeq ) {
+            colorTexSeqHash = colorTexSeq.getTextureFragmentShaderHashCode();
+        } else {
+            colorTexSeqHash = 0;
+        }
+        final ShaderModeSelector1 sel1 = pass1 ? ShaderModeSelector1.selectPass1(renderModes) :
+                                                 ShaderModeSelector1.selectPass2(renderModes, quality, sampleCount);
+        final boolean isTwoPass = Region.isTwoPass( renderModes );
+        final boolean isPass1ColorTexSeq = pass1 && null != colorTexSeq;
+        final int shaderKey = ( (colorTexSeqHash << 5) - colorTexSeqHash ) +
+                              ( sel1.ordinal() | ( HIGH_MASK & renderModes ) | ( isTwoPass ? TWO_PASS_BIT : 0 ) );
+
+        /**
+        if(DEBUG) {
+            System.err.printf("RegionRendererImpl01.useShaderProgram.0: renderModes %s, sel1 %s, key 0x%X (pass1 %b, q %d, samples %d) - Thread %s%n",
+                    Region.getRenderModeString(renderModes), sel1, shaderKey, pass1, quality, sampleCount, Thread.currentThread());
+        } */
+
+        ShaderProgram sp = (ShaderProgram) shaderPrograms.get( shaderKey );
+        if( null != sp ) {
+            final boolean spChanged = getRenderState().setShaderProgram(gl, sp);
+            if(DEBUG) {
+                if( spChanged ) {
+                    System.err.printf("RegionRendererImpl01.useShaderProgram.X1: GOT renderModes %s, sel1 %s, key 0x%X -> sp %d / %d (changed)%n", Region.getRenderModeString(renderModes), sel1, shaderKey, sp.program(), sp.id());
+                } else {
+                    System.err.printf("RegionRendererImpl01.useShaderProgram.X1: GOT renderModes %s, sel1 %s, key 0x%X -> sp %d / %d (keep)%n", Region.getRenderModeString(renderModes), sel1, shaderKey, sp.program(), sp.id());
+                }
+            }
+            return spChanged;
+        }
+        final String versionedBaseName = getVersionedShaderName();
+        final String vertexShaderName;
+        if( isTwoPass ) {
+            vertexShaderName = versionedBaseName+"-pass"+(pass1?1:2);
+        } else {
+            vertexShaderName = versionedBaseName+"-single";
+        }
+        final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, AttributeNames.class, SHADER_SRC_SUB, SHADER_BIN_SUB, vertexShaderName, true);
+        final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, AttributeNames.class, SHADER_SRC_SUB, SHADER_BIN_SUB, versionedBaseName+"-segment-head", true);
+
+        if( isPass1ColorTexSeq && GLES2.GL_TEXTURE_EXTERNAL_OES == colorTexSeq.getTextureTarget() ) {
+            if( !gl.isExtensionAvailable(GLExtensions.OES_EGL_image_external) ) {
+                throw new GLException(GLExtensions.OES_EGL_image_external+" requested but not available");
+            }
+        }
+        boolean supressGLSLVersionES30 = false;
+        if( isPass1ColorTexSeq && GLES2.GL_TEXTURE_EXTERNAL_OES == colorTexSeq.getTextureTarget() ) {
+            if( Platform.OSType.ANDROID == Platform.getOSType() && gl.isGLES3() ) {
+                // Bug on Nexus 10, ES3 - Android 4.3, where
+                // GL_OES_EGL_image_external extension directive leads to a failure _with_ '#version 300 es' !
+                //   P0003: Extension 'GL_OES_EGL_image_external' not supported
+                supressGLSLVersionES30 = true;
+            }
+        }
+        //
+        // GLSL customization at top
+        //
+        int posVp = rsVp.defaultShaderCustomization(gl, !supressGLSLVersionES30, true);
+        // rsFp.defaultShaderCustomization(gl, true, true);
+        int posFp = supressGLSLVersionES30 ? 0 : rsFp.addGLSLVersion(gl);
+        if( isPass1ColorTexSeq ) {
+            posFp = rsFp.insertShaderSource(0, posFp, colorTexSeq.getRequiredExtensionsShaderStub());
+        }
+        if( pass1 && supressGLSLVersionES30 || ( gl.isGLES2() && !gl.isGLES3() ) ) {
+            posFp = rsFp.insertShaderSource(0, posFp, ShaderCode.createExtensionDirective(GLExtensions.OES_standard_derivatives, ShaderCode.ENABLE));
+        }
+        if( false ) {
+            final String rsFpDefPrecision =  getFragmentShaderPrecision(gl);
+            if( null != rsFpDefPrecision ) {
+                posFp = rsFp.insertShaderSource(0, posFp, rsFpDefPrecision);
+            }
+        } else {
+            posFp = rsFp.addDefaultShaderPrecision(gl, posFp);
+        }
+
+        //
+        // GLSL append from here on
+        posFp = -1;
+
+        if( Region.hasColorChannel( renderModes ) ) {
+            posVp = rsVp.insertShaderSource(0, posVp, GLSL_USE_COLOR_CHANNEL);
+            posFp = rsFp.insertShaderSource(0, posFp, GLSL_USE_COLOR_CHANNEL);
+        }
+        if( Region.hasColorTexture( renderModes ) ) {
+                    rsVp.insertShaderSource(0, posVp, GLSL_USE_COLOR_TEXTURE);
+            posFp = rsFp.insertShaderSource(0, posFp, GLSL_USE_COLOR_TEXTURE);
+        }
+        if( !pass1 ) {
+            posFp = rsFp.insertShaderSource(0, posFp, GLSL_DEF_SAMPLE_COUNT+sel1.sampleCount+"\n");
+            posFp = rsFp.insertShaderSource(0, posFp, GLSL_CONST_SAMPLE_COUNT+sel1.sampleCount+".0;\n");
+        }
+
+        try {
+            posFp = rsFp.insertShaderSource(0, posFp, AttributeNames.class, "uniforms.glsl");
+            posFp = rsFp.insertShaderSource(0, posFp, AttributeNames.class, "varyings.glsl");
+        } catch (final IOException ioe) {
+            throw new RuntimeException("Failed to read: includes", ioe);
+        }
+        if( 0 > posFp ) {
+            throw new RuntimeException("Failed to read: includes");
+        }
+
+        final String texLookupFuncName;
+        if( isPass1ColorTexSeq ) {
+            posFp = rsFp.insertShaderSource(0, posFp, "uniform "+colorTexSeq.getTextureSampler2DType()+" "+UniformNames.gcu_ColorTexUnit+";\n");
+            texLookupFuncName = colorTexSeq.getTextureLookupFunctionName(gcuTexture2D);
+            posFp = rsFp.insertShaderSource(0, posFp, colorTexSeq.getTextureLookupFragmentShaderImpl());
+        } else {
+            texLookupFuncName = null;
+        }
+
+        posFp = rsFp.insertShaderSource(0, posFp, GLSL_MAIN_BEGIN);
+
+        final String passS = pass1 ? "-pass1-" : "-pass2-";
+        final String shaderSegment = versionedBaseName+passS+sel1.tech+sel1.sub+".glsl";
+        if(DEBUG) {
+            System.err.printf("RegionRendererImpl01.useShaderProgram.1: segment %s%n", shaderSegment);
+        }
+        try {
+            posFp = rsFp.insertShaderSource(0, posFp, AttributeNames.class, shaderSegment);
+        } catch (final IOException ioe) {
+            throw new RuntimeException("Failed to read: "+shaderSegment, ioe);
+        }
+        if( 0 > posFp ) {
+            throw new RuntimeException("Failed to read: "+shaderSegment);
+        }
+        posFp = rsFp.insertShaderSource(0, posFp, "}\n");
+
+        if( isPass1ColorTexSeq ) {
+            rsFp.replaceInShaderSource(gcuTexture2D, texLookupFuncName);
+        }
+
+        sp = new ShaderProgram();
+        sp.add(rsVp);
+        sp.add(rsFp);
+
+        if( !sp.init(gl) ) {
+            throw new GLException("RegionRenderer: Couldn't init program: "+sp);
+        }
+
+        if( !sp.link(gl, System.err) ) {
+            throw new GLException("could not link program: "+sp);
+        }
+        getRenderState().setShaderProgram(gl, sp);
+
+        shaderPrograms.put(shaderKey, sp);
+        if(DEBUG) {
+            System.err.printf("RegionRendererImpl01.useShaderProgram.X1: PUT renderModes %s, sel1 %s, key 0x%X -> sp %d / %d (changed)%n",
+                    Region.getRenderModeString(renderModes), sel1, shaderKey, sp.program(), sp.id());
+        }
+        return true;
+    }
+}
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
index 9b0f32e..6ff9bf9 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/RenderState.java
@@ -27,86 +27,326 @@
  */
 package com.jogamp.graph.curve.opengl;
 
+import java.nio.FloatBuffer;
+
+import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GLException;
 import javax.media.opengl.GLUniformData;
 
-import jogamp.graph.curve.opengl.RenderStateImpl;
+import jogamp.common.os.PlatformPropsImpl;
 import jogamp.graph.curve.opengl.shader.UniformNames;
 
 import com.jogamp.common.os.Platform;
+import com.jogamp.graph.curve.Region;
 import com.jogamp.graph.geom.Vertex;
+import com.jogamp.opengl.util.GLArrayDataServer;
 import com.jogamp.opengl.util.PMVMatrix;
-import com.jogamp.opengl.util.glsl.ShaderState;
+import com.jogamp.opengl.util.glsl.ShaderProgram;
 
-public abstract class RenderState {
+public class RenderState {
     private static final String thisKey = "jogamp.graph.curve.RenderState" ;
 
-    public static RenderState createRenderState(ShaderState st, Vertex.Factory<? extends Vertex> pointFactory) {
-        return new RenderStateImpl(st, pointFactory, null);
+    /**
+     * Bitfield hint, {@link #isHintMaskSet(int) if set}
+     * stating <i>enabled</i> {@link GL#GL_BLEND}, otherwise <i>disabled</i>.
+     * <p>
+     * Shall be set via {@link #setHintMask(int)} and cleared via {@link #clearHintMask(int)}.
+     * </p>
+     * <p>
+     * If set, {@link GLRegion#draw(GL2ES2, RegionRenderer, int[]) GLRegion's draw-method}
+     * will set the proper {@link GL#glBlendFuncSeparate(int, int, int, int) blend-function}
+     * and the clear-color to <i>transparent-black</i> in case of {@link Region#isTwoPass(int) multipass} FBO rendering.
+     * </p>
+     * <p>
+     * Shall be set by custom code, e.g. via {@link RegionRenderer}'s
+     * enable and disable {@link RegionRenderer.GLCallback} as done in
+     * {@link RegionRenderer#defaultBlendEnable} and {@link RegionRenderer#defaultBlendDisable}.
+     * </p>
+     */
+    public static final int BITHINT_BLENDING_ENABLED = 1 << 0 ;
+
+    /**
+     * Bitfield hint, {@link #isHintMaskSet(int) if set}
+     * stating globally <i>enabled</i> {@link GL#GL_DEPTH_TEST}, otherwise <i>disabled</i>.
+     * <p>
+     * Shall be set via {@link #setHintMask(int)} and cleared via {@link #clearHintMask(int)}.
+     * </p>
+     * <p>
+     * {@link GLRegion#draw(GL2ES2, RegionRenderer, int[]) GLRegion's draw-method}
+     * may toggle depth test, and reset it's state according to this hint.
+     * </p>
+     * <p>
+     * Shall be set by custom code, e.g. after {@link RenderState} or {@link RegionRenderer} construction.
+     * </p>
+     */
+    public static final int BITHINT_GLOBAL_DEPTH_TEST_ENABLED = 1 << 1 ;
+
+    public static RenderState createRenderState(final Vertex.Factory<? extends Vertex> pointFactory) {
+        return new RenderState(pointFactory, null);
     }
 
-    public static RenderState createRenderState(ShaderState st, Vertex.Factory<? extends Vertex> pointFactory, PMVMatrix pmvMatrix) {
-        return new RenderStateImpl(st, pointFactory, pmvMatrix);
+    public static RenderState createRenderState(final Vertex.Factory<? extends Vertex> pointFactory, final PMVMatrix pmvMatrix) {
+        return new RenderState(pointFactory, pmvMatrix);
     }
 
-    public static final RenderState getRenderState(GL2ES2 gl) {
+    public static final RenderState getRenderState(final GL2ES2 gl) {
         return (RenderState) gl.getContext().getAttachedObject(thisKey);
     }
 
-    protected final ShaderState st;
-    protected final Vertex.Factory<? extends Vertex> vertexFactory;
-    protected final PMVMatrix pmvMatrix;
-    protected final GLUniformData gcu_PMVMatrix;
+    private final Vertex.Factory<? extends Vertex> vertexFactory;
+    private final PMVMatrix pmvMatrix;
+    private final float[] weight;
+    private final FloatBuffer weightBuffer;
+    private final float[] colorStatic;
+    private final FloatBuffer colorStaticBuffer;
+    private ShaderProgram sp;
+    private int hintBitfield;
+
+    private final int id;
+    private static synchronized int getNextID() {
+        return nextID++;
+    }
+    private static int nextID = 1;
+
+    /**
+     * Representation of {@link RenderState} data for one {@link ShaderProgram}
+     * as {@link GLUniformData}.
+     * <p>
+     * FIXME: Utilize 'ARB_Uniform_Buffer_Object' where available!
+     * </p>
+     */
+    public static class ProgramLocal {
+        public final GLUniformData gcu_PMVMatrix01;
+        public final GLUniformData gcu_Weight;
+        public final GLUniformData gcu_ColorStatic;
+        private int rsId = -1;
+
+        public ProgramLocal() {
+            gcu_PMVMatrix01 = GLUniformData.creatEmptyMatrix(UniformNames.gcu_PMVMatrix01, 4, 4);
+            gcu_Weight = GLUniformData.creatEmptyVector(UniformNames.gcu_Weight, 1);
+            gcu_ColorStatic = GLUniformData.creatEmptyVector(UniformNames.gcu_ColorStatic, 4);
+        }
+
+        public final int getRenderStateId() { return rsId; }
+
+        /**
+         * <p>
+         * Since {@link RenderState} data is being used in multiple
+         * {@link ShaderProgram}s the data must always be written.
+         * </p>
+         * @param gl
+         * @param updateLocation
+         * @param renderModes
+         * @param throwOnError TODO
+         * @return true if no error occurred, i.e. all locations found, otherwise false.
+         */
+        public final boolean update(final GL2ES2 gl, final RenderState rs, final boolean updateLocation, final int renderModes, final boolean pass1, final boolean throwOnError) {
+            if( rs.id() != rsId ) {
+                gcu_PMVMatrix01.setData(rs.pmvMatrix.glGetPMvMatrixf());
+                gcu_Weight.setData(rs.weightBuffer);
+                gcu_ColorStatic.setData(rs.colorStaticBuffer);
+                rsId = rs.id();
+            }
+            boolean res = true;
+            if( null != rs.sp && rs.sp.inUse() ) {
+                if( !Region.isTwoPass(renderModes) || !pass1 ) {
+                    final boolean r0 = rs.updateUniformDataLoc(gl, updateLocation, true, gcu_PMVMatrix01, throwOnError);
+                    res = res && r0;
+                }
+                if( pass1 ) {
+                    if( Region.hasVariableWeight( renderModes ) ) {
+                        final boolean r0 = rs.updateUniformDataLoc(gl, updateLocation, true, gcu_Weight, throwOnError);
+                        res = res && r0;
+                    }
+                    {
+                        final boolean r0 = rs.updateUniformDataLoc(gl, updateLocation, true, gcu_ColorStatic, throwOnError);
+                        res = res && r0;
+                    }
+                }
+            }
+            return res;
+        }
+
+        public StringBuilder toString(StringBuilder sb, final boolean alsoUnlocated) {
+            if(null==sb) {
+                sb = new StringBuilder();
+            }
+            sb.append("ProgramLocal[rsID ").append(rsId).append(PlatformPropsImpl.NEWLINE);
+            // pmvMatrix.toString(sb, "%.2f");
+            sb.append(gcu_PMVMatrix01).append(", ").append(PlatformPropsImpl.NEWLINE);
+            sb.append(gcu_ColorStatic).append(", ");
+            sb.append(gcu_Weight).append("]");
+            return sb;
+        }
+
+        @Override
+        public String toString() {
+            return toString(null, false).toString();
+        }
+    }
 
-    protected RenderState(ShaderState st, Vertex.Factory<? extends Vertex> vertexFactory, PMVMatrix pmvMatrix) {
-        this.st = st;
+    protected RenderState(final Vertex.Factory<? extends Vertex> vertexFactory, final PMVMatrix pmvMatrix) {
+        this.id = getNextID();
+        this.sp = null;
         this.vertexFactory = vertexFactory;
         this.pmvMatrix = null != pmvMatrix ? pmvMatrix : new PMVMatrix();
-        this.gcu_PMVMatrix = new GLUniformData(UniformNames.gcu_PMVMatrix, 4, 4, this.pmvMatrix.glGetPMvMatrixf());
-        st.ownUniform(gcu_PMVMatrix);
+        this.weight = new float[1];
+        this.weightBuffer = FloatBuffer.wrap(weight);
+        this.colorStatic = new float[4];
+        this.colorStaticBuffer = FloatBuffer.wrap(colorStatic);
+        this.hintBitfield = 0;
+    }
+
+    public final int id() { return id; }
+    public final ShaderProgram getShaderProgram() { return sp; }
+    public final boolean isShaderProgramInUse() { return null != sp ? sp.inUse() : false; }
+
+    /**
+     * Set a {@link ShaderProgram} and enable it. If the given {@link ShaderProgram} is new,
+     * method returns true, otherwise false.
+     * @param gl
+     * @param spNext
+     * @return true if a new shader program is being used and hence external uniform-data and -location,
+     *         as well as the attribute-location must be updated, otherwise false.
+     */
+    public final boolean setShaderProgram(final GL2ES2 gl, final ShaderProgram spNext) {
+        if( spNext.equals(this.sp) ) {
+            spNext.useProgram(gl, true);
+            return false;
+        }
+        if( null != this.sp ) {
+            this.sp.notifyNotInUse();
+        }
+        this.sp = spNext;
+        spNext.useProgram(gl, true);
+        return true;
     }
 
-    public final ShaderState getShaderState() { return st; }
     public final Vertex.Factory<? extends Vertex> getVertexFactory() { return vertexFactory; }
-    public final PMVMatrix pmvMatrix() { return pmvMatrix; }
-    public final GLUniformData getPMVMatrix() { return gcu_PMVMatrix; }
 
-    public void destroy(GL2ES2 gl) {
-        st.destroy(gl);
+    public final PMVMatrix getMatrix() { return pmvMatrix; }
+
+    public static boolean isWeightValid(final float v) {
+        return 0.0f <= v && v <= 1.9f ;
+    }
+    public final float getWeight() { return weight[0]; }
+    public final void setWeight(final float v) {
+        if( !isWeightValid(v) ) {
+             throw new IllegalArgumentException("Weight out of range");
+        }
+        weight[0] = v;
     }
 
-    public abstract GLUniformData getWeight();
-    public abstract GLUniformData getAlpha();
-    public abstract GLUniformData getColorStatic();
-    // public abstract GLUniformData getStrength();
 
-    public final RenderState attachTo(GL2ES2 gl) {
-        return (RenderState) gl.getContext().attachObject(thisKey, this);
+    public final float[] getColorStatic(final float[] rgbaColor) {
+        System.arraycopy(colorStatic, 0, rgbaColor, 0, 4);
+        return rgbaColor;
+    }
+    public final void setColorStatic(final float r, final float g, final float b, final float a){
+        colorStatic[0] = r;
+        colorStatic[1] = g;
+        colorStatic[2] = b;
+        colorStatic[3] = a;
     }
 
-    public final boolean detachFrom(GL2ES2 gl) {
-        RenderState _rs = (RenderState) gl.getContext().getAttachedObject(thisKey);
-        if(_rs == this) {
-            gl.getContext().detachObject(thisKey);
+
+    /**
+     *
+     * @param gl
+     * @param updateLocation
+     * @param data
+     * @param throwOnError TODO
+     * @return true if no error occured, i.e. all locations found, otherwise false.
+     */
+    public final boolean updateUniformLoc(final GL2ES2 gl, final boolean updateLocation, final GLUniformData data, final boolean throwOnError) {
+        if( updateLocation || 0 > data.getLocation() ) {
+            final boolean ok = 0 <= data.setLocation(gl, sp.program());
+            if( throwOnError && !ok ) {
+                throw new GLException("Could not locate "+data);
+            }
+            return ok;
+        } else {
+            return true;
+        }
+    }
+
+    /**
+     *
+     * @param gl
+     * @param updateLocation
+     * @param updateData TODO
+     * @param data
+     * @param throwOnError TODO
+     * @return true if no error occured, i.e. all locations found, otherwise false.
+     */
+    public final boolean updateUniformDataLoc(final GL2ES2 gl, boolean updateLocation, boolean updateData, final GLUniformData data, final boolean throwOnError) {
+        updateLocation = updateLocation || 0 > data.getLocation();
+        if( updateLocation ) {
+            updateData = 0 <= data.setLocation(gl, sp.program());
+            if( throwOnError && !updateData ) {
+                throw new GLException("Could not locate "+data);
+            }
+        }
+        if( updateData ){
+            gl.glUniform(data);
+            return true;
+        } else {
+            return !updateLocation;
+        }
+    }
+
+    /**
+     * @param gl
+     * @param data
+     * @param throwOnError TODO
+     * @return true if no error occured, i.e. all locations found, otherwise false.
+     */
+    public final boolean updateAttributeLoc(final GL2ES2 gl, final boolean updateLocation, final GLArrayDataServer data, final boolean throwOnError) {
+        if( updateLocation || 0 > data.getLocation() ) {
+            final boolean ok = 0 <= data.setLocation(gl, sp.program());
+            if( throwOnError && !ok ) {
+                throw new GLException("Could not locate "+data);
+            }
+            return ok;
+        } else {
             return true;
         }
-        return false;
     }
 
-    public StringBuilder toString(StringBuilder sb, boolean alsoUnlocated) {
-        if(null==sb) {
-            sb = new StringBuilder();
+
+    public final boolean isHintMaskSet(final int mask) {
+        return mask == ( hintBitfield & mask );
+    }
+    public final void setHintMask(final int mask) {
+        hintBitfield |= mask;
+    }
+    public final void clearHintMask(final int mask) {
+        hintBitfield &= ~mask;
+    }
+
+    public void destroy(final GL2ES2 gl) {
+        if( null != sp ) {
+            sp.destroy(gl);
+            sp = null;
         }
+    }
 
-        sb.append("RenderState[");
-        st.toString(sb, alsoUnlocated).append(Platform.getNewline());
-        sb.append("]");
+    public final RenderState attachTo(final GL2ES2 gl) {
+        return (RenderState) gl.getContext().attachObject(thisKey, this);
+    }
 
-        return sb;
+    public final boolean detachFrom(final GL2ES2 gl) {
+        final RenderState _rs = (RenderState) gl.getContext().getAttachedObject(thisKey);
+        if(_rs == this) {
+            gl.getContext().detachObject(thisKey);
+            return true;
+        }
+        return false;
     }
 
     @Override
     public String toString() {
-        return toString(null, false).toString();
+        return "RenderState["+sp+"]";
     }
 }
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java
deleted file mode 100644
index 0292866..0000000
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/Renderer.java
+++ /dev/null
@@ -1,302 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.graph.curve.opengl;
-
-import java.nio.FloatBuffer;
-
-import javax.media.opengl.GL2ES2;
-import javax.media.opengl.GLException;
-import javax.media.opengl.fixedfunc.GLMatrixFunc;
-
-import com.jogamp.opengl.util.glsl.ShaderCode;
-import com.jogamp.opengl.util.glsl.ShaderState;
-import com.jogamp.opengl.util.PMVMatrix;
-
-import com.jogamp.graph.curve.Region;
-
-public abstract class Renderer {
-    protected static final boolean DEBUG = Region.DEBUG;
-    protected static final boolean DEBUG_INSTANCE = Region.DEBUG_INSTANCE;
-
-    public static boolean isWeightValid(float v) {
-        return 0.0f <= v && v <= 1.9f ;
-    }
-
-    protected final int renderModes;
-    protected int vp_width;
-    protected int vp_height;
-    protected boolean initialized;
-    protected final RenderState rs;
-    private boolean vboSupported = false;
-
-    public final boolean isInitialized() { return initialized; }
-
-    public final int getWidth() { return vp_width; }
-    public final int getHeight() { return vp_height; }
-
-    public float getWeight() { return rs.getWeight().floatValue(); }
-    public float getAlpha() { return rs.getAlpha().floatValue(); }
-    public final PMVMatrix getMatrix() { return rs.pmvMatrix(); }
-
-    /**
-     * Implementation shall load, compile and link the shader program and leave it active.
-     * @param gl referencing the current GLContext to which the ShaderState is bound to
-     * @return
-     */
-    protected abstract boolean initShaderProgram(GL2ES2 gl);
-
-    protected abstract void destroyImpl(GL2ES2 gl);
-
-    /**
-     * @param rs the used {@link RenderState}
-     * @param renderModes bit-field of modes
-     */
-    protected Renderer(RenderState rs, int renderModes) {
-        this.rs = rs;
-        this.renderModes = renderModes;
-    }
-
-    public final int getRenderModes() {
-        return renderModes;
-    }
-
-    public boolean usesVariableCurveWeight() { return Region.isNonUniformWeight(renderModes); }
-
-    /**
-     * @return true if Region's renderModes contains all bits as this Renderer's renderModes
-     *         except {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, otherwise false.
-     */
-    public final boolean areRenderModesCompatible(Region region) {
-        final int cleanRenderModes = getRenderModes() & ( Region.VARIABLE_CURVE_WEIGHT_BIT );
-        return cleanRenderModes == ( region.getRenderModes() & cleanRenderModes );
-    }
-
-    public final boolean isVBOSupported() { return vboSupported; }
-
-    /**
-     * Initialize shader and bindings for GPU based rendering bound to the given GL object's GLContext
-     * if not initialized yet.
-     * <p>Leaves the renderer enabled, ie ShaderState.</p>
-     * <p>Shall be called by a {@code draw()} method, e.g. {@link RegionRenderer#draw(GL2ES2, Region, float[], int)}</p>
-     *
-     * @param gl referencing the current GLContext to which the ShaderState is bound to
-     * @throws GLException if initialization failed
-     */
-    public final void init(GL2ES2 gl) throws GLException {
-        if(initialized){
-            return;
-        }
-        vboSupported =  gl.isFunctionAvailable("glGenBuffers") &&
-                        gl.isFunctionAvailable("glBindBuffer") &&
-                        gl.isFunctionAvailable("glBufferData") &&
-                        gl.isFunctionAvailable("glDrawElements") &&
-                        gl.isFunctionAvailable("glVertexAttribPointer") &&
-                        gl.isFunctionAvailable("glDeleteBuffers");
-
-        if(DEBUG) {
-            System.err.println("TextRendererImpl01: VBO Supported = " + isVBOSupported());
-        }
-
-        if(!vboSupported){
-            throw new GLException("VBO not supported");
-        }
-
-        rs.attachTo(gl);
-
-        gl.glEnable(GL2ES2.GL_BLEND);
-        gl.glBlendFunc(GL2ES2.GL_SRC_ALPHA, GL2ES2.GL_ONE_MINUS_SRC_ALPHA); // FIXME: alpha blending stage ?
-
-        initialized = initShaderProgram(gl);
-        if(!initialized) {
-            throw new GLException("Shader initialization failed");
-        }
-
-        if(!rs.getShaderState().uniform(gl, rs.getPMVMatrix())) {
-            throw new GLException("Error setting PMVMatrix in shader: "+rs.getShaderState());
-        }
-
-        if( Region.isNonUniformWeight( getRenderModes() ) ) {
-            if(!rs.getShaderState().uniform(gl, rs.getWeight())) {
-                throw new GLException("Error setting weight in shader: "+rs.getShaderState());
-            }
-        }
-
-        if(!rs.getShaderState().uniform(gl, rs.getAlpha())) {
-            throw new GLException("Error setting global alpha in shader: "+rs.getShaderState());
-        }
-
-        if(!rs.getShaderState().uniform(gl, rs.getColorStatic())) {
-            throw new GLException("Error setting global color in shader: "+rs.getShaderState());
-        }
-    }
-
-    public final void flushCache(GL2ES2 gl) {
-        // FIXME: REMOVE !
-    }
-
-    public void destroy(GL2ES2 gl) {
-        if(!initialized){
-            if(DEBUG_INSTANCE) {
-                System.err.println("TextRenderer: Not initialized!");
-            }
-            return;
-        }
-        rs.getShaderState().useProgram(gl, false);
-        destroyImpl(gl);
-        rs.destroy(gl);
-        initialized = false;
-    }
-
-    public final RenderState getRenderState() { return rs; }
-    public final ShaderState getShaderState() { return rs.getShaderState(); }
-
-    public final void enable(GL2ES2 gl, boolean enable) {
-        rs.getShaderState().useProgram(gl, enable);
-    }
-
-    public void setWeight(GL2ES2 gl, float v) {
-        if( !isWeightValid(v) ) {
-        	 throw new IllegalArgumentException("Weight out of range");
-        }
-        rs.getWeight().setData(v);
-        if(null != gl && rs.getShaderState().inUse() && Region.isNonUniformWeight( getRenderModes() ) ) {
-            rs.getShaderState().uniform(gl, rs.getWeight());
-        }
-    }
-
-    public void setAlpha(GL2ES2 gl, float alpha_t) {
-        rs.getAlpha().setData(alpha_t);
-        if(null != gl && rs.getShaderState().inUse()) {
-            rs.getShaderState().uniform(gl, rs.getAlpha());
-        }
-
-    }
-
-    public void getColorStatic(GL2ES2 gl, float[] rgb) {
-        FloatBuffer fb = (FloatBuffer) rs.getColorStatic().getBuffer();
-        rgb[0] = fb.get(0);
-        rgb[1] = fb.get(1);
-        rgb[2] = fb.get(2);
-    }
-
-    public void setColorStatic(GL2ES2 gl, float r, float g, float b){
-        FloatBuffer fb = (FloatBuffer) rs.getColorStatic().getBuffer();
-        fb.put(0, r);
-        fb.put(1, g);
-        fb.put(2, b);
-        if(null != gl && rs.getShaderState().inUse()) {
-            rs.getShaderState().uniform(gl, rs.getColorStatic());
-        }
-    }
-
-    public void rotate(GL2ES2 gl, float angle, float x, float y, float z) {
-        rs.pmvMatrix().glRotatef(angle, x, y, z);
-        updateMatrix(gl);
-    }
-
-    public void translate(GL2ES2 gl, float x, float y, float z) {
-        rs.pmvMatrix().glTranslatef(x, y, z);
-        updateMatrix(gl);
-    }
-
-    public void scale(GL2ES2 gl, float x, float y, float z) {
-        rs.pmvMatrix().glScalef(x, y, z);
-        updateMatrix(gl);
-    }
-
-    public void resetModelview(GL2ES2 gl) {
-        rs.pmvMatrix().glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
-        rs.pmvMatrix().glLoadIdentity();
-        updateMatrix(gl);
-    }
-
-    public void updateMatrix(GL2ES2 gl) {
-        if(initialized && null != gl && rs.getShaderState().inUse()) {
-            rs.getShaderState().uniform(gl, rs.getPMVMatrix());
-        }
-    }
-
-    /** No PMVMatrix operation is performed here. PMVMatrix will be updated if gl is not null. */
-    public boolean reshapeNotify(GL2ES2 gl, int width, int height) {
-        this.vp_width = width;
-        this.vp_height = height;
-        updateMatrix(gl);
-        return true;
-    }
-
-    public boolean reshapePerspective(GL2ES2 gl, float angle, int width, int height, float near, float far) {
-        this.vp_width = width;
-        this.vp_height = height;
-        final float ratio = (float)width/(float)height;
-        final PMVMatrix p = rs.pmvMatrix();
-        p.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
-        p.glLoadIdentity();
-        p.gluPerspective(angle, ratio, near, far);
-        updateMatrix(gl);
-        return true;
-    }
-
-    public boolean reshapeOrtho(GL2ES2 gl, int width, int height, float near, float far) {
-        this.vp_width = width;
-        this.vp_height = height;
-        final PMVMatrix p = rs.pmvMatrix();
-        p.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
-        p.glLoadIdentity();
-        p.glOrthof(0, width, 0, height, near, far);
-        updateMatrix(gl);
-        return true;
-    }
-
-    protected String getVertexShaderName() {
-        return "curverenderer" + getImplVersion();
-    }
-
-    protected String getFragmentShaderName() {
-        final String version = getImplVersion();
-        final String pass = Region.isVBAA(renderModes) ? "-2pass" : "-1pass" ;
-        final String weight = Region.isNonUniformWeight(renderModes) ? "-weight" : "" ;
-        return "curverenderer" + version + pass + weight;
-    }
-
-    // FIXME: Really required to have sampler2D def. precision ? If not, we can drop getFragmentShaderPrecision(..) and use default ShaderCode ..
-    public static final String es2_precision_fp = "\nprecision mediump float;\nprecision mediump int;\nprecision mediump sampler2D;\n";
-
-    protected String getFragmentShaderPrecision(GL2ES2 gl) {
-        if( gl.isGLES() ) {
-            return es2_precision_fp;
-        }
-        if( ShaderCode.requiresGL3DefaultPrecision(gl) ) {
-            return ShaderCode.gl3_default_precision_fp;
-        }
-        return null;
-    }
-
-    protected String getImplVersion() {
-        return "01";
-    }
-}
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
new file mode 100644
index 0000000..0fa1f49
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRegionUtil.java
@@ -0,0 +1,351 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.graph.curve.opengl;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GLException;
+
+import jogamp.graph.geom.plane.AffineTransform;
+
+import com.jogamp.graph.curve.OutlineShape;
+import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.font.Font;
+import com.jogamp.graph.font.Font.Glyph;
+import com.jogamp.graph.geom.Vertex;
+import com.jogamp.graph.geom.Vertex.Factory;
+
+/**
+ * Text {@link GLRegion} Utility Class
+ */
+public class TextRegionUtil {
+
+    public final int renderModes;
+
+    public TextRegionUtil(final int renderModes) {
+        this.renderModes = renderModes;
+    }
+
+    public static interface ShapeVisitor {
+        /**
+         * Visiting the given {@link OutlineShape} with it's corresponding {@link AffineTransform}.
+         * @param shape may be used as is, otherwise a copy shall be made if intended to be modified.
+         * @param t may be used immediately as is, otherwise a copy shall be made if stored.
+         */
+        public void visit(final OutlineShape shape, final AffineTransform t);
+    }
+
+    public static int getCharCount(final String s, final char c) {
+        final int sz = s.length();
+        int count = 0;
+        for(int i=0; i<sz; i++) {
+            if( s.charAt(i) == c ) {
+                count++;
+            }
+        }
+        return count;
+    }
+
+    /**
+     * Visit each {@link Font.Glyph}'s {@link OutlineShape} with the given {@link ShapeVisitor}
+     * additionally passing the progressed {@link AffineTransform}.
+     * The latter reflects the given font metric, pixelSize and hence character position.
+     * @param visitor
+     * @param transform optional given transform
+     * @param font the target {@link Font}
+     * @param pixelSize Use {@link Font#getPixelSize(float, float)} for resolution correct pixel-size.
+     * @param str string text
+     * @param temp1 temporary AffineTransform storage, mandatory, will be passed to {@link ShapeVisitor#visit(OutlineShape, AffineTransform)} and can be modified.
+     * @param temp2 temporary AffineTransform storage, mandatory, can be re-used in {@link ShapeVisitor#visit(OutlineShape, AffineTransform)} by user code.
+     */
+    public static void processString(final ShapeVisitor visitor, final AffineTransform transform,
+                                     final Font font, final float pixelSize, final CharSequence str,
+                                     final AffineTransform temp1, final AffineTransform temp2) {
+        final int charCount = str.length();
+
+        // region.setFlipped(true);
+        final Font.Metrics metrics = font.getMetrics();
+        final float lineHeight = font.getLineHeight(pixelSize);
+
+        final float scale = metrics.getScale(pixelSize);
+
+        float y = 0;
+        float advanceTotal = 0;
+
+        for(int i=0; i< charCount; i++) {
+            final char character = str.charAt(i);
+            if( '\n' == character ) {
+                y -= lineHeight;
+                advanceTotal = 0;
+            } else if (character == ' ') {
+                advanceTotal += font.getAdvanceWidth(Glyph.ID_SPACE, pixelSize);
+            } else {
+                if(Region.DEBUG_INSTANCE) {
+                    System.err.println("XXXXXXXXXXXXXXx char: "+character+", scale: "+scale+"; translate: "+advanceTotal+", "+y);
+                }
+                // reset transform
+                if( null != transform ) {
+                    temp1.setTransform(transform);
+                } else {
+                    temp1.setToIdentity();
+                }
+                temp1.translate(advanceTotal, y, temp2);
+                temp1.scale(scale, scale, temp2);
+
+                final Font.Glyph glyph = font.getGlyph(character);
+                final OutlineShape glyphShape = glyph.getShape();
+                if( null == glyphShape ) {
+                    continue;
+                }
+                visitor.visit(glyphShape, temp1);
+
+                advanceTotal += glyph.getAdvance(pixelSize, true);
+            }
+        }
+    }
+
+    /**
+     * Add the string in 3D space w.r.t. the font and pixelSize at the end of the {@link GLRegion}.
+     * @param region the {@link GLRegion} sink
+     * @param vertexFactory vertex impl factory {@link Factory}
+     * @param font the target {@link Font}
+     * @param pixelSize Use {@link Font#getPixelSize(float, float)} for resolution correct pixel-size.
+     * @param str string text
+     * @param rgbaColor if {@link Region#hasColorChannel()} RGBA color must be passed, otherwise value is ignored.
+     * @param temp1 temporary AffineTransform storage, mandatory
+     * @param temp2 temporary AffineTransform storage, mandatory
+     */
+    public static void addStringToRegion(final GLRegion region, final Factory<? extends Vertex> vertexFactory,
+                                         final Font font, final float pixelSize, final CharSequence str, final float[] rgbaColor,
+                                         final AffineTransform temp1, final AffineTransform temp2) {
+        final ShapeVisitor visitor = new ShapeVisitor() {
+            public final void visit(final OutlineShape shape, final AffineTransform t) {
+                region.addOutlineShape(shape, t, region.hasColorChannel() ? rgbaColor : null);
+            } };
+        processString(visitor, null, font, pixelSize, str, temp1, temp2);
+    }
+
+    /**
+     * Render the string in 3D space w.r.t. the font and pixelSize
+     * using a cached {@link GLRegion} for reuse.
+     * <p>
+     * Cached {@link GLRegion}s will be destroyed w/ {@link #clear(GL2ES2)} or to free memory.
+     * </p>
+     * @param gl the current GL state
+     * @param renderer TODO
+     * @param font {@link Font} to be used
+     * @param pixelSize Use {@link Font#getPixelSize(float, float)} for resolution correct pixel-size.
+     * @param str text to be rendered
+     * @param rgbaColor if {@link Region#hasColorChannel()} RGBA color must be passed, otherwise value is ignored.
+     * @param sampleCount desired multisampling sample count for msaa-rendering.
+     *        The actual used scample-count is written back when msaa-rendering is enabled, otherwise the store is untouched.
+     * @throws Exception if TextRenderer not initialized
+     */
+    public void drawString3D(final GL2ES2 gl,
+                             final RegionRenderer renderer, final Font font, final float pixelSize,
+                             final CharSequence str, final float[] rgbaColor, final int[/*1*/] sampleCount) {
+        if( !renderer.isInitialized() ) {
+            throw new GLException("TextRendererImpl01: not initialized!");
+        }
+        final int special = 0;
+        GLRegion region = getCachedRegion(font, str, pixelSize, special);
+        if(null == region) {
+            region = GLRegion.create(renderModes, null);
+            addStringToRegion(region, renderer.getRenderState().getVertexFactory(), font, pixelSize, str, rgbaColor, tempT1, tempT2);
+            addCachedRegion(gl, font, str, pixelSize, special, region);
+        }
+        region.draw(gl, renderer, sampleCount);
+    }
+
+    /**
+     * Render the string in 3D space w.r.t. the font and pixelSize
+     * using a temporary {@link GLRegion}, which will be destroyed afterwards.
+     * <p>
+     * In case of a multisampling region renderer, i.e. {@link Region#VBAA_RENDERING_BIT}, recreating the {@link GLRegion}
+     * is a huge performance impact.
+     * In such case better use {@link #drawString3D(GL2ES2, GLRegion, RegionRenderer, Font, float, CharSequence, float[], int[], AffineTransform, AffineTransform)}
+     * instead.
+     * </p>
+     * @param gl the current GL state
+     * @param renderModes TODO
+     * @param font {@link Font} to be used
+     * @param pixelSize Use {@link Font#getPixelSize(float, float)} for resolution correct pixel-size.
+     * @param str text to be rendered
+     * @param rgbaColor if {@link Region#hasColorChannel()} RGBA color must be passed, otherwise value is ignored.
+     * @param sampleCount desired multisampling sample count for msaa-rendering.
+     *        The actual used scample-count is written back when msaa-rendering is enabled, otherwise the store is untouched.
+     * @param temp1 temporary AffineTransform storage, mandatory
+     * @param temp2 temporary AffineTransform storage, mandatory
+     * @throws Exception if TextRenderer not initialized
+     */
+    public static void drawString3D(final GL2ES2 gl, final int renderModes,
+                                    final RegionRenderer renderer, final Font font, final float pixelSize,
+                                    final CharSequence str, final float[] rgbaColor, final int[/*1*/] sampleCount,
+                                    final AffineTransform temp1, final AffineTransform temp2) {
+        if(!renderer.isInitialized()){
+            throw new GLException("TextRendererImpl01: not initialized!");
+        }
+        final GLRegion region = GLRegion.create(renderModes, null);
+        addStringToRegion(region, renderer.getRenderState().getVertexFactory(), font, pixelSize, str, rgbaColor, temp1, temp2);
+        region.draw(gl, renderer, sampleCount);
+        region.destroy(gl);
+    }
+
+    /**
+     * Render the string in 3D space w.r.t. the font and pixelSize
+     * using the given {@link GLRegion}, which will {@link GLRegion#clear(GL2ES2) cleared} beforehand.
+     * @param gl the current GL state
+     * @param font {@link Font} to be used
+     * @param pixelSize Use {@link Font#getPixelSize(float, float)} for resolution correct pixel-size.
+     * @param str text to be rendered
+     * @param rgbaColor if {@link Region#hasColorChannel()} RGBA color must be passed, otherwise value is ignored.
+     * @param sampleCount desired multisampling sample count for msaa-rendering.
+     *        The actual used scample-count is written back when msaa-rendering is enabled, otherwise the store is untouched.
+     * @param temp1 temporary AffineTransform storage, mandatory
+     * @param temp2 temporary AffineTransform storage, mandatory
+     * @throws Exception if TextRenderer not initialized
+     */
+    public static void drawString3D(final GL2ES2 gl, final GLRegion region, final RegionRenderer renderer,
+                                    final Font font, final float pixelSize, final CharSequence str,
+                                    final float[] rgbaColor, final int[/*1*/] sampleCount,
+                                    final AffineTransform temp1, final AffineTransform temp2) {
+        if(!renderer.isInitialized()){
+            throw new GLException("TextRendererImpl01: not initialized!");
+        }
+        region.clear(gl);
+        addStringToRegion(region, renderer.getRenderState().getVertexFactory(), font, pixelSize, str, rgbaColor, temp1, temp2);
+        region.draw(gl, renderer, sampleCount);
+    }
+
+   /**
+    * Clear all cached {@link GLRegions}.
+    */
+   public void clear(final GL2ES2 gl) {
+       // fluchCache(gl) already called
+       final Iterator<GLRegion> iterator = stringCacheMap.values().iterator();
+       while(iterator.hasNext()){
+           final GLRegion region = iterator.next();
+           region.destroy(gl);
+       }
+       stringCacheMap.clear();
+       stringCacheArray.clear();
+   }
+
+   /**
+    * <p>Sets the cache limit for reusing GlyphString's and their Region.
+    * Default is {@link #DEFAULT_CACHE_LIMIT}, -1 unlimited, 0 turns cache off, >0 limited </p>
+    *
+    * <p>The cache will be validate when the next string rendering happens.</p>
+    *
+    * @param newLimit new cache size
+    *
+    * @see #DEFAULT_CACHE_LIMIT
+    */
+   public final void setCacheLimit(final int newLimit ) { stringCacheLimit = newLimit; }
+
+   /**
+    * Sets the cache limit, see {@link #setCacheLimit(int)} and validates the cache.
+    *
+    * @see #setCacheLimit(int)
+    *
+    * @param gl current GL used to remove cached objects if required
+    * @param newLimit new cache size
+    */
+   public final void setCacheLimit(final GL2ES2 gl, final int newLimit ) { stringCacheLimit = newLimit; validateCache(gl, 0); }
+
+   /**
+    * @return the current cache limit
+    */
+   public final int getCacheLimit() { return stringCacheLimit; }
+
+   /**
+    * @return the current utilized cache size, <= {@link #getCacheLimit()}
+    */
+   public final int getCacheSize() { return stringCacheArray.size(); }
+
+   protected final void validateCache(final GL2ES2 gl, final int space) {
+       if ( getCacheLimit() > 0 ) {
+           while ( getCacheSize() + space > getCacheLimit() ) {
+               removeCachedRegion(gl, 0);
+           }
+       }
+   }
+
+   protected final GLRegion getCachedRegion(final Font font, final CharSequence str, final float pixelSize, final int special) {
+       return stringCacheMap.get(getKey(font, str, pixelSize, special));
+   }
+
+   protected final void addCachedRegion(final GL2ES2 gl, final Font font, final CharSequence str, final float pixelSize, final int special, final GLRegion glyphString) {
+       if ( 0 != getCacheLimit() ) {
+           final String key = getKey(font, str, pixelSize, special);
+           final GLRegion oldRegion = stringCacheMap.put(key, glyphString);
+           if ( null == oldRegion ) {
+               // new entry ..
+               validateCache(gl, 1);
+               stringCacheArray.add(stringCacheArray.size(), key);
+           } /// else overwrite is nop ..
+       }
+   }
+
+   protected final void removeCachedRegion(final GL2ES2 gl, final Font font, final CharSequence str, final int pixelSize, final int special) {
+       final String key = getKey(font, str, pixelSize, special);
+       final GLRegion region = stringCacheMap.remove(key);
+       if(null != region) {
+           region.destroy(gl);
+       }
+       stringCacheArray.remove(key);
+   }
+
+   protected final void removeCachedRegion(final GL2ES2 gl, final int idx) {
+       final String key = stringCacheArray.remove(idx);
+       if( null != key ) {
+           final GLRegion region = stringCacheMap.remove(key);
+           if(null != region) {
+               region.destroy(gl);
+           }
+       }
+   }
+
+   protected final String getKey(final Font font, final CharSequence str, final float pixelSize, final int special) {
+       final StringBuilder sb = new StringBuilder();
+       return font.getName(sb, Font.NAME_UNIQUNAME)
+              .append(".").append(str.hashCode()).append(".").append(Float.floatToIntBits(pixelSize)).append(special).toString();
+   }
+
+   /** Default cache limit, see {@link #setCacheLimit(int)} */
+   public static final int DEFAULT_CACHE_LIMIT = 256;
+
+   public final AffineTransform tempT1 = new AffineTransform();
+   public final AffineTransform tempT2 = new AffineTransform();
+   private final HashMap<String, GLRegion> stringCacheMap = new HashMap<String, GLRegion>(DEFAULT_CACHE_LIMIT);
+   private final ArrayList<String> stringCacheArray = new ArrayList<String>(DEFAULT_CACHE_LIMIT);
+   private int stringCacheLimit = DEFAULT_CACHE_LIMIT;
+}
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java b/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java
deleted file mode 100644
index f6ce852..0000000
--- a/src/jogl/classes/com/jogamp/graph/curve/opengl/TextRenderer.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.graph.curve.opengl;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-
-import javax.media.opengl.GL2ES2;
-
-import jogamp.graph.curve.text.GlyphString;
-
-import com.jogamp.graph.font.Font;
-
-public abstract class TextRenderer extends Renderer {
-    /**
-     * Create a Hardware accelerated Text Renderer.
-     * @param rs the used {@link RenderState}
-     * @param renderModes either {@link com.jogamp.graph.curve.opengl.GLRegion#SINGLE_PASS} or {@link com.jogamp.graph.curve.Region#VBAA_RENDERING_BIT}
-     */
-    public static TextRenderer create(RenderState rs, int renderModes) {
-        return new jogamp.graph.curve.opengl.TextRendererImpl01(rs, renderModes);
-    }
-
-    protected TextRenderer(RenderState rs, int type) {
-        super(rs, type);
-    }
-
-
-    /** Render the String in 3D space wrt to the font provided at the position provided
-     * the outlines will be generated, if not yet generated
-     * @param gl the current GL state
-     * @param font {@link Font} to be used
-     * @param str text to be rendered
-     * @param position the lower left corner of the string
-     * @param fontSize font size
-     * @param texWidth desired texture width for multipass-rendering.
-     *        The actual used texture-width is written back when mp rendering is enabled, otherwise the store is untouched.
-     * @throws Exception if TextRenderer not initialized
-     */
-    public abstract void drawString3D(GL2ES2 gl, Font font,
-                                      String str, float[] position, int fontSize, int[/*1*/] texSize);
-
-    /**Create the resulting {@link GlyphString} that represents
-     * the String wrt to the font.
-     * @param font {@link Font} to be used
-     * @param size font size
-     * @param str {@link String} to be created
-     * @return the resulting GlyphString inclusive the generated region
-     */
-    public GlyphString createString(GL2ES2 gl, Font font, int size, String str) {
-        if(DEBUG_INSTANCE) {
-            System.err.println("createString: "+getCacheSize()+"/"+getCacheLimit()+" - "+Font.NAME_UNIQUNAME + " - " + str + " - " + size);
-        }
-        final GlyphString glyphString = GlyphString.createString(null, rs.getVertexFactory(), font, size, str);
-        glyphString.createRegion(gl, renderModes);
-        return glyphString;
-    }
-
-    /** FIXME
-   public void flushCache(GL2ES2 gl) {
-       Iterator<GlyphString> iterator = stringCacheMap.values().iterator();
-       while(iterator.hasNext()){
-           GlyphString glyphString = iterator.next();
-           glyphString.destroy(gl, rs);
-       }
-       stringCacheMap.clear();
-       stringCacheArray.clear();
-   } */
-
-   @Override
-   protected void destroyImpl(GL2ES2 gl) {
-       // fluchCache(gl) already called
-       Iterator<GlyphString> iterator = stringCacheMap.values().iterator();
-       while(iterator.hasNext()){
-           GlyphString glyphString = iterator.next();
-           glyphString.destroy(gl, rs);
-       }
-       stringCacheMap.clear();
-       stringCacheArray.clear();
-   }
-
-   /**
-    * <p>Sets the cache limit for reusing GlyphString's and their Region.
-    * Default is {@link #DEFAULT_CACHE_LIMIT}, -1 unlimited, 0 turns cache off, >0 limited </p>
-    *
-    * <p>The cache will be validate when the next string rendering happens.</p>
-    *
-    * @param newLimit new cache size
-    *
-    * @see #DEFAULT_CACHE_LIMIT
-    */
-   public final void setCacheLimit(int newLimit ) { stringCacheLimit = newLimit; }
-
-   /**
-    * Sets the cache limit, see {@link #setCacheLimit(int)} and validates the cache.
-    *
-    * @see #setCacheLimit(int)
-    *
-    * @param gl current GL used to remove cached objects if required
-    * @param newLimit new cache size
-    */
-   public final void setCacheLimit(GL2ES2 gl, int newLimit ) { stringCacheLimit = newLimit; validateCache(gl, 0); }
-
-   /**
-    * @return the current cache limit
-    */
-   public final int getCacheLimit() { return stringCacheLimit; }
-
-   /**
-    * @return the current utilized cache size, <= {@link #getCacheLimit()}
-    */
-   public final int getCacheSize() { return stringCacheArray.size(); }
-
-   protected final void validateCache(GL2ES2 gl, int space) {
-       if ( getCacheLimit() > 0 ) {
-           while ( getCacheSize() + space > getCacheLimit() ) {
-               removeCachedGlyphString(gl, 0);
-           }
-       }
-   }
-
-   protected final GlyphString getCachedGlyphString(Font font, String str, int fontSize) {
-       return stringCacheMap.get(getKey(font, str, fontSize));
-   }
-
-   protected final void addCachedGlyphString(GL2ES2 gl, Font font, String str, int fontSize, GlyphString glyphString) {
-       if ( 0 != getCacheLimit() ) {
-           final String key = getKey(font, str, fontSize);
-           GlyphString oldGlyphString = stringCacheMap.put(key, glyphString);
-           if ( null == oldGlyphString ) {
-               // new entry ..
-               validateCache(gl, 1);
-               stringCacheArray.add(stringCacheArray.size(), key);
-           } /// else overwrite is nop ..
-       }
-   }
-
-   protected final void removeCachedGlyphString(GL2ES2 gl, Font font, String str, int fontSize) {
-       final String key = getKey(font, str, fontSize);
-       GlyphString glyphString = stringCacheMap.remove(key);
-       if(null != glyphString) {
-           glyphString.destroy(gl, rs);
-       }
-       stringCacheArray.remove(key);
-   }
-
-   protected final void removeCachedGlyphString(GL2ES2 gl, int idx) {
-       final String key = stringCacheArray.remove(idx);
-       final GlyphString glyphString = stringCacheMap.remove(key);
-       if(null != glyphString) {
-           glyphString.destroy(gl, rs);
-       }
-   }
-
-   protected final String getKey(Font font, String str, int fontSize) {
-       final StringBuilder sb = new StringBuilder();
-       return font.getName(sb, Font.NAME_UNIQUNAME)
-              .append(".").append(str.hashCode()).append(".").append(fontSize).toString();
-   }
-
-   /** Default cache limit, see {@link #setCacheLimit(int)} */
-   public static final int DEFAULT_CACHE_LIMIT = 256;
-
-   private HashMap<String, GlyphString> stringCacheMap = new HashMap<String, GlyphString>(DEFAULT_CACHE_LIMIT);
-   private ArrayList<String> stringCacheArray = new ArrayList<String>(DEFAULT_CACHE_LIMIT);
-   private int stringCacheLimit = DEFAULT_CACHE_LIMIT;
-}
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulator.java b/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulator.java
index 4e8c400..20fe9bf 100644
--- a/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulator.java
+++ b/src/jogl/classes/com/jogamp/graph/curve/tess/Triangulator.java
@@ -28,7 +28,7 @@
 
 package com.jogamp.graph.curve.tess;
 
-import java.util.ArrayList;
+import java.util.List;
 
 import com.jogamp.graph.geom.Outline;
 import com.jogamp.graph.geom.Triangle;
@@ -49,21 +49,29 @@ import com.jogamp.graph.geom.Triangle;
  */
 public interface Triangulator {
 
-    /** Add a curve to the list of Outlines
+    /**
+     * Add a curve to the list of Outlines
      * describing the shape
+     * @param sink list where the generated triangles will be added
      * @param outline a bounding {@link Outline}
+     * @param sharpness TODO
      */
-    public void addCurve(Outline outline);
+    public void addCurve(List<Triangle> sink, Outline outline, float sharpness);
 
     /** Generate the triangulation of the provided
      *  List of {@link Outline}s
-     * @return an arraylist of {@link Triangle}s resembling the
-     * final shape.
+     * @param sink list where the generated triangles will be added
      */
-    public ArrayList<Triangle> generate();
+    public void generate(List<Triangle> sink);
 
-    /** Reset the triangulation to initial state
-     *  Clearing cached data
+    /**
+     * Reset the triangulation to initial state
+     * Clearing cached data
      */
     public void reset();
+
+    /**
+     * Return the number of newly added vertices during {@link #addCurve(List, Outline, float)}.
+     */
+    public int getAddedVerticeCount();
 }
diff --git a/src/jogl/classes/com/jogamp/graph/font/Font.java b/src/jogl/classes/com/jogamp/graph/font/Font.java
index a4a8fd5..92d3576 100644
--- a/src/jogl/classes/com/jogamp/graph/font/Font.java
+++ b/src/jogl/classes/com/jogamp/graph/font/Font.java
@@ -1,5 +1,5 @@
 /**
- * Copyright 2010 JogAmp Community. All rights reserved.
+// * Copyright 2010 JogAmp Community. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
@@ -27,16 +27,35 @@
  */
 package com.jogamp.graph.font;
 
+import jogamp.graph.geom.plane.AffineTransform;
+
+import com.jogamp.graph.curve.OutlineShape;
 import com.jogamp.opengl.math.geom.AABBox;
 
 /**
  * Interface wrapper for font implementation.
- *
+ * <p>
  * TrueType Font Specification:
- *   http://developer.apple.com/fonts/ttrefman/rm06/Chap6.html
- *
+ * <ul>
+ *   <li>http://www.freetype.org/freetype2/documentation.html</li>
+ *   <li>http://developer.apple.com/fonts/ttrefman/rm06/Chap6.html</li>
+ *   <li>http://www.microsoft.com/typography/SpecificationsOverview.mspx</li>
+ *   <li>http://www.microsoft.com/typography/otspec/</li>
+ * </ul>
+ * </p>
+ * <p>
  * TrueType Font Table Introduction:
- *   http://scripts.sil.org/cms/scripts/page.php?item_id=IWS-Chapter08
+ * <ul>
+ *   <li>http://scripts.sil.org/cms/scripts/page.php?item_id=IWS-Chapter08</li>
+ * </ul>
+ * </p>
+ * <p>
+ * Misc.:
+ * <ul>
+ *   <li>Treatis on Font <code>Rasterization https://freddie.witherden.org/pages/font-rasterisation/</code></li>
+ *   <li>Glyph Hell <code>http://walon.org/pub/ttf/ttf_glyphs.htm</code></li>
+ * </ul>
+ * </p>
  */
 
 public interface Font {
@@ -62,16 +81,26 @@ public interface Font {
      * Horizontal http://developer.apple.com/fonts/TTRefMan/RM06/Chap6hhea.html
      */
     public interface Metrics {
-        float getAscent(float pixelSize);
-        float getDescent(float pixelSize);
-        float getLineGap(float pixelSize);
-        float getMaxExtend(float pixelSize);
-        float getScale(float pixelSize);
-        AABBox getBBox(float pixelSize);
+        float getAscent(final float pixelSize);
+        float getDescent(final float pixelSize);
+        float getLineGap(final float pixelSize);
+        float getMaxExtend(final float pixelSize);
+        float getScale(final float pixelSize);
+        /**
+         * @param dest AABBox instance set to this metrics boundary w/ given pixelSize
+         * @param pixelSize
+         * @param tmpV3 caller provided temporary 3-component vector
+         * @return the given and set AABBox 'dest'
+         */
+        AABBox getBBox(final AABBox dest, final float pixelSize, final float[] tmpV3);
     }
 
     /**
      * Glyph for font
+     *
+     * http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6cmap.html
+     * http://developer.apple.com/textfonts/TTRefMan/RM06/Chap6glyf.html
+     * http://www.microsoft.com/typography/otspec/glyf.htm
      */
     public interface Glyph {
         // reserved special glyph IDs
@@ -82,33 +111,81 @@ public interface Font {
 
         public Font getFont();
         public char getSymbol();
-        public AABBox getBBox(float pixelSize);
-        public float getAdvance(float pixelSize, boolean useFrationalMetrics);
+        public short getID();
+        public AABBox getBBox();
+        public float getScale(final float pixelSize);
+        /**
+         * @param dest AABBox instance set to this metrics boundary w/ given pixelSize
+         * @param pixelSize
+         * @param tmpV3 caller provided temporary 3-component vector
+         * @return the given and set AABBox 'dest'
+         */
+        public AABBox getBBox(final AABBox dest, final float pixelSize, float[] tmpV3);
+        public float getAdvance(final float pixelSize, boolean useFrationalMetrics);
+        public OutlineShape getShape();
+        public int hashCode();
     }
 
 
-    public String getName(int nameIndex);
-    public StringBuilder getName(StringBuilder string, int nameIndex);
+    public String getName(final int nameIndex);
+    public StringBuilder getName(final StringBuilder string, final int nameIndex);
 
     /** Shall return the family and subfamily name, separated a dash.
      * <p>{@link #getName(StringBuilder, int)} w/ {@link #NAME_FAMILY} and {@link #NAME_SUBFAMILY}</p>
      * <p>Example: "{@code Ubuntu-Regular}"</p>  */
-    public StringBuilder getFullFamilyName(StringBuilder buffer);
+    public StringBuilder getFullFamilyName(final StringBuilder buffer);
+
+    public StringBuilder getAllNames(final StringBuilder string, final String separator);
 
-    public StringBuilder getAllNames(StringBuilder string, String separator);
+    /**
+     * <pre>
+        Font Scale Formula:
+         inch: 25.4 mm
+         pointSize: [point] = [1/72 inch]
+
+         [1]      Scale := pointSize * resolution / ( 72 points per inch * units_per_em )
+         [2]  PixelSize := pointSize * resolution / ( 72 points per inch )
+         [3]      Scale := PixelSize / units_per_em
+     * </pre>
+     * @param fontSize in point-per-inch
+     * @param resolution display resolution in dots-per-inch
+     * @return pixel-per-inch, pixelSize scale factor for font operations.
+     */
+    public float getPixelSize(final float fontSize /* points per inch */, final float resolution);
 
-    public float getAdvanceWidth(int i, float pixelSize);
+    public float getAdvanceWidth(final int glyphID, final float pixelSize);
     public Metrics getMetrics();
-    public Glyph getGlyph(char symbol);
+    public Glyph getGlyph(final char symbol);
     public int getNumGlyphs();
 
-    public float getStringWidth(CharSequence string, float pixelSize);
-    public float getStringHeight(CharSequence string, float pixelSize);
-    public AABBox getStringBounds(CharSequence string, float pixelSize);
+    public float getLineHeight(final float pixelSize);
+    public float getMetricWidth(final CharSequence string, final float pixelSize);
+    public float getMetricHeight(final CharSequence string, final float pixelSize, final AABBox tmp);
+    /**
+     * Return the <i>layout</i> bounding box as computed by each glyph's metrics.
+     * The result is not pixel correct, bit reflects layout specific metrics.
+     * <p>
+     * See {@link #getPointsBounds(AffineTransform, CharSequence, float, AffineTransform, AffineTransform)} for pixel correct results.
+     * </p>
+     * @param string string text
+     * @param pixelSize Use {@link Font#getPixelSize(float, float)} for resolution correct pixel-size.
+     */
+    public AABBox getMetricBounds(final CharSequence string, final float pixelSize);
+
+    /**
+     * Return the bounding box by taking each glyph's point-based bounding box into account.
+     * @param transform optional given transform
+     * @param string string text
+     * @param pixelSize Use {@link Font#getPixelSize(float, float)} for resolution correct pixel-size.
+     * @param temp1 temporary AffineTransform storage, mandatory
+     * @param temp2 temporary AffineTransform storage, mandatory
+     */
+    public AABBox getPointsBounds(final AffineTransform transform, final CharSequence string, final float pixelSize,
+                                  final AffineTransform temp1, final AffineTransform temp2);
 
-    public boolean isPrintableChar( char c );
+    public boolean isPrintableChar(final char c);
 
     /** Shall return {@link #getFullFamilyName()} */
     @Override
     public String toString();
-}
\ No newline at end of file
+}
diff --git a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
index 884662e..db775e8 100644
--- a/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
+++ b/src/jogl/classes/com/jogamp/graph/font/FontFactory.java
@@ -29,10 +29,13 @@ package com.jogamp.graph.font;
 
 import java.io.File;
 import java.io.IOException;
+import java.net.URI;
 import java.net.URLConnection;
 
+import com.jogamp.common.util.IOUtil;
 import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.common.util.ReflectionUtil;
+import com.jogamp.common.util.cache.TempJarCache;
 
 import jogamp.graph.font.FontConstructor;
 import jogamp.graph.font.JavaFontLoader;
@@ -50,10 +53,10 @@ public class FontFactory {
     private static final String FontConstructorPropKey = "jogamp.graph.font.ctor";
     private static final String DefaultFontConstructor = "jogamp.graph.font.typecast.TypecastFontConstructor";
 
-    /** Ubuntu is the default font family */
+    /** Ubuntu is the default font family, {@value} */
     public static final int UBUNTU = 0;
 
-    /** Java fonts are optional */
+    /** Java fonts are optional, {@value} */
     public static final int JAVA = 1;
 
     private static final FontConstructor fontConstr;
@@ -75,7 +78,7 @@ public class FontFactory {
         return get(UBUNTU);
     }
 
-    public static final FontSet get(int font) {
+    public static final FontSet get(final int font) {
         switch (font) {
             case JAVA:
                 return JavaFontLoader.get();
@@ -84,7 +87,7 @@ public class FontFactory {
         }
     }
 
-    public static final Font get(File file) throws IOException {
+    public static final Font get(final File file) throws IOException {
         return fontConstr.create(file);
     }
 
@@ -92,7 +95,25 @@ public class FontFactory {
         return fontConstr.create(conn);
     }
 
-    public static boolean isPrintableChar( char c ) {
+    public static final Font get(final Class<?> context, final String fname, final boolean useTempJarCache) throws IOException {
+        URLConnection conn = null;
+        if( useTempJarCache ) {
+            try {
+                final URI uri = TempJarCache.getResource(fname);
+                conn = null != uri ? uri.toURL().openConnection() : null;
+            } catch (final Exception e) {
+                throw new IOException(e);
+            }
+        } else {
+            conn = IOUtil.getResource(context, fname);
+        }
+        if(null != conn) {
+            return FontFactory.get ( conn ) ;
+        }
+        return null;
+    }
+
+    public static boolean isPrintableChar( final char c ) {
         if( Character.isWhitespace(c) ) {
             return true;
         }
diff --git a/src/jogl/classes/com/jogamp/graph/font/FontSet.java b/src/jogl/classes/com/jogamp/graph/font/FontSet.java
index 17b8b21..60a16b2 100644
--- a/src/jogl/classes/com/jogamp/graph/font/FontSet.java
+++ b/src/jogl/classes/com/jogamp/graph/font/FontSet.java
@@ -32,30 +32,38 @@ import java.io.IOException;
 
 public interface FontSet {
 
-    /** Font family REGULAR **/
+    /** Font family REGULAR, {@value} **/
     public static final int FAMILY_REGULAR    = 0;
 
-    /** Font family LIGHT **/
+    /** Font family LIGHT, {@value} **/
     public static final int FAMILY_LIGHT      = 1;
 
-    /** Font family MEDIUM **/
+    /** Font family MEDIUM, {@value} **/
     public static final int FAMILY_MEDIUM     = 2;
 
-    /** Font family CONDENSED **/
+    /** Font family CONDENSED, {@value} **/
     public static final int FAMILY_CONDENSED  = 3;
 
-    /** Font family MONO **/
+    /** Font family MONO, {@value} **/
     public static final int FAMILY_MONOSPACED = 4;
 
-    /** SERIF style/family bit flag. Fallback to Sans Serif. */
+    /** Zero style, {@value} */
+    public static final int STYLE_NONE        = 0;
+
+    /** SERIF style/family bit flag. Fallback to Sans Serif, {@value} */
     public static final int STYLE_SERIF       = 1 << 1;
 
-    /** BOLD style bit flag */
+    /** BOLD style bit flag, {@value} */
     public static final int STYLE_BOLD        = 1 << 2;
 
-    /** ITALIC style bit flag */
+    /** ITALIC style bit flag, {@value} */
     public static final int STYLE_ITALIC      = 1 << 3;
 
+    /**
+     * Returns the family {@link #FAMILY_REGULAR} with {@link #STYLE_NONE}
+     * as retrieved with {@link #get(int, int)}.
+     * @throws IOException
+     */
     Font getDefault() throws IOException ;
 
     Font get(int family, int stylebits) throws IOException ;
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Outline.java b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
index 77a3180..4caf06e 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Outline.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Outline.java
@@ -29,7 +29,10 @@ package com.jogamp.graph.geom;
 
 import java.util.ArrayList;
 
+import jogamp.graph.geom.plane.AffineTransform;
+
 import com.jogamp.graph.geom.Vertex;
+import com.jogamp.opengl.math.FloatUtil;
 import com.jogamp.opengl.math.VectorUtil;
 import com.jogamp.opengl.math.geom.AABBox;
 
@@ -44,45 +47,64 @@ import com.jogamp.opengl.math.geom.AABBox;
  *
  *  @see OutlineShape, Region
  */
-public class Outline implements Cloneable, Comparable<Outline> {
+public class Outline implements Comparable<Outline> {
 
-    private ArrayList<Vertex> vertices = new ArrayList<Vertex>(3);
-    private boolean closed = false;
-    private AABBox bbox = new AABBox();
-    private boolean dirtyBBox = false;
+    private ArrayList<Vertex> vertices;
+    private boolean closed;
+    private final AABBox bbox;
+    private boolean dirtyBBox;
 
     /**Create an outline defined by control vertices.
      * An outline can contain off Curve vertices which define curved
      * regions in the outline.
      */
     public Outline() {
+        vertices = new ArrayList<Vertex>(3);
+        closed = false;
+        bbox = new AABBox();
+        dirtyBBox = false;
+    }
+
+    /**
+     * Copy ctor
+     */
+    public Outline(final Outline src) {
+        vertices = new ArrayList<Vertex>(src.vertices.size());
+        for(int i=0; i<vertices.size(); i++) {
+            vertices.add( src.vertices.get(i).clone() );
+        }
+        closed = src.closed;
+        bbox = new AABBox(src.bbox);
+        dirtyBBox = src.dirtyBBox;
     }
 
     public final int getVertexCount() {
         return vertices.size();
     }
 
-    /** Appends a vertex to the outline loop/strip.
+    /**
+     * Appends a vertex to the outline loop/strip.
      * @param vertex Vertex to be added
      * @throws NullPointerException if the  {@link Vertex} element is null
      */
-    public final void addVertex(Vertex vertex) throws NullPointerException {
+    public final void addVertex(final Vertex vertex) throws NullPointerException {
         addVertex(vertices.size(), vertex);
     }
 
-    /** Insert the {@link Vertex} element at the given {@code position} to the outline loop/strip.
+    /**
+     * Insert the {@link Vertex} element at the given {@code position} to the outline loop/strip.
      * @param position of the added Vertex
      * @param vertex Vertex object to be added
      * @throws NullPointerException if the  {@link Vertex} element is null
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position > getVertexNumber())
      */
-    public final void addVertex(int position, Vertex vertex) throws NullPointerException, IndexOutOfBoundsException {
+    public final void addVertex(final int position, final Vertex vertex) throws NullPointerException, IndexOutOfBoundsException {
         if (null == vertex) {
             throw new NullPointerException("vertex is null");
         }
         vertices.add(position, vertex);
         if(!dirtyBBox) {
-            bbox.resize(vertex.getX(), vertex.getY(), vertex.getZ());
+            bbox.resize(vertex.getCoord());
         }
     }
 
@@ -94,7 +116,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
      * @throws NullPointerException if the  {@link Outline} element is null
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getVertexNumber())
      */
-    public final void setVertex(int position, Vertex vertex) throws NullPointerException, IndexOutOfBoundsException {
+    public final void setVertex(final int position, final Vertex vertex) throws NullPointerException, IndexOutOfBoundsException {
         if (null == vertex) {
             throw new NullPointerException("vertex is null");
         }
@@ -102,11 +124,11 @@ public class Outline implements Cloneable, Comparable<Outline> {
         dirtyBBox = true;
     }
 
-    public final Vertex getVertex(int index){
+    public final Vertex getVertex(final int index){
         return vertices.get(index);
     }
 
-    public int getVertexIndex(Vertex vertex){
+    public int getVertexIndex(final Vertex vertex){
         return vertices.indexOf(vertex);
     }
 
@@ -116,7 +138,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
      * @param position of the to be removed Vertex
      * @throws IndexOutOfBoundsException if position is out of range (position < 0 || position >= getVertexNumber())
      */
-    public final Vertex removeVertex(int position) throws IndexOutOfBoundsException {
+    public final Vertex removeVertex(final int position) throws IndexOutOfBoundsException {
         dirtyBBox = true;
         return vertices.remove(position);
     }
@@ -142,7 +164,7 @@ public class Outline implements Cloneable, Comparable<Outline> {
      *
      * @param vertices the new outline loop/strip
      */
-    public final void setVertices(ArrayList<Vertex> vertices) {
+    public final void setVertices(final ArrayList<Vertex> vertices) {
         this.vertices = vertices;
         validateBoundingBox();
     }
@@ -151,46 +173,53 @@ public class Outline implements Cloneable, Comparable<Outline> {
         return closed;
     }
 
-    /** define if this outline is closed or not.
-     * if set to closed, checks if the last vertex is
-     * equal to the first vertex. If not Equal adds a
-     * vertex at the end to the list.
-     * @param closed
+    /**
+     * Ensure this outline is closed.
+     * <p>
+     * Checks whether the last vertex equals to the first.
+     * If not equal, it either appends a clone of the first vertex
+     * or prepends a clone of the last vertex, depending on <code>closeTail</code>.
+     * </p>
+     * @param closeTail if true, a clone of the first vertex will be appended,
+     *                  otherwise a clone of the last vertex will be prepended.
+     * @return true if closing performed, otherwise false for NOP
      */
-    public final void setClosed(boolean closed) {
-        this.closed = closed;
-        if( closed && !isEmpty() ) {
-            Vertex first = vertices.get(0);
-            Vertex last = getLastVertex();
-            if(!VectorUtil.checkEquality(first.getCoord(), last.getCoord())){
-                Vertex v = first.clone();
-                vertices.add(v);
+    public final boolean setClosed(final boolean closeTail) {
+        this.closed = true;
+        if( !isEmpty() ) {
+            final Vertex first = vertices.get(0);
+            final Vertex last = getLastVertex();
+            if( !VectorUtil.isVec3Equal( first.getCoord(), 0, last.getCoord(), 0, FloatUtil.EPSILON ) ) {
+                if( closeTail ) {
+                    vertices.add(first.clone());
+                } else {
+                    vertices.add(0, last.clone());
+                }
+                return true;
             }
         }
+        return false;
     }
 
-    /** Compare two outlines with Bounding Box area
-     * as criteria.
-     * @see java.lang.Comparable#compareTo(java.lang.Object)
+    /**
+     * Return a transformed instance with all vertices are copied and transformed.
      */
-    @Override
-    public final int compareTo(Outline outline) {
-        float size = getBounds().getSize();
-        float newSize = outline.getBounds().getSize();
-        if(size < newSize){
-            return -1;
+    public final Outline transform(final AffineTransform t, final Vertex.Factory<? extends Vertex> vertexFactory) {
+        final Outline newOutline = new Outline();
+        final int vsize = vertices.size();
+        for(int i=0; i<vsize; i++) {
+            final Vertex v = vertices.get(i);
+            newOutline.addVertex(t.transform(v, vertexFactory.create()));
         }
-        else if(size > newSize){
-            return 1;
-        }
-        return 0;
+        newOutline.closed = this.closed;
+        return newOutline;
     }
 
     private final void validateBoundingBox() {
         dirtyBBox = false;
         bbox.reset();
         for (int i=0; i<vertices.size(); i++) {
-            bbox.resize(vertices.get(i).getCoord(), 0);
+            bbox.resize(vertices.get(i).getCoord());
         }
     }
 
@@ -202,11 +231,29 @@ public class Outline implements Cloneable, Comparable<Outline> {
     }
 
     /**
+     * Compare two outline's Bounding Box size.
+     * @see AABBox#getSize()
+     * @see java.lang.Comparable#compareTo(java.lang.Object)
+     */
+    @Override
+    public final int compareTo(final Outline other) {
+        final float thisSize = getBounds().getSize();
+        final float otherSize = other.getBounds().getSize();
+        if( FloatUtil.isEqual(thisSize, otherSize, FloatUtil.EPSILON) ) {
+            return 0;
+        } else if(thisSize < otherSize){
+            return -1;
+        } else {
+            return 1;
+        }
+    }
+
+    /**
      * @param obj the Object to compare this Outline with
      * @return true if {@code obj} is an Outline, not null, equals bounds and equal vertices in the same order
      */
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if( obj == this) {
             return true;
         }
@@ -227,21 +274,8 @@ public class Outline implements Cloneable, Comparable<Outline> {
         }
         return true;
     }
-
-    /**
-     * @return deep clone of this Outline
-     */
     @Override
-    public Outline clone() {
-        Outline o;
-        try {
-            o = (Outline) super.clone();
-        } catch (CloneNotSupportedException e) { throw new InternalError(); }
-        o.bbox = bbox.clone();
-        o.vertices = new ArrayList<Vertex>(vertices.size());
-        for(int i=0; i<vertices.size(); i++) {
-            o.vertices.add(vertices.get(i).clone());
-        }
-        return o;
+    public final int hashCode() {
+        throw new InternalError("hashCode not designed");
     }
 }
diff --git a/src/jogl/classes/com/jogamp/graph/geom/SVertex.java b/src/jogl/classes/com/jogamp/graph/geom/SVertex.java
new file mode 100644
index 0000000..dc69820
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/graph/geom/SVertex.java
@@ -0,0 +1,224 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.graph.geom;
+
+import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.math.VectorUtil;
+
+/** A Simple Vertex Implementation. Where the coordinates, and other attributes are
+ * float based, and the coordinates and texture coordinates are saved in two float arrays.
+ *
+ */
+public class SVertex implements Vertex {
+    private int id;
+    protected boolean onCurve;
+    protected final float[] coord = new float[3];
+    private final float[] texCoord = new float[3];
+
+    static final Factory factory = new Factory();
+
+    public static Factory factory() { return factory; }
+
+    public static class Factory implements Vertex.Factory<SVertex> {
+        @Override
+        public SVertex create() {
+            return new SVertex();
+        }
+
+        public SVertex create(final Vertex src) {
+            return new SVertex(src);
+        }
+
+        @Override
+        public SVertex create(final int id, final boolean onCurve, final float[] texCoordsBuffer) {
+            return new SVertex(id, onCurve, texCoordsBuffer);
+        }
+
+        @Override
+        public SVertex create(final float x, final float y, final float z, final boolean onCurve) {
+            return new SVertex(x, y, z, onCurve);
+        }
+
+        @Override
+        public SVertex create(final float[] coordsBuffer, final int offset, final int length, final boolean onCurve) {
+            return new SVertex(coordsBuffer, offset, length, onCurve);
+        }
+    }
+
+    public SVertex() {
+        this.id = Integer.MAX_VALUE;
+    }
+
+    public SVertex(final Vertex src) {
+        this.id = Integer.MAX_VALUE;
+        System.arraycopy(src.getCoord(), 0, coord, 0, 3);
+        System.arraycopy(src.getTexCoord(), 0, texCoord, 0, 3);
+        setOnCurve(src.isOnCurve());
+    }
+
+    public SVertex(final int id, final boolean onCurve, final float[] texCoordsBuffer) {
+        this.id = id;
+        this.onCurve = onCurve;
+        System.arraycopy(texCoordsBuffer, 0, texCoord, 0, 3);
+    }
+
+    public SVertex(final float x, final float y, final float z, final boolean onCurve) {
+        this.id = Integer.MAX_VALUE;
+        setCoord(x, y, z);
+        setOnCurve(onCurve);
+    }
+
+    public SVertex(final float[] coordsBuffer, final int offset, final int length, final boolean onCurve) {
+        this.id = Integer.MAX_VALUE;
+        setCoord(coordsBuffer, offset, length);
+        setOnCurve(onCurve);
+    }
+
+    @Override
+    public final void setCoord(final float x, final float y, final float z) {
+        coord[0] = x;
+        coord[1] = y;
+        coord[2] = z;
+    }
+
+    @Override
+    public final void setCoord(final float[] coordsBuffer, final int offset, final int length) {
+        System.arraycopy(coordsBuffer, offset, coord, 0, length);
+    }
+
+    @Override
+    public int getCoordCount() {
+        return 3;
+    }
+
+    @Override
+    public final float[] getCoord() {
+        return coord;
+    }
+
+    @Override
+    public final void setX(final float x) {
+        this.coord[0] = x;
+    }
+
+    @Override
+    public final void setY(final float y) {
+        this.coord[1] = y;
+    }
+
+    @Override
+    public final void setZ(final float z) {
+        this.coord[2] = z;
+    }
+
+    @Override
+    public final float getX() {
+        return this.coord[0];
+    }
+
+    @Override
+    public final float getY() {
+        return this.coord[1];
+    }
+
+    @Override
+    public final float getZ() {
+        return this.coord[2];
+    }
+
+    @Override
+    public final boolean isOnCurve() {
+        return onCurve;
+    }
+
+    @Override
+    public final void setOnCurve(final boolean onCurve) {
+        this.onCurve = onCurve;
+    }
+
+    @Override
+    public final int getId(){
+        return id;
+    }
+
+    @Override
+    public final void setId(final int id){
+        this.id = id;
+    }
+
+    @Override
+    public boolean equals(final Object obj) {
+        if( obj == this) {
+            return true;
+        }
+        if( null == obj || !(obj instanceof Vertex) ) {
+            return false;
+        }
+        final Vertex v = (Vertex) obj;
+        return this == v ||
+               isOnCurve() == v.isOnCurve() &&
+               VectorUtil.isVec3Equal(getTexCoord(), 0, v.getTexCoord(), 0, FloatUtil.EPSILON) &&
+               VectorUtil.isVec3Equal(getCoord(), 0, v.getCoord(), 0, FloatUtil.EPSILON) ;
+    }
+    @Override
+    public final int hashCode() {
+        throw new InternalError("hashCode not designed");
+    }
+
+    @Override
+    public final float[] getTexCoord() {
+        return texCoord;
+    }
+
+    @Override
+    public final void setTexCoord(final float s, final float t, final float p) {
+        texCoord[0] = s;
+        texCoord[1] = t;
+        texCoord[2] = p;
+    }
+
+    @Override
+    public final void setTexCoord(final float[] texCoordsBuffer, final int offset, final int length) {
+        System.arraycopy(texCoordsBuffer, offset, texCoord, 0, length);
+    }
+
+    /**
+     * @return deep clone of this Vertex elements
+     */
+    @Override
+    public SVertex clone(){
+        return new SVertex(this); // OK to not call super.clone(), using own copy-ctor
+    }
+
+    @Override
+    public String toString() {
+        return "[ID: " + id + ", onCurve: " + onCurve +
+               ": p " + coord[0] + ", " + coord[1] + ", " + coord[2] +
+               ", t " + texCoord[0] + ", " + texCoord[1] + ", " + texCoord[2] + "]";
+    }
+}
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
index a01cd83..fc345f2 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Triangle.java
@@ -27,24 +27,77 @@
  */
 package com.jogamp.graph.geom;
 
+import com.jogamp.opengl.math.VectorUtil;
+
+import jogamp.graph.geom.plane.AffineTransform;
+
 public class Triangle {
-    private int id = Integer.MAX_VALUE;
-    final private Vertex[] vertices;
-    private boolean[] boundaryEdges = new boolean[3];
+    private final Vertex[] vertices = new Vertex[3];
+    private final boolean[] boundaryEdges = new boolean[3];
     private boolean[] boundaryVertices = null;
+    private int id;
+
+    public Triangle(final Vertex v1, final Vertex v2, final Vertex v3, final boolean[] boundaryVertices) {
+        id = Integer.MAX_VALUE;
+        vertices[0] = v1;
+        vertices[1] = v2;
+        vertices[2] = v3;
+        this.boundaryVertices = boundaryVertices;
+    }
+
+    public Triangle(final Triangle src) {
+        id = src.id;
+        vertices[0] = src.vertices[0].clone();
+        vertices[1] = src.vertices[1].clone();
+        vertices[2] = src.vertices[2].clone();
+        System.arraycopy(src.boundaryEdges, 0, boundaryEdges, 0, 3);
+        boundaryVertices = new boolean[3];
+        System.arraycopy(src.boundaryVertices, 0, boundaryVertices, 0, 3);
+    }
+
+    private Triangle(final int id, final boolean[] boundaryEdges, final boolean[] boundaryVertices){
+        this.id = id;
+        System.arraycopy(boundaryEdges, 0, this.boundaryEdges, 0, 3);
+        this.boundaryVertices = new boolean[3];
+        System.arraycopy(boundaryVertices, 0, this.boundaryVertices, 0, 3);
+    }
+
+    /**
+     * Returns a transformed a clone of this instance using the given AffineTransform.
+     */
+    public Triangle transform(final AffineTransform t, final Vertex.Factory<? extends Vertex> vertexFactory) {
+        final Triangle tri = new Triangle(id, boundaryEdges, boundaryVertices);
+        tri.vertices[0] = t.transform(vertices[0], vertexFactory.create());
+        tri.vertices[1] = t.transform(vertices[1], vertexFactory.create());
+        tri.vertices[2] = t.transform(vertices[2], vertexFactory.create());
+        return tri;
+    }
 
-    public Triangle(Vertex ... v123){
-        vertices = v123;
+    /**
+     * Returns true if all vertices are on-curve, otherwise false.
+     */
+    public final boolean isOnCurve() {
+        return vertices[0].isOnCurve() && vertices[1].isOnCurve() && vertices[2].isOnCurve();
+    }
+
+    /**
+     * Returns true if all vertices are lines, i.e. zero tex-coord, otherwise false.
+     */
+    public final boolean isLine() {
+        return VectorUtil.isVec2Zero(vertices[0].getTexCoord(), 0) &&
+               VectorUtil.isVec2Zero(vertices[1].getTexCoord(), 0) &&
+               VectorUtil.isVec2Zero(vertices[2].getTexCoord(), 0) ;
     }
 
     public int getId() {
         return id;
     }
 
-    public void setId(int id) {
+    public void setId(final int id) {
         this.id = id;
     }
 
+    /** Returns array of 3 vertices, denominating the triangle. */
     public Vertex[] getVertices() {
         return vertices;
     }
@@ -57,10 +110,6 @@ public class Triangle {
         return boundaryVertices[0] || boundaryVertices[1] || boundaryVertices[2];
     }
 
-    public void setEdgesBoundary(boolean[] boundary) {
-        this.boundaryEdges = boundary;
-    }
-
     public boolean[] getEdgeBoundary() {
         return boundaryEdges;
     }
@@ -69,12 +118,15 @@ public class Triangle {
         return boundaryVertices;
     }
 
-    public void setVerticesBoundary(boolean[] boundaryVertices) {
+    public void setVerticesBoundary(final boolean[] boundaryVertices) {
         this.boundaryVertices = boundaryVertices;
     }
 
     @Override
     public String toString() {
-        return "Tri ID: " + id + "\n" +  vertices[0]  + "\n" +  vertices[1] + "\n" +  vertices[2];
+        return "Tri ID: " + id + ", onCurve "+isOnCurve()+"\n\t" +
+                            vertices[0]  + ", bound "+boundaryVertices[0]+"\n\t" +
+                            vertices[1]  + ", bound "+boundaryVertices[1]+"\n\t" +
+                            vertices[2]  + ", bound "+boundaryVertices[2];
     }
 }
diff --git a/src/jogl/classes/com/jogamp/graph/geom/Vertex.java b/src/jogl/classes/com/jogamp/graph/geom/Vertex.java
index 994253f..e9c8dd1 100644
--- a/src/jogl/classes/com/jogamp/graph/geom/Vertex.java
+++ b/src/jogl/classes/com/jogamp/graph/geom/Vertex.java
@@ -37,6 +37,10 @@ public interface Vertex extends Vert3fImmutable, Cloneable {
     public static interface Factory <T extends Vertex> {
         T create();
 
+        T create(Vertex src);
+
+        T create(int id, boolean onCurve, float[] texCoordsBuffer);
+
         T create(float x, float y, float z, boolean onCurve);
 
         T create(float[] coordsBuffer, int offset, int length, boolean onCurve);
@@ -65,7 +69,7 @@ public interface Vertex extends Vert3fImmutable, Cloneable {
 
     float[] getTexCoord();
 
-    void setTexCoord(float s, float t);
+    void setTexCoord(float s, float t, float p);
 
     /**
      * @see System#arraycopy(Object, int, Object, int, int) for thrown IndexOutOfBoundsException
diff --git a/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java b/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java
deleted file mode 100644
index b27604a..0000000
--- a/src/jogl/classes/com/jogamp/graph/geom/opengl/SVertex.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.graph.geom.opengl;
-
-import com.jogamp.graph.geom.Vertex;
-import com.jogamp.opengl.math.VectorUtil;
-
-/** A Simple Vertex Implementation. Where the coordinates, and other attributes are
- * float based, and the coordinates and texture coordinates are saved in two float arrays.
- *
- */
-public class SVertex implements Vertex {
-    private int id = Integer.MAX_VALUE;
-    protected float[] coord = new float[3];
-    protected boolean onCurve;
-    private float[] texCoord = new float[2];
-
-    static final Factory factory = new Factory();
-
-    public static Factory factory() { return factory; }
-
-    public static class Factory implements Vertex.Factory<SVertex> {
-        @Override
-        public SVertex create() {
-            return new SVertex();
-        }
-
-        @Override
-        public SVertex create(float x, float y, float z, boolean onCurve) {
-            return new SVertex(x, y, z, onCurve);
-        }
-
-        @Override
-        public SVertex create(float[] coordsBuffer, int offset, int length, boolean onCurve) {
-            return new SVertex(coordsBuffer, offset, length, onCurve);
-        }
-    }
-
-    public SVertex() {
-    }
-
-    public SVertex(float x, float y, float z, boolean onCurve) {
-        setCoord(x, y, z);
-        setOnCurve(onCurve);
-    }
-
-    public SVertex(float[] coordsBuffer, int offset, int length, boolean onCurve) {
-        setCoord(coordsBuffer, offset, length);
-        setOnCurve(onCurve);
-    }
-
-    public SVertex(float[] coordsBuffer, int offset, int length,
-                   float[] texCoordsBuffer, int offsetTC, int lengthTC, boolean onCurve) {
-        setCoord(coordsBuffer, offset, length);
-        setTexCoord(texCoordsBuffer, offsetTC, lengthTC);
-        setOnCurve(onCurve);
-    }
-
-    @Override
-    public final void setCoord(float x, float y, float z) {
-        this.coord[0] = x;
-        this.coord[1] = y;
-        this.coord[2] = z;
-    }
-
-    @Override
-    public final void setCoord(float[] coordsBuffer, int offset, int length) {
-        System.arraycopy(coordsBuffer, offset, coord, 0, length);
-    }
-
-    @Override
-    public int getCoordCount() {
-        return 3;
-    }
-
-    @Override
-    public final float[] getCoord() {
-        return coord;
-    }
-
-    @Override
-    public final void setX(float x) {
-        this.coord[0] = x;
-    }
-
-    @Override
-    public final void setY(float y) {
-        this.coord[1] = y;
-    }
-
-    @Override
-    public final void setZ(float z) {
-        this.coord[2] = z;
-    }
-
-    @Override
-    public final float getX() {
-        return this.coord[0];
-    }
-
-    @Override
-    public final float getY() {
-        return this.coord[1];
-    }
-
-    @Override
-    public final float getZ() {
-        return this.coord[2];
-    }
-
-    @Override
-    public final boolean isOnCurve() {
-        return onCurve;
-    }
-
-    @Override
-    public final void setOnCurve(boolean onCurve) {
-        this.onCurve = onCurve;
-    }
-
-    @Override
-    public final int getId(){
-        return id;
-    }
-
-    @Override
-    public final void setId(int id){
-        this.id = id;
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if( obj == this) {
-            return true;
-        }
-        if( null == obj || !(obj instanceof Vertex) ) {
-            return false;
-        }
-        final Vertex v = (Vertex) obj;
-        return this == v ||
-               isOnCurve() == v.isOnCurve() &&
-               VectorUtil.checkEqualityVec2(getTexCoord(), v.getTexCoord()) &&
-               VectorUtil.checkEquality(getCoord(), v.getCoord()) ;
-    }
-
-    @Override
-    public final float[] getTexCoord() {
-        return texCoord;
-    }
-
-    @Override
-    public final void setTexCoord(float s, float t) {
-        this.texCoord[0] = s;
-        this.texCoord[1] = t;
-    }
-
-    @Override
-    public final void setTexCoord(float[] texCoordsBuffer, int offset, int length) {
-        System.arraycopy(texCoordsBuffer, offset, texCoord, 0, length);
-    }
-
-    /**
-     * @return deep clone of this Vertex, but keeping the id blank
-     */
-    @Override
-    public SVertex clone(){
-        return new SVertex(this.coord, 0, 3, this.texCoord, 0, 2, this.onCurve);
-    }
-
-    @Override
-    public String toString() {
-        return "[ID: " + id + ", onCurve: " + onCurve +
-               ": p " + coord[0] + ", " + coord[1] + ", " + coord[2] +
-               ", t " + texCoord[0] + ", " + texCoord[1] + "]";
-    }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/FBObject.java b/src/jogl/classes/com/jogamp/opengl/FBObject.java
index 90a8dc0..a378171 100644
--- a/src/jogl/classes/com/jogamp/opengl/FBObject.java
+++ b/src/jogl/classes/com/jogamp/opengl/FBObject.java
@@ -43,6 +43,7 @@ import javax.media.opengl.GLProfile;
 
 import jogamp.opengl.Debug;
 
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.opengl.FBObject.Attachment.Type;
 
 /**
@@ -60,15 +61,21 @@ import com.jogamp.opengl.FBObject.Attachment.Type;
  * <p>FIXME: Implement support for {@link Type#DEPTH_TEXTURE}, {@link Type#STENCIL_TEXTURE} .</p>
  */
 public class FBObject {
-    protected static final boolean DEBUG = Debug.debug("FBObject");
+    protected static final boolean DEBUG;
+    private static final int USER_MAX_TEXTURE_SIZE;
     private static final boolean FBOResizeQuirk = false;
 
+    static {
+        Debug.initSingleton();
+        DEBUG = Debug.debug("FBObject");
+        USER_MAX_TEXTURE_SIZE = PropertyAccess.getIntProperty("jogl.debug.FBObject.MaxTextureSize", true, 0);
+    }
+
     private static enum DetachAction { NONE, DISPOSE, RECREATE };
 
     /**
-     * Marker interface, denotes a color buffer attachment.
+     * Generic color buffer FBO attachment, either of type {@link ColorAttachment} or {@link TextureAttachment}.
      * <p>Always an instance of {@link Attachment}.</p>
-     * <p>Either an instance of {@link ColorAttachment} or {@link TextureAttachment}.</b>
      */
     public static interface Colorbuffer {
         /**
@@ -76,23 +83,55 @@ public class FBObject {
          * @return <code>true</code> if newly initialized, otherwise <code>false</code>.
          * @throws GLException if buffer generation or setup fails. The just created buffer name will be deleted in this case.
          */
-        public boolean initialize(GL gl) throws GLException;
+        boolean initialize(final GL gl) throws GLException;
 
         /**
          * Releases the color buffer if initialized, i.e. name is not <code>zero</code>.
          * @throws GLException if buffer release fails.
          */
-        public void free(GL gl) throws GLException;
+        void free(final GL gl) throws GLException;
 
         /**
          * Writes the internal format to the given GLCapabilities object.
          * @param caps the destination for format bits
          * @param rgba8Avail whether rgba8 is available
          */
-        public void formatToGLCapabilities(GLCapabilities caps, boolean rgba8Avail);
+        void formatToGLCapabilities(final GLCapabilities caps, final boolean rgba8Avail);
+
+        /**
+         * Returns <code>true</code> if instance is of type {@link TextureAttachment}
+         * and <code>false</code> if instance is of type {@link ColorAttachment}.
+         */
+        boolean isTextureAttachment();
+
+        /**
+         * Casts this object to a {@link TextureAttachment} reference, see {@link #isTextureAttachment()}.
+         * @throws GLException if this object is not of type {@link TextureAttachment}
+         * @see #isTextureAttachment()
+         */
+        TextureAttachment getTextureAttachment();
+
+        /**
+         * Casts this object to a {@link ColorAttachment} reference, see {@link #isTextureAttachment()}.
+         * @throws GLException if this object is not of type {@link ColorAttachment}
+         * @see #isTextureAttachment()
+         */
+        ColorAttachment getColorAttachment();
+
+        /** internal format of colorbuffer */
+        int getFormat();
+
+        /** width of colorbuffer */
+        int getWidth();
+
+        /** height of colorbuffer */
+        int getHeight();
+
+        /** colorbuffer name [1..max] */
+        int getName();
     }
 
-    /** Common super class of all attachments */
+    /** Common super class of all FBO attachments */
     public static abstract class Attachment {
         public enum Type {
             NONE, DEPTH, STENCIL, DEPTH_STENCIL, COLOR, COLOR_TEXTURE, DEPTH_TEXTURE, STENCIL_TEXTURE;
@@ -101,7 +140,7 @@ public class FBObject {
              * Returns {@link #COLOR}, {@link #DEPTH}, {@link #STENCIL} or {@link #DEPTH_STENCIL}
              * @throws IllegalArgumentException if <code>format</code> cannot be handled.
              */
-            public static Type determine(int format) throws IllegalArgumentException {
+            public static Type determine(final int format) throws IllegalArgumentException {
                 switch(format) {
                     case GL.GL_RGBA4:
                     case GL.GL_RGB5_A1:
@@ -135,7 +174,7 @@ public class FBObject {
 
         private int name;
 
-        protected Attachment(Type type, int iFormat, int width, int height, int name) {
+        protected Attachment(final Type type, final int iFormat, final int width, final int height, final int name) {
             this.type = type;
             this.format = iFormat;
             this.width = width;
@@ -148,7 +187,7 @@ public class FBObject {
          * @param caps the destination for format bits
          * @param rgba8Avail whether rgba8 is available
          */
-        public final void formatToGLCapabilities(GLCapabilities caps, boolean rgba8Avail) {
+        public final void formatToGLCapabilities(final GLCapabilities caps, final boolean rgba8Avail) {
             final int _format;
             switch(format) {
                 case GL.GL_RGBA:
@@ -220,15 +259,18 @@ public class FBObject {
             }
         }
 
+        /** immutable internal format of attachment */
+        public final int getFormat() { return format; }
+
         /** width of attachment */
         public final int getWidth() { return width; }
         /** height of attachment */
         public final int getHeight() { return height; }
-        /* pp */ final void setSize(int w, int h) { width = w; height = h; }
+        /* pp */ final void setSize(final int w, final int h) { width = w; height = h; }
 
         /** buffer name [1..max], maybe a texture or renderbuffer name, depending on type. */
         public final int getName() { return name; }
-        /* pp */ final void setName(int n) { name = n; }
+        /* pp */ final void setName(final int n) { name = n; }
 
         /**
          * Initializes the attachment and set it's parameter, if uninitialized, i.e. name is <code>zero</code>.
@@ -242,7 +284,7 @@ public class FBObject {
          * @return <code>true</code> if newly initialized, otherwise <code>false</code>.
          * @throws GLException if buffer generation or setup fails. The just created buffer name will be deleted in this case.
          */
-        public abstract boolean initialize(GL gl) throws GLException;
+        public abstract boolean initialize(final GL gl) throws GLException;
 
         /**
          * Releases the attachment if initialized, i.e. name is not <code>zero</code>.
@@ -254,7 +296,7 @@ public class FBObject {
          * </pre>
          * @throws GLException if buffer release fails.
          */
-        public abstract void free(GL gl) throws GLException;
+        public abstract void free(final GL gl) throws GLException;
 
         /**
          * <p>
@@ -263,7 +305,7 @@ public class FBObject {
          * {@inheritDoc}
          */
         @Override
-        public boolean equals(Object o) {
+        public boolean equals(final Object o) {
             if( this == o ) return true;
             if( ! ( o instanceof Attachment ) ) return false;
             final Attachment a = (Attachment)o;
@@ -299,7 +341,7 @@ public class FBObject {
                    "; name "+toHexString(name)+", obj "+toHexString(objectHashCode())+"]";
         }
 
-        public static Type getType(int attachmentPoint, int maxColorAttachments) {
+        public static Type getType(final int attachmentPoint, final int maxColorAttachments) {
             if( GL.GL_COLOR_ATTACHMENT0 <= attachmentPoint && attachmentPoint < GL.GL_COLOR_ATTACHMENT0+maxColorAttachments ) {
                 return Type.COLOR;
             }
@@ -326,16 +368,16 @@ public class FBObject {
          * @param height
          * @param name
          */
-        public RenderAttachment(Type type, int iFormat, int samples, int width, int height, int name) {
+        public RenderAttachment(final Type type, final int iFormat, final int samples, final int width, final int height, final int name) {
             super(validateType(type), iFormat, width, height, name);
             this.samples = samples;
         }
 
         /** number of samples, or zero for no multisampling */
         public final int getSamples() { return samples; }
-        /* pp */ final void setSamples(int s) { samples = s; }
+        /* pp */ final void setSamples(final int s) { samples = s; }
 
-        private static Type validateType(Type type) {
+        private static Type validateType(final Type type) {
             switch(type) {
                 case DEPTH_STENCIL:
                 case DEPTH:
@@ -354,7 +396,7 @@ public class FBObject {
          * {@inheritDoc}
          */
         @Override
-        public boolean equals(Object o) {
+        public boolean equals(final Object o) {
             if( this == o ) return true;
             if( ! ( o instanceof RenderAttachment ) ) return false;
             return super.equals(o) &&
@@ -376,7 +418,7 @@ public class FBObject {
         }
 
         @Override
-        public boolean initialize(GL gl) throws GLException {
+        public boolean initialize(final GL gl) throws GLException {
             final boolean init = 0 == getName();
             if( init ) {
                 checkPreGLError(gl);
@@ -405,7 +447,7 @@ public class FBObject {
         }
 
         @Override
-        public void free(GL gl) {
+        public void free(final GL gl) {
             final int[] name = new int[] { getName() };
             if( 0 != name[0] ) {
                 if(DEBUG) {
@@ -423,14 +465,21 @@ public class FBObject {
         }
     }
 
-    /** Color render buffer attachment  */
+    /** Color render buffer FBO attachment  */
     public static class ColorAttachment extends RenderAttachment implements Colorbuffer {
-        public ColorAttachment(int iFormat, int samples, int width, int height, int name) {
+        public ColorAttachment(final int iFormat, final int samples, final int width, final int height, final int name) {
             super(Type.COLOR, iFormat, samples, width, height, name);
         }
+        @Override
+        public final boolean isTextureAttachment() { return false; }
+        @Override
+        public final TextureAttachment getTextureAttachment() { throw new GLException("Not a TextureAttachment, but ColorAttachment"); }
+        @Override
+        public final ColorAttachment getColorAttachment() { return this; }
+
     }
 
-    /** Texture attachment */
+    /** Texture FBO attachment */
     public static class TextureAttachment extends Attachment implements Colorbuffer  {
         /** details of the texture setup */
         public final int dataFormat, dataType, magFilter, minFilter, wrapS, wrapT;
@@ -448,8 +497,8 @@ public class FBObject {
          * @param wrapT
          * @param name
          */
-        public TextureAttachment(Type type, int iFormat, int width, int height, int dataFormat, int dataType,
-                                 int magFilter, int minFilter, int wrapS, int wrapT, int name) {
+        public TextureAttachment(final Type type, final int iFormat, final int width, final int height, final int dataFormat, final int dataType,
+                                 final int magFilter, final int minFilter, final int wrapS, final int wrapT, final int name) {
             super(validateType(type), iFormat, width, height, name);
             this.dataFormat = dataFormat;
             this.dataType = dataType;
@@ -459,7 +508,7 @@ public class FBObject {
             this.wrapT = wrapT;
         }
 
-        private static Type validateType(Type type) {
+        private static Type validateType(final Type type) {
             switch(type) {
                 case COLOR_TEXTURE:
                 case DEPTH_TEXTURE:
@@ -475,7 +524,7 @@ public class FBObject {
          * @throws GLException if texture generation and setup fails. The just created texture name will be deleted in this case.
          */
         @Override
-        public boolean initialize(GL gl) throws GLException {
+        public boolean initialize(final GL gl) throws GLException {
             final boolean init = 0 == getName();
             if( init ) {
                 checkPreGLError(gl);
@@ -520,7 +569,7 @@ public class FBObject {
         }
 
         @Override
-        public void free(GL gl) {
+        public void free(final GL gl) {
             final int[] name = new int[] { getName() };
             if( 0 != name[0] ) {
                 if(DEBUG) {
@@ -530,6 +579,14 @@ public class FBObject {
                 setName(0);
             }
         }
+
+        @Override
+        public final boolean isTextureAttachment() { return true; }
+        @Override
+        public final TextureAttachment getTextureAttachment() { return this; }
+        @Override
+        public final ColorAttachment getColorAttachment() { throw new GLException("Not a ColorAttachment, but TextureAttachment"); }
+
         @Override
         public String toString() {
             return getClass().getSimpleName()+"[type "+type+", target GL_TEXTURE_2D, level 0, format "+toHexString(format)+
@@ -540,7 +597,7 @@ public class FBObject {
                                               "; name "+toHexString(getName())+", obj "+toHexString(objectHashCode())+"]";
         }
     }
-    static String toHexString(int v) {
+    static String toHexString(final int v) {
         return "0x"+Integer.toHexString(v);
     }
 
@@ -550,21 +607,52 @@ public class FBObject {
      *
      * <p>Using default min/mag filter {@link GL#GL_NEAREST} and default wrapS/wrapT {@link GL#GL_CLAMP_TO_EDGE}.</p>
      *
-     * @param glp the chosen {@link GLProfile}
+     * @param gl the used {@link GLContext}'s {@link GL} object
      * @param alpha set to <code>true</code> if you request alpha channel, otherwise <code>false</code>;
      * @param width texture width
      * @param height texture height
      * @return the created and uninitialized color {@link TextureAttachment}
      */
-    public static final TextureAttachment createColorTextureAttachment(GLProfile glp, boolean alpha, int width, int height) {
-        return createColorTextureAttachment(glp, alpha, width, height, GL.GL_NEAREST, GL.GL_NEAREST, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
+    public static final TextureAttachment createColorTextureAttachment(final GL gl, final boolean alpha, final int width, final int height) {
+        return createColorTextureAttachment(gl, alpha, width, height, GL.GL_NEAREST, GL.GL_NEAREST, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
     }
 
     /**
      * Creates a color {@link TextureAttachment}, i.e. type {@link Type#COLOR_TEXTURE},
      * selecting the texture data type and format automatically.
+     * <p>
+     * For GLES3, sampling-sink format <b>must be equal</b> w/ the sampling-source {@link Colorbuffer},
+     * see details below. Implementation aligns w/ {@link #createColorAttachment(boolean)}
+     * and is enforced via {@link #sampleSinkFormatMismatch(GL)}.
+     * </p>
+     * <p>
+     * ES3 BlitFramebuffer Requirements: OpenGL ES 3.0.2 p194: 4.3.2  Copying Pixels
+     * <pre>
+     * If SAMPLE_BUFFERS for the read framebuffer is greater than zero, no copy
+     * is performed and an INVALID_OPERATION error is generated if the formats of
+     * the read and draw framebuffers are not identical or if the source and destination
+     * rectangles are not defined with the same (X0, Y 0) and (X1, Y 1) bounds.
+     * </pre>
+     * Texture and Renderbuffer format details:
+     * <pre>
+     * ES2 Base iFormat: OpenGL ES 2.0.24 p66: 3.7.1 Texture Image Specification, Table 3.8
+     *   ALPHA, LUMINANCE, LUMINANCE_ALPHA, RGB, RGBA
      *
-     * @param glp the chosen {@link GLProfile}
+     * ES3 Base iFormat: OpenGL ES 3.0.2 p125: 3.8.3 Texture Image Specification, Table 3.11
+     *   ALPHA, LUMINANCE, LUMINANCE_ALPHA, RGB, RGBA
+     *   DEPTH_COMPONENT, STENCIL_COMPONENT, RED, RG
+     *
+     * ES3 Required Texture and Renderbuffer iFormat: OpenGL ES 3.0.2 p126: 3.8.3 Texture Image Specification
+     *   - RGBA32I, RGBA32UI, RGBA16I, RGBA16UI, RGBA8, RGBA8I,
+     *     RGBA8UI, SRGB8_ALPHA8, RGB10_A2, RGB10_A2UI, RGBA4, and
+     *     RGB5_A1.
+     *   - RGB8 and RGB565.
+     *   - RG32I, RG32UI, RG16I, RG16UI, RG8, RG8I, and RG8UI.
+     *   - R32I, R32UI, R16I, R16UI, R8, R8I, and R8UI.
+     * </pre>
+     * </p>
+     *
+     * @param gl the used {@link GLContext}'s {@link GL} object
      * @param alpha set to <code>true</code> if you request alpha channel, otherwise <code>false</code>;
      * @param width texture width
      * @param height texture height
@@ -574,10 +662,14 @@ public class FBObject {
      * @param wrapT if > 0 value for {@link GL#GL_TEXTURE_WRAP_T}
      * @return the created and uninitialized color {@link TextureAttachment}
      */
-    public static final TextureAttachment createColorTextureAttachment(GLProfile glp, boolean alpha, int width, int height,
-                                                                       int magFilter, int minFilter, int wrapS, int wrapT) {
+    public static final TextureAttachment createColorTextureAttachment(final GL gl, final boolean alpha, final int width, final int height,
+                                                                       final int magFilter, final int minFilter, final int wrapS, final int wrapT) {
         final int textureInternalFormat, textureDataFormat, textureDataType;
-        if(glp.isGLES()) {
+        if(gl.isGLES3()) {
+            textureInternalFormat = alpha ? GL.GL_RGBA8 : GL.GL_RGB8;
+            textureDataFormat = alpha ? GL.GL_RGBA : GL.GL_RGB;
+            textureDataType = GL.GL_UNSIGNED_BYTE;
+        } else if(gl.isGLES()) {
             textureInternalFormat = alpha ? GL.GL_RGBA : GL.GL_RGB;
             textureDataFormat = alpha ? GL.GL_RGBA : GL.GL_RGB;
             textureDataType = GL.GL_UNSIGNED_BYTE;
@@ -605,13 +697,13 @@ public class FBObject {
      * @param wrapT if > 0 value for {@link GL#GL_TEXTURE_WRAP_T}
      * @return the created and uninitialized color {@link TextureAttachment}
      */
-    public static final TextureAttachment createColorTextureAttachment(int internalFormat, int width, int height, int dataFormat, int dataType,
-                                                                       int magFilter, int minFilter, int wrapS, int wrapT) {
+    public static final TextureAttachment createColorTextureAttachment(final int internalFormat, final int width, final int height, final int dataFormat, final int dataType,
+                                                                       final int magFilter, final int minFilter, final int wrapS, final int wrapT) {
         return new TextureAttachment(Type.COLOR_TEXTURE, internalFormat, width, height, dataFormat, dataType,
                                      magFilter, minFilter, wrapS, wrapT, 0 /* name */);
     }
 
-    private static boolean hasAlpha(int format) {
+    private static boolean hasAlpha(final int format) {
         switch(format) {
             case GL.GL_RGBA8:
             case GL.GL_RGBA4:
@@ -642,55 +734,62 @@ public class FBObject {
     private int fbName;
     private boolean bound;
 
-    private int colorAttachmentCount;
-    private Colorbuffer[] colorAttachmentPoints; // colorbuffer attachment points
+    private int colorbufferCount;
+    private int textureAttachmentCount;
+    private Colorbuffer[] colorbufferAttachments; // colorbuffer attachment points
     private RenderAttachment depth, stencil; // depth and stencil maybe equal in case of packed-depth-stencil
 
     private FBObject samplingSink; // MSAA sink
-    private TextureAttachment samplingSinkTexture;
+    private Colorbuffer samplingColorSink;
     private boolean samplingSinkDirty;
 
     //
     // ColorAttachment helper ..
     //
 
-    private final void validateColorAttachmentPointRange(int point) {
+    private final void validateColorAttachmentPointRange(final int point) {
         if(!initialized) {
             throw new GLException("FBO not initialized");
         }
-        if(maxColorAttachments != colorAttachmentPoints.length) {
-            throw new InternalError("maxColorAttachments "+maxColorAttachments+", array.lenght "+colorAttachmentPoints);
+        if(maxColorAttachments != colorbufferAttachments.length) {
+            throw new InternalError("maxColorAttachments "+maxColorAttachments+", array.length "+colorbufferAttachments.length);
         }
         if(0 > point || point >= maxColorAttachments) {
             throw new IllegalArgumentException("attachment point out of range: "+point+", should be within [0.."+(maxColorAttachments-1)+"], "+this);
         }
     }
 
-    private final void validateAddColorAttachment(int point, Colorbuffer ca) {
+    private final void validateAddColorAttachment(final int point, final Colorbuffer ca) {
         validateColorAttachmentPointRange(point);
-        if( null != colorAttachmentPoints[point] ) {
-            throw new IllegalArgumentException("Cannot attach "+ca+", attachment point already in use by "+colorAttachmentPoints[point]+", "+this);
+        if( null != colorbufferAttachments[point] ) {
+            throw new IllegalArgumentException("Cannot attach "+ca+", attachment point already in use by "+colorbufferAttachments[point]+", "+this);
         }
     }
 
-    private final void addColorAttachment(int point, Colorbuffer ca) {
+    private final void addColorAttachment(final int point, final Colorbuffer ca) {
         validateColorAttachmentPointRange(point);
-        final Colorbuffer c = colorAttachmentPoints[point];
+        final Colorbuffer c = colorbufferAttachments[point];
         if( null != c && c != ca ) {
             throw new IllegalArgumentException("Add failed: requested to add "+ca+" at "+point+", but slot is holding "+c+"; "+this);
         }
-        colorAttachmentPoints[point] = ca;
-        colorAttachmentCount++;
+        colorbufferAttachments[point] = ca;
+        colorbufferCount++;
+        if( ca.isTextureAttachment() ) {
+            textureAttachmentCount++;
+        }
     }
 
-    private final void removeColorAttachment(int point, Colorbuffer ca) {
+    private final void removeColorAttachment(final int point, final Colorbuffer ca) {
         validateColorAttachmentPointRange(point);
-        final Colorbuffer c = colorAttachmentPoints[point];
+        final Colorbuffer c = colorbufferAttachments[point];
         if( null != c && c != ca ) {
             throw new IllegalArgumentException("Remove failed: requested to removed "+ca+" at "+point+", but slot is holding "+c+"; "+this);
         }
-        colorAttachmentPoints[point] = null;
-        colorAttachmentCount--;
+        colorbufferAttachments[point] = null;
+        colorbufferCount--;
+        if( ca.isTextureAttachment() ) {
+            textureAttachmentCount--;
+        }
     }
 
     /**
@@ -701,9 +800,9 @@ public class FBObject {
      * @see #attachTexture2D(GL, int, boolean, int, int, int, int)
      * @see #attachTexture2D(GL, int, int, int, int, int, int, int, int)
      */
-    public final Colorbuffer getColorbuffer(int attachmentPoint) {
+    public final Colorbuffer getColorbuffer(final int attachmentPoint) {
         validateColorAttachmentPointRange(attachmentPoint);
-        return colorAttachmentPoints[attachmentPoint];
+        return colorbufferAttachments[attachmentPoint];
     }
 
     /**
@@ -715,9 +814,9 @@ public class FBObject {
      * @param ca the {@link Colorbuffer} to look for.
      * @return -1 if the {@link Colorbuffer} could not be found, otherwise [0..{@link #getMaxColorAttachments()}-1]
      */
-    public final int getColorbufferAttachmentPoint(Colorbuffer ca) {
-        for(int i=0; i<colorAttachmentPoints.length; i++) {
-            if( colorAttachmentPoints[i] == ca ) {
+    public final int getColorbufferAttachmentPoint(final Colorbuffer ca) {
+        for(int i=0; i<colorbufferAttachments.length; i++) {
+            if( colorbufferAttachments[i] == ca ) {
                 return i;
             }
         }
@@ -738,12 +837,32 @@ public class FBObject {
      * @see #attachTexture2D(GL, int, boolean, int, int, int, int)
      * @see #attachTexture2D(GL, int, int, int, int, int, int, int, int)
      */
-    public final Colorbuffer getColorbuffer(Colorbuffer ca) {
+    public final Colorbuffer getColorbuffer(final Colorbuffer ca) {
         final int p = getColorbufferAttachmentPoint(ca);
         return p>=0 ? getColorbuffer(p) : null;
     }
 
     /**
+     * Returns true if any attached {@link Colorbuffer} uses alpha,
+     * otherwise false.
+     */
+    public final boolean hasAttachmentUsingAlpha() {
+        final int caCount = getColorbufferCount();
+        boolean hasAlpha = false;
+        for(int i=0; i<caCount; i++) {
+            final Attachment ca = (Attachment)getColorbuffer(i);
+            if( null == ca ) {
+                break;
+            }
+            if( hasAlpha(ca.format) ) {
+                hasAlpha = true;
+                break;
+            }
+        }
+        return hasAlpha;
+    }
+
+    /**
      * Creates an uninitialized FBObject instance.
      * <p>
      * Call {@link #init(GL, int, int, int)} .. etc to use it.
@@ -775,17 +894,18 @@ public class FBObject {
         this.fbName = 0;
         this.bound = false;
 
-        this.colorAttachmentPoints = null; // at init ..
-        this.colorAttachmentCount = 0;
+        this.colorbufferAttachments = null; // at init ..
+        this.colorbufferCount = 0;
+        this.textureAttachmentCount = 0;
         this.depth = null;
         this.stencil = null;
 
         this.samplingSink = null;
-        this.samplingSinkTexture = null;
+        this.samplingColorSink = null;
         this.samplingSinkDirty = true;
     }
 
-    private void init(GL gl, int width, int height, int samples) throws GLException {
+    private void init(final GL gl, int width, int height, final int samples) throws GLException {
         if(initialized) {
             throw new GLException("FBO already initialized");
         }
@@ -808,7 +928,7 @@ public class FBObject {
 
         final boolean NV_fbo_color_attachments = gl.isExtensionAvailable(GLExtensions.NV_fbo_color_attachments);
 
-        int val[] = new int[1];
+        final int val[] = new int[1];
 
         checkPreGLError(gl);
 
@@ -819,16 +939,22 @@ public class FBObject {
                 val[0] = 0;
                 gl.glGetIntegerv(GL2ES2.GL_MAX_COLOR_ATTACHMENTS, val, 0);
                 realMaxColorAttachments = 1 <= val[0] ? val[0] : 1; // cap minimum to 1
-            } catch (GLException gle) { gle.printStackTrace(); }
+            } catch (final GLException gle) { gle.printStackTrace(); }
         }
         maxColorAttachments = realMaxColorAttachments <= 8 ? realMaxColorAttachments : 8; // cap to limit array size
 
-        colorAttachmentPoints = new Colorbuffer[maxColorAttachments];
-        colorAttachmentCount = 0;
+        colorbufferAttachments = new Colorbuffer[maxColorAttachments];
+        colorbufferCount = 0;
+        textureAttachmentCount = 0;
 
         maxSamples = gl.getMaxRenderbufferSamples();
         gl.glGetIntegerv(GL.GL_MAX_TEXTURE_SIZE, val, 0);
-        maxTextureSize = val[0];
+        final int _maxTextureSize = val[0];
+        if( 0 < USER_MAX_TEXTURE_SIZE ) {
+            maxTextureSize = USER_MAX_TEXTURE_SIZE;
+        } else {
+            maxTextureSize = _maxTextureSize;
+        }
         gl.glGetIntegerv(GL.GL_MAX_RENDERBUFFER_SIZE, val, 0);
         maxRenderbufferSize = val[0];
 
@@ -841,11 +967,11 @@ public class FBObject {
         this.samples = samples <= maxSamples ? samples : maxSamples;
 
         if(DEBUG) {
-            System.err.println("FBObject "+width+"x"+height+", "+samples+" -> "+this.samples+" samples");
+            System.err.println("FBObject.init() START: "+width+"x"+height+", "+samples+" -> "+this.samples+" samples");
             System.err.println("fullFBOSupport:           "+fullFBOSupport);
             System.err.println("maxColorAttachments:      "+maxColorAttachments+"/"+realMaxColorAttachments+" [capped/real]");
             System.err.println("maxSamples:               "+maxSamples);
-            System.err.println("maxTextureSize:           "+maxTextureSize);
+            System.err.println("maxTextureSize:           "+_maxTextureSize+" -> "+maxTextureSize);
             System.err.println("maxRenderbufferSize:      "+maxRenderbufferSize);
             System.err.println("rgba8:                    "+rgba8Avail);
             System.err.println("depth24:                  "+depth24Avail);
@@ -857,15 +983,16 @@ public class FBObject {
             System.err.println("packedDepthStencil:       "+packedDepthStencilAvail);
             System.err.println("NV_fbo_color_attachments: "+NV_fbo_color_attachments);
             System.err.println(gl.getContext().getGLVersion());
-            System.err.println(JoglVersion.getGLStrings(gl, null).toString());
-            System.err.println(gl.getContext());
+            System.err.println(JoglVersion.getGLStrings(gl, null, false).toString());
         }
 
         checkNoError(null, gl.glGetError(), "FBObject Init.pre"); // throws GLException if error
 
-        if(width > 2 + maxTextureSize  || height> 2 + maxTextureSize ||
-           width > maxRenderbufferSize || height> maxRenderbufferSize  ) {
-            throw new GLException("size "+width+"x"+height+" exceeds on of the maxima [texture "+maxTextureSize+", renderbuffer "+maxRenderbufferSize+"]");
+        if( textureAttachmentCount > 0 && ( width > 2 + maxTextureSize  || height > 2 + maxTextureSize ) ) {
+            throw new GLException("Size "+width+"x"+height+" exceeds on of the maximum texture size "+maxTextureSize+": \n\t"+this);
+        }
+        if( width > maxRenderbufferSize || height > maxRenderbufferSize  ) {
+            throw new GLException("Size "+width+"x"+height+" exceeds on of the maxima renderbuffer size "+maxRenderbufferSize+": \n\t"+this);
         }
 
         resetSamplingSink(gl);
@@ -889,7 +1016,8 @@ public class FBObject {
 
         vStatus = GL.GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT; // always incomplete w/o attachments!
         if(DEBUG) {
-            System.err.println("FBObject.init(): "+this);
+            System.err.println("FBObject.init() END: "+this);
+            Thread.dumpStack();
         }
     }
 
@@ -912,7 +1040,7 @@ public class FBObject {
      * @param newHeight
      * @throws GLException in case of an error
      */
-    public final void reset(GL gl, int newWidth, int newHeight) {
+    public final void reset(final GL gl, final int newWidth, final int newHeight) {
         reset(gl, newWidth, newHeight, 0, false);
     }
 
@@ -941,7 +1069,7 @@ public class FBObject {
      *
      * @throws GLException in case of an error, i.e. size too big, etc ..
      */
-    public final void reset(GL gl, int newWidth, int newHeight, int newSamples, boolean resetSamplingSink) {
+    public final void reset(final GL gl, int newWidth, int newHeight, int newSamples, final boolean resetSamplingSink) {
         if( !initialized ) {
             init(gl, newWidth, newHeight, newSamples);
             return;
@@ -952,9 +1080,11 @@ public class FBObject {
         if( newWidth !=  width || newHeight !=  height || newSamples != samples ) {
             if( 0 >= newWidth )  { newWidth = 1; }
             if( 0 >= newHeight ) { newHeight = 1; }
-            if( newWidth > 2 + maxTextureSize  || newHeight > 2 + maxTextureSize ||
-                newWidth > maxRenderbufferSize || newHeight > maxRenderbufferSize  ) {
-                throw new GLException("size "+width+"x"+height+" exceeds on of the maxima [texture "+maxTextureSize+", renderbuffer "+maxRenderbufferSize+"]");
+            if( textureAttachmentCount > 0 && ( newWidth > 2 + maxTextureSize  || newHeight > 2 + maxTextureSize ) ) {
+                throw new GLException("Size "+newWidth+"x"+newHeight+" exceeds on of the maximum texture size "+maxTextureSize+": \n\t"+this);
+            }
+            if( newWidth > maxRenderbufferSize || newHeight > maxRenderbufferSize  ) {
+                throw new GLException("Size "+newWidth+"x"+newHeight+" exceeds on of the maxima renderbuffer size "+maxRenderbufferSize+": \n\t"+this);
             }
 
             if(DEBUG) {
@@ -963,6 +1093,16 @@ public class FBObject {
 
             final boolean wasBound = isBound();
 
+            final int sampleCountChange;
+            if( 0 < samples && 0 < newSamples || 0 == samples && 0 == newSamples ) {
+                sampleCountChange =  0; // keep MSAA settings
+            } else if( 0 == samples && 0 < newSamples ) {
+                sampleCountChange =  1; // add MSAA
+            } else if( 0 < samples && 0 == newSamples ) {
+                sampleCountChange = -1; // remove MSAA
+            } else {
+                throw new IllegalArgumentException("Error in sampleCount change: "+samples+" -> "+newSamples);
+            }
             width = newWidth;
             height = newHeight;
             samples = newSamples;
@@ -972,7 +1112,7 @@ public class FBObject {
                 samplingSink = new FBObject();
                 samplingSink.init(gl, width, height, 0);
             }
-            detachAllImpl(gl, true , true);
+            detachAllImpl(gl, true, true, sampleCountChange);
             if(resetSamplingSink) {
                 resetSamplingSink(gl);
             }
@@ -989,11 +1129,23 @@ public class FBObject {
         }
     }
 
+    private void validateAttachmentSize(final Attachment a) {
+        final int aWidth = a.getWidth();
+        final int aHeight = a.getHeight();
+
+        if( a instanceof TextureAttachment && ( aWidth > 2 + maxTextureSize  || aHeight > 2 + maxTextureSize ) ) {
+            throw new GLException("Size "+aWidth+"x"+aHeight+" of "+a+" exceeds on of the maximum texture size "+maxTextureSize+": \n\t"+this);
+        }
+        if( aWidth > maxRenderbufferSize || aHeight > maxRenderbufferSize  ) {
+            throw new GLException("Size "+aWidth+"x"+aHeight+" of "+a+" exceeds on of the maxima renderbuffer size "+maxRenderbufferSize+": \n\t"+this);
+        }
+    }
+
     /**
      * Writes the internal format of the attachments to the given GLCapabilities object.
      * @param caps the destination for format bits
      */
-    public final void formatToGLCapabilities(GLCapabilities caps) {
+    public final void formatToGLCapabilities(final GLCapabilities caps) {
         caps.setSampleBuffers(samples > 0);
         caps.setNumSamples(samples);
         caps.setDepthBits(0);
@@ -1025,7 +1177,7 @@ public class FBObject {
         return getStatusString(vStatus);
     }
 
-    public static final String getStatusString(int fbStatus) {
+    public static final String getStatusString(final int fbStatus) {
         switch(fbStatus) {
             case -1:
                 return "NOT A FBO";
@@ -1077,9 +1229,9 @@ public class FBObject {
             case GL.GL_FRAMEBUFFER_INCOMPLETE_FORMATS:
             case GL2GL3.GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER:
             case GL2GL3.GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER:
-            case GL2GL3.GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
+            case GL2ES3.GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:
             case GL3.GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS:
-                if(0 == colorAttachmentCount || null == depth) {
+                if(0 == colorbufferCount || null == depth) {
                     // we are in transition
                     return true;
                 }
@@ -1097,8 +1249,8 @@ public class FBObject {
         }
     }
 
-    private static int checkPreGLError(GL gl) {
-        int glerr = gl.glGetError();
+    private static int checkPreGLError(final GL gl) {
+        final int glerr = gl.glGetError();
         if(DEBUG && GL.GL_NO_ERROR != glerr) {
             System.err.println("Pre-existing GL error: "+toHexString(glerr));
             Thread.dumpStack();
@@ -1106,7 +1258,7 @@ public class FBObject {
         return glerr;
     }
 
-    private final boolean checkNoError(GL gl, int err, String exceptionMessage) throws GLException {
+    private final boolean checkNoError(final GL gl, final int err, final String exceptionMessage) throws GLException {
         if(GL.GL_NO_ERROR != err) {
             if(null != gl) {
                 destroy(gl);
@@ -1140,9 +1292,9 @@ public class FBObject {
      * @throws GLException in case the texture colorbuffer couldn't be allocated or MSAA has been chosen
      * @see #createColorTextureAttachment(GLProfile, boolean, int, int)
      */
-    public final TextureAttachment attachTexture2D(GL gl, int attachmentPoint, boolean alpha) throws GLException {
-        return (TextureAttachment)attachColorbuffer(gl, attachmentPoint,
-                     createColorTextureAttachment(gl.getGLProfile(), alpha, width, height));
+    public final TextureAttachment attachTexture2D(final GL gl, final int attachmentPoint, final boolean alpha) throws GLException {
+        return attachColorbuffer(gl, attachmentPoint,
+                                 createColorTextureAttachment(gl, alpha, width, height)).getTextureAttachment();
     }
 
     /**
@@ -1162,9 +1314,9 @@ public class FBObject {
      * @throws GLException in case the texture colorbuffer couldn't be allocated or MSAA has been chosen
      * @see #createColorTextureAttachment(GLProfile, boolean, int, int, int, int, int, int)
      */
-    public final TextureAttachment attachTexture2D(GL gl, int attachmentPoint, boolean alpha, int magFilter, int minFilter, int wrapS, int wrapT) throws GLException {
-        return (TextureAttachment)attachColorbuffer(gl, attachmentPoint,
-                     createColorTextureAttachment(gl.getGLProfile(), alpha, width, height, magFilter, minFilter, wrapS, wrapT));
+    public final TextureAttachment attachTexture2D(final GL gl, final int attachmentPoint, final boolean alpha, final int magFilter, final int minFilter, final int wrapS, final int wrapT) throws GLException {
+        return attachColorbuffer(gl, attachmentPoint,
+                                 createColorTextureAttachment(gl, alpha, width, height, magFilter, minFilter, wrapS, wrapT)).getTextureAttachment();
     }
 
     /**
@@ -1185,27 +1337,52 @@ public class FBObject {
      * @throws GLException in case the texture colorbuffer couldn't be allocated or MSAA has been chosen
      * @see #createColorTextureAttachment(int, int, int, int, int, int, int, int, int)
      */
-    public final TextureAttachment attachTexture2D(GL gl, int attachmentPoint,
-                                                   int internalFormat, int dataFormat, int dataType,
-                                                   int magFilter, int minFilter, int wrapS, int wrapT) throws GLException {
-        return (TextureAttachment)attachColorbuffer(gl, attachmentPoint,
-                     createColorTextureAttachment(internalFormat, width, height, dataFormat, dataType, magFilter, minFilter, wrapS, wrapT));
+    public final TextureAttachment attachTexture2D(final GL gl, final int attachmentPoint,
+                                                   final int internalFormat, final int dataFormat, final int dataType,
+                                                   final int magFilter, final int minFilter, final int wrapS, final int wrapT) throws GLException {
+        return attachColorbuffer(gl, attachmentPoint,
+                                 createColorTextureAttachment(internalFormat, width, height, dataFormat, dataType, magFilter, minFilter, wrapS, wrapT)).getTextureAttachment();
     }
 
     /**
      * Creates a {@link ColorAttachment}, selecting the format automatically.
+     * <p>
+     * For GLES3, sampling-sink {@link Colorbuffer} format <b>must be equal</b> w/ the sampling-source {@link Colorbuffer}.
+     * Implementation aligns w/ {@link #createColorTextureAttachment(GLProfile, boolean, int, int, int, int, int, int)}
+     * and is enforced via {@link #sampleSinkFormatMismatch(GL)}.
+     * </p>
      *
      * @param alpha set to <code>true</code> if you request alpha channel, otherwise <code>false</code>;
      * @return uninitialized ColorAttachment instance describing the new attached colorbuffer
      */
-    public final ColorAttachment createColorAttachment(boolean alpha) {
+    public final ColorAttachment createColorAttachment(final boolean alpha) {
         final int internalFormat;
+
         if( rgba8Avail ) {
             internalFormat = alpha ? GL.GL_RGBA8 : GL.GL_RGB8 ;
         } else {
             internalFormat = alpha ? GL.GL_RGBA4 : GL.GL_RGB565;
         }
-        return new ColorAttachment(internalFormat, samples, width, height, 0);
+        return createColorAttachment(internalFormat, samples, width, height);
+    }
+
+    /**
+     * Creates a {@link ColorAttachment}, selecting the format automatically.
+     * <p>
+     * For GLES3, sampling-sink {@link Colorbuffer} format <b>must be equal</b> w/ the sampling-source {@link Colorbuffer}.
+     * Implementation aligns w/ {@link #createColorTextureAttachment(GLProfile, boolean, int, int, int, int, int, int)}
+     * and is enforced via {@link #sampleSinkFormatMismatch(GL)}.
+     * </p>
+     *
+     * @param alpha set to <code>true</code> if you request alpha channel, otherwise <code>false</code>;
+     * @return uninitialized ColorAttachment instance describing the new attached colorbuffer
+     */
+    public static final ColorAttachment createColorAttachment(final int internalFormat, final int samples, final int width, final int height) {
+        return new ColorAttachment(internalFormat, samples, width, height, 0 /* name not yet determined */);
+    }
+
+    public static final RenderAttachment createRenderAttachment(final Type type, final int internalFormat, final int samples, final int width, final int height) {
+        return new RenderAttachment(type, internalFormat, samples, width, height, 0 /* name not yet determined */);
     }
 
     /**
@@ -1221,8 +1398,8 @@ public class FBObject {
      * @throws GLException in case the colorbuffer couldn't be allocated
      * @see #createColorAttachment(boolean)
      */
-    public final ColorAttachment attachColorbuffer(GL gl, int attachmentPoint, boolean alpha) throws GLException {
-        return (ColorAttachment) attachColorbuffer(gl, attachmentPoint, createColorAttachment(alpha));
+    public final ColorAttachment attachColorbuffer(final GL gl, final int attachmentPoint, final boolean alpha) throws GLException {
+        return attachColorbuffer(gl, attachmentPoint, createColorAttachment(alpha)).getColorAttachment();
     }
 
     /**
@@ -1237,13 +1414,13 @@ public class FBObject {
      * @throws GLException in case the colorbuffer couldn't be allocated
      * @throws IllegalArgumentException if <code>internalFormat</code> doesn't reflect a colorbuffer
      */
-    public final ColorAttachment attachColorbuffer(GL gl, int attachmentPoint, int internalFormat) throws GLException, IllegalArgumentException {
+    public final ColorAttachment attachColorbuffer(final GL gl, final int attachmentPoint, final int internalFormat) throws GLException, IllegalArgumentException {
         final Attachment.Type atype = Attachment.Type.determine(internalFormat);
         if( Attachment.Type.COLOR != atype ) {
             throw new IllegalArgumentException("colorformat invalid: "+toHexString(internalFormat)+", "+this);
         }
 
-        return (ColorAttachment) attachColorbuffer(gl, attachmentPoint, new ColorAttachment(internalFormat, samples, width, height, 0));
+        return attachColorbuffer(gl, attachmentPoint, createColorAttachment(internalFormat, samples, width, height)).getColorAttachment();
     }
 
     /**
@@ -1265,21 +1442,21 @@ public class FBObject {
      * @return newly attached {@link Colorbuffer} instance if bound and configured successfully, otherwise GLException is thrown
      * @throws GLException in case the colorbuffer couldn't be allocated or MSAA has been chosen in case of a {@link TextureAttachment}
      */
-    public final Colorbuffer attachColorbuffer(GL gl, int attachmentPoint, Colorbuffer colbuf) throws GLException {
+    public final Colorbuffer attachColorbuffer(final GL gl, final int attachmentPoint, final Colorbuffer colbuf) throws GLException {
         bind(gl);
         return attachColorbufferImpl(gl, attachmentPoint, colbuf);
     }
 
-    private final Colorbuffer attachColorbufferImpl(GL gl, int attachmentPoint, Colorbuffer colbuf) throws GLException {
+    private final Colorbuffer attachColorbufferImpl(final GL gl, final int attachmentPoint, final Colorbuffer colbuf) throws GLException {
         validateAddColorAttachment(attachmentPoint, colbuf);
 
+        validateAttachmentSize((Attachment)colbuf);
         final boolean initializedColorbuf = colbuf.initialize(gl);
         addColorAttachment(attachmentPoint, colbuf);
 
-        if(colbuf instanceof TextureAttachment) {
-            final TextureAttachment texA = (TextureAttachment) colbuf;
-
-            if(samples>0) {
+        if( colbuf.isTextureAttachment() ) {
+            final TextureAttachment texA = colbuf.getTextureAttachment();
+            if( samples > 0 ) {
                 removeColorAttachment(attachmentPoint, texA);
                 if(initializedColorbuf) {
                     texA.free(gl);
@@ -1299,8 +1476,8 @@ public class FBObject {
                     throw new GLException("attachTexture2D "+texA+" at "+attachmentPoint+" failed "+getStatusString()+", "+this);
                 }
             }
-        } else if(colbuf instanceof ColorAttachment) {
-            final ColorAttachment colA = (ColorAttachment) colbuf;
+        } else {
+            final ColorAttachment colA = colbuf.getColorAttachment();
 
             // Attach the color buffer
             gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER,
@@ -1346,7 +1523,7 @@ public class FBObject {
      * @see #getDepthAttachment()
      * @see #getStencilAttachment()
      */
-    public final void attachRenderbuffer(GL gl, Attachment.Type atype, int reqBits) throws GLException, IllegalArgumentException {
+    public final void attachRenderbuffer(final GL gl, final Attachment.Type atype, int reqBits) throws GLException, IllegalArgumentException {
         if( 0 > reqBits ) {
             reqBits = 24;
         }
@@ -1432,7 +1609,7 @@ public class FBObject {
      * @see #getDepthAttachment()
      * @see #getStencilAttachment()
      */
-    public final void attachRenderbuffer(GL gl, int internalFormat) throws GLException, IllegalArgumentException {
+    public final void attachRenderbuffer(final GL gl, final int internalFormat) throws GLException, IllegalArgumentException {
         final Attachment.Type atype = Attachment.Type.determine(internalFormat);
         if( Attachment.Type.DEPTH != atype && Attachment.Type.STENCIL != atype && Attachment.Type.DEPTH_STENCIL != atype ) {
             throw new IllegalArgumentException("renderformat invalid: "+toHexString(internalFormat)+", "+this);
@@ -1440,7 +1617,7 @@ public class FBObject {
         attachRenderbufferImpl(gl, atype, internalFormat);
     }
 
-    protected final void attachRenderbufferImpl(GL gl, Attachment.Type atype, int internalFormat) throws GLException {
+    protected final void attachRenderbufferImpl(final GL gl, final Attachment.Type atype, final int internalFormat) throws GLException {
         if( null != depth && ( Attachment.Type.DEPTH == atype || Attachment.Type.DEPTH_STENCIL == atype ) ) {
             throw new GLException("FBO depth buffer already attached (rb "+depth+"), type is "+atype+", "+toHexString(internalFormat)+", "+this);
         }
@@ -1452,33 +1629,36 @@ public class FBObject {
         attachRenderbufferImpl2(gl, atype, internalFormat);
     }
 
-    private final void attachRenderbufferImpl2(GL gl, Attachment.Type atype, int internalFormat) throws GLException {
+    private final void attachRenderbufferImpl2(final GL gl, final Attachment.Type atype, final int internalFormat) throws GLException {
         if( Attachment.Type.DEPTH == atype ) {
             if(null == depth) {
-                depth = new RenderAttachment(Type.DEPTH, internalFormat, samples, width, height, 0);
+                depth = createRenderAttachment(Type.DEPTH, internalFormat, samples, width, height);
             } else {
                 depth.setSize(width, height);
                 depth.setSamples(samples);
             }
+            validateAttachmentSize(depth);
             depth.initialize(gl);
         } else if( Attachment.Type.STENCIL == atype ) {
             if(null == stencil) {
-                stencil = new RenderAttachment(Type.STENCIL, internalFormat, samples, width, height, 0);
+                stencil = createRenderAttachment(Type.STENCIL, internalFormat, samples, width, height);
             } else {
                 stencil.setSize(width, height);
                 stencil.setSamples(samples);
             }
+            validateAttachmentSize(stencil);
             stencil.initialize(gl);
         } else if( Attachment.Type.DEPTH_STENCIL == atype ) {
             if(null == depth) {
                 if(null != stencil) {
                     throw new InternalError("XXX: DEPTH_STENCIL, depth was null, stencil not: "+this.toString());
                 }
-                depth = new RenderAttachment(Type.DEPTH_STENCIL, internalFormat, samples, width, height, 0);
+                depth = createRenderAttachment(Type.DEPTH_STENCIL, internalFormat, samples, width, height);
             } else {
                 depth.setSize(width, height);
                 depth.setSamples(samples);
             }
+            validateAttachmentSize(depth);
             depth.initialize(gl);
             // DEPTH_STENCIL shares buffer w/ depth and stencil
             stencil = depth;
@@ -1517,10 +1697,10 @@ public class FBObject {
      * @return the detached Colorbuffer
      * @throws IllegalArgumentException
      */
-    public final Colorbuffer detachColorbuffer(GL gl, int attachmentPoint, boolean dispose) throws IllegalArgumentException {
+    public final Colorbuffer detachColorbuffer(final GL gl, final int attachmentPoint, final boolean dispose) throws IllegalArgumentException {
         bind(gl);
 
-        final Colorbuffer res = detachColorbufferImpl(gl, attachmentPoint, dispose ? DetachAction.DISPOSE : DetachAction.NONE);
+        final Colorbuffer res = detachColorbufferImpl(gl, attachmentPoint, dispose ? DetachAction.DISPOSE : DetachAction.NONE, 0);
         if(null == res) {
             throw new IllegalArgumentException("ColorAttachment at "+attachmentPoint+", not attached, "+this);
         }
@@ -1530,8 +1710,8 @@ public class FBObject {
         return res;
     }
 
-    private final Colorbuffer detachColorbufferImpl(GL gl, int attachmentPoint, DetachAction detachAction) {
-        Colorbuffer colbuf = colorAttachmentPoints[attachmentPoint]; // shortcut, don't validate here
+    private final Colorbuffer detachColorbufferImpl(final GL gl, final int attachmentPoint, final DetachAction detachAction, final int sampleCountChange) {
+        Colorbuffer colbuf = colorbufferAttachments[attachmentPoint]; // shortcut, don't validate here
 
         if(null == colbuf) {
             return null;
@@ -1539,8 +1719,8 @@ public class FBObject {
 
         removeColorAttachment(attachmentPoint, colbuf);
 
-        if(colbuf instanceof TextureAttachment) {
-            final TextureAttachment texA = (TextureAttachment) colbuf;
+        if( colbuf.isTextureAttachment() ) {
+            final TextureAttachment texA = colbuf.getTextureAttachment();
             if( 0 != texA.getName() ) {
                 gl.glFramebufferTexture2D(GL.GL_FRAMEBUFFER,
                               GL.GL_COLOR_ATTACHMENT0 + attachmentPoint,
@@ -1555,17 +1735,17 @@ public class FBObject {
                 }
             }
             if(DetachAction.RECREATE == detachAction) {
-                if(samples == 0) {
-                    // stay non MSAA
-                    texA.setSize(width, height);
-                } else {
-                    // switch to MSAA
+                if( 0 < sampleCountChange ) {
+                    // switch to MSAA: TextureAttachment -> ColorAttachment
                     colbuf = createColorAttachment(hasAlpha(texA.format));
+                } else {
+                    // keep MSAA settings
+                    texA.setSize(width, height);
                 }
                 attachColorbufferImpl(gl, attachmentPoint, colbuf);
             }
-        } else if(colbuf instanceof ColorAttachment) {
-            final ColorAttachment colA = (ColorAttachment) colbuf;
+        } else {
+            final ColorAttachment colA = colbuf.getColorAttachment();
             if( 0 != colA.getName() ) {
                 gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER,
                                              GL.GL_COLOR_ATTACHMENT0+attachmentPoint,
@@ -1579,19 +1759,22 @@ public class FBObject {
                 }
             }
             if(DetachAction.RECREATE == detachAction) {
-                if(samples > 0) {
-                    // stay MSAA
+                if( 0 <= sampleCountChange || null == samplingColorSink ) {
+                    // keep ColorAttachment,
+                    // including 'switch to non-MSAA' if no samplingColorSink is available
+                    // to determine whether a TextureAttachment or ColorAttachment is desired!
                     colA.setSize(width, height);
                     colA.setSamples(samples);
                 } else {
                     // switch to non MSAA
-                    if(null != samplingSinkTexture) {
-                        colbuf = createColorTextureAttachment(samplingSinkTexture.format, width, height,
-                                                              samplingSinkTexture.dataFormat, samplingSinkTexture.dataType,
-                                                              samplingSinkTexture.magFilter, samplingSinkTexture.minFilter,
-                                                              samplingSinkTexture.wrapS, samplingSinkTexture.wrapT);
+                    if( samplingColorSink.isTextureAttachment() ) {
+                        final TextureAttachment samplingTextureSink = samplingColorSink.getTextureAttachment();
+                        colbuf = createColorTextureAttachment(samplingTextureSink.format, width, height,
+                                                              samplingTextureSink.dataFormat, samplingTextureSink.dataType,
+                                                              samplingTextureSink.magFilter, samplingTextureSink.minFilter,
+                                                              samplingTextureSink.wrapS, samplingTextureSink.wrapT);
                     } else {
-                        colbuf = createColorTextureAttachment(gl.getGLProfile(), true, width, height);
+                        colbuf = createColorAttachment(samplingColorSink.getFormat(), 0, width, height);
                     }
                 }
                 attachColorbuffer(gl, attachmentPoint, colbuf);
@@ -1600,16 +1783,16 @@ public class FBObject {
         return colbuf;
     }
 
-    private final void freeAllColorbufferImpl(GL gl) {
+    private final void freeAllColorbufferImpl(final GL gl) {
         for(int i=0; i<maxColorAttachments; i++) {
-            final Colorbuffer colbuf = colorAttachmentPoints[i]; // shortcut, don't validate here
+            final Colorbuffer colbuf = colorbufferAttachments[i]; // shortcut, don't validate here
 
             if(null == colbuf) {
                 return;
             }
 
-            if(colbuf instanceof TextureAttachment) {
-                final TextureAttachment texA = (TextureAttachment) colbuf;
+            if( colbuf.isTextureAttachment() ) {
+                final TextureAttachment texA = colbuf.getTextureAttachment();
                 if( 0 != texA.getName() ) {
                     gl.glFramebufferTexture2D(GL.GL_FRAMEBUFFER,
                                   GL.GL_COLOR_ATTACHMENT0 + i,
@@ -1617,8 +1800,8 @@ public class FBObject {
                     gl.glBindTexture(GL.GL_TEXTURE_2D, 0);
                 }
                 texA.free(gl);
-            } else if(colbuf instanceof ColorAttachment) {
-                final ColorAttachment colA = (ColorAttachment) colbuf;
+            } else {
+                final ColorAttachment colA = colbuf.getColorAttachment();
                 if( 0 != colA.getName() ) {
                     gl.glFramebufferRenderbuffer(GL.GL_FRAMEBUFFER,
                                                  GL.GL_COLOR_ATTACHMENT0 + i,
@@ -1635,7 +1818,7 @@ public class FBObject {
      * @param dispose true if the Colorbuffer shall be disposed
      * @param reqAType {@link Type#DEPTH}, {@link Type#DEPTH} or {@link Type#DEPTH_STENCIL}
      */
-    public final void detachRenderbuffer(GL gl, Attachment.Type atype, boolean dispose) throws IllegalArgumentException {
+    public final void detachRenderbuffer(final GL gl, final Attachment.Type atype, final boolean dispose) throws IllegalArgumentException {
         bind(gl);
         detachRenderbufferImpl(gl, atype, dispose ? DetachAction.DISPOSE : DetachAction.NONE);
         if(DEBUG) {
@@ -1657,7 +1840,7 @@ public class FBObject {
         return res;
     }
 
-    private final void detachRenderbufferImpl(GL gl, Attachment.Type atype, DetachAction detachAction) throws IllegalArgumentException {
+    private final void detachRenderbufferImpl(final GL gl, Attachment.Type atype, final DetachAction detachAction) throws IllegalArgumentException {
         switch ( atype ) {
             case DEPTH:
             case STENCIL:
@@ -1763,7 +1946,7 @@ public class FBObject {
         }
     }
 
-    private final void freeAllRenderbufferImpl(GL gl) throws IllegalArgumentException {
+    private final void freeAllRenderbufferImpl(final GL gl) throws IllegalArgumentException {
         // Note: DEPTH_STENCIL shares buffer w/ depth and stencil
         final boolean packed = isDepthStencilPackedFormat();
         if( null != depth ) {
@@ -1788,15 +1971,15 @@ public class FBObject {
      * and disposes them.
      * <p>Leaves the FBO bound, if initialized!</p>
      * <p>
-     * An attached sampling sink texture will be detached as well, see {@link #getSamplingSink()}.
+     * An attached sampling sink texture will be detached as well, see {@link #getSamplingTextureSink()}.
      * </p>
      * @param gl the current GL context
      */
-    public final void detachAll(GL gl) {
+    public final void detachAll(final GL gl) {
         if(null != samplingSink) {
             samplingSink.detachAll(gl);
         }
-        detachAllImpl(gl, true/* detachNonColorbuffer */, false /* recreate */);
+        detachAllImpl(gl, true/* detachNonColorbuffer */, false /* recreate */, 0);
     }
 
     /**
@@ -1804,26 +1987,26 @@ public class FBObject {
      * and disposes them.
      * <p>Leaves the FBO bound, if initialized!</p>
      * <p>
-     * An attached sampling sink texture will be detached as well, see {@link #getSamplingSink()}.
+     * An attached sampling sink texture will be detached as well, see {@link #getSamplingTextureSink()}.
      * </p>
      * @param gl the current GL context
      */
-    public final void detachAllColorbuffer(GL gl) {
+    public final void detachAllColorbuffer(final GL gl) {
         if(null != samplingSink) {
             samplingSink.detachAllColorbuffer(gl);
         }
-        detachAllImpl(gl, false/* detachNonColorbuffer */, false /* recreate */);
+        detachAllImpl(gl, false/* detachNonColorbuffer */, false /* recreate */, 0);
     }
 
     /**
      * Detaches all {@link TextureAttachment}s and disposes them.
      * <p>Leaves the FBO bound, if initialized!</p>
      * <p>
-     * An attached sampling sink texture will be detached as well, see {@link #getSamplingSink()}.
+     * An attached sampling sink texture will be detached as well, see {@link #getSamplingTextureSink()}.
      * </p>
      * @param gl the current GL context
      */
-    public final void detachAllTexturebuffer(GL gl) {
+    public final void detachAllTexturebuffer(final GL gl) {
         if( !isInitialized() ) {
             return;
         }
@@ -1832,8 +2015,8 @@ public class FBObject {
         }
         bind(gl);
         for(int i=0; i<maxColorAttachments; i++) {
-            if(colorAttachmentPoints[i] instanceof TextureAttachment) {
-                detachColorbufferImpl(gl, i, DetachAction.DISPOSE);
+            if( colorbufferAttachments[i].isTextureAttachment() ) {
+                detachColorbufferImpl(gl, i, DetachAction.DISPOSE, 0);
             }
         }
         if(DEBUG) {
@@ -1841,7 +2024,7 @@ public class FBObject {
         }
     }
 
-    public final void detachAllRenderbuffer(GL gl) {
+    public final void detachAllRenderbuffer(final GL gl) {
         if( !isInitialized() ) {
             return;
         }
@@ -1852,7 +2035,7 @@ public class FBObject {
         detachRenderbufferImpl(gl, Attachment.Type.DEPTH_STENCIL, DetachAction.DISPOSE);
     }
 
-    private final void detachAllImpl(GL gl, boolean detachNonColorbuffer, boolean recreate) {
+    private final void detachAllImpl(final GL gl, final boolean detachNonColorbuffer, final boolean recreate, final int sampleCountChange) {
         if( !isInitialized() ) {
             return;
         }
@@ -1867,9 +2050,9 @@ public class FBObject {
                 }
             }
             for(int i=0; i<maxColorAttachments; i++) {
-                detachColorbufferImpl(gl, i, recreate ? DetachAction.RECREATE : DetachAction.DISPOSE);
+                detachColorbufferImpl(gl, i, recreate ? DetachAction.RECREATE : DetachAction.DISPOSE, sampleCountChange);
             }
-            if( !recreate && colorAttachmentCount>0 ) {
+            if( !recreate && colorbufferCount>0 ) {
                 throw new InternalError("Non zero ColorAttachments "+this);
             }
 
@@ -1896,7 +2079,7 @@ public class FBObject {
     /**
      * @param gl the current GL context
      */
-    public final void destroy(GL gl) {
+    public final void destroy(final GL gl) {
         if(!initialized) {
             return;
         }
@@ -1908,14 +2091,14 @@ public class FBObject {
             samplingSink.destroy(gl);
         }
 
-        detachAllImpl(gl, true /* detachNonColorbuffer */, false /* recreate */);
+        detachAllImpl(gl, true /* detachNonColorbuffer */, false /* recreate */, 0);
 
         // cache FB names, preset exposed to zero,
         // braking ties w/ GL/GLContext link to getReadFramebuffer()/getWriteFramebuffer()
         final int fb_cache = fbName;
         fbName = 0;
 
-        int name[] = new int[1];
+        final int name[] = new int[1];
         if(0!=fb_cache) {
             name[0] = fb_cache;
             gl.glDeleteFramebuffers(1, name, 0);
@@ -1930,20 +2113,33 @@ public class FBObject {
     private final boolean sampleSinkSizeMismatch() {
         return samplingSink.getWidth() != width || samplingSink.getHeight() != height ;
     }
-    private final boolean sampleSinkTexMismatch() {
-        return null == samplingSinkTexture || 0 == samplingSinkTexture.getName() ;
+    private final boolean sampleColorsinkUninit() {
+        return null != samplingColorSink && 0 == samplingColorSink.getName() ;
     }
     private final boolean sampleSinkDepthStencilMismatch() {
-        final boolean depthMismatch   = ( null != depth && null == samplingSink.depth ) ||
-                                        ( null != depth && null != samplingSink.depth &&
+        final boolean depthMismatch   = null != depth &&
+                                        ( null == samplingSink.depth ||
                                           depth.format != samplingSink.depth.format );
 
-        final boolean stencilMismatch = ( null != stencil && null == samplingSink.stencil ) ||
-                                        ( null != stencil && null != samplingSink.stencil &&
+        final boolean stencilMismatch = null != stencil &&
+                                        ( null == samplingSink.stencil ||
                                           stencil.format != samplingSink.stencil.format );
 
         return depthMismatch || stencilMismatch;
     }
+    /**
+     * For GLES3, sampling-sink {@link Colorbuffer} format <b>must be equal</b> w/ the sampling-source {@link Colorbuffer}.
+     * Implementation aligns w/ {@link #createColorTextureAttachment(GLProfile, boolean, int, int, int, int, int, int)}
+     * and {@link #createColorAttachment(boolean)}.
+     */
+    private final boolean sampleSinkFormatMismatch(final GL gl) {
+        if( null != samplingColorSink && getColorbufferCount() > 0 && gl.isGL2ES3() ) {
+            final Attachment ca = (Attachment)getColorbuffer(0); // should be at attachment-point 0
+            return ( null != ca && ca.format != samplingColorSink.getFormat() ) ||
+                   hasAlpha(samplingColorSink.getFormat()) != hasAttachmentUsingAlpha();
+        }
+        return false;
+    }
 
     /**
      * Manually reset the MSAA sampling sink, if used.
@@ -1962,34 +2158,42 @@ public class FBObject {
      * @param gl the current GL context
      * @throws GLException in case of an error, i.e. size too big, etc ..
      */
-    public final void resetSamplingSink(GL gl) throws GLException {
-        if(0 == samples) {
+    public final void resetSamplingSink(final GL gl) throws GLException {
+        if(DEBUG) {
+            System.err.println("FBObject.resetSamplingSink.0");
+        }
+        if( 0 == samples ) {
             // MSAA off
             if(null != samplingSink && samplingSink.initialized) {
                 // cleanup
                 samplingSink.detachAll(gl);
             }
+            if(DEBUG) {
+                System.err.println("FBObject.resetSamplingSink.X1: zero samples \n\tTHIS "+this);
+            }
             return;
         }
 
-        if(null == samplingSink ) {
+        if( null == samplingSink ) {
             samplingSink = new FBObject();
         }
 
-        if(!samplingSink.initialized) {
+        if( !samplingSink.initialized ) {
             samplingSink.init(gl, width, height, 0);
         }
 
+        if(DEBUG) {
+            System.err.println("FBObject.resetSamplingSink.1: \n\tTHIS "+this+",\n\tSINK "+samplingSink);
+        }
+        boolean sampleSinkFormatMismatch = sampleSinkFormatMismatch(gl);
         boolean sampleSinkSizeMismatch = sampleSinkSizeMismatch();
-        boolean sampleSinkTexMismatch = sampleSinkTexMismatch();
         boolean sampleSinkDepthStencilMismatch = sampleSinkDepthStencilMismatch();
+        boolean sampleColorsinkUninit = sampleColorsinkUninit();
 
-        /** if(DEBUG) {
-            System.err.println("FBObject.resetSamplingSink.0: \n\tTHIS "+this+",\n\tSINK "+samplesSink+
-                               "\n\t size "+sampleSinkSizeMismatch +", tex "+sampleSinkTexMismatch +", depthStencil "+sampleSinkDepthStencilMismatch);
-        } */
-
-        if(!sampleSinkSizeMismatch && !sampleSinkTexMismatch && !sampleSinkDepthStencilMismatch) {
+        if(!sampleSinkFormatMismatch && !sampleSinkSizeMismatch && !sampleColorsinkUninit && !sampleSinkDepthStencilMismatch) {
+            if(DEBUG) {
+                System.err.println("FBObject.resetSamplingSink.X2: Matching: format "+!sampleSinkFormatMismatch+", size "+!sampleSinkSizeMismatch +", csUninit "+!sampleColorsinkUninit +", depthStencil "+!sampleSinkDepthStencilMismatch);
+            }
             // all properties match ..
             return;
         }
@@ -1997,23 +2201,36 @@ public class FBObject {
         unbind(gl);
 
         if(DEBUG) {
-            System.err.println("FBObject.resetSamplingSink: BEGIN\n\tTHIS "+this+",\n\tSINK "+samplingSink+
-                               "\n\t size "+sampleSinkSizeMismatch +", tex "+sampleSinkTexMismatch +", depthStencil "+sampleSinkDepthStencilMismatch);
+            System.err.println("FBObject.resetSamplingSink.2: Mismatch. Matching: format "+!sampleSinkFormatMismatch+", size "+!sampleSinkSizeMismatch +", csUninit "+!sampleColorsinkUninit +", depthStencil "+!sampleSinkDepthStencilMismatch);
+            Thread.dumpStack();
         }
 
         if( sampleSinkDepthStencilMismatch ) {
             samplingSink.detachAllRenderbuffer(gl);
         }
 
-        if( sampleSinkSizeMismatch ) {
+        final Colorbuffer preSamplingColorSink = samplingColorSink;
+        final boolean samplingColorSinkShallBeTA = null == preSamplingColorSink || preSamplingColorSink.isTextureAttachment();
+
+        if( sampleSinkFormatMismatch ) {
+            samplingSink.detachAllColorbuffer(gl);
+            samplingColorSink = null;
+        } else if( sampleSinkSizeMismatch ) {
             samplingSink.reset(gl, width, height);
         }
 
-        if(null == samplingSinkTexture) {
-            samplingSinkTexture = samplingSink.attachTexture2D(gl, 0, true);
-        } else if( 0 == samplingSinkTexture.getName() ) {
-            samplingSinkTexture.setSize(width, height);
-            samplingSink.attachColorbuffer(gl, 0, samplingSinkTexture);
+        if(null == samplingColorSink) {
+            final boolean hasAlpha = hasAttachmentUsingAlpha();
+            if( samplingColorSinkShallBeTA ) {
+                samplingColorSink = samplingSink.attachTexture2D(gl, 0, hasAlpha);
+            } else {
+                samplingColorSink = samplingSink.attachColorbuffer(gl, 0, hasAlpha);
+            }
+        } else if( 0 == samplingColorSink.getName() ) {
+            // final boolean dispose = true;
+            // detachColorbufferImpl(gl, 0, dispose ? DetachAction.DISPOSE : DetachAction.NONE);
+            ((Attachment)samplingColorSink).setSize(width, height);
+            samplingSink.attachColorbuffer(gl, 0, samplingColorSink);
         }
 
         if( sampleSinkDepthStencilMismatch ) {
@@ -2023,17 +2240,18 @@ public class FBObject {
             }
         }
 
+        sampleSinkFormatMismatch = sampleSinkFormatMismatch(gl);
         sampleSinkSizeMismatch = sampleSinkSizeMismatch();
-        sampleSinkTexMismatch = sampleSinkTexMismatch();
         sampleSinkDepthStencilMismatch = sampleSinkDepthStencilMismatch();
-        if(sampleSinkSizeMismatch || sampleSinkTexMismatch || sampleSinkDepthStencilMismatch) {
+        sampleColorsinkUninit = sampleColorsinkUninit();
+        if(sampleSinkFormatMismatch || sampleSinkSizeMismatch || sampleColorsinkUninit || sampleSinkDepthStencilMismatch) {
             throw new InternalError("Samples sink mismatch after reset: \n\tTHIS "+this+",\n\t SINK "+samplingSink+
-                                    "\n\t size "+sampleSinkSizeMismatch +", tex "+sampleSinkTexMismatch +", depthStencil "+sampleSinkDepthStencilMismatch);
+                                    "\n\t Mismatch. Matching: format "+!sampleSinkFormatMismatch+", size "+!sampleSinkSizeMismatch +", csUninit "+!sampleColorsinkUninit +", depthStencil "+!sampleSinkDepthStencilMismatch);
         }
 
         if(DEBUG) {
-            System.err.println("FBObject.resetSamplingSink: END\n\tTHIS "+this+",\n\tSINK "+samplingSink+
-                               "\n\t size "+sampleSinkSizeMismatch +", tex "+sampleSinkTexMismatch +", depthStencil "+sampleSinkDepthStencilMismatch);
+            System.err.println("FBObject.resetSamplingSink.XX: END\n\tTHIS "+this+",\n\tSINK "+samplingSink+
+                               "\n\t Matching: format "+!sampleSinkFormatMismatch+", size "+!sampleSinkSizeMismatch +", csUninit "+!sampleColorsinkUninit +", depthStencil "+!sampleSinkDepthStencilMismatch);
         }
     }
 
@@ -2043,17 +2261,17 @@ public class FBObject {
      * @return the previous sampling sink or null if none was attached
      * @throws GLException if this FBO doesn't use MSAA or the given sink uses MSAA itself
      */
-    public FBObject setSamplingSink(FBObject newSamplingSink) throws GLException {
+    public FBObject setSamplingSink(final FBObject newSamplingSink) throws GLException {
         final FBObject prev = samplingSink;
         if( null == newSamplingSink) {
             samplingSink = null;
-            samplingSinkTexture = null;
+            samplingColorSink = null;
         } else if( samples > 0 ) {
             if( newSamplingSink.getNumSamples() > 0 ) {
                 throw new GLException("SamplingSink FBO cannot use MSAA itself: "+newSamplingSink);
             }
             samplingSink = newSamplingSink;
-            samplingSinkTexture = (TextureAttachment) newSamplingSink.getColorbuffer(0);
+            samplingColorSink = newSamplingSink.getColorbuffer(0);
         } else {
             throw new GLException("Setting SamplingSink for non MSAA FBO not allowed: "+this);
         }
@@ -2074,7 +2292,7 @@ public class FBObject {
      * @param gl the current GL context
      * @throws GLException
      */
-    public final void bind(GL gl) throws GLException {
+    public final void bind(final GL gl) throws GLException {
         if(!bound || fbName != gl.getBoundFramebuffer(GL.GL_FRAMEBUFFER)) {
             checkInitialized();
             if(samples > 0 && fullFBOSupport) {
@@ -2100,7 +2318,7 @@ public class FBObject {
      * @param gl the current GL context
      * @throws GLException
      */
-    public final void unbind(GL gl) throws GLException {
+    public final void unbind(final GL gl) throws GLException {
         if(bound) {
             if(fullFBOSupport) {
                 // default read/draw buffers, may utilize GLContext/GLDrawable override of
@@ -2132,7 +2350,7 @@ public class FBObject {
      * </p>
      * @param gl the current GL context
      */
-    public final boolean isBound(GL gl) {
+    public final boolean isBound(final GL gl) {
         bound = bound &&  fbName != gl.getBoundFramebuffer(GL.GL_FRAMEBUFFER) ;
         return bound;
     }
@@ -2142,7 +2360,7 @@ public class FBObject {
 
     /**
      * If multisampling is being used and flagged dirty by a previous call of {@link #bind(GL)} or after initialization,
-     * the msaa-buffers are sampled to it's sink {@link #getSamplingSink()}.
+     * the msaa-buffers are sampled to it's sink {@link #getSamplingTextureSink()}.
      * <p>
      * Method also resets the sampling sink configuration via {@link #resetSamplingSink(GL)} if used and required.
      * </p>
@@ -2164,7 +2382,7 @@ public class FBObject {
      * @param ta {@link TextureAttachment} to use, prev. attached w/  {@link #attachTexture2D(GL, int, boolean, int, int, int, int) attachTexture2D(..)}
      * @throws IllegalArgumentException
      */
-    public final void syncSamplingSink(GL gl) {
+    public final void syncSamplingSink(final GL gl) {
         markUnbound();
         if(samples>0 && samplingSinkDirty) {
             samplingSinkDirty = false;
@@ -2187,22 +2405,24 @@ public class FBObject {
     }
 
     /**
-     * Bind the given texture colorbuffer.
+     * {@link #syncSamplingSink(GL) Synchronize the sampling sink} and bind the given {@link TextureAttachment}, if not <code>null</code>.
      *
-     * <p>If using multiple texture units, ensure you call {@link GL#glActiveTexture(int)} first!</p>
+     * <p>If using a {@link TextureAttachment} and multiple texture units, ensure you call {@link GL#glActiveTexture(int)} first!</p>
      *
      * <p>{@link #syncSamplingSink(GL)} is being called</p>
      *
      * <p>Leaves the FBO unbound!</p>
      *
      * @param gl the current GL context
-     * @param ta {@link TextureAttachment} to use, prev. attached w/  {@link #attachTexture2D(GL, int, boolean, int, int, int, int) attachTexture2D(..)}
+     * @param ta {@link TextureAttachment} to use, prev. attached w/  {@link #attachTexture2D(GL, int, boolean, int, int, int, int) attachTexture2D(..)},
+     *           may be <code>null</code> in case no {@link TextureAttachment} is used.
      * @throws IllegalArgumentException
      */
-    public final void use(GL gl, TextureAttachment ta) throws IllegalArgumentException {
-        if(null == ta) { throw new IllegalArgumentException("Null TextureAttachment, this: "+toString()); }
+    public final void use(final GL gl, final TextureAttachment ta) throws IllegalArgumentException {
         syncSamplingSink(gl);
-        gl.glBindTexture(GL.GL_TEXTURE_2D, ta.getName()); // use it ..
+        if( null != ta ) {
+            gl.glBindTexture(GL.GL_TEXTURE_2D, ta.getName()); // use it ..
+        }
     }
 
     /**
@@ -2210,7 +2430,7 @@ public class FBObject {
      *
      * <p>Leaves the FBO unbound.</p>
      */
-    public final void unuse(GL gl) {
+    public final void unuse(final GL gl) {
         unbind(gl);
         gl.glBindTexture(GL.GL_TEXTURE_2D, 0); // don't use it
     }
@@ -2229,7 +2449,7 @@ public class FBObject {
      * @param bits 16, 24 or 32 bits
      * @throws GLException if {@link #init(GL)} hasn't been called.
      */
-    public final boolean supportsDepth(int bits) throws GLException {
+    public final boolean supportsDepth(final int bits) throws GLException {
         checkInitialized();
         switch(bits) {
             case 16: return true;
@@ -2244,7 +2464,7 @@ public class FBObject {
      * @param bits 1, 4, 8 or 16 bits
      * @throws GLException if {@link #init(GL)} hasn't been called.
      */
-    public final boolean supportsStencil(int bits) throws GLException {
+    public final boolean supportsStencil(final int bits) throws GLException {
         checkInitialized();
         switch(bits) {
             case  1: return stencil01Avail;
@@ -2289,8 +2509,10 @@ public class FBObject {
     /** Returns the framebuffer name to read from. Depending on multisampling, this may be a different framebuffer. */
     public final int getReadFramebuffer() { return ( samples > 0 ) ? samplingSink.getReadFramebuffer() : fbName; }
     public final int getDefaultReadBuffer() { return GL.GL_COLOR_ATTACHMENT0; }
-    /** Return the number of color/texture attachments */
-    public final int getColorAttachmentCount() { return colorAttachmentCount; }
+    /** Return the number of attached {@link Colorbuffer}s */
+    public final int getColorbufferCount() { return colorbufferCount; }
+    /** Return the number of attached {@link TextureAttachment}s */
+    public final int getTextureAttachmentCount() { return textureAttachmentCount; }
     /** Return the stencil {@link RenderAttachment} attachment, if exist. Maybe share the same {@link Attachment#getName()} as {@link #getDepthAttachment()}, if packed depth-stencil is being used. */
     public final RenderAttachment getStencilAttachment() { return stencil; }
     /** Return the depth {@link RenderAttachment} attachment. Maybe share the same {@link Attachment#getName()} as {@link #getStencilAttachment()}, if packed depth-stencil is being used. */
@@ -2299,8 +2521,9 @@ public class FBObject {
     /** Return the complete multisampling {@link FBObject} sink, if using multisampling. */
     public final FBObject getSamplingSinkFBO() { return samplingSink; }
 
-    /** Return the multisampling {@link TextureAttachment} sink, if using multisampling. */
-    public final TextureAttachment getSamplingSink() { return samplingSinkTexture; }
+    /** Return the multisampling {@link Colorbuffer} sink, if using multisampling. */
+    public final Colorbuffer getSamplingSink() { return samplingColorSink; }
+
     /**
      * Returns <code>true</code> if the multisampling colorbuffer (msaa-buffer)
      * has been flagged dirty by a previous call of {@link #bind(GL)},
@@ -2312,15 +2535,15 @@ public class FBObject {
 
     @Override
     public final String toString() {
-        final String caps = null != colorAttachmentPoints ? Arrays.asList(colorAttachmentPoints).toString() : null ;
+        final String caps = null != colorbufferAttachments ? Arrays.asList(colorbufferAttachments).toString() : null ;
         return "FBO[name r/w "+fbName+"/"+getReadFramebuffer()+", init "+initialized+", bound "+bound+", size "+width+"x"+height+
                ", samples "+samples+"/"+maxSamples+", depth "+depth+", stencil "+stencil+
-               ", color attachments: "+colorAttachmentCount+"/"+maxColorAttachments+
-               ": "+caps+", msaa-sink "+samplingSinkTexture+", hasSamplesSink "+(null != samplingSink)+
-               ", state "+getStatusString()+", obj "+toHexString(objectHashCode())+"]";
+               ", colorbuffer attachments: "+colorbufferCount+"/"+maxColorAttachments+", with "+textureAttachmentCount+" textures"+
+               ": "+caps+", msaa["+samplingColorSink+", hasSink "+(null != samplingSink)+
+               ", dirty "+samplingSinkDirty+"], state "+getStatusString()+", obj "+toHexString(objectHashCode())+"]";
     }
 
-    private final void updateStatus(GL gl) {
+    private final void updateStatus(final GL gl) {
         if( 0 == fbName ) {
             vStatus = -1;
         } else {
diff --git a/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java b/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java
index 6b1bb0e..4ef717a 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLAutoDrawableDelegate.java
@@ -36,6 +36,7 @@ import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLContext;
 import javax.media.opengl.GLDrawable;
 import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLException;
 
 import com.jogamp.common.util.locks.LockFactory;
@@ -83,7 +84,7 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
      *                  and no further lifecycle handling is applied.
      * @param lock optional custom {@link RecursiveLock}.
      */
-    public GLAutoDrawableDelegate(GLDrawable drawable, GLContext context, Object upstreamWidget, boolean ownDevice, RecursiveLock lock) {
+    public GLAutoDrawableDelegate(final GLDrawable drawable, final GLContext context, final Object upstreamWidget, final boolean ownDevice, final RecursiveLock lock) {
         super((GLDrawableImpl)drawable, (GLContextImpl)context, ownDevice);
         if(null == drawable) {
             throw new IllegalArgumentException("null drawable");
@@ -101,8 +102,23 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
         super.defaultWindowRepaintOp();
     }
 
-    /** Implementation to handle resize events from the windowing system. All required locks are being claimed. */
-    public final void windowResizedOp(int newWidth, int newHeight) {
+    /**
+     * Handling resize events from the windowing system.
+     * <p>
+     * Implementation:
+     * <ul>
+     *   <li>resizes {@link #getDelegatedDrawable() the GLDrawable}, if offscreen,</li>
+     *   <li>triggers a pending {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape events}, and</li>
+     *   <li>issues a {@link #display()} call, if no animator is present.</li>
+     * </ul>
+     * </p>
+     * <p>
+     * All required locks are being claimed.
+     * </p>
+     * @param newWidth new width in pixel units
+     * @param newWidth new height in pixel units
+     */
+    public final void windowResizedOp(final int newWidth, final int newHeight) {
         super.defaultWindowResizedOp(newWidth, newHeight);
     }
 
@@ -127,7 +143,7 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
     private final RecursiveLock lock;
 
     @Override
-    protected final RecursiveLock getLock() { return lock; }
+    public final RecursiveLock getUpstreamLock() { return lock; }
 
     @Override
     public final Object getUpstreamWidget() {
@@ -138,7 +154,7 @@ public class GLAutoDrawableDelegate extends GLAutoDrawableBase implements GLAuto
      * Set the upstream UI toolkit object.
      * @see #getUpstreamWidget()
      */
-    public final void setUpstreamWidget(Object newUpstreamWidget) {
+    public final void setUpstreamWidget(final Object newUpstreamWidget) {
         upstreamWidget = newUpstreamWidget;
     }
 
diff --git a/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java b/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java
index 1b41876..bfd5fe1 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLEventListenerState.java
@@ -45,7 +45,9 @@ import javax.media.opengl.GLRunnable;
 
 import jogamp.opengl.Debug;
 
+import com.jogamp.common.util.locks.RecursiveLock;
 import com.jogamp.nativewindow.MutableGraphicsConfiguration;
+import com.jogamp.opengl.util.GLDrawableUtil;
 
 /**
  * GLEventListenerState is holding {@link GLAutoDrawable} components crucial
@@ -70,13 +72,16 @@ import com.jogamp.nativewindow.MutableGraphicsConfiguration;
 public class GLEventListenerState {
     private static final boolean DEBUG = Debug.debug("GLDrawable") || Debug.debug("GLEventListenerState");
 
-    private GLEventListenerState(AbstractGraphicsDevice upstreamDevice, boolean proxyOwnsUpstreamDevice, AbstractGraphicsDevice device,
-                                 GLCapabilitiesImmutable caps,
-                                 GLContext context, int count, GLAnimatorControl anim, boolean animStarted) {
+    private GLEventListenerState(final AbstractGraphicsDevice upstreamDevice, final boolean proxyOwnsUpstreamDevice, final AbstractGraphicsDevice device,
+                                 final GLCapabilitiesImmutable caps,
+                                 final RecursiveLock upstreamLock, final NativeSurface lockedSurface,
+                                 final GLContext context, final int count, final GLAnimatorControl anim, final boolean animStarted) {
         this.upstreamDevice = upstreamDevice;
         this.proxyOwnsUpstreamDevice = proxyOwnsUpstreamDevice;
         this.device = device;
         this.caps = caps;
+        this.upstreamLock = upstreamLock;
+        this.lockedSurface = lockedSurface;
         this.context = context;
         this.listeners = new GLEventListener[count];
         this.listenersInit = new boolean[count];
@@ -107,7 +112,29 @@ public class GLEventListenerState {
     public final GLAnimatorControl anim;
     public final boolean animStarted;
 
-    private boolean owner;
+    private volatile RecursiveLock upstreamLock;
+    private volatile NativeSurface lockedSurface;
+    private volatile boolean owner;
+
+    /**
+     * Returns a {@link Runnable} {@link NativeSurface#unlockSurface() unlocking} an eventually locked {@link NativeSurface},
+     * see {@link #moveFrom(GLAutoDrawable, boolean)} and {@link #moveTo(GLAutoDrawable, Runnable)}.
+     */
+    public Runnable getUnlockSurfaceOp() { return unlockOp; }
+
+    private final Runnable unlockOp = new Runnable() {
+        public void run() {
+            final RecursiveLock rl = upstreamLock;
+            final NativeSurface ls = lockedSurface;
+            upstreamLock = null;
+            lockedSurface = null;
+            if( null != rl ) {
+                rl.unlock();
+            }
+            if( null != ls ) {
+                ls.unlockSurface();
+            }
+        } };
 
     /**
      * Last resort to destroy and loose ownership
@@ -119,12 +146,13 @@ public class GLEventListenerState {
                 listeners[i] = null;
             }
             // context.destroy(); - NPE (null drawable)
+            unlockOp.run();
             device.close();
             owner = false;
         }
     }
 
-    private static AbstractGraphicsDevice cloneDevice(AbstractGraphicsDevice aDevice) {
+    private static AbstractGraphicsDevice cloneDevice(final AbstractGraphicsDevice aDevice) {
         return (AbstractGraphicsDevice) aDevice.clone();
     }
 
@@ -142,92 +170,143 @@ public class GLEventListenerState {
      * <p>
      * The returned GLEventListenerState instance is the {@link #isOwner() owner of the components}.
      * </p>
+     * <p>
+     * Locking is performed on the {@link GLAutoDrawable auto-drawable's}
+     * {@link GLAutoDrawable#getUpstreamLock() upstream-lock} and {@link GLAutoDrawable#getNativeSurface() surface}.
+     * See <a href="../../../javax/media/opengl/GLAutoDrawable.html#locking">GLAutoDrawable Locking</a>.</li>
+     * </p>
      *
-     * @param a {@link GLAutoDrawable} source to move components from
+     * @param src {@link GLAutoDrawable} source to move components from
      * @return new GLEventListenerState instance {@link #isOwner() owning} moved components.
      *
      * @see #moveTo(GLAutoDrawable)
      */
-    public static GLEventListenerState moveFrom(GLAutoDrawable a) {
-        final GLAnimatorControl aAnim = a.getAnimator();
-        final boolean aAnimStarted;
-        if( null != aAnim ) {
-            aAnimStarted = aAnim.isStarted();
-            aAnim.remove(a); // also handles ECT
+    public static GLEventListenerState moveFrom(final GLAutoDrawable src) {
+        return GLEventListenerState.moveFrom(src, false);
+    }
+
+    /**
+     * Moves all GLEventListenerState components from the given {@link GLAutoDrawable}
+     * to a newly created instance.
+     * <p>
+     * Note that all components are removed from the {@link GLAutoDrawable},
+     * i.e. the {@link GLContext}, all {@link GLEventListener}.
+     * </p>
+     * <p>
+     * If the {@link GLAutoDrawable} was added to a {@link GLAnimatorControl}, it is removed
+     * and the {@link GLAnimatorControl} added to the GLEventListenerState.
+     * </p>
+     * <p>
+     * The returned GLEventListenerState instance is the {@link #isOwner() owner of the components}.
+     * </p>
+     * <p>
+     * Locking is performed on the {@link GLAutoDrawable auto-drawable's}
+     * {@link GLAutoDrawable#getUpstreamLock() upstream-lock} and {@link GLAutoDrawable#getNativeSurface() surface},
+     * which is <i>not released</i> if <code>keepLocked</code> is <code>true</code>.
+     * See <a href="../../../javax/media/opengl/GLAutoDrawable.html#locking">GLAutoDrawable Locking</a>.</li>
+     * </p>
+     * <p>
+     * <code>keepLocked</code> may be utilized if swapping a context between drawables
+     * and to ensure atomicity of operation.
+     * Here, the {@link #getUnlockSurfaceOp()} shall be passed to {@link #moveTo(GLAutoDrawable, Runnable)}.
+     * See {@link GLDrawableUtil#swapGLContextAndAllGLEventListener(GLAutoDrawable, GLAutoDrawable)}.
+     * </p>
+     *
+     * @param src {@link GLAutoDrawable} source to move components from
+     * @param keepLocked keep {@link GLAutoDrawable#getUpstreamLock() upstream-lock} and {@link GLAutoDrawable#getNativeSurface() surface} locked, see above
+     * @return new GLEventListenerState instance {@link #isOwner() owning} moved components.
+     *
+     * @see #moveTo(GLAutoDrawable, Runnable)
+     */
+    public static GLEventListenerState moveFrom(final GLAutoDrawable src, final boolean keepLocked) {
+        final GLAnimatorControl srcAnim = src.getAnimator();
+        final boolean srcAnimStarted;
+        if( null != srcAnim ) {
+            srcAnimStarted = srcAnim.isStarted();
+            srcAnim.remove(src); // also handles ECT
         } else {
-            aAnimStarted = false;
+            srcAnimStarted = false;
         }
 
         final GLEventListenerState glls;
-        final NativeSurface aSurface = a.getNativeSurface();
-        final boolean surfaceLocked = false; // NativeSurface.LOCK_SURFACE_NOT_READY < aSurface.lockSurface();
+        final RecursiveLock srcUpstreamLock = src.getUpstreamLock();
+        srcUpstreamLock.lock();
         try {
-            final int aSz = a.getGLEventListenerCount();
-
-            // Create new AbstractGraphicsScreen w/ cloned AbstractGraphicsDevice for future GLAutoDrawable
-            // allowing this AbstractGraphicsDevice to loose ownership -> not closing display/device!
-            final AbstractGraphicsConfiguration aCfg = aSurface.getGraphicsConfiguration();
-            final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) aCfg.getChosenCapabilities();
-            final AbstractGraphicsDevice aDevice1 = aCfg.getScreen().getDevice();
-            final AbstractGraphicsDevice aDevice2 = cloneDevice(aDevice1);
-            aDevice1.clearHandleOwner();  // don't close device handle
-            if( DEBUG ) {
-                System.err.println("GLEventListenerState.moveFrom.0a: orig 0x"+Integer.toHexString(aDevice1.hashCode())+", "+aDevice1);
-                System.err.println("GLEventListenerState.moveFrom.0b: pres 0x"+Integer.toHexString(aDevice2.hashCode())+", "+aDevice2);
-                System.err.println("GLEventListenerState.moveFrom.1: "+aSurface.getClass().getName()/*+", "+aSurface*/);
+            final NativeSurface srcSurface = src.getNativeSurface();
+            final boolean srcSurfaceLocked = NativeSurface.LOCK_SURFACE_NOT_READY < srcSurface.lockSurface();
+            if( src.isRealized() && !srcSurfaceLocked ) {
+                throw new GLException("Could not lock realized surface "+src);
             }
-            final AbstractGraphicsDevice aUpDevice2;
-            final boolean proxyOwnsUpstreamDevice;
-            {
-                AbstractGraphicsDevice _aUpDevice2 = null;
-                if(aSurface instanceof ProxySurface) {
-                    final ProxySurface aProxy = (ProxySurface)aSurface;
-                    proxyOwnsUpstreamDevice = aProxy.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_DEVICE );
-                    final NativeSurface aUpSurface = aProxy.getUpstreamSurface();
-                    if(DEBUG && null != aUpSurface) {
-                        System.err.println("GLEventListenerState.moveFrom.2: "+aUpSurface.getClass().getName()+", "+aUpSurface);
-                    }
-                    if(null != aUpSurface) {
-                        final AbstractGraphicsDevice aUpDevice1 = aUpSurface.getGraphicsConfiguration().getScreen().getDevice();
-                        _aUpDevice2 = cloneDevice(aUpDevice1);
-                        aUpDevice1.clearHandleOwner(); // don't close device handle
-                        if(DEBUG) {
-                            System.err.println("GLEventListenerState.moveFrom.3a: up-orig 0x"+Integer.toHexString(aUpDevice1.hashCode())+", "+aUpDevice1);
-                            System.err.println("GLEventListenerState.moveFrom.3b: up-pres 0x"+Integer.toHexString(_aUpDevice2.hashCode())+", "+_aUpDevice2);
-                            System.err.println("GLEventListenerState.moveFrom.3c: "+aSurface.getClass().getName()+", "+aSurface);
-                            System.err.println("GLEventListenerState.moveFrom.3d: "+aUpSurface.getClass().getName()/*+", "+aUpSurface+", "*/+aProxy.getUpstreamOptionBits(null).toString());
+
+            try {
+                final int aSz = src.getGLEventListenerCount();
+
+                // Create new AbstractGraphicsScreen w/ cloned AbstractGraphicsDevice for future GLAutoDrawable
+                // allowing this AbstractGraphicsDevice to loose ownership -> not closing display/device!
+                final AbstractGraphicsConfiguration aCfg = srcSurface.getGraphicsConfiguration();
+                final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) aCfg.getChosenCapabilities();
+                final AbstractGraphicsDevice aDevice1 = aCfg.getScreen().getDevice();
+                final AbstractGraphicsDevice aDevice2 = cloneDevice(aDevice1);
+                aDevice1.clearHandleOwner();  // don't close device handle
+                if( DEBUG ) {
+                    System.err.println("GLEventListenerState.moveFrom.0a: orig 0x"+Integer.toHexString(aDevice1.hashCode())+", "+aDevice1);
+                    System.err.println("GLEventListenerState.moveFrom.0b: pres 0x"+Integer.toHexString(aDevice2.hashCode())+", "+aDevice2);
+                    System.err.println("GLEventListenerState.moveFrom.1: "+srcSurface.getClass().getName()/*+", "+aSurface*/);
+                }
+                final AbstractGraphicsDevice aUpDevice2;
+                final boolean proxyOwnsUpstreamDevice;
+                {
+                    AbstractGraphicsDevice _aUpDevice2 = null;
+                    if(srcSurface instanceof ProxySurface) {
+                        final ProxySurface aProxy = (ProxySurface)srcSurface;
+                        proxyOwnsUpstreamDevice = aProxy.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_DEVICE );
+                        final NativeSurface aUpSurface = aProxy.getUpstreamSurface();
+                        if(DEBUG && null != aUpSurface) {
+                            System.err.println("GLEventListenerState.moveFrom.2: "+aUpSurface.getClass().getName()+", "+aUpSurface);
                         }
+                        if(null != aUpSurface) {
+                            final AbstractGraphicsDevice aUpDevice1 = aUpSurface.getGraphicsConfiguration().getScreen().getDevice();
+                            _aUpDevice2 = cloneDevice(aUpDevice1);
+                            aUpDevice1.clearHandleOwner(); // don't close device handle
+                            if(DEBUG) {
+                                System.err.println("GLEventListenerState.moveFrom.3a: up-orig 0x"+Integer.toHexString(aUpDevice1.hashCode())+", "+aUpDevice1);
+                                System.err.println("GLEventListenerState.moveFrom.3b: up-pres 0x"+Integer.toHexString(_aUpDevice2.hashCode())+", "+_aUpDevice2);
+                                System.err.println("GLEventListenerState.moveFrom.3c: "+srcSurface.getClass().getName()+", "+srcSurface);
+                                System.err.println("GLEventListenerState.moveFrom.3d: "+aUpSurface.getClass().getName()/*+", "+aUpSurface+", "*/+aProxy.getUpstreamOptionBits(null).toString());
+                            }
+                        }
+                    } else {
+                        proxyOwnsUpstreamDevice = false;
                     }
-                } else {
-                    proxyOwnsUpstreamDevice = false;
+                    aUpDevice2 = _aUpDevice2;
                 }
-                aUpDevice2 = _aUpDevice2;
-            }
-
-            glls = new GLEventListenerState(aUpDevice2, proxyOwnsUpstreamDevice, aDevice2, caps, a.getContext(), aSz, aAnim, aAnimStarted);
-
-            //
-            // remove and cache all GLEventListener and their init-state
-            //
-            for(int i=0; i<aSz; i++) {
-                final GLEventListener l = a.getGLEventListener(0);
-                glls.listenersInit[i] = a.getGLEventListenerInitState(l);
-                glls.listeners[i] = a.removeGLEventListener( l );
-            }
 
-            //
-            // trigger glFinish to sync GL ctx
-            //
-            a.invoke(true, glFinish);
+                glls = new GLEventListenerState(aUpDevice2, proxyOwnsUpstreamDevice, aDevice2, caps,
+                                                keepLocked ? srcUpstreamLock : null,
+                                                srcSurfaceLocked && keepLocked ? srcSurface : null,
+                                                src.getContext(), aSz, srcAnim, srcAnimStarted);
+
+                //
+                // remove and cache all GLEventListener and their init-state
+                //
+                for(int i=0; i<aSz; i++) {
+                    final GLEventListener l = src.getGLEventListener(0);
+                    glls.listenersInit[i] = src.getGLEventListenerInitState(l);
+                    glls.listeners[i] = src.removeGLEventListener( l );
+                }
 
-            a.setContext( null, false );
+                src.setContext( null, false ); // implicit glFinish() ctx/drawable sync
 
+            } finally {
+                if( srcSurfaceLocked && !keepLocked ) {
+                    srcSurface.unlockSurface();
+                }
+            }
         } finally {
-            if( surfaceLocked ) {
-                aSurface.unlockSurface();
+            if( !keepLocked ) {
+                srcUpstreamLock.unlock();
             }
         }
-
         return glls;
     }
 
@@ -240,134 +319,184 @@ public class GLEventListenerState {
      * This operation is skipped, if the given {@link GLAutoDrawable} is already added to a {@link GLAnimatorControl} instance.
      * </p>
      * <p>
+     * Locking is performed on the {@link GLAutoDrawable auto-drawable's}
+     * {@link GLAutoDrawable#getUpstreamLock() upstream-lock} and {@link GLAutoDrawable#getNativeSurface() surface}.
+     * See <a href="../../../javax/media/opengl/GLAutoDrawable.html#locking">GLAutoDrawable Locking</a>.</li>
+     * </p>
+     * <p>
      * Note: After this operation, the GLEventListenerState reference should be released.
      * </p>
      *
-     * @param a {@link GLAutoDrawable} destination to move GLEventListenerState components to
+     * @param dest {@link GLAutoDrawable} destination to move GLEventListenerState components to
      *
-     * <!-- @throws GLException if the {@link GLAutoDrawable}'s configuration is incompatible, i.e. different {@link GLCapabilitiesImmutable}. -->
+     * @throws GLException if a realized surface could not be locked.
      * @throws GLException if this preserved {@link AbstractGraphicsDevice} is incompatible w/ the given destination one.
+     * <!-- @throws GLException if the {@link GLAutoDrawable}'s configuration is incompatible, i.e. different {@link GLCapabilitiesImmutable}. -->
      *
      * @see #moveFrom(GLAutoDrawable)
      * @see #isOwner()
      */
-    public final void moveTo(GLAutoDrawable a) {
-        final GLAnimatorControl aAnim = a.getAnimator();
-        final boolean hasAnimator = null != aAnim;
-        final boolean aPaused;
-        if( hasAnimator ) {
-            aPaused = aAnim.pause();
-            aAnim.remove(a); // also handles ECT
-            if( aPaused ) {
-                aAnim.resume();
-            }
+    public final void moveTo(final GLAutoDrawable dest) throws GLException  {
+        this.moveTo(dest, null);
+    }
+
+    /**
+     * Moves all GLEventListenerState components to the given {@link GLAutoDrawable}
+     * from this instance, while loosing {@link #isOwner() ownership}.
+     * <p>
+     * If the previous {@link GLAutoDrawable} was removed from a {@link GLAnimatorControl} by previous {@link #moveFrom(GLAutoDrawable, boolean)},
+     * the given {@link GLAutoDrawable} is added to the cached {@link GLAnimatorControl}.
+     * This operation is skipped, if the given {@link GLAutoDrawable} is already added to a {@link GLAnimatorControl} instance.
+     * </p>
+     * <p>
+     * Locking is performed on the {@link GLAutoDrawable auto-drawable's}
+     * {@link GLAutoDrawable#getUpstreamLock() upstream-lock} and {@link GLAutoDrawable#getNativeSurface() surface}.
+     * See <a href="../../../javax/media/opengl/GLAutoDrawable.html#locking">GLAutoDrawable Locking</a>.</li>
+     * </p>
+     * <p>
+     * If the {@link GLAutoDrawable} <code>dest</code> has been kept locked by {@link #moveFrom(GLAutoDrawable, boolean)},
+     * it's {@link #getUnlockSurfaceOp()} shall be passed here to <code>destUnlockOperation</code> to be unlocked.
+     * </p>
+     * <p>
+     * Note: After this operation, the GLEventListenerState reference should be released.
+     * </p>
+     *
+     * @param dest {@link GLAutoDrawable} destination to move GLEventListenerState components to
+     * @param destUnlockOperation optional unlock operation for <code>dest</code>, see {@link #moveFrom(GLAutoDrawable, boolean)}.
+     *
+     * @throws GLException if a realized surface could not be locked.
+     * @throws GLException if this preserved {@link AbstractGraphicsDevice} is incompatible w/ the given destination one.
+     * <!-- @throws GLException if the {@link GLAutoDrawable}'s configuration is incompatible, i.e. different {@link GLCapabilitiesImmutable}. -->
+     *
+     * @see #moveFrom(GLAutoDrawable, boolean)
+     * @see #isOwner()
+     */
+    public final void moveTo(final GLAutoDrawable dest, final Runnable destUnlockOperation) throws GLException {
+        final GLAnimatorControl destAnim = dest.getAnimator();
+        final boolean destAnimPaused;
+        if( null != destAnim ) {
+            destAnimPaused = destAnim.pause();
+            destAnim.remove(dest); // also handles ECT
         } else {
-            aPaused = false;
+            destAnimPaused = false;
         }
 
         final List<GLRunnable> aGLCmds = new ArrayList<GLRunnable>();
         final int aSz = listenerCount();
 
-        final NativeSurface aSurface = a.getNativeSurface();
-        final boolean surfaceLocked = false; // NativeSurface.LOCK_SURFACE_NOT_READY < aSurface.lockSurface();
-        final boolean aRealized;
+        final RecursiveLock destUpstreamLock = dest.getUpstreamLock();
+        destUpstreamLock.lock();
+        final boolean destIsRealized;
         try {
-
-            final MutableGraphicsConfiguration aCfg = (MutableGraphicsConfiguration) aSurface.getGraphicsConfiguration();
-            /**
-            final GLCapabilitiesImmutable aCaps = (GLCapabilitiesImmutable) aCfg.getChosenCapabilities();
-            if( caps.getVisualID(VisualIDHolder.VIDType.INTRINSIC) != aCaps.getVisualID(VisualIDHolder.VIDType.INTRINSIC) ||
-                caps.getVisualID(VisualIDHolder.VIDType.NATIVE) != aCaps.getVisualID(VisualIDHolder.VIDType.NATIVE) ) {
-                throw new GLException("Incompatible Capabilities - Prev-Holder: "+caps+", New-Holder "+caps);
-            } */
-            final DefaultGraphicsDevice aDevice1 = (DefaultGraphicsDevice) aCfg.getScreen().getDevice();
-            final DefaultGraphicsDevice aDevice2 = (DefaultGraphicsDevice) device;
-            if( !aDevice1.getUniqueID().equals( aDevice2.getUniqueID() ) ) {
-                throw new GLException("Incompatible devices: Preserved <"+aDevice2.getUniqueID()+">, target <"+aDevice1.getUniqueID()+">");
-            }
-
-            // collect optional upstream surface info
-            final ProxySurface aProxy;
-            final NativeSurface aUpSurface;
-            if(aSurface instanceof ProxySurface) {
-                aProxy = (ProxySurface)aSurface;
-                aUpSurface = aProxy.getUpstreamSurface();
-            } else {
-                aProxy = null;
-                aUpSurface = null;
-            }
-            if( DEBUG ) {
-                System.err.println("GLEventListenerState.moveTo.0 : has aProxy "+(null!=aProxy));
-                System.err.println("GLEventListenerState.moveTo.0 : has aUpSurface "+(null!=aUpSurface));
-            }
-            if( null==aUpSurface && null != upstreamDevice ) {
-                throw new GLException("Incompatible Surface config - Has Upstream-Surface: Prev-Holder = true, New-Holder = false");
-            }
-
-            // Destroy and remove currently associated GLContext, if any (will be replaced)
-            a.setContext( null, true );
-            aRealized = a.isRealized();
-            if( aRealized && null != aUpSurface ) {
-                // Unrealize due to device dependencies of an upstream surface, e.g. EGLUpstreamSurfaceHook
-                a.getDelegatedDrawable().setRealized(false);
+            final NativeSurface destSurface = dest.getNativeSurface();
+            final boolean destSurfaceLocked = NativeSurface.LOCK_SURFACE_NOT_READY < destSurface.lockSurface();
+            if( dest.isRealized() && !destSurfaceLocked ) {
+                throw new GLException("Could not lock realized surface "+dest);
             }
+            try {
+
+                final MutableGraphicsConfiguration aCfg = (MutableGraphicsConfiguration) destSurface.getGraphicsConfiguration();
+                /**
+                final GLCapabilitiesImmutable aCaps = (GLCapabilitiesImmutable) aCfg.getChosenCapabilities();
+                if( caps.getVisualID(VisualIDHolder.VIDType.INTRINSIC) != aCaps.getVisualID(VisualIDHolder.VIDType.INTRINSIC) ||
+                    caps.getVisualID(VisualIDHolder.VIDType.NATIVE) != aCaps.getVisualID(VisualIDHolder.VIDType.NATIVE) ) {
+                    throw new GLException("Incompatible Capabilities - Prev-Holder: "+caps+", New-Holder "+caps);
+                } */
+                final DefaultGraphicsDevice aDevice1 = (DefaultGraphicsDevice) aCfg.getScreen().getDevice();
+                final DefaultGraphicsDevice aDevice2 = (DefaultGraphicsDevice) device;
+                if( !aDevice1.getUniqueID().equals( aDevice2.getUniqueID() ) ) {
+                    throw new GLException("Incompatible devices: Preserved <"+aDevice2.getUniqueID()+">, target <"+aDevice1.getUniqueID()+">");
+                }
 
-            // Set new Screen and close previous one
-            {
-                if( DEBUG ) {
-                    System.err.println("GLEventListenerState.moveTo.0a: orig 0x"+Integer.toHexString(aDevice1.hashCode())+", "+aDevice1);
-                    System.err.println("GLEventListenerState.moveTo.0b: pres 0x"+Integer.toHexString(aDevice2.hashCode())+", "+aDevice2);
+                // collect optional upstream surface info
+                final ProxySurface aProxy;
+                final NativeSurface aUpSurface;
+                if(destSurface instanceof ProxySurface) {
+                    aProxy = (ProxySurface)destSurface;
+                    aUpSurface = aProxy.getUpstreamSurface();
+                } else {
+                    aProxy = null;
+                    aUpSurface = null;
                 }
-                DefaultGraphicsDevice.swapDeviceHandleAndOwnership(aDevice1, aDevice2);
-                aDevice2.close();
                 if( DEBUG ) {
-                    System.err.println("GLEventListenerState.moveTo.1a: orig 0x"+Integer.toHexString(aDevice1.hashCode())+", "+aDevice1);
-                    System.err.println("GLEventListenerState.moveTo.1b: pres 0x"+Integer.toHexString(aDevice2.hashCode())+", "+aDevice2);
+                    System.err.println("GLEventListenerState.moveTo.0 : has aProxy "+(null!=aProxy));
+                    System.err.println("GLEventListenerState.moveTo.0 : has aUpSurface "+(null!=aUpSurface));
+                }
+                if( null==aUpSurface && null != upstreamDevice ) {
+                    throw new GLException("Incompatible Surface config - Has Upstream-Surface: Prev-Holder = true, New-Holder = false");
                 }
-            }
 
-            // If using a ProxySurface w/ an upstream surface, set new Screen and close previous one on it
-            if( null != aUpSurface ) {
-                final MutableGraphicsConfiguration aUpCfg = (MutableGraphicsConfiguration) aUpSurface.getGraphicsConfiguration();
-                if( null != upstreamDevice ) {
-                    final DefaultGraphicsDevice aUpDevice1 = (DefaultGraphicsDevice) aUpCfg.getScreen().getDevice();
-                    final DefaultGraphicsDevice aUpDevice2 = (DefaultGraphicsDevice)upstreamDevice;
-                    if( !aUpDevice1.getUniqueID().equals( aUpDevice2.getUniqueID() ) ) {
-                        throw new GLException("Incompatible updtream devices: Preserved <"+aUpDevice2.getUniqueID()+">, target <"+aUpDevice1.getUniqueID()+">");
-                    }
+                // Destroy and remove currently associated GLContext, if any (will be replaced)
+                dest.setContext( null, true );
+                destIsRealized = dest.isRealized();
+                if( destIsRealized && null != aUpSurface ) {
+                    // Unrealize due to device dependencies of an upstream surface, e.g. EGLUpstreamSurfaceHook
+                    dest.getDelegatedDrawable().setRealized(false);
+                }
+
+                // Set new Screen and close previous one
+                {
                     if( DEBUG ) {
-                        System.err.println("GLEventListenerState.moveTo.2a: up-orig 0x"+Integer.toHexString(aUpDevice1.hashCode())+", "+aUpDevice1);
-                        System.err.println("GLEventListenerState.moveTo.2b: up-pres 0x"+Integer.toHexString(aUpDevice2.hashCode())+", "+aUpDevice2);
-                        System.err.println("GLEventListenerState.moveTo.2c:  "+aUpSurface.getClass().getName()/*+", "+aUpSurface+", "*/+aProxy.getUpstreamOptionBits(null).toString());
-                    }
-                    DefaultGraphicsDevice.swapDeviceHandleAndOwnership(aUpDevice1, aUpDevice2);
-                    aUpDevice2.close();
-                    if( proxyOwnsUpstreamDevice ) {
-                        aProxy.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_DEVICE );
+                        System.err.println("GLEventListenerState.moveTo.0a: orig 0x"+Integer.toHexString(aDevice1.hashCode())+", "+aDevice1);
+                        System.err.println("GLEventListenerState.moveTo.0b: pres 0x"+Integer.toHexString(aDevice2.hashCode())+", "+aDevice2);
                     }
+                    DefaultGraphicsDevice.swapDeviceHandleAndOwnership(aDevice1, aDevice2);
+                    aDevice2.close();
                     if( DEBUG ) {
-                        System.err.println("GLEventListenerState.moveTo.3a: up-orig 0x"+Integer.toHexString(aUpDevice1.hashCode())+", "+aUpDevice1);
-                        System.err.println("GLEventListenerState.moveTo.3b: up-pres 0x"+Integer.toHexString(aUpDevice2.hashCode())+", "+aUpDevice2);
-                        System.err.println("GLEventListenerState.moveTo.3c:  "+aUpSurface.getClass().getName()/*+", "+aUpSurface+", "*/+aProxy.getUpstreamOptionBits(null).toString());
+                        System.err.println("GLEventListenerState.moveTo.1a: orig 0x"+Integer.toHexString(aDevice1.hashCode())+", "+aDevice1);
+                        System.err.println("GLEventListenerState.moveTo.1b: pres 0x"+Integer.toHexString(aDevice2.hashCode())+", "+aDevice2);
                     }
-                } else {
-                    throw new GLException("Incompatible Surface config - Has Upstream-Surface: Prev-Holder = false, New-Holder = true");
                 }
-            }
 
-            if( aRealized && null != aUpSurface ) {
-                a.getDelegatedDrawable().setRealized(true);
-            }
-            if( DEBUG ) {
-                System.err.println("GLEventListenerState.moveTo.X : has aProxy "+(null!=aProxy));
-                System.err.println("GLEventListenerState.moveTo.X : has aUpSurface "+(null!=aUpSurface));
+                // If using a ProxySurface w/ an upstream surface, set new Screen and close previous one on it
+                if( null != aUpSurface ) {
+                    final MutableGraphicsConfiguration aUpCfg = (MutableGraphicsConfiguration) aUpSurface.getGraphicsConfiguration();
+                    if( null != upstreamDevice ) {
+                        final DefaultGraphicsDevice aUpDevice1 = (DefaultGraphicsDevice) aUpCfg.getScreen().getDevice();
+                        final DefaultGraphicsDevice aUpDevice2 = (DefaultGraphicsDevice)upstreamDevice;
+                        if( !aUpDevice1.getUniqueID().equals( aUpDevice2.getUniqueID() ) ) {
+                            throw new GLException("Incompatible updtream devices: Preserved <"+aUpDevice2.getUniqueID()+">, target <"+aUpDevice1.getUniqueID()+">");
+                        }
+                        if( DEBUG ) {
+                            System.err.println("GLEventListenerState.moveTo.2a: up-orig 0x"+Integer.toHexString(aUpDevice1.hashCode())+", "+aUpDevice1);
+                            System.err.println("GLEventListenerState.moveTo.2b: up-pres 0x"+Integer.toHexString(aUpDevice2.hashCode())+", "+aUpDevice2);
+                            System.err.println("GLEventListenerState.moveTo.2c:  "+aUpSurface.getClass().getName()/*+", "+aUpSurface+", "*/+aProxy.getUpstreamOptionBits(null).toString());
+                        }
+                        DefaultGraphicsDevice.swapDeviceHandleAndOwnership(aUpDevice1, aUpDevice2);
+                        aUpDevice2.close();
+                        if( proxyOwnsUpstreamDevice ) {
+                            aProxy.addUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_DEVICE );
+                        }
+                        if( DEBUG ) {
+                            System.err.println("GLEventListenerState.moveTo.3a: up-orig 0x"+Integer.toHexString(aUpDevice1.hashCode())+", "+aUpDevice1);
+                            System.err.println("GLEventListenerState.moveTo.3b: up-pres 0x"+Integer.toHexString(aUpDevice2.hashCode())+", "+aUpDevice2);
+                            System.err.println("GLEventListenerState.moveTo.3c:  "+aUpSurface.getClass().getName()/*+", "+aUpSurface+", "*/+aProxy.getUpstreamOptionBits(null).toString());
+                        }
+                    } else {
+                        throw new GLException("Incompatible Surface config - Has Upstream-Surface: Prev-Holder = false, New-Holder = true");
+                    }
+                }
+
+                if( destIsRealized && null != aUpSurface ) {
+                    dest.getDelegatedDrawable().setRealized(true);
+                }
+                if( DEBUG ) {
+                    System.err.println("GLEventListenerState.moveTo.X : has aProxy "+(null!=aProxy));
+                    System.err.println("GLEventListenerState.moveTo.X : has aUpSurface "+(null!=aUpSurface));
+                }
+                dest.setContext( context, false );
+            } finally {
+                if( destSurfaceLocked ) {
+                    destSurface.unlockSurface();
+                }
             }
-            a.setContext( context, false );
         } finally {
-            if( surfaceLocked ) {
-                aSurface.unlockSurface();
-            }
+            destUpstreamLock.unlock();
+        }
+        if( null != destUnlockOperation ) {
+            destUnlockOperation.run();
         }
+
         owner = false;
 
         //
@@ -376,60 +505,48 @@ public class GLEventListenerState {
         aGLCmds.add(setViewport);
         for(int i=0; i<aSz; i++) {
             if( listenersInit[i] ) {
-                aGLCmds.add(new ReshapeGLEventListener( listeners[i] ) );
+                aGLCmds.add(new GLDrawableUtil.ReshapeGLEventListener( listeners[i], false ) );
             }
         }
         aGLCmds.add(glFinish);
-        a.invoke(aRealized, aGLCmds); // only wait if already realized
+        dest.invoke(destIsRealized, aGLCmds); // only wait if already realized
 
         // add all cached GLEventListener to their destination and fix their init-state
         for(int i=0; i<aSz; i++) {
             final GLEventListener l = listeners[i];
-            a.addGLEventListener( l );
-            a.setGLEventListenerInitState(l, listenersInit[i]);
+            dest.addGLEventListener( l );
+            dest.setGLEventListenerInitState(l, listenersInit[i]);
             listeners[i] = null;
         }
 
-        if( hasAnimator ) {
+        if( null != destAnim ) {
             // prefer already bound animator
-            aAnim.add(a);
-            if( aPaused ) {
-                aAnim.resume();
+            destAnim.add(dest);
+            if( destAnimPaused ) {
+                destAnim.resume();
             }
         } else if ( null != anim ) {
             // use previously bound animator
-            anim.add(a); // also handles ECT
+            anim.add(dest); // also handles ECT
             if(animStarted) {
                 anim.start();
             }
         }
     }
 
-    public static GLRunnable setViewport = new GLRunnable() {
+    private static final GLRunnable setViewport = new GLRunnable() {
         @Override
-        public boolean run(GLAutoDrawable drawable) {
-            drawable.getGL().glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
+        public boolean run(final GLAutoDrawable drawable) {
+            drawable.getGL().glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
             return true;
         }
     };
 
-    public static GLRunnable glFinish = new GLRunnable() {
+    private static final GLRunnable glFinish = new GLRunnable() {
         @Override
-        public boolean run(GLAutoDrawable drawable) {
+        public boolean run(final GLAutoDrawable drawable) {
             drawable.getGL().glFinish();
             return true;
         }
     };
-
-    public static class ReshapeGLEventListener implements GLRunnable {
-        private GLEventListener listener;
-        public ReshapeGLEventListener(GLEventListener listener) {
-            this.listener = listener;
-        }
-        @Override
-        public boolean run(GLAutoDrawable drawable) {
-            listener.reshape(drawable, 0, 0, drawable.getWidth(), drawable.getHeight());
-            return true;
-        }
-    }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/GLExtensions.java b/src/jogl/classes/com/jogamp/opengl/GLExtensions.java
index da9e08a..1593da2 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLExtensions.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLExtensions.java
@@ -72,6 +72,7 @@ public class GLExtensions {
   public static final String OES_read_format                 = "GL_OES_read_format";
   public static final String OES_single_precision            = "GL_OES_single_precision";
   public static final String OES_EGL_image_external          = "GL_OES_EGL_image_external";
+  /** Required to be requested for OpenGL ES 2.0, <i>not</i> ES 3.0! */
   public static final String OES_standard_derivatives        = "GL_OES_standard_derivatives";
 
   public static final String ARB_gpu_shader_fp64             = "GL_ARB_gpu_shader_fp64";
diff --git a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
index a643d81..83fceeb 100644
--- a/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
+++ b/src/jogl/classes/com/jogamp/opengl/GLRendererQuirks.java
@@ -30,6 +30,7 @@ package com.jogamp.opengl;
 import java.util.IdentityHashMap;
 
 import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.opengl.GLCapabilitiesImmutable;
 
 import com.jogamp.common.os.Platform;
 
@@ -289,15 +290,38 @@ public class GLRendererQuirks {
      */
     public static final int SingletonEGLDisplayOnly = 16;
 
+    /**
+     * With certain drivers no reliable MSAA / FSAA
+     * {@link GLCapabilitiesImmutable#getSampleBuffers() multi}
+     * {@link GLCapabilitiesImmutable#getNumSamples() sampling} is available, read <i>a crash</i> may occur.
+     * <p>
+     * Appears on:
+     * <ul>
+     *   <li>GL_VENDOR       nouveau</li>
+     *   <li>GL_RENDERER     Gallium 0.4 on NV34</li>
+     * </ul>
+     * TODO: We have to determine the exact version range, i.e. not adding the quirk with fixed driver version!
+     * </p>
+     * TODO: Since we currently don't handle this quirk internally, a user may need to do the following:
+     * <pre>
+     * final AbstractGraphicsDevice adevice = GLDrawableFactory.getDesktopFactory(); // or similar
+     * if( GLRendererQuirks.existStickyDeviceQuirk(adevice, GLRendererQuirks.NoMultiSamplingBuffers) ) {
+     *    // don't use MSAA
+     * }
+     * </pre>
+     */
+    public static final int NoMultiSamplingBuffers  = 17;
+
     /** Number of quirks known. */
-    public static final int COUNT = 17;
+    public static final int COUNT = 18;
 
     private static final String[] _names = new String[] { "NoDoubleBufferedPBuffer", "NoDoubleBufferedBitmap", "NoSetSwapInterval",
                                                           "NoOffscreenBitmap", "NoSetSwapIntervalPostRetarget", "GLSLBuggyDiscard",
                                                           "GLNonCompliant", "GLFlushBeforeRelease", "DontCloseX11Display",
                                                           "NeedCurrCtx4ARBPixFmtQueries", "NeedCurrCtx4ARBCreateContext",
                                                           "NoFullFBOSupport", "GLSLNonCompliant", "GL4NeedsGL3Request",
-                                                          "GLSharedContextBuggy", "GLES3ViaEGLES2Config", "SingletonEGLDisplayOnly"
+                                                          "GLSharedContextBuggy", "GLES3ViaEGLES2Config", "SingletonEGLDisplayOnly",
+                                                          "NoMultiSamplingBuffers"
                                                         };
 
     private static final IdentityHashMap<String, GLRendererQuirks> stickyDeviceQuirks = new IdentityHashMap<String, GLRendererQuirks>();
@@ -312,7 +336,7 @@ public class GLRendererQuirks {
      * </p>
      * @see #areSameStickyDevice(AbstractGraphicsDevice, AbstractGraphicsDevice)
      */
-    public static GLRendererQuirks getStickyDeviceQuirks(AbstractGraphicsDevice device) {
+    public static GLRendererQuirks getStickyDeviceQuirks(final AbstractGraphicsDevice device) {
         final String key = device.getUniqueID();
         final GLRendererQuirks has = stickyDeviceQuirks.get(key);
         final GLRendererQuirks res;
@@ -329,8 +353,8 @@ public class GLRendererQuirks {
      * Returns true if both devices have the same {@link AbstractGraphicsDevice#getUniqueID()},
      * otherwise false.
      */
-    public static boolean areSameStickyDevice(AbstractGraphicsDevice device1, AbstractGraphicsDevice device2) {
-        return device1.getUniqueID() == device2.getUniqueID();
+    public static boolean areSameStickyDevice(final AbstractGraphicsDevice device1, final AbstractGraphicsDevice device2) {
+        return device1.getUniqueID() == device2.getUniqueID(); // uses .intern()!
     }
 
     /**
@@ -340,7 +364,7 @@ public class GLRendererQuirks {
      * </p>
      * @see #getStickyDeviceQuirks(AbstractGraphicsDevice)
      */
-    public static void addStickyDeviceQuirks(AbstractGraphicsDevice device, int[] quirks, int offset, int len) throws IllegalArgumentException {
+    public static void addStickyDeviceQuirks(final AbstractGraphicsDevice device, final int[] quirks, final int offset, final int len) throws IllegalArgumentException {
         final GLRendererQuirks sq = getStickyDeviceQuirks(device);
         sq.addQuirks(quirks, offset, len);
     }
@@ -351,7 +375,7 @@ public class GLRendererQuirks {
      * </p>
      * @see #getStickyDeviceQuirks(AbstractGraphicsDevice)
      */
-    public static void addStickyDeviceQuirks(AbstractGraphicsDevice device, GLRendererQuirks quirks) throws IllegalArgumentException {
+    public static void addStickyDeviceQuirks(final AbstractGraphicsDevice device, final GLRendererQuirks quirks) throws IllegalArgumentException {
         final GLRendererQuirks sq = getStickyDeviceQuirks(device);
         sq.addQuirks(quirks);
     }
@@ -362,7 +386,7 @@ public class GLRendererQuirks {
      * </p>
      * @see #getStickyDeviceQuirks(AbstractGraphicsDevice)
      */
-    public static boolean existStickyDeviceQuirk(AbstractGraphicsDevice device, int quirk) {
+    public static boolean existStickyDeviceQuirk(final AbstractGraphicsDevice device, final int quirk) {
         return getStickyDeviceQuirks(device).exist(quirk);
     }
     /**
@@ -373,7 +397,7 @@ public class GLRendererQuirks {
      * </p>
      * @see #getStickyDeviceQuirks(AbstractGraphicsDevice)
      */
-    public static void pushStickyDeviceQuirks(AbstractGraphicsDevice device, GLRendererQuirks dest) {
+    public static void pushStickyDeviceQuirks(final AbstractGraphicsDevice device, final GLRendererQuirks dest) {
         dest.addQuirks(getStickyDeviceQuirks(device));
     }
 
@@ -389,7 +413,7 @@ public class GLRendererQuirks {
      * @param len number of quirks to read from offset within quirks array
      * @throws IllegalArgumentException if one of the quirks is out of range
      */
-    public GLRendererQuirks(int[] quirks, int offset, int len) throws IllegalArgumentException {
+    public GLRendererQuirks(final int[] quirks, final int offset, final int len) throws IllegalArgumentException {
         this();
         addQuirks(quirks, offset, len);
     }
@@ -400,7 +424,7 @@ public class GLRendererQuirks {
      * @param len number of quirks to read from offset within quirks array
      * @throws IllegalArgumentException if one of the quirks is out of range
      */
-    public final void addQuirks(int[] quirks, int offset, int len) throws IllegalArgumentException {
+    public final void addQuirks(final int[] quirks, final int offset, final int len) throws IllegalArgumentException {
         int bitmask = 0;
         if( !( 0 <= offset + len && offset + len <= quirks.length ) ) {
             throw new IllegalArgumentException("offset and len out of bounds: offset "+offset+", len "+len+", array-len "+quirks.length);
@@ -416,7 +440,7 @@ public class GLRendererQuirks {
     /**
      * @param quirks valid GLRendererQuirks to be added
      */
-    public final void addQuirks(GLRendererQuirks quirks) {
+    public final void addQuirks(final GLRendererQuirks quirks) {
         _bitmask |= quirks._bitmask;
     }
 
@@ -425,7 +449,7 @@ public class GLRendererQuirks {
      * @return true if quirk exist, otherwise false
      * @throws IllegalArgumentException if quirk is out of range
      */
-    public final boolean exist(int quirk) throws IllegalArgumentException {
+    public final boolean exist(final int quirk) throws IllegalArgumentException {
         validateQuirk(quirk);
         return 0 != ( ( 1 << quirk )  & _bitmask );
     }
@@ -457,7 +481,7 @@ public class GLRendererQuirks {
      * @param quirk the quirk to be validated, i.e. whether it is out of range
      * @throws IllegalArgumentException if quirk is out of range
      */
-    public static void validateQuirk(int quirk) throws IllegalArgumentException {
+    public static void validateQuirk(final int quirk) throws IllegalArgumentException {
         if( !( 0 <= quirk && quirk < COUNT ) ) {
             throw new IllegalArgumentException("Quirks must be in range [0.."+COUNT+"[, but quirk: "+quirk);
         }
@@ -468,7 +492,7 @@ public class GLRendererQuirks {
      * @return the String equivalent of this quirk
      * @throws IllegalArgumentException if quirk is out of range
      */
-    public static final String toString(int quirk) throws IllegalArgumentException {
+    public static final String toString(final int quirk) throws IllegalArgumentException {
         validateQuirk(quirk);
         return _names[quirk];
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
index 40f0d18..8d67650 100644
--- a/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
+++ b/src/jogl/classes/com/jogamp/opengl/JoglVersion.java
@@ -43,7 +43,7 @@ public class JoglVersion extends JogampVersion {
 
     protected static volatile JoglVersion jogampCommonVersionInfo;
 
-    protected JoglVersion(String packageName, Manifest mf) {
+    protected JoglVersion(final String packageName, final Manifest mf) {
         super(packageName, mf);
     }
 
@@ -60,17 +60,17 @@ public class JoglVersion extends JogampVersion {
         return jogampCommonVersionInfo;
     }
 
-    public StringBuilder toString(GL gl, StringBuilder sb) {
+    public StringBuilder toString(final GL gl, StringBuilder sb) {
         sb = super.toString(sb).append(Platform.getNewline());
         getGLInfo(gl, sb);
         return sb;
     }
 
-    public String toString(GL gl) {
+    public String toString(final GL gl) {
         return toString(gl, null).toString();
     }
 
-    public static StringBuilder getAvailableCapabilitiesInfo(GLDrawableFactory factory, AbstractGraphicsDevice device, StringBuilder sb) {
+    public static StringBuilder getAvailableCapabilitiesInfo(final GLDrawableFactory factory, final AbstractGraphicsDevice device, StringBuilder sb) {
         if(null==sb) {
             sb = new StringBuilder();
         }
@@ -84,7 +84,7 @@ public class JoglVersion extends JogampVersion {
                     }
                     done = true;
                 }
-            } catch (GLException gle) { /* n/a */ }
+            } catch (final GLException gle) { /* n/a */ }
         }
         if(!done) {
             sb.append("\tnone").append(Platform.getNewline());
@@ -108,7 +108,7 @@ public class JoglVersion extends JogampVersion {
         return sb;
     }
 
-    public static StringBuilder getDefaultOpenGLInfo(AbstractGraphicsDevice device, StringBuilder sb, boolean withCapabilitiesInfo) {
+    public static StringBuilder getDefaultOpenGLInfo(AbstractGraphicsDevice device, StringBuilder sb, final boolean withCapabilitiesInfo) {
         if(null==sb) {
             sb = new StringBuilder();
         }
@@ -127,11 +127,11 @@ public class JoglVersion extends JogampVersion {
         return sb;
     }
 
-    public static StringBuilder getGLInfo(GL gl, StringBuilder sb) {
+    public static StringBuilder getGLInfo(final GL gl, final StringBuilder sb) {
         return getGLInfo(gl, sb, false);
     }
-    public static StringBuilder getGLInfo(GL gl, StringBuilder sb, boolean withCapabilitiesAndExtensionInfo) {
-        AbstractGraphicsDevice device = gl.getContext().getGLDrawable().getNativeSurface()
+    public static StringBuilder getGLInfo(final GL gl, StringBuilder sb, final boolean withCapabilitiesAndExtensionInfo) {
+        final AbstractGraphicsDevice device = gl.getContext().getGLDrawable().getNativeSurface()
                                             .getGraphicsConfiguration().getScreen().getDevice();
         if(null==sb) {
             sb = new StringBuilder();
@@ -151,11 +151,11 @@ public class JoglVersion extends JogampVersion {
         return sb;
     }
 
-    public static StringBuilder getGLStrings(GL gl, StringBuilder sb) {
+    public static StringBuilder getGLStrings(final GL gl, final StringBuilder sb) {
         return getGLStrings(gl, sb, true);
     }
 
-    public static StringBuilder getGLStrings(GL gl, StringBuilder sb, boolean withExtensions) {
+    public static StringBuilder getGLStrings(final GL gl, StringBuilder sb, final boolean withExtensions) {
         if(null==sb) {
             sb = new StringBuilder();
         }
@@ -200,7 +200,7 @@ public class JoglVersion extends JogampVersion {
         return sb;
     }
 
-    public StringBuilder getBriefOSGLBuildInfo(GL gl, StringBuilder sb) {
+    public StringBuilder getBriefOSGLBuildInfo(final GL gl, StringBuilder sb) {
         if(null==sb) {
             sb = new StringBuilder();
         }
@@ -217,7 +217,7 @@ public class JoglVersion extends JogampVersion {
         return sb;
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         System.err.println(VersionUtil.getPlatformInfo());
         System.err.println(GlueGenVersion.getInstance());
         // System.err.println(NativeWindowVersion.getInstance());
diff --git a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
index 4270607..8f033a8 100644
--- a/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/com/jogamp/opengl/cg/CgDynamicLibraryBundleInfo.java
@@ -49,7 +49,7 @@ public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
 
                 if(TempJarCache.isInitialized()) {
                    // only: jogl-cg.jar -> jogl-cg-natives-<os.and.arch>.jar [atomic JAR files only]
-                   JNILibLoaderBase.addNativeJarLibs(new Class<?>[] { CgDynamicLibraryBundleInfo.class }, null, null );
+                   JNILibLoaderBase.addNativeJarLibs(new Class<?>[] { jogamp.opengl.cg.CgPackagePlaceholder.class }, null);
                 }
                 return null;
             }
@@ -89,12 +89,12 @@ public final class CgDynamicLibraryBundleInfo implements DynamicLibraryBundleInf
 
     /** Tool has none **/
     @Override
-    public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+    public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
         return 0;
     }
 
     @Override
-    public final boolean useToolGetProcAdressFirst(String funcName) {
+    public final boolean useToolGetProcAdressFirst(final String funcName) {
         return false;
     }
 
diff --git a/src/jogl/classes/com/jogamp/opengl/cg/CgException.java b/src/jogl/classes/com/jogamp/opengl/cg/CgException.java
index 3e42f4d..0a3535b 100644
--- a/src/jogl/classes/com/jogamp/opengl/cg/CgException.java
+++ b/src/jogl/classes/com/jogamp/opengl/cg/CgException.java
@@ -50,18 +50,18 @@ public class CgException extends RuntimeException {
   }
 
   /** Constructs a CgException object with the specified detail message. */
-  public CgException(String message) {
+  public CgException(final String message) {
     super(message);
   }
 
   /** Constructs a CgException object with the specified detail message and
       root cause. */
-  public CgException(String message, Throwable cause) {
+  public CgException(final String message, final Throwable cause) {
     super(message, cause);
   }
 
   /** Constructs a CgException object with the specified root cause. */
-  public CgException(Throwable cause) {
+  public CgException(final Throwable cause) {
     super(cause);
   }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Binary16.java b/src/jogl/classes/com/jogamp/opengl/math/Binary16.java
index 33add46..8e4aa91 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Binary16.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Binary16.java
@@ -151,7 +151,7 @@ public final class Binary16
    * the interval of double precision values is far larger than that of the
    * <code>binary16</code> type.
    * </p>
-   * 
+   *
    * @see #unpackDouble(char)
    */
 
@@ -224,7 +224,7 @@ public final class Binary16
    * the interval of single precision values is far larger than that of the
    * <code>binary16</code> type.
    * </p>
-   * 
+   *
    * @see #unpackFloat(char)
    */
 
@@ -280,7 +280,7 @@ public final class Binary16
    * range <code>[-15, 16]</code> - values outside of this range will be
    * truncated.
    * </p>
-   * 
+   *
    * @see #unpackGetExponentUnbiased(char)
    */
 
@@ -298,7 +298,7 @@ public final class Binary16
    * Encode the significand <code>s</code>. Values should be in the range
    * <code>[0, 1023]</code>. Values outside of this range will be truncated.
    * </p>
-   * 
+   *
    * @see #unpackGetSignificand(char)
    */
 
@@ -315,7 +315,7 @@ public final class Binary16
    * <code>[0, 1]</code>, with <code>0</code> ironically denoting a positive
    * value. Values outside of this range will be truncated.
    * </p>
-   * 
+   *
    * @see #unpackGetSign(char)
    */
 
@@ -369,7 +369,7 @@ public final class Binary16
    * <code>k</code>, and the decoded significand <code>s</code> of
    * <code>k</code>.</li>
    * </ul>
-   * 
+   *
    * @see #packDouble(double)
    */
 
@@ -405,7 +405,7 @@ public final class Binary16
 
     /**
      * 1. Bias the exponent.
-     * 
+     *
      * 2. Shift the result left to the position at which it will appear in the
      * resulting value.
      */
@@ -443,7 +443,7 @@ public final class Binary16
    * <code>k</code>, and the decoded significand <code>s</code> of
    * <code>k</code>.</li>
    * </ul>
-   * 
+   *
    * @see #packFloat(float)
    */
 
@@ -479,7 +479,7 @@ public final class Binary16
 
     /**
      * 1. Bias the exponent.
-     * 
+     *
      * 2. Shift the result left to the position at which it will appear in the
      * resulting value.
      */
@@ -522,7 +522,7 @@ public final class Binary16
    * <code>16</code> iff the input is {@link #POSITIVE_INFINITY},
    * {@link #NEGATIVE_INFINITY}, or <code>NaN</code>.</li>
    * </ul>
-   * 
+   *
    * @see #packSetExponentUnbiasedUnchecked(int)
    */
 
@@ -537,7 +537,7 @@ public final class Binary16
   /**
    * Retrieve the sign bit of the given packed <code>binary16</code> value, as
    * an integer in the range <code>[0, 1]</code>.
-   * 
+   *
    * @see Binary16#packSetSignUnchecked(int)
    */
 
@@ -552,7 +552,7 @@ public final class Binary16
    * Return the significand of the given packed <code>binary16</code> value as
    * an integer in the range <code>[0, 1023]</code>.
    * </p>
-   * 
+   *
    * @see Binary16#packSetSignificandUnchecked(int)
    */
 
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Binary32.java b/src/jogl/classes/com/jogamp/opengl/math/Binary32.java
index d98815d..599b1ff 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Binary32.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Binary32.java
@@ -75,7 +75,7 @@ public final class Binary32
    * {@link #POSITIVE_INFINITY}, {@link #NEGATIVE_INFINITY}, or
    * <code>NaN</code>.</li>
    * </ul>
-   * 
+   *
    * @see #packSetExponentUnbiasedUnchecked(int)
    */
 
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Binary64.java b/src/jogl/classes/com/jogamp/opengl/math/Binary64.java
index 5efad43..d4ec636 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Binary64.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Binary64.java
@@ -75,7 +75,7 @@ public final class Binary64
    * {@link #POSITIVE_INFINITY}, {@link #NEGATIVE_INFINITY}, or
    * <code>NaN</code>.</li>
    * </ul>
-   * 
+   *
    * @see #packSetExponentUnbiasedUnchecked(int)
    */
 
@@ -93,7 +93,7 @@ public final class Binary64
    * Return the significand of the given double value.
    * </p>
    */
-  
+
   public static long unpackGetSignificand(
     final double d)
   {
@@ -106,7 +106,7 @@ public final class Binary64
    * Return the sign of the given double value.
    * </p>
    */
-  
+
   public static long unpackGetSign(
     final double d)
   {
diff --git a/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java b/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java
index b7dbf18..31408b0 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/FixedPoint.java
@@ -46,15 +46,15 @@ public class FixedPoint {
     return (int)(value * 65536.0f);
   }
 
-  public static final float toFloat(int value) {
-    return (float)value/65536.0f;
+  public static final float toFloat(final int value) {
+    return value/65536.0f;
   }
 
-  public static final int mult(int x1, int x2) {
+  public static final int mult(final int x1, final int x2) {
     return (int) ( ((long)x1*(long)x2)/65536 );
   }
 
-  public static final int div(int x1, int x2) {
+  public static final int div(final int x1, final int x2) {
     return (int) ( (((long)x1)<<16)/x2 );
   }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java b/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java
index 191a832..3a35686 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/FloatUtil.java
@@ -29,300 +29,1741 @@ package com.jogamp.opengl.math;
 
 import java.nio.FloatBuffer;
 
+import javax.media.opengl.GLException;
+
+import jogamp.opengl.Debug;
+
 import com.jogamp.common.os.Platform;
+import com.jogamp.opengl.math.geom.AABBox;
 
 /**
  * Basic Float math utility functions.
  * <p>
  * Implementation assumes linear matrix layout in column-major order
- * matching OpenGL's implementation.
+ * matching OpenGL's implementation, illustration:
+ * <pre>
+  Row-Major                    Column-Major (OpenGL):
+
+        | 0  1  2  3  |            | 0  4  8  12 |
+        |             |            |             |
+        | 4  5  6  7  |            | 1  5  9  13 |
+    M = |             |        M = |             |
+        | 8  9  10 11 |            | 2  6  10 14 |
+        |             |            |             |
+        | 12 13 14 15 |            | 3  7  11 15 |
+
+           C   R                      C   R
+         m[0*4+3] = tx;             m[0+4*3] = tx;
+         m[1*4+3] = ty;             m[1+4*3] = ty;
+         m[2*4+3] = tz;             m[2+4*3] = tz;
+ * </pre>
  * </p>
  * <p>
- * Derived from ProjectFloat.java - Created 11-jan-2004
+ * <ul>
+ *   <li><a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html">Matrix-FAQ</a></li>
+ *   <li><a href="https://en.wikipedia.org/wiki/Matrix_%28mathematics%29">Wikipedia-Matrix</a></li>
+ *   <li><a href="http://www.euclideanspace.com/maths/algebra/matrix/index.htm">euclideanspace.com-Matrix</a></li>
+ * </ul>
+ * </p>
+ * <p>
+ * Implementation utilizes unrolling of small vertices and matrices wherever possible
+ * while trying to access memory in a linear fashion for performance reasons, see:
+ * <ul>
+ *   <li><a href="https://code.google.com/p/java-matrix-benchmark/">java-matrix-benchmark</a></li>
+ *   <li><a href="https://github.com/lessthanoptimal/ejml">EJML Efficient Java Matrix Library</a></li>
+ * </ul>
  * </p>
- *
- * @author Erik Duijs
- * @author Kenneth Russell
- * @author Sven Gothel
  */
-public class FloatUtil {
-  private static final float[] IDENTITY_MATRIX =
-    new float[] {
-      1.0f, 0.0f, 0.0f, 0.0f,
-      0.0f, 1.0f, 0.0f, 0.0f,
-      0.0f, 0.0f, 1.0f, 0.0f,
-      0.0f, 0.0f, 0.0f, 1.0f };
-
-  private static final float[] ZERO_MATRIX =
-    new float[] {
-      0.0f, 0.0f, 0.0f, 0.0f,
-      0.0f, 0.0f, 0.0f, 0.0f,
-      0.0f, 0.0f, 0.0f, 0.0f,
-      0.0f, 0.0f, 0.0f, 0.0f };
+public final class FloatUtil {
+  public static final boolean DEBUG = Debug.debug("Math");
+
+  //
+  // Matrix Ops
+  //
 
   /**
    * Make matrix an identity matrix
+   * @param m 4x4 matrix in column-major order (also result)
+   * @param m_offset offset in given array <i>m</i>, i.e. start of the 4x4 matrix
+   * @return given matrix for chaining
    */
-  public static final void makeIdentityf(float[] m, int offset) {
-    for (int i = 0; i < 16; i++) {
-      m[i+offset] = IDENTITY_MATRIX[i];
-    }
+  public static float[] makeIdentity(final float[] m, final int m_offset) {
+      m[m_offset+0+4*0] = 1f;
+      m[m_offset+1+4*0] = 0f;
+      m[m_offset+2+4*0] = 0f;
+      m[m_offset+3+4*0] = 0f;
+
+      m[m_offset+0+4*1] = 0f;
+      m[m_offset+1+4*1] = 1f;
+      m[m_offset+2+4*1] = 0f;
+      m[m_offset+3+4*1] = 0f;
+
+      m[m_offset+0+4*2] = 0f;
+      m[m_offset+1+4*2] = 0f;
+      m[m_offset+2+4*2] = 1f;
+      m[m_offset+3+4*2] = 0f;
+
+      m[m_offset+0+4*3] = 0f;
+      m[m_offset+1+4*3] = 0f;
+      m[m_offset+2+4*3] = 0f;
+      m[m_offset+3+4*3] = 1f;
+      return m;
   }
 
   /**
    * Make matrix an identity matrix
+   * @param m 4x4 matrix in column-major order (also result)
+   * @return given matrix for chaining
    */
-  public static final void makeIdentityf(FloatBuffer m) {
-    final int oldPos = m.position();
-    m.put(IDENTITY_MATRIX);
-    m.position(oldPos);
+  public static float[] makeIdentity(final float[] m) {
+      m[0+4*0] = 1f;
+      m[1+4*0] = 0f;
+      m[2+4*0] = 0f;
+      m[3+4*0] = 0f;
+
+      m[0+4*1] = 0f;
+      m[1+4*1] = 1f;
+      m[2+4*1] = 0f;
+      m[3+4*1] = 0f;
+
+      m[0+4*2] = 0f;
+      m[1+4*2] = 0f;
+      m[2+4*2] = 1f;
+      m[3+4*2] = 0f;
+
+      m[0+4*3] = 0f;
+      m[1+4*3] = 0f;
+      m[2+4*3] = 0f;
+      m[3+4*3] = 1f;
+      return m;
   }
 
   /**
-   * Make matrix an zero matrix
+   * Make a translation matrix in column-major order from the given axis deltas
+   * <pre>
+      Translation matrix (Column Order):
+      1 0 0 0
+      0 1 0 0
+      0 0 1 0
+      x y z 1
+   * </pre>
+   * <p>
+   * All matrix fields are only set if <code>initM</code> is <code>true</code>.
+   * </p>
+   * @param m 4x4 matrix in column-major order (also result)
+   * @param m_offset offset in given array <i>m</i>, i.e. start of the 4x4 matrix
+   * @param initM if true, given matrix will be initialized w/ identity matrix,
+   *              otherwise only the diagonal and last-row is set.
+   *              The latter can be utilized to share a once {@link #makeIdentity(float[], int) identity set} matrix
+   *              for {@link #makeScale(float[], int, boolean, float, float, float) scaling}
+   *              and {@link #makeTranslation(float[], int, boolean, float, float, float) translation},
+   *              while leaving the other fields untouched for performance reasons.
+   * @return given matrix for chaining
    */
-  public static final void makeZero(float[] m, int offset) {
-    for (int i = 0; i < 16; i++) {
-      m[i+offset] = 0;
-    }
+  public static float[] makeTranslation(final float[] m, final int m_offset, final boolean initM, final float tx, final float ty, final float tz) {
+      if( initM ) {
+          makeIdentity(m, m_offset);
+      } else {
+          m[m_offset+0+4*0] = 1;
+          m[m_offset+1+4*1] = 1;
+          m[m_offset+2+4*2] = 1;
+          m[m_offset+3+4*3] = 1;
+      }
+      m[m_offset+0+4*3] = tx;
+      m[m_offset+1+4*3] = ty;
+      m[m_offset+2+4*3] = tz;
+      return m;
   }
 
   /**
-   * Make matrix an zero matrix
+   * Make a translation matrix in column-major order from the given axis deltas
+   * <pre>
+      Translation matrix (Column Order):
+      1 0 0 0
+      0 1 0 0
+      0 0 1 0
+      x y z 1
+   * </pre>
+   * <p>
+   * All matrix fields are only set if <code>initM</code> is <code>true</code>.
+   * </p>
+   * @param m 4x4 matrix in column-major order (also result)
+   * @param initM if true, given matrix will be initialized w/ identity matrix,
+   *              otherwise only the diagonal and last-row is set.
+   *              The latter can be utilized to share a once {@link #makeIdentity(float[], int) identity set} matrix
+   *              for {@link #makeScale(float[], int, boolean, float, float, float) scaling}
+   *              and {@link #makeTranslation(float[], int, boolean, float, float, float) translation},
+   *              while leaving the other fields untouched for performance reasons.
+   * @return given matrix for chaining
    */
-  public static final void makeZero(FloatBuffer m) {
-    final int oldPos = m.position();
-    m.put(ZERO_MATRIX);
-    m.position(oldPos);
+  public static float[] makeTranslation(final float[] m, final boolean initM, final float tx, final float ty, final float tz) {
+      if( initM ) {
+          makeIdentity(m);
+      } else {
+          m[0+4*0] = 1;
+          m[1+4*1] = 1;
+          m[2+4*2] = 1;
+          m[3+4*3] = 1;
+      }
+      m[0+4*3] = tx;
+      m[1+4*3] = ty;
+      m[2+4*3] = tz;
+      return m;
   }
 
   /**
-   * @param a 4x4 matrix in column-major order
-   * @param b 4x4 matrix in column-major order
-   * @param d result a*b in column-major order
+   * Make a scale matrix in column-major order from the given axis factors
+   * <pre>
+      Scale matrix (Any Order):
+      x 0 0 0
+      0 y 0 0
+      0 0 z 0
+      0 0 0 1
+   * </pre>
+   * <p>
+   * All matrix fields are only set if <code>initM</code> is <code>true</code>.
+   * </p>
+   * @param m 4x4 matrix in column-major order (also result)
+   * @param m_offset offset in given array <i>m</i>, i.e. start of the 4x4 matrix
+   * @param initM if true, given matrix will be initialized w/ identity matrix,
+   *              otherwise only the diagonal and last-row is set.
+   *              The latter can be utilized to share a once {@link #makeIdentity(float[], int) identity set} matrix
+   *              for {@link #makeScale(float[], int, boolean, float, float, float) scaling}
+   *              and {@link #makeTranslation(float[], int, boolean, float, float, float) translation},
+   *              while leaving the other fields untouched for performance reasons.
+   * @return given matrix for chaining
    */
-  public static final void multMatrixf(final float[] a, int a_off, final float[] b, int b_off, float[] d, int d_off) {
-     for (int i = 0; i < 4; i++) {
-        // one row in column-major order
-        final float ai0=a[a_off+i+0*4],  ai1=a[a_off+i+1*4],  ai2=a[a_off+i+2*4],  ai3=a[a_off+i+3*4]; // row-i of a
-        d[d_off+i+0*4] = ai0 * b[b_off+0+0*4] + ai1 * b[b_off+1+0*4] + ai2 * b[b_off+2+0*4] + ai3 * b[b_off+3+0*4] ;
-        d[d_off+i+1*4] = ai0 * b[b_off+0+1*4] + ai1 * b[b_off+1+1*4] + ai2 * b[b_off+2+1*4] + ai3 * b[b_off+3+1*4] ;
-        d[d_off+i+2*4] = ai0 * b[b_off+0+2*4] + ai1 * b[b_off+1+2*4] + ai2 * b[b_off+2+2*4] + ai3 * b[b_off+3+2*4] ;
-        d[d_off+i+3*4] = ai0 * b[b_off+0+3*4] + ai1 * b[b_off+1+3*4] + ai2 * b[b_off+2+3*4] + ai3 * b[b_off+3+3*4] ;
-     }
+  public static float[] makeScale(final float[] m, final int m_offset, final boolean initM, final float sx, final float sy, final float sz) {
+      if( initM ) {
+          makeIdentity(m, m_offset);
+      } else {
+          m[m_offset+0+4*3] = 0;
+          m[m_offset+1+4*3] = 0;
+          m[m_offset+2+4*3] = 0;
+          m[m_offset+3+4*3] = 1;
+      }
+      m[m_offset+0+4*0] = sx;
+      m[m_offset+1+4*1] = sy;
+      m[m_offset+2+4*2] = sz;
+      return m;
   }
 
   /**
-   * @param a 4x4 matrix in column-major order (also result)
-   * @param b 4x4 matrix in column-major order
+   * Make a scale matrix in column-major order from the given axis factors
+   * <pre>
+      Scale matrix (Any Order):
+      x 0 0 0
+      0 y 0 0
+      0 0 z 0
+      0 0 0 1
+   * </pre>
+   * <p>
+   * All matrix fields are only set if <code>initM</code> is <code>true</code>.
+   * </p>
+   * @param m 4x4 matrix in column-major order (also result)
+   * @param initM if true, given matrix will be initialized w/ identity matrix,
+   *              otherwise only the diagonal and last-row is set.
+   *              The latter can be utilized to share a once {@link #makeIdentity(float[], int) identity set} matrix
+   *              for {@link #makeScale(float[], int, boolean, float, float, float) scaling}
+   *              and {@link #makeTranslation(float[], int, boolean, float, float, float) translation},
+   *              while leaving the other fields untouched for performance reasons.
+   * @return given matrix for chaining
    */
-  public static final void multMatrixf(final float[] a, int a_off, final float[] b, int b_off) {
-     for (int i = 0; i < 4; i++) {
-        // one row in column-major order
-        final int a_off_i = a_off+i;
-        final float ai0=a[a_off_i+0*4],  ai1=a[a_off_i+1*4],  ai2=a[a_off_i+2*4],  ai3=a[a_off_i+3*4]; // row-i of a
-        a[a_off_i+0*4] = ai0 * b[b_off+0+0*4] + ai1 * b[b_off+1+0*4] + ai2 * b[b_off+2+0*4] + ai3 * b[b_off+3+0*4] ;
-        a[a_off_i+1*4] = ai0 * b[b_off+0+1*4] + ai1 * b[b_off+1+1*4] + ai2 * b[b_off+2+1*4] + ai3 * b[b_off+3+1*4] ;
-        a[a_off_i+2*4] = ai0 * b[b_off+0+2*4] + ai1 * b[b_off+1+2*4] + ai2 * b[b_off+2+2*4] + ai3 * b[b_off+3+2*4] ;
-        a[a_off_i+3*4] = ai0 * b[b_off+0+3*4] + ai1 * b[b_off+1+3*4] + ai2 * b[b_off+2+3*4] + ai3 * b[b_off+3+3*4] ;
-     }
+  public static float[] makeScale(final float[] m, final boolean initM, final float sx, final float sy, final float sz) {
+      if( initM ) {
+          makeIdentity(m);
+      } else {
+          m[0+4*3] = 0;
+          m[1+4*3] = 0;
+          m[2+4*3] = 0;
+          m[3+4*3] = 1;
+      }
+      m[0+4*0] = sx;
+      m[1+4*1] = sy;
+      m[2+4*2] = sz;
+      return m;
   }
 
   /**
-   * @param a 4x4 matrix in column-major order
-   * @param b 4x4 matrix in column-major order
-   * @param d result a*b in column-major order
+   * Make a rotation matrix from the given axis and angle in radians.
+   * <pre>
+        Rotation matrix (Column Order):
+        xx(1-c)+c  xy(1-c)+zs xz(1-c)-ys 0
+        xy(1-c)-zs yy(1-c)+c  yz(1-c)+xs 0
+        xz(1-c)+ys yz(1-c)-xs zz(1-c)+c  0
+        0          0          0          1
+   * </pre>
+   * <p>
+   * All matrix fields are set.
+   * </p>
+   * @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q38">Matrix-FAQ Q38</a>
+   * @param m 4x4 matrix in column-major order (also result)
+   * @param m_offset offset in given array <i>m</i>, i.e. start of the 4x4 matrix
+   * @return given matrix for chaining
    */
-  public static final void multMatrixf(final float[] a, int a_off, final float[] b, int b_off, FloatBuffer d) {
-     final int dP = d.position();
-     for (int i = 0; i < 4; i++) {
-        // one row in column-major order
-        final float ai0=a[a_off+i+0*4],  ai1=a[a_off+i+1*4],  ai2=a[a_off+i+2*4],  ai3=a[a_off+i+3*4]; // row-i of a
-        d.put(dP+i+0*4 , ai0 * b[b_off+0+0*4] + ai1 * b[b_off+1+0*4] + ai2 * b[b_off+2+0*4] + ai3 * b[b_off+3+0*4] );
-        d.put(dP+i+1*4 , ai0 * b[b_off+0+1*4] + ai1 * b[b_off+1+1*4] + ai2 * b[b_off+2+1*4] + ai3 * b[b_off+3+1*4] );
-        d.put(dP+i+2*4 , ai0 * b[b_off+0+2*4] + ai1 * b[b_off+1+2*4] + ai2 * b[b_off+2+2*4] + ai3 * b[b_off+3+2*4] );
-        d.put(dP+i+3*4 , ai0 * b[b_off+0+3*4] + ai1 * b[b_off+1+3*4] + ai2 * b[b_off+2+3*4] + ai3 * b[b_off+3+3*4] );
-     }
+  public static float[] makeRotationAxis(final float[] m, final int m_offset, final float angrad, float x, float y, float z, final float[] tmpVec3f) {
+      final float c = cos(angrad);
+      final float ic= 1.0f - c;
+      final float s = sin(angrad);
+
+      tmpVec3f[0]=x; tmpVec3f[1]=y; tmpVec3f[2]=z;
+      VectorUtil.normalizeVec3(tmpVec3f);
+      x = tmpVec3f[0]; y = tmpVec3f[1]; z = tmpVec3f[2];
+
+      final float xy = x*y;
+      final float xz = x*z;
+      final float xs = x*s;
+      final float ys = y*s;
+      final float yz = y*z;
+      final float zs = z*s;
+      m[0+0*4+m_offset] = x*x*ic+c;
+      m[1+0*4+m_offset] = xy*ic+zs;
+      m[2+0*4+m_offset] = xz*ic-ys;
+      m[3+0*4+m_offset] = 0;
+
+      m[0+1*4+m_offset] = xy*ic-zs;
+      m[1+1*4+m_offset] = y*y*ic+c;
+      m[2+1*4+m_offset] = yz*ic+xs;
+      m[3+1*4+m_offset] = 0;
+
+      m[0+2*4+m_offset] = xz*ic+ys;
+      m[1+2*4+m_offset] = yz*ic-xs;
+      m[2+2*4+m_offset] = z*z*ic+c;
+      m[3+2*4+m_offset] = 0;
+
+      m[0+3*4+m_offset]  = 0f;
+      m[1+3*4+m_offset]  = 0f;
+      m[2+3*4+m_offset]  = 0f;
+      m[3+3*4+m_offset]  = 1f;
+
+      return m;
   }
 
   /**
-   * @param a 4x4 matrix in column-major order
-   * @param b 4x4 matrix in column-major order
-   * @param d result a*b in column-major order
+   * Make a concatenated rotation matrix in column-major order from the given Euler rotation angles in radians.
+   * <p>
+   * The rotations are applied in the given order:
+   * <ul>
+   *  <li>y - heading</li>
+   *  <li>z - attitude</li>
+   *  <li>x - bank</li>
+   * </ul>
+   * </p>
+   * <p>
+   * All matrix fields are set.
+   * </p>
+   * @param m 4x4 matrix in column-major order (also result)
+   * @param m_offset offset in given array <i>m</i>, i.e. start of the 4x4 matrix
+   * @param bankX the Euler pitch angle in radians. (rotation about the X axis)
+   * @param headingY the Euler yaw angle in radians. (rotation about the Y axis)
+   * @param attitudeZ the Euler roll angle in radians. (rotation about the Z axis)
+   * @return given matrix for chaining
+   * <p>
+   * Implementation does not use Quaternion and hence is exposed to
+   * <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q34">Gimbal-Lock</a>
+   * </p>
+   * @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q36">Matrix-FAQ Q36</a>
+   * @see <a href="http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToMatrix/index.htm">euclideanspace.com-eulerToMatrix</a>
    */
-  public static final void multMatrixf(final FloatBuffer a, final float[] b, int b_off, FloatBuffer d) {
-     final int aP = a.position();
-     final int dP = d.position();
-     for (int i = 0; i < 4; i++) {
-        // one row in column-major order
-        final float ai0=a.get(aP+i+0*4),  ai1=a.get(aP+i+1*4),  ai2=a.get(aP+i+2*4),  ai3=a.get(aP+i+3*4); // row-i of a
-        d.put(dP+i+0*4 , ai0 * b[b_off+0+0*4] + ai1 * b[b_off+1+0*4] + ai2 * b[b_off+2+0*4] + ai3 * b[b_off+3+0*4] );
-        d.put(dP+i+1*4 , ai0 * b[b_off+0+1*4] + ai1 * b[b_off+1+1*4] + ai2 * b[b_off+2+1*4] + ai3 * b[b_off+3+1*4] );
-        d.put(dP+i+2*4 , ai0 * b[b_off+0+2*4] + ai1 * b[b_off+1+2*4] + ai2 * b[b_off+2+2*4] + ai3 * b[b_off+3+2*4] );
-        d.put(dP+i+3*4 , ai0 * b[b_off+0+3*4] + ai1 * b[b_off+1+3*4] + ai2 * b[b_off+2+3*4] + ai3 * b[b_off+3+3*4] );
-     }
+  public static float[] makeRotationEuler(final float[] m, final int m_offset, final float bankX, final float headingY, final float attitudeZ) {
+      // Assuming the angles are in radians.
+      final float ch = cos(headingY);
+      final float sh = sin(headingY);
+      final float ca = cos(attitudeZ);
+      final float sa = sin(attitudeZ);
+      final float cb = cos(bankX);
+      final float sb = sin(bankX);
+
+      m[0+0*4+m_offset] =  ch*ca;
+      m[1+0*4+m_offset] =  sa;
+      m[2+0*4+m_offset] = -sh*ca;
+      m[3+0*4+m_offset] =  0;
+
+      m[0+1*4+m_offset] =  sh*sb    - ch*sa*cb;
+      m[1+1*4+m_offset] =  ca*cb;
+      m[2+1*4+m_offset] =  sh*sa*cb + ch*sb;
+      m[3+1*4+m_offset] =  0;
+
+      m[0+2*4+m_offset] =  ch*sa*sb + sh*cb;
+      m[1+2*4+m_offset] = -ca*sb;
+      m[2+2*4+m_offset] = -sh*sa*sb + ch*cb;
+      m[3+2*4+m_offset] =  0;
+
+      m[0+3*4+m_offset] =  0;
+      m[1+3*4+m_offset] =  0;
+      m[2+3*4+m_offset] =  0;
+      m[3+3*4+m_offset] =  1;
+
+      return m;
   }
 
   /**
-   * @param a 4x4 matrix in column-major order (also result)
-   * @param b 4x4 matrix in column-major order
+   * Make given matrix the orthogonal matrix based on given parameters.
+   * <pre>
+      Ortho matrix (Column Order):
+      2/dx  0     0    0
+      0     2/dy  0    0
+      0     0     2/dz 0
+      tx    ty    tz   1
+   * </pre>
+   * <p>
+   * All matrix fields are only set if <code>initM</code> is <code>true</code>.
+   * </p>
+   * @param m 4x4 matrix in column-major order (also result)
+   * @param m_offset offset in given array <i>m</i>, i.e. start of the 4x4 matrix
+   * @param initM if true, given matrix will be initialized w/ identity matrix,
+   *              otherwise only the orthogonal fields are set.
+   * @param left
+   * @param right
+   * @param bottom
+   * @param top
+   * @param zNear
+   * @param zFar
+   * @return given matrix for chaining
    */
-  public static final void multMatrixf(final FloatBuffer a, final float[] b, int b_off) {
-     final int aP = a.position();
-     for (int i = 0; i < 4; i++) {
-        // one row in column-major order
-        final int aP_i = aP+i;
-        final float ai0=a.get(aP_i+0*4),  ai1=a.get(aP_i+1*4),  ai2=a.get(aP_i+2*4),  ai3=a.get(aP_i+3*4); // row-i of a
-        a.put(aP_i+0*4 , ai0 * b[b_off+0+0*4] + ai1 * b[b_off+1+0*4] + ai2 * b[b_off+2+0*4] + ai3 * b[b_off+3+0*4] );
-        a.put(aP_i+1*4 , ai0 * b[b_off+0+1*4] + ai1 * b[b_off+1+1*4] + ai2 * b[b_off+2+1*4] + ai3 * b[b_off+3+1*4] );
-        a.put(aP_i+2*4 , ai0 * b[b_off+0+2*4] + ai1 * b[b_off+1+2*4] + ai2 * b[b_off+2+2*4] + ai3 * b[b_off+3+2*4] );
-        a.put(aP_i+3*4 , ai0 * b[b_off+0+3*4] + ai1 * b[b_off+1+3*4] + ai2 * b[b_off+2+3*4] + ai3 * b[b_off+3+3*4] );
-     }
+  public static float[] makeOrtho(final float[] m, final int m_offset, final boolean initM,
+                                  final float left, final float right,
+                                  final float bottom, final float top,
+                                  final float zNear, final float zFar) {
+      if( initM ) {
+          // m[m_offset+0+4*0] = 1f;
+          m[m_offset+1+4*0] = 0f;
+          m[m_offset+2+4*0] = 0f;
+          m[m_offset+3+4*0] = 0f;
+
+          m[m_offset+0+4*1] = 0f;
+          // m[m_offset+1+4*1] = 1f;
+          m[m_offset+2+4*1] = 0f;
+          m[m_offset+3+4*1] = 0f;
+
+          m[m_offset+0+4*2] = 0f;
+          m[m_offset+1+4*2] = 0f;
+          // m[m_offset+2+4*2] = 1f;
+          m[m_offset+3+4*2] = 0f;
+
+          // m[m_offset+0+4*3] = 0f;
+          // m[m_offset+1+4*3] = 0f;
+          // m[m_offset+2+4*3] = 0f;
+          // m[m_offset+3+4*3] = 1f;
+      }
+      final float dx=right-left;
+      final float dy=top-bottom;
+      final float dz=zFar-zNear;
+      final float tx=-1.0f*(right+left)/dx;
+      final float ty=-1.0f*(top+bottom)/dy;
+      final float tz=-1.0f*(zFar+zNear)/dz;
+
+      m[m_offset+0+4*0] =  2.0f/dx;
+
+      m[m_offset+1+4*1] =  2.0f/dy;
+
+      m[m_offset+2+4*2] = -2.0f/dz;
+
+      m[m_offset+0+4*3] = tx;
+      m[m_offset+1+4*3] = ty;
+      m[m_offset+2+4*3] = tz;
+      m[m_offset+3+4*3] = 1f;
+
+      return m;
   }
 
   /**
-   * @param a 4x4 matrix in column-major order
-   * @param b 4x4 matrix in column-major order
-   * @param d result a*b in column-major order
+   * Make given matrix the frustum matrix based on given parameters.
+   * <pre>
+      Frustum matrix (Column Order):
+      2*zNear/dx   0          0   0
+      0            2*zNear/dy 0   0
+      A            B          C  -1
+      0            0          D   0
+   * </pre>
+   * <p>
+   * All matrix fields are only set if <code>initM</code> is <code>true</code>.
+   * </p>
+   *
+   * @param m 4x4 matrix in column-major order (also result)
+   * @param m_offset offset in given array <i>m</i>, i.e. start of the 4x4 matrix
+   * @param initM if true, given matrix will be initialized w/ identity matrix,
+   *              otherwise only the frustum fields are set.
+   * @param left
+   * @param right
+   * @param bottom
+   * @param top
+   * @param zNear
+   * @param zFar
+   * @return given matrix for chaining
    */
-  public static final void multMatrixf(final FloatBuffer a, final FloatBuffer b, FloatBuffer d) {
-     final int aP = a.position();
-     final int bP = b.position();
-     final int dP = d.position();
-     for (int i = 0; i < 4; i++) {
-        // one row in column-major order
-        final float ai0=a.get(aP+i+0*4),  ai1=a.get(aP+i+1*4),  ai2=a.get(aP+i+2*4),  ai3=a.get(aP+i+3*4); // row-i of a
-        d.put(dP+i+0*4 , ai0 * b.get(bP+0+0*4) + ai1 * b.get(bP+1+0*4) + ai2 * b.get(bP+2+0*4) + ai3 * b.get(bP+3+0*4) );
-        d.put(dP+i+1*4 , ai0 * b.get(bP+0+1*4) + ai1 * b.get(bP+1+1*4) + ai2 * b.get(bP+2+1*4) + ai3 * b.get(bP+3+1*4) );
-        d.put(dP+i+2*4 , ai0 * b.get(bP+0+2*4) + ai1 * b.get(bP+1+2*4) + ai2 * b.get(bP+2+2*4) + ai3 * b.get(bP+3+2*4) );
-        d.put(dP+i+3*4 , ai0 * b.get(bP+0+3*4) + ai1 * b.get(bP+1+3*4) + ai2 * b.get(bP+2+3*4) + ai3 * b.get(bP+3+3*4) );
-     }
+  public static float[] makeFrustum(final float[] m, final int m_offset, final boolean initM,
+                                    final float left, final float right,
+                                    final float bottom, final float top,
+                                    final float zNear, final float zFar) {
+      if(zNear<=0.0f||zFar<0.0f) {
+          throw new GLException("GL_INVALID_VALUE: zNear and zFar must be positive, and zNear>0");
+      }
+      if(left==right || top==bottom) {
+          throw new GLException("GL_INVALID_VALUE: top,bottom and left,right must not be equal");
+      }
+      if( initM ) {
+          // m[m_offset+0+4*0] = 1f;
+          m[m_offset+1+4*0] = 0f;
+          m[m_offset+2+4*0] = 0f;
+          m[m_offset+3+4*0] = 0f;
+
+          m[m_offset+0+4*1] = 0f;
+          // m[m_offset+1+4*1] = 1f;
+          m[m_offset+2+4*1] = 0f;
+          m[m_offset+3+4*1] = 0f;
+
+          // m[m_offset+0+4*2] = 0f;
+          // m[m_offset+1+4*2] = 0f;
+          // m[m_offset+2+4*2] = 1f;
+          // m[m_offset+3+4*2] = 0f;
+
+          m[m_offset+0+4*3] = 0f;
+          m[m_offset+1+4*3] = 0f;
+          // m[m_offset+2+4*3] = 0f;
+          // m[m_offset+3+4*3] = 1f;
+      }
+      final float zNear2 = 2.0f*zNear;
+      final float dx=right-left;
+      final float dy=top-bottom;
+      final float dz=zFar-zNear;
+      final float A=(right+left)/dx;
+      final float B=(top+bottom)/dy;
+      final float C=-1.0f*(zFar+zNear)/dz;
+      final float D=-2.0f*(zFar*zNear)/dz;
+
+      m[m_offset+0+4*0] = zNear2/dx;
+
+      m[m_offset+1+4*1] = zNear2/dy;
+
+      m[m_offset+0+4*2] = A;
+      m[m_offset+1+4*2] = B;
+      m[m_offset+2+4*2] = C;
+      m[m_offset+3+4*2] = -1.0f;
+
+      m[m_offset+2+4*3] = D;
+      m[m_offset+3+4*3] = 0f;
+
+      return m;
   }
 
   /**
-   * @param a 4x4 matrix in column-major order (also result)
-   * @param b 4x4 matrix in column-major order
+   * Make given matrix the perspective {@link #makeFrustum(float[], int, boolean, float, float, float, float, float, float) frustum}
+   * matrix based on given parameters.
+   * <p>
+   * All matrix fields are only set if <code>initM</code> is <code>true</code>.
+   * </p>
+   *
+   * @param m 4x4 matrix in column-major order (also result)
+   * @param m_offset offset in given array <i>m</i>, i.e. start of the 4x4 matrix
+   * @param initM if true, given matrix will be initialized w/ identity matrix,
+   *              otherwise only the frustum fields are set.
+   * @param fovy_rad angle in radians
+   * @param aspect aspect ratio width / height
+   * @param zNear
+   * @param zFar
+   * @return given matrix for chaining
    */
-  public static final void multMatrixf(final FloatBuffer a, final FloatBuffer b) {
-     final int aP = a.position();
-     final int bP = b.position();
-     for (int i = 0; i < 4; i++) {
-        // one row in column-major order
-        final int aP_i = aP+i;
-        final float ai0=a.get(aP_i+0*4),  ai1=a.get(aP_i+1*4),  ai2=a.get(aP_i+2*4),  ai3=a.get(aP_i+3*4); // row-i of a
-        a.put(aP_i+0*4 , ai0 * b.get(bP+0+0*4) + ai1 * b.get(bP+1+0*4) + ai2 * b.get(bP+2+0*4) + ai3 * b.get(bP+3+0*4) );
-        a.put(aP_i+1*4 , ai0 * b.get(bP+0+1*4) + ai1 * b.get(bP+1+1*4) + ai2 * b.get(bP+2+1*4) + ai3 * b.get(bP+3+1*4) );
-        a.put(aP_i+2*4 , ai0 * b.get(bP+0+2*4) + ai1 * b.get(bP+1+2*4) + ai2 * b.get(bP+2+2*4) + ai3 * b.get(bP+3+2*4) );
-        a.put(aP_i+3*4 , ai0 * b.get(bP+0+3*4) + ai1 * b.get(bP+1+3*4) + ai2 * b.get(bP+2+3*4) + ai3 * b.get(bP+3+3*4) );
-     }
+  public static float[] makePerspective(final float[] m, final int m_off, final boolean initM,
+                                        final float fovy_rad, final float aspect, final float zNear, final float zFar) {
+      final float top    =  tan(fovy_rad/2f) * zNear; // use tangent of half-fov !
+      final float bottom =  -1.0f * top;
+      final float left   = aspect * bottom;
+      final float right  = aspect * top;
+      return makeFrustum(m, m_off, initM, left, right, bottom, top, zNear, zFar);
   }
 
   /**
-   * @param a 4x4 matrix in column-major order
-   * @param b 4x4 matrix in column-major order
-   * @param d result a*b in column-major order
+   * Make given matrix the perspective {@link #makeFrustum(float[], int, boolean, float, float, float, float, float, float) frustum}
+   * matrix based on given parameters.
+   * <p>
+   * All matrix fields are only set if <code>initM</code> is <code>true</code>.
+   * </p>
+   *
+   * @param m 4x4 matrix in column-major order (also result)
+   * @param m_offset offset in given array <i>m</i>, i.e. start of the 4x4 matrix
+   * @param initM if true, given matrix will be initialized w/ identity matrix,
+   *              otherwise only the frustum fields are set.
+   * @param fovhv {@link FovHVHalves} field of view in both directions, may not be centered, either in radians or tangent
+   * @param zNear
+   * @param zFar
+   * @return given matrix for chaining
    */
-  public static final void multMatrixf(final FloatBuffer a, final FloatBuffer b, float[] d, int d_off) {
-     final int aP = a.position();
-     final int bP = b.position();
-     for (int i = 0; i < 4; i++) {
-        // one row in column-major order
-        final float ai0=a.get(aP+i+0*4),  ai1=a.get(aP+i+1*4),  ai2=a.get(aP+i+2*4),  ai3=a.get(aP+i+3*4); // row-i of a
-        d[d_off+i+0*4] = ai0 * b.get(bP+0+0*4) + ai1 * b.get(bP+1+0*4) + ai2 * b.get(bP+2+0*4) + ai3 * b.get(bP+3+0*4) ;
-        d[d_off+i+1*4] = ai0 * b.get(bP+0+1*4) + ai1 * b.get(bP+1+1*4) + ai2 * b.get(bP+2+1*4) + ai3 * b.get(bP+3+1*4) ;
-        d[d_off+i+2*4] = ai0 * b.get(bP+0+2*4) + ai1 * b.get(bP+1+2*4) + ai2 * b.get(bP+2+2*4) + ai3 * b.get(bP+3+2*4) ;
-        d[d_off+i+3*4] = ai0 * b.get(bP+0+3*4) + ai1 * b.get(bP+1+3*4) + ai2 * b.get(bP+2+3*4) + ai3 * b.get(bP+3+3*4) ;
-     }
+  public static float[] makePerspective(final float[] m, final int m_offset, final boolean initM,
+                                        final FovHVHalves fovhv, final float zNear, final float zFar) {
+      final FovHVHalves fovhvTan = fovhv.toTangents();  // use tangent of half-fov !
+      final float top    =         fovhvTan.top    * zNear;
+      final float bottom = -1.0f * fovhvTan.bottom * zNear;
+      final float left   = -1.0f * fovhvTan.left   * zNear;
+      final float right  =         fovhvTan.right  * zNear;
+      return makeFrustum(m, m_offset, initM, left, right, bottom, top, zNear, zFar);
   }
 
   /**
-   * Normalize vector
+   * Make given matrix the <i>look-at</i> matrix based on given parameters.
+   * <p>
+   * Consist out of two matrix multiplications:
+   * <pre>
+   *   <b>R</b> = <b>L</b> x <b>T</b>,
+   *   with <b>L</b> for <i>look-at</i> matrix and
+   *        <b>T</b> for eye translation.
    *
-   * @param v makes len(v)==1
+   *   Result <b>R</b> can be utilized for <i>modelview</i> multiplication, i.e.
+   *          <b>M</b> = <b>M</b> x <b>R</b>,
+   *          with <b>M</b> being the <i>modelview</i> matrix.
+   * </pre>
+   * </p>
+   * <p>
+   * All matrix fields are set.
+   * </p>
+   * @param m 4x4 matrix in column-major order, result only
+   * @param m_offset offset in given array <i>m</i>, i.e. start of the 4x4 matrix
+   * @param eye 3 component eye vector
+   * @param eye_offset
+   * @param center 3 component center vector
+   * @param center_offset
+   * @param up 3 component up vector
+   * @param up_offset
+   * @param mat4Tmp temp float[16] storage
+   * @return given matrix <code>m</code> for chaining
    */
-  public static final void normalize(float[] v) {
-    float r = (float) Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
+  public static float[] makeLookAt(final float[] m, final int m_offset,
+                                   final float[] eye, final int eye_offset,
+                                   final float[] center, final int center_offset,
+                                   final float[] up, final int up_offset,
+                                   final float[] mat4Tmp) {
+      final int forward_off = 0;
+      final int side_off = 3;
+      final int up2_off = 6;
 
-    if ( r == 0.0 || r == 1.0) {
-      return;
-    }
+      // forward!
+      mat4Tmp[0] = center[0+center_offset] - eye[0+eye_offset];
+      mat4Tmp[1] = center[1+center_offset] - eye[1+eye_offset];
+      mat4Tmp[2] = center[2+center_offset] - eye[2+eye_offset];
+
+      VectorUtil.normalizeVec3(mat4Tmp); // normalize forward
+
+      /* Side = forward x up */
+      VectorUtil.crossVec3(mat4Tmp, side_off, mat4Tmp, forward_off, up, up_offset);
+      VectorUtil.normalizeVec3(mat4Tmp, side_off); // normalize side
+
+      /* Recompute up as: up = side x forward */
+      VectorUtil.crossVec3(mat4Tmp, up2_off, mat4Tmp, side_off, mat4Tmp, forward_off);
+
+      m[m_offset + 0 * 4 + 0] = mat4Tmp[0+side_off]; // side
+      m[m_offset + 0 * 4 + 1] = mat4Tmp[0+up2_off];  // up2
+      m[m_offset + 0 * 4 + 2] = -mat4Tmp[0];         // forward
+      m[m_offset + 0 * 4 + 3] = 0;
+
+      m[m_offset + 1 * 4 + 0] = mat4Tmp[1+side_off]; // side
+      m[m_offset + 1 * 4 + 1] = mat4Tmp[1+up2_off];  // up2
+      m[m_offset + 1 * 4 + 2] = -mat4Tmp[1];         // forward
+      m[m_offset + 1 * 4 + 3] = 0;
 
-    r = 1.0f / r;
+      m[m_offset + 2 * 4 + 0] = mat4Tmp[2+side_off]; // side
+      m[m_offset + 2 * 4 + 1] = mat4Tmp[2+up2_off];  // up2
+      m[m_offset + 2 * 4 + 2] = -mat4Tmp[2];         // forward
+      m[m_offset + 2 * 4 + 3] = 0;
 
-    v[0] *= r;
-    v[1] *= r;
-    v[2] *= r;
+      m[m_offset + 3 * 4 + 0] = 0;
+      m[m_offset + 3 * 4 + 1] = 0;
+      m[m_offset + 3 * 4 + 2] = 0;
+      m[m_offset + 3 * 4 + 3] = 1;
+
+      makeTranslation(mat4Tmp, true, -eye[0+eye_offset], -eye[1+eye_offset], -eye[2+eye_offset]);
+      multMatrix(m, m_offset, mat4Tmp, 0);
+
+      return m;
   }
 
   /**
-   * Normalize vector
+   * Make given matrix the <i>pick</i> matrix based on given parameters.
+   * <p>
+   * Traditional <code>gluPickMatrix</code> implementation.
+   * </p>
+   * <p>
+   * Consist out of two matrix multiplications:
+   * <pre>
+   *   <b>R</b> = <b>T</b> x <b>S</b>,
+   *   with <b>T</b> for viewport translation matrix and
+   *        <b>S</b> for viewport scale matrix.
    *
-   * @param v makes len(v)==1
+   *   Result <b>R</b> can be utilized for <i>projection</i> multiplication, i.e.
+   *          <b>P</b> = <b>P</b> x <b>R</b>,
+   *          with <b>P</b> being the <i>projection</i> matrix.
+   * </pre>
+   * </p>
+   * <p>
+   * To effectively use the generated pick matrix for picking,
+   * call {@link #makePick(float[], int, float, float, float, float, int[], int, float[]) makePick}
+   * and multiply a {@link #makePerspective(float[], int, boolean, float, float, float, float) custom perspective matrix}
+   * by this pick matrix. Then you may load the result onto the perspective matrix stack.
+   * </p>
+   * <p>
+   * All matrix fields are set.
+   * </p>
+   * @param m 4x4 matrix in column-major order, result only
+   * @param m_offset offset in given array <i>m</i>, i.e. start of the 4x4 matrix
+   * @param x the center x-component of a picking region in window coordinates
+   * @param y the center y-component of a picking region in window coordinates
+   * @param deltaX the width of the picking region in window coordinates.
+   * @param deltaY the height of the picking region in window coordinates.
+   * @param viewport 4 component viewport vector
+   * @param viewport_offset
+   * @param mat4Tmp temp float[16] storage
+   * @return given matrix <code>m</code> for chaining or <code>null</code> if either delta value is <= zero.
    */
-  public static final void normalize(FloatBuffer v) {
-    final int vPos = v.position();
+  public static float[] makePick(final float[] m, final int m_offset,
+                                 final float x, final float y,
+                                 final float deltaX, final float deltaY,
+                                 final int[] viewport, final int viewport_offset,
+                                 final float[] mat4Tmp) {
+      if (deltaX <= 0 || deltaY <= 0) {
+          return null;
+      }
 
-    float r = (float) Math.sqrt(v.get(0+vPos) * v.get(0+vPos) +
-                                v.get(1+vPos) * v.get(1+vPos) +
-                                v.get(2+vPos) * v.get(2+vPos));
+      /* Translate and scale the picked region to the entire window */
+      makeTranslation(m, m_offset, true,
+              (viewport[2+viewport_offset] - 2 * (x - viewport[0+viewport_offset])) / deltaX,
+              (viewport[3+viewport_offset] - 2 * (y - viewport[1+viewport_offset])) / deltaY,
+              0);
+      makeScale(mat4Tmp, true,
+              viewport[2+viewport_offset] / deltaX, viewport[3+viewport_offset] / deltaY, 1.0f);
+      multMatrix(m, m_offset, mat4Tmp, 0);
+      return m;
+  }
 
-    if ( r == 0.0 || r == 1.0) {
-      return;
-    }
+  /**
+   * Transpose the given matrix.
+   *
+   * @param msrc 4x4 matrix in column-major order, the source
+   * @param msrc_offset offset in given array <i>msrc</i>, i.e. start of the 4x4 matrix
+   * @param mres 4x4 matrix in column-major order, the result
+   * @param mres_offset offset in given array <i>mres</i>, i.e. start of the 4x4 matrix
+   * @return given result matrix <i>mres</i> for chaining
+   */
+  public static float[] transposeMatrix(final float[] msrc, final int msrc_offset, final float[] mres, final int mres_offset) {
+      mres[mres_offset+0] = msrc[msrc_offset+0*4];
+      mres[mres_offset+1] = msrc[msrc_offset+1*4];
+      mres[mres_offset+2] = msrc[msrc_offset+2*4];
+      mres[mres_offset+3] = msrc[msrc_offset+3*4];
+
+      final int i4_1 = 1*4;
+      mres[mres_offset+0+i4_1] = msrc[msrc_offset+1+0*4];
+      mres[mres_offset+1+i4_1] = msrc[msrc_offset+1+1*4];
+      mres[mres_offset+2+i4_1] = msrc[msrc_offset+1+2*4];
+      mres[mres_offset+3+i4_1] = msrc[msrc_offset+1+3*4];
+
+      final int i4_2 = 2*4;
+      mres[mres_offset+0+i4_2] = msrc[msrc_offset+2+0*4];
+      mres[mres_offset+1+i4_2] = msrc[msrc_offset+2+1*4];
+      mres[mres_offset+2+i4_2] = msrc[msrc_offset+2+2*4];
+      mres[mres_offset+3+i4_2] = msrc[msrc_offset+2+3*4];
+
+      final int i4_3 = 3*4;
+      mres[mres_offset+0+i4_3] = msrc[msrc_offset+3+0*4];
+      mres[mres_offset+1+i4_3] = msrc[msrc_offset+3+1*4];
+      mres[mres_offset+2+i4_3] = msrc[msrc_offset+3+2*4];
+      mres[mres_offset+3+i4_3] = msrc[msrc_offset+3+3*4];
+
+      return mres;
+  }
+
+  /**
+   * Transpose the given matrix.
+   *
+   * @param msrc 4x4 matrix in column-major order, the source
+   * @param mres 4x4 matrix in column-major order, the result
+   * @return given result matrix <i>mres</i> for chaining
+   */
+  public static float[] transposeMatrix(final float[] msrc, final float[] mres) {
+      mres[0] = msrc[0*4];
+      mres[1] = msrc[1*4];
+      mres[2] = msrc[2*4];
+      mres[3] = msrc[3*4];
+
+      final int i4_1 = 1*4;
+      mres[0+i4_1] = msrc[1+0*4];
+      mres[1+i4_1] = msrc[1+1*4];
+      mres[2+i4_1] = msrc[1+2*4];
+      mres[3+i4_1] = msrc[1+3*4];
+
+      final int i4_2 = 2*4;
+      mres[0+i4_2] = msrc[2+0*4];
+      mres[1+i4_2] = msrc[2+1*4];
+      mres[2+i4_2] = msrc[2+2*4];
+      mres[3+i4_2] = msrc[2+3*4];
 
-    r = 1.0f / r;
+      final int i4_3 = 3*4;
+      mres[0+i4_3] = msrc[3+0*4];
+      mres[1+i4_3] = msrc[3+1*4];
+      mres[2+i4_3] = msrc[3+2*4];
+      mres[3+i4_3] = msrc[3+3*4];
 
-    v.put(0+vPos, v.get(0+vPos) * r);
-    v.put(1+vPos, v.get(1+vPos) * r);
-    v.put(2+vPos, v.get(2+vPos) * r);
+      return mres;
   }
 
+  /**
+   * Returns the determinant of the given matrix
+   * @param m 4x4 matrix in column-major order, the source
+   * @param m_offset offset in given array <i>m</i>, i.e. start of the 4x4 matrix
+   * @return the matrix determinant
+   */
+  public static float matrixDeterminant(final float[] m, final int m_offset) {
+        float a11 = m[ 1+4*1 + m_offset ];
+        float a21 = m[ 2+4*1 + m_offset ];
+        float a31 = m[ 3+4*1 + m_offset ];
+        float a12 = m[ 1+4*2 + m_offset ];
+        float a22 = m[ 2+4*2 + m_offset ];
+        float a32 = m[ 3+4*2 + m_offset ];
+        float a13 = m[ 1+4*3 + m_offset ];
+        float a23 = m[ 2+4*3 + m_offset ];
+        float a33 = m[ 3+4*3 + m_offset ];
+
+        float ret = 0;
+        ret += m[     0 + m_offset ] * ( + a11*(a22*a33 - a23*a32) - a12*(a21*a33 - a23*a31) + a13*(a21*a32 - a22*a31));
+        a11  = m[ 1+4*0 + m_offset ];
+        a21  = m[ 2+4*0 + m_offset ];
+        a31  = m[ 3+4*0 + m_offset ];
+        ret -= m[ 0+4*1 + m_offset ] * ( + a11*(a22*a33 - a23*a32) - a12*(a21*a33 - a23*a31) + a13*(a21*a32 - a22*a31));
+        a12  = m[ 1+4*1 + m_offset ];
+        a22  = m[ 2+4*1 + m_offset ];
+        a32  = m[ 3+4*1 + m_offset ];
+        ret += m[ 0+4*2 + m_offset ] * ( + a11*(a22*a33 - a23*a32) - a12*(a21*a33 - a23*a31) + a13*(a21*a32 - a22*a31));
+        a13  = m[ 1+4*2 + m_offset ];
+        a23  = m[ 2+4*2 + m_offset ];
+        a33  = m[ 3+4*2 + m_offset ];
+        ret -= m[ 0+4*3 + m_offset ] * ( + a11*(a22*a33 - a23*a32) - a12*(a21*a33 - a23*a31) + a13*(a21*a32 - a22*a31));
+        return ret;
+   }
+
+  /**
+   * Returns the determinant of the given matrix
+   * @param m 4x4 matrix in column-major order, the source
+   * @return the matrix determinant
+   */
+  public static float matrixDeterminant(final float[] m) {
+        float a11 = m[ 1+4*1 ];
+        float a21 = m[ 2+4*1 ];
+        float a31 = m[ 3+4*1 ];
+        float a12 = m[ 1+4*2 ];
+        float a22 = m[ 2+4*2 ];
+        float a32 = m[ 3+4*2 ];
+        float a13 = m[ 1+4*3 ];
+        float a23 = m[ 2+4*3 ];
+        float a33 = m[ 3+4*3 ];
+
+        float ret = 0;
+        ret += m[     0 ] * ( + a11*(a22*a33 - a23*a32) - a12*(a21*a33 - a23*a31) + a13*(a21*a32 - a22*a31));
+        a11  = m[ 1+4*0 ];
+        a21  = m[ 2+4*0 ];
+        a31  = m[ 3+4*0 ];
+        ret -= m[ 0+4*1 ] * ( + a11*(a22*a33 - a23*a32) - a12*(a21*a33 - a23*a31) + a13*(a21*a32 - a22*a31));
+        a12  = m[ 1+4*1 ];
+        a22  = m[ 2+4*1 ];
+        a32  = m[ 3+4*1 ];
+        ret += m[ 0+4*2 ] * ( + a11*(a22*a33 - a23*a32) - a12*(a21*a33 - a23*a31) + a13*(a21*a32 - a22*a31));
+        a13  = m[ 1+4*2 ];
+        a23  = m[ 2+4*2 ];
+        a33  = m[ 3+4*2 ];
+        ret -= m[ 0+4*3 ] * ( + a11*(a22*a33 - a23*a32) - a12*(a21*a33 - a23*a31) + a13*(a21*a32 - a22*a31));
+        return ret;
+   }
 
   /**
-   * Calculate cross-product of 2 vector
+   * Invert the given matrix.
+   * <p>
+   * Returns <code>null</code> if inversion is not possible,
+   * e.g. matrix is singular due to a bad matrix.
+   * </p>
    *
-   * @param v1 3-component vector
-   * @param v2 3-component vector
-   * @param result v1 X v2
+   * @param msrc 4x4 matrix in column-major order, the source
+   * @param msrc_offset offset in given array <i>msrc</i>, i.e. start of the 4x4 matrix
+   * @param mres 4x4 matrix in column-major order, the result - may be <code>msrc</code> (in-place)
+   * @param mres_offset offset in given array <i>mres</i>, i.e. start of the 4x4 matrix - may be <code>msrc_offset</code> (in-place)
+   * @return given result matrix <i>mres</i> for chaining if successful, otherwise <code>null</code>. See above.
    */
-  public static final void cross(float[] v1, float[] v2, float[] result) {
-    result[0] = v1[1] * v2[2] - v1[2] * v2[1];
-    result[1] = v1[2] * v2[0] - v1[0] * v2[2];
-    result[2] = v1[0] * v2[1] - v1[1] * v2[0];
+  public static float[] invertMatrix(final float[] msrc, final int msrc_offset, final float[] mres, final int mres_offset) {
+      final float scale;
+      {
+          float max = Math.abs(msrc[0]);
+
+          for( int i = 1; i < 16; i++ ) {
+              final float a = Math.abs(msrc[i]);
+              if( a > max ) max = a;
+          }
+          if( 0 == max ) {
+              return null;
+          }
+          scale = 1.0f/max;
+      }
+
+      final float a11 = msrc[0+4*0+msrc_offset]*scale;
+      final float a21 = msrc[1+4*0+msrc_offset]*scale;
+      final float a31 = msrc[2+4*0+msrc_offset]*scale;
+      final float a41 = msrc[3+4*0+msrc_offset]*scale;
+      final float a12 = msrc[0+4*1+msrc_offset]*scale;
+      final float a22 = msrc[1+4*1+msrc_offset]*scale;
+      final float a32 = msrc[2+4*1+msrc_offset]*scale;
+      final float a42 = msrc[3+4*1+msrc_offset]*scale;
+      final float a13 = msrc[0+4*2+msrc_offset]*scale;
+      final float a23 = msrc[1+4*2+msrc_offset]*scale;
+      final float a33 = msrc[2+4*2+msrc_offset]*scale;
+      final float a43 = msrc[3+4*2+msrc_offset]*scale;
+      final float a14 = msrc[0+4*3+msrc_offset]*scale;
+      final float a24 = msrc[1+4*3+msrc_offset]*scale;
+      final float a34 = msrc[2+4*3+msrc_offset]*scale;
+      final float a44 = msrc[3+4*3+msrc_offset]*scale;
+
+      final float m11 = + a22*(a33*a44 - a34*a43) - a23*(a32*a44 - a34*a42) + a24*(a32*a43 - a33*a42);
+      final float m12 = -( + a21*(a33*a44 - a34*a43) - a23*(a31*a44 - a34*a41) + a24*(a31*a43 - a33*a41));
+      final float m13 = + a21*(a32*a44 - a34*a42) - a22*(a31*a44 - a34*a41) + a24*(a31*a42 - a32*a41);
+      final float m14 = -( + a21*(a32*a43 - a33*a42) - a22*(a31*a43 - a33*a41) + a23*(a31*a42 - a32*a41));
+      final float m21 = -( + a12*(a33*a44 - a34*a43) - a13*(a32*a44 - a34*a42) + a14*(a32*a43 - a33*a42));
+      final float m22 = + a11*(a33*a44 - a34*a43) - a13*(a31*a44 - a34*a41) + a14*(a31*a43 - a33*a41);
+      final float m23 = -( + a11*(a32*a44 - a34*a42) - a12*(a31*a44 - a34*a41) + a14*(a31*a42 - a32*a41));
+      final float m24 = + a11*(a32*a43 - a33*a42) - a12*(a31*a43 - a33*a41) + a13*(a31*a42 - a32*a41);
+      final float m31 = + a12*(a23*a44 - a24*a43) - a13*(a22*a44 - a24*a42) + a14*(a22*a43 - a23*a42);
+      final float m32 = -( + a11*(a23*a44 - a24*a43) - a13*(a21*a44 - a24*a41) + a14*(a21*a43 - a23*a41));
+      final float m33 = + a11*(a22*a44 - a24*a42) - a12*(a21*a44 - a24*a41) + a14*(a21*a42 - a22*a41);
+      final float m34 = -( + a11*(a22*a43 - a23*a42) - a12*(a21*a43 - a23*a41) + a13*(a21*a42 - a22*a41));
+      final float m41 = -( + a12*(a23*a34 - a24*a33) - a13*(a22*a34 - a24*a32) + a14*(a22*a33 - a23*a32));
+      final float m42 = + a11*(a23*a34 - a24*a33) - a13*(a21*a34 - a24*a31) + a14*(a21*a33 - a23*a31);
+      final float m43 = -( + a11*(a22*a34 - a24*a32) - a12*(a21*a34 - a24*a31) + a14*(a21*a32 - a22*a31));
+      final float m44 = + a11*(a22*a33 - a23*a32) - a12*(a21*a33 - a23*a31) + a13*(a21*a32 - a22*a31);
+
+      final float det = (a11*m11 + a12*m12 + a13*m13 + a14*m14)/scale;
+
+      if( 0 == det ) {
+          return null;
+      }
+
+      mres[0+4*0+mres_offset] = m11 / det;
+      mres[1+4*0+mres_offset] = m12 / det;
+      mres[2+4*0+mres_offset] = m13 / det;
+      mres[3+4*0+mres_offset] = m14 / det;
+      mres[0+4*1+mres_offset] = m21 / det;
+      mres[1+4*1+mres_offset] = m22 / det;
+      mres[2+4*1+mres_offset] = m23 / det;
+      mres[3+4*1+mres_offset] = m24 / det;
+      mres[0+4*2+mres_offset] = m31 / det;
+      mres[1+4*2+mres_offset] = m32 / det;
+      mres[2+4*2+mres_offset] = m33 / det;
+      mres[3+4*2+mres_offset] = m34 / det;
+      mres[0+4*3+mres_offset] = m41 / det;
+      mres[1+4*3+mres_offset] = m42 / det;
+      mres[2+4*3+mres_offset] = m43 / det;
+      mres[3+4*3+mres_offset] = m44 / det;
+      return mres;
   }
 
   /**
-   * Calculate cross-product of 2 vector
+   * Invert the given matrix.
+   * <p>
+   * Returns <code>null</code> if inversion is not possible,
+   * e.g. matrix is singular due to a bad matrix.
+   * </p>
    *
-   * @param v1 3-component vector
-   * @param v2 3-component vector
-   * @param result v1 X v2
+   * @param msrc 4x4 matrix in column-major order, the source
+   * @param mres 4x4 matrix in column-major order, the result - may be <code>msrc</code> (in-place)
+   * @return given result matrix <i>mres</i> for chaining if successful, otherwise <code>null</code>. See above.
    */
-  public static final void cross(FloatBuffer v1, FloatBuffer v2, FloatBuffer result) {
-    final int v1Pos = v1.position();
-    final int v2Pos = v2.position();
-    final int rPos  = result.position();
+  public static float[] invertMatrix(final float[] msrc, final float[] mres) {
+      final float scale;
+      {
+          float max = Math.abs(msrc[0]);
+
+          for( int i = 1; i < 16; i++ ) {
+              final float a = Math.abs(msrc[i]);
+              if( a > max ) max = a;
+          }
+          if( 0 == max ) {
+              return null;
+          }
+          scale = 1.0f/max;
+      }
+
+      final float a11 = msrc[0+4*0]*scale;
+      final float a21 = msrc[1+4*0]*scale;
+      final float a31 = msrc[2+4*0]*scale;
+      final float a41 = msrc[3+4*0]*scale;
+      final float a12 = msrc[0+4*1]*scale;
+      final float a22 = msrc[1+4*1]*scale;
+      final float a32 = msrc[2+4*1]*scale;
+      final float a42 = msrc[3+4*1]*scale;
+      final float a13 = msrc[0+4*2]*scale;
+      final float a23 = msrc[1+4*2]*scale;
+      final float a33 = msrc[2+4*2]*scale;
+      final float a43 = msrc[3+4*2]*scale;
+      final float a14 = msrc[0+4*3]*scale;
+      final float a24 = msrc[1+4*3]*scale;
+      final float a34 = msrc[2+4*3]*scale;
+      final float a44 = msrc[3+4*3]*scale;
+
+      final float m11 = + a22*(a33*a44 - a34*a43) - a23*(a32*a44 - a34*a42) + a24*(a32*a43 - a33*a42);
+      final float m12 = -( + a21*(a33*a44 - a34*a43) - a23*(a31*a44 - a34*a41) + a24*(a31*a43 - a33*a41));
+      final float m13 = + a21*(a32*a44 - a34*a42) - a22*(a31*a44 - a34*a41) + a24*(a31*a42 - a32*a41);
+      final float m14 = -( + a21*(a32*a43 - a33*a42) - a22*(a31*a43 - a33*a41) + a23*(a31*a42 - a32*a41));
+      final float m21 = -( + a12*(a33*a44 - a34*a43) - a13*(a32*a44 - a34*a42) + a14*(a32*a43 - a33*a42));
+      final float m22 = + a11*(a33*a44 - a34*a43) - a13*(a31*a44 - a34*a41) + a14*(a31*a43 - a33*a41);
+      final float m23 = -( + a11*(a32*a44 - a34*a42) - a12*(a31*a44 - a34*a41) + a14*(a31*a42 - a32*a41));
+      final float m24 = + a11*(a32*a43 - a33*a42) - a12*(a31*a43 - a33*a41) + a13*(a31*a42 - a32*a41);
+      final float m31 = + a12*(a23*a44 - a24*a43) - a13*(a22*a44 - a24*a42) + a14*(a22*a43 - a23*a42);
+      final float m32 = -( + a11*(a23*a44 - a24*a43) - a13*(a21*a44 - a24*a41) + a14*(a21*a43 - a23*a41));
+      final float m33 = + a11*(a22*a44 - a24*a42) - a12*(a21*a44 - a24*a41) + a14*(a21*a42 - a22*a41);
+      final float m34 = -( + a11*(a22*a43 - a23*a42) - a12*(a21*a43 - a23*a41) + a13*(a21*a42 - a22*a41));
+      final float m41 = -( + a12*(a23*a34 - a24*a33) - a13*(a22*a34 - a24*a32) + a14*(a22*a33 - a23*a32));
+      final float m42 = + a11*(a23*a34 - a24*a33) - a13*(a21*a34 - a24*a31) + a14*(a21*a33 - a23*a31);
+      final float m43 = -( + a11*(a22*a34 - a24*a32) - a12*(a21*a34 - a24*a31) + a14*(a21*a32 - a22*a31));
+      final float m44 = + a11*(a22*a33 - a23*a32) - a12*(a21*a33 - a23*a31) + a13*(a21*a32 - a22*a31);
+
+      final float det = (a11*m11 + a12*m12 + a13*m13 + a14*m14)/scale;
+
+      if( 0 == det ) {
+          return null;
+      }
 
-    result.put(0+rPos, v1.get(1+v1Pos) * v2.get(2+v2Pos) - v1.get(2+v1Pos) * v2.get(1+v2Pos));
-    result.put(1+rPos, v1.get(2+v1Pos) * v2.get(0+v2Pos) - v1.get(0+v1Pos) * v2.get(2+v2Pos));
-    result.put(2+rPos, v1.get(0+v1Pos) * v2.get(1+v2Pos) - v1.get(1+v1Pos) * v2.get(0+v2Pos));
+      mres[0+4*0] = m11 / det;
+      mres[1+4*0] = m12 / det;
+      mres[2+4*0] = m13 / det;
+      mres[3+4*0] = m14 / det;
+      mres[0+4*1] = m21 / det;
+      mres[1+4*1] = m22 / det;
+      mres[2+4*1] = m23 / det;
+      mres[3+4*1] = m24 / det;
+      mres[0+4*2] = m31 / det;
+      mres[1+4*2] = m32 / det;
+      mres[2+4*2] = m33 / det;
+      mres[3+4*2] = m34 / det;
+      mres[0+4*3] = m41 / det;
+      mres[1+4*3] = m42 / det;
+      mres[2+4*3] = m43 / det;
+      mres[3+4*3] = m44 / det;
+      return mres;
   }
 
   /**
-   * @param m_in 4x4 matrix in column-major order
-   * @param m_in_off
-   * @param v_in 4-component column-vector
-   * @param v_out m_in * v_in
+   * Map object coordinates to window coordinates.
+   * <p>
+   * Traditional <code>gluProject</code> implementation.
+   * </p>
+   *
+   * @param objx
+   * @param objy
+   * @param objz
+   * @param modelMatrix 4x4 modelview matrix
+   * @param modelMatrix_offset
+   * @param projMatrix 4x4 projection matrix
+   * @param projMatrix_offset
+   * @param viewport 4 component viewport vector
+   * @param viewport_offset
+   * @param win_pos 3 component window coordinate, the result
+   * @param win_pos_offset
+   * @param vec4Tmp1 4 component vector for temp storage
+   * @param vec4Tmp2 4 component vector for temp storage
+   * @return true if successful, otherwise false (z is 1)
    */
-  public static final void multMatrixVecf(float[] m_in, int m_in_off, float[] v_in, int v_in_off, float[] v_out, int v_out_off) {
-    for (int i = 0; i < 4; i++) {
-      // (one matrix row in column-major order) X (column vector)
-      v_out[i + v_out_off] =
-        v_in[0+v_in_off] * m_in[0*4+i+m_in_off] +
-        v_in[1+v_in_off] * m_in[1*4+i+m_in_off] +
-        v_in[2+v_in_off] * m_in[2*4+i+m_in_off] +
-        v_in[3+v_in_off] * m_in[3*4+i+m_in_off];
+  public static boolean mapObjToWinCoords(final float objx, final float objy, final float objz,
+                                          final float[] modelMatrix, final int modelMatrix_offset,
+                                          final float[] projMatrix, final int projMatrix_offset,
+                                          final int[] viewport, final int viewport_offset,
+                                          final float[] win_pos, final int win_pos_offset,
+                                          final float[/*4*/] vec4Tmp1, final float[/*4*/] vec4Tmp2) {
+      vec4Tmp1[0] = objx;
+      vec4Tmp1[1] = objy;
+      vec4Tmp1[2] = objz;
+      vec4Tmp1[3] = 1.0f;
+
+      // vec4Tmp2 = Mv * o
+      // vec4Tmp1 = P  * vec4Tmp2
+      // vec4Tmp1 = P * ( Mv * o )
+      // vec4Tmp1 = P * Mv * o
+      multMatrixVec(modelMatrix, modelMatrix_offset, vec4Tmp1, 0, vec4Tmp2, 0);
+      multMatrixVec(projMatrix, projMatrix_offset, vec4Tmp2, 0, vec4Tmp1, 0);
+
+      if (vec4Tmp1[3] == 0.0f) {
+          return false;
+      }
+
+      vec4Tmp1[3] = (1.0f / vec4Tmp1[3]) * 0.5f;
+
+      // Map x, y and z to range 0-1
+      vec4Tmp1[0] = vec4Tmp1[0] * vec4Tmp1[3] + 0.5f;
+      vec4Tmp1[1] = vec4Tmp1[1] * vec4Tmp1[3] + 0.5f;
+      vec4Tmp1[2] = vec4Tmp1[2] * vec4Tmp1[3] + 0.5f;
+
+      // Map x,y to viewport
+      win_pos[0+win_pos_offset] = vec4Tmp1[0] * viewport[2+viewport_offset] + viewport[0+viewport_offset];
+      win_pos[1+win_pos_offset] = vec4Tmp1[1] * viewport[3+viewport_offset] + viewport[1+viewport_offset];
+      win_pos[2+win_pos_offset] = vec4Tmp1[2];
+
+      return true;
+  }
+
+  /**
+   * Map object coordinates to window coordinates.
+   * <p>
+   * Traditional <code>gluProject</code> implementation.
+   * </p>
+   *
+   * @param objx
+   * @param objy
+   * @param objz
+   * @param mat4PMv [projection] x [modelview] matrix, i.e. P x Mv
+   * @param viewport 4 component viewport vector
+   * @param viewport_offset
+   * @param win_pos 3 component window coordinate, the result
+   * @param win_pos_offset
+   * @param vec4Tmp1 4 component vector for temp storage
+   * @param vec4Tmp2 4 component vector for temp storage
+   * @return true if successful, otherwise false (z is 1)
+   */
+  public static boolean mapObjToWinCoords(final float objx, final float objy, final float objz,
+                                          final float[/*16*/] mat4PMv,
+                                          final int[] viewport, final int viewport_offset,
+                                          final float[] win_pos, final int win_pos_offset,
+                                          final float[/*4*/] vec4Tmp1, final float[/*4*/] vec4Tmp2) {
+      vec4Tmp2[0] = objx;
+      vec4Tmp2[1] = objy;
+      vec4Tmp2[2] = objz;
+      vec4Tmp2[3] = 1.0f;
+
+      // vec4Tmp1 = P * Mv * o
+      multMatrixVec(mat4PMv, vec4Tmp2, vec4Tmp1);
+
+      if (vec4Tmp1[3] == 0.0f) {
+          return false;
+      }
+
+      vec4Tmp1[3] = (1.0f / vec4Tmp1[3]) * 0.5f;
+
+      // Map x, y and z to range 0-1
+      vec4Tmp1[0] = vec4Tmp1[0] * vec4Tmp1[3] + 0.5f;
+      vec4Tmp1[1] = vec4Tmp1[1] * vec4Tmp1[3] + 0.5f;
+      vec4Tmp1[2] = vec4Tmp1[2] * vec4Tmp1[3] + 0.5f;
+
+      // Map x,y to viewport
+      win_pos[0+win_pos_offset] = vec4Tmp1[0] * viewport[2+viewport_offset] + viewport[0+viewport_offset];
+      win_pos[1+win_pos_offset] = vec4Tmp1[1] * viewport[3+viewport_offset] + viewport[1+viewport_offset];
+      win_pos[2+win_pos_offset] = vec4Tmp1[2];
+
+      return true;
+  }
+
+  /**
+   * Map window coordinates to object coordinates.
+   * <p>
+   * Traditional <code>gluUnProject</code> implementation.
+   * </p>
+   *
+   * @param winx
+   * @param winy
+   * @param winz
+   * @param modelMatrix 4x4 modelview matrix
+   * @param modelMatrix_offset
+   * @param projMatrix 4x4 projection matrix
+   * @param projMatrix_offset
+   * @param viewport 4 component viewport vector
+   * @param viewport_offset
+   * @param obj_pos 3 component object coordinate, the result
+   * @param obj_pos_offset
+   * @param mat4Tmp1 16 component matrix for temp storage
+   * @param mat4Tmp2 16 component matrix for temp storage
+   * @return true if successful, otherwise false (failed to invert matrix, or becomes infinity due to zero z)
+   */
+  public static boolean mapWinToObjCoords(final float winx, final float winy, final float winz,
+                                          final float[] modelMatrix, final int modelMatrix_offset,
+                                          final float[] projMatrix, final int projMatrix_offset,
+                                          final int[] viewport, final int viewport_offset,
+                                          final float[] obj_pos, final int obj_pos_offset,
+                                          final float[/*16*/] mat4Tmp1, final float[/*16*/] mat4Tmp2) {
+    // mat4Tmp1 = P x Mv
+    multMatrix(projMatrix, projMatrix_offset, modelMatrix, modelMatrix_offset, mat4Tmp1, 0);
+
+    // mat4Tmp1 = Inv(P x Mv)
+    if ( null == invertMatrix(mat4Tmp1, mat4Tmp1) ) {
+      return false;
+    }
+    mat4Tmp2[0] = winx;
+    mat4Tmp2[1] = winy;
+    mat4Tmp2[2] = winz;
+    mat4Tmp2[3] = 1.0f;
+
+    // Map x and y from window coordinates
+    mat4Tmp2[0] = (mat4Tmp2[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
+    mat4Tmp2[1] = (mat4Tmp2[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
+
+    // Map to range -1 to 1
+    mat4Tmp2[0] = mat4Tmp2[0] * 2 - 1;
+    mat4Tmp2[1] = mat4Tmp2[1] * 2 - 1;
+    mat4Tmp2[2] = mat4Tmp2[2] * 2 - 1;
+
+    final int raw_off = 4;
+    // object raw coords = Inv(P x Mv) *  winPos  -> mat4Tmp2
+    multMatrixVec(mat4Tmp1, 0, mat4Tmp2, 0, mat4Tmp2, raw_off);
+
+    if (mat4Tmp2[3+raw_off] == 0.0) {
+      return false;
+    }
+
+    mat4Tmp2[3+raw_off] = 1.0f / mat4Tmp2[3+raw_off];
+
+    obj_pos[0+obj_pos_offset] = mat4Tmp2[0+raw_off] * mat4Tmp2[3+raw_off];
+    obj_pos[1+obj_pos_offset] = mat4Tmp2[1+raw_off] * mat4Tmp2[3+raw_off];
+    obj_pos[2+obj_pos_offset] = mat4Tmp2[2+raw_off] * mat4Tmp2[3+raw_off];
+
+    return true;
+  }
+
+  /**
+   * Map window coordinates to object coordinates.
+   * <p>
+   * Traditional <code>gluUnProject</code> implementation.
+   * </p>
+   *
+   * @param winx
+   * @param winy
+   * @param winz
+   * @param mat4PMvI inverse [projection] x [modelview] matrix, i.e. Inv(P x Mv)
+   * @param viewport 4 component viewport vector
+   * @param viewport_offset
+   * @param obj_pos 3 component object coordinate, the result
+   * @param obj_pos_offset
+   * @param vec4Tmp1 4 component vector for temp storage
+   * @param vec4Tmp2 4 component vector for temp storage
+   * @return true if successful, otherwise false (failed to invert matrix, or becomes infinity due to zero z)
+   */
+  public static boolean mapWinToObjCoords(final float winx, final float winy, final float winz,
+                                          final float[/*16*/] mat4PMvI,
+                                          final int[] viewport, final int viewport_offset,
+                                          final float[] obj_pos, final int obj_pos_offset,
+                                          final float[/*4*/] vec4Tmp1, final float[/*4*/] vec4Tmp2) {
+    vec4Tmp1[0] = winx;
+    vec4Tmp1[1] = winy;
+    vec4Tmp1[2] = winz;
+    vec4Tmp1[3] = 1.0f;
+
+    // Map x and y from window coordinates
+    vec4Tmp1[0] = (vec4Tmp1[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
+    vec4Tmp1[1] = (vec4Tmp1[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
+
+    // Map to range -1 to 1
+    vec4Tmp1[0] = vec4Tmp1[0] * 2 - 1;
+    vec4Tmp1[1] = vec4Tmp1[1] * 2 - 1;
+    vec4Tmp1[2] = vec4Tmp1[2] * 2 - 1;
+
+    // object raw coords = Inv(P x Mv) *  winPos  -> mat4Tmp2
+    multMatrixVec(mat4PMvI, vec4Tmp1, vec4Tmp2);
+
+    if (vec4Tmp2[3] == 0.0) {
+      return false;
+    }
+
+    vec4Tmp2[3] = 1.0f / vec4Tmp2[3];
+
+    obj_pos[0+obj_pos_offset] = vec4Tmp2[0] * vec4Tmp2[3];
+    obj_pos[1+obj_pos_offset] = vec4Tmp2[1] * vec4Tmp2[3];
+    obj_pos[2+obj_pos_offset] = vec4Tmp2[2] * vec4Tmp2[3];
+
+    return true;
+  }
+
+  /**
+   * Map two window coordinates to two object coordinates,
+   * distinguished by their z component.
+   *
+   * @param winx
+   * @param winy
+   * @param winz1
+   * @param winz2
+   * @param mat4PMvI inverse [projection] x [modelview] matrix, i.e. Inv(P x Mv)
+   * @param viewport 4 component viewport vector
+   * @param viewport_offset
+   * @param obj1_pos 3 component object coordinate, the result for winz1
+   * @param obj1_pos_offset
+   * @param obj2_pos 3 component object coordinate, the result for winz2
+   * @param obj2_pos_offset
+   * @param vec4Tmp1 4 component vector for temp storage
+   * @param vec4Tmp2 4 component vector for temp storage
+   * @return true if successful, otherwise false (failed to invert matrix, or becomes infinity due to zero z)
+   */
+  public static boolean mapWinToObjCoords(final float winx, final float winy, final float winz1, final float winz2,
+                                          final float[/*16*/] mat4PMvI,
+                                          final int[] viewport, final int viewport_offset,
+                                          final float[] obj1_pos, final int obj1_pos_offset,
+                                          final float[] obj2_pos, final int obj2_pos_offset,
+                                          final float[/*4*/] vec4Tmp1, final float[/*4*/] vec4Tmp2) {
+    vec4Tmp1[0] = winx;
+    vec4Tmp1[1] = winy;
+    vec4Tmp1[3] = 1.0f;
+
+    // Map x and y from window coordinates
+    vec4Tmp1[0] = (vec4Tmp1[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
+    vec4Tmp1[1] = (vec4Tmp1[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
+
+    // Map to range -1 to 1
+    vec4Tmp1[0] = vec4Tmp1[0] * 2 - 1;
+    vec4Tmp1[1] = vec4Tmp1[1] * 2 - 1;
+
+    //
+    // winz1
+    //
+    vec4Tmp1[2] = winz1;
+    vec4Tmp1[2] = vec4Tmp1[2] * 2 - 1;
+
+    // object raw coords = Inv(P x Mv) *  winPos  -> mat4Tmp2
+    multMatrixVec(mat4PMvI, vec4Tmp1, vec4Tmp2);
+
+    if (vec4Tmp2[3] == 0.0) {
+      return false;
+    }
+
+    vec4Tmp2[3] = 1.0f / vec4Tmp2[3];
+
+    obj1_pos[0+obj1_pos_offset] = vec4Tmp2[0] * vec4Tmp2[3];
+    obj1_pos[1+obj1_pos_offset] = vec4Tmp2[1] * vec4Tmp2[3];
+    obj1_pos[2+obj1_pos_offset] = vec4Tmp2[2] * vec4Tmp2[3];
+
+    //
+    // winz2
+    //
+    vec4Tmp1[2] = winz2;
+    vec4Tmp1[2] = vec4Tmp1[2] * 2 - 1;
+
+    // object raw coords = Inv(P x Mv) *  winPos  -> mat4Tmp2
+    multMatrixVec(mat4PMvI, vec4Tmp1, vec4Tmp2);
+
+    if (vec4Tmp2[3] == 0.0) {
+      return false;
+    }
+
+    vec4Tmp2[3] = 1.0f / vec4Tmp2[3];
+
+    obj2_pos[0+obj2_pos_offset] = vec4Tmp2[0] * vec4Tmp2[3];
+    obj2_pos[1+obj2_pos_offset] = vec4Tmp2[1] * vec4Tmp2[3];
+    obj2_pos[2+obj2_pos_offset] = vec4Tmp2[2] * vec4Tmp2[3];
+
+    return true;
+  }
+
+  /**
+   * Map window coordinates to object coordinates.
+   * <p>
+   * Traditional <code>gluUnProject4</code> implementation.
+   * </p>
+   *
+   * @param winx
+   * @param winy
+   * @param winz
+   * @param clipw
+   * @param modelMatrix 4x4 modelview matrix
+   * @param modelMatrix_offset
+   * @param projMatrix 4x4 projection matrix
+   * @param projMatrix_offset
+   * @param viewport 4 component viewport vector
+   * @param viewport_offset
+   * @param near
+   * @param far
+   * @param obj_pos 4 component object coordinate, the result
+   * @param obj_pos_offset
+   * @param mat4Tmp1 16 component matrix for temp storage
+   * @param mat4Tmp2 16 component matrix for temp storage
+   * @return true if successful, otherwise false (failed to invert matrix, or becomes infinity due to zero z)
+   */
+  public static boolean mapWinToObjCoords(final float winx, final float winy, final float winz, final float clipw,
+                                          final float[] modelMatrix, final int modelMatrix_offset,
+                                          final float[] projMatrix, final int projMatrix_offset,
+                                          final int[] viewport, final int viewport_offset,
+                                          final float near, final float far,
+                                          final float[] obj_pos, final int obj_pos_offset,
+                                          final float[/*16*/] mat4Tmp1, final float[/*16*/] mat4Tmp2) {
+    // mat4Tmp1 = P x Mv
+    multMatrix(projMatrix, projMatrix_offset, modelMatrix, modelMatrix_offset, mat4Tmp1, 0);
+
+    // mat4Tmp1 = Inv(P x Mv)
+    if ( null == invertMatrix(mat4Tmp1, mat4Tmp1) ) {
+      return false;
     }
+
+    mat4Tmp2[0] = winx;
+    mat4Tmp2[1] = winy;
+    mat4Tmp2[2] = winz;
+    mat4Tmp2[3] = 1.0f;
+
+    // Map x and y from window coordinates
+    mat4Tmp2[0] = (mat4Tmp2[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
+    mat4Tmp2[1] = (mat4Tmp2[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
+    mat4Tmp2[2] = (mat4Tmp2[2] - near) / (far - near);
+
+    // Map to range -1 to 1
+    mat4Tmp2[0] = mat4Tmp2[0] * 2 - 1;
+    mat4Tmp2[1] = mat4Tmp2[1] * 2 - 1;
+    mat4Tmp2[2] = mat4Tmp2[2] * 2 - 1;
+
+    final int raw_off = 4;
+    // object raw coords = Inv(P x Mv) *  winPos  -> mat4Tmp2
+    multMatrixVec(mat4Tmp1, 0, mat4Tmp2, 0, mat4Tmp2, raw_off);
+
+    if (mat4Tmp2[3+raw_off] == 0.0) {
+      return false;
+    }
+
+    mat4Tmp2[3+raw_off] = 1.0f / mat4Tmp2[3+raw_off];
+
+    obj_pos[0+obj_pos_offset] = mat4Tmp2[0+raw_off];
+    obj_pos[1+obj_pos_offset] = mat4Tmp2[1+raw_off];
+    obj_pos[2+obj_pos_offset] = mat4Tmp2[2+raw_off];
+    obj_pos[3+obj_pos_offset] = mat4Tmp2[3+raw_off];
+
+    return true;
+  }
+
+
+  /**
+   * Map two window coordinates w/ shared X/Y and distinctive Z
+   * to a {@link Ray}. The resulting {@link Ray} maybe used for <i>picking</i>
+   * using a {@link AABBox#getRayIntersection(Ray, float[]) bounding box}.
+   * <p>
+   * Notes for picking <i>winz0</i> and <i>winz1</i>:
+   * <ul>
+   *   <li>see {@link #getZBufferEpsilon(int, float, float)}</li>
+   *   <li>see {@link #getZBufferValue(int, float, float, float)}</li>
+   *   <li>see {@link #getOrthoWinZ(float, float, float)}</li>
+   * </ul>
+   * </p>
+   * @param winx
+   * @param winy
+   * @param winz0
+   * @param winz1
+   * @param modelMatrix 4x4 modelview matrix
+   * @param modelMatrix_offset
+   * @param projMatrix 4x4 projection matrix
+   * @param projMatrix_offset
+   * @param viewport 4 component viewport vector
+   * @param viewport_offset
+   * @param ray storage for the resulting {@link Ray}
+   * @param mat4Tmp1 16 component matrix for temp storage
+   * @param mat4Tmp2 16 component matrix for temp storage
+   * @param vec4Tmp2 4 component vector for temp storage
+   * @return true if successful, otherwise false (failed to invert matrix, or becomes z is infinity)
+   */
+  public static boolean mapWinToRay(final float winx, final float winy, final float winz0, final float winz1,
+                                    final float[] modelMatrix, final int modelMatrix_offset,
+                                    final float[] projMatrix, final int projMatrix_offset,
+                                    final int[] viewport, final int viewport_offset,
+                                    final Ray ray,
+                                    final float[/*16*/] mat4Tmp1, final float[/*16*/] mat4Tmp2, final float[/*4*/] vec4Tmp2) {
+      // mat4Tmp1 = P x Mv
+      multMatrix(projMatrix, projMatrix_offset, modelMatrix, modelMatrix_offset, mat4Tmp1, 0);
+
+      // mat4Tmp1 = Inv(P x Mv)
+      if ( null == invertMatrix(mat4Tmp1, mat4Tmp1) ) {
+          return false;
+      }
+      if( mapWinToObjCoords(winx, winy, winz0, winz1, mat4Tmp1,
+                            viewport, viewport_offset,
+                            ray.orig, 0, ray.dir, 0,
+                            mat4Tmp2, vec4Tmp2) ) {
+          VectorUtil.normalizeVec3( VectorUtil.subVec3(ray.dir, ray.dir, ray.orig) );
+          return true;
+      } else {
+          return false;
+      }
+  }
+
+  /**
+   * Multiply matrix: [d] = [a] x [b]
+   * @param a 4x4 matrix in column-major order
+   * @param b 4x4 matrix in column-major order
+   * @param d result a*b in column-major order
+   * @return given result matrix <i>d</i> for chaining
+   */
+  public static float[] multMatrix(final float[] a, final int a_off, final float[] b, final int b_off, final float[] d, final int d_off) {
+      final float b00 = b[b_off+0+0*4];
+      final float b10 = b[b_off+1+0*4];
+      final float b20 = b[b_off+2+0*4];
+      final float b30 = b[b_off+3+0*4];
+      final float b01 = b[b_off+0+1*4];
+      final float b11 = b[b_off+1+1*4];
+      final float b21 = b[b_off+2+1*4];
+      final float b31 = b[b_off+3+1*4];
+      final float b02 = b[b_off+0+2*4];
+      final float b12 = b[b_off+1+2*4];
+      final float b22 = b[b_off+2+2*4];
+      final float b32 = b[b_off+3+2*4];
+      final float b03 = b[b_off+0+3*4];
+      final float b13 = b[b_off+1+3*4];
+      final float b23 = b[b_off+2+3*4];
+      final float b33 = b[b_off+3+3*4];
+
+      float ai0=a[a_off+  0*4]; // row-0 of a
+      float ai1=a[a_off+  1*4];
+      float ai2=a[a_off+  2*4];
+      float ai3=a[a_off+  3*4];
+      d[d_off+ 0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      d[d_off+ 1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      d[d_off+ 2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      d[d_off+ 3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      ai0=a[a_off+1+0*4]; // row-1 of a
+      ai1=a[a_off+1+1*4];
+      ai2=a[a_off+1+2*4];
+      ai3=a[a_off+1+3*4];
+      d[d_off+1+0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      d[d_off+1+1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      d[d_off+1+2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      d[d_off+1+3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      ai0=a[a_off+2+0*4]; // row-2 of a
+      ai1=a[a_off+2+1*4];
+      ai2=a[a_off+2+2*4];
+      ai3=a[a_off+2+3*4];
+      d[d_off+2+0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      d[d_off+2+1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      d[d_off+2+2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      d[d_off+2+3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      ai0=a[a_off+3+0*4]; // row-3 of a
+      ai1=a[a_off+3+1*4];
+      ai2=a[a_off+3+2*4];
+      ai3=a[a_off+3+3*4];
+      d[d_off+3+0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      d[d_off+3+1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      d[d_off+3+2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      d[d_off+3+3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      return d;
+  }
+
+  /**
+   * Multiply matrix: [d] = [a] x [b]
+   * @param a 4x4 matrix in column-major order
+   * @param b 4x4 matrix in column-major order
+   * @param d result a*b in column-major order
+   * @return given result matrix <i>d</i> for chaining
+   */
+  public static float[] multMatrix(final float[] a, final float[] b, final float[] d) {
+      final float b00 = b[0+0*4];
+      final float b10 = b[1+0*4];
+      final float b20 = b[2+0*4];
+      final float b30 = b[3+0*4];
+      final float b01 = b[0+1*4];
+      final float b11 = b[1+1*4];
+      final float b21 = b[2+1*4];
+      final float b31 = b[3+1*4];
+      final float b02 = b[0+2*4];
+      final float b12 = b[1+2*4];
+      final float b22 = b[2+2*4];
+      final float b32 = b[3+2*4];
+      final float b03 = b[0+3*4];
+      final float b13 = b[1+3*4];
+      final float b23 = b[2+3*4];
+      final float b33 = b[3+3*4];
+
+      float ai0=a[  0*4]; // row-0 of a
+      float ai1=a[  1*4];
+      float ai2=a[  2*4];
+      float ai3=a[  3*4];
+      d[ 0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      d[ 1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      d[ 2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      d[ 3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      ai0=a[1+0*4]; // row-1 of a
+      ai1=a[1+1*4];
+      ai2=a[1+2*4];
+      ai3=a[1+3*4];
+      d[1+0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      d[1+1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      d[1+2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      d[1+3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      ai0=a[2+0*4]; // row-2 of a
+      ai1=a[2+1*4];
+      ai2=a[2+2*4];
+      ai3=a[2+3*4];
+      d[2+0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      d[2+1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      d[2+2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      d[2+3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      ai0=a[3+0*4]; // row-3 of a
+      ai1=a[3+1*4];
+      ai2=a[3+2*4];
+      ai3=a[3+3*4];
+      d[3+0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      d[3+1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      d[3+2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      d[3+3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      return d;
+  }
+
+  /**
+   * Multiply matrix: [a] = [a] x [b]
+   * @param a 4x4 matrix in column-major order (also result)
+   * @param b 4x4 matrix in column-major order
+   * @return given result matrix <i>a</i> for chaining
+   */
+  public static float[] multMatrix(final float[] a, final int a_off, final float[] b, final int b_off) {
+      final float b00 = b[b_off+0+0*4];
+      final float b10 = b[b_off+1+0*4];
+      final float b20 = b[b_off+2+0*4];
+      final float b30 = b[b_off+3+0*4];
+      final float b01 = b[b_off+0+1*4];
+      final float b11 = b[b_off+1+1*4];
+      final float b21 = b[b_off+2+1*4];
+      final float b31 = b[b_off+3+1*4];
+      final float b02 = b[b_off+0+2*4];
+      final float b12 = b[b_off+1+2*4];
+      final float b22 = b[b_off+2+2*4];
+      final float b32 = b[b_off+3+2*4];
+      final float b03 = b[b_off+0+3*4];
+      final float b13 = b[b_off+1+3*4];
+      final float b23 = b[b_off+2+3*4];
+      final float b33 = b[b_off+3+3*4];
+
+      float ai0=a[a_off+  0*4]; // row-0 of a
+      float ai1=a[a_off+  1*4];
+      float ai2=a[a_off+  2*4];
+      float ai3=a[a_off+  3*4];
+      a[a_off+ 0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      a[a_off+ 1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      a[a_off+ 2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      a[a_off+ 3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      ai0=a[a_off+1+0*4]; // row-1 of a
+      ai1=a[a_off+1+1*4];
+      ai2=a[a_off+1+2*4];
+      ai3=a[a_off+1+3*4];
+      a[a_off+1+0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      a[a_off+1+1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      a[a_off+1+2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      a[a_off+1+3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      ai0=a[a_off+2+0*4]; // row-2 of a
+      ai1=a[a_off+2+1*4];
+      ai2=a[a_off+2+2*4];
+      ai3=a[a_off+2+3*4];
+      a[a_off+2+0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      a[a_off+2+1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      a[a_off+2+2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      a[a_off+2+3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      ai0=a[a_off+3+0*4]; // row-3 of a
+      ai1=a[a_off+3+1*4];
+      ai2=a[a_off+3+2*4];
+      ai3=a[a_off+3+3*4];
+      a[a_off+3+0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      a[a_off+3+1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      a[a_off+3+2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      a[a_off+3+3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      return a;
+  }
+
+  /**
+   * Multiply matrix: [a] = [a] x [b]
+   * @param a 4x4 matrix in column-major order (also result)
+   * @param b 4x4 matrix in column-major order
+   * @return given result matrix <i>a</i> for chaining
+   */
+  public static float[] multMatrix(final float[] a, final float[] b) {
+      final float b00 = b[0+0*4];
+      final float b10 = b[1+0*4];
+      final float b20 = b[2+0*4];
+      final float b30 = b[3+0*4];
+      final float b01 = b[0+1*4];
+      final float b11 = b[1+1*4];
+      final float b21 = b[2+1*4];
+      final float b31 = b[3+1*4];
+      final float b02 = b[0+2*4];
+      final float b12 = b[1+2*4];
+      final float b22 = b[2+2*4];
+      final float b32 = b[3+2*4];
+      final float b03 = b[0+3*4];
+      final float b13 = b[1+3*4];
+      final float b23 = b[2+3*4];
+      final float b33 = b[3+3*4];
+
+      float ai0=a[  0*4]; // row-0 of a
+      float ai1=a[  1*4];
+      float ai2=a[  2*4];
+      float ai3=a[  3*4];
+      a[ 0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      a[ 1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      a[ 2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      a[ 3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      ai0=a[1+0*4]; // row-1 of a
+      ai1=a[1+1*4];
+      ai2=a[1+2*4];
+      ai3=a[1+3*4];
+      a[1+0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      a[1+1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      a[1+2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      a[1+3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      ai0=a[2+0*4]; // row-2 of a
+      ai1=a[2+1*4];
+      ai2=a[2+2*4];
+      ai3=a[2+3*4];
+      a[2+0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      a[2+1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      a[2+2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      a[2+3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      ai0=a[3+0*4]; // row-3 of a
+      ai1=a[3+1*4];
+      ai2=a[3+2*4];
+      ai3=a[3+3*4];
+      a[3+0*4] = ai0 * b00  +  ai1 * b10  +  ai2 * b20  +  ai3 * b30 ;
+      a[3+1*4] = ai0 * b01  +  ai1 * b11  +  ai2 * b21  +  ai3 * b31 ;
+      a[3+2*4] = ai0 * b02  +  ai1 * b12  +  ai2 * b22  +  ai3 * b32 ;
+      a[3+3*4] = ai0 * b03  +  ai1 * b13  +  ai2 * b23  +  ai3 * b33 ;
+
+      return a;
+  }
+
+  /**
+   * Multiply matrix: [d] = [a] x [b]
+   * @param a 4x4 matrix in column-major order
+   * @param b 4x4 matrix in column-major order
+   * @param d result a*b in column-major order
+   * @deprecated use on of the float[] variants
+   */
+  public static void multMatrix(final FloatBuffer a, final FloatBuffer b, final float[] d) {
+     final int a_off = a.position();
+     final int b_off = b.position();
+     for (int i = 0; i < 4; i++) {
+        // one row in column-major order
+        final int a_off_i = a_off+i;
+        final float ai0=a.get(a_off_i+0*4),  ai1=a.get(a_off_i+1*4),  ai2=a.get(a_off_i+2*4),  ai3=a.get(a_off_i+3*4); // row-i of a
+        d[i+0*4] = ai0 * b.get(b_off+0+0*4) + ai1 * b.get(b_off+1+0*4) + ai2 * b.get(b_off+2+0*4) + ai3 * b.get(b_off+3+0*4) ;
+        d[i+1*4] = ai0 * b.get(b_off+0+1*4) + ai1 * b.get(b_off+1+1*4) + ai2 * b.get(b_off+2+1*4) + ai3 * b.get(b_off+3+1*4) ;
+        d[i+2*4] = ai0 * b.get(b_off+0+2*4) + ai1 * b.get(b_off+1+2*4) + ai2 * b.get(b_off+2+2*4) + ai3 * b.get(b_off+3+2*4) ;
+        d[i+3*4] = ai0 * b.get(b_off+0+3*4) + ai1 * b.get(b_off+1+3*4) + ai2 * b.get(b_off+2+3*4) + ai3 * b.get(b_off+3+3*4) ;
+     }
+  }
+
+  /**
+   * Multiply matrix: [a] = [a] x [b]
+   * @param a 4x4 matrix in column-major order (also result)
+   * @param b 4x4 matrix in column-major order
+   * @deprecated use on of the float[] variants
+   */
+  public static void multMatrix(final FloatBuffer a, final FloatBuffer b) {
+     final int a_off = a.position();
+     final int b_off = b.position();
+     for (int i = 0; i < 4; i++) {
+        // one row in column-major order
+        final int a_off_i = a_off+i;
+        final float ai0=a.get(a_off_i+0*4),  ai1=a.get(a_off_i+1*4),  ai2=a.get(a_off_i+2*4),  ai3=a.get(a_off_i+3*4); // row-i of a
+        a.put(a_off_i+0*4 , ai0 * b.get(b_off+0+0*4) + ai1 * b.get(b_off+1+0*4) + ai2 * b.get(b_off+2+0*4) + ai3 * b.get(b_off+3+0*4) );
+        a.put(a_off_i+1*4 , ai0 * b.get(b_off+0+1*4) + ai1 * b.get(b_off+1+1*4) + ai2 * b.get(b_off+2+1*4) + ai3 * b.get(b_off+3+1*4) );
+        a.put(a_off_i+2*4 , ai0 * b.get(b_off+0+2*4) + ai1 * b.get(b_off+1+2*4) + ai2 * b.get(b_off+2+2*4) + ai3 * b.get(b_off+3+2*4) );
+        a.put(a_off_i+3*4 , ai0 * b.get(b_off+0+3*4) + ai1 * b.get(b_off+1+3*4) + ai2 * b.get(b_off+2+3*4) + ai3 * b.get(b_off+3+3*4) );
+     }
   }
 
   /**
@@ -330,69 +1771,115 @@ public class FloatUtil {
    * @param m_in_off
    * @param v_in 4-component column-vector
    * @param v_out m_in * v_in
+   * @return given result vector <i>v_out</i> for chaining
    */
-  public static final void multMatrixVecf(float[] m_in, float[] v_in, float[] v_out) {
-    for (int i = 0; i < 4; i++) {
+  public static float[] multMatrixVec(final float[] m_in, final int m_in_off,
+                                      final float[] v_in, final int v_in_off,
+                                      final float[] v_out, final int v_out_off) {
       // (one matrix row in column-major order) X (column vector)
-      v_out[i] =
-        v_in[0] * m_in[0*4+i] +
-        v_in[1] * m_in[1*4+i] +
-        v_in[2] * m_in[2*4+i] +
-        v_in[3] * m_in[3*4+i];
-    }
+      v_out[0 + v_out_off] = v_in[0+v_in_off] * m_in[0*4+m_in_off  ]  +  v_in[1+v_in_off] * m_in[1*4+m_in_off  ] +
+                             v_in[2+v_in_off] * m_in[2*4+m_in_off  ]  +  v_in[3+v_in_off] * m_in[3*4+m_in_off  ];
+
+      final int m_in_off_1 = 1+m_in_off;
+      v_out[1 + v_out_off] = v_in[0+v_in_off] * m_in[0*4+m_in_off_1]  +  v_in[1+v_in_off] * m_in[1*4+m_in_off_1] +
+                             v_in[2+v_in_off] * m_in[2*4+m_in_off_1]  +  v_in[3+v_in_off] * m_in[3*4+m_in_off_1];
+
+      final int m_in_off_2 = 2+m_in_off;
+      v_out[2 + v_out_off] = v_in[0+v_in_off] * m_in[0*4+m_in_off_2]  +  v_in[1+v_in_off] * m_in[1*4+m_in_off_2] +
+                             v_in[2+v_in_off] * m_in[2*4+m_in_off_2]  +  v_in[3+v_in_off] * m_in[3*4+m_in_off_2];
+
+      final int m_in_off_3 = 3+m_in_off;
+      v_out[3 + v_out_off] = v_in[0+v_in_off] * m_in[0*4+m_in_off_3]  +  v_in[1+v_in_off] * m_in[1*4+m_in_off_3] +
+                             v_in[2+v_in_off] * m_in[2*4+m_in_off_3]  +  v_in[3+v_in_off] * m_in[3*4+m_in_off_3];
+
+      return v_out;
   }
 
   /**
    * @param m_in 4x4 matrix in column-major order
+   * @param m_in_off
    * @param v_in 4-component column-vector
    * @param v_out m_in * v_in
+   * @return given result vector <i>v_out</i> for chaining
    */
-  public static final void multMatrixVecf(FloatBuffer m_in, float[] v_in, int v_in_off, float[] v_out, int v_out_off) {
-    final int matrixPos = m_in.position();
-    for (int i = 0; i < 4; i++) {
+  public static float[] multMatrixVec(final float[] m_in, final float[] v_in, final float[] v_out) {
       // (one matrix row in column-major order) X (column vector)
-      v_out[i+v_out_off] =
-        v_in[0+v_in_off] * m_in.get(0*4+i+matrixPos) +
-        v_in[1+v_in_off] * m_in.get(1*4+i+matrixPos) +
-        v_in[2+v_in_off] * m_in.get(2*4+i+matrixPos) +
-        v_in[3+v_in_off] * m_in.get(3*4+i+matrixPos);
-    }
+      v_out[0] = v_in[0] * m_in[0*4  ]  +  v_in[1] * m_in[1*4  ] +
+                 v_in[2] * m_in[2*4  ]  +  v_in[3] * m_in[3*4  ];
+
+      v_out[1] = v_in[0] * m_in[0*4+1]  +  v_in[1] * m_in[1*4+1] +
+                 v_in[2] * m_in[2*4+1]  +  v_in[3] * m_in[3*4+1];
+
+      v_out[2] = v_in[0] * m_in[0*4+2]  +  v_in[1] * m_in[1*4+2] +
+                 v_in[2] * m_in[2*4+2]  +  v_in[3] * m_in[3*4+2];
+
+      v_out[3] = v_in[0] * m_in[0*4+3]  +  v_in[1] * m_in[1*4+3] +
+                 v_in[2] * m_in[2*4+3]  +  v_in[3] * m_in[3*4+3];
+
+      return v_out;
   }
 
   /**
    * @param m_in 4x4 matrix in column-major order
    * @param v_in 4-component column-vector
    * @param v_out m_in * v_in
+   * @deprecated use on of the float[] variants
    */
-  public static final void multMatrixVecf(FloatBuffer m_in, float[] v_in, float[] v_out) {
-    final int matrixPos = m_in.position();
+  public static void multMatrixVec(final FloatBuffer m_in, final float[] v_in, final float[] v_out) {
+    final int m_in_off = m_in.position();
     for (int i = 0; i < 4; i++) {
       // (one matrix row in column-major order) X (column vector)
+      final int i_m_in_off = i+m_in_off;
       v_out[i] =
-        v_in[0] * m_in.get(0*4+i+matrixPos) +
-        v_in[1] * m_in.get(1*4+i+matrixPos) +
-        v_in[2] * m_in.get(2*4+i+matrixPos) +
-        v_in[3] * m_in.get(3*4+i+matrixPos);
+        v_in[0] * m_in.get(0*4+i_m_in_off) +
+        v_in[1] * m_in.get(1*4+i_m_in_off) +
+        v_in[2] * m_in.get(2*4+i_m_in_off) +
+        v_in[3] * m_in.get(3*4+i_m_in_off);
     }
   }
 
   /**
-   * @param m_in 4x4 matrix in column-major order
-   * @param v_in 4-component column-vector
-   * @param v_out m_in * v_in
+   * Copy the named column of the given column-major matrix to v_out.
+   * <p>
+   * v_out may be 3 or 4 components long, hence the 4th row may not be stored.
+   * </p>
+   * @param m_in input column-major matrix
+   * @param m_in_off offset to input matrix
+   * @param column named column to copy
+   * @param v_out the column-vector storage, at least 3 components long
+   * @param v_out_off offset to storage
+   * @return given result vector <i>v_out</i> for chaining
    */
-  public static final void multMatrixVecf(FloatBuffer m_in, FloatBuffer v_in, FloatBuffer v_out) {
-    final int inPos = v_in.position();
-    final int outPos = v_out.position();
-    final int matrixPos = m_in.position();
-    for (int i = 0; i < 4; i++) {
-      // (one matrix row in column-major order) X (column vector)
-      v_out.put(i + outPos,
-              v_in.get(0+inPos) * m_in.get(0*4+i+matrixPos) +
-              v_in.get(1+inPos) * m_in.get(1*4+i+matrixPos) +
-              v_in.get(2+inPos) * m_in.get(2*4+i+matrixPos) +
-              v_in.get(3+inPos) * m_in.get(3*4+i+matrixPos));
-    }
+  public static float[] copyMatrixColumn(final float[] m_in, final int m_in_off, final int column, final float[] v_out, final int v_out_off) {
+      v_out[0+v_out_off]=m_in[0+column*4+m_in_off];
+      v_out[1+v_out_off]=m_in[1+column*4+m_in_off];
+      v_out[2+v_out_off]=m_in[2+column*4+m_in_off];
+      if( v_out.length > 3+v_out_off ) {
+          v_out[3+v_out_off]=m_in[3+column*4+m_in_off];
+      }
+      return v_out;
+  }
+
+  /**
+   * Copy the named row of the given column-major matrix to v_out.
+   * <p>
+   * v_out may be 3 or 4 components long, hence the 4th column may not be stored.
+   * </p>
+   * @param m_in input column-major matrix
+   * @param m_in_off offset to input matrix
+   * @param row named row to copy
+   * @param v_out the row-vector storage, at least 3 components long
+   * @param v_out_off offset to storage
+   * @return given result vector <i>v_out</i> for chaining
+   */
+  public static float[] copyMatrixRow(final float[] m_in, final int m_in_off, final int row, final float[] v_out, final int v_out_off) {
+      v_out[0+v_out_off]=m_in[row+0*4+m_in_off];
+      v_out[1+v_out_off]=m_in[row+1*4+m_in_off];
+      v_out[2+v_out_off]=m_in[row+2*4+m_in_off];
+      if( v_out.length > 3+v_out_off ) {
+          v_out[3+v_out_off]=m_in[row+3*4+m_in_off];
+      }
+      return v_out;
   }
 
   /**
@@ -405,8 +1892,11 @@ public class FloatUtil {
    * @param rowMajorOrder if true floats are layed out in row-major-order, otherwise column-major-order (OpenGL)
    * @param row row number to print
    * @return matrix row string representation
+   * @deprecated use on of the float[] variants
    */
-  public static StringBuilder matrixRowToString(StringBuilder sb, String f, FloatBuffer a, int aOffset, int rows, int columns, boolean rowMajorOrder, int row) {
+  public static StringBuilder matrixRowToString(StringBuilder sb, final String f,
+                                                final FloatBuffer a, final int aOffset,
+                                                final int rows, final int columns, final boolean rowMajorOrder, final int row) {
       if(null == sb) {
           sb = new StringBuilder();
       }
@@ -434,7 +1924,8 @@ public class FloatUtil {
    * @param row row number to print
    * @return matrix row string representation
    */
-  public static StringBuilder matrixRowToString(StringBuilder sb, String f, float[] a, int aOffset, int rows, int columns, boolean rowMajorOrder, int row) {
+  public static StringBuilder matrixRowToString(StringBuilder sb, final String f,
+                                                final float[] a, final int aOffset, final int rows, final int columns, final boolean rowMajorOrder, final int row) {
       if(null == sb) {
           sb = new StringBuilder();
       }
@@ -460,8 +1951,10 @@ public class FloatUtil {
    * @param columns
    * @param rowMajorOrder if true floats are layed out in row-major-order, otherwise column-major-order (OpenGL)
    * @return matrix string representation
+   * @deprecated use on of the float[] variants
    */
-  public static StringBuilder matrixToString(StringBuilder sb, String rowPrefix, String f, FloatBuffer a, int aOffset, int rows, int columns, boolean rowMajorOrder) {
+  public static StringBuilder matrixToString(StringBuilder sb, final String rowPrefix, final String f,
+                                             final FloatBuffer a, final int aOffset, final int rows, final int columns, final boolean rowMajorOrder) {
       if(null == sb) {
           sb = new StringBuilder();
       }
@@ -485,7 +1978,8 @@ public class FloatUtil {
    * @param rowMajorOrder if true floats are layed out in row-major-order, otherwise column-major-order (OpenGL)
    * @return matrix string representation
    */
-  public static StringBuilder matrixToString(StringBuilder sb, String rowPrefix, String f, float[] a, int aOffset, int rows, int columns, boolean rowMajorOrder) {
+  public static StringBuilder matrixToString(StringBuilder sb, final String rowPrefix, final String f,
+                                             final float[] a, final int aOffset, final int rows, final int columns, final boolean rowMajorOrder) {
       if(null == sb) {
           sb = new StringBuilder();
       }
@@ -510,8 +2004,11 @@ public class FloatUtil {
    * @param columns
    * @param rowMajorOrder if true floats are layed out in row-major-order, otherwise column-major-order (OpenGL)
    * @return side by side representation
+   * @deprecated use on of the float[] variants
    */
-  public static StringBuilder matrixToString(StringBuilder sb, String rowPrefix, String f, FloatBuffer a, int aOffset, FloatBuffer b, int bOffset, int rows, int columns, boolean rowMajorOrder) {
+  public static StringBuilder matrixToString(StringBuilder sb, final String rowPrefix, final String f,
+                                             final FloatBuffer a, final int aOffset, final FloatBuffer b, final int bOffset,
+                                             final int rows, final int columns, final boolean rowMajorOrder) {
       if(null == sb) {
           sb = new StringBuilder();
       }
@@ -539,7 +2036,9 @@ public class FloatUtil {
    * @param rowMajorOrder if true floats are layed out in row-major-order, otherwise column-major-order (OpenGL)
    * @return side by side representation
    */
-  public static StringBuilder matrixToString(StringBuilder sb, String rowPrefix, String f, float[] a, int aOffset, float[] b, int bOffset, int rows, int columns, boolean rowMajorOrder) {
+  public static StringBuilder matrixToString(StringBuilder sb, final String rowPrefix, final String f,
+                                             final float[] a, final int aOffset, final float[] b, final int bOffset,
+                                             final int rows, final int columns, final boolean rowMajorOrder) {
       if(null == sb) {
           sb = new StringBuilder();
       }
@@ -554,20 +2053,268 @@ public class FloatUtil {
       return sb;
   }
 
+  //
+  // Scalar Ops
+  //
+
+  @SuppressWarnings("unused")
+  private static void calculateMachineEpsilonFloat() {
+      final long t0;
+      if( DEBUG_EPSILON ) {
+          t0 = Platform.currentTimeMillis();
+      }
+      float machEps = 1.0f;
+      int i=0;
+      do {
+          machEps /= 2.0f;
+          i++;
+      } while (1.0f + (machEps / 2.0f) != 1.0f);
+      machEpsilon = machEps;
+      if( DEBUG_EPSILON ) {
+          final long t1 = Platform.currentTimeMillis();
+          System.err.println("MachineEpsilon: "+machEpsilon+", in "+i+" iterations within "+(t1-t0)+" ms");
+      }
+  }
+  private static volatile boolean machEpsilonAvail = false;
+  private static float machEpsilon = 0f;
+  private static final boolean DEBUG_EPSILON = false;
+
+  /**
+   * Return computed machine Epsilon value.
+   * <p>
+   * The machine Epsilon value is computed once.
+   * </p>
+   * <p>
+   * On a reference machine the result was {@link #EPSILON} in 23 iterations.
+   * </p>
+   * @see #EPSILON
+   */
+  public static float getMachineEpsilon() {
+      if( !machEpsilonAvail ) {
+          synchronized(FloatUtil.class) {
+              if( !machEpsilonAvail ) {
+                  machEpsilonAvail = true;
+                  calculateMachineEpsilonFloat();
+              }
+          }
+      }
+      return machEpsilon;
+  }
+
   public static final float E = 2.7182818284590452354f;
 
+  /** The value PI, i.e. 180 degrees in radians. */
   public static final float PI = 3.14159265358979323846f;
 
-  public static float abs(float a) { return (float) java.lang.Math.abs(a);  }
+  /** The value 2PI, i.e. 360 degrees in radians. */
+  public static final float TWO_PI = 2f * PI;
 
-  public static float pow(float a, float b) { return (float) java.lang.Math.pow(a, b);  }
+  /** The value PI/2, i.e. 90 degrees in radians. */
+  public static final float HALF_PI = PI / 2f;
 
-  public static float sin(float a) { return (float) java.lang.Math.sin(a);  }
+  /** The value PI/4, i.e. 45 degrees in radians. */
+  public static final float QUARTER_PI = PI / 4f;
 
-  public static float cos(float a) { return (float) java.lang.Math.cos(a);  }
+  /** The value PI^2. */
+  public final static float SQUARED_PI = PI * PI;
 
-  public static float acos(float a) { return (float) java.lang.Math.acos(a);  }
+  /**
+   * Epsilon for floating point {@value}, as once computed via {@link #getMachineEpsilon()} on an AMD-64 CPU.
+   * <p>
+   * Definition of machine epsilon guarantees that:
+   * <pre>
+   *        1.0f + EPSILON != 1.0f
+   * </pre>
+   * In other words: <i>machEps</i> is the maximum relative error of the chosen rounding procedure.
+   * </p>
+   * <p>
+   * A number can be considered zero if it is in the range (or in the set):
+   * <pre>
+   *    <b>MaybeZeroSet</b> e ]-<i>machEps</i> .. <i>machEps</i>[  <i>(exclusive)</i>
+   * </pre>
+   * While comparing floating point values, <i>machEps</i> allows to clip the relative error:
+   * <pre>
+   *    boolean isZero    = afloat < EPSILON;
+   *    boolean isNotZero = afloat >= EPSILON;
+   *
+   *    boolean isEqual    = abs(bfloat - afloat) < EPSILON;
+   *    boolean isNotEqual = abs(bfloat - afloat) >= EPSILON;
+   * </pre>
+   * </p>
+   * @see #isEqual(float, float, float)
+   * @see #isZero(float, float)
+   */
+  public static final float EPSILON = 1.1920929E-7f; // Float.MIN_VALUE == 1.4e-45f ; double EPSILON 2.220446049250313E-16d
 
-  public static float sqrt(float a) { return (float) java.lang.Math.sqrt(a);  }
+  /**
+   * Inversion Epsilon, used with equals method to determine if two inverted matrices are close enough to be considered equal.
+   * <p>
+   * Using {@value}, which is ~100 times {@link FloatUtil#EPSILON}.
+   * </p>
+   */
+  public static final float INV_DEVIANCE = 1.0E-5f; // FloatUtil.EPSILON == 1.1920929E-7f; double ALLOWED_DEVIANCE: 1.0E-8f
+
+  /**
+   * Return true if both values are equal w/o regarding an epsilon.
+   * <p>
+   * Implementation considers following corner cases:
+   * <ul>
+   *    <li>NaN == NaN</li>
+   *    <li>+Inf == +Inf</li>
+   *    <li>-Inf == -Inf</li>
+   * </ul>
+   * </p>
+   * @see #isEqual(float, float, float)
+   */
+  public static boolean isEqual(final float a, final float b) {
+      // Values are equal (Inf, Nan .. )
+      return Float.floatToIntBits(a) == Float.floatToIntBits(b);
+  }
+
+  /**
+   * Return true if both values are equal, i.e. their absolute delta < <code>epsilon</code>.
+   * <p>
+   * Implementation considers following corner cases:
+   * <ul>
+   *    <li>NaN == NaN</li>
+   *    <li>+Inf == +Inf</li>
+   *    <li>-Inf == -Inf</li>
+   * </ul>
+   * </p>
+   * @see #EPSILON
+   */
+  public static boolean isEqual(final float a, final float b, final float epsilon) {
+      if ( Math.abs(a - b) < epsilon ) {
+          return true;
+      } else {
+          // Values are equal (Inf, Nan .. )
+          return Float.floatToIntBits(a) == Float.floatToIntBits(b);
+      }
+  }
+
+  /**
+   * Return true if both values are equal w/o regarding an epsilon.
+   * <p>
+   * Implementation considers following corner cases:
+   * <ul>
+   *    <li>NaN == NaN</li>
+   *    <li>+Inf == +Inf</li>
+   *    <li>-Inf == -Inf</li>
+   *    <li>NaN > 0</li>
+   *    <li>+Inf > -Inf</li>
+   * </ul>
+   * </p>
+   * @see #compare(float, float, float)
+   */
+  public static int compare(final float a, final float b) {
+      if (a < b) {
+          return -1; // Neither is NaN, a is smaller
+      }
+      if (a > b) {
+          return 1;  // Neither is NaN, a is larger
+      }
+      final int aBits = Float.floatToIntBits(a);
+      final int bBits = Float.floatToIntBits(b);
+      if( aBits == bBits ) {
+          return 0;  // Values are equal (Inf, Nan .. )
+      } else if( aBits < bBits ) {
+          return -1; // (-0.0,  0.0) or (!NaN,  NaN)
+      } else {
+          return 1;  // ( 0.0, -0.0) or ( NaN, !NaN)
+      }
+  }
+
+  /**
+   * Return true if both values are equal, i.e. their absolute delta < <code>epsilon</code>.
+   * <p>
+   * Implementation considers following corner cases:
+   * <ul>
+   *    <li>NaN == NaN</li>
+   *    <li>+Inf == +Inf</li>
+   *    <li>-Inf == -Inf</li>
+   *    <li>NaN > 0</li>
+   *    <li>+Inf > -Inf</li>
+   * </ul>
+   * </p>
+   * @see #EPSILON
+   */
+  public static int compare(final float a, final float b, final float epsilon) {
+      if ( Math.abs(a - b) < epsilon ) {
+          return 0;
+      } else {
+          return compare(a, b);
+      }
+  }
+
+  /**
+   * Return true if value is zero, i.e. it's absolute value < <code>epsilon</code>.
+   * @see #EPSILON
+   */
+  public static boolean isZero(final float a, final float epsilon) {
+      return Math.abs(a) < epsilon;
+  }
+
+  public static float abs(final float a) { return java.lang.Math.abs(a);  }
+
+  public static float pow(final float a, final float b) { return (float) java.lang.Math.pow(a, b);  }
+
+  public static float sin(final float a) { return (float) java.lang.Math.sin(a);  }
+
+  public static float asin(final float a) { return (float) java.lang.Math.asin(a);  }
+
+  public static float cos(final float a) { return (float) java.lang.Math.cos(a);  }
+
+  public static float acos(final float a) { return (float) java.lang.Math.acos(a);  }
+
+  public static float tan(final float a) { return (float) java.lang.Math.tan(a); }
+
+  public static float atan(final float a) { return (float) java.lang.Math.atan(a); }
+
+  public static float atan2(final float y, final float x) { return (float) java.lang.Math.atan2(y, x); }
+
+  public static float sqrt(final float a) { return (float) java.lang.Math.sqrt(a);  }
+
+  /**
+   * Returns resolution of Z buffer of given parameter,
+   * see <a href="http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html">Love Your Z-Buffer</a>.
+   * <pre>
+   *  return z * z / ( zNear * (1<<zBits) - z )
+   * </pre>
+   * @param zBits number of bits of Z precision, i.e. z-buffer depth
+   * @param z distance from the eye to the object
+   * @param zNear distance from eye to near clip plane
+   * @return smallest resolvable Z separation at this range.
+   */
+  public static float getZBufferEpsilon(final int zBits, final float z, final float zNear) {
+      return z * z / ( zNear * ( 1 << zBits ) - z );
+  }
+
+  /**
+   * Returns Z buffer value of given parameter,
+   * see <a href="http://www.sjbaker.org/steve/omniv/love_your_z_buffer.html">Love Your Z-Buffer</a>.
+   * <pre>
+   *  float a = zFar / ( zFar - zNear )
+   *  float b = zFar * zNear / ( zNear - zFar )
+   *  return (int) ( (1<<zBits) * ( a + b / z ) )
+   * </pre>
+   * @param zBits number of bits of Z precision, i.e. z-buffer depth
+   * @param z distance from the eye to the object
+   * @param zNear distance from eye to near clip plane
+   * @param zFar distance from eye to far clip plane
+   * @return z buffer value
+   */
+  public static int getZBufferValue(final int zBits, final float z, final float zNear, final float zFar) {
+      final float a = zFar / ( zFar - zNear );
+      final float b = zFar * zNear / ( zNear - zFar );
+      return (int) ( (1<<zBits) * ( a + b / z ) );
+  }
+
+  /**
+   * Returns orthogonal distance
+   * (1f/zNear-1f/orthoDist)/(1f/zNear-1f/zFar);
+   */
+  public static float getOrthoWinZ(final float orthoZ, final float zNear, final float zFar) {
+      return (1f/zNear-1f/orthoZ)/(1f/zNear-1f/zFar);
+  }
 
 }
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/opengl/math/FovHVHalves.java b/src/jogl/classes/com/jogamp/opengl/math/FovHVHalves.java
new file mode 100644
index 0000000..26ed570
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/math/FovHVHalves.java
@@ -0,0 +1,182 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.math;
+
+/**
+ * Horizontal and vertical field of view (FOV) halves,
+ * allowing a non-centered projection.
+ * <p>
+ * The values might be either in tangent or radians.
+ * </p>
+ */
+public final class FovHVHalves {
+    /** Half horizontal FOV from center to left. */
+    public final float left;
+    /** Half horizontal FOV from center to right. */
+    public final float right;
+    /** Half vertical FOV from center to top. */
+    public final float top;
+    /** Half vertical FOV from center to bottom. */
+    public final float bottom;
+    /** If true, values are in tangent, otherwise radians.*/
+    public final boolean inTangents;
+
+    /**
+     * Constructor for one {@link FovHVHalves} instance.
+     * <p>
+     * It is recommended to pass and store values in tangent
+     * if used for perspective FOV calculations, since it will avoid conversion to tangent later on.
+     * </p>
+     * @param left half horizontal FOV, left side, in tangent or radians
+     * @param right half horizontal FOV, right side, in tangent or radians
+     * @param top half vertical FOV, top side, in tangent or radians
+     * @param bottom half vertical FOV, bottom side, in tangent or radians
+     * @param inTangents if true, values are in tangent, otherwise radians
+     */
+    public FovHVHalves(final float left, final float right, final float top, final float bottom, final boolean inTangents) {
+        this.left = left;
+        this.right = right;
+        this.top = top;
+        this.bottom = bottom;
+        this.inTangents = inTangents;
+    }
+
+    /**
+     * Returns a symmetrical centered {@link FovHVHalves} instance in tangents, using:
+     * <pre>
+        halfHorizFovTan = tan( horizontalFov / 2f );
+        halfVertFovTan  = tan( verticalFov / 2f );
+     * </pre>
+     * @param horizontalFov whole horizontal FOV in radians
+     * @param verticalFov whole vertical FOV in radians
+     */
+    public static FovHVHalves byRadians(final float horizontalFov, final float verticalFov) {
+        final float halfHorizFovTan = FloatUtil.tan(horizontalFov/2f);
+        final float halfVertFovTan = FloatUtil.tan(verticalFov/2f);
+        return new FovHVHalves(halfHorizFovTan, halfHorizFovTan, halfVertFovTan, halfVertFovTan, true);
+    }
+
+    /**
+     * Returns a symmetrical centered {@link FovHVHalves} instance in tangents, using:
+     * <pre>
+        top  = bottom = tan( verticalFov / 2f );
+        left =  right = aspect * top;
+     * </pre>
+     *
+     * @param verticalFov vertical FOV in radians
+     * @param aspect aspect ration width / height
+     */
+    public static FovHVHalves byFovyRadianAndAspect(final float verticalFov, final float aspect) {
+        final float halfVertFovTan = FloatUtil.tan(verticalFov/2f);
+        final float halfHorizFovTan = aspect * halfVertFovTan;
+        return new FovHVHalves(halfHorizFovTan, halfHorizFovTan,
+                               halfVertFovTan, halfVertFovTan, true);
+    }
+
+    /**
+     * Returns a custom symmetry {@link FovHVHalves} instance in tangents, using:
+     * <pre>
+        left   = tan( horizontalFov * horizCenterFromLeft )
+        right  = tan( horizontalFov * ( 1f - horizCenterFromLeft ) )
+        top    = tan( verticalFov   * vertCenterFromTop )
+        bottom = tan( verticalFov   * (1f - vertCenterFromTop ) )
+     * </pre>
+     * @param horizontalFov whole horizontal FOV in radians
+     * @param horizCenterFromLeft horizontal center from left in [0..1]
+     * @param verticalFov whole vertical FOV in radians
+     * @param vertCenterFromTop vertical center from top in [0..1]
+     */
+    public static FovHVHalves byRadians(final float horizontalFov, final float horizCenterFromLeft,
+                                        final float verticalFov, final float vertCenterFromTop) {
+        return new FovHVHalves(FloatUtil.tan(horizontalFov * horizCenterFromLeft),
+                               FloatUtil.tan(horizontalFov * ( 1f - horizCenterFromLeft )),
+                               FloatUtil.tan(verticalFov   * vertCenterFromTop),
+                               FloatUtil.tan(verticalFov   * (1f - vertCenterFromTop )),
+                               true);
+    }
+
+    /**
+     * Returns a custom symmetry {@link FovHVHalves} instance in tangents,
+     * via computing the <code>horizontalFov</code> using:
+     * <pre>
+        halfVertFovTan  = tan( verticalFov / 2f );
+        halfHorizFovTan = aspect * halfVertFovTan;
+        horizontalFov   = atan( halfHorizFovTan ) * 2f;
+        return {@link #byRadians(float, float, float, float) byRadians}(horizontalFov, horizCenterFromLeft, verticalFov, vertCenterFromTop)
+     * </pre>
+     * @param verticalFov whole vertical FOV in radians
+     * @param vertCenterFromTop vertical center from top in [0..1]
+     * @param aspect aspect ration width / height
+     * @param horizCenterFromLeft horizontal center from left in [0..1]
+     */
+    public static FovHVHalves byFovyRadianAndAspect(final float verticalFov, final float vertCenterFromTop,
+                                                    final float aspect, final float horizCenterFromLeft) {
+        final float halfVertFovTan = FloatUtil.tan(verticalFov/2f);
+        final float halfHorizFovTan = aspect * halfVertFovTan;
+        final float horizontalFov = FloatUtil.atan(halfHorizFovTan) * 2f;
+        return byRadians(horizontalFov, horizCenterFromLeft, verticalFov, vertCenterFromTop);
+    }
+
+    /**
+     * Returns this instance <i>in tangent</i> values.
+     * <p>
+     * If this instance is {@link #inTangents} already, method returns this instance,
+     * otherwise a newly created instance w/ converted values to tangent.
+     * </p>
+     */
+    public final FovHVHalves toTangents() {
+        if( inTangents ) {
+            return this;
+        } else {
+            return new FovHVHalves(FloatUtil.tan(left), FloatUtil.tan(right), FloatUtil.tan(top), FloatUtil.tan(bottom), true);
+        }
+    }
+
+    /** Returns the full horizontal FOV, i.e. {@link #left} + {@link #right}. */
+    public final float horzFov() { return left+right; }
+
+    /** Returns the full vertical FOV, i.e. {@link #top} + {@link #bottom}. */
+    public final float vertFov() { return top+bottom; }
+
+    public final String toString() {
+        return "FovHVH["+(inTangents?"tangents":"radians")+": "+left+" l, "+right+" r, "+top+" t, "+bottom+" b]";
+    }
+    public final String toStringInDegrees() {
+        final float f = 180.0f / FloatUtil.PI;
+        final String storedAs = inTangents?"tangents":"radians";
+        if( inTangents ) {
+            final float aleft = FloatUtil.atan(left);
+            final float aright = FloatUtil.atan(right);
+            final float atop = FloatUtil.atan(top);
+            final float abottom = FloatUtil.atan(bottom);
+            return "FovHVH[degrees: "+aleft*f+" l, "+aright*f+" r, "+atop*f+" t, "+abottom*f+" b, stored-as: "+storedAs+"]";
+        } else {
+            return "FovHVH[degrees: "+left*f+" l, "+right*f+" r, "+top*f+" t, "+bottom*f+" b, stored-as: "+storedAs+"]";
+        }
+    }
+}
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Matrix4.java b/src/jogl/classes/com/jogamp/opengl/math/Matrix4.java
new file mode 100644
index 0000000..830f1a8
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/math/Matrix4.java
@@ -0,0 +1,152 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.math;
+
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
+
+import com.jogamp.opengl.util.PMVMatrix;
+
+/**
+ * Simple float array-backed float 4x4 matrix
+ * exposing {@link FloatUtil} matrix functionality in an object oriented manner.
+ * <p>
+ * Unlike {@link PMVMatrix}, this class only represents one single matrix
+ * without a complete {@link GLMatrixFunc} implementation,
+ * allowing this class to be more lightweight.
+ * </p>
+ * <p>
+ * Implementation is not mature - WIP and subject to change.
+ * </p>
+ */
+public class Matrix4 {
+
+    public Matrix4() {
+          matrix     = new float[16];
+          matrixTxSx = new float[16];
+          mat4Tmp1   = new float[16];
+          vec4Tmp1   = new float[4];
+          FloatUtil.makeIdentity(matrixTxSx);
+          loadIdentity();
+    }
+
+    public final float[] getMatrix() {
+        return matrix;
+    }
+
+    public final void loadIdentity() {
+        FloatUtil.makeIdentity(matrix);
+    }
+
+    /**
+     * Multiply matrix: [this] = [this] x [m]
+     * @param m 4x4 matrix in column-major order
+     */
+    public final void multMatrix(final float[] m, final int m_offset) {
+        FloatUtil.multMatrix(matrix, 0, m, m_offset);
+    }
+
+    /**
+     * Multiply matrix: [this] = [this] x [m]
+     * @param m 4x4 matrix in column-major order
+     */
+    public final void multMatrix(final float[] m) {
+        FloatUtil.multMatrix(matrix, m);
+    }
+
+    /**
+     * Multiply matrix: [this] = [this] x [m]
+     * @param m 4x4 matrix in column-major order
+     */
+    public final void multMatrix(final Matrix4 m) {
+        FloatUtil.multMatrix(matrix, m.getMatrix());
+    }
+
+    /**
+     * @param v_in 4-component column-vector
+     * @param v_out this * v_in
+     */
+    public final void multVec(final float[] v_in, final float[] v_out) {
+        FloatUtil.multMatrixVec(matrix, v_in, v_out);
+    }
+
+    /**
+     * @param v_in 4-component column-vector
+     * @param v_out this * v_in
+     */
+    public final void multVec(final float[] v_in, final int v_in_offset, final float[] v_out, final int v_out_offset) {
+        FloatUtil.multMatrixVec(matrix, 0, v_in, v_in_offset, v_out, v_out_offset);
+    }
+
+    public final void translate(final float x, final float y, final float z) {
+        multMatrix(FloatUtil.makeTranslation(matrixTxSx, false, x, y, z));
+    }
+
+    public final void scale(final float x, final float y, final float z) {
+        multMatrix(FloatUtil.makeScale(matrixTxSx, false, x, y, z));
+    }
+
+    public final void rotate(final float angrad, final float x, final float y, final float z) {
+        multMatrix(FloatUtil.makeRotationAxis(mat4Tmp1, 0, angrad, x, y, z, vec4Tmp1));
+    }
+
+    /**
+     * Rotate the current matrix with the given {@link Quaternion}'s rotation {@link Quaternion#toMatrix(float[], int) matrix representation}.
+     */
+    public final void rotate(final Quaternion quat) {
+        multMatrix(quat.toMatrix(mat4Tmp1, 0));
+    }
+
+    public final void transpose() {
+        System.arraycopy(matrix, 0, mat4Tmp1, 0, 16);
+        FloatUtil.transposeMatrix(mat4Tmp1, matrix);
+    }
+
+    public final float determinant() {
+        return FloatUtil.matrixDeterminant(matrix);
+    }
+
+    public final boolean invert() {
+        return null != FloatUtil.invertMatrix(matrix, matrix);
+    }
+
+    public final void makeOrtho(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) {
+        multMatrix( FloatUtil.makeOrtho(mat4Tmp1, 0, true, left, right, bottom, top, zNear, zFar) );
+    }
+
+    public final void makeFrustum(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) {
+        multMatrix( FloatUtil.makeFrustum(mat4Tmp1, 0, true, left, right, bottom, top, zNear, zFar) );
+    }
+
+    public final void makePerspective(final float fovy_rad, final float aspect, final float zNear, final float zFar) {
+        multMatrix( FloatUtil.makePerspective(mat4Tmp1, 0, true, fovy_rad, aspect, zNear, zFar) );
+    }
+
+    private final float[] matrix, matrixTxSx;
+    private final float[] mat4Tmp1, vec4Tmp1;
+}
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java b/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
index 52a59c5..4304507 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/Quaternion.java
@@ -27,360 +27,1124 @@
  */
 package com.jogamp.opengl.math;
 
+/**
+ * Quaternion implementation supporting
+ * <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q34">Gimbal-Lock</a> free rotations.
+ * <p>
+ * All matrix operation provided are in column-major order,
+ * as specified in the OpenGL fixed function pipeline, i.e. compatibility profile.
+ * See {@link FloatUtil}.
+ * </p>
+ * <p>
+ * See <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html">Matrix-FAQ</a>
+ * </p>
+ * <p>
+ * See <a href="http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/index.htm">euclideanspace.com-Quaternion</a>
+ * </p>
+ */
 public class Quaternion {
-    protected float x, y, z, w;
+    private float x, y, z, w;
+
+    /**
+     * Quaternion Epsilon, used with equals method to determine if two Quaternions are close enough to be considered equal.
+     * <p>
+     * Using {@value}, which is ~10 times {@link FloatUtil#EPSILON}.
+     * </p>
+     */
+    public static final float ALLOWED_DEVIANCE = 1.0E-6f; // FloatUtil.EPSILON == 1.1920929E-7f; double ALLOWED_DEVIANCE: 1.0E-8f
 
     public Quaternion() {
-        setIdentity();
+        x = y = z = 0; w = 1;
     }
 
-    public Quaternion(Quaternion q) {
-        x = q.x;
-        y = q.y;
-        z = q.z;
-        w = q.w;
+    public Quaternion(final Quaternion q) {
+        set(q);
     }
 
-    public Quaternion(float x, float y, float z, float w) {
-        this.x = x;
-        this.y = y;
-        this.z = z;
-        this.w = w;
+    public Quaternion(final float x, final float y, final float z, final float w) {
+        set(x, y, z, w);
     }
 
     /**
-     * Constructor to create a rotation based quaternion from two vectors
-     *
-     * @param vector1
-     * @param vector2
+     * See {@link #magnitude()} for special handling of {@link FloatUtil#EPSILON epsilon},
+     * which is not applied here.
+     * @return the squared magnitude of this quaternion.
      */
-    public Quaternion(float[] vector1, float[] vector2) {
-        final float theta = FloatUtil.acos(VectorUtil.dot(vector1, vector2));
-        final float[] cross = VectorUtil.cross(vector1, vector2);
-        fromAxis(cross, theta);
-    }
-
-    /***
-     * Constructor to create a rotation based quaternion from axis vector and angle
-     * @param vector axis vector
-     * @param angle rotation angle (rads)
-     * @see #fromAxis(float[], float)
-     */
-    public Quaternion(float[] vector, float angle) {
-        fromAxis(vector, angle);
-    }
-
-    /***
-     * Initialize this quaternion with given axis vector and rotation angle
-     *
-     * @param vector axis vector
-     * @param angle rotation angle (rads)
-     */
-    public void fromAxis(float[] vector, float angle) {
-        final float halfangle = angle * 0.5f;
-        final float sin = FloatUtil.sin(halfangle);
-        final float[] nv = VectorUtil.normalize(vector);
-        x = (nv[0] * sin);
-        y = (nv[1] * sin);
-        z = (nv[2] * sin);
-        w = FloatUtil.cos(halfangle);
+    public final float magnitudeSquared() {
+        return w*w + x*x + y*y + z*z;
     }
 
     /**
-     * Transform the rotational quaternion to axis based rotation angles
-     *
-     * @return new float[4] with ,theta,Rx,Ry,Rz
+     * Return the magnitude of this quaternion, i.e. sqrt({@link #magnitude()})
+     * <p>
+     * A magnitude of zero shall equal {@link #isIdentity() identity},
+     * as performed by {@link #normalize()}.
+     * </p>
+     * <p>
+     * Implementation Details:
+     * <ul>
+     *   <li> returns 0f if {@link #magnitudeSquared()} is {@link FloatUtil#isZero(float, float) is zero} using {@link FloatUtil#EPSILON epsilon}</li>
+     *   <li> returns 1f if {@link #magnitudeSquared()} is {@link FloatUtil#isEqual(float, float, float) equals 1f} using {@link FloatUtil#EPSILON epsilon}</li>
+     * </ul>
+     * </p>
      */
-    public float[] toAxis() {
-        final float[] vec = new float[4];
-        final float scale = FloatUtil.sqrt(x * x + y * y + z * z);
-        vec[0] = FloatUtil.acos(w) * 2.0f;
-        vec[1] = x / scale;
-        vec[2] = y / scale;
-        vec[3] = z / scale;
-        return vec;
+    public final float magnitude() {
+        final float magnitudeSQ = magnitudeSquared();
+        if ( FloatUtil.isZero(magnitudeSQ, FloatUtil.EPSILON) ) {
+            return 0f;
+        }
+        if ( FloatUtil.isEqual(1f, magnitudeSQ, FloatUtil.EPSILON) ) {
+            return 1f;
+        }
+        return FloatUtil.sqrt(magnitudeSQ);
     }
 
-    public float getW() {
+    public final float getW() {
         return w;
     }
 
-    public void setW(float w) {
+    public final void setW(final float w) {
         this.w = w;
     }
 
-    public float getX() {
+    public final float getX() {
         return x;
     }
 
-    public void setX(float x) {
+    public final void setX(final float x) {
         this.x = x;
     }
 
-    public float getY() {
+    public final float getY() {
         return y;
     }
 
-    public void setY(float y) {
+    public final void setY(final float y) {
         this.y = y;
     }
 
-    public float getZ() {
+    public final float getZ() {
         return z;
     }
 
-    public void setZ(float z) {
+    public final void setZ(final float z) {
+        this.z = z;
+    }
+
+    /**
+     * Returns the dot product of this quaternion with the given x,y,z and w components.
+     */
+    public final float dot(final float x, final float y, final float z, final float w) {
+        return this.x * x + this.y * y + this.z * z + this.w * w;
+    }
+
+    /**
+     * Returns the dot product of this quaternion with the given quaternion
+     */
+    public final float dot(final Quaternion quat) {
+        return dot(quat.getX(), quat.getY(), quat.getZ(), quat.getW());
+    }
+
+    /**
+     * Returns <code>true</code> if this quaternion has identity.
+     * <p>
+     * Implementation uses {@link FloatUtil#EPSILON epsilon} to compare
+     * {@link #getW() W} {@link FloatUtil#isEqual(float, float, float) against 1f} and
+     * {@link #getX() X}, {@link #getY() Y} and {@link #getZ() Z}
+     * {@link FloatUtil#isZero(float, float) against zero}.
+     * </p>
+     */
+    public final boolean isIdentity() {
+        return FloatUtil.isEqual(1f, w, FloatUtil.EPSILON) && VectorUtil.isZero(x, y, z, FloatUtil.EPSILON);
+        // return w == 1f && x == 0f && y == 0f && z == 0f;
+    }
+
+    /***
+     * Set this quaternion to identity (x=0,y=0,z=0,w=1)
+     * @return this quaternion for chaining.
+     */
+    public final Quaternion setIdentity() {
+        x = y = z = 0f; w = 1f;
+        return this;
+    }
+
+    /**
+     * Normalize a quaternion required if to be used as a rotational quaternion.
+     * <p>
+     * Implementation Details:
+     * <ul>
+     *   <li> {@link #setIdentity()} if {@link #magnitude()} is {@link FloatUtil#isZero(float, float) is zero} using {@link FloatUtil#EPSILON epsilon}</li>
+     * </ul>
+     * </p>
+     * @return this quaternion for chaining.
+     */
+    public final Quaternion normalize() {
+        final float norm = magnitude();
+        if ( FloatUtil.isZero(norm, FloatUtil.EPSILON) ) {
+            setIdentity();
+        } else {
+            final float invNorm = 1f/norm;
+            w *= invNorm;
+            x *= invNorm;
+            y *= invNorm;
+            z *= invNorm;
+        }
+        return this;
+    }
+
+    /**
+     * Conjugates this quaternion <code>[-x, -y, -z, w]</code>.
+     * @return this quaternion for chaining.
+     * @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q49">Matrix-FAQ Q49</a>
+     */
+    public Quaternion conjugate() {
+        x = -x;
+        y = -y;
+        z = -z;
+        return this;
+    }
+
+    /**
+     * Invert the quaternion If rotational, will produce a the inverse rotation
+     * <p>
+     * Implementation Details:
+     * <ul>
+     *   <li> {@link #conjugate() conjugates} if {@link #magnitudeSquared()} is is {@link FloatUtil#isEqual(float, float, float) equals 1f} using {@link FloatUtil#EPSILON epsilon}</li>
+     * </ul>
+     * </p>
+     * @return this quaternion for chaining.
+     * @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q50">Matrix-FAQ Q50</a>
+     */
+    public final Quaternion invert() {
+        final float magnitudeSQ = magnitudeSquared();
+        if ( FloatUtil.isEqual(1.0f, magnitudeSQ, FloatUtil.EPSILON) ) {
+            conjugate();
+        } else {
+            final float invmsq = 1f/magnitudeSQ;
+            w *= invmsq;
+            x = -x * invmsq;
+            y = -y * invmsq;
+            z = -z * invmsq;
+        }
+        return this;
+    }
+
+    /**
+     * Set all values of this quaternion using the given src.
+     * @return this quaternion for chaining.
+     */
+    public final Quaternion set(final Quaternion src) {
+        this.x = src.x;
+        this.y = src.y;
+        this.z = src.z;
+        this.w = src.w;
+        return this;
+    }
+
+    /**
+     * Set all values of this quaternion using the given components.
+     * @return this quaternion for chaining.
+     */
+    public final Quaternion set(final float x, final float y, final float z, final float w) {
+        this.x = x;
+        this.y = y;
         this.z = z;
+        this.w = w;
+        return this;
     }
 
     /**
      * Add a quaternion
      *
      * @param q quaternion
+     * @return this quaternion for chaining.
+     * @see <a href="http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm#add">euclideanspace.com-QuaternionAdd</a>
      */
-    public void add(Quaternion q) {
+    public final Quaternion add(final Quaternion q) {
         x += q.x;
         y += q.y;
         z += q.z;
+        w += q.w;
+        return this;
     }
 
     /**
      * Subtract a quaternion
      *
      * @param q quaternion
+     * @return this quaternion for chaining.
+     * @see <a href="http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm#add">euclideanspace.com-QuaternionAdd</a>
      */
-    public void subtract(Quaternion q) {
+    public final Quaternion subtract(final Quaternion q) {
         x -= q.x;
         y -= q.y;
         z -= q.z;
+        w -= q.w;
+        return this;
     }
 
     /**
-     * Divide a quaternion by a constant
+     * Multiply this quaternion by the param quaternion
      *
-     * @param n a float to divide by
+     * @param q a quaternion to multiply with
+     * @return this quaternion for chaining.
+     * @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q53">Matrix-FAQ Q53</a>
+     * @see <a href="http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm#mul">euclideanspace.com-QuaternionMul</a>
      */
-    public void divide(float n) {
-        x /= n;
-        y /= n;
-        z /= n;
+    public final Quaternion mult(final Quaternion q) {
+        return set( w * q.x + x * q.w + y * q.z - z * q.y,
+                    w * q.y - x * q.z + y * q.w + z * q.x,
+                    w * q.z + x * q.y - y * q.x + z * q.w,
+                    w * q.w - x * q.x - y * q.y - z * q.z );
     }
 
     /**
-     * Multiply this quaternion by the param quaternion
+     * Scale this quaternion by a constant
      *
-     * @param q a quaternion to multiply with
+     * @param n a float constant
+     * @return this quaternion for chaining.
+     * @see <a href="http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/code/index.htm#scale">euclideanspace.com-QuaternionScale</a>
      */
-    public void mult(Quaternion q) {
-        final float w1 = w * q.w - x * q.x - y * q.y - z * q.z;
+    public final Quaternion scale(final float n) {
+        x *= n;
+        y *= n;
+        z *= n;
+        w *= n;
+        return this;
+    }
 
-        final float x1 = w * q.x + x * q.w + y * q.z - z * q.y;
-        final float y1 = w * q.y - x * q.z + y * q.w + z * q.x;
-        final float z1 = w * q.z + x * q.y - y * q.x + z * q.w;
+    /**
+     * Rotate this quaternion by the given angle and axis.
+     * <p>
+     * The axis must be a normalized vector.
+     * </p>
+     * <p>
+     * A rotational quaternion is made from the given angle and axis.
+     * </p>
+     *
+     * @param angle in radians
+     * @param axisX x-coord of rotation axis
+     * @param axisY y-coord of rotation axis
+     * @param axisZ z-coord of rotation axis
+     * @return this quaternion for chaining.
+     */
+    public Quaternion rotateByAngleNormalAxis(final float angle, final float axisX, final float axisY, final float axisZ) {
+        if( VectorUtil.isZero(axisX, axisY, axisZ, FloatUtil.EPSILON) ) {
+            // no change
+            return this;
+        }
+        final float halfAngle = 0.5f * angle;
+        final float sin = FloatUtil.sin(halfAngle);
+        final float qw = FloatUtil.cos(halfAngle);
+        final float qx = sin * axisX;
+        final float qy = sin * axisY;
+        final float qz = sin * axisZ;
+        return set( x * qw + y * qz - z * qy + w * qx,
+                   -x * qz + y * qw + z * qx + w * qy,
+                    x * qy - y * qx + z * qw + w * qz,
+                   -x * qx - y * qy - z * qz + w * qw);
+    }
 
-        w = w1;
-        x = x1;
-        y = y1;
-        z = z1;
+    /**
+     * Rotate this quaternion around X axis with the given angle in radians
+     *
+     * @param angle in radians
+     * @return this quaternion for chaining.
+     */
+    public Quaternion rotateByAngleX(final float angle) {
+        final float halfAngle = 0.5f * angle;
+        final float sin = FloatUtil.sin(halfAngle);
+        final float cos = FloatUtil.cos(halfAngle);
+        return set( x * cos + w * sin,
+                    y * cos + z * sin,
+                   -y * sin + z * cos,
+                   -x * sin + w * cos);
     }
 
     /**
-     * Multiply a quaternion by a constant
+     * Rotate this quaternion around Y axis with the given angle in radians
      *
-     * @param n a float constant
+     * @param angle in radians
+     * @return this quaternion for chaining.
      */
-    public void mult(float n) {
-        x *= n;
-        y *= n;
-        z *= n;
+    public Quaternion rotateByAngleY(final float angle) {
+        final float halfAngle = 0.5f * angle;
+        final float sin = FloatUtil.sin(halfAngle);
+        final float cos = FloatUtil.cos(halfAngle);
+        return set( x * cos - z * sin,
+                    y * cos + w * sin,
+                    x * sin + z * cos,
+                   -y * sin + w * cos);
+    }
+
+    /**
+     * Rotate this quaternion around Z axis with the given angle in radians
+     *
+     * @param angle in radians
+     * @return this quaternion for chaining.
+     */
+    public Quaternion rotateByAngleZ(final float angle) {
+        final float halfAngle = 0.5f * angle;
+        final float sin = FloatUtil.sin(halfAngle);
+        final float cos = FloatUtil.cos(halfAngle);
+        return set( x * cos + y * sin,
+                   -x * sin + y * cos,
+                    z * cos + w * sin,
+                   -z * sin + w * cos);
+    }
+
+    /**
+     * Rotates this quaternion from the given Euler rotation array <code>angradXYZ</code> in radians.
+     * <p>
+     * The <code>angradXYZ</code> array is laid out in natural order:
+     * <ul>
+     *  <li>x - bank</li>
+     *  <li>y - heading</li>
+     *  <li>z - attitude</li>
+     * </ul>
+     * </p>
+     * For details see {@link #rotateByEuler(float, float, float)}.
+     * @param angradXYZ euler angel array in radians
+     * @return this quaternion for chaining.
+     * @see #rotateByEuler(float, float, float)
+     */
+    public final Quaternion rotateByEuler(final float[] angradXYZ) {
+        return rotateByEuler(angradXYZ[0], angradXYZ[1], angradXYZ[2]);
+    }
+
+    /**
+     * Rotates this quaternion from the given Euler rotation angles in radians.
+     * <p>
+     * The rotations are applied in the given order and using chained rotation per axis:
+     * <ul>
+     *  <li>y - heading  - {@link #rotateByAngleY(float)}</li>
+     *  <li>z - attitude - {@link #rotateByAngleZ(float)}</li>
+     *  <li>x - bank     - {@link #rotateByAngleX(float)}</li>
+     * </ul>
+     * </p>
+     * <p>
+     * Implementation Details:
+     * <ul>
+     *   <li> NOP if all angles are {@link FloatUtil#isZero(float, float) is zero} using {@link FloatUtil#EPSILON epsilon}</li>
+     *   <li> result is {@link #normalize()}ed</li>
+     * </ul>
+     * </p>
+     * @param bankX the Euler pitch angle in radians. (rotation about the X axis)
+     * @param headingY the Euler yaw angle in radians. (rotation about the Y axis)
+     * @param attitudeZ the Euler roll angle in radians. (rotation about the Z axis)
+     * @return this quaternion for chaining.
+     * @see #rotateByAngleY(float)
+     * @see #rotateByAngleZ(float)
+     * @see #rotateByAngleX(float)
+     * @see #setFromEuler(float, float, float)
+     */
+    public final Quaternion rotateByEuler(final float bankX, final float headingY, final float attitudeZ) {
+        if ( VectorUtil.isZero(bankX, headingY, attitudeZ, FloatUtil.EPSILON) ) {
+            return this;
+        } else {
+            // setFromEuler muls: ( 8 + 4 ) , + quat muls 24 = 36
+            // this:  8  + 8 + 8 + 4 = 28 muls
+            return rotateByAngleY(headingY).rotateByAngleZ(attitudeZ).rotateByAngleX(bankX).normalize();
+        }
     }
 
     /***
-     * Rotate given vector by this quaternion
+     * Rotate the given vector by this quaternion
      *
-     * @param vector input vector
-     * @return rotated vector
-     */
-    public float[] mult(float[] vector) {
-        // TODO : optimize
-        final float[] res = new float[3];
-        final Quaternion a = new Quaternion(vector[0], vector[1], vector[2], 0.0f);
-        final Quaternion b = new Quaternion(this);
-        final Quaternion c = new Quaternion(this);
-        b.inverse();
-        a.mult(b);
-        c.mult(a);
-        res[0] = c.x;
-        res[1] = c.y;
-        res[2] = c.z;
-        return res;
-    }
-
-    /**
-     * Normalize a quaternion required if to be used as a rotational quaternion
-     */
-    public void normalize() {
-        final float norme = (float) FloatUtil.sqrt(w * w + x * x + y * y + z * z);
-        if (norme == 0.0f) {
-            setIdentity();
+     * @param vecOut result float[3] storage for rotated vector, maybe equal to vecIn for in-place rotation
+     * @param vecOutOffset offset in result storage
+     * @param vecIn float[3] vector to be rotated
+     * @param vecInOffset offset in vecIn
+     * @return the given vecOut store for chaining
+     * @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q63">Matrix-FAQ Q63</a>
+     */
+    public final float[] rotateVector(final float[] vecOut, final int vecOutOffset, final float[] vecIn, final int vecInOffset) {
+        if ( VectorUtil.isVec3Zero(vecIn, vecInOffset, FloatUtil.EPSILON) ) {
+            vecOut[0+vecOutOffset] = 0f;
+            vecOut[1+vecOutOffset] = 0f;
+            vecOut[2+vecOutOffset] = 0f;
         } else {
-            final float recip = 1.0f / norme;
+            final float vecX = vecIn[0+vecInOffset];
+            final float vecY = vecIn[1+vecInOffset];
+            final float vecZ = vecIn[2+vecInOffset];
+            final float x_x = x*x;
+            final float y_y = y*y;
+            final float z_z = z*z;
+            final float w_w = w*w;
+
+            vecOut[0+vecOutOffset] =   w_w * vecX
+                                     + x_x * vecX
+                                     - z_z * vecX
+                                     - y_y * vecX
+                                     + 2f * ( y*w*vecZ - z*w*vecY + y*x*vecY + z*x*vecZ );
+                                     ;
+
+            vecOut[1+vecOutOffset] =   y_y * vecY
+                                     - z_z * vecY
+                                     + w_w * vecY
+                                     - x_x * vecY
+                                     + 2f * ( x*y*vecX + z*y*vecZ + w*z*vecX - x*w*vecZ );
+                                     ;
 
-            w *= recip;
-            x *= recip;
-            y *= recip;
-            z *= recip;
+            vecOut[2+vecOutOffset] =   z_z * vecZ
+                                     - y_y * vecZ
+                                     - x_x * vecZ
+                                     + w_w * vecZ
+                                     + 2f * ( x*z*vecX + y*z*vecY - w*y*vecX + w*x*vecY );
+                                     ;
         }
+        return vecOut;
     }
 
     /**
-     * Invert the quaternion If rotational, will produce a the inverse rotation
+     * Set this quaternion to a spherical linear interpolation
+     * between the given start and end quaternions by the given change amount.
+     * <p>
+     * Note: Method <i>does not</i> normalize this quaternion!
+     * </p>
+     *
+     * @param a start quaternion
+     * @param b end  quaternion
+     * @param changeAmnt float between 0 and 1 representing interpolation.
+     * @return this quaternion for chaining.
+     * @see <a href="http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/quaternions/slerp/">euclideanspace.com-QuaternionSlerp</a>
      */
-    public void inverse() {
-        final float norm = w * w + x * x + y * y + z * z;
+    public final Quaternion setSlerp(final Quaternion a, final Quaternion b, final float changeAmnt) {
+        // System.err.println("Slerp.0: A "+a+", B "+b+", t "+changeAmnt);
+        if (changeAmnt == 0.0f) {
+            set(a);
+        } else if (changeAmnt == 1.0f) {
+            set(b);
+        } else {
+            float bx = b.x;
+            float by = b.y;
+            float bz = b.z;
+            float bw = b.w;
+
+            // Calculate angle between them (quat dot product)
+            float cosHalfTheta = a.x * bx + a.y * by + a.z * bz + a.w * bw;
+
+            final float scale0, scale1;
 
-        final float recip = 1.0f / norm;
+            if( cosHalfTheta >= 0.95f ) {
+                // quaternions are close, just use linear interpolation
+                scale0 = 1.0f - changeAmnt;
+                scale1 = changeAmnt;
+                // System.err.println("Slerp.1: Linear Interpol; cosHalfTheta "+cosHalfTheta);
+            } else if ( cosHalfTheta <= -0.99f ) {
+                // the quaternions are nearly opposite,
+                // we can pick any axis normal to a,b to do the rotation
+                scale0 = 0.5f;
+                scale1 = 0.5f;
+                // System.err.println("Slerp.2: Any; cosHalfTheta "+cosHalfTheta);
+            } else {
+                // System.err.println("Slerp.3: cosHalfTheta "+cosHalfTheta);
+                if( cosHalfTheta <= -FloatUtil.EPSILON ) { // FIXME: .. or shall we use the upper bound 'cosHalfTheta < FloatUtil.EPSILON' ?
+                    // Negate the second quaternion and the result of the dot product (Inversion)
+                    bx *= -1f;
+                    by *= -1f;
+                    bz *= -1f;
+                    bw *= -1f;
+                    cosHalfTheta *= -1f;
+                    // System.err.println("Slerp.4: Inverted cosHalfTheta "+cosHalfTheta);
+                }
+                final float halfTheta = FloatUtil.acos(cosHalfTheta);
+                final float sinHalfTheta = FloatUtil.sqrt(1.0f - cosHalfTheta*cosHalfTheta);
+                // if theta = 180 degrees then result is not fully defined
+                // we could rotate around any axis normal to qa or qb
+                if ( Math.abs(sinHalfTheta) < 0.001f ){ // fabs is floating point absolute
+                    scale0 = 0.5f;
+                    scale1 = 0.5f;
+                    // throw new InternalError("XXX"); // FIXME should not be reached due to above inversion ?
+                } else {
+                    // Calculate the scale for q1 and q2, according to the angle and
+                    // it's sine value
+                    scale0 = FloatUtil.sin((1f - changeAmnt) * halfTheta) / sinHalfTheta;
+                    scale1 = FloatUtil.sin(changeAmnt * halfTheta) / sinHalfTheta;
+                }
+            }
 
-        w *= recip;
-        x = -1 * x * recip;
-        y = -1 * y * recip;
-        z = -1 * z * recip;
+            x = a.x * scale0 + bx * scale1;
+            y = a.y * scale0 + by * scale1;
+            z = a.z * scale0 + bz * scale1;
+            w = a.w * scale0 + bw * scale1;
+        }
+        // System.err.println("Slerp.X: Result "+this);
+        return this;
     }
 
     /**
-     * Transform this quaternion to a 4x4 column matrix representing the
-     * rotation
-     *
-     * @return new float[16] column matrix 4x4
-     */
-    public float[] toMatrix() {
-        final float[] matrix = new float[16];
-        matrix[0] = 1.0f - 2 * y * y - 2 * z * z;
-        matrix[1] = 2 * x * y + 2 * w * z;
-        matrix[2] = 2 * x * z - 2 * w * y;
-        matrix[3] = 0;
-
-        matrix[4] = 2 * x * y - 2 * w * z;
-        matrix[5] = 1.0f - 2 * x * x - 2 * z * z;
-        matrix[6] = 2 * y * z + 2 * w * x;
-        matrix[7] = 0;
-
-        matrix[8] = 2 * x * z + 2 * w * y;
-        matrix[9] = 2 * y * z - 2 * w * x;
-        matrix[10] = 1.0f - 2 * x * x - 2 * y * y;
-        matrix[11] = 0;
-
-        matrix[12] = 0;
-        matrix[13] = 0;
-        matrix[14] = 0;
-        matrix[15] = 1;
-        return matrix;
+     * Set this quaternion to equal the rotation required
+     * to point the z-axis at <i>direction</i> and the y-axis to <i>up</i>.
+     * <p>
+     * Implementation generates a 3x3 matrix
+     * and is equal with ProjectFloat's lookAt(..).<br/>
+     * </p>
+     * Implementation Details:
+     * <ul>
+     *   <li> result is {@link #normalize()}ed</li>
+     * </ul>
+     * </p>
+     * @param directionIn where to <i>look</i> at
+     * @param upIn a vector indicating the local <i>up</i> direction.
+     * @param xAxisOut vector storing the <i>orthogonal</i> x-axis of the coordinate system.
+     * @param yAxisOut vector storing the <i>orthogonal</i> y-axis of the coordinate system.
+     * @param zAxisOut vector storing the <i>orthogonal</i> z-axis of the coordinate system.
+     * @return this quaternion for chaining.
+     * @see <a href="http://www.euclideanspace.com/maths/algebra/vectors/lookat/index.htm">euclideanspace.com-LookUp</a>
+     */
+    public Quaternion setLookAt(final float[] directionIn, final float[] upIn,
+                                final float[] xAxisOut, final float[] yAxisOut, final float[] zAxisOut) {
+        // Z = norm(dir)
+        VectorUtil.normalizeVec3(zAxisOut, directionIn);
+
+        // X = upIn x Z
+        //     (borrow yAxisOut for upNorm)
+        VectorUtil.normalizeVec3(yAxisOut, upIn);
+        VectorUtil.crossVec3(xAxisOut, yAxisOut, zAxisOut);
+        VectorUtil.normalizeVec3(xAxisOut);
+
+        // Y = Z x X
+        //
+        VectorUtil.crossVec3(yAxisOut, zAxisOut, xAxisOut);
+        VectorUtil.normalizeVec3(yAxisOut);
+
+        /**
+            final float m00 = xAxisOut[0];
+            final float m01 = yAxisOut[0];
+            final float m02 = zAxisOut[0];
+            final float m10 = xAxisOut[1];
+            final float m11 = yAxisOut[1];
+            final float m12 = zAxisOut[1];
+            final float m20 = xAxisOut[2];
+            final float m21 = yAxisOut[2];
+            final float m22 = zAxisOut[2];
+         */
+        return setFromAxes(xAxisOut, yAxisOut, zAxisOut).normalize();
     }
 
+    //
+    // Conversions
+    //
+
     /**
-     * Set this quaternion from a Sphereical interpolation of two param
-     * quaternion, used mostly for rotational animation.
+     * Initialize this quaternion from two vectors
+     * <pre>
+     *   q = (s,v) = (v1•v2 , v1 × v2),
+     *     angle = angle(v1, v2) = v1•v2
+     *      axis = normal(v1 x v2)
+     * </pre>
      * <p>
-     * Note: Method does not normalize this quaternion!
+     * Implementation Details:
+     * <ul>
+     *   <li> {@link #setIdentity()} if square vector-length is {@link FloatUtil#isZero(float, float) is zero} using {@link FloatUtil#EPSILON epsilon}</li>
+     * </ul>
      * </p>
+     * @param v1 not normalized
+     * @param v2 not normalized
+     * @param tmpPivotVec float[3] temp storage for cross product
+     * @param tmpNormalVec float[3] temp storage to normalize vector
+     * @return this quaternion for chaining.
+     */
+    public final Quaternion setFromVectors(final float[] v1, final float[] v2, final float[] tmpPivotVec, final float[] tmpNormalVec) {
+        final float factor = VectorUtil.normVec3(v1) * VectorUtil.normVec3(v2);
+        if ( FloatUtil.isZero(factor, FloatUtil.EPSILON ) ) {
+            return setIdentity();
+        } else {
+            final float dot = VectorUtil.dotVec3(v1, v2) / factor; // normalize
+            final float theta = FloatUtil.acos(Math.max(-1.0f, Math.min(dot, 1.0f))); // clipping [-1..1]
+
+            VectorUtil.crossVec3(tmpPivotVec, v1, v2);
+
+            if ( dot < 0.0f && FloatUtil.isZero( VectorUtil.normVec3(tmpPivotVec), FloatUtil.EPSILON ) ) {
+                // Vectors parallel and opposite direction, therefore a rotation of 180 degrees about any vector
+                // perpendicular to this vector will rotate vector a onto vector b.
+                //
+                // The following guarantees the dot-product will be 0.0.
+                int dominantIndex;
+                if (Math.abs(v1[0]) > Math.abs(v1[1])) {
+                    if (Math.abs(v1[0]) > Math.abs(v1[2])) {
+                        dominantIndex = 0;
+                    } else {
+                        dominantIndex = 2;
+                    }
+                } else {
+                    if (Math.abs(v1[1]) > Math.abs(v1[2])) {
+                        dominantIndex = 1;
+                    } else {
+                        dominantIndex = 2;
+                    }
+                }
+                tmpPivotVec[dominantIndex]           = -v1[(dominantIndex + 1) % 3];
+                tmpPivotVec[(dominantIndex + 1) % 3] =  v1[dominantIndex];
+                tmpPivotVec[(dominantIndex + 2) % 3] =  0f;
+            }
+            return setFromAngleAxis(theta, tmpPivotVec, tmpNormalVec);
+        }
+    }
+
+    /**
+     * Initialize this quaternion from two normalized vectors
+     * <pre>
+     *   q = (s,v) = (v1•v2 , v1 × v2),
+     *     angle = angle(v1, v2) = v1•v2
+     *      axis = v1 x v2
+     * </pre>
      * <p>
-     * See http://www.euclideanspace.com/maths/algebra/realNormedAlgebra/
-     * quaternions/slerp/
+     * Implementation Details:
+     * <ul>
+     *   <li> {@link #setIdentity()} if square vector-length is {@link FloatUtil#isZero(float, float) is zero} using {@link FloatUtil#EPSILON epsilon}</li>
+     * </ul>
      * </p>
+     * @param v1 normalized
+     * @param v2 normalized
+     * @param tmpPivotVec float[3] temp storage for cross product
+     * @return this quaternion for chaining.
+     */
+    public final Quaternion setFromNormalVectors(final float[] v1, final float[] v2, final float[] tmpPivotVec) {
+        final float factor = VectorUtil.normVec3(v1) * VectorUtil.normVec3(v2);
+        if ( FloatUtil.isZero(factor, FloatUtil.EPSILON ) ) {
+            return setIdentity();
+        } else {
+            final float dot = VectorUtil.dotVec3(v1, v2) / factor; // normalize
+            final float theta = FloatUtil.acos(Math.max(-1.0f, Math.min(dot, 1.0f))); // clipping [-1..1]
+
+            VectorUtil.crossVec3(tmpPivotVec, v1, v2);
+
+            if ( dot < 0.0f && FloatUtil.isZero( VectorUtil.normVec3(tmpPivotVec), FloatUtil.EPSILON ) ) {
+                // Vectors parallel and opposite direction, therefore a rotation of 180 degrees about any vector
+                // perpendicular to this vector will rotate vector a onto vector b.
+                //
+                // The following guarantees the dot-product will be 0.0.
+                int dominantIndex;
+                if (Math.abs(v1[0]) > Math.abs(v1[1])) {
+                    if (Math.abs(v1[0]) > Math.abs(v1[2])) {
+                        dominantIndex = 0;
+                    } else {
+                        dominantIndex = 2;
+                    }
+                } else {
+                    if (Math.abs(v1[1]) > Math.abs(v1[2])) {
+                        dominantIndex = 1;
+                    } else {
+                        dominantIndex = 2;
+                    }
+                }
+                tmpPivotVec[dominantIndex]           = -v1[(dominantIndex + 1) % 3];
+                tmpPivotVec[(dominantIndex + 1) % 3] =  v1[dominantIndex];
+                tmpPivotVec[(dominantIndex + 2) % 3] =  0f;
+            }
+            return setFromAngleNormalAxis(theta, tmpPivotVec);
+        }
+    }
+
+    /***
+     * Initialize this quaternion with given non-normalized axis vector and rotation angle
+     * <p>
+     * Implementation Details:
+     * <ul>
+     *   <li> {@link #setIdentity()} if axis is {@link FloatUtil#isZero(float, float) is zero} using {@link FloatUtil#EPSILON epsilon}</li>
+     * </ul>
+     * </p>
+     * @param angle rotation angle (rads)
+     * @param vector axis vector not normalized
+     * @param tmpV3f float[3] temp storage to normalize vector
+     * @return this quaternion for chaining.
      *
-     * @param a initial quaternion
-     * @param b target quaternion
-     * @param t float between 0 and 1 representing interp.
-     */
-    public void slerp(Quaternion a, Quaternion b, float t) {
-        final float cosom = a.x * b.x + a.y * b.y + a.z * b.z + a.w * b.w;
-        final float t1 = 1.0f - t;
-
-        // if the two quaternions are close, just use linear interpolation
-        if (cosom >= 0.95f) {
-            x = a.x * t1 + b.x * t;
-            y = a.y * t1 + b.y * t;
-            z = a.z * t1 + b.z * t;
-            w = a.w * t1 + b.w * t;
-            return;
+     * @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q56">Matrix-FAQ Q56</a>
+     * @see #toAngleAxis(float[])
+     */
+    public final Quaternion setFromAngleAxis(final float angle, final float[] vector, final float[] tmpV3f) {
+        VectorUtil.normalizeVec3(tmpV3f, vector);
+        return setFromAngleNormalAxis(angle, tmpV3f);
+    }
+
+    /***
+     * Initialize this quaternion with given normalized axis vector and rotation angle
+     * <p>
+     * Implementation Details:
+     * <ul>
+     *   <li> {@link #setIdentity()} if axis is {@link FloatUtil#isZero(float, float) is zero} using {@link FloatUtil#EPSILON epsilon}</li>
+     * </ul>
+     * </p>
+     * @param angle rotation angle (rads)
+     * @param vector axis vector normalized
+     * @return this quaternion for chaining.
+     *
+     * @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q56">Matrix-FAQ Q56</a>
+     * @see #toAngleAxis(float[])
+     */
+    public final Quaternion setFromAngleNormalAxis(final float angle, final float[] vector) {
+        if ( VectorUtil.isVec3Zero(vector, 0, FloatUtil.EPSILON) ) {
+            setIdentity();
+        } else {
+            final float halfangle = angle * 0.5f;
+            final float sin = FloatUtil.sin(halfangle);
+            x = vector[0] * sin;
+            y = vector[1] * sin;
+            z = vector[2] * sin;
+            w = FloatUtil.cos(halfangle);
         }
+        return this;
+    }
 
-        // the quaternions are nearly opposite, we can pick any axis normal to
-        // a,b
-        // to do the rotation
-        if (cosom <= -0.99f) {
-            x = 0.5f * (a.x + b.x);
-            y = 0.5f * (a.y + b.y);
-            z = 0.5f * (a.z + b.z);
-            w = 0.5f * (a.w + b.w);
-            return;
+    /**
+     * Transform the rotational quaternion to axis based rotation angles
+     *
+     * @param axis float[3] storage for computed axis
+     * @return the rotation angle in radians
+     * @see #setFromAngleAxis(float, float[], float[])
+     */
+    public final float toAngleAxis(final float[] axis) {
+        final float sqrLength = x*x + y*y + z*z;
+        float angle;
+        if ( FloatUtil.isZero(sqrLength, FloatUtil.EPSILON) ) { // length is ~0
+            angle = 0.0f;
+            axis[0] = 1.0f;
+            axis[1] = 0.0f;
+            axis[2] = 0.0f;
+        } else {
+            angle = FloatUtil.acos(w) * 2.0f;
+            final float invLength = 1.0f / FloatUtil.sqrt(sqrLength);
+            axis[0] = x * invLength;
+            axis[1] = y * invLength;
+            axis[2] = z * invLength;
         }
+        return angle;
+    }
+
+    /**
+     * Initializes this quaternion from the given Euler rotation array <code>angradXYZ</code> in radians.
+     * <p>
+     * The <code>angradXYZ</code> array is laid out in natural order:
+     * <ul>
+     *  <li>x - bank</li>
+     *  <li>y - heading</li>
+     *  <li>z - attitude</li>
+     * </ul>
+     * </p>
+     * For details see {@link #setFromEuler(float, float, float)}.
+     * @param angradXYZ euler angel array in radians
+     * @return this quaternion for chaining.
+     * @see #setFromEuler(float, float, float)
+     */
+    public final Quaternion setFromEuler(final float[] angradXYZ) {
+        return setFromEuler(angradXYZ[0], angradXYZ[1], angradXYZ[2]);
+    }
+
+    /**
+     * Initializes this quaternion from the given Euler rotation angles in radians.
+     * <p>
+     * The rotations are applied in the given order:
+     * <ul>
+     *  <li>y - heading</li>
+     *  <li>z - attitude</li>
+     *  <li>x - bank</li>
+     * </ul>
+     * </p>
+     * <p>
+     * Implementation Details:
+     * <ul>
+     *   <li> {@link #setIdentity()} if all angles are {@link FloatUtil#isZero(float, float) is zero} using {@link FloatUtil#EPSILON epsilon}</li>
+     *   <li> result is {@link #normalize()}ed</li>
+     * </ul>
+     * </p>
+     * @param bankX the Euler pitch angle in radians. (rotation about the X axis)
+     * @param headingY the Euler yaw angle in radians. (rotation about the Y axis)
+     * @param attitudeZ the Euler roll angle in radians. (rotation about the Z axis)
+     * @return this quaternion for chaining.
+     *
+     * @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q60">Matrix-FAQ Q60</a>
+     * @see <a href="http://vered.rose.utoronto.ca/people/david_dir/GEMS/GEMS.html">Gems</a>
+     * @see <a href="http://www.euclideanspace.com/maths/geometry/rotations/conversions/eulerToQuaternion/index.htm">euclideanspace.com-eulerToQuaternion</a>
+     * @see #toEuler(float[])
+     */
+    public final Quaternion setFromEuler(final float bankX, final float headingY, final float attitudeZ) {
+        if ( VectorUtil.isZero(bankX, headingY, attitudeZ, FloatUtil.EPSILON) ) {
+            return setIdentity();
+        } else {
+            float angle = headingY * 0.5f;
+            final float sinHeadingY = FloatUtil.sin(angle);
+            final float cosHeadingY = FloatUtil.cos(angle);
+            angle = attitudeZ * 0.5f;
+            final float sinAttitudeZ = FloatUtil.sin(angle);
+            final float cosAttitudeZ = FloatUtil.cos(angle);
+            angle = bankX * 0.5f;
+            final float sinBankX = FloatUtil.sin(angle);
+            final float cosBankX = FloatUtil.cos(angle);
 
-        // cosom is now withion range of acos, do a SLERP
-        final float sinom = FloatUtil.sqrt(1.0f - cosom * cosom);
-        final float omega = FloatUtil.acos(cosom);
+            // variables used to reduce multiplication calls.
+            final float cosHeadingXcosAttitude = cosHeadingY * cosAttitudeZ;
+            final float sinHeadingXsinAttitude = sinHeadingY * sinAttitudeZ;
+            final float cosHeadingXsinAttitude = cosHeadingY * sinAttitudeZ;
+            final float sinHeadingXcosAttitude = sinHeadingY * cosAttitudeZ;
 
-        final float scla = FloatUtil.sin(t1 * omega) / sinom;
-        final float sclb = FloatUtil.sin(t * omega) / sinom;
+            w = cosHeadingXcosAttitude * cosBankX - sinHeadingXsinAttitude * sinBankX;
+            x = cosHeadingXcosAttitude * sinBankX + sinHeadingXsinAttitude * cosBankX;
+            y = sinHeadingXcosAttitude * cosBankX + cosHeadingXsinAttitude * sinBankX;
+            z = cosHeadingXsinAttitude * cosBankX - sinHeadingXcosAttitude * sinBankX;
+            return normalize();
+        }
+    }
 
-        x = a.x * scla + b.x * sclb;
-        y = a.y * scla + b.y * sclb;
-        z = a.z * scla + b.z * sclb;
-        w = a.w * scla + b.w * sclb;
+    /**
+     * Transform this quaternion to Euler rotation angles in radians (pitchX, yawY and rollZ).
+     *
+     * @param result the float[] array storing the computed angles.
+     * @return the double[] array, filled with heading, attitude and bank in that order..
+     * @see <a href="http://www.euclideanspace.com/maths/geometry/rotations/conversions/quaternionToEuler/index.htm">euclideanspace.com-quaternionToEuler</a>
+     * @see #setFromEuler(float, float, float)
+     */
+    public float[] toEuler(final float[] result) {
+        final float sqw = w*w;
+        final float sqx = x*x;
+        final float sqy = y*y;
+        final float sqz = z*z;
+        final float unit = sqx + sqy + sqz + sqw; // if normalized is one, otherwise
+        // is correction factor
+        final float test = x*y + z*w;
+
+        if (test > 0.499f * unit) { // singularity at north pole
+            result[0] =  0f;
+            result[1] =  2f * FloatUtil.atan2(x, w);
+            result[2] =  FloatUtil.HALF_PI;
+        } else if (test < -0.499f * unit) { // singularity at south pole
+            result[0] =  0f;
+            result[1] = -2 * FloatUtil.atan2(x, w);
+            result[2] = -FloatUtil.HALF_PI;
+        } else {
+            result[0] = FloatUtil.atan2(2f * x * w - 2 * y * z, -sqx + sqy - sqz + sqw);
+            result[1] = FloatUtil.atan2(2f * y * w - 2 * x * z,  sqx - sqy - sqz + sqw);
+            result[2] = FloatUtil.asin( 2f * test / unit);
+        }
+        return result;
     }
 
     /**
-     * Check if this quaternion represents an identity matrix for rotation,
-     * , ie (0,0,0,1).
+     * Initializes this quaternion from a 4x4 column rotation matrix
+     * <p>
+     * See <a href="ftp://ftp.cis.upenn.edu/pub/graphics/shoemake/quatut.ps.Z">Graphics Gems Code</a>,<br/>
+     * <a href="http://mathworld.wolfram.com/MatrixTrace.html">MatrixTrace</a>.
+     * </p>
+     * <p>
+     * Buggy <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q55">Matrix-FAQ Q55</a>
+     * </p>
      *
-     * @return true if it is an identity rep., false otherwise
+     * @param m 4x4 column matrix
+     * @return this quaternion for chaining.
+     * @see #toMatrix(float[], int)
      */
-    public boolean isIdentity() {
-        return w == 1 && x == 0 && y == 0 && z == 0;
+    public final Quaternion setFromMatrix(final float[] m, final int m_off) {
+        return setFromMatrix(m[0+0*4+m_off], m[0+1*4+m_off], m[0+2*4+m_off],
+                             m[1+0*4+m_off], m[1+1*4+m_off], m[1+2*4+m_off],
+                             m[2+0*4+m_off], m[2+1*4+m_off], m[2+2*4+m_off]);
     }
 
-    /***
-     * Set this quaternion to identity (x=0,y=0,z=0,w=1)
+    /**
+     * Compute the quaternion from a 3x3 column rotation matrix
+     * <p>
+     * See <a href="ftp://ftp.cis.upenn.edu/pub/graphics/shoemake/quatut.ps.Z">Graphics Gems Code</a>,<br/>
+     * <a href="http://mathworld.wolfram.com/MatrixTrace.html">MatrixTrace</a>.
+     * </p>
+     * <p>
+     * Buggy <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q55">Matrix-FAQ Q55</a>
+     * </p>
+     *
+     * @return this quaternion for chaining.
+     * @see #toMatrix(float[], int)
      */
-    public void setIdentity() {
-        x = y = z = 0;
-        w = 1;
+    public Quaternion setFromMatrix(final float m00, final float m01, final float m02,
+                                    final float m10, final float m11, final float m12,
+                                    final float m20, final float m21, final float m22) {
+        // Note: Other implementations uses 'T' w/o '+1f' and compares 'T >= 0' while adding missing 1f in sqrt expr.
+        //       However .. this causes setLookAt(..) to fail and actually violates the 'trace definition'.
+
+        // The trace T is the sum of the diagonal elements; see
+        // http://mathworld.wolfram.com/MatrixTrace.html
+        final float T = m00 + m11 + m22 + 1f;
+        // System.err.println("setFromMatrix.0 T "+T+", m00 "+m00+", m11 "+m11+", m22 "+m22);
+        if ( T > 0f ) {
+            // System.err.println("setFromMatrix.1");
+            final float S = 0.5f / FloatUtil.sqrt(T);  // S = 1 / ( 2 t )
+            w = 0.25f / S;                             // w = 1 / ( 4 S ) = t / 2
+            x = ( m21 - m12 ) * S;
+            y = ( m02 - m20 ) * S;
+            z = ( m10 - m01 ) * S;
+        } else if ( m00 > m11 && m00 > m22) {
+            // System.err.println("setFromMatrix.2");
+            final float S = 0.5f / FloatUtil.sqrt(1.0f + m00 - m11 - m22); // S=4*qx
+            w = ( m21 - m12 ) * S;
+            x = 0.25f / S;
+            y = ( m10 + m01 ) * S;
+            z = ( m02 + m20 ) * S;
+        } else if ( m11 > m22 ) {
+            // System.err.println("setFromMatrix.3");
+            final float S = 0.5f / FloatUtil.sqrt(1.0f + m11 - m00 - m22); // S=4*qy
+            w = ( m02 - m20 ) * S;
+            x = ( m20 + m01 ) * S;
+            y = 0.25f / S;
+            z = ( m21 + m12 ) * S;
+        } else {
+            // System.err.println("setFromMatrix.3");
+            final float S = 0.5f / FloatUtil.sqrt(1.0f + m22 - m00 - m11); // S=4*qz
+            w = ( m10 - m01 ) * S;
+            x = ( m02 + m20 ) * S;
+            y = ( m21 + m12 ) * S;
+            z = 0.25f / S;
+        }
+        return this;
     }
 
     /**
-     * compute the quaternion from a 3x3 column matrix
+     * Transform this quaternion to a normalized 4x4 column matrix representing the rotation.
+     * <p>
+     * Implementation Details:
+     * <ul>
+     *   <li> makes identity matrix if {@link #magnitudeSquared()} is {@link FloatUtil#isZero(float, float) is zero} using {@link FloatUtil#EPSILON epsilon}</li>
+     * </ul>
+     * </p>
      *
-     * @param m 3x3 column matrix
+     * @param matrix float[16] store for the resulting normalized column matrix 4x4
+     * @param mat_offset
+     * @return the given matrix store
+     * @see <a href="http://web.archive.org/web/20041029003853/http://www.j3d.org/matrix_faq/matrfaq_latest.html#Q54">Matrix-FAQ Q54</a>
+     * @see #setFromMatrix(float[], int)
      */
-    public void setFromMatrix(float[] m) {
-        final float T = m[0] + m[4] + m[8] + 1;
-        if (T > 0) {
-            final float S = 0.5f / (float) FloatUtil.sqrt(T);
-            w = 0.25f / S;
-            x = (m[5] - m[7]) * S;
-            y = (m[6] - m[2]) * S;
-            z = (m[1] - m[3]) * S;
+    public final float[] toMatrix(final float[] matrix, final int mat_offset) {
+        // pre-multiply scaled-reciprocal-magnitude to reduce multiplications
+        final float norm = magnitudeSquared();
+        if ( FloatUtil.isZero(norm, FloatUtil.EPSILON) ) {
+            // identity matrix -> srecip = 0f
+            return FloatUtil.makeIdentity(matrix, mat_offset);
+        }
+        final float srecip;
+        if ( FloatUtil.isEqual(1f, norm, FloatUtil.EPSILON) ) {
+            srecip = 2f;
         } else {
-            if ((m[0] > m[4]) && (m[0] > m[8])) {
-                final float S = FloatUtil.sqrt(1.0f + m[0] - m[4] - m[8]) * 2f; // S=4*qx
-                w = (m[7] - m[5]) / S;
-                x = 0.25f * S;
-                y = (m[3] + m[1]) / S;
-                z = (m[6] + m[2]) / S;
-            } else if (m[4] > m[8]) {
-                final float S = FloatUtil.sqrt(1.0f + m[4] - m[0] - m[8]) * 2f; // S=4*qy
-                w = (m[6] - m[2]) / S;
-                x = (m[3] + m[1]) / S;
-                y = 0.25f * S;
-                z = (m[7] + m[5]) / S;
-            } else {
-                final float S = FloatUtil.sqrt(1.0f + m[8] - m[0] - m[4]) * 2f; // S=4*qz
-                w = (m[3] - m[1]) / S;
-                x = (m[6] + m[2]) / S;
-                y = (m[7] + m[5]) / S;
-                z = 0.25f * S;
-            }
+            srecip = 2.0f / norm;
         }
+
+        final float xs = srecip * x;
+        final float ys = srecip * y;
+        final float zs = srecip * z;
+
+        final float xx = x  * xs;
+        final float xy = x  * ys;
+        final float xz = x  * zs;
+        final float xw = xs * w;
+        final float yy = y  * ys;
+        final float yz = y  * zs;
+        final float yw = ys * w;
+        final float zz = z  * zs;
+        final float zw = zs * w;
+
+        matrix[0+0*4+mat_offset]  = 1f - ( yy + zz );
+        matrix[0+1*4+mat_offset]  =      ( xy - zw );
+        matrix[0+2*4+mat_offset]  =      ( xz + yw );
+        matrix[0+3*4+mat_offset]  = 0f;
+
+        matrix[1+0*4+mat_offset]  =      ( xy + zw );
+        matrix[1+1*4+mat_offset]  = 1f - ( xx + zz );
+        matrix[1+2*4+mat_offset]  =      ( yz - xw );
+        matrix[1+3*4+mat_offset]  = 0f;
+
+        matrix[2+0*4+mat_offset]  =      ( xz - yw );
+        matrix[2+1*4+mat_offset]  =      ( yz + xw );
+        matrix[2+2*4+mat_offset]  = 1f - ( xx + yy );
+        matrix[2+3*4+mat_offset]  = 0f;
+
+        matrix[3+0*4+mat_offset]  = 0f;
+        matrix[3+1*4+mat_offset]  = 0f;
+        matrix[3+2*4+mat_offset]  = 0f;
+        matrix[3+3*4+mat_offset]  = 1f;
+        return matrix;
+    }
+
+    /**
+     * @param index the 3x3 rotation matrix column to retrieve from this quaternion (normalized). Must be between 0 and 2.
+     * @param result the vector object to store the result in.
+     * @return the result column-vector for chaining.
+     */
+    public float[] copyMatrixColumn(final int index, final float[] result, final int resultOffset) {
+        // pre-multipliy scaled-reciprocal-magnitude to reduce multiplications
+        final float norm = magnitudeSquared();
+        final float srecip;
+        if ( FloatUtil.isZero(norm, FloatUtil.EPSILON) ) {
+            srecip= 0f;
+        } else if ( FloatUtil.isEqual(1f, norm, FloatUtil.EPSILON) ) {
+            srecip= 2f;
+        } else {
+            srecip= 2.0f / norm;
+        }
+
+        // compute xs/ys/zs first to save 6 multiplications, since xs/ys/zs
+        // will be used 2-4 times each.
+        final float xs = x * srecip;
+        final float ys = y * srecip;
+        final float zs = z * srecip;
+        final float xx = x * xs;
+        final float xy = x * ys;
+        final float xz = x * zs;
+        final float xw = w * xs;
+        final float yy = y * ys;
+        final float yz = y * zs;
+        final float yw = w * ys;
+        final float zz = z * zs;
+        final float zw = w * zs;
+
+        // using s=2/norm (instead of 1/norm) saves 3 multiplications by 2 here
+        switch (index) {
+        case 0:
+            result[0+resultOffset] = 1.0f - (yy + zz);
+            result[1+resultOffset] = xy + zw;
+            result[2+resultOffset] = xz - yw;
+            break;
+        case 1:
+            result[0+resultOffset] = xy - zw;
+            result[1+resultOffset] = 1.0f - (xx + zz);
+            result[2+resultOffset] = yz + xw;
+            break;
+        case 2:
+            result[0+resultOffset] = xz + yw;
+            result[1+resultOffset] = yz - xw;
+            result[2+resultOffset] = 1.0f - (xx + yy);
+            break;
+        default:
+            throw new IllegalArgumentException("Invalid column index. " + index);
+        }
+        return result;
+    }
+
+    /**
+     * Initializes this quaternion to represent a rotation formed by the given three <i>orthogonal</i> axes.
+     * <p>
+     * No validation whether the axes are <i>orthogonal</i> is performed.
+     * </p>
+     *
+     * @param xAxis vector representing the <i>orthogonal</i> x-axis of the coordinate system.
+     * @param yAxis vector representing the <i>orthogonal</i> y-axis of the coordinate system.
+     * @param zAxis vector representing the <i>orthogonal</i> z-axis of the coordinate system.
+     * @return this quaternion for chaining.
+     */
+    public final Quaternion setFromAxes(final float[] xAxis, final float[] yAxis, final float[] zAxis) {
+        return setFromMatrix(xAxis[0], yAxis[0], zAxis[0],
+                             xAxis[1], yAxis[1], zAxis[1],
+                             xAxis[2], yAxis[2], zAxis[2]);
+    }
+
+    /**
+     * Extracts this quaternion's <i>orthogonal</i> rotation axes.
+     *
+     * @param xAxis vector representing the <i>orthogonal</i> x-axis of the coordinate system.
+     * @param yAxis vector representing the <i>orthogonal</i> y-axis of the coordinate system.
+     * @param zAxis vector representing the <i>orthogonal</i> z-axis of the coordinate system.
+     * @param tmpMat4 temporary float[4] matrix, used to transform this quaternion to a matrix.
+     */
+    public void toAxes(final float[] xAxis, final float[] yAxis, final float[] zAxis, final float[] tmpMat4) {
+        toMatrix(tmpMat4, 0);
+        FloatUtil.copyMatrixColumn(tmpMat4, 0, 2, zAxis, 0);
+        FloatUtil.copyMatrixColumn(tmpMat4, 0, 1, yAxis, 0);
+        FloatUtil.copyMatrixColumn(tmpMat4, 0, 0, xAxis, 0);
     }
 
     /**
@@ -390,7 +1154,7 @@ public class Quaternion {
      * @param m 3x3 column matrix
      * @return true if representing a rotational matrix, false otherwise
      */
-    public boolean isRotationMatrix(float[] m) {
+    public final boolean isRotationMatrix3f(final float[] m) {
         final float epsilon = 0.01f; // margin to allow for rounding errors
         if (FloatUtil.abs(m[0] * m[3] + m[3] * m[4] + m[6] * m[7]) > epsilon)
             return false;
@@ -404,11 +1168,42 @@ public class Quaternion {
             return false;
         if (FloatUtil.abs(m[2] * m[2] + m[5] * m[5] + m[8] * m[8] - 1) > epsilon)
             return false;
-        return (FloatUtil.abs(determinant(m) - 1) < epsilon);
+        return (FloatUtil.abs(determinant3f(m) - 1) < epsilon);
     }
 
-    private float determinant(float[] m) {
+    private final float determinant3f(final float[] m) {
         return m[0] * m[4] * m[8] + m[3] * m[7] * m[2] + m[6] * m[1] * m[5]
              - m[0] * m[7] * m[5] - m[3] * m[1] * m[8] - m[6] * m[4] * m[2];
     }
+
+    //
+    // std java overrides
+    //
+
+    /**
+     * @param o the object to compare for equality
+     * @return true if this quaternion and the provided quaternion have roughly the same x, y, z and w values.
+     */
+    @Override
+    public boolean equals(final Object o) {
+        if (this == o) {
+            return true;
+        }
+        if (!(o instanceof Quaternion)) {
+            return false;
+        }
+        final Quaternion comp = (Quaternion) o;
+        return Math.abs(x - comp.getX()) <= ALLOWED_DEVIANCE &&
+               Math.abs(y - comp.getY()) <= ALLOWED_DEVIANCE &&
+               Math.abs(z - comp.getZ()) <= ALLOWED_DEVIANCE &&
+               Math.abs(w - comp.getW()) <= ALLOWED_DEVIANCE;
+    }
+    @Override
+    public final int hashCode() {
+        throw new InternalError("hashCode not designed");
+    }
+
+    public String toString() {
+        return "Quaternion[x "+x+", y "+y+", z "+z+", w "+w+"]";
+    }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/math/Ray.java b/src/jogl/classes/com/jogamp/opengl/math/Ray.java
new file mode 100644
index 0000000..0daca25
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/math/Ray.java
@@ -0,0 +1,57 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.math;
+
+import com.jogamp.opengl.math.geom.AABBox;
+
+/**
+ * Simple compound denoting a ray.
+ * <p>
+ * A ray, also known as a half line, consists out of it's <i>origin</i>
+ * and <i>direction</i>. Hence it is bound to only the <i>origin</i> side,
+ * where the other end is +infinitive.
+ * <pre>
+ * R(t) = R0 + Rd * t with R0 origin, Rd direction and t > 0.0
+ * </pre>
+ * </p>
+ * <p>
+ * A {@link Ray} maybe used for <i>picking</i>
+ * using a {@link AABBox#getRayIntersection(Ray, float[]) bounding box}.
+ * </p>
+ */
+public class Ray {
+    /** Origin of Ray, float[3]. */
+    public final float[] orig = new float[3];
+
+    /** Normalized direction vector of ray, float[3]. */
+    public final float[] dir = new float[3];
+
+    public String toString() {
+        return "Ray[orig["+orig[0]+", "+orig[1]+", "+orig[2]+"], dir["+dir[0]+", "+dir[1]+", "+dir[2]+"]]";
+    }
+}
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java b/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java
index e1e7970..36222cf 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/VectorUtil.java
@@ -29,83 +29,404 @@ package com.jogamp.opengl.math;
 
 import java.util.ArrayList;
 
-public class VectorUtil {
+public final class VectorUtil {
+
+    public static final float[] VEC3_ONE = { 1f, 1f, 1f };
+    public static final float[] VEC3_ZERO = { 0f, 0f, 0f };
+    public static final float[] VEC3_UNIT_Y = { 0f, 1f, 0f };
+    public static final float[] VEC3_UNIT_Y_NEG = { 0f, -1f, 0f };
+    public static final float[] VEC3_UNIT_Z = { 0f, 0f, 1f };
+    public static final float[] VEC3_UNIT_Z_NEG = { 0f, 0f, -1f };
 
     public enum Winding {
         CW(-1), CCW(1);
 
         public final int dir;
 
-        Winding(int dir) {
+        Winding(final int dir) {
             this.dir = dir;
         }
     }
 
-    public static final int COLLINEAR = 0;
+    /**
+     * Copies a vector of length 2
+     * @param dst output vector
+     * @param dstOffset offset of dst in array
+     * @param src input vector
+     * @param srcOffset offset of src in array
+     * @return copied output vector for chaining
+     */
+    public static float[] copyVec2(final float[] dst, final int dstOffset, final float[] src, final int srcOffset)
+    {
+        System.arraycopy(src, srcOffset, dst, dstOffset, 2);
+        return dst;
+    }
+
+    /**
+     * Copies a vector of length 3
+     * @param dst output vector
+     * @param dstOffset offset of dst in array
+     * @param src input vector
+     * @param srcOffset offset of src in array
+     * @return copied output vector for chaining
+     */
+    public static float[] copyVec3(final float[] dst, final int dstOffset, final float[] src, final int srcOffset)
+    {
+        System.arraycopy(src, srcOffset, dst, dstOffset, 3);
+        return dst;
+    }
+
+    /**
+     * Copies a vector of length 4
+     * @param dst output vector
+     * @param dstOffset offset of dst in array
+     * @param src input vector
+     * @param srcOffset offset of src in array
+     * @return copied output vector for chaining
+     */
+    public static float[] copyVec4(final float[] dst, final int dstOffset, final float[] src, final int srcOffset)
+    {
+        System.arraycopy(src, srcOffset, dst, dstOffset, 4);
+        return dst;
+    }
+
+    /**
+     * Return true if both vectors are equal w/o regarding an epsilon.
+     * <p>
+     * Implementation uses {@link FloatUtil#isEqual(float, float)}, see API doc for details.
+     * </p>
+     */
+    public static boolean isVec2Equal(final float[] vec1, final int vec1Offset, final float[] vec2, final int vec2Offset) {
+        return FloatUtil.isEqual(vec1[0+vec1Offset], vec2[0+vec2Offset]) &&
+               FloatUtil.isEqual(vec1[1+vec1Offset], vec2[1+vec2Offset]) ;
+    }
+
+    /**
+     * Return true if both vectors are equal w/o regarding an epsilon.
+     * <p>
+     * Implementation uses {@link FloatUtil#isEqual(float, float)}, see API doc for details.
+     * </p>
+     */
+    public static boolean isVec3Equal(final float[] vec1, final int vec1Offset, final float[] vec2, final int vec2Offset) {
+        return FloatUtil.isEqual(vec1[0+vec1Offset], vec2[0+vec2Offset]) &&
+               FloatUtil.isEqual(vec1[1+vec1Offset], vec2[1+vec2Offset]) &&
+               FloatUtil.isEqual(vec1[2+vec1Offset], vec2[2+vec2Offset]) ;
+    }
+
+    /**
+     * Return true if both vectors are equal, i.e. their absolute delta < <code>epsilon</code>.
+     * <p>
+     * Implementation uses {@link FloatUtil#isEqual(float, float, float)}, see API doc for details.
+     * </p>
+     */
+    public static boolean isVec2Equal(final float[] vec1, final int vec1Offset, final float[] vec2, final int vec2Offset, final float epsilon) {
+        return FloatUtil.isEqual(vec1[0+vec1Offset], vec2[0+vec2Offset], epsilon) &&
+               FloatUtil.isEqual(vec1[1+vec1Offset], vec2[1+vec2Offset], epsilon) ;
+    }
+
+    /**
+     * Return true if both vectors are equal, i.e. their absolute delta < <code>epsilon</code>.
+     * <p>
+     * Implementation uses {@link FloatUtil#isEqual(float, float, float)}, see API doc for details.
+     * </p>
+     */
+    public static boolean isVec3Equal(final float[] vec1, final int vec1Offset, final float[] vec2, final int vec2Offset, final float epsilon) {
+        return FloatUtil.isEqual(vec1[0+vec1Offset], vec2[0+vec2Offset], epsilon) &&
+               FloatUtil.isEqual(vec1[1+vec1Offset], vec2[1+vec2Offset], epsilon) &&
+               FloatUtil.isEqual(vec1[2+vec1Offset], vec2[2+vec2Offset], epsilon) ;
+    }
+
+    /**
+     * Return true if vector is zero, no {@link FloatUtil#EPSILON} is taken into consideration.
+     */
+    public static boolean isVec2Zero(final float[] vec, final int vecOffset) {
+        return 0f == vec[0+vecOffset] && 0f == vec[1+vecOffset];
+    }
+
+    /**
+     * Return true if vector is zero, no {@link FloatUtil#EPSILON} is taken into consideration.
+     */
+    public static boolean isVec3Zero(final float[] vec, final int vecOffset) {
+        return 0f == vec[0+vecOffset] && 0f == vec[1+vecOffset] && 0f == vec[2+vecOffset];
+    }
+
+    /**
+     * Return true if vector is zero, i.e. it's absolute components < <code>epsilon</code>.
+     * <p>
+     * Implementation uses {@link FloatUtil#isZero(float, float)}, see API doc for details.
+     * </p>
+     */
+    public static boolean isVec2Zero(final float[] vec, final int vecOffset, final float epsilon) {
+        return isZero(vec[0+vecOffset], vec[1+vecOffset], epsilon);
+    }
+
+    /**
+     * Return true if vector is zero, i.e. it's absolute components < <code>epsilon</code>.
+     * <p>
+     * Implementation uses {@link FloatUtil#isZero(float, float)}, see API doc for details.
+     * </p>
+     */
+    public static boolean isVec3Zero(final float[] vec, final int vecOffset, final float epsilon) {
+        return isZero(vec[0+vecOffset], vec[1+vecOffset], vec[2+vecOffset], epsilon);
+    }
+
+    /**
+     * Return true if all two vector components are zero, i.e. it's their absolute value < <code>epsilon</code>.
+     * <p>
+     * Implementation uses {@link FloatUtil#isZero(float, float)}, see API doc for details.
+     * </p>
+     */
+    public static boolean isZero(final float x, final float y, final float epsilon) {
+        return FloatUtil.isZero(x, epsilon) &&
+               FloatUtil.isZero(y, epsilon) ;
+    }
 
-    /** compute the dot product of two points
+    /**
+     * Return true if all three vector components are zero, i.e. it's their absolute value < <code>epsilon</code>.
+     * <p>
+     * Implementation uses {@link FloatUtil#isZero(float, float)}, see API doc for details.
+     * </p>
+     */
+    public static boolean isZero(final float x, final float y, final float z, final float epsilon) {
+        return FloatUtil.isZero(x, epsilon) &&
+               FloatUtil.isZero(y, epsilon) &&
+               FloatUtil.isZero(z, epsilon) ;
+    }
+
+    /**
+     * Return the squared distance between the given two points described vector v1 and v2.
+     * <p>
+     * When comparing the relative distance between two points it is usually sufficient to compare the squared
+     * distances, thus avoiding an expensive square root operation.
+     * </p>
+     */
+    public static float distSquareVec3(final float[] v1, final float[] v2) {
+        final float dx = v1[0] - v2[0];
+        final float dy = v1[1] - v2[1];
+        final float dz = v1[2] - v2[2];
+        return dx * dx + dy * dy + dz * dz;
+    }
+
+    /**
+     * Return the distance between the given two points described vector v1 and v2.
+     */
+    public static float distVec3(final float[] v1, final float[] v2) {
+        return FloatUtil.sqrt(distSquareVec3(v1, v2));
+    }
+
+    /**
+     * Return the dot product of two points
      * @param vec1 vector 1
      * @param vec2 vector 2
      * @return the dot product as float
      */
-    public static float dot(float[] vec1, float[] vec2)
-    {
-        return (vec1[0]*vec2[0] + vec1[1]*vec2[1] + vec1[2]*vec2[2]);
+    public static float dotVec3(final float[] vec1, final float[] vec2)  {
+        return vec1[0]*vec2[0] + vec1[1]*vec2[1] + vec1[2]*vec2[2];
+    }
+
+    /**
+     * Return the cosines of the angle between to vectors
+     * @param vec1 vector 1
+     * @param vec2 vector 2
+     */
+    public static float cosAngleVec3(final float[] vec1, final float[] vec2)  {
+        return dotVec3(vec1, vec2) / ( normVec3(vec1) * normVec3(vec2) ) ;
+    }
+
+    /**
+     * Return the angle between to vectors in radians
+     * @param vec1 vector 1
+     * @param vec2 vector 2
+     */
+    public static float angleVec3(final float[] vec1, final float[] vec2)  {
+        return FloatUtil.acos(cosAngleVec3(vec1, vec2));
+    }
+
+    /**
+     * Return the squared length of a vector, a.k.a the squared <i>norm</i> or squared <i>magnitude</i>
+     */
+    public static float normSquareVec2(final float[] vec) {
+        return vec[0]*vec[0] + vec[1]*vec[1];
+    }
+
+    /**
+     * Return the squared length of a vector, a.k.a the squared <i>norm</i> or squared <i>magnitude</i>
+     */
+    public static float normSquareVec2(final float[] vec, final int offset) {
+        float v = vec[0+offset];
+        final float r = v*v;
+        v = vec[1+offset];
+        return r + v*v;
+    }
+
+    /**
+     * Return the squared length of a vector, a.k.a the squared <i>norm</i> or squared <i>magnitude</i>
+     */
+    public static float normSquareVec3(final float[] vec) {
+        return vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2];
+    }
+
+    /**
+     * Return the squared length of a vector, a.k.a the squared <i>norm</i> or squared <i>magnitude</i>
+     */
+    public static float normSquareVec3(final float[] vec, final int offset) {
+        float v = vec[0+offset];
+        float r = v*v;
+        v = vec[1+offset];
+        r += v*v;
+        v = vec[2+offset];
+        return r + v*v;
+    }
+
+    /**
+     * Return the length of a vector, a.k.a the <i>norm</i> or <i>magnitude</i>
+     */
+    public static float normVec2(final float[] vec) {
+        return FloatUtil.sqrt(normSquareVec2(vec));
+    }
+
+    /**
+     * Return the length of a vector, a.k.a the <i>norm</i> or <i>magnitude</i>
+     */
+    public static float normVec3(final float[] vec) {
+        return FloatUtil.sqrt(normSquareVec3(vec));
     }
-    /** Normalize a vector
+
+    /**
+     * Normalize a vector
+     * @param result output vector, may be vector (in-place)
      * @param vector input vector
-     * @return normalized vector
+     * @return normalized output vector
+     * @return result vector for chaining
      */
-    public static float[] normalize(float[] vector)
-    {
-        final float[] newVector = new float[3];
+    public static float[] normalizeVec2(final float[] result, final float[] vector) {
+        final float lengthSq = normSquareVec2(vector);
+        if ( FloatUtil.isZero(lengthSq, FloatUtil.EPSILON) ) {
+            result[0] = 0f;
+            result[1] = 0f;
+        } else {
+            final float invSqr = 1f / FloatUtil.sqrt(lengthSq);
+            result[0] = vector[0] * invSqr;
+            result[1] = vector[1] * invSqr;
+        }
+        return result;
+    }
 
-        final float d = FloatUtil.sqrt(vector[0]*vector[0] + vector[1]*vector[1] + vector[2]*vector[2]);
-        if(d> 0.0f)
-        {
-            newVector[0] = vector[0]/d;
-            newVector[1] = vector[1]/d;
-            newVector[2] = vector[2]/d;
+    /**
+     * Normalize a vector in place
+     * @param vector input vector
+     * @return normalized output vector
+     */
+    public static float[] normalizeVec2(final float[] vector) {
+        final float lengthSq = normSquareVec2(vector);
+        if ( FloatUtil.isZero(lengthSq, FloatUtil.EPSILON) ) {
+            vector[0] = 0f;
+            vector[1] = 0f;
+        } else {
+            final float invSqr = 1f / FloatUtil.sqrt(lengthSq);
+            vector[0] *= invSqr;
+            vector[1] *= invSqr;
         }
-        return newVector;
+        return vector;
     }
 
-    /** Scales a vector by param creating a new float[] for the result!
+    /**
+     * Normalize a vector
+     * @param result output vector, may be vector (in-place)
      * @param vector input vector
-     * @param scale constant to scale by
-     * @return new scaled vector
-     * @deprecated Use {@link #scale(float[], float[], float)}
+     * @return normalized output vector
+     * @return result vector for chaining
      */
-    public static float[] scale(float[] vector, float scale)
-    {
-        final float[] newVector = new float[3];
+    public static float[] normalizeVec3(final float[] result, final float[] vector) {
+        final float lengthSq = normSquareVec3(vector);
+        if ( FloatUtil.isZero(lengthSq, FloatUtil.EPSILON) ) {
+            result[0] = 0f;
+            result[1] = 0f;
+            result[2] = 0f;
+        } else {
+            final float invSqr = 1f / FloatUtil.sqrt(lengthSq);
+            result[0] = vector[0] * invSqr;
+            result[1] = vector[1] * invSqr;
+            result[2] = vector[2] * invSqr;
+        }
+        return result;
+    }
 
-        newVector[0] = vector[0] * scale;
-        newVector[1] = vector[1] * scale;
-        newVector[2] = vector[2] * scale;
-        return newVector;
+    /**
+     * Normalize a vector in place
+     * @param vector input vector
+     * @return normalized output vector
+     */
+    public static float[] normalizeVec3(final float[] vector) {
+        final float lengthSq = normSquareVec3(vector);
+        if ( FloatUtil.isZero(lengthSq, FloatUtil.EPSILON) ) {
+            vector[0] = 0f;
+            vector[1] = 0f;
+            vector[2] = 0f;
+        } else {
+            final float invSqr = 1f / FloatUtil.sqrt(lengthSq);
+            vector[0] *= invSqr;
+            vector[1] *= invSqr;
+            vector[2] *= invSqr;
+        }
+        return vector;
     }
 
-    /** Scales a vector by param using given result float[]
-     * @param result vector for the result
+    /**
+     * Normalize a vector in place
+     * @param vector input vector
+     * @return normalized output vector
+     */
+    public static float[] normalizeVec3(final float[] vector, final int offset) {
+        final float lengthSq = normSquareVec3(vector, offset);
+        if ( FloatUtil.isZero(lengthSq, FloatUtil.EPSILON) ) {
+            vector[0+offset] = 0f;
+            vector[1+offset] = 0f;
+            vector[2+offset] = 0f;
+        } else {
+            final float invSqr = 1f / FloatUtil.sqrt(lengthSq);
+            vector[0+offset] *= invSqr;
+            vector[1+offset] *= invSqr;
+            vector[2+offset] *= invSqr;
+        }
+        return vector;
+    }
+
+    /**
+     * Scales a vector by param using given result float[], result = vector * scale
+     * @param result vector for the result, may be vector (in-place)
      * @param vector input vector
      * @param scale single scale constant for all vector components
+     * @return result vector for chaining
      */
-    public static float[] scale(float[] result, float[] vector, float scale)
-    {
+    public static float[] scaleVec2(final float[] result, final float[] vector, final float scale) {
+        result[0] = vector[0] * scale;
+        result[1] = vector[1] * scale;
+        return result;
+    }
+
+    /**
+     * Scales a vector by param using given result float[], result = vector * scale
+     * @param result vector for the result, may be vector (in-place)
+     * @param vector input vector
+     * @param scale single scale constant for all vector components
+     * @return result vector for chaining
+     */
+    public static float[] scaleVec3(final float[] result, final float[] vector, final float scale) {
         result[0] = vector[0] * scale;
         result[1] = vector[1] * scale;
         result[2] = vector[2] * scale;
         return result;
     }
 
-    /** Scales a vector by param using given result float[]
-     * @param result vector for the result
+    /**
+     * Scales a vector by param using given result float[], result = vector * scale
+     * @param result vector for the result, may be vector (in-place)
      * @param vector input vector
      * @param scale 3 component scale constant for each vector component
-     * @return given result vector
+     * @return result vector for chaining
      */
-    public static float[] scale(float[] result, float[] vector, float[] scale)
+    public static float[] scaleVec3(final float[] result, final float[] vector, final float[] scale)
     {
         result[0] = vector[0] * scale[0];
         result[1] = vector[1] * scale[1];
@@ -113,178 +434,235 @@ public class VectorUtil {
         return result;
     }
 
-    /** Adds to vectors
-     * @param v1 vector 1
-     * @param v2 vector 2
-     * @return v1 + v2
+    /**
+     * Scales a vector by param using given result float[], result = vector * scale
+     * @param result vector for the result, may be vector (in-place)
+     * @param vector input vector
+     * @param scale 2 component scale constant for each vector component
+     * @return result vector for chaining
      */
-    public static float[] vectorAdd(float[] v1, float[] v2)
+    public static float[] scaleVec2(final float[] result, final float[] vector, final float[] scale)
     {
-        final float[] newVector = new float[3];
-
-        newVector[0] = v1[0] + v2[0];
-        newVector[1] = v1[1] + v2[1];
-        newVector[2] = v1[2] + v2[2];
-        return newVector;
+        result[0] = vector[0] * scale[0];
+        result[1] = vector[1] * scale[1];
+        return result;
     }
 
-    /** cross product vec1 x vec2
-     * @param vec1 vector 1
-     * @param vec2 vecttor 2
-     * @return the resulting vector
+    /**
+     * Divides a vector by param using given result float[], result = vector / scale
+     * @param result vector for the result, may be vector (in-place)
+     * @param vector input vector
+     * @param scale single scale constant for all vector components
+     * @return result vector for chaining
      */
-    public static float[] cross(float[] vec1, float[] vec2)
-    {
-        final float[] out = new float[3];
-
-        out[0] = vec2[2]*vec1[1] - vec2[1]*vec1[2];
-        out[1] = vec2[0]*vec1[2] - vec2[2]*vec1[0];
-        out[2] = vec2[1]*vec1[0] - vec2[0]*vec1[1];
+    public static float[] divVec2(final float[] result, final float[] vector, final float scale) {
+        result[0] = vector[0] / scale;
+        result[1] = vector[1] / scale;
+        return result;
+    }
 
-        return out;
+    /**
+     * Divides a vector by param using given result float[], result = vector / scale
+     * @param result vector for the result, may be vector (in-place)
+     * @param vector input vector
+     * @param scale single scale constant for all vector components
+     * @return result vector for chaining
+     */
+    public static float[] divVec3(final float[] result, final float[] vector, final float scale) {
+        result[0] = vector[0] / scale;
+        result[1] = vector[1] / scale;
+        result[2] = vector[2] / scale;
+        return result;
     }
 
-    /** Column Matrix Vector multiplication
-     * @param colMatrix column matrix (4x4)
-     * @param vec vector(x,y,z)
-     * @return result new float[3]
+    /**
+     * Divides a vector by param using given result float[], result = vector / scale
+     * @param result vector for the result, may be vector (in-place)
+     * @param vector input vector
+     * @param scale 3 component scale constant for each vector component
+     * @return result vector for chaining
      */
-    public static float[] colMatrixVectorMult(float[] colMatrix, float[] vec)
+    public static float[] divVec3(final float[] result, final float[] vector, final float[] scale)
     {
-        final float[] out = new float[3];
+        result[0] = vector[0] / scale[0];
+        result[1] = vector[1] / scale[1];
+        result[2] = vector[2] / scale[2];
+        return result;
+    }
 
-        out[0] = vec[0]*colMatrix[0] + vec[1]*colMatrix[4] + vec[2]*colMatrix[8] + colMatrix[12];
-        out[1] = vec[0]*colMatrix[1] + vec[1]*colMatrix[5] + vec[2]*colMatrix[9] + colMatrix[13];
-        out[2] = vec[0]*colMatrix[2] + vec[1]*colMatrix[6] + vec[2]*colMatrix[10] + colMatrix[14];
+    /**
+     * Divides a vector by param using given result float[], result = vector / scale
+     * @param result vector for the result, may be vector (in-place)
+     * @param vector input vector
+     * @param scale 2 component scale constant for each vector component
+     * @return result vector for chaining
+     */
+    public static float[] divVec2(final float[] result, final float[] vector, final float[] scale)
+    {
+        result[0] = vector[0] / scale[0];
+        result[1] = vector[1] / scale[1];
+        return result;
+    }
 
-        return out;
+    /**
+     * Adds two vectors, result = v1 + v2
+     * @param result float[2] result vector, may be either v1 or v2 (in-place)
+     * @param v1 vector 1
+     * @param v2 vector 2
+     * @return result vector for chaining
+     */
+    public static float[] addVec2(final float[] result, final float[] v1, final float[] v2) {
+        result[0] = v1[0] + v2[0];
+        result[1] = v1[1] + v2[1];
+        return result;
     }
 
-    /** Matrix Vector multiplication
-     * @param rawMatrix column matrix (4x4)
-     * @param vec vector(x,y,z)
-     * @return result new float[3]
+    /**
+     * Adds two vectors, result = v1 + v2
+     * @param result float[3] result vector, may be either v1 or v2 (in-place)
+     * @param v1 vector 1
+     * @param v2 vector 2
+     * @return result vector for chaining
      */
-    public static float[] rowMatrixVectorMult(float[] rawMatrix, float[] vec)
-    {
-        final float[] out = new float[3];
+    public static float[] addVec3(final float[] result, final float[] v1, final float[] v2) {
+        result[0] = v1[0] + v2[0];
+        result[1] = v1[1] + v2[1];
+        result[2] = v1[2] + v2[2];
+        return result;
+    }
 
-        out[0] = vec[0]*rawMatrix[0] + vec[1]*rawMatrix[1] + vec[2]*rawMatrix[2] + rawMatrix[3];
-        out[1] = vec[0]*rawMatrix[4] + vec[1]*rawMatrix[5] + vec[2]*rawMatrix[6] + rawMatrix[7];
-        out[2] = vec[0]*rawMatrix[8] + vec[1]*rawMatrix[9] + vec[2]*rawMatrix[10] + rawMatrix[11];
+    /**
+     * Subtracts two vectors, result = v1 - v2
+     * @param result float[2] result vector, may be either v1 or v2 (in-place)
+     * @param v1 vector 1
+     * @param v2 vector 2
+     * @return result vector for chaining
+     */
+    public static float[] subVec2(final float[] result, final float[] v1, final float[] v2) {
+        result[0] = v1[0] - v2[0];
+        result[1] = v1[1] - v2[1];
+        return result;
+    }
 
-        return out;
+    /**
+     * Subtracts two vectors, result = v1 - v2
+     * @param result float[3] result vector, may be either v1 or v2 (in-place)
+     * @param v1 vector 1
+     * @param v2 vector 2
+     * @return result vector for chaining
+     */
+    public static float[] subVec3(final float[] result, final float[] v1, final float[] v2) {
+        result[0] = v1[0] - v2[0];
+        result[1] = v1[1] - v2[1];
+        result[2] = v1[2] - v2[2];
+        return result;
     }
 
-    /** Calculate the midpoint of two values
-     * @param p1 first value
-     * @param p2 second vale
-     * @return midpoint
+    /**
+     * cross product vec1 x vec2
+     * @param v1 vector 1
+     * @param v2 vector 2
+     * @return the resulting vector
      */
-    public static float mid(float p1, float p2)
+    public static float[] crossVec3(final float[] result, final float[] v1, final float[] v2)
     {
-        return (p1+p2)/2.0f;
+        result[0] = v1[1] * v2[2] - v1[2] * v2[1];
+        result[1] = v1[2] * v2[0] - v1[0] * v2[2];
+        result[2] = v1[0] * v2[1] - v1[1] * v2[0];
+        return result;
     }
 
-    /** Calculate the midpoint of two points
-     * @param p1 first point
-     * @param p2 second point
-     * @return midpoint
+    /**
+     * cross product vec1 x vec2
+     * @param v1 vector 1
+     * @param v2 vector 2
+     * @return the resulting vector
      */
-    public static float[] mid(float[] p1, float[] p2)
+    public static float[] crossVec3(final float[] r, final int r_offset, final float[] v1, final int v1_offset, final float[] v2, final int v2_offset)
     {
-        final float[] midPoint = new float[3];
-        midPoint[0] = (p1[0] + p2[0])*0.5f;
-        midPoint[1] = (p1[1] + p2[1])*0.5f;
-        midPoint[2] = (p1[2] + p2[2])*0.5f;
-
-        return midPoint;
+        r[0+r_offset] = v1[1+v1_offset] * v2[2+v2_offset] - v1[2+v1_offset] * v2[1+v2_offset];
+        r[1+r_offset] = v1[2+v1_offset] * v2[0+v2_offset] - v1[0+v1_offset] * v2[2+v2_offset];
+        r[2+r_offset] = v1[0+v1_offset] * v2[1+v2_offset] - v1[1+v1_offset] * v2[0+v2_offset];
+        return r;
     }
 
-    /** Compute the norm of a vector
-     * @param vec vector
-     * @return vorm
+    /**
+     * Multiplication of column-major 4x4 matrix with vector
+     * @param colMatrix column matrix (4x4)
+     * @param vec vector(x,y,z)
+     * @return result
      */
-    public static float norm(float[] vec)
+    public static float[] mulColMat4Vec3(final float[] result, final float[] colMatrix, final float[] vec)
     {
-        return FloatUtil.sqrt(vec[0]*vec[0] + vec[1]*vec[1] + vec[2]*vec[2]);
+        result[0] = vec[0]*colMatrix[0] + vec[1]*colMatrix[4] + vec[2]*colMatrix[8] + colMatrix[12];
+        result[1] = vec[0]*colMatrix[1] + vec[1]*colMatrix[5] + vec[2]*colMatrix[9] + colMatrix[13];
+        result[2] = vec[0]*colMatrix[2] + vec[1]*colMatrix[6] + vec[2]*colMatrix[10] + colMatrix[14];
+
+        return result;
     }
 
-    /** Compute distance between 2 points
-     * @param p0 a ref point on the line
-     * @param vec vector representing the direction of the line
-     * @param point the point to compute the relative distance of
-     * @return distance float
+    /**
+     * Matrix Vector multiplication
+     * @param rawMatrix column matrix (4x4)
+     * @param vec vector(x,y,z)
+     * @return result
      */
-    public static float computeLength(float[] p0, float[] point)
+    public static float[] mulRowMat4Vec3(final float[] result, final float[] rawMatrix, final float[] vec)
     {
-        final float w0 = point[0]-p0[0];
-        final float w1 = point[1]-p0[1];
-        final float w2 = point[2]-p0[2];
+        result[0] = vec[0]*rawMatrix[0] + vec[1]*rawMatrix[1] + vec[2]*rawMatrix[2] + rawMatrix[3];
+        result[1] = vec[0]*rawMatrix[4] + vec[1]*rawMatrix[5] + vec[2]*rawMatrix[6] + rawMatrix[7];
+        result[2] = vec[0]*rawMatrix[8] + vec[1]*rawMatrix[9] + vec[2]*rawMatrix[10] + rawMatrix[11];
 
-        return FloatUtil.sqrt(w0*w0 + w1*w1 + w2*w2);
+        return result;
     }
 
-    /**Check equality of 2 vec3 vectors
-     * @param v1 vertex 1
-     * @param v2 vertex 2
-     * @return
+    /**
+     * Calculate the midpoint of two values
+     * @param p1 first value
+     * @param p2 second vale
+     * @return midpoint
      */
-    public static boolean checkEquality(float[] v1, float[] v2)
-    {
-        return Float.compare(v1[0], v2[0]) == 0 &&
-               Float.compare(v1[1], v2[1]) == 0 &&
-               Float.compare(v1[2], v2[2]) == 0 ;
+    public static float mid(final float p1, final float p2) {
+        return (p1+p2)*0.5f;
     }
 
-    /**Check equality of 2 vec2 vectors
-     * @param v1 vertex 1
-     * @param v2 vertex 2
-     * @return
+    /**
+     * Calculate the midpoint of two points
+     * @param p1 first point vector
+     * @param p2 second point vector
+     * @return midpoint
      */
-    public static boolean checkEqualityVec2(float[] v1, float[] v2)
-    {
-        return Float.compare(v1[0], v2[0]) == 0 &&
-               Float.compare(v1[1], v2[1]) == 0 ;
+    public static float[] midVec3(final float[] result, final float[] p1, final float[] p2) {
+        result[0] = (p1[0] + p2[0])*0.5f;
+        result[1] = (p1[1] + p2[1])*0.5f;
+        result[2] = (p1[2] + p2[2])*0.5f;
+        return result;
     }
 
-    /** Compute the determinant of 3 vectors
+    /**
+     * Return the determinant of 3 vectors
      * @param a vector 1
      * @param b vector 2
      * @param c vector 3
      * @return the determinant value
      */
-    public static float computeDeterminant(float[] a, float[] b, float[] c)
-    {
+    public static float determinantVec3(final float[] a, final float[] b, final float[] c) {
         return a[0]*b[1]*c[2] + a[1]*b[2]*c[0] + a[2]*b[0]*c[1] - a[0]*b[2]*c[1] - a[1]*b[0]*c[2] - a[2]*b[1]*c[0];
     }
 
-    /** Check if three vertices are colliniear
+    /**
+     * Check if three vertices are colliniear
      * @param v1 vertex 1
      * @param v2 vertex 2
      * @param v3 vertex 3
      * @return true if collinear, false otherwise
      */
-    public static boolean checkCollinear(float[] v1, float[] v2, float[] v3)
-    {
-        return (computeDeterminant(v1, v2, v3) == VectorUtil.COLLINEAR);
+    public static boolean isCollinearVec3(final float[] v1, final float[] v2, final float[] v3) {
+        return FloatUtil.isZero( determinantVec3(v1, v2, v3), FloatUtil.EPSILON );
     }
 
-    /** Compute Vector
-     * @param v1 vertex 1
-     * @param v2 vertex2 2
-     * @return Vector V1V2
-     */
-    public static float[] computeVector(float[] v1, float[] v2)
-    {
-        final float[] vector = new float[3];
-        vector[0] = v2[0] - v1[0];
-        vector[1] = v2[1] - v1[1];
-        vector[2] = v2[2] - v1[2];
-        return vector;
-    }
-
-    /** Check if vertices in triangle circumcircle
+    /**
+     * Check if vertices in triangle circumcircle
      * @param a triangle vertex 1
      * @param b triangle vertex 2
      * @param c triangle vertex 3
@@ -292,25 +670,46 @@ public class VectorUtil {
      * @return true if the vertex d is inside the circle defined by the
      * vertices a, b, c. from paper by Guibas and Stolfi (1985).
      */
-    public static boolean inCircle(Vert2fImmutable a, Vert2fImmutable b, Vert2fImmutable c, Vert2fImmutable d){
-        return (a.getX() * a.getX() + a.getY() * a.getY()) * triArea(b, c, d) -
-               (b.getX() * b.getX() + b.getY() * b.getY()) * triArea(a, c, d) +
-               (c.getX() * c.getX() + c.getY() * c.getY()) * triArea(a, b, d) -
-               (d.getX() * d.getX() + d.getY() * d.getY()) * triArea(a, b, c) > 0;
+    public static boolean isInCircleVec2(final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c, final Vert2fImmutable d) {
+        final float[] A = a.getCoord();
+        final float[] B = b.getCoord();
+        final float[] C = c.getCoord();
+        final float[] D = d.getCoord();
+        return (A[0] * A[0] + A[1] * A[1]) * triAreaVec2(B, C, D) -
+               (B[0] * B[0] + B[1] * B[1]) * triAreaVec2(A, C, D) +
+               (C[0] * C[0] + C[1] * C[1]) * triAreaVec2(A, B, D) -
+               (D[0] * D[0] + D[1] * D[1]) * triAreaVec2(A, B, C) > 0;
     }
 
-    /** Computes oriented area of a triangle
+    /**
+     * Computes oriented area of a triangle
      * @param a first vertex
      * @param b second vertex
      * @param c third vertex
      * @return compute twice the area of the oriented triangle (a,b,c), the area
      * is positive if the triangle is oriented counterclockwise.
      */
-    public static float triArea(Vert2fImmutable a, Vert2fImmutable b, Vert2fImmutable c) {
-        return (b.getX() - a.getX()) * (c.getY() - a.getY()) - (b.getY() - a.getY())*(c.getX() - a.getX());
+    public static float triAreaVec2(final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c){
+        final float[] A = a.getCoord();
+        final float[] B = b.getCoord();
+        final float[] C = c.getCoord();
+        return (B[0] - A[0]) * (C[1] - A[1]) - (B[1] - A[1]) * (C[0] - A[0]);
+    }
+
+    /**
+     * Computes oriented area of a triangle
+     * @param A first vertex
+     * @param B second vertex
+     * @param C third vertex
+     * @return compute twice the area of the oriented triangle (a,b,c), the area
+     * is positive if the triangle is oriented counterclockwise.
+     */
+    public static float triAreaVec2(final float[] A, final float[] B, final float[] C){
+        return (B[0] - A[0]) * (C[1] - A[1]) - (B[1] - A[1])*(C[0] - A[0]);
     }
 
-    /** Check if a vertex is in triangle using
+    /**
+     * Check if a vertex is in triangle using
      * barycentric coordinates computation.
      * @param a first triangle vertex
      * @param b second triangle vertex
@@ -318,36 +717,183 @@ public class VectorUtil {
      * @param p the vertex in question
      * @return true if p is in triangle (a, b, c), false otherwise.
      */
-    public static boolean vertexInTriangle(float[] a, float[]  b, float[]  c, float[]  p){
+    public static boolean isInTriangleVec3(final float[] a, final float[]  b, final float[]  c,
+                                           final float[] p,
+                                           final float[] ac, final float[] ab, final float[] ap){
         // Compute vectors
-        final float[] ac = computeVector(a, c); //v0
-        final float[] ab = computeVector(a, b); //v1
-        final float[] ap = computeVector(a, p); //v2
+        subVec3(ac, c, a); //v0
+        subVec3(ab, b, a); //v1
+        subVec3(ap, p, a); //v2
 
         // Compute dot products
-        final float dot00 = dot(ac, ac);
-        final float dot01 = dot(ac, ab);
-        final float dot02 = dot(ac, ap);
-        final float dot11 = dot(ab, ab);
-        final float dot12 = dot(ab, ap);
+        final float dotAC_AC = dotVec3(ac, ac);
+        final float dotAC_AB = dotVec3(ac, ab);
+        final float dotAB_AB = dotVec3(ab, ab);
+        final float dotAC_AP = dotVec3(ac, ap);
+        final float dotAB_AP = dotVec3(ab, ap);
 
         // Compute barycentric coordinates
-        final float invDenom = 1 / (dot00 * dot11 - dot01 * dot01);
-        final float u = (dot11 * dot02 - dot01 * dot12) * invDenom;
-        final float v = (dot00 * dot12 - dot01 * dot02) * invDenom;
+        final float invDenom = 1 / (dotAC_AC * dotAB_AB - dotAC_AB * dotAC_AB);
+        final float u = (dotAB_AB * dotAC_AP - dotAC_AB * dotAB_AP) * invDenom;
+        final float v = (dotAC_AC * dotAB_AP - dotAC_AB * dotAC_AP) * invDenom;
 
         // Check if point is in triangle
         return (u >= 0) && (v >= 0) && (u + v < 1);
     }
 
+    /**
+     * Check if one of three vertices are in triangle using
+     * barycentric coordinates computation.
+     * @param a first triangle vertex
+     * @param b second triangle vertex
+     * @param c third triangle vertex
+     * @param p1 the vertex in question
+     * @param p2 the vertex in question
+     * @param p3 the vertex in question
+     * @param tmpAC
+     * @param tmpAB
+     * @param tmpAP
+     * @return true if p1 or p2 or p3 is in triangle (a, b, c), false otherwise.
+     */
+    public static boolean isVec3InTriangle3(final float[] a, final float[]  b, final float[]  c,
+                                            final float[] p1, final float[] p2, final float[] p3,
+                                            final float[] tmpAC, final float[] tmpAB, final float[] tmpAP){
+        // Compute vectors
+        subVec3(tmpAC, c, a); //v0
+        subVec3(tmpAB, b, a); //v1
+
+        // Compute dot products
+        final float dotAC_AC = dotVec3(tmpAC, tmpAC);
+        final float dotAC_AB = dotVec3(tmpAC, tmpAB);
+        final float dotAB_AB = dotVec3(tmpAB, tmpAB);
+
+        // Compute barycentric coordinates
+        final float invDenom = 1 / (dotAC_AC * dotAB_AB - dotAC_AB * dotAC_AB);
+        {
+            subVec3(tmpAP, p1, a); //v2
+            final float dotAC_AP1 = dotVec3(tmpAC, tmpAP);
+            final float dotAB_AP1 = dotVec3(tmpAB, tmpAP);
+            final float u = (dotAB_AB * dotAC_AP1 - dotAC_AB * dotAB_AP1) * invDenom;
+            final float v = (dotAC_AC * dotAB_AP1 - dotAC_AB * dotAC_AP1) * invDenom;
+
+            // Check if point is in triangle
+            if ( (u >= 0) && (v >= 0) && (u + v < 1) ) {
+                return true;
+            }
+        }
+
+        {
+            subVec3(tmpAP, p1, a); //v2
+            final float dotAC_AP2 = dotVec3(tmpAC, tmpAP);
+            final float dotAB_AP2 = dotVec3(tmpAB, tmpAP);
+            final float u = (dotAB_AB * dotAC_AP2 - dotAC_AB * dotAB_AP2) * invDenom;
+            final float v = (dotAC_AC * dotAB_AP2 - dotAC_AB * dotAC_AP2) * invDenom;
+
+            // Check if point is in triangle
+            if ( (u >= 0) && (v >= 0) && (u + v < 1) ) {
+                return true;
+            }
+        }
+
+        {
+            subVec3(tmpAP, p2, a); //v2
+            final float dotAC_AP3 = dotVec3(tmpAC, tmpAP);
+            final float dotAB_AP3 = dotVec3(tmpAB, tmpAP);
+            final float u = (dotAB_AB * dotAC_AP3 - dotAC_AB * dotAB_AP3) * invDenom;
+            final float v = (dotAC_AC * dotAB_AP3 - dotAC_AB * dotAC_AP3) * invDenom;
+
+            // Check if point is in triangle
+            if ( (u >= 0) && (v >= 0) && (u + v < 1) ) {
+                return true;
+            }
+        }
+        return false;
+    }
+    /**
+     * Check if one of three vertices are in triangle using
+     * barycentric coordinates computation, using given epsilon for comparison.
+     * @param a first triangle vertex
+     * @param b second triangle vertex
+     * @param c third triangle vertex
+     * @param p1 the vertex in question
+     * @param p2 the vertex in question
+     * @param p3 the vertex in question
+     * @param tmpAC
+     * @param tmpAB
+     * @param tmpAP
+     * @return true if p1 or p2 or p3 is in triangle (a, b, c), false otherwise.
+     */
+    public static boolean isVec3InTriangle3(final float[] a, final float[]  b, final float[]  c,
+                                            final float[] p1, final float[] p2, final float[] p3,
+                                            final float[] tmpAC, final float[] tmpAB, final float[] tmpAP,
+                                            final float epsilon){
+        // Compute vectors
+        subVec3(tmpAC, c, a); //v0
+        subVec3(tmpAB, b, a); //v1
+
+        // Compute dot products
+        final float dotAC_AC = dotVec3(tmpAC, tmpAC);
+        final float dotAC_AB = dotVec3(tmpAC, tmpAB);
+        final float dotAB_AB = dotVec3(tmpAB, tmpAB);
+
+        // Compute barycentric coordinates
+        final float invDenom = 1 / (dotAC_AC * dotAB_AB - dotAC_AB * dotAC_AB);
+        {
+            subVec3(tmpAP, p1, a); //v2
+            final float dotAC_AP1 = dotVec3(tmpAC, tmpAP);
+            final float dotAB_AP1 = dotVec3(tmpAB, tmpAP);
+            final float u = (dotAB_AB * dotAC_AP1 - dotAC_AB * dotAB_AP1) * invDenom;
+            final float v = (dotAC_AC * dotAB_AP1 - dotAC_AB * dotAC_AP1) * invDenom;
+
+            // Check if point is in triangle
+            if( FloatUtil.compare(u, 0.0f, epsilon) >= 0 &&
+                FloatUtil.compare(v, 0.0f, epsilon) >= 0 &&
+                FloatUtil.compare(u+v, 1.0f, epsilon) < 0 ) {
+                return true;
+            }
+        }
+
+        {
+            subVec3(tmpAP, p1, a); //v2
+            final float dotAC_AP2 = dotVec3(tmpAC, tmpAP);
+            final float dotAB_AP2 = dotVec3(tmpAB, tmpAP);
+            final float u = (dotAB_AB * dotAC_AP2 - dotAC_AB * dotAB_AP2) * invDenom;
+            final float v = (dotAC_AC * dotAB_AP2 - dotAC_AB * dotAC_AP2) * invDenom;
+
+            // Check if point is in triangle
+            if( FloatUtil.compare(u, 0.0f, epsilon) >= 0 &&
+                FloatUtil.compare(v, 0.0f, epsilon) >= 0 &&
+                FloatUtil.compare(u+v, 1.0f, epsilon) < 0 ) {
+                return true;
+            }
+        }
+
+        {
+            subVec3(tmpAP, p2, a); //v2
+            final float dotAC_AP3 = dotVec3(tmpAC, tmpAP);
+            final float dotAB_AP3 = dotVec3(tmpAB, tmpAP);
+            final float u = (dotAB_AB * dotAC_AP3 - dotAC_AB * dotAB_AP3) * invDenom;
+            final float v = (dotAC_AC * dotAB_AP3 - dotAC_AB * dotAC_AP3) * invDenom;
+
+            // Check if point is in triangle
+            if( FloatUtil.compare(u, 0.0f, epsilon) >= 0 &&
+                FloatUtil.compare(v, 0.0f, epsilon) >= 0 &&
+                FloatUtil.compare(u+v, 1.0f, epsilon) < 0 ) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
     /** Check if points are in ccw order
      * @param a first vertex
      * @param b second vertex
      * @param c third vertex
      * @return true if the points a,b,c are in a ccw order
      */
-    public static boolean ccw(Vert2fImmutable a, Vert2fImmutable b, Vert2fImmutable c){
-        return triArea(a,b,c) > 0;
+    public static boolean ccw(final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c){
+        return triAreaVec2(a,b,c) > 0;
     }
 
     /** Compute the winding of given points
@@ -356,15 +902,15 @@ public class VectorUtil {
      * @param c third vertex
      * @return Winding
      */
-    public static Winding getWinding(Vert2fImmutable a, Vert2fImmutable b, Vert2fImmutable c) {
-        return triArea(a,b,c) > 0 ? Winding.CCW : Winding.CW ;
+    public static Winding getWinding(final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c) {
+        return triAreaVec2(a,b,c) > 0 ? Winding.CCW : Winding.CW ;
     }
 
     /** Computes the area of a list of vertices to check if ccw
      * @param vertices
      * @return positive area if ccw else negative area value
      */
-    public static float area(ArrayList<? extends Vert2fImmutable> vertices) {
+    public static float area(final ArrayList<? extends Vert2fImmutable> vertices) {
         final int n = vertices.size();
         float area = 0.0f;
         for (int p = n - 1, q = 0; q < n; p = q++)
@@ -380,20 +926,114 @@ public class VectorUtil {
      * @param vertices array of Vertices
      * @return CCW or CW {@link Winding}
      */
-    public static Winding getWinding(ArrayList<? extends Vert2fImmutable> vertices) {
+    public static Winding getWinding(final ArrayList<? extends Vert2fImmutable> vertices) {
         return area(vertices) >= 0 ? Winding.CCW : Winding.CW ;
     }
 
+    /**
+     * @param result vec2 result for normal
+     * @param v1 vec2
+     * @param v2 vec2
+     * @return result for chaining
+     */
+    public static float[] getNormalVec2(final float[] result, final float[] v1, final float[] v2 ) {
+        subVec2(result, v2, v1);
+        final float tmp = result [ 0 ] ; result [ 0 ] = -result [ 1 ] ; result [ 1 ] = tmp ;
+        return normalizeVec2 ( result ) ;
+    }
+
+    /**
+     * Returns the 3d surface normal of a triangle given three vertices.
+     *
+     * @param result vec3 result for normal
+     * @param v1 vec3
+     * @param v2 vec3
+     * @param v3 vec3
+     * @param tmp1Vec3 temp vec3
+     * @param tmp2Vec3 temp vec3
+     * @return result for chaining
+     */
+    public static float[] getNormalVec3(final float[] result, final float[] v1, final float[] v2, final float[] v3,
+                                        final float[] tmp1Vec3, final float[] tmp2Vec3) {
+        subVec3 ( tmp1Vec3, v2, v1 );
+        subVec3 ( tmp2Vec3, v3, v1 ) ;
+        return normalizeVec3 ( crossVec3(result, tmp1Vec3, tmp2Vec3) ) ;
+    }
+
+    /**
+     * Finds the plane equation of a plane given its normal and a point on the plane.
+     *
+     * @param resultV4 vec4 plane equation
+     * @param normalVec3
+     * @param pVec3
+     * @return result for chaining
+     */
+    public static float[] getPlaneVec3(final float[/*4*/] resultV4, final float[] normalVec3, final float[] pVec3) {
+        /**
+            Ax + By + Cz + D == 0 ;
+            D = - ( Ax + By + Cz )
+              = - ( A*a[0] + B*a[1] + C*a[2] )
+              = - vec3Dot ( normal, a ) ;
+         */
+        System.arraycopy(normalVec3, 0, resultV4, 0, 3);
+        resultV4 [ 3 ] = -dotVec3(normalVec3, pVec3) ;
+        return resultV4;
+    }
+
+    /**
+     * This finds the plane equation of a triangle given three vertices.
+     *
+     * @param resultVec4 vec4 plane equation
+     * @param v1 vec3
+     * @param v2 vec3
+     * @param v3 vec3
+     * @param temp1V3
+     * @param temp2V3
+     * @return result for chaining
+     */
+    public static float[] getPlaneVec3(final float[/*4*/] resultVec4, final float[] v1, final float[] v2, final float[] v3,
+                                       final float[] temp1V3, final float[] temp2V3) {
+        /**
+            Ax + By + Cz + D == 0 ;
+            D = - ( Ax + By + Cz )
+              = - ( A*a[0] + B*a[1] + C*a[2] )
+              = - vec3Dot ( normal, a ) ;
+         */
+      getNormalVec3( resultVec4, v1, v2, v3, temp1V3, temp2V3 ) ;
+      resultVec4 [ 3 ] = -dotVec3 (resultVec4, v1) ;
+      return resultVec4;
+    }
+
+    /**
+     * Return intersection of an infinite line with a plane if exists, otherwise null.
+     * <p>
+     * Thanks to <i>Norman Vine -- nhv at yahoo.com  (with hacks by Steve)</i>
+     * </p>
+     *
+     * @param result vec3 result buffer for intersecting coords
+     * @param ray here representing an infinite line, origin and direction.
+     * @param plane vec4 plane equation
+     * @param epsilon
+     * @return resulting intersecting if exists, otherwise null
+     */
+    public static float[] line2PlaneIntersection(final float[] result, final Ray ray, final float[/*4*/] plane, final float epsilon) {
+        final float tmp = dotVec3(ray.dir, plane) ;
+
+        if ( Math.abs(tmp) < epsilon ) {
+            return null; // ray is parallel to plane
+        }
+        scaleVec3 ( result, ray.dir, -( dotVec3(ray.orig, plane) + plane[3] ) / tmp ) ;
+        return addVec3(result, result, ray.orig);
+    }
 
     /** Compute intersection between two segments
      * @param a vertex 1 of first segment
      * @param b vertex 2 of first segment
      * @param c vertex 1 of second segment
      * @param d vertex 2 of second segment
-     * @return the intersection coordinates if the segments intersect, otherwise
-     * returns null
+     * @return the intersection coordinates if the segments intersect, otherwise returns null
      */
-    public static float[] seg2SegIntersection(Vert2fImmutable a, Vert2fImmutable b, Vert2fImmutable c, Vert2fImmutable d) {
+    public static float[] seg2SegIntersection(final float[] result, final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c, final Vert2fImmutable d) {
         final float determinant = (a.getX()-b.getX())*(c.getY()-d.getY()) - (a.getY()-b.getY())*(c.getX()-d.getX());
 
         if (determinant == 0)
@@ -409,10 +1049,89 @@ public class VectorUtil {
         if(gamma <= 0 || gamma >= 1) return null;
         if(gamma1 <= 0 || gamma1 >= 1) return null;
 
-        return new float[]{xi,yi,0};
+        result[0] = xi;
+        result[1] = yi;
+        result[2] = 0;
+        return result;
+    }
+
+    /**
+     * Compute intersection between two segments
+     * @param a vertex 1 of first segment
+     * @param b vertex 2 of first segment
+     * @param c vertex 1 of second segment
+     * @param d vertex 2 of second segment
+     * @return true if the segments intersect, otherwise returns false
+     */
+    public static boolean testSeg2SegIntersection(final Vert2fImmutable a, final Vert2fImmutable b,
+                                                  final Vert2fImmutable c, final Vert2fImmutable d) {
+        final float[] A = a.getCoord();
+        final float[] B = b.getCoord();
+        final float[] C = c.getCoord();
+        final float[] D = d.getCoord();
+
+        final float determinant = (A[0]-B[0])*(C[1]-D[1]) - (A[1]-B[1])*(C[0]-D[0]);
+
+        if (determinant == 0) {
+            return false;
+        }
+
+        final float alpha = (A[0]*B[1]-A[1]*B[0]);
+        final float beta = (C[0]*D[1]-C[1]*D[1]);
+        final float xi = ((C[0]-D[0])*alpha-(A[0]-B[0])*beta)/determinant;
+
+        final float gamma0 = (xi - A[0])/(B[0] - A[0]);
+        final float gamma1 = (xi - C[0])/(D[0] - C[0]);
+        if(gamma0 <= 0 || gamma0 >= 1 || gamma1 <= 0 || gamma1 >= 1) {
+            return false;
+        }
+
+        return true;
+    }
+    /**
+     * Compute intersection between two segments, using given epsilon for comparison.
+     * @param a vertex 1 of first segment
+     * @param b vertex 2 of first segment
+     * @param c vertex 1 of second segment
+     * @param d vertex 2 of second segment
+     * @return true if the segments intersect, otherwise returns false
+     */
+    public static boolean testSeg2SegIntersection(final Vert2fImmutable a, final Vert2fImmutable b,
+                                                  final Vert2fImmutable c, final Vert2fImmutable d,
+                                                  final float epsilon) {
+        final float[] A = a.getCoord();
+        final float[] B = b.getCoord();
+        final float[] C = c.getCoord();
+        final float[] D = d.getCoord();
+
+        final float determinant = (A[0]-B[0])*(C[1]-D[1]) - (A[1]-B[1])*(C[0]-D[0]);
+
+        if ( FloatUtil.isZero(determinant, epsilon) ) {
+            return false;
+        }
+
+        final float alpha = (A[0]*B[1]-A[1]*B[0]);
+        final float beta = (C[0]*D[1]-C[1]*D[1]);
+        final float xi = ((C[0]-D[0])*alpha-(A[0]-B[0])*beta)/determinant;
+
+        final float gamma0 = (xi - A[0])/(B[0] - A[0]);
+        final float gamma1 = (xi - C[0])/(D[0] - C[0]);
+        if( FloatUtil.compare(gamma0, 0.0f, epsilon) <= 0 ||
+            FloatUtil.compare(gamma0, 1.0f, epsilon) >= 0 ||
+            FloatUtil.compare(gamma1, 0.0f, epsilon) <= 0 ||
+            FloatUtil.compare(gamma1, 1.0f, epsilon) >= 0 ) {
+            return false;
+        }
+
+        if(gamma0 <= 0 || gamma0 >= 1 || gamma1 <= 0 || gamma1 >= 1) {
+            return false;
+        }
+
+        return true;
     }
 
-    /** Compute intersection between two lines
+    /**
+     * Compute intersection between two lines
      * @param a vertex 1 of first line
      * @param b vertex 2 of first line
      * @param c vertex 1 of second line
@@ -420,7 +1139,9 @@ public class VectorUtil {
      * @return the intersection coordinates if the lines intersect, otherwise
      * returns null
      */
-    public static float[] line2lineIntersection(Vert2fImmutable a, Vert2fImmutable b, Vert2fImmutable c, Vert2fImmutable d) {
+    public static float[] line2lineIntersection(final float[] result,
+                                                final Vert2fImmutable a, final Vert2fImmutable b,
+                                                final Vert2fImmutable c, final Vert2fImmutable d) {
         final float determinant = (a.getX()-b.getX())*(c.getY()-d.getY()) - (a.getY()-b.getY())*(c.getX()-d.getX());
 
         if (determinant == 0)
@@ -431,10 +1152,14 @@ public class VectorUtil {
         final float xi = ((c.getX()-d.getX())*alpha-(a.getX()-b.getX())*beta)/determinant;
         final float yi = ((c.getY()-d.getY())*alpha-(a.getY()-b.getY())*beta)/determinant;
 
-        return new float[]{xi,yi,0};
+        result[0] = xi;
+        result[1] = yi;
+        result[2] = 0;
+        return result;
     }
 
-    /** Check if a segment intersects with a triangle
+    /**
+     * Check if a segment intersects with a triangle
      * @param a vertex 1 of the triangle
      * @param b vertex 2 of the triangle
      * @param c vertex 3 of the triangle
@@ -442,14 +1167,26 @@ public class VectorUtil {
      * @param e vertex 2 of first segment
      * @return true if the segment intersects at least one segment of the triangle, false otherwise
      */
-    public static boolean tri2SegIntersection(Vert2fImmutable a, Vert2fImmutable b, Vert2fImmutable c, Vert2fImmutable d, Vert2fImmutable e){
-        if(seg2SegIntersection(a, b, d, e) != null)
-            return true;
-        if(seg2SegIntersection(b, c, d, e) != null)
-            return true;
-        if(seg2SegIntersection(a, c, d, e) != null)
-            return true;
-
-        return false;
+    public static boolean testTri2SegIntersection(final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c,
+                                                  final Vert2fImmutable d, final Vert2fImmutable e){
+        return testSeg2SegIntersection(a, b, d, e) ||
+               testSeg2SegIntersection(b, c, d, e) ||
+               testSeg2SegIntersection(a, c, d, e) ;
+    }
+    /**
+     * Check if a segment intersects with a triangle, using given epsilon for comparison.
+     * @param a vertex 1 of the triangle
+     * @param b vertex 2 of the triangle
+     * @param c vertex 3 of the triangle
+     * @param d vertex 1 of first segment
+     * @param e vertex 2 of first segment
+     * @return true if the segment intersects at least one segment of the triangle, false otherwise
+     */
+    public static boolean testTri2SegIntersection(final Vert2fImmutable a, final Vert2fImmutable b, final Vert2fImmutable c,
+                                                  final Vert2fImmutable d, final Vert2fImmutable e,
+                                                  final float epsilon){
+        return testSeg2SegIntersection(a, b, d, e, epsilon) ||
+               testSeg2SegIntersection(b, c, d, e, epsilon) ||
+               testSeg2SegIntersection(a, c, d, e, epsilon) ;
     }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
index d48677d..4caff95 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/geom/AABBox.java
@@ -27,6 +27,11 @@
  */
 package com.jogamp.opengl.math.geom;
 
+import jogamp.graph.geom.plane.AffineTransform;
+
+import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.math.Quaternion;
+import com.jogamp.opengl.math.Ray;
 import com.jogamp.opengl.math.VectorUtil;
 
 
@@ -34,21 +39,41 @@ import com.jogamp.opengl.math.VectorUtil;
  * Axis Aligned Bounding Box. Defined by two 3D coordinates (low and high)
  * The low being the the lower left corner of the box, and the high being the upper
  * right corner of the box.
+ * <p>
+ * A few references for collision detection, intersections:
+ * <pre>
+ * http://www.realtimerendering.com/intersections.html
+ * http://www.codercorner.com/RayAABB.cpp
+ * http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtinter0.htm
+ * http://realtimecollisiondetection.net/files/levine_swept_sat.txt
+ * </pre>
+ * </p>
  *
  */
-public class AABBox implements Cloneable {
-    private float[] low = new float[3];
-    private float[] high = new float[3];
-    private float[] center = new float[3];
+public class AABBox {
+    private static final boolean DEBUG = FloatUtil.DEBUG;
+    private final float[] low = new float[3];
+    private final float[] high = new float[3];
+    private final float[] center = new float[3];
 
-    /** Create a Axis Aligned bounding box (AABBox)
+    /**
+     * Create an Axis Aligned bounding box (AABBox)
      * where the low and and high MAX float Values.
      */
     public AABBox() {
         reset();
     }
 
-    /** Create an AABBox specifying the coordinates
+    /**
+     * Create an AABBox copying all values from the given one
+     * @param src the box value to be used for the new instance
+     */
+    public AABBox(final AABBox src) {
+        copy(src);
+    }
+
+    /**
+     * Create an AABBox specifying the coordinates
      * of the low and high
      * @param lx min x-coordinate
      * @param ly min y-coordnate
@@ -57,26 +82,31 @@ public class AABBox implements Cloneable {
      * @param hy max y-coordinate
      * @param hz max z-coordinate
      */
-    public AABBox(float lx, float ly, float lz,
-                  float hx, float hy, float hz) {
+    public AABBox(final float lx, final float ly, final float lz,
+                  final float hx, final float hy, final float hz) {
         setSize(lx, ly, lz, hx, hy, hz);
     }
 
-    /** Create a AABBox defining the low and high
+    /**
+     * Create a AABBox defining the low and high
      * @param low min xyz-coordinates
      * @param high max xyz-coordinates
      */
-    public AABBox(float[] low, float[] high) {
-        setSize(low[0],low[1],low[2], high[0],high[1],high[2]);
+    public AABBox(final float[] low, final float[] high) {
+        setSize(low, high);
     }
 
-    /** resets this box to the inverse low/high, allowing the next {@link #resize(float, float, float)} command to hit. */
-    public final void reset() {
+    /**
+     * resets this box to the inverse low/high, allowing the next {@link #resize(float, float, float)} command to hit.
+     * @return this AABBox for chaining
+     */
+    public final AABBox reset() {
         setLow(Float.MAX_VALUE,Float.MAX_VALUE,Float.MAX_VALUE);
         setHigh(-1*Float.MAX_VALUE,-1*Float.MAX_VALUE,-1*Float.MAX_VALUE);
         center[0] = 0f;
         center[1] = 0f;
         center[2] = 0f;
+        return this;
     }
 
     /** Get the max xyz-coordinates
@@ -86,7 +116,7 @@ public class AABBox implements Cloneable {
         return high;
     }
 
-    private final void setHigh(float hx, float hy, float hz) {
+    private final void setHigh(final float hx, final float hy, final float hz) {
         this.high[0] = hx;
         this.high[1] = hy;
         this.high[2] = hz;
@@ -99,16 +129,41 @@ public class AABBox implements Cloneable {
         return low;
     }
 
-    private final void setLow(float lx, float ly, float lz) {
+    private final void setLow(final float lx, final float ly, final float lz) {
         this.low[0] = lx;
         this.low[1] = ly;
         this.low[2] = lz;
     }
 
     private final void computeCenter() {
-        center[0] = (high[0] + low[0])/2;
-        center[1] = (high[1] + low[1])/2;
-        center[2] = (high[2] + low[2])/2;
+        center[0] = (high[0] + low[0])/2f;
+        center[1] = (high[1] + low[1])/2f;
+        center[2] = (high[2] + low[2])/2f;
+    }
+
+    /**
+     * Copy given AABBox 'src' values to this AABBox.
+     *
+     * @param src source AABBox
+     * @return this AABBox for chaining
+     */
+    public final AABBox copy(final AABBox src) {
+        System.arraycopy(src.low, 0, low, 0, 3);
+        System.arraycopy(src.high, 0, high, 0, 3);
+        System.arraycopy(src.center, 0, center, 0, 3);
+        return this;
+    }
+
+    /**
+     * Set size of the AABBox specifying the coordinates
+     * of the low and high.
+     *
+     * @param low min xyz-coordinates
+     * @param high max xyz-coordinates
+     * @return this AABBox for chaining
+     */
+    public final AABBox setSize(final float[] low, final float[] high) {
+        return setSize(low[0],low[1],low[2], high[0],high[1],high[2]);
     }
 
     /**
@@ -121,9 +176,10 @@ public class AABBox implements Cloneable {
      * @param hx max x-coordinate
      * @param hy max y-coordinate
      * @param hz max z-coordinate
+     * @return this AABBox for chaining
      */
-    public final void setSize(float lx, float ly, float lz,
-                              float hx, float hy, float hz) {
+    public final AABBox setSize(final float lx, final float ly, final float lz,
+                                final float hx, final float hy, final float hz) {
         this.low[0] = lx;
         this.low[1] = ly;
         this.low[2] = lz;
@@ -131,14 +187,17 @@ public class AABBox implements Cloneable {
         this.high[1] = hy;
         this.high[2] = hz;
         computeCenter();
+        return this;
     }
 
-    /** Resize the AABBox to encapsulate another AABox
+    /**
+     * Resize the AABBox to encapsulate another AABox
      * @param newBox AABBox to be encapsulated in
+     * @return this AABBox for chaining
      */
-    public final void resize(AABBox newBox) {
-        float[] newLow = newBox.getLow();
-        float[] newHigh = newBox.getHigh();
+    public final AABBox resize(final AABBox newBox) {
+        final float[] newLow = newBox.getLow();
+        final float[] newHigh = newBox.getHigh();
 
         /** test low */
         if (newLow[0] < low[0])
@@ -157,51 +216,112 @@ public class AABBox implements Cloneable {
             high[2] = newHigh[2];
 
         computeCenter();
+        return this;
+    }
+
+    /**
+     * Resize the AABBox to encapsulate another AABox, which will be <i>transformed</i> on the fly first.
+     * @param newBox AABBox to be encapsulated in
+     * @param t the {@link AffineTransform} applied on <i>newBox</i> on the fly
+     * @param tmpV3 temp float[3] storage
+     * @return this AABBox for chaining
+     */
+    public final AABBox resize(final AABBox newBox, final AffineTransform t, final float[] tmpV3) {
+        /** test low */
+        {
+            final float[] newBoxLow = newBox.getLow();
+            t.transform(newBoxLow, tmpV3);
+            tmpV3[2] = newBoxLow[2];
+            if (tmpV3[0] < low[0])
+                low[0] = tmpV3[0];
+            if (tmpV3[1] < low[1])
+                low[1] = tmpV3[1];
+            if (tmpV3[2] < low[2])
+                low[2] = tmpV3[2];
+        }
+
+        /** test high */
+        {
+            final float[] newBoxHigh = newBox.getHigh();
+            t.transform(newBoxHigh, tmpV3);
+            tmpV3[2] = newBoxHigh[2];
+            if (tmpV3[0] > high[0])
+                high[0] = tmpV3[0];
+            if (tmpV3[1] > high[1])
+                high[1] = tmpV3[1];
+            if (tmpV3[2] > high[2])
+                high[2] = tmpV3[2];
+        }
+
+        computeCenter();
+        return this;
     }
 
-    /** Resize the AABBox to encapsulate the passed
+    /**
+     * Resize the AABBox to encapsulate the passed
      * xyz-coordinates.
      * @param x x-axis coordinate value
      * @param y y-axis coordinate value
      * @param z z-axis coordinate value
+     * @return this AABBox for chaining
      */
-    public final void resize(float x, float y, float z) {
+    public final AABBox resize(final float x, final float y, final float z) {
         /** test low */
-        if (x < low[0])
+        if (x < low[0]) {
             low[0] = x;
-        if (y < low[1])
+        }
+        if (y < low[1]) {
             low[1] = y;
-        if (z < low[2])
+        }
+        if (z < low[2]) {
             low[2] = z;
+        }
 
         /** test high */
-        if (x > high[0])
+        if (x > high[0]) {
             high[0] = x;
-        if (y > high[1])
+        }
+        if (y > high[1]) {
             high[1] = y;
-        if (z > high[2])
+        }
+        if (z > high[2]) {
             high[2] = z;
+        }
 
         computeCenter();
+        return this;
     }
 
-    /** Resize the AABBox to encapsulate the passed
+    /**
+     * Resize the AABBox to encapsulate the passed
      * xyz-coordinates.
      * @param xyz xyz-axis coordinate values
      * @param offset of the array
+     * @return this AABBox for chaining
      */
-    public final void resize(float[] xyz, int offset) {
-        resize(xyz[0+offset], xyz[1+offset], xyz[2+offset]);
+    public final AABBox resize(final float[] xyz, final int offset) {
+        return resize(xyz[0+offset], xyz[1+offset], xyz[2+offset]);
     }
 
-    /** Check if the x & y coordinates are bounded/contained
-     *  by this AABBox
+    /**
+     * Resize the AABBox to encapsulate the passed
+     * xyz-coordinates.
+     * @param xyz xyz-axis coordinate values
+     * @return this AABBox for chaining
+     */
+    public final AABBox resize(final float[] xyz) {
+        return resize(xyz[0], xyz[1], xyz[2]);
+    }
+
+    /**
+     * Check if the x & y coordinates are bounded/contained
+     * by this AABBox
      * @param x  x-axis coordinate value
      * @param y  y-axis coordinate value
      * @return true if  x belong to (low.x, high.x) and
      * y belong to (low.y, high.y)
      */
-    public final boolean contains(float x, float y) {
+    public final boolean contains(final float x, final float y) {
         if(x<low[0] || x>high[0]){
             return false;
         }
@@ -211,15 +331,16 @@ public class AABBox implements Cloneable {
         return true;
     }
 
-    /** Check if the xyz coordinates are bounded/contained
-     *  by this AABBox.
+    /**
+     * Check if the xyz coordinates are bounded/contained
+     * by this AABBox.
      * @param x x-axis coordinate value
      * @param y y-axis coordinate value
      * @param z z-axis coordinate value
      * @return true if  x belong to (low.x, high.x) and
      * y belong to (low.y, high.y) and  z belong to (low.z, high.z)
      */
-    public final boolean contains(float x, float y, float z) {
+    public final boolean contains(final float x, final float y, final float z) {
         if(x<low[0] || x>high[0]){
             return false;
         }
@@ -232,15 +353,16 @@ public class AABBox implements Cloneable {
         return true;
     }
 
-    /** Check if there is a common region between this AABBox and the passed
-     *     2D region irrespective of z range
+    /**
+     * Check if there is a common region between this AABBox and the passed
+     * 2D region irrespective of z range
      * @param x lower left x-coord
      * @param y lower left y-coord
      * @param w width
      * @param h hight
      * @return true if this AABBox might have a common region with this 2D region
      */
-    public final boolean intersects(float x, float y, float w, float h) {
+    public final boolean intersects2DRegion(final float x, final float y, final float w, final float h) {
         if (w <= 0 || h <= 0) {
             return false;
         }
@@ -259,42 +381,248 @@ public class AABBox implements Cloneable {
                 y < y0 + _h);
     }
 
+    /**
+     * Check if {@link Ray} intersects this bounding box.
+     * <p>
+     * Versions uses the SAT[1], testing 6 axes.
+     * Original code for OBBs from MAGIC.
+     * Rewritten for AABBs and reorganized for early exits[2].
+     * </p>
+     * <pre>
+     * [1] SAT = Separating Axis Theorem
+     * [2] http://www.codercorner.com/RayAABB.cpp
+     * </pre>
+     * @param ray
+     * @return
+     */
+    public final boolean intersectsRay(final Ray ray) {
+        // diff[XYZ] -> VectorUtil.subVec3(diff, ray.orig, center);
+        //  ext[XYZ] -> extend VectorUtil.subVec3(ext, high, center);
+
+        final float dirX  = ray.dir[0];
+        final float diffX = ray.orig[0] - center[0];
+        final float extX  = high[0] - center[0];
+        if( Math.abs(diffX) > extX && diffX*dirX >= 0f ) return false;
+
+        final float dirY  = ray.dir[1];
+        final float diffY = ray.orig[1] - center[1];
+        final float extY  = high[1] - center[1];
+        if( Math.abs(diffY) > extY && diffY*dirY >= 0f ) return false;
+
+        final float dirZ  = ray.dir[2];
+        final float diffZ = ray.orig[2] - center[2];
+        final float extZ  = high[2] - center[2];
+        if( Math.abs(diffZ) > extZ && diffZ*dirZ >= 0f ) return false;
+
+        final float absDirY = Math.abs(dirY);
+        final float absDirZ = Math.abs(dirZ);
+
+        float f = dirY * diffZ - dirZ * diffY;
+        if( Math.abs(f) > extY*absDirZ + extZ*absDirY ) return false;
+
+        final float absDirX = Math.abs(dirX);
+
+        f = dirZ * diffX - dirX * diffZ;
+        if( Math.abs(f) > extX*absDirZ + extZ*absDirX ) return false;
+
+        f = dirX * diffY - dirY * diffX;
+        if( Math.abs(f) > extX*absDirY + extY*absDirX ) return false;
+
+        return true;
+    }
+
+    /**
+     * Return intersection of a {@link Ray} with this bounding box,
+     * or null if none exist.
+     * <p>
+     * <ul>
+     *  <li>Original code by Andrew Woo, from "Graphics Gems", Academic Press, 1990 [2]</li>
+     *  <li>Optimized code by Pierre Terdiman, 2000 (~20-30% faster on my Celeron 500)</li>
+     *  <li>Epsilon value added by Klaus Hartmann.</li>
+     * </ul>
+     * Method is based on the requirements:
+     * <ul>
+     *  <li>the integer representation of 0.0f is 0x00000000</li>
+     *  <li>the sign bit of the float is the most significant one</li>
+     * </ul>
+     * Report bugs: p.terdiman at codercorner.com
+     * </p>
+     * <pre>
+     * [1] http://www.codercorner.com/RayAABB.cpp
+     * [2] http://tog.acm.org/resources/GraphicsGems/gems/RayBox.c
+     * </pre>
+     * @param result vec3
+     * @param ray
+     * @param epsilon
+     * @param assumeIntersection if true, method assumes an intersection, i.e. by pre-checking via {@link #intersectsRay(Ray)}.
+     *                           In this case method will not validate a possible non-intersection and just computes
+     *                           coordinates.
+     * @param tmp1V3 temp vec3
+     * @param tmp2V3 temp vec3
+     * @param tmp3V3 temp vec3
+     * @return float[3] result of intersection coordinates, or null if none exists
+     */
+    public final float[] getRayIntersection(final float[] result, final Ray ray, final float epsilon,
+                                            final boolean assumeIntersection,
+                                            final float[] tmp1V3, final float[] tmp2V3, final float[] tmp3V3) {
+        final float[] maxT = { -1f, -1f, -1f };
+
+        final float[] origin = ray.orig;
+        final float[] dir = ray.dir;
+
+        boolean inside = true;
+
+        // Find candidate planes.
+        for(int i=0; i<3; i++) {
+            if(origin[i] < low[i]) {
+                result[i] = low[i];
+                inside    = false;
+
+                // Calculate T distances to candidate planes
+                if( 0 != Float.floatToIntBits(dir[i]) ) {
+                    maxT[i] = (low[i] - origin[i]) / dir[i];
+                }
+            } else if(origin[i] > high[i]) {
+                result[i] = high[i];
+                inside    = false;
+
+                // Calculate T distances to candidate planes
+                if( 0 != Float.floatToIntBits(dir[i]) ) {
+                    maxT[i] = (high[i] - origin[i]) / dir[i];
+                }
+            }
+        }
 
-    /** Get the size of the Box where the size is represented by the
+        // Ray origin inside bounding box
+        if(inside) {
+            System.arraycopy(origin, 0, result, 0, 3);
+            return result;
+        }
+
+        // Get largest of the maxT's for final choice of intersection
+        int whichPlane = 0;
+        if(maxT[1] > maxT[whichPlane]) { whichPlane = 1; }
+        if(maxT[2] > maxT[whichPlane]) { whichPlane = 2; }
+
+        if( !assumeIntersection ) {
+            // Check final candidate actually inside box
+            if( 0 != ( Float.floatToIntBits(maxT[whichPlane]) & 0x80000000 ) ) {
+                return null;
+            }
+
+            /** Use unrolled version below ..
+            for(int i=0; i<3; i++) {
+                if( i!=whichPlane ) {
+                    result[i] = origin[i] + maxT[whichPlane] * dir[i];
+                    if(result[i] < minB[i] - epsilon || result[i] > maxB[i] + epsilon) { return null; }
+                    // if(result[i] < minB[i] || result[i] > maxB[i] ) { return null; }
+                }
+            } */
+            switch( whichPlane ) {
+                case 0:
+                    result[1] = origin[1] + maxT[whichPlane] * dir[1];
+                    if(result[1] < low[1] - epsilon || result[1] > high[1] + epsilon) { return null; }
+                    result[2] = origin[2] + maxT[whichPlane] * dir[2];
+                    if(result[2] < low[2] - epsilon || result[2] > high[2] + epsilon) { return null; }
+                    break;
+                case 1:
+                    result[0] = origin[0] + maxT[whichPlane] * dir[0];
+                    if(result[0] < low[0] - epsilon || result[0] > high[0] + epsilon) { return null; }
+                    result[2] = origin[2] + maxT[whichPlane] * dir[2];
+                    if(result[2] < low[2] - epsilon || result[2] > high[2] + epsilon) { return null; }
+                    break;
+                case 2:
+                    result[0] = origin[0] + maxT[whichPlane] * dir[0];
+                    if(result[0] < low[0] - epsilon || result[0] > high[0] + epsilon) { return null; }
+                    result[1] = origin[1] + maxT[whichPlane] * dir[1];
+                    if(result[1] < low[1] - epsilon || result[1] > high[1] + epsilon) { return null; }
+                    break;
+                default:
+                    throw new InternalError("XXX");
+            }
+        } else {
+            switch( whichPlane ) {
+                case 0:
+                    result[1] = origin[1] + maxT[whichPlane] * dir[1];
+                    result[2] = origin[2] + maxT[whichPlane] * dir[2];
+                    break;
+                case 1:
+                    result[0] = origin[0] + maxT[whichPlane] * dir[0];
+                    result[2] = origin[2] + maxT[whichPlane] * dir[2];
+                    break;
+                case 2:
+                    result[0] = origin[0] + maxT[whichPlane] * dir[0];
+                    result[1] = origin[1] + maxT[whichPlane] * dir[1];
+                    break;
+                default:
+                    throw new InternalError("XXX");
+            }
+        }
+        return result; // ray hits box
+    }
+
+    /**
+     * Get the size of this AABBox where the size is represented by the
      * length of the vector between low and high.
      * @return a float representing the size of the AABBox
      */
     public final float getSize() {
-        return VectorUtil.computeLength(low, high);
+        return VectorUtil.distVec3(low, high);
     }
 
-    /**Get the Center of the AABBox
+    /**
+     * Get the Center of this AABBox
      * @return the xyz-coordinates of the center of the AABBox
      */
     public final float[] getCenter() {
         return center;
     }
 
-    /** Scale the AABBox by a constant
+    /**
+     * Scale this AABBox by a constant
      * @param size a constant float value
+     * @param tmpV3 caller provided temporary 3-component vector
+     * @return this AABBox for chaining
      */
-    public final void scale(float size) {
-        float[] diffH = new float[3];
-        diffH[0] = high[0] - center[0];
-        diffH[1] = high[1] - center[1];
-        diffH[2] = high[2] - center[2];
+    public final AABBox scale(final float size, final float[] tmpV3) {
+        tmpV3[0] = high[0] - center[0];
+        tmpV3[1] = high[1] - center[1];
+        tmpV3[2] = high[2] - center[2];
 
-        diffH = VectorUtil.scale(diffH, size);
+        VectorUtil.scaleVec3(tmpV3, tmpV3, size); // in-place scale
+        VectorUtil.addVec3(high, center, tmpV3);
 
-        float[] diffL = new float[3];
-        diffL[0] = low[0] - center[0];
-        diffL[1] = low[1] - center[1];
-        diffL[2] = low[2] - center[2];
+        tmpV3[0] = low[0] - center[0];
+        tmpV3[1] = low[1] - center[1];
+        tmpV3[2] = low[2] - center[2];
 
-        diffL = VectorUtil.scale(diffL, size);
+        VectorUtil.scaleVec3(tmpV3, tmpV3, size); // in-place scale
+        VectorUtil.addVec3(low, center, tmpV3);
+        return this;
+    }
 
-        high = VectorUtil.vectorAdd(center, diffH);
-        low = VectorUtil.vectorAdd(center, diffL);
+    /**
+     * Translate this AABBox by a float[3] vector
+     * @param t the float[3] translation vector
+     * @return this AABBox for chaining
+     */
+    public final AABBox translate(final float[] t) {
+        VectorUtil.addVec3(low, low, t); // in-place translate
+        VectorUtil.addVec3(high, high, t); // in-place translate
+        computeCenter();
+        return this;
+    }
+
+    /**
+     * Rotate this AABBox by a float[3] vector
+     * @param quat the {@link Quaternion} used for rotation
+     * @return this AABBox for chaining
+     */
+    public final AABBox rotate(final Quaternion quat) {
+        quat.rotateVector(low, 0, low, 0);
+        quat.rotateVector(high, 0, high, 0);
+        computeCenter();
+        return this;
     }
 
     public final float getMinX() {
@@ -334,12 +662,7 @@ public class AABBox implements Cloneable {
     }
 
     @Override
-    public final AABBox clone() {
-        return new AABBox(this.low, this.high);
-    }
-
-    @Override
-    public final boolean equals(Object obj) {
+    public final boolean equals(final Object obj) {
         if( obj == this ) {
             return true;
         }
@@ -347,13 +670,88 @@ public class AABBox implements Cloneable {
             return false;
         }
         final AABBox other = (AABBox) obj;
-        return VectorUtil.checkEquality(low, other.low) &&
-               VectorUtil.checkEquality(high, other.high) ;
+        return VectorUtil.isVec2Equal(low, 0, other.low, 0, FloatUtil.EPSILON) &&
+               VectorUtil.isVec3Equal(high, 0, other.high, 0, FloatUtil.EPSILON) ;
+    }
+    @Override
+    public final int hashCode() {
+        throw new InternalError("hashCode not designed");
+    }
+
+    /**
+     * Assume this bounding box as being in object space and
+     * compute the window bounding box.
+     * <p>
+     * If <code>useCenterZ</code> is <code>true</code>,
+     * only 4 {@link FloatUtil#mapObjToWinCoords(float, float, float, float[], int[], int, float[], int, float[], float[]) mapObjToWinCoords}
+     * operations are made on points [1..4] using {@link #getCenter()}'s z-value.
+     * Otherwise 8 {@link FloatUtil#mapObjToWinCoords(float, float, float, float[], int[], int, float[], int, float[], float[]) mapObjToWinCoords}
+     * operation on all 8 points are performed.
+     * </p>
+     * <pre>
+     *  [2] ------ [4]
+     *   |          |
+     *   |          |
+     *  [1] ------ [3]
+     * </pre>
+     * @param mat4PMv P x Mv matrix
+     * @param view
+     * @param useCenterZ
+     * @param vec3Tmp0 3 component vector for temp storage
+     * @param vec4Tmp1 4 component vector for temp storage
+     * @param vec4Tmp2 4 component vector for temp storage
+     * @return
+     */
+    public AABBox mapToWindow(final AABBox result, final float[/*16*/] mat4PMv, final int[] view, final boolean useCenterZ,
+                              final float[] vec3Tmp0, final float[] vec4Tmp1, final float[] vec4Tmp2) {
+        {
+            // System.err.printf("AABBox.mapToWindow.0: view[%d, %d, %d, %d], this %s%n", view[0], view[1], view[2], view[3], toString());
+            final float objZ = useCenterZ ? center[2] : getMinZ();
+            FloatUtil.mapObjToWinCoords(getMinX(), getMinY(), objZ, mat4PMv, view, 0, vec3Tmp0, 0, vec4Tmp1, vec4Tmp2);
+            // System.err.printf("AABBox.mapToWindow.p1: %f, %f, %f -> %f, %f, %f%n", getMinX(), getMinY(), objZ, vec3Tmp0[0], vec3Tmp0[1], vec3Tmp0[2]);
+            // System.err.println("AABBox.mapToWindow.p1:");
+            // System.err.println(FloatUtil.matrixToString(null, "  mat4PMv", "%10.5f", mat4PMv, 0, 4, 4, false /* rowMajorOrder */));
+
+            result.reset();
+            result.resize(vec3Tmp0, 0);
+
+            FloatUtil.mapObjToWinCoords(getMinX(), getMaxY(), objZ, mat4PMv, view, 0, vec3Tmp0, 0, vec4Tmp1, vec4Tmp2);
+            // System.err.printf("AABBox.mapToWindow.p2: %f, %f, %f -> %f, %f, %f%n", getMinX(), getMaxY(), objZ, vec3Tmp0[0], vec3Tmp0[1], vec3Tmp0[2]);
+            result.resize(vec3Tmp0, 0);
+
+            FloatUtil.mapObjToWinCoords(getMaxX(), getMinY(), objZ, mat4PMv, view, 0, vec3Tmp0, 0, vec4Tmp1, vec4Tmp2);
+            // System.err.printf("AABBox.mapToWindow.p3: %f, %f, %f -> %f, %f, %f%n", getMaxX(), getMinY(), objZ, vec3Tmp0[0], vec3Tmp0[1], vec3Tmp0[2]);
+            result.resize(vec3Tmp0, 0);
+
+            FloatUtil.mapObjToWinCoords(getMaxX(), getMaxY(), objZ, mat4PMv, view, 0, vec3Tmp0, 0, vec4Tmp1, vec4Tmp2);
+            // System.err.printf("AABBox.mapToWindow.p4: %f, %f, %f -> %f, %f, %f%n", getMaxX(), getMaxY(), objZ, vec3Tmp0[0], vec3Tmp0[1], vec3Tmp0[2]);
+            result.resize(vec3Tmp0, 0);
+        }
+
+        if( !useCenterZ ) {
+            final float objZ = getMaxZ();
+            FloatUtil.mapObjToWinCoords(getMinX(), getMinY(), objZ, mat4PMv, view, 0, vec3Tmp0, 0, vec4Tmp1, vec4Tmp2);
+            result.resize(vec3Tmp0, 0);
+
+            FloatUtil.mapObjToWinCoords(getMinX(), getMaxY(), objZ, mat4PMv, view, 0, vec3Tmp0, 0, vec4Tmp1, vec4Tmp2);
+            result.resize(vec3Tmp0, 0);
+
+            FloatUtil.mapObjToWinCoords(getMaxX(), getMinY(), objZ, mat4PMv, view, 0, vec3Tmp0, 0, vec4Tmp1, vec4Tmp2);
+            result.resize(vec3Tmp0, 0);
+
+            FloatUtil.mapObjToWinCoords(getMaxX(), getMaxY(), objZ, mat4PMv, view, 0, vec3Tmp0, 0, vec4Tmp1, vec4Tmp2);
+            result.resize(vec3Tmp0, 0);
+        }
+        if( DEBUG ) {
+            System.err.printf("AABBox.mapToWindow: view[%d, %d], this %s -> %s%n", view[0], view[1], toString(), result.toString());
+        }
+        return result;
     }
 
     @Override
     public final String toString() {
-        return "[ "+low[0]+"/"+low[1]+"/"+low[1]+" .. "+high[0]+"/"+high[0]+"/"+high[0]+", ctr "+
-                    center[0]+"/"+center[1]+"/"+center[1]+" ]";
+        return "[ dim "+getWidth()+" x "+getHeight()+" x "+getDepth()+
+               ", box "+low[0]+" / "+low[1]+" / "+low[2]+" .. "+high[0]+" / "+high[1]+" / "+high[2]+
+               ", ctr "+center[0]+" / "+center[1]+" / "+center[2]+" ]";
     }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java b/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
index fb31108..f6d3c0d 100644
--- a/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
+++ b/src/jogl/classes/com/jogamp/opengl/math/geom/Frustum.java
@@ -27,6 +27,8 @@
  */
 package com.jogamp.opengl.math.geom;
 
+import jogamp.common.os.PlatformPropsImpl;
+
 import com.jogamp.common.os.Platform;
 
 /**
@@ -68,7 +70,7 @@ import com.jogamp.common.os.Platform;
  */
 public class Frustum {
     /** Normalized planes[l, r, b, t, n, f] */
-	protected Plane[] planes = new Plane[6];
+	protected final Plane[] planes = new Plane[6];
 
 	/**
 	 * Creates an undefined instance w/o calculating the frustum.
@@ -113,12 +115,12 @@ public class Frustum {
          * Negative halfspace is the <i>other side</i> of the plane, i.e. *-1
          * </p>
          **/
-        public final float distanceTo(float x, float y, float z) {
+        public final float distanceTo(final float x, final float y, final float z) {
             return n[0] * x + n[1] * y + n[2] * z + d;
         }
 
         /** Return distance of plane to given point, see {@link #distanceTo(float, float, float)}. */
-        public final float distanceTo(float[] p) {
+        public final float distanceTo(final float[] p) {
             return n[0] * p[0] + n[1] * p[1] + n[2] * p[2] + d;
         }
 
@@ -164,7 +166,7 @@ public class Frustum {
      * Copy the given <code>src</code> planes into this this instance's planes.
      * @param src the 6 source planes
      */
-    public final void updateByPlanes(Plane[] src) {
+    public final void updateByPlanes(final Plane[] src) {
         for (int i = 0; i < 6; ++i) {
             final Plane p0 = planes[i];
             final float[] p0_n = p0.n;
@@ -185,9 +187,9 @@ public class Frustum {
      * as required by this class.
      * </p>
      */
-    public void updateByPMV(float[] pmv, int pmv_off) {
-        // Left:   a = m41 + m11, b = m42 + m12, c = m43 + m13, d = m44 + m14  - [1..4] row-major
-        // Left:   a = m30 + m00, b = m31 + m01, c = m32 + m02, d = m33 + m03  - [0..3] row-major
+    public void updateByPMV(final float[] pmv, final int pmv_off) {
+        // Left:   a = m41 + m11, b = m42 + m12, c = m43 + m13, d = m44 + m14  - [1..4] column-major
+        // Left:   a = m30 + m00, b = m31 + m01, c = m32 + m02, d = m33 + m03  - [0..3] column-major
         {
             final Plane p = planes[LEFT];
             final float[] p_n = p.n;
@@ -197,8 +199,8 @@ public class Frustum {
             p.d    = pmv[ pmv_off + 3 + 3 * 4 ] + pmv[ pmv_off + 0 + 3 * 4 ];
         }
 
-        // Right:  a = m41 - m11, b = m42 - m12, c = m43 - m13, d = m44 - m14  - [1..4] row-major
-        // Right:  a = m30 - m00, b = m31 - m01, c = m32 - m02, d = m33 - m03  - [0..3] row-major
+        // Right:  a = m41 - m11, b = m42 - m12, c = m43 - m13, d = m44 - m14  - [1..4] column-major
+        // Right:  a = m30 - m00, b = m31 - m01, c = m32 - m02, d = m33 - m03  - [0..3] column-major
         {
             final Plane p = planes[RIGHT];
             final float[] p_n = p.n;
@@ -208,8 +210,8 @@ public class Frustum {
             p.d    = pmv[ pmv_off + 3 + 3 * 4 ] - pmv[ pmv_off + 0 + 3 * 4 ];
         }
 
-        // Bottom: a = m41 + m21, b = m42 + m22, c = m43 + m23, d = m44 + m24  - [1..4] row-major
-        // Bottom: a = m30 + m10, b = m31 + m11, c = m32 + m12, d = m33 + m13  - [0..3] row-major
+        // Bottom: a = m41 + m21, b = m42 + m22, c = m43 + m23, d = m44 + m24  - [1..4] column-major
+        // Bottom: a = m30 + m10, b = m31 + m11, c = m32 + m12, d = m33 + m13  - [0..3] column-major
         {
             final Plane p = planes[BOTTOM];
             final float[] p_n = p.n;
@@ -219,8 +221,8 @@ public class Frustum {
             p.d    = pmv[ pmv_off + 3 + 3 * 4 ] + pmv[ pmv_off + 1 + 3 * 4 ];
         }
 
-        // Top:   a = m41 - m21, b = m42 - m22, c = m43 - m23, d = m44 - m24  - [1..4] row-major
-        // Top:   a = m30 - m10, b = m31 - m11, c = m32 - m12, d = m33 - m13  - [0..3] row-major
+        // Top:   a = m41 - m21, b = m42 - m22, c = m43 - m23, d = m44 - m24  - [1..4] column-major
+        // Top:   a = m30 - m10, b = m31 - m11, c = m32 - m12, d = m33 - m13  - [0..3] column-major
         {
             final Plane p = planes[TOP];
             final float[] p_n = p.n;
@@ -230,8 +232,8 @@ public class Frustum {
             p.d    = pmv[ pmv_off + 3 + 3 * 4 ] - pmv[ pmv_off + 1 + 3 * 4 ];
         }
 
-        // Near:  a = m41 + m31, b = m42 + m32, c = m43 + m33, d = m44 + m34  - [1..4] row-major
-        // Near:  a = m30 + m20, b = m31 + m21, c = m32 + m22, d = m33 + m23  - [0..3] row-major
+        // Near:  a = m41 + m31, b = m42 + m32, c = m43 + m33, d = m44 + m34  - [1..4] column-major
+        // Near:  a = m30 + m20, b = m31 + m21, c = m32 + m22, d = m33 + m23  - [0..3] column-major
         {
             final Plane p = planes[NEAR];
             final float[] p_n = p.n;
@@ -241,8 +243,8 @@ public class Frustum {
             p.d    = pmv[ pmv_off + 3 + 3 * 4 ] + pmv[ pmv_off + 2 + 3 * 4 ];
         }
 
-        // Far:   a = m41 - m31, b = m42 - m32, c = m43 - m33, d = m44 - m34  - [1..4] row-major
-        // Far:   a = m30 - m20, b = m31 - m21, c = m32 + m22, d = m33 + m23  - [0..3] row-major
+        // Far:   a = m41 - m31, b = m42 - m32, c = m43 - m33, d = m44 - m34  - [1..4] column-major
+        // Far:   a = m30 - m20, b = m31 - m21, c = m32 + m22, d = m33 + m23  - [0..3] column-major
         {
             final Plane p = planes[FAR];
             final float[] p_n = p.n;
@@ -265,7 +267,7 @@ public class Frustum {
         }
     }
 
-	private static final boolean isOutsideImpl(Plane p, AABBox box) {
+	private static final boolean isOutsideImpl(final Plane p, final AABBox box) {
 	    final float[] low = box.getLow();
 	    final float[] high = box.getHigh();
 
@@ -288,7 +290,7 @@ public class Frustum {
 	 * Note: If method returns false, the box may only be partially inside.
 	 * </p>
 	 */
-    public final boolean isAABBoxOutside(AABBox box) {
+    public final boolean isAABBoxOutside(final AABBox box) {
         for (int i = 0; i < 6; ++i) {
             if ( isOutsideImpl(planes[i], box) ) {
                 // fully outside
@@ -308,7 +310,7 @@ public class Frustum {
      * @param p the point
      * @return {@link Location} of point related to frustum planes
      */
-    public final Location classifyPoint(float[] p) {
+    public final Location classifyPoint(final float[] p) {
         Location res = Location.INSIDE;
 
         for (int i = 0; i < 6; ++i) {
@@ -328,7 +330,7 @@ public class Frustum {
      * @param p the point
      * @return true if outside of the frustum, otherwise inside or on a plane
      */
-    public final boolean isPointOutside(float[] p) {
+    public final boolean isPointOutside(final float[] p) {
         return Location.OUTSIDE == classifyPoint(p);
     }
 
@@ -339,7 +341,7 @@ public class Frustum {
      * @param radius radius of the sphere
      * @return {@link Location} of point related to frustum planes
      */
-    public final Location classifySphere(float[] p, float radius) {
+    public final Location classifySphere(final float[] p, final float radius) {
         Location res = Location.INSIDE; // fully inside
 
         for (int i = 0; i < 6; ++i) {
@@ -362,7 +364,7 @@ public class Frustum {
      * @param radius radius of the sphere
      * @return true if outside of the frustum, otherwise inside or intersecting
      */
-    public final boolean isSphereOutside(float[] p, float radius) {
+    public final boolean isSphereOutside(final float[] p, final float radius) {
         return Location.OUTSIDE == classifySphere(p, radius);
     }
 
@@ -370,13 +372,13 @@ public class Frustum {
         if( null == sb ) {
             sb = new StringBuilder();
         }
-        sb.append("Frustum[ Planes[ ").append(Platform.NEWLINE)
-        .append(" L: ").append(planes[0]).append(", ").append(Platform.NEWLINE)
-        .append(" R: ").append(planes[1]).append(", ").append(Platform.NEWLINE)
-        .append(" B: ").append(planes[2]).append(", ").append(Platform.NEWLINE)
-        .append(" T: ").append(planes[3]).append(", ").append(Platform.NEWLINE)
-        .append(" N: ").append(planes[4]).append(", ").append(Platform.NEWLINE)
-        .append(" F: ").append(planes[5]).append("], ").append(Platform.NEWLINE)
+        sb.append("Frustum[ Planes[ ").append(PlatformPropsImpl.NEWLINE)
+        .append(" L: ").append(planes[0]).append(", ").append(PlatformPropsImpl.NEWLINE)
+        .append(" R: ").append(planes[1]).append(", ").append(PlatformPropsImpl.NEWLINE)
+        .append(" B: ").append(planes[2]).append(", ").append(PlatformPropsImpl.NEWLINE)
+        .append(" T: ").append(planes[3]).append(", ").append(PlatformPropsImpl.NEWLINE)
+        .append(" N: ").append(planes[4]).append(", ").append(PlatformPropsImpl.NEWLINE)
+        .append(" F: ").append(planes[5]).append("], ").append(PlatformPropsImpl.NEWLINE)
         .append("]");
         return sb;
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java
index cd5aa33..e33ceee 100644
--- a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java
+++ b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java
@@ -125,8 +125,8 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
    private volatile boolean sendReshape; // volatile: maybe written by WindowManager thread w/o locking
 
    private static String getThreadName() { return Thread.currentThread().getName(); }
-   private static String toHexString(int v) { return "0x"+Integer.toHexString(v); }
-   private static String toHexString(long v) { return "0x"+Long.toHexString(v); }
+   private static String toHexString(final int v) { return "0x"+Integer.toHexString(v); }
+   private static String toHexString(final long v) { return "0x"+Long.toHexString(v); }
 
    /*
     * Invokes init(...) on all GLEventListeners. Assumes context is current when run.
@@ -205,39 +205,60 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
                  animatorPaused = false;
              }
 
-             if ( null != context ) {
+             GLException exceptionOnDisposeGL = null;
+             if( null != context ) {
                  if( context.isCreated() ) {
-                     // Catch dispose GLExceptions by GLEventListener, just 'print' them
-                     // so we can continue with the destruction.
                      try {
                          if( !GLCanvas.this.isDisposed() ) {
                              helper.disposeGL(GLCanvas.this, context, true);
                          } else {
                              context.destroy();
                          }
-                     } catch (GLException gle) {
-                         gle.printStackTrace();
+                     } catch (final GLException gle) {
+                         exceptionOnDisposeGL = gle;
                      }
                  }
                  context = null;
              }
-             if ( null != drawable ) {
-                 drawable.setRealized(false);
+
+             Throwable exceptionOnUnrealize = null;
+             if( null != drawable ) {
+                 try {
+                     drawable.setRealized(false);
+                 } catch( final Throwable re ) {
+                     exceptionOnUnrealize = re;
+                 }
                  drawable = null;
              }
-             if( 0 != x11Window) {
-                 SWTAccessor.destroyX11Window(screen.getDevice(), x11Window);
-                 x11Window = 0;
-             } else if( 0 != gdkWindow) {
-                 SWTAccessor.destroyGDKWindow(gdkWindow);
-                 gdkWindow = 0;
+
+             Throwable exceptionOnDeviceClose = null;
+             try {
+                 if( 0 != x11Window) {
+                     SWTAccessor.destroyX11Window(screen.getDevice(), x11Window);
+                     x11Window = 0;
+                 } else if( 0 != gdkWindow) {
+                     SWTAccessor.destroyGDKWindow(gdkWindow);
+                     gdkWindow = 0;
+                 }
+                 screen.getDevice().close();
+             } catch (final Throwable re) {
+                 exceptionOnDeviceClose = re;
              }
-             screen.getDevice().close();
 
              if (animatorPaused) {
                  animator.resume();
              }
 
+             // throw exception in order of occurrence ..
+             if( null != exceptionOnDisposeGL ) {
+                 throw exceptionOnDisposeGL;
+             }
+             if( null != exceptionOnUnrealize ) {
+                 throw GLException.newGLException(exceptionOnUnrealize);
+             }
+             if( null != exceptionOnDeviceClose ) {
+                 throw GLException.newGLException(exceptionOnDeviceClose);
+             }
          } finally {
              _lock.unlock();
          }
@@ -247,7 +268,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
    private class DisposeGLEventListenerAction implements Runnable {
        private GLEventListener listener;
        private final boolean remove;
-       private DisposeGLEventListenerAction(GLEventListener listener, boolean remove) {
+       private DisposeGLEventListenerAction(final GLEventListener listener, final boolean remove) {
            this.listener = listener;
            this.remove = remove;
        }
@@ -297,40 +318,6 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
    }
 
    /**
-    * Creates an instance using {@link #GLCanvas(Composite, int, GLCapabilitiesImmutable, GLCapabilitiesChooser, GLContext)}
-    * on the SWT thread.
-    *
-    * @param parent
-    *           Required (non-null) parent Composite.
-    * @param style
-    *           Optional SWT style bit-field. The {@link SWT#NO_BACKGROUND} bit is set before passing this up to the
-    *           Canvas constructor, so OpenGL handles the background.
-    * @param caps
-    *           Optional GLCapabilities. If not provided, the default capabilities for the default GLProfile for the
-    *           graphics device determined by the parent Composite are used. Note that the GLCapabilities that are
-    *           actually used may differ based on the capabilities of the graphics device.
-    * @param chooser
-    *           Optional GLCapabilitiesChooser to customize the selection of the used GLCapabilities based on the
-    *           requested GLCapabilities, and the available capabilities of the graphics device.
-    * @param shareWith
-    *           Optional GLContext to share state (textures, vbos, shaders, etc.) with.
-    * @return a new instance
-    * @deprecated Use {@link #create(Composite, int, GLCapabilitiesImmutable, GLCapabilitiesChooser)}
-    *             and set shared GLContext via {@link #setSharedContext(GLContext)} or {@link #setSharedAutoDrawable(GLAutoDrawable)}.
-    */
-   public static GLCanvas create(final Composite parent, final int style, final GLCapabilitiesImmutable caps,
-                                 final GLCapabilitiesChooser chooser, final GLContext shareWith) {
-       final GLCanvas[] res = new GLCanvas[] { null };
-       parent.getDisplay().syncExec(new Runnable() {
-           @Override
-           public void run() {
-               res[0] = new GLCanvas( parent, style, caps, chooser, shareWith );
-           }
-       });
-       return res[0];
-   }
-
-   /**
     * Creates a new SWT GLCanvas.
     *
     * @param parent
@@ -346,33 +333,8 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
     *           Optional GLCapabilitiesChooser to customize the selection of the used GLCapabilities based on the
     *           requested GLCapabilities, and the available capabilities of the graphics device.
     */
-   public GLCanvas(final Composite parent, final int style, GLCapabilitiesImmutable capsReqUser,
+   public GLCanvas(final Composite parent, final int style, final GLCapabilitiesImmutable capsReqUser,
                    final GLCapabilitiesChooser capsChooser) {
-       this(parent, style, capsReqUser, capsChooser, null);
-   }
-
-   /**
-    * Creates a new SWT GLCanvas.
-    *
-    * @param parent
-    *           Required (non-null) parent Composite.
-    * @param style
-    *           Optional SWT style bit-field. The {@link SWT#NO_BACKGROUND} bit is set before passing this up to the
-    *           Canvas constructor, so OpenGL handles the background.
-    * @param capsReqUser
-    *           Optional GLCapabilities. If not provided, the default capabilities for the default GLProfile for the
-    *           graphics device determined by the parent Composite are used. Note that the GLCapabilities that are
-    *           actually used may differ based on the capabilities of the graphics device.
-    * @param capsChooser
-    *           Optional GLCapabilitiesChooser to customize the selection of the used GLCapabilities based on the
-    *           requested GLCapabilities, and the available capabilities of the graphics device.
-    * @param shareWith
-    *           Optional GLContext to share state (textures, vbos, shaders, etc.) with.
-    * @deprecated Use {@link #GLCanvas(Composite, int, GLCapabilitiesImmutable, GLCapabilitiesChooser)}
-    *             and set shared GLContext via {@link #setSharedContext(GLContext)} or {@link #setSharedAutoDrawable(GLAutoDrawable)}.
-    */
-   public GLCanvas(final Composite parent, final int style, GLCapabilitiesImmutable capsReqUser,
-                   final GLCapabilitiesChooser capsChooser, final GLContext shareWith) {
       /* NO_BACKGROUND required to avoid clearing bg in native SWT widget (we do this in the GL display) */
       super(parent, style | SWT.NO_BACKGROUND);
 
@@ -399,16 +361,13 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
           screen = SWTAccessor.getScreen(swtDevice, -1 /* default */);
       }
 
-      /* Select default GLCapabilities if none was provided, otherwise clone provided caps to ensure safety */
+      /* Select default GLCapabilities if none was provided, otherwise use cloned provided caps */
       if(null == capsReqUser) {
-          capsReqUser = new GLCapabilities(GLProfile.getDefault(screen.getDevice()));
+          this.capsRequested = new GLCapabilities(GLProfile.getDefault(screen.getDevice()));
+      } else {
+          this.capsRequested = (GLCapabilitiesImmutable) capsReqUser.cloneMutable();
       }
-
-      this.capsRequested = capsReqUser;
       this.capsChooser = capsChooser;
-      if( null != shareWith ) {
-          helper.setSharedContext(null, shareWith);
-      }
 
       // post create .. when ready
       gdkWindow = 0;
@@ -418,7 +377,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
 
       final Listener listener = new Listener () {
           @Override
-          public void handleEvent (Event event) {
+          public void handleEvent (final Event event) {
               switch (event.type) {
               case SWT.Paint:
                   displayIfNoAnimatorNoCheck();
@@ -438,29 +397,29 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
    }
 
    @Override
-   public final void setSharedContext(GLContext sharedContext) throws IllegalStateException {
+   public final void setSharedContext(final GLContext sharedContext) throws IllegalStateException {
        helper.setSharedContext(this.context, sharedContext);
    }
 
    @Override
-   public final void setSharedAutoDrawable(GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
+   public final void setSharedAutoDrawable(final GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
        helper.setSharedAutoDrawable(this, sharedAutoDrawable);
    }
 
    private final UpstreamSurfaceHook swtCanvasUpStreamHook = new UpstreamSurfaceHook() {
        @Override
-       public final void create(ProxySurface s) { /* nop */ }
+       public final void create(final ProxySurface s) { /* nop */ }
 
        @Override
-       public final void destroy(ProxySurface s) { /* nop */ }
+       public final void destroy(final ProxySurface s) { /* nop */ }
 
        @Override
-       public final int getWidth(ProxySurface s) {
+       public final int getSurfaceWidth(final ProxySurface s) {
            return clientArea.width;
        }
 
        @Override
-       public final int getHeight(ProxySurface s) {
+       public final int getSurfaceHeight(final ProxySurface s) {
            return clientArea.height;
        }
 
@@ -468,6 +427,17 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
        public String toString() {
            return "SWTCanvasUpstreamSurfaceHook[upstream: "+GLCanvas.this.toString()+", "+clientArea.width+"x"+clientArea.height+"]";
        }
+
+       /**
+        * {@inheritDoc}
+        * <p>
+        * Returns <code>null</code>.
+        * </p>
+        */
+       @Override
+       public final NativeSurface getUpstreamSurface() {
+           return null;
+       }
    };
 
    protected final void updateSizeCheck() {
@@ -608,7 +578,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
        final GLDrawableFactory glFactory = GLDrawableFactory.getFactory(capsRequested.getGLProfile());
 
        // Create a NativeWindow proxy for the SWT canvas
-       ProxySurface proxySurface = glFactory.createProxySurface(device, screen.getIndex(), nativeWindowHandle,
+       final ProxySurface proxySurface = glFactory.createProxySurface(device, screen.getIndex(), nativeWindowHandle,
                                                                 capsRequested, capsChooser, swtCanvasUpStreamHook);
        // Associate a GL surface with the proxy
        final GLDrawableImpl _drawable = (GLDrawableImpl) glFactory.createGLDrawable(proxySurface);
@@ -689,12 +659,15 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
    }
 
    @Override
-   public int getWidth() {
+   public final RecursiveLock getUpstreamLock() { return lock; }
+
+   @Override
+   public int getSurfaceWidth() {
       return clientArea.width;
    }
 
    @Override
-   public int getHeight() {
+   public int getSurfaceHeight() {
       return clientArea.height;
    }
 
@@ -720,7 +693,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
    }
 
    @Override
-   public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException {
+   public GLEventListener getGLEventListener(final int index) throws IndexOutOfBoundsException {
       return helper.getGLEventListener(index);
    }
 
@@ -730,17 +703,17 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
    }
 
    @Override
-   public boolean getGLEventListenerInitState(GLEventListener listener) {
+   public boolean getGLEventListenerInitState(final GLEventListener listener) {
        return helper.getGLEventListenerInitState(listener);
    }
 
    @Override
-   public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
+   public void setGLEventListenerInitState(final GLEventListener listener, final boolean initialized) {
        helper.setGLEventListenerInitState(listener, initialized);
    }
 
    @Override
-   public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
+   public GLEventListener disposeGLEventListener(final GLEventListener listener, final boolean remove) {
        final DisposeGLEventListenerAction r = new DisposeGLEventListenerAction(listener, remove);
        runInGLThread(r);
        return r.listener;
@@ -770,7 +743,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
    }
 
    @Override
-   public final Thread setExclusiveContextThread(Thread t) throws GLException {
+   public final Thread setExclusiveContextThread(final Thread t) throws GLException {
        return helper.setExclusiveContextThread(t, context);
    }
 
@@ -806,16 +779,21 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
    }
 
    @Override
-   public boolean invoke(final boolean wait, final GLRunnable runnable) {
+   public boolean invoke(final boolean wait, final GLRunnable runnable) throws IllegalStateException {
       return helper.invoke(this, wait, runnable);
    }
 
    @Override
-   public boolean invoke(final boolean wait, final List<GLRunnable> runnables) {
+   public boolean invoke(final boolean wait, final List<GLRunnable> runnables) throws IllegalStateException {
       return helper.invoke(this, wait, runnables);
    }
 
    @Override
+   public void flushGLRunnables() {
+       helper.flushGLRunnables();
+   }
+
+   @Override
    public void setAnimator(final GLAnimatorControl arg0) throws GLException {
       helper.setAnimator(arg0);
    }
@@ -826,7 +804,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
    }
 
    @Override
-   public GLContext setContext(GLContext newCtx, boolean destroyPrevCtx) {
+   public GLContext setContext(final GLContext newCtx, final boolean destroyPrevCtx) {
       final RecursiveLock _lock = lock;
       _lock.lock();
       try {
@@ -880,14 +858,10 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
       return null != _drawable ? (GLCapabilitiesImmutable)_drawable.getChosenGLCapabilities() : null;
    }
 
-   /**
-    * Accessor for the GLCapabilities that were requested (via the constructor parameter).
-    *
-    * @return Non-null GLCapabilities.
-    */
+   @Override
    public GLCapabilitiesImmutable getRequestedGLCapabilities() {
       final GLDrawable _drawable = drawable;
-      return null != _drawable ? (GLCapabilitiesImmutable)_drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities() : null;
+      return null != _drawable ? (GLCapabilitiesImmutable)_drawable.getRequestedGLCapabilities() : null;
    }
 
    @Override
@@ -930,6 +904,15 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
    }
 
    /**
+    * {@inheritDoc}
+    * <p>
+    * Implementation always supports multithreading, hence method always returns <code>true</code>.
+    * </p>
+    */
+   @Override
+   public final boolean isThreadGLCapable() { return true; }
+
+   /**
     * Runs the specified action in an SWT compatible thread, which is:
     * <ul>
     *   <li>Mac OSX
@@ -970,7 +953,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
       action.run();
    }
 
-   private void runOnEDTIfAvail(boolean wait, final Runnable action) {
+   private void runOnEDTIfAvail(final boolean wait, final Runnable action) {
        final Display d = isDisposed() ? null : getDisplay();
        if( null == d || d.isDisposed() || d.getThread() == Thread.currentThread() ) {
            action.run();
@@ -984,15 +967,15 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
    @Override
    public String toString() {
        final GLDrawable _drawable = drawable;
-       final int dw = (null!=_drawable) ? _drawable.getWidth() : -1;
-       final int dh = (null!=_drawable) ? _drawable.getHeight() : -1;
+       final int dw = (null!=_drawable) ? _drawable.getSurfaceWidth() : -1;
+       final int dh = (null!=_drawable) ? _drawable.getSurfaceHeight() : -1;
 
        return "SWT-GLCanvas[Realized "+isRealized()+
                ",\n\t"+((null!=_drawable)?_drawable.getClass().getName():"null-drawable")+
                ",\n\tFactory   "+getFactory()+
                ",\n\thandle    "+toHexString(getHandle())+
                ",\n\tDrawable size "+dw+"x"+dh+
-               ",\n\tSWT size "+getWidth()+"x"+getHeight()+"]";
+               ",\n\tSWT size "+getSurfaceWidth()+"x"+getSurfaceHeight()+"]";
    }
 
    public static void main(final String[] args) {
@@ -1014,7 +997,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS
        canvas.addGLEventListener(new GLEventListener() {
            @Override
            public void init(final GLAutoDrawable drawable) {
-               GL gl = drawable.getGL();
+               final GL gl = drawable.getGL();
                System.err.println(JoglVersion.getGLInfo(gl, null));
            }
            @Override
diff --git a/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
index d0de3b3..62df3fa 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/AWTAnimatorImpl.java
@@ -41,12 +41,14 @@ import java.util.IdentityHashMap;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+
 import javax.swing.JComponent;
 import javax.swing.RepaintManager;
 import javax.swing.SwingUtilities;
-
 import javax.media.opengl.GLAutoDrawable;
 
+import com.jogamp.opengl.util.AnimatorBase.UncaughtAnimatorException;
+
 /** Abstraction to factor out AWT dependencies from the Animator's
     implementation in a way that still allows the FPSAnimator to pick
     up this behavior if desired. */
@@ -54,16 +56,16 @@ import javax.media.opengl.GLAutoDrawable;
 class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
     // For efficient rendering of Swing components, in particular when
     // they overlap one another
-    private List<JComponent> lightweights    = new ArrayList<JComponent>();
-    private Map<RepaintManager,RepaintManager> repaintManagers = new IdentityHashMap<RepaintManager,RepaintManager>();
-    private Map<JComponent,Rectangle>  dirtyRegions    = new IdentityHashMap<JComponent,Rectangle>();
+    private final List<JComponent> lightweights    = new ArrayList<JComponent>();
+    private final Map<RepaintManager,RepaintManager> repaintManagers = new IdentityHashMap<RepaintManager,RepaintManager>();
+    private final Map<JComponent,Rectangle>  dirtyRegions    = new IdentityHashMap<JComponent,Rectangle>();
 
     @Override
-    public void display(ArrayList<GLAutoDrawable> drawables,
-                        boolean ignoreExceptions,
-                        boolean printExceptions) {
+    public void display(final ArrayList<GLAutoDrawable> drawables,
+                        final boolean ignoreExceptions,
+                        final boolean printExceptions) throws UncaughtAnimatorException {
         for (int i=0; i<drawables.size(); i++) {
-            GLAutoDrawable drawable = drawables.get(i);
+            final GLAutoDrawable drawable = drawables.get(i);
             if (drawable instanceof JComponent) {
                 // Lightweight components need a more efficient drawing
                 // scheme than simply forcing repainting of each one in
@@ -73,13 +75,13 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
             } else {
                 try {
                     drawable.display();
-                } catch (RuntimeException e) {
+                } catch (final Throwable t) {
                     if (ignoreExceptions) {
                         if (printExceptions) {
-                            e.printStackTrace();
+                            t.printStackTrace();
                         }
                     } else {
-                        throw(e);
+                        throw new UncaughtAnimatorException(drawable, t);
                     }
                 }
             }
@@ -88,7 +90,7 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
         if (lightweights.size() > 0) {
             try {
                 SwingUtilities.invokeAndWait(drawWithRepaintManagerRunnable);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
             }
             lightweights.clear();
@@ -97,10 +99,10 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
 
     // Uses RepaintManager APIs to implement more efficient redrawing of
     // the Swing widgets we're animating
-    private Runnable drawWithRepaintManagerRunnable = new Runnable() {
+    private final Runnable drawWithRepaintManagerRunnable = new Runnable() {
             @Override
             public void run() {
-                for (Iterator<JComponent> iter = lightweights.iterator(); iter.hasNext(); ) {
+                for (final Iterator<JComponent> iter = lightweights.iterator(); iter.hasNext(); ) {
                     JComponent comp = iter.next();
                     RepaintManager rm = RepaintManager.currentManager(comp);
                     rm.markCompletelyDirty(comp);
@@ -117,13 +119,13 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
 
                     // Walk up the hierarchy trying to find a non-optimizable
                     // ancestor
-                    Rectangle visible = comp.getVisibleRect();
+                    final Rectangle visible = comp.getVisibleRect();
                     int x = visible.x;
                     int y = visible.y;
                     while (comp != null) {
                         x += comp.getX();
                         y += comp.getY();
-                        Component c = comp.getParent();
+                        final Component c = comp.getParent();
                         if ((c == null) || (!(c instanceof JComponent))) {
                             comp = null;
                         } else {
@@ -132,7 +134,7 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
                                 rm = RepaintManager.currentManager(comp);
                                 repaintManagers.put(rm, rm);
                                 // Need to dirty this region
-                                Rectangle dirty = (Rectangle) dirtyRegions.get(comp);
+                                Rectangle dirty = dirtyRegions.get(comp);
                                 if (dirty == null) {
                                     dirty = new Rectangle(x, y, visible.width, visible.height);
                                     dirtyRegions.put(comp, dirty);
@@ -150,15 +152,15 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
                 }
 
                 // Dirty any needed regions on non-optimizable components
-                for (Iterator<JComponent> iter = dirtyRegions.keySet().iterator(); iter.hasNext(); ) {
-                    JComponent comp = iter.next();
-                    Rectangle  rect = dirtyRegions.get(comp);
-                    RepaintManager rm = RepaintManager.currentManager(comp);
+                for (final Iterator<JComponent> iter = dirtyRegions.keySet().iterator(); iter.hasNext(); ) {
+                    final JComponent comp = iter.next();
+                    final Rectangle  rect = dirtyRegions.get(comp);
+                    final RepaintManager rm = RepaintManager.currentManager(comp);
                     rm.addDirtyRegion(comp, rect.x, rect.y, rect.width, rect.height);
                 }
 
                 // Draw all dirty regions
-                for (Iterator<RepaintManager> iter = repaintManagers.keySet().iterator(); iter.hasNext(); ) {
+                for (final Iterator<RepaintManager> iter = repaintManagers.keySet().iterator(); iter.hasNext(); ) {
                     iter.next().paintDirtyRegions();
                 }
                 dirtyRegions.clear();
@@ -167,7 +169,7 @@ class AWTAnimatorImpl implements AnimatorBase.AnimatorImpl {
         };
 
     @Override
-    public boolean blockUntilDone(Thread thread) {
+    public boolean blockUntilDone(final Thread thread) {
         return Thread.currentThread() != thread && !EventQueue.isDispatchThread();
     }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Animator.java b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
index 7990692..d9a9571 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/Animator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/Animator.java
@@ -78,7 +78,7 @@ public class Animator extends AnimatorBase {
     /**
      * Creates a new Animator w/ an associated ThreadGroup.
      */
-    public Animator(ThreadGroup tg) {
+    public Animator(final ThreadGroup tg) {
         super();
         setThreadGroup(tg);
         if(DEBUG) {
@@ -89,7 +89,7 @@ public class Animator extends AnimatorBase {
     /**
      * Creates a new Animator for a particular drawable.
      */
-    public Animator(GLAutoDrawable drawable) {
+    public Animator(final GLAutoDrawable drawable) {
         super();
         add(drawable);
         if(DEBUG) {
@@ -100,7 +100,7 @@ public class Animator extends AnimatorBase {
     /**
      * Creates a new Animator w/ an associated ThreadGroup for a particular drawable.
      */
-    public Animator(ThreadGroup tg, GLAutoDrawable drawable) {
+    public Animator(final ThreadGroup tg, final GLAutoDrawable drawable) {
         super();
         setThreadGroup(tg);
         add(drawable);
@@ -110,7 +110,7 @@ public class Animator extends AnimatorBase {
     }
 
     @Override
-    protected final String getBaseName(String prefix) {
+    protected final String getBaseName(final String prefix) {
         return prefix + "Animator" ;
     }
 
@@ -120,7 +120,7 @@ public class Animator extends AnimatorBase {
      * animation loop which prevents the CPU from getting swamped.
      * This method may not have an effect on subclasses.
      */
-    public final synchronized void setRunAsFastAsPossible(boolean runFast) {
+    public final synchronized void setRunAsFastAsPossible(final boolean runFast) {
         runAsFastAsPossible = runFast;
     }
 
@@ -132,6 +132,8 @@ public class Animator extends AnimatorBase {
 
         @Override
         public void run() {
+            UncaughtAnimatorException displayCaught = null;
+
             try {
                 synchronized (Animator.this) {
                     if(DEBUG) {
@@ -151,20 +153,27 @@ public class Animator extends AnimatorBase {
                             if( drawablesEmpty ) {
                                 pauseIssued = true;
                             }
-                            boolean wasPaused = pauseIssued;
+                            final boolean wasPaused = pauseIssued;
                             if (DEBUG) {
                                 System.err.println("Animator pause on " + animThread.getName() + ": " + toString());
                             }
                             if ( exclusiveContext && !drawablesEmpty && !ectCleared ) {
                                 ectCleared = true;
                                 setDrawablesExclCtxState(false);
-                                display(); // propagate exclusive change!
+                                try {
+                                    display(); // propagate exclusive context -> off!
+                                } catch (final UncaughtAnimatorException dre) {
+                                    displayCaught = dre;
+                                    stopIssued = true;
+                                    isAnimating = false;
+                                    break; // end pause loop
+                                }
                             }
                             isAnimating = false;
                             Animator.this.notifyAll();
                             try {
                                 Animator.this.wait();
-                            } catch (InterruptedException e) {
+                            } catch (final InterruptedException e) {
                             }
                             if (wasPaused) {
                                 // resume from pause -> reset counter
@@ -180,36 +189,58 @@ public class Animator extends AnimatorBase {
                             // Resume from pause or drawablesEmpty,
                             // implies !pauseIssued and !drawablesEmpty
                             isAnimating = true;
-                            setDrawablesExclCtxState(exclusiveContext);
+                            setDrawablesExclCtxState(exclusiveContext); // may re-enable exclusive context
                             Animator.this.notifyAll();
                         }
                     } // sync Animator.this
                     if (!stopIssued) {
-                        display();
+                        try {
+                            display();
+                        } catch (final UncaughtAnimatorException dre) {
+                            displayCaught = dre;
+                            stopIssued = true;
+                            isAnimating = false;
+                            break; // end animation loop
+                        }
                     }
                     if (!stopIssued && !runAsFastAsPossible) {
                         // Avoid swamping the CPU
                         Thread.yield();
                     }
                 }
-            } catch( ThreadDeath td) {
+            } catch( final ThreadDeath td) {
                 if(DEBUG) {
-                    System.err.println("Animator Catched: "+td.getClass().getName()+": "+td.getMessage());
+                    System.err.println("Animator caught: "+td.getClass().getName()+": "+td.getMessage());
                     td.printStackTrace();
                 }
             } finally {
                 if( exclusiveContext && !drawablesEmpty ) {
                     setDrawablesExclCtxState(false);
-                    display(); // propagate exclusive change!
+                    try {
+                        display(); // propagate exclusive context -> off!
+                    } catch (final UncaughtAnimatorException dre) {
+                        if( null == displayCaught ) {
+                            displayCaught = dre;
+                        } else {
+                            dre.printStackTrace();
+                        }
+                    }
                 }
                 synchronized (Animator.this) {
                     if(DEBUG) {
                         System.err.println("Animator stop on " + animThread.getName() + ": " + toString());
+                        if( null != displayCaught ) {
+                            System.err.println("Animator caught: "+displayCaught.getMessage());
+                            displayCaught.printStackTrace();
+                        }
                     }
                     stopIssued = false;
                     pauseIssued = false;
-                    animThread = null;
                     isAnimating = false;
+                    if( null != displayCaught ) {
+                        handleUncaughtException(displayCaught);
+                    }
+                    animThread = null;
                     Animator.this.notifyAll();
                 }
             }
@@ -232,7 +263,7 @@ public class Animator extends AnimatorBase {
      * @param tg the {@link ThreadGroup}
      * @throws GLException if the animator has already been started
      */
-    public final synchronized void setThreadGroup(ThreadGroup tg) throws GLException {
+    public final synchronized void setThreadGroup(final ThreadGroup tg) throws GLException {
         if ( isStarted() ) {
             throw new GLException("Animator already started.");
         }
@@ -248,7 +279,7 @@ public class Animator extends AnimatorBase {
             runnable = new MainLoop();
         }
         fpsCounter.resetFPSCounter();
-        String threadName = getThreadName()+"-"+baseName;
+        final String threadName = getThreadName()+"-"+baseName;
         Thread thread;
         if(null==threadGroup) {
             thread = new Thread(runnable, threadName);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
index 3964374..8b4e125 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/AnimatorBase.java
@@ -67,8 +67,25 @@ public abstract class AnimatorBase implements GLAnimatorControl {
      */
     public static final int MODE_EXPECT_AWT_RENDERING_THREAD = 1 << 0;
 
-    public interface AnimatorImpl {
-        void display(ArrayList<GLAutoDrawable> drawables, boolean ignoreExceptions, boolean printExceptions);
+
+    @SuppressWarnings("serial")
+    public static class UncaughtAnimatorException extends RuntimeException {
+        final GLAutoDrawable drawable;
+        public UncaughtAnimatorException(final GLAutoDrawable drawable, final Throwable cause) {
+            super(cause);
+            this.drawable = drawable;
+        }
+        public final GLAutoDrawable getGLAutoDrawable() { return drawable; }
+    }
+
+    public static interface AnimatorImpl {
+        /**
+         * @param drawables
+         * @param ignoreExceptions
+         * @param printExceptions
+         * @throws UncaughtAnimatorException as caused by {@link GLAutoDrawable#display()}
+         */
+        void display(ArrayList<GLAutoDrawable> drawables, boolean ignoreExceptions, boolean printExceptions) throws UncaughtAnimatorException;
         boolean blockUntilDone(Thread thread);
     }
 
@@ -83,6 +100,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
     protected boolean printExceptions;
     protected boolean exclusiveContext;
     protected Thread userExclusiveContextThread;
+    protected UncaughtExceptionHandler uncaughtExceptionHandler;
     protected FPSCounterImpl fpsCounter = new FPSCounterImpl();
 
     private final static Class<?> awtAnimatorImplClazz;
@@ -92,7 +110,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
             Class<?> clazz;
             try {
                 clazz = Class.forName("com.jogamp.opengl.util.AWTAnimatorImpl");
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 clazz = null;
             }
             awtAnimatorImplClazz =  clazz;
@@ -112,7 +130,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
         drawablesEmpty = true;
     }
 
-    private static final boolean useAWTAnimatorImpl(int modeBits) {
+    private static final boolean useAWTAnimatorImpl(final int modeBits) {
         return 0 != ( MODE_EXPECT_AWT_RENDERING_THREAD & modeBits ) && null != awtAnimatorImplClazz;
     }
 
@@ -126,13 +144,13 @@ public abstract class AnimatorBase implements GLAnimatorControl {
      *
      * @throws GLException if Animator is {@link #isStarted()}
      */
-    protected final synchronized void initImpl(boolean force) {
+    protected final synchronized void initImpl(final boolean force) {
         if( force || null == impl ) {
             if( useAWTAnimatorImpl( modeBits ) ) {
                 try {
                     impl = (AnimatorImpl) awtAnimatorImplClazz.newInstance();
                     baseName = getBaseName("AWT");
-                } catch (Exception e) { e.printStackTrace(); }
+                } catch (final Exception e) { e.printStackTrace(); }
             }
             if( null == impl ) {
                 impl = new DefaultAnimatorImpl();
@@ -154,7 +172,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
      * @throws GLException if Animator is {@link #isStarted()} and {@link #MODE_EXPECT_AWT_RENDERING_THREAD} about to change
      * @see AnimatorBase#MODE_EXPECT_AWT_RENDERING_THREAD
      */
-    public final synchronized void setModeBits(boolean enable, int bitValues) throws GLException {
+    public final synchronized void setModeBits(final boolean enable, final int bitValues) throws GLException {
         final int _oldModeBits = modeBits;
         if(enable) {
             modeBits |=  bitValues;
@@ -225,7 +243,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
             }
         }
 
-        boolean paused = pause();
+        final boolean paused = pause();
         drawables.remove(drawable);
         drawablesEmpty = drawables.size() == 0;
         drawable.setAnimator(null);
@@ -267,7 +285,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
      * @see #isExclusiveContextEnabled()
      */
     // @Override
-    public final synchronized Thread setExclusiveContext(Thread t) {
+    public final synchronized Thread setExclusiveContext(final Thread t) {
         final boolean enable = null != t;
         final Thread old = userExclusiveContextThread;
         if( enable && t != animThread ) { // disable: will be cleared at end after propagation && filter out own animThread usae
@@ -299,7 +317,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
      * @see #isExclusiveContextEnabled()
      */
     // @Override
-    public final boolean setExclusiveContext(boolean enable) {
+    public final boolean setExclusiveContext(final boolean enable) {
         final boolean propagateState;
         final boolean oldExclusiveContext;
         final Thread _exclusiveContextThread;
@@ -312,19 +330,24 @@ public abstract class AnimatorBase implements GLAnimatorControl {
                 System.err.println("AnimatorBase.setExclusiveContextThread: "+oldExclusiveContext+" -> "+exclusiveContext+", propagateState "+propagateState+", "+this);
             }
         }
-        final Thread dECT = enable ? ( null != userExclusiveContextThread ? userExclusiveContextThread : animThread ) : null ;
+        final Thread dECT = enable ? ( null != _exclusiveContextThread ? _exclusiveContextThread : animThread ) : null ;
+        UncaughtAnimatorException displayCaught = null;
         if( propagateState ) {
             setDrawablesExclCtxState(enable);
             if( !enable ) {
                 if( Thread.currentThread() == getThread() || Thread.currentThread() == _exclusiveContextThread ) {
-                    display();
+                    try {
+                        display(); // propagate exclusive context -> off!
+                    } catch (final UncaughtAnimatorException dre) {
+                        displayCaught = dre;
+                    }
                 } else {
                     final boolean resumed = isAnimating() ? false : resume();
                     int counter = 10;
                     while( 0<counter && isAnimating() && !validateDrawablesExclCtxState(dECT) ) {
                         try {
                             Thread.sleep(20);
-                        } catch (InterruptedException e) { }
+                        } catch (final InterruptedException e) { }
                         counter--;
                     }
                     if(resumed) {
@@ -338,6 +361,13 @@ public abstract class AnimatorBase implements GLAnimatorControl {
         }
         if(DEBUG) {
             System.err.println("AnimatorBase.setExclusiveContextThread: all-GLAD Ok: "+validateDrawablesExclCtxState(dECT)+", "+this);
+            if( null != displayCaught ) {
+                System.err.println("AnimatorBase.setExclusiveContextThread: caught: "+displayCaught.getMessage());
+                displayCaught.printStackTrace();
+            }
+        }
+        if( null != displayCaught ) {
+            throw displayCaught;
         }
         return oldExclusiveContext;
     }
@@ -379,7 +409,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
      * to allow propagation of releasing the exclusive thread.
      * </p>
      */
-    protected final synchronized void setDrawablesExclCtxState(boolean enable) {
+    protected final synchronized void setDrawablesExclCtxState(final boolean enable) {
         if(DEBUG) {
             System.err.println("AnimatorBase.setExclusiveContextImpl exlusive "+exclusiveContext+": Enable "+enable+" for "+this+" - "+Thread.currentThread());
             // Thread.dumpStack();
@@ -388,12 +418,12 @@ public abstract class AnimatorBase implements GLAnimatorControl {
         for (int i=0; i<drawables.size(); i++) {
             try {
                 drawables.get(i).setExclusiveContextThread( enable ? ect : null );
-            } catch (RuntimeException e) {
+            } catch (final RuntimeException e) {
                 e.printStackTrace();
             }
         }
     }
-    protected final boolean validateDrawablesExclCtxState(Thread expected) {
+    protected final boolean validateDrawablesExclCtxState(final Thread expected) {
         for (int i=0; i<drawables.size(); i++) {
             if( expected != drawables.get(i).getExclusiveContextThread() ) {
                 return false;
@@ -412,13 +442,13 @@ public abstract class AnimatorBase implements GLAnimatorControl {
         this to get the most optimized painting behavior for the set of
         components this Animator manages, in particular when multiple
         lightweight widgets are continually being redrawn. */
-    protected final void display() {
+    protected final void display() throws UncaughtAnimatorException {
         impl.display(drawables, ignoreExceptions, printExceptions);
         fpsCounter.tickFPS();
     }
 
     @Override
-    public final void setUpdateFPSFrames(int frames, PrintStream out) {
+    public final void setUpdateFPSFrames(final int frames, final PrintStream out) {
         fpsCounter.setUpdateFPSFrames(frames, out);
     }
 
@@ -470,7 +500,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
     /** Sets a flag causing this Animator to ignore exceptions produced
     while redrawing the drawables. By default this flag is set to
     false, causing any exception thrown to halt the Animator. */
-    public final void setIgnoreExceptions(boolean ignoreExceptions) {
+    public final void setIgnoreExceptions(final boolean ignoreExceptions) {
         this.ignoreExceptions = ignoreExceptions;
     }
 
@@ -478,11 +508,47 @@ public abstract class AnimatorBase implements GLAnimatorControl {
     this Animator (see {@link #setIgnoreExceptions}), to print the
     exceptions' stack traces for diagnostic information. Defaults to
     false. */
-    public final void setPrintExceptions(boolean printExceptions) {
+    public final void setPrintExceptions(final boolean printExceptions) {
         this.printExceptions = printExceptions;
     }
 
-    protected interface Condition {
+    @Override
+    public final UncaughtExceptionHandler getUncaughtExceptionHandler() {
+        return uncaughtExceptionHandler;
+    }
+
+    @Override
+    public final void setUncaughtExceptionHandler(final UncaughtExceptionHandler handler) {
+        uncaughtExceptionHandler = handler;
+    }
+
+    /**
+     * Should be called in case of an uncaught exception
+     * from within the animator thread to flush all animator
+     */
+    protected final synchronized void handleUncaughtException(final UncaughtAnimatorException ue) {
+        if( null != uncaughtExceptionHandler ) {
+            try {
+                uncaughtExceptionHandler.uncaughtException(this, ue.getGLAutoDrawable(), ue.getCause());
+            } catch (final Throwable t) { /* ignore intentionally */ }
+            flushGLRunnables();
+        } else {
+            flushGLRunnables();
+            throw ue;
+        }
+    }
+
+    /**
+     * Should be called in case of an uncaught exception
+     * from within the animator thread to flush all animator
+     */
+    protected final synchronized void flushGLRunnables() {
+        for (int i=0; i<drawables.size(); i++) {
+            drawables.get(i).flushGLRunnables();
+        }
+    }
+
+    protected static interface Condition {
         /**
          * @return true if branching (continue waiting, action), otherwise false
          */
@@ -495,7 +561,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
      *                   if > <code>0</code>, method will wait for the given <code>pollPeriod</code> in milliseconds.
      * @return <code>true</code> if {@link Condition#eval() waitCondition.eval()} returned <code>false</code>, otherwise <code>false</code>.
      */
-    protected final synchronized boolean finishLifecycleAction(Condition waitCondition, long pollPeriod) {
+    protected final synchronized boolean finishLifecycleAction(final Condition waitCondition, long pollPeriod) {
         /**
          * It's hard to tell whether the thread which changes the lifecycle has
          * dependencies on the Animator's internal thread. Currently we
@@ -519,7 +585,7 @@ public abstract class AnimatorBase implements GLAnimatorControl {
                 notifyAll();
                 try {
                     wait(pollPeriod);
-                } catch (InterruptedException ie) {  }
+                } catch (final InterruptedException ie) {  }
                 remaining -= System.currentTimeMillis() - t1 ;
                 nok = waitCondition.eval();
             }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/CustomGLEventListener.java b/src/jogl/classes/com/jogamp/opengl/util/CustomGLEventListener.java
new file mode 100644
index 0000000..8644308
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/util/CustomGLEventListener.java
@@ -0,0 +1,63 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.util;
+
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLEventListener;
+
+/**
+ * Extended {@link GLEventListener} interface
+ * supporting more fine grained control over the implementation.
+ */
+public interface CustomGLEventListener extends GLEventListener {
+    /**
+     * {@link #display(GLAutoDrawable, int) display flag}: Repeat last produced image.
+     * <p>
+     * While a repeated frame shall produce the same artifacts as the last <code>display</code> call,
+     * e.g. not change animated objects, it shall reflect the {@link #setProjectionModelview(GLAutoDrawable, float[], float[]) current matrix}.
+     * </p>
+     */
+    public static final int DISPLAY_REPEAT    = 1 << 0;
+
+    /**
+     * {@link #display(GLAutoDrawable, int) display flag}: Do not clear any target buffer, e.g. color-, depth- or stencil-buffers.
+     */
+    public static final int DISPLAY_DONTCLEAR = 1 << 1;
+
+    /**
+     * Extended {@link #display(GLAutoDrawable) display} method,
+     * allowing to pass a display flag, e.g. {@link #DISPLAY_REPEAT} or {@link #DISPLAY_DONTCLEAR}.
+     * <p>
+     * Method is usually called by a custom rendering loop,
+     * e.g. for manual stereo rendering or the like.
+     * </p>
+     * @param drawable
+     * @param flags
+     */
+    public void display(final GLAutoDrawable drawable, final int flags);
+}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java b/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
index a9c6e64..6b1485a 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/DefaultAnimatorImpl.java
@@ -34,35 +34,38 @@
 package com.jogamp.opengl.util;
 
 import java.util.ArrayList;
+
 import javax.media.opengl.GLAutoDrawable;
 
+import com.jogamp.opengl.util.AnimatorBase.UncaughtAnimatorException;
+
 /** Abstraction to factor out AWT dependencies from the Animator's
     implementation in a way that still allows the FPSAnimator to pick
     up this behavior if desired. */
 
 class DefaultAnimatorImpl implements AnimatorBase.AnimatorImpl {
     @Override
-    public void display(ArrayList<GLAutoDrawable> drawables,
-                        boolean ignoreExceptions,
-                        boolean printExceptions) {
+    public void display(final ArrayList<GLAutoDrawable> drawables,
+                        final boolean ignoreExceptions,
+                        final boolean printExceptions) throws UncaughtAnimatorException {
         for (int i=0; i<drawables.size(); i++) {
-            GLAutoDrawable drawable = drawables.get(i);
+            final GLAutoDrawable drawable = drawables.get(i);
             try {
                 drawable.display();
-            } catch (RuntimeException e) {
+            } catch (final Throwable t) {
                 if (ignoreExceptions) {
                     if (printExceptions) {
-                        e.printStackTrace();
+                        t.printStackTrace();
                     }
                 } else {
-                    throw(e);
+                    throw new UncaughtAnimatorException(drawable, t);
                 }
             }
         }
     }
 
     @Override
-    public boolean blockUntilDone(Thread thread) {
+    public boolean blockUntilDone(final Thread thread) {
         return Thread.currentThread() != thread;
     }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
index 5bd8035..9ae8804 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/FPSAnimator.java
@@ -65,13 +65,13 @@ public class FPSAnimator extends AnimatorBase {
     private volatile boolean shouldStop; // MainTask trigger
 
     @Override
-    protected String getBaseName(String prefix) {
+    protected String getBaseName(final String prefix) {
         return "FPS" + prefix + "Animator" ;
     }
 
     /** Creates an FPSAnimator with a given target frames-per-second
     value. Equivalent to <code>FPSAnimator(null, fps)</code>. */
-    public FPSAnimator(int fps) {
+    public FPSAnimator(final int fps) {
         this(null, fps);
     }
 
@@ -79,21 +79,21 @@ public class FPSAnimator extends AnimatorBase {
     value and a flag indicating whether to use fixed-rate
     scheduling. Equivalent to <code>FPSAnimator(null, fps,
     scheduleAtFixedRate)</code>. */
-    public FPSAnimator(int fps, boolean scheduleAtFixedRate) {
+    public FPSAnimator(final int fps, final boolean scheduleAtFixedRate) {
         this(null, fps, scheduleAtFixedRate);
     }
 
     /** Creates an FPSAnimator with a given target frames-per-second
     value and an initial drawable to animate. Equivalent to
     <code>FPSAnimator(null, fps, false)</code>. */
-    public FPSAnimator(GLAutoDrawable drawable, int fps) {
+    public FPSAnimator(final GLAutoDrawable drawable, final int fps) {
         this(drawable, fps, false);
     }
 
     /** Creates an FPSAnimator with a given target frames-per-second
     value, an initial drawable to animate, and a flag indicating
     whether to use fixed-rate scheduling. */
-    public FPSAnimator(GLAutoDrawable drawable, int fps, boolean scheduleAtFixedRate) {
+    public FPSAnimator(final GLAutoDrawable drawable, final int fps, final boolean scheduleAtFixedRate) {
         super();
         this.fps = fps;
         if (drawable != null) {
@@ -106,7 +106,7 @@ public class FPSAnimator extends AnimatorBase {
      * @param fps
      * @throws GLException if the animator has already been started
      */
-    public final synchronized void setFPS(int fps) throws GLException {
+    public final void setFPS(final int fps) throws GLException {
         if ( isStarted() ) {
             throw new GLException("Animator already started.");
         }
@@ -122,7 +122,7 @@ public class FPSAnimator extends AnimatorBase {
         public MainTask() {
         }
 
-        public void start(Timer timer) {
+        public void start(final Timer timer) {
             fpsCounter.resetFPSCounter();
             shouldRun = true;
             shouldStop = false;
@@ -148,6 +148,8 @@ public class FPSAnimator extends AnimatorBase {
 
         @Override
         public void run() {
+            UncaughtAnimatorException displayCaught = null;
+
             if( justStarted ) {
                 justStarted = false;
                 synchronized (FPSAnimator.this) {
@@ -160,7 +162,7 @@ public class FPSAnimator extends AnimatorBase {
                         shouldRun = false; // isAnimating:=false @ pause below
                     } else {
                         shouldRun = true;
-                        setDrawablesExclCtxState(exclusiveContext);
+                        setDrawablesExclCtxState(exclusiveContext); // may re-enable exclusive context
                         FPSAnimator.this.notifyAll();
                     }
                     if(DEBUG) {
@@ -168,46 +170,76 @@ public class FPSAnimator extends AnimatorBase {
                     }
                 }
             }
-            if( shouldRun ) {
-                display();
-            } else if( shouldStop ) { // STOP
+            if( shouldRun && !shouldStop ) { // RUN
+                try {
+                    display();
+                } catch (final UncaughtAnimatorException dre) {
+                    displayCaught = dre;
+                    shouldRun = false;
+                    shouldStop = true;
+                }
+            } else if( !shouldRun && !shouldStop ) { // PAUSE
                 if(DEBUG) {
-                    System.err.println("FPSAnimator P4: "+alreadyStopped+", "+ Thread.currentThread() + ": " + toString());
+                    System.err.println("FPSAnimator pausing: "+alreadyPaused+", "+ Thread.currentThread() + ": " + toString());
                 }
                 this.cancel();
 
-                if( !alreadyStopped ) {
-                    alreadyStopped = true;
+                if( !alreadyPaused ) { // PAUSE
+                    alreadyPaused = true;
                     if( exclusiveContext && !drawablesEmpty ) {
                         setDrawablesExclCtxState(false);
-                        display(); // propagate exclusive change!
+                        try {
+                            display(); // propagate exclusive context -> off!
+                        } catch (final UncaughtAnimatorException dre) {
+                            displayCaught = dre;
+                            shouldRun = false;
+                            shouldStop = true;
+                        }
                     }
-                    synchronized (FPSAnimator.this) {
-                        if(DEBUG) {
-                            System.err.println("FPSAnimator stop " + Thread.currentThread() + ": " + toString());
+                    if( null == displayCaught ) {
+                        synchronized (FPSAnimator.this) {
+                            if(DEBUG) {
+                                System.err.println("FPSAnimator pause " + Thread.currentThread() + ": " + toString());
+                            }
+                            isAnimating = false;
+                            FPSAnimator.this.notifyAll();
                         }
-                        animThread = null;
-                        isAnimating = false;
-                        FPSAnimator.this.notifyAll();
                     }
                 }
-            } else {
+            }
+            if( shouldStop ) { // STOP
                 if(DEBUG) {
-                    System.err.println("FPSAnimator P5: "+alreadyPaused+", "+ Thread.currentThread() + ": " + toString());
+                    System.err.println("FPSAnimator stopping: "+alreadyStopped+", "+ Thread.currentThread() + ": " + toString());
                 }
                 this.cancel();
 
-                if( !alreadyPaused ) { // PAUSE
-                    alreadyPaused = true;
+                if( !alreadyStopped ) {
+                    alreadyStopped = true;
                     if( exclusiveContext && !drawablesEmpty ) {
                         setDrawablesExclCtxState(false);
-                        display(); // propagate exclusive change!
+                        try {
+                            display(); // propagate exclusive context -> off!
+                        } catch (final UncaughtAnimatorException dre) {
+                            if( null == displayCaught ) {
+                                displayCaught = dre;
+                            } else {
+                                dre.printStackTrace();
+                            }
+                        }
                     }
                     synchronized (FPSAnimator.this) {
                         if(DEBUG) {
-                            System.err.println("FPSAnimator pause " + Thread.currentThread() + ": " + toString());
+                            System.err.println("FPSAnimator stop " + Thread.currentThread() + ": " + toString());
+                            if( null != displayCaught ) {
+                                System.err.println("AnimatorBase.setExclusiveContextThread: caught: "+displayCaught.getMessage());
+                                displayCaught.printStackTrace();
+                            }
                         }
                         isAnimating = false;
+                        if( null != displayCaught ) {
+                            handleUncaughtException(displayCaught);
+                        }
+                        animThread = null;
                         FPSAnimator.this.notifyAll();
                     }
                 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
index a58eb82..1a9ec27 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataClient.java
@@ -69,11 +69,11 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
    *
    * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
    */
-  public static GLArrayDataClient createFixed(int index, int comps, int dataType, boolean normalized, int initialElementCount)
+  public static GLArrayDataClient createFixed(final int index, final int comps, final int dataType, final boolean normalized, final int initialElementCount)
     throws GLException
   {
-      GLArrayDataClient adc = new GLArrayDataClient();
-      GLArrayHandler glArrayHandler = new GLFixedArrayHandler(adc);
+      final GLArrayDataClient adc = new GLArrayDataClient();
+      final GLArrayHandler glArrayHandler = new GLFixedArrayHandler(adc);
       adc.init(null, index, comps, dataType, normalized, 0, null, initialElementCount, 0 /* mappedElementCount */, false, glArrayHandler, 0, 0, 0, 0, false);
       return adc;
   }
@@ -99,12 +99,12 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
    *
    * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
    */
-  public static GLArrayDataClient createFixed(int index, int comps, int dataType, boolean normalized, int stride,
-                                              Buffer buffer)
+  public static GLArrayDataClient createFixed(final int index, final int comps, final int dataType, final boolean normalized, final int stride,
+                                              final Buffer buffer)
     throws GLException
   {
-      GLArrayDataClient adc = new GLArrayDataClient();
-      GLArrayHandler glArrayHandler = new GLFixedArrayHandler(adc);
+      final GLArrayDataClient adc = new GLArrayDataClient();
+      final GLArrayHandler glArrayHandler = new GLFixedArrayHandler(adc);
       adc.init(null, index, comps, dataType, normalized, stride, buffer, comps*comps, 0 /* mappedElementCount */, false, glArrayHandler, 0, 0, 0, 0, false);
       return adc;
   }
@@ -118,12 +118,12 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
    * @param normalized Whether the data shall be normalized
    * @param initialElementCount
    */
-  public static GLArrayDataClient createGLSL(String name, int comps,
-                                             int dataType, boolean normalized, int initialElementCount)
+  public static GLArrayDataClient createGLSL(final String name, final int comps,
+                                             final int dataType, final boolean normalized, final int initialElementCount)
     throws GLException
   {
-      GLArrayDataClient adc = new GLArrayDataClient();
-      GLArrayHandler glArrayHandler = new GLSLArrayHandler(adc);
+      final GLArrayDataClient adc = new GLArrayDataClient();
+      final GLArrayHandler glArrayHandler = new GLSLArrayHandler(adc);
       adc.init(name, -1, comps, dataType, normalized, 0, null, initialElementCount, 0 /* mappedElementCount */, true, glArrayHandler, 0, 0, 0, 0, true);
       return adc;
   }
@@ -138,18 +138,18 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
    * @param stride
    * @param buffer the user define data
    */
-  public static GLArrayDataClient createGLSL(String name, int comps,
-                                             int dataType, boolean normalized, int stride, Buffer buffer)
+  public static GLArrayDataClient createGLSL(final String name, final int comps,
+                                             final int dataType, final boolean normalized, final int stride, final Buffer buffer)
     throws GLException
   {
-      GLArrayDataClient adc = new GLArrayDataClient();
-      GLArrayHandler glArrayHandler = new GLSLArrayHandler(adc);
+      final GLArrayDataClient adc = new GLArrayDataClient();
+      final GLArrayHandler glArrayHandler = new GLSLArrayHandler(adc);
       adc.init(name, -1, comps, dataType, normalized, stride, buffer, comps*comps, 0 /* mappedElementCount */, true, glArrayHandler, 0, 0, 0, 0, true);
       return adc;
   }
 
   @Override
-  public void associate(Object obj, boolean enable) {
+  public void associate(final Object obj, final boolean enable) {
       if(obj instanceof ShaderState) {
           if(enable) {
               shaderState = (ShaderState)obj;
@@ -177,30 +177,30 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
   //
 
   @Override
-  public final void setVBOWritten(boolean written) {
+  public final void setVBOWritten(final boolean written) {
       bufferWritten = ( 0 == mappedElementCount ) ? written : true;
   }
 
   @Override
-  public void destroy(GL gl) {
+  public void destroy(final GL gl) {
     reset(gl);
     super.destroy(gl);
   }
 
   @Override
-  public void reset(GL gl) {
+  public void reset(final GL gl) {
     enableBuffer(gl, false);
     reset();
   }
 
   @Override
-  public void seal(GL gl, boolean seal) {
+  public void seal(final GL gl, final boolean seal) {
     seal(seal);
     enableBuffer(gl, seal);
   }
 
   @Override
-  public void enableBuffer(GL gl, boolean enable) {
+  public void enableBuffer(final GL gl, final boolean enable) {
     if( enableBufferAlways || bufferEnabled != enable ) {
         if(enable) {
             checkSeal(true);
@@ -213,7 +213,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
   }
 
   @Override
-  public boolean bindBuffer(GL gl, boolean bind) {
+  public boolean bindBuffer(final GL gl, final boolean bind) {
       if(bind) {
           checkSeal(true);
           // init/generate VBO name if not done yet
@@ -223,7 +223,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
   }
 
   @Override
-  public void setEnableAlways(boolean always) {
+  public void setEnableAlways(final boolean always) {
     enableBufferAlways = always;
   }
 
@@ -242,7 +242,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
   }
 
   @Override
-  public void seal(boolean seal)
+  public void seal(final boolean seal)
   {
     if( sealed == seal ) return;
     sealed = seal;
@@ -281,7 +281,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
    * The arguments remaining elements must be a multiple of this arrays element stride.
    */
   @Override
-  public void put(Buffer v) {
+  public void put(final Buffer v) {
     if ( sealed ) return;
     /** FIXME: isn't true for interleaved arrays !
     if(0!=(v.remaining() % strideL)) {
@@ -292,33 +292,33 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
   }
 
   @Override
-  public void putb(byte v) {
+  public void putb(final byte v) {
     if ( sealed ) return;
     growBufferIfNecessary(1);
     Buffers.putb(buffer, v);
   }
 
   @Override
-  public void puts(short v) {
+  public void puts(final short v) {
     if ( sealed ) return;
     growBufferIfNecessary(1);
     Buffers.puts(buffer, v);
   }
 
   @Override
-  public void puti(int v) {
+  public void puti(final int v) {
     if ( sealed ) return;
     growBufferIfNecessary(1);
     Buffers.puti(buffer, v);
   }
 
   @Override
-  public void putx(int v) {
+  public void putx(final int v) {
     puti(v);
   }
 
   @Override
-  public void putf(float v) {
+  public void putf(final float v) {
     if ( sealed ) return;
     growBufferIfNecessary(1);
     Buffers.putf(buffer, v);
@@ -349,7 +349,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
 
   // non public matters
 
-  protected final boolean growBufferIfNecessary(int spareComponents) {
+  protected final boolean growBufferIfNecessary(final int spareComponents) {
     if( buffer==null || buffer.remaining()<spareComponents ) {
         if( 0 != mappedElementCount ) {
             throw new GLException("Mapped buffer can't grow. Insufficient storage size: Needed "+spareComponents+" components, "+
@@ -411,7 +411,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
     }
   }
 
-  protected final void checkSeal(boolean test) throws GLException {
+  protected final void checkSeal(final boolean test) throws GLException {
     if(!alive) {
         throw new GLException("Invalid state: "+this);
     }
@@ -424,9 +424,9 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
     }
   }
 
-  protected void init(String name, int index, int comps, int dataType, boolean normalized, int stride, Buffer data,
-                      int initialElementCount, int mappedElementCount, boolean isVertexAttribute,
-                      GLArrayHandler handler, int vboName, long vboOffset, int vboUsage, int vboTarget, boolean usesGLSL)
+  protected void init(final String name, final int index, final int comps, final int dataType, final boolean normalized, final int stride, final Buffer data,
+                      final int initialElementCount, final int mappedElementCount, final boolean isVertexAttribute,
+                      final GLArrayHandler handler, final int vboName, final long vboOffset, final int vboUsage, final int vboTarget, final boolean usesGLSL)
     throws GLException
   {
     super.init(name, index, comps, dataType, normalized, stride, data, mappedElementCount,
@@ -450,7 +450,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
 
   private boolean isValidated = false;
 
-  protected void init_vbo(GL gl) {
+  protected void init_vbo(final GL gl) {
       if(!isValidated ) {
           isValidated = true;
           validate(gl.getGLProfile(), true);
@@ -468,7 +468,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
    * All other values are simply copied.
    * </p>
    */
-  public GLArrayDataClient(GLArrayDataClient src) {
+  public GLArrayDataClient(final GLArrayDataClient src) {
     super(src);
     this.isValidated = src.isValidated;
     this.sealed = src.sealed;
@@ -481,7 +481,7 @@ public class GLArrayDataClient extends GLArrayDataWrapper implements GLArrayData
         try {
             final Constructor<? extends GLArrayHandler> ctor = clazz.getConstructor(GLArrayDataEditable.class);
             this.glArrayHandler = ctor.newInstance(this);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new RuntimeException("Could not ctor "+clazz.getName()+"("+this.getClass().getName()+")", e);
         }
     } else {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java
index 833f1cc..51c55e3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataServer.java
@@ -81,12 +81,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    *
    * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
    */
-  public static GLArrayDataServer createFixed(int index, int compsPerElement, int dataType, boolean normalized, int stride,
-                                              Buffer buffer, int vboUsage)
+  public static GLArrayDataServer createFixed(final int index, final int compsPerElement, final int dataType, final boolean normalized, final int stride,
+                                              final Buffer buffer, final int vboUsage)
     throws GLException
   {
-    GLArrayDataServer ads = new GLArrayDataServer();
-    GLArrayHandler glArrayHandler = new GLFixedArrayHandler(ads);
+    final GLArrayDataServer ads = new GLArrayDataServer();
+    final GLArrayHandler glArrayHandler = new GLFixedArrayHandler(ads);
     ads.init(null, index, compsPerElement, dataType, normalized, stride, buffer, buffer.limit(), 0 /* mappedElementCount */, false,
              glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, false);
     return ads;
@@ -113,12 +113,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    *
    * @see javax.media.opengl.GLContext#getPredefinedArrayIndexName(int)
    */
-  public static GLArrayDataServer createFixed(int index, int compsPerElement, int dataType, boolean normalized, int initialElementCount,
-                                              int vboUsage)
+  public static GLArrayDataServer createFixed(final int index, final int compsPerElement, final int dataType, final boolean normalized, final int initialElementCount,
+                                              final int vboUsage)
     throws GLException
   {
-    GLArrayDataServer ads = new GLArrayDataServer();
-    GLArrayHandler glArrayHandler = new GLFixedArrayHandler(ads);
+    final GLArrayDataServer ads = new GLArrayDataServer();
+    final GLArrayHandler glArrayHandler = new GLFixedArrayHandler(ads);
     ads.init(null, index, compsPerElement, dataType, normalized, 0, null, initialElementCount, 0 /* mappedElementCount */, false,
              glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, false);
     return ads;
@@ -134,12 +134,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * @param initialElementCount
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    */
-  public static GLArrayDataServer createGLSL(String name, int compsPerElement,
-                                             int dataType, boolean normalized, int initialElementCount, int vboUsage)
+  public static GLArrayDataServer createGLSL(final String name, final int compsPerElement,
+                                             final int dataType, final boolean normalized, final int initialElementCount, final int vboUsage)
     throws GLException
   {
-    GLArrayDataServer ads = new GLArrayDataServer();
-    GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
+    final GLArrayDataServer ads = new GLArrayDataServer();
+    final GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
     ads.init(name, -1, compsPerElement, dataType, normalized, 0, null, initialElementCount,
              0 /* mappedElementCount */, true, glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
     return ads;
@@ -155,12 +155,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * @param mappedElementCount
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    */
-  public static GLArrayDataServer createGLSLMapped(String name, int compsPerElement,
-                                                   int dataType, boolean normalized, int mappedElementCount, int vboUsage)
+  public static GLArrayDataServer createGLSLMapped(final String name, final int compsPerElement,
+                                                   final int dataType, final boolean normalized, final int mappedElementCount, final int vboUsage)
     throws GLException
   {
-    GLArrayDataServer ads = new GLArrayDataServer();
-    GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
+    final GLArrayDataServer ads = new GLArrayDataServer();
+    final GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
     ads.init(name, -1, compsPerElement, dataType, normalized, 0, null, 0 /* initialElementCount */,
              mappedElementCount, true, glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
     ads.seal(true);
@@ -178,13 +178,13 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * @param buffer the user define data
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    */
-  public static GLArrayDataServer createGLSL(String name, int compsPerElement,
-                                             int dataType, boolean normalized, int stride, Buffer buffer,
-                                             int vboUsage)
+  public static GLArrayDataServer createGLSL(final String name, final int compsPerElement,
+                                             final int dataType, final boolean normalized, final int stride, final Buffer buffer,
+                                             final int vboUsage)
     throws GLException
   {
-    GLArrayDataServer ads = new GLArrayDataServer();
-    GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
+    final GLArrayDataServer ads = new GLArrayDataServer();
+    final GLArrayHandler glArrayHandler = new GLSLArrayHandler(ads);
     ads.init(name, -1, compsPerElement, dataType, normalized, stride, buffer, buffer.limit(), 0 /* mappedElementCount */, true,
              glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
     return ads;
@@ -203,12 +203,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * @param vboTarget {@link GL#GL_ELEMENT_ARRAY_BUFFER}, ..
    * {@link GL#glGenBuffers(int, int[], int)
    */
-  public static GLArrayDataServer createData(int compsPerElement, int dataType, int stride,
-                                             Buffer buffer, int vboUsage, int vboTarget)
+  public static GLArrayDataServer createData(final int compsPerElement, final int dataType, final int stride,
+                                             final Buffer buffer, final int vboUsage, final int vboTarget)
     throws GLException
   {
-    GLArrayDataServer ads = new GLArrayDataServer();
-    GLArrayHandler glArrayHandler = new GLDataArrayHandler(ads);
+    final GLArrayDataServer ads = new GLArrayDataServer();
+    final GLArrayHandler glArrayHandler = new GLDataArrayHandler(ads);
     ads.init(null, -1, compsPerElement, dataType, false, stride, buffer, buffer.limit(), 0 /* mappedElementCount */, false,
              glArrayHandler, 0, 0, vboUsage, vboTarget, false);
     return ads;
@@ -225,12 +225,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    * @param vboTarget {@link GL#GL_ELEMENT_ARRAY_BUFFER}, ..
    */
-  public static GLArrayDataServer createData(int compsPerElement, int dataType, int initialElementCount,
-                                             int vboUsage, int vboTarget)
+  public static GLArrayDataServer createData(final int compsPerElement, final int dataType, final int initialElementCount,
+                                             final int vboUsage, final int vboTarget)
     throws GLException
   {
-    GLArrayDataServer ads = new GLArrayDataServer();
-    GLArrayHandler glArrayHandler = new GLDataArrayHandler(ads);
+    final GLArrayDataServer ads = new GLArrayDataServer();
+    final GLArrayHandler glArrayHandler = new GLDataArrayHandler(ads);
     ads.init(null, -1, compsPerElement, dataType, false, 0, null, initialElementCount, 0 /* mappedElementCount */, false,
              glArrayHandler, 0, 0, vboUsage, vboTarget, false);
     return ads;
@@ -249,12 +249,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    * @param vboTarget {@link GL#GL_ELEMENT_ARRAY_BUFFER}, ..
    */
-  public static GLArrayDataServer createDataMapped(int compsPerElement, int dataType, int mappedElementCount,
-                                                   int vboUsage, int vboTarget)
+  public static GLArrayDataServer createDataMapped(final int compsPerElement, final int dataType, final int mappedElementCount,
+                                                   final int vboUsage, final int vboTarget)
     throws GLException
   {
-    GLArrayDataServer ads = new GLArrayDataServer();
-    GLArrayHandler glArrayHandler = new GLDataArrayHandler(ads);
+    final GLArrayDataServer ads = new GLArrayDataServer();
+    final GLArrayHandler glArrayHandler = new GLDataArrayHandler(ads);
     ads.init(null, -1, compsPerElement, dataType, false, 0, null, 0 /* initialElementCount */, mappedElementCount, false,
              glArrayHandler, 0, 0, vboUsage, vboTarget, false);
     return ads;
@@ -271,12 +271,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * @param initialElementCount The initial number of all interleaved elements
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    */
-  public static GLArrayDataServer createFixedInterleaved(int compsPerElement, int dataType, boolean normalized, int initialElementCount,
-                                              int vboUsage)
+  public static GLArrayDataServer createFixedInterleaved(final int compsPerElement, final int dataType, final boolean normalized, final int initialElementCount,
+                                              final int vboUsage)
     throws GLException
   {
-    GLArrayDataServer ads = new GLArrayDataServer();
-    GLArrayHandler glArrayHandler = new GLArrayHandlerInterleaved(ads);
+    final GLArrayDataServer ads = new GLArrayDataServer();
+    final GLArrayHandler glArrayHandler = new GLArrayHandlerInterleaved(ads);
     ads.init(GLPointerFuncUtil.mgl_InterleaveArray, -1, compsPerElement, dataType, false, 0, null, initialElementCount, 0 /* mappedElementCount */, false,
              glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, false);
     return ads;
@@ -293,12 +293,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * @param mappedElementCount The total number of all interleaved elements
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    */
-  public static GLArrayDataServer createFixedInterleavedMapped(int compsPerElement, int dataType, boolean normalized, int mappedElementCount,
-                                                               int vboUsage)
+  public static GLArrayDataServer createFixedInterleavedMapped(final int compsPerElement, final int dataType, final boolean normalized, final int mappedElementCount,
+                                                               final int vboUsage)
     throws GLException
   {
-    GLArrayDataServer ads = new GLArrayDataServer();
-    GLArrayHandler glArrayHandler = new GLArrayHandlerInterleaved(ads);
+    final GLArrayDataServer ads = new GLArrayDataServer();
+    final GLArrayHandler glArrayHandler = new GLArrayHandlerInterleaved(ads);
     ads.init(GLPointerFuncUtil.mgl_InterleaveArray, -1, compsPerElement, dataType, false, 0, null, 0 /* initialElementCount */, mappedElementCount, false,
              glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, false);
     ads.seal(true);
@@ -317,12 +317,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * @param buffer The user define data of all interleaved elements
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    */
-  public static GLArrayDataServer createFixedInterleaved(int compsPerElement, int dataType, boolean normalized, int stride, Buffer buffer,
-                                              int vboUsage)
+  public static GLArrayDataServer createFixedInterleaved(final int compsPerElement, final int dataType, final boolean normalized, final int stride, final Buffer buffer,
+                                              final int vboUsage)
     throws GLException
   {
-    GLArrayDataServer ads = new GLArrayDataServer();
-    GLArrayHandler glArrayHandler = new GLArrayHandlerInterleaved(ads);
+    final GLArrayDataServer ads = new GLArrayDataServer();
+    final GLArrayHandler glArrayHandler = new GLArrayHandlerInterleaved(ads);
     ads.init(GLPointerFuncUtil.mgl_InterleaveArray, -1, compsPerElement, dataType, normalized, stride, buffer, buffer.limit(), 0 /* mappedElementCount */, false,
              glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, false);
     return ads;
@@ -342,7 +342,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * @param comps This interleaved array segment's component count per element
    * @param vboTarget {@link GL#GL_ARRAY_BUFFER} or {@link GL#GL_ELEMENT_ARRAY_BUFFER}
    */
-  public GLArrayData addFixedSubArray(int index, int comps, int vboTarget) {
+  public GLArrayData addFixedSubArray(final int index, final int comps, final int vboTarget) {
       if(interleavedOffset >= getComponentCount() * getComponentSizeInBytes()) {
           final int iOffC = interleavedOffset / getComponentSizeInBytes();
           throw new GLException("Interleaved offset > total components ("+iOffC+" > "+getComponentCount()+")");
@@ -382,12 +382,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * @param initialElementCount The initial number of all interleaved elements
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    */
-  public static GLArrayDataServer createGLSLInterleaved(int compsPerElement, int dataType, boolean normalized, int initialElementCount,
-                                                        int vboUsage)
+  public static GLArrayDataServer createGLSLInterleaved(final int compsPerElement, final int dataType, final boolean normalized, final int initialElementCount,
+                                                        final int vboUsage)
     throws GLException
   {
-    GLArrayDataServer ads = new GLArrayDataServer();
-    GLArrayHandler glArrayHandler = new GLSLArrayHandlerInterleaved(ads);
+    final GLArrayDataServer ads = new GLArrayDataServer();
+    final GLArrayHandler glArrayHandler = new GLSLArrayHandlerInterleaved(ads);
     ads.init(GLPointerFuncUtil.mgl_InterleaveArray, -1, compsPerElement, dataType, normalized, 0, null, initialElementCount, 0 /* mappedElementCount */, false,
              glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
     return ads;
@@ -404,11 +404,11 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * @param mappedElementCount The total number of all interleaved elements
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    */
-  public static GLArrayDataServer createGLSLInterleavedMapped(int compsPerElement, int dataType, boolean normalized, int mappedElementCount, int vboUsage)
+  public static GLArrayDataServer createGLSLInterleavedMapped(final int compsPerElement, final int dataType, final boolean normalized, final int mappedElementCount, final int vboUsage)
     throws GLException
   {
-    GLArrayDataServer ads = new GLArrayDataServer();
-    GLArrayHandler glArrayHandler = new GLSLArrayHandlerInterleaved(ads);
+    final GLArrayDataServer ads = new GLArrayDataServer();
+    final GLArrayHandler glArrayHandler = new GLSLArrayHandlerInterleaved(ads);
     ads.init(GLPointerFuncUtil.mgl_InterleaveArray, -1, compsPerElement, dataType, normalized, 0, null, 0 /* initialElementCount */, mappedElementCount, false,
              glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
     ads.seal(true);
@@ -427,12 +427,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * @param buffer The user define data of all interleaved elements
    * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
    */
-  public static GLArrayDataServer createGLSLInterleaved(int compsPerElement, int dataType, boolean normalized, int stride, Buffer buffer,
-                                                        int vboUsage)
+  public static GLArrayDataServer createGLSLInterleaved(final int compsPerElement, final int dataType, final boolean normalized, final int stride, final Buffer buffer,
+                                                        final int vboUsage)
     throws GLException
   {
-    GLArrayDataServer ads = new GLArrayDataServer();
-    GLArrayHandler glArrayHandler = new GLSLArrayHandlerInterleaved(ads);
+    final GLArrayDataServer ads = new GLArrayDataServer();
+    final GLArrayHandler glArrayHandler = new GLSLArrayHandlerInterleaved(ads);
     ads.init(GLPointerFuncUtil.mgl_InterleaveArray, -1, compsPerElement, dataType, normalized, stride, buffer, buffer.limit(), 0 /* mappedElementCount */, false,
              glArrayHandler, 0, 0, vboUsage, GL.GL_ARRAY_BUFFER, true);
     return ads;
@@ -451,7 +451,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * @param comps This interleaved array segment's component count per element
    * @param vboTarget {@link GL#GL_ARRAY_BUFFER} or {@link GL#GL_ELEMENT_ARRAY_BUFFER}
    */
-  public GLArrayData addGLSLSubArray(String name, int comps, int vboTarget) {
+  public GLArrayData addGLSLSubArray(final String name, final int comps, final int vboTarget) {
       if(interleavedOffset >= getComponentCount() * getComponentSizeInBytes()) {
           final int iOffC = interleavedOffset / getComponentSizeInBytes();
           throw new GLException("Interleaved offset > total components ("+iOffC+" > "+getComponentCount()+")");
@@ -480,7 +480,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
       return ad;
   }
 
-  public final void setInterleavedOffset(int interleavedOffset) {
+  public final void setInterleavedOffset(final int interleavedOffset) {
     this.interleavedOffset = interleavedOffset;
   }
 
@@ -497,11 +497,11 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
   //
 
   @Override
-  public void destroy(GL gl) {
+  public void destroy(final GL gl) {
     // super.destroy(gl):
     // - GLArrayDataClient.destroy(gl): disables & clears client-side buffer
     //   - GLArrayDataWrapper.destroy(gl) (clears all values 'vboName' ..)
-    int _vboName = vboName;
+    final int _vboName = vboName;
     super.destroy(gl);
     if(_vboName!=0) {
         final int[] tmp = new int[] { _vboName } ;
@@ -520,12 +520,12 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * Only possible if buffer is defined.
    */
   @Override
-  public void setVBOEnabled(boolean vboUsage) {
+  public void setVBOEnabled(final boolean vboUsage) {
     checkSeal(false);
     super.setVBOEnabled(vboUsage);
   }
 
-  public GLBufferStorage mapStorage(GL gl, int access) {
+  public GLBufferStorage mapStorage(final GL gl, final int access) {
       if( null != this.getBuffer() ) {
           throw new IllegalStateException("user buffer not null");
       }
@@ -542,7 +542,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
       rewind();
       return storage;
   }
-  public GLBufferStorage mapStorage(GL gl, long offset, long length, int access) {
+  public GLBufferStorage mapStorage(final GL gl, final long offset, final long length, final int access) {
       if( null != this.getBuffer() ) {
           throw new IllegalStateException("user buffer not null");
       }
@@ -559,7 +559,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
       rewind();
       return storage;
   }
-  private final void setMappedBuffer(GLBufferStorage storage) {
+  private final void setMappedBuffer(final GLBufferStorage storage) {
       mappedStorage = storage;
       final ByteBuffer bb = storage.getMappedBuffer();
       if(componentClazz==ByteBuffer.class) {
@@ -575,7 +575,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
       }
   }
 
-  public void unmapStorage(GL gl) {
+  public void unmapStorage(final GL gl) {
       if( null == mappedStorage ) {
           throw new IllegalStateException("not mapped");
       }
@@ -621,10 +621,10 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
   //
 
   @Override
-  protected void init(String name, int index, int comps, int dataType, boolean normalized,
-                      int stride, Buffer data, int initialElementCount, int mappedElementCount,
-                      boolean isVertexAttribute,
-                      GLArrayHandler glArrayHandler, int vboName, long vboOffset, int vboUsage, int vboTarget, boolean usesGLSL)
+  protected void init(final String name, final int index, final int comps, final int dataType, final boolean normalized,
+                      final int stride, final Buffer data, final int initialElementCount, final int mappedElementCount,
+                      final boolean isVertexAttribute,
+                      final GLArrayHandler glArrayHandler, final int vboName, final long vboOffset, final int vboUsage, final int vboTarget, final boolean usesGLSL)
     throws GLException
   {
     super.init(name, index, comps, dataType, normalized, stride, data, initialElementCount, mappedElementCount, isVertexAttribute,
@@ -634,10 +634,10 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
   }
 
   @Override
-  protected void init_vbo(GL gl) {
+  protected void init_vbo(final GL gl) {
     super.init_vbo(gl);
     if(vboEnabled && vboName==0) {
-        int[] tmp = new int[1];
+        final int[] tmp = new int[1];
         gl.glGenBuffers(1, tmp, 0);
         vboName = tmp[0];
         if(0 < interleavedOffset) {
@@ -657,7 +657,7 @@ public class GLArrayDataServer extends GLArrayDataClient implements GLArrayDataE
    * All other values are simply copied.
    * </p>
    */
-  public GLArrayDataServer(GLArrayDataServer src) {
+  public GLArrayDataServer(final GLArrayDataServer src) {
     super(src);
     this.interleavedOffset = src.interleavedOffset;
     this.mappedStorage = src.mappedStorage;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java
index f617fed..867bc00 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLArrayDataWrapper.java
@@ -66,11 +66,11 @@ public class GLArrayDataWrapper implements GLArrayData {
    *
    * @throws GLException
    */
-  public static GLArrayDataWrapper createFixed(int index, int comps, int dataType, boolean normalized, int stride,
-                                               Buffer buffer, int vboName, long vboOffset, int vboUsage, int vboTarget)
+  public static GLArrayDataWrapper createFixed(final int index, final int comps, final int dataType, final boolean normalized, final int stride,
+                                               final Buffer buffer, final int vboName, final long vboOffset, final int vboUsage, final int vboTarget)
     throws GLException
   {
-      GLArrayDataWrapper adc = new GLArrayDataWrapper();
+      final GLArrayDataWrapper adc = new GLArrayDataWrapper();
       adc.init(null, index, comps, dataType, normalized, stride, buffer, 0 /* mappedElementCount */,
                false, vboName, vboOffset, vboUsage, vboTarget);
       return adc;
@@ -93,11 +93,11 @@ public class GLArrayDataWrapper implements GLArrayData {
    *
    * @throws GLException
    */
-  public static GLArrayDataWrapper createFixed(int index, int comps, int dataType, boolean normalized, int stride,
-                                               int mappedElementCount, int vboName, long vboOffset, int vboUsage, int vboTarget)
+  public static GLArrayDataWrapper createFixed(final int index, final int comps, final int dataType, final boolean normalized, final int stride,
+                                               final int mappedElementCount, final int vboName, final long vboOffset, final int vboUsage, final int vboTarget)
     throws GLException
   {
-      GLArrayDataWrapper adc = new GLArrayDataWrapper();
+      final GLArrayDataWrapper adc = new GLArrayDataWrapper();
       adc.init(null, index, comps, dataType, normalized, stride, null, mappedElementCount,
                false, vboName, vboOffset, vboUsage, vboTarget);
       return adc;
@@ -119,11 +119,11 @@ public class GLArrayDataWrapper implements GLArrayData {
    * @return the new create instance
    * @throws GLException
    */
-  public static GLArrayDataWrapper createGLSL(String name, int comps, int dataType, boolean normalized, int stride,
-                                             Buffer buffer, int vboName, long vboOffset, int vboUsage, int vboTarget)
+  public static GLArrayDataWrapper createGLSL(final String name, final int comps, final int dataType, final boolean normalized, final int stride,
+                                             final Buffer buffer, final int vboName, final long vboOffset, final int vboUsage, final int vboTarget)
     throws GLException
   {
-      GLArrayDataWrapper adc = new GLArrayDataWrapper();
+      final GLArrayDataWrapper adc = new GLArrayDataWrapper();
       adc.init(name, -1, comps, dataType, normalized, stride, buffer, 0  /* mappedElementCount */,
               true, vboName, vboOffset, vboUsage, vboTarget);
       return adc;
@@ -145,11 +145,11 @@ public class GLArrayDataWrapper implements GLArrayData {
    * @return the new create instance
    * @throws GLException
    */
-  public static GLArrayDataWrapper createGLSL(String name, int comps, int dataType, boolean normalized, int stride,
-                                              int mappedElementCount, int vboName, long vboOffset, int vboUsage, int vboTarget)
+  public static GLArrayDataWrapper createGLSL(final String name, final int comps, final int dataType, final boolean normalized, final int stride,
+                                              final int mappedElementCount, final int vboName, final long vboOffset, final int vboUsage, final int vboTarget)
     throws GLException
   {
-      GLArrayDataWrapper adc = new GLArrayDataWrapper();
+      final GLArrayDataWrapper adc = new GLArrayDataWrapper();
       adc.init(name, -1, comps, dataType, normalized, stride, null, mappedElementCount,
               true, vboName, vboOffset, vboUsage, vboTarget);
       return adc;
@@ -163,7 +163,7 @@ public class GLArrayDataWrapper implements GLArrayData {
    * @param throwException whether to throw an exception if this instance has invalid parameter or not
    * @return true if this instance has invalid parameter, otherwise false
    */
-  public final boolean validate(GLProfile glp, boolean throwException) {
+  public final boolean validate(final GLProfile glp, final boolean throwException) {
     if(!alive) {
         if(throwException) {
             throw new GLException("Instance !alive "+this);
@@ -180,7 +180,7 @@ public class GLArrayDataWrapper implements GLArrayData {
   }
 
   @Override
-  public void associate(Object obj, boolean enable) {
+  public void associate(final Object obj, final boolean enable) {
       // nop
   }
 
@@ -198,16 +198,16 @@ public class GLArrayDataWrapper implements GLArrayData {
   public final int getLocation() { return location; }
 
   @Override
-  public final int setLocation(int v) { location = v; return location; }
+  public final int setLocation(final int v) { location = v; return location; }
 
   @Override
-  public final int setLocation(GL2ES2 gl, int program) {
+  public final int setLocation(final GL2ES2 gl, final int program) {
       location = gl.glGetAttribLocation(program, name);
       return location;
   }
 
   @Override
-  public final int setLocation(GL2ES2 gl, int program, int location) {
+  public final int setLocation(final GL2ES2 gl, final int program, final int location) {
       this.location = location;
       gl.glBindAttribLocation(program, location, name);
       return location;
@@ -275,7 +275,7 @@ public class GLArrayDataWrapper implements GLArrayData {
   public final Class<?> getBufferClass() { return componentClazz; }
 
   @Override
-  public void destroy(GL gl) {
+  public void destroy(final GL gl) {
     buffer = null;
     vboName=0;
     vboEnabled=false;
@@ -305,7 +305,7 @@ public class GLArrayDataWrapper implements GLArrayData {
                        "]";
   }
 
-  public static final Class<?> getBufferClass(int dataType) {
+  public static final Class<?> getBufferClass(final int dataType) {
     switch(dataType) {
         case GL.GL_BYTE:
         case GL.GL_UNSIGNED_BYTE:
@@ -314,7 +314,7 @@ public class GLArrayDataWrapper implements GLArrayData {
         case GL.GL_UNSIGNED_SHORT:
             return ShortBuffer.class;
         case GL.GL_UNSIGNED_INT:
-        case GL2ES1.GL_FIXED:
+        case GL.GL_FIXED:
         case GL2ES2.GL_INT:
             return IntBuffer.class;
         case GL.GL_FLOAT:
@@ -325,7 +325,7 @@ public class GLArrayDataWrapper implements GLArrayData {
   }
 
   @Override
-  public void setName(String newName) {
+  public void setName(final String newName) {
     location = -1;
     name = newName;
   }
@@ -335,7 +335,7 @@ public class GLArrayDataWrapper implements GLArrayData {
    * Only possible if a VBO buffer name is defined.
    * @see #setVBOName(int)
    */
-  public void setVBOEnabled(boolean vboEnabled) {
+  public void setVBOEnabled(final boolean vboEnabled) {
     this.vboEnabled=vboEnabled;
   }
 
@@ -345,7 +345,7 @@ public class GLArrayDataWrapper implements GLArrayData {
    *
    * @see #setVBOEnabled(boolean)
    */
-  public void    setVBOName(int vboName) {
+  public void    setVBOName(final int vboName) {
     this.vboName=vboName;
     setVBOEnabled(0!=vboName);
   }
@@ -353,20 +353,20 @@ public class GLArrayDataWrapper implements GLArrayData {
  /**
   * @param vboUsage {@link GL2ES2#GL_STREAM_DRAW}, {@link GL#GL_STATIC_DRAW} or {@link GL#GL_DYNAMIC_DRAW}
   */
-  public void setVBOUsage(int vboUsage) {
+  public void setVBOUsage(final int vboUsage) {
       this.vboUsage = vboUsage;
   }
 
   /**
    * @param vboTarget either {@link GL#GL_ARRAY_BUFFER} or {@link GL#GL_ELEMENT_ARRAY_BUFFER}
    */
-  public void setVBOTarget(int vboTarget) {
+  public void setVBOTarget(final int vboTarget) {
       this.vboTarget = vboTarget;
   }
 
-  protected void init(String name, int index, int componentsPerElement, int componentType,
-                      boolean normalized, int stride, Buffer data, int mappedElementCount,
-                      boolean isVertexAttribute, int vboName, long vboOffset, int vboUsage, int vboTarget)
+  protected void init(final String name, final int index, final int componentsPerElement, final int componentType,
+                      final boolean normalized, final int stride, final Buffer data, final int mappedElementCount,
+                      final boolean isVertexAttribute, final int vboName, final long vboOffset, final int vboUsage, final int vboTarget)
     throws GLException
   {
     if( 0<mappedElementCount && null != data ) {
@@ -452,7 +452,7 @@ public class GLArrayDataWrapper implements GLArrayData {
    * All other values are simply copied.
    * </p>
    */
-  public GLArrayDataWrapper(GLArrayDataWrapper src) {
+  public GLArrayDataWrapper(final GLArrayDataWrapper src) {
     this.alive = src.alive;
     this.index = src.index;
     this.location = src.location;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
index b9903ac..44be299 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLBuffers.java
@@ -44,6 +44,7 @@ import java.nio.ByteBuffer;
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
 import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GL2ES3;
 import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLES2;
 import javax.media.opengl.GLException;
@@ -65,7 +66,7 @@ public class GLBuffers extends Buffers {
      *              GL_UNSIGNED_INT, <br/>
      *              GL_HILO16_NV <br/>
      */
-    public static final boolean isSignedGLType(int glType) {
+    public static final boolean isSignedGLType(final int glType) {
         switch (glType) { // 29
             case GL.GL_UNSIGNED_BYTE:
             case GL.GL_UNSIGNED_SHORT:
@@ -85,7 +86,7 @@ public class GLBuffers extends Buffers {
      *              GL_HALF_FLOAT_OES, <br/>
      *              GL_DOUBLE <br/>
      */
-    public static final boolean isGLTypeFixedPoint(int glType) {
+    public static final boolean isGLTypeFixedPoint(final int glType) {
         switch(glType) {
             case GL.GL_FLOAT:
             case GL.GL_HALF_FLOAT:
@@ -123,7 +124,7 @@ public class GLBuffers extends Buffers {
      *
      * @return -1 if glType is unhandled, otherwise the actual value > 0
      */
-    public static final int sizeOfGLType(int glType) {
+    public static final int sizeOfGLType(final int glType) {
         switch (glType) { // 29
             // case GL2.GL_BITMAP:
             case GL.GL_BYTE:
@@ -136,9 +137,9 @@ public class GLBuffers extends Buffers {
             case GL.GL_UNSIGNED_SHORT:
             case GL.GL_UNSIGNED_SHORT_5_6_5:
             case GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV:
-            case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4:
+            case GL.GL_UNSIGNED_SHORT_4_4_4_4:
             case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV:
-            case GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1:
+            case GL.GL_UNSIGNED_SHORT_5_5_5_1:
             case GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV:
             case GL2.GL_UNSIGNED_SHORT_8_8_APPLE:
             case GL2.GL_UNSIGNED_SHORT_8_8_REV_APPLE:
@@ -151,16 +152,16 @@ public class GLBuffers extends Buffers {
             case GL.GL_UNSIGNED_INT:
             case GL2GL3.GL_UNSIGNED_INT_8_8_8_8:
             case GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:
-            case GL2GL3.GL_UNSIGNED_INT_10_10_10_2:
-            case GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV:
-            case GL2GL3.GL_UNSIGNED_INT_24_8:
-            case GL2GL3.GL_UNSIGNED_INT_10F_11F_11F_REV:
-            case GL2GL3.GL_UNSIGNED_INT_5_9_9_9_REV:
+            case GL2ES2.GL_UNSIGNED_INT_10_10_10_2:
+            case GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV:
+            case GL.GL_UNSIGNED_INT_24_8:
+            case GL.GL_UNSIGNED_INT_10F_11F_11F_REV:
+            case GL2ES3.GL_UNSIGNED_INT_5_9_9_9_REV:
             case GL2.GL_HILO16_NV:
             case GL2.GL_SIGNED_HILO16_NV:
                 return SIZEOF_INT;
 
-            case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
+            case GL2ES3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
                 return SIZEOF_LONG;
 
             case GL.GL_FLOAT:
@@ -197,7 +198,7 @@ public class GLBuffers extends Buffers {
      *
      * @return null if glType is unhandled, otherwise the new Buffer object
      */
-    public static final Buffer newDirectGLBuffer(int glType, int numElements) {
+    public static final Buffer newDirectGLBuffer(final int glType, final int numElements) {
         switch (glType) { // 29
             case GL.GL_BYTE:
             case GL.GL_UNSIGNED_BYTE:
@@ -209,9 +210,9 @@ public class GLBuffers extends Buffers {
             case GL.GL_UNSIGNED_SHORT:
             case GL.GL_UNSIGNED_SHORT_5_6_5:
             case GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV:
-            case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4:
+            case GL.GL_UNSIGNED_SHORT_4_4_4_4:
             case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV:
-            case GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1:
+            case GL.GL_UNSIGNED_SHORT_5_5_5_1:
             case GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV:
             case GL2.GL_UNSIGNED_SHORT_8_8_APPLE:
             case GL2.GL_UNSIGNED_SHORT_8_8_REV_APPLE:
@@ -224,22 +225,22 @@ public class GLBuffers extends Buffers {
             case GL.GL_UNSIGNED_INT:
             case GL2GL3.GL_UNSIGNED_INT_8_8_8_8:
             case GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:
-            case GL2GL3.GL_UNSIGNED_INT_10_10_10_2:
-            case GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV:
-            case GL2GL3.GL_UNSIGNED_INT_24_8:
-            case GL2GL3.GL_UNSIGNED_INT_10F_11F_11F_REV:
-            case GL2GL3.GL_UNSIGNED_INT_5_9_9_9_REV:
+            case GL2ES2.GL_UNSIGNED_INT_10_10_10_2:
+            case GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV:
+            case GL.GL_UNSIGNED_INT_24_8:
+            case GL.GL_UNSIGNED_INT_10F_11F_11F_REV:
+            case GL2ES3.GL_UNSIGNED_INT_5_9_9_9_REV:
             case GL2.GL_HILO16_NV:
             case GL2.GL_SIGNED_HILO16_NV:
                 return newDirectIntBuffer(numElements);
 
-            case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
+            case GL2ES3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
                 return newDirectLongBuffer(numElements);
 
             case GL.GL_FLOAT:
                 return newDirectFloatBuffer(numElements);
 
-            case GL2.GL_DOUBLE:
+            case GL2GL3.GL_DOUBLE:
                 return newDirectDoubleBuffer(numElements);
         }
         return null;
@@ -269,7 +270,7 @@ public class GLBuffers extends Buffers {
      *              GL_FLOAT, GL_DOUBLE <br/>
      * @return null if glType is unhandled or parent is null or bufLen is 0, otherwise the new Buffer object
      */
-    public static final Buffer sliceGLBuffer(ByteBuffer parent, int bytePos, int byteLen, int glType) {
+    public static final Buffer sliceGLBuffer(final ByteBuffer parent, final int bytePos, final int byteLen, final int glType) {
         if (parent == null || byteLen == 0) {
             return null;
         }
@@ -292,9 +293,9 @@ public class GLBuffers extends Buffers {
             case GL.GL_UNSIGNED_SHORT:
             case GL.GL_UNSIGNED_SHORT_5_6_5:
             case GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV:
-            case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4:
+            case GL.GL_UNSIGNED_SHORT_4_4_4_4:
             case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV:
-            case GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1:
+            case GL.GL_UNSIGNED_SHORT_5_5_5_1:
             case GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV:
             case GL2.GL_UNSIGNED_SHORT_8_8_APPLE:
             case GL2.GL_UNSIGNED_SHORT_8_8_REV_APPLE:
@@ -304,21 +305,21 @@ public class GLBuffers extends Buffers {
                 break;
 
             case GL.GL_FIXED:
-            case GL2GL3.GL_INT:
-            case GL2ES2.GL_UNSIGNED_INT:
+            case GL2ES2.GL_INT:
+            case GL.GL_UNSIGNED_INT:
             case GL2GL3.GL_UNSIGNED_INT_8_8_8_8:
             case GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:
-            case GL2GL3.GL_UNSIGNED_INT_10_10_10_2:
-            case GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV:
-            case GL2GL3.GL_UNSIGNED_INT_24_8:
-            case GL2GL3.GL_UNSIGNED_INT_10F_11F_11F_REV:
-            case GL2GL3.GL_UNSIGNED_INT_5_9_9_9_REV:
+            case GL2ES2.GL_UNSIGNED_INT_10_10_10_2:
+            case GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV:
+            case GL.GL_UNSIGNED_INT_24_8:
+            case GL.GL_UNSIGNED_INT_10F_11F_11F_REV:
+            case GL2ES3.GL_UNSIGNED_INT_5_9_9_9_REV:
             case GL2.GL_HILO16_NV:
             case GL2.GL_SIGNED_HILO16_NV:
                 res = parent.slice().order(parent.order()).asIntBuffer(); // slice and duplicate may change byte order
                 break;
 
-            case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
+            case GL2ES3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
                 res = parent.slice().order(parent.order()).asLongBuffer(); // slice and duplicate may change byte order
                 break;
 
@@ -326,7 +327,7 @@ public class GLBuffers extends Buffers {
                 res = parent.slice().order(parent.order()).asFloatBuffer(); // slice and duplicate may change byte order
                 break;
 
-            case GL2.GL_DOUBLE:
+            case GL2GL3.GL_DOUBLE:
                 res = parent.slice().order(parent.order()).asDoubleBuffer(); // slice and duplicate may change byte order
                 break;
         }
@@ -334,7 +335,7 @@ public class GLBuffers extends Buffers {
         return res;
     }
 
-    private static final int glGetInteger(GL gl, int pname, int[] tmp) {
+    private static final int glGetInteger(final GL gl, final int pname, final int[] tmp) {
         gl.glGetIntegerv(pname, tmp, 0);
         return tmp[0];
     }
@@ -359,9 +360,9 @@ public class GLBuffers extends Buffers {
      * @return required minimum size of the buffer in bytes
      * @throws GLException if alignment is invalid. Please contact the maintainer if this is our bug.
      */
-    public static final int sizeof(GL gl, int tmp[],
-                                   int bytesPerPixel, int width, int height, int depth,
-                                   boolean pack) {
+    public static final int sizeof(final GL gl, final int tmp[],
+                                   final int bytesPerPixel, int width, int height, int depth,
+                                   final boolean pack) {
         int rowLength = 0;
         int skipRows = 0;
         int skipPixels = 0;
@@ -372,9 +373,9 @@ public class GLBuffers extends Buffers {
         if (pack) {
           alignment = glGetInteger(gl, GL.GL_PACK_ALIGNMENT, tmp);
           if(gl.isGL2GL3()) {
-              rowLength = glGetInteger(gl, GL2GL3.GL_PACK_ROW_LENGTH, tmp);
-              skipRows = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_ROWS, tmp);
-              skipPixels = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_PIXELS, tmp);
+              rowLength = glGetInteger(gl, GL2ES3.GL_PACK_ROW_LENGTH, tmp);
+              skipRows = glGetInteger(gl, GL2ES3.GL_PACK_SKIP_ROWS, tmp);
+              skipPixels = glGetInteger(gl, GL2ES3.GL_PACK_SKIP_PIXELS, tmp);
               if (depth > 1) {
                   imageHeight = glGetInteger(gl, GL2GL3.GL_PACK_IMAGE_HEIGHT, tmp);
                   skipImages = glGetInteger(gl, GL2GL3.GL_PACK_SKIP_IMAGES, tmp);
@@ -383,12 +384,12 @@ public class GLBuffers extends Buffers {
         } else {
           alignment = glGetInteger(gl, GL.GL_UNPACK_ALIGNMENT, tmp);
           if(gl.isGL2GL3 ()) {
-              rowLength = glGetInteger(gl, GL2GL3.GL_UNPACK_ROW_LENGTH, tmp);
-              skipRows = glGetInteger(gl, GL2GL3.GL_UNPACK_SKIP_ROWS, tmp);
-              skipPixels = glGetInteger(gl, GL2GL3.GL_UNPACK_SKIP_PIXELS, tmp);
+              rowLength = glGetInteger(gl, GL2ES2.GL_UNPACK_ROW_LENGTH, tmp);
+              skipRows = glGetInteger(gl, GL2ES2.GL_UNPACK_SKIP_ROWS, tmp);
+              skipPixels = glGetInteger(gl, GL2ES2.GL_UNPACK_SKIP_PIXELS, tmp);
               if (depth > 1) {
-                  imageHeight = glGetInteger(gl, GL2GL3.GL_UNPACK_IMAGE_HEIGHT, tmp);
-                  skipImages = glGetInteger(gl, GL2GL3.GL_UNPACK_SKIP_IMAGES, tmp);
+                  imageHeight = glGetInteger(gl, GL2ES3.GL_UNPACK_IMAGE_HEIGHT, tmp);
+                  skipImages = glGetInteger(gl, GL2ES3.GL_UNPACK_SKIP_IMAGES, tmp);
                }
           }
         }
@@ -511,9 +512,9 @@ public class GLBuffers extends Buffers {
      * @return required minimum size of the buffer in bytes
      * @throws GLException if format, type or alignment is not handled. Please contact the maintainer if this is our bug.
      */
-    public static final int sizeof(GL gl, int tmp[],
-                                   int format, int type, int width, int height, int depth,
-                                   boolean pack) throws GLException {
+    public static final int sizeof(final GL gl, final int tmp[],
+                                   final int format, final int type, final int width, final int height, final int depth,
+                                   final boolean pack) throws GLException {
         if (width < 0) return 0;
         if (height < 0) return 0;
         if (depth < 0) return 0;
@@ -578,16 +579,19 @@ public class GLBuffers extends Buffers {
      * @return required size of one pixel in bytes
      * @throws GLException if format or type alignment is not handled. Please contact the maintainer if this is our bug.
      */
-    public static final int bytesPerPixel(int format, int type) throws GLException {
+    public static final int bytesPerPixel(final int format, final int type) throws GLException {
         int compSize = 0;
 
         int compCount = componentCount(format);
 
         switch (type) /* 30 */ {
             case GL2.GL_BITMAP:
-              if (GL2.GL_COLOR_INDEX == format || GL2GL3.GL_STENCIL_INDEX == format) {
+              if (GL2.GL_COLOR_INDEX == format || GL2ES2.GL_STENCIL_INDEX == format) {
                   compSize = 1;
+              } else {
+                  throw new GLException("BITMAP type only supported for format COLOR_INDEX and STENCIL_INDEX, not 0x"+Integer.toHexString(format));
               }
+              break;
             case GL.GL_BYTE:
             case GL.GL_UNSIGNED_BYTE:
               compSize = 1;
@@ -615,9 +619,9 @@ public class GLBuffers extends Buffers {
               break;
             case GL.GL_UNSIGNED_SHORT_5_6_5:
             case GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV:
-            case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4:
+            case GL.GL_UNSIGNED_SHORT_4_4_4_4:
             case GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV:
-            case GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1:
+            case GL.GL_UNSIGNED_SHORT_5_5_5_1:
             case GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV:
             case GL2.GL_UNSIGNED_SHORT_8_8_APPLE:
             case GL2.GL_UNSIGNED_SHORT_8_8_REV_APPLE:
@@ -631,15 +635,15 @@ public class GLBuffers extends Buffers {
               break;
             case GL2GL3.GL_UNSIGNED_INT_8_8_8_8:
             case GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV:
-            case GL2GL3.GL_UNSIGNED_INT_10_10_10_2:
-            case GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV:
-            case GL2GL3.GL_UNSIGNED_INT_24_8:
-            case GL2GL3.GL_UNSIGNED_INT_10F_11F_11F_REV:
-            case GL2GL3.GL_UNSIGNED_INT_5_9_9_9_REV:
+            case GL2ES2.GL_UNSIGNED_INT_10_10_10_2:
+            case GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV:
+            case GL.GL_UNSIGNED_INT_24_8:
+            case GL.GL_UNSIGNED_INT_10F_11F_11F_REV:
+            case GL2ES3.GL_UNSIGNED_INT_5_9_9_9_REV:
               compSize = 4;
               compCount = 1;
               break;
-            case GL2GL3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
+            case GL2ES3.GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
               compSize = 8;
               compCount = 1;
               break;
@@ -681,33 +685,33 @@ public class GLBuffers extends Buffers {
      * @return number of components required for the given OpenGL format
      * @throws GLException if format is not handled. Please contact the maintainer if this is our bug.
      */
-    public static final int componentCount(int format) throws GLException {
+    public static final int componentCount(final int format) throws GLException {
         final int compCount;
 
         switch (format) /* 26 */ {
             case GL2.GL_COLOR_INDEX:
-            case GL2GL3.GL_STENCIL_INDEX:
-            case GL2GL3.GL_DEPTH_COMPONENT:
-            case GL2GL3.GL_DEPTH_STENCIL:
-            case GL2GL3.GL_RED:
-            case GL2GL3.GL_RED_INTEGER:
-            case GL2GL3.GL_GREEN:
+            case GL2ES2.GL_STENCIL_INDEX:
+            case GL2ES2.GL_DEPTH_COMPONENT:
+            case GL.GL_DEPTH_STENCIL:
+            case GL2ES2.GL_RED:
+            case GL2ES3.GL_RED_INTEGER:
+            case GL2ES3.GL_GREEN:
             case GL2GL3.GL_GREEN_INTEGER:
-            case GL2GL3.GL_BLUE:
+            case GL2ES3.GL_BLUE:
             case GL2GL3.GL_BLUE_INTEGER:
             case GL.GL_ALPHA:
             case GL.GL_LUMINANCE:
               compCount = 1;
               break;
             case GL.GL_LUMINANCE_ALPHA:
-            case GL2GL3.GL_RG:
-            case GL2GL3.GL_RG_INTEGER:
+            case GL2ES2.GL_RG:
+            case GL2ES3.GL_RG_INTEGER:
             case GL2.GL_HILO_NV:
             case GL2.GL_SIGNED_HILO_NV:
               compCount = 2;
               break;
             case GL.GL_RGB:
-            case GL2GL3.GL_RGB_INTEGER:
+            case GL2ES3.GL_RGB_INTEGER:
             case GL2GL3.GL_BGR:
             case GL2GL3.GL_BGR_INTEGER:
               compCount = 3;
@@ -716,7 +720,7 @@ public class GLBuffers extends Buffers {
               compCount = 3;
               break;
             case GL.GL_RGBA:
-            case GL2GL3.GL_RGBA_INTEGER:
+            case GL2ES3.GL_RGBA_INTEGER:
             case GL.GL_BGRA:
             case GL2GL3.GL_BGRA_INTEGER:
             case GL2.GL_ABGR_EXT:
@@ -748,9 +752,9 @@ public class GLBuffers extends Buffers {
     //----------------------------------------------------------------------
     // Conversion routines
     //
-    public final static float[] getFloatArray(double[] source) {
+    public final static float[] getFloatArray(final double[] source) {
         int i = source.length;
-        float[] dest = new float[i--];
+        final float[] dest = new float[i--];
         while (i >= 0) {
             dest[i] = (float) source[i];
             i--;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java b/src/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java
index cf88e7b..956693c 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLDrawableUtil.java
@@ -28,6 +28,7 @@
 package com.jogamp.opengl.util;
 
 import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.NativeSurface;
 import javax.media.opengl.GLAnimatorControl;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLBase;
@@ -36,7 +37,10 @@ import javax.media.opengl.GLContext;
 import javax.media.opengl.GLDrawable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLException;
+import javax.media.opengl.GLRunnable;
+import javax.media.opengl.Threading;
 
+import com.jogamp.common.util.locks.RecursiveLock;
 import com.jogamp.opengl.GLEventListenerState;
 
 import jogamp.opengl.Debug;
@@ -45,148 +49,298 @@ import jogamp.opengl.Debug;
  * Providing utility functions dealing w/ {@link GLDrawable}s, {@link GLAutoDrawable} and their {@link GLEventListener}.
  */
 public class GLDrawableUtil {
-  protected static final boolean DEBUG = Debug.debug("GLDrawable");
-
-  public static final boolean isAnimatorStartedOnOtherThread(GLAnimatorControl animatorCtrl) {
-    return ( null != animatorCtrl ) ? animatorCtrl.isStarted() && animatorCtrl.getThread() != Thread.currentThread() : false ;
-  }
-
-  public static final boolean isAnimatorStarted(GLAnimatorControl animatorCtrl) {
-    return ( null != animatorCtrl ) ? animatorCtrl.isStarted() : false ;
-  }
-
-  public static final boolean isAnimatorAnimatingOnOtherThread(GLAnimatorControl animatorCtrl) {
-    return ( null != animatorCtrl ) ? animatorCtrl.isAnimating() && animatorCtrl.getThread() != Thread.currentThread() : false ;
-  }
-
-  public static final boolean isAnimatorAnimating(GLAnimatorControl animatorCtrl) {
-    return ( null != animatorCtrl ) ? animatorCtrl.isAnimating() : false ;
-  }
-
-  /**
-   * Moves the designated {@link GLEventListener} from {@link GLAutoDrawable} <code>src</code> to <code>dest</code>.
-   * If <code>preserveInitState</code> is <code>true</code>, it's initialized state is preserved
-   * and {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape(..)} issued w/ the next {@link GLAutoDrawable#display()} call.
-   * <p>
-   * Note that it is only legal to pass <code>preserveInitState := true</code>,
-   * if the {@link GLContext} of both <code>src</code> and <code>dest</code> are shared, or has itself moved from <code>src</code> to <code>dest</code>.
-   * </p>
-   * <p>
-   * Also note that the caller is encouraged to pause an attached {@link GLAnimatorControl}.
-   * </p>
-   * @param src
-   * @param dest
-   * @param listener
-   * @param preserveInitState
-   */
-  public static final void moveGLEventListener(GLAutoDrawable src, GLAutoDrawable dest, GLEventListener listener, boolean preserveInitState) {
-    final boolean initialized = src.getGLEventListenerInitState(listener);
-    src.removeGLEventListener(listener);
-    dest.addGLEventListener(listener);
-    if(preserveInitState && initialized) {
-        dest.setGLEventListenerInitState(listener, true);
-        dest.invoke(false, new GLEventListenerState.ReshapeGLEventListener(listener));
-    } // else .. !init state is default
-  }
-
-  /**
-   * Moves all {@link GLEventListener} from {@link GLAutoDrawable} <code>src</code> to <code>dest</code>.
-   * If <code>preserveInitState</code> is <code>true</code>, it's initialized state is preserved
-   * and {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape(..)} issued w/ the next {@link GLAutoDrawable#display()} call.
-   * <p>
-   * Note that it is only legal to pass <code>preserveInitState := true</code>,
-   * if the {@link GLContext} of both <code>src</code> and <code>dest</code> are shared, or has itself moved from <code>src</code> to <code>dest</code>.
-   * </p>
-   * <p>
-   * Also note that the caller is encouraged to pause an attached {@link GLAnimatorControl}.
-   * </p>
-   * @param src
-   * @param dest
-   * @param listener
-   * @param preserveInitState
-   */
-  public static final void moveAllGLEventListener(GLAutoDrawable src, GLAutoDrawable dest, boolean preserveInitState) {
-    for(int count = src.getGLEventListenerCount(); 0<count; count--) {
-        final GLEventListener listener = src.getGLEventListener(0);
-        moveGLEventListener(src, dest, listener, preserveInitState);
+    protected static final boolean DEBUG = Debug.debug("GLDrawable");
+
+    public static final boolean isAnimatorStartedOnOtherThread(final GLAnimatorControl animatorCtrl) {
+        return ( null != animatorCtrl ) ? animatorCtrl.isStarted() && animatorCtrl.getThread() != Thread.currentThread() : false ;
+    }
+
+    public static final boolean isAnimatorStarted(final GLAnimatorControl animatorCtrl) {
+        return ( null != animatorCtrl ) ? animatorCtrl.isStarted() : false ;
     }
-  }
-
-  /**
-   * Swaps the {@link GLContext} and all {@link GLEventListener} between {@link GLAutoDrawable} <code>a</code> and <code>b</code>,
-   * while preserving it's initialized state, resets the GL-Viewport and issuing {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape(..)}.
-   * <p>
-   * The {@link GLAutoDrawable} to {@link GLAnimatorControl} association
-   * is also swapped.
-   * </p>
-   * <p>
-   * If an {@link GLAnimatorControl} is being attached to {@link GLAutoDrawable} <code>a</code> or <code>b</code>
-   * and the current thread is different than {@link GLAnimatorControl#getThread() the animator's thread}, it is paused during the operation.
-   * </p>
-   * @param a
-   * @param b
-   * @throws GLException if the {@link AbstractGraphicsDevice} are incompatible w/ each other.
-   */
-  public static final void swapGLContextAndAllGLEventListener(GLAutoDrawable a, GLAutoDrawable b) {
-    final GLEventListenerState gllsA = GLEventListenerState.moveFrom(a);
-    final GLEventListenerState gllsB = GLEventListenerState.moveFrom(b);
-
-    gllsA.moveTo(b);
-    gllsB.moveTo(a);
-  }
-
-  /**
-   * Swaps the {@link GLContext} of given {@link GLAutoDrawable}
-   * and {@link GLAutoDrawable#disposeGLEventListener(GLEventListener, boolean) disposes}
-   * each {@link GLEventListener} w/o removing it.
-   * <p>
-   * The GL-Viewport is reset and {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape(..)} issued implicit.
-   * </p>
-   * <p>
-   * If an {@link GLAnimatorControl} is being attached to GLAutoDrawable src or dest and the current thread is different
-   * than {@link GLAnimatorControl#getThread() the animator's thread}, it is paused during the operation.
-   * </p>
-   * @param src
-   * @param dest
-   */
-  public static final void swapGLContext(GLAutoDrawable src, GLAutoDrawable dest) {
-    final GLAnimatorControl aAnim = src.getAnimator();
-    final GLAnimatorControl bAnim = dest.getAnimator();
-    final boolean aIsPaused = isAnimatorAnimatingOnOtherThread(aAnim) && aAnim.pause();
-    final boolean bIsPaused = isAnimatorAnimatingOnOtherThread(bAnim) && bAnim.pause();
-
-    for(int i = src.getGLEventListenerCount() - 1; 0 <= i; i--) {
-        src.disposeGLEventListener(src.getGLEventListener(i), false);
+
+    public static final boolean isAnimatorAnimatingOnOtherThread(final GLAnimatorControl animatorCtrl) {
+        return ( null != animatorCtrl ) ? animatorCtrl.isAnimating() && animatorCtrl.getThread() != Thread.currentThread() : false ;
+    }
+
+    public static final boolean isAnimatorAnimating(final GLAnimatorControl animatorCtrl) {
+        return ( null != animatorCtrl ) ? animatorCtrl.isAnimating() : false ;
     }
-    for(int i = dest.getGLEventListenerCount() - 1; 0 <= i; i--) {
-        dest.disposeGLEventListener(dest.getGLEventListener(i), false);
+
+    /**
+     * {@link GLRunnable} to issue {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int)},
+     * returning <code>true</code> on {@link GLRunnable#run(GLAutoDrawable)}.
+     */
+    public static class ReshapeGLEventListener implements GLRunnable {
+        private final GLEventListener listener;
+        private final boolean displayAfterReshape;
+        /**
+         *
+         * @param listener
+         * @param displayAfterReshape <code>true</code> to issue {@link GLEventListener#display(GLAutoDrawable)}
+         *                            after {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int)},
+         *                            otherwise false.
+         */
+        public ReshapeGLEventListener(final GLEventListener listener, final boolean displayAfterReshape) {
+            this.listener = listener;
+            this.displayAfterReshape = displayAfterReshape;
+        }
+        @Override
+        public boolean run(final GLAutoDrawable drawable) {
+            listener.reshape(drawable, 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
+            if( displayAfterReshape ) {
+                listener.display(drawable);
+            }
+            return true;
+        }
+    }
+
+    /**
+     * Moves the designated {@link GLEventListener} from {@link GLAutoDrawable} <code>src</code> to <code>dest</code>.
+     * If <code>preserveInitState</code> is <code>true</code>, it's initialized state is preserved
+     * and {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape(..)} issued w/ the next {@link GLAutoDrawable#display()} call.
+     * <p>
+     * Note that it is only legal to pass <code>preserveInitState := true</code>,
+     * if the {@link GLContext} of both <code>src</code> and <code>dest</code> are shared, or has itself moved from <code>src</code> to <code>dest</code>.
+     * </p>
+     * <p>
+     * Also note that the caller is encouraged to pause an attached {@link GLAnimatorControl}.
+     * </p>
+     * @param src
+     * @param dest
+     * @param listener
+     * @param preserveInitState
+     */
+    public static final void moveGLEventListener(final GLAutoDrawable src, final GLAutoDrawable dest, final GLEventListener listener, final boolean preserveInitState) {
+        final boolean initialized = src.getGLEventListenerInitState(listener);
+        if( preserveInitState ) {
+            src.removeGLEventListener(listener);
+            dest.addGLEventListener(listener);
+            if( initialized ) {
+                dest.setGLEventListenerInitState(listener, true);
+                dest.invoke(false, new ReshapeGLEventListener(listener, true));
+            }
+        } else {
+            src.disposeGLEventListener(listener, true);
+            dest.addGLEventListener(listener);
+        }
+    }
+
+    /**
+     * Moves all {@link GLEventListener} from {@link GLAutoDrawable} <code>src</code> to <code>dest</code>.
+     * If <code>preserveInitState</code> is <code>true</code>, it's initialized state is preserved
+     * and {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape(..)} issued w/ the next {@link GLAutoDrawable#display()} call.
+     * <p>
+     * Note that it is only legal to pass <code>preserveInitState := true</code>,
+     * if the {@link GLContext} of both <code>src</code> and <code>dest</code> are shared, or has itself moved from <code>src</code> to <code>dest</code>.
+     * </p>
+     * <p>
+     * Also note that the caller is encouraged to pause an attached {@link GLAnimatorControl}.
+     * </p>
+     * @param src
+     * @param dest
+     * @param listener
+     * @param preserveInitState
+     */
+    public static final void moveAllGLEventListener(final GLAutoDrawable src, final GLAutoDrawable dest, final boolean preserveInitState) {
+        for(int count = src.getGLEventListenerCount(); 0<count; count--) {
+            final GLEventListener listener = src.getGLEventListener(0);
+            moveGLEventListener(src, dest, listener, preserveInitState);
+        }
+    }
+
+    /**
+     * Return a heuristic value whether switching the {@link GLContext} is safe between {@lin GLAutoDrawable}s,
+     * i.e. via {@link #swapGLContext(GLAutoDrawable, GLAutoDrawable)} or {@link #swapGLContextAndAllGLEventListener(GLAutoDrawable, GLAutoDrawable)}.
+     * <p>
+     * Method currently returns <code>false</code> if:
+     * <ul>
+     *   <li>Switching between on- and offscreen and one of the following is <code>true</code>:
+     *     <ul>
+     *       <li>{@link GLCapabilitiesImmutable#getSampleBuffers() MSAA is <i>used</i>} [1] in <code>chosenCapsA</code> or <code>chosenCapsB</code></li>
+     *       <li>{@link GLCapabilitiesImmutable#getStereo() Stereo is <i>used</i>} in <code>chosenCapsA</code> or <code>chosenCapsB</code></li>
+     *       <li>{@link GLCapabilitiesImmutable#getAccumAlphaBits() Accumulator Buffer is <i>requested</i>} [2] in <code>requestedCaps</code></li>
+     *     </ul></li>
+     * </ul>
+     * Otherwise method returns <code>true</code>
+     * </p>
+     * <pre>
+     * [1] See Bug 830: swapGLContextAndAllGLEventListener and onscreen MSAA w/ NV/GLX
+     *     On NVidia GPUs w/ it's proprietary driver context swapping does not work if MSAA is involved
+     *     and when swapping on- to offscreen.
+     * </pre>
+     * <pre>
+     * [2] On AMD GPUs w/ it's proprietary driver, requesting an accumulator buffer leads to receive an accumulator buffer configuration,
+     *     for which context swapping does not work when swapping on- to offscreen and vice-versa, i.e. cannot make context current.
+     *     With AMD and Mesa drivers we only receive an accumulator buffer if requested,
+     *     where on NVidia drivers all configurations contain the accumulator buffer.
+     *     On both drivers, NVidia and Mesa, context swapping with accumulator buffer works.
+     * </pre>
+     * @param requestedCaps requested {@link GLCapabilitiesImmutable} which are intended for usage by both {@link GLAutoDrawable}s A and B
+     * @param chosenCapsA chosen {@link GLCapabilitiesImmutable} of {@link GLAutoDrawable} A, which {@link GLContext} is intended to be swapped
+     * @param chosenCapsB chosen {@link GLCapabilitiesImmutable} of {@link GLAutoDrawable} B, which {@link GLContext} is intended to be swapped
+     * @see #swapGLContext(GLAutoDrawable, GLAutoDrawable)
+     * @see #swapGLContextAndAllGLEventListener(GLAutoDrawable, GLAutoDrawable)
+     */
+    public static boolean isSwapGLContextSafe(final GLCapabilitiesImmutable requestedCaps, final GLCapabilitiesImmutable chosenCapsA, final GLCapabilitiesImmutable chosenCapsB) {
+        final boolean usingAccumulatorBuffer = requestedCaps.getAccumAlphaBits() > 0 ||
+                                               requestedCaps.getAccumRedBits()   > 0 ||
+                                               requestedCaps.getAccumGreenBits() > 0 ||
+                                               requestedCaps.getAccumBlueBits()  > 0;
+        if( ( chosenCapsA.isOnscreen() && !chosenCapsB.isOnscreen() || !chosenCapsA.isOnscreen() && chosenCapsB.isOnscreen() ) && // switching between on- and offscreen
+            (
+              ( chosenCapsA.getSampleBuffers() || chosenCapsB.getSampleBuffers() ) ||  // MSAA involved
+              ( chosenCapsA.getStereo() || chosenCapsB.getStereo() )               ||  // Stereo involved
+              usingAccumulatorBuffer                                                   // Using accumulator buffer
+            )
+          )
+        {
+            return false;
+        } else {
+            return true;
+        }
+    }
+    /**
+     * Swaps the {@link GLContext} and all {@link GLEventListener} between {@link GLAutoDrawable} <code>a</code> and <code>b</code>,
+     * while preserving it's initialized state, resets the GL-Viewport and issuing {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape(..)}.
+     * <p>
+     * The {@link GLAutoDrawable} to {@link GLAnimatorControl} association
+     * is also swapped.
+     * </p>
+     * <p>
+     * If an {@link GLAnimatorControl} is being attached to {@link GLAutoDrawable} <code>a</code> or <code>b</code>
+     * and the current thread is different than {@link GLAnimatorControl#getThread() the animator's thread}, it is paused during the operation.
+     * </p>
+     * <p>
+     * During operation, both {@link GLAutoDrawable auto-drawable's}
+     * {@link GLAutoDrawable#getUpstreamLock() upstream-locks} and {@link GLAutoDrawable#getNativeSurface() surfaces} are locked,
+     * hence atomicity of operation is guaranteed,
+     * see <a href="../../../../javax/media/opengl/GLAutoDrawable.html#locking">GLAutoDrawable Locking</a>.
+     * </p>
+     * <p>
+     * Because of above mentioned locking, if this method is not performed
+     * on {@link GLAutoDrawable#isThreadGLCapable() a OpenGL capable thread} of <i>both</i>
+     * {@link GLAutoDrawable}s, it must be invoked on such an OpenGL capable thread,
+     * e.g. via {@link Threading#invokeOnOpenGLThread(boolean, Runnable)}.
+     * </p>
+     * @throws GLException if the {@link AbstractGraphicsDevice} are incompatible w/ each other.
+     * @see #isSwapGLContextSafe(GLCapabilitiesImmutable, GLCapabilitiesImmutable, GLCapabilitiesImmutable)
+     */
+    public static final void swapGLContextAndAllGLEventListener(final GLAutoDrawable a, final GLAutoDrawable b) {
+        final GLEventListenerState gllsA = GLEventListenerState.moveFrom(a, true);
+        final GLEventListenerState gllsB = GLEventListenerState.moveFrom(b, true);
+        final Runnable gllsAUnlockOp = gllsA.getUnlockSurfaceOp();
+        final Runnable gllsBUnlockOp = gllsB.getUnlockSurfaceOp();
+        try {
+            gllsA.moveTo(b, gllsBUnlockOp);
+            gllsB.moveTo(a, gllsAUnlockOp);
+        } finally {
+            // guarantee unlock in case of an exception
+            gllsBUnlockOp.run();
+            gllsAUnlockOp.run();
+        }
+    }
+
+    /**
+     * Swaps the {@link GLContext} of given {@link GLAutoDrawable}
+     * and {@link GLAutoDrawable#disposeGLEventListener(GLEventListener, boolean) disposes}
+     * each {@link GLEventListener} w/o removing it.
+     * <p>
+     * The GL-Viewport is reset and {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape(..)} issued implicit.
+     * </p>
+     * <p>
+     * If an {@link GLAnimatorControl} is being attached to GLAutoDrawable src or dest and the current thread is different
+     * than {@link GLAnimatorControl#getThread() the animator's thread}, it is paused during the operation.
+     * </p>
+     * <p>
+     * During operation, both {@link GLAutoDrawable auto-drawable's}
+     * {@link GLAutoDrawable#getUpstreamLock() upstream-locks} and {@link GLAutoDrawable#getNativeSurface() surfaces} are locked,
+     * hence atomicity of operation is guaranteed,
+     * see <a href="../../../../javax/media/opengl/GLAutoDrawable.html#locking">GLAutoDrawable Locking</a>.
+     * </p>
+     * <p>
+     * Because of above mentioned locking, if this method is not performed
+     * on {@link GLAutoDrawable#isThreadGLCapable() a OpenGL capable thread} of <i>both</i>
+     * {@link GLAutoDrawable}s, it must be invoked on such an OpenGL capable thread,
+     * e.g. via {@link Threading#invokeOnOpenGLThread(boolean, Runnable)}.
+     * </p>
+     * @param a
+     * @param b
+     * @see #isSwapGLContextSafe(GLCapabilitiesImmutable, GLCapabilitiesImmutable, GLCapabilitiesImmutable)
+     */
+    public static final void swapGLContext(final GLAutoDrawable a, final GLAutoDrawable b) {
+        final GLAnimatorControl aAnim = a.getAnimator();
+        final GLAnimatorControl bAnim = b.getAnimator();
+        final boolean aIsPaused = isAnimatorAnimatingOnOtherThread(aAnim) && aAnim.pause();
+        final boolean bIsPaused = isAnimatorAnimatingOnOtherThread(bAnim) && bAnim.pause();
+
+        final RecursiveLock aUpstreamLock = a.getUpstreamLock();
+        final RecursiveLock bUpstreamLock = b.getUpstreamLock();
+        aUpstreamLock.lock();
+        bUpstreamLock.lock();
+        try {
+            final NativeSurface aSurface = a.getNativeSurface();
+            final boolean aSurfaceLocked = NativeSurface.LOCK_SURFACE_NOT_READY < aSurface.lockSurface();
+            if( a.isRealized() && !aSurfaceLocked ) {
+                throw new GLException("Could not lock realized a surface "+a);
+            }
+            final NativeSurface bSurface = b.getNativeSurface();
+            final boolean bSurfaceLocked = NativeSurface.LOCK_SURFACE_NOT_READY < bSurface.lockSurface();
+            if( b.isRealized() && !bSurfaceLocked ) {
+                throw new GLException("Could not lock realized b surface "+b);
+            }
+            try {
+                for(int i = a.getGLEventListenerCount() - 1; 0 <= i; i--) {
+                    a.disposeGLEventListener(a.getGLEventListener(i), false);
+                }
+                for(int i = b.getGLEventListenerCount() - 1; 0 <= i; i--) {
+                    b.disposeGLEventListener(b.getGLEventListener(i), false);
+                }
+                b.setContext( a.setContext( b.getContext(), false ), false );
+
+            } finally {
+                if( bSurfaceLocked ) {
+                    bSurface.unlockSurface();
+                }
+                if( aSurfaceLocked ) {
+                    aSurface.unlockSurface();
+                }
+            }
+        } finally {
+            bUpstreamLock.unlock();
+            aUpstreamLock.unlock();
+        }
+        a.invoke(true, setViewport);
+        b.invoke(true, setViewport);
+        if(aIsPaused) { aAnim.resume(); }
+        if(bIsPaused) { bAnim.resume(); }
+    }
+
+    private static final GLRunnable setViewport = new GLRunnable() {
+        @Override
+        public boolean run(final GLAutoDrawable drawable) {
+            drawable.getGL().glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
+            return false; // issue re-display w/ new viewport!
+        }
+    };
+
+    /**
+     * Determines whether the chosen {@link GLCapabilitiesImmutable}
+     * requires a {@link GLDrawable#swapBuffers() swap-buffers}
+     * before reading pixels.
+     * <p>
+     * Usually one uses the {@link GLBase#getDefaultReadBuffer() default-read-buffer}
+     * in which case {@link GLDrawable#swapBuffers() swap-buffers} shall happen <b>after</b> calling reading pixels, the default.
+     * </p>
+     * <p>
+     * However, <i>multisampling</i> offscreen {@link javax.media.opengl.GLFBODrawable}s
+     * utilize {@link GLDrawable#swapBuffers() swap-buffers} to <i>downsample</i>
+     * the multisamples into the readable sampling sink.
+     * In this case, we require {@link GLDrawable#swapBuffers() swap-buffers} <b>before</b> reading pixels.
+     * </p>
+     * @return chosenCaps.isFBO() && chosenCaps.getSampleBuffers()
+     */
+    public static final boolean swapBuffersBeforeRead(final GLCapabilitiesImmutable chosenCaps) {
+        return chosenCaps.isFBO() && chosenCaps.getSampleBuffers();
     }
-    dest.setContext( src.setContext( dest.getContext(), false ), false );
-
-    src.invoke(true, GLEventListenerState.setViewport);
-    dest.invoke(true, GLEventListenerState.setViewport);
-
-    if(aIsPaused) { aAnim.resume(); }
-    if(bIsPaused) { bAnim.resume(); }
-  }
-
-  /**
-   * Determines whether the chosen {@link GLCapabilitiesImmutable}
-   * requires a {@link GLDrawable#swapBuffers() swap-buffers}
-   * before reading pixels.
-   * <p>
-   * Usually one uses the {@link GLBase#getDefaultReadBuffer() default-read-buffer}
-   * in which case {@link GLDrawable#swapBuffers() swap-buffers} shall happen <b>after</b> calling reading pixels, the default.
-   * </p>
-   * <p>
-   * However, <i>multisampling</i> offscreen {@link javax.media.opengl.GLFBODrawable}s
-   * utilize {@link GLDrawable#swapBuffers() swap-buffers} to <i>downsample</i>
-   * the multisamples into the readable sampling sink.
-   * In this case, we require {@link GLDrawable#swapBuffers() swap-buffers} <b>before</b> reading pixels.
-   * </p>
-   * @return chosenCaps.isFBO() && chosenCaps.getSampleBuffers()
-   */
-  public static final boolean swapBuffersBeforeRead(final GLCapabilitiesImmutable chosenCaps) {
-      return chosenCaps.isFBO() && chosenCaps.getSampleBuffers();
-  }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java b/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java
index 223c23e..a09321d 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLPixelBuffer.java
@@ -32,7 +32,6 @@ import java.nio.ByteBuffer;
 
 import javax.media.nativewindow.util.PixelFormat;
 import javax.media.opengl.GL;
-import javax.media.opengl.GL2;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GL2ES3;
 import javax.media.opengl.GL2GL3;
@@ -103,7 +102,7 @@ public class GLPixelBuffer {
          * @param allowRowStride If <code>true</code>, allow row-stride, otherwise not.
          * See {@link #getAllowRowStride()} and {@link GLPixelBuffer#requiresNewBuffer(GL, int, int, int)}.
          */
-        public DefaultGLPixelBufferProvider(boolean allowRowStride) {
+        public DefaultGLPixelBufferProvider(final boolean allowRowStride) {
             this.allowRowStride = allowRowStride;
         }
 
@@ -111,7 +110,7 @@ public class GLPixelBuffer {
         public boolean getAllowRowStride() { return allowRowStride; }
 
         @Override
-        public GLPixelAttributes getAttributes(GL gl, int componentCount) {
+        public GLPixelAttributes getAttributes(final GL gl, final int componentCount) {
             final GLContext ctx = gl.getContext();
             final int dFormat, dType;
 
@@ -121,14 +120,14 @@ public class GLPixelBuffer {
                     dFormat = GL2ES2.GL_RED;
                 } else {
                     // ALPHA is supported on ES2 and GL2, i.e. <= GL3 [core] or compatibility
-                    dFormat = GL2ES2.GL_ALPHA;
+                    dFormat = GL.GL_ALPHA;
                 }
                 dType   = GL.GL_UNSIGNED_BYTE;
             } else if( 3 == componentCount ) {
                 dFormat = GL.GL_RGB;
                 dType   = GL.GL_UNSIGNED_BYTE;
             } else if( 4 == componentCount ) {
-                int _dFormat = ctx.getDefaultPixelDataFormat();
+                final int _dFormat = ctx.getDefaultPixelDataFormat();
                 final int dComps = GLBuffers.componentCount(_dFormat);
                 if( dComps == componentCount ) {
                     dFormat = _dFormat;
@@ -150,11 +149,11 @@ public class GLPixelBuffer {
          * </p>
          */
         @Override
-        public GLPixelBuffer allocate(GL gl, GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize) {
+        public GLPixelBuffer allocate(final GL gl, final GLPixelAttributes pixelAttributes, final int width, final int height, final int depth, final boolean pack, final int minByteSize) {
             if( minByteSize > 0 ) {
                 return new GLPixelBuffer(pixelAttributes, width, height, depth, pack, Buffers.newDirectByteBuffer(minByteSize), getAllowRowStride());
             } else {
-                int[] tmp = { 0 };
+                final int[] tmp = { 0 };
                 final int byteSize = GLBuffers.sizeof(gl, tmp, pixelAttributes.bytesPerPixel, width, height, depth, pack);
                 return new GLPixelBuffer(pixelAttributes, width, height, depth, pack, Buffers.newDirectByteBuffer(byteSize), getAllowRowStride());
             }
@@ -166,14 +165,14 @@ public class GLPixelBuffer {
      * utilizing best match for {@link GLPixelAttributes}
      * and {@link GLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocating} a {@link ByteBuffer}.
      */
-    public static GLPixelBufferProvider defaultProviderNoRowStride = new DefaultGLPixelBufferProvider(false);
+    public static final GLPixelBufferProvider defaultProviderNoRowStride = new DefaultGLPixelBufferProvider(false);
 
     /**
      * Default {@link GLPixelBufferProvider} with {@link GLPixelBufferProvider#getAllowRowStride()} == <code>true</code>,
      * utilizing best match for {@link GLPixelAttributes}
      * and {@link GLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocating} a {@link ByteBuffer}.
      */
-    public static GLPixelBufferProvider defaultProviderWithRowStride = new DefaultGLPixelBufferProvider(true);
+    public static final GLPixelBufferProvider defaultProviderWithRowStride = new DefaultGLPixelBufferProvider(true);
 
     /** Pixel attributes. */
     public static class GLPixelAttributes {
@@ -194,7 +193,7 @@ public class GLPixelBuffer {
          * @param dataFormat GL data format
          * @param dataType GL data type
          */
-        public GLPixelAttributes(int dataFormat, int dataType) {
+        public GLPixelAttributes(final int dataFormat, final int dataType) {
             this(0 < dataFormat ? GLBuffers.componentCount(dataFormat) : 0, dataFormat, dataType);
         }
         /**
@@ -203,7 +202,7 @@ public class GLPixelBuffer {
          * @param dataFormat GL data format
          * @param dataType GL data type
          */
-        public GLPixelAttributes(int componentCount, int dataFormat, int dataType) {
+        public GLPixelAttributes(final int componentCount, final int dataFormat, final int dataType) {
             this(componentCount, dataFormat, dataType, true);
         }
 
@@ -211,7 +210,7 @@ public class GLPixelBuffer {
          * Returns the matching {@link GLPixelAttributes} for the given {@link PixelFormat} and {@link GLProfile} if exists,
          * otherwise returns <code>null</code>.
          */
-        public static final GLPixelAttributes convert(PixelFormat pixFmt, GLProfile glp) {
+        public static final GLPixelAttributes convert(final PixelFormat pixFmt, final GLProfile glp) {
             int df = 0; // format
             int dt = GL.GL_UNSIGNED_BYTE; // data type
             switch(pixFmt) {
@@ -221,7 +220,7 @@ public class GLPixelBuffer {
                         df = GL2ES2.GL_RED;
                     } else {
                         // ALPHA/LUMINANCE is supported on ES2 and GL2, i.e. <= GL3 [core] or compatibility
-                        df = GL2ES2.GL_LUMINANCE;
+                        df = GL.GL_LUMINANCE;
                     }
                     break;
                 case BGR888:
@@ -256,7 +255,7 @@ public class GLPixelBuffer {
             }
             return null;
         }
-        private GLPixelAttributes(int componentCount, int dataFormat, int dataType, boolean checkArgs) {
+        private GLPixelAttributes(final int componentCount, final int dataFormat, final int dataType, final boolean checkArgs) {
             this.componentCount = componentCount;
             this.format = dataFormat;
             this.type = dataType;
@@ -290,7 +289,7 @@ public class GLPixelBuffer {
                 case GL.GL_RGBA:
                     pixFmt = PixelFormat.RGBA8888;
                     break;
-                case GL2.GL_BGR:
+                case GL2GL3.GL_BGR:
                     pixFmt = PixelFormat.BGR888;
                     break;
                 case GL.GL_BGRA:
@@ -383,7 +382,7 @@ public class GLPixelBuffer {
      * @param buffer the backing array
      * @param allowRowStride If <code>true</code>, allow row-stride, otherwise not. See {@link #requiresNewBuffer(GL, int, int, int)}.
      */
-    public GLPixelBuffer(GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, Buffer buffer, boolean allowRowStride) {
+    public GLPixelBuffer(final GLPixelAttributes pixelAttributes, final int width, final int height, final int depth, final boolean pack, final Buffer buffer, final boolean allowRowStride) {
         this.pixelAttributes = pixelAttributes;
         this.width = width;
         this.height = height;
@@ -414,7 +413,7 @@ public class GLPixelBuffer {
     }
 
     /** Sets the byte position of the {@link #buffer}. */
-    public Buffer position(int bytePos) {
+    public Buffer position(final int bytePos) {
         return buffer.position( bytePos / bufferElemSize );
     }
 
@@ -465,7 +464,7 @@ public class GLPixelBuffer {
      * @param newByteSize if > 0, the pre-calculated minimum byte-size for the resulting buffer, otherwise ignore.
      * @see GLPixelBufferProvider#allocate(GL, GLPixelAttributes, int, int, int, boolean, int)
      */
-    public boolean requiresNewBuffer(GL gl, int newWidth, int newHeight, int newByteSize) {
+    public boolean requiresNewBuffer(final GL gl, final int newWidth, final int newHeight, int newByteSize) {
         if( !isValid() ) {
             return true;
         }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java b/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java
index b6cff85..52612d2 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLPixelStorageModes.java
@@ -36,49 +36,56 @@ import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLException;
 
 /**
- * Utility to safely set and restore the pack and unpack pixel storage mode,
+ * Utility to safely set and restore the PACK and UNPACK pixel storage mode,
  * regardless of the GLProfile.
+ * <p>
+ * PACK for GPU to CPU transfers, e.g. {@link GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer) ReadPixels}, etc.
+ * </p>
+ * <p>
+ * UNPACK for CPU o GPU transfers, e.g. {@link GL#glTexImage2D(int, int, int, int, int, int, int, int, long) TexImage2D}, etc
+ * </p>
  */
 public class GLPixelStorageModes {
-    private final int[] savedGL2GL3Modes = new int[8];
-    private final int[] savedAlignment = new int[2];
-    private boolean saved = false;
+    private final int[] cachePack = new int[8];
+    private final int[] cacheUnpack = new int[8];
+    private boolean savedPack = false;
+    private boolean savedUnpack = false;
 
-    /** Create instance w/o {@link #save(GL)} */
+    /** Create instance w/o {@link #saveAll(GL)} */
     public GLPixelStorageModes() {}
 
-    /** Create instance w/ {@link #save(GL)} */
-    public GLPixelStorageModes(GL gl) { save(gl); }
+    /** Create instance w/ {@link #saveAll(GL)} */
+    public GLPixelStorageModes(final GL gl) { saveAll(gl); }
 
     /**
      * Sets the {@link GL#GL_PACK_ALIGNMENT}.
      * <p>
-     * Saves the pixel storage modes if not saved yet.
+     * Saves the PACK pixel storage modes if not saved yet, see {@link #savePack(GL)}.
      * </p>
      */
-    public final void setPackAlignment(GL gl, int packAlignment) {
-        save(gl);
+    public final void setPackAlignment(final GL gl, final int packAlignment) {
+        savePack(gl);
         gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, packAlignment);
     }
 
     /**
      * Sets the {@link GL#GL_UNPACK_ALIGNMENT}.
      * <p>
-     * Saves the pixel storage modes if not saved yet.
+     * Saves the UNPACK pixel storage modes if not saved yet, see {@link #saveUnpack(GL)}.
      * </p>
      */
-    public final void setUnpackAlignment(GL gl, int unpackAlignment) {
-        save(gl);
+    public final void setUnpackAlignment(final GL gl, final int unpackAlignment) {
+        saveUnpack(gl);
         gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, unpackAlignment);
     }
 
     /**
      * Sets the {@link GL#GL_PACK_ALIGNMENT} and {@link GL#GL_UNPACK_ALIGNMENT}.
      * <p>
-     * Saves the pixel storage modes if not saved yet.
+     * Saves the PACK and UNPACK pixel storage modes if not saved yet, see {@link #saveAll(GL)}.
      * </p>
      */
-    public final void setAlignment(GL gl, int packAlignment, int unpackAlignment) {
+    public final void setAlignment(final GL gl, final int packAlignment, final int unpackAlignment) {
         setPackAlignment(gl, packAlignment);
         setUnpackAlignment(gl, unpackAlignment);
     }
@@ -86,114 +93,219 @@ public class GLPixelStorageModes {
     /**
      * Sets the {@link GL2ES3#GL_PACK_ROW_LENGTH}.
      * <p>
-     * Saves the pixel storage modes if not saved yet.
+     * Saves the PACK pixel storage modes if not saved yet, see {@link #savePack(GL)}.
      * </p>
      */
-    public final void setPackRowLength(GL2ES3 gl, int packRowLength) {
-        save(gl);
+    public final void setPackRowLength(final GL2ES3 gl, final int packRowLength) {
+        savePack(gl);
         gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, packRowLength);
     }
 
     /**
      * Sets the {@link GL2ES2#GL_UNPACK_ROW_LENGTH}.
      * <p>
-     * Saves the pixel storage modes if not saved yet.
+     * Saves the UNPACK pixel storage modes if not saved yet, see {@link #saveUnpack(GL)}.
      * </p>
      */
-    public final void setUnpackRowLength(GL2ES2 gl, int unpackRowLength) {
-        save(gl);
+    public final void setUnpackRowLength(final GL2ES2 gl, final int unpackRowLength) {
+        saveUnpack(gl);
         gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, unpackRowLength);
     }
 
     /**
      * Sets the {@link GL2ES3#GL_PACK_ROW_LENGTH} and {@link GL2ES2#GL_UNPACK_ROW_LENGTH}.
      * <p>
-     * Saves the pixel storage modes if not saved yet.
+     * Saves the PACK and UNPACK pixel storage modes if not saved yet, see {@link #saveAll(GL)}.
      * </p>
      */
-    public final void setRowLength(GL2ES3 gl, int packRowLength, int unpackRowLength) {
+    public final void setRowLength(final GL2ES3 gl, final int packRowLength, final int unpackRowLength) {
         setPackRowLength(gl, packRowLength);
         setUnpackRowLength(gl, unpackRowLength);
     }
 
     /**
-     * Save the pixel storage mode, if not saved yet.
+     * Saves PACK and UNPACK pixel storage modes and {@link #resetAll(GL) resets} them,
+     * i.e. issues {@link #savePack(GL)} and {@link #saveUnpack(GL)}.
+     * <p>
+     * Operation is skipped, if the modes were already saved.
+     * </p>
      * <p>
      * Restore via {@link #restore(GL)}
      * </p>
      */
-    public final void save(GL gl) {
-        if(saved) {
-            return;
+    public final void saveAll(final GL gl) {
+        savePack(gl);
+        saveUnpack(gl);
+    }
+
+    /**
+     * Resets PACK and UNPACK pixel storage modes to their default value,
+     * i.e. issues {@link #resetPack(GL)} and {@link #resetUnpack(GL)}.
+     */
+    public final void resetAll(final GL gl) {
+        resetPack(gl);
+        resetUnpack(gl);
+    }
+
+    /**
+     * Restores PACK and UNPACK pixel storage mode previously saved w/ {@link #saveAll(GL)}
+     * or {@link #savePack(GL)} and {@link #saveUnpack(GL)}.
+     * @throws GLException if neither PACK nor UNPACK modes were saved.
+     */
+    public final void restore(final GL gl) throws GLException {
+        if(!savedPack && !savedUnpack) {
+            throw new GLException("Neither PACK nor UNPACK pixel storage modes were saved");
+        }
+        if( savedPack ) {
+            restorePack(gl);
+            savedPack = false;
         }
+        if( savedUnpack ) {
+            restoreUnpack(gl);
+            savedUnpack = false;
+        }
+    }
 
+    /**
+     * Resets PACK pixel storage modes to their default value.
+     */
+    public final void resetPack(final GL gl) {
+        // Compared w/ ES2, ES3 and GL3-core spec
+        gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, 4);                        // es2, es3, gl3
         if( gl.isGL2ES3() ) {
-            if( gl.isGL2() ) {
-                gl.getGL2().glPushClientAttrib(GL2.GL_CLIENT_PIXEL_STORE_BIT);
-            } else {
-                gl.glGetIntegerv(GL2ES2.GL_PACK_ALIGNMENT,     savedAlignment,   0);
-                gl.glGetIntegerv(GL2ES2.GL_UNPACK_ALIGNMENT,   savedAlignment,   1);
-                gl.glGetIntegerv(GL2ES3.GL_PACK_ROW_LENGTH,    savedGL2GL3Modes, 0);
-                gl.glGetIntegerv(GL2ES3.GL_PACK_SKIP_ROWS,     savedGL2GL3Modes, 1);
-                gl.glGetIntegerv(GL2ES3.GL_PACK_SKIP_PIXELS,   savedGL2GL3Modes, 2);
-                gl.glGetIntegerv(GL2ES2.GL_UNPACK_ROW_LENGTH,  savedGL2GL3Modes, 4);
-                gl.glGetIntegerv(GL2ES2.GL_UNPACK_SKIP_ROWS,   savedGL2GL3Modes, 5);
-                gl.glGetIntegerv(GL2ES2.GL_UNPACK_SKIP_PIXELS, savedGL2GL3Modes, 6);
-                if( gl.isGL2GL3() ) {
-                    gl.glGetIntegerv(GL2GL3.GL_PACK_SWAP_BYTES,    savedGL2GL3Modes, 3);
-                    gl.glGetIntegerv(GL2GL3.GL_UNPACK_SWAP_BYTES,  savedGL2GL3Modes, 7);
-                }
-            }
-            gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, 0);
-            gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_ROWS, 0);
-            gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_PIXELS, 0);
-            gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, 0);
-            gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_ROWS, 0);
-            gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_PIXELS, 0);
+            gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, 0);                   // es3, gl3
+            gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_ROWS, 0);                    // es3, gl3
+            gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_PIXELS, 0);                  // es3, gl3
             if( gl.isGL2GL3() ) {
-                gl.glPixelStorei(GL2GL3.GL_PACK_SWAP_BYTES, 0);
-                gl.glPixelStorei(GL2GL3.GL_UNPACK_SWAP_BYTES, 0);
+                gl.glPixelStorei(GL2GL3.GL_PACK_SWAP_BYTES,     GL.GL_FALSE); // gl3
+                gl.glPixelStorei(GL2GL3.GL_PACK_LSB_FIRST,      GL.GL_FALSE); // gl3
+                gl.glPixelStorei(GL2GL3.GL_PACK_IMAGE_HEIGHT,   0);           // gl3
+                gl.glPixelStorei(GL2GL3.GL_PACK_SKIP_IMAGES,    0);           // gl3
             }
+        }
+    }
+    /**
+     * Saves PACK pixel storage modes and {@link #resetPack(GL) resets} them.
+     * <p>
+     * Operation is skipped, if the modes were already saved.
+     * </p>
+     * <p>
+     * Restore via {@link #restore(GL)}
+     * </p>
+     */
+    public final void savePack(final GL gl) {
+        if(savedPack) {
+            return;
+        }
+        if( gl.isGL2() ) {
+            // See GLStateTracker.pushAttrib(GL2.GL_CLIENT_PIXEL_STORE_BIT)
+            gl.getGL2().glPushClientAttrib(GL2.GL_CLIENT_PIXEL_STORE_BIT);
         } else {
             // ES1 or ES2 deals with pack/unpack alignment only
-            gl.glGetIntegerv(GL2ES2.GL_PACK_ALIGNMENT,   savedAlignment, 0);
-            gl.glGetIntegerv(GL2ES2.GL_UNPACK_ALIGNMENT, savedAlignment, 1);
+            gl.glGetIntegerv(GL.GL_PACK_ALIGNMENT,   cachePack, 0);
+            if( gl.isGL2ES3() ) {
+                gl.glGetIntegerv(GL2ES3.GL_PACK_ROW_LENGTH,     cachePack, 1);
+                gl.glGetIntegerv(GL2ES3.GL_PACK_SKIP_ROWS,      cachePack, 2);
+                gl.glGetIntegerv(GL2ES3.GL_PACK_SKIP_PIXELS,    cachePack, 3);
+                if( gl.isGL2GL3() ) {
+                    gl.glGetIntegerv(GL2GL3.GL_PACK_SWAP_BYTES,    cachePack, 4);
+                    gl.glGetIntegerv(GL2GL3.GL_PACK_LSB_FIRST,     cachePack, 5);
+                    gl.glGetIntegerv(GL2GL3.GL_PACK_IMAGE_HEIGHT,  cachePack, 6);
+                    gl.glGetIntegerv(GL2GL3.GL_PACK_SKIP_IMAGES,   cachePack, 7);
+                }
+            }
+        }
+        savedPack = true;
+        resetPack(gl);
+    }
+    private final void restorePack(final GL gl) {
+        if( gl.isGL2() ) {
+            gl.getGL2().glPopClientAttrib();
+        } else {
+            gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, cachePack[0]);
+            if( gl.isGL2ES3() ) {
+                gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, cachePack[1]);
+                gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_ROWS, cachePack[2]);
+                gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_PIXELS, cachePack[3]);
+                if( gl.isGL2GL3() ) {
+                    gl.glPixelStorei(GL2GL3.GL_PACK_SWAP_BYTES,     cachePack[4]);
+                    gl.glPixelStorei(GL2GL3.GL_PACK_LSB_FIRST,      cachePack[5]);
+                    gl.glPixelStorei(GL2GL3.GL_PACK_IMAGE_HEIGHT,   cachePack[6]);
+                    gl.glPixelStorei(GL2GL3.GL_PACK_SKIP_IMAGES,    cachePack[7]);
+                }
+            }
         }
-        saved = true;
     }
 
     /**
-     * Restores the pixel storage mode.
-     * @throws GLException if not saved via one of the set methods.
+     * Resets UNPACK pixel storage modes to their default value.
      */
-    public final void restore(GL gl) throws GLException {
-        if(!saved) {
-            throw new GLException("pixel storage modes not saved");
-        }
-
+    public final void resetUnpack(final GL gl) {
+        // Compared w/ ES2, ES3 and GL3-core spec
+        gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 4);                      // es2, es3, gl3
         if( gl.isGL2ES3() ) {
-            if( gl.isGL2() ) {
-                gl.getGL2().glPopClientAttrib();
-            } else {
-                gl.glPixelStorei(GL2ES2.GL_PACK_ALIGNMENT,     savedAlignment[0]);
-                gl.glPixelStorei(GL2ES2.GL_UNPACK_ALIGNMENT,   savedAlignment[1]);
-                gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH,    savedGL2GL3Modes[0]);
-                gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_ROWS,     savedGL2GL3Modes[1]);
-                gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_PIXELS,   savedGL2GL3Modes[2]);
-                gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH,  savedGL2GL3Modes[4]);
-                gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_ROWS,   savedGL2GL3Modes[5]);
-                gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_PIXELS, savedGL2GL3Modes[6]);
+            gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, 0);                 // es3, gl3
+            gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_ROWS, 0);                  // es3, gl3
+            gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_PIXELS, 0);                // es3, gl3
+            gl.glPixelStorei(GL2ES3.GL_UNPACK_IMAGE_HEIGHT, 0);               // es3, gl3
+            gl.glPixelStorei(GL2ES3.GL_UNPACK_SKIP_IMAGES,  0);               // es3, gl3
+            if( gl.isGL2GL3() ) {
+                gl.glPixelStorei(GL2GL3.GL_UNPACK_SWAP_BYTES,   GL.GL_FALSE); // gl3
+                gl.glPixelStorei(GL2GL3.GL_UNPACK_LSB_FIRST,    GL.GL_FALSE); // gl3
+            }
+        }
+    }
+    /**
+     * Saves UNPACK pixel storage modes and {@link #resetUnpack(GL) resets} them.
+     * <p>
+     * Operation is skipped, if the modes were already saved.
+     * </p>
+     * <p>
+     * Restore via {@link #restore(GL)}
+     * </p>
+     */
+    public final void saveUnpack(final GL gl) {
+        if(savedUnpack) {
+            return;
+        }
+        if( gl.isGL2() ) {
+            // See GLStateTracker.pushAttrib(GL2.GL_CLIENT_PIXEL_STORE_BIT)
+            gl.getGL2().glPushClientAttrib(GL2.GL_CLIENT_PIXEL_STORE_BIT);
+        } else {
+            // ES1 or ES2 deals with pack/unpack alignment only
+            gl.glGetIntegerv(GL.GL_UNPACK_ALIGNMENT, cacheUnpack, 0);
+            if( gl.isGL2ES3() ) {
+                gl.glGetIntegerv(GL2ES2.GL_UNPACK_ROW_LENGTH,   cacheUnpack, 1);
+                gl.glGetIntegerv(GL2ES2.GL_UNPACK_SKIP_ROWS,    cacheUnpack, 2);
+                gl.glGetIntegerv(GL2ES2.GL_UNPACK_SKIP_PIXELS,  cacheUnpack, 3);
+                gl.glGetIntegerv(GL2ES3.GL_UNPACK_IMAGE_HEIGHT, cacheUnpack, 4);
+                gl.glGetIntegerv(GL2ES3.GL_UNPACK_SKIP_IMAGES,  cacheUnpack, 5);
                 if( gl.isGL2GL3() ) {
-                    gl.glPixelStorei(GL2GL3.GL_PACK_SWAP_BYTES,    savedGL2GL3Modes[3]);
-                    gl.glPixelStorei(GL2GL3.GL_UNPACK_SWAP_BYTES,  savedGL2GL3Modes[7]);
+                    gl.glGetIntegerv(GL2GL3.GL_UNPACK_SWAP_BYTES,  cacheUnpack, 6);
+                    gl.glGetIntegerv(GL2GL3.GL_UNPACK_LSB_FIRST,   cacheUnpack, 7);
                 }
             }
+        }
+        savedUnpack = true;
+        resetUnpack(gl);
+    }
+    private final void restoreUnpack(final GL gl) {
+        if( gl.isGL2() ) {
+            gl.getGL2().glPopClientAttrib();
         } else {
-            // ES1 or ES2 deals with pack/unpack alignment only
-            gl.glPixelStorei(GL2ES2.GL_PACK_ALIGNMENT,   savedAlignment[0]);
-            gl.glPixelStorei(GL2ES2.GL_UNPACK_ALIGNMENT, savedAlignment[1]);
+            gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, cacheUnpack[0]);
+            if( gl.isGL2ES3() ) {
+                gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, cacheUnpack[1]);
+                gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_ROWS, cacheUnpack[2]);
+                gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_PIXELS, cacheUnpack[3]);
+                gl.glPixelStorei(GL2ES3.GL_UNPACK_IMAGE_HEIGHT, cacheUnpack[4]);
+                gl.glPixelStorei(GL2ES3.GL_UNPACK_SKIP_IMAGES,  cacheUnpack[5]);
+                if( gl.isGL2GL3() ) {
+                    gl.glPixelStorei(GL2GL3.GL_UNPACK_SWAP_BYTES,   cacheUnpack[6]);
+                    gl.glPixelStorei(GL2GL3.GL_UNPACK_LSB_FIRST,    cacheUnpack[7]);
+                }
+            }
         }
-        saved = false;
     }
 }
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java b/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java
index 25a012b..abdb7c5 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/GLReadBufferUtil.java
@@ -33,7 +33,6 @@ import java.io.IOException;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES3;
-import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLDrawable;
 import javax.media.opengl.GLException;
@@ -63,11 +62,11 @@ public class GLReadBufferUtil {
      * @param alpha true for RGBA readPixels, otherwise RGB readPixels. Disclaimer: Alpha maybe forced on ES platforms!
      * @param write2Texture true if readPixel's TextureData shall be written to a 2d Texture
      */
-    public GLReadBufferUtil(boolean alpha, boolean write2Texture) {
+    public GLReadBufferUtil(final boolean alpha, final boolean write2Texture) {
         this(GLPixelBuffer.defaultProviderNoRowStride, alpha, write2Texture);
     }
 
-    public GLReadBufferUtil(GLPixelBufferProvider pixelBufferProvider, boolean alpha, boolean write2Texture) {
+    public GLReadBufferUtil(final GLPixelBufferProvider pixelBufferProvider, final boolean alpha, final boolean write2Texture) {
         this.pixelBufferProvider = pixelBufferProvider;
         this.componentCount = alpha ? 4 : 3 ;
         this.alignment = alpha ? 4 : 1 ;
@@ -111,11 +110,11 @@ public class GLReadBufferUtil {
     /**
      * Write the TextureData filled by {@link #readPixels(GLAutoDrawable, boolean)} to file
      */
-    public void write(File dest) {
+    public void write(final File dest) {
         try {
             TextureIO.write(readTextureData, dest);
             rewindPixelBuffer();
-        } catch (IOException ex) {
+        } catch (final IOException ex) {
             throw new RuntimeException("can not write to file: " + dest.getAbsolutePath(), ex);
         }
     }
@@ -132,7 +131,7 @@ public class GLReadBufferUtil {
      *
      * @see #GLReadBufferUtil(boolean, boolean)
      */
-    public boolean readPixels(GL gl, boolean mustFlipVertically) {
+    public boolean readPixels(final GL gl, final boolean mustFlipVertically) {
         return readPixels(gl, 0, 0, 0, 0, mustFlipVertically);
     }
 
@@ -151,16 +150,16 @@ public class GLReadBufferUtil {
      *                           and handled in a efficient manner there (TextureCoordinates and TextureIO writer).
      * @see #GLReadBufferUtil(boolean, boolean)
      */
-    public boolean readPixels(GL gl, int inX, int inY, int inWidth, int inHeight, boolean mustFlipVertically) {
+    public boolean readPixels(final GL gl, final int inX, final int inY, final int inWidth, final int inHeight, final boolean mustFlipVertically) {
         final GLDrawable drawable = gl.getContext().getGLReadDrawable();
         final int width, height;
-        if( 0 >= inWidth || drawable.getWidth() < inWidth ) {
-            width = drawable.getWidth();
+        if( 0 >= inWidth || drawable.getSurfaceWidth() < inWidth ) {
+            width = drawable.getSurfaceWidth();
         } else {
             width = inWidth;
         }
-        if( 0 >= inHeight || drawable.getHeight() < inHeight ) {
-            height = drawable.getHeight();
+        if( 0 >= inHeight || drawable.getSurfaceHeight() < inHeight ) {
+            height = drawable.getSurfaceHeight();
         } else {
             height= inHeight;
         }
@@ -208,7 +207,7 @@ public class GLReadBufferUtil {
                            readPixelBuffer.buffer,
                            null /* Flusher */);
                 newData = true;
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 readTextureData = null;
                 readPixelBuffer = null;
                 throw new RuntimeException("can not fetch offscreen texture", e);
@@ -221,7 +220,7 @@ public class GLReadBufferUtil {
         }
         boolean res = null!=readPixelBuffer && readPixelBuffer.isValid();
         if(res) {
-            psm.setAlignment(gl, alignment, alignment);
+            psm.setPackAlignment(gl, alignment);
             if(gl.isGL2ES3()) {
                 final GL2ES3 gl2es3 = gl.getGL2ES3();
                 gl2es3.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, width);
@@ -230,7 +229,7 @@ public class GLReadBufferUtil {
             readPixelBuffer.clear();
             try {
                 gl.glReadPixels(inX, inY, width, height, pixelAttribs.format, pixelAttribs.type, readPixelBuffer.buffer);
-            } catch(GLException gle) { res = false; gle.printStackTrace(); }
+            } catch(final GLException gle) { res = false; gle.printStackTrace(); }
             readPixelBuffer.position( readPixelSize );
             readPixelBuffer.flip();
             final int glerr1 = gl.glGetError();
@@ -257,7 +256,7 @@ public class GLReadBufferUtil {
         return res;
     }
 
-    public void dispose(GL gl) {
+    public void dispose(final GL gl) {
         if(null != readTexture) {
             readTexture.destroy(gl);
             readTextureData = null;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/Gamma.java b/src/jogl/classes/com/jogamp/opengl/util/Gamma.java
index 9667819..bab85e5 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/Gamma.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/Gamma.java
@@ -39,69 +39,79 @@
 
 package com.jogamp.opengl.util;
 
-import javax.media.opengl.*;
-import jogamp.opengl.*;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLDrawable;
+import javax.media.opengl.GLDrawableFactory;
 
-/** Provides control over the primary display's gamma, brightness and
-    contrast controls via the hardware gamma ramp tables. Not
-    supported on all platforms or graphics hardware. <P>
-
-    Thanks to the LWJGL project for illustrating how to access gamma
-    control on the various platforms.
-*/
+import com.jogamp.common.util.locks.RecursiveLock;
 
+/**
+ * Provides convenient wrapper for {@link GLDrawableFactory} control over
+ * individual display's gamma, brightness and contrast values
+ * via the hardware gamma ramp tables.
+ * <p>
+ * Not supported on all platforms or graphics hardware.
+ * </p>
+ * <p>
+ * Thanks to the LWJGL project for illustrating how to access gamma
+ * control on the various platforms.
+ * </p>
+ */
 public class Gamma {
   private Gamma() {}
 
   /**
-   * Sets the gamma, brightness, and contrast of the current main
-   * display. This functionality is not available on all platforms and
-   * graphics hardware. Returns true if the settings were successfully
-   * changed, false if not. This method may return false for some
-   * values of the incoming arguments even on hardware which does
-   * support the underlying functionality. <P>
-   *
-   * If this method returns true, the display settings will
-   * automatically be reset to their original values upon JVM exit
-   * (assuming the JVM does not crash); if the user wishes to change
-   * the display settings back to normal ahead of time, use {@link
-   * #resetDisplayGamma resetDisplayGamma}(). It is recommended to
-   * call {@link #resetDisplayGamma resetDisplayGamma} before calling
-   * e.g. <code>System.exit()</code> from the application rather than
-   * rely on the shutdown hook functionality due to inevitable race
-   * conditions and unspecified behavior during JVM teardown. <P>
-   *
-   * This method may be called multiple times during the application's
-   * execution, but calling {@link #resetDisplayGamma
-   * resetDisplayGamma} will only reset the settings to the values
-   * before the first call to this method. <P>
-   *
-   * @param gamma The gamma value, typically > 1.0 (default values
-   *   vary, but typically roughly 1.0)
-   * @param brightness The brightness value between -1.0 and 1.0,
-   *   inclusive (default values vary, but typically 0)
-   * @param contrast The contrast, greater than 0.0 (default values
-   *   vary, but typically 1)
-   * @return true if gamma settings were successfully changed, false
-   *   if not
-   * @throws IllegalArgumentException if any of the parameters were
-   *   out-of-bounds
+   * Convenient wrapper for {@link GLDrawableFactory#setDisplayGamma(javax.media.nativewindow.NativeSurface, float, float, float)}.
+   * <p>
+   * Use {@link #setDisplayGamma(GLAutoDrawable, float, float, float)} in case of using an {#link GLAutoDrawable}.
+   * </p>
+   */
+  public static boolean setDisplayGamma(final GLDrawable drawable, final float gamma, final float brightness, final float contrast) throws IllegalArgumentException {
+    return GLDrawableFactory.getFactory(drawable.getGLProfile()).setDisplayGamma(drawable.getNativeSurface(), gamma, brightness, contrast);
+  }
+
+  /**
+   * Convenient wrapper for {@link GLDrawableFactory#setDisplayGamma(javax.media.nativewindow.NativeSurface, float, float, float)}
+   * locking {@link GLAutoDrawable#getUpstreamLock()} to ensure proper atomic operation.
+   */
+  public static boolean setDisplayGamma(final GLAutoDrawable drawable, final float gamma, final float brightness, final float contrast) throws IllegalArgumentException {
+    final RecursiveLock lock = drawable.getUpstreamLock();
+    lock.lock();
+    try {
+        return GLDrawableFactory.getFactory(drawable.getGLProfile()).setDisplayGamma(drawable.getNativeSurface(), gamma, brightness, contrast);
+    } finally {
+        lock.unlock();
+    }
+  }
+
+  /**
+   * Convenient wrapper for {@link GLDrawableFactory#resetDisplayGamma(javax.media.nativewindow.NativeSurface)}.
+   * <p>
+   * Use {@link #resetDisplayGamma(GLAutoDrawable)} in case of using an {#link GLAutoDrawable}.
+   * </p>
+   */
+  public static void resetDisplayGamma(final GLDrawable drawable) {
+    GLDrawableFactory.getFactory(drawable.getGLProfile()).resetDisplayGamma(drawable.getNativeSurface());
+  }
+
+  /**
+   * Convenient wrapper for {@link GLDrawableFactory#resetDisplayGamma(javax.media.nativewindow.NativeSurface)}
+   * locking {@link GLAutoDrawable#getUpstreamLock()} to ensure proper atomic operation.
    */
-  public static boolean setDisplayGamma(GL gl, float gamma, float brightness, float contrast) throws IllegalArgumentException {
-    return GLDrawableFactoryImpl.getFactoryImpl(gl.getContext().getGLDrawable().getGLProfile()).setDisplayGamma(gamma, brightness, contrast);
+  public static void resetDisplayGamma(final GLAutoDrawable drawable) {
+    final RecursiveLock lock = drawable.getUpstreamLock();
+    lock.lock();
+    try {
+        GLDrawableFactory.getFactory(drawable.getGLProfile()).resetDisplayGamma(drawable.getNativeSurface());
+    } finally {
+        lock.unlock();
+    }
   }
 
   /**
-   * Resets the gamma, brightness and contrast values for the primary
-   * display to their original values before {@link #setDisplayGamma
-   * setDisplayGamma} was called the first time. {@link
-   * #setDisplayGamma setDisplayGamma} must be called before calling
-   * this method or an unspecified exception will be thrown. While it
-   * is not explicitly required that this method be called before
-   * exiting, calling it is recommended because of the inevitable
-   * unspecified behavior during JVM teardown.
+   * Convenient wrapper for {@link GLDrawableFactory#resetAllDisplayGamma()}.
    */
-  public static void resetDisplayGamma(GL gl) {
-    GLDrawableFactoryImpl.getFactoryImpl(gl.getContext().getGLDrawable().getGLProfile()).resetDisplayGamma();
+  public static void resetAllDisplayGamma(final GLDrawable drawable) {
+    GLDrawableFactory.getFactory(drawable.getGLProfile()).resetAllDisplayGamma();
   }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
index 986f6d8..150e92c 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
@@ -18,6 +18,7 @@ import jogamp.opengl.Debug;
 
 import com.jogamp.common.nio.Buffers;
 import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.opengl.util.glsl.ShaderState;
 
 /**
@@ -54,9 +55,9 @@ public class ImmModeSink {
 
   static {
       Debug.initSingleton();
-      DEBUG_BEGIN_END = Debug.isPropertyDefined("jogl.debug.ImmModeSink.BeginEnd", true);
-      DEBUG_DRAW = Debug.isPropertyDefined("jogl.debug.ImmModeSink.Draw", true);
-      DEBUG_BUFFER = Debug.isPropertyDefined("jogl.debug.ImmModeSink.Buffer", true);
+      DEBUG_BEGIN_END = PropertyAccess.isPropertyDefined("jogl.debug.ImmModeSink.BeginEnd", true);
+      DEBUG_DRAW = PropertyAccess.isPropertyDefined("jogl.debug.ImmModeSink.Draw", true);
+      DEBUG_BUFFER = PropertyAccess.isPropertyDefined("jogl.debug.ImmModeSink.Buffer", true);
   }
 
   public static final int GL_QUADS      = 0x0007; // Needs data manipulation on ES1/ES2
@@ -81,12 +82,12 @@ public class ImmModeSink {
    * @param glBufferUsage VBO <code>usage</code> parameter for {@link GL#glBufferData(int, long, Buffer, int)}, e.g. {@link GL#GL_STATIC_DRAW},
    *                      set to <code>0</code> for no VBO usage
    */
-  public static ImmModeSink createFixed(int initialElementCount,
-                                        int vComps, int vDataType,
-                                        int cComps, int cDataType,
-                                        int nComps, int nDataType,
-                                        int tComps, int tDataType,
-                                        int glBufferUsage) {
+  public static ImmModeSink createFixed(final int initialElementCount,
+                                        final int vComps, final int vDataType,
+                                        final int cComps, final int cDataType,
+                                        final int nComps, final int nDataType,
+                                        final int tComps, final int tDataType,
+                                        final int glBufferUsage) {
     return new ImmModeSink(initialElementCount,
                            vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
                            false, glBufferUsage, null, 0);
@@ -114,12 +115,12 @@ public class ImmModeSink {
    * @see com.jogamp.opengl.util.glsl.ShaderState#useProgram(GL2ES2, boolean)
    * @see com.jogamp.opengl.util.glsl.ShaderState#getCurrentShaderState()
    */
-  public static ImmModeSink createGLSL(int initialElementCount,
-                                       int vComps, int vDataType,
-                                       int cComps, int cDataType,
-                                       int nComps, int nDataType,
-                                       int tComps, int tDataType,
-                                       int glBufferUsage, ShaderState st) {
+  public static ImmModeSink createGLSL(final int initialElementCount,
+                                       final int vComps, final int vDataType,
+                                       final int cComps, final int cDataType,
+                                       final int nComps, final int nDataType,
+                                       final int tComps, final int tDataType,
+                                       final int glBufferUsage, final ShaderState st) {
     return new ImmModeSink(initialElementCount,
                            vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
                            true, glBufferUsage, st, 0);
@@ -147,18 +148,18 @@ public class ImmModeSink {
    * @see com.jogamp.opengl.util.glsl.ShaderState#useProgram(GL2ES2, boolean)
    * @see com.jogamp.opengl.util.glsl.ShaderState#getCurrentShaderState()
    */
-  public static ImmModeSink createGLSL(int initialElementCount,
-                                       int vComps, int vDataType,
-                                       int cComps, int cDataType,
-                                       int nComps, int nDataType,
-                                       int tComps, int tDataType,
-                                       int glBufferUsage, int shaderProgram) {
+  public static ImmModeSink createGLSL(final int initialElementCount,
+                                       final int vComps, final int vDataType,
+                                       final int cComps, final int cDataType,
+                                       final int nComps, final int nDataType,
+                                       final int tComps, final int tDataType,
+                                       final int glBufferUsage, final int shaderProgram) {
     return new ImmModeSink(initialElementCount,
                            vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
                            true, glBufferUsage, null, shaderProgram);
   }
 
-  public void destroy(GL gl) {
+  public void destroy(final GL gl) {
     destroyList(gl);
 
     vboSet.destroy(gl);
@@ -168,16 +169,16 @@ public class ImmModeSink {
     reset(null);
   }
 
-  public void reset(GL gl) {
+  public void reset(final GL gl) {
     destroyList(gl);
     vboSet.reset(gl);
   }
 
   @Override
   public String toString() {
-    StringBuilder sb = new StringBuilder("ImmModeSink[");
+    final StringBuilder sb = new StringBuilder("ImmModeSink[");
     sb.append(",\n\tVBO list: "+vboSetList.size()+" [");
-    for(Iterator<VBOSet> i=vboSetList.iterator(); i.hasNext() ; ) {
+    for(final Iterator<VBOSet> i=vboSetList.iterator(); i.hasNext() ; ) {
         sb.append("\n\t");
         sb.append( i.next() );
     }
@@ -191,7 +192,7 @@ public class ImmModeSink {
     return sb.toString();
   }
 
-  public void draw(GL gl, boolean disableBufferAfterDraw) {
+  public void draw(final GL gl, final boolean disableBufferAfterDraw) {
     if(DEBUG_DRAW) {
         System.err.println("ImmModeSink.draw(disableBufferAfterDraw: "+disableBufferAfterDraw+"):\n\t"+this);
     }
@@ -201,7 +202,7 @@ public class ImmModeSink {
     }
   }
 
-  public void draw(GL gl, Buffer indices, boolean disableBufferAfterDraw) {
+  public void draw(final GL gl, final Buffer indices, final boolean disableBufferAfterDraw) {
     if(DEBUG_DRAW) {
         System.err.println("ImmModeSink.draw(disableBufferAfterDraw: "+disableBufferAfterDraw+"):\n\t"+this);
     }
@@ -228,19 +229,19 @@ public class ImmModeSink {
     vboSet.checkSeal(false);
   }
 
-  public final void glEnd(GL gl) {
+  public final void glEnd(final GL gl) {
       glEnd(gl, null, true);
   }
 
-  public void glEnd(GL gl, boolean immediateDraw) {
+  public void glEnd(final GL gl, final boolean immediateDraw) {
       glEnd(gl, null, immediateDraw);
   }
 
-  public final void glEnd(GL gl, Buffer indices) {
+  public final void glEnd(final GL gl, final Buffer indices) {
       glEnd(gl, indices, true);
   }
 
-  private void glEnd(GL gl, Buffer indices, boolean immediateDraw) {
+  private void glEnd(final GL gl, final Buffer indices, final boolean immediateDraw) {
     if(DEBUG_BEGIN_END) {
         System.err.println("ImmModeSink START glEnd(immediate: "+immediateDraw+")");
     }
@@ -259,117 +260,117 @@ public class ImmModeSink {
     }
   }
 
-  public void glVertexv(Buffer v) {
+  public void glVertexv(final Buffer v) {
     vboSet.glVertexv(v);
   }
-  public void glNormalv(Buffer v) {
+  public void glNormalv(final Buffer v) {
     vboSet.glNormalv(v);
   }
-  public void glColorv(Buffer v) {
+  public void glColorv(final Buffer v) {
     vboSet.glColorv(v);
   }
-  public void glTexCoordv(Buffer v) {
+  public void glTexCoordv(final Buffer v) {
     vboSet.glTexCoordv(v);
   }
 
-  public final void glVertex2f(float x, float y) {
+  public final void glVertex2f(final float x, final float y) {
     vboSet.glVertex2f(x,y);
   }
 
-  public final void glVertex3f(float x, float y, float z) {
+  public final void glVertex3f(final float x, final float y, final float z) {
     vboSet.glVertex3f(x,y,z);
   }
 
-  public final void glNormal3f(float x, float y, float z) {
+  public final void glNormal3f(final float x, final float y, final float z) {
     vboSet.glNormal3f(x,y,z);
   }
 
-  public final void glColor3f(float x, float y, float z) {
+  public final void glColor3f(final float x, final float y, final float z) {
     vboSet.glColor3f(x,y,z);
   }
 
-  public final void glColor4f(float x, float y, float z, float a) {
+  public final void glColor4f(final float x, final float y, final float z, final float a) {
     vboSet.glColor4f(x,y,z, a);
   }
 
-  public final void glTexCoord2f(float x, float y) {
+  public final void glTexCoord2f(final float x, final float y) {
     vboSet.glTexCoord2f(x,y);
   }
 
-  public final void glTexCoord3f(float x, float y, float z) {
+  public final void glTexCoord3f(final float x, final float y, final float z) {
     vboSet.glTexCoord3f(x,y,z);
   }
 
-  public final void glVertex2s(short x, short y) {
+  public final void glVertex2s(final short x, final short y) {
     vboSet.glVertex2s(x,y);
   }
 
-  public final void glVertex3s(short x, short y, short z) {
+  public final void glVertex3s(final short x, final short y, final short z) {
     vboSet.glVertex3s(x,y,z);
   }
 
-  public final void glNormal3s(short x, short y, short z) {
+  public final void glNormal3s(final short x, final short y, final short z) {
     vboSet.glNormal3s(x,y,z);
   }
 
-  public final void glColor3s(short x, short y, short z) {
+  public final void glColor3s(final short x, final short y, final short z) {
     vboSet.glColor3s(x,y,z);
   }
 
-  public final void glColor4s(short x, short y, short z, short a) {
+  public final void glColor4s(final short x, final short y, final short z, final short a) {
     vboSet.glColor4s(x,y,z,a);
   }
 
-  public final void glTexCoord2s(short x, short y) {
+  public final void glTexCoord2s(final short x, final short y) {
     vboSet.glTexCoord2s(x,y);
   }
 
-  public final void glTexCoord3s(short x, short y, short z) {
+  public final void glTexCoord3s(final short x, final short y, final short z) {
     vboSet.glTexCoord3s(x,y,z);
   }
 
-  public final void glVertex2b(byte x, byte y) {
+  public final void glVertex2b(final byte x, final byte y) {
     vboSet.glVertex2b(x,y);
   }
 
-  public final void glVertex3b(byte x, byte y, byte z) {
+  public final void glVertex3b(final byte x, final byte y, final byte z) {
     vboSet.glVertex3b(x,y,z);
   }
 
-  public final void glNormal3b(byte x, byte y, byte z) {
+  public final void glNormal3b(final byte x, final byte y, final byte z) {
     vboSet.glNormal3b(x,y,z);
   }
 
-  public final void glColor3b(byte x, byte y, byte z) {
+  public final void glColor3b(final byte x, final byte y, final byte z) {
     vboSet.glColor3b(x,y,z);
   }
 
-  public final void glColor3ub(byte x, byte y, byte z) {
+  public final void glColor3ub(final byte x, final byte y, final byte z) {
     vboSet.glColor3ub(x,y,z);
   }
 
-  public final void glColor4b(byte x, byte y, byte z, byte a) {
+  public final void glColor4b(final byte x, final byte y, final byte z, final byte a) {
     vboSet.glColor4b(x,y,z,a);
   }
 
-  public final void glColor4ub(byte x, byte y, byte z, byte a) {
+  public final void glColor4ub(final byte x, final byte y, final byte z, final byte a) {
     vboSet.glColor4ub(x,y,z,a);
   }
 
-  public final void glTexCoord2b(byte x, byte y) {
+  public final void glTexCoord2b(final byte x, final byte y) {
     vboSet.glTexCoord2b(x,y);
   }
 
-  public final void glTexCoord3b(byte x, byte y, byte z) {
+  public final void glTexCoord3b(final byte x, final byte y, final byte z) {
     vboSet.glTexCoord3b(x,y,z);
   }
 
-  protected ImmModeSink(int initialElementCount,
-                        int vComps, int vDataType,
-                        int cComps, int cDataType,
-                        int nComps, int nDataType,
-                        int tComps, int tDataType,
-                        boolean useGLSL, int glBufferUsage, ShaderState st, int shaderProgram) {
+  protected ImmModeSink(final int initialElementCount,
+                        final int vComps, final int vDataType,
+                        final int cComps, final int cDataType,
+                        final int nComps, final int nDataType,
+                        final int tComps, final int tDataType,
+                        final boolean useGLSL, final int glBufferUsage, final ShaderState st, final int shaderProgram) {
     vboSet = new VBOSet(initialElementCount,
                         vComps, vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
                         useGLSL, glBufferUsage, st, shaderProgram);
@@ -390,9 +391,9 @@ public class ImmModeSink {
    * @see #createFixed(int, int, int, int, int, int, int, int, int, int)
    * @see #createGLSL(int, int, int, int, int, int, int, int, int, int, ShaderState)
    */
-  public void setResizeElementCount(int v) { vboSet.setResizeElementCount(v); }
+  public void setResizeElementCount(final int v) { vboSet.setResizeElementCount(v); }
 
-  private void destroyList(GL gl) {
+  private void destroyList(final GL gl) {
     for(int i=0; i<vboSetList.size(); i++) {
         vboSetList.get(i).destroy(gl);
     }
@@ -403,12 +404,12 @@ public class ImmModeSink {
   private final ArrayList<VBOSet> vboSetList;
 
   protected static class VBOSet {
-    protected VBOSet (int initialElementCount,
-                      int vComps, int vDataType,
-                      int cComps, int cDataType,
-                      int nComps, int nDataType,
-                      int tComps, int tDataType,
-                      boolean useGLSL, int glBufferUsage, ShaderState st, int shaderProgram) {
+    protected VBOSet (final int initialElementCount,
+                      final int vComps, final int vDataType,
+                      final int cComps, final int cDataType,
+                      final int nComps, final int nDataType,
+                      final int tComps, final int tDataType,
+                      final boolean useGLSL, final int glBufferUsage, final ShaderState st, final int shaderProgram) {
         // final ..
         this.glBufferUsage=glBufferUsage;
         this.initialElementCount=initialElementCount;
@@ -465,17 +466,17 @@ public class ImmModeSink {
     }
 
     protected int getResizeElementCount() { return resizeElementCount; }
-    protected void setResizeElementCount(int v) { resizeElementCount=v; }
+    protected void setResizeElementCount(final int v) { resizeElementCount=v; }
 
     protected boolean getUseVBO() { return useVBO; }
 
-    protected final VBOSet regenerate(GL gl) {
+    protected final VBOSet regenerate(final GL gl) {
         return new VBOSet(initialElementCount, vComps,
                           vDataType, cComps, cDataType, nComps, nDataType, tComps, tDataType,
                           useGLSL, glBufferUsage, shaderState, shaderProgram);
     }
 
-    protected void checkSeal(boolean test) throws GLException {
+    protected void checkSeal(final boolean test) throws GLException {
         if(0==mode) {
                 throw new GLException("No mode set yet, call glBegin(mode) first:\n\t"+this);
         }
@@ -490,7 +491,7 @@ public class ImmModeSink {
 
     private boolean usingShaderProgram = false;
 
-    protected void useShaderProgram(GL2ES2 gl, boolean force) {
+    protected void useShaderProgram(final GL2ES2 gl, final boolean force) {
         if( force || !usingShaderProgram ) {
             if(null != shaderState) {
                 shaderState.useProgram(gl, true);
@@ -501,7 +502,7 @@ public class ImmModeSink {
         }
     }
 
-    protected void draw(GL gl, Buffer indices, boolean disableBufferAfterDraw, int i)
+    protected void draw(final GL gl, final Buffer indices, final boolean disableBufferAfterDraw, final int i)
     {
         enableBuffer(gl, true);
 
@@ -544,17 +545,17 @@ public class ImmModeSink {
                     if( GL.GL_UNSIGNED_BYTE == type ) {
                         final ByteBuffer b = (ByteBuffer) indices;
                         for (int j = 0; j < idxLen; j++) {
-                            gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x000000ff & b.get(idx0+j)), 4);
+                            gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0x000000ff & b.get(idx0+j), 4);
                         }
                     } else if( GL.GL_UNSIGNED_SHORT == type ){
                         final ShortBuffer b = (ShortBuffer) indices;
                         for (int j = 0; j < idxLen; j++) {
-                            gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x0000ffff & b.get(idx0+j)), 4);
+                            gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0x0000ffff & b.get(idx0+j), 4);
                         }
                     } else {
                         final IntBuffer b = (IntBuffer) indices;
                         for (int j = 0; j < idxLen; j++) {
-                            gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0xffffffff & b.get(idx0+j)), 4);
+                            gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0xffffffff & b.get(idx0+j), 4);
                         }
                     }
                 } else {
@@ -573,24 +574,24 @@ public class ImmModeSink {
         }
     }
 
-    public void glVertexv(Buffer v) {
+    public void glVertexv(final Buffer v) {
         checkSeal(false);
         Buffers.put(vertexArray, v);
     }
-    public void glNormalv(Buffer v) {
+    public void glNormalv(final Buffer v) {
         checkSeal(false);
         Buffers.put(normalArray, v);
     }
-    public void glColorv(Buffer v) {
+    public void glColorv(final Buffer v) {
         checkSeal(false);
         Buffers.put(colorArray, v);
     }
-    public void glTexCoordv(Buffer v) {
+    public void glTexCoordv(final Buffer v) {
         checkSeal(false);
         Buffers.put(textCoordArray, v);
     }
 
-    public void glVertex2b(byte x, byte y) {
+    public void glVertex2b(final byte x, final byte y) {
         checkSeal(false);
         growBuffer(VERTEX);
         if(vComps>0)
@@ -599,7 +600,7 @@ public class ImmModeSink {
             Buffers.putNb(vertexArray, vDataTypeSigned, y, true);
         countAndPadding(VERTEX, vComps-2);
     }
-    public void glVertex3b(byte x, byte y, byte z) {
+    public void glVertex3b(final byte x, final byte y, final byte z) {
         checkSeal(false);
         growBuffer(VERTEX);
         if(vComps>0)
@@ -610,7 +611,7 @@ public class ImmModeSink {
             Buffers.putNb(vertexArray, vDataTypeSigned, z, true);
         countAndPadding(VERTEX, vComps-3);
     }
-    public void glVertex2s(short x, short y) {
+    public void glVertex2s(final short x, final short y) {
         checkSeal(false);
         growBuffer(VERTEX);
         if(vComps>0)
@@ -619,7 +620,7 @@ public class ImmModeSink {
             Buffers.putNs(vertexArray, vDataTypeSigned, y, true);
         countAndPadding(VERTEX, vComps-2);
     }
-    public void glVertex3s(short x, short y, short z) {
+    public void glVertex3s(final short x, final short y, final short z) {
         checkSeal(false);
         growBuffer(VERTEX);
         if(vComps>0)
@@ -630,7 +631,7 @@ public class ImmModeSink {
             Buffers.putNs(vertexArray, vDataTypeSigned, z, true);
         countAndPadding(VERTEX, vComps-3);
     }
-    public void glVertex2f(float x, float y) {
+    public void glVertex2f(final float x, final float y) {
         checkSeal(false);
         growBuffer(VERTEX);
         if(vComps>0)
@@ -639,7 +640,7 @@ public class ImmModeSink {
             Buffers.putNf(vertexArray, vDataTypeSigned, y);
         countAndPadding(VERTEX, vComps-2);
     }
-    public void glVertex3f(float x, float y, float z) {
+    public void glVertex3f(final float x, final float y, final float z) {
         checkSeal(false);
         growBuffer(VERTEX);
         if(vComps>0)
@@ -651,7 +652,7 @@ public class ImmModeSink {
         countAndPadding(VERTEX, vComps-3);
     }
 
-    public void glNormal3b(byte x, byte y, byte z) {
+    public void glNormal3b(final byte x, final byte y, final byte z) {
         checkSeal(false);
         growBuffer(NORMAL);
         if(nComps>0)
@@ -662,7 +663,7 @@ public class ImmModeSink {
             Buffers.putNb(normalArray, nDataTypeSigned, z, true);
         countAndPadding(NORMAL, nComps-3);
     }
-    public void glNormal3s(short x, short y, short z) {
+    public void glNormal3s(final short x, final short y, final short z) {
         checkSeal(false);
         growBuffer(NORMAL);
         if(nComps>0)
@@ -673,7 +674,7 @@ public class ImmModeSink {
             Buffers.putNs(normalArray, nDataTypeSigned, z, true);
         countAndPadding(NORMAL, nComps-3);
     }
-    public void glNormal3f(float x, float y, float z) {
+    public void glNormal3f(final float x, final float y, final float z) {
         checkSeal(false);
         growBuffer(NORMAL);
         if(nComps>0)
@@ -685,7 +686,7 @@ public class ImmModeSink {
         countAndPadding(NORMAL, nComps-3);
     }
 
-    public void glColor3b(byte r, byte g, byte b) {
+    public void glColor3b(final byte r, final byte g, final byte b) {
         checkSeal(false);
         growBuffer(COLOR);
         if(cComps>0)
@@ -696,7 +697,7 @@ public class ImmModeSink {
             Buffers.putNb(colorArray, cDataTypeSigned, b, true);
         countAndPadding(COLOR, cComps-3);
     }
-    public void glColor3ub(byte r, byte g, byte b) {
+    public void glColor3ub(final byte r, final byte g, final byte b) {
         checkSeal(false);
         growBuffer(COLOR);
         if(cComps>0)
@@ -707,7 +708,7 @@ public class ImmModeSink {
             Buffers.putNb(colorArray, cDataTypeSigned, b, false);
         countAndPadding(COLOR, cComps-3);
     }
-    public void glColor4b(byte r, byte g, byte b, byte a) {
+    public void glColor4b(final byte r, final byte g, final byte b, final byte a) {
         checkSeal(false);
         growBuffer(COLOR);
         if(cComps>0)
@@ -720,7 +721,7 @@ public class ImmModeSink {
             Buffers.putNb(colorArray, cDataTypeSigned, a, true);
         countAndPadding(COLOR, cComps-4);
     }
-    public void glColor4ub(byte r, byte g, byte b, byte a) {
+    public void glColor4ub(final byte r, final byte g, final byte b, final byte a) {
         checkSeal(false);
         growBuffer(COLOR);
         if(cComps>0)
@@ -733,7 +734,7 @@ public class ImmModeSink {
             Buffers.putNb(colorArray, cDataTypeSigned, a, false);
         countAndPadding(COLOR, cComps-4);
     }
-    public void glColor3s(short r, short g, short b) {
+    public void glColor3s(final short r, final short g, final short b) {
         checkSeal(false);
         growBuffer(COLOR);
         if(cComps>0)
@@ -744,7 +745,7 @@ public class ImmModeSink {
             Buffers.putNs(colorArray, cDataTypeSigned, b, true);
         countAndPadding(COLOR, cComps-3);
     }
-    public void glColor4s(short r, short g, short b, short a) {
+    public void glColor4s(final short r, final short g, final short b, final short a) {
         checkSeal(false);
         growBuffer(COLOR);
         if(cComps>0)
@@ -757,7 +758,7 @@ public class ImmModeSink {
             Buffers.putNs(colorArray, cDataTypeSigned, a, true);
         countAndPadding(COLOR, cComps-4);
     }
-    public void glColor3f(float r, float g, float b) {
+    public void glColor3f(final float r, final float g, final float b) {
         checkSeal(false);
         growBuffer(COLOR);
         if(cComps>0)
@@ -768,7 +769,7 @@ public class ImmModeSink {
             Buffers.putNf(colorArray, cDataTypeSigned, b);
         countAndPadding(COLOR, cComps-3);
     }
-    public void glColor4f(float r, float g, float b, float a) {
+    public void glColor4f(final float r, final float g, final float b, final float a) {
         checkSeal(false);
         growBuffer(COLOR);
         if(cComps>0)
@@ -782,7 +783,7 @@ public class ImmModeSink {
         countAndPadding(COLOR, cComps-4);
     }
 
-    public void glTexCoord2b(byte x, byte y) {
+    public void glTexCoord2b(final byte x, final byte y) {
         checkSeal(false);
         growBuffer(TEXTCOORD);
         if(tComps>0)
@@ -791,7 +792,7 @@ public class ImmModeSink {
             Buffers.putNb(textCoordArray, tDataTypeSigned, y, true);
         countAndPadding(TEXTCOORD, tComps-2);
     }
-    public void glTexCoord3b(byte x, byte y, byte z) {
+    public void glTexCoord3b(final byte x, final byte y, final byte z) {
         checkSeal(false);
         growBuffer(TEXTCOORD);
         if(tComps>0)
@@ -802,7 +803,7 @@ public class ImmModeSink {
             Buffers.putNb(textCoordArray, tDataTypeSigned, z, true);
         countAndPadding(TEXTCOORD, tComps-3);
     }
-    public void glTexCoord2s(short x, short y) {
+    public void glTexCoord2s(final short x, final short y) {
         checkSeal(false);
         growBuffer(TEXTCOORD);
         if(tComps>0)
@@ -811,7 +812,7 @@ public class ImmModeSink {
             Buffers.putNs(textCoordArray, tDataTypeSigned, y, true);
         countAndPadding(TEXTCOORD, tComps-2);
     }
-    public void glTexCoord3s(short x, short y, short z) {
+    public void glTexCoord3s(final short x, final short y, final short z) {
         checkSeal(false);
         growBuffer(TEXTCOORD);
         if(tComps>0)
@@ -822,7 +823,7 @@ public class ImmModeSink {
             Buffers.putNs(textCoordArray, tDataTypeSigned, z, true);
         countAndPadding(TEXTCOORD, tComps-3);
     }
-    public void glTexCoord2f(float x, float y) {
+    public void glTexCoord2f(final float x, final float y) {
         checkSeal(false);
         growBuffer(TEXTCOORD);
         if(tComps>0)
@@ -831,7 +832,7 @@ public class ImmModeSink {
             Buffers.putNf(textCoordArray, tDataTypeSigned, y);
         countAndPadding(TEXTCOORD, tComps-2);
     }
-    public void glTexCoord3f(float x, float y, float z) {
+    public void glTexCoord3f(final float x, final float y, final float z) {
         checkSeal(false);
         growBuffer(TEXTCOORD);
         if(tComps>0)
@@ -858,7 +859,7 @@ public class ImmModeSink {
         }
     }
 
-    public void setShaderProgram(int program) {
+    public void setShaderProgram(final int program) {
         if(null == shaderState && 0 == program) {
             throw new IllegalArgumentException("Not allowed to zero shader program if no ShaderState is set");
         }
@@ -871,7 +872,7 @@ public class ImmModeSink {
      * @return true if all locations for all used arrays are found (min 1 array), otherwise false.
      *         Also sets 'glslLocationSet' to the return value!
      */
-    private boolean resetGLSLArrayLocation(GL2ES2 gl) {
+    private boolean resetGLSLArrayLocation(final GL2ES2 gl) {
         int iA = 0;
         int iL = 0;
 
@@ -903,7 +904,7 @@ public class ImmModeSink {
         return glslLocationSet;
     }
 
-    public void destroy(GL gl) {
+    public void destroy(final GL gl) {
         reset(gl);
 
         vCount=0; cCount=0; nCount=0; tCount=0;
@@ -912,7 +913,7 @@ public class ImmModeSink {
         buffer=null;
     }
 
-    public void reset(GL gl) {
+    public void reset(final GL gl) {
         enableBuffer(gl, false);
         reset();
     }
@@ -935,16 +936,16 @@ public class ImmModeSink {
         this.tElems=0;
     }
 
-    public void seal(GL glObj, boolean seal)
+    public void seal(final GL glObj, final boolean seal)
     {
         seal(seal);
         if(sealedGL==seal) return;
         sealedGL = seal;
-        GL gl = glObj.getGL();
+        final GL gl = glObj.getGL();
         if(seal) {
             if(useVBO) {
                 if(0 == vboName) {
-                    int[] tmp = new int[1];
+                    final int[] tmp = new int[1];
                     gl.glGenBuffers(1, tmp, 0);
                     vboName = tmp[0];
                 }
@@ -967,7 +968,7 @@ public class ImmModeSink {
         }
     }
 
-    public void seal(boolean seal)
+    public void seal(final boolean seal)
     {
         if(sealed==seal) return;
         sealed = seal;
@@ -977,7 +978,7 @@ public class ImmModeSink {
         }
     }
 
-  public void enableBuffer(GL gl, boolean enable) {
+  public void enableBuffer(final GL gl, final boolean enable) {
     if( bufferEnabled != enable && vElems>0 ) {
         if(enable) {
             checkSeal(true);
@@ -996,7 +997,7 @@ public class ImmModeSink {
     }
   }
 
-  private final void writeBuffer(GL gl) {
+  private final void writeBuffer(final GL gl) {
     final int vBytes  = vElems * vCompsBytes;
     final int cBytes  = cElems * cCompsBytes;
     final int nBytes  = nElems * nCompsBytes;
@@ -1021,8 +1022,8 @@ public class ImmModeSink {
     }
   }
 
-  private void enableBufferFixed(GL gl, boolean enable) {
-    GL2ES1 glf = gl.getGL2ES1();
+  private void enableBufferFixed(final GL gl, final boolean enable) {
+    final GL2ES1 glf = gl.getGL2ES1();
 
     final boolean useV = vComps>0 && vElems>0 ;
     final boolean useC = cComps>0 && cElems>0 ;
@@ -1089,8 +1090,8 @@ public class ImmModeSink {
     }
   }
 
-  private void enableBufferGLSLShaderState(GL gl, boolean enable) {
-    GL2ES2 glsl = gl.getGL2ES2();
+  private void enableBufferGLSLShaderState(final GL gl, final boolean enable) {
+    final GL2ES2 glsl = gl.getGL2ES2();
 
     final boolean useV = vComps>0 && vElems>0 ;
     final boolean useC = cComps>0 && cElems>0 ;
@@ -1157,8 +1158,8 @@ public class ImmModeSink {
     }
   }
 
-  private void enableBufferGLSLSimple(GL gl, boolean enable) {
-    GL2ES2 glsl = gl.getGL2ES2();
+  private void enableBufferGLSLSimple(final GL gl, final boolean enable) {
+    final GL2ES2 glsl = gl.getGL2ES2();
 
     final boolean useV = vComps>0 && vElems>0 ;
     final boolean useC = cComps>0 && cElems>0 ;
@@ -1267,7 +1268,7 @@ public class ImmModeSink {
         return "[v "+vElems+"/"+vCount+", c "+cElems+"/"+cCount+", n "+nElems+"/"+nCount+", t "+tElems+"/"+tCount+"]";
     }
 
-    protected boolean fitElementInBuffer(int type) {
+    protected boolean fitElementInBuffer(final int type) {
         final int addElems = 1;
         switch (type) {
             case VERTEX:
@@ -1283,7 +1284,7 @@ public class ImmModeSink {
         }
     }
 
-    protected boolean reallocateBuffer(int addElems) {
+    protected boolean reallocateBuffer(final int addElems) {
         final int vAdd = addElems - ( vCount - vElems );
         final int cAdd = addElems - ( cCount - cElems );
         final int nAdd = addElems - ( nCount - nElems );
@@ -1381,7 +1382,7 @@ public class ImmModeSink {
     }
 
     /** grow buffer by initialElementCount if there is no space for one more element in the designated buffer */
-    protected final boolean growBuffer(int type) {
+    protected final boolean growBuffer(final int type) {
         if( null !=buffer && !sealed ) {
             if( !fitElementInBuffer(type) ) {
                 // save olde values ..
@@ -1422,7 +1423,7 @@ public class ImmModeSink {
      * @param type
      * @param fill
      */
-    private void countAndPadding(int type, int fill) {
+    private void countAndPadding(final int type, int fill) {
         if ( sealed ) return;
 
         final Buffer dest;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
index 218897f..11acb0c 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/PMVMatrix.java
@@ -34,7 +34,6 @@
 
 package com.jogamp.opengl.util;
 
-import java.nio.Buffer;
 import java.nio.FloatBuffer;
 import java.nio.IntBuffer;
 
@@ -42,12 +41,14 @@ import javax.media.opengl.GL;
 import javax.media.opengl.GLException;
 import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
-import jogamp.opengl.ProjectFloat;
+import jogamp.common.os.PlatformPropsImpl;
 
 import com.jogamp.common.nio.Buffers;
-import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.FloatStack;
 import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.math.Quaternion;
+import com.jogamp.opengl.math.Ray;
+import com.jogamp.opengl.math.geom.AABBox;
 import com.jogamp.opengl.math.geom.Frustum;
 
 /**
@@ -65,6 +66,7 @@ import com.jogamp.opengl.math.geom.Frustum;
  * <p>
  * All matrices are provided in column-major order,
  * as specified in the OpenGL fixed function pipeline, i.e. compatibility profile.
+ * See {@link FloatUtil}.
  * </p>
  * <p>
  * PMVMatrix can supplement {@link GL2ES2} applications w/ the
@@ -72,30 +74,28 @@ import com.jogamp.opengl.math.geom.Frustum;
  * </p>
  * <a name="storageDetails"><h5>Matrix storage details</h5></a>
  * <p>
- * All matrices use a common FloatBuffer storage
- * and are a {@link Buffers#slice2Float(Buffer, float[], int, int) sliced} representation of it.
- * The common FloatBuffer and hence all matrices may use NIO direct storage or a {@link #usesBackingArray() backing float array},
- * depending how the instance if {@link #PMVMatrix(boolean) being constructed}.
+ * All matrices are backed up by a common primitive float-array for performance considerations
+ * and are a {@link Buffers#slice2Float(float[], int, int) sliced} representation of it.
  * </p>
  * <p>
  * <b>Note:</b>
  * <ul>
- *   <li>The matrix is a {@link Buffers#slice2Float(Buffer, float[], int, int) sliced part } of a host matrix and it's start position has been {@link FloatBuffer#mark() marked}.</li>
+ *   <li>The matrix is a {@link Buffers#slice2Float(float[], int, int) sliced part } of a host matrix and it's start position has been {@link FloatBuffer#mark() marked}.</li>
  *   <li>Use {@link FloatBuffer#reset() reset()} to rewind it to it's start position after relative operations, like {@link FloatBuffer#get() get()}.</li>
  *   <li>If using absolute operations like {@link FloatBuffer#get(int) get(int)}, use it's {@link FloatBuffer#reset() reset} {@link FloatBuffer#position() position} as it's offset.</li>
  * </ul>
  * </p>
  */
-public class PMVMatrix implements GLMatrixFunc {
+public final class PMVMatrix implements GLMatrixFunc {
 
     /** Bit value stating a modified {@link #glGetPMatrixf() projection matrix (P)}, since last {@link #update()} call. */
-    public static final int MODIFIED_PROJECTION                    = 1 << 0;
+    public static final int MODIFIED_PROJECTION                 = 1 << 0;
     /** Bit value stating a modified {@link #glGetMvMatrixf() modelview matrix (Mv)}, since last {@link #update()} call. */
-    public static final int MODIFIED_MODELVIEW                     = 1 << 1;
+    public static final int MODIFIED_MODELVIEW                  = 1 << 1;
     /** Bit value stating a modified {@link #glGetTMatrixf() texture matrix (T)}, since last {@link #update()} call. */
-    public static final int MODIFIED_TEXTURE                       = 1 << 2;
+    public static final int MODIFIED_TEXTURE                    = 1 << 2;
     /** Bit value stating all is modified */
-    public static final int MODIFIED_ALL                           = MODIFIED_PROJECTION | MODIFIED_MODELVIEW | MODIFIED_TEXTURE ;
+    public static final int MODIFIED_ALL                        = MODIFIED_PROJECTION | MODIFIED_MODELVIEW | MODIFIED_TEXTURE ;
 
     /** Bit value stating a dirty {@link #glGetMviMatrixf() inverse modelview matrix (Mvi)}. */
     public static final int DIRTY_INVERSE_MODELVIEW             = 1 << 0;
@@ -175,7 +175,8 @@ public class PMVMatrix implements GLMatrixFunc {
      * @param a 4x4 matrix in column major order (OpenGL)
      * @return matrix string representation
      */
-    public static StringBuilder matrixToString(StringBuilder sb, String f, FloatBuffer a) {
+    @SuppressWarnings("deprecation")
+    public static StringBuilder matrixToString(final StringBuilder sb, final String f, final FloatBuffer a) {
         return FloatUtil.matrixToString(sb, null, f, a, 0, 4, 4, false);
     }
 
@@ -186,135 +187,72 @@ public class PMVMatrix implements GLMatrixFunc {
      * @param b 4x4 matrix in column major order (OpenGL)
      * @return side by side representation
      */
-    public static StringBuilder matrixToString(StringBuilder sb, String f, FloatBuffer a, FloatBuffer b) {
+    @SuppressWarnings("deprecation")
+    public static StringBuilder matrixToString(final StringBuilder sb, final String f, final FloatBuffer a, final FloatBuffer b) {
         return FloatUtil.matrixToString(sb, null, f, a, 0, b, 0, 4, 4, false);
     }
 
     /**
-     * Creates an instance of PMVMatrix {@link #PMVMatrix(boolean) PMVMatrix(boolean useBackingArray)},
-     * with <code>useBackingArray = true</code>.
-     */
-    public PMVMatrix() {
-        this(true);
-    }
-
-    /**
      * Creates an instance of PMVMatrix.
-     *
-     * @param useBackingArray <code>true</code> for non direct NIO Buffers with guaranteed backing array,
-     *                        which allows faster access in Java computation.
-     *                        <p><code>false</code> for direct NIO buffers w/o a guaranteed backing array.
-     *                        In most Java implementations, direct NIO buffers have no backing array
-     *                        and hence the Java computation will be throttled down by direct IO get/put
-     *                        operations.</p>
-     *                        <p>Depending on the application, ie. whether the Java computation or
-     *                        JNI invocation and hence native data transfer part is heavier,
-     *                        this flag shall be set to <code>true</code> or <code>false</code></p>.
+     * <p>
+     * Implementation uses non-direct non-NIO Buffers with guaranteed backing array,
+     * which allows faster access in Java computation.
+     * </p>
      */
-    public PMVMatrix(boolean useBackingArray) {
-          this.usesBackingArray = useBackingArray;
-
+    public PMVMatrix() {
           // I    Identity
           // T    Texture
           // P    Projection
           // Mv   ModelView
           // Mvi  Modelview-Inverse
           // Mvit Modelview-Inverse-Transpose
-          if(useBackingArray) {
-              matrixBufferArray = new float[ 6*16 + ProjectFloat.getRequiredFloatBufferSize() ];
-              matrixBuffer = null;
-          } else {
-              matrixBufferArray = null;
-              matrixBuffer = Buffers.newDirectByteBuffer( ( 6*16 + ProjectFloat.getRequiredFloatBufferSize() ) * Buffers.SIZEOF_FLOAT );
-              matrixBuffer.mark();
-          }
-
-          matrixIdent   = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  0*16, 1*16);  //  I
-          matrixTex     = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  1*16, 1*16);  //      T
-          matrixPMvMvit = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  2*16, 4*16);  //          P  + Mv + Mvi + Mvit
-          matrixPMvMvi  = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  2*16, 3*16);  //          P  + Mv + Mvi
-          matrixPMv     = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  2*16, 2*16);  //          P  + Mv
-          matrixP       = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  2*16, 1*16);  //          P
-          matrixMv      = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  3*16, 1*16);  //               Mv
-          matrixMvi     = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  4*16, 1*16);  //                    Mvi
-          matrixMvit    = Buffers.slice2Float(matrixBuffer, matrixBufferArray,  5*16, 1*16);  //                          Mvit
-
-          projectFloat  = new ProjectFloat(matrixBuffer, matrixBufferArray, 6*16);
-
-          if(null != matrixBuffer) {
-              matrixBuffer.reset();
-          }
-          FloatUtil.makeIdentityf(matrixIdent);
-
-          vec3f         = new float[3];
-          matrixMult    = new float[16];
-          matrixTrans   = new float[16];
-          matrixRot     = new float[16];
-          matrixScale   = new float[16];
-          matrixOrtho   = new float[16];
-          matrixFrustum = new float[16];
-          FloatUtil.makeIdentityf(matrixTrans, 0);
-          FloatUtil.makeIdentityf(matrixRot, 0);
-          FloatUtil.makeIdentityf(matrixScale, 0);
-          FloatUtil.makeIdentityf(matrixOrtho, 0);
-          FloatUtil.makeZero(matrixFrustum, 0);
+          matrixArray = new float[5*16];
+
+          mP_offset   = 0*16;
+          mMv_offset  = 1*16;
+          mTex_offset = 4*16;
+
+          matrixPMvMvit = Buffers.slice2Float(matrixArray,  0*16, 4*16);  // P + Mv + Mvi + Mvit
+          matrixPMvMvi  = Buffers.slice2Float(matrixArray,  0*16, 3*16);  // P + Mv + Mvi
+          matrixPMv     = Buffers.slice2Float(matrixArray,  0*16, 2*16);  // P + Mv
+          matrixP       = Buffers.slice2Float(matrixArray,  0*16, 1*16);  // P
+          matrixMv      = Buffers.slice2Float(matrixArray,  1*16, 1*16);  //     Mv
+          matrixMvi     = Buffers.slice2Float(matrixArray,  2*16, 1*16);  //          Mvi
+          matrixMvit    = Buffers.slice2Float(matrixArray,  3*16, 1*16);  //                Mvit
+          matrixTex     = Buffers.slice2Float(matrixArray,  4*16, 1*16);  //                       T
+
+          mat4Tmp1      = new float[16];
+          mat4Tmp2      = new float[16];
+          mat4Tmp3      = new float[16];
+          matrixTxSx    = new float[16];
+          FloatUtil.makeIdentity(matrixTxSx);
 
           // Start w/ zero size to save memory
           matrixTStack = new FloatStack( 0,  2*16); // growSize: GL-min size (2)
           matrixPStack = new FloatStack( 0,  2*16); // growSize: GL-min size (2)
           matrixMvStack= new FloatStack( 0, 16*16); // growSize: half GL-min size (32)
 
-          // default values and mode
-          glMatrixMode(GL_PROJECTION);
-          glLoadIdentity();
-          glMatrixMode(GL_MODELVIEW);
-          glLoadIdentity();
-          glMatrixMode(GL.GL_TEXTURE);
-          glLoadIdentity();
-          modifiedBits = MODIFIED_ALL;
-          dirtyBits = DIRTY_ALL;
-          requestMask = 0;
-          matrixMode = GL_MODELVIEW;
-
-          mulPMV = null;
+          reset();
+
           frustum = null;
     }
 
-    /** @see #PMVMatrix(boolean) */
-    public final boolean usesBackingArray() { return usesBackingArray; }
-
-    public final void destroy() {
-        if(null!=projectFloat) {
-            projectFloat.destroy(); projectFloat=null;
-        }
-
-        matrixBuffer=null;
-        matrixBuffer=null; matrixPMvMvit=null; matrixPMvMvi=null; matrixPMv=null;
-        matrixP=null; matrixTex=null; matrixMv=null; matrixMvi=null; matrixMvit=null;
-
-        vec3f         = null;
-        matrixMult    = null;
-        matrixTrans   = null;
-        matrixRot     = null;
-        matrixScale   = null;
-        matrixOrtho   = null;
-        matrixFrustum = null;
-
-        if(null!=matrixPStack) {
-            matrixPStack=null;
-        }
-        if(null!=matrixMvStack) {
-            matrixMvStack=null;
-        }
-        if(null!=matrixPStack) {
-            matrixPStack=null;
-        }
-        if(null!=matrixTStack) {
-            matrixTStack=null;
-        }
+    /**
+     * Issues {@link #glLoadIdentity()} on all matrices,
+     * i.e. {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}
+     * and resets all internal states.
+     */
+    public final void reset() {
+        FloatUtil.makeIdentity(matrixArray, mMv_offset);
+        FloatUtil.makeIdentity(matrixArray, mP_offset);
+        FloatUtil.makeIdentity(matrixArray, mTex_offset);
+
+        modifiedBits = MODIFIED_ALL;
+        dirtyBits = DIRTY_ALL;
+        requestMask = 0;
+        matrixMode = GL_MODELVIEW;
     }
 
-
     /** Returns the current matrix-mode, one of {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}. */
     public final int  glGetMatrixMode() {
         return matrixMode;
@@ -429,7 +367,7 @@ public class PMVMatrix implements GLMatrixFunc {
     }
 
     /** Returns the frustum, derived from projection * modelview */
-    public Frustum glGetFrustum() {
+    public final Frustum glGetFrustum() {
         requestMask |= DIRTY_FRUSTUM;
         updateImpl(false);
         return frustum;
@@ -447,7 +385,7 @@ public class PMVMatrix implements GLMatrixFunc {
      *                   {@link GLMatrixFunc#GL_MODELVIEW_MATRIX GL_MODELVIEW_MATRIX}, {@link GLMatrixFunc#GL_PROJECTION_MATRIX GL_PROJECTION_MATRIX} or {@link GLMatrixFunc#GL_TEXTURE_MATRIX GL_TEXTURE_MATRIX},
      *                   or a matrix-mode-name, i.e.
      *                   {@link GLMatrixFunc#GL_MODELVIEW GL_MODELVIEW}, {@link GLMatrixFunc#GL_PROJECTION GL_PROJECTION} or {@link GL#GL_TEXTURE GL_TEXTURE}
-     * @return the named matrix
+     * @return the named matrix, not a copy!
      */
     public final FloatBuffer glGetMatrixf(final int matrixName) {
         switch(matrixName) {
@@ -465,6 +403,35 @@ public class PMVMatrix implements GLMatrixFunc {
         }
     }
 
+
+    /**
+     * Multiplies the {@link #glGetPMatrixf() P} and {@link #glGetMvMatrixf() Mv} matrix, i.e.
+     * <pre>
+     *    mat4PMv = P x Mv
+     * </pre>
+     * @param mat4PMv 4x4 matrix storage for result
+     * @param mat4PMv_offset
+     * @return given matrix for chaining
+     */
+    public final float[] multPMvMatrixf(final float[/*16*/] mat4PMv, final int mat4PMv_offset) {
+        FloatUtil.multMatrix(matrixArray, mP_offset, matrixArray, mMv_offset, mat4PMv, mat4PMv_offset);
+        return mat4PMv;
+    }
+
+    /**
+     * Multiplies the {@link #glGetMvMatrixf() Mv} and {@link #glGetPMatrixf() P} matrix, i.e.
+     * <pre>
+     *    mat4MvP = Mv x P
+     * </pre>
+     * @param mat4MvP 4x4 matrix storage for result
+     * @param mat4MvP_offset
+     * @return given matrix for chaining
+     */
+    public final float[] multMvPMatrixf(final float[/*16*/] mat4MvP, final int mat4MvP_offset) {
+        FloatUtil.multMatrix(matrixArray, mMv_offset, matrixArray, mP_offset, mat4MvP, mat4MvP_offset);
+        return mat4MvP;
+    }
+
     //
     // GLMatrixFunc implementation
     //
@@ -483,10 +450,10 @@ public class PMVMatrix implements GLMatrixFunc {
     }
 
     @Override
-    public final void glGetFloatv(int matrixGetName, FloatBuffer params) {
-        int pos = params.position();
+    public final void glGetFloatv(final int matrixGetName, final FloatBuffer params) {
+        final int pos = params.position();
         if(matrixGetName==GL_MATRIX_MODE) {
-            params.put((float)matrixMode);
+            params.put(matrixMode);
         } else {
             final FloatBuffer matrix = glGetMatrixf(matrixGetName);
             params.put(matrix); // matrix -> params
@@ -496,9 +463,9 @@ public class PMVMatrix implements GLMatrixFunc {
     }
 
     @Override
-    public final void glGetFloatv(int matrixGetName, float[] params, int params_offset) {
+    public final void glGetFloatv(final int matrixGetName, final float[] params, final int params_offset) {
         if(matrixGetName==GL_MATRIX_MODE) {
-            params[params_offset]=(float)matrixMode;
+            params[params_offset]=matrixMode;
         } else {
             final FloatBuffer matrix = glGetMatrixf(matrixGetName);
             matrix.get(params, params_offset, 16); // matrix -> params
@@ -507,8 +474,8 @@ public class PMVMatrix implements GLMatrixFunc {
     }
 
     @Override
-    public final void glGetIntegerv(int pname, IntBuffer params) {
-        int pos = params.position();
+    public final void glGetIntegerv(final int pname, final IntBuffer params) {
+        final int pos = params.position();
         if(pname==GL_MATRIX_MODE) {
             params.put(matrixMode);
         } else {
@@ -518,7 +485,7 @@ public class PMVMatrix implements GLMatrixFunc {
     }
 
     @Override
-    public final void glGetIntegerv(int pname, int[] params, int params_offset) {
+    public final void glGetIntegerv(final int pname, final int[] params, final int params_offset) {
         if(pname==GL_MATRIX_MODE) {
             params[params_offset]=matrixMode;
         } else {
@@ -546,8 +513,8 @@ public class PMVMatrix implements GLMatrixFunc {
     }
 
     @Override
-    public final void glLoadMatrixf(java.nio.FloatBuffer m) {
-        int spos = m.position();
+    public final void glLoadMatrixf(final java.nio.FloatBuffer m) {
+        final int spos = m.position();
         if(matrixMode==GL_MODELVIEW) {
             matrixMv.put(m);
             matrixMv.reset();
@@ -566,6 +533,27 @@ public class PMVMatrix implements GLMatrixFunc {
         m.position(spos);
     }
 
+    /**
+     * Load the current matrix with the values of the given {@link Quaternion}'s rotation {@link Quaternion#toMatrix(float[], int) matrix representation}.
+     */
+    public final void glLoadMatrix(final Quaternion quat) {
+        if(matrixMode==GL_MODELVIEW) {
+            quat.toMatrix(matrixArray, mMv_offset);
+            matrixMv.reset();
+            dirtyBits |= DIRTY_INVERSE_MODELVIEW | DIRTY_INVERSE_TRANSPOSED_MODELVIEW | DIRTY_FRUSTUM ;
+            modifiedBits |= MODIFIED_MODELVIEW;
+        } else if(matrixMode==GL_PROJECTION) {
+            quat.toMatrix(matrixArray, mP_offset);
+            matrixP.reset();
+            dirtyBits |= DIRTY_FRUSTUM ;
+            modifiedBits |= MODIFIED_PROJECTION;
+        } else if(matrixMode==GL.GL_TEXTURE) {
+            quat.toMatrix(matrixArray, mTex_offset);
+            matrixTex.reset();
+            modifiedBits |= MODIFIED_TEXTURE;
+        }
+    }
+
     @Override
     public final void glPopMatrix() {
         final FloatStack stack;
@@ -599,176 +587,82 @@ public class PMVMatrix implements GLMatrixFunc {
     @Override
     public final void glLoadIdentity() {
         if(matrixMode==GL_MODELVIEW) {
-            matrixMv.put(matrixIdent);
-            matrixMv.reset();
+            FloatUtil.makeIdentity(matrixArray, mMv_offset);
             dirtyBits |= DIRTY_INVERSE_MODELVIEW | DIRTY_INVERSE_TRANSPOSED_MODELVIEW | DIRTY_FRUSTUM ;
             modifiedBits |= MODIFIED_MODELVIEW;
         } else if(matrixMode==GL_PROJECTION) {
-            matrixP.put(matrixIdent);
-            matrixP.reset();
+            FloatUtil.makeIdentity(matrixArray, mP_offset);
             dirtyBits |= DIRTY_FRUSTUM ;
             modifiedBits |= MODIFIED_PROJECTION;
         } else if(matrixMode==GL.GL_TEXTURE) {
-            matrixTex.put(matrixIdent);
-            matrixTex.reset();
+            FloatUtil.makeIdentity(matrixArray, mTex_offset);
             modifiedBits |= MODIFIED_TEXTURE;
         }
-        matrixIdent.reset();
     }
 
+    @SuppressWarnings("deprecation")
     @Override
     public final void glMultMatrixf(final FloatBuffer m) {
         if(matrixMode==GL_MODELVIEW) {
-            FloatUtil.multMatrixf(matrixMv, m);
+            FloatUtil.multMatrix(matrixMv, m);
             dirtyBits |= DIRTY_INVERSE_MODELVIEW | DIRTY_INVERSE_TRANSPOSED_MODELVIEW | DIRTY_FRUSTUM ;
             modifiedBits |= MODIFIED_MODELVIEW;
         } else if(matrixMode==GL_PROJECTION) {
-            FloatUtil.multMatrixf(matrixP, m);
+            FloatUtil.multMatrix(matrixP, m);
             dirtyBits |= DIRTY_FRUSTUM ;
             modifiedBits |= MODIFIED_PROJECTION;
         } else if(matrixMode==GL.GL_TEXTURE) {
-            FloatUtil.multMatrixf(matrixTex, m);
+            FloatUtil.multMatrix(matrixTex, m);
             modifiedBits |= MODIFIED_TEXTURE;
         }
     }
 
     @Override
-    public final void glMultMatrixf(float[] m, int m_offset) {
+    public final void glMultMatrixf(final float[] m, final int m_offset) {
         if(matrixMode==GL_MODELVIEW) {
-            FloatUtil.multMatrixf(matrixMv, m, m_offset);
+            FloatUtil.multMatrix(matrixArray, mMv_offset, m, m_offset);
             dirtyBits |= DIRTY_INVERSE_MODELVIEW | DIRTY_INVERSE_TRANSPOSED_MODELVIEW | DIRTY_FRUSTUM ;
             modifiedBits |= MODIFIED_MODELVIEW;
         } else if(matrixMode==GL_PROJECTION) {
-            FloatUtil.multMatrixf(matrixP, m, m_offset);
+            FloatUtil.multMatrix(matrixArray, mP_offset, m, m_offset);
             dirtyBits |= DIRTY_FRUSTUM ;
             modifiedBits |= MODIFIED_PROJECTION;
         } else if(matrixMode==GL.GL_TEXTURE) {
-            FloatUtil.multMatrixf(matrixTex, m, m_offset);
+            FloatUtil.multMatrix(matrixArray, mTex_offset, m, m_offset);
             modifiedBits |= MODIFIED_TEXTURE;
         }
     }
 
     @Override
     public final void glTranslatef(final float x, final float y, final float z) {
-        // Translation matrix:
-        //  1 0 0 x
-        //  0 1 0 y
-        //  0 0 1 z
-        //  0 0 0 1
-        matrixTrans[0+4*3] = x;
-        matrixTrans[1+4*3] = y;
-        matrixTrans[2+4*3] = z;
-        glMultMatrixf(matrixTrans, 0);
+        glMultMatrixf(FloatUtil.makeTranslation(matrixTxSx, false, x, y, z), 0);
     }
 
     @Override
-    public final void glRotatef(final float angdeg, float x, float y, float z) {
-        final float angrad = angdeg   * (float) Math.PI / 180.0f;
-        final float c = (float)Math.cos(angrad);
-        final float ic= 1.0f - c;
-        final float s = (float)Math.sin(angrad);
-
-        vec3f[0]=x; vec3f[1]=y; vec3f[2]=z;
-        FloatUtil.normalize(vec3f);
-        x = vec3f[0]; y = vec3f[1]; z = vec3f[2];
-
-        // Rotation matrix:
-        //      xx(1-c)+c  xy(1-c)+zs xz(1-c)-ys 0
-        //      xy(1-c)-zs yy(1-c)+c  yz(1-c)+xs 0
-        //      xz(1-c)+ys yz(1-c)-xs zz(1-c)+c  0
-        //      0          0          0          1
-        final float xy = x*y;
-        final float xz = x*z;
-        final float xs = x*s;
-        final float ys = y*s;
-        final float yz = y*z;
-        final float zs = z*s;
-        matrixRot[0*4+0] = x*x*ic+c;
-        matrixRot[0*4+1] = xy*ic+zs;
-        matrixRot[0*4+2] = xz*ic-ys;
-
-        matrixRot[1*4+0] = xy*ic-zs;
-        matrixRot[1*4+1] = y*y*ic+c;
-        matrixRot[1*4+2] = yz*ic+xs;
-
-        matrixRot[2*4+0] = xz*ic+ys;
-        matrixRot[2*4+1] = yz*ic-xs;
-        matrixRot[2*4+2] = z*z*ic+c;
-
-        glMultMatrixf(matrixRot, 0);
+    public final void glScalef(final float x, final float y, final float z) {
+        glMultMatrixf(FloatUtil.makeScale(matrixTxSx, false, x, y, z), 0);
     }
 
     @Override
-    public final void glScalef(final float x, final float y, final float z) {
-        // Scale matrix:
-        //  x 0 0 0
-        //  0 y 0 0
-        //  0 0 z 0
-        //  0 0 0 1
-        matrixScale[0+4*0] = x;
-        matrixScale[1+4*1] = y;
-        matrixScale[2+4*2] = z;
-
-        glMultMatrixf(matrixScale, 0);
+    public final void glRotatef(final float ang_deg, final float x, final float y, final float z) {
+        glMultMatrixf(FloatUtil.makeRotationAxis(mat4Tmp1, 0, ang_deg * FloatUtil.PI / 180.0f, x, y, z, mat4Tmp2), 0);
+    }
+
+    /**
+     * Rotate the current matrix with the given {@link Quaternion}'s rotation {@link Quaternion#toMatrix(float[], int) matrix representation}.
+     */
+    public final void glRotate(final Quaternion quat) {
+        glMultMatrixf(quat.toMatrix(mat4Tmp1, 0), 0);
     }
 
     @Override
     public final void glOrthof(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) {
-        // Ortho matrix:
-        //  2/dx  0     0    tx
-        //  0     2/dy  0    ty
-        //  0     0     2/dz tz
-        //  0     0     0    1
-        final float dx=right-left;
-        final float dy=top-bottom;
-        final float dz=zFar-zNear;
-        final float tx=-1.0f*(right+left)/dx;
-        final float ty=-1.0f*(top+bottom)/dy;
-        final float tz=-1.0f*(zFar+zNear)/dz;
-
-        matrixOrtho[0+4*0] =  2.0f/dx;
-        matrixOrtho[1+4*1] =  2.0f/dy;
-        matrixOrtho[2+4*2] = -2.0f/dz;
-        matrixOrtho[0+4*3] = tx;
-        matrixOrtho[1+4*3] = ty;
-        matrixOrtho[2+4*3] = tz;
-
-        glMultMatrixf(matrixOrtho, 0);
+        glMultMatrixf( FloatUtil.makeOrtho(mat4Tmp1, 0, true, left, right, bottom, top, zNear, zFar), 0 );
     }
 
     @Override
     public final void glFrustumf(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) {
-        if(zNear<=0.0f||zFar<0.0f) {
-            throw new GLException("GL_INVALID_VALUE: zNear and zFar must be positive, and zNear>0");
-        }
-        if(left==right || top==bottom) {
-            throw new GLException("GL_INVALID_VALUE: top,bottom and left,right must not be equal");
-        }
-        // Frustum matrix:
-        //  2*zNear/dx   0          A  0
-        //  0            2*zNear/dy B  0
-        //  0            0          C  D
-        //  0            0         -1  0
-        final float zNear2 = 2.0f*zNear;
-        final float dx=right-left;
-        final float dy=top-bottom;
-        final float dz=zFar-zNear;
-        final float A=(right+left)/dx;
-        final float B=(top+bottom)/dy;
-        final float C=-1.0f*(zFar+zNear)/dz;
-        final float D=-2.0f*(zFar*zNear)/dz;
-
-        matrixFrustum[0+4*0] = zNear2/dx;
-        matrixFrustum[1+4*1] = zNear2/dy;
-        matrixFrustum[2+4*2] = C;
-
-        matrixFrustum[0+4*2] = A;
-        matrixFrustum[1+4*2] = B;
-
-        matrixFrustum[2+4*3] = D;
-        matrixFrustum[3+4*2] = -1.0f;
-
-        glMultMatrixf(matrixFrustum, 0);
+        glMultMatrixf( FloatUtil.makeFrustum(mat4Tmp1, 0, true, left, right, bottom, top, zNear, zFar), 0 );
     }
 
     //
@@ -777,92 +671,179 @@ public class PMVMatrix implements GLMatrixFunc {
 
     /**
      * {@link #glMultMatrixf(FloatBuffer) Multiply} the {@link #glGetMatrixMode() current matrix} with the perspective/frustum matrix.
+     *
+     * @param fovy_deg fov angle in degrees
+     * @param aspect aspect ratio width / height
+     * @param zNear
+     * @param zFar
      */
-    public final void gluPerspective(final float fovy, final float aspect, final float zNear, final float zFar) {
-      float top=(float)Math.tan(fovy*((float)Math.PI)/360.0f)*zNear;
-      float bottom=-1.0f*top;
-      float left=aspect*bottom;
-      float right=aspect*top;
-      glFrustumf(left, right, bottom, top, zNear, zFar);
+    public final void gluPerspective(final float fovy_deg, final float aspect, final float zNear, final float zFar) {
+      glMultMatrixf( FloatUtil.makePerspective(mat4Tmp1, 0, true, fovy_deg * FloatUtil.PI / 180.0f, aspect, zNear, zFar), 0 );
     }
 
     /**
      * {@link #glMultMatrixf(FloatBuffer) Multiply} and {@link #glTranslatef(float, float, float) translate} the {@link #glGetMatrixMode() current matrix}
      * with the eye, object and orientation.
      */
-    public final void gluLookAt(float eyex, float eyey, float eyez,
-                          float centerx, float centery, float centerz,
-                          float upx, float upy, float upz) {
-        projectFloat.gluLookAt(this, eyex, eyey, eyez, centerx, centery, centerz, upx, upy, upz);
+    public final void gluLookAt(final float eyex, final float eyey, final float eyez,
+                                final float centerx, final float centery, final float centerz,
+                                final float upx, final float upy, final float upz) {
+        mat4Tmp2[0+0] = eyex;
+        mat4Tmp2[1+0] = eyey;
+        mat4Tmp2[2+0] = eyez;
+        mat4Tmp2[0+4] = centerx;
+        mat4Tmp2[1+4] = centery;
+        mat4Tmp2[2+4] = centerz;
+        mat4Tmp2[0+8] = upx;
+        mat4Tmp2[1+8] = upy;
+        mat4Tmp2[2+8] = upz;
+        glMultMatrixf(
+                FloatUtil.makeLookAt(mat4Tmp1, 0, mat4Tmp2 /* eye */, 0, mat4Tmp2 /* center */, 4, mat4Tmp2 /* up */, 8, mat4Tmp3), 0);
     }
 
     /**
      * Map object coordinates to window coordinates.
+     * <p>
+     * Traditional <code>gluProject</code> implementation.
+     * </p>
      *
      * @param objx
      * @param objy
      * @param objz
-     * @param viewport
+     * @param viewport 4 component viewport vector
      * @param viewport_offset
-     * @param win_pos
+     * @param win_pos 3 component window coordinate, the result
      * @param win_pos_offset
-     * @return
+     * @return true if successful, otherwise false (z is 1)
      */
-    public final boolean gluProject(float objx, float objy, float objz,
-                            int[] viewport, int viewport_offset,
-                            float[] win_pos, int win_pos_offset ) {
-        if(usesBackingArray) {
-            return projectFloat.gluProject(objx, objy, objz,
-                                           matrixMv.array(), matrixMv.position(),
-                                           matrixP.array(), matrixP.position(),
-                                           viewport, viewport_offset,
-                                           win_pos, win_pos_offset);
-        } else {
-            return projectFloat.gluProject(objx, objy, objz,
-                                           matrixMv,
-                                           matrixP,
+    public final boolean gluProject(final float objx, final float objy, final float objz,
+                                    final int[] viewport, final int viewport_offset,
+                                    final float[] win_pos, final int win_pos_offset ) {
+        return FloatUtil.mapObjToWinCoords(objx, objy, objz,
+                          matrixArray, mMv_offset,
+                          matrixArray, mP_offset,
+                          viewport, viewport_offset,
+                          win_pos, win_pos_offset,
+                          mat4Tmp1, mat4Tmp2);
+    }
+
+    /**
+     * Map window coordinates to object coordinates.
+     * <p>
+     * Traditional <code>gluUnProject</code> implementation.
+     * </p>
+     *
+     * @param winx
+     * @param winy
+     * @param winz
+     * @param viewport 4 component viewport vector
+     * @param viewport_offset
+     * @param obj_pos 3 component object coordinate, the result
+     * @param obj_pos_offset
+     * @return true if successful, otherwise false (failed to invert matrix, or becomes infinity due to zero z)
+     */
+    public final boolean gluUnProject(final float winx, final float winy, final float winz,
+                                      final int[] viewport, final int viewport_offset,
+                                      final float[] obj_pos, final int obj_pos_offset) {
+        return FloatUtil.mapWinToObjCoords(winx, winy, winz,
+                                           matrixArray, mMv_offset,
+                                           matrixArray, mP_offset,
                                            viewport, viewport_offset,
-                                           win_pos, win_pos_offset);
-        }
+                                           obj_pos, obj_pos_offset,
+                                           mat4Tmp1, mat4Tmp2);
     }
 
     /**
      * Map window coordinates to object coordinates.
+     * <p>
+     * Traditional <code>gluUnProject4</code> implementation.
+     * </p>
      *
      * @param winx
      * @param winy
      * @param winz
-     * @param viewport
+     * @param clipw
+     * @param modelMatrix 4x4 modelview matrix
+     * @param modelMatrix_offset
+     * @param projMatrix 4x4 projection matrix
+     * @param projMatrix_offset
+     * @param viewport 4 component viewport vector
      * @param viewport_offset
-     * @param obj_pos
+     * @param near
+     * @param far
+     * @param obj_pos 4 component object coordinate, the result
      * @param obj_pos_offset
-     * @return
+     * @return true if successful, otherwise false (failed to invert matrix, or becomes infinity due to zero z)
      */
-    public final boolean gluUnProject(float winx, float winy, float winz,
-                                      int[] viewport, int viewport_offset,
-                                      float[] obj_pos, int obj_pos_offset) {
-        if(usesBackingArray) {
-            return projectFloat.gluUnProject(winx, winy, winz,
-                                             matrixMv.array(), matrixMv.position(),
-                                             matrixP.array(), matrixP.position(),
-                                             viewport, viewport_offset,
-                                             obj_pos, obj_pos_offset);
-        } else {
-            return projectFloat.gluUnProject(winx, winy, winz,
-                                             matrixMv,
-                                             matrixP,
-                                             viewport, viewport_offset,
-                                             obj_pos, obj_pos_offset);
+    public boolean gluUnProject4(final float winx, final float winy, final float winz, final float clipw,
+                                 final int[] viewport, final int viewport_offset,
+                                 final float near, final float far,
+                                 final float[] obj_pos, final int obj_pos_offset ) {
+        return FloatUtil.mapWinToObjCoords(winx, winy, winz, clipw,
+                matrixArray, mMv_offset,
+                matrixArray, mP_offset,
+                viewport, viewport_offset,
+                near, far,
+                obj_pos, obj_pos_offset,
+                mat4Tmp1, mat4Tmp2);
+    }
+
+    /**
+     * Make given matrix the <i>pick</i> matrix based on given parameters.
+     * <p>
+     * Traditional <code>gluPickMatrix</code> implementation.
+     * </p>
+     * <p>
+     * See {@link FloatUtil#makePick(float[], int, float, float, float, float, int[], int, float[]) FloatUtil.makePick(..)} for details.
+     * </p>
+     * @param x the center x-component of a picking region in window coordinates
+     * @param y the center y-component of a picking region in window coordinates
+     * @param deltaX the width of the picking region in window coordinates.
+     * @param deltaY the height of the picking region in window coordinates.
+     * @param viewport 4 component viewport vector
+     * @param viewport_offset
+     */
+    public final void gluPickMatrix(final float x, final float y,
+                                    final float deltaX, final float deltaY,
+                                    final int[] viewport, final int viewport_offset) {
+        if( null != FloatUtil.makePick(mat4Tmp1, 0, x, y, deltaX, deltaY, viewport, viewport_offset, mat4Tmp2) ) {
+            glMultMatrixf(mat4Tmp1, 0);
         }
     }
 
-    public final void gluPickMatrix(float x, float y,
-                              float deltaX, float deltaY,
-                              int[] viewport, int viewport_offset) {
-        projectFloat.gluPickMatrix(this, x, y, deltaX, deltaY, viewport, viewport_offset);
+    /**
+     * Map two window coordinates w/ shared X/Y and distinctive Z
+     * to a {@link Ray}. The resulting {@link Ray} maybe used for <i>picking</i>
+     * using a {@link AABBox#getRayIntersection(Ray, float[]) bounding box}.
+     * <p>
+     * Notes for picking <i>winz0</i> and <i>winz1</i>:
+     * <ul>
+     *   <li>see {@link FloatUtil#getZBufferEpsilon(int, float, float)}</li>
+     *   <li>see {@link FloatUtil#getZBufferValue(int, float, float, float)}</li>
+     *   <li>see {@link FloatUtil#getOrthoWinZ(float, float, float)}</li>
+     * </ul>
+     * </p>
+     * @param winx
+     * @param winy
+     * @param winz0
+     * @param winz1
+     * @param viewport
+     * @param viewport_offset
+     * @param ray storage for the resulting {@link Ray}
+     * @return true if successful, otherwise false (failed to invert matrix, or becomes z is infinity)
+     */
+    public final boolean gluUnProjectRay(final float winx, final float winy, final float winz0, final float winz1,
+                                         final int[] viewport, final int viewport_offset,
+                                         final Ray ray) {
+        return FloatUtil.mapWinToRay(winx, winy, winz0, winz1,
+                matrixArray, mMv_offset,
+                matrixArray, mP_offset,
+                viewport, viewport_offset,
+                ray,
+                mat4Tmp1, mat4Tmp2, mat4Tmp3);
     }
 
-    public StringBuilder toString(StringBuilder sb, String f) {
+    public StringBuilder toString(StringBuilder sb, final String f) {
         if(null == sb) {
             sb = new StringBuilder();
         }
@@ -876,21 +857,20 @@ public class PMVMatrix implements GLMatrixFunc {
         final boolean modMv = 0 != ( MODIFIED_MODELVIEW & modifiedBits );
         final boolean modT = 0 != ( MODIFIED_TEXTURE & modifiedBits );
 
-        sb.append("PMVMatrix[backingArray ").append(this.usesBackingArray());
-        sb.append(", modified[P ").append(modP).append(", Mv ").append(modMv).append(", T ").append(modT);
-        sb.append("], dirty/req[Mvi ").append(mviDirty).append("/").append(mviReq).append(", Mvit ").append(mvitDirty).append("/").append(mvitReq).append(", Frustum ").append(frustumDirty).append("/").append(frustumReq);
-        sb.append("], Projection").append(Platform.NEWLINE);
+        sb.append("PMVMatrix[modified[P ").append(modP).append(", Mv ").append(modMv).append(", T ").append(modT);
+        sb.append("], dirty/req[Mvi ").append(mviDirty).append("/").append(mviReq).append(", Mvit ").append(mvitDirty).append("/").append(mvitReq).append(", Frustum ").append(frustumDirty).append("/").append(frustumReq).append("]").append(PlatformPropsImpl.NEWLINE);
+        sb.append(", Projection").append(PlatformPropsImpl.NEWLINE);
         matrixToString(sb, f, matrixP);
-        sb.append(", Modelview").append(Platform.NEWLINE);
+        sb.append(", Modelview").append(PlatformPropsImpl.NEWLINE);
         matrixToString(sb, f, matrixMv);
-        sb.append(", Texture").append(Platform.NEWLINE);
+        sb.append(", Texture").append(PlatformPropsImpl.NEWLINE);
         matrixToString(sb, f, matrixTex);
         if( 0 != ( requestMask & DIRTY_INVERSE_MODELVIEW ) ) {
-            sb.append(", Inverse Modelview").append(Platform.NEWLINE);
+            sb.append(", Inverse Modelview").append(PlatformPropsImpl.NEWLINE);
             matrixToString(sb, f, matrixMvi);
         }
         if( 0 != ( requestMask & DIRTY_INVERSE_TRANSPOSED_MODELVIEW ) ) {
-            sb.append(", Inverse Transposed Modelview").append(Platform.NEWLINE);
+            sb.append(", Inverse Transposed Modelview").append(PlatformPropsImpl.NEWLINE);
             matrixToString(sb, f, matrixMvit);
         }
         sb.append("]");
@@ -914,7 +894,7 @@ public class PMVMatrix implements GLMatrixFunc {
      * @see #MODIFIED_MODELVIEW
      * @see #MODIFIED_TEXTURE
      */
-    public final int getModifiedBits(boolean clear) {
+    public final int getModifiedBits(final boolean clear) {
         final int r = modifiedBits;
         if(clear) {
             modifiedBits = 0;
@@ -1031,7 +1011,7 @@ public class PMVMatrix implements GLMatrixFunc {
     public final boolean update() {
         return updateImpl(true);
     }
-    private final boolean updateImpl(boolean clearModBits) {
+    private final boolean updateImpl(final boolean clearModBits) {
         boolean mod = 0 != modifiedBits;
         if(clearModBits) {
             modifiedBits = 0;
@@ -1040,10 +1020,10 @@ public class PMVMatrix implements GLMatrixFunc {
         if( 0 != ( dirtyBits & ( DIRTY_FRUSTUM & requestMask ) ) ) {
             if( null == frustum ) {
                 frustum = new Frustum();
-                mulPMV = new float[16];
             }
-            FloatUtil.multMatrixf(matrixP, matrixMv, mulPMV, 0);
-            frustum.updateByPMV(mulPMV, 0);
+            FloatUtil.multMatrix(matrixArray, mP_offset, matrixArray, mMv_offset, mat4Tmp1, 0);
+            // FloatUtil.multMatrix(matrixP, matrixMv, mat4Tmp1, 0);
+            frustum.updateByPMV(mat4Tmp1, 0);
             dirtyBits &= ~DIRTY_FRUSTUM;
             mod = true;
         }
@@ -1052,82 +1032,42 @@ public class PMVMatrix implements GLMatrixFunc {
             return mod; // nothing more requested which may have been dirty
         }
 
-        if(nioBackupArraySupported>=0) {
-            try {
-                nioBackupArraySupported = 1;
-                return setMviMvitNIOBackupArray() || mod;
-            } catch(UnsupportedOperationException uoe) {
-                nioBackupArraySupported = -1;
-            }
-        }
-        return setMviMvitNIODirectAccess() || mod;
+        return setMviMvit() || mod;
     }
 
     //
     // private
     //
-    private int nioBackupArraySupported = 0; // -1 not supported, 0 - TBD, 1 - supported
-    private final String msgCantComputeInverse = "Invalid source Mv matrix, can't compute inverse";
+    private static final String msgCantComputeInverse = "Invalid source Mv matrix, can't compute inverse";
 
-    private final boolean setMviMvitNIOBackupArray() {
+    private final boolean setMviMvit() {
         final float[] _matrixMvi = matrixMvi.array();
         final int _matrixMviOffset = matrixMvi.position();
         boolean res = false;
         if( 0 != ( dirtyBits & DIRTY_INVERSE_MODELVIEW ) ) { // only if dirt; always requested at this point, see update()
-            if(!projectFloat.gluInvertMatrixf(matrixMv.array(), matrixMv.position(), _matrixMvi, _matrixMviOffset)) {
-                throw new GLException(msgCantComputeInverse);
-            }
-            dirtyBits &= ~DIRTY_INVERSE_MODELVIEW;
-            res = true;
-        }
-        if( 0 != ( requestMask & ( dirtyBits & DIRTY_INVERSE_TRANSPOSED_MODELVIEW ) ) ) { // only if requested & dirty
-            // transpose matrix
-            final float[] _matrixMvit = matrixMvit.array();
-            final int _matrixMvitOffset = matrixMvit.position();
-            for (int i = 0; i < 4; i++) {
-                for (int j = 0; j < 4; j++) {
-                    _matrixMvit[_matrixMvitOffset+j+i*4] = _matrixMvi[_matrixMviOffset+i+j*4];
-                }
-            }
-            dirtyBits &= ~DIRTY_INVERSE_TRANSPOSED_MODELVIEW;
-            res = true;
-        }
-        return res;
-    }
-
-    private final boolean setMviMvitNIODirectAccess() {
-        boolean res = false;
-        if( 0 != ( dirtyBits & DIRTY_INVERSE_MODELVIEW ) ) { // only if dirt; always requested at this point, see update()
-            if(!projectFloat.gluInvertMatrixf(matrixMv, matrixMvi)) {
+            if( null == FloatUtil.invertMatrix(matrixArray, mMv_offset, _matrixMvi, _matrixMviOffset) ) {
                 throw new GLException(msgCantComputeInverse);
             }
             dirtyBits &= ~DIRTY_INVERSE_MODELVIEW;
             res = true;
         }
         if( 0 != ( requestMask & ( dirtyBits & DIRTY_INVERSE_TRANSPOSED_MODELVIEW ) ) ) { // only if requested & dirty
-            // transpose matrix
-            for (int i = 0; i < 4; i++) {
-                for (int j = 0; j < 4; j++) {
-                    matrixMvit.put(j+i*4, matrixMvi.get(i+j*4));
-                }
-            }
+            FloatUtil.transposeMatrix(_matrixMvi, _matrixMviOffset, matrixMvit.array(), matrixMvit.position());
             dirtyBits &= ~DIRTY_INVERSE_TRANSPOSED_MODELVIEW;
             res = true;
         }
         return res;
     }
 
-    protected final float[] matrixBufferArray;
-    protected final boolean usesBackingArray;
-    protected Buffer matrixBuffer;
-    protected FloatBuffer matrixIdent, matrixPMvMvit, matrixPMvMvi, matrixPMv, matrixP, matrixTex, matrixMv, matrixMvi, matrixMvit;
-    protected float[] matrixMult, matrixTrans, matrixRot, matrixScale, matrixOrtho, matrixFrustum, vec3f;
-    protected FloatStack matrixTStack, matrixPStack, matrixMvStack;
-    protected int matrixMode = GL_MODELVIEW;
-    protected int modifiedBits = MODIFIED_ALL;
-    protected int dirtyBits = DIRTY_ALL; // contains the dirty bits, i.e. hinting for update operation
-    protected int requestMask = 0; // may contain the requested dirty bits: DIRTY_INVERSE_MODELVIEW | DIRTY_INVERSE_TRANSPOSED_MODELVIEW
-    protected ProjectFloat projectFloat;
-    protected float[] mulPMV; // premultiplied PMV
-    protected Frustum frustum;
+    private final float[] matrixArray;
+    private final int mP_offset, mMv_offset, mTex_offset;
+    private final FloatBuffer matrixPMvMvit, matrixPMvMvi, matrixPMv, matrixP, matrixTex, matrixMv, matrixMvi, matrixMvit;
+    private final float[] matrixTxSx;
+    private final float[] mat4Tmp1, mat4Tmp2, mat4Tmp3;
+    private final FloatStack matrixTStack, matrixPStack, matrixMvStack;
+    private int matrixMode = GL_MODELVIEW;
+    private int modifiedBits = MODIFIED_ALL;
+    private int dirtyBits = DIRTY_ALL; // contains the dirty bits, i.e. hinting for update operation
+    private int requestMask = 0; // may contain the requested dirty bits: DIRTY_INVERSE_MODELVIEW | DIRTY_INVERSE_TRANSPOSED_MODELVIEW
+    private Frustum frustum;
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/PNGPixelRect.java b/src/jogl/classes/com/jogamp/opengl/util/PNGPixelRect.java
index fd8f541..64da547 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/PNGPixelRect.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/PNGPixelRect.java
@@ -192,7 +192,7 @@ public class PNGPixelRect extends PixelRectangle.GenericPixelRect {
         return new PNGPixelRect(destFmt, new Dimension(width, height), destStrideInBytes, destIsGLOriented, destPixels, dpiX, dpiY);
     }
 
-    private static final int getPixelLUMToAny(PixelFormat dest_fmt, ByteBuffer d, int dOff, byte lum, byte alpha) {
+    private static final int getPixelLUMToAny(final PixelFormat dest_fmt, final ByteBuffer d, int dOff, final byte lum, final byte alpha) {
         switch(dest_fmt) {
             case LUMINANCE:
                 d.put(dOff++, lum);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java
index 1c87dad..3b65b08 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/RandomTileRenderer.java
@@ -51,7 +51,7 @@ public class RandomTileRenderer extends TileRendererBase {
     }
 
     @Override
-    public final int getParam(int pname) {
+    public final int getParam(final int pname) {
         switch (pname) {
         case TR_IMAGE_WIDTH:
             return imageSize.getWidth();
@@ -75,7 +75,7 @@ public class RandomTileRenderer extends TileRendererBase {
      *
      * @throws IllegalArgumentException is tile x/y are < 0 or tile size is <= 0x0
      */
-    public void setTileRect(int tX, int tY, int tWidth, int tHeight) throws IllegalStateException, IllegalArgumentException {
+    public void setTileRect(final int tX, final int tY, final int tWidth, final int tHeight) throws IllegalStateException, IllegalArgumentException {
         if( 0 > tX || 0 > tY ) {
             throw new IllegalArgumentException("Tile pos must be >= 0/0");
         }
@@ -120,7 +120,7 @@ public class RandomTileRenderer extends TileRendererBase {
      *         {@link #setTileRect(int, int, int, int) tile-rect} has not been set.
      */
     @Override
-    public final void beginTile(GL gl) throws IllegalStateException, GLException {
+    public final void beginTile(final GL gl) throws IllegalStateException, GLException {
         if( 0 >= imageSize.getWidth() || 0 >= imageSize.getHeight() ) {
             throw new IllegalStateException("Image size has not been set");
         }
@@ -143,7 +143,7 @@ public class RandomTileRenderer extends TileRendererBase {
     }
 
     @Override
-    public void endTile( GL gl ) throws IllegalStateException, GLException {
+    public void endTile( final GL gl ) throws IllegalStateException, GLException {
         if( !beginCalled ) {
             throw new IllegalStateException("beginTile(..) has not been called");
         }
@@ -152,8 +152,7 @@ public class RandomTileRenderer extends TileRendererBase {
         // be sure OpenGL rendering is finished
         gl.glFlush();
 
-        // save current glPixelStore values
-        psm.save(gl);
+        // implicitly save current glPixelStore values
         psm.setPackAlignment(gl, 1);
         final GL2ES3 gl2es3;
         final int readBuffer;
@@ -230,7 +229,7 @@ public class RandomTileRenderer extends TileRendererBase {
      * @throws IllegalStateException if no {@link GLAutoDrawable} is {@link #attachAutoDrawable(GLAutoDrawable) attached}
      *                               or imageSize is not set
      */
-    public void display(int tX, int tY, int tWidth, int tHeight) throws IllegalStateException {
+    public void display(final int tX, final int tY, final int tWidth, final int tHeight) throws IllegalStateException {
         setTileRect(tX, tY, tWidth, tHeight);
         display();
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java b/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java
deleted file mode 100644
index 47d56bc..0000000
--- a/src/jogl/classes/com/jogamp/opengl/util/TGAWriter.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- */
-
-package com.jogamp.opengl.util;
-
-import java.io.*;
-import java.nio.*;
-import java.nio.channels.*;
-
-/**
- * Utility class which helps take fast screenshots of OpenGL rendering
- * results into Targa-format files. Used by the {@link com.jogamp.opengl.util.awt.Screenshot}
- * class; can also be used in conjunction with the {@link com.jogamp.opengl.util.gl2.TileRenderer} class.
- */
-public class TGAWriter {
-
-  private static final int TARGA_HEADER_SIZE = 18;
-
-  private FileChannel ch;
-  private ByteBuffer buf;
-
-  /** Constructor for the TGAWriter. */
-  public TGAWriter() {
-  }
-
-  /**
-   * Opens the specified Targa file for writing, overwriting any
-   * existing file, and sets up the header of the file expecting the
-   * data to be filled in before closing it.
-   *
-   * @param file the file to write containing the screenshot
-   * @param width the width of the current drawable
-   * @param height the height of the current drawable
-   * @param alpha whether the alpha channel should be saved. If true,
-   *   requires GL_EXT_abgr extension to be present.
-   *
-   * @throws IOException if an I/O error occurred while writing the
-   *   file
-   */
-  public void open(File file,
-                   int width,
-                   int height,
-                   boolean alpha) throws IOException {
-    RandomAccessFile out = new RandomAccessFile(file, "rw");
-    ch = out.getChannel();
-    int pixelSize = (alpha ? 32 : 24);
-    int numChannels = (alpha ? 4 : 3);
-
-    int fileLength = TARGA_HEADER_SIZE + width * height * numChannels;
-    out.setLength(fileLength);
-    MappedByteBuffer image = ch.map(FileChannel.MapMode.READ_WRITE, 0, fileLength);
-
-    // write the TARGA header
-    image.put(0, (byte) 0).put(1, (byte) 0);
-    image.put(2, (byte) 2); // uncompressed type
-    image.put(12, (byte) (width & 0xFF)); // width
-    image.put(13, (byte) (width >> 8)); // width
-    image.put(14, (byte) (height & 0xFF)); // height
-    image.put(15, (byte) (height >> 8)); // height
-    image.put(16, (byte) pixelSize); // pixel size
-
-    // go to image data position
-    image.position(TARGA_HEADER_SIZE);
-    // jogl needs a sliced buffer
-    buf = image.slice();
-  }
-
-  /**
-   * Returns the ByteBuffer corresponding to the data for the image.
-   * This must be filled in with data in either BGR or BGRA format
-   * depending on whether an alpha channel was specified during
-   * open().
-   */
-  public ByteBuffer getImageData() {
-    return buf;
-  }
-
-  public void close() throws IOException {
-    // close the file channel
-    ch.close();
-    buf = null;
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java
index 7f86b14..d8410a1 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TileRenderer.java
@@ -145,7 +145,7 @@ public class TileRenderer extends TileRendererBase {
     private int offsetY;
 
     @Override
-    protected StringBuilder tileDetails(StringBuilder sb) {
+    protected StringBuilder tileDetails(final StringBuilder sb) {
         sb.append("# "+currentTile+": ["+currentColumn+"]["+currentRow+"] / "+columns+"x"+rows+", ")
         .append("rowOrder "+rowOrder+", offset/size "+offsetX+"/"+offsetY+" "+tileSize.getWidth()+"x"+tileSize.getHeight()+" brd "+tileBorder+", ");
         return super.tileDetails(sb);
@@ -165,7 +165,7 @@ public class TileRenderer extends TileRendererBase {
      * </p>
      */
     @Override
-    public final void setImageSize(int width, int height) {
+    public final void setImageSize(final int width, final int height) {
         super.setImageSize(width, height);
         reset();
     }
@@ -184,7 +184,7 @@ public class TileRenderer extends TileRendererBase {
      * @param height The image-clipping.height
      * @see #getClippedImageSize()
      */
-    public final void clipImageSize(int width, int height) {
+    public final void clipImageSize(final int width, final int height) {
         if( null == imageClippingDim ) {
             imageClippingDim = new Dimension(width, height);
         } else {
@@ -236,7 +236,7 @@ public class TileRenderer extends TileRendererBase {
      *           to avoid artifacts when rendering lines or points with
      *           thickness > 1.
      */
-    public final void setTileSize(int width, int height, int border) {
+    public final void setTileSize(final int width, final int height, final int border) {
         if( 0 > border ) {
             throw new IllegalArgumentException("Tile border must be >= 0");
         }
@@ -255,7 +255,7 @@ public class TileRenderer extends TileRendererBase {
      * @see #TR_TILE_X_OFFSET
      * @see #TR_TILE_Y_OFFSET
      **/
-    public void setTileOffset(int xoff, int yoff) {
+    public void setTileOffset(final int xoff, final int yoff) {
         offsetX = xoff;
         offsetY = yoff;
     }
@@ -299,7 +299,7 @@ public class TileRenderer extends TileRendererBase {
     /* pp */ final int getCurrentTile() { return currentTile; }
 
     @Override
-    public final int getParam(int pname) {
+    public final int getParam(final int pname) {
         switch (pname) {
         case TR_IMAGE_WIDTH:
             return imageSize.getWidth();
@@ -349,7 +349,7 @@ public class TileRenderer extends TileRendererBase {
      *
      * @param order The row traversal order, must be either {@link #TR_TOP_TO_BOTTOM} or {@link #TR_BOTTOM_TO_TOP}.
      */
-    public final void setRowOrder(int order) {
+    public final void setRowOrder(final int order) {
         if (order == TR_TOP_TO_BOTTOM || order == TR_BOTTOM_TO_TOP) {
             rowOrder = order;
         } else {
@@ -388,7 +388,7 @@ public class TileRenderer extends TileRendererBase {
      *         {@link #eot() end-of-tiling} has been reached.
      */
     @Override
-    public final void beginTile( GL gl ) throws IllegalStateException, GLException {
+    public final void beginTile( final GL gl ) throws IllegalStateException, GLException {
         if( !isSetup() ) {
             throw new IllegalStateException("Image size has not been set: "+this);
         }
@@ -408,7 +408,7 @@ public class TileRenderer extends TileRendererBase {
         assert ( currentRow < rows );
         assert ( currentColumn < columns );
 
-        int border = tileBorder;
+        final int border = tileBorder;
 
         final DimensionImmutable clippedImageSize = getClippedImageSize();
         int tH, tW;
@@ -446,7 +446,7 @@ public class TileRenderer extends TileRendererBase {
     }
 
     @Override
-    public void endTile( GL gl ) throws IllegalStateException, GLException {
+    public void endTile( final GL gl ) throws IllegalStateException, GLException {
         if( !beginCalled ) {
             throw new IllegalStateException("beginTile(..) has not been called");
         }
@@ -455,8 +455,7 @@ public class TileRenderer extends TileRendererBase {
         // be sure OpenGL rendering is finished
         gl.glFlush();
 
-        // save current glPixelStore values
-        psm.save(gl);
+        // implicitly save current glPixelStore values
         psm.setPackAlignment(gl, 1);
         final GL2ES3 gl2es3;
         final int readBuffer;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java b/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
index dabde83..a173576 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TileRendererBase.java
@@ -45,7 +45,6 @@ import javax.media.opengl.GLCapabilitiesImmutable;
 import javax.media.opengl.GLDrawable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLException;
-import javax.media.opengl.GLFBODrawable;
 import jogamp.opengl.Debug;
 
 /**
@@ -228,14 +227,14 @@ public abstract class TileRendererBase {
     protected GLEventListener glEventListenerPre = null;
     protected GLEventListener glEventListenerPost = null;
 
-    private final String hashStr(Object o) {
+    private final String hashStr(final Object o) {
         final int h = null != o ? o.hashCode() : 0;
         return "0x"+Integer.toHexString(h);
     }
-    protected StringBuilder tileDetails(StringBuilder sb) {
+    protected StringBuilder tileDetails(final StringBuilder sb) {
         return sb.append("cur "+currentTileXPos+"/"+currentTileYPos+" "+currentTileWidth+"x"+currentTileHeight+", buffer "+hashStr(tileBuffer));
     }
-    public StringBuilder toString(StringBuilder sb) {
+    public StringBuilder toString(final StringBuilder sb) {
         final int gladListenerCount = null != listeners ? listeners.length : 0;
         sb.append("tile[");
         tileDetails(sb);
@@ -246,7 +245,7 @@ public abstract class TileRendererBase {
     }
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         return getClass().getSimpleName()+
                 "["+toString(sb).toString()+"]";
     }
@@ -270,7 +269,7 @@ public abstract class TileRendererBase {
      *
      * @param buffer The buffer itself. Must be large enough to contain a random tile
      */
-    public final void setTileBuffer(GLPixelBuffer buffer) {
+    public final void setTileBuffer(final GLPixelBuffer buffer) {
         tileBuffer = buffer;
         if( DEBUG ) {
             System.err.println("TileRenderer: tile-buffer "+tileBuffer);
@@ -286,7 +285,7 @@ public abstract class TileRendererBase {
      * @param width The width of the final image
      * @param height The height of the final image
      */
-    public void setImageSize(int width, int height) {
+    public void setImageSize(final int width, final int height) {
         imageSize.set(width, height);
     }
 
@@ -298,7 +297,7 @@ public abstract class TileRendererBase {
      *
      * @param buffer the buffer itself, must be large enough to hold the final image
      */
-    public final void setImageBuffer(GLPixelBuffer buffer) {
+    public final void setImageBuffer(final GLPixelBuffer buffer) {
         imageBuffer = buffer;
         if( DEBUG ) {
             System.err.println("TileRenderer: image-buffer "+imageBuffer);
@@ -308,7 +307,7 @@ public abstract class TileRendererBase {
     /** @see #setImageBuffer(GLPixelBuffer) */
     public final GLPixelBuffer getImageBuffer() { return imageBuffer; }
 
-    /* pp */ final void validateGL(GL gl) throws GLException {
+    /* pp */ final void validateGL(final GL gl) throws GLException {
         if( imageBuffer != null && !gl.isGL2ES3()) {
             throw new GLException("Using image-buffer w/ inssufficient GL context: "+gl.getContext().getGLVersion()+", "+gl.getGLProfile());
         }
@@ -415,7 +414,7 @@ public abstract class TileRendererBase {
      * See {@link GLDrawableUtil#swapBuffersBeforeRead(GLCapabilitiesImmutable)}.
      * </p>
      */
-    public final boolean reqPreSwapBuffers(GLCapabilitiesImmutable chosenCaps) {
+    public final boolean reqPreSwapBuffers(final GLCapabilitiesImmutable chosenCaps) {
         return GLDrawableUtil.swapBuffersBeforeRead(chosenCaps);
     }
 
@@ -466,7 +465,7 @@ public abstract class TileRendererBase {
      * @see #getAttachedDrawable()
      * @see #detachAutoDrawable()
      */
-    public final void attachAutoDrawable(GLAutoDrawable glad) throws IllegalStateException {
+    public final void attachAutoDrawable(final GLAutoDrawable glad) throws IllegalStateException {
         if( null != this.glad ) {
             throw new IllegalStateException("GLAutoDrawable already attached");
         }
@@ -551,7 +550,7 @@ public abstract class TileRendererBase {
      * @param preTile the pre operations
      * @param postTile the post operations
      */
-    public final void setGLEventListener(GLEventListener preTile, GLEventListener postTile) {
+    public final void setGLEventListener(final GLEventListener preTile, final GLEventListener postTile) {
         glEventListenerPre = preTile;
         glEventListenerPost = postTile;
     }
@@ -573,7 +572,7 @@ public abstract class TileRendererBase {
         final TileRenderer tileRenderer = TileRendererBase.this instanceof TileRenderer ? (TileRenderer) TileRendererBase.this : null;
 
         @Override
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
             if( null != glEventListenerPre ) {
                 glEventListenerPre.init(drawable);
             }
@@ -590,7 +589,7 @@ public abstract class TileRendererBase {
             }
         }
         @Override
-        public void dispose(GLAutoDrawable drawable) {
+        public void dispose(final GLAutoDrawable drawable) {
             if( null != glEventListenerPre ) {
                 glEventListenerPre.dispose(drawable);
             }
@@ -603,7 +602,7 @@ public abstract class TileRendererBase {
             }
         }
         @Override
-        public void display(GLAutoDrawable drawable) {
+        public void display(final GLAutoDrawable drawable) {
             if( null != glEventListenerPre ) {
                 glEventListenerPre.reshape(drawable, 0, 0, currentTileWidth, currentTileHeight);
                 glEventListenerPre.display(drawable);
@@ -660,6 +659,6 @@ public abstract class TileRendererBase {
             }
         }
         @Override
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
     };
 }
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java b/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java
index b29846d..99def6f 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/TimeFrameI.java
@@ -60,7 +60,7 @@ public class TimeFrameI {
         pts = INVALID_PTS;
         duration = 0;
     }
-    public TimeFrameI(int pts, int duration) {
+    public TimeFrameI(final int pts, final int duration) {
         this.pts = pts;
         this.duration = duration;
     }
@@ -68,11 +68,11 @@ public class TimeFrameI {
     /** Get this frame's presentation timestamp (PTS) in milliseconds. */
     public final int getPTS() { return pts; }
     /** Set this frame's presentation timestamp (PTS) in milliseconds. */
-    public final void setPTS(int pts) { this.pts = pts; }
+    public final void setPTS(final int pts) { this.pts = pts; }
     /** Get this frame's duration in milliseconds. */
     public final int getDuration() { return duration; }
     /** Set this frame's duration in milliseconds. */
-    public final void setDuration(int duration) { this.duration = duration; }
+    public final void setDuration(final int duration) { this.duration = duration; }
 
     @Override
     public String toString() {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
index b964245..fd6172e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSink.java
@@ -61,7 +61,7 @@ public interface AudioSink {
          * @param planar true for planar data package (each channel in own data buffer), false for packed data channels interleaved in one buffer.
          * @param littleEndian true for little-endian, false for big endian
          */
-        public AudioFormat(int sampleRate, int sampleSize, int channelCount, boolean signed, boolean fixedP, boolean planar, boolean littleEndian) {
+        public AudioFormat(final int sampleRate, final int sampleSize, final int channelCount, final boolean signed, final boolean fixedP, final boolean planar, final boolean littleEndian) {
             this.sampleRate = sampleRate;
             this.sampleSize = sampleSize;
             this.channelCount = channelCount;
@@ -104,7 +104,7 @@ public interface AudioSink {
          * Time -> Byte Count
          * </p>
          */
-        public final int getDurationsByteSize(int millisecs) {
+        public final int getDurationsByteSize(final int millisecs) {
             final int bytesPerSample = sampleSize >>> 3; // /8
             return millisecs * ( channelCount * bytesPerSample * ( sampleRate / 1000 ) );
         }
@@ -116,7 +116,7 @@ public interface AudioSink {
          * Byte Count -> Time
          * </p>
          */
-        public final int getBytesDuration(int byteCount) {
+        public final int getBytesDuration(final int byteCount) {
             final int bytesPerSample = sampleSize >>> 3; // /8
             return byteCount / ( channelCount * bytesPerSample * ( sampleRate / 1000 ) );
         }
@@ -132,8 +132,8 @@ public interface AudioSink {
          * </p>
          * @param sampleCount sample count per frame and channel
          */
-        public final float getSamplesDuration(int sampleCount) {
-            return ( 1000f * (float) sampleCount ) / (float)sampleRate;
+        public final float getSamplesDuration(final int sampleCount) {
+            return ( 1000f * sampleCount ) / sampleRate;
         }
 
         /**
@@ -151,8 +151,8 @@ public interface AudioSink {
          * @param millisecs time in milliseconds
          * @param frameDuration duration per frame in milliseconds.
          */
-        public final int getFrameCount(int millisecs, float frameDuration) {
-            return Math.max(1, (int) ( (float)millisecs / frameDuration + 0.5f ));
+        public final int getFrameCount(final int millisecs, final float frameDuration) {
+            return Math.max(1, (int) ( millisecs / frameDuration + 0.5f ));
         }
 
         /**
@@ -170,7 +170,7 @@ public interface AudioSink {
          * </p>
          * @param sampleCount sample count
          */
-        public final int getSamplesByteCount(int sampleCount) {
+        public final int getSamplesByteCount(final int sampleCount) {
             return sampleCount * ( sampleSize >>> 3 );
         }
 
@@ -187,9 +187,9 @@ public interface AudioSink {
          * <p>
          * Byte Count -> Sample Count
          * </p>
-         * @param sampleCount sample count
+         * @param byteCount number of bytes
          */
-        public final int getBytesSampleCount(int byteCount) {
+        public final int getBytesSampleCount(final int byteCount) {
             return ( byteCount << 3 ) / sampleSize;
         }
 
@@ -208,7 +208,7 @@ public interface AudioSink {
         public AudioFrame() {
             this.byteSize = 0;
         }
-        public AudioFrame(int pts, int duration, int byteCount) {
+        public AudioFrame(final int pts, final int duration, final int byteCount) {
             super(pts, duration);
             this.byteSize=byteCount;
         }
@@ -216,7 +216,7 @@ public interface AudioSink {
         /** Get this frame's size in bytes. */
         public final int getByteSize() { return byteSize; }
         /** Set this frame's size in bytes. */
-        public final void setByteSize(int size) { this.byteSize=size; }
+        public final void setByteSize(final int size) { this.byteSize=size; }
 
         @Override
         public String toString() {
@@ -226,7 +226,7 @@ public interface AudioSink {
     public static class AudioDataFrame extends AudioFrame {
         protected final ByteBuffer data;
 
-        public AudioDataFrame(int pts, int duration, ByteBuffer bytes, int byteCount) {
+        public AudioDataFrame(final int pts, final int duration, final ByteBuffer bytes, final int byteCount) {
             super(pts, duration, byteCount);
             if( byteCount > bytes.remaining() ) {
                 throw new IllegalArgumentException("Give size "+byteCount+" exceeds remaining bytes in ls "+bytes+". "+this);
@@ -335,6 +335,12 @@ public interface AudioSink {
                         int initialQueueSize, int queueGrowAmount, int queueLimit);
 
     /**
+     * Returns the {@link AudioFormat} as chosen by {@link #init(AudioFormat, float, int, int, int)},
+     * i.e. it shall match the <i>requestedFormat</i>.
+     */
+    public AudioFormat getChosenFormat();
+
+    /**
      * Returns true, if {@link #play()} has been requested <i>and</i> the sink is still playing,
      * otherwise false.
      */
@@ -417,20 +423,6 @@ public interface AudioSink {
     public int getFreeFrameCount();
 
     /**
-     * Enqueue the remaining bytes of the given {@link AudioDataFrame}'s direct ByteBuffer to this sink.
-     * <p>
-     * The data must comply with the chosen {@link AudioFormat} as returned by {@link #initSink(AudioFormat)}.
-     * </p>
-     * <p>
-     * {@link #init(AudioFormat, float, int, int, int)} must be called first.
-     * </p>
-     * @returns the enqueued internal {@link AudioFrame}, which may differ from the input <code>audioDataFrame</code>.
-     * @deprecated User shall use {@link #enqueueData(int, ByteBuffer, int)}, which allows implementation
-     *             to reuse specialized {@link AudioFrame} instances.
-     */
-    public AudioFrame enqueueData(AudioDataFrame audioDataFrame);
-
-    /**
      * Enqueue <code>byteCount</code> bytes of the remaining bytes of the given NIO {@link ByteBuffer} to this sink.
      * <p>
      * The data must comply with the chosen {@link AudioFormat} as returned by {@link #initSink(AudioFormat)}.
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java
index 2cfd40d..a2b29b4 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/AudioSinkFactory.java
@@ -50,7 +50,7 @@ public class AudioSinkFactory {
         return new NullAudioSink();
     }
 
-    public static AudioSink create(final ClassLoader cl, String implName) {
+    public static AudioSink create(final ClassLoader cl, final String implName) {
         final AudioSink audioSink;
         if(ReflectionUtil.isClassAvailable(implName, cl)){
             try {
@@ -58,8 +58,8 @@ public class AudioSinkFactory {
                 if( audioSink.isInitialized() ) {
                     return audioSink;
                 }
-            } catch (Throwable t) {
-                if(AudioSink.DEBUG) { System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage()); t.printStackTrace(); }
+            } catch (final Throwable t) {
+                if(AudioSink.DEBUG) { System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage()); t.printStackTrace(); }
             }
         }
         return null;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
index 5a455c8..4fffd9f 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayer.java
@@ -165,6 +165,7 @@ import com.jogamp.opengl.util.TimeFrameI;
  * <table border="1">
  *   <tr><th colspan=5>Big Buck Bunny 24f 16:9</th></tr>
  *   <tr><td>Big Buck Bunny</td><td>320p</td><td>h264<td>aac 48000Hz 2 chan</td><td>http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4</td></tr>
+ *   <tr><td>Big Buck Bunny</td><td>240p</td><td>h264<td>aac 48000Hz 2 chan</td><td>http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4</td></tr>
  *   <tr><td>Big Buck Bunny</td><td>720p</td><td>mpeg4<td>ac3 48000Hz 5.1 chan</td><td>http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_surround.avi</td></tr>
  *   <tr><td>Big Buck Bunny</td><td>720p</td><td>msmpeg4v2<td>mp3 48000Hz 2 chan</td><td>http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_stereo.avi</td></tr>
  *   <tr><td>Big Buck Bunny</td><td>720p</td><td>theora<td>vorbis 48000Hz 2 chan</td><td>http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_720p_stereo.ogg</td></tr>
@@ -245,10 +246,10 @@ public interface GLMediaPlayer extends TextureSequence {
      */
     @SuppressWarnings("serial")
     public static class StreamException extends Exception {
-        public StreamException(Throwable cause) {
+        public StreamException(final Throwable cause) {
             super(cause);
         }
-        public StreamException(String message, Throwable cause) {
+        public StreamException(final String message, final Throwable cause) {
             super(message, cause);
         }
     }
@@ -317,7 +318,7 @@ public interface GLMediaPlayer extends TextureSequence {
 
         public final int id;
 
-        State(int id){
+        State(final int id){
             this.id = id;
         }
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
index 248e265..9378cec 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/av/GLMediaPlayerFactory.java
@@ -55,12 +55,12 @@ public class GLMediaPlayerFactory {
         return new NullGLMediaPlayer();
     }
 
-    public static GLMediaPlayer create(final ClassLoader cl, String implName) {
+    public static GLMediaPlayer create(final ClassLoader cl, final String implName) {
         try {
             if(((Boolean)ReflectionUtil.callStaticMethod(implName, isAvailableMethodName, null, null, cl)).booleanValue()) {
                 return (GLMediaPlayer) ReflectionUtil.createInstance(implName, cl);
             }
-        } catch (Throwable t) { if(GLMediaPlayer.DEBUG) { System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage()); t.printStackTrace(); } }
+        } catch (final Throwable t) { if(GLMediaPlayer.DEBUG) { System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage()); t.printStackTrace(); } }
         return null;
     }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java
index a333560..04bc0a1 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLPixelBuffer.java
@@ -31,6 +31,7 @@ import java.awt.image.BufferedImage;
 import java.awt.image.ColorModel;
 import java.awt.image.DataBuffer;
 import java.awt.image.DataBufferInt;
+import java.awt.image.Raster;
 import java.awt.image.SinglePixelPackedSampleModel;
 import java.awt.image.WritableRaster;
 import java.nio.Buffer;
@@ -78,8 +79,8 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
      * @param allowRowStride If <code>true</code>, allow row-stride, otherwise not. See {@link #requiresNewBuffer(GL, int, int, int)}.
      *                       If <code>true</code>, user shall decide whether to use a {@link #getAlignedImage(int, int) width-aligned image}.
      */
-    public AWTGLPixelBuffer(GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, BufferedImage image,
-                            Buffer buffer, boolean allowRowStride) {
+    public AWTGLPixelBuffer(final GLPixelAttributes pixelAttributes, final int width, final int height, final int depth, final boolean pack, final BufferedImage image,
+                            final Buffer buffer, final boolean allowRowStride) {
         super(pixelAttributes, width, height, depth, pack, buffer, allowRowStride);
         this.image = image;
     }
@@ -97,7 +98,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
      * @return
      * @throws IllegalArgumentException if requested size exceeds image size
      */
-    public BufferedImage getAlignedImage(int width, int height) throws IllegalArgumentException {
+    public BufferedImage getAlignedImage(final int width, final int height) throws IllegalArgumentException {
         if( width * height > image.getWidth() * image.getHeight() ) {
             throw new IllegalArgumentException("Requested size exceeds image size: "+width+"x"+height+" > "+image.getWidth()+"x"+image.getHeight());
         }
@@ -110,12 +111,12 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
             final SinglePixelPackedSampleModel sppsm0 = (SinglePixelPackedSampleModel) raster0.getSampleModel();
             final SinglePixelPackedSampleModel sppsm1 = new SinglePixelPackedSampleModel(dataBuffer.getDataType(),
                         width, height, width /* scanLineStride */, sppsm0.getBitMasks());
-            final WritableRaster raster1 = WritableRaster.createWritableRaster(sppsm1, dataBuffer, null);
+            final WritableRaster raster1 = Raster.createWritableRaster(sppsm1, dataBuffer, null);
             return new BufferedImage (cm, raster1, cm.isAlphaPremultiplied(), null);
         }
     }
 
-    public final boolean isDataBufferSource(BufferedImage imageU) {
+    public final boolean isDataBufferSource(final BufferedImage imageU) {
         final DataBuffer dataBuffer0 = image.getRaster().getDataBuffer();
         final DataBuffer dataBufferU = imageU.getRaster().getDataBuffer();
         return dataBufferU == dataBuffer0;
@@ -143,14 +144,14 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
          * See {@link #getAllowRowStride()} and {@link AWTGLPixelBuffer#requiresNewBuffer(GL, int, int, int)}.
          * If <code>true</code>, user shall decide whether to use a {@link AWTGLPixelBuffer#getAlignedImage(int, int) width-aligned image}.
          */
-        public AWTGLPixelBufferProvider(boolean allowRowStride) {
+        public AWTGLPixelBufferProvider(final boolean allowRowStride) {
             this.allowRowStride = allowRowStride;
         }
         @Override
         public boolean getAllowRowStride() { return allowRowStride; }
 
         @Override
-        public GLPixelAttributes getAttributes(GL gl, int componentCount) {
+        public GLPixelAttributes getAttributes(final GL gl, final int componentCount) {
             return 4 == componentCount ? awtPixelAttributesIntRGBA4 : awtPixelAttributesIntRGB3;
         }
 
@@ -161,7 +162,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
          * </p>
          */
         @Override
-        public AWTGLPixelBuffer allocate(GL gl, GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize) {
+        public AWTGLPixelBuffer allocate(final GL gl, final GLPixelAttributes pixelAttributes, final int width, final int height, final int depth, final boolean pack, final int minByteSize) {
             final BufferedImage image = new BufferedImage(width, height, 4 == pixelAttributes.componentCount ? BufferedImage.TYPE_INT_ARGB : BufferedImage.TYPE_INT_RGB);
             final int[] readBackIntBuffer = ((DataBufferInt) image.getRaster().getDataBuffer()).getData();
             final Buffer ibuffer = IntBuffer.wrap( readBackIntBuffer );
@@ -186,7 +187,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
         /**
          * @param allowRowStride If <code>true</code>, allow row-stride, otherwise not. See {@link AWTGLPixelBuffer#requiresNewBuffer(GL, int, int, int)}.
          */
-        public SingleAWTGLPixelBufferProvider(boolean allowRowStride) {
+        public SingleAWTGLPixelBufferProvider(final boolean allowRowStride) {
             super(allowRowStride);
         }
 
@@ -197,7 +198,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
          * </p>
          */
         @Override
-        public AWTGLPixelBuffer allocate(GL gl, GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize) {
+        public AWTGLPixelBuffer allocate(final GL gl, final GLPixelAttributes pixelAttributes, final int width, final int height, final int depth, final boolean pack, final int minByteSize) {
             if( 4 == pixelAttributes.componentCount ) {
                 if( null == singleRGBA4 || singleRGBA4.requiresNewBuffer(gl, width, height, minByteSize) ) {
                     singleRGBA4 = allocateImpl(pixelAttributes, width, height, depth, pack, minByteSize);
@@ -211,7 +212,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
             }
         }
 
-        private AWTGLPixelBuffer allocateImpl(GLPixelAttributes pixelAttributes, int width, int height, int depth, boolean pack, int minByteSize) {
+        private AWTGLPixelBuffer allocateImpl(final GLPixelAttributes pixelAttributes, final int width, final int height, final int depth, final boolean pack, final int minByteSize) {
             final BufferedImage image = new BufferedImage(width, height, 4 == pixelAttributes.componentCount ? BufferedImage.TYPE_INT_ARGB : BufferedImage.TYPE_INT_RGB);
             final int[] readBackIntBuffer = ((DataBufferInt) image.getRaster().getDataBuffer()).getData();
             final Buffer ibuffer = IntBuffer.wrap( readBackIntBuffer );
@@ -220,7 +221,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
 
         /** Return the last {@link #allocate(GL, GLPixelAttributes, int, int, int, boolean, int) allocated} {@link AWTGLPixelBuffer} w/ {@link GLPixelAttributes#componentCount}. */
         @Override
-        public AWTGLPixelBuffer getSingleBuffer(GLPixelAttributes pixelAttributes) {
+        public AWTGLPixelBuffer getSingleBuffer(final GLPixelAttributes pixelAttributes) {
             return 4 == pixelAttributes.componentCount ? singleRGBA4 : singleRGB3;
         }
 
@@ -229,7 +230,7 @@ public class AWTGLPixelBuffer extends GLPixelBuffer {
          * @return the newly initialized single {@link AWTGLPixelBuffer}, or null if already allocated.
          */
         @Override
-        public AWTGLPixelBuffer initSingleton(int componentCount, int width, int height, int depth, boolean pack) {
+        public AWTGLPixelBuffer initSingleton(final int componentCount, final int width, final int height, final int depth, final boolean pack) {
             if( 4 == componentCount ) {
                 if( null != singleRGBA4 ) {
                     return null;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java
index 9490e04..b75ad3b 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/AWTGLReadBufferUtil.java
@@ -46,10 +46,13 @@ public class AWTGLReadBufferUtil extends GLReadBufferUtil {
      *
      * @param alpha
      */
-    public AWTGLReadBufferUtil(GLProfile glp, boolean alpha) {
+    public AWTGLReadBufferUtil(final GLProfile glp, final boolean alpha) {
         super(new AWTGLPixelBuffer.AWTGLPixelBufferProvider( glp.isGL2ES3() /* allowRowStride */ ), alpha, false);
     }
 
+    /**
+     * Returns the {@link AWTGLPixelBuffer}, as filled by previous call to {@link #readPixels(GL, int, int, int, int, boolean)}.
+     */
     public AWTGLPixelBuffer getAWTGLPixelBuffer() { return (AWTGLPixelBuffer)this.getPixelBuffer(); }
 
     /**
@@ -64,7 +67,7 @@ public class AWTGLReadBufferUtil extends GLReadBufferUtil {
      *                       and handled in a efficient manner there (TextureCoordinates and TextureIO writer).
      * @see #AWTGLReadBufferUtil(GLProfile, boolean)
      */
-    public BufferedImage readPixelsToBufferedImage(GL gl, boolean awtOrientation) {
+    public BufferedImage readPixelsToBufferedImage(final GL gl, final boolean awtOrientation) {
         return readPixelsToBufferedImage(gl, 0, 0, 0, 0, awtOrientation);
     }
 
@@ -84,16 +87,16 @@ public class AWTGLReadBufferUtil extends GLReadBufferUtil {
      *                       and handled in a efficient manner there (TextureCoordinates and TextureIO writer).
      * @see #AWTGLReadBufferUtil(GLProfile, boolean)
      */
-    public BufferedImage readPixelsToBufferedImage(GL gl, int inX, int inY, int inWidth, int inHeight, boolean awtOrientation) {
+    public BufferedImage readPixelsToBufferedImage(final GL gl, final int inX, final int inY, final int inWidth, final int inHeight, final boolean awtOrientation) {
         final GLDrawable drawable = gl.getContext().getGLReadDrawable();
         final int width, height;
-        if( 0 >= inWidth || drawable.getWidth() < inWidth ) {
-            width = drawable.getWidth();
+        if( 0 >= inWidth || drawable.getSurfaceWidth() < inWidth ) {
+            width = drawable.getSurfaceWidth();
         } else {
             width = inWidth;
         }
-        if( 0 >= inHeight || drawable.getHeight() < inHeight ) {
-            height = drawable.getHeight();
+        if( 0 >= inHeight || drawable.getSurfaceHeight() < inHeight ) {
+            height = drawable.getSurfaceHeight();
         } else {
             height= inHeight;
         }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java b/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
index df3cc4a..4023a06 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/ImageUtil.java
@@ -50,8 +50,8 @@ public class ImageUtil {
   /** Flips the supplied BufferedImage vertically. This is often a
       necessary conversion step to display a Java2D image correctly
       with OpenGL and vice versa. */
-  public static void flipImageVertically(BufferedImage image) {
-    WritableRaster raster = image.getRaster();
+  public static void flipImageVertically(final BufferedImage image) {
+    final WritableRaster raster = image.getRaster();
     Object scanline1 = null;
     Object scanline2 = null;
 
@@ -73,8 +73,8 @@ public class ImageUtil {
    *
    * @return A instance of <code>BufferedImage</code> with a type compatible with the graphics card.
    */
-  public static BufferedImage createCompatibleImage(int width, int height) {
-    GraphicsConfiguration configuration =
+  public static BufferedImage createCompatibleImage(final int width, final int height) {
+    final GraphicsConfiguration configuration =
       GraphicsEnvironment.getLocalGraphicsEnvironment().
       getDefaultScreenDevice().getDefaultConfiguration();
     return configuration.createCompatibleImage(width, height);
@@ -92,7 +92,7 @@ public class ImageUtil {
    *
    * @return A thumbnail with the requested width or the original picture if thumbWidth = image.getWidth()
    */
-  public static BufferedImage createThumbnail(BufferedImage image, int thumbWidth) {
+  public static BufferedImage createThumbnail(final BufferedImage image, final int thumbWidth) {
     // Thanks to Romain Guy for this utility
     if (thumbWidth > image.getWidth()) {
       throw new IllegalArgumentException("Thumbnail width must be greater than image width");
@@ -102,7 +102,7 @@ public class ImageUtil {
       return image;
     }
 
-    float ratio = (float) image.getWidth() / (float) image.getHeight();
+    final float ratio = (float) image.getWidth() / (float) image.getHeight();
     int width = image.getWidth();
     BufferedImage thumb = image;
 
@@ -112,8 +112,8 @@ public class ImageUtil {
         width = thumbWidth;
       }
 
-      BufferedImage temp = createCompatibleImage(width, (int) (width / ratio));
-      Graphics2D g2 = temp.createGraphics();
+      final BufferedImage temp = createCompatibleImage(width, (int) (width / ratio));
+      final Graphics2D g2 = temp.createGraphics();
       g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                           RenderingHints.VALUE_INTERPOLATION_BILINEAR);
       g2.drawImage(thumb, 0, 0, temp.getWidth(), temp.getHeight(), null);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java b/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java
index 931f598..a78bc9b 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/Overlay.java
@@ -49,13 +49,13 @@ import javax.media.opengl.*;
     efficiency. */
 
 public class Overlay {
-  private GLDrawable drawable;
+  private final GLDrawable drawable;
   private TextureRenderer renderer;
   private boolean contentsLost;
 
   /** Creates a new Java 2D overlay on top of the specified
       GLDrawable. */
-  public Overlay(GLDrawable drawable) {
+  public Overlay(final GLDrawable drawable) {
     this.drawable = drawable;
   }
 
@@ -103,7 +103,7 @@ public class Overlay {
       @param height the height of the region to update
 
       @throws GLException If an OpenGL context is not current when this method is called */
-  public void markDirty(int x, int y, int width, int height) {
+  public void markDirty(final int x, final int y, final int width, final int height) {
     renderer.markDirty(x, y, width, height);
   }
 
@@ -119,7 +119,7 @@ public class Overlay {
   */
   public void drawAll() throws GLException {
     beginRendering();
-    draw(0, 0, drawable.getWidth(), drawable.getHeight());
+    draw(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
     endRendering();
   }
 
@@ -130,7 +130,7 @@ public class Overlay {
       @throws GLException If an OpenGL context is not current when this method is called
   */
   public void beginRendering() throws GLException {
-    renderer.beginOrthoRendering(drawable.getWidth(), drawable.getHeight());
+    renderer.beginOrthoRendering(drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
   }
 
   /** Ends the OpenGL rendering process for the overlay. This is
@@ -159,7 +159,7 @@ public class Overlay {
 
       @throws GLException If an OpenGL context is not current when this method is called
   */
-  public void draw(int x, int y, int width, int height) throws GLException {
+  public void draw(final int x, final int y, final int width, final int height) throws GLException {
     draw(x, y, x, y, width, height);
   }
 
@@ -184,9 +184,9 @@ public class Overlay {
 
       @throws GLException If an OpenGL context is not current when this method is called
   */
-  public void draw(int screenx, int screeny,
-                   int overlayx, int overlayy,
-                   int width, int height) throws GLException {
+  public void draw(final int screenx, final int screeny,
+                   final int overlayx, final int overlayy,
+                   final int width, final int height) throws GLException {
     renderer.drawOrthoRect(screenx, screeny,
                            overlayx, overlayy,
                            width, height);
@@ -198,13 +198,13 @@ public class Overlay {
 
   private void validateRenderer() {
     if (renderer == null) {
-      renderer = new TextureRenderer(drawable.getWidth(),
-                                     drawable.getHeight(),
+      renderer = new TextureRenderer(drawable.getSurfaceWidth(),
+                                     drawable.getSurfaceHeight(),
                                      true);
       contentsLost = true;
-    } else if (renderer.getWidth() != drawable.getWidth() ||
-               renderer.getHeight() != drawable.getHeight()) {
-      renderer.setSize(drawable.getWidth(), drawable.getHeight());
+    } else if (renderer.getWidth() != drawable.getSurfaceWidth() ||
+               renderer.getHeight() != drawable.getSurfaceHeight()) {
+      renderer.setSize(drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
       contentsLost = true;
     } else {
       contentsLost = false;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java b/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java
deleted file mode 100644
index f686b67..0000000
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/Screenshot.java
+++ /dev/null
@@ -1,414 +0,0 @@
-/*
- * Copyright (c) 2005 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2013 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- */
-
-package com.jogamp.opengl.util.awt;
-
-import java.awt.image.BufferedImage;
-import java.awt.image.DataBufferByte;
-import java.io.File;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-
-import javax.imageio.ImageIO;
-import javax.media.opengl.GL;
-import javax.media.opengl.GL2;
-import javax.media.opengl.GL2GL3;
-import javax.media.opengl.GLContext;
-import javax.media.opengl.GLDrawable;
-import javax.media.opengl.GLException;
-
-import com.jogamp.common.util.IOUtil;
-import com.jogamp.opengl.GLExtensions;
-import com.jogamp.opengl.util.GLPixelStorageModes;
-import com.jogamp.opengl.util.TGAWriter;
-
-/**
- * Utilities for taking screenshots of OpenGL applications.
- * @deprecated Please consider using {@link com.jogamp.opengl.util.GLReadBufferUtil},
- *             which is AWT independent and does not require a CPU based vertical image flip
- *             in case drawable {@link GLDrawable#isGLOriented() is in OpenGL orientation}.
- *             Further more you may use {@link AWTGLReadBufferUtil} to read out
- *             the framebuffer into a BufferedImage for further AWT processing.
- */
-public class Screenshot {
-  private Screenshot() {}
-
-  /**
-   * Takes a fast screenshot of the current OpenGL drawable to a Targa
-   * file. Requires the OpenGL context for the desired drawable to be
-   * current. Takes the screenshot from the last assigned read buffer,
-   * or the OpenGL default read buffer if none has been specified by
-   * the user (GL_FRONT for single-buffered configurations and GL_BACK
-   * for double-buffered configurations). This is the fastest
-   * mechanism for taking a screenshot of an application. Contributed
-   * by Carsten Weisse of Bytonic Software (http://bytonic.de/). <p>
-   *
-   * No alpha channel is written with this variant.
-   *
-   * @param file the file to write containing the screenshot
-   * @param width the width of the current drawable
-   * @param height the height of the current drawable
-   *
-   * @throws GLException if an OpenGL context was not current or
-   *   another OpenGL-related error occurred
-   * @throws IOException if an I/O error occurred while writing the
-   *   file
-   */
-  public static void writeToTargaFile(File file,
-                                      int width,
-                                      int height) throws GLException, IOException {
-    writeToTargaFile(file, width, height, false);
-  }
-
-  /**
-   * Takes a fast screenshot of the current OpenGL drawable to a Targa
-   * file. Requires the OpenGL context for the desired drawable to be
-   * current. Takes the screenshot from the last assigned read buffer,
-   * or the OpenGL default read buffer if none has been specified by
-   * the user (GL_FRONT for single-buffered configurations and GL_BACK
-   * for double-buffered configurations). This is the fastest
-   * mechanism for taking a screenshot of an application. Contributed
-   * by Carsten Weisse of Bytonic Software (http://bytonic.de/).
-   *
-   * @param file the file to write containing the screenshot
-   * @param width the width of the current drawable
-   * @param height the height of the current drawable
-   * @param alpha whether the alpha channel should be saved. If true,
-   *   requires GL_EXT_abgr extension to be present.
-   *
-   * @throws GLException if an OpenGL context was not current or
-   *   another OpenGL-related error occurred
-   * @throws IOException if an I/O error occurred while writing the
-   *   file
-   */
-  public static void writeToTargaFile(File file,
-                                      int width,
-                                      int height,
-                                      boolean alpha) throws GLException, IOException {
-    writeToTargaFile(file, 0, 0, width, height, alpha);
-  }
-
-  /**
-   * Takes a fast screenshot of the current OpenGL drawable to a Targa
-   * file. Requires the OpenGL context for the desired drawable to be
-   * current. Takes the screenshot from the last assigned read buffer,
-   * or the OpenGL default read buffer if none has been specified by
-   * the user (GL_FRONT for single-buffered configurations and GL_BACK
-   * for double-buffered configurations). This is the fastest
-   * mechanism for taking a screenshot of an application. Contributed
-   * by Carsten Weisse of Bytonic Software (http://bytonic.de/).
-   *
-   * @param file the file to write containing the screenshot
-   * @param x the starting x coordinate of the screenshot, measured from the lower-left
-   * @param y the starting y coordinate of the screenshot, measured from the lower-left
-   * @param width the width of the desired screenshot area
-   * @param height the height of the desired screenshot area
-   * @param alpha whether the alpha channel should be saved. If true,
-   *   requires GL_EXT_abgr extension to be present.
-   *
-   * @throws GLException if an OpenGL context was not current or
-   *   another OpenGL-related error occurred
-   * @throws IOException if an I/O error occurred while writing the
-   *   file
-   */
-  public static void writeToTargaFile(File file,
-                                      int x,
-                                      int y,
-                                      int width,
-                                      int height,
-                                      boolean alpha) throws GLException, IOException {
-    if (alpha) {
-      checkExtABGR();
-    }
-
-    TGAWriter writer = new TGAWriter();
-    writer.open(file, width, height, alpha);
-    ByteBuffer bgr = writer.getImageData();
-
-    GL gl = GLContext.getCurrentGL();
-
-    // Set up pixel storage modes
-    GLPixelStorageModes psm = new GLPixelStorageModes();
-    psm.setPackAlignment(gl, 1);
-
-    int readbackType = (alpha ? GL2.GL_ABGR_EXT : GL2GL3.GL_BGR);
-
-    // read the BGR values into the image buffer
-    gl.glReadPixels(x, y, width, height, readbackType,
-                    GL.GL_UNSIGNED_BYTE, bgr);
-
-    // Restore pixel storage modes
-    psm.restore(gl);
-
-    // close the file
-    writer.close();
-  }
-
-  /**
-   * Takes a screenshot of the current OpenGL drawable to a
-   * BufferedImage. Requires the OpenGL context for the desired
-   * drawable to be current. Takes the screenshot from the last
-   * assigned read buffer, or the OpenGL default read buffer if none
-   * has been specified by the user (GL_FRONT for single-buffered
-   * configurations and GL_BACK for double-buffered configurations).
-   * Note that the scanlines of the resulting image are flipped
-   * vertically in order to correctly match the OpenGL contents, which
-   * takes time and is therefore not as fast as the Targa screenshot
-   * function. <P>
-   *
-   * No alpha channel is read back with this variant.
-   *
-   * @param width the width of the current drawable
-   * @param height the height of the current drawable
-   *
-   * @throws GLException if an OpenGL context was not current or
-   *   another OpenGL-related error occurred
-   */
-  public static BufferedImage readToBufferedImage(int width,
-                                                  int height) throws GLException {
-    return readToBufferedImage(width, height, false);
-  }
-
-  /**
-   * Takes a screenshot of the current OpenGL drawable to a
-   * BufferedImage. Requires the OpenGL context for the desired
-   * drawable to be current. Takes the screenshot from the last
-   * assigned read buffer, or the OpenGL default read buffer if none
-   * has been specified by the user (GL_FRONT for single-buffered
-   * configurations and GL_BACK for double-buffered configurations).
-   * Note that the scanlines of the resulting image are flipped
-   * vertically in order to correctly match the OpenGL contents, which
-   * takes time and is therefore not as fast as the Targa screenshot
-   * function.
-   *
-   * @param width the width of the current drawable
-   * @param height the height of the current drawable
-   * @param alpha whether the alpha channel should be read back. If
-   *   true, requires GL_EXT_abgr extension to be present.
-   *
-   * @throws GLException if an OpenGL context was not current or
-   *   another OpenGL-related error occurred
-   */
-  public static BufferedImage readToBufferedImage(int width,
-                                                  int height,
-                                                  boolean alpha) throws GLException {
-    return readToBufferedImage(0, 0, width, height, alpha);
-  }
-
-  /**
-   * Takes a screenshot of the current OpenGL drawable to a
-   * BufferedImage. Requires the OpenGL context for the desired
-   * drawable to be current. Takes the screenshot from the last
-   * assigned read buffer, or the OpenGL default read buffer if none
-   * has been specified by the user (GL_FRONT for single-buffered
-   * configurations and GL_BACK for double-buffered configurations).
-   * Note that the scanlines of the resulting image are flipped
-   * vertically in order to correctly match the OpenGL contents, which
-   * takes time and is therefore not as fast as the Targa screenshot
-   * function.
-   *
-   * @param x the starting x coordinate of the screenshot, measured from the lower-left
-   * @param y the starting y coordinate of the screenshot, measured from the lower-left
-   * @param width the width of the desired screenshot area
-   * @param height the height of the desired screenshot area
-   * @param alpha whether the alpha channel should be read back. If
-   *   true, requires GL_EXT_abgr extension to be present.
-   *
-   * @throws GLException if an OpenGL context was not current or
-   *   another OpenGL-related error occurred
-   */
-  public static BufferedImage readToBufferedImage(int x,
-                                                  int y,
-                                                  int width,
-                                                  int height,
-                                                  boolean alpha) throws GLException {
-    int bufImgType = (alpha ? BufferedImage.TYPE_4BYTE_ABGR : BufferedImage.TYPE_3BYTE_BGR);
-    int readbackType = (alpha ? GL2.GL_ABGR_EXT : GL2GL3.GL_BGR);
-
-    if (alpha) {
-      checkExtABGR();
-    }
-
-    // Allocate necessary storage
-    BufferedImage image = new BufferedImage(width, height, bufImgType);
-
-    GLContext glc = GLContext.getCurrent();
-    GL gl = glc.getGL();
-
-    // Set up pixel storage modes
-    GLPixelStorageModes psm = new GLPixelStorageModes();
-    psm.setPackAlignment(gl, 1);
-
-    // read the BGR values into the image
-    gl.glReadPixels(x, y, width, height, readbackType,
-                    GL.GL_UNSIGNED_BYTE,
-                    ByteBuffer.wrap(((DataBufferByte) image.getRaster().getDataBuffer()).getData()));
-
-    // Restore pixel storage modes
-    psm.restore(gl);
-
-    if( glc.getGLDrawable().isGLOriented() ) {
-        // Must flip BufferedImage vertically for correct results
-        ImageUtil.flipImageVertically(image);
-    }
-    return image;
-  }
-
-  /**
-   * Takes a screenshot of the current OpenGL drawable to the
-   * specified file on disk using the ImageIO package. Requires the
-   * OpenGL context for the desired drawable to be current. Takes the
-   * screenshot from the last assigned read buffer, or the OpenGL
-   * default read buffer if none has been specified by the user
-   * (GL_FRONT for single-buffered configurations and GL_BACK for
-   * double-buffered configurations). This is not the fastest
-   * mechanism for taking a screenshot but may be more convenient than
-   * others for getting images for consumption by other packages. The
-   * file format is inferred from the suffix of the given file. <P>
-   *
-   * No alpha channel is saved with this variant.
-   *
-   * @param file the file to write containing the screenshot
-   * @param width the width of the current drawable
-   * @param height the height of the current drawable
-   *
-   * @throws GLException if an OpenGL context was not current or
-   *   another OpenGL-related error occurred
-   *
-   * @throws IOException if an I/O error occurred or if the file could
-   *   not be written to disk due to the requested file format being
-   *   unsupported by ImageIO
-   */
-  public static void writeToFile(File file,
-                                 int width,
-                                 int height) throws IOException, GLException {
-    writeToFile(file, width, height, false);
-  }
-
-  /**
-   * Takes a screenshot of the current OpenGL drawable to the
-   * specified file on disk using the ImageIO package. Requires the
-   * OpenGL context for the desired drawable to be current. Takes the
-   * screenshot from the last assigned read buffer, or the OpenGL
-   * default read buffer if none has been specified by the user
-   * (GL_FRONT for single-buffered configurations and GL_BACK for
-   * double-buffered configurations). This is not the fastest
-   * mechanism for taking a screenshot but may be more convenient than
-   * others for getting images for consumption by other packages. The
-   * file format is inferred from the suffix of the given file. <P>
-   *
-   * Note that some file formats, in particular JPEG, can not handle
-   * an alpha channel properly. If the "alpha" argument is specified
-   * as true for such a file format it will be silently ignored.
-   *
-   * @param file the file to write containing the screenshot
-   * @param width the width of the current drawable
-   * @param height the height of the current drawable
-   * @param alpha whether an alpha channel should be saved. If true,
-   *   requires GL_EXT_abgr extension to be present.
-   *
-   * @throws GLException if an OpenGL context was not current or
-   *   another OpenGL-related error occurred
-   *
-   * @throws IOException if an I/O error occurred or if the file could
-   *   not be written to disk due to the requested file format being
-   *   unsupported by ImageIO
-   */
-  public static void writeToFile(File file,
-                                 int width,
-                                 int height,
-                                 boolean alpha) throws IOException, GLException {
-    writeToFile(file, 0, 0, width, height, alpha);
-  }
-
-  /**
-   * Takes a screenshot of the current OpenGL drawable to the
-   * specified file on disk using the ImageIO package. Requires the
-   * OpenGL context for the desired drawable to be current. Takes the
-   * screenshot from the last assigned read buffer, or the OpenGL
-   * default read buffer if none has been specified by the user
-   * (GL_FRONT for single-buffered configurations and GL_BACK for
-   * double-buffered configurations). This is not the fastest
-   * mechanism for taking a screenshot but may be more convenient than
-   * others for getting images for consumption by other packages. The
-   * file format is inferred from the suffix of the given file. <P>
-   *
-   * Note that some file formats, in particular JPEG, can not handle
-   * an alpha channel properly. If the "alpha" argument is specified
-   * as true for such a file format it will be silently ignored.
-   *
-   * @param file the file to write containing the screenshot
-   * @param x the starting x coordinate of the screenshot, measured from the lower-left
-   * @param y the starting y coordinate of the screenshot, measured from the lower-left
-   * @param width the width of the current drawable
-   * @param height the height of the current drawable
-   * @param alpha whether an alpha channel should be saved. If true,
-   *   requires GL_EXT_abgr extension to be present.
-   *
-   * @throws GLException if an OpenGL context was not current or
-   *   another OpenGL-related error occurred
-   *
-   * @throws IOException if an I/O error occurred or if the file could
-   *   not be written to disk due to the requested file format being
-   *   unsupported by ImageIO
-   */
-  public static void writeToFile(File file,
-                                 int x,
-                                 int y,
-                                 int width,
-                                 int height,
-                                 boolean alpha) throws IOException, GLException {
-    String fileSuffix = IOUtil.getFileSuffix(file);
-    if (alpha && (fileSuffix.equals("jpg") || fileSuffix.equals("jpeg"))) {
-      // JPEGs can't deal properly with alpha channels
-      alpha = false;
-    }
-
-    BufferedImage image = readToBufferedImage(x, y, width, height, alpha);
-    if (!ImageIO.write(image, fileSuffix, file)) {
-      throw new IOException("Unsupported file format " + fileSuffix);
-    }
-  }
-
-  private static void checkExtABGR() {
-    GL gl = GLContext.getCurrentGL();
-
-    if (!gl.isExtensionAvailable(GLExtensions.EXT_abgr)) {
-      throw new IllegalArgumentException("Saving alpha channel requires GL_EXT_abgr");
-    }
-  }
-}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
index 46dc730..fc0861e 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextRenderer.java
@@ -40,7 +40,7 @@
 package com.jogamp.opengl.util.awt;
 
 import com.jogamp.common.nio.Buffers;
-
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.opengl.GLExtensions;
 import com.jogamp.opengl.util.*;
 import com.jogamp.opengl.util.packrect.*;
@@ -60,14 +60,12 @@ import java.awt.RenderingHints;
 import java.awt.event.*;
 import java.awt.font.*;
 import java.awt.geom.*;
-
 import java.nio.*;
-
 import java.text.*;
-
 import java.util.*;
 
 import javax.media.opengl.*;
+import javax.media.opengl.fixedfunc.GLPointerFunc;
 import javax.media.opengl.glu.*;
 import javax.media.opengl.awt.*;
 
@@ -132,7 +130,7 @@ public class TextRenderer {
 
     static {
         Debug.initSingleton();
-        DEBUG = Debug.isPropertyDefined("jogl.debug.TextRenderer", true);
+        DEBUG = PropertyAccess.isPropertyDefined("jogl.debug.TextRenderer", true);
     }
 
     // These are occasionally useful for more in-depth debugging
@@ -218,7 +216,7 @@ public class TextRenderer {
 
         @param font the font to render with
     */
-    public TextRenderer(Font font) {
+    public TextRenderer(final Font font) {
         this(font, false, false, null, false);
     }
 
@@ -232,7 +230,7 @@ public class TextRenderer {
         @param font the font to render with
         @param mipmap whether to attempt use of automatic mipmap generation
     */
-    public TextRenderer(Font font, boolean mipmap) {
+    public TextRenderer(final Font font, final boolean mipmap) {
         this(font, false, false, null, mipmap);
     }
 
@@ -249,8 +247,8 @@ public class TextRenderer {
         @param useFractionalMetrics whether to use fractional font
         metrics at the Java 2D level
     */
-    public TextRenderer(Font font, boolean antialiased,
-                        boolean useFractionalMetrics) {
+    public TextRenderer(final Font font, final boolean antialiased,
+                        final boolean useFractionalMetrics) {
         this(font, antialiased, useFractionalMetrics, null, false);
     }
 
@@ -268,8 +266,8 @@ public class TextRenderer {
         @param renderDelegate the render delegate to use to draw the
         text's bitmap, or null to use the default one
     */
-    public TextRenderer(Font font, boolean antialiased,
-                        boolean useFractionalMetrics, RenderDelegate renderDelegate) {
+    public TextRenderer(final Font font, final boolean antialiased,
+                        final boolean useFractionalMetrics, final RenderDelegate renderDelegate) {
         this(font, antialiased, useFractionalMetrics, renderDelegate, false);
     }
 
@@ -290,9 +288,9 @@ public class TextRenderer {
         text's bitmap, or null to use the default one
         @param mipmap whether to attempt use of automatic mipmap generation
     */
-    public TextRenderer(Font font, boolean antialiased,
-                        boolean useFractionalMetrics, RenderDelegate renderDelegate,
-                        boolean mipmap) {
+    public TextRenderer(final Font font, final boolean antialiased,
+                        final boolean useFractionalMetrics, RenderDelegate renderDelegate,
+                        final boolean mipmap) {
         this.font = font;
         this.antialiased = antialiased;
         this.useFractionalMetrics = useFractionalMetrics;
@@ -314,7 +312,7 @@ public class TextRenderer {
     /** Returns the bounding rectangle of the given String, assuming it
         was rendered at the origin. See {@link #getBounds(CharSequence)
         getBounds(CharSequence)}. */
-    public Rectangle2D getBounds(String str) {
+    public Rectangle2D getBounds(final String str) {
         return getBounds((CharSequence) str);
     }
 
@@ -333,12 +331,12 @@ public class TextRenderer {
         {@link java.awt.font.GlyphVector#getPixelBounds getPixelBounds},
         etc.) the returned bounds correspond to, although every effort
         is made to ensure an accurate bound. */
-    public Rectangle2D getBounds(CharSequence str) {
+    public Rectangle2D getBounds(final CharSequence str) {
         // FIXME: this should be more optimized and use the glyph cache
-        Rect r = stringLocations.get(str);
+        final Rect r = stringLocations.get(str);
 
         if (r != null) {
-            TextData data = (TextData) r.getUserData();
+            final TextData data = (TextData) r.getUserData();
 
             // Reconstitute the Java 2D results based on the cached values
             return new Rectangle2D.Double(-data.origin().x, -data.origin().y,
@@ -385,7 +383,7 @@ public class TextRenderer {
         @param height the height of the current on-screen OpenGL drawable
         @throws javax.media.opengl.GLException If an OpenGL context is not current when this method is called
     */
-    public void beginRendering(int width, int height) throws GLException {
+    public void beginRendering(final int width, final int height) throws GLException {
         beginRendering(width, height, true);
     }
 
@@ -405,7 +403,7 @@ public class TextRenderer {
         @param disableDepthTest whether to disable the depth test
         @throws GLException If an OpenGL context is not current when this method is called
     */
-    public void beginRendering(int width, int height, boolean disableDepthTest)
+    public void beginRendering(final int width, final int height, final boolean disableDepthTest)
         throws GLException {
         beginRendering(true, width, height, disableDepthTest);
     }
@@ -432,8 +430,8 @@ public class TextRenderer {
         @param color the new color to use for rendering text
         @throws GLException If an OpenGL context is not current when this method is called
     */
-    public void setColor(Color color) throws GLException {
-        boolean noNeedForFlush = (haveCachedColor && (cachedColor != null) &&
+    public void setColor(final Color color) throws GLException {
+        final boolean noNeedForFlush = (haveCachedColor && (cachedColor != null) &&
                                   color.equals(cachedColor));
 
         if (!noNeedForFlush) {
@@ -460,9 +458,9 @@ public class TextRenderer {
         transparent, 1.0f = completely opaque
         @throws GLException If an OpenGL context is not current when this method is called
     */
-    public void setColor(float r, float g, float b, float a)
+    public void setColor(final float r, final float g, final float b, final float a)
         throws GLException {
-        boolean noNeedForFlush = (haveCachedColor && (cachedColor == null) &&
+        final boolean noNeedForFlush = (haveCachedColor && (cachedColor == null) &&
                                   (r == cachedR) && (g == cachedG) && (b == cachedB) &&
                                   (a == cachedA));
 
@@ -490,14 +488,14 @@ public class TextRenderer {
         @param y the y coordinate at which to draw
         @throws GLException If an OpenGL context is not current when this method is called
     */
-    public void draw(CharSequence str, int x, int y) throws GLException {
+    public void draw(final CharSequence str, final int x, final int y) throws GLException {
         draw3D(str, x, y, 0, 1);
     }
 
     /** Draws the supplied String at the desired location using the
         renderer's current color. See {@link #draw(CharSequence, int,
         int) draw(CharSequence, int, int)}. */
-    public void draw(String str, int x, int y) throws GLException {
+    public void draw(final String str, final int x, final int y) throws GLException {
         draw3D(str, x, y, 0, 1);
     }
 
@@ -513,8 +511,8 @@ public class TextRenderer {
         @param scaleFactor a uniform scale factor applied to the width and height of the drawn rectangle
         @throws GLException If an OpenGL context is not current when this method is called
     */
-    public void draw3D(CharSequence str, float x, float y, float z,
-                       float scaleFactor) {
+    public void draw3D(final CharSequence str, final float x, final float y, final float z,
+                       final float scaleFactor) {
         internal_draw3D(str, x, y, z, scaleFactor);
     }
 
@@ -522,12 +520,12 @@ public class TextRenderer {
         renderer's current color. See {@link #draw3D(CharSequence,
         float, float, float, float) draw3D(CharSequence, float, float,
         float, float)}. */
-    public void draw3D(String str, float x, float y, float z, float scaleFactor) {
+    public void draw3D(final String str, final float x, final float y, final float z, final float scaleFactor) {
         internal_draw3D(str, x, y, z, scaleFactor);
     }
 
     /** Returns the pixel width of the given character. */
-    public float getCharWidth(char inChar) {
+    public float getCharWidth(final char inChar) {
         return mGlyphProducer.getGlyphPixelWidth(inChar);
     }
 
@@ -582,20 +580,20 @@ public class TextRenderer {
     // Internals only below this point
     //
 
-    private static Rectangle2D preNormalize(Rectangle2D src) {
+    private static Rectangle2D preNormalize(final Rectangle2D src) {
         // Need to round to integer coordinates
         // Also give ourselves a little slop around the reported
         // bounds of glyphs because it looks like neither the visual
         // nor the pixel bounds works perfectly well
-        int minX = (int) Math.floor(src.getMinX()) - 1;
-        int minY = (int) Math.floor(src.getMinY()) - 1;
-        int maxX = (int) Math.ceil(src.getMaxX()) + 1;
-        int maxY = (int) Math.ceil(src.getMaxY()) + 1;
+        final int minX = (int) Math.floor(src.getMinX()) - 1;
+        final int minY = (int) Math.floor(src.getMinY()) - 1;
+        final int maxX = (int) Math.ceil(src.getMaxX()) + 1;
+        final int maxY = (int) Math.ceil(src.getMaxY()) + 1;
         return new Rectangle2D.Double(minX, minY, maxX - minX, maxY - minY);
     }
 
 
-    private Rectangle2D normalize(Rectangle2D src) {
+    private Rectangle2D normalize(final Rectangle2D src) {
         // Give ourselves a boundary around each entity on the backing
         // store in order to prevent bleeding of nearby Strings due to
         // the fact that we use linear filtering
@@ -603,7 +601,7 @@ public class TextRenderer {
         // NOTE that this boundary is quite heuristic and is related
         // to how far away in 3D we may view the text --
         // heuristically, 1.5% of the font's height
-        int boundary = (int) Math.max(1, 0.015 * font.getSize());
+        final int boundary = (int) Math.max(1, 0.015 * font.getSize());
 
         return new Rectangle2D.Double((int) Math.floor(src.getMinX() - boundary),
                                       (int) Math.floor(src.getMinY() - boundary),
@@ -612,7 +610,7 @@ public class TextRenderer {
     }
 
     private TextureRenderer getBackingStore() {
-        TextureRenderer renderer = (TextureRenderer) packer.getBackingStore();
+        final TextureRenderer renderer = (TextureRenderer) packer.getBackingStore();
 
         if (renderer != cachedBackingStore) {
             // Backing store changed since last time; discard any cached Graphics2D
@@ -629,7 +627,7 @@ public class TextRenderer {
     }
 
     private Graphics2D getGraphics2D() {
-        TextureRenderer renderer = getBackingStore();
+        final TextureRenderer renderer = getBackingStore();
 
         if (cachedGraphics == null) {
             cachedGraphics = renderer.createGraphics();
@@ -650,9 +648,9 @@ public class TextRenderer {
         return cachedGraphics;
     }
 
-    private void beginRendering(boolean ortho, int width, int height,
-                                boolean disableDepthTestForOrtho) {
-        GL2 gl = GLContext.getCurrentGL().getGL2();
+    private void beginRendering(final boolean ortho, final int width, final int height,
+                                final boolean disableDepthTestForOrtho) {
+        final GL2 gl = GLContext.getCurrentGL().getGL2();
 
         if (DEBUG && !debugged) {
             debug(gl);
@@ -677,8 +675,8 @@ public class TextRenderer {
         if (!haveMaxSize) {
             // Query OpenGL for the maximum texture size and set it in the
             // RectanglePacker to keep it from expanding too large
-            int[] sz = new int[1];
-            gl.glGetIntegerv(GL2.GL_MAX_TEXTURE_SIZE, sz, 0);
+            final int[] sz = new int[1];
+            gl.glGetIntegerv(GL.GL_MAX_TEXTURE_SIZE, sz, 0);
             packer.setMaxSize(sz[0], sz[0]);
             haveMaxSize = true;
         }
@@ -711,12 +709,12 @@ public class TextRenderer {
      * @param ortho
      * @throws GLException
      */
-    private void endRendering(boolean ortho) throws GLException {
+    private void endRendering(final boolean ortho) throws GLException {
         flushGlyphPipeline();
 
         inBeginEndPair = false;
 
-        GL2 gl = GLContext.getCurrentGL().getGL2();
+        final GL2 gl = GLContext.getCurrentGL().getGL2();
 
         // Pop client attrib bits used by the pipelined quad renderer
         gl.glPopClientAttrib();
@@ -726,8 +724,8 @@ public class TextRenderer {
         // binding
         if (getUseVertexArrays() && is15Available(gl)) {
             try {
-                gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
-            } catch (Exception e) {
+                gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+            } catch (final Exception e) {
                 isExtensionAvailable_GL_VERSION_1_5 = false;
             }
         }
@@ -756,8 +754,8 @@ public class TextRenderer {
         // text strings that haven't been used recently
         packer.visit(new RectVisitor() {
                 @Override
-                public void visit(Rect rect) {
-                    TextData data = (TextData) rect.getUserData();
+                public void visit(final Rect rect) {
+                    final TextData data = (TextData) rect.getUserData();
 
                     if (data.used()) {
                         data.clearUsed();
@@ -767,11 +765,11 @@ public class TextRenderer {
                 }
             });
 
-        for (Rect r : deadRects) {
+        for (final Rect r : deadRects) {
             packer.remove(r);
             stringLocations.remove(((TextData) r.getUserData()).string());
 
-            int unicodeToClearFromCache = ((TextData) r.getUserData()).unicodeID;
+            final int unicodeToClearFromCache = ((TextData) r.getUserData()).unicodeID;
 
             if (unicodeToClearFromCache > 0) {
                 mGlyphProducer.clearCacheEntry(unicodeToClearFromCache);
@@ -786,7 +784,7 @@ public class TextRenderer {
         }
 
         // If we removed dead rectangles this cycle, try to do a compaction
-        float frag = packer.verticalFragmentationRatio();
+        final float frag = packer.verticalFragmentationRatio();
 
         if (!deadRects.isEmpty() && (frag > MAX_VERTICAL_FRAGMENTATION)) {
             if (DEBUG) {
@@ -804,10 +802,10 @@ public class TextRenderer {
         }
     }
 
-    private void internal_draw3D(CharSequence str, float x, float y, float z,
-                                 float scaleFactor) {
-        for (Glyph glyph : mGlyphProducer.getGlyphs(str)) {
-            float advance = glyph.draw3D(x, y, z, scaleFactor);
+    private void internal_draw3D(final CharSequence str, float x, final float y, final float z,
+                                 final float scaleFactor) {
+        for (final Glyph glyph : mGlyphProducer.getGlyphs(str)) {
+            final float advance = glyph.draw3D(x, y, z, scaleFactor);
             x += advance * scaleFactor;
         }
     }
@@ -818,8 +816,8 @@ public class TextRenderer {
         }
     }
 
-    private void draw3D_ROBUST(CharSequence str, float x, float y, float z,
-                               float scaleFactor) {
+    private void draw3D_ROBUST(final CharSequence str, final float x, final float y, final float z,
+                               final float scaleFactor) {
         String curStr;
         if (str instanceof String) {
             curStr = (String) str;
@@ -833,9 +831,9 @@ public class TextRenderer {
         if (rect == null) {
             // Rasterize this string and place it on the backing store
             Graphics2D g = getGraphics2D();
-            Rectangle2D origBBox = preNormalize(renderDelegate.getBounds(curStr, font, getFontRenderContext()));
-            Rectangle2D bbox = normalize(origBBox);
-            Point origin = new Point((int) -bbox.getMinX(),
+            final Rectangle2D origBBox = preNormalize(renderDelegate.getBounds(curStr, font, getFontRenderContext()));
+            final Rectangle2D bbox = normalize(origBBox);
+            final Point origin = new Point((int) -bbox.getMinX(),
                                      (int) -bbox.getMinY());
             rect = new Rect(0, 0, (int) bbox.getWidth(),
                             (int) bbox.getHeight(),
@@ -850,8 +848,8 @@ public class TextRenderer {
 
             // OK, should now have an (x, y) for this rectangle; rasterize
             // the String
-            int strx = rect.x() + origin.x;
-            int stry = rect.y() + origin.y;
+            final int strx = rect.x() + origin.x;
+            final int stry = rect.y() + origin.y;
 
             // Clear out the area we're going to draw into
             g.setComposite(AlphaComposite.Clear);
@@ -862,7 +860,7 @@ public class TextRenderer {
             renderDelegate.draw(g, curStr, strx, stry);
 
             if (DRAW_BBOXES) {
-                TextData data = (TextData) rect.getUserData();
+                final TextData data = (TextData) rect.getUserData();
                 // Draw a bounding box on the backing store
                 g.drawRect(strx - data.origOriginX(),
                            stry - data.origOriginY(),
@@ -880,15 +878,15 @@ public class TextRenderer {
         }
 
         // OK, now draw the portion of the backing store to the screen
-        TextureRenderer renderer = getBackingStore();
+        final TextureRenderer renderer = getBackingStore();
 
         // NOTE that the rectangles managed by the packer have their
         // origin at the upper-left but the TextureRenderer's origin is
         // at its lower left!!!
-        TextData data = (TextData) rect.getUserData();
+        final TextData data = (TextData) rect.getUserData();
         data.markUsed();
 
-        Rectangle2D origRect = data.origRect();
+        final Rectangle2D origRect = data.origRect();
 
         // Align the leftmost point of the baseline to the (x, y, z) coordinate requested
         renderer.draw3DRect(x - (scaleFactor * data.origOriginX()),
@@ -902,10 +900,10 @@ public class TextRenderer {
     //----------------------------------------------------------------------
     // Debugging functionality
     //
-    private void debug(GL gl) {
+    private void debug(final GL gl) {
         dbgFrame = new Frame("TextRenderer Debug Output");
 
-        GLCanvas dbgCanvas = new GLCanvas(new GLCapabilities(gl.getGLProfile()));
+        final GLCanvas dbgCanvas = new GLCanvas(new GLCapabilities(gl.getGLProfile()));
         dbgCanvas.setSharedContext(GLContext.getCurrent());
         dbgCanvas.addGLEventListener(new DebugListener(gl, dbgFrame));
         dbgFrame.add(dbgCanvas);
@@ -913,7 +911,7 @@ public class TextRenderer {
         final FPSAnimator anim = new FPSAnimator(dbgCanvas, 10);
         dbgFrame.addWindowListener(new WindowAdapter() {
                 @Override
-                public void windowClosing(WindowEvent e) {
+                public void windowClosing(final WindowEvent e) {
                     // Run this on another thread than the AWT event queue to
                     // make sure the call to Animator.stop() completes before
                     // exiting
@@ -999,11 +997,11 @@ public class TextRenderer {
         CharSequenceIterator() {
         }
 
-        CharSequenceIterator(CharSequence sequence) {
+        CharSequenceIterator(final CharSequence sequence) {
             initFromCharSequence(sequence);
         }
 
-        public void initFromCharSequence(CharSequence sequence) {
+        public void initFromCharSequence(final CharSequence sequence) {
             mSequence = sequence;
             mLength = mSequence.length();
             mCurrentIndex = 0;
@@ -1040,7 +1038,7 @@ public class TextRenderer {
         }
 
         @Override
-        public char setIndex(int position) {
+        public char setIndex(final int position) {
             mCurrentIndex = position;
 
             return current();
@@ -1063,7 +1061,7 @@ public class TextRenderer {
 
         @Override
         public Object clone() {
-            CharSequenceIterator iter = new CharSequenceIterator(mSequence);
+            final CharSequenceIterator iter = new CharSequenceIterator(mSequence);
             iter.mCurrentIndex = mCurrentIndex;
 
             return iter;
@@ -1108,7 +1106,7 @@ public class TextRenderer {
 
         private boolean used; // Whether this text was used recently
 
-        TextData(String str, Point origin, Rectangle2D origRect, int unicodeID) {
+        TextData(final String str, final Point origin, final Rectangle2D origRect, final int unicodeID) {
             this.str = str;
             this.origin = origin;
             this.origRect = origRect;
@@ -1154,7 +1152,7 @@ public class TextRenderer {
         private Graphics2D g;
 
         @Override
-        public Object allocateBackingStore(int w, int h) {
+        public Object allocateBackingStore(final int w, final int h) {
             // FIXME: should consider checking Font's attributes to see
             // whether we're likely to need to support a full RGBA backing
             // store (i.e., non-default Paint, foreground color, etc.), but
@@ -1177,12 +1175,12 @@ public class TextRenderer {
         }
 
         @Override
-        public void deleteBackingStore(Object backingStore) {
+        public void deleteBackingStore(final Object backingStore) {
             ((TextureRenderer) backingStore).dispose();
         }
 
         @Override
-        public boolean preExpand(Rect cause, int attemptNumber) {
+        public boolean preExpand(final Rect cause, final int attemptNumber) {
             // Only try this one time; clear out potentially obsolete entries
             // NOTE: this heuristic and the fact that it clears the used bit
             // of all entries seems to cause cycling of entries in some
@@ -1218,7 +1216,7 @@ public class TextRenderer {
         }
 
         @Override
-        public boolean additionFailed(Rect cause, int attemptNumber) {
+        public boolean additionFailed(final Rect cause, final int attemptNumber) {
             // Heavy hammer -- might consider doing something different
             packer.clear();
             stringLocations.clear();
@@ -1242,13 +1240,13 @@ public class TextRenderer {
         }
 
         @Override
-        public void beginMovement(Object oldBackingStore, Object newBackingStore) {
+        public void beginMovement(final Object oldBackingStore, final Object newBackingStore) {
             // Exit the begin / end pair if necessary
             if (inBeginEndPair) {
                 // Draw any outstanding glyphs
                 flush();
 
-                GL2 gl = GLContext.getCurrentGL().getGL2();
+                final GL2 gl = GLContext.getCurrentGL().getGL2();
 
                 // Pop client attrib bits used by the pipelined quad renderer
                 gl.glPopClientAttrib();
@@ -1258,8 +1256,8 @@ public class TextRenderer {
                 // binding
                 if (getUseVertexArrays() && is15Available(gl)) {
                     try {
-                        gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
-                    } catch (Exception e) {
+                        gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+                    } catch (final Exception e) {
                         isExtensionAvailable_GL_VERSION_1_5 = false;
                     }
                 }
@@ -1271,15 +1269,15 @@ public class TextRenderer {
                 }
             }
 
-            TextureRenderer newRenderer = (TextureRenderer) newBackingStore;
+            final TextureRenderer newRenderer = (TextureRenderer) newBackingStore;
             g = newRenderer.createGraphics();
         }
 
         @Override
-        public void move(Object oldBackingStore, Rect oldLocation,
-                         Object newBackingStore, Rect newLocation) {
-            TextureRenderer oldRenderer = (TextureRenderer) oldBackingStore;
-            TextureRenderer newRenderer = (TextureRenderer) newBackingStore;
+        public void move(final Object oldBackingStore, final Rect oldLocation,
+                         final Object newBackingStore, final Rect newLocation) {
+            final TextureRenderer oldRenderer = (TextureRenderer) oldBackingStore;
+            final TextureRenderer newRenderer = (TextureRenderer) newBackingStore;
 
             if (oldRenderer == newRenderer) {
                 // Movement on the same backing store -- easy case
@@ -1288,7 +1286,7 @@ public class TextRenderer {
                            newLocation.y() - oldLocation.y());
             } else {
                 // Need to draw from the old renderer's image into the new one
-                Image img = oldRenderer.getImage();
+                final Image img = oldRenderer.getImage();
                 g.drawImage(img, newLocation.x(), newLocation.y(),
                             newLocation.x() + newLocation.w(),
                             newLocation.y() + newLocation.h(), oldLocation.x(),
@@ -1298,11 +1296,11 @@ public class TextRenderer {
         }
 
         @Override
-        public void endMovement(Object oldBackingStore, Object newBackingStore) {
+        public void endMovement(final Object oldBackingStore, final Object newBackingStore) {
             g.dispose();
 
             // Sync the whole surface
-            TextureRenderer newRenderer = (TextureRenderer) newBackingStore;
+            final TextureRenderer newRenderer = (TextureRenderer) newBackingStore;
             newRenderer.markDirty(0, 0, newRenderer.getWidth(),
                                   newRenderer.getHeight());
 
@@ -1316,7 +1314,7 @@ public class TextRenderer {
                 }
 
                 // Push client attrib bits used by the pipelined quad renderer
-                GL2 gl = GLContext.getCurrentGL().getGL2();
+                final GL2 gl = GLContext.getCurrentGL().getGL2();
                 gl.glPushClientAttrib((int) GL2.GL_ALL_CLIENT_ATTRIB_BITS);
 
                 if (haveCachedColor) {
@@ -1340,32 +1338,32 @@ public class TextRenderer {
         }
 
         @Override
-        public Rectangle2D getBounds(CharSequence str, Font font,
-                                     FontRenderContext frc) {
+        public Rectangle2D getBounds(final CharSequence str, final Font font,
+                                     final FontRenderContext frc) {
             return getBounds(font.createGlyphVector(frc,
                                                     new CharSequenceIterator(str)),
                              frc);
         }
 
         @Override
-        public Rectangle2D getBounds(String str, Font font,
-                                     FontRenderContext frc) {
+        public Rectangle2D getBounds(final String str, final Font font,
+                                     final FontRenderContext frc) {
             return getBounds(font.createGlyphVector(frc, str), frc);
         }
 
         @Override
-        public Rectangle2D getBounds(GlyphVector gv, FontRenderContext frc) {
+        public Rectangle2D getBounds(final GlyphVector gv, final FontRenderContext frc) {
             return gv.getVisualBounds();
         }
 
         @Override
-        public void drawGlyphVector(Graphics2D graphics, GlyphVector str,
-                                    int x, int y) {
+        public void drawGlyphVector(final Graphics2D graphics, final GlyphVector str,
+                                    final int x, final int y) {
             graphics.drawGlyphVector(str, x, y);
         }
 
         @Override
-        public void draw(Graphics2D graphics, String str, int x, int y) {
+        public void draw(final Graphics2D graphics, final String str, final int x, final int y) {
             graphics.drawString(str, x, y);
         }
     }
@@ -1415,11 +1413,11 @@ public class TextRenderer {
         private boolean needAdvance;
 
         // Creates a Glyph representing an individual Unicode character
-        public Glyph(int unicodeID,
-                     int glyphCode,
-                     float advance,
-                     GlyphVector singleUnicodeGlyphVector,
-                     GlyphProducer producer) {
+        public Glyph(final int unicodeID,
+                     final int glyphCode,
+                     final float advance,
+                     final GlyphVector singleUnicodeGlyphVector,
+                     final GlyphProducer producer) {
             this.unicodeID = unicodeID;
             this.glyphCode = glyphCode;
             this.advance = advance;
@@ -1430,7 +1428,7 @@ public class TextRenderer {
         // Creates a Glyph representing a sequence of characters, with
         // an indication of whether additional single glyphs are being
         // rendered after it
-        public Glyph(String str, boolean needAdvance) {
+        public Glyph(final String str, final boolean needAdvance) {
             this.str = str;
             this.needAdvance = needAdvance;
         }
@@ -1451,14 +1449,14 @@ public class TextRenderer {
         }
 
         /** Draws this glyph and returns the (x) advance for this glyph */
-        public float draw3D(float inX, float inY, float z, float scaleFactor) {
+        public float draw3D(final float inX, final float inY, final float z, final float scaleFactor) {
             if (str != null) {
                 draw3D_ROBUST(str, inX, inY, z, scaleFactor);
                 if (!needAdvance) {
                     return 0;
                 }
                 // Compute and return the advance for this string
-                GlyphVector gv = font.createGlyphVector(getFontRenderContext(), str);
+                final GlyphVector gv = font.createGlyphVector(getFontRenderContext(), str);
                 float totalAdvance = 0;
                 for (int i = 0; i < gv.getNumGlyphs(); i++) {
                     totalAdvance += gv.getGlyphMetrics(i).getAdvance();
@@ -1476,32 +1474,32 @@ public class TextRenderer {
                     mPipelinedQuadRenderer = new Pipelined_QuadRenderer();
                 }
 
-                TextureRenderer renderer = getBackingStore();
+                final TextureRenderer renderer = getBackingStore();
                 // Handles case where NPOT texture is used for backing store
-                TextureCoords wholeImageTexCoords = renderer.getTexture().getImageTexCoords();
-                float xScale = wholeImageTexCoords.right();
-                float yScale = wholeImageTexCoords.bottom();
+                final TextureCoords wholeImageTexCoords = renderer.getTexture().getImageTexCoords();
+                final float xScale = wholeImageTexCoords.right();
+                final float yScale = wholeImageTexCoords.bottom();
 
-                Rect rect = glyphRectForTextureMapping;
-                TextData data = (TextData) rect.getUserData();
+                final Rect rect = glyphRectForTextureMapping;
+                final TextData data = (TextData) rect.getUserData();
                 data.markUsed();
 
-                Rectangle2D origRect = data.origRect();
+                final Rectangle2D origRect = data.origRect();
 
-                float x = inX - (scaleFactor * data.origOriginX());
-                float y = inY - (scaleFactor * ((float) origRect.getHeight() - data.origOriginY()));
+                final float x = inX - (scaleFactor * data.origOriginX());
+                final float y = inY - (scaleFactor * ((float) origRect.getHeight() - data.origOriginY()));
 
-                int texturex = rect.x() + (data.origin().x - data.origOriginX());
-                int texturey = renderer.getHeight() - rect.y() - (int) origRect.getHeight() -
+                final int texturex = rect.x() + (data.origin().x - data.origOriginX());
+                final int texturey = renderer.getHeight() - rect.y() - (int) origRect.getHeight() -
                     (data.origin().y - data.origOriginY());
-                int width = (int) origRect.getWidth();
-                int height = (int) origRect.getHeight();
+                final int width = (int) origRect.getWidth();
+                final int height = (int) origRect.getHeight();
 
-                float tx1 = xScale * texturex / renderer.getWidth();
-                float ty1 = yScale * (1.0f -
+                final float tx1 = xScale * texturex / renderer.getWidth();
+                final float ty1 = yScale * (1.0f -
                                       ((float) texturey / (float) renderer.getHeight()));
-                float tx2 = xScale * (texturex + width) / renderer.getWidth();
-                float ty2 = yScale * (1.0f -
+                final float tx2 = xScale * (texturex + width) / renderer.getWidth();
+                final float ty2 = yScale * (1.0f -
                                       ((float) (texturey + height) / (float) renderer.getHeight()));
 
                 mPipelinedQuadRenderer.glTexCoord2f(tx1, ty1);
@@ -1515,7 +1513,7 @@ public class TextRenderer {
                 mPipelinedQuadRenderer.glTexCoord2f(tx1, ty2);
                 mPipelinedQuadRenderer.glVertex3f(x,
                                                   y + (height * scaleFactor), z);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
             }
             return advance;
@@ -1527,21 +1525,21 @@ public class TextRenderer {
         }
 
         private void upload() {
-            GlyphVector gv = getGlyphVector();
-            Rectangle2D origBBox = preNormalize(renderDelegate.getBounds(gv, getFontRenderContext()));
-            Rectangle2D bbox = normalize(origBBox);
-            Point origin = new Point((int) -bbox.getMinX(),
+            final GlyphVector gv = getGlyphVector();
+            final Rectangle2D origBBox = preNormalize(renderDelegate.getBounds(gv, getFontRenderContext()));
+            final Rectangle2D bbox = normalize(origBBox);
+            final Point origin = new Point((int) -bbox.getMinX(),
                                      (int) -bbox.getMinY());
-            Rect rect = new Rect(0, 0, (int) bbox.getWidth(),
+            final Rect rect = new Rect(0, 0, (int) bbox.getWidth(),
                                  (int) bbox.getHeight(),
                                  new TextData(null, origin, origBBox, unicodeID));
             packer.add(rect);
             glyphRectForTextureMapping = rect;
-            Graphics2D g = getGraphics2D();
+            final Graphics2D g = getGraphics2D();
             // OK, should now have an (x, y) for this rectangle; rasterize
             // the glyph
-            int strx = rect.x() + origin.x;
-            int stry = rect.y() + origin.y;
+            final int strx = rect.x() + origin.x;
+            final int stry = rect.y() + origin.y;
 
             // Clear out the area we're going to draw into
             g.setComposite(AlphaComposite.Clear);
@@ -1552,7 +1550,7 @@ public class TextRenderer {
             renderDelegate.drawGlyphVector(g, gv, strx, stry);
 
             if (DRAW_BBOXES) {
-                TextData data = (TextData) rect.getUserData();
+                final TextData data = (TextData) rect.getUserData();
                 // Draw a bounding box on the backing store
                 g.drawRect(strx - data.origOriginX(),
                            stry - data.origOriginY(),
@@ -1572,7 +1570,7 @@ public class TextRenderer {
         }
 
         private GlyphVector getGlyphVector() {
-            GlyphVector gv = singleUnicodeGlyphVector;
+            final GlyphVector gv = singleUnicodeGlyphVector;
             if (gv != null) {
                 singleUnicodeGlyphVector = null; // Don't need this anymore
                 return gv;
@@ -1583,8 +1581,8 @@ public class TextRenderer {
     }
 
     class GlyphProducer {
-        final int undefined = -2;
-        FontRenderContext fontRenderContext;
+        static final int undefined = -2;
+        final FontRenderContext fontRenderContext = null; // FIXME: Never initialized!
         List<Glyph> glyphsOutput = new ArrayList<Glyph>();
         HashMap<String, GlyphVector> fullGlyphVectorCache = new HashMap<String, GlyphVector>();
         HashMap<Character, GlyphMetrics> glyphMetricsCache = new HashMap<Character, GlyphMetrics>();
@@ -1595,13 +1593,13 @@ public class TextRenderer {
         // We re-use this for each incoming string
         CharSequenceIterator iter = new CharSequenceIterator();
 
-        GlyphProducer(int fontLengthInGlyphs) {
+        GlyphProducer(final int fontLengthInGlyphs) {
             unicodes2Glyphs = new int[512];
             glyphCache = new Glyph[fontLengthInGlyphs];
             clearAllCacheEntries();
         }
 
-        public List<Glyph> getGlyphs(CharSequence inString) {
+        public List<Glyph> getGlyphs(final CharSequence inString) {
             glyphsOutput.clear();
             GlyphVector fullRunGlyphVector;
             fullRunGlyphVector = fullGlyphVectorCache.get(inString.toString());
@@ -1610,30 +1608,30 @@ public class TextRenderer {
                 fullRunGlyphVector = font.createGlyphVector(getFontRenderContext(), iter);
                 fullGlyphVectorCache.put(inString.toString(), fullRunGlyphVector);
             }
-            boolean complex = (fullRunGlyphVector.getLayoutFlags() != 0);
+            final boolean complex = (fullRunGlyphVector.getLayoutFlags() != 0);
             if (complex || DISABLE_GLYPH_CACHE) {
                 // Punt to the robust version of the renderer
                 glyphsOutput.add(new Glyph(inString.toString(), false));
                 return glyphsOutput;
             }
 
-            int lengthInGlyphs = fullRunGlyphVector.getNumGlyphs();
+            final int lengthInGlyphs = fullRunGlyphVector.getNumGlyphs();
             int i = 0;
             while (i < lengthInGlyphs) {
-                Character letter = CharacterCache.valueOf(inString.charAt(i));
+                final Character letter = CharacterCache.valueOf(inString.charAt(i));
                 GlyphMetrics metrics = glyphMetricsCache.get(letter);
                 if (metrics == null) {
                     metrics = fullRunGlyphVector.getGlyphMetrics(i);
                     glyphMetricsCache.put(letter, metrics);
                 }
-                Glyph glyph = getGlyph(inString, metrics, i);
+                final Glyph glyph = getGlyph(inString, metrics, i);
                 if (glyph != null) {
                     glyphsOutput.add(glyph);
                     i++;
                 } else {
                     // Assemble a run of characters that don't fit in
                     // the cache
-                    StringBuilder buf = new StringBuilder();
+                    final StringBuilder buf = new StringBuilder();
                     while (i < lengthInGlyphs &&
                            getGlyph(inString, fullRunGlyphVector.getGlyphMetrics(i), i) == null) {
                         buf.append(inString.charAt(i++));
@@ -1646,10 +1644,10 @@ public class TextRenderer {
             return glyphsOutput;
         }
 
-        public void clearCacheEntry(int unicodeID) {
-            int glyphID = unicodes2Glyphs[unicodeID];
+        public void clearCacheEntry(final int unicodeID) {
+            final int glyphID = unicodes2Glyphs[unicodeID];
             if (glyphID != undefined) {
-                Glyph glyph = glyphCache[glyphID];
+                final Glyph glyph = glyphCache[glyphID];
                 if (glyph != null) {
                     glyph.clear();
                 }
@@ -1664,20 +1662,23 @@ public class TextRenderer {
             }
         }
 
-        public void register(Glyph glyph) {
+        public void register(final Glyph glyph) {
             unicodes2Glyphs[glyph.getUnicodeID()] = glyph.getGlyphCode();
             glyphCache[glyph.getGlyphCode()] = glyph;
         }
 
-        public float getGlyphPixelWidth(char unicodeID) {
-            Glyph glyph = getGlyph(unicodeID);
+        public float getGlyphPixelWidth(final char unicodeID) {
+            final Glyph glyph = getGlyph(unicodeID);
             if (glyph != null) {
                 return glyph.getAdvance();
             }
 
             // Have to do this the hard / uncached way
             singleUnicode[0] = unicodeID;
-            GlyphVector gv = font.createGlyphVector(fontRenderContext,
+            if( null == fontRenderContext ) { // FIXME: Never initialized!
+                throw new InternalError("fontRenderContext never initialized!");
+            }
+            final GlyphVector gv = font.createGlyphVector(fontRenderContext,
                                                                     singleUnicode);
             return gv.getGlyphMetrics(0).getAdvance();
         }
@@ -1685,52 +1686,52 @@ public class TextRenderer {
         // Returns a glyph object for this single glyph. Returns null
         // if the unicode or glyph ID would be out of bounds of the
         // glyph cache.
-        private Glyph getGlyph(CharSequence inString,
-                               GlyphMetrics glyphMetrics,
-                               int index) {
-            char unicodeID = inString.charAt(index);
+        private Glyph getGlyph(final CharSequence inString,
+                               final GlyphMetrics glyphMetrics,
+                               final int index) {
+            final char unicodeID = inString.charAt(index);
 
             if (unicodeID >= unicodes2Glyphs.length) {
                 return null;
             }
 
-            int glyphID = unicodes2Glyphs[unicodeID];
+            final int glyphID = unicodes2Glyphs[unicodeID];
             if (glyphID != undefined) {
                 return glyphCache[glyphID];
             }
 
             // Must fabricate the glyph
             singleUnicode[0] = unicodeID;
-            GlyphVector gv = font.createGlyphVector(getFontRenderContext(), singleUnicode);
+            final GlyphVector gv = font.createGlyphVector(getFontRenderContext(), singleUnicode);
             return getGlyph(unicodeID, gv, glyphMetrics);
         }
 
         // It's unclear whether this variant might produce less
         // optimal results than if we can see the entire GlyphVector
         // for the incoming string
-        private Glyph getGlyph(int unicodeID) {
+        private Glyph getGlyph(final int unicodeID) {
             if (unicodeID >= unicodes2Glyphs.length) {
                 return null;
             }
 
-            int glyphID = unicodes2Glyphs[unicodeID];
+            final int glyphID = unicodes2Glyphs[unicodeID];
             if (glyphID != undefined) {
                 return glyphCache[glyphID];
             }
             singleUnicode[0] = (char) unicodeID;
-            GlyphVector gv = font.createGlyphVector(getFontRenderContext(), singleUnicode);
+            final GlyphVector gv = font.createGlyphVector(getFontRenderContext(), singleUnicode);
             return getGlyph(unicodeID, gv, gv.getGlyphMetrics(0));
         }
 
-        private Glyph getGlyph(int unicodeID,
-                               GlyphVector singleUnicodeGlyphVector,
-                               GlyphMetrics metrics) {
-            int glyphCode = singleUnicodeGlyphVector.getGlyphCode(0);
+        private Glyph getGlyph(final int unicodeID,
+                               final GlyphVector singleUnicodeGlyphVector,
+                               final GlyphMetrics metrics) {
+            final int glyphCode = singleUnicodeGlyphVector.getGlyphCode(0);
             // Have seen huge glyph codes (65536) coming out of some fonts in some Unicode situations
             if (glyphCode >= glyphCache.length) {
                 return null;
             }
-            Glyph glyph = new Glyph(unicodeID,
+            final Glyph glyph = new Glyph(unicodeID,
                                     glyphCode,
                                     metrics.getAdvance(),
                                     singleUnicodeGlyphVector,
@@ -1748,15 +1749,15 @@ public class TextRenderer {
 
         static {
             for (int i = 0; i < cache.length; i++) {
-                cache[i] = new Character((char) i);
+                cache[i] = Character.valueOf((char) i);
             }
         }
 
-        public static Character valueOf(char c) {
+        public static Character valueOf(final char c) {
             if (c <= 127) { // must cache
                 return CharacterCache.cache[c];
             }
-            return new Character(c);
+            return Character.valueOf(c);
         }
     }
 
@@ -1769,7 +1770,7 @@ public class TextRenderer {
         int mVBO_For_ResuableTileTexCoords;
 
         Pipelined_QuadRenderer() {
-            GL2 gl = GLContext.getCurrentGL().getGL2();
+            final GL2 gl = GLContext.getCurrentGL().getGL2();
             mVertCoords = Buffers.newDirectFloatBuffer(kTotalBufferSizeCoordsVerts);
             mTexCoords = Buffers.newDirectFloatBuffer(kTotalBufferSizeCoordsTex);
 
@@ -1777,34 +1778,34 @@ public class TextRenderer {
 
             if (usingVBOs) {
                 try {
-                    int[] vbos = new int[2];
+                    final int[] vbos = new int[2];
                     gl.glGenBuffers(2, IntBuffer.wrap(vbos));
 
                     mVBO_For_ResuableTileVertices = vbos[0];
                     mVBO_For_ResuableTileTexCoords = vbos[1];
 
-                    gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,
+                    gl.glBindBuffer(GL.GL_ARRAY_BUFFER,
                                     mVBO_For_ResuableTileVertices);
-                    gl.glBufferData(GL2.GL_ARRAY_BUFFER, kTotalBufferSizeBytesVerts,
-                                    null, GL2.GL_STREAM_DRAW); // stream draw because this is a single quad use pipeline
+                    gl.glBufferData(GL.GL_ARRAY_BUFFER, kTotalBufferSizeBytesVerts,
+                                    null, GL2ES2.GL_STREAM_DRAW); // stream draw because this is a single quad use pipeline
 
-                    gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,
+                    gl.glBindBuffer(GL.GL_ARRAY_BUFFER,
                                     mVBO_For_ResuableTileTexCoords);
-                    gl.glBufferData(GL2.GL_ARRAY_BUFFER, kTotalBufferSizeBytesTex,
-                                    null, GL2.GL_STREAM_DRAW); // stream draw because this is a single quad use pipeline
-                } catch (Exception e) {
+                    gl.glBufferData(GL.GL_ARRAY_BUFFER, kTotalBufferSizeBytesTex,
+                                    null, GL2ES2.GL_STREAM_DRAW); // stream draw because this is a single quad use pipeline
+                } catch (final Exception e) {
                     isExtensionAvailable_GL_VERSION_1_5 = false;
                     usingVBOs = false;
                 }
             }
         }
 
-        public void glTexCoord2f(float v, float v1) {
+        public void glTexCoord2f(final float v, final float v1) {
             mTexCoords.put(v);
             mTexCoords.put(v1);
         }
 
-        public void glVertex3f(float inX, float inY, float inZ) {
+        public void glVertex3f(final float inX, final float inY, final float inZ) {
             mVertCoords.put(inX);
             mVertCoords.put(inY);
             mVertCoords.put(inZ);
@@ -1826,41 +1827,41 @@ public class TextRenderer {
 
         private void drawVertexArrays() {
             if (mOutstandingGlyphsVerticesPipeline > 0) {
-                GL2 gl = GLContext.getCurrentGL().getGL2();
+                final GL2 gl = GLContext.getCurrentGL().getGL2();
 
-                TextureRenderer renderer = getBackingStore();
+                final TextureRenderer renderer = getBackingStore();
                 renderer.getTexture(); // triggers texture uploads.  Maybe this should be more obvious?
 
                 mVertCoords.rewind();
                 mTexCoords.rewind();
 
-                gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
+                gl.glEnableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
 
                 if (usingVBOs) {
-                    gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,
+                    gl.glBindBuffer(GL.GL_ARRAY_BUFFER,
                                     mVBO_For_ResuableTileVertices);
-                    gl.glBufferSubData(GL2.GL_ARRAY_BUFFER, 0,
+                    gl.glBufferSubData(GL.GL_ARRAY_BUFFER, 0,
                                        mOutstandingGlyphsVerticesPipeline * kSizeInBytes_OneVertices_VertexData,
                                        mVertCoords); // upload only the new stuff
-                    gl.glVertexPointer(3, GL2.GL_FLOAT, 0, 0);
+                    gl.glVertexPointer(3, GL.GL_FLOAT, 0, 0);
                 } else {
-                    gl.glVertexPointer(3, GL2.GL_FLOAT, 0, mVertCoords);
+                    gl.glVertexPointer(3, GL.GL_FLOAT, 0, mVertCoords);
                 }
 
-                gl.glEnableClientState(GL2.GL_TEXTURE_COORD_ARRAY);
+                gl.glEnableClientState(GLPointerFunc.GL_TEXTURE_COORD_ARRAY);
 
                 if (usingVBOs) {
-                    gl.glBindBuffer(GL2.GL_ARRAY_BUFFER,
+                    gl.glBindBuffer(GL.GL_ARRAY_BUFFER,
                                     mVBO_For_ResuableTileTexCoords);
-                    gl.glBufferSubData(GL2.GL_ARRAY_BUFFER, 0,
+                    gl.glBufferSubData(GL.GL_ARRAY_BUFFER, 0,
                                        mOutstandingGlyphsVerticesPipeline * kSizeInBytes_OneVertices_TexData,
                                        mTexCoords); // upload only the new stuff
-                    gl.glTexCoordPointer(2, GL2.GL_FLOAT, 0, 0);
+                    gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, 0);
                 } else {
-                    gl.glTexCoordPointer(2, GL2.GL_FLOAT, 0, mTexCoords);
+                    gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, mTexCoords);
                 }
 
-                gl.glDrawArrays(GL2.GL_QUADS, 0,
+                gl.glDrawArrays(GL2GL3.GL_QUADS, 0,
                                 mOutstandingGlyphsVerticesPipeline);
 
                 mVertCoords.rewind();
@@ -1871,14 +1872,14 @@ public class TextRenderer {
 
         private void drawIMMEDIATE() {
             if (mOutstandingGlyphsVerticesPipeline > 0) {
-                TextureRenderer renderer = getBackingStore();
+                final TextureRenderer renderer = getBackingStore();
                 renderer.getTexture(); // triggers texture uploads.  Maybe this should be more obvious?
 
-                GL2 gl = GLContext.getCurrentGL().getGL2();
-                gl.glBegin(GL2.GL_QUADS);
+                final GL2 gl = GLContext.getCurrentGL().getGL2();
+                gl.glBegin(GL2GL3.GL_QUADS);
 
                 try {
-                    int numberOfQuads = mOutstandingGlyphsVerticesPipeline / 4;
+                    final int numberOfQuads = mOutstandingGlyphsVerticesPipeline / 4;
                     mVertCoords.rewind();
                     mTexCoords.rewind();
 
@@ -1899,7 +1900,7 @@ public class TextRenderer {
                         gl.glVertex3f(mVertCoords.get(), mVertCoords.get(),
                                       mVertCoords.get());
                     }
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     e.printStackTrace();
                 } finally {
                     gl.glEnd();
@@ -1915,21 +1916,21 @@ public class TextRenderer {
         private GLU glu;
         private Frame frame;
 
-        DebugListener(GL gl, Frame frame) {
+        DebugListener(final GL gl, final Frame frame) {
             this.glu = GLU.createGLU(gl);
             this.frame = frame;
         }
 
         @Override
-        public void display(GLAutoDrawable drawable) {
-            GL2 gl = GLContext.getCurrentGL().getGL2();
-            gl.glClear(GL2.GL_DEPTH_BUFFER_BIT | GL2.GL_COLOR_BUFFER_BIT);
+        public void display(final GLAutoDrawable drawable) {
+            final GL2 gl = GLContext.getCurrentGL().getGL2();
+            gl.glClear(GL.GL_DEPTH_BUFFER_BIT | GL.GL_COLOR_BUFFER_BIT);
 
             if (packer == null) {
                 return;
             }
 
-            TextureRenderer rend = getBackingStore();
+            final TextureRenderer rend = getBackingStore();
             final int w = rend.getWidth();
             final int h = rend.getHeight();
             rend.beginOrthoRendering(w, h);
@@ -1947,24 +1948,23 @@ public class TextRenderer {
         }
 
         @Override
-        public void dispose(GLAutoDrawable drawable) {
-            glu.destroy();
+        public void dispose(final GLAutoDrawable drawable) {
             glu=null;
             frame=null;
         }
 
         // Unused methods
         @Override
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
         }
 
         @Override
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width,
-                            int height) {
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width,
+                            final int height) {
         }
 
-        public void displayChanged(GLAutoDrawable drawable,
-                                   boolean modeChanged, boolean deviceChanged) {
+        public void displayChanged(final GLAutoDrawable drawable,
+                                   final boolean modeChanged, final boolean deviceChanged) {
         }
     }
 
@@ -1975,7 +1975,7 @@ public class TextRenderer {
      * certain graphics cards which have poor vertex array
      * performance. Defaults to true.
      */
-    public void setUseVertexArrays(boolean useVertexArrays) {
+    public void setUseVertexArrays(final boolean useVertexArrays) {
         this.useVertexArrays = useVertexArrays;
     }
 
@@ -1994,7 +1994,7 @@ public class TextRenderer {
      * graphics cards do not behave well when this is enabled,
      * resulting in fuzzy text. Defaults to true.
      */
-    public void setSmoothing(boolean smoothing) {
+    public void setSmoothing(final boolean smoothing) {
         this.smoothing = smoothing;
         getBackingStore().setSmoothing(smoothing);
     }
@@ -2009,7 +2009,7 @@ public class TextRenderer {
         return smoothing;
     }
 
-    private final boolean is15Available(GL gl) {
+    private final boolean is15Available(final GL gl) {
         if (!checkFor_isExtensionAvailable_GL_VERSION_1_5) {
             isExtensionAvailable_GL_VERSION_1_5 = gl.isExtensionAvailable(GLExtensions.VERSION_1_5);
             checkFor_isExtensionAvailable_GL_VERSION_1_5 = true;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java
index 26e1eb0..ef59f9f 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/awt/TextureRenderer.java
@@ -48,7 +48,10 @@ import java.awt.Rectangle;
 import java.awt.image.*;
 
 import javax.media.opengl.*;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 import javax.media.opengl.glu.gl2.*;
+
 import com.jogamp.opengl.util.texture.*;
 import com.jogamp.opengl.util.texture.awt.*;
 
@@ -70,10 +73,10 @@ public class TextureRenderer {
   // appropriate threads, which would be somewhat unfortunate.
 
   // Whether we have an alpha channel in the (RGB/A) backing store
-  private boolean alpha;
+  private final boolean alpha;
 
   // Whether we're using only a GL_INTENSITY backing store
-  private boolean intensity;
+  private final boolean intensity;
 
   // Whether we're attempting to use automatic mipmap generation support
   private boolean mipmap;
@@ -91,7 +94,7 @@ public class TextureRenderer {
   private boolean mustReallocateTexture;
   private Rectangle dirtyRegion;
 
-  private GLUgl2 glu = new GLUgl2();
+  private final GLUgl2 glu = new GLUgl2();
 
   // Current color
   private float r = 1.0f;
@@ -108,7 +111,7 @@ public class TextureRenderer {
       @param height the height of the texture to render into
       @param alpha whether to allocate an alpha channel for the texture
   */
-  public TextureRenderer(int width, int height, boolean alpha) {
+  public TextureRenderer(final int width, final int height, final boolean alpha) {
     this(width, height, alpha, false);
   }
 
@@ -123,13 +126,13 @@ public class TextureRenderer {
       @param alpha whether to allocate an alpha channel for the texture
       @param mipmap whether to attempt use of automatic mipmap generation
   */
-  public TextureRenderer(int width, int height, boolean alpha, boolean mipmap) {
+  public TextureRenderer(final int width, final int height, final boolean alpha, final boolean mipmap) {
     this(width, height, alpha, false, mipmap);
   }
 
   // Internal constructor to avoid confusion since alpha only makes
   // sense when intensity is not set
-  private TextureRenderer(int width, int height, boolean alpha, boolean intensity, boolean mipmap) {
+  private TextureRenderer(final int width, final int height, final boolean alpha, final boolean intensity, final boolean mipmap) {
     this.alpha = alpha;
     this.intensity = intensity;
     this.mipmap = mipmap;
@@ -140,7 +143,7 @@ public class TextureRenderer {
       which acts only as an alpha channel. No mipmap support is
       requested. Internally, this associates a GL_INTENSITY OpenGL
       texture with the backing store. */
-  public static TextureRenderer createAlphaOnlyRenderer(int width, int height) {
+  public static TextureRenderer createAlphaOnlyRenderer(final int width, final int height) {
     return createAlphaOnlyRenderer(width, height, false);
   }
 
@@ -150,7 +153,7 @@ public class TextureRenderer {
       better smoothing when rendering the TextureRenderer's contents
       at a distance. Internally, this associates a GL_INTENSITY OpenGL
       texture with the backing store. */
-  public static TextureRenderer createAlphaOnlyRenderer(int width, int height, boolean mipmap) {
+  public static TextureRenderer createAlphaOnlyRenderer(final int width, final int height, final boolean mipmap) {
     return new TextureRenderer(width, height, false, true, mipmap);
   }
 
@@ -205,7 +208,7 @@ public class TextureRenderer {
       @param height the new height of the backing store of this renderer
       @throws GLException If an OpenGL context is not current when this method is called
   */
-  public void setSize(int width, int height) throws GLException {
+  public void setSize(final int width, final int height) throws GLException {
     init(width, height);
   }
 
@@ -216,7 +219,7 @@ public class TextureRenderer {
       @param d the new size of the backing store of this renderer
       @throws GLException If an OpenGL context is not current when this method is called
   */
-  public void setSize(Dimension d) throws GLException {
+  public void setSize(final Dimension d) throws GLException {
     setSize(d.width, d.height);
   }
 
@@ -228,7 +231,7 @@ public class TextureRenderer {
 
       @param smoothing whether smoothing is enabled for the OpenGL texture
   */
-  public void setSmoothing(boolean smoothing) {
+  public void setSmoothing(final boolean smoothing) {
     this.smoothing = smoothing;
     smoothingChanged = true;
   }
@@ -275,8 +278,8 @@ public class TextureRenderer {
       @param width the width of the region to update
       @param height the height of the region to update
   */
-  public void markDirty(int x, int y, int width, int height) {
-    Rectangle curRegion = new Rectangle(x, y, width, height);
+  public void markDirty(final int x, final int y, final int width, final int height) {
+    final Rectangle curRegion = new Rectangle(x, y, width, height);
     if (dirtyRegion == null) {
       dirtyRegion = curRegion;
     } else {
@@ -333,7 +336,7 @@ public class TextureRenderer {
 
       @throws GLException If an OpenGL context is not current when this method is called
   */
-  public void beginOrthoRendering(int width, int height) throws GLException {
+  public void beginOrthoRendering(final int width, final int height) throws GLException {
     beginOrthoRendering(width, height, true);
   }
 
@@ -355,7 +358,7 @@ public class TextureRenderer {
 
       @throws GLException If an OpenGL context is not current when this method is called
   */
-  public void beginOrthoRendering(int width, int height, boolean disableDepthTest) throws GLException {
+  public void beginOrthoRendering(final int width, final int height, final boolean disableDepthTest) throws GLException {
     beginRendering(true, width, height, disableDepthTest);
   }
 
@@ -399,8 +402,8 @@ public class TextureRenderer {
         transparent, 1.0f = completely opaque
       @throws GLException If an OpenGL context is not current when this method is called
   */
-  public void setColor(float r, float g, float b, float a) throws GLException {
-    GL2 gl = GLContext.getCurrentGL().getGL2();
+  public void setColor(final float r, final float g, final float b, final float a) throws GLException {
+    final GL2 gl = GLContext.getCurrentGL().getGL2();
     this.r = r * a;
     this.g = g * a;
     this.b = b * a;
@@ -417,7 +420,7 @@ public class TextureRenderer {
       @param color the new color to use for rendering
       @throws GLException If an OpenGL context is not current when this method is called
   */
-  public void setColor(Color color) throws GLException {
+  public void setColor(final Color color) throws GLException {
     // Get color's RGBA components as floats in the range [0,1].
     if (compArray == null) {
       compArray = new float[4];
@@ -440,7 +443,7 @@ public class TextureRenderer {
 
       @throws GLException If an OpenGL context is not current when this method is called
   */
-  public void drawOrthoRect(int screenx, int screeny) throws GLException {
+  public void drawOrthoRect(final int screenx, final int screeny) throws GLException {
     drawOrthoRect(screenx, screeny, 0, 0, getWidth(), getHeight());
   }
 
@@ -462,9 +465,9 @@ public class TextureRenderer {
 
       @throws GLException If an OpenGL context is not current when this method is called
   */
-  public void drawOrthoRect(int screenx, int screeny,
-                            int texturex, int texturey,
-                            int width, int height) throws GLException {
+  public void drawOrthoRect(final int screenx, final int screeny,
+                            final int texturex, final int texturey,
+                            final int width, final int height) throws GLException {
     draw3DRect(screenx, screeny, 0, texturex, texturey, width, height, 1);
   }
 
@@ -493,16 +496,16 @@ public class TextureRenderer {
 
       @throws GLException If an OpenGL context is not current when this method is called
   */
-  public void draw3DRect(float x, float y, float z,
-                         int texturex, int texturey,
-                         int width, int height,
-                         float scaleFactor) throws GLException {
-    GL2 gl = GLContext.getCurrentGL().getGL2();
-    Texture texture = getTexture();
-    TextureCoords coords = texture.getSubImageTexCoords(texturex, texturey,
+  public void draw3DRect(final float x, final float y, final float z,
+                         final int texturex, final int texturey,
+                         final int width, final int height,
+                         final float scaleFactor) throws GLException {
+    final GL2 gl = GLContext.getCurrentGL().getGL2();
+    final Texture texture = getTexture();
+    final TextureCoords coords = texture.getSubImageTexCoords(texturex, texturey,
                                                         texturex + width,
                                                         texturey + height);
-    gl.glBegin(GL2.GL_QUADS);
+    gl.glBegin(GL2GL3.GL_QUADS);
     gl.glTexCoord2f(coords.left(), coords.bottom());
     gl.glVertex3f(x, y, z);
     gl.glTexCoord2f(coords.right(), coords.bottom());
@@ -550,70 +553,70 @@ public class TextureRenderer {
   // Internals only below this point
   //
 
-  private void beginRendering(boolean ortho, int width, int height, boolean disableDepthTestForOrtho) {
-    GL2 gl = GLContext.getCurrentGL().getGL2();
-    int attribBits =
-      GL2.GL_ENABLE_BIT | GL2.GL_TEXTURE_BIT | GL2.GL_COLOR_BUFFER_BIT |
-      (ortho ? (GL2.GL_DEPTH_BUFFER_BIT | GL2.GL_TRANSFORM_BIT) : 0);
+  private void beginRendering(final boolean ortho, final int width, final int height, final boolean disableDepthTestForOrtho) {
+    final GL2 gl = GLContext.getCurrentGL().getGL2();
+    final int attribBits =
+      GL2.GL_ENABLE_BIT | GL2.GL_TEXTURE_BIT | GL.GL_COLOR_BUFFER_BIT |
+      (ortho ? (GL.GL_DEPTH_BUFFER_BIT | GL2.GL_TRANSFORM_BIT) : 0);
     gl.glPushAttrib(attribBits);
-    gl.glDisable(GL2.GL_LIGHTING);
+    gl.glDisable(GLLightingFunc.GL_LIGHTING);
     if (ortho) {
       if (disableDepthTestForOrtho) {
-        gl.glDisable(GL2.GL_DEPTH_TEST);
+        gl.glDisable(GL.GL_DEPTH_TEST);
       }
-      gl.glDisable(GL2.GL_CULL_FACE);
-      gl.glMatrixMode(GL2.GL_PROJECTION);
+      gl.glDisable(GL.GL_CULL_FACE);
+      gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
       gl.glPushMatrix();
       gl.glLoadIdentity();
       glu.gluOrtho2D(0, width, 0, height);
-      gl.glMatrixMode(GL2.GL_MODELVIEW);
+      gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
       gl.glPushMatrix();
       gl.glLoadIdentity();
-      gl.glMatrixMode(GL2.GL_TEXTURE);
+      gl.glMatrixMode(GL.GL_TEXTURE);
       gl.glPushMatrix();
       gl.glLoadIdentity();
     }
-    gl.glEnable(GL2.GL_BLEND);
-    gl.glBlendFunc(GL2.GL_ONE, GL2.GL_ONE_MINUS_SRC_ALPHA);
-    Texture texture = getTexture();
+    gl.glEnable(GL.GL_BLEND);
+    gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
+    final Texture texture = getTexture();
     texture.enable(gl);
     texture.bind(gl);
-    gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_MODULATE);
+    gl.glTexEnvi(GL2ES1.GL_TEXTURE_ENV, GL2ES1.GL_TEXTURE_ENV_MODE, GL2ES1.GL_MODULATE);
     // Change polygon color to last saved
     gl.glColor4f(r, g, b, a);
     if (smoothingChanged) {
       smoothingChanged = false;
       if (smoothing) {
-        texture.setTexParameteri(gl, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_LINEAR);
+        texture.setTexParameteri(gl, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
         if (mipmap) {
-          texture.setTexParameteri(gl, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR_MIPMAP_LINEAR);
+          texture.setTexParameteri(gl, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR_MIPMAP_LINEAR);
         } else {
-          texture.setTexParameteri(gl, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_LINEAR);
+          texture.setTexParameteri(gl, GL.GL_TEXTURE_MIN_FILTER, GL.GL_LINEAR);
         }
       } else {
-        texture.setTexParameteri(gl, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_NEAREST);
-        texture.setTexParameteri(gl, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_NEAREST);
+        texture.setTexParameteri(gl, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
+        texture.setTexParameteri(gl, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
       }
     }
   }
 
-  private void endRendering(boolean ortho) {
-    GL2 gl = GLContext.getCurrentGL().getGL2();
-    Texture texture = getTexture();
+  private void endRendering(final boolean ortho) {
+    final GL2 gl = GLContext.getCurrentGL().getGL2();
+    final Texture texture = getTexture();
     texture.disable(gl);
     if (ortho) {
-      gl.glMatrixMode(GL2.GL_PROJECTION);
+      gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
       gl.glPopMatrix();
-      gl.glMatrixMode(GL2.GL_MODELVIEW);
+      gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
       gl.glPopMatrix();
-      gl.glMatrixMode(GL2.GL_TEXTURE);
+      gl.glMatrixMode(GL.GL_TEXTURE);
       gl.glPopMatrix();
     }
     gl.glPopAttrib();
   }
 
-  private void init(int width, int height) {
-    GL2 gl = GLContext.getCurrentGL().getGL2();
+  private void init(final int width, final int height) {
+    final GL2 gl = GLContext.getCurrentGL().getGL2();
     // Discard previous BufferedImage if any
     if (image != null) {
       image.flush();
@@ -621,8 +624,8 @@ public class TextureRenderer {
     }
 
     // Infer the internal format if not an intensity texture
-    int internalFormat = (intensity ? GL2.GL_INTENSITY : 0);
-    int imageType =
+    final int internalFormat = (intensity ? GL2.GL_INTENSITY : 0);
+    final int imageType =
       (intensity ? BufferedImage.TYPE_BYTE_GRAY :
        (alpha ?  BufferedImage.TYPE_INT_ARGB_PRE : BufferedImage.TYPE_INT_RGB));
     image = new BufferedImage(width, height, imageType);
@@ -650,9 +653,9 @@ public class TextureRenderer {
 
       @throws GLException If an OpenGL context is not current when this method is called
   */
-  private void sync(int x, int y, int width, int height) throws GLException {
+  private void sync(final int x, final int y, final int width, final int height) throws GLException {
     // Force allocation if necessary
-    boolean canSkipUpdate = ensureTexture();
+    final boolean canSkipUpdate = ensureTexture();
 
     if (!canSkipUpdate) {
       // Update specified region.
@@ -667,7 +670,7 @@ public class TextureRenderer {
 
   // Returns true if the texture was newly allocated, false if not
   private boolean ensureTexture() {
-    GL gl = GLContext.getCurrentGL();
+    final GL gl = GLContext.getCurrentGL();
     if (mustReallocateTexture) {
       if (texture != null) {
         texture.destroy(gl);
@@ -688,8 +691,8 @@ public class TextureRenderer {
 
       if (!smoothing) {
         // The TextureIO classes default to GL_LINEAR filtering
-        texture.setTexParameteri(gl, GL2.GL_TEXTURE_MIN_FILTER, GL2.GL_NEAREST);
-        texture.setTexParameteri(gl, GL2.GL_TEXTURE_MAG_FILTER, GL2.GL_NEAREST);
+        texture.setTexParameteri(gl, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
+        texture.setTexParameteri(gl, GL.GL_TEXTURE_MAG_FILTER, GL.GL_NEAREST);
       }
       return true;
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java
index e8df6aa..1f05521 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapCharRec.java
@@ -53,12 +53,12 @@ class BitmapCharRec {
   public float advance;
   public byte[] bitmap;
 
-  public BitmapCharRec(int width,
-                int height,
-                float xorig,
-                float yorig,
-                float advance,
-                byte[] bitmap) {
+  public BitmapCharRec(final int width,
+                final int height,
+                final float xorig,
+                final float yorig,
+                final float advance,
+                final byte[] bitmap) {
     this.width   = width;
     this.height  = height;
     this.xorig   = xorig;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java
index d4ee12b..7b84187 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/BitmapFontRec.java
@@ -51,10 +51,10 @@ class BitmapFontRec {
   public int first;
   public BitmapCharRec[] ch;
 
-  public BitmapFontRec(String name,
-                int num_chars,
-                int first,
-                BitmapCharRec[] ch) {
+  public BitmapFontRec(final String name,
+                final int num_chars,
+                final int first,
+                final BitmapCharRec[] ch) {
     this.name = name;
     this.num_chars = num_chars;
     this.first = first;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java
index 5e26e0d..d79f166 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/CoordRec.java
@@ -49,7 +49,7 @@ class CoordRec {
   public float x;
   public float y;
 
-  public CoordRec(float x, float y) {
+  public CoordRec(final float x, final float y) {
     this.x = x;
     this.y = y;
   }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java
index 42529f3..92cbd66 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUT.java
@@ -40,6 +40,7 @@
 package com.jogamp.opengl.util.gl2;
 
 import javax.media.opengl.*;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
 import javax.media.opengl.glu.*;
 import javax.media.opengl.glu.gl2.*;
 
@@ -103,13 +104,13 @@ public class GLUT {
   public static final int BITMAP_HELVETICA_12 = 7;
   public static final int BITMAP_HELVETICA_18 = 8;
 
-  private GLUgl2 glu = new GLUgl2();
+  private final GLUgl2 glu = new GLUgl2();
 
   //----------------------------------------------------------------------
   // Shapes
   //
 
-  public void glutWireSphere(double radius, int slices, int stacks) {
+  public void glutWireSphere(final double radius, final int slices, final int stacks) {
     quadObjInit(glu);
     glu.gluQuadricDrawStyle(quadObj, GLU.GLU_LINE);
     glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
@@ -119,7 +120,7 @@ public class GLUT {
     glu.gluSphere(quadObj, radius, slices, stacks);
   }
 
-  public void glutSolidSphere(double radius, int slices, int stacks) {
+  public void glutSolidSphere(final double radius, final int slices, final int stacks) {
     quadObjInit(glu);
     glu.gluQuadricDrawStyle(quadObj, GLU.GLU_FILL);
     glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
@@ -129,8 +130,8 @@ public class GLUT {
     glu.gluSphere(quadObj, radius, slices, stacks);
   }
 
-  public void glutWireCone(double base, double height,
-                           int slices, int stacks) {
+  public void glutWireCone(final double base, final double height,
+                           final int slices, final int stacks) {
     quadObjInit(glu);
     glu.gluQuadricDrawStyle(quadObj, GLU.GLU_LINE);
     glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
@@ -140,8 +141,8 @@ public class GLUT {
     glu.gluCylinder(quadObj, base, 0.0, height, slices, stacks);
   }
 
-  public void glutSolidCone(double base, double height,
-                            int slices, int stacks) {
+  public void glutSolidCone(final double base, final double height,
+                            final int slices, final int stacks) {
     quadObjInit(glu);
     glu.gluQuadricDrawStyle(quadObj, GLU.GLU_FILL);
     glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
@@ -151,7 +152,7 @@ public class GLUT {
     glu.gluCylinder(quadObj, base, 0.0, height, slices, stacks);
   }
 
-  public void glutWireCylinder(double radius, double height, int slices, int stacks) {
+  public void glutWireCylinder(final double radius, final double height, final int slices, final int stacks) {
     quadObjInit(glu);
     glu.gluQuadricDrawStyle(quadObj, GLU.GLU_LINE);
     glu.gluQuadricNormals(quadObj, GLU.GLU_SMOOTH);
@@ -161,13 +162,13 @@ public class GLUT {
     glu.gluCylinder(quadObj, radius, radius, height, slices, stacks);
   }
 
-  public void glutSolidCylinder(double radius, double height, int slices, int stacks) {
-    GL2 gl = GLUgl2.getCurrentGL2();
+  public void glutSolidCylinder(final double radius, final double height, final int slices, final int stacks) {
+    final GL2 gl = GLUgl2.getCurrentGL2();
 
     // Prepare table of points for drawing end caps
-    double [] x = new double[slices];
-    double [] y = new double[slices];
-    double angleDelta = Math.PI * 2 / slices;
+    final double [] x = new double[slices];
+    final double [] y = new double[slices];
+    final double angleDelta = Math.PI * 2 / slices;
     double angle = 0;
     for (int i = 0 ; i < slices ; i ++) {
       angle = i * angleDelta;
@@ -176,7 +177,7 @@ public class GLUT {
     }
 
     // Draw bottom cap
-    gl.glBegin(GL2.GL_TRIANGLE_FAN);
+    gl.glBegin(GL.GL_TRIANGLE_FAN);
     gl.glNormal3d(0,0,-1);
     gl.glVertex3d(0,0,0);
     for (int i = 0 ; i < slices ; i ++) {
@@ -186,7 +187,7 @@ public class GLUT {
     gl.glEnd();
 
     // Draw top cap
-    gl.glBegin(GL2.GL_TRIANGLE_FAN);
+    gl.glBegin(GL.GL_TRIANGLE_FAN);
     gl.glNormal3d(0,0,1);
     gl.glVertex3d(0,0,height);
     for (int i = 0 ; i < slices ; i ++) {
@@ -205,58 +206,58 @@ public class GLUT {
     glu.gluCylinder(quadObj, radius, radius, height, slices, stacks);
   }
 
-  public void glutWireCube(float size) {
-    drawBox(GLUgl2.getCurrentGL2(), size, GL2.GL_LINE_LOOP);
+  public void glutWireCube(final float size) {
+    drawBox(GLUgl2.getCurrentGL2(), size, GL.GL_LINE_LOOP);
   }
 
-  public void glutSolidCube(float size) {
-    drawBox(GLUgl2.getCurrentGL2(), size, GL2.GL_QUADS);
+  public void glutSolidCube(final float size) {
+    drawBox(GLUgl2.getCurrentGL2(), size, GL2GL3.GL_QUADS);
   }
 
-  public void glutWireTorus(double innerRadius, double outerRadius,
-                            int nsides, int rings) {
-    GL2 gl = GLUgl2.getCurrentGL2();
+  public void glutWireTorus(final double innerRadius, final double outerRadius,
+                            final int nsides, final int rings) {
+    final GL2 gl = GLUgl2.getCurrentGL2();
     gl.glPushAttrib(GL2.GL_POLYGON_BIT);
-    gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
+    gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_LINE);
     doughnut(gl, innerRadius, outerRadius, nsides, rings);
     gl.glPopAttrib();
   }
 
-  public void glutSolidTorus(double innerRadius, double outerRadius,
-                             int nsides, int rings) {
+  public void glutSolidTorus(final double innerRadius, final double outerRadius,
+                             final int nsides, final int rings) {
     doughnut(GLUgl2.getCurrentGL2(), innerRadius, outerRadius, nsides, rings);
   }
 
   public void glutWireDodecahedron() {
-    dodecahedron(GLUgl2.getCurrentGL2(), GL2.GL_LINE_LOOP);
+    dodecahedron(GLUgl2.getCurrentGL2(), GL.GL_LINE_LOOP);
   }
 
   public void glutSolidDodecahedron() {
-    dodecahedron(GLUgl2.getCurrentGL2(), GL2.GL_TRIANGLE_FAN);
+    dodecahedron(GLUgl2.getCurrentGL2(), GL.GL_TRIANGLE_FAN);
   }
 
   public void glutWireOctahedron() {
-    octahedron(GLUgl2.getCurrentGL2(), GL2.GL_LINE_LOOP);
+    octahedron(GLUgl2.getCurrentGL2(), GL.GL_LINE_LOOP);
   }
 
   public void glutSolidOctahedron() {
-    octahedron(GLUgl2.getCurrentGL2(), GL2.GL_TRIANGLES);
+    octahedron(GLUgl2.getCurrentGL2(), GL.GL_TRIANGLES);
   }
 
   public void glutWireIcosahedron() {
-    icosahedron(GLUgl2.getCurrentGL2(), GL2.GL_LINE_LOOP);
+    icosahedron(GLUgl2.getCurrentGL2(), GL.GL_LINE_LOOP);
   }
 
   public void glutSolidIcosahedron() {
-    icosahedron(GLUgl2.getCurrentGL2(), GL2.GL_TRIANGLES);
+    icosahedron(GLUgl2.getCurrentGL2(), GL.GL_TRIANGLES);
   }
 
   public void glutWireTetrahedron() {
-    tetrahedron(GLUgl2.getCurrentGL2(), GL2.GL_LINE_LOOP);
+    tetrahedron(GLUgl2.getCurrentGL2(), GL.GL_LINE_LOOP);
   }
 
   public void glutSolidTetrahedron() {
-    tetrahedron(GLUgl2.getCurrentGL2(), GL2.GL_TRIANGLES);
+    tetrahedron(GLUgl2.getCurrentGL2(), GL.GL_TRIANGLES);
   }
 
 /**
@@ -266,7 +267,7 @@ public class GLUT {
    * @param scale
    *        the factor by which to scale the teapot
    */
-  public void glutSolidTeapot(double scale) {
+  public void glutSolidTeapot(final double scale) {
     glutSolidTeapot(scale, true);
   }
 
@@ -285,8 +286,8 @@ public class GLUT {
    *        whether to create the teapot in exactly the same way as in the C
    *        implementation of GLUT
    */
-  public void glutSolidTeapot(double scale, boolean cStyle) {
-    teapot(GLUgl2.getCurrentGL2(), 14, scale, GL2.GL_FILL, cStyle);
+  public void glutSolidTeapot(final double scale, final boolean cStyle) {
+    teapot(GLUgl2.getCurrentGL2(), 14, scale, GL2GL3.GL_FILL, cStyle);
   }
 
   /**
@@ -296,7 +297,7 @@ public class GLUT {
    * @param scale
    *        the factor by which to scale the teapot
    */
-  public void glutWireTeapot(double scale) {
+  public void glutWireTeapot(final double scale) {
     glutWireTeapot(scale, true);
   }
 
@@ -315,22 +316,22 @@ public class GLUT {
    *        whether to create the teapot in exactly the same way as in the C
    *        implementation of GLUT
    */
-  public void glutWireTeapot(double scale, boolean cStyle) {
-    teapot(GLUgl2.getCurrentGL2(), 10, scale, GL2.GL_LINE, cStyle);
+  public void glutWireTeapot(final double scale, final boolean cStyle) {
+    teapot(GLUgl2.getCurrentGL2(), 10, scale, GL2GL3.GL_LINE, cStyle);
   }
 
   //----------------------------------------------------------------------
   // Fonts
   //
 
-  public void glutBitmapCharacter(int font, char character) {
-    GL2 gl = GLUgl2.getCurrentGL2();
-    int[] swapbytes  = new int[1];
-    int[] lsbfirst   = new int[1];
-    int[] rowlength  = new int[1];
-    int[] skiprows   = new int[1];
-    int[] skippixels = new int[1];
-    int[] alignment  = new int[1];
+  public void glutBitmapCharacter(final int font, final char character) {
+    final GL2 gl = GLUgl2.getCurrentGL2();
+    final int[] swapbytes  = new int[1];
+    final int[] lsbfirst   = new int[1];
+    final int[] rowlength  = new int[1];
+    final int[] skiprows   = new int[1];
+    final int[] skippixels = new int[1];
+    final int[] alignment  = new int[1];
     beginBitmap(gl,
                 swapbytes,
                 lsbfirst,
@@ -348,14 +349,14 @@ public class GLUT {
               alignment);
   }
 
-  public void glutBitmapString   (int font, String string) {
-    GL2 gl = GLUgl2.getCurrentGL2();
-    int[] swapbytes  = new int[1];
-    int[] lsbfirst   = new int[1];
-    int[] rowlength  = new int[1];
-    int[] skiprows   = new int[1];
-    int[] skippixels = new int[1];
-    int[] alignment  = new int[1];
+  public void glutBitmapString   (final int font, final String string) {
+    final GL2 gl = GLUgl2.getCurrentGL2();
+    final int[] swapbytes  = new int[1];
+    final int[] lsbfirst   = new int[1];
+    final int[] rowlength  = new int[1];
+    final int[] skiprows   = new int[1];
+    final int[] skippixels = new int[1];
+    final int[] alignment  = new int[1];
     beginBitmap(gl,
                 swapbytes,
                 lsbfirst,
@@ -363,7 +364,7 @@ public class GLUT {
                 skiprows,
                 skippixels,
                 alignment);
-    int len = string.length();
+    final int len = string.length();
     for (int i = 0; i < len; i++) {
       bitmapCharacterImpl(gl, font, string.charAt(i));
     }
@@ -376,31 +377,31 @@ public class GLUT {
               alignment);
   }
 
-  public int  glutBitmapWidth    (int font, char character) {
-    BitmapFontRec fontinfo = getBitmapFont(font);
-    int c = character & 0xFFFF;
+  public int  glutBitmapWidth    (final int font, final char character) {
+    final BitmapFontRec fontinfo = getBitmapFont(font);
+    final int c = character & 0xFFFF;
     if (c < fontinfo.first || c >= fontinfo.first + fontinfo.num_chars)
       return 0;
-    BitmapCharRec ch = fontinfo.ch[c - fontinfo.first];
+    final BitmapCharRec ch = fontinfo.ch[c - fontinfo.first];
     if (ch != null)
       return (int) ch.advance;
     else
       return 0;
   }
 
-  public void glutStrokeCharacter(int font, char character) {
-    GL2 gl = GLUgl2.getCurrentGL2();
-    StrokeFontRec fontinfo = getStrokeFont(font);
-    int c = character & 0xFFFF;
+  public void glutStrokeCharacter(final int font, final char character) {
+    final GL2 gl = GLUgl2.getCurrentGL2();
+    final StrokeFontRec fontinfo = getStrokeFont(font);
+    final int c = character & 0xFFFF;
     if (c < 0 || c >= fontinfo.num_chars)
       return;
-    StrokeCharRec ch = fontinfo.ch[c];
+    final StrokeCharRec ch = fontinfo.ch[c];
     if (ch != null) {
       for (int i = 0; i < ch.num_strokes; i++) {
-        StrokeRec stroke = ch.stroke[i];
-        gl.glBegin(GL2.GL_LINE_STRIP);
+        final StrokeRec stroke = ch.stroke[i];
+        gl.glBegin(GL.GL_LINE_STRIP);
         for (int j = 0; j < stroke.num_coords; j++) {
-          CoordRec coord = stroke.coord[j];
+          final CoordRec coord = stroke.coord[j];
           gl.glVertex2f(coord.x, coord.y);
         }
         gl.glEnd();
@@ -409,21 +410,21 @@ public class GLUT {
     }
   }
 
-  public void glutStrokeString(int font, String string) {
-    GL2 gl = GLUgl2.getCurrentGL2();
-    StrokeFontRec fontinfo = getStrokeFont(font);
-    int len = string.length();
+  public void glutStrokeString(final int font, final String string) {
+    final GL2 gl = GLUgl2.getCurrentGL2();
+    final StrokeFontRec fontinfo = getStrokeFont(font);
+    final int len = string.length();
     for (int pos = 0; pos < len; pos++) {
-      int c = string.charAt(pos) & 0xFFFF;
+      final int c = string.charAt(pos) & 0xFFFF;
       if (c < 0 || c >= fontinfo.num_chars)
         continue;
-      StrokeCharRec ch = fontinfo.ch[c];
+      final StrokeCharRec ch = fontinfo.ch[c];
       if (ch != null) {
         for (int i = 0; i < ch.num_strokes; i++) {
-          StrokeRec stroke = ch.stroke[i];
-          gl.glBegin(GL2.GL_LINE_STRIP);
+          final StrokeRec stroke = ch.stroke[i];
+          gl.glBegin(GL.GL_LINE_STRIP);
           for (int j = 0; j < stroke.num_coords; j++) {
-            CoordRec coord = stroke.coord[j];
+            final CoordRec coord = stroke.coord[j];
             gl.glVertex2f(coord.x, coord.y);
           }
           gl.glEnd();
@@ -433,30 +434,30 @@ public class GLUT {
     }
   }
 
-  public int  glutStrokeWidth    (int font, char character) {
+  public int  glutStrokeWidth    (final int font, final char character) {
     return (int) glutStrokeWidthf(font, character);
   }
 
-  public float glutStrokeWidthf   (int font, char character) {
-    StrokeFontRec fontinfo = getStrokeFont(font);
-    int c = character & 0xFFFF;
+  public float glutStrokeWidthf   (final int font, final char character) {
+    final StrokeFontRec fontinfo = getStrokeFont(font);
+    final int c = character & 0xFFFF;
     if (c < 0 || c >= fontinfo.num_chars)
       return 0;
-    StrokeCharRec ch = fontinfo.ch[c];
+    final StrokeCharRec ch = fontinfo.ch[c];
     if (ch != null)
       return ch.right;
     else
       return 0;
   }
 
-  public int  glutBitmapLength   (int font, String string) {
-    BitmapFontRec fontinfo = getBitmapFont(font);
+  public int  glutBitmapLength   (final int font, final String string) {
+    final BitmapFontRec fontinfo = getBitmapFont(font);
     int length = 0;
-    int len = string.length();
+    final int len = string.length();
     for (int pos = 0; pos < len; pos++) {
-      int c = string.charAt(pos) & 0xFFFF;
+      final int c = string.charAt(pos) & 0xFFFF;
       if (c >= fontinfo.first && c < fontinfo.first + fontinfo.num_chars) {
-        BitmapCharRec ch = fontinfo.ch[c - fontinfo.first];
+        final BitmapCharRec ch = fontinfo.ch[c - fontinfo.first];
         if (ch != null)
           length += ch.advance;
       }
@@ -464,18 +465,18 @@ public class GLUT {
     return length;
   }
 
-  public int  glutStrokeLength   (int font, String string) {
+  public int  glutStrokeLength   (final int font, final String string) {
     return (int) glutStrokeLengthf(font, string);
   }
 
-  public float glutStrokeLengthf  (int font, String string) {
-    StrokeFontRec fontinfo = getStrokeFont(font);
+  public float glutStrokeLengthf  (final int font, final String string) {
+    final StrokeFontRec fontinfo = getStrokeFont(font);
     float length = 0;
-    int len = string.length();
+    final int len = string.length();
     for (int i = 0; i < len; i++) {
-      char c = string.charAt(i);
+      final char c = string.charAt(i);
       if (c >= 0 && c < fontinfo.num_chars) {
-        StrokeCharRec ch = fontinfo.ch[c];
+        final StrokeCharRec ch = fontinfo.ch[c];
         if (ch != null)
           length += ch.right;
       }
@@ -491,9 +492,9 @@ public class GLUT {
      The polyhedron is centered at the origin.
   */
   public void glutWireRhombicDodecahedron() {
-    GL2 gl = GLUgl2.getCurrentGL2();
+    final GL2 gl = GLUgl2.getCurrentGL2();
     for( int i = 0; i < 12; i++ ) {
-      gl.glBegin( GL2.GL_LINE_LOOP );
+      gl.glBegin( GL.GL_LINE_LOOP );
       gl.glNormal3dv( rdod_n[ i ],0 );
       gl.glVertex3dv( rdod_r[ rdod_v[ i ][ 0 ] ],0 );
       gl.glVertex3dv( rdod_r[ rdod_v[ i ][ 1 ] ],0 );
@@ -511,8 +512,8 @@ public class GLUT {
    The polyhedron is centered at the origin.
    */
   public void glutSolidRhombicDodecahedron() {
-    GL2 gl = GLUgl2.getCurrentGL2();
-    gl.glBegin( GL2.GL_QUADS );
+    final GL2 gl = GLUgl2.getCurrentGL2();
+    gl.glBegin( GL2GL3.GL_QUADS );
     for( int i = 0; i < 12; i++ ) {
       gl.glNormal3dv( rdod_n[ i ],0 );
       gl.glVertex3dv( rdod_r[ rdod_v[ i ][ 0 ] ],0 );
@@ -532,7 +533,7 @@ public class GLUT {
   //
 
   private GLUquadric quadObj;
-  private void quadObjInit(GLUgl2 glu) {
+  private void quadObjInit(final GLUgl2 glu) {
     if (quadObj == null) {
       quadObj = glu.gluNewQuadric();
     }
@@ -541,7 +542,7 @@ public class GLUT {
     }
   }
 
-  private static void doughnut(GL2 gl, double r, double R, int nsides, int rings) {
+  private static void doughnut(final GL2 gl, final double r, final double R, final int nsides, final int rings) {
     int i, j;
     float theta, phi, theta1;
     float cosTheta, sinTheta;
@@ -597,9 +598,9 @@ public class GLUT {
     {5, 6, 2, 1},
     {7, 4, 0, 3}
   };
-  private void drawBox(GL2 gl, float size, int type) {
+  private void drawBox(final GL2 gl, final float size, final int type) {
     if (boxVertices == null) {
-      float[][] v = new float[8][];
+      final float[][] v = new float[8][];
       for (int i = 0; i < 8; i++) {
         v[i] = new float[3];
       }
@@ -611,9 +612,9 @@ public class GLUT {
       v[1][2] = v[2][2] = v[5][2] = v[6][2] =  0.5f;
       boxVertices = v;
     }
-    float[][] v = boxVertices;
-    float[][] n = boxNormals;
-    int[][] faces = boxFaces;
+    final float[][] v = boxVertices;
+    final float[][] n = boxNormals;
+    final int[][] faces = boxFaces;
     for (int i = 5; i >= 0; i--) {
       gl.glBegin(type);
       gl.glNormal3fv(n[i], 0);
@@ -664,14 +665,14 @@ public class GLUT {
     dodec[19][0] = 0; dodec[19][1] = -beta; dodec[19][2] = -alpha;
   }
 
-  private static void diff3(float[] a, float[] b, float[] c) {
+  private static void diff3(final float[] a, final float[] b, final float[] c) {
     c[0] = a[0] - b[0];
     c[1] = a[1] - b[1];
     c[2] = a[2] - b[2];
   }
 
-  private static void crossprod(float[] v1, float[] v2, float[] prod) {
-    float[] p = new float[3];         /* in case prod == v1 or v2 */
+  private static void crossprod(final float[] v1, final float[] v2, final float[] prod) {
+    final float[] p = new float[3];         /* in case prod == v1 or v2 */
 
     p[0] = v1[1] * v2[2] - v2[1] * v1[2];
     p[1] = v1[2] * v2[0] - v2[2] * v1[0];
@@ -681,7 +682,7 @@ public class GLUT {
     prod[2] = p[2];
   }
 
-  private static void normalize(float[] v) {
+  private static void normalize(final float[] v) {
     float d;
 
     d = (float) Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
@@ -694,10 +695,10 @@ public class GLUT {
     v[2] *= d;
   }
 
-  private void pentagon(GL2 gl, int a, int b, int c, int d, int e, int shadeType) {
-    float[] n0 = new float[3];
-    float[] d1 = new float[3];
-    float[] d2 = new float[3];
+  private void pentagon(final GL2 gl, final int a, final int b, final int c, final int d, final int e, final int shadeType) {
+    final float[] n0 = new float[3];
+    final float[] d1 = new float[3];
+    final float[] d2 = new float[3];
 
     diff3(dodec[a], dodec[b], d1);
     diff3(dodec[b], dodec[c], d2);
@@ -714,7 +715,7 @@ public class GLUT {
     gl.glEnd();
   }
 
-  private void dodecahedron(GL2 gl, int type) {
+  private void dodecahedron(final GL2 gl, final int type) {
     if (dodec == null) {
       initDodecahedron();
     }
@@ -732,9 +733,9 @@ public class GLUT {
     pentagon(gl, 4, 12, 5, 16, 17, type);
   }
 
-  private static void recorditem(GL2 gl, float[] n1, float[] n2, float[] n3, int shadeType) {
-    float[] q0 = new float[3];
-    float[] q1 = new float[3];
+  private static void recorditem(final GL2 gl, final float[] n1, final float[] n2, final float[] n3, final int shadeType) {
+    final float[] q0 = new float[3];
+    final float[] q1 = new float[3];
 
     diff3(n1, n2, q0);
     diff3(n2, n3, q1);
@@ -749,11 +750,11 @@ public class GLUT {
     gl.glEnd();
   }
 
-  private static void subdivide(GL2 gl, float[] v0, float[] v1, float[] v2, int shadeType) {
+  private static void subdivide(final GL2 gl, final float[] v0, final float[] v1, final float[] v2, final int shadeType) {
     int depth;
-    float[] w0 = new float[3];
-    float[] w1 = new float[3];
-    float[] w2 = new float[3];
+    final float[] w0 = new float[3];
+    final float[] w1 = new float[3];
+    final float[] w2 = new float[3];
     float l;
     int i, j, k, n;
 
@@ -785,10 +786,10 @@ public class GLUT {
     }
   }
 
-  private static void drawtriangle(GL2 gl, int i, float[][] data, int[][] ndx, int shadeType) {
-    float[] x0 = data[ndx[i][0]];
-    float[] x1 = data[ndx[i][1]];
-    float[] x2 = data[ndx[i][2]];
+  private static void drawtriangle(final GL2 gl, final int i, final float[][] data, final int[][] ndx, final int shadeType) {
+    final float[] x0 = data[ndx[i][0]];
+    final float[] x1 = data[ndx[i][1]];
+    final float[] x2 = data[ndx[i][2]];
     subdivide(gl, x0, x1, x2, shadeType);
   }
 
@@ -816,7 +817,7 @@ public class GLUT {
     {1, 3, 5}
   };
 
-  private static void octahedron(GL2 gl, int shadeType) {
+  private static void octahedron(final GL2 gl, final int shadeType) {
     int i;
 
     for (i = 7; i >= 0; i--) {
@@ -870,7 +871,7 @@ public class GLUT {
     {7, 2, 11},
   };
 
-  private static void icosahedron(GL2 gl, int shadeType) {
+  private static void icosahedron(final GL2 gl, final int shadeType) {
     int i;
 
     for (i = 19; i >= 0; i--) {
@@ -950,7 +951,7 @@ public class GLUT {
     {1, 2, 3}
   };
 
-  private static final void tetrahedron(GL2 gl, int shadeType) {
+  private static final void tetrahedron(final GL2 gl, final int shadeType) {
     for (int i = 3; i >= 0; i--)
       drawtriangle(gl, i, tdata, tndex, shadeType);
   }
@@ -1112,28 +1113,28 @@ public class GLUT {
     0, 0, 1, 0, 0, 1, 1, 1
   };
 
-  private static void teapot(GL2 gl,
-                             int grid,
-                             double scale,
-                             int type,
-                             boolean backCompatible)
+  private static void teapot(final GL2 gl,
+                             final int grid,
+                             final double scale,
+                             final int type,
+                             final boolean backCompatible)
   {
     // As mentioned above, GL2.glMap2f expects a packed array of floats
-    float[] p = new float[4*4*3];
-    float[] q = new float[4*4*3];
-    float[] r = new float[4*4*3];
-    float[] s = new float[4*4*3];
+    final float[] p = new float[4*4*3];
+    final float[] q = new float[4*4*3];
+    final float[] r = new float[4*4*3];
+    final float[] s = new float[4*4*3];
     int i, j, k, l;
 
     gl.glPushAttrib(GL2.GL_ENABLE_BIT | GL2.GL_EVAL_BIT | GL2.GL_POLYGON_BIT);
     gl.glEnable(GL2.GL_AUTO_NORMAL);
-    gl.glEnable(GL2.GL_NORMALIZE);
+    gl.glEnable(GLLightingFunc.GL_NORMALIZE);
     gl.glEnable(GL2.GL_MAP2_VERTEX_3);
     gl.glEnable(GL2.GL_MAP2_TEXTURE_COORD_2);
     gl.glPushMatrix();
     if (!backCompatible) {
       // The time has come to have the teapot no longer be inside out
-      gl.glFrontFace(GL2.GL_CW);
+      gl.glFrontFace(GL.GL_CW);
       gl.glScaled(0.5*scale, 0.5*scale, 0.5*scale);
     } else {
       // We want the teapot in it's backward compatible position and
@@ -1184,29 +1185,29 @@ public class GLUT {
     gl.glPopAttrib();
   }
 
-  private static void evaluateTeapotMesh(GL2 gl,
-                                         int grid,
-                                         int type,
-                                         int partNum,
-                                         boolean repairSingularities)
+  private static void evaluateTeapotMesh(final GL2 gl,
+                                         final int grid,
+                                         final int type,
+                                         final int partNum,
+                                         final boolean repairSingularities)
   {
     if (repairSingularities && (partNum == 5 || partNum == 3)) {
       // Instead of using evaluators that give bad results at singularities,
       // evaluate by hand
-      gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, type);
+      gl.glPolygonMode(GL.GL_FRONT_AND_BACK, type);
       for (int nv = 0; nv < grid; nv++) {
         if (nv == 0) {
           // Draw a small triangle-fan to fill the hole
           gl.glDisable(GL2.GL_AUTO_NORMAL);
           gl.glNormal3f(0, 0, partNum == 3 ? 1 : -1);
-          gl.glBegin(GL2.GL_TRIANGLE_FAN);
+          gl.glBegin(GL.GL_TRIANGLE_FAN);
           {
             gl.glEvalCoord2f(0, 0);
             // Note that we draw in clock-wise order to match the evaluator
             // method
             for (int nu = 0; nu <= grid; nu++)
             {
-              gl.glEvalCoord2f(nu / (float)grid, (1f / grid) / (float)grid);
+              gl.glEvalCoord2f(nu / (float)grid, (1f / grid) / grid);
             }
           }
           gl.glEnd();
@@ -1219,7 +1220,7 @@ public class GLUT {
           for (int nu = grid; nu >= 0; nu--) {
             gl.glEvalCoord2f(nu / (float)grid, (nv + 1) / (float)grid);
             gl.glEvalCoord2f(nu / (float)grid, Math.max(nv, 1f / grid)
-                                                         / (float)grid);
+                                                         / grid);
           }
         }
         gl.glEnd();
@@ -1233,13 +1234,13 @@ public class GLUT {
   // Font implementation
   //
 
-  private static void bitmapCharacterImpl(GL2 gl, int font, char cin) {
-    BitmapFontRec fontinfo = getBitmapFont(font);
-    int c = cin & 0xFFFF;
+  private static void bitmapCharacterImpl(final GL2 gl, final int font, final char cin) {
+    final BitmapFontRec fontinfo = getBitmapFont(font);
+    final int c = cin & 0xFFFF;
     if (c < fontinfo.first ||
         c >= fontinfo.first + fontinfo.num_chars)
       return;
-    BitmapCharRec ch = fontinfo.ch[c - fontinfo.first];
+    final BitmapCharRec ch = fontinfo.ch[c - fontinfo.first];
     if (ch != null) {
       gl.glBitmap(ch.width, ch.height, ch.xorig, ch.yorig,
                   ch.advance, 0, ch.bitmap, 0);
@@ -1249,7 +1250,7 @@ public class GLUT {
   private static final BitmapFontRec[] bitmapFonts = new BitmapFontRec[9];
   private static final StrokeFontRec[] strokeFonts = new StrokeFontRec[9];
 
-  private static BitmapFontRec getBitmapFont(int font) {
+  private static BitmapFontRec getBitmapFont(final int font) {
     BitmapFontRec rec = bitmapFonts[font];
     if (rec == null) {
       switch (font) {
@@ -1282,7 +1283,7 @@ public class GLUT {
     return rec;
   }
 
-  private static StrokeFontRec getStrokeFont(int font) {
+  private static StrokeFontRec getStrokeFont(final int font) {
     StrokeFontRec rec = strokeFonts[font];
     if (rec == null) {
       switch (font) {
@@ -1299,44 +1300,44 @@ public class GLUT {
     return rec;
   }
 
-  private static void beginBitmap(GL2 gl,
-                                  int[] swapbytes,
-                                  int[] lsbfirst,
-                                  int[] rowlength,
-                                  int[] skiprows,
-                                  int[] skippixels,
-                                  int[] alignment) {
-    gl.glGetIntegerv(GL2.GL_UNPACK_SWAP_BYTES, swapbytes, 0);
-    gl.glGetIntegerv(GL2.GL_UNPACK_LSB_FIRST, lsbfirst, 0);
-    gl.glGetIntegerv(GL2.GL_UNPACK_ROW_LENGTH, rowlength, 0);
-    gl.glGetIntegerv(GL2.GL_UNPACK_SKIP_ROWS, skiprows, 0);
-    gl.glGetIntegerv(GL2.GL_UNPACK_SKIP_PIXELS, skippixels, 0);
-    gl.glGetIntegerv(GL2.GL_UNPACK_ALIGNMENT, alignment, 0);
+  private static void beginBitmap(final GL2 gl,
+                                  final int[] swapbytes,
+                                  final int[] lsbfirst,
+                                  final int[] rowlength,
+                                  final int[] skiprows,
+                                  final int[] skippixels,
+                                  final int[] alignment) {
+    gl.glGetIntegerv(GL2GL3.GL_UNPACK_SWAP_BYTES, swapbytes, 0);
+    gl.glGetIntegerv(GL2GL3.GL_UNPACK_LSB_FIRST, lsbfirst, 0);
+    gl.glGetIntegerv(GL2ES2.GL_UNPACK_ROW_LENGTH, rowlength, 0);
+    gl.glGetIntegerv(GL2ES2.GL_UNPACK_SKIP_ROWS, skiprows, 0);
+    gl.glGetIntegerv(GL2ES2.GL_UNPACK_SKIP_PIXELS, skippixels, 0);
+    gl.glGetIntegerv(GL.GL_UNPACK_ALIGNMENT, alignment, 0);
     /* Little endian machines (DEC Alpha for example) could
        benefit from setting GL_UNPACK_LSB_FIRST to GL_TRUE
        instead of GL_FALSE, but this would require changing the
        generated bitmaps too. */
-    gl.glPixelStorei(GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE);
-    gl.glPixelStorei(GL2.GL_UNPACK_LSB_FIRST, GL2.GL_FALSE);
-    gl.glPixelStorei(GL2.GL_UNPACK_ROW_LENGTH, 0);
-    gl.glPixelStorei(GL2.GL_UNPACK_SKIP_ROWS, 0);
-    gl.glPixelStorei(GL2.GL_UNPACK_SKIP_PIXELS, 0);
-    gl.glPixelStorei(GL2.GL_UNPACK_ALIGNMENT, 1);
+    gl.glPixelStorei(GL2GL3.GL_UNPACK_SWAP_BYTES, GL.GL_FALSE);
+    gl.glPixelStorei(GL2GL3.GL_UNPACK_LSB_FIRST, GL.GL_FALSE);
+    gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, 0);
+    gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_ROWS, 0);
+    gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_PIXELS, 0);
+    gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1);
   }
 
-  private static void endBitmap(GL2 gl,
-                                int[] swapbytes,
-                                int[] lsbfirst,
-                                int[] rowlength,
-                                int[] skiprows,
-                                int[] skippixels,
-                                int[] alignment) {
+  private static void endBitmap(final GL2 gl,
+                                final int[] swapbytes,
+                                final int[] lsbfirst,
+                                final int[] rowlength,
+                                final int[] skiprows,
+                                final int[] skippixels,
+                                final int[] alignment) {
     /* Restore saved modes. */
-    gl.glPixelStorei(GL2.GL_UNPACK_SWAP_BYTES, swapbytes[0]);
-    gl.glPixelStorei(GL2.GL_UNPACK_LSB_FIRST, lsbfirst[0]);
-    gl.glPixelStorei(GL2.GL_UNPACK_ROW_LENGTH, rowlength[0]);
-    gl.glPixelStorei(GL2.GL_UNPACK_SKIP_ROWS, skiprows[0]);
-    gl.glPixelStorei(GL2.GL_UNPACK_SKIP_PIXELS, skippixels[0]);
-    gl.glPixelStorei(GL2.GL_UNPACK_ALIGNMENT, alignment[0]);
+    gl.glPixelStorei(GL2GL3.GL_UNPACK_SWAP_BYTES, swapbytes[0]);
+    gl.glPixelStorei(GL2GL3.GL_UNPACK_LSB_FIRST, lsbfirst[0]);
+    gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, rowlength[0]);
+    gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_ROWS, skiprows[0]);
+    gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_PIXELS, skippixels[0]);
+    gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, alignment[0]);
   }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java
index 3587ca9..a191efd 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeMonoRoman.java
@@ -46,14 +46,14 @@ class GLUTStrokeMonoRoman {
 /* char: 33 '!' */
 
 static final CoordRec char33_stroke0[] = {
-    new CoordRec((float) 52.381, (float) 100 ),
+    new CoordRec((float) 52.381, 100 ),
     new CoordRec((float) 52.381, (float) 33.3333 ),
 };
 
 static final CoordRec char33_stroke1[] = {
     new CoordRec((float) 52.381, (float) 9.5238 ),
     new CoordRec((float) 47.6191, (float) 4.7619 ),
-    new CoordRec((float) 52.381, (float) 0 ),
+    new CoordRec((float) 52.381, 0 ),
     new CoordRec((float) 57.1429, (float) 4.7619 ),
     new CoordRec((float) 52.381, (float) 9.5238 ),
 };
@@ -66,12 +66,12 @@ static final StrokeRec char33[] = {
 /* char: 34 '"' */
 
 static final CoordRec char34_stroke0[] = {
-    new CoordRec((float) 33.3334, (float) 100 ),
+    new CoordRec((float) 33.3334, 100 ),
     new CoordRec((float) 33.3334, (float) 66.6667 ),
 };
 
 static final CoordRec char34_stroke1[] = {
-    new CoordRec((float) 71.4286, (float) 100 ),
+    new CoordRec((float) 71.4286, 100 ),
     new CoordRec((float) 71.4286, (float) 66.6667 ),
 };
 
@@ -89,7 +89,7 @@ static final CoordRec char35_stroke0[] = {
 
 static final CoordRec char35_stroke1[] = {
     new CoordRec((float) 83.3334, (float) 119.048 ),
-    new CoordRec((float) 50, (float) -33.3333 ),
+    new CoordRec(50, (float) -33.3333 ),
 };
 
 static final CoordRec char35_stroke2[] = {
@@ -124,8 +124,8 @@ static final CoordRec char36_stroke1[] = {
 static final CoordRec char36_stroke2[] = {
     new CoordRec((float) 85.7143, (float) 85.7143 ),
     new CoordRec((float) 76.1905, (float) 95.2381 ),
-    new CoordRec((float) 61.9047, (float) 100 ),
-    new CoordRec((float) 42.8571, (float) 100 ),
+    new CoordRec((float) 61.9047, 100 ),
+    new CoordRec((float) 42.8571, 100 ),
     new CoordRec((float) 28.5714, (float) 95.2381 ),
     new CoordRec((float) 19.0476, (float) 85.7143 ),
     new CoordRec((float) 19.0476, (float) 76.1905 ),
@@ -138,8 +138,8 @@ static final CoordRec char36_stroke2[] = {
     new CoordRec((float) 85.7143, (float) 28.5714 ),
     new CoordRec((float) 85.7143, (float) 14.2857 ),
     new CoordRec((float) 76.1905, (float) 4.7619 ),
-    new CoordRec((float) 61.9047, (float) 0 ),
-    new CoordRec((float) 42.8571, (float) 0 ),
+    new CoordRec((float) 61.9047, 0 ),
+    new CoordRec((float) 42.8571, 0 ),
     new CoordRec((float) 28.5714, (float) 4.7619 ),
     new CoordRec((float) 19.0476, (float) 14.2857 ),
 };
@@ -153,12 +153,12 @@ static final StrokeRec char36[] = {
 /* char: 37 '%' */
 
 static final CoordRec char37_stroke0[] = {
-    new CoordRec((float) 95.2381, (float) 100 ),
-    new CoordRec((float) 9.5238, (float) 0 ),
+    new CoordRec((float) 95.2381, 100 ),
+    new CoordRec((float) 9.5238, 0 ),
 };
 
 static final CoordRec char37_stroke1[] = {
-    new CoordRec((float) 33.3333, (float) 100 ),
+    new CoordRec((float) 33.3333, 100 ),
     new CoordRec((float) 42.8571, (float) 90.4762 ),
     new CoordRec((float) 42.8571, (float) 80.9524 ),
     new CoordRec((float) 38.0952, (float) 71.4286 ),
@@ -167,13 +167,13 @@ static final CoordRec char37_stroke1[] = {
     new CoordRec((float) 9.5238, (float) 76.1905 ),
     new CoordRec((float) 9.5238, (float) 85.7143 ),
     new CoordRec((float) 14.2857, (float) 95.2381 ),
-    new CoordRec((float) 23.8095, (float) 100 ),
-    new CoordRec((float) 33.3333, (float) 100 ),
+    new CoordRec((float) 23.8095, 100 ),
+    new CoordRec((float) 33.3333, 100 ),
     new CoordRec((float) 42.8571, (float) 95.2381 ),
     new CoordRec((float) 57.1428, (float) 90.4762 ),
     new CoordRec((float) 71.4286, (float) 90.4762 ),
     new CoordRec((float) 85.7143, (float) 95.2381 ),
-    new CoordRec((float) 95.2381, (float) 100 ),
+    new CoordRec((float) 95.2381, 100 ),
 };
 
 static final CoordRec char37_stroke2[] = {
@@ -181,8 +181,8 @@ static final CoordRec char37_stroke2[] = {
     new CoordRec((float) 66.6667, (float) 28.5714 ),
     new CoordRec((float) 61.9048, (float) 19.0476 ),
     new CoordRec((float) 61.9048, (float) 9.5238 ),
-    new CoordRec((float) 71.4286, (float) 0 ),
-    new CoordRec((float) 80.9524, (float) 0 ),
+    new CoordRec((float) 71.4286, 0 ),
+    new CoordRec((float) 80.9524, 0 ),
     new CoordRec((float) 90.4762, (float) 4.7619 ),
     new CoordRec((float) 95.2381, (float) 14.2857 ),
     new CoordRec((float) 95.2381, (float) 23.8095 ),
@@ -199,8 +199,8 @@ static final StrokeRec char37[] = {
 /* char: 38 '&' */
 
 static final CoordRec char38_stroke0[] = {
-    new CoordRec((float) 100, (float) 57.1429 ),
-    new CoordRec((float) 100, (float) 61.9048 ),
+    new CoordRec(100, (float) 57.1429 ),
+    new CoordRec(100, (float) 61.9048 ),
     new CoordRec((float) 95.2381, (float) 66.6667 ),
     new CoordRec((float) 90.4762, (float) 66.6667 ),
     new CoordRec((float) 85.7143, (float) 61.9048 ),
@@ -208,8 +208,8 @@ static final CoordRec char38_stroke0[] = {
     new CoordRec((float) 71.4286, (float) 28.5714 ),
     new CoordRec((float) 61.9048, (float) 14.2857 ),
     new CoordRec((float) 52.3809, (float) 4.7619 ),
-    new CoordRec((float) 42.8571, (float) 0 ),
-    new CoordRec((float) 23.8095, (float) 0 ),
+    new CoordRec((float) 42.8571, 0 ),
+    new CoordRec((float) 23.8095, 0 ),
     new CoordRec((float) 14.2857, (float) 4.7619 ),
     new CoordRec((float) 9.5238, (float) 9.5238 ),
     new CoordRec((float) 4.7619, (float) 19.0476 ),
@@ -221,7 +221,7 @@ static final CoordRec char38_stroke0[] = {
     new CoordRec((float) 57.1429, (float) 76.1905 ),
     new CoordRec((float) 57.1429, (float) 85.7143 ),
     new CoordRec((float) 52.3809, (float) 95.2381 ),
-    new CoordRec((float) 42.8571, (float) 100 ),
+    new CoordRec((float) 42.8571, 100 ),
     new CoordRec((float) 33.3333, (float) 95.2381 ),
     new CoordRec((float) 28.5714, (float) 85.7143 ),
     new CoordRec((float) 28.5714, (float) 76.1905 ),
@@ -229,10 +229,10 @@ static final CoordRec char38_stroke0[] = {
     new CoordRec((float) 42.8571, (float) 47.619 ),
     new CoordRec((float) 66.6667, (float) 14.2857 ),
     new CoordRec((float) 76.1905, (float) 4.7619 ),
-    new CoordRec((float) 85.7143, (float) 0 ),
-    new CoordRec((float) 95.2381, (float) 0 ),
-    new CoordRec((float) 100, (float) 4.7619 ),
-    new CoordRec((float) 100, (float) 9.5238 ),
+    new CoordRec((float) 85.7143, 0 ),
+    new CoordRec((float) 95.2381, 0 ),
+    new CoordRec(100, (float) 4.7619 ),
+    new CoordRec(100, (float) 9.5238 ),
 };
 
 static final StrokeRec char38[] = {
@@ -242,7 +242,7 @@ static final StrokeRec char38[] = {
 /* char: 39 ''' */
 
 static final CoordRec char39_stroke0[] = {
-    new CoordRec((float) 52.381, (float) 100 ),
+    new CoordRec((float) 52.381, 100 ),
     new CoordRec((float) 52.381, (float) 66.6667 ),
 };
 
@@ -255,12 +255,12 @@ static final StrokeRec char39[] = {
 static final CoordRec char40_stroke0[] = {
     new CoordRec((float) 69.0476, (float) 119.048 ),
     new CoordRec((float) 59.5238, (float) 109.524 ),
-    new CoordRec((float) 50, (float) 95.2381 ),
+    new CoordRec(50, (float) 95.2381 ),
     new CoordRec((float) 40.4762, (float) 76.1905 ),
     new CoordRec((float) 35.7143, (float) 52.381 ),
     new CoordRec((float) 35.7143, (float) 33.3333 ),
     new CoordRec((float) 40.4762, (float) 9.5238 ),
-    new CoordRec((float) 50, (float) -9.5238 ),
+    new CoordRec(50, (float) -9.5238 ),
     new CoordRec((float) 59.5238, (float) -23.8095 ),
     new CoordRec((float) 69.0476, (float) -33.3333 ),
 };
@@ -315,7 +315,7 @@ static final StrokeRec char42[] = {
 
 static final CoordRec char43_stroke0[] = {
     new CoordRec((float) 52.3809, (float) 85.7143 ),
-    new CoordRec((float) 52.3809, (float) 0 ),
+    new CoordRec((float) 52.3809, 0 ),
 };
 
 static final CoordRec char43_stroke1[] = {
@@ -332,7 +332,7 @@ static final StrokeRec char43[] = {
 
 static final CoordRec char44_stroke0[] = {
     new CoordRec((float) 57.1429, (float) 4.7619 ),
-    new CoordRec((float) 52.381, (float) 0 ),
+    new CoordRec((float) 52.381, 0 ),
     new CoordRec((float) 47.6191, (float) 4.7619 ),
     new CoordRec((float) 52.381, (float) 9.5238 ),
     new CoordRec((float) 57.1429, (float) 4.7619 ),
@@ -361,7 +361,7 @@ static final StrokeRec char45[] = {
 static final CoordRec char46_stroke0[] = {
     new CoordRec((float) 52.381, (float) 9.5238 ),
     new CoordRec((float) 47.6191, (float) 4.7619 ),
-    new CoordRec((float) 52.381, (float) 0 ),
+    new CoordRec((float) 52.381, 0 ),
     new CoordRec((float) 57.1429, (float) 4.7619 ),
     new CoordRec((float) 52.381, (float) 9.5238 ),
 };
@@ -374,7 +374,7 @@ static final StrokeRec char46[] = {
 
 static final CoordRec char47_stroke0[] = {
     new CoordRec((float) 19.0476, (float) -14.2857 ),
-    new CoordRec((float) 85.7143, (float) 100 ),
+    new CoordRec((float) 85.7143, 100 ),
 };
 
 static final StrokeRec char47[] = {
@@ -384,23 +384,23 @@ static final StrokeRec char47[] = {
 /* char: 48 '0' */
 
 static final CoordRec char48_stroke0[] = {
-    new CoordRec((float) 47.619, (float) 100 ),
+    new CoordRec((float) 47.619, 100 ),
     new CoordRec((float) 33.3333, (float) 95.2381 ),
     new CoordRec((float) 23.8095, (float) 80.9524 ),
     new CoordRec((float) 19.0476, (float) 57.1429 ),
     new CoordRec((float) 19.0476, (float) 42.8571 ),
     new CoordRec((float) 23.8095, (float) 19.0476 ),
     new CoordRec((float) 33.3333, (float) 4.7619 ),
-    new CoordRec((float) 47.619, (float) 0 ),
-    new CoordRec((float) 57.1428, (float) 0 ),
+    new CoordRec((float) 47.619, 0 ),
+    new CoordRec((float) 57.1428, 0 ),
     new CoordRec((float) 71.4286, (float) 4.7619 ),
     new CoordRec((float) 80.9524, (float) 19.0476 ),
     new CoordRec((float) 85.7143, (float) 42.8571 ),
     new CoordRec((float) 85.7143, (float) 57.1429 ),
     new CoordRec((float) 80.9524, (float) 80.9524 ),
     new CoordRec((float) 71.4286, (float) 95.2381 ),
-    new CoordRec((float) 57.1428, (float) 100 ),
-    new CoordRec((float) 47.619, (float) 100 ),
+    new CoordRec((float) 57.1428, 100 ),
+    new CoordRec((float) 47.619, 100 ),
 };
 
 static final StrokeRec char48[] = {
@@ -411,9 +411,9 @@ static final StrokeRec char48[] = {
 
 static final CoordRec char49_stroke0[] = {
     new CoordRec((float) 40.4762, (float) 80.9524 ),
-    new CoordRec((float) 50, (float) 85.7143 ),
-    new CoordRec((float) 64.2857, (float) 100 ),
-    new CoordRec((float) 64.2857, (float) 0 ),
+    new CoordRec(50, (float) 85.7143 ),
+    new CoordRec((float) 64.2857, 100 ),
+    new CoordRec((float) 64.2857, 0 ),
 };
 
 static final StrokeRec char49[] = {
@@ -427,16 +427,16 @@ static final CoordRec char50_stroke0[] = {
     new CoordRec((float) 23.8095, (float) 80.9524 ),
     new CoordRec((float) 28.5714, (float) 90.4762 ),
     new CoordRec((float) 33.3333, (float) 95.2381 ),
-    new CoordRec((float) 42.8571, (float) 100 ),
-    new CoordRec((float) 61.9047, (float) 100 ),
+    new CoordRec((float) 42.8571, 100 ),
+    new CoordRec((float) 61.9047, 100 ),
     new CoordRec((float) 71.4286, (float) 95.2381 ),
     new CoordRec((float) 76.1905, (float) 90.4762 ),
     new CoordRec((float) 80.9524, (float) 80.9524 ),
     new CoordRec((float) 80.9524, (float) 71.4286 ),
     new CoordRec((float) 76.1905, (float) 61.9048 ),
     new CoordRec((float) 66.6666, (float) 47.619 ),
-    new CoordRec((float) 19.0476, (float) 0 ),
-    new CoordRec((float) 85.7143, (float) 0 ),
+    new CoordRec((float) 19.0476, 0 ),
+    new CoordRec((float) 85.7143, 0 ),
 };
 
 static final StrokeRec char50[] = {
@@ -446,8 +446,8 @@ static final StrokeRec char50[] = {
 /* char: 51 '3' */
 
 static final CoordRec char51_stroke0[] = {
-    new CoordRec((float) 28.5714, (float) 100 ),
-    new CoordRec((float) 80.9524, (float) 100 ),
+    new CoordRec((float) 28.5714, 100 ),
+    new CoordRec((float) 80.9524, 100 ),
     new CoordRec((float) 52.3809, (float) 61.9048 ),
     new CoordRec((float) 66.6666, (float) 61.9048 ),
     new CoordRec((float) 76.1905, (float) 57.1429 ),
@@ -456,8 +456,8 @@ static final CoordRec char51_stroke0[] = {
     new CoordRec((float) 85.7143, (float) 28.5714 ),
     new CoordRec((float) 80.9524, (float) 14.2857 ),
     new CoordRec((float) 71.4286, (float) 4.7619 ),
-    new CoordRec((float) 57.1428, (float) 0 ),
-    new CoordRec((float) 42.8571, (float) 0 ),
+    new CoordRec((float) 57.1428, 0 ),
+    new CoordRec((float) 42.8571, 0 ),
     new CoordRec((float) 28.5714, (float) 4.7619 ),
     new CoordRec((float) 23.8095, (float) 9.5238 ),
     new CoordRec((float) 19.0476, (float) 19.0476 ),
@@ -470,14 +470,14 @@ static final StrokeRec char51[] = {
 /* char: 52 '4' */
 
 static final CoordRec char52_stroke0[] = {
-    new CoordRec((float) 64.2857, (float) 100 ),
+    new CoordRec((float) 64.2857, 100 ),
     new CoordRec((float) 16.6667, (float) 33.3333 ),
     new CoordRec((float) 88.0952, (float) 33.3333 ),
 };
 
 static final CoordRec char52_stroke1[] = {
-    new CoordRec((float) 64.2857, (float) 100 ),
-    new CoordRec((float) 64.2857, (float) 0 ),
+    new CoordRec((float) 64.2857, 100 ),
+    new CoordRec((float) 64.2857, 0 ),
 };
 
 static final StrokeRec char52[] = {
@@ -488,8 +488,8 @@ static final StrokeRec char52[] = {
 /* char: 53 '5' */
 
 static final CoordRec char53_stroke0[] = {
-    new CoordRec((float) 76.1905, (float) 100 ),
-    new CoordRec((float) 28.5714, (float) 100 ),
+    new CoordRec((float) 76.1905, 100 ),
+    new CoordRec((float) 28.5714, 100 ),
     new CoordRec((float) 23.8095, (float) 57.1429 ),
     new CoordRec((float) 28.5714, (float) 61.9048 ),
     new CoordRec((float) 42.8571, (float) 66.6667 ),
@@ -500,8 +500,8 @@ static final CoordRec char53_stroke0[] = {
     new CoordRec((float) 85.7143, (float) 28.5714 ),
     new CoordRec((float) 80.9524, (float) 14.2857 ),
     new CoordRec((float) 71.4286, (float) 4.7619 ),
-    new CoordRec((float) 57.1428, (float) 0 ),
-    new CoordRec((float) 42.8571, (float) 0 ),
+    new CoordRec((float) 57.1428, 0 ),
+    new CoordRec((float) 42.8571, 0 ),
     new CoordRec((float) 28.5714, (float) 4.7619 ),
     new CoordRec((float) 23.8095, (float) 9.5238 ),
     new CoordRec((float) 19.0476, (float) 19.0476 ),
@@ -516,16 +516,16 @@ static final StrokeRec char53[] = {
 static final CoordRec char54_stroke0[] = {
     new CoordRec((float) 78.5714, (float) 85.7143 ),
     new CoordRec((float) 73.8096, (float) 95.2381 ),
-    new CoordRec((float) 59.5238, (float) 100 ),
-    new CoordRec((float) 50, (float) 100 ),
+    new CoordRec((float) 59.5238, 100 ),
+    new CoordRec(50, 100 ),
     new CoordRec((float) 35.7143, (float) 95.2381 ),
     new CoordRec((float) 26.1905, (float) 80.9524 ),
     new CoordRec((float) 21.4286, (float) 57.1429 ),
     new CoordRec((float) 21.4286, (float) 33.3333 ),
     new CoordRec((float) 26.1905, (float) 14.2857 ),
     new CoordRec((float) 35.7143, (float) 4.7619 ),
-    new CoordRec((float) 50, (float) 0 ),
-    new CoordRec((float) 54.7619, (float) 0 ),
+    new CoordRec(50, 0 ),
+    new CoordRec((float) 54.7619, 0 ),
     new CoordRec((float) 69.0476, (float) 4.7619 ),
     new CoordRec((float) 78.5714, (float) 14.2857 ),
     new CoordRec((float) 83.3334, (float) 28.5714 ),
@@ -533,7 +533,7 @@ static final CoordRec char54_stroke0[] = {
     new CoordRec((float) 78.5714, (float) 47.619 ),
     new CoordRec((float) 69.0476, (float) 57.1429 ),
     new CoordRec((float) 54.7619, (float) 61.9048 ),
-    new CoordRec((float) 50, (float) 61.9048 ),
+    new CoordRec(50, (float) 61.9048 ),
     new CoordRec((float) 35.7143, (float) 57.1429 ),
     new CoordRec((float) 26.1905, (float) 47.619 ),
     new CoordRec((float) 21.4286, (float) 33.3333 ),
@@ -546,13 +546,13 @@ static final StrokeRec char54[] = {
 /* char: 55 '7' */
 
 static final CoordRec char55_stroke0[] = {
-    new CoordRec((float) 85.7143, (float) 100 ),
-    new CoordRec((float) 38.0952, (float) 0 ),
+    new CoordRec((float) 85.7143, 100 ),
+    new CoordRec((float) 38.0952, 0 ),
 };
 
 static final CoordRec char55_stroke1[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 85.7143, (float) 100 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 85.7143, 100 ),
 };
 
 static final StrokeRec char55[] = {
@@ -563,7 +563,7 @@ static final StrokeRec char55[] = {
 /* char: 56 '8' */
 
 static final CoordRec char56_stroke0[] = {
-    new CoordRec((float) 42.8571, (float) 100 ),
+    new CoordRec((float) 42.8571, 100 ),
     new CoordRec((float) 28.5714, (float) 95.2381 ),
     new CoordRec((float) 23.8095, (float) 85.7143 ),
     new CoordRec((float) 23.8095, (float) 76.1905 ),
@@ -576,8 +576,8 @@ static final CoordRec char56_stroke0[] = {
     new CoordRec((float) 85.7143, (float) 19.0476 ),
     new CoordRec((float) 80.9524, (float) 9.5238 ),
     new CoordRec((float) 76.1905, (float) 4.7619 ),
-    new CoordRec((float) 61.9047, (float) 0 ),
-    new CoordRec((float) 42.8571, (float) 0 ),
+    new CoordRec((float) 61.9047, 0 ),
+    new CoordRec((float) 42.8571, 0 ),
     new CoordRec((float) 28.5714, (float) 4.7619 ),
     new CoordRec((float) 23.8095, (float) 9.5238 ),
     new CoordRec((float) 19.0476, (float) 19.0476 ),
@@ -590,8 +590,8 @@ static final CoordRec char56_stroke0[] = {
     new CoordRec((float) 80.9524, (float) 76.1905 ),
     new CoordRec((float) 80.9524, (float) 85.7143 ),
     new CoordRec((float) 76.1905, (float) 95.2381 ),
-    new CoordRec((float) 61.9047, (float) 100 ),
-    new CoordRec((float) 42.8571, (float) 100 ),
+    new CoordRec((float) 61.9047, 100 ),
+    new CoordRec((float) 42.8571, 100 ),
 };
 
 static final StrokeRec char56[] = {
@@ -605,23 +605,23 @@ static final CoordRec char57_stroke0[] = {
     new CoordRec((float) 78.5714, (float) 52.381 ),
     new CoordRec((float) 69.0476, (float) 42.8571 ),
     new CoordRec((float) 54.7619, (float) 38.0952 ),
-    new CoordRec((float) 50, (float) 38.0952 ),
+    new CoordRec(50, (float) 38.0952 ),
     new CoordRec((float) 35.7143, (float) 42.8571 ),
     new CoordRec((float) 26.1905, (float) 52.381 ),
     new CoordRec((float) 21.4286, (float) 66.6667 ),
     new CoordRec((float) 21.4286, (float) 71.4286 ),
     new CoordRec((float) 26.1905, (float) 85.7143 ),
     new CoordRec((float) 35.7143, (float) 95.2381 ),
-    new CoordRec((float) 50, (float) 100 ),
-    new CoordRec((float) 54.7619, (float) 100 ),
+    new CoordRec(50, 100 ),
+    new CoordRec((float) 54.7619, 100 ),
     new CoordRec((float) 69.0476, (float) 95.2381 ),
     new CoordRec((float) 78.5714, (float) 85.7143 ),
     new CoordRec((float) 83.3334, (float) 66.6667 ),
     new CoordRec((float) 83.3334, (float) 42.8571 ),
     new CoordRec((float) 78.5714, (float) 19.0476 ),
     new CoordRec((float) 69.0476, (float) 4.7619 ),
-    new CoordRec((float) 54.7619, (float) 0 ),
-    new CoordRec((float) 45.2381, (float) 0 ),
+    new CoordRec((float) 54.7619, 0 ),
+    new CoordRec((float) 45.2381, 0 ),
     new CoordRec((float) 30.9524, (float) 4.7619 ),
     new CoordRec((float) 26.1905, (float) 14.2857 ),
 };
@@ -643,7 +643,7 @@ static final CoordRec char58_stroke0[] = {
 static final CoordRec char58_stroke1[] = {
     new CoordRec((float) 52.381, (float) 9.5238 ),
     new CoordRec((float) 47.6191, (float) 4.7619 ),
-    new CoordRec((float) 52.381, (float) 0 ),
+    new CoordRec((float) 52.381, 0 ),
     new CoordRec((float) 57.1429, (float) 4.7619 ),
     new CoordRec((float) 52.381, (float) 9.5238 ),
 };
@@ -665,7 +665,7 @@ static final CoordRec char59_stroke0[] = {
 
 static final CoordRec char59_stroke1[] = {
     new CoordRec((float) 57.1429, (float) 4.7619 ),
-    new CoordRec((float) 52.381, (float) 0 ),
+    new CoordRec((float) 52.381, 0 ),
     new CoordRec((float) 47.6191, (float) 4.7619 ),
     new CoordRec((float) 52.381, (float) 9.5238 ),
     new CoordRec((float) 57.1429, (float) 4.7619 ),
@@ -684,7 +684,7 @@ static final StrokeRec char59[] = {
 static final CoordRec char60_stroke0[] = {
     new CoordRec((float) 90.4762, (float) 85.7143 ),
     new CoordRec((float) 14.2857, (float) 42.8571 ),
-    new CoordRec((float) 90.4762, (float) 0 ),
+    new CoordRec((float) 90.4762, 0 ),
 };
 
 static final StrokeRec char60[] = {
@@ -713,7 +713,7 @@ static final StrokeRec char61[] = {
 static final CoordRec char62_stroke0[] = {
     new CoordRec((float) 14.2857, (float) 85.7143 ),
     new CoordRec((float) 90.4762, (float) 42.8571 ),
-    new CoordRec((float) 14.2857, (float) 0 ),
+    new CoordRec((float) 14.2857, 0 ),
 };
 
 static final StrokeRec char62[] = {
@@ -727,8 +727,8 @@ static final CoordRec char63_stroke0[] = {
     new CoordRec((float) 23.8095, (float) 80.9524 ),
     new CoordRec((float) 28.5714, (float) 90.4762 ),
     new CoordRec((float) 33.3333, (float) 95.2381 ),
-    new CoordRec((float) 42.8571, (float) 100 ),
-    new CoordRec((float) 61.9047, (float) 100 ),
+    new CoordRec((float) 42.8571, 100 ),
+    new CoordRec((float) 61.9047, 100 ),
     new CoordRec((float) 71.4285, (float) 95.2381 ),
     new CoordRec((float) 76.1905, (float) 90.4762 ),
     new CoordRec((float) 80.9524, (float) 80.9524 ),
@@ -742,7 +742,7 @@ static final CoordRec char63_stroke0[] = {
 static final CoordRec char63_stroke1[] = {
     new CoordRec((float) 52.3809, (float) 9.5238 ),
     new CoordRec((float) 47.619, (float) 4.7619 ),
-    new CoordRec((float) 52.3809, (float) 0 ),
+    new CoordRec((float) 52.3809, 0 ),
     new CoordRec((float) 57.1428, (float) 4.7619 ),
     new CoordRec((float) 52.3809, (float) 9.5238 ),
 };
@@ -775,14 +775,14 @@ static final CoordRec char64_stroke1[] = {
     new CoordRec((float) 78.5714, (float) 61.9048 ),
     new CoordRec((float) 69.0476, (float) 71.4286 ),
     new CoordRec((float) 54.7619, (float) 76.1905 ),
-    new CoordRec((float) 50, (float) 76.1905 ),
+    new CoordRec(50, (float) 76.1905 ),
     new CoordRec((float) 35.7143, (float) 71.4286 ),
     new CoordRec((float) 26.1905, (float) 61.9048 ),
     new CoordRec((float) 21.4286, (float) 47.619 ),
     new CoordRec((float) 21.4286, (float) 42.8571 ),
     new CoordRec((float) 26.1905, (float) 28.5714 ),
     new CoordRec((float) 35.7143, (float) 19.0476 ),
-    new CoordRec((float) 50, (float) 14.2857 ),
+    new CoordRec(50, (float) 14.2857 ),
     new CoordRec((float) 54.7619, (float) 14.2857 ),
     new CoordRec((float) 69.0476, (float) 19.0476 ),
 };
@@ -795,13 +795,13 @@ static final StrokeRec char64[] = {
 /* char: 65 'A' */
 
 static final CoordRec char65_stroke0[] = {
-    new CoordRec((float) 52.3809, (float) 100 ),
-    new CoordRec((float) 14.2857, (float) 0 ),
+    new CoordRec((float) 52.3809, 100 ),
+    new CoordRec((float) 14.2857, 0 ),
 };
 
 static final CoordRec char65_stroke1[] = {
-    new CoordRec((float) 52.3809, (float) 100 ),
-    new CoordRec((float) 90.4762, (float) 0 ),
+    new CoordRec((float) 52.3809, 100 ),
+    new CoordRec((float) 90.4762, 0 ),
 };
 
 static final CoordRec char65_stroke2[] = {
@@ -818,13 +818,13 @@ static final StrokeRec char65[] = {
 /* char: 66 'B' */
 
 static final CoordRec char66_stroke0[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 19.0476, (float) 0 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 19.0476, 0 ),
 };
 
 static final CoordRec char66_stroke1[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 61.9047, (float) 100 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 61.9047, 100 ),
     new CoordRec((float) 76.1905, (float) 95.2381 ),
     new CoordRec((float) 80.9524, (float) 90.4762 ),
     new CoordRec((float) 85.7143, (float) 80.9524 ),
@@ -843,8 +843,8 @@ static final CoordRec char66_stroke2[] = {
     new CoordRec((float) 85.7143, (float) 19.0476 ),
     new CoordRec((float) 80.9524, (float) 9.5238 ),
     new CoordRec((float) 76.1905, (float) 4.7619 ),
-    new CoordRec((float) 61.9047, (float) 0 ),
-    new CoordRec((float) 19.0476, (float) 0 ),
+    new CoordRec((float) 61.9047, 0 ),
+    new CoordRec((float) 19.0476, 0 ),
 };
 
 static final StrokeRec char66[] = {
@@ -859,8 +859,8 @@ static final CoordRec char67_stroke0[] = {
     new CoordRec((float) 88.0952, (float) 76.1905 ),
     new CoordRec((float) 83.3334, (float) 85.7143 ),
     new CoordRec((float) 73.8096, (float) 95.2381 ),
-    new CoordRec((float) 64.2857, (float) 100 ),
-    new CoordRec((float) 45.2381, (float) 100 ),
+    new CoordRec((float) 64.2857, 100 ),
+    new CoordRec((float) 45.2381, 100 ),
     new CoordRec((float) 35.7143, (float) 95.2381 ),
     new CoordRec((float) 26.1905, (float) 85.7143 ),
     new CoordRec((float) 21.4286, (float) 76.1905 ),
@@ -869,8 +869,8 @@ static final CoordRec char67_stroke0[] = {
     new CoordRec((float) 21.4286, (float) 23.8095 ),
     new CoordRec((float) 26.1905, (float) 14.2857 ),
     new CoordRec((float) 35.7143, (float) 4.7619 ),
-    new CoordRec((float) 45.2381, (float) 0 ),
-    new CoordRec((float) 64.2857, (float) 0 ),
+    new CoordRec((float) 45.2381, 0 ),
+    new CoordRec((float) 64.2857, 0 ),
     new CoordRec((float) 73.8096, (float) 4.7619 ),
     new CoordRec((float) 83.3334, (float) 14.2857 ),
     new CoordRec((float) 88.0952, (float) 23.8095 ),
@@ -883,13 +883,13 @@ static final StrokeRec char67[] = {
 /* char: 68 'D' */
 
 static final CoordRec char68_stroke0[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 19.0476, (float) 0 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 19.0476, 0 ),
 };
 
 static final CoordRec char68_stroke1[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 52.3809, (float) 100 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 52.3809, 100 ),
     new CoordRec((float) 66.6666, (float) 95.2381 ),
     new CoordRec((float) 76.1905, (float) 85.7143 ),
     new CoordRec((float) 80.9524, (float) 76.1905 ),
@@ -898,8 +898,8 @@ static final CoordRec char68_stroke1[] = {
     new CoordRec((float) 80.9524, (float) 23.8095 ),
     new CoordRec((float) 76.1905, (float) 14.2857 ),
     new CoordRec((float) 66.6666, (float) 4.7619 ),
-    new CoordRec((float) 52.3809, (float) 0 ),
-    new CoordRec((float) 19.0476, (float) 0 ),
+    new CoordRec((float) 52.3809, 0 ),
+    new CoordRec((float) 19.0476, 0 ),
 };
 
 static final StrokeRec char68[] = {
@@ -910,13 +910,13 @@ static final StrokeRec char68[] = {
 /* char: 69 'E' */
 
 static final CoordRec char69_stroke0[] = {
-    new CoordRec((float) 21.4286, (float) 100 ),
-    new CoordRec((float) 21.4286, (float) 0 ),
+    new CoordRec((float) 21.4286, 100 ),
+    new CoordRec((float) 21.4286, 0 ),
 };
 
 static final CoordRec char69_stroke1[] = {
-    new CoordRec((float) 21.4286, (float) 100 ),
-    new CoordRec((float) 83.3334, (float) 100 ),
+    new CoordRec((float) 21.4286, 100 ),
+    new CoordRec((float) 83.3334, 100 ),
 };
 
 static final CoordRec char69_stroke2[] = {
@@ -925,8 +925,8 @@ static final CoordRec char69_stroke2[] = {
 };
 
 static final CoordRec char69_stroke3[] = {
-    new CoordRec((float) 21.4286, (float) 0 ),
-    new CoordRec((float) 83.3334, (float) 0 ),
+    new CoordRec((float) 21.4286, 0 ),
+    new CoordRec((float) 83.3334, 0 ),
 };
 
 static final StrokeRec char69[] = {
@@ -939,13 +939,13 @@ static final StrokeRec char69[] = {
 /* char: 70 'F' */
 
 static final CoordRec char70_stroke0[] = {
-    new CoordRec((float) 21.4286, (float) 100 ),
-    new CoordRec((float) 21.4286, (float) 0 ),
+    new CoordRec((float) 21.4286, 100 ),
+    new CoordRec((float) 21.4286, 0 ),
 };
 
 static final CoordRec char70_stroke1[] = {
-    new CoordRec((float) 21.4286, (float) 100 ),
-    new CoordRec((float) 83.3334, (float) 100 ),
+    new CoordRec((float) 21.4286, 100 ),
+    new CoordRec((float) 83.3334, 100 ),
 };
 
 static final CoordRec char70_stroke2[] = {
@@ -965,8 +965,8 @@ static final CoordRec char71_stroke0[] = {
     new CoordRec((float) 88.0952, (float) 76.1905 ),
     new CoordRec((float) 83.3334, (float) 85.7143 ),
     new CoordRec((float) 73.8096, (float) 95.2381 ),
-    new CoordRec((float) 64.2857, (float) 100 ),
-    new CoordRec((float) 45.2381, (float) 100 ),
+    new CoordRec((float) 64.2857, 100 ),
+    new CoordRec((float) 45.2381, 100 ),
     new CoordRec((float) 35.7143, (float) 95.2381 ),
     new CoordRec((float) 26.1905, (float) 85.7143 ),
     new CoordRec((float) 21.4286, (float) 76.1905 ),
@@ -975,8 +975,8 @@ static final CoordRec char71_stroke0[] = {
     new CoordRec((float) 21.4286, (float) 23.8095 ),
     new CoordRec((float) 26.1905, (float) 14.2857 ),
     new CoordRec((float) 35.7143, (float) 4.7619 ),
-    new CoordRec((float) 45.2381, (float) 0 ),
-    new CoordRec((float) 64.2857, (float) 0 ),
+    new CoordRec((float) 45.2381, 0 ),
+    new CoordRec((float) 64.2857, 0 ),
     new CoordRec((float) 73.8096, (float) 4.7619 ),
     new CoordRec((float) 83.3334, (float) 14.2857 ),
     new CoordRec((float) 88.0952, (float) 23.8095 ),
@@ -996,13 +996,13 @@ static final StrokeRec char71[] = {
 /* char: 72 'H' */
 
 static final CoordRec char72_stroke0[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 19.0476, (float) 0 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 19.0476, 0 ),
 };
 
 static final CoordRec char72_stroke1[] = {
-    new CoordRec((float) 85.7143, (float) 100 ),
-    new CoordRec((float) 85.7143, (float) 0 ),
+    new CoordRec((float) 85.7143, 100 ),
+    new CoordRec((float) 85.7143, 0 ),
 };
 
 static final CoordRec char72_stroke2[] = {
@@ -1019,8 +1019,8 @@ static final StrokeRec char72[] = {
 /* char: 73 'I' */
 
 static final CoordRec char73_stroke0[] = {
-    new CoordRec((float) 52.381, (float) 100 ),
-    new CoordRec((float) 52.381, (float) 0 ),
+    new CoordRec((float) 52.381, 100 ),
+    new CoordRec((float) 52.381, 0 ),
 };
 
 static final StrokeRec char73[] = {
@@ -1030,12 +1030,12 @@ static final StrokeRec char73[] = {
 /* char: 74 'J' */
 
 static final CoordRec char74_stroke0[] = {
-    new CoordRec((float) 76.1905, (float) 100 ),
+    new CoordRec((float) 76.1905, 100 ),
     new CoordRec((float) 76.1905, (float) 23.8095 ),
     new CoordRec((float) 71.4286, (float) 9.5238 ),
     new CoordRec((float) 66.6667, (float) 4.7619 ),
-    new CoordRec((float) 57.1429, (float) 0 ),
-    new CoordRec((float) 47.6191, (float) 0 ),
+    new CoordRec((float) 57.1429, 0 ),
+    new CoordRec((float) 47.6191, 0 ),
     new CoordRec((float) 38.0953, (float) 4.7619 ),
     new CoordRec((float) 33.3334, (float) 9.5238 ),
     new CoordRec((float) 28.5715, (float) 23.8095 ),
@@ -1049,18 +1049,18 @@ static final StrokeRec char74[] = {
 /* char: 75 'K' */
 
 static final CoordRec char75_stroke0[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 19.0476, (float) 0 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 19.0476, 0 ),
 };
 
 static final CoordRec char75_stroke1[] = {
-    new CoordRec((float) 85.7143, (float) 100 ),
+    new CoordRec((float) 85.7143, 100 ),
     new CoordRec((float) 19.0476, (float) 33.3333 ),
 };
 
 static final CoordRec char75_stroke2[] = {
     new CoordRec((float) 42.8571, (float) 57.1429 ),
-    new CoordRec((float) 85.7143, (float) 0 ),
+    new CoordRec((float) 85.7143, 0 ),
 };
 
 static final StrokeRec char75[] = {
@@ -1072,13 +1072,13 @@ static final StrokeRec char75[] = {
 /* char: 76 'L' */
 
 static final CoordRec char76_stroke0[] = {
-    new CoordRec((float) 23.8095, (float) 100 ),
-    new CoordRec((float) 23.8095, (float) 0 ),
+    new CoordRec((float) 23.8095, 100 ),
+    new CoordRec((float) 23.8095, 0 ),
 };
 
 static final CoordRec char76_stroke1[] = {
-    new CoordRec((float) 23.8095, (float) 0 ),
-    new CoordRec((float) 80.9524, (float) 0 ),
+    new CoordRec((float) 23.8095, 0 ),
+    new CoordRec((float) 80.9524, 0 ),
 };
 
 static final StrokeRec char76[] = {
@@ -1089,23 +1089,23 @@ static final StrokeRec char76[] = {
 /* char: 77 'M' */
 
 static final CoordRec char77_stroke0[] = {
-    new CoordRec((float) 14.2857, (float) 100 ),
-    new CoordRec((float) 14.2857, (float) 0 ),
+    new CoordRec((float) 14.2857, 100 ),
+    new CoordRec((float) 14.2857, 0 ),
 };
 
 static final CoordRec char77_stroke1[] = {
-    new CoordRec((float) 14.2857, (float) 100 ),
-    new CoordRec((float) 52.3809, (float) 0 ),
+    new CoordRec((float) 14.2857, 100 ),
+    new CoordRec((float) 52.3809, 0 ),
 };
 
 static final CoordRec char77_stroke2[] = {
-    new CoordRec((float) 90.4762, (float) 100 ),
-    new CoordRec((float) 52.3809, (float) 0 ),
+    new CoordRec((float) 90.4762, 100 ),
+    new CoordRec((float) 52.3809, 0 ),
 };
 
 static final CoordRec char77_stroke3[] = {
-    new CoordRec((float) 90.4762, (float) 100 ),
-    new CoordRec((float) 90.4762, (float) 0 ),
+    new CoordRec((float) 90.4762, 100 ),
+    new CoordRec((float) 90.4762, 0 ),
 };
 
 static final StrokeRec char77[] = {
@@ -1118,18 +1118,18 @@ static final StrokeRec char77[] = {
 /* char: 78 'N' */
 
 static final CoordRec char78_stroke0[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 19.0476, (float) 0 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 19.0476, 0 ),
 };
 
 static final CoordRec char78_stroke1[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 85.7143, (float) 0 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 85.7143, 0 ),
 };
 
 static final CoordRec char78_stroke2[] = {
-    new CoordRec((float) 85.7143, (float) 100 ),
-    new CoordRec((float) 85.7143, (float) 0 ),
+    new CoordRec((float) 85.7143, 100 ),
+    new CoordRec((float) 85.7143, 0 ),
 };
 
 static final StrokeRec char78[] = {
@@ -1141,7 +1141,7 @@ static final StrokeRec char78[] = {
 /* char: 79 'O' */
 
 static final CoordRec char79_stroke0[] = {
-    new CoordRec((float) 42.8571, (float) 100 ),
+    new CoordRec((float) 42.8571, 100 ),
     new CoordRec((float) 33.3333, (float) 95.2381 ),
     new CoordRec((float) 23.8095, (float) 85.7143 ),
     new CoordRec((float) 19.0476, (float) 76.1905 ),
@@ -1150,8 +1150,8 @@ static final CoordRec char79_stroke0[] = {
     new CoordRec((float) 19.0476, (float) 23.8095 ),
     new CoordRec((float) 23.8095, (float) 14.2857 ),
     new CoordRec((float) 33.3333, (float) 4.7619 ),
-    new CoordRec((float) 42.8571, (float) 0 ),
-    new CoordRec((float) 61.9047, (float) 0 ),
+    new CoordRec((float) 42.8571, 0 ),
+    new CoordRec((float) 61.9047, 0 ),
     new CoordRec((float) 71.4286, (float) 4.7619 ),
     new CoordRec((float) 80.9524, (float) 14.2857 ),
     new CoordRec((float) 85.7143, (float) 23.8095 ),
@@ -1160,8 +1160,8 @@ static final CoordRec char79_stroke0[] = {
     new CoordRec((float) 85.7143, (float) 76.1905 ),
     new CoordRec((float) 80.9524, (float) 85.7143 ),
     new CoordRec((float) 71.4286, (float) 95.2381 ),
-    new CoordRec((float) 61.9047, (float) 100 ),
-    new CoordRec((float) 42.8571, (float) 100 ),
+    new CoordRec((float) 61.9047, 100 ),
+    new CoordRec((float) 42.8571, 100 ),
 };
 
 static final StrokeRec char79[] = {
@@ -1171,13 +1171,13 @@ static final StrokeRec char79[] = {
 /* char: 80 'P' */
 
 static final CoordRec char80_stroke0[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 19.0476, (float) 0 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 19.0476, 0 ),
 };
 
 static final CoordRec char80_stroke1[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 61.9047, (float) 100 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 61.9047, 100 ),
     new CoordRec((float) 76.1905, (float) 95.2381 ),
     new CoordRec((float) 80.9524, (float) 90.4762 ),
     new CoordRec((float) 85.7143, (float) 80.9524 ),
@@ -1196,7 +1196,7 @@ static final StrokeRec char80[] = {
 /* char: 81 'Q' */
 
 static final CoordRec char81_stroke0[] = {
-    new CoordRec((float) 42.8571, (float) 100 ),
+    new CoordRec((float) 42.8571, 100 ),
     new CoordRec((float) 33.3333, (float) 95.2381 ),
     new CoordRec((float) 23.8095, (float) 85.7143 ),
     new CoordRec((float) 19.0476, (float) 76.1905 ),
@@ -1205,8 +1205,8 @@ static final CoordRec char81_stroke0[] = {
     new CoordRec((float) 19.0476, (float) 23.8095 ),
     new CoordRec((float) 23.8095, (float) 14.2857 ),
     new CoordRec((float) 33.3333, (float) 4.7619 ),
-    new CoordRec((float) 42.8571, (float) 0 ),
-    new CoordRec((float) 61.9047, (float) 0 ),
+    new CoordRec((float) 42.8571, 0 ),
+    new CoordRec((float) 61.9047, 0 ),
     new CoordRec((float) 71.4286, (float) 4.7619 ),
     new CoordRec((float) 80.9524, (float) 14.2857 ),
     new CoordRec((float) 85.7143, (float) 23.8095 ),
@@ -1215,8 +1215,8 @@ static final CoordRec char81_stroke0[] = {
     new CoordRec((float) 85.7143, (float) 76.1905 ),
     new CoordRec((float) 80.9524, (float) 85.7143 ),
     new CoordRec((float) 71.4286, (float) 95.2381 ),
-    new CoordRec((float) 61.9047, (float) 100 ),
-    new CoordRec((float) 42.8571, (float) 100 ),
+    new CoordRec((float) 61.9047, 100 ),
+    new CoordRec((float) 42.8571, 100 ),
 };
 
 static final CoordRec char81_stroke1[] = {
@@ -1232,13 +1232,13 @@ static final StrokeRec char81[] = {
 /* char: 82 'R' */
 
 static final CoordRec char82_stroke0[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 19.0476, (float) 0 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 19.0476, 0 ),
 };
 
 static final CoordRec char82_stroke1[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 61.9047, (float) 100 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 61.9047, 100 ),
     new CoordRec((float) 76.1905, (float) 95.2381 ),
     new CoordRec((float) 80.9524, (float) 90.4762 ),
     new CoordRec((float) 85.7143, (float) 80.9524 ),
@@ -1251,7 +1251,7 @@ static final CoordRec char82_stroke1[] = {
 
 static final CoordRec char82_stroke2[] = {
     new CoordRec((float) 52.3809, (float) 52.381 ),
-    new CoordRec((float) 85.7143, (float) 0 ),
+    new CoordRec((float) 85.7143, 0 ),
 };
 
 static final StrokeRec char82[] = {
@@ -1265,8 +1265,8 @@ static final StrokeRec char82[] = {
 static final CoordRec char83_stroke0[] = {
     new CoordRec((float) 85.7143, (float) 85.7143 ),
     new CoordRec((float) 76.1905, (float) 95.2381 ),
-    new CoordRec((float) 61.9047, (float) 100 ),
-    new CoordRec((float) 42.8571, (float) 100 ),
+    new CoordRec((float) 61.9047, 100 ),
+    new CoordRec((float) 42.8571, 100 ),
     new CoordRec((float) 28.5714, (float) 95.2381 ),
     new CoordRec((float) 19.0476, (float) 85.7143 ),
     new CoordRec((float) 19.0476, (float) 76.1905 ),
@@ -1279,8 +1279,8 @@ static final CoordRec char83_stroke0[] = {
     new CoordRec((float) 85.7143, (float) 28.5714 ),
     new CoordRec((float) 85.7143, (float) 14.2857 ),
     new CoordRec((float) 76.1905, (float) 4.7619 ),
-    new CoordRec((float) 61.9047, (float) 0 ),
-    new CoordRec((float) 42.8571, (float) 0 ),
+    new CoordRec((float) 61.9047, 0 ),
+    new CoordRec((float) 42.8571, 0 ),
     new CoordRec((float) 28.5714, (float) 4.7619 ),
     new CoordRec((float) 19.0476, (float) 14.2857 ),
 };
@@ -1292,13 +1292,13 @@ static final StrokeRec char83[] = {
 /* char: 84 'T' */
 
 static final CoordRec char84_stroke0[] = {
-    new CoordRec((float) 52.3809, (float) 100 ),
-    new CoordRec((float) 52.3809, (float) 0 ),
+    new CoordRec((float) 52.3809, 100 ),
+    new CoordRec((float) 52.3809, 0 ),
 };
 
 static final CoordRec char84_stroke1[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 85.7143, (float) 100 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 85.7143, 100 ),
 };
 
 static final StrokeRec char84[] = {
@@ -1309,16 +1309,16 @@ static final StrokeRec char84[] = {
 /* char: 85 'U' */
 
 static final CoordRec char85_stroke0[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
+    new CoordRec((float) 19.0476, 100 ),
     new CoordRec((float) 19.0476, (float) 28.5714 ),
     new CoordRec((float) 23.8095, (float) 14.2857 ),
     new CoordRec((float) 33.3333, (float) 4.7619 ),
-    new CoordRec((float) 47.619, (float) 0 ),
-    new CoordRec((float) 57.1428, (float) 0 ),
+    new CoordRec((float) 47.619, 0 ),
+    new CoordRec((float) 57.1428, 0 ),
     new CoordRec((float) 71.4286, (float) 4.7619 ),
     new CoordRec((float) 80.9524, (float) 14.2857 ),
     new CoordRec((float) 85.7143, (float) 28.5714 ),
-    new CoordRec((float) 85.7143, (float) 100 ),
+    new CoordRec((float) 85.7143, 100 ),
 };
 
 static final StrokeRec char85[] = {
@@ -1328,13 +1328,13 @@ static final StrokeRec char85[] = {
 /* char: 86 'V' */
 
 static final CoordRec char86_stroke0[] = {
-    new CoordRec((float) 14.2857, (float) 100 ),
-    new CoordRec((float) 52.3809, (float) 0 ),
+    new CoordRec((float) 14.2857, 100 ),
+    new CoordRec((float) 52.3809, 0 ),
 };
 
 static final CoordRec char86_stroke1[] = {
-    new CoordRec((float) 90.4762, (float) 100 ),
-    new CoordRec((float) 52.3809, (float) 0 ),
+    new CoordRec((float) 90.4762, 100 ),
+    new CoordRec((float) 52.3809, 0 ),
 };
 
 static final StrokeRec char86[] = {
@@ -1345,23 +1345,23 @@ static final StrokeRec char86[] = {
 /* char: 87 'W' */
 
 static final CoordRec char87_stroke0[] = {
-    new CoordRec((float) 4.7619, (float) 100 ),
-    new CoordRec((float) 28.5714, (float) 0 ),
+    new CoordRec((float) 4.7619, 100 ),
+    new CoordRec((float) 28.5714, 0 ),
 };
 
 static final CoordRec char87_stroke1[] = {
-    new CoordRec((float) 52.3809, (float) 100 ),
-    new CoordRec((float) 28.5714, (float) 0 ),
+    new CoordRec((float) 52.3809, 100 ),
+    new CoordRec((float) 28.5714, 0 ),
 };
 
 static final CoordRec char87_stroke2[] = {
-    new CoordRec((float) 52.3809, (float) 100 ),
-    new CoordRec((float) 76.1905, (float) 0 ),
+    new CoordRec((float) 52.3809, 100 ),
+    new CoordRec((float) 76.1905, 0 ),
 };
 
 static final CoordRec char87_stroke3[] = {
-    new CoordRec((float) 100, (float) 100 ),
-    new CoordRec((float) 76.1905, (float) 0 ),
+    new CoordRec(100, 100 ),
+    new CoordRec((float) 76.1905, 0 ),
 };
 
 static final StrokeRec char87[] = {
@@ -1374,13 +1374,13 @@ static final StrokeRec char87[] = {
 /* char: 88 'X' */
 
 static final CoordRec char88_stroke0[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 85.7143, (float) 0 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 85.7143, 0 ),
 };
 
 static final CoordRec char88_stroke1[] = {
-    new CoordRec((float) 85.7143, (float) 100 ),
-    new CoordRec((float) 19.0476, (float) 0 ),
+    new CoordRec((float) 85.7143, 100 ),
+    new CoordRec((float) 19.0476, 0 ),
 };
 
 static final StrokeRec char88[] = {
@@ -1391,13 +1391,13 @@ static final StrokeRec char88[] = {
 /* char: 89 'Y' */
 
 static final CoordRec char89_stroke0[] = {
-    new CoordRec((float) 14.2857, (float) 100 ),
+    new CoordRec((float) 14.2857, 100 ),
     new CoordRec((float) 52.3809, (float) 52.381 ),
-    new CoordRec((float) 52.3809, (float) 0 ),
+    new CoordRec((float) 52.3809, 0 ),
 };
 
 static final CoordRec char89_stroke1[] = {
-    new CoordRec((float) 90.4762, (float) 100 ),
+    new CoordRec((float) 90.4762, 100 ),
     new CoordRec((float) 52.3809, (float) 52.381 ),
 };
 
@@ -1409,18 +1409,18 @@ static final StrokeRec char89[] = {
 /* char: 90 'Z' */
 
 static final CoordRec char90_stroke0[] = {
-    new CoordRec((float) 85.7143, (float) 100 ),
-    new CoordRec((float) 19.0476, (float) 0 ),
+    new CoordRec((float) 85.7143, 100 ),
+    new CoordRec((float) 19.0476, 0 ),
 };
 
 static final CoordRec char90_stroke1[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
-    new CoordRec((float) 85.7143, (float) 100 ),
+    new CoordRec((float) 19.0476, 100 ),
+    new CoordRec((float) 85.7143, 100 ),
 };
 
 static final CoordRec char90_stroke2[] = {
-    new CoordRec((float) 19.0476, (float) 0 ),
-    new CoordRec((float) 85.7143, (float) 0 ),
+    new CoordRec((float) 19.0476, 0 ),
+    new CoordRec((float) 85.7143, 0 ),
 };
 
 static final StrokeRec char90[] = {
@@ -1461,7 +1461,7 @@ static final StrokeRec char91[] = {
 /* char: 92 '\' */
 
 static final CoordRec char92_stroke0[] = {
-    new CoordRec((float) 19.0476, (float) 100 ),
+    new CoordRec((float) 19.0476, 100 ),
     new CoordRec((float) 85.7143, (float) -14.2857 ),
 };
 
@@ -1518,11 +1518,11 @@ static final StrokeRec char94[] = {
 /* char: 95 '_' */
 
 static final CoordRec char95_stroke0[] = {
-    new CoordRec((float) 0, (float) -33.3333 ),
+    new CoordRec(0, (float) -33.3333 ),
     new CoordRec((float) 104.762, (float) -33.3333 ),
     new CoordRec((float) 104.762, (float) -28.5714 ),
-    new CoordRec((float) 0, (float) -28.5714 ),
-    new CoordRec((float) 0, (float) -33.3333 ),
+    new CoordRec(0, (float) -28.5714 ),
+    new CoordRec(0, (float) -33.3333 ),
 };
 
 static final StrokeRec char95[] = {
@@ -1532,12 +1532,12 @@ static final StrokeRec char95[] = {
 /* char: 96 '`' */
 
 static final CoordRec char96_stroke0[] = {
-    new CoordRec((float) 42.8572, (float) 100 ),
+    new CoordRec((float) 42.8572, 100 ),
     new CoordRec((float) 66.6667, (float) 71.4286 ),
 };
 
 static final CoordRec char96_stroke1[] = {
-    new CoordRec((float) 42.8572, (float) 100 ),
+    new CoordRec((float) 42.8572, 100 ),
     new CoordRec((float) 38.0953, (float) 95.2381 ),
     new CoordRec((float) 66.6667, (float) 71.4286 ),
 };
@@ -1551,7 +1551,7 @@ static final StrokeRec char96[] = {
 
 static final CoordRec char97_stroke0[] = {
     new CoordRec((float) 80.9524, (float) 66.6667 ),
-    new CoordRec((float) 80.9524, (float) 0 ),
+    new CoordRec((float) 80.9524, 0 ),
 };
 
 static final CoordRec char97_stroke1[] = {
@@ -1565,8 +1565,8 @@ static final CoordRec char97_stroke1[] = {
     new CoordRec((float) 23.8095, (float) 28.5714 ),
     new CoordRec((float) 28.5714, (float) 14.2857 ),
     new CoordRec((float) 38.0952, (float) 4.7619 ),
-    new CoordRec((float) 47.619, (float) 0 ),
-    new CoordRec((float) 61.9047, (float) 0 ),
+    new CoordRec((float) 47.619, 0 ),
+    new CoordRec((float) 61.9047, 0 ),
     new CoordRec((float) 71.4285, (float) 4.7619 ),
     new CoordRec((float) 80.9524, (float) 14.2857 ),
 };
@@ -1579,8 +1579,8 @@ static final StrokeRec char97[] = {
 /* char: 98 'b' */
 
 static final CoordRec char98_stroke0[] = {
-    new CoordRec((float) 23.8095, (float) 100 ),
-    new CoordRec((float) 23.8095, (float) 0 ),
+    new CoordRec((float) 23.8095, 100 ),
+    new CoordRec((float) 23.8095, 0 ),
 };
 
 static final CoordRec char98_stroke1[] = {
@@ -1594,8 +1594,8 @@ static final CoordRec char98_stroke1[] = {
     new CoordRec((float) 80.9524, (float) 28.5714 ),
     new CoordRec((float) 76.1905, (float) 14.2857 ),
     new CoordRec((float) 66.6666, (float) 4.7619 ),
-    new CoordRec((float) 57.1428, (float) 0 ),
-    new CoordRec((float) 42.8571, (float) 0 ),
+    new CoordRec((float) 57.1428, 0 ),
+    new CoordRec((float) 42.8571, 0 ),
     new CoordRec((float) 33.3333, (float) 4.7619 ),
     new CoordRec((float) 23.8095, (float) 14.2857 ),
 };
@@ -1618,8 +1618,8 @@ static final CoordRec char99_stroke0[] = {
     new CoordRec((float) 23.8095, (float) 28.5714 ),
     new CoordRec((float) 28.5714, (float) 14.2857 ),
     new CoordRec((float) 38.0952, (float) 4.7619 ),
-    new CoordRec((float) 47.619, (float) 0 ),
-    new CoordRec((float) 61.9047, (float) 0 ),
+    new CoordRec((float) 47.619, 0 ),
+    new CoordRec((float) 61.9047, 0 ),
     new CoordRec((float) 71.4285, (float) 4.7619 ),
     new CoordRec((float) 80.9524, (float) 14.2857 ),
 };
@@ -1631,8 +1631,8 @@ static final StrokeRec char99[] = {
 /* char: 100 'd' */
 
 static final CoordRec char100_stroke0[] = {
-    new CoordRec((float) 80.9524, (float) 100 ),
-    new CoordRec((float) 80.9524, (float) 0 ),
+    new CoordRec((float) 80.9524, 100 ),
+    new CoordRec((float) 80.9524, 0 ),
 };
 
 static final CoordRec char100_stroke1[] = {
@@ -1646,8 +1646,8 @@ static final CoordRec char100_stroke1[] = {
     new CoordRec((float) 23.8095, (float) 28.5714 ),
     new CoordRec((float) 28.5714, (float) 14.2857 ),
     new CoordRec((float) 38.0952, (float) 4.7619 ),
-    new CoordRec((float) 47.619, (float) 0 ),
-    new CoordRec((float) 61.9047, (float) 0 ),
+    new CoordRec((float) 47.619, 0 ),
+    new CoordRec((float) 61.9047, 0 ),
     new CoordRec((float) 71.4285, (float) 4.7619 ),
     new CoordRec((float) 80.9524, (float) 14.2857 ),
 };
@@ -1673,8 +1673,8 @@ static final CoordRec char101_stroke0[] = {
     new CoordRec((float) 23.8095, (float) 28.5714 ),
     new CoordRec((float) 28.5714, (float) 14.2857 ),
     new CoordRec((float) 38.0952, (float) 4.7619 ),
-    new CoordRec((float) 47.619, (float) 0 ),
-    new CoordRec((float) 61.9047, (float) 0 ),
+    new CoordRec((float) 47.619, 0 ),
+    new CoordRec((float) 61.9047, 0 ),
     new CoordRec((float) 71.4285, (float) 4.7619 ),
     new CoordRec((float) 80.9524, (float) 14.2857 ),
 };
@@ -1686,11 +1686,11 @@ static final StrokeRec char101[] = {
 /* char: 102 'f' */
 
 static final CoordRec char102_stroke0[] = {
-    new CoordRec((float) 71.4286, (float) 100 ),
-    new CoordRec((float) 61.9048, (float) 100 ),
+    new CoordRec((float) 71.4286, 100 ),
+    new CoordRec((float) 61.9048, 100 ),
     new CoordRec((float) 52.381, (float) 95.2381 ),
     new CoordRec((float) 47.6191, (float) 80.9524 ),
-    new CoordRec((float) 47.6191, (float) 0 ),
+    new CoordRec((float) 47.6191, 0 ),
 };
 
 static final CoordRec char102_stroke1[] = {
@@ -1726,8 +1726,8 @@ static final CoordRec char103_stroke1[] = {
     new CoordRec((float) 23.8095, (float) 28.5714 ),
     new CoordRec((float) 28.5714, (float) 14.2857 ),
     new CoordRec((float) 38.0952, (float) 4.7619 ),
-    new CoordRec((float) 47.619, (float) 0 ),
-    new CoordRec((float) 61.9047, (float) 0 ),
+    new CoordRec((float) 47.619, 0 ),
+    new CoordRec((float) 61.9047, 0 ),
     new CoordRec((float) 71.4285, (float) 4.7619 ),
     new CoordRec((float) 80.9524, (float) 14.2857 ),
 };
@@ -1740,18 +1740,18 @@ static final StrokeRec char103[] = {
 /* char: 104 'h' */
 
 static final CoordRec char104_stroke0[] = {
-    new CoordRec((float) 26.1905, (float) 100 ),
-    new CoordRec((float) 26.1905, (float) 0 ),
+    new CoordRec((float) 26.1905, 100 ),
+    new CoordRec((float) 26.1905, 0 ),
 };
 
 static final CoordRec char104_stroke1[] = {
     new CoordRec((float) 26.1905, (float) 47.619 ),
     new CoordRec((float) 40.4762, (float) 61.9048 ),
-    new CoordRec((float) 50, (float) 66.6667 ),
+    new CoordRec(50, (float) 66.6667 ),
     new CoordRec((float) 64.2857, (float) 66.6667 ),
     new CoordRec((float) 73.8095, (float) 61.9048 ),
     new CoordRec((float) 78.5715, (float) 47.619 ),
-    new CoordRec((float) 78.5715, (float) 0 ),
+    new CoordRec((float) 78.5715, 0 ),
 };
 
 static final StrokeRec char104[] = {
@@ -1762,16 +1762,16 @@ static final StrokeRec char104[] = {
 /* char: 105 'i' */
 
 static final CoordRec char105_stroke0[] = {
-    new CoordRec((float) 47.6191, (float) 100 ),
+    new CoordRec((float) 47.6191, 100 ),
     new CoordRec((float) 52.381, (float) 95.2381 ),
-    new CoordRec((float) 57.1429, (float) 100 ),
+    new CoordRec((float) 57.1429, 100 ),
     new CoordRec((float) 52.381, (float) 104.762 ),
-    new CoordRec((float) 47.6191, (float) 100 ),
+    new CoordRec((float) 47.6191, 100 ),
 };
 
 static final CoordRec char105_stroke1[] = {
     new CoordRec((float) 52.381, (float) 66.6667 ),
-    new CoordRec((float) 52.381, (float) 0 ),
+    new CoordRec((float) 52.381, 0 ),
 };
 
 static final StrokeRec char105[] = {
@@ -1782,11 +1782,11 @@ static final StrokeRec char105[] = {
 /* char: 106 'j' */
 
 static final CoordRec char106_stroke0[] = {
-    new CoordRec((float) 57.1429, (float) 100 ),
+    new CoordRec((float) 57.1429, 100 ),
     new CoordRec((float) 61.9048, (float) 95.2381 ),
-    new CoordRec((float) 66.6667, (float) 100 ),
+    new CoordRec((float) 66.6667, 100 ),
     new CoordRec((float) 61.9048, (float) 104.762 ),
-    new CoordRec((float) 57.1429, (float) 100 ),
+    new CoordRec((float) 57.1429, 100 ),
 };
 
 static final CoordRec char106_stroke1[] = {
@@ -1805,8 +1805,8 @@ static final StrokeRec char106[] = {
 /* char: 107 'k' */
 
 static final CoordRec char107_stroke0[] = {
-    new CoordRec((float) 26.1905, (float) 100 ),
-    new CoordRec((float) 26.1905, (float) 0 ),
+    new CoordRec((float) 26.1905, 100 ),
+    new CoordRec((float) 26.1905, 0 ),
 };
 
 static final CoordRec char107_stroke1[] = {
@@ -1816,7 +1816,7 @@ static final CoordRec char107_stroke1[] = {
 
 static final CoordRec char107_stroke2[] = {
     new CoordRec((float) 45.2381, (float) 38.0952 ),
-    new CoordRec((float) 78.5715, (float) 0 ),
+    new CoordRec((float) 78.5715, 0 ),
 };
 
 static final StrokeRec char107[] = {
@@ -1828,8 +1828,8 @@ static final StrokeRec char107[] = {
 /* char: 108 'l' */
 
 static final CoordRec char108_stroke0[] = {
-    new CoordRec((float) 52.381, (float) 100 ),
-    new CoordRec((float) 52.381, (float) 0 ),
+    new CoordRec((float) 52.381, 100 ),
+    new CoordRec((float) 52.381, 0 ),
 };
 
 static final StrokeRec char108[] = {
@@ -1839,18 +1839,18 @@ static final StrokeRec char108[] = {
 /* char: 109 'm' */
 
 static final CoordRec char109_stroke0[] = {
-    new CoordRec((float) 0, (float) 66.6667 ),
-    new CoordRec((float) 0, (float) 0 ),
+    new CoordRec(0, (float) 66.6667 ),
+    new CoordRec(0, 0 ),
 };
 
 static final CoordRec char109_stroke1[] = {
-    new CoordRec((float) 0, (float) 47.619 ),
+    new CoordRec(0, (float) 47.619 ),
     new CoordRec((float) 14.2857, (float) 61.9048 ),
     new CoordRec((float) 23.8095, (float) 66.6667 ),
     new CoordRec((float) 38.0952, (float) 66.6667 ),
     new CoordRec((float) 47.619, (float) 61.9048 ),
     new CoordRec((float) 52.381, (float) 47.619 ),
-    new CoordRec((float) 52.381, (float) 0 ),
+    new CoordRec((float) 52.381, 0 ),
 };
 
 static final CoordRec char109_stroke2[] = {
@@ -1858,9 +1858,9 @@ static final CoordRec char109_stroke2[] = {
     new CoordRec((float) 66.6667, (float) 61.9048 ),
     new CoordRec((float) 76.1905, (float) 66.6667 ),
     new CoordRec((float) 90.4762, (float) 66.6667 ),
-    new CoordRec((float) 100, (float) 61.9048 ),
+    new CoordRec(100, (float) 61.9048 ),
     new CoordRec((float) 104.762, (float) 47.619 ),
-    new CoordRec((float) 104.762, (float) 0 ),
+    new CoordRec((float) 104.762, 0 ),
 };
 
 static final StrokeRec char109[] = {
@@ -1873,17 +1873,17 @@ static final StrokeRec char109[] = {
 
 static final CoordRec char110_stroke0[] = {
     new CoordRec((float) 26.1905, (float) 66.6667 ),
-    new CoordRec((float) 26.1905, (float) 0 ),
+    new CoordRec((float) 26.1905, 0 ),
 };
 
 static final CoordRec char110_stroke1[] = {
     new CoordRec((float) 26.1905, (float) 47.619 ),
     new CoordRec((float) 40.4762, (float) 61.9048 ),
-    new CoordRec((float) 50, (float) 66.6667 ),
+    new CoordRec(50, (float) 66.6667 ),
     new CoordRec((float) 64.2857, (float) 66.6667 ),
     new CoordRec((float) 73.8095, (float) 61.9048 ),
     new CoordRec((float) 78.5715, (float) 47.619 ),
-    new CoordRec((float) 78.5715, (float) 0 ),
+    new CoordRec((float) 78.5715, 0 ),
 };
 
 static final StrokeRec char110[] = {
@@ -1901,8 +1901,8 @@ static final CoordRec char111_stroke0[] = {
     new CoordRec((float) 21.4286, (float) 28.5714 ),
     new CoordRec((float) 26.1905, (float) 14.2857 ),
     new CoordRec((float) 35.7143, (float) 4.7619 ),
-    new CoordRec((float) 45.2381, (float) 0 ),
-    new CoordRec((float) 59.5238, (float) 0 ),
+    new CoordRec((float) 45.2381, 0 ),
+    new CoordRec((float) 59.5238, 0 ),
     new CoordRec((float) 69.0476, (float) 4.7619 ),
     new CoordRec((float) 78.5714, (float) 14.2857 ),
     new CoordRec((float) 83.3334, (float) 28.5714 ),
@@ -1935,8 +1935,8 @@ static final CoordRec char112_stroke1[] = {
     new CoordRec((float) 80.9524, (float) 28.5714 ),
     new CoordRec((float) 76.1905, (float) 14.2857 ),
     new CoordRec((float) 66.6666, (float) 4.7619 ),
-    new CoordRec((float) 57.1428, (float) 0 ),
-    new CoordRec((float) 42.8571, (float) 0 ),
+    new CoordRec((float) 57.1428, 0 ),
+    new CoordRec((float) 42.8571, 0 ),
     new CoordRec((float) 33.3333, (float) 4.7619 ),
     new CoordRec((float) 23.8095, (float) 14.2857 ),
 };
@@ -1964,8 +1964,8 @@ static final CoordRec char113_stroke1[] = {
     new CoordRec((float) 23.8095, (float) 28.5714 ),
     new CoordRec((float) 28.5714, (float) 14.2857 ),
     new CoordRec((float) 38.0952, (float) 4.7619 ),
-    new CoordRec((float) 47.619, (float) 0 ),
-    new CoordRec((float) 61.9047, (float) 0 ),
+    new CoordRec((float) 47.619, 0 ),
+    new CoordRec((float) 61.9047, 0 ),
     new CoordRec((float) 71.4285, (float) 4.7619 ),
     new CoordRec((float) 80.9524, (float) 14.2857 ),
 };
@@ -1979,7 +1979,7 @@ static final StrokeRec char113[] = {
 
 static final CoordRec char114_stroke0[] = {
     new CoordRec((float) 33.3334, (float) 66.6667 ),
-    new CoordRec((float) 33.3334, (float) 0 ),
+    new CoordRec((float) 33.3334, 0 ),
 };
 
 static final CoordRec char114_stroke1[] = {
@@ -2011,8 +2011,8 @@ static final CoordRec char115_stroke0[] = {
     new CoordRec((float) 78.5715, (float) 19.0476 ),
     new CoordRec((float) 78.5715, (float) 14.2857 ),
     new CoordRec((float) 73.8095, (float) 4.7619 ),
-    new CoordRec((float) 59.5238, (float) 0 ),
-    new CoordRec((float) 45.2381, (float) 0 ),
+    new CoordRec((float) 59.5238, 0 ),
+    new CoordRec((float) 45.2381, 0 ),
     new CoordRec((float) 30.9524, (float) 4.7619 ),
     new CoordRec((float) 26.1905, (float) 14.2857 ),
 };
@@ -2024,11 +2024,11 @@ static final StrokeRec char115[] = {
 /* char: 116 't' */
 
 static final CoordRec char116_stroke0[] = {
-    new CoordRec((float) 47.6191, (float) 100 ),
+    new CoordRec((float) 47.6191, 100 ),
     new CoordRec((float) 47.6191, (float) 19.0476 ),
     new CoordRec((float) 52.381, (float) 4.7619 ),
-    new CoordRec((float) 61.9048, (float) 0 ),
-    new CoordRec((float) 71.4286, (float) 0 ),
+    new CoordRec((float) 61.9048, 0 ),
+    new CoordRec((float) 71.4286, 0 ),
 };
 
 static final CoordRec char116_stroke1[] = {
@@ -2047,15 +2047,15 @@ static final CoordRec char117_stroke0[] = {
     new CoordRec((float) 26.1905, (float) 66.6667 ),
     new CoordRec((float) 26.1905, (float) 19.0476 ),
     new CoordRec((float) 30.9524, (float) 4.7619 ),
-    new CoordRec((float) 40.4762, (float) 0 ),
-    new CoordRec((float) 54.7619, (float) 0 ),
+    new CoordRec((float) 40.4762, 0 ),
+    new CoordRec((float) 54.7619, 0 ),
     new CoordRec((float) 64.2857, (float) 4.7619 ),
     new CoordRec((float) 78.5715, (float) 19.0476 ),
 };
 
 static final CoordRec char117_stroke1[] = {
     new CoordRec((float) 78.5715, (float) 66.6667 ),
-    new CoordRec((float) 78.5715, (float) 0 ),
+    new CoordRec((float) 78.5715, 0 ),
 };
 
 static final StrokeRec char117[] = {
@@ -2067,12 +2067,12 @@ static final StrokeRec char117[] = {
 
 static final CoordRec char118_stroke0[] = {
     new CoordRec((float) 23.8095, (float) 66.6667 ),
-    new CoordRec((float) 52.3809, (float) 0 ),
+    new CoordRec((float) 52.3809, 0 ),
 };
 
 static final CoordRec char118_stroke1[] = {
     new CoordRec((float) 80.9524, (float) 66.6667 ),
-    new CoordRec((float) 52.3809, (float) 0 ),
+    new CoordRec((float) 52.3809, 0 ),
 };
 
 static final StrokeRec char118[] = {
@@ -2084,22 +2084,22 @@ static final StrokeRec char118[] = {
 
 static final CoordRec char119_stroke0[] = {
     new CoordRec((float) 14.2857, (float) 66.6667 ),
-    new CoordRec((float) 33.3333, (float) 0 ),
+    new CoordRec((float) 33.3333, 0 ),
 };
 
 static final CoordRec char119_stroke1[] = {
     new CoordRec((float) 52.3809, (float) 66.6667 ),
-    new CoordRec((float) 33.3333, (float) 0 ),
+    new CoordRec((float) 33.3333, 0 ),
 };
 
 static final CoordRec char119_stroke2[] = {
     new CoordRec((float) 52.3809, (float) 66.6667 ),
-    new CoordRec((float) 71.4286, (float) 0 ),
+    new CoordRec((float) 71.4286, 0 ),
 };
 
 static final CoordRec char119_stroke3[] = {
     new CoordRec((float) 90.4762, (float) 66.6667 ),
-    new CoordRec((float) 71.4286, (float) 0 ),
+    new CoordRec((float) 71.4286, 0 ),
 };
 
 static final StrokeRec char119[] = {
@@ -2113,12 +2113,12 @@ static final StrokeRec char119[] = {
 
 static final CoordRec char120_stroke0[] = {
     new CoordRec((float) 26.1905, (float) 66.6667 ),
-    new CoordRec((float) 78.5715, (float) 0 ),
+    new CoordRec((float) 78.5715, 0 ),
 };
 
 static final CoordRec char120_stroke1[] = {
     new CoordRec((float) 78.5715, (float) 66.6667 ),
-    new CoordRec((float) 26.1905, (float) 0 ),
+    new CoordRec((float) 26.1905, 0 ),
 };
 
 static final StrokeRec char120[] = {
@@ -2130,12 +2130,12 @@ static final StrokeRec char120[] = {
 
 static final CoordRec char121_stroke0[] = {
     new CoordRec((float) 26.1905, (float) 66.6667 ),
-    new CoordRec((float) 54.7619, (float) 0 ),
+    new CoordRec((float) 54.7619, 0 ),
 };
 
 static final CoordRec char121_stroke1[] = {
     new CoordRec((float) 83.3334, (float) 66.6667 ),
-    new CoordRec((float) 54.7619, (float) 0 ),
+    new CoordRec((float) 54.7619, 0 ),
     new CoordRec((float) 45.2381, (float) -19.0476 ),
     new CoordRec((float) 35.7143, (float) -28.5714 ),
     new CoordRec((float) 26.1905, (float) -33.3333 ),
@@ -2151,7 +2151,7 @@ static final StrokeRec char121[] = {
 
 static final CoordRec char122_stroke0[] = {
     new CoordRec((float) 78.5715, (float) 66.6667 ),
-    new CoordRec((float) 26.1905, (float) 0 ),
+    new CoordRec((float) 26.1905, 0 ),
 };
 
 static final CoordRec char122_stroke1[] = {
@@ -2160,8 +2160,8 @@ static final CoordRec char122_stroke1[] = {
 };
 
 static final CoordRec char122_stroke2[] = {
-    new CoordRec((float) 26.1905, (float) 0 ),
-    new CoordRec((float) 78.5715, (float) 0 ),
+    new CoordRec((float) 26.1905, 0 ),
+    new CoordRec((float) 78.5715, 0 ),
 };
 
 static final StrokeRec char122[] = {
@@ -2175,20 +2175,20 @@ static final StrokeRec char122[] = {
 static final CoordRec char123_stroke0[] = {
     new CoordRec((float) 64.2857, (float) 119.048 ),
     new CoordRec((float) 54.7619, (float) 114.286 ),
-    new CoordRec((float) 50, (float) 109.524 ),
-    new CoordRec((float) 45.2381, (float) 100 ),
+    new CoordRec(50, (float) 109.524 ),
+    new CoordRec((float) 45.2381, 100 ),
     new CoordRec((float) 45.2381, (float) 90.4762 ),
-    new CoordRec((float) 50, (float) 80.9524 ),
+    new CoordRec(50, (float) 80.9524 ),
     new CoordRec((float) 54.7619, (float) 76.1905 ),
     new CoordRec((float) 59.5238, (float) 66.6667 ),
     new CoordRec((float) 59.5238, (float) 57.1429 ),
-    new CoordRec((float) 50, (float) 47.619 ),
+    new CoordRec(50, (float) 47.619 ),
 };
 
 static final CoordRec char123_stroke1[] = {
     new CoordRec((float) 54.7619, (float) 114.286 ),
-    new CoordRec((float) 50, (float) 104.762 ),
-    new CoordRec((float) 50, (float) 95.2381 ),
+    new CoordRec(50, (float) 104.762 ),
+    new CoordRec(50, (float) 95.2381 ),
     new CoordRec((float) 54.7619, (float) 85.7143 ),
     new CoordRec((float) 59.5238, (float) 80.9524 ),
     new CoordRec((float) 64.2857, (float) 71.4286 ),
@@ -2199,21 +2199,21 @@ static final CoordRec char123_stroke1[] = {
     new CoordRec((float) 64.2857, (float) 23.8095 ),
     new CoordRec((float) 64.2857, (float) 14.2857 ),
     new CoordRec((float) 59.5238, (float) 4.7619 ),
-    new CoordRec((float) 54.7619, (float) 0 ),
-    new CoordRec((float) 50, (float) -9.5238 ),
-    new CoordRec((float) 50, (float) -19.0476 ),
+    new CoordRec((float) 54.7619, 0 ),
+    new CoordRec(50, (float) -9.5238 ),
+    new CoordRec(50, (float) -19.0476 ),
     new CoordRec((float) 54.7619, (float) -28.5714 ),
 };
 
 static final CoordRec char123_stroke2[] = {
-    new CoordRec((float) 50, (float) 38.0952 ),
+    new CoordRec(50, (float) 38.0952 ),
     new CoordRec((float) 59.5238, (float) 28.5714 ),
     new CoordRec((float) 59.5238, (float) 19.0476 ),
     new CoordRec((float) 54.7619, (float) 9.5238 ),
-    new CoordRec((float) 50, (float) 4.7619 ),
+    new CoordRec(50, (float) 4.7619 ),
     new CoordRec((float) 45.2381, (float) -4.7619 ),
     new CoordRec((float) 45.2381, (float) -14.2857 ),
-    new CoordRec((float) 50, (float) -23.8095 ),
+    new CoordRec(50, (float) -23.8095 ),
     new CoordRec((float) 54.7619, (float) -28.5714 ),
     new CoordRec((float) 64.2857, (float) -33.3333 ),
 };
@@ -2239,22 +2239,22 @@ static final StrokeRec char124[] = {
 
 static final CoordRec char125_stroke0[] = {
     new CoordRec((float) 40.4762, (float) 119.048 ),
-    new CoordRec((float) 50, (float) 114.286 ),
+    new CoordRec(50, (float) 114.286 ),
     new CoordRec((float) 54.7619, (float) 109.524 ),
-    new CoordRec((float) 59.5238, (float) 100 ),
+    new CoordRec((float) 59.5238, 100 ),
     new CoordRec((float) 59.5238, (float) 90.4762 ),
     new CoordRec((float) 54.7619, (float) 80.9524 ),
-    new CoordRec((float) 50, (float) 76.1905 ),
+    new CoordRec(50, (float) 76.1905 ),
     new CoordRec((float) 45.2381, (float) 66.6667 ),
     new CoordRec((float) 45.2381, (float) 57.1429 ),
     new CoordRec((float) 54.7619, (float) 47.619 ),
 };
 
 static final CoordRec char125_stroke1[] = {
-    new CoordRec((float) 50, (float) 114.286 ),
+    new CoordRec(50, (float) 114.286 ),
     new CoordRec((float) 54.7619, (float) 104.762 ),
     new CoordRec((float) 54.7619, (float) 95.2381 ),
-    new CoordRec((float) 50, (float) 85.7143 ),
+    new CoordRec(50, (float) 85.7143 ),
     new CoordRec((float) 45.2381, (float) 80.9524 ),
     new CoordRec((float) 40.4762, (float) 71.4286 ),
     new CoordRec((float) 40.4762, (float) 61.9048 ),
@@ -2264,22 +2264,22 @@ static final CoordRec char125_stroke1[] = {
     new CoordRec((float) 40.4762, (float) 23.8095 ),
     new CoordRec((float) 40.4762, (float) 14.2857 ),
     new CoordRec((float) 45.2381, (float) 4.7619 ),
-    new CoordRec((float) 50, (float) 0 ),
+    new CoordRec(50, 0 ),
     new CoordRec((float) 54.7619, (float) -9.5238 ),
     new CoordRec((float) 54.7619, (float) -19.0476 ),
-    new CoordRec((float) 50, (float) -28.5714 ),
+    new CoordRec(50, (float) -28.5714 ),
 };
 
 static final CoordRec char125_stroke2[] = {
     new CoordRec((float) 54.7619, (float) 38.0952 ),
     new CoordRec((float) 45.2381, (float) 28.5714 ),
     new CoordRec((float) 45.2381, (float) 19.0476 ),
-    new CoordRec((float) 50, (float) 9.5238 ),
+    new CoordRec(50, (float) 9.5238 ),
     new CoordRec((float) 54.7619, (float) 4.7619 ),
     new CoordRec((float) 59.5238, (float) -4.7619 ),
     new CoordRec((float) 59.5238, (float) -14.2857 ),
     new CoordRec((float) 54.7619, (float) -23.8095 ),
-    new CoordRec((float) 50, (float) -28.5714 ),
+    new CoordRec(50, (float) -28.5714 ),
     new CoordRec((float) 40.4762, (float) -33.3333 ),
 };
 
@@ -2327,7 +2327,7 @@ static final StrokeRec char126[] = {
 /* char: 127 */
 
 static final CoordRec char127_stroke0[] = {
-    new CoordRec((float) 71.4286, (float) 100 ),
+    new CoordRec((float) 71.4286, 100 ),
     new CoordRec((float) 33.3333, (float) -33.3333 ),
 };
 
@@ -2339,8 +2339,8 @@ static final CoordRec char127_stroke1[] = {
     new CoordRec((float) 19.0476, (float) 23.8095 ),
     new CoordRec((float) 23.8095, (float) 14.2857 ),
     new CoordRec((float) 33.3333, (float) 4.7619 ),
-    new CoordRec((float) 47.619, (float) 0 ),
-    new CoordRec((float) 57.1428, (float) 0 ),
+    new CoordRec((float) 47.619, 0 ),
+    new CoordRec((float) 57.1428, 0 ),
     new CoordRec((float) 71.4286, (float) 4.7619 ),
     new CoordRec((float) 80.9524, (float) 14.2857 ),
     new CoordRec((float) 85.7143, (float) 28.5714 ),
@@ -2357,38 +2357,38 @@ static final StrokeRec char127[] = {
 };
 
 static final StrokeCharRec chars[] = {
-    new StrokeCharRec(0, /* char0 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char1 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char2 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char3 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char4 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char5 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char6 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char7 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char8 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char9 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char10 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char11 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char12 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char13 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char14 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char15 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char16 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char17 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char18 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char19 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char20 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char21 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char22 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char23 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char24 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char25 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char26 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char27 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char28 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char29 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char30 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec(0, /* char31 */ null, (float) 0, (float) 0 ),
+    new StrokeCharRec(0, /* char0 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char1 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char2 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char3 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char4 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char5 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char6 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char7 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char8 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char9 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char10 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char11 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char12 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char13 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char14 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char15 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char16 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char17 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char18 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char19 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char20 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char21 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char22 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char23 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char24 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char25 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char26 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char27 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char28 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char29 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char30 */ null, 0, 0 ),
+    new StrokeCharRec(0, /* char31 */ null, 0, 0 ),
     new StrokeCharRec(0, /* char32 */ null, (float) 52.381, (float) 104.762 ),
     new StrokeCharRec(2, char33, (float) 52.381, (float) 104.762 ),
     new StrokeCharRec(2, char34, (float) 52.381, (float) 104.762 ),
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java
index cf51ddd..5b614c6 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/GLUTStrokeRoman.java
@@ -46,14 +46,14 @@ class GLUTStrokeRoman {
 /* char: 33 '!' */
 
 static final CoordRec char33_stroke0[] = {
-    new CoordRec((float) 13.3819, (float) 100),
+    new CoordRec((float) 13.3819, 100),
     new CoordRec((float) 13.3819, (float) 33.3333),
 };
 
 static final CoordRec char33_stroke1[] = {
     new CoordRec((float) 13.3819, (float) 9.5238),
     new CoordRec((float) 8.62, (float) 4.7619),
-    new CoordRec((float) 13.3819, (float) 0),
+    new CoordRec((float) 13.3819, 0),
     new CoordRec((float) 18.1438, (float) 4.7619),
     new CoordRec((float) 13.3819, (float) 9.5238),
 };
@@ -66,12 +66,12 @@ static final StrokeRec char33[] = {
 /* char: 34 '"' */
 
 static final CoordRec char34_stroke0[] = {
-    new CoordRec((float) 4.02, (float) 100),
+    new CoordRec((float) 4.02, 100),
     new CoordRec((float) 4.02, (float) 66.6667),
 };
 
 static final CoordRec char34_stroke1[] = {
-    new CoordRec((float) 42.1152, (float) 100),
+    new CoordRec((float) 42.1152, 100),
     new CoordRec((float) 42.1152, (float) 66.6667),
 };
 
@@ -124,8 +124,8 @@ static final CoordRec char36_stroke1[] = {
 static final CoordRec char36_stroke2[] = {
     new CoordRec((float) 71.4867, (float) 85.7143),
     new CoordRec((float) 61.9629, (float) 95.2381),
-    new CoordRec((float) 47.6771, (float) 100),
-    new CoordRec((float) 28.6295, (float) 100),
+    new CoordRec((float) 47.6771, 100),
+    new CoordRec((float) 28.6295, 100),
     new CoordRec((float) 14.3438, (float) 95.2381),
     new CoordRec((float) 4.82, (float) 85.7143),
     new CoordRec((float) 4.82, (float) 76.1905),
@@ -138,8 +138,8 @@ static final CoordRec char36_stroke2[] = {
     new CoordRec((float) 71.4867, (float) 28.5714),
     new CoordRec((float) 71.4867, (float) 14.2857),
     new CoordRec((float) 61.9629, (float) 4.7619),
-    new CoordRec((float) 47.6771, (float) 0),
-    new CoordRec((float) 28.6295, (float) 0),
+    new CoordRec((float) 47.6771, 0),
+    new CoordRec((float) 28.6295, 0),
     new CoordRec((float) 14.3438, (float) 4.7619),
     new CoordRec((float) 4.82, (float) 14.2857),
 };
@@ -153,12 +153,12 @@ static final StrokeRec char36[] = {
 /* char: 37 '%' */
 
 static final CoordRec char37_stroke0[] = {
-    new CoordRec((float) 92.0743, (float) 100),
-    new CoordRec((float) 6.36, (float) 0),
+    new CoordRec((float) 92.0743, 100),
+    new CoordRec((float) 6.36, 0),
 };
 
 static final CoordRec char37_stroke1[] = {
-    new CoordRec((float) 30.1695, (float) 100),
+    new CoordRec((float) 30.1695, 100),
     new CoordRec((float) 39.6933, (float) 90.4762),
     new CoordRec((float) 39.6933, (float) 80.9524),
     new CoordRec((float) 34.9314, (float) 71.4286),
@@ -167,13 +167,13 @@ static final CoordRec char37_stroke1[] = {
     new CoordRec((float) 6.36, (float) 76.1905),
     new CoordRec((float) 6.36, (float) 85.7143),
     new CoordRec((float) 11.1219, (float) 95.2381),
-    new CoordRec((float) 20.6457, (float) 100),
-    new CoordRec((float) 30.1695, (float) 100),
+    new CoordRec((float) 20.6457, 100),
+    new CoordRec((float) 30.1695, 100),
     new CoordRec((float) 39.6933, (float) 95.2381),
     new CoordRec((float) 53.979, (float) 90.4762),
     new CoordRec((float) 68.2648, (float) 90.4762),
     new CoordRec((float) 82.5505, (float) 95.2381),
-    new CoordRec((float) 92.0743, (float) 100),
+    new CoordRec((float) 92.0743, 100),
 };
 
 static final CoordRec char37_stroke2[] = {
@@ -181,8 +181,8 @@ static final CoordRec char37_stroke2[] = {
     new CoordRec((float) 63.5029, (float) 28.5714),
     new CoordRec((float) 58.741, (float) 19.0476),
     new CoordRec((float) 58.741, (float) 9.5238),
-    new CoordRec((float) 68.2648, (float) 0),
-    new CoordRec((float) 77.7886, (float) 0),
+    new CoordRec((float) 68.2648, 0),
+    new CoordRec((float) 77.7886, 0),
     new CoordRec((float) 87.3124, (float) 4.7619),
     new CoordRec((float) 92.0743, (float) 14.2857),
     new CoordRec((float) 92.0743, (float) 23.8095),
@@ -208,8 +208,8 @@ static final CoordRec char38_stroke0[] = {
     new CoordRec((float) 72.6467, (float) 28.5714),
     new CoordRec((float) 63.1229, (float) 14.2857),
     new CoordRec((float) 53.599, (float) 4.7619),
-    new CoordRec((float) 44.0752, (float) 0),
-    new CoordRec((float) 25.0276, (float) 0),
+    new CoordRec((float) 44.0752, 0),
+    new CoordRec((float) 25.0276, 0),
     new CoordRec((float) 15.5038, (float) 4.7619),
     new CoordRec((float) 10.7419, (float) 9.5238),
     new CoordRec((float) 5.98, (float) 19.0476),
@@ -221,7 +221,7 @@ static final CoordRec char38_stroke0[] = {
     new CoordRec((float) 58.361, (float) 76.1905),
     new CoordRec((float) 58.361, (float) 85.7143),
     new CoordRec((float) 53.599, (float) 95.2381),
-    new CoordRec((float) 44.0752, (float) 100),
+    new CoordRec((float) 44.0752, 100),
     new CoordRec((float) 34.5514, (float) 95.2381),
     new CoordRec((float) 29.7895, (float) 85.7143),
     new CoordRec((float) 29.7895, (float) 76.1905),
@@ -229,8 +229,8 @@ static final CoordRec char38_stroke0[] = {
     new CoordRec((float) 44.0752, (float) 47.619),
     new CoordRec((float) 67.8848, (float) 14.2857),
     new CoordRec((float) 77.4086, (float) 4.7619),
-    new CoordRec((float) 86.9324, (float) 0),
-    new CoordRec((float) 96.4562, (float) 0),
+    new CoordRec((float) 86.9324, 0),
+    new CoordRec((float) 96.4562, 0),
     new CoordRec((float) 101.218, (float) 4.7619),
     new CoordRec((float) 101.218, (float) 9.5238),
 };
@@ -242,7 +242,7 @@ static final StrokeRec char38[] = {
 /* char: 39 ''' */
 
 static final CoordRec char39_stroke0[] = {
-    new CoordRec((float) 4.44, (float) 100),
+    new CoordRec((float) 4.44, 100),
     new CoordRec((float) 4.44, (float) 66.6667),
 };
 
@@ -315,7 +315,7 @@ static final StrokeRec char42[] = {
 
 static final CoordRec char43_stroke0[] = {
     new CoordRec((float) 48.8371, (float) 85.7143),
-    new CoordRec((float) 48.8371, (float) 0),
+    new CoordRec((float) 48.8371, 0),
 };
 
 static final CoordRec char43_stroke1[] = {
@@ -332,7 +332,7 @@ static final StrokeRec char43[] = {
 
 static final CoordRec char44_stroke0[] = {
     new CoordRec((float) 18.2838, (float) 4.7619),
-    new CoordRec((float) 13.5219, (float) 0),
+    new CoordRec((float) 13.5219, 0),
     new CoordRec((float) 8.76, (float) 4.7619),
     new CoordRec((float) 13.5219, (float) 9.5238),
     new CoordRec((float) 18.2838, (float) 4.7619),
@@ -361,7 +361,7 @@ static final StrokeRec char45[] = {
 static final CoordRec char46_stroke0[] = {
     new CoordRec((float) 13.1019, (float) 9.5238),
     new CoordRec((float) 8.34, (float) 4.7619),
-    new CoordRec((float) 13.1019, (float) 0),
+    new CoordRec((float) 13.1019, 0),
     new CoordRec((float) 17.8638, (float) 4.7619),
     new CoordRec((float) 13.1019, (float) 9.5238),
 };
@@ -374,7 +374,7 @@ static final StrokeRec char46[] = {
 
 static final CoordRec char47_stroke0[] = {
     new CoordRec((float) 7.24, (float) -14.2857),
-    new CoordRec((float) 73.9067, (float) 100),
+    new CoordRec((float) 73.9067, 100),
 };
 
 static final StrokeRec char47[] = {
@@ -384,23 +384,23 @@ static final StrokeRec char47[] = {
 /* char: 48 '0' */
 
 static final CoordRec char48_stroke0[] = {
-    new CoordRec((float) 33.5514, (float) 100),
+    new CoordRec((float) 33.5514, 100),
     new CoordRec((float) 19.2657, (float) 95.2381),
     new CoordRec((float) 9.7419, (float) 80.9524),
     new CoordRec((float) 4.98, (float) 57.1429),
     new CoordRec((float) 4.98, (float) 42.8571),
     new CoordRec((float) 9.7419, (float) 19.0476),
     new CoordRec((float) 19.2657, (float) 4.7619),
-    new CoordRec((float) 33.5514, (float) 0),
-    new CoordRec((float) 43.0752, (float) 0),
+    new CoordRec((float) 33.5514, 0),
+    new CoordRec((float) 43.0752, 0),
     new CoordRec((float) 57.361, (float) 4.7619),
     new CoordRec((float) 66.8848, (float) 19.0476),
     new CoordRec((float) 71.6467, (float) 42.8571),
     new CoordRec((float) 71.6467, (float) 57.1429),
     new CoordRec((float) 66.8848, (float) 80.9524),
     new CoordRec((float) 57.361, (float) 95.2381),
-    new CoordRec((float) 43.0752, (float) 100),
-    new CoordRec((float) 33.5514, (float) 100),
+    new CoordRec((float) 43.0752, 100),
+    new CoordRec((float) 33.5514, 100),
 };
 
 static final StrokeRec char48[] = {
@@ -412,8 +412,8 @@ static final StrokeRec char48[] = {
 static final CoordRec char49_stroke0[] = {
     new CoordRec((float) 11.82, (float) 80.9524),
     new CoordRec((float) 21.3438, (float) 85.7143),
-    new CoordRec((float) 35.6295, (float) 100),
-    new CoordRec((float) 35.6295, (float) 0),
+    new CoordRec((float) 35.6295, 100),
+    new CoordRec((float) 35.6295, 0),
 };
 
 static final StrokeRec char49[] = {
@@ -427,16 +427,16 @@ static final CoordRec char50_stroke0[] = {
     new CoordRec((float) 10.1819, (float) 80.9524),
     new CoordRec((float) 14.9438, (float) 90.4762),
     new CoordRec((float) 19.7057, (float) 95.2381),
-    new CoordRec((float) 29.2295, (float) 100),
-    new CoordRec((float) 48.2771, (float) 100),
+    new CoordRec((float) 29.2295, 100),
+    new CoordRec((float) 48.2771, 100),
     new CoordRec((float) 57.801, (float) 95.2381),
     new CoordRec((float) 62.5629, (float) 90.4762),
     new CoordRec((float) 67.3248, (float) 80.9524),
     new CoordRec((float) 67.3248, (float) 71.4286),
     new CoordRec((float) 62.5629, (float) 61.9048),
     new CoordRec((float) 53.039, (float) 47.619),
-    new CoordRec((float) 5.42, (float) 0),
-    new CoordRec((float) 72.0867, (float) 0),
+    new CoordRec((float) 5.42, 0),
+    new CoordRec((float) 72.0867, 0),
 };
 
 static final StrokeRec char50[] = {
@@ -446,8 +446,8 @@ static final StrokeRec char50[] = {
 /* char: 51 '3' */
 
 static final CoordRec char51_stroke0[] = {
-    new CoordRec((float) 14.5238, (float) 100),
-    new CoordRec((float) 66.9048, (float) 100),
+    new CoordRec((float) 14.5238, 100),
+    new CoordRec((float) 66.9048, 100),
     new CoordRec((float) 38.3333, (float) 61.9048),
     new CoordRec((float) 52.619, (float) 61.9048),
     new CoordRec((float) 62.1429, (float) 57.1429),
@@ -456,11 +456,11 @@ static final CoordRec char51_stroke0[] = {
     new CoordRec((float) 71.6667, (float) 28.5714),
     new CoordRec((float) 66.9048, (float) 14.2857),
     new CoordRec((float) 57.381, (float) 4.7619),
-    new CoordRec((float) 43.0952, (float) 0),
-    new CoordRec((float) 28.8095, (float) 0),
+    new CoordRec((float) 43.0952, 0),
+    new CoordRec((float) 28.8095, 0),
     new CoordRec((float) 14.5238, (float) 4.7619),
     new CoordRec((float) 9.7619, (float) 9.5238),
-    new CoordRec((float) 5, (float) 19.0476),
+    new CoordRec(5, (float) 19.0476),
 };
 
 static final StrokeRec char51[] = {
@@ -470,14 +470,14 @@ static final StrokeRec char51[] = {
 /* char: 52 '4' */
 
 static final CoordRec char52_stroke0[] = {
-    new CoordRec((float) 51.499, (float) 100),
+    new CoordRec((float) 51.499, 100),
     new CoordRec((float) 3.88, (float) 33.3333),
     new CoordRec((float) 75.3086, (float) 33.3333),
 };
 
 static final CoordRec char52_stroke1[] = {
-    new CoordRec((float) 51.499, (float) 100),
-    new CoordRec((float) 51.499, (float) 0),
+    new CoordRec((float) 51.499, 100),
+    new CoordRec((float) 51.499, 0),
 };
 
 static final StrokeRec char52[] = {
@@ -488,8 +488,8 @@ static final StrokeRec char52[] = {
 /* char: 53 '5' */
 
 static final CoordRec char53_stroke0[] = {
-    new CoordRec((float) 62.0029, (float) 100),
-    new CoordRec((float) 14.3838, (float) 100),
+    new CoordRec((float) 62.0029, 100),
+    new CoordRec((float) 14.3838, 100),
     new CoordRec((float) 9.6219, (float) 57.1429),
     new CoordRec((float) 14.3838, (float) 61.9048),
     new CoordRec((float) 28.6695, (float) 66.6667),
@@ -500,8 +500,8 @@ static final CoordRec char53_stroke0[] = {
     new CoordRec((float) 71.5267, (float) 28.5714),
     new CoordRec((float) 66.7648, (float) 14.2857),
     new CoordRec((float) 57.241, (float) 4.7619),
-    new CoordRec((float) 42.9552, (float) 0),
-    new CoordRec((float) 28.6695, (float) 0),
+    new CoordRec((float) 42.9552, 0),
+    new CoordRec((float) 28.6695, 0),
     new CoordRec((float) 14.3838, (float) 4.7619),
     new CoordRec((float) 9.6219, (float) 9.5238),
     new CoordRec((float) 4.86, (float) 19.0476),
@@ -516,16 +516,16 @@ static final StrokeRec char53[] = {
 static final CoordRec char54_stroke0[] = {
     new CoordRec((float) 62.7229, (float) 85.7143),
     new CoordRec((float) 57.961, (float) 95.2381),
-    new CoordRec((float) 43.6752, (float) 100),
-    new CoordRec((float) 34.1514, (float) 100),
+    new CoordRec((float) 43.6752, 100),
+    new CoordRec((float) 34.1514, 100),
     new CoordRec((float) 19.8657, (float) 95.2381),
     new CoordRec((float) 10.3419, (float) 80.9524),
     new CoordRec((float) 5.58, (float) 57.1429),
     new CoordRec((float) 5.58, (float) 33.3333),
     new CoordRec((float) 10.3419, (float) 14.2857),
     new CoordRec((float) 19.8657, (float) 4.7619),
-    new CoordRec((float) 34.1514, (float) 0),
-    new CoordRec((float) 38.9133, (float) 0),
+    new CoordRec((float) 34.1514, 0),
+    new CoordRec((float) 38.9133, 0),
     new CoordRec((float) 53.199, (float) 4.7619),
     new CoordRec((float) 62.7229, (float) 14.2857),
     new CoordRec((float) 67.4848, (float) 28.5714),
@@ -546,13 +546,13 @@ static final StrokeRec char54[] = {
 /* char: 55 '7' */
 
 static final CoordRec char55_stroke0[] = {
-    new CoordRec((float) 72.2267, (float) 100),
-    new CoordRec((float) 24.6076, (float) 0),
+    new CoordRec((float) 72.2267, 100),
+    new CoordRec((float) 24.6076, 0),
 };
 
 static final CoordRec char55_stroke1[] = {
-    new CoordRec((float) 5.56, (float) 100),
-    new CoordRec((float) 72.2267, (float) 100),
+    new CoordRec((float) 5.56, 100),
+    new CoordRec((float) 72.2267, 100),
 };
 
 static final StrokeRec char55[] = {
@@ -563,7 +563,7 @@ static final StrokeRec char55[] = {
 /* char: 56 '8' */
 
 static final CoordRec char56_stroke0[] = {
-    new CoordRec((float) 29.4095, (float) 100),
+    new CoordRec((float) 29.4095, 100),
     new CoordRec((float) 15.1238, (float) 95.2381),
     new CoordRec((float) 10.3619, (float) 85.7143),
     new CoordRec((float) 10.3619, (float) 76.1905),
@@ -576,8 +576,8 @@ static final CoordRec char56_stroke0[] = {
     new CoordRec((float) 72.2667, (float) 19.0476),
     new CoordRec((float) 67.5048, (float) 9.5238),
     new CoordRec((float) 62.7429, (float) 4.7619),
-    new CoordRec((float) 48.4571, (float) 0),
-    new CoordRec((float) 29.4095, (float) 0),
+    new CoordRec((float) 48.4571, 0),
+    new CoordRec((float) 29.4095, 0),
     new CoordRec((float) 15.1238, (float) 4.7619),
     new CoordRec((float) 10.3619, (float) 9.5238),
     new CoordRec((float) 5.6, (float) 19.0476),
@@ -590,8 +590,8 @@ static final CoordRec char56_stroke0[] = {
     new CoordRec((float) 67.5048, (float) 76.1905),
     new CoordRec((float) 67.5048, (float) 85.7143),
     new CoordRec((float) 62.7429, (float) 95.2381),
-    new CoordRec((float) 48.4571, (float) 100),
-    new CoordRec((float) 29.4095, (float) 100),
+    new CoordRec((float) 48.4571, 100),
+    new CoordRec((float) 29.4095, 100),
 };
 
 static final StrokeRec char56[] = {
@@ -612,16 +612,16 @@ static final CoordRec char57_stroke0[] = {
     new CoordRec((float) 6.6, (float) 71.4286),
     new CoordRec((float) 11.3619, (float) 85.7143),
     new CoordRec((float) 20.8857, (float) 95.2381),
-    new CoordRec((float) 35.1714, (float) 100),
-    new CoordRec((float) 39.9333, (float) 100),
+    new CoordRec((float) 35.1714, 100),
+    new CoordRec((float) 39.9333, 100),
     new CoordRec((float) 54.219, (float) 95.2381),
     new CoordRec((float) 63.7429, (float) 85.7143),
     new CoordRec((float) 68.5048, (float) 66.6667),
     new CoordRec((float) 68.5048, (float) 42.8571),
     new CoordRec((float) 63.7429, (float) 19.0476),
     new CoordRec((float) 54.219, (float) 4.7619),
-    new CoordRec((float) 39.9333, (float) 0),
-    new CoordRec((float) 30.4095, (float) 0),
+    new CoordRec((float) 39.9333, 0),
+    new CoordRec((float) 30.4095, 0),
     new CoordRec((float) 16.1238, (float) 4.7619),
     new CoordRec((float) 11.3619, (float) 14.2857),
 };
@@ -643,7 +643,7 @@ static final CoordRec char58_stroke0[] = {
 static final CoordRec char58_stroke1[] = {
     new CoordRec((float) 14.0819, (float) 9.5238),
     new CoordRec((float) 9.32, (float) 4.7619),
-    new CoordRec((float) 14.0819, (float) 0),
+    new CoordRec((float) 14.0819, 0),
     new CoordRec((float) 18.8438, (float) 4.7619),
     new CoordRec((float) 14.0819, (float) 9.5238),
 };
@@ -665,7 +665,7 @@ static final CoordRec char59_stroke0[] = {
 
 static final CoordRec char59_stroke1[] = {
     new CoordRec((float) 17.7238, (float) 4.7619),
-    new CoordRec((float) 12.9619, (float) 0),
+    new CoordRec((float) 12.9619, 0),
     new CoordRec((float) 8.2, (float) 4.7619),
     new CoordRec((float) 12.9619, (float) 9.5238),
     new CoordRec((float) 17.7238, (float) 4.7619),
@@ -684,7 +684,7 @@ static final StrokeRec char59[] = {
 static final CoordRec char60_stroke0[] = {
     new CoordRec((float) 79.2505, (float) 85.7143),
     new CoordRec((float) 3.06, (float) 42.8571),
-    new CoordRec((float) 79.2505, (float) 0),
+    new CoordRec((float) 79.2505, 0),
 };
 
 static final StrokeRec char60[] = {
@@ -713,7 +713,7 @@ static final StrokeRec char61[] = {
 static final CoordRec char62_stroke0[] = {
     new CoordRec((float) 2.78, (float) 85.7143),
     new CoordRec((float) 78.9705, (float) 42.8571),
-    new CoordRec((float) 2.78, (float) 0),
+    new CoordRec((float) 2.78, 0),
 };
 
 static final StrokeRec char62[] = {
@@ -727,8 +727,8 @@ static final CoordRec char63_stroke0[] = {
     new CoordRec((float) 8.42, (float) 80.9524),
     new CoordRec((float) 13.1819, (float) 90.4762),
     new CoordRec((float) 17.9438, (float) 95.2381),
-    new CoordRec((float) 27.4676, (float) 100),
-    new CoordRec((float) 46.5152, (float) 100),
+    new CoordRec((float) 27.4676, 100),
+    new CoordRec((float) 46.5152, 100),
     new CoordRec((float) 56.039, (float) 95.2381),
     new CoordRec((float) 60.801, (float) 90.4762),
     new CoordRec((float) 65.5629, (float) 80.9524),
@@ -742,7 +742,7 @@ static final CoordRec char63_stroke0[] = {
 static final CoordRec char63_stroke1[] = {
     new CoordRec((float) 36.9914, (float) 9.5238),
     new CoordRec((float) 32.2295, (float) 4.7619),
-    new CoordRec((float) 36.9914, (float) 0),
+    new CoordRec((float) 36.9914, 0),
     new CoordRec((float) 41.7533, (float) 4.7619),
     new CoordRec((float) 36.9914, (float) 9.5238),
 };
@@ -795,13 +795,13 @@ static final StrokeRec char64[] = {
 /* char: 65 'A' */
 
 static final CoordRec char65_stroke0[] = {
-    new CoordRec((float) 40.5952, (float) 100),
-    new CoordRec((float) 2.5, (float) 0),
+    new CoordRec((float) 40.5952, 100),
+    new CoordRec((float) 2.5, 0),
 };
 
 static final CoordRec char65_stroke1[] = {
-    new CoordRec((float) 40.5952, (float) 100),
-    new CoordRec((float) 78.6905, (float) 0),
+    new CoordRec((float) 40.5952, 100),
+    new CoordRec((float) 78.6905, 0),
 };
 
 static final CoordRec char65_stroke2[] = {
@@ -818,13 +818,13 @@ static final StrokeRec char65[] = {
 /* char: 66 'B' */
 
 static final CoordRec char66_stroke0[] = {
-    new CoordRec((float) 11.42, (float) 100),
-    new CoordRec((float) 11.42, (float) 0),
+    new CoordRec((float) 11.42, 100),
+    new CoordRec((float) 11.42, 0),
 };
 
 static final CoordRec char66_stroke1[] = {
-    new CoordRec((float) 11.42, (float) 100),
-    new CoordRec((float) 54.2771, (float) 100),
+    new CoordRec((float) 11.42, 100),
+    new CoordRec((float) 54.2771, 100),
     new CoordRec((float) 68.5629, (float) 95.2381),
     new CoordRec((float) 73.3248, (float) 90.4762),
     new CoordRec((float) 78.0867, (float) 80.9524),
@@ -843,8 +843,8 @@ static final CoordRec char66_stroke2[] = {
     new CoordRec((float) 78.0867, (float) 19.0476),
     new CoordRec((float) 73.3248, (float) 9.5238),
     new CoordRec((float) 68.5629, (float) 4.7619),
-    new CoordRec((float) 54.2771, (float) 0),
-    new CoordRec((float) 11.42, (float) 0),
+    new CoordRec((float) 54.2771, 0),
+    new CoordRec((float) 11.42, 0),
 };
 
 static final StrokeRec char66[] = {
@@ -859,8 +859,8 @@ static final CoordRec char67_stroke0[] = {
     new CoordRec((float) 78.0886, (float) 76.1905),
     new CoordRec((float) 73.3267, (float) 85.7143),
     new CoordRec((float) 63.8029, (float) 95.2381),
-    new CoordRec((float) 54.279, (float) 100),
-    new CoordRec((float) 35.2314, (float) 100),
+    new CoordRec((float) 54.279, 100),
+    new CoordRec((float) 35.2314, 100),
     new CoordRec((float) 25.7076, (float) 95.2381),
     new CoordRec((float) 16.1838, (float) 85.7143),
     new CoordRec((float) 11.4219, (float) 76.1905),
@@ -869,8 +869,8 @@ static final CoordRec char67_stroke0[] = {
     new CoordRec((float) 11.4219, (float) 23.8095),
     new CoordRec((float) 16.1838, (float) 14.2857),
     new CoordRec((float) 25.7076, (float) 4.7619),
-    new CoordRec((float) 35.2314, (float) 0),
-    new CoordRec((float) 54.279, (float) 0),
+    new CoordRec((float) 35.2314, 0),
+    new CoordRec((float) 54.279, 0),
     new CoordRec((float) 63.8029, (float) 4.7619),
     new CoordRec((float) 73.3267, (float) 14.2857),
     new CoordRec((float) 78.0886, (float) 23.8095),
@@ -883,13 +883,13 @@ static final StrokeRec char67[] = {
 /* char: 68 'D' */
 
 static final CoordRec char68_stroke0[] = {
-    new CoordRec((float) 11.96, (float) 100),
-    new CoordRec((float) 11.96, (float) 0),
+    new CoordRec((float) 11.96, 100),
+    new CoordRec((float) 11.96, 0),
 };
 
 static final CoordRec char68_stroke1[] = {
-    new CoordRec((float) 11.96, (float) 100),
-    new CoordRec((float) 45.2933, (float) 100),
+    new CoordRec((float) 11.96, 100),
+    new CoordRec((float) 45.2933, 100),
     new CoordRec((float) 59.579, (float) 95.2381),
     new CoordRec((float) 69.1029, (float) 85.7143),
     new CoordRec((float) 73.8648, (float) 76.1905),
@@ -898,8 +898,8 @@ static final CoordRec char68_stroke1[] = {
     new CoordRec((float) 73.8648, (float) 23.8095),
     new CoordRec((float) 69.1029, (float) 14.2857),
     new CoordRec((float) 59.579, (float) 4.7619),
-    new CoordRec((float) 45.2933, (float) 0),
-    new CoordRec((float) 11.96, (float) 0),
+    new CoordRec((float) 45.2933, 0),
+    new CoordRec((float) 11.96, 0),
 };
 
 static final StrokeRec char68[] = {
@@ -910,13 +910,13 @@ static final StrokeRec char68[] = {
 /* char: 69 'E' */
 
 static final CoordRec char69_stroke0[] = {
-    new CoordRec((float) 11.42, (float) 100),
-    new CoordRec((float) 11.42, (float) 0),
+    new CoordRec((float) 11.42, 100),
+    new CoordRec((float) 11.42, 0),
 };
 
 static final CoordRec char69_stroke1[] = {
-    new CoordRec((float) 11.42, (float) 100),
-    new CoordRec((float) 73.3248, (float) 100),
+    new CoordRec((float) 11.42, 100),
+    new CoordRec((float) 73.3248, 100),
 };
 
 static final CoordRec char69_stroke2[] = {
@@ -925,8 +925,8 @@ static final CoordRec char69_stroke2[] = {
 };
 
 static final CoordRec char69_stroke3[] = {
-    new CoordRec((float) 11.42, (float) 0),
-    new CoordRec((float) 73.3248, (float) 0),
+    new CoordRec((float) 11.42, 0),
+    new CoordRec((float) 73.3248, 0),
 };
 
 static final StrokeRec char69[] = {
@@ -939,13 +939,13 @@ static final StrokeRec char69[] = {
 /* char: 70 'F' */
 
 static final CoordRec char70_stroke0[] = {
-    new CoordRec((float) 11.42, (float) 100),
-    new CoordRec((float) 11.42, (float) 0),
+    new CoordRec((float) 11.42, 100),
+    new CoordRec((float) 11.42, 0),
 };
 
 static final CoordRec char70_stroke1[] = {
-    new CoordRec((float) 11.42, (float) 100),
-    new CoordRec((float) 73.3248, (float) 100),
+    new CoordRec((float) 11.42, 100),
+    new CoordRec((float) 73.3248, 100),
 };
 
 static final CoordRec char70_stroke2[] = {
@@ -965,8 +965,8 @@ static final CoordRec char71_stroke0[] = {
     new CoordRec((float) 78.4886, (float) 76.1905),
     new CoordRec((float) 73.7267, (float) 85.7143),
     new CoordRec((float) 64.2029, (float) 95.2381),
-    new CoordRec((float) 54.679, (float) 100),
-    new CoordRec((float) 35.6314, (float) 100),
+    new CoordRec((float) 54.679, 100),
+    new CoordRec((float) 35.6314, 100),
     new CoordRec((float) 26.1076, (float) 95.2381),
     new CoordRec((float) 16.5838, (float) 85.7143),
     new CoordRec((float) 11.8219, (float) 76.1905),
@@ -975,8 +975,8 @@ static final CoordRec char71_stroke0[] = {
     new CoordRec((float) 11.8219, (float) 23.8095),
     new CoordRec((float) 16.5838, (float) 14.2857),
     new CoordRec((float) 26.1076, (float) 4.7619),
-    new CoordRec((float) 35.6314, (float) 0),
-    new CoordRec((float) 54.679, (float) 0),
+    new CoordRec((float) 35.6314, 0),
+    new CoordRec((float) 54.679, 0),
     new CoordRec((float) 64.2029, (float) 4.7619),
     new CoordRec((float) 73.7267, (float) 14.2857),
     new CoordRec((float) 78.4886, (float) 23.8095),
@@ -996,13 +996,13 @@ static final StrokeRec char71[] = {
 /* char: 72 'H' */
 
 static final CoordRec char72_stroke0[] = {
-    new CoordRec((float) 11.42, (float) 100),
-    new CoordRec((float) 11.42, (float) 0),
+    new CoordRec((float) 11.42, 100),
+    new CoordRec((float) 11.42, 0),
 };
 
 static final CoordRec char72_stroke1[] = {
-    new CoordRec((float) 78.0867, (float) 100),
-    new CoordRec((float) 78.0867, (float) 0),
+    new CoordRec((float) 78.0867, 100),
+    new CoordRec((float) 78.0867, 0),
 };
 
 static final CoordRec char72_stroke2[] = {
@@ -1019,8 +1019,8 @@ static final StrokeRec char72[] = {
 /* char: 73 'I' */
 
 static final CoordRec char73_stroke0[] = {
-    new CoordRec((float) 10.86, (float) 100),
-    new CoordRec((float) 10.86, (float) 0),
+    new CoordRec((float) 10.86, 100),
+    new CoordRec((float) 10.86, 0),
 };
 
 static final StrokeRec char73[] = {
@@ -1030,12 +1030,12 @@ static final StrokeRec char73[] = {
 /* char: 74 'J' */
 
 static final CoordRec char74_stroke0[] = {
-    new CoordRec((float) 50.119, (float) 100),
+    new CoordRec((float) 50.119, 100),
     new CoordRec((float) 50.119, (float) 23.8095),
     new CoordRec((float) 45.3571, (float) 9.5238),
     new CoordRec((float) 40.5952, (float) 4.7619),
-    new CoordRec((float) 31.0714, (float) 0),
-    new CoordRec((float) 21.5476, (float) 0),
+    new CoordRec((float) 31.0714, 0),
+    new CoordRec((float) 21.5476, 0),
     new CoordRec((float) 12.0238, (float) 4.7619),
     new CoordRec((float) 7.2619, (float) 9.5238),
     new CoordRec((float) 2.5, (float) 23.8095),
@@ -1049,18 +1049,18 @@ static final StrokeRec char74[] = {
 /* char: 75 'K' */
 
 static final CoordRec char75_stroke0[] = {
-    new CoordRec((float) 11.28, (float) 100),
-    new CoordRec((float) 11.28, (float) 0),
+    new CoordRec((float) 11.28, 100),
+    new CoordRec((float) 11.28, 0),
 };
 
 static final CoordRec char75_stroke1[] = {
-    new CoordRec((float) 77.9467, (float) 100),
+    new CoordRec((float) 77.9467, 100),
     new CoordRec((float) 11.28, (float) 33.3333),
 };
 
 static final CoordRec char75_stroke2[] = {
     new CoordRec((float) 35.0895, (float) 57.1429),
-    new CoordRec((float) 77.9467, (float) 0),
+    new CoordRec((float) 77.9467, 0),
 };
 
 static final StrokeRec char75[] = {
@@ -1072,13 +1072,13 @@ static final StrokeRec char75[] = {
 /* char: 76 'L' */
 
 static final CoordRec char76_stroke0[] = {
-    new CoordRec((float) 11.68, (float) 100),
-    new CoordRec((float) 11.68, (float) 0),
+    new CoordRec((float) 11.68, 100),
+    new CoordRec((float) 11.68, 0),
 };
 
 static final CoordRec char76_stroke1[] = {
-    new CoordRec((float) 11.68, (float) 0),
-    new CoordRec((float) 68.8229, (float) 0),
+    new CoordRec((float) 11.68, 0),
+    new CoordRec((float) 68.8229, 0),
 };
 
 static final StrokeRec char76[] = {
@@ -1089,23 +1089,23 @@ static final StrokeRec char76[] = {
 /* char: 77 'M' */
 
 static final CoordRec char77_stroke0[] = {
-    new CoordRec((float) 10.86, (float) 100),
-    new CoordRec((float) 10.86, (float) 0),
+    new CoordRec((float) 10.86, 100),
+    new CoordRec((float) 10.86, 0),
 };
 
 static final CoordRec char77_stroke1[] = {
-    new CoordRec((float) 10.86, (float) 100),
-    new CoordRec((float) 48.9552, (float) 0),
+    new CoordRec((float) 10.86, 100),
+    new CoordRec((float) 48.9552, 0),
 };
 
 static final CoordRec char77_stroke2[] = {
-    new CoordRec((float) 87.0505, (float) 100),
-    new CoordRec((float) 48.9552, (float) 0),
+    new CoordRec((float) 87.0505, 100),
+    new CoordRec((float) 48.9552, 0),
 };
 
 static final CoordRec char77_stroke3[] = {
-    new CoordRec((float) 87.0505, (float) 100),
-    new CoordRec((float) 87.0505, (float) 0),
+    new CoordRec((float) 87.0505, 100),
+    new CoordRec((float) 87.0505, 0),
 };
 
 static final StrokeRec char77[] = {
@@ -1118,18 +1118,18 @@ static final StrokeRec char77[] = {
 /* char: 78 'N' */
 
 static final CoordRec char78_stroke0[] = {
-    new CoordRec((float) 11.14, (float) 100),
-    new CoordRec((float) 11.14, (float) 0),
+    new CoordRec((float) 11.14, 100),
+    new CoordRec((float) 11.14, 0),
 };
 
 static final CoordRec char78_stroke1[] = {
-    new CoordRec((float) 11.14, (float) 100),
-    new CoordRec((float) 77.8067, (float) 0),
+    new CoordRec((float) 11.14, 100),
+    new CoordRec((float) 77.8067, 0),
 };
 
 static final CoordRec char78_stroke2[] = {
-    new CoordRec((float) 77.8067, (float) 100),
-    new CoordRec((float) 77.8067, (float) 0),
+    new CoordRec((float) 77.8067, 100),
+    new CoordRec((float) 77.8067, 0),
 };
 
 static final StrokeRec char78[] = {
@@ -1141,7 +1141,7 @@ static final StrokeRec char78[] = {
 /* char: 79 'O' */
 
 static final CoordRec char79_stroke0[] = {
-    new CoordRec((float) 34.8114, (float) 100),
+    new CoordRec((float) 34.8114, 100),
     new CoordRec((float) 25.2876, (float) 95.2381),
     new CoordRec((float) 15.7638, (float) 85.7143),
     new CoordRec((float) 11.0019, (float) 76.1905),
@@ -1150,8 +1150,8 @@ static final CoordRec char79_stroke0[] = {
     new CoordRec((float) 11.0019, (float) 23.8095),
     new CoordRec((float) 15.7638, (float) 14.2857),
     new CoordRec((float) 25.2876, (float) 4.7619),
-    new CoordRec((float) 34.8114, (float) 0),
-    new CoordRec((float) 53.859, (float) 0),
+    new CoordRec((float) 34.8114, 0),
+    new CoordRec((float) 53.859, 0),
     new CoordRec((float) 63.3829, (float) 4.7619),
     new CoordRec((float) 72.9067, (float) 14.2857),
     new CoordRec((float) 77.6686, (float) 23.8095),
@@ -1160,8 +1160,8 @@ static final CoordRec char79_stroke0[] = {
     new CoordRec((float) 77.6686, (float) 76.1905),
     new CoordRec((float) 72.9067, (float) 85.7143),
     new CoordRec((float) 63.3829, (float) 95.2381),
-    new CoordRec((float) 53.859, (float) 100),
-    new CoordRec((float) 34.8114, (float) 100),
+    new CoordRec((float) 53.859, 100),
+    new CoordRec((float) 34.8114, 100),
 };
 
 static final StrokeRec char79[] = {
@@ -1171,13 +1171,13 @@ static final StrokeRec char79[] = {
 /* char: 80 'P' */
 
 static final CoordRec char80_stroke0[] = {
-    new CoordRec((float) 12.1, (float) 100),
-    new CoordRec((float) 12.1, (float) 0),
+    new CoordRec((float) 12.1, 100),
+    new CoordRec((float) 12.1, 0),
 };
 
 static final CoordRec char80_stroke1[] = {
-    new CoordRec((float) 12.1, (float) 100),
-    new CoordRec((float) 54.9571, (float) 100),
+    new CoordRec((float) 12.1, 100),
+    new CoordRec((float) 54.9571, 100),
     new CoordRec((float) 69.2429, (float) 95.2381),
     new CoordRec((float) 74.0048, (float) 90.4762),
     new CoordRec((float) 78.7667, (float) 80.9524),
@@ -1196,7 +1196,7 @@ static final StrokeRec char80[] = {
 /* char: 81 'Q' */
 
 static final CoordRec char81_stroke0[] = {
-    new CoordRec((float) 33.8714, (float) 100),
+    new CoordRec((float) 33.8714, 100),
     new CoordRec((float) 24.3476, (float) 95.2381),
     new CoordRec((float) 14.8238, (float) 85.7143),
     new CoordRec((float) 10.0619, (float) 76.1905),
@@ -1205,8 +1205,8 @@ static final CoordRec char81_stroke0[] = {
     new CoordRec((float) 10.0619, (float) 23.8095),
     new CoordRec((float) 14.8238, (float) 14.2857),
     new CoordRec((float) 24.3476, (float) 4.7619),
-    new CoordRec((float) 33.8714, (float) 0),
-    new CoordRec((float) 52.919, (float) 0),
+    new CoordRec((float) 33.8714, 0),
+    new CoordRec((float) 52.919, 0),
     new CoordRec((float) 62.4429, (float) 4.7619),
     new CoordRec((float) 71.9667, (float) 14.2857),
     new CoordRec((float) 76.7286, (float) 23.8095),
@@ -1215,8 +1215,8 @@ static final CoordRec char81_stroke0[] = {
     new CoordRec((float) 76.7286, (float) 76.1905),
     new CoordRec((float) 71.9667, (float) 85.7143),
     new CoordRec((float) 62.4429, (float) 95.2381),
-    new CoordRec((float) 52.919, (float) 100),
-    new CoordRec((float) 33.8714, (float) 100),
+    new CoordRec((float) 52.919, 100),
+    new CoordRec((float) 33.8714, 100),
 };
 
 static final CoordRec char81_stroke1[] = {
@@ -1232,13 +1232,13 @@ static final StrokeRec char81[] = {
 /* char: 82 'R' */
 
 static final CoordRec char82_stroke0[] = {
-    new CoordRec((float) 11.68, (float) 100),
-    new CoordRec((float) 11.68, (float) 0),
+    new CoordRec((float) 11.68, 100),
+    new CoordRec((float) 11.68, 0),
 };
 
 static final CoordRec char82_stroke1[] = {
-    new CoordRec((float) 11.68, (float) 100),
-    new CoordRec((float) 54.5371, (float) 100),
+    new CoordRec((float) 11.68, 100),
+    new CoordRec((float) 54.5371, 100),
     new CoordRec((float) 68.8229, (float) 95.2381),
     new CoordRec((float) 73.5848, (float) 90.4762),
     new CoordRec((float) 78.3467, (float) 80.9524),
@@ -1251,7 +1251,7 @@ static final CoordRec char82_stroke1[] = {
 
 static final CoordRec char82_stroke2[] = {
     new CoordRec((float) 45.0133, (float) 52.381),
-    new CoordRec((float) 78.3467, (float) 0),
+    new CoordRec((float) 78.3467, 0),
 };
 
 static final StrokeRec char82[] = {
@@ -1265,11 +1265,11 @@ static final StrokeRec char82[] = {
 static final CoordRec char83_stroke0[] = {
     new CoordRec((float) 74.6667, (float) 85.7143),
     new CoordRec((float) 65.1429, (float) 95.2381),
-    new CoordRec((float) 50.8571, (float) 100),
-    new CoordRec((float) 31.8095, (float) 100),
+    new CoordRec((float) 50.8571, 100),
+    new CoordRec((float) 31.8095, 100),
     new CoordRec((float) 17.5238, (float) 95.2381),
-    new CoordRec((float) 8, (float) 85.7143),
-    new CoordRec((float) 8, (float) 76.1905),
+    new CoordRec(8, (float) 85.7143),
+    new CoordRec(8, (float) 76.1905),
     new CoordRec((float) 12.7619, (float) 66.6667),
     new CoordRec((float) 17.5238, (float) 61.9048),
     new CoordRec((float) 27.0476, (float) 57.1429),
@@ -1279,10 +1279,10 @@ static final CoordRec char83_stroke0[] = {
     new CoordRec((float) 74.6667, (float) 28.5714),
     new CoordRec((float) 74.6667, (float) 14.2857),
     new CoordRec((float) 65.1429, (float) 4.7619),
-    new CoordRec((float) 50.8571, (float) 0),
-    new CoordRec((float) 31.8095, (float) 0),
+    new CoordRec((float) 50.8571, 0),
+    new CoordRec((float) 31.8095, 0),
     new CoordRec((float) 17.5238, (float) 4.7619),
-    new CoordRec((float) 8, (float) 14.2857),
+    new CoordRec(8, (float) 14.2857),
 };
 
 static final StrokeRec char83[] = {
@@ -1292,13 +1292,13 @@ static final StrokeRec char83[] = {
 /* char: 84 'T' */
 
 static final CoordRec char84_stroke0[] = {
-    new CoordRec((float) 35.6933, (float) 100),
-    new CoordRec((float) 35.6933, (float) 0),
+    new CoordRec((float) 35.6933, 100),
+    new CoordRec((float) 35.6933, 0),
 };
 
 static final CoordRec char84_stroke1[] = {
-    new CoordRec((float) 2.36, (float) 100),
-    new CoordRec((float) 69.0267, (float) 100),
+    new CoordRec((float) 2.36, 100),
+    new CoordRec((float) 69.0267, 100),
 };
 
 static final StrokeRec char84[] = {
@@ -1309,16 +1309,16 @@ static final StrokeRec char84[] = {
 /* char: 85 'U' */
 
 static final CoordRec char85_stroke0[] = {
-    new CoordRec((float) 11.54, (float) 100),
+    new CoordRec((float) 11.54, 100),
     new CoordRec((float) 11.54, (float) 28.5714),
     new CoordRec((float) 16.3019, (float) 14.2857),
     new CoordRec((float) 25.8257, (float) 4.7619),
-    new CoordRec((float) 40.1114, (float) 0),
-    new CoordRec((float) 49.6352, (float) 0),
+    new CoordRec((float) 40.1114, 0),
+    new CoordRec((float) 49.6352, 0),
     new CoordRec((float) 63.921, (float) 4.7619),
     new CoordRec((float) 73.4448, (float) 14.2857),
     new CoordRec((float) 78.2067, (float) 28.5714),
-    new CoordRec((float) 78.2067, (float) 100),
+    new CoordRec((float) 78.2067, 100),
 };
 
 static final StrokeRec char85[] = {
@@ -1328,13 +1328,13 @@ static final StrokeRec char85[] = {
 /* char: 86 'V' */
 
 static final CoordRec char86_stroke0[] = {
-    new CoordRec((float) 2.36, (float) 100),
-    new CoordRec((float) 40.4552, (float) 0),
+    new CoordRec((float) 2.36, 100),
+    new CoordRec((float) 40.4552, 0),
 };
 
 static final CoordRec char86_stroke1[] = {
-    new CoordRec((float) 78.5505, (float) 100),
-    new CoordRec((float) 40.4552, (float) 0),
+    new CoordRec((float) 78.5505, 100),
+    new CoordRec((float) 40.4552, 0),
 };
 
 static final StrokeRec char86[] = {
@@ -1345,23 +1345,23 @@ static final StrokeRec char86[] = {
 /* char: 87 'W' */
 
 static final CoordRec char87_stroke0[] = {
-    new CoordRec((float) 2.22, (float) 100),
-    new CoordRec((float) 26.0295, (float) 0),
+    new CoordRec((float) 2.22, 100),
+    new CoordRec((float) 26.0295, 0),
 };
 
 static final CoordRec char87_stroke1[] = {
-    new CoordRec((float) 49.839, (float) 100),
-    new CoordRec((float) 26.0295, (float) 0),
+    new CoordRec((float) 49.839, 100),
+    new CoordRec((float) 26.0295, 0),
 };
 
 static final CoordRec char87_stroke2[] = {
-    new CoordRec((float) 49.839, (float) 100),
-    new CoordRec((float) 73.6486, (float) 0),
+    new CoordRec((float) 49.839, 100),
+    new CoordRec((float) 73.6486, 0),
 };
 
 static final CoordRec char87_stroke3[] = {
-    new CoordRec((float) 97.4581, (float) 100),
-    new CoordRec((float) 73.6486, (float) 0),
+    new CoordRec((float) 97.4581, 100),
+    new CoordRec((float) 73.6486, 0),
 };
 
 static final StrokeRec char87[] = {
@@ -1374,13 +1374,13 @@ static final StrokeRec char87[] = {
 /* char: 88 'X' */
 
 static final CoordRec char88_stroke0[] = {
-    new CoordRec((float) 2.5, (float) 100),
-    new CoordRec((float) 69.1667, (float) 0),
+    new CoordRec((float) 2.5, 100),
+    new CoordRec((float) 69.1667, 0),
 };
 
 static final CoordRec char88_stroke1[] = {
-    new CoordRec((float) 69.1667, (float) 100),
-    new CoordRec((float) 2.5, (float) 0),
+    new CoordRec((float) 69.1667, 100),
+    new CoordRec((float) 2.5, 0),
 };
 
 static final StrokeRec char88[] = {
@@ -1391,13 +1391,13 @@ static final StrokeRec char88[] = {
 /* char: 89 'Y' */
 
 static final CoordRec char89_stroke0[] = {
-    new CoordRec((float) 1.52, (float) 100),
+    new CoordRec((float) 1.52, 100),
     new CoordRec((float) 39.6152, (float) 52.381),
-    new CoordRec((float) 39.6152, (float) 0),
+    new CoordRec((float) 39.6152, 0),
 };
 
 static final CoordRec char89_stroke1[] = {
-    new CoordRec((float) 77.7105, (float) 100),
+    new CoordRec((float) 77.7105, 100),
     new CoordRec((float) 39.6152, (float) 52.381),
 };
 
@@ -1409,18 +1409,18 @@ static final StrokeRec char89[] = {
 /* char: 90 'Z' */
 
 static final CoordRec char90_stroke0[] = {
-    new CoordRec((float) 69.1667, (float) 100),
-    new CoordRec((float) 2.5, (float) 0),
+    new CoordRec((float) 69.1667, 100),
+    new CoordRec((float) 2.5, 0),
 };
 
 static final CoordRec char90_stroke1[] = {
-    new CoordRec((float) 2.5, (float) 100),
-    new CoordRec((float) 69.1667, (float) 100),
+    new CoordRec((float) 2.5, 100),
+    new CoordRec((float) 69.1667, 100),
 };
 
 static final CoordRec char90_stroke2[] = {
-    new CoordRec((float) 2.5, (float) 0),
-    new CoordRec((float) 69.1667, (float) 0),
+    new CoordRec((float) 2.5, 0),
+    new CoordRec((float) 69.1667, 0),
 };
 
 static final StrokeRec char90[] = {
@@ -1461,7 +1461,7 @@ static final StrokeRec char91[] = {
 /* char: 92 '\' */
 
 static final CoordRec char92_stroke0[] = {
-    new CoordRec((float) 5.84, (float) 100),
+    new CoordRec((float) 5.84, 100),
     new CoordRec((float) 72.5067, (float) -14.2857),
 };
 
@@ -1532,12 +1532,12 @@ static final StrokeRec char95[] = {
 /* char: 96 '`' */
 
 static final CoordRec char96_stroke0[] = {
-    new CoordRec((float) 33.0219, (float) 100),
+    new CoordRec((float) 33.0219, 100),
     new CoordRec((float) 56.8314, (float) 71.4286),
 };
 
 static final CoordRec char96_stroke1[] = {
-    new CoordRec((float) 33.0219, (float) 100),
+    new CoordRec((float) 33.0219, 100),
     new CoordRec((float) 28.26, (float) 95.2381),
     new CoordRec((float) 56.8314, (float) 71.4286),
 };
@@ -1551,7 +1551,7 @@ static final StrokeRec char96[] = {
 
 static final CoordRec char97_stroke0[] = {
     new CoordRec((float) 63.8229, (float) 66.6667),
-    new CoordRec((float) 63.8229, (float) 0),
+    new CoordRec((float) 63.8229, 0),
 };
 
 static final CoordRec char97_stroke1[] = {
@@ -1565,8 +1565,8 @@ static final CoordRec char97_stroke1[] = {
     new CoordRec((float) 6.68, (float) 28.5714),
     new CoordRec((float) 11.4419, (float) 14.2857),
     new CoordRec((float) 20.9657, (float) 4.7619),
-    new CoordRec((float) 30.4895, (float) 0),
-    new CoordRec((float) 44.7752, (float) 0),
+    new CoordRec((float) 30.4895, 0),
+    new CoordRec((float) 44.7752, 0),
     new CoordRec((float) 54.299, (float) 4.7619),
     new CoordRec((float) 63.8229, (float) 14.2857),
 };
@@ -1579,8 +1579,8 @@ static final StrokeRec char97[] = {
 /* char: 98 'b' */
 
 static final CoordRec char98_stroke0[] = {
-    new CoordRec((float) 8.76, (float) 100),
-    new CoordRec((float) 8.76, (float) 0),
+    new CoordRec((float) 8.76, 100),
+    new CoordRec((float) 8.76, 0),
 };
 
 static final CoordRec char98_stroke1[] = {
@@ -1594,8 +1594,8 @@ static final CoordRec char98_stroke1[] = {
     new CoordRec((float) 65.9029, (float) 28.5714),
     new CoordRec((float) 61.141, (float) 14.2857),
     new CoordRec((float) 51.6171, (float) 4.7619),
-    new CoordRec((float) 42.0933, (float) 0),
-    new CoordRec((float) 27.8076, (float) 0),
+    new CoordRec((float) 42.0933, 0),
+    new CoordRec((float) 27.8076, 0),
     new CoordRec((float) 18.2838, (float) 4.7619),
     new CoordRec((float) 8.76, (float) 14.2857),
 };
@@ -1618,8 +1618,8 @@ static final CoordRec char99_stroke0[] = {
     new CoordRec((float) 5.52, (float) 28.5714),
     new CoordRec((float) 10.2819, (float) 14.2857),
     new CoordRec((float) 19.8057, (float) 4.7619),
-    new CoordRec((float) 29.3295, (float) 0),
-    new CoordRec((float) 43.6152, (float) 0),
+    new CoordRec((float) 29.3295, 0),
+    new CoordRec((float) 43.6152, 0),
     new CoordRec((float) 53.139, (float) 4.7619),
     new CoordRec((float) 62.6629, (float) 14.2857),
 };
@@ -1631,8 +1631,8 @@ static final StrokeRec char99[] = {
 /* char: 100 'd' */
 
 static final CoordRec char100_stroke0[] = {
-    new CoordRec((float) 61.7829, (float) 100),
-    new CoordRec((float) 61.7829, (float) 0),
+    new CoordRec((float) 61.7829, 100),
+    new CoordRec((float) 61.7829, 0),
 };
 
 static final CoordRec char100_stroke1[] = {
@@ -1646,8 +1646,8 @@ static final CoordRec char100_stroke1[] = {
     new CoordRec((float) 4.64, (float) 28.5714),
     new CoordRec((float) 9.4019, (float) 14.2857),
     new CoordRec((float) 18.9257, (float) 4.7619),
-    new CoordRec((float) 28.4495, (float) 0),
-    new CoordRec((float) 42.7352, (float) 0),
+    new CoordRec((float) 28.4495, 0),
+    new CoordRec((float) 42.7352, 0),
     new CoordRec((float) 52.259, (float) 4.7619),
     new CoordRec((float) 61.7829, (float) 14.2857),
 };
@@ -1673,8 +1673,8 @@ static final CoordRec char101_stroke0[] = {
     new CoordRec((float) 5.72, (float) 28.5714),
     new CoordRec((float) 10.4819, (float) 14.2857),
     new CoordRec((float) 20.0057, (float) 4.7619),
-    new CoordRec((float) 29.5295, (float) 0),
-    new CoordRec((float) 43.8152, (float) 0),
+    new CoordRec((float) 29.5295, 0),
+    new CoordRec((float) 43.8152, 0),
     new CoordRec((float) 53.339, (float) 4.7619),
     new CoordRec((float) 62.8629, (float) 14.2857),
 };
@@ -1686,11 +1686,11 @@ static final StrokeRec char101[] = {
 /* char: 102 'f' */
 
 static final CoordRec char102_stroke0[] = {
-    new CoordRec((float) 38.7752, (float) 100),
-    new CoordRec((float) 29.2514, (float) 100),
+    new CoordRec((float) 38.7752, 100),
+    new CoordRec((float) 29.2514, 100),
     new CoordRec((float) 19.7276, (float) 95.2381),
     new CoordRec((float) 14.9657, (float) 80.9524),
-    new CoordRec((float) 14.9657, (float) 0),
+    new CoordRec((float) 14.9657, 0),
 };
 
 static final CoordRec char102_stroke1[] = {
@@ -1726,8 +1726,8 @@ static final CoordRec char103_stroke1[] = {
     new CoordRec((float) 5.36, (float) 28.5714),
     new CoordRec((float) 10.1219, (float) 14.2857),
     new CoordRec((float) 19.6457, (float) 4.7619),
-    new CoordRec((float) 29.1695, (float) 0),
-    new CoordRec((float) 43.4552, (float) 0),
+    new CoordRec((float) 29.1695, 0),
+    new CoordRec((float) 43.4552, 0),
     new CoordRec((float) 52.979, (float) 4.7619),
     new CoordRec((float) 62.5029, (float) 14.2857),
 };
@@ -1740,8 +1740,8 @@ static final StrokeRec char103[] = {
 /* char: 104 'h' */
 
 static final CoordRec char104_stroke0[] = {
-    new CoordRec((float) 9.6, (float) 100),
-    new CoordRec((float) 9.6, (float) 0),
+    new CoordRec((float) 9.6, 100),
+    new CoordRec((float) 9.6, 0),
 };
 
 static final CoordRec char104_stroke1[] = {
@@ -1751,7 +1751,7 @@ static final CoordRec char104_stroke1[] = {
     new CoordRec((float) 47.6952, (float) 66.6667),
     new CoordRec((float) 57.219, (float) 61.9048),
     new CoordRec((float) 61.981, (float) 47.619),
-    new CoordRec((float) 61.981, (float) 0),
+    new CoordRec((float) 61.981, 0),
 };
 
 static final StrokeRec char104[] = {
@@ -1762,16 +1762,16 @@ static final StrokeRec char104[] = {
 /* char: 105 'i' */
 
 static final CoordRec char105_stroke0[] = {
-    new CoordRec((float) 10.02, (float) 100),
+    new CoordRec((float) 10.02, 100),
     new CoordRec((float) 14.7819, (float) 95.2381),
-    new CoordRec((float) 19.5438, (float) 100),
+    new CoordRec((float) 19.5438, 100),
     new CoordRec((float) 14.7819, (float) 104.762),
-    new CoordRec((float) 10.02, (float) 100),
+    new CoordRec((float) 10.02, 100),
 };
 
 static final CoordRec char105_stroke1[] = {
     new CoordRec((float) 14.7819, (float) 66.6667),
-    new CoordRec((float) 14.7819, (float) 0),
+    new CoordRec((float) 14.7819, 0),
 };
 
 static final StrokeRec char105[] = {
@@ -1782,11 +1782,11 @@ static final StrokeRec char105[] = {
 /* char: 106 'j' */
 
 static final CoordRec char106_stroke0[] = {
-    new CoordRec((float) 17.3876, (float) 100),
+    new CoordRec((float) 17.3876, 100),
     new CoordRec((float) 22.1495, (float) 95.2381),
-    new CoordRec((float) 26.9114, (float) 100),
+    new CoordRec((float) 26.9114, 100),
     new CoordRec((float) 22.1495, (float) 104.762),
-    new CoordRec((float) 17.3876, (float) 100),
+    new CoordRec((float) 17.3876, 100),
 };
 
 static final CoordRec char106_stroke1[] = {
@@ -1805,8 +1805,8 @@ static final StrokeRec char106[] = {
 /* char: 107 'k' */
 
 static final CoordRec char107_stroke0[] = {
-    new CoordRec((float) 9.6, (float) 100),
-    new CoordRec((float) 9.6, (float) 0),
+    new CoordRec((float) 9.6, 100),
+    new CoordRec((float) 9.6, 0),
 };
 
 static final CoordRec char107_stroke1[] = {
@@ -1816,7 +1816,7 @@ static final CoordRec char107_stroke1[] = {
 
 static final CoordRec char107_stroke2[] = {
     new CoordRec((float) 28.6476, (float) 38.0952),
-    new CoordRec((float) 61.981, (float) 0),
+    new CoordRec((float) 61.981, 0),
 };
 
 static final StrokeRec char107[] = {
@@ -1828,8 +1828,8 @@ static final StrokeRec char107[] = {
 /* char: 108 'l' */
 
 static final CoordRec char108_stroke0[] = {
-    new CoordRec((float) 10.02, (float) 100),
-    new CoordRec((float) 10.02, (float) 0),
+    new CoordRec((float) 10.02, 100),
+    new CoordRec((float) 10.02, 0),
 };
 
 static final StrokeRec char108[] = {
@@ -1840,7 +1840,7 @@ static final StrokeRec char108[] = {
 
 static final CoordRec char109_stroke0[] = {
     new CoordRec((float) 9.6, (float) 66.6667),
-    new CoordRec((float) 9.6, (float) 0),
+    new CoordRec((float) 9.6, 0),
 };
 
 static final CoordRec char109_stroke1[] = {
@@ -1850,7 +1850,7 @@ static final CoordRec char109_stroke1[] = {
     new CoordRec((float) 47.6952, (float) 66.6667),
     new CoordRec((float) 57.219, (float) 61.9048),
     new CoordRec((float) 61.981, (float) 47.619),
-    new CoordRec((float) 61.981, (float) 0),
+    new CoordRec((float) 61.981, 0),
 };
 
 static final CoordRec char109_stroke2[] = {
@@ -1860,7 +1860,7 @@ static final CoordRec char109_stroke2[] = {
     new CoordRec((float) 100.076, (float) 66.6667),
     new CoordRec((float) 109.6, (float) 61.9048),
     new CoordRec((float) 114.362, (float) 47.619),
-    new CoordRec((float) 114.362, (float) 0),
+    new CoordRec((float) 114.362, 0),
 };
 
 static final StrokeRec char109[] = {
@@ -1873,7 +1873,7 @@ static final StrokeRec char109[] = {
 
 static final CoordRec char110_stroke0[] = {
     new CoordRec((float) 9.18, (float) 66.6667),
-    new CoordRec((float) 9.18, (float) 0),
+    new CoordRec((float) 9.18, 0),
 };
 
 static final CoordRec char110_stroke1[] = {
@@ -1883,7 +1883,7 @@ static final CoordRec char110_stroke1[] = {
     new CoordRec((float) 47.2752, (float) 66.6667),
     new CoordRec((float) 56.799, (float) 61.9048),
     new CoordRec((float) 61.561, (float) 47.619),
-    new CoordRec((float) 61.561, (float) 0),
+    new CoordRec((float) 61.561, 0),
 };
 
 static final StrokeRec char110[] = {
@@ -1901,8 +1901,8 @@ static final CoordRec char111_stroke0[] = {
     new CoordRec((float) 4.98, (float) 28.5714),
     new CoordRec((float) 9.7419, (float) 14.2857),
     new CoordRec((float) 19.2657, (float) 4.7619),
-    new CoordRec((float) 28.7895, (float) 0),
-    new CoordRec((float) 43.0752, (float) 0),
+    new CoordRec((float) 28.7895, 0),
+    new CoordRec((float) 43.0752, 0),
     new CoordRec((float) 52.599, (float) 4.7619),
     new CoordRec((float) 62.1229, (float) 14.2857),
     new CoordRec((float) 66.8848, (float) 28.5714),
@@ -1935,8 +1935,8 @@ static final CoordRec char112_stroke1[] = {
     new CoordRec((float) 66.6029, (float) 28.5714),
     new CoordRec((float) 61.841, (float) 14.2857),
     new CoordRec((float) 52.3171, (float) 4.7619),
-    new CoordRec((float) 42.7933, (float) 0),
-    new CoordRec((float) 28.5076, (float) 0),
+    new CoordRec((float) 42.7933, 0),
+    new CoordRec((float) 28.5076, 0),
     new CoordRec((float) 18.9838, (float) 4.7619),
     new CoordRec((float) 9.46, (float) 14.2857),
 };
@@ -1964,8 +1964,8 @@ static final CoordRec char113_stroke1[] = {
     new CoordRec((float) 4.84, (float) 28.5714),
     new CoordRec((float) 9.6019, (float) 14.2857),
     new CoordRec((float) 19.1257, (float) 4.7619),
-    new CoordRec((float) 28.6495, (float) 0),
-    new CoordRec((float) 42.9352, (float) 0),
+    new CoordRec((float) 28.6495, 0),
+    new CoordRec((float) 42.9352, 0),
     new CoordRec((float) 52.459, (float) 4.7619),
     new CoordRec((float) 61.9829, (float) 14.2857),
 };
@@ -1979,7 +1979,7 @@ static final StrokeRec char113[] = {
 
 static final CoordRec char114_stroke0[] = {
     new CoordRec((float) 9.46, (float) 66.6667),
-    new CoordRec((float) 9.46, (float) 0),
+    new CoordRec((float) 9.46, 0),
 };
 
 static final CoordRec char114_stroke1[] = {
@@ -2011,8 +2011,8 @@ static final CoordRec char115_stroke0[] = {
     new CoordRec((float) 57.081, (float) 19.0476),
     new CoordRec((float) 57.081, (float) 14.2857),
     new CoordRec((float) 52.319, (float) 4.7619),
-    new CoordRec((float) 38.0333, (float) 0),
-    new CoordRec((float) 23.7476, (float) 0),
+    new CoordRec((float) 38.0333, 0),
+    new CoordRec((float) 23.7476, 0),
     new CoordRec((float) 9.4619, (float) 4.7619),
     new CoordRec((float) 4.7, (float) 14.2857),
 };
@@ -2024,11 +2024,11 @@ static final StrokeRec char115[] = {
 /* char: 116 't' */
 
 static final CoordRec char116_stroke0[] = {
-    new CoordRec((float) 14.8257, (float) 100),
+    new CoordRec((float) 14.8257, 100),
     new CoordRec((float) 14.8257, (float) 19.0476),
     new CoordRec((float) 19.5876, (float) 4.7619),
-    new CoordRec((float) 29.1114, (float) 0),
-    new CoordRec((float) 38.6352, (float) 0),
+    new CoordRec((float) 29.1114, 0),
+    new CoordRec((float) 38.6352, 0),
 };
 
 static final CoordRec char116_stroke1[] = {
@@ -2047,15 +2047,15 @@ static final CoordRec char117_stroke0[] = {
     new CoordRec((float) 9.46, (float) 66.6667),
     new CoordRec((float) 9.46, (float) 19.0476),
     new CoordRec((float) 14.2219, (float) 4.7619),
-    new CoordRec((float) 23.7457, (float) 0),
-    new CoordRec((float) 38.0314, (float) 0),
+    new CoordRec((float) 23.7457, 0),
+    new CoordRec((float) 38.0314, 0),
     new CoordRec((float) 47.5552, (float) 4.7619),
     new CoordRec((float) 61.841, (float) 19.0476),
 };
 
 static final CoordRec char117_stroke1[] = {
     new CoordRec((float) 61.841, (float) 66.6667),
-    new CoordRec((float) 61.841, (float) 0),
+    new CoordRec((float) 61.841, 0),
 };
 
 static final StrokeRec char117[] = {
@@ -2067,12 +2067,12 @@ static final StrokeRec char117[] = {
 
 static final CoordRec char118_stroke0[] = {
     new CoordRec((float) 1.8, (float) 66.6667),
-    new CoordRec((float) 30.3714, (float) 0),
+    new CoordRec((float) 30.3714, 0),
 };
 
 static final CoordRec char118_stroke1[] = {
     new CoordRec((float) 58.9429, (float) 66.6667),
-    new CoordRec((float) 30.3714, (float) 0),
+    new CoordRec((float) 30.3714, 0),
 };
 
 static final StrokeRec char118[] = {
@@ -2084,22 +2084,22 @@ static final StrokeRec char118[] = {
 
 static final CoordRec char119_stroke0[] = {
     new CoordRec((float) 2.5, (float) 66.6667),
-    new CoordRec((float) 21.5476, (float) 0),
+    new CoordRec((float) 21.5476, 0),
 };
 
 static final CoordRec char119_stroke1[] = {
     new CoordRec((float) 40.5952, (float) 66.6667),
-    new CoordRec((float) 21.5476, (float) 0),
+    new CoordRec((float) 21.5476, 0),
 };
 
 static final CoordRec char119_stroke2[] = {
     new CoordRec((float) 40.5952, (float) 66.6667),
-    new CoordRec((float) 59.6429, (float) 0),
+    new CoordRec((float) 59.6429, 0),
 };
 
 static final CoordRec char119_stroke3[] = {
     new CoordRec((float) 78.6905, (float) 66.6667),
-    new CoordRec((float) 59.6429, (float) 0),
+    new CoordRec((float) 59.6429, 0),
 };
 
 static final StrokeRec char119[] = {
@@ -2113,12 +2113,12 @@ static final StrokeRec char119[] = {
 
 static final CoordRec char120_stroke0[] = {
     new CoordRec((float) 1.66, (float) 66.6667),
-    new CoordRec((float) 54.041, (float) 0),
+    new CoordRec((float) 54.041, 0),
 };
 
 static final CoordRec char120_stroke1[] = {
     new CoordRec((float) 54.041, (float) 66.6667),
-    new CoordRec((float) 1.66, (float) 0),
+    new CoordRec((float) 1.66, 0),
 };
 
 static final StrokeRec char120[] = {
@@ -2130,12 +2130,12 @@ static final StrokeRec char120[] = {
 
 static final CoordRec char121_stroke0[] = {
     new CoordRec((float) 6.5619, (float) 66.6667),
-    new CoordRec((float) 35.1333, (float) 0),
+    new CoordRec((float) 35.1333, 0),
 };
 
 static final CoordRec char121_stroke1[] = {
     new CoordRec((float) 63.7048, (float) 66.6667),
-    new CoordRec((float) 35.1333, (float) 0),
+    new CoordRec((float) 35.1333, 0),
     new CoordRec((float) 25.6095, (float) -19.0476),
     new CoordRec((float) 16.0857, (float) -28.5714),
     new CoordRec((float) 6.5619, (float) -33.3333),
@@ -2151,7 +2151,7 @@ static final StrokeRec char121[] = {
 
 static final CoordRec char122_stroke0[] = {
     new CoordRec((float) 56.821, (float) 66.6667),
-    new CoordRec((float) 4.44, (float) 0),
+    new CoordRec((float) 4.44, 0),
 };
 
 static final CoordRec char122_stroke1[] = {
@@ -2160,8 +2160,8 @@ static final CoordRec char122_stroke1[] = {
 };
 
 static final CoordRec char122_stroke2[] = {
-    new CoordRec((float) 4.44, (float) 0),
-    new CoordRec((float) 56.821, (float) 0),
+    new CoordRec((float) 4.44, 0),
+    new CoordRec((float) 56.821, 0),
 };
 
 static final StrokeRec char122[] = {
@@ -2176,7 +2176,7 @@ static final CoordRec char123_stroke0[] = {
     new CoordRec((float) 31.1895, (float) 119.048),
     new CoordRec((float) 21.6657, (float) 114.286),
     new CoordRec((float) 16.9038, (float) 109.524),
-    new CoordRec((float) 12.1419, (float) 100),
+    new CoordRec((float) 12.1419, 100),
     new CoordRec((float) 12.1419, (float) 90.4762),
     new CoordRec((float) 16.9038, (float) 80.9524),
     new CoordRec((float) 21.6657, (float) 76.1905),
@@ -2199,7 +2199,7 @@ static final CoordRec char123_stroke1[] = {
     new CoordRec((float) 31.1895, (float) 23.8095),
     new CoordRec((float) 31.1895, (float) 14.2857),
     new CoordRec((float) 26.4276, (float) 4.7619),
-    new CoordRec((float) 21.6657, (float) 0),
+    new CoordRec((float) 21.6657, 0),
     new CoordRec((float) 16.9038, (float) -9.5238),
     new CoordRec((float) 16.9038, (float) -19.0476),
     new CoordRec((float) 21.6657, (float) -28.5714),
@@ -2241,7 +2241,7 @@ static final CoordRec char125_stroke0[] = {
     new CoordRec((float) 9.18, (float) 119.048),
     new CoordRec((float) 18.7038, (float) 114.286),
     new CoordRec((float) 23.4657, (float) 109.524),
-    new CoordRec((float) 28.2276, (float) 100),
+    new CoordRec((float) 28.2276, 100),
     new CoordRec((float) 28.2276, (float) 90.4762),
     new CoordRec((float) 23.4657, (float) 80.9524),
     new CoordRec((float) 18.7038, (float) 76.1905),
@@ -2264,7 +2264,7 @@ static final CoordRec char125_stroke1[] = {
     new CoordRec((float) 9.18, (float) 23.8095),
     new CoordRec((float) 9.18, (float) 14.2857),
     new CoordRec((float) 13.9419, (float) 4.7619),
-    new CoordRec((float) 18.7038, (float) 0),
+    new CoordRec((float) 18.7038, 0),
     new CoordRec((float) 23.4657, (float) -9.5238),
     new CoordRec((float) 23.4657, (float) -19.0476),
     new CoordRec((float) 18.7038, (float) -28.5714),
@@ -2327,7 +2327,7 @@ static final StrokeRec char126[] = {
 /* char: 127 */
 
 static final CoordRec char127_stroke0[] = {
-    new CoordRec((float) 52.381, (float) 100),
+    new CoordRec((float) 52.381, 100),
     new CoordRec((float) 14.2857, (float) -33.3333),
 };
 
@@ -2335,12 +2335,12 @@ static final CoordRec char127_stroke1[] = {
     new CoordRec((float) 28.5714, (float) 66.6667),
     new CoordRec((float) 14.2857, (float) 61.9048),
     new CoordRec((float) 4.7619, (float) 52.381),
-    new CoordRec((float) 0, (float) 38.0952),
-    new CoordRec((float) 0, (float) 23.8095),
+    new CoordRec(0, (float) 38.0952),
+    new CoordRec(0, (float) 23.8095),
     new CoordRec((float) 4.7619, (float) 14.2857),
     new CoordRec((float) 14.2857, (float) 4.7619),
-    new CoordRec((float) 28.5714, (float) 0),
-    new CoordRec((float) 38.0952, (float) 0),
+    new CoordRec((float) 28.5714, 0),
+    new CoordRec((float) 38.0952, 0),
     new CoordRec((float) 52.381, (float) 4.7619),
     new CoordRec((float) 61.9048, (float) 14.2857),
     new CoordRec((float) 66.6667, (float) 28.5714),
@@ -2357,38 +2357,38 @@ static final StrokeRec char127[] = {
 };
 
 static final StrokeCharRec chars[] = {
-    new StrokeCharRec( 0, /* char0 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char1 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char2 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char3 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char4 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char5 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char6 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char7 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char8 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char9 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char10 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char11 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char12 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char13 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char14 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char15 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char16 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char17 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char18 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char19 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char20 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char21 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char22 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char23 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char24 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char25 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char26 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char27 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char28 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char29 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char30 */ null, (float) 0, (float) 0 ),
-    new StrokeCharRec( 0, /* char31 */ null, (float) 0, (float) 0 ),
+    new StrokeCharRec( 0, /* char0 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char1 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char2 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char3 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char4 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char5 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char6 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char7 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char8 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char9 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char10 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char11 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char12 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char13 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char14 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char15 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char16 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char17 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char18 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char19 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char20 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char21 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char22 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char23 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char24 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char25 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char26 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char27 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char28 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char29 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char30 */ null, 0, 0 ),
+    new StrokeCharRec( 0, /* char31 */ null, 0, 0 ),
     new StrokeCharRec( 0, /* char32 */ null, (float) 52.381, (float) 104.762 ),
     new StrokeCharRec( 2, char33, (float) 13.3819, (float) 26.6238 ),
     new StrokeCharRec( 2, char34, (float) 23.0676, (float) 51.4352 ),
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java
index 515212f..59935e3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeCharRec.java
@@ -51,10 +51,10 @@ class StrokeCharRec {
   public float center;
   public float right;
 
-  public StrokeCharRec(int num_strokes,
-                StrokeRec[] stroke,
-                float center,
-                float right) {
+  public StrokeCharRec(final int num_strokes,
+                final StrokeRec[] stroke,
+                final float center,
+                final float right) {
     this.num_strokes = num_strokes;
     this.stroke = stroke;
     this.center = center;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java
index 5335c85..5810ac3 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeFontRec.java
@@ -52,11 +52,11 @@ class StrokeFontRec {
   public float top;
   public float bottom;
 
-  public StrokeFontRec(String name,
-                int num_chars,
-                StrokeCharRec[] ch,
-                float top,
-                float bottom) {
+  public StrokeFontRec(final String name,
+                final int num_chars,
+                final StrokeCharRec[] ch,
+                final float top,
+                final float bottom) {
     this.name = name;
     this.num_chars = num_chars;
     this.ch = ch;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java
index b0c91c6..fcb7c91 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/gl2/StrokeRec.java
@@ -49,8 +49,8 @@ class StrokeRec {
   public int num_coords;
   public CoordRec[] coord;
 
-  public StrokeRec(int num_coords,
-            CoordRec[] coord) {
+  public StrokeRec(final int num_coords,
+            final CoordRec[] coord) {
     this.num_coords = num_coords;
     this.coord = coord;
   }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
index 6a64ede..574fc42 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderCode.java
@@ -96,7 +96,7 @@ public class ShaderCode {
      *
      * @throws IllegalArgumentException if <code>count</count> and <code>source.length</code> do not match
      */
-    public ShaderCode(int type, int count, CharSequence[][] source) {
+    public ShaderCode(final int type, final int count, final CharSequence[][] source) {
         if(source.length != count) {
             throw new IllegalArgumentException("shader number ("+count+") and sourceFiles array ("+source.length+") of different lenght.");
         }
@@ -126,7 +126,7 @@ public class ShaderCode {
      * @param count number of shaders
      * @param binary binary buffer containing the shader binaries,
      */
-    public ShaderCode(int type, int count, int binFormat, Buffer binary) {
+    public ShaderCode(final int type, final int count, final int binFormat, final Buffer binary) {
         switch (type) {
             case GL2ES2.GL_VERTEX_SHADER:
             case GL2ES2.GL_FRAGMENT_SHADER:
@@ -162,7 +162,7 @@ public class ShaderCode {
      * @throws IllegalArgumentException if <code>count</count> and <code>sourceFiles.length</code> do not match
      * @see #readShaderSource(Class, String)
      */
-    public static ShaderCode create(GL2ES2 gl, int type, int count, Class<?> context, String[] sourceFiles, boolean mutableStringBuilder) {
+    public static ShaderCode create(final GL2ES2 gl, final int type, final int count, final Class<?> context, final String[] sourceFiles, final boolean mutableStringBuilder) {
         if(null != gl && !ShaderUtil.isShaderCompilerAvailable(gl)) {
             return null;
         }
@@ -174,7 +174,7 @@ public class ShaderCode {
             for(int i=0; i<sourceFiles.length; i++) {
                 try {
                     shaderSources[i][0] = readShaderSource(context, sourceFiles[i], mutableStringBuilder);
-                } catch (IOException ioe) {
+                } catch (final IOException ioe) {
                     throw new RuntimeException("readShaderSource("+sourceFiles[i]+") error: ", ioe);
                 }
                 if(null == shaderSources[i][0]) {
@@ -201,12 +201,12 @@ public class ShaderCode {
      * @see #readShaderBinary(Class, String)
      * @see ShaderUtil#getShaderBinaryFormats(GL)
      */
-    public static ShaderCode create(int type, int count, Class<?> context, int binFormat, String binaryFile) {
+    public static ShaderCode create(final int type, final int count, final Class<?> context, int binFormat, final String binaryFile) {
         ByteBuffer shaderBinary = null;
         if(null!=binaryFile && 0<=binFormat) {
             try {
                 shaderBinary = readShaderBinary(context, binaryFile);
-            } catch (IOException ioe) {
+            } catch (final IOException ioe) {
                 throw new RuntimeException("readShaderBinary("+binaryFile+") error: ", ioe);
             }
             if(null == shaderBinary) {
@@ -238,7 +238,7 @@ public class ShaderCode {
      *
      * @see #create(GL2ES2, int, Class, String, String, String, boolean)
      */
-    public static String getFileSuffix(boolean binary, int type) {
+    public static String getFileSuffix(final boolean binary, final int type) {
         switch (type) {
             case GL2ES2.GL_VERTEX_SHADER:
                 return binary?SUFFIX_VERTEX_BINARY:SUFFIX_VERTEX_SOURCE;
@@ -261,7 +261,7 @@ public class ShaderCode {
      *
      * @see #create(GL2ES2, int, Class, String, String, String, boolean)
      */
-    public static String getBinarySubPath(int binFormat) {
+    public static String getBinarySubPath(final int binFormat) {
         switch (binFormat) {
             case GLES2.GL_NVIDIA_PLATFORM_BINARY_NV:
                 return SUB_PATH_NVIDIA;
@@ -327,7 +327,7 @@ public class ShaderCode {
      * @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER}
      * @param count number of shaders
      * @param context class used to help resolving the source and binary location
-     * @param srcRoot relative <i>root</i> path for <code>srcBasenames</code>
+     * @param srcRoot relative <i>root</i> path for <code>srcBasenames</code> optional
      * @param srcBasenames basenames w/o path or suffix relative to <code>srcRoot</code> for the shader's source code
      * @param binRoot relative <i>root</i> path for <code>binBasenames</code>
      * @param binBasename basename w/o path or suffix relative to <code>binRoot</code> for the shader's binary code
@@ -347,19 +347,25 @@ public class ShaderCode {
      * @see ShaderUtil#getShaderBinaryFormats(GL)
      * @see #getBinarySubPath(int)
      */
-    public static ShaderCode create(GL2ES2 gl, int type, int count, Class<?> context,
-                                    String srcRoot, String[] srcBasenames, String binRoot, String binBasename,
-                                    boolean mutableStringBuilder) {
+    public static ShaderCode create(final GL2ES2 gl, final int type, final int count, final Class<?> context,
+                                    final String srcRoot, final String[] srcBasenames, final String binRoot, final String binBasename,
+                                    final boolean mutableStringBuilder) {
         ShaderCode res = null;
         final String srcPath[];
         String srcPathString = null;
         String binFileName = null;
 
-        if(null!=srcRoot && null!=srcBasenames && ShaderUtil.isShaderCompilerAvailable(gl)) {
+        if( null!=srcBasenames && ShaderUtil.isShaderCompilerAvailable(gl) ) {
             srcPath = new String[srcBasenames.length];
             final String srcSuffix = getFileSuffix(false, type);
-            for(int i=0; i<srcPath.length; i++) {
-                srcPath[i] = srcRoot + '/' + srcBasenames[i] + "." + srcSuffix;
+            if( null != srcRoot && srcRoot.length() > 0 ) {
+                for(int i=0; i<srcPath.length; i++) {
+                    srcPath[i] = srcRoot + '/' + srcBasenames[i] + "." + srcSuffix;
+                }
+            } else {
+                for(int i=0; i<srcPath.length; i++) {
+                    srcPath[i] = srcBasenames[i] + "." + srcSuffix;
+                }
             }
             res = create(gl, type, count, context, srcPath, mutableStringBuilder);
             if(null!=res) {
@@ -369,12 +375,12 @@ public class ShaderCode {
         } else {
             srcPath = null;
         }
-        if(null!=binRoot && null!=binBasename) {
-            Set<Integer> binFmts = ShaderUtil.getShaderBinaryFormats(gl);
+        if( null!=binBasename ) {
+            final Set<Integer> binFmts = ShaderUtil.getShaderBinaryFormats(gl);
             final String binSuffix = getFileSuffix(true, type);
-            for(Iterator<Integer> iter=binFmts.iterator(); iter.hasNext(); ) {
-                int bFmt = iter.next().intValue();
-                String bFmtPath = getBinarySubPath(bFmt);
+            for(final Iterator<Integer> iter=binFmts.iterator(); iter.hasNext(); ) {
+                final int bFmt = iter.next().intValue();
+                final String bFmtPath = getBinarySubPath(bFmt);
                 if(null==bFmtPath) continue;
                 binFileName = binRoot + '/' + bFmtPath + '/' + binBasename + "." + binSuffix;
                 res = create(type, count, context, bFmt, binFileName);
@@ -426,7 +432,7 @@ public class ShaderCode {
      *           or to determine the shader binary format (if <code>binary</code> is used).
      * @param type either {@link GL2ES2#GL_VERTEX_SHADER}, {@link GL2ES2#GL_FRAGMENT_SHADER} or {@link GL3#GL_GEOMETRY_SHADER}
      * @param context class used to help resolving the source and binary location
-     * @param srcRoot relative <i>root</i> path for <code>basename</code>
+     * @param srcRoot relative <i>root</i> path for <code>basename</code> optional
      * @param binRoot relative <i>root</i> path for <code>basename</code>
      * @param mutableStringBuilder TODO
      * @param basenames basename w/o path or suffix relative to <code>srcRoot</code> and <code>binRoot</code>
@@ -441,8 +447,8 @@ public class ShaderCode {
      *
      * @see #create(GL2ES2, int, int, Class, String, String[], String, String)
      */
-    public static ShaderCode create(GL2ES2 gl, int type, Class<?> context,
-                                    String srcRoot, String binRoot, String basename, boolean mutableStringBuilder) {
+    public static ShaderCode create(final GL2ES2 gl, final int type, final Class<?> context,
+                                    final String srcRoot, final String binRoot, final String basename, final boolean mutableStringBuilder) {
         return create(gl, type, 1, context, srcRoot, new String[] { basename }, binRoot, basename, mutableStringBuilder );
     }
 
@@ -454,7 +460,7 @@ public class ShaderCode {
     public int        shaderType() { return shaderType; }
     public String     shaderTypeStr() { return shaderTypeStr(shaderType); }
 
-    public static String shaderTypeStr(int type) {
+    public static String shaderTypeStr(final int type) {
         switch (type) {
             case GL2ES2.GL_VERTEX_SHADER:
                 return "VERTEX_SHADER";
@@ -474,10 +480,10 @@ public class ShaderCode {
 
     public IntBuffer  shader() { return shader; }
 
-    public boolean compile(GL2ES2 gl) {
+    public boolean compile(final GL2ES2 gl) {
         return compile(gl, null);
     }
-    public boolean compile(GL2ES2 gl, PrintStream verboseOut) {
+    public boolean compile(final GL2ES2 gl, final PrintStream verboseOut) {
         if(isValid()) return true;
 
         // Create & Compile the vertex/fragment shader objects
@@ -497,7 +503,7 @@ public class ShaderCode {
         return valid;
     }
 
-    public void destroy(GL2ES2 gl) {
+    public void destroy(final GL2ES2 gl) {
         if(isValid()) {
             if(null!=gl) {
                 ShaderUtil.deleteShader(gl, shader());
@@ -515,7 +521,7 @@ public class ShaderCode {
     }
 
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if(this==obj) { return true; }
         if(obj instanceof ShaderCode) {
             return id()==((ShaderCode)obj).id();
@@ -528,7 +534,7 @@ public class ShaderCode {
     }
     @Override
     public String toString() {
-        StringBuilder buf = new StringBuilder("ShaderCode[id="+id+", type="+shaderTypeStr()+", valid="+valid+", shader: ");
+        final StringBuilder buf = new StringBuilder("ShaderCode[id="+id+", type="+shaderTypeStr()+", valid="+valid+", shader: ");
         for(int i=0; i<shader.remaining(); i++) {
             buf.append(" "+shader.get(i));
         }
@@ -540,12 +546,12 @@ public class ShaderCode {
         return buf.toString();
     }
 
-    public void dumpShaderSource(PrintStream out) {
+    public void dumpShaderSource(final PrintStream out) {
         if(null==shaderSource) {
             out.println("<no shader source>");
             return;
         }
-        final int sourceCount = (null!=shaderSource)?shaderSource.length:0;
+        final int sourceCount = shaderSource.length;
         final int shaderCount = (null!=shader)?shader.capacity():0;
         for(int i=0; i<shaderCount; i++) {
             out.println("");
@@ -554,7 +560,7 @@ public class ShaderCode {
             if(i>=sourceCount) {
                 out.println("<no shader source>");
             } else {
-                CharSequence[] src = shaderSource[i];
+                final CharSequence[] src = shaderSource[i];
                 int lineno=0;
 
                 for(int j=0; j<src.length; j++) {
@@ -566,7 +572,7 @@ public class ShaderCode {
                             lineno++;
                             out.printf("%4d: %s\n", lineno, line);
                         }
-                    } catch (IOException e) { /* impossible .. StringReader */ }
+                    } catch (final IOException e) { /* impossible .. StringReader */ }
                 }
             }
             out.println("--------------------------------------------------------------");
@@ -587,7 +593,7 @@ public class ShaderCode {
      *
      * @throws IllegalStateException if the shader source's CharSequence is immutable, i.e. not of type <code>StringBuilder</code>
      */
-    public int insertShaderSource(int shaderIdx, String tag, int fromIndex, CharSequence data) {
+    public int insertShaderSource(final int shaderIdx, final String tag, final int fromIndex, final CharSequence data) {
         if(null==shaderSource) {
             throw new IllegalStateException("no shader source");
         }
@@ -595,7 +601,7 @@ public class ShaderCode {
         if(0>shaderIdx || shaderIdx>=shaderCount) {
             throw new IndexOutOfBoundsException("shaderIdx not within shader bounds [0.."+(shaderCount-1)+"]: "+shaderIdx);
         }
-        final int sourceCount = (null!=shaderSource)?shaderSource.length:0;
+        final int sourceCount = shaderSource.length;
         if(shaderIdx>=sourceCount) {
             throw new IndexOutOfBoundsException("shaderIdx not within source bounds [0.."+(sourceCount-1)+"]: "+shaderIdx);
         }
@@ -644,7 +650,7 @@ public class ShaderCode {
      *
      * @throws IllegalStateException if the shader source's CharSequence is immutable, i.e. not of type <code>StringBuilder</code>
      */
-    public int replaceInShaderSource(String oldName, String newName) {
+    public int replaceInShaderSource(final String oldName, final String newName) {
         if(null==shaderSource) {
             throw new IllegalStateException("no shader source");
         }
@@ -654,7 +660,7 @@ public class ShaderCode {
         final int oldNameLen = oldName.length();
         final int newNameLen = newName.length();
         int num = 0;
-        final int sourceCount = (null!=shaderSource)?shaderSource.length:0;
+        final int sourceCount = shaderSource.length;
         for(int shaderIdx = 0; shaderIdx<sourceCount; shaderIdx++) {
             final CharSequence[] src = shaderSource[shaderIdx];
             for(int j=0; j<src.length; j++) {
@@ -664,9 +670,9 @@ public class ShaderCode {
                 final StringBuilder sb = (StringBuilder)src[j];
                 int curPos = 0;
                 while(curPos<sb.length()-oldNameLen+1) {
-                    int startIdx = sb.indexOf(oldName, curPos);
+                    final int startIdx = sb.indexOf(oldName, curPos);
                     if(0<=startIdx) {
-                        int endIdx = startIdx + oldNameLen;
+                        final int endIdx = startIdx + oldNameLen;
                         sb.replace(startIdx, endIdx, newName);
                         curPos = startIdx + newNameLen;
                         num++;
@@ -680,19 +686,19 @@ public class ShaderCode {
     }
 
     /**
-     * Adds <code>data</code> at <code>offset</code> in shader source for shader <code>shaderIdx</code>.
+     * Adds <code>data</code> at <code>position</code> in shader source for shader <code>shaderIdx</code>.
      * <p>
      * Note: The shader source to be edit must be created using a mutable StringBuilder.
      * </p>
      *
      * @param shaderIdx the shader index to be used.
-     * @param position in shader source segments of shader <code>shaderIdx</code>
+     * @param position in shader source segments of shader <code>shaderIdx</code>, -1 will append data
      * @param data the text to be inserted. Shall end with an EOL '\n' character
      * @return index after the inserted <code>data</code>
      *
      * @throws IllegalStateException if the shader source's CharSequence is immutable, i.e. not of type <code>StringBuilder</code>
      */
-    public int insertShaderSource(int shaderIdx, int position, CharSequence data) {
+    public int insertShaderSource(final int shaderIdx, int position, final CharSequence data) {
         if(null==shaderSource) {
             throw new IllegalStateException("no shader source");
         }
@@ -700,7 +706,7 @@ public class ShaderCode {
         if(0>shaderIdx || shaderIdx>=shaderCount) {
             throw new IndexOutOfBoundsException("shaderIdx not within shader bounds [0.."+(shaderCount-1)+"]: "+shaderIdx);
         }
-        final int sourceCount = (null!=shaderSource)?shaderSource.length:0;
+        final int sourceCount = shaderSource.length;
         if(shaderIdx>=sourceCount) {
             throw new IndexOutOfBoundsException("shaderIdx not within source bounds [0.."+(sourceCount-1)+"]: "+shaderIdx);
         }
@@ -712,16 +718,49 @@ public class ShaderCode {
             }
             final StringBuilder sb = (StringBuilder)src[j];
             curEndIndex += sb.length();
-            if(position < curEndIndex) {
+            if( 0 > position && j == src.length - 1 ) {
+                position = curEndIndex;
+            }
+            if(0 <= position && position <= curEndIndex ) {
                 sb.insert(position, data);
                 return position+data.length();
             }
         }
-        return -1;
+        return position;
+    }
+
+    /**
+     * Adds shader source located in <code>path</code>,
+     * either relative to the <code>context</code> class or absolute <i>as-is</i>
+     * at <code>position</code> in shader source for shader <code>shaderIdx</code>.
+     * <p>
+     * Final location lookup is performed via {@link ClassLoader#getResource(String)} and {@link ClassLoader#getSystemResource(String)},
+     * see {@link IOUtil#getResource(Class, String)}.
+     * </p>
+     * <p>
+     * Note: The shader source to be edit must be created using a mutable StringBuilder.
+     * </p>
+     *
+     * @param shaderIdx the shader index to be used.
+     * @param position in shader source segments of shader <code>shaderIdx</code>, -1 will append data
+     * @param context class used to help resolve the source location
+     * @param path location of shader source
+     * @return index after the inserted code.
+     * @throws IOException
+     * @throws IllegalStateException if the shader source's CharSequence is immutable, i.e. not of type <code>StringBuilder</code>
+     * @see IOUtil#getResource(Class, String)
+     */
+    public int insertShaderSource(final int shaderIdx, final int position, final Class<?> context, final String path) throws IOException {
+        final CharSequence data = readShaderSource(context, path, true);
+        if( null != data ) {
+            return insertShaderSource(shaderIdx, position, data);
+        } else {
+            return position;
+        }
     }
 
     @SuppressWarnings("resource")
-    private static int readShaderSource(Class<?> context, URLConnection conn, StringBuilder result, int lineno) throws IOException  {
+    private static int readShaderSource(final Class<?> context, final URLConnection conn, final StringBuilder result, int lineno) throws IOException  {
         if(DEBUG_CODE) {
             if(0 == lineno) {
                 result.append("// "+conn.getURL().toExternalForm()+"\n");
@@ -735,7 +774,7 @@ public class ShaderCode {
             while ((line = reader.readLine()) != null) {
                 lineno++;
                 if (line.startsWith("#include ")) {
-                    String includeFile = line.substring(9).trim();
+                    final String includeFile = line.substring(9).trim();
                     URLConnection nextConn = null;
 
                     // Try relative of current shader location
@@ -766,7 +805,7 @@ public class ShaderCode {
      * @param result
      * @throws IOException
      */
-    public static void readShaderSource(Class<?> context, URLConnection conn, StringBuilder result) throws IOException {
+    public static void readShaderSource(final Class<?> context, final URLConnection conn, final StringBuilder result) throws IOException {
         readShaderSource(context, conn, result, 0);
     }
 
@@ -790,12 +829,12 @@ public class ShaderCode {
      *
      * @see IOUtil#getResource(Class, String)
      */
-    public static CharSequence readShaderSource(Class<?> context, String path, boolean mutableStringBuilder) throws IOException {
-        URLConnection conn = IOUtil.getResource(context, path);
+    public static CharSequence readShaderSource(final Class<?> context, final String path, final boolean mutableStringBuilder) throws IOException {
+        final URLConnection conn = IOUtil.getResource(context, path);
         if (conn == null) {
             return null;
         }
-        StringBuilder result = new StringBuilder();
+        final StringBuilder result = new StringBuilder();
         readShaderSource(context, conn, result);
         return mutableStringBuilder ? result : result.toString();
     }
@@ -814,7 +853,7 @@ public class ShaderCode {
      *
      * @see IOUtil#getResource(Class, String)
      */
-    public static ByteBuffer readShaderBinary(Class<?> context, String path) throws IOException {
+    public static ByteBuffer readShaderBinary(final Class<?> context, final String path) throws IOException {
         final URLConnection conn = IOUtil.getResource(context, path);
         if (conn == null) {
             return null;
@@ -835,8 +874,12 @@ public class ShaderCode {
 
     /** Default precision of {@link GL#isGLES3() ES3} for {@link GL2ES2#GL_VERTEX_SHADER vertex-shader}: {@value #es3_default_precision_vp} */
     public static final String es3_default_precision_vp = es2_default_precision_vp;
-    /** Default precision of {@link GL#isGLES3() ES3} for {@link GL2ES2#GL_FRAGMENT_SHADER fragment-shader}: {@value #es3_default_precision_fp} */
-    public static final String es3_default_precision_fp = es2_default_precision_fp;
+    /**
+     * Default precision of {@link GL#isGLES3() ES3} for {@link GL2ES2#GL_FRAGMENT_SHADER fragment-shader}: {@value #es3_default_precision_fp},
+     * same as for {@link GL2ES2#GL_VERTEX_SHADER vertex-shader}, i.e {@link #es3_default_precision_vp},
+     * due to ES 3.x requirements of using same precision for uniforms!
+     */
+    public static final String es3_default_precision_fp = es3_default_precision_vp;
 
     /** Default precision of GLSL ≥ 1.30 as required until < 1.50 for {@link GL2ES2#GL_VERTEX_SHADER vertex-shader} or {@link GL3#GL_GEOMETRY_SHADER geometry-shader}: {@value #gl3_default_precision_vp_gp}. See GLSL Spec 1.30-1.50 Section 4.5.3. */
     public static final String gl3_default_precision_vp_gp = "\nprecision highp float;\nprecision highp int;\n";
@@ -862,8 +905,8 @@ public class ShaderCode {
      * @param behavior shall be either {@link #REQUIRE}, {@link #ENABLE}, {@link #DISABLE} or {@link #WARN}
      * @return the complete extension directive
      */
-    public static String createExtensionDirective(String extensionName, String behavior) {
-        return "#extension " + extensionName + " : " + behavior;
+    public static String createExtensionDirective(final String extensionName, final String behavior) {
+        return "#extension " + extensionName + " : " + behavior + "\n";
     }
 
     /**
@@ -874,7 +917,7 @@ public class ShaderCode {
      * @param gl a GL context, which must have been made current once
      * @return the index after the inserted data, maybe 0 if nothing has be inserted.
      */
-    public final int addGLSLVersion(GL2ES2 gl) {
+    public final int addGLSLVersion(final GL2ES2 gl) {
         return insertShaderSource(0, 0, gl.getContext().getGLSLVersionString());
     }
 
@@ -890,24 +933,24 @@ public class ShaderCode {
      * @param pos position within this mutable shader source.
      * @return the index after the inserted data, maybe 0 if nothing has be inserted.
      */
-    public final int addDefaultShaderPrecision(GL2ES2 gl, int pos) {
+    public final int addDefaultShaderPrecision(final GL2ES2 gl, int pos) {
         final String defaultPrecision;
-        if( gl.isGLES2() ) {
+        if( gl.isGLES3() ) {
             switch ( shaderType ) {
                 case GL2ES2.GL_VERTEX_SHADER:
-                    defaultPrecision = es2_default_precision_vp; break;
+                    defaultPrecision = es3_default_precision_vp; break;
                 case GL2ES2.GL_FRAGMENT_SHADER:
-                    defaultPrecision = es2_default_precision_fp; break;
+                    defaultPrecision = es3_default_precision_fp; break;
                 default:
                     defaultPrecision = null;
                     break;
             }
-        } else if( gl.isGLES3() ) {
+        } else if( gl.isGLES2() ) {
             switch ( shaderType ) {
                 case GL2ES2.GL_VERTEX_SHADER:
-                    defaultPrecision = es3_default_precision_vp; break;
+                    defaultPrecision = es2_default_precision_vp; break;
                 case GL2ES2.GL_FRAGMENT_SHADER:
-                    defaultPrecision = es3_default_precision_fp; break;
+                    defaultPrecision = es2_default_precision_fp; break;
                 default:
                     defaultPrecision = null;
                     break;
@@ -934,7 +977,7 @@ public class ShaderCode {
     }
 
     /** Returns true, if GLSL version requires default precision, i.e. ES2 or GLSL [1.30 .. 1.50[. */
-    public static final boolean requiresDefaultPrecision(GL2ES2 gl) {
+    public static final boolean requiresDefaultPrecision(final GL2ES2 gl) {
         if( gl.isGLES() ) {
             return true;
         }
@@ -942,7 +985,7 @@ public class ShaderCode {
     }
 
     /** Returns true, if GL3 GLSL version requires default precision, i.e. GLSL [1.30 .. 1.50[. */
-    public static final boolean requiresGL3DefaultPrecision(GL2ES2 gl) {
+    public static final boolean requiresGL3DefaultPrecision(final GL2ES2 gl) {
         if( gl.isGL3() ) {
             final VersionNumber glslVersion = gl.getContext().getGLSLVersionNumber();
             return glslVersion.compareTo(GLContext.Version130) >= 0 && glslVersion.compareTo(GLContext.Version150) < 0 ;
@@ -966,7 +1009,7 @@ public class ShaderCode {
      * @see #addGLSLVersion(GL2ES2)
      * @see #addDefaultShaderPrecision(GL2ES2, int)
      */
-    public final int defaultShaderCustomization(GL2ES2 gl, boolean preludeVersion, boolean addDefaultPrecision) {
+    public final int defaultShaderCustomization(final GL2ES2 gl, final boolean preludeVersion, final boolean addDefaultPrecision) {
         int pos;
         if( preludeVersion ) {
             pos = addGLSLVersion(gl);
@@ -992,7 +1035,7 @@ public class ShaderCode {
      * @see #addGLSLVersion(GL2ES2)
      * @see #addDefaultShaderPrecision(GL2ES2, int)
      */
-    public final int defaultShaderCustomization(GL2ES2 gl, boolean preludeVersion, String esDefaultPrecision) {
+    public final int defaultShaderCustomization(final GL2ES2 gl, final boolean preludeVersion, final String esDefaultPrecision) {
         int pos;
         if( preludeVersion ) {
             pos = addGLSLVersion(gl);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
index b289b41..a9b0bdd 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderProgram.java
@@ -56,7 +56,7 @@ public class ShaderProgram {
     /**
      * returns the uniq shader id as an integer
      */
-    public int        id() { return id; }
+    public int id() { return id; }
 
     /**
      * Detaches all shader codes and deletes the program.
@@ -65,7 +65,7 @@ public class ShaderProgram {
      *
      * @see #release(GL2ES2, boolean)
      */
-    public synchronized void destroy(GL2ES2 gl) {
+    public synchronized void destroy(final GL2ES2 gl) {
         release(gl, true);
     }
 
@@ -76,7 +76,7 @@ public class ShaderProgram {
      *
      * @see #release(GL2ES2, boolean)
      */
-    public synchronized void release(GL2ES2 gl) {
+    public synchronized void release(final GL2ES2 gl) {
         release(gl, false);
     }
 
@@ -84,12 +84,12 @@ public class ShaderProgram {
      * Detaches all shader codes and deletes the program.
      * If <code>destroyShaderCode</code> is true it destroys the shader codes as well.
      */
-    public synchronized void release(GL2ES2 gl, boolean destroyShaderCode) {
+    public synchronized void release(final GL2ES2 gl, final boolean destroyShaderCode) {
         if( programLinked ) {
             useProgram(gl, false);
         }
-        for(Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
-            ShaderCode shaderCode = iter.next();
+        for(final Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
+            final ShaderCode shaderCode = iter.next();
             if(attachedShaderCode.remove(shaderCode)) {
                 ShaderUtil.detachShader(gl, shaderProgram, shaderCode.shader());
             }
@@ -115,11 +115,11 @@ public class ShaderProgram {
      * <p>This command does not compile and attach the shader,
      * use {@link #add(GL2ES2, ShaderCode)} for this purpose.</p>
      */
-    public synchronized void add(ShaderCode shaderCode) throws GLException {
+    public synchronized void add(final ShaderCode shaderCode) throws GLException {
         allShaderCode.add(shaderCode);
     }
 
-    public synchronized boolean contains(ShaderCode shaderCode) {
+    public synchronized boolean contains(final ShaderCode shaderCode) {
         return allShaderCode.contains(shaderCode);
     }
 
@@ -128,9 +128,9 @@ public class ShaderProgram {
      * @param id
      * @return
      */
-    public synchronized ShaderCode getShader(int id) {
-        for(Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
-            ShaderCode shaderCode = iter.next();
+    public synchronized ShaderCode getShader(final int id) {
+        for(final Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
+            final ShaderCode shaderCode = iter.next();
             if(shaderCode.id() == id) {
                 return shaderCode;
             }
@@ -149,7 +149,7 @@ public class ShaderProgram {
      * @param gl
      * @return true if shader program is valid, i.e. not zero
      */
-    public synchronized final boolean init(GL2ES2 gl) {
+    public synchronized final boolean init(final GL2ES2 gl) {
         if( 0 == shaderProgram ) {
             shaderProgram = gl.glCreateProgram();
         }
@@ -163,7 +163,7 @@ public class ShaderProgram {
      *
      * @return true if the shader was successfully added, false if compilation failed.
      */
-    public synchronized boolean add(GL2ES2 gl, ShaderCode shaderCode, PrintStream verboseOut) {
+    public synchronized boolean add(final GL2ES2 gl, final ShaderCode shaderCode, final PrintStream verboseOut) {
         if( !init(gl) ) { return false; }
         if( allShaderCode.add(shaderCode) ) {
             if( !shaderCode.compile(gl, verboseOut) ) {
@@ -195,12 +195,12 @@ public class ShaderProgram {
      * @see ShaderState#glResetAllVertexAttributes
      * @see ShaderState#glResetAllVertexAttributes
      */
-    public synchronized boolean replaceShader(GL2ES2 gl, ShaderCode oldShader, ShaderCode newShader, PrintStream verboseOut) {
+    public synchronized boolean replaceShader(final GL2ES2 gl, final ShaderCode oldShader, final ShaderCode newShader, final PrintStream verboseOut) {
         if(!init(gl) || !newShader.compile(gl, verboseOut)) {
             return false;
         }
 
-        boolean shaderWasInUse = inUse();
+        final boolean shaderWasInUse = inUse();
         if(shaderWasInUse) {
             useProgram(gl, false);
         }
@@ -238,13 +238,13 @@ public class ShaderProgram {
      *
      * @see #init(GL2ES2)
      */
-    public synchronized boolean link(GL2ES2 gl, PrintStream verboseOut) {
+    public synchronized boolean link(final GL2ES2 gl, final PrintStream verboseOut) {
         if( !init(gl) ) {
             programLinked = false; // mark unlinked due to user attempt to [re]link
             return false;
         }
 
-        for(Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
+        for(final Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
             final ShaderCode shaderCode = iter.next();
             if(!shaderCode.compile(gl, verboseOut)) {
                 programLinked = false; // mark unlinked due to user attempt to [re]link
@@ -264,7 +264,7 @@ public class ShaderProgram {
     }
 
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if(this == obj)  { return true; }
         if(obj instanceof ShaderProgram) {
             return id()==((ShaderProgram)obj).id();
@@ -283,7 +283,7 @@ public class ShaderProgram {
         }
         sb.append("ShaderProgram[id=").append(id);
         sb.append(", linked="+programLinked+", inUse="+programInUse+", program: "+shaderProgram+",");
-        for(Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
+        for(final Iterator<ShaderCode> iter=allShaderCode.iterator(); iter.hasNext(); ) {
             sb.append(Platform.getNewline()).append("   ").append(iter.next());
         }
         sb.append("]");
@@ -299,11 +299,11 @@ public class ShaderProgram {
      * Performs {@link GL2ES2#glValidateProgram(int)} via {@link ShaderUtil#isProgramExecStatusValid(GL, int, PrintStream)}.
      * @see ShaderUtil#isProgramExecStatusValid(GL, int, PrintStream)
      **/
-    public synchronized boolean validateProgram(GL2ES2 gl, PrintStream verboseOut) {
+    public synchronized boolean validateProgram(final GL2ES2 gl, final PrintStream verboseOut) {
         return ShaderUtil.isProgramExecStatusValid(gl, shaderProgram, verboseOut);
     }
 
-    public synchronized void useProgram(GL2ES2 gl, boolean on) {
+    public synchronized void useProgram(final GL2ES2 gl, boolean on) {
         if(!programLinked) { throw new GLException("Program is not linked"); }
         if(programInUse==on) { return; }
         if( 0 == shaderProgram ) {
@@ -312,17 +312,20 @@ public class ShaderProgram {
         gl.glUseProgram( on ? shaderProgram : 0 );
         programInUse = on;
     }
+    public synchronized void notifyNotInUse() {
+        programInUse = false;
+    }
 
-    protected boolean programLinked = false;
-    protected boolean programInUse = false;
-    protected int shaderProgram = 0; // non zero is valid!
-    protected HashSet<ShaderCode> allShaderCode = new HashSet<ShaderCode>();
-    protected HashSet<ShaderCode> attachedShaderCode = new HashSet<ShaderCode>();
-    protected int id = -1;
+    private boolean programLinked = false;
+    private boolean programInUse = false;
+    private int shaderProgram = 0; // non zero is valid!
+    private final HashSet<ShaderCode> allShaderCode = new HashSet<ShaderCode>();
+    private final HashSet<ShaderCode> attachedShaderCode = new HashSet<ShaderCode>();
+    private final int id;
 
     private static synchronized int getNextID() {
         return nextID++;
     }
-    protected static int nextID = 1;
+    private static int nextID = 1;
 }
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java
index f60cb60..d758fc1 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderState.java
@@ -41,6 +41,7 @@ import javax.media.opengl.GLUniformData;
 import jogamp.opengl.Debug;
 
 import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.opengl.util.GLArrayDataEditable;
 
 /**
@@ -60,7 +61,7 @@ public class ShaderState {
 
     static {
         Debug.initSingleton();
-        DEBUG = Debug.isPropertyDefined("jogl.debug.GLSLState", true);
+        DEBUG = PropertyAccess.isPropertyDefined("jogl.debug.GLSLState", true);
     }
 
     public ShaderState() {
@@ -68,12 +69,12 @@ public class ShaderState {
 
     public boolean verbose() { return verbose; }
 
-    public void setVerbose(boolean v) { verbose = DEBUG || v; }
+    public void setVerbose(final boolean v) { verbose = DEBUG || v; }
 
     /**
      * Returns the attached user object for the given name to this ShaderState.
      */
-    public final Object getAttachedObject(String name) {
+    public final Object getAttachedObject(final String name) {
       return attachedObjectsByString.get(name);
     }
 
@@ -83,7 +84,7 @@ public class ShaderState {
      *
      * @return the previous mapped object or null if none
      */
-    public final Object attachObject(String name, Object obj) {
+    public final Object attachObject(final String name, final Object obj) {
       return attachedObjectsByString.put(name, obj);
     }
 
@@ -92,7 +93,7 @@ public class ShaderState {
      *
      * @return the previous mapped object or null if none
      */
-    public final Object detachObject(String name) {
+    public final Object detachObject(final String name) {
         return attachedObjectsByString.remove(name);
     }
 
@@ -103,7 +104,7 @@ public class ShaderState {
      *
      * @see com.jogamp.opengl.util.glsl.ShaderState#useProgram(GL2ES2, boolean)
      */
-    public synchronized void useProgram(GL2ES2 gl, boolean on) throws GLException {
+    public synchronized void useProgram(final GL2ES2 gl, final boolean on) throws GLException {
         if(null==shaderProgram) { throw new GLException("No program is attached"); }
         if(on) {
             if(shaderProgram.linked()) {
@@ -154,10 +155,10 @@ public class ShaderState {
      *
      * @throws GLException if program was not linked and linking fails
      */
-    public synchronized boolean attachShaderProgram(GL2ES2 gl, ShaderProgram prog, boolean enable) throws GLException {
+    public synchronized boolean attachShaderProgram(final GL2ES2 gl, final ShaderProgram prog, final boolean enable) throws GLException {
         if(verbose) {
-            int curId = (null!=shaderProgram)?shaderProgram.id():-1;
-            int newId = (null!=prog)?prog.id():-1;
+            final int curId = (null!=shaderProgram)?shaderProgram.id():-1;
+            final int newId = (null!=prog)?prog.id():-1;
             System.err.println("ShaderState: attachShaderProgram: "+curId+" -> "+newId+" (enable: "+enable+")\n\t"+shaderProgram+"\n\t"+prog);
             if(DEBUG) {
                 Thread.dumpStack();
@@ -176,8 +177,7 @@ public class ShaderState {
             }
             if(shaderProgram.inUse()) {
                 if(null != prog && enable) {
-                    // new program will issue glUseProgram(..)
-                    shaderProgram.programInUse = false;
+                    shaderProgram.notifyNotInUse();
                 } else {
                     // no new 'enabled' program - disable
                     useProgram(gl, false);
@@ -214,7 +214,7 @@ public class ShaderState {
      * @see #glReleaseAllUniforms
      * @see #release(GL2ES2, boolean, boolean, boolean)
      */
-    public synchronized void destroy(GL2ES2 gl) {
+    public synchronized void destroy(final GL2ES2 gl) {
         release(gl, true, true, true);
         attachedObjectsByString.clear();
     }
@@ -226,7 +226,7 @@ public class ShaderState {
      * @see #glReleaseAllUniforms
      * @see #release(GL2ES2, boolean, boolean, boolean)
      */
-    public synchronized void releaseAllData(GL2ES2 gl) {
+    public synchronized void releaseAllData(final GL2ES2 gl) {
         release(gl, false, false, false);
     }
 
@@ -235,12 +235,12 @@ public class ShaderState {
      * @see #glReleaseAllUniforms
      * @see ShaderProgram#release(GL2ES2, boolean)
      */
-    public synchronized void release(GL2ES2 gl, boolean destroyBoundAttributes, boolean destroyShaderProgram, boolean destroyShaderCode) {
+    public synchronized void release(final GL2ES2 gl, final boolean destroyBoundAttributes, final boolean destroyShaderProgram, final boolean destroyShaderCode) {
         if(null!=shaderProgram && shaderProgram.linked() ) {
             shaderProgram.useProgram(gl, false);
         }
         if(destroyBoundAttributes) {
-            for(Iterator<GLArrayData> iter = managedAttributes.iterator(); iter.hasNext(); ) {
+            for(final Iterator<GLArrayData> iter = managedAttributes.iterator(); iter.hasNext(); ) {
                 iter.next().destroy(gl);
             }
         }
@@ -266,8 +266,8 @@ public class ShaderState {
      * @see #getAttribLocation(GL2ES2, String)
      * @see GL2ES2#glGetAttribLocation(int, String)
      */
-    public int getCachedAttribLocation(String name) {
-        Integer idx = activeAttribLocationMap.get(name);
+    public int getCachedAttribLocation(final String name) {
+        final Integer idx = activeAttribLocationMap.get(name);
         return (null!=idx)?idx.intValue():-1;
     }
 
@@ -286,11 +286,11 @@ public class ShaderState {
      * @see #glResetAllVertexAttributes
      * @see ShaderProgram#glReplaceShader
      */
-    public GLArrayData getAttribute(String name) {
+    public GLArrayData getAttribute(final String name) {
         return activeAttribDataMap.get(name);
     }
 
-    public boolean isActiveAttribute(GLArrayData attribute) {
+    public boolean isActiveAttribute(final GLArrayData attribute) {
         return attribute == activeAttribDataMap.get(attribute.getName());
     }
 
@@ -314,7 +314,7 @@ public class ShaderState {
      * @see #getAttribute(String)
      * @see GLArrayData#associate(Object, boolean)
      */
-    public void ownAttribute(GLArrayData attribute, boolean own) {
+    public void ownAttribute(final GLArrayData attribute, final boolean own) {
         if(own) {
             final int location = getCachedAttribLocation(attribute.getName());
             if(0<=location) {
@@ -327,7 +327,7 @@ public class ShaderState {
         attribute.associate(this, own);
     }
 
-    public boolean ownsAttribute(GLArrayData attribute) {
+    public boolean ownsAttribute(final GLArrayData attribute) {
         return managedAttributes.contains(attribute);
     }
 
@@ -344,11 +344,10 @@ public class ShaderState {
      * @see #getAttribLocation(GL2ES2, String)
      * @see #getCachedAttribLocation(String)
      */
-    public void bindAttribLocation(GL2ES2 gl, int location, String name) {
+    public void bindAttribLocation(final GL2ES2 gl, final int location, final String name) {
         if(null==shaderProgram) throw new GLException("No program is attached");
         if(shaderProgram.linked()) throw new GLException("Program is already linked");
-        final Integer loc = new Integer(location);
-        activeAttribLocationMap.put(name, loc);
+        activeAttribLocationMap.put(name, Integer.valueOf(location));
         gl.glBindAttribLocation(shaderProgram.program(), location, name);
     }
 
@@ -367,11 +366,11 @@ public class ShaderState {
      * @see #getCachedAttribLocation(String)
      * @see #getAttribute(String)
      */
-    public void bindAttribLocation(GL2ES2 gl, int location, GLArrayData data) {
+    public void bindAttribLocation(final GL2ES2 gl, final int location, final GLArrayData data) {
         if(null==shaderProgram) throw new GLException("No program is attached");
         if(shaderProgram.linked()) throw new GLException("Program is already linked");
         final String name = data.getName();
-        activeAttribLocationMap.put(name, new Integer(location));
+        activeAttribLocationMap.put(name, Integer.valueOf(location));
         data.setLocation(gl, shaderProgram.program(), location);
         activeAttribDataMap.put(data.getName(), data);
     }
@@ -392,14 +391,14 @@ public class ShaderState {
      * @see #bindAttribLocation(GL2ES2, int, String)
      * @see GL2ES2#glGetAttribLocation(int, String)
      */
-    public int getAttribLocation(GL2ES2 gl, String name) {
+    public int getAttribLocation(final GL2ES2 gl, final String name) {
         if(null==shaderProgram) throw new GLException("No program is attached");
         int location = getCachedAttribLocation(name);
         if(0>location) {
             if(!shaderProgram.linked()) throw new GLException("Program is not linked");
             location = gl.glGetAttribLocation(shaderProgram.program(), name);
             if(0<=location) {
-                activeAttribLocationMap.put(name, new Integer(location));
+                activeAttribLocationMap.put(name, Integer.valueOf(location));
                 if(DEBUG) {
                     System.err.println("ShaderState: glGetAttribLocation: "+name+", loc: "+location);
                 }
@@ -432,7 +431,7 @@ public class ShaderState {
      * @see GL2ES2#glGetAttribLocation(int, String)
      * @see #getAttribute(String)
      */
-    public int getAttribLocation(GL2ES2 gl, GLArrayData data) {
+    public int getAttribLocation(final GL2ES2 gl, final GLArrayData data) {
         if(null==shaderProgram) throw new GLException("No program is attached");
         final String name = data.getName();
         int location = getCachedAttribLocation(name);
@@ -442,8 +441,7 @@ public class ShaderState {
             if(!shaderProgram.linked()) throw new GLException("Program is not linked");
             location = data.setLocation(gl, shaderProgram.program());
             if(0<=location) {
-                Integer idx = new Integer(location);
-                activeAttribLocationMap.put(name, idx);
+                activeAttribLocationMap.put(name, Integer.valueOf(location));
                 if(DEBUG) {
                     System.err.println("ShaderState: glGetAttribLocation: "+name+", loc: "+location);
                 }
@@ -465,7 +463,7 @@ public class ShaderState {
     /**
      * @return true if the named attribute is enable
      */
-    public final boolean isVertexAttribArrayEnabled(String name) {
+    public final boolean isVertexAttribArrayEnabled(final String name) {
         final Boolean v = activedAttribEnabledMap.get(name);
         return null != v && v.booleanValue();
     }
@@ -473,11 +471,11 @@ public class ShaderState {
     /**
      * @return true if the {@link GLArrayData} attribute is enable
      */
-    public final boolean isVertexAttribArrayEnabled(GLArrayData data) {
+    public final boolean isVertexAttribArrayEnabled(final GLArrayData data) {
         return isVertexAttribArrayEnabled(data.getName());
     }
 
-    private boolean enableVertexAttribArray(GL2ES2 gl, String name, int location) {
+    private boolean enableVertexAttribArray(final GL2ES2 gl, final String name, int location) {
         activedAttribEnabledMap.put(name, Boolean.TRUE);
         if(0>location) {
             location = getAttribLocation(gl, name);
@@ -516,7 +514,7 @@ public class ShaderState {
      * @see #glVertexAttribPointer
      * @see #getVertexAttribPointer
      */
-    public boolean enableVertexAttribArray(GL2ES2 gl, String name) {
+    public boolean enableVertexAttribArray(final GL2ES2 gl, final String name) {
         return enableVertexAttribArray(gl, name, -1);
     }
 
@@ -542,7 +540,7 @@ public class ShaderState {
      * @see #getVertexAttribPointer
      * @see GLArrayDataEditable#enableBuffer(GL, boolean)
      */
-    public boolean enableVertexAttribArray(GL2ES2 gl, GLArrayData data) {
+    public boolean enableVertexAttribArray(final GL2ES2 gl, final GLArrayData data) {
         if(0 > data.getLocation()) {
             getAttribLocation(gl, data);
         } else {
@@ -552,7 +550,7 @@ public class ShaderState {
         return enableVertexAttribArray(gl, data.getName(), data.getLocation());
     }
 
-    private boolean disableVertexAttribArray(GL2ES2 gl, String name, int location) {
+    private boolean disableVertexAttribArray(final GL2ES2 gl, final String name, int location) {
         activedAttribEnabledMap.put(name, Boolean.FALSE);
         if(0>location) {
             location = getAttribLocation(gl, name);
@@ -592,7 +590,7 @@ public class ShaderState {
      * @see #glVertexAttribPointer
      * @see #getVertexAttribPointer
      */
-    public boolean disableVertexAttribArray(GL2ES2 gl, String name) {
+    public boolean disableVertexAttribArray(final GL2ES2 gl, final String name) {
         return disableVertexAttribArray(gl, name, -1);
     }
 
@@ -617,7 +615,7 @@ public class ShaderState {
      * @see #glVertexAttribPointer
      * @see #getVertexAttribPointer
      */
-    public boolean disableVertexAttribArray(GL2ES2 gl, GLArrayData data) {
+    public boolean disableVertexAttribArray(final GL2ES2 gl, final GLArrayData data) {
         if(0 > data.getLocation()) {
             getAttribLocation(gl, data);
         }
@@ -642,7 +640,7 @@ public class ShaderState {
      * @see #glVertexAttribPointer
      * @see #getVertexAttribPointer
      */
-    public boolean vertexAttribPointer(GL2ES2 gl, GLArrayData data) {
+    public boolean vertexAttribPointer(final GL2ES2 gl, final GLArrayData data) {
         int location = data.getLocation();
         if(0 > location) {
             location = getAttribLocation(gl, data);
@@ -671,12 +669,12 @@ public class ShaderState {
      * @see #glResetAllVertexAttributes
      * @see ShaderProgram#glReplaceShader
      */
-    public void releaseAllAttributes(GL2ES2 gl) {
+    public void releaseAllAttributes(final GL2ES2 gl) {
         if(null!=shaderProgram) {
-            for(Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
+            for(final Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
                 disableVertexAttribArray(gl, iter.next());
             }
-            for(Iterator<String> iter = activedAttribEnabledMap.keySet().iterator(); iter.hasNext(); ) {
+            for(final Iterator<String> iter = activedAttribEnabledMap.keySet().iterator(); iter.hasNext(); ) {
                 disableVertexAttribArray(gl, iter.next());
             }
         }
@@ -703,8 +701,8 @@ public class ShaderState {
      * @see #glResetAllVertexAttributes
      * @see ShaderProgram#glReplaceShader
      */
-    public void disableAllVertexAttributeArrays(GL2ES2 gl, boolean removeFromState) {
-        for(Iterator<String> iter = activedAttribEnabledMap.keySet().iterator(); iter.hasNext(); ) {
+    public void disableAllVertexAttributeArrays(final GL2ES2 gl, final boolean removeFromState) {
+        for(final Iterator<String> iter = activedAttribEnabledMap.keySet().iterator(); iter.hasNext(); ) {
             final String name = iter.next();
             if(removeFromState) {
                 activedAttribEnabledMap.remove(name);
@@ -716,12 +714,12 @@ public class ShaderState {
         }
     }
 
-    private final void relocateAttribute(GL2ES2 gl, GLArrayData attribute) {
+    private final void relocateAttribute(final GL2ES2 gl, final GLArrayData attribute) {
         // get new location .. note: 'activeAttribLocationMap' is cleared before
         final String name = attribute.getName();
         final int loc = attribute.setLocation(gl, shaderProgram.program());
         if(0<=loc) {
-            activeAttribLocationMap.put(name, new Integer(loc));
+            activeAttribLocationMap.put(name, Integer.valueOf(loc));
             if(DEBUG) {
                 System.err.println("ShaderState: relocateAttribute: "+name+", loc: "+loc);
             }
@@ -761,19 +759,19 @@ public class ShaderState {
      *
      * @see #attachShaderProgram(GL2ES2, ShaderProgram)
      */
-    private final void resetAllAttributes(GL2ES2 gl) {
+    private final void resetAllAttributes(final GL2ES2 gl) {
         if(!shaderProgram.linked()) throw new GLException("Program is not linked");
         activeAttribLocationMap.clear();
 
         for(int i=0; i<managedAttributes.size(); i++) {
-            ((GLArrayData)managedAttributes.get(i)).setLocation(-1);
+            managedAttributes.get(i).setLocation(-1);
         }
-        for(Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
+        for(final Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
             relocateAttribute(gl, iter.next());
         }
     }
 
-    private final void setAttribute(GL2ES2 gl, GLArrayData attribute) {
+    private final void setAttribute(final GL2ES2 gl, final GLArrayData attribute) {
         // get new location ..
         final String name = attribute.getName();
         final int loc = attribute.getLocation();
@@ -799,8 +797,8 @@ public class ShaderState {
     /**
      * preserves the attribute location .. (program not linked)
      */
-    private final void setAllAttributes(GL2ES2 gl) {
-        for(Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
+    private final void setAllAttributes(final GL2ES2 gl) {
+        for(final Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
             setAttribute(gl, iter.next());
         }
     }
@@ -815,8 +813,8 @@ public class ShaderState {
      * @return -1 if there is no such uniform available,
      *         otherwise >= 0
      */
-    public final int getCachedUniformLocation(String name) {
-        Integer idx = (Integer) activeUniformLocationMap.get(name);
+    public final int getCachedUniformLocation(final String name) {
+        final Integer idx = activeUniformLocationMap.get(name);
         return (null!=idx)?idx.intValue():-1;
     }
 
@@ -834,7 +832,7 @@ public class ShaderState {
      *
      * @see #getUniform(String)
      */
-    public void ownUniform(GLUniformData uniform) {
+    public void ownUniform(final GLUniformData uniform) {
         final int location = getCachedUniformLocation(uniform.getName());
         if(0<=location) {
             uniform.setLocation(location);
@@ -843,7 +841,7 @@ public class ShaderState {
         managedUniforms.add(uniform);
     }
 
-    public boolean ownsUniform(GLUniformData uniform) {
+    public boolean ownsUniform(final GLUniformData uniform) {
         return managedUniforms.contains(uniform);
     }
 
@@ -866,15 +864,14 @@ public class ShaderState {
      * @see #getUniformLocation
      * @see ShaderProgram#glReplaceShader
      */
-    public final int getUniformLocation(GL2ES2 gl, String name) {
+    public final int getUniformLocation(final GL2ES2 gl, final String name) {
         if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
         int location = getCachedUniformLocation(name);
         if(0>location) {
             if(!shaderProgram.linked()) throw new GLException("Program is not linked");
             location = gl.glGetUniformLocation(shaderProgram.program(), name);
             if(0<=location) {
-                Integer idx = new Integer(location);
-                activeUniformLocationMap.put(name, idx);
+                activeUniformLocationMap.put(name, Integer.valueOf(location));
             } else if(verbose) {
                 System.err.println("ShaderState: glUniform failed, no location for: "+name+", index: "+location);
                 if(DEBUG) {
@@ -905,7 +902,7 @@ public class ShaderState {
      * @see #getUniformLocation
      * @see ShaderProgram#glReplaceShader
      */
-    public int getUniformLocation(GL2ES2 gl, GLUniformData data) {
+    public int getUniformLocation(final GL2ES2 gl, final GLUniformData data) {
         if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
         final String name = data.getName();
         int location = getCachedUniformLocation(name);
@@ -915,7 +912,7 @@ public class ShaderState {
             if(!shaderProgram.linked()) throw new GLException("Program is not linked");
             location = data.setLocation(gl, shaderProgram.program());
             if(0<=location) {
-                activeUniformLocationMap.put(name, new Integer(location));
+                activeUniformLocationMap.put(name, Integer.valueOf(location));
             } else if(verbose) {
                 System.err.println("ShaderState: glUniform failed, no location for: "+name+", index: "+location);
                 if(DEBUG) {
@@ -943,7 +940,7 @@ public class ShaderState {
      * @see #getUniformLocation
      * @see ShaderProgram#glReplaceShader
      */
-    public boolean uniform(GL2ES2 gl, GLUniformData data) {
+    public boolean uniform(final GL2ES2 gl, final GLUniformData data) {
         if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
         int location = data.getLocation();
         if(0>location) {
@@ -965,7 +962,7 @@ public class ShaderState {
      *
      * @return the GLUniformData object, null if not previously set.
      */
-    public GLUniformData getUniform(String name) {
+    public GLUniformData getUniform(final String name) {
         return activeUniformDataMap.get(name);
     }
 
@@ -973,7 +970,7 @@ public class ShaderState {
      * Releases all mapped uniform data
      * and loses all indices
      */
-    public void releaseAllUniforms(GL2ES2 gl) {
+    public void releaseAllUniforms(final GL2ES2 gl) {
         activeUniformDataMap.clear();
         activeUniformLocationMap.clear();
         managedUniforms.clear();
@@ -994,18 +991,18 @@ public class ShaderState {
      *
      * @see #attachShaderProgram(GL2ES2, ShaderProgram)
      */
-    private final void resetAllUniforms(GL2ES2 gl) {
+    private final void resetAllUniforms(final GL2ES2 gl) {
         if(!shaderProgram.inUse()) throw new GLException("Program is not in use");
         activeUniformLocationMap.clear();
-        for(Iterator<GLUniformData> iter = managedUniforms.iterator(); iter.hasNext(); ) {
+        for(final Iterator<GLUniformData> iter = managedUniforms.iterator(); iter.hasNext(); ) {
             iter.next().setLocation(-1);
         }
-        for(Iterator<GLUniformData> iter = activeUniformDataMap.values().iterator(); iter.hasNext(); ) {
+        for(final Iterator<GLUniformData> iter = activeUniformDataMap.values().iterator(); iter.hasNext(); ) {
             final GLUniformData data = iter.next();
             final int loc = data.setLocation(gl, shaderProgram.program());
             if( 0 <= loc ) {
                 // only pass the data, if the uniform exists in the current shader
-                activeUniformLocationMap.put(data.getName(), new Integer(loc));
+                activeUniformLocationMap.put(data.getName(), Integer.valueOf(loc));
                 if(DEBUG) {
                     System.err.println("ShaderState: resetAllUniforms: "+data);
                 }
@@ -1014,7 +1011,7 @@ public class ShaderState {
         }
     }
 
-    public StringBuilder toString(StringBuilder sb, boolean alsoUnlocated) {
+    public StringBuilder toString(StringBuilder sb, final boolean alsoUnlocated) {
         if(null==sb) {
             sb = new StringBuilder();
         }
@@ -1029,35 +1026,35 @@ public class ShaderState {
         }
         sb.append(Platform.getNewline()).append(" enabledAttributes [");
         {
-            Iterator<String> names = activedAttribEnabledMap.keySet().iterator();
-            Iterator<Boolean> values = activedAttribEnabledMap.values().iterator();
+            final Iterator<String> names = activedAttribEnabledMap.keySet().iterator();
+            final Iterator<Boolean> values = activedAttribEnabledMap.values().iterator();
             while( names.hasNext() ) {
                 sb.append(Platform.getNewline()).append("  ").append(names.next()).append(": ").append(values.next());
             }
         }
         sb.append(Platform.getNewline()).append(" ],").append(" activeAttributes [");
-        for(Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
+        for(final Iterator<GLArrayData> iter = activeAttribDataMap.values().iterator(); iter.hasNext(); ) {
             final GLArrayData ad = iter.next();
             if( alsoUnlocated || 0 <= ad.getLocation() ) {
                 sb.append(Platform.getNewline()).append("  ").append(ad);
             }
         }
         sb.append(Platform.getNewline()).append(" ],").append(" managedAttributes [");
-        for(Iterator<GLArrayData> iter = managedAttributes.iterator(); iter.hasNext(); ) {
+        for(final Iterator<GLArrayData> iter = managedAttributes.iterator(); iter.hasNext(); ) {
             final GLArrayData ad = iter.next();
             if( alsoUnlocated || 0 <= ad.getLocation() ) {
                 sb.append(Platform.getNewline()).append("  ").append(ad);
             }
         }
         sb.append(Platform.getNewline()).append(" ],").append(" activeUniforms [");
-        for(Iterator<GLUniformData> iter=activeUniformDataMap.values().iterator(); iter.hasNext(); ) {
+        for(final Iterator<GLUniformData> iter=activeUniformDataMap.values().iterator(); iter.hasNext(); ) {
             final GLUniformData ud = iter.next();
             if( alsoUnlocated || 0 <= ud.getLocation() ) {
                 sb.append(Platform.getNewline()).append("  ").append(ud);
             }
         }
         sb.append(Platform.getNewline()).append(" ],").append(" managedUniforms [");
-        for(Iterator<GLUniformData> iter = managedUniforms.iterator(); iter.hasNext(); ) {
+        for(final Iterator<GLUniformData> iter = managedUniforms.iterator(); iter.hasNext(); ) {
             final GLUniformData ud = iter.next();
             if( alsoUnlocated || 0 <= ud.getLocation() ) {
                 sb.append(Platform.getNewline()).append("  ").append(ud);
@@ -1075,16 +1072,16 @@ public class ShaderState {
     private boolean verbose = DEBUG;
     private ShaderProgram shaderProgram=null;
 
-    private HashMap<String, Boolean> activedAttribEnabledMap = new HashMap<String, Boolean>();
-    private HashMap<String, Integer> activeAttribLocationMap = new HashMap<String, Integer>();
-    private HashMap<String, GLArrayData> activeAttribDataMap = new HashMap<String, GLArrayData>();
-    private ArrayList<GLArrayData> managedAttributes = new ArrayList<GLArrayData>();
+    private final HashMap<String, Boolean> activedAttribEnabledMap = new HashMap<String, Boolean>();
+    private final HashMap<String, Integer> activeAttribLocationMap = new HashMap<String, Integer>();
+    private final HashMap<String, GLArrayData> activeAttribDataMap = new HashMap<String, GLArrayData>();
+    private final ArrayList<GLArrayData> managedAttributes = new ArrayList<GLArrayData>();
 
-    private HashMap<String, Integer> activeUniformLocationMap = new HashMap<String, Integer>();
-    private HashMap<String, GLUniformData> activeUniformDataMap = new HashMap<String, GLUniformData>();
-    private ArrayList<GLUniformData> managedUniforms = new ArrayList<GLUniformData>();
+    private final HashMap<String, Integer> activeUniformLocationMap = new HashMap<String, Integer>();
+    private final HashMap<String, GLUniformData> activeUniformDataMap = new HashMap<String, GLUniformData>();
+    private final ArrayList<GLUniformData> managedUniforms = new ArrayList<GLUniformData>();
 
-    private HashMap<String, Object> attachedObjectsByString = new HashMap<String, Object>();
+    private final HashMap<String, Object> attachedObjectsByString = new HashMap<String, Object>();
     private boolean resetAllShaderData = false;
 }
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
index 5cd384c..06f7d92 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/ShaderUtil.java
@@ -43,49 +43,49 @@ import com.jogamp.common.nio.Buffers;
 import com.jogamp.opengl.GLExtensions;
 
 public class ShaderUtil {
-    public static String getShaderInfoLog(GL _gl, int shaderObj) {
+    public static String getShaderInfoLog(final GL _gl, final int shaderObj) {
         final GL2ES2 gl = _gl.getGL2ES2();
-        int[] infoLogLength=new int[1];
+        final int[] infoLogLength=new int[1];
         gl.glGetShaderiv(shaderObj, GL2ES2.GL_INFO_LOG_LENGTH, infoLogLength, 0);
 
         if(infoLogLength[0]==0) {
             return "(no info log)";
         }
-        int[] charsWritten=new int[1];
-        byte[] infoLogBytes = new byte[infoLogLength[0]];
+        final int[] charsWritten=new int[1];
+        final byte[] infoLogBytes = new byte[infoLogLength[0]];
         gl.glGetShaderInfoLog(shaderObj, infoLogLength[0], charsWritten, 0, infoLogBytes, 0);
 
         return new String(infoLogBytes, 0, charsWritten[0]);
     }
 
-    public static String getProgramInfoLog(GL _gl, int programObj) {
+    public static String getProgramInfoLog(final GL _gl, final int programObj) {
         final GL2ES2 gl = _gl.getGL2ES2();
-        int[] infoLogLength=new int[1];
+        final int[] infoLogLength=new int[1];
         gl.glGetProgramiv(programObj, GL2ES2.GL_INFO_LOG_LENGTH, infoLogLength, 0);
 
         if(infoLogLength[0]==0) {
             return "(no info log)";
         }
-        int[] charsWritten=new int[1];
-        byte[] infoLogBytes = new byte[infoLogLength[0]];
+        final int[] charsWritten=new int[1];
+        final byte[] infoLogBytes = new byte[infoLogLength[0]];
         gl.glGetProgramInfoLog(programObj, infoLogLength[0], charsWritten, 0, infoLogBytes, 0);
 
         return new String(infoLogBytes, 0, charsWritten[0]);
     }
 
-    public static boolean isShaderStatusValid(GL _gl, int shaderObj, int name, PrintStream verboseOut) {
+    public static boolean isShaderStatusValid(final GL _gl, final int shaderObj, final int name, final PrintStream verboseOut) {
         final GL2ES2 gl = _gl.getGL2ES2();
-        int[] ires = new int[1];
+        final int[] ires = new int[1];
         gl.glGetShaderiv(shaderObj, name, ires, 0);
 
-        boolean res = ires[0]==1;
+        final boolean res = ires[0]==1;
         if(!res && null!=verboseOut) {
             verboseOut.println("Shader status invalid: "+ getShaderInfoLog(gl, shaderObj));
         }
         return res;
     }
 
-    public static boolean isShaderStatusValid(GL _gl, IntBuffer shaders, int name, PrintStream verboseOut) {
+    public static boolean isShaderStatusValid(final GL _gl, final IntBuffer shaders, final int name, final PrintStream verboseOut) {
         boolean res = true;
         for (int i = shaders.position(); i < shaders.limit(); i++) {
             res = isShaderStatusValid(_gl, shaders.get(i), name, verboseOut) && res;
@@ -93,15 +93,15 @@ public class ShaderUtil {
         return res;
     }
 
-    public static boolean isProgramStatusValid(GL _gl, int programObj, int name) {
+    public static boolean isProgramStatusValid(final GL _gl, final int programObj, final int name) {
         final GL2ES2 gl = _gl.getGL2ES2();
-        int[] ires = new int[1];
+        final int[] ires = new int[1];
         gl.glGetProgramiv(programObj, name, ires, 0);
 
         return ires[0]==1;
     }
 
-    public static boolean isProgramLinkStatusValid(GL _gl, int programObj, PrintStream verboseOut) {
+    public static boolean isProgramLinkStatusValid(final GL _gl, final int programObj, final PrintStream verboseOut) {
         final GL2ES2 gl = _gl.getGL2ES2();
         if(!gl.glIsProgram(programObj)) {
             if(null!=verboseOut) {
@@ -130,7 +130,7 @@ public class ShaderUtil {
      * </p>
      * @see GL2ES2#glValidateProgram(int)
      **/
-    public static boolean isProgramExecStatusValid(GL _gl, int programObj, PrintStream verboseOut) {
+    public static boolean isProgramExecStatusValid(final GL _gl, final int programObj, final PrintStream verboseOut) {
         final GL2ES2 gl = _gl.getGL2ES2();
         gl.glValidateProgram(programObj);
         if(!isProgramStatusValid(gl, programObj, GL2ES2.GL_VALIDATE_STATUS)) {
@@ -142,7 +142,7 @@ public class ShaderUtil {
         return true;
     }
 
-    public static void createShader(GL _gl, int type, IntBuffer shaders) {
+    public static void createShader(final GL _gl, final int type, final IntBuffer shaders) {
         final GL2ES2 gl = _gl.getGL2ES2();
         for (int i = shaders.position(); i < shaders.limit(); i++) {
             shaders.put(i, gl.glCreateShader(type));
@@ -154,7 +154,7 @@ public class ShaderUtil {
      * {@link GL2ES2#GL_NUM_SHADER_BINARY_FORMATS} and {@link GL2ES2#GL_SHADER_BINARY_FORMATS}
      * via {@link GL2ES2#glGetIntegerv(int, int[], int)}.
      */
-    public static Set<Integer> getShaderBinaryFormats(GL _gl) {
+    public static Set<Integer> getShaderBinaryFormats(final GL _gl) {
         final GL2ES2 gl = _gl.getGL2ES2();
         final ProfileInformation info = getProfileInformation(gl);
         if(null == info.shaderBinaryFormats) {
@@ -166,14 +166,14 @@ public class ShaderUtil {
                     final int err = gl.glGetError();
                     final int numFormats = GL.GL_NO_ERROR == err ? param[0] : 0;
                     if(numFormats>0) {
-                        int[] formats = new int[numFormats];
+                        final int[] formats = new int[numFormats];
                         gl.glGetIntegerv(GL2ES2.GL_SHADER_BINARY_FORMATS, formats, 0);
                         for(int i=0; i<numFormats; i++) {
-                            info.shaderBinaryFormats.add(new Integer(formats[i]));
+                            info.shaderBinaryFormats.add(Integer.valueOf(formats[i]));
                         }
                     }
-                } catch (GLException gle) {
-                    System.err.println("Catched Exception on thread "+Thread.currentThread().getName());
+                } catch (final GLException gle) {
+                    System.err.println("Caught exception on thread "+Thread.currentThread().getName());
                     gle.printStackTrace();
                 }
             }
@@ -182,7 +182,7 @@ public class ShaderUtil {
     }
 
     /** Returns true if a hader compiler is available, otherwise false. */
-    public static boolean isShaderCompilerAvailable(GL _gl) {
+    public static boolean isShaderCompilerAvailable(final GL _gl) {
         final GL2ES2 gl = _gl.getGL2ES2();
         final ProfileInformation info = getProfileInformation(gl);
         if(null==info.shaderCompilerAvailable) {
@@ -200,14 +200,14 @@ public class ShaderUtil {
                             v = true;
                         }
                     }
-                    info.shaderCompilerAvailable = new Boolean(v);
+                    info.shaderCompilerAvailable = Boolean.valueOf(v);
                     queryOK = true;
-                } catch (GLException gle) {
-                    System.err.println("Catched Exception on thread "+Thread.currentThread().getName());
+                } catch (final GLException gle) {
+                    System.err.println("Caught exception on thread "+Thread.currentThread().getName());
                     gle.printStackTrace();
                 }
                 if(!queryOK) {
-                    info.shaderCompilerAvailable = new Boolean(true);
+                    info.shaderCompilerAvailable = Boolean.valueOf(true);
                 }
             } else if( gl.isGL2ES2() ) {
                 info.shaderCompilerAvailable = new Boolean(true);
@@ -219,25 +219,25 @@ public class ShaderUtil {
     }
 
     /** Returns true if GeometryShader is supported, i.e. whether GLContext is ≥ 3.2 or ARB_geometry_shader4 extension is available. */
-    public static boolean isGeometryShaderSupported(GL _gl) {
+    public static boolean isGeometryShaderSupported(final GL _gl) {
       final GLContext ctx = _gl.getContext();
       return ctx.getGLVersionNumber().compareTo(GLContext.Version320) >= 0 ||
              ctx.isExtensionAvailable(GLExtensions.ARB_geometry_shader4);
     }
 
-    public static void shaderSource(GL _gl, int shader, CharSequence[] source)
+    public static void shaderSource(final GL _gl, final int shader, final CharSequence[] source)
     {
         final GL2ES2 gl = _gl.getGL2ES2();
         if(!isShaderCompilerAvailable(_gl)) {
             throw new GLException("No compiler is available");
         }
 
-        int count = (null!=source)?source.length:0;
+        final int count = (null!=source)?source.length:0;
         if(count==0) {
             throw new GLException("No sources specified");
         }
 
-        IntBuffer lengths = Buffers.newDirectIntBuffer(count);
+        final IntBuffer lengths = Buffers.newDirectIntBuffer(count);
         for(int i=0; i<count; i++) {
             lengths.put(i, source[i].length());
         }
@@ -260,10 +260,10 @@ public class ShaderUtil {
         }
     }
 
-    public static void shaderSource(GL _gl, IntBuffer shaders, CharSequence[][] sources)
+    public static void shaderSource(final GL _gl, final IntBuffer shaders, final CharSequence[][] sources)
     {
-        int sourceNum = (null!=sources)?sources.length:0;
-        int shaderNum = (null!=shaders)?shaders.remaining():0;
+        final int sourceNum = (null!=sources)?sources.length:0;
+        final int shaderNum = (null!=shaders)?shaders.remaining():0;
         if(shaderNum<=0 || sourceNum<=0 || shaderNum!=sourceNum) {
             throw new GLException("Invalid number of shaders and/or sources: shaders="+
                                   shaderNum+", sources="+sourceNum);
@@ -273,28 +273,28 @@ public class ShaderUtil {
         }
     }
 
-    public static void shaderBinary(GL _gl, IntBuffer shaders, int binFormat, java.nio.Buffer bin)
+    public static void shaderBinary(final GL _gl, final IntBuffer shaders, final int binFormat, final java.nio.Buffer bin)
     {
         final GL2ES2 gl = _gl.getGL2ES2();
         if(getShaderBinaryFormats(gl).size()<=0) {
             throw new GLException("No binary formats are supported");
         }
 
-        int shaderNum = shaders.remaining();
+        final int shaderNum = shaders.remaining();
         if(shaderNum<=0) {
             throw new GLException("No shaders specified");
         }
         if(null==bin) {
             throw new GLException("Null shader binary");
         }
-        int binLength = bin.remaining();
+        final int binLength = bin.remaining();
         if(0>=binLength) {
             throw new GLException("Empty shader binary (remaining == 0)");
         }
         gl.glShaderBinary(shaderNum, shaders, binFormat, bin, binLength);
     }
 
-    public static void compileShader(GL _gl, IntBuffer shaders)
+    public static void compileShader(final GL _gl, final IntBuffer shaders)
     {
         final GL2ES2 gl = _gl.getGL2ES2();
         for (int i = shaders.position(); i < shaders.limit(); i++) {
@@ -302,7 +302,7 @@ public class ShaderUtil {
         }
     }
 
-    public static void attachShader(GL _gl, int program, IntBuffer shaders)
+    public static void attachShader(final GL _gl, final int program, final IntBuffer shaders)
     {
         final GL2ES2 gl = _gl.getGL2ES2();
         for (int i = shaders.position(); i < shaders.limit(); i++) {
@@ -310,7 +310,7 @@ public class ShaderUtil {
         }
     }
 
-    public static void detachShader(GL _gl, int program, IntBuffer shaders)
+    public static void detachShader(final GL _gl, final int program, final IntBuffer shaders)
     {
         final GL2ES2 gl = _gl.getGL2ES2();
         for (int i = shaders.position(); i < shaders.limit(); i++) {
@@ -318,7 +318,7 @@ public class ShaderUtil {
         }
     }
 
-    public static void deleteShader(GL _gl, IntBuffer shaders)
+    public static void deleteShader(final GL _gl, final IntBuffer shaders)
     {
         final GL2ES2 gl = _gl.getGL2ES2();
         for (int i = shaders.position(); i < shaders.limit(); i++) {
@@ -327,9 +327,9 @@ public class ShaderUtil {
         }
     }
 
-    public static boolean createAndLoadShader(GL _gl, IntBuffer shader, int shaderType,
-                                              int binFormat, java.nio.Buffer bin,
-                                              PrintStream verboseOut)
+    public static boolean createAndLoadShader(final GL _gl, final IntBuffer shader, final int shaderType,
+                                              final int binFormat, final java.nio.Buffer bin,
+                                              final PrintStream verboseOut)
     {
         final GL2ES2 gl = _gl.getGL2ES2();
         int err = gl.glGetError(); // flush previous errors ..
@@ -352,9 +352,9 @@ public class ShaderUtil {
         return err == GL.GL_NO_ERROR;
     }
 
-    public static boolean createAndCompileShader(GL _gl, IntBuffer shader, int shaderType,
-                                                 CharSequence[][] sources,
-                                                 PrintStream verboseOut)
+    public static boolean createAndCompileShader(final GL _gl, final IntBuffer shader, final int shaderType,
+                                                 final CharSequence[][] sources,
+                                                 final PrintStream verboseOut)
     {
         final GL2ES2 gl = _gl.getGL2ES2();
         int err = gl.glGetError(); // flush previous errors ..
@@ -390,7 +390,7 @@ public class ShaderUtil {
         Set<Integer> shaderBinaryFormats = null;
     }
 
-    private static ProfileInformation getProfileInformation(GL gl) {
+    private static ProfileInformation getProfileInformation(final GL gl) {
         final GLContext context = gl.getContext();
         context.validateCurrent();
         ProfileInformation data = (ProfileInformation) context.getAttachedObject(implObjectKey);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
index 2f8884a..1ed875f 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/fixedfunc/FixedFuncUtil.java
@@ -37,7 +37,7 @@ public class FixedFuncUtil {
      * @see ShaderSelectionMode#COLOR_TEXTURE
      * @see ShaderSelectionMode#COLOR_TEXTURE_LIGHT_PER_VERTEX
      */
-    public static final GL2ES1 wrapFixedFuncEmul(GL gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix, boolean force, boolean verbose) {
+    public static final GL2ES1 wrapFixedFuncEmul(final GL gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix, final boolean force, final boolean verbose) {
         if(gl.isGL2ES2() && ( !gl.isGL2ES1() || force ) ) {
             final GL2ES2 es2 = gl.getGL2ES2();
             final FixedFuncHook hook = new FixedFuncHook(es2, mode, pmvMatrix);
@@ -66,7 +66,7 @@ public class FixedFuncUtil {
      * @see ShaderSelectionMode#COLOR_TEXTURE
      * @see ShaderSelectionMode#COLOR_TEXTURE_LIGHT_PER_VERTEX
      */
-    public static final GL2ES1 wrapFixedFuncEmul(GL gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) {
+    public static final GL2ES1 wrapFixedFuncEmul(final GL gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix) {
         return wrapFixedFuncEmul(gl, mode, null, false, false);
     }
 
@@ -90,7 +90,7 @@ public class FixedFuncUtil {
      * @see javax.media.opengl.fixedfunc.GLPointerFunc#glNormalPointer
      * @see javax.media.opengl.fixedfunc.GLPointerFunc#glTexCoordPointer
      */
-    public static String getPredefinedArrayIndexName(int glArrayIndex) {
+    public static String getPredefinedArrayIndexName(final int glArrayIndex) {
         return GLPointerFuncUtil.getPredefinedArrayIndexName(glArrayIndex);
     }
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java
index 44fbf1c..f113be2 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShader.java
@@ -30,7 +30,7 @@ public abstract class CompileShader {
 
     public abstract String getFragmentShaderCompiler();
 
-    public void processOneShader(String resourceName)
+    public void processOneShader(final String resourceName)
         throws IOException, UnsupportedEncodingException, InterruptedException
     {
         int type = -1;
@@ -49,11 +49,11 @@ public abstract class CompileShader {
             suffixLen = 4;
             type = GL2ES2.GL_VERTEX_SHADER;
         }
-        String justName = basename(resourceName);
+        final String justName = basename(resourceName);
         outName = justName.substring(0, justName.length() - suffixLen) +
                   ShaderCode.getFileSuffix(true, type);
-        URL resourceURL = IOUtil.getResource(null, resourceName).getURL();
-        String dirName = dirname(resourceURL.getPath());
+        final URL resourceURL = IOUtil.getResource(null, resourceName).getURL();
+        final String dirName = dirname(resourceURL.getPath());
 
         outName = dirName + File.separator + "bin" + File.separator +
                   ShaderCode.getBinarySubPath(getBinaryFormat()) + File.separator +
@@ -61,19 +61,19 @@ public abstract class CompileShader {
         processOneShader(resourceName, outName, type);
     }
 
-    public void processOneShader(String resourceName, String outName, int type)
+    public void processOneShader(final String resourceName, final String outName, final int type)
         throws IOException, UnsupportedEncodingException, InterruptedException
     {
-        URL resourceURL = IOUtil.getResource(null, resourceName).getURL();
-        String dirName = dirname(resourceURL.getPath());
+        final URL resourceURL = IOUtil.getResource(null, resourceName).getURL();
+        final String dirName = dirname(resourceURL.getPath());
 
-        CharSequence shader = ShaderCode.readShaderSource(null, resourceName, false);
+        final CharSequence shader = ShaderCode.readShaderSource(null, resourceName, false);
         if(null==shader) {
             System.err.println("Can't find shader source " + resourceName + " - ignored");
             return;
         }
         System.err.println("Preprocessing: "+ resourceName+", in dir: "+dirName);
-        String justName = basename(resourceName);
+        final String justName = basename(resourceName);
         String processor;
         switch (type) {
             case GL2ES2.GL_VERTEX_SHADER:
@@ -85,26 +85,26 @@ public abstract class CompileShader {
             default:
                 throw new GLException("Unknown shader type: "+type);
         }
-        File outputFile = new File(outName);
+        final File outputFile = new File(outName);
 
         // Write shader to a file in java.io.tmpdir
-        File tmpDir = new File(dirName+File.separator+"tmp");
+        final File tmpDir = new File(dirName+File.separator+"tmp");
         tmpDir.mkdirs();
-        File tmpFile = new File(tmpDir, justName);
-        Writer writer = new BufferedWriter(new FileWriter(tmpFile));
+        final File tmpFile = new File(tmpDir, justName);
+        final Writer writer = new BufferedWriter(new FileWriter(tmpFile));
         writer.write(shader.toString(), 0, shader.length());
         writer.flush();
         writer.close();
         System.err.println("Preprocessed: "+ tmpFile.getAbsolutePath());
 
-        File processorDir = getSDKCompilerDir();
+        final File processorDir = getSDKCompilerDir();
 
         System.err.println("SDK: "+ processorDir.getAbsolutePath() + ", compiler: "+processor);
 
         System.err.println("Output: "+ outputFile.getAbsolutePath());
 
         // Run the tool
-        Process process = Runtime.getRuntime().exec(new String[] {
+        final Process process = Runtime.getRuntime().exec(new String[] {
                 processorDir.getAbsolutePath() + File.separator + processor,
                 tmpFile.getAbsolutePath(),
                 outputFile.getAbsolutePath()
@@ -116,7 +116,7 @@ public abstract class CompileShader {
         // tmpFile.delete();
     }
 
-    protected static String basename(String path) {
+    protected static String basename(final String path) {
         int lastSlash = path.lastIndexOf("/");
         if (lastSlash < 0) {
             lastSlash = path.lastIndexOf("\\");
@@ -130,7 +130,7 @@ public abstract class CompileShader {
         return basename;
     }
 
-    protected static String dirname(String path) {
+    protected static String dirname(final String path) {
         int lastSlash = path.lastIndexOf("/");
         if (lastSlash < 0) {
             lastSlash = path.lastIndexOf("\\");
@@ -144,19 +144,19 @@ public abstract class CompileShader {
         return dirname;
     }
 
-    public void run(String[] args) {
+    public void run(final String[] args) {
         try {
             for (int i = 0; i < args.length; i++) {
                 processOneShader(args[i]);
             }
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
         }
     }
 
     private static class StreamMonitor implements Runnable {
-        private InputStream istream;
-        public StreamMonitor(InputStream stream) {
+        private final InputStream istream;
+        public StreamMonitor(final InputStream stream) {
             istream = stream;
             new Thread(this, "Output Reader Thread").start();
         }
@@ -164,7 +164,7 @@ public abstract class CompileShader {
         @Override
         public void run()
         {
-            byte[] buffer = new byte[4096];
+            final byte[] buffer = new byte[4096];
             try {
                 int numRead = 0;
                 do {
@@ -175,10 +175,10 @@ public abstract class CompileShader {
                     }
                 } while (numRead >= 0);
             }
-            catch (IOException e) {
+            catch (final IOException e) {
                 try {
                     istream.close();
-                } catch (IOException e2) {
+                } catch (final IOException e2) {
                 }
                 // Should allow clean exit when process shuts down
             }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java
index 215cf59..9ff37c7 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/glsl/sdk/CompileShaderNVidia.java
@@ -13,7 +13,7 @@ public class CompileShaderNVidia extends CompileShader {
     private static final String NVAPSDK;
 
     static {
-        String nvapSDKProp = System.getProperty("NVAPSDK");
+        final String nvapSDKProp = System.getProperty("NVAPSDK");
         if (nvapSDKProp != null) {
             NVAPSDK = nvapSDKProp;
         } else {
@@ -51,7 +51,7 @@ public class CompileShaderNVidia extends CompileShader {
         return "glslf.bat";
     }
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         new CompileShaderNVidia().run(args);
     }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java
index 9aadfba..e694f1b 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/Level.java
@@ -42,29 +42,29 @@ package com.jogamp.opengl.util.packrect;
 import java.util.*;
 
 public class Level {
-  private int width;
+  private final int width;
   private int height;
-  private int yPos;
-  private LevelSet holder;
+  private final int yPos;
+  private final LevelSet holder;
 
-  private List<Rect> rects = new ArrayList<Rect>();
+  private final List<Rect> rects = new ArrayList<Rect>();
   private List<Rect> freeList;
   private int nextAddX;
 
   static class RectXComparator implements Comparator<Rect> {
     @Override
-    public int compare(Rect r1, Rect r2) {
+    public int compare(final Rect r1, final Rect r2) {
       return r1.x() - r2.x();
     }
 
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
       return this == obj;
     }
   }
   private static final Comparator<Rect> rectXComparator = new RectXComparator();
 
-  public Level(int width, int height, int yPos, LevelSet holder) {
+  public Level(final int width, final int height, final int yPos, final LevelSet holder) {
     this.width = width;
     this.height = height;
     this.yPos = yPos;
@@ -80,7 +80,7 @@ public class Level {
       in the RectanglePacker and allocation from the free list. More
       disruptive changes like compaction of the level must be
       requested explicitly. */
-  public boolean add(Rect rect) {
+  public boolean add(final Rect rect) {
     if (rect.h() > height) {
       // See whether it's worth trying to expand vertically
       if (nextAddX + rect.w() > width) {
@@ -108,8 +108,8 @@ public class Level {
     // See whether we can add from the free list
     if (freeList != null) {
       Rect candidate = null;
-      for (Iterator<Rect> iter = freeList.iterator(); iter.hasNext(); ) {
-        Rect cur = iter.next();
+      for (final Iterator<Rect> iter = freeList.iterator(); iter.hasNext(); ) {
+        final Rect cur = iter.next();
         if (cur.canContain(rect)) {
           candidate = cur;
           break;
@@ -139,7 +139,7 @@ public class Level {
   }
 
   /** Removes the given Rect from this Level. */
-  public boolean remove(Rect rect) {
+  public boolean remove(final Rect rect) {
     if (!rects.remove(rect))
       return false;
 
@@ -165,14 +165,14 @@ public class Level {
 
   /** Indicates whether this Level could satisfy an allocation request
       if it were compacted. */
-  public boolean couldAllocateIfCompacted(Rect rect) {
+  public boolean couldAllocateIfCompacted(final Rect rect) {
     if (rect.h() > height)
       return false;
     if (freeList == null)
       return false;
     int freeListWidth = 0;
-    for (Iterator<Rect> iter = freeList.iterator(); iter.hasNext(); ) {
-      Rect cur = iter.next();
+    for (final Iterator<Rect> iter = freeList.iterator(); iter.hasNext(); ) {
+      final Rect cur = iter.next();
       freeListWidth += cur.w();
     }
     // Add on the remaining space at the end
@@ -180,12 +180,12 @@ public class Level {
     return (freeListWidth >= rect.w());
   }
 
-  public void compact(Object backingStore, BackingStoreManager manager) {
+  public void compact(final Object backingStore, final BackingStoreManager manager) {
     Collections.sort(rects, rectXComparator);
     int nextCompactionDest = 0;
     manager.beginMovement(backingStore, backingStore);
-    for (Iterator<Rect> iter = rects.iterator(); iter.hasNext(); ) {
-      Rect cur = iter.next();
+    for (final Iterator<Rect> iter = rects.iterator(); iter.hasNext(); ) {
+      final Rect cur = iter.next();
       if (cur.x() != nextCompactionDest) {
         manager.move(backingStore, cur,
                      backingStore, new Rect(nextCompactionDest, cur.y(), cur.w(), cur.h(), null));
@@ -203,9 +203,9 @@ public class Level {
   }
 
   /** Visits all Rects contained in this Level. */
-  public void visit(RectVisitor visitor) {
-    for (Iterator<Rect> iter = rects.iterator(); iter.hasNext(); ) {
-      Rect rect = iter.next();
+  public void visit(final RectVisitor visitor) {
+    for (final Iterator<Rect> iter = rects.iterator(); iter.hasNext(); ) {
+      final Rect rect = iter.next();
       visitor.visit(rect);
     }
   }
@@ -216,8 +216,8 @@ public class Level {
       original Rects. */
   public void updateRectangleReferences() {
     for (int i = 0; i < rects.size(); i++) {
-      Rect cur = rects.get(i);
-      Rect next = cur.getNextLocation();
+      final Rect cur = rects.get(i);
+      final Rect next = cur.getNextLocation();
       next.setPosition(cur.x(), cur.y());
       if (cur.w() != next.w() || cur.h() != next.h())
         throw new RuntimeException("Unexpected disparity in rectangle sizes during updateRectangleReferences");
@@ -235,8 +235,8 @@ public class Level {
     Collections.sort(freeList, rectXComparator);
     int i = 0;
     while (i < freeList.size() - 1) {
-      Rect r1 = freeList.get(i);
-      Rect r2 = freeList.get(i+1);
+      final Rect r1 = freeList.get(i);
+      final Rect r2 = freeList.get(i+1);
       if (r1.maxX() + 1 == r2.x()) {
         // Coalesce r1 and r2 into one block
         freeList.remove(i+1);
@@ -246,7 +246,7 @@ public class Level {
       }
     }
     // See whether the last block bumps up against the addition point
-    Rect last = freeList.get(freeList.size() - 1);
+    final Rect last = freeList.get(freeList.size() - 1);
     if (last.maxX() + 1 == nextAddX) {
       nextAddX -= last.w();
       freeList.remove(freeList.size() - 1);
@@ -262,8 +262,8 @@ public class Level {
 
   public void dumpFreeSpace() {
     int freeListWidth = 0;
-    for (Iterator<Rect> iter = freeList.iterator(); iter.hasNext(); ) {
-      Rect cur = iter.next();
+    for (final Iterator<Rect> iter = freeList.iterator(); iter.hasNext(); ) {
+      final Rect cur = iter.next();
       System.err.println(" Free rectangle at " + cur);
       freeListWidth += cur.w();
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java
index 433421f..803ca28 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/LevelSet.java
@@ -47,14 +47,14 @@ import java.util.*;
 
 public class LevelSet {
   // Maintained in sorted order by increasing Y coordinate
-  private List<Level> levels = new ArrayList<Level>();
+  private final List<Level> levels = new ArrayList<Level>();
   private int nextAddY;
-  private int w;
+  private final int w;
   private int h;
 
   /** A LevelSet manages all of the backing store for a region of a
       specified width and height. */
-  public LevelSet(int w, int h) {
+  public LevelSet(final int w, final int h) {
     this.w = w;
     this.h = h;
   }
@@ -66,14 +66,14 @@ public class LevelSet {
       the LevelSet given its current dimensions, false if not. Caller
       is responsible for performing compaction, expansion, etc. as a
       consequence. */
-  public boolean add(Rect rect) {
+  public boolean add(final Rect rect) {
     if (rect.w() > w)
       return false;
 
     // Go in reverse order through the levels seeing whether we can
     // trivially satisfy the allocation request
     for (int i = levels.size() - 1; i >= 0; --i) {
-      Level level = levels.get(i);
+      final Level level = levels.get(i);
       if (level.add(rect))
         return true;
     }
@@ -82,7 +82,7 @@ public class LevelSet {
     // increases the computational complexity of the addition process,
     // but prevents us from expanding unnecessarily.
     for (int i = levels.size() - 1; i >= 0; --i) {
-      Level level = levels.get(i);
+      final Level level = levels.get(i);
       if (level.couldAllocateIfCompacted(rect))
         return false;
     }
@@ -92,19 +92,19 @@ public class LevelSet {
     if (nextAddY + rect.h() > h)
       return false;
 
-    Level newLevel = new Level(w, rect.h(), nextAddY, this);
+    final Level newLevel = new Level(w, rect.h(), nextAddY, this);
     levels.add(newLevel);
     nextAddY += rect.h();
-    boolean res = newLevel.add(rect);
+    final boolean res = newLevel.add(rect);
     if (!res)
       throw new RuntimeException("Unexpected failure in addition to new Level");
     return true;
   }
 
   /** Removes the given Rect from this LevelSet. */
-  public boolean remove(Rect rect) {
+  public boolean remove(final Rect rect) {
     for (int i = levels.size() - 1; i >= 0; --i) {
-      Level level = levels.get(i);
+      final Level level = levels.get(i);
       if (level.remove(rect))
         return true;
     }
@@ -116,14 +116,14 @@ public class LevelSet {
       if necessary. This is the correct fallback path to {@link
       #add(Rect)} above. Returns true if allocated successfully, false
       otherwise (indicating the need to expand the backing store). */
-  public boolean compactAndAdd(Rect rect,
-                               Object backingStore,
-                               BackingStoreManager manager) {
+  public boolean compactAndAdd(final Rect rect,
+                               final Object backingStore,
+                               final BackingStoreManager manager) {
     for (int i = levels.size() - 1; i >= 0; --i) {
-      Level level = levels.get(i);
+      final Level level = levels.get(i);
       if (level.couldAllocateIfCompacted(rect)) {
         level.compact(backingStore, manager);
-        boolean res = level.add(rect);
+        final boolean res = level.add(rect);
         if (!res)
           throw new RuntimeException("Unexpected failure to add after compaction");
         return true;
@@ -136,7 +136,7 @@ public class LevelSet {
   /** Indicates whether it's legal to trivially increase the height of
       the given Level. This is only possible if it's the last Level
       added and there's enough room in the backing store. */
-  public boolean canExpand(Level level, int height) {
+  public boolean canExpand(final Level level, final int height) {
     if (levels.isEmpty())
       return false; // Should not happen
     if (levels.get(levels.size() - 1) == level &&
@@ -145,7 +145,7 @@ public class LevelSet {
     return false;
   }
 
-  public void expand(Level level, int oldHeight, int newHeight) {
+  public void expand(final Level level, final int oldHeight, final int newHeight) {
     nextAddY += (newHeight - oldHeight);
   }
 
@@ -156,7 +156,7 @@ public class LevelSet {
 
   /** Sets the height of this LevelSet. It is only legal to reduce the
       height to greater than or equal to the currently used height. */
-  public void setHeight(int height) throws IllegalArgumentException {
+  public void setHeight(final int height) throws IllegalArgumentException {
     if (height < getUsedHeight()) {
       throw new IllegalArgumentException("May not reduce height below currently used height");
     }
@@ -170,11 +170,11 @@ public class LevelSet {
       it may be profitable to perform a compaction. */
   public float verticalFragmentationRatio() {
     int freeHeight = 0;
-    int usedHeight = getUsedHeight();
+    final int usedHeight = getUsedHeight();
     if (usedHeight == 0)
       return 0.0f;
-    for (Iterator<Level> iter = iterator(); iter.hasNext(); ) {
-      Level level = iter.next();
+    for (final Iterator<Level> iter = iterator(); iter.hasNext(); ) {
+      final Level level = iter.next();
       if (level.isEmpty()) {
         freeHeight += level.h();
       }
@@ -187,9 +187,9 @@ public class LevelSet {
   }
 
   /** Visits all Rects contained in this LevelSet. */
-  public void visit(RectVisitor visitor) {
-    for (Iterator<Level> iter = levels.iterator(); iter.hasNext(); ) {
-      Level level = iter.next();
+  public void visit(final RectVisitor visitor) {
+    for (final Iterator<Level> iter = levels.iterator(); iter.hasNext(); ) {
+      final Level level = iter.next();
       level.visit(visitor);
     }
   }
@@ -199,8 +199,8 @@ public class LevelSet {
       update the new Rects in a newly laid-out LevelSet with the
       original Rects. */
   public void updateRectangleReferences() {
-    for (Iterator<Level> iter = levels.iterator(); iter.hasNext(); ) {
-      Level level = iter.next();
+    for (final Iterator<Level> iter = levels.iterator(); iter.hasNext(); ) {
+      final Level level = iter.next();
       level.updateRectangleReferences();
     }
   }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java
index 89f5942..cbf6b93 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/Rect.java
@@ -77,11 +77,11 @@ public class Rect {
     this(null);
   }
 
-  public Rect(Object userData) {
+  public Rect(final Object userData) {
     this(0, 0, 0, 0, userData);
   }
 
-  public Rect(int x, int y, int w, int h, Object userData) {
+  public Rect(final int x, final int y, final int w, final int h, final Object userData) {
     setPosition(x, y);
     setSize(w, h);
     setUserData(userData);
@@ -94,7 +94,7 @@ public class Rect {
   public Object getUserData() { return userData; }
   public Rect getNextLocation() { return nextLocation; }
 
-  public void setPosition(int x, int y) {
+  public void setPosition(final int x, final int y) {
     if (x < 0)
       throw new IllegalArgumentException("Negative x");
     if (y < 0)
@@ -103,7 +103,7 @@ public class Rect {
     this.y = y;
   }
 
-  public void setSize(int w, int h) throws IllegalArgumentException {
+  public void setSize(final int w, final int h) throws IllegalArgumentException {
     if (w < 0)
       throw new IllegalArgumentException("Negative width");
     if (h < 0)
@@ -112,8 +112,8 @@ public class Rect {
     this.h = h;
   }
 
-  public void setUserData(Object obj) { userData = obj; }
-  public void setNextLocation(Rect nextLocation) { this.nextLocation = nextLocation; }
+  public void setUserData(final Object obj) { userData = obj; }
+  public void setNextLocation(final Rect nextLocation) { this.nextLocation = nextLocation; }
 
   // Helpers for computations.
 
@@ -139,7 +139,7 @@ public class Rect {
     return y() + h() - 1;
   }
 
-  public boolean canContain(Rect other) {
+  public boolean canContain(final Rect other) {
     return (w() >= other.w() &&
             h() >= other.h());
   }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java
index 44faa44..794ae44 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/packrect/RectanglePacker.java
@@ -48,34 +48,34 @@ import java.util.*;
     backing store, when necessary. */
 
 public class RectanglePacker {
-  private BackingStoreManager manager;
+  private final BackingStoreManager manager;
   private Object backingStore;
   private LevelSet levels;
-  private float EXPANSION_FACTOR = 0.5f;
-  private float SHRINK_FACTOR = 0.3f;
+  private static final float EXPANSION_FACTOR = 0.5f;
+  private static final float SHRINK_FACTOR = 0.3f;
 
-  private int initialWidth;
-  private int initialHeight;
+  private final int initialWidth;
+  private final int initialHeight;
 
   private int maxWidth  = -1;
   private int maxHeight = -1;
 
   static class RectHComparator implements Comparator<Rect> {
     @Override
-    public int compare(Rect r1, Rect r2) {
+    public int compare(final Rect r1, final Rect r2) {
       return r2.h() - r1.h();
     }
 
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
       return this == obj;
     }
   }
   private static final Comparator<Rect> rectHComparator = new RectHComparator();
 
-  public RectanglePacker(BackingStoreManager manager,
-                         int initialWidth,
-                         int initialHeight) {
+  public RectanglePacker(final BackingStoreManager manager,
+                         final int initialWidth,
+                         final int initialHeight) {
     this.manager = manager;
     levels = new LevelSet(initialWidth, initialHeight);
     this.initialWidth = initialWidth;
@@ -95,7 +95,7 @@ public class RectanglePacker {
       necessary. Setting up a maximum width and height introduces the
       possibility that additions will fail; these are handled with the
       BackingStoreManager's allocationFailed notification. */
-  public void setMaxSize(int maxWidth, int maxHeight) {
+  public void setMaxSize(final int maxWidth, final int maxHeight) {
     this.maxWidth  = maxWidth;
     this.maxHeight = maxHeight;
   }
@@ -107,7 +107,7 @@ public class RectanglePacker {
       BackingStoreManager#preExpand BackingStoreManager.preExpand}
       does not clear enough space for the incoming rectangle, then
       this method will throw a RuntimeException. */
-  public void add(Rect rect) throws RuntimeException {
+  public void add(final Rect rect) throws RuntimeException {
     // Allocate backing store if we don't have any yet
     if (backingStore == null)
       backingStore = manager.allocateBackingStore(levels.w(), levels.h());
@@ -143,12 +143,12 @@ public class RectanglePacker {
   }
 
   /** Removes the given rectangle from this RectanglePacker. */
-  public void remove(Rect rect) {
+  public void remove(final Rect rect) {
     levels.remove(rect);
   }
 
   /** Visits all Rects contained in this RectanglePacker. */
-  public void visit(RectVisitor visitor) {
+  public void visit(final RectVisitor visitor) {
     levels.visit(visitor);
   }
 
@@ -168,7 +168,7 @@ public class RectanglePacker {
   }
 
   // The "cause" rect may be null
-  private void compactImpl(Rect cause) {
+  private void compactImpl(final Rect cause) {
     // Have to either expand, compact or both. Need to figure out what
     // direction to go. Prefer to expand vertically. Expand
     // horizontally only if rectangle being added is too wide. FIXME:
@@ -205,12 +205,12 @@ public class RectanglePacker {
       nextLevelSet = new LevelSet(newWidth, newHeight);
 
       // Make copies of all existing rectangles
-      List<Rect> newRects = new ArrayList<Rect>();
-      for (Iterator<Level> i1 = levels.iterator(); i1.hasNext(); ) {
-        Level level = i1.next();
-        for (Iterator<Rect> i2 = level.iterator(); i2.hasNext(); ) {
-          Rect cur = i2.next();
-          Rect newRect = new Rect(0, 0, cur.w(), cur.h(), null);
+      final List<Rect> newRects = new ArrayList<Rect>();
+      for (final Iterator<Level> i1 = levels.iterator(); i1.hasNext(); ) {
+        final Level level = i1.next();
+        for (final Iterator<Rect> i2 = level.iterator(); i2.hasNext(); ) {
+          final Rect cur = i2.next();
+          final Rect newRect = new Rect(0, 0, cur.w(), cur.h(), null);
           cur.setNextLocation(newRect);
           // Hook up the reverse mapping too for easier replacement
           newRect.setNextLocation(cur);
@@ -222,7 +222,7 @@ public class RectanglePacker {
       Collections.sort(newRects, rectHComparator);
       // Try putting all of these rectangles into the new level set
       done = true;
-      for (Iterator<Rect> iter = newRects.iterator(); iter.hasNext(); ) {
+      for (final Iterator<Rect> iter = newRects.iterator(); iter.hasNext(); ) {
         if (!nextLevelSet.add(iter.next())) {
           done = false;
           break;
@@ -268,13 +268,13 @@ public class RectanglePacker {
     // new locations of rectangles on the backing store. Allocate a
     // new backing store, move the contents over and deallocate the
     // old one.
-    Object newBackingStore = manager.allocateBackingStore(nextLevelSet.w(),
+    final Object newBackingStore = manager.allocateBackingStore(nextLevelSet.w(),
                                                           nextLevelSet.h());
     manager.beginMovement(backingStore, newBackingStore);
-    for (Iterator<Level> i1 = levels.iterator(); i1.hasNext(); ) {
-      Level level = i1.next();
-      for (Iterator<Rect> i2 = level.iterator(); i2.hasNext(); ) {
-        Rect cur = i2.next();
+    for (final Iterator<Level> i1 = levels.iterator(); i1.hasNext(); ) {
+      final Level level = i1.next();
+      for (final Iterator<Rect> i2 = level.iterator(); i2.hasNext(); ) {
+        final Rect cur = i2.next();
         manager.move(backingStore, cur,
                      newBackingStore, cur.getNextLocation());
       }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/stereo/EyeParameter.java b/src/jogl/classes/com/jogamp/opengl/util/stereo/EyeParameter.java
new file mode 100644
index 0000000..075da34
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/util/stereo/EyeParameter.java
@@ -0,0 +1,68 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.util.stereo;
+
+import com.jogamp.opengl.math.FovHVHalves;
+
+/**
+ * Constant parameter for one eye.
+ */
+public final class EyeParameter {
+    /** Eye number, <code>0</code> for the left eye and <code>1</code> for the right eye. */
+    public final int number;
+
+    /** float[3] eye position vector used to define eye height in meter relative to <i>actor</i>. */
+    public final float[] positionOffset;
+
+    /** Field of view in both directions, may not be centered, either in radians or tangent. */
+    public final FovHVHalves fovhv;
+
+    /** IPD related horizontal distance from nose to pupil in meter. */
+    public final float distNoseToPupilX;
+
+    /** Vertical distance from middle-line to pupil in meter. */
+    public final float distMiddleToPupilY;
+
+    /** Z-axis eye relief in meter. */
+    public final float eyeReliefZ;
+
+    public EyeParameter(final int number, final float[] positionOffset, final FovHVHalves fovhv,
+                        final float distNoseToPupil, final float verticalDelta, final float eyeRelief) {
+        this.number = number;
+        this.positionOffset = new float[3];
+        System.arraycopy(positionOffset, 0, this.positionOffset, 0, 3);
+        this.fovhv = fovhv;
+        this.distNoseToPupilX = distNoseToPupil;
+        this.distMiddleToPupilY = verticalDelta;
+        this.eyeReliefZ = eyeRelief;
+    }
+    public final String toString() {
+        return "EyeParam[num "+number+", posOff["+positionOffset[0]+", "+positionOffset[1]+", "+positionOffset[2]+"], "+fovhv+
+                      ", distPupil[noseX "+distNoseToPupilX+", middleY "+distMiddleToPupilY+", reliefZ "+eyeReliefZ+"]]";
+    }
+}
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/opengl/util/stereo/EyePose.java b/src/jogl/classes/com/jogamp/opengl/util/stereo/EyePose.java
new file mode 100644
index 0000000..aa64ff1
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/util/stereo/EyePose.java
@@ -0,0 +1,69 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.util.stereo;
+
+import com.jogamp.opengl.math.Quaternion;
+
+/**
+ * Position and orientation of one eye.
+ */
+public final class EyePose {
+    /** Eye number, <code>0</code> for the left eye and <code>1</code> for the right eye. */
+    public final int number;
+
+    /** float[3] eye position vector. */
+    public final float[] position;
+
+    /** Eye orientation */
+    public final Quaternion orientation;
+
+    public EyePose(final int number) {
+        this.number = number;
+        this.position = new float[3];
+        this.orientation = new Quaternion();
+    }
+    public EyePose(final int number, final float[] position, final Quaternion orientation) {
+        this(number);
+        set(position, orientation);
+    }
+
+    /** Set position and orientation of this instance. */
+    public final void set(final float[] position, final Quaternion orientation) {
+        System.arraycopy(position, 0, this.position, 0, 3);
+        this.orientation.set(orientation);
+    }
+    /** Set position and orientation of this instance. */
+    public final void setPosition(final float posX, final float posY, final float posZ) {
+        position[0] = posX;
+        position[1] = posY;
+        position[2] = posZ;
+    }
+    public final String toString() {
+        return "EyePose[num "+number+", pos["+position[0]+", "+position[1]+", "+position[2]+"], "+orientation+"]";
+    }
+}
\ No newline at end of file
diff --git a/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoClientRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoClientRenderer.java
new file mode 100644
index 0000000..c9445b7
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoClientRenderer.java
@@ -0,0 +1,263 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.util.stereo;
+
+import javax.media.nativewindow.util.DimensionImmutable;
+import javax.media.nativewindow.util.RectangleImmutable;
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLEventListener;
+
+import jogamp.opengl.GLDrawableHelper;
+import jogamp.opengl.GLDrawableHelper.GLEventListenerAction;
+
+import com.jogamp.opengl.FBObject;
+import com.jogamp.opengl.FBObject.Attachment;
+import com.jogamp.opengl.FBObject.TextureAttachment;
+import com.jogamp.opengl.FBObject.Attachment.Type;
+import com.jogamp.opengl.util.CustomGLEventListener;
+
+/**
+ * {@link StereoClientRenderer} utilizing {@link StereoDeviceRenderer}
+ * implementing {@link GLEventListener} for convenience.
+ * <p>
+ * See {@link StereoDeviceRenderer} notes about <a href="StereoDeviceRenderer.html#asymFOVRendering">Correct Asymmetric FOV Rendering</a>.
+ * <p>
+ * Implementation renders {@link StereoGLEventListener}
+ * using one or more {@link FBObject} according to {@link StereoDeviceRenderer#getTextureCount()}.
+ * </p>
+ */
+public class StereoClientRenderer implements GLEventListener {
+    private final GLDrawableHelper helper;
+    private final StereoDeviceRenderer deviceRenderer;
+    private final boolean ownsDevice;
+    private final FBObject[] fbos;
+    private final int magFilter;
+    private final int minFilter;
+
+    private int numSamples;
+    private final TextureAttachment[] fboTexs;
+
+    public StereoClientRenderer(final StereoDeviceRenderer deviceRenderer, final boolean ownsDevice,
+                                final int magFilter, final int minFilter, final int numSamples) {
+        final int fboCount = deviceRenderer.getTextureCount();
+        if( 0 > fboCount || 2 < fboCount ) {
+            throw new IllegalArgumentException("fboCount must be within [0..2], has "+fboCount+", due to "+deviceRenderer);
+        }
+        this.helper = new GLDrawableHelper();
+        this.deviceRenderer = deviceRenderer;
+        this.ownsDevice = ownsDevice;
+        this.magFilter = magFilter;
+        this.minFilter = minFilter;
+
+        this.numSamples = numSamples;
+
+        this.fbos = new FBObject[fboCount];
+        for(int i=0; i<fboCount; i++) {
+            this.fbos[i] = new FBObject();
+        }
+        this.fboTexs = new TextureAttachment[fboCount];
+    }
+
+    private void initFBOs(final GL gl, final DimensionImmutable size) {
+        for(int i=0; i<fbos.length; i++) {
+            fbos[i].detachAllColorbuffer(gl);
+            fbos[i].reset(gl, size.getWidth(), size.getHeight(), numSamples, false);
+            if( i>0 && fbos[i-1].getNumSamples() != fbos[i].getNumSamples()) {
+                throw new InternalError("sample size mismatch: \n\t0: "+fbos[i-1]+"\n\t1: "+fbos[i]);
+            }
+            numSamples = fbos[i].getNumSamples();
+
+            if(numSamples>0) {
+                fbos[i].attachColorbuffer(gl, 0, true); // MSAA requires alpha
+                fbos[i].attachRenderbuffer(gl, Type.DEPTH, 24);
+                final FBObject ssink = new FBObject();
+                {
+                    ssink.reset(gl, size.getWidth(), size.getHeight());
+                    ssink.attachTexture2D(gl, 0, false, magFilter, minFilter, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
+                    ssink.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
+                }
+                fbos[i].setSamplingSink(ssink);
+                fbos[i].resetSamplingSink(gl); // validate
+                fboTexs[i] = fbos[i].getSamplingSink().getTextureAttachment();
+            } else {
+                fboTexs[i] = fbos[i].attachTexture2D(gl, 0, false, magFilter, minFilter, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
+                fbos[i].attachRenderbuffer(gl, Type.DEPTH, 24);
+            }
+            fbos[i].unbind(gl);
+            System.err.println("FBO["+i+"]: "+fbos[i]);
+        }
+
+    }
+
+    @SuppressWarnings("unused")
+    private void resetFBOs(final GL gl, final DimensionImmutable size) {
+        for(int i=0; i<fbos.length; i++) {
+            fbos[i].reset(gl, size.getWidth(), size.getHeight(), numSamples, true);
+            if( i>0 && fbos[i-1].getNumSamples() != fbos[i].getNumSamples()) {
+                throw new InternalError("sample size mismatch: \n\t0: "+fbos[i-1]+"\n\t1: "+fbos[i]);
+            }
+            numSamples = fbos[i].getNumSamples();
+            if(numSamples>0) {
+                fboTexs[i] = fbos[i].getSamplingSink().getTextureAttachment();
+            } else {
+                fboTexs[i] = fbos[i].getColorbuffer(0).getTextureAttachment();
+            }
+        }
+    }
+
+    public final StereoDeviceRenderer getStereoDeviceRenderer() { return deviceRenderer; }
+
+    public final void addGLEventListener(final StereoGLEventListener l) {
+        helper.addGLEventListener(l);
+    }
+    public final void removeGLEventListener(final StereoGLEventListener l) {
+        helper.removeGLEventListener(l);
+    }
+
+    @Override
+    public void init(final GLAutoDrawable drawable) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+        deviceRenderer.init(gl);
+
+        // We will do some offscreen rendering, setup FBO...
+        final DimensionImmutable textureSize = deviceRenderer.getTextureCount() > 1 ? deviceRenderer.getSingleSurfaceSize() : deviceRenderer.getTotalSurfaceSize();
+        initFBOs(gl, textureSize);
+        helper.init(drawable, false);
+
+        gl.setSwapInterval(1);
+    }
+
+    @Override
+    public void dispose(final GLAutoDrawable drawable) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+        helper.disposeAllGLEventListener(drawable, false);
+        for(int i=0; i<fbos.length; i++) {
+            fbos[i].destroy(gl);
+            fboTexs[i] = null;
+        }
+        if( ownsDevice ) {
+            deviceRenderer.dispose(gl);
+        }
+    }
+
+    @Override
+    public void display(final GLAutoDrawable drawable) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+        deviceRenderer.beginFrame(gl);
+
+        if(0 < numSamples) {
+            gl.glEnable(GL.GL_MULTISAMPLE);
+        }
+
+        final int fboCount = fbos.length;
+        final int displayRepeatFlags;
+        if( 1 >= fboCount ) {
+            displayRepeatFlags = CustomGLEventListener.DISPLAY_DONTCLEAR;
+        } else {
+            displayRepeatFlags = 0;
+        }
+
+        final int[] eyeOrder = deviceRenderer.getDevice().getEyeRenderOrder();
+        final int eyeCount = eyeOrder.length;
+
+        // Update eye pos upfront to have same (almost) results
+        for(int eyeNum=0; eyeNum<eyeCount; eyeNum++) {
+            deviceRenderer.updateEyePose(eyeNum);
+        }
+
+        if( 1 == fboCount ) {
+            fbos[0].bind(gl);
+        }
+
+        for(int eyeNum=0; eyeNum<eyeCount; eyeNum++) {
+            final int eyeName = eyeOrder[eyeNum];
+            if( 1 < fboCount ) {
+                fbos[eyeName].bind(gl);
+            }
+
+            final StereoDeviceRenderer.Eye eye = deviceRenderer.getEye(eyeName);
+            final RectangleImmutable viewport = eye.getViewport();
+            gl.glViewport(viewport.getX(), viewport.getY(), viewport.getWidth(), viewport.getHeight());
+
+            final int displayFlags = eyeNum > 0 ? CustomGLEventListener.DISPLAY_REPEAT | displayRepeatFlags : 0;
+            final GLEventListenerAction reshapeDisplayAction = new GLEventListenerAction() {
+                public void run(final GLAutoDrawable drawable, final GLEventListener listener) {
+                    final StereoGLEventListener sl = (StereoGLEventListener) listener;
+                    sl.reshapeForEye(drawable, viewport.getX(), viewport.getY(), viewport.getWidth(), viewport.getHeight(),
+                                     eye.getEyeParameter(), eye.getLastEyePose());
+                    sl.display(drawable, displayFlags);
+                }  };
+            helper.runForAllGLEventListener(drawable, reshapeDisplayAction);
+
+            if( 1 < fboCount ) {
+                fbos[eyeName].unbind(gl);
+            }
+        }
+
+        if( 1 == fboCount ) {
+            fbos[0].unbind(gl);
+        }
+        // restore viewport
+        gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
+
+        if( deviceRenderer.ppAvailable() ) {
+            deviceRenderer.ppBegin(gl);
+            if( 1 == fboCount ) {
+                fbos[0].use(gl, fboTexs[0]);
+                for(int eyeNum=0; eyeNum<eyeCount; eyeNum++) {
+                    deviceRenderer.ppOneEye(gl, eyeOrder[eyeNum]);
+                }
+                fbos[0].unuse(gl);
+            } else {
+                for(int eyeNum=0; eyeNum<eyeCount; eyeNum++) {
+                    final int eyeName = eyeOrder[eyeNum];
+                    fbos[eyeName].use(gl, fboTexs[eyeName]);
+                    deviceRenderer.ppOneEye(gl, eyeName);
+                    fbos[eyeName].unuse(gl);
+                }
+            }
+            deviceRenderer.ppEnd(gl);
+        }
+
+        if( !drawable.getAutoSwapBufferMode() ) {
+            drawable.swapBuffers();
+        }
+        deviceRenderer.endFrame(gl);
+    }
+
+    @Override
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+        if( !drawable.getAutoSwapBufferMode() ) {
+            final GL2ES2 gl = drawable.getGL().getGL2ES2();
+            gl.glViewport(0, 0, width, height);
+        }
+    }
+}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDevice.java b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDevice.java
new file mode 100644
index 0000000..d32c981
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDevice.java
@@ -0,0 +1,160 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.util.stereo;
+
+import javax.media.nativewindow.util.DimensionImmutable;
+import javax.media.nativewindow.util.PointImmutable;
+
+import jogamp.opengl.Debug;
+
+import com.jogamp.opengl.math.FovHVHalves;
+
+/**
+ * Interface describing a native stereoscopic device
+ */
+public interface StereoDevice {
+    public static final boolean DEBUG = Debug.debug("StereoDevice");
+    public static final boolean DUMP_DATA = Debug.isPropertyDefined("jogl.debug.StereoDevice.DumpData", true);
+
+    /** Merely a class providing a type-tag for extensions */
+    public static class Config {
+        // NOP
+    }
+
+    /** Return the factory used to create this device. */
+    public StereoDeviceFactory getFactory();
+
+    /** Disposes this {@link StereoDevice}. */
+    public void dispose();
+
+    /**
+     * If operation within a device spanning virtual desktop,
+     * returns the device position.
+     * <p>
+     * Otherwise simply 0/0.
+     * </p>
+     */
+    public PointImmutable getPosition();
+
+    /**
+     * Returns the required surface size in pixel.
+     */
+    public DimensionImmutable getSurfaceSize();
+
+    /**
+     * Return the device default eye position offset for {@link #createRenderer(int, int, float[], FovHVHalves[], float)}.
+     * <p>
+     * Result is an array of float values for
+     * <ul>
+     *   <li><i>right</i> (positive)</li>
+     *   <li><i>up</i> (positive)</li>
+     *   <li><i>forward</i> (negative)</li>
+     * </ul>
+     * </p>
+     * @return
+     */
+    public float[] getDefaultEyePositionOffset();
+
+    /**
+     * Returns the device default {@link FovHVHalves} for all supported eyes
+     * in natural order, i.e. left and right if supported.
+     * <p>
+     * Monoscopic devices return an array length of one, without the value for the right-eye!
+     * </p>
+     */
+    public FovHVHalves[] getDefaultFOV();
+
+    /** Start or stop sensors. Returns true if action was successful, otherwise false. */
+    public boolean startSensors(boolean start);
+
+    /** Return true if sensors have been started, false otherwise */
+    public boolean getSensorsStarted();
+
+    /**
+     * Returns an array of the preferred eye rendering order.
+     * The array length reflects the supported eye count.
+     * <p>
+     * Monoscopic devices only support one eye, where stereoscopic device two eyes.
+     * </p>
+     */
+    public int[] getEyeRenderOrder();
+
+    /**
+     * Returns the supported distortion compensation by the {@link StereoDeviceRenderer},
+     * e.g. {@link StereoDeviceRenderer#DISTORTION_BARREL}, {@link StereoDeviceRenderer#DISTORTION_CHROMATIC}, etc.
+     * @see StereoDeviceRenderer#getDistortionBits()
+     * @see #createRenderer(int, int, float[], FovHVHalves[], float, int)
+     * @see #getRecommendedDistortionBits()
+     * @see #getMinimumDistortionBits()
+     */
+    public int getSupportedDistortionBits();
+
+    /**
+     * Returns the recommended distortion compensation bits for the {@link StereoDeviceRenderer},
+     * e.g. {@link StereoDeviceRenderer#DISTORTION_BARREL}, {@link StereoDeviceRenderer#DISTORTION_CHROMATIC}
+     * {@link StereoDeviceRenderer#DISTORTION_VIGNETTE}.
+     * <p>
+     * User shall use the recommended distortion compensation to achieve a distortion free view.
+     * </p>
+     * @see StereoDeviceRenderer#getDistortionBits()
+     * @see #createRenderer(int, int, float[], FovHVHalves[], float, int)
+     * @see #getSupportedDistortionBits()
+     * @see #getMinimumDistortionBits()
+     */
+    public int getRecommendedDistortionBits();
+
+    /**
+     * Returns the minimum distortion compensation bits as required by the {@link StereoDeviceRenderer},
+     * e.g. {@link StereoDeviceRenderer#DISTORTION_BARREL} in case the stereoscopic display uses [a]spherical lenses.
+     * <p>
+     * Minimum distortion compensation bits are being enforced by the {@link StereoDeviceRenderer}.
+     * </p>
+     * @see #getSupportedDistortionBits()
+     * @see #getRecommendedDistortionBits()
+     * @see StereoDeviceRenderer#getDistortionBits()
+     * @see #createRenderer(int, int, float[], FovHVHalves[], float, int)
+     */
+    public int getMinimumDistortionBits();
+
+    /**
+     * Create a new {@link StereoDeviceRenderer} instance.
+     *
+     * @param distortionBits {@link StereoDeviceRenderer} distortion bits, e.g. {@link StereoDeviceRenderer#DISTORTION_BARREL}, etc,
+     *                       see {@link #getRecommendedDistortionBits()}.
+     * @param textureCount desired texture count for post-processing, see {@link StereoDeviceRenderer#getTextureCount()} and {@link StereoDeviceRenderer#ppAvailable()}
+     * @param eyePositionOffset eye position offset, e.g. {@link #getDefaultEyePositionOffset()}.
+     * @param eyeFov FovHVHalves[] field-of-view per eye, e.g. {@link #getDefaultFOV()}. May contain only one value for monoscopic devices,
+     *               see {@link #getEyeRenderOrder()}.
+     * @param pixelsPerDisplayPixel
+     * @param textureUnit
+     * @return
+     */
+    public StereoDeviceRenderer createRenderer(final int distortionBits,
+                                               final int textureCount, final float[] eyePositionOffset,
+                                               final FovHVHalves[] eyeFov, final float pixelsPerDisplayPixel, final int textureUnit);
+}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDeviceFactory.java b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDeviceFactory.java
new file mode 100644
index 0000000..c418058
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDeviceFactory.java
@@ -0,0 +1,99 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.util.stereo;
+
+import com.jogamp.common.util.ReflectionUtil;
+
+/**
+ * Platform agnostic {@link StereoDevice} factory.
+ * <p>
+ * To implement a new {@link StereoDevice}, the following interfaces/classes must be implemented:
+ * <ul>
+ *   <li>{@link StereoDeviceFactory}</li>
+ *   <li>{@link StereoDevice}</li>
+ *   <li>{@link StereoDeviceRenderer}</li>
+ * </ul>
+ * </p>
+ */
+public abstract class StereoDeviceFactory {
+    private static final String OVRStereoDeviceClazzName = "jogamp.opengl.oculusvr.OVRStereoDeviceFactory";
+    private static final String GenericStereoDeviceClazzName = "jogamp.opengl.util.stereo.GenericStereoDeviceFactory";
+    private static final String isAvailableMethodName = "isAvailable";
+
+    /** {@link StereoDevice} type used for {@link StereoDeviceFactory#createFactory(DeviceType) createFactory(type)}. */
+    public static enum DeviceType {
+        /**
+         * Auto selection of device in the following order:
+         * <ol>
+         *   <li>{@link DeviceType#OculusVR}</li>
+         *   <li>{@link DeviceType#Generic}</li>
+         * </ol>
+         */
+        Default,
+        /**
+         * Generic software implementation.
+         */
+        Generic,
+        /**
+         * OculusVR implementation.
+         */
+        OculusVR
+    };
+
+    public static StereoDeviceFactory createDefaultFactory() {
+        final ClassLoader cl = StereoDeviceFactory.class.getClassLoader();
+        StereoDeviceFactory sink = createFactory(cl, OVRStereoDeviceClazzName);
+        if( null == sink ) {
+            sink = createFactory(cl, GenericStereoDeviceClazzName);
+        }
+        return sink;
+    }
+
+    public static StereoDeviceFactory createFactory(final DeviceType type) {
+        final String className;
+        switch( type ) {
+            case Default: return createDefaultFactory();
+            case Generic: className = GenericStereoDeviceClazzName; break;
+            case OculusVR: className = OVRStereoDeviceClazzName; break;
+            default: throw new InternalError("XXX");
+        }
+        final ClassLoader cl = StereoDeviceFactory.class.getClassLoader();
+        return createFactory(cl, className);
+    }
+
+    public static StereoDeviceFactory createFactory(final ClassLoader cl, final String implName) {
+        try {
+            if(((Boolean)ReflectionUtil.callStaticMethod(implName, isAvailableMethodName, null, null, cl)).booleanValue()) {
+                return (StereoDeviceFactory) ReflectionUtil.createInstance(implName, cl);
+            }
+        } catch (final Throwable t) { if(StereoDevice.DEBUG) { System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage()); t.printStackTrace(); } }
+        return null;
+    }
+
+    public abstract StereoDevice createDevice(final int deviceIndex, final StereoDevice.Config config, final boolean verbose);
+}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDeviceRenderer.java b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDeviceRenderer.java
new file mode 100644
index 0000000..ab9ba99
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoDeviceRenderer.java
@@ -0,0 +1,243 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.util.stereo;
+
+import javax.media.nativewindow.util.DimensionImmutable;
+import javax.media.nativewindow.util.RectangleImmutable;
+import javax.media.opengl.GL;
+
+import com.jogamp.opengl.math.FovHVHalves;
+
+/**
+ * Stereoscopic device rendering interface.
+ * <p>
+ * The following pseudo-code describes how to implement a renderer
+ * using a {@link StereoDeviceRenderer}.
+ * See {@link StereoClientRenderer} which implements the following:
+ * <ul>
+ *   <li>device.{@link #beginFrame(GL)}</li>
+ *   <li>For both eyes:<ul>
+ *     <li>device.{@link #updateEyePose(int)}</li>
+ *     <li>if device.{@link #ppAvailable()}: Set the render target, e.g. FBO</li>
+ *     <li>Set the viewport using {@link Eye#getViewport()}</li>
+ *     <li>{@link StereoGLEventListener#reshapeForEye(javax.media.opengl.GLAutoDrawable, int, int, int, int, EyeParameter, EyePose) upstream.reshapeEye(..)}</li>
+ *     <li>{@link StereoGLEventListener#display(javax.media.opengl.GLAutoDrawable, int) upstream.display(..)}.</li>
+ *   </ul></li>
+ *   <li>Reset the viewport</li>
+ *   <li>If device.{@link #ppAvailable()}:<ul>
+ *     <li>device.{@link #ppBegin(GL)}</li>
+ *     <li>Use render target, e.g. FBO's texture</li>
+ *     <li>device.{@link #ppBothEyes(GL)} or device.{@link #ppOneEye(GL, int)} for both eyes</li>
+ *     <li>device.{@link #ppEnd(GL)}</li>
+ *   </ul></li>
+ *   <li>device.{@link #endFrame(GL)}</li>
+ * </ul>
+ * </p>
+ * <a name="asymFOVRendering"><h5>Correct {@link FovHVHalves Asymmetric FOV} Rendering</h5></a>
+ * <p>
+ * The {@link StereoClientRenderer} shall render both images for each eye correctly <i>Off-axis</i>
+ * utilizing an asymmetric camera frustum, i.e. by using {@link StereoDevice StereoDevice}'s {@link StereoDevice#getDefaultFOV() default} {@link FovHVHalves}.<br>
+ *
+ * Some references:
+ * <ul>
+ *   <li><a href="https://en.wikipedia.org/wiki/Binocular_vision">Wiki: Binocular Vision</a></li>
+ *   <li><a href="http://paulbourke.net/stereographics/stereorender/">Paul Burke: Stereo Graphics - Stereo Renderer</a></li>
+ *   <li><a href="https://en.wikipedia.org/wiki/Distortion_%28optics%29">Wiki: Distortion (Optics)</a></li>
+ * </ul>
+ * </p>
+ */
+public interface StereoDeviceRenderer {
+    /**
+     * Distortion Bit: Barrel distortion compensating lens pincushion distortion
+     */
+    public static final int DISTORTION_BARREL    = 1 << 0;
+
+    /**
+     * Distortion Bit: Chromatic distortion compensating lens chromatic aberration.
+     */
+    public static final int DISTORTION_CHROMATIC = 1 << 1;
+
+    /**
+     * Distortion Bit: Vignette distortion compensating lens chromatic aberration.
+     */
+    public static final int DISTORTION_VIGNETTE  = 1 << 2;
+
+    /**
+     * Distortion Bit: Timewarp distortion technique to predict
+     *                 {@link EyePose} movement to reduce latency.
+     * <p>
+     * FIXME: Explanation needs refinement!
+     * </p>
+     */
+    public static final int DISTORTION_TIMEWARP  = 1 << 3;
+
+
+    /** Returns the {@link StereoDevice} of this {@link StereoDeviceRenderer} instance. */
+    public StereoDevice getDevice();
+
+    /**
+     * Interface describing one eye of the stereoscopic device,
+     * see {@link StereoDeviceRenderer#getEye(int)}.
+     */
+    public static interface Eye {
+        /**
+         * Returns the viewport for this eye.
+         */
+        public RectangleImmutable getViewport();
+        /**
+         * Returns the {@link EyeParameter} of this eye.
+         */
+        public EyeParameter getEyeParameter();
+        /**
+         * Returns the last {@link EyePose} of this eye.
+         */
+        public EyePose getLastEyePose();
+    }
+
+    /**
+     * Returns the {@link Eye} instance for the denoted <code>eyeNum</code>.
+     */
+    public Eye getEye(final int eyeNum);
+
+    /**
+     * Updates the {@link Eye#getLastEyePose()}
+     * for the denoted <code>eyeNum</code>.
+     */
+    public EyePose updateEyePose(final int eyeNum);
+
+    /**
+     * Returns used distortion compensation bits, e.g. {@link #DISTORTION_BARREL},
+     * in case the stereoscopic display requires such, i.e. in case lenses are utilized.
+     * <p>
+     * Distortion requires {@link #ppAvailable() post-processing}.
+     * </p>
+     */
+    public int getDistortionBits();
+
+    /**
+     * Method returns <code>true</code> if using <i>side-by-side</i> (SBS)
+     * stereoscopic images, otherwise <code>false</code>.
+     * <p>
+     * SBS requires that both eye's images are presented
+     * <i>side-by-side</i> in the final framebuffer.
+     * </p>
+     * <p>
+     * Either the renderer presents the images <i>side-by-side</i> according to the {@link Eye#getViewport() eye's viewport},
+     * or {@link #ppAvailable() post-processing} is utilized to merge {@link #getTextureCount() textures}
+     * to a <i>side-by-side</i> configuration.
+     * </p>
+     */
+    public boolean usesSideBySideStereo();
+
+    /**
+     * Returns the unified surface size of one eye's a single image in pixel units.
+     */
+    public DimensionImmutable getSingleSurfaceSize();
+
+    /**
+     * Returns the total surface size required for the complete images in pixel units.
+     * <p>
+     * If {@link #usesSideBySideStereo()} the total size spans over both {@link #getSingleSurfaceSize()}, side-by-side.
+     * </p>
+     * <p>
+     * Otherwise the size is equal to {@link #getSingleSurfaceSize()}.
+     * </p>
+     */
+    public DimensionImmutable getTotalSurfaceSize();
+
+    /**
+     * Returns the used texture-image count for post-processing, see {@link #ppAvailable()}.
+     * <p>
+     * In case the renderer does not support multiple textures for post-processing,
+     * or no post-processing at all, method returns zero despite the request
+     * from {@link StereoDevice#createRenderer(int, int, float[], com.jogamp.opengl.math.FovHVHalves[], float)}.
+     * </p>
+     */
+    public int getTextureCount();
+
+    /** Returns the desired texture-image unit for post-processing, see {@link #ppAvailable()}. */
+    public int getTextureUnit();
+
+    /** Initialize OpenGL related resources */
+    public void init(final GL gl);
+
+    /** Release all OpenGL related resources */
+    public void dispose(final GL gl);
+
+    /** Notifying that a new frame is about to start. */
+    public void beginFrame(final GL gl);
+
+    /** Notifying that the frame has been rendered completely. */
+    public void endFrame(final GL gl);
+
+    /**
+     * Returns <code>true</code> if stereoscopic post-processing is required and available,
+     * otherwise <code>false</code>.
+     * <p>
+     * Stereoscopic post-processing is available if:
+     * <ul>
+     *   <li>one of the <i>distortion</i> bits are set, see {@link #getDistortionBits()}</li>
+     * </ul>
+     * </p>
+     * <p>
+     * If stereoscopic post-processing is used
+     * the following post-processing methods must be called to before {@link #endFrame()}:
+     * <ul>
+     *   <li>{@link #ppBegin(GL)}</li>
+     *   <li>{@link #ppOneEye(GL, int)} for both eyes</li>
+     *   <li>{@link #ppEnd(GL)}</li>
+     * </ul>
+     * </p>
+     */
+    public boolean ppAvailable();
+
+    /**
+     * Begin stereoscopic post-processing, see {@link #ppAvailable()}.
+     * <p>
+     * {@link #updateEyePose(int)} for both eyes must be called upfront
+     * when rendering upstream {@link StereoGLEventListener}.
+     * </p>
+     *
+     * @param gl
+     */
+    public void ppBegin(final GL gl);
+
+    /**
+     * Performs stereoscopic post-processing for one eye, see {@link #ppAvailable()}.
+     * @param gl
+     * @param eyeNum
+     */
+    public void ppOneEye(final GL gl, final int eyeNum);
+
+    /**
+     * End stereoscopic post-processing, see {@link #ppAvailable()}.
+     * @param gl
+     */
+    public void ppEnd(final GL gl);
+
+}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoGLEventListener.java b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoGLEventListener.java
new file mode 100644
index 0000000..ec580cb
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoGLEventListener.java
@@ -0,0 +1,74 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.util.stereo;
+
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLEventListener;
+
+import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.util.CustomGLEventListener;
+
+/**
+ * Extended {@link GLEventListener} and {@link CustomGLEventListener} interface
+ * supporting stereoscopic client rendering.
+ */
+public interface StereoGLEventListener extends CustomGLEventListener {
+    /**
+     * Stereo capable specialization of {@link #reshape(GLAutoDrawable, int, int, int, int)}
+     * for one {@link StereoDeviceRenderer.Eye}.
+     * <p>
+     * Called by the stereo renderer before each {@link #display(GLAutoDrawable)}
+     * or {@link #display(GLAutoDrawable, int)} call.
+     * </p>
+     * <p>
+     * The client can update it's viewport associated data
+     * and view volume of the window appropriately.
+     * </p>
+     * <p>
+     * The client shall also update it's projection- and modelview matrices according
+     * to the given {@link EyeParameter} and {@link EyePose}.
+     * </p>
+     * <p>
+     * For efficiency the GL viewport has already been updated
+     * via <code>glViewport(x, y, width, height)</code> when this method is called.
+     * </p>
+     *
+     * @param drawable the triggering {@link GLAutoDrawable}
+     * @param x viewport x-coord in pixel units
+     * @param y viewport y-coord in pixel units
+     * @param width viewport width in pixel units
+     * @param height viewport height in pixel units
+     * @param eyeParam constant eye parameter, i.e. FOV and IPD
+     * @param eyePose current eye position and orientation
+     * @see FloatUtil#makePerspective(float[], int, boolean, com.jogamp.opengl.math.FloatUtil.FovHVHalves, float, float)
+     */
+    public void reshapeForEye(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height,
+                              final EyeParameter eyeParam, final EyePose eyePose);
+
+
+}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoUtil.java b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoUtil.java
new file mode 100644
index 0000000..3031013
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/util/stereo/StereoUtil.java
@@ -0,0 +1,125 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.util.stereo;
+
+import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.math.Quaternion;
+import com.jogamp.opengl.math.VectorUtil;
+import com.jogamp.opengl.util.CustomGLEventListener;
+import com.jogamp.opengl.util.stereo.StereoDeviceRenderer.Eye;
+
+public class StereoUtil {
+
+    /** See {@link StereoDeviceRenderer#getDistortionBits()}. */
+    public static boolean usesBarrelDistortion(final int distortionBits) { return 0 != ( distortionBits & StereoDeviceRenderer.DISTORTION_BARREL ) ; }
+    /** See {@link StereoDeviceRenderer#getDistortionBits()}. */
+    public static boolean usesTimewarpDistortion(final int distortionBits) { return 0 != ( distortionBits & StereoDeviceRenderer.DISTORTION_TIMEWARP ) ; }
+    /** See {@link StereoDeviceRenderer#getDistortionBits()}. */
+    public static boolean usesChromaticDistortion(final int distortionBits) { return 0 != ( distortionBits & StereoDeviceRenderer.DISTORTION_CHROMATIC ) ; }
+    /** See {@link StereoDeviceRenderer#getDistortionBits()}. */
+    public static boolean usesVignetteDistortion(final int distortionBits) { return 0 != ( distortionBits & StereoDeviceRenderer.DISTORTION_VIGNETTE ) ; }
+
+    /** See {@link StereoDeviceRenderer#getDistortionBits()}. */
+    public static String distortionBitsToString(final int distortionBits) {
+        boolean appendComma = false;
+        final StringBuilder sb = new StringBuilder();
+        if( usesBarrelDistortion(distortionBits) ) {
+            if( appendComma ) { sb.append(", "); };
+            sb.append("barrel"); appendComma=true;
+        }
+        if( usesVignetteDistortion(distortionBits) ) {
+            if( appendComma ) { sb.append(", "); };
+            sb.append("vignette"); appendComma=true;
+        }
+        if( usesChromaticDistortion(distortionBits) ) {
+            if( appendComma ) { sb.append(", "); };
+            sb.append("chroma"); appendComma=true;
+        }
+        if( usesTimewarpDistortion(distortionBits) ) {
+            if( appendComma ) { sb.append(", "); };
+            sb.append("timewarp"); appendComma=true;
+        }
+        return sb.toString();
+    }
+
+    /**
+     * Calculates the <i>Side By Side</i>, SBS, projection- and modelview matrix for one eye.
+     * <p>
+     * {@link #updateEyePose(int)} must be called upfront.
+     * </p>
+     * <p>
+     * This method merely exist as an example implementation to compute the matrices,
+     * which shall be adopted by the
+     * {@link CustomGLEventListener#reshape(javax.media.opengl.GLAutoDrawable, int, int, int, int, EyeParameter, EyePose) upstream client code}.
+     * </p>
+     * @param eyeNum eye denominator
+     * @param zNear frustum near value
+     * @param zFar frustum far value
+     * @param mat4Projection float[16] projection matrix result
+     * @param mat4Modelview float[16] modelview matrix result
+     */
+    public static void getSBSUpstreamPMV(final Eye eye, final float zNear, final float zFar,
+                                         final float[] mat4Projection, final float[] mat4Modelview) {
+        final float[] mat4Tmp1 = new float[16];
+        final float[] mat4Tmp2 = new float[16];
+        final float[] vec3Tmp1 = new float[3];
+        final float[] vec3Tmp2 = new float[3];
+        final float[] vec3Tmp3 = new float[3];
+
+        final EyeParameter eyeParam = eye.getEyeParameter();
+        final EyePose eyePose = eye.getLastEyePose();
+
+        //
+        // Projection
+        //
+        FloatUtil.makePerspective(mat4Projection, 0, true, eyeParam.fovhv, zNear, zFar);
+
+        //
+        // Modelview
+        //
+        final Quaternion rollPitchYaw = new Quaternion();
+        // private final float eyeYaw = FloatUtil.PI; // 180 degrees in radians
+        // rollPitchYaw.rotateByAngleY(eyeYaw);
+        final float[] shiftedEyePos = rollPitchYaw.rotateVector(vec3Tmp1, 0, eyePose.position, 0);
+        VectorUtil.addVec3(shiftedEyePos, shiftedEyePos, eyeParam.positionOffset);
+
+        rollPitchYaw.mult(eyePose.orientation);
+        final float[] up = rollPitchYaw.rotateVector(vec3Tmp2, 0, VectorUtil.VEC3_UNIT_Y, 0);
+        final float[] forward = rollPitchYaw.rotateVector(vec3Tmp3, 0, VectorUtil.VEC3_UNIT_Z_NEG, 0);
+        final float[] center = VectorUtil.addVec3(forward, shiftedEyePos, forward);
+
+        final float[] mLookAt = FloatUtil.makeLookAt(mat4Tmp2, 0, shiftedEyePos, 0, center, 0, up, 0, mat4Tmp1);
+        final float[] mViewAdjust = FloatUtil.makeTranslation(mat4Modelview, true,
+                                                              eyeParam.distNoseToPupilX,
+                                                              eyeParam.distMiddleToPupilY,
+                                                              eyeParam.eyeReliefZ);
+
+        /* mat4Modelview = */ FloatUtil.multMatrix(mViewAdjust, mLookAt);
+    }
+
+}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java
new file mode 100644
index 0000000..f5ef567
--- /dev/null
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/ImageSequence.java
@@ -0,0 +1,190 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.util.texture;
+
+import java.io.IOException;
+import java.net.URLConnection;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
+
+import com.jogamp.common.util.IOUtil;
+
+/**
+ * Simple {@link TextureSequence} implementation
+ * allowing {@link #addFrame(GL, Texture) existing textures}
+ * or {@link #addFrame(GL, Class, String, String) image streams}
+ * to be used and <i>replayed</i> as {@link TextureSequence.TextureFrame frames}.
+ */
+public class ImageSequence implements TextureSequence {
+    private final int textureUnit;
+    private final boolean useBuildInTexLookup;
+    private final List<TextureSequence.TextureFrame> frames = new ArrayList<TextureSequence.TextureFrame>();
+    private final int[] texMinMagFilter = { GL.GL_NEAREST, GL.GL_NEAREST };
+    private final int[] texWrapST = { GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE };
+    private volatile int frameIdx = 0;
+    private volatile boolean manualStepping = false;
+    private int textureFragmentShaderHashCode = 0;
+
+    public ImageSequence(final int textureUnit, final boolean useBuildInTexLookup) {
+        this.textureUnit = textureUnit;
+        this.useBuildInTexLookup = useBuildInTexLookup;
+    }
+
+    public void setParams(final int magFilter, final int minFilter, final int wrapS, final int wrapT) {
+        texMinMagFilter[0] = minFilter;
+        texMinMagFilter[1] = magFilter;
+        texWrapST[0] = wrapS;
+        texWrapST[1] = wrapT;
+    }
+
+    public final void addFrame(final GL gl, final Texture tex) {
+        final TextureSequence.TextureFrame frame = new TextureSequence.TextureFrame(tex);
+        frames.add(frame);
+        tex.bind(gl);
+        gl.glTexParameteri(getTextureTarget(), GL.GL_TEXTURE_MIN_FILTER, texMinMagFilter[0]);
+        gl.glTexParameteri(getTextureTarget(), GL.GL_TEXTURE_MAG_FILTER, texMinMagFilter[1]);
+        gl.glTexParameteri(getTextureTarget(), GL.GL_TEXTURE_WRAP_S, texWrapST[0]);
+        gl.glTexParameteri(getTextureTarget(), GL.GL_TEXTURE_WRAP_T, texWrapST[1]);
+    }
+
+    public final void addFrame(final GL gl, final Class<?> context, final String imageResourcePath, final String imageSuffix) throws IOException {
+        final URLConnection urlConn = IOUtil.getResource(context, imageResourcePath);
+        if(null != urlConn) {
+            final TextureData texData = TextureIO.newTextureData(GLProfile.getGL2ES2(), urlConn.getInputStream(), false, imageSuffix);
+            final Texture tex = new Texture(getTextureTarget());
+            tex.updateImage(gl, texData);
+            addFrame(gl, tex);
+        }
+    }
+    public final int getFrameCount() { return frames.size(); }
+    public final int getCurrentIdx() { return frameIdx; }
+    public final void setCurrentIdx(final int idx) throws IndexOutOfBoundsException {
+        if( 0 > idx || idx >= frames.size() ) {
+            throw new IndexOutOfBoundsException("idx shall be within 0 <= "+idx+" < "+frames.size());
+        }
+        frameIdx=idx;
+    }
+    public final void setManualStepping(final boolean v) { manualStepping = v; }
+    public final boolean getManualStepping() { return manualStepping; }
+    public final TextureSequence.TextureFrame getFrame(final int idx) { return frames.get(idx); }
+
+    public void destroy(final GL gl) throws GLException {
+        for(int i=frames.size()-1; i>=0; i--) {
+            frames.get(i).getTexture().destroy(gl);
+        }
+        frames.clear();
+    }
+
+    @Override
+    public int getTextureTarget() {
+        return GL.GL_TEXTURE_2D;
+    }
+
+    @Override
+    public int getTextureUnit() {
+        return textureUnit;
+    }
+
+    @Override
+    public int[] getTextureMinMagFilter() {
+        return texMinMagFilter;
+    }
+
+    @Override
+    public int[] getTextureWrapST() {
+        return texWrapST;
+    }
+
+    @Override
+    public boolean isTextureAvailable() { return frames.size() > 0; }
+
+    @Override
+    public TextureSequence.TextureFrame getLastTexture() throws IllegalStateException {
+        return frames.get(frameIdx); // may return null
+    }
+
+    @Override
+    public TextureSequence.TextureFrame getNextTexture(final GL gl) throws IllegalStateException {
+        if( !manualStepping ) {
+            frameIdx = ( frameIdx + 1 ) % frames.size();
+        }
+        return frames.get(frameIdx);
+    }
+
+    @Override
+    public String getRequiredExtensionsShaderStub() throws IllegalStateException {
+        return "// TextTextureSequence: No extensions required\n";
+    }
+
+    @Override
+    public String getTextureSampler2DType() throws IllegalStateException {
+        return "sampler2D" ;
+    }
+
+    private String textureLookupFunctionName = "myTexture2D";
+
+    @Override
+    public String getTextureLookupFunctionName(final String desiredFuncName) throws IllegalStateException {
+        if(useBuildInTexLookup) {
+            return "texture2D";
+        }
+        if(null != desiredFuncName && desiredFuncName.length()>0) {
+            textureLookupFunctionName = desiredFuncName;
+        }
+        return textureLookupFunctionName;
+    }
+
+    @Override
+    public String getTextureLookupFragmentShaderImpl() throws IllegalStateException {
+        if(useBuildInTexLookup) {
+          return "";
+        }
+        return
+          "\n"+
+          "vec4 "+textureLookupFunctionName+"(in "+getTextureSampler2DType()+" image, in vec2 texCoord) {\n"+
+          "  return texture2D(image, texCoord);\n"+
+          "}\n\n";
+    }
+
+    @Override
+    public int getTextureFragmentShaderHashCode() {
+        if( !isTextureAvailable() ) {
+            textureFragmentShaderHashCode = 0;
+            return 0;
+        } else if( 0 == textureFragmentShaderHashCode ) {
+            int hash = 31 + getTextureLookupFragmentShaderImpl().hashCode();
+            hash = ((hash << 5) - hash) + getTextureSampler2DType().hashCode();
+            textureFragmentShaderHashCode = hash;
+        }
+        return textureFragmentShaderHashCode;
+    }
+}
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
index 584cacf..e7693f4 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/Texture.java
@@ -205,22 +205,49 @@ public class Texture {
     private static final boolean disableNPOT    = Debug.isPropertyDefined("jogl.texture.nonpot", true);
     private static final boolean disableTexRect = Debug.isPropertyDefined("jogl.texture.notexrect", true);
 
-    public Texture(GL gl, TextureData data) throws GLException {
+    public Texture(final GL gl, final TextureData data) throws GLException {
         texID = 0;
         updateImage(gl, data);
     }
 
-    // Constructor for use when creating e.g. cube maps, where there is
-    // no initial texture data
-    public Texture(int target) {
+    /**
+     * Constructor for use when creating e.g. cube maps, where there is
+     * no initial texture data
+     * @param target the OpenGL texture target, eg GL.GL_TEXTURE_2D,
+     *               GL2.GL_TEXTURE_RECTANGLE
+     */
+    public Texture(final int target) {
         texID = 0;
         this.target = target;
     }
 
-    // Package-private constructor for creating a texture object which wraps
-    // an existing texture ID from another package
-    Texture(int textureID, int target, int texWidth, int texHeight, int imgWidth, int imgHeight,
-            boolean mustFlipVertically) {
+    /**
+     * Constructor to wrap an OpenGL texture ID from an external library and allows
+     * some of the base methods from the Texture class, such as
+     * binding and querying of texture coordinates, to be used with
+     * it. Attempts to update such textures' contents will yield
+     * undefined results.
+     *
+     * @param textureID the OpenGL texture object to wrap
+     * @param target the OpenGL texture target, eg GL.GL_TEXTURE_2D,
+     *               GL2.GL_TEXTURE_RECTANGLE
+     * @param texWidth the width of the texture in pixels
+     * @param texHeight the height of the texture in pixels
+     * @param imgWidth the width of the image within the texture in
+     *          pixels (if the content is a sub-rectangle in the upper
+     *          left corner); otherwise, pass in texWidth
+     * @param imgHeight the height of the image within the texture in
+     *          pixels (if the content is a sub-rectangle in the upper
+     *          left corner); otherwise, pass in texHeight
+     * @param mustFlipVertically indicates whether the texture
+     *                           coordinates must be flipped vertically
+     *                           in order to properly display the
+     *                           texture
+     */
+    public Texture(final int textureID, final int target,
+                   final int texWidth, final int texHeight,
+                   final int imgWidth, final int imgHeight,
+                   final boolean mustFlipVertically) {
         this.texID = textureID;
         this.target = target;
         this.mustFlipVertically = mustFlipVertically;
@@ -251,7 +278,7 @@ public class Texture {
      * @throws GLException if no OpenGL context was current or if any
      * OpenGL-related errors occurred
      */
-    public void enable(GL gl) throws GLException {
+    public void enable(final GL gl) throws GLException {
         if( !gl.isGLcore() && GLES2.GL_TEXTURE_EXTERNAL_OES != target) {
             gl.glEnable(target);
         }
@@ -278,7 +305,7 @@ public class Texture {
      * @throws GLException if no OpenGL context was current or if any
      * OpenGL-related errors occurred
      */
-    public void disable(GL gl) throws GLException {
+    public void disable(final GL gl) throws GLException {
         if( !gl.isGLcore() && GLES2.GL_TEXTURE_EXTERNAL_OES != target ) {
             gl.glDisable(target);
         }
@@ -298,7 +325,7 @@ public class Texture {
      * @throws GLException if no OpenGL context was current or if any
      * OpenGL-related errors occurred
      */
-    public void bind(GL gl) throws GLException {
+    public void bind(final GL gl) throws GLException {
         validateTexID(gl, true);
         gl.glBindTexture(target, texID);
     }
@@ -308,7 +335,7 @@ public class Texture {
      *
      * @throws GLException if any OpenGL-related errors occurred
      */
-    public void destroy(GL gl) throws GLException {
+    public void destroy(final GL gl) throws GLException {
         if(0!=texID) {
             gl.glDeleteTextures(1, new int[] {texID}, 0);
             texID = 0;
@@ -410,7 +437,7 @@ public class Texture {
      *
      * @return the texture coordinates corresponding to the specified sub-image
      */
-    public TextureCoords getSubImageTexCoords(int x1, int y1, int x2, int y2) {
+    public TextureCoords getSubImageTexCoords(final int x1, final int y1, final int x2, final int y2) {
         if (target == GL2.GL_TEXTURE_RECTANGLE_ARB) {
             if (mustFlipVertically) {
                 return new TextureCoords(x1, texHeight - y1, x2, texHeight - y2);
@@ -418,12 +445,12 @@ public class Texture {
                 return new TextureCoords(x1, y1, x2, y2);
             }
         } else {
-            float tx1 = (float)x1 / (float)texWidth;
-            float ty1 = (float)y1 / (float)texHeight;
-            float tx2 = (float)x2 / (float)texWidth;
-            float ty2 = (float)y2 / (float)texHeight;
+            final float tx1 = (float)x1 / (float)texWidth;
+            final float ty1 = (float)y1 / (float)texHeight;
+            final float tx2 = (float)x2 / (float)texWidth;
+            final float ty2 = (float)y2 / (float)texHeight;
             if (mustFlipVertically) {
-                float yMax = (float) imgHeight / (float) texHeight;
+                final float yMax = (float) imgHeight / (float) texHeight;
                 return new TextureCoords(tx1, yMax - ty1, tx2, yMax - ty2);
             } else {
                 return new TextureCoords(tx1, ty1, tx2, ty2);
@@ -437,7 +464,7 @@ public class Texture {
      *
      * @throws GLException if any OpenGL-related errors occurred
      */
-    public void updateImage(GL gl, TextureData data) throws GLException {
+    public void updateImage(final GL gl, final TextureData data) throws GLException {
         updateImage(gl, data, 0);
     }
 
@@ -460,7 +487,7 @@ public class Texture {
      * No-op if no change, otherwise generates new {@link TextureCoords}.
      * </p>
      */
-    public void setMustFlipVertically(boolean v) {
+    public void setMustFlipVertically(final boolean v) {
         if( v != mustFlipVertically ) {
             mustFlipVertically = v;
             updateTexCoords();
@@ -474,7 +501,7 @@ public class Texture {
      *
      * @throws GLException if any OpenGL-related errors occurred
      */
-    public void updateImage(GL gl, TextureData data, int targetOverride) throws GLException {
+    public void updateImage(final GL gl, final TextureData data, final int targetOverride) throws GLException {
         validateTexID(gl, true);
 
         imgWidth = data.getWidth();
@@ -495,7 +522,7 @@ public class Texture {
         data.setHaveGL12(gl.isExtensionAvailable(GLExtensions.VERSION_1_2));
 
         // Indicates whether both width and height are power of two
-        boolean isPOT = isPowerOfTwo(imgWidth) && isPowerOfTwo(imgHeight);
+        final boolean isPOT = isPowerOfTwo(imgWidth) && isPowerOfTwo(imgHeight);
 
         // Note that automatic mipmap generation doesn't work for
         // GL_ARB_texture_rectangle
@@ -607,7 +634,7 @@ public class Texture {
         }
 
         if (data.getMipmap() && !haveAutoMipmapGeneration) {
-            int[] align = new int[1];
+            final int[] align = new int[1];
             gl.glGetIntegerv(GL.GL_UNPACK_ALIGNMENT, align, 0); // save alignment
             gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, data.getAlignment());
 
@@ -617,7 +644,7 @@ public class Texture {
 
             try {
                 // FIXME: may need check for GLUnsupportedException
-                GLU glu = GLU.createGLU(gl);
+                final GLU glu = GLU.createGLU(gl);
                 glu.gluBuild2DMipmaps(texTarget, data.getInternalFormat(),
                                       data.getWidth(), data.getHeight(),
                                       data.getPixelFormat(), data.getPixelType(), data.getBuffer());
@@ -626,7 +653,7 @@ public class Texture {
             }
         } else {
             checkCompressedTextureExtensions(gl, data);
-            Buffer[] mipmapData = data.getMipmapData();
+            final Buffer[] mipmapData = data.getMipmapData();
             if (mipmapData != null) {
                 int width = texWidth;
                 int height = texHeight;
@@ -657,7 +684,7 @@ public class Texture {
                                                   texWidth, texHeight, data.getBorder(),
                                                   data.getBuffer().capacity(), data.getBuffer());
                     } else {
-                        ByteBuffer buf = DDSImage.allocateBlankBuffer(texWidth,
+                        final ByteBuffer buf = DDSImage.allocateBlankBuffer(texWidth,
                                                                       texHeight,
                                                                       data.getInternalFormat());
                         gl.glCompressedTexImage2D(texTarget, 0, data.getInternalFormat(),
@@ -683,9 +710,9 @@ public class Texture {
             }
         }
 
-        int minFilter = (data.getMipmap() ? GL.GL_LINEAR_MIPMAP_LINEAR : GL.GL_LINEAR);
-        int magFilter = GL.GL_LINEAR;
-        int wrapMode = (gl.isExtensionAvailable(GLExtensions.VERSION_1_2) || !gl.isGL2()) ? GL.GL_CLAMP_TO_EDGE : GL2.GL_CLAMP;
+        final int minFilter = (data.getMipmap() ? GL.GL_LINEAR_MIPMAP_LINEAR : GL.GL_LINEAR);
+        final int magFilter = GL.GL_LINEAR;
+        final int wrapMode = (gl.isExtensionAvailable(GLExtensions.VERSION_1_2) || !gl.isGL2()) ? GL.GL_CLAMP_TO_EDGE : GL2.GL_CLAMP;
 
         // REMIND: figure out what to do for GL_TEXTURE_RECTANGLE_ARB
         if (texTarget != GL2.GL_TEXTURE_RECTANGLE_ARB) {
@@ -693,8 +720,8 @@ public class Texture {
             gl.glTexParameteri(texParamTarget, GL.GL_TEXTURE_MAG_FILTER, magFilter);
             gl.glTexParameteri(texParamTarget, GL.GL_TEXTURE_WRAP_S, wrapMode);
             gl.glTexParameteri(texParamTarget, GL.GL_TEXTURE_WRAP_T, wrapMode);
-            if (this.target == GL2.GL_TEXTURE_CUBE_MAP) {
-                gl.glTexParameteri(texParamTarget, GL2.GL_TEXTURE_WRAP_R, wrapMode);
+            if (this.target == GL.GL_TEXTURE_CUBE_MAP) {
+                gl.glTexParameteri(texParamTarget, GL2ES2.GL_TEXTURE_WRAP_R, wrapMode);
             }
         }
 
@@ -731,7 +758,7 @@ public class Texture {
      *
      * @throws GLException if any OpenGL-related errors occurred
      */
-    public void updateSubImage(GL gl, TextureData data, int mipmapLevel, int x, int y) throws GLException {
+    public void updateSubImage(final GL gl, final TextureData data, final int mipmapLevel, final int x, final int y) throws GLException {
         if (usingAutoMipmapGeneration && mipmapLevel != 0) {
             // When we're using mipmap generation via GL_GENERATE_MIPMAP, we
             // don't need to update other mipmap levels
@@ -771,10 +798,10 @@ public class Texture {
      * @throws GLException if no OpenGL context was current or if any
      * OpenGL-related errors occurred
      */
-    public void updateSubImage(GL gl, TextureData data, int mipmapLevel,
-                               int dstx, int dsty,
-                               int srcx, int srcy,
-                               int width, int height) throws GLException {
+    public void updateSubImage(final GL gl, final TextureData data, final int mipmapLevel,
+                               final int dstx, final int dsty,
+                               final int srcx, final int srcy,
+                               final int width, final int height) throws GLException {
         if (data.isDataCompressed()) {
             throw new GLException("updateSubImage specifying a sub-rectangle is not supported for compressed TextureData");
         }
@@ -796,8 +823,8 @@ public class Texture {
      * @throws GLException if no OpenGL context was current or if any
      * OpenGL-related errors occurred
      */
-    public void setTexParameterf(GL gl, int parameterName,
-                                 float value) {
+    public void setTexParameterf(final GL gl, final int parameterName,
+                                 final float value) {
         bind(gl);
         gl.glTexParameterf(target, parameterName, value);
     }
@@ -809,8 +836,8 @@ public class Texture {
      *
      * @throws GLException if any OpenGL-related errors occurred
      */
-    public void setTexParameterfv(GL gl, int parameterName,
-                                  FloatBuffer params) {
+    public void setTexParameterfv(final GL gl, final int parameterName,
+                                  final FloatBuffer params) {
         bind(gl);
         gl.glTexParameterfv(target, parameterName, params);
     }
@@ -822,8 +849,8 @@ public class Texture {
      *
      * @throws GLException if any OpenGL-related errors occurred
      */
-    public void setTexParameterfv(GL gl, int parameterName,
-                                  float[] params, int params_offset) {
+    public void setTexParameterfv(final GL gl, final int parameterName,
+                                  final float[] params, final int params_offset) {
         bind(gl);
         gl.glTexParameterfv(target, parameterName, params, params_offset);
     }
@@ -838,8 +865,8 @@ public class Texture {
      *
      * @throws GLException if any OpenGL-related errors occurred
      */
-    public void setTexParameteri(GL gl, int parameterName,
-                                 int value) {
+    public void setTexParameteri(final GL gl, final int parameterName,
+                                 final int value) {
         bind(gl);
         gl.glTexParameteri(target, parameterName, value);
     }
@@ -851,8 +878,8 @@ public class Texture {
      *
      * @throws GLException if any OpenGL-related errors occurred
      */
-    public void setTexParameteriv(GL gl, int parameterName,
-                                  IntBuffer params) {
+    public void setTexParameteriv(final GL gl, final int parameterName,
+                                  final IntBuffer params) {
         bind(gl);
         gl.glTexParameteriv(target, parameterName, params);
     }
@@ -864,8 +891,8 @@ public class Texture {
      *
      * @throws GLException if any OpenGL-related errors occurred
      */
-    public void setTexParameteriv(GL gl, int parameterName,
-                                  int[] params, int params_offset) {
+    public void setTexParameteriv(final GL gl, final int parameterName,
+                                  final int[] params, final int params_offset) {
         bind(gl);
         gl.glTexParameteriv(target, parameterName, params, params_offset);
     }
@@ -881,7 +908,7 @@ public class Texture {
      *           otherwise it may be <code>null</code>.
      * @see #getTextureObject()
      */
-    public int getTextureObject(GL gl) {
+    public int getTextureObject(final GL gl) {
         validateTexID(gl, false);
         return texID;
     }
@@ -930,7 +957,7 @@ public class Texture {
      *
      * @return true if the given value is a power of two, false otherwise
      */
-    private static boolean isPowerOfTwo(int val) {
+    private static boolean isPowerOfTwo(final int val) {
         return ((val & (val - 1)) == 0);
     }
 
@@ -942,7 +969,7 @@ public class Texture {
      * @param val the value
      * @return the next power of two
      */
-    private static int nextPowerOfTwo(int val) {
+    private static int nextPowerOfTwo(final int val) {
         int ret = 1;
         while (ret < val) {
             ret <<= 1;
@@ -954,7 +981,7 @@ public class Texture {
      * Updates the actual image dimensions; usually only called from
      * <code>updateImage</code>.
      */
-    private void setImageSize(int width, int height, int target) {
+    private void setImageSize(final int width, final int height, final int target) {
         imgWidth = width;
         imgHeight = height;
         updateTexCoords();
@@ -983,7 +1010,7 @@ public class Texture {
         }
     }
 
-    private void updateSubImageImpl(GL gl, TextureData data, int newTarget, int mipmapLevel,
+    private void updateSubImageImpl(final GL gl, final TextureData data, final int newTarget, final int mipmapLevel,
                                     int dstx, int dsty,
                                     int srcx, int srcy, int width, int height) throws GLException {
         data.setHaveEXTABGR(gl.isExtensionAvailable(GLExtensions.EXT_abgr));
@@ -1054,15 +1081,15 @@ public class Texture {
                                          data.getInternalFormat(),
                                          buffer.remaining(), buffer);
         } else {
-            int[] align = { 0 };
-            int[] rowLength = { 0 };
-            int[] skipRows = { 0 };
-            int[] skipPixels = { 0 };
+            final int[] align = { 0 };
+            final int[] rowLength = { 0 };
+            final int[] skipRows = { 0 };
+            final int[] skipPixels = { 0 };
             gl.glGetIntegerv(GL.GL_UNPACK_ALIGNMENT,   align,      0); // save alignment
             if(gl.isGL2GL3()) {
-                gl.glGetIntegerv(GL2GL3.GL_UNPACK_ROW_LENGTH,  rowLength,  0); // save row length
-                gl.glGetIntegerv(GL2GL3.GL_UNPACK_SKIP_ROWS,   skipRows,   0); // save skipped rows
-                gl.glGetIntegerv(GL2GL3.GL_UNPACK_SKIP_PIXELS, skipPixels, 0); // save skipped pixels
+                gl.glGetIntegerv(GL2ES2.GL_UNPACK_ROW_LENGTH,  rowLength,  0); // save row length
+                gl.glGetIntegerv(GL2ES2.GL_UNPACK_SKIP_ROWS,   skipRows,   0); // save skipped rows
+                gl.glGetIntegerv(GL2ES2.GL_UNPACK_SKIP_PIXELS, skipPixels, 0); // save skipped pixels
             }
             gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, data.getAlignment());
             if (DEBUG && VERBOSE) {
@@ -1075,9 +1102,9 @@ public class Texture {
                 System.out.println("height      = " + height);
             }
             if(gl.isGL2GL3()) {
-                gl.glPixelStorei(GL2GL3.GL_UNPACK_ROW_LENGTH, rowlen);
-                gl.glPixelStorei(GL2GL3.GL_UNPACK_SKIP_ROWS, srcy);
-                gl.glPixelStorei(GL2GL3.GL_UNPACK_SKIP_PIXELS, srcx);
+                gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH, rowlen);
+                gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_ROWS, srcy);
+                gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_PIXELS, srcx);
             } else {
                 if ( rowlen!=0 && rowlen!=width &&
                      srcy!=0 && srcx!=0 ) {
@@ -1091,14 +1118,14 @@ public class Texture {
                                buffer);
             gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT,   align[0]);      // restore alignment
             if(gl.isGL2GL3()) {
-                gl.glPixelStorei(GL2GL3.GL_UNPACK_ROW_LENGTH,  rowLength[0]);  // restore row length
-                gl.glPixelStorei(GL2GL3.GL_UNPACK_SKIP_ROWS,   skipRows[0]);   // restore skipped rows
-                gl.glPixelStorei(GL2GL3.GL_UNPACK_SKIP_PIXELS, skipPixels[0]); // restore skipped pixels
+                gl.glPixelStorei(GL2ES2.GL_UNPACK_ROW_LENGTH,  rowLength[0]);  // restore row length
+                gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_ROWS,   skipRows[0]);   // restore skipped rows
+                gl.glPixelStorei(GL2ES2.GL_UNPACK_SKIP_PIXELS, skipPixels[0]); // restore skipped pixels
             }
         }
     }
 
-    private void checkCompressedTextureExtensions(GL gl, TextureData data) {
+    private void checkCompressedTextureExtensions(final GL gl, final TextureData data) {
         if (data.isDataCompressed()) {
             switch (data.getInternalFormat()) {
             case GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
@@ -1118,10 +1145,10 @@ public class Texture {
         }
     }
 
-    private boolean validateTexID(GL gl, boolean throwException) {
+    private boolean validateTexID(final GL gl, final boolean throwException) {
         if( 0 == texID ) {
             if( null != gl ) {
-                int[] tmp = new int[1];
+                final int[] tmp = new int[1];
                 gl.glGenTextures(1, tmp, 0);
                 texID = tmp[0];
                 if ( 0 == texID && throwException ) {
@@ -1135,22 +1162,22 @@ public class Texture {
     }
 
     // Helper routines for disabling certain codepaths
-    private static boolean haveNPOT(GL gl) {
+    private static boolean haveNPOT(final GL gl) {
         return !disableNPOT && gl.isNPOTTextureAvailable();
     }
 
-    private static boolean haveTexRect(GL gl) {
+    private static boolean haveTexRect(final GL gl) {
         return (!disableTexRect &&
                 TextureIO.isTexRectEnabled() &&
                 gl.isExtensionAvailable(GLExtensions.ARB_texture_rectangle));
     }
 
-    private static boolean preferTexRect(GL gl) {
+    private static boolean preferTexRect(final GL gl) {
         // Prefer GL_ARB_texture_rectangle on ATI hardware on Mac OS X
         // due to software fallbacks
 
         if (NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(false)) {
-            String vendor = gl.glGetString(GL.GL_VENDOR);
+            final String vendor = gl.glGetString(GL.GL_VENDOR);
             if (vendor != null && vendor.startsWith("ATI")) {
                 return true;
             }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
index ba59f89..17fcc70 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureCoords.java
@@ -48,14 +48,14 @@ package com.jogamp.opengl.util.texture;
 
 public class TextureCoords {
     // These represent the lower-left point
-    private float left;
-    private float bottom;
+    private final float left;
+    private final float bottom;
     // These represent the upper-right point
-    private float right;
-    private float top;
+    private final float right;
+    private final float top;
 
-    public TextureCoords(float left, float bottom,
-                         float right, float top) {
+    public TextureCoords(final float left, final float bottom,
+                         final float right, final float top) {
         this.left = left;
         this.bottom = bottom;
         this.right = right;
@@ -70,7 +70,7 @@ public class TextureCoords {
      *   right  top
      * </pre>
      */
-    public float[] getST_LB_RB_LT_RT(float[] d, int d_off, float ss, float ts) {
+    public float[] getST_LB_RB_LT_RT(final float[] d, final int d_off, final float ss, final float ts) {
         d[0+d_off] = left  *ss;  d[1+d_off] = bottom*ts;
         d[2+d_off] = right *ss;  d[3+d_off] = bottom*ts;
         d[4+d_off] = left  *ss;  d[5+d_off] = top   *ts;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
index 5d88a76..5b2e4fc 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureData.java
@@ -41,6 +41,7 @@ import java.nio.Buffer;
 
 import javax.media.opengl.GLProfile;
 
+import com.jogamp.common.nio.Buffers;
 import com.jogamp.opengl.util.GLBuffers;
 import com.jogamp.opengl.util.GLPixelBuffer.GLPixelAttributes;
 
@@ -123,18 +124,18 @@ public class TextureData {
      *   data were invalid, such as requesting mipmap generation for a
      *   compressed texture
      */
-    public TextureData(GLProfile glp,
-                       int internalFormat,
-                       int width,
-                       int height,
-                       int border,
-                       int pixelFormat,
-                       int pixelType,
-                       boolean mipmap,
-                       boolean dataIsCompressed,
-                       boolean mustFlipVertically,
-                       Buffer buffer,
-                       Flusher flusher) throws IllegalArgumentException {
+    public TextureData(final GLProfile glp,
+                       final int internalFormat,
+                       final int width,
+                       final int height,
+                       final int border,
+                       final int pixelFormat,
+                       final int pixelType,
+                       final boolean mipmap,
+                       final boolean dataIsCompressed,
+                       final boolean mustFlipVertically,
+                       final Buffer buffer,
+                       final Flusher flusher) throws IllegalArgumentException {
         this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
              mipmap, dataIsCompressed, mustFlipVertically, buffer, flusher);
     }
@@ -178,17 +179,17 @@ public class TextureData {
      *   data were invalid, such as requesting mipmap generation for a
      *   compressed texture
      */
-    public TextureData(GLProfile glp,
-                       int internalFormat,
-                       int width,
-                       int height,
-                       int border,
-                       GLPixelAttributes pixelAttributes,
-                       boolean mipmap,
-                       boolean dataIsCompressed,
-                       boolean mustFlipVertically,
-                       Buffer buffer,
-                       Flusher flusher) throws IllegalArgumentException {
+    public TextureData(final GLProfile glp,
+                       final int internalFormat,
+                       final int width,
+                       final int height,
+                       final int border,
+                       final GLPixelAttributes pixelAttributes,
+                       final boolean mipmap,
+                       final boolean dataIsCompressed,
+                       final boolean mustFlipVertically,
+                       final Buffer buffer,
+                       final Flusher flusher) throws IllegalArgumentException {
         if (mipmap && dataIsCompressed) {
             throw new IllegalArgumentException("Can not generate mipmaps for compressed textures");
         }
@@ -247,17 +248,17 @@ public class TextureData {
      *   data were invalid, such as requesting mipmap generation for a
      *   compressed texture
      */
-    public TextureData(GLProfile glp,
-                       int internalFormat,
-                       int width,
-                       int height,
-                       int border,
-                       int pixelFormat,
-                       int pixelType,
-                       boolean dataIsCompressed,
-                       boolean mustFlipVertically,
-                       Buffer[] mipmapData,
-                       Flusher flusher) throws IllegalArgumentException {
+    public TextureData(final GLProfile glp,
+                       final int internalFormat,
+                       final int width,
+                       final int height,
+                       final int border,
+                       final int pixelFormat,
+                       final int pixelType,
+                       final boolean dataIsCompressed,
+                       final boolean mustFlipVertically,
+                       final Buffer[] mipmapData,
+                       final Flusher flusher) throws IllegalArgumentException {
         this(glp, internalFormat, width, height, border, new GLPixelAttributes(pixelFormat, pixelType),
              dataIsCompressed, mustFlipVertically, mipmapData, flusher);
     }
@@ -300,16 +301,16 @@ public class TextureData {
      *   data were invalid, such as requesting mipmap generation for a
      *   compressed texture
      */
-    public TextureData(GLProfile glp,
-                       int internalFormat,
-                       int width,
-                       int height,
-                       int border,
-                       GLPixelAttributes pixelAttributes,
-                       boolean dataIsCompressed,
-                       boolean mustFlipVertically,
-                       Buffer[] mipmapData,
-                       Flusher flusher) throws IllegalArgumentException {
+    public TextureData(final GLProfile glp,
+                       final int internalFormat,
+                       final int width,
+                       final int height,
+                       final int border,
+                       final GLPixelAttributes pixelAttributes,
+                       final boolean dataIsCompressed,
+                       final boolean mustFlipVertically,
+                       final Buffer[] mipmapData,
+                       final Flusher flusher) throws IllegalArgumentException {
         this.glProfile = glp;
         this.width = width;
         this.height = height;
@@ -318,7 +319,7 @@ public class TextureData {
         this.internalFormat = internalFormat;
         this.dataIsCompressed = dataIsCompressed;
         this.mustFlipVertically = mustFlipVertically;
-        this.mipmapData = (Buffer[]) mipmapData.clone();
+        this.mipmapData = mipmapData.clone();
         this.flusher = flusher;
         alignment = 1;  // FIXME: is this correct enough in all situations?
         for (int i = 0; i < mipmapData.length; i++) {
@@ -336,10 +337,10 @@ public class TextureData {
      * Set the color space of the pixel data, which defaults to {@link ColorSpace#RGB}.
      * @see #getColorSpace()
      */
-    public void setColorSpace(ColorSpace cs) { pixelCS = cs; }
+    public void setColorSpace(final ColorSpace cs) { pixelCS = cs; }
 
     /** Used only by subclasses */
-    protected TextureData(GLProfile glp) { this.glProfile = glp; this.pixelAttributes = GLPixelAttributes.UNDEF; }
+    protected TextureData(final GLProfile glp) { this.glProfile = glp; this.pixelAttributes = GLPixelAttributes.UNDEF; }
 
     /** Returns the width in pixels of the texture data. */
     public int getWidth() { return width; }
@@ -399,20 +400,20 @@ public class TextureData {
     }
 
     /** Sets the width in pixels of the texture data. */
-    public void setWidth(int width) { this.width = width; }
+    public void setWidth(final int width) { this.width = width; }
     /** Sets the height in pixels of the texture data. */
-    public void setHeight(int height) { this.height = height; }
+    public void setHeight(final int height) { this.height = height; }
     /** Sets the border in pixels of the texture data. */
-    public void setBorder(int border) { this.border = border; }
+    public void setBorder(final int border) { this.border = border; }
     /** Sets the intended OpenGL pixel format of the texture data. */
-    public void setPixelAttributes(GLPixelAttributes pixelAttributes) { this.pixelAttributes = pixelAttributes; }
+    public void setPixelAttributes(final GLPixelAttributes pixelAttributes) { this.pixelAttributes = pixelAttributes; }
     /**
      * Sets the intended OpenGL pixel format component of {@link GLPixelAttributes} of the texture data.
      * <p>
      * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
      * </p>
      */
-    public void setPixelFormat(int pixelFormat) {
+    public void setPixelFormat(final int pixelFormat) {
         if( pixelAttributes.format != pixelFormat ) {
             pixelAttributes = new GLPixelAttributes(pixelFormat, pixelAttributes.type);
         }
@@ -423,42 +424,42 @@ public class TextureData {
      * Use {@link #setPixelAttributes(GLPixelAttributes)}, if setting format and type.
      * </p>
      */
-    public void setPixelType(int pixelType) {
+    public void setPixelType(final int pixelType) {
         if( pixelAttributes.type != pixelType) {
             pixelAttributes = new GLPixelAttributes(pixelAttributes.format, pixelType);
         }
     }
     /** Sets the intended OpenGL internal format of the texture data. */
-    public void setInternalFormat(int internalFormat) { this.internalFormat = internalFormat; }
+    public void setInternalFormat(final int internalFormat) { this.internalFormat = internalFormat; }
     /** Sets whether mipmaps should be generated for the texture data. */
-    public void setMipmap(boolean mipmap) { this.mipmap = mipmap; }
+    public void setMipmap(final boolean mipmap) { this.mipmap = mipmap; }
     /** Sets whether the texture data is in compressed form. */
-    public void setIsDataCompressed(boolean compressed) { this.dataIsCompressed = compressed; }
+    public void setIsDataCompressed(final boolean compressed) { this.dataIsCompressed = compressed; }
     /** Sets whether the texture coordinates must be flipped vertically
         for proper display. */
-    public void setMustFlipVertically(boolean mustFlipVertically) { this.mustFlipVertically = mustFlipVertically; }
+    public void setMustFlipVertically(final boolean mustFlipVertically) { this.mustFlipVertically = mustFlipVertically; }
     /** Sets the texture data. */
-    public void setBuffer(Buffer buffer) {
+    public void setBuffer(final Buffer buffer) {
         this.buffer = buffer;
         estimatedMemorySize = estimatedMemorySize(buffer);
     }
     /** Sets the required byte alignment for the texture data. */
-    public void setAlignment(int alignment) { this.alignment = alignment; }
+    public void setAlignment(final int alignment) { this.alignment = alignment; }
     /** Sets the row length needed for correct GL_UNPACK_ROW_LENGTH
         specification. This is currently only supported for
         non-mipmapped, non-compressed textures. */
-    public void setRowLength(int rowLength) { this.rowLength = rowLength; }
+    public void setRowLength(final int rowLength) { this.rowLength = rowLength; }
     /** Indicates to this TextureData whether the GL_EXT_abgr extension
         is available. Used for optimization along some code paths to
         avoid data copies. */
-    public void setHaveEXTABGR(boolean haveEXTABGR) {
+    public void setHaveEXTABGR(final boolean haveEXTABGR) {
         this.haveEXTABGR = haveEXTABGR;
     }
     /** Indicates to this TextureData whether OpenGL version 1.2 is
         available. If not, falls back to relatively inefficient code
         paths for several input data types (several kinds of packed
         pixel formats, in particular). */
-    public void setHaveGL12(boolean haveGL12) {
+    public void setHaveGL12(final boolean haveGL12) {
         this.haveGL12 = haveGL12;
     }
 
@@ -509,10 +510,10 @@ public class TextureData {
     // Internals only below this point
     //
 
-    protected static int estimatedMemorySize(Buffer buffer) {
+    protected static int estimatedMemorySize(final Buffer buffer) {
         if (buffer == null) {
             return 0;
         }
-        return buffer.capacity() * GLBuffers.sizeOfBufferElem(buffer);
+        return buffer.capacity() * Buffers.sizeOfBufferElem(buffer);
     }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
index 0f64fd0..19f2fc0 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureIO.java
@@ -60,6 +60,7 @@ import javax.media.nativewindow.util.DimensionImmutable;
 import javax.media.nativewindow.util.PixelFormat;
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
+import javax.media.opengl.GL2ES3;
 import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLContext;
 import javax.media.opengl.GLException;
@@ -209,8 +210,8 @@ public class TextureIO {
      *         registered texture providers could read the file
      * @throws IOException if an error occurred while reading the file
      */
-    public static TextureData newTextureData(GLProfile glp, File file,
-                                             boolean mipmap,
+    public static TextureData newTextureData(final GLProfile glp, final File file,
+                                             final boolean mipmap,
                                              String fileSuffix) throws IOException {
         if (fileSuffix == null) {
             fileSuffix = IOUtil.getFileSuffix(file);
@@ -239,9 +240,9 @@ public class TextureIO {
      *         registered texture providers could read the stream
      * @throws IOException if an error occurred while reading the stream
      */
-    public static TextureData newTextureData(GLProfile glp, InputStream stream,
-                                             boolean mipmap,
-                                             String fileSuffix) throws IOException {
+    public static TextureData newTextureData(final GLProfile glp, final InputStream stream,
+                                             final boolean mipmap,
+                                             final String fileSuffix) throws IOException {
         return newTextureDataImpl(glp, stream, 0, 0, mipmap, fileSuffix);
     }
 
@@ -266,8 +267,8 @@ public class TextureIO {
      *         registered texture providers could read the URL
      * @throws IOException if an error occurred while reading the URL
      */
-    public static TextureData newTextureData(GLProfile glp, URL url,
-                                             boolean mipmap,
+    public static TextureData newTextureData(final GLProfile glp, final URL url,
+                                             final boolean mipmap,
                                              String fileSuffix) throws IOException {
         if (fileSuffix == null) {
             fileSuffix = IOUtil.getFileSuffix(url.getPath());
@@ -314,10 +315,10 @@ public class TextureIO {
      *                                  pixelFormat was 0
      * @throws IOException if an error occurred while reading the file
      */
-    public static TextureData newTextureData(GLProfile glp, File file,
-                                             int internalFormat,
-                                             int pixelFormat,
-                                             boolean mipmap,
+    public static TextureData newTextureData(final GLProfile glp, final File file,
+                                             final int internalFormat,
+                                             final int pixelFormat,
+                                             final boolean mipmap,
                                              String fileSuffix) throws IOException, IllegalArgumentException {
         if ((internalFormat == 0) || (pixelFormat == 0)) {
             throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
@@ -362,11 +363,11 @@ public class TextureIO {
      *                                  pixelFormat was 0
      * @throws IOException if an error occurred while reading the stream
      */
-    public static TextureData newTextureData(GLProfile glp, InputStream stream,
-                                             int internalFormat,
-                                             int pixelFormat,
-                                             boolean mipmap,
-                                             String fileSuffix) throws IOException, IllegalArgumentException {
+    public static TextureData newTextureData(final GLProfile glp, final InputStream stream,
+                                             final int internalFormat,
+                                             final int pixelFormat,
+                                             final boolean mipmap,
+                                             final String fileSuffix) throws IOException, IllegalArgumentException {
         if ((internalFormat == 0) || (pixelFormat == 0)) {
             throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
         }
@@ -406,10 +407,10 @@ public class TextureIO {
      *                                  pixelFormat was 0
      * @throws IOException if an error occurred while reading the URL
      */
-    public static TextureData newTextureData(GLProfile glp, URL url,
-                                             int internalFormat,
-                                             int pixelFormat,
-                                             boolean mipmap,
+    public static TextureData newTextureData(final GLProfile glp, final URL url,
+                                             final int internalFormat,
+                                             final int pixelFormat,
+                                             final boolean mipmap,
                                              String fileSuffix) throws IOException, IllegalArgumentException {
         if ((internalFormat == 0) || (pixelFormat == 0)) {
             throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
@@ -435,7 +436,7 @@ public class TextureIO {
      *                     OpenGL error occurred
      * @throws IllegalArgumentException if the passed TextureData was null
      */
-    public static Texture newTexture(TextureData data) throws GLException, IllegalArgumentException {
+    public static Texture newTexture(final TextureData data) throws GLException, IllegalArgumentException {
         return newTexture(GLContext.getCurrentGL(), data);
     }
 
@@ -448,7 +449,7 @@ public class TextureIO {
      *                     OpenGL error occurred
      * @throws IllegalArgumentException if the passed TextureData was null
      */
-    public static Texture newTexture(GL gl, TextureData data) throws GLException, IllegalArgumentException {
+    public static Texture newTexture(final GL gl, final TextureData data) throws GLException, IllegalArgumentException {
         if (data == null) {
             throw new IllegalArgumentException("Null TextureData");
         }
@@ -470,11 +471,11 @@ public class TextureIO {
      * @throws GLException if no OpenGL context is current or if an
      *                     OpenGL error occurred
      */
-    public static Texture newTexture(File file, boolean mipmap) throws IOException, GLException {
-        GL gl = GLContext.getCurrentGL();
-        GLProfile glp = gl.getGLProfile();
-        TextureData data = newTextureData(glp, file, mipmap, IOUtil.getFileSuffix(file));
-        Texture texture = newTexture(gl, data);
+    public static Texture newTexture(final File file, final boolean mipmap) throws IOException, GLException {
+        final GL gl = GLContext.getCurrentGL();
+        final GLProfile glp = gl.getGLProfile();
+        final TextureData data = newTextureData(glp, file, mipmap, IOUtil.getFileSuffix(file));
+        final Texture texture = newTexture(gl, data);
         data.flush();
         return texture;
     }
@@ -499,11 +500,11 @@ public class TextureIO {
      * @throws GLException if no OpenGL context is current or if an
      *                     OpenGL error occurred
      */
-    public static Texture newTexture(InputStream stream, boolean mipmap, String fileSuffix) throws IOException, GLException {
-        GL gl = GLContext.getCurrentGL();
-        GLProfile glp = gl.getGLProfile();
-        TextureData data = newTextureData(glp, stream, mipmap, fileSuffix);
-        Texture texture = newTexture(gl, data);
+    public static Texture newTexture(final InputStream stream, final boolean mipmap, final String fileSuffix) throws IOException, GLException {
+        final GL gl = GLContext.getCurrentGL();
+        final GLProfile glp = gl.getGLProfile();
+        final TextureData data = newTextureData(glp, stream, mipmap, fileSuffix);
+        final Texture texture = newTexture(gl, data);
         data.flush();
         return texture;
     }
@@ -528,14 +529,14 @@ public class TextureIO {
      * @throws GLException if no OpenGL context is current or if an
      *                     OpenGL error occurred
      */
-    public static Texture newTexture(URL url, boolean mipmap, String fileSuffix) throws IOException, GLException {
+    public static Texture newTexture(final URL url, final boolean mipmap, String fileSuffix) throws IOException, GLException {
         if (fileSuffix == null) {
             fileSuffix = IOUtil.getFileSuffix(url.getPath());
         }
-        GL gl = GLContext.getCurrentGL();
-        GLProfile glp = gl.getGLProfile();
-        TextureData data = newTextureData(glp, url, mipmap, fileSuffix);
-        Texture texture = newTexture(gl, data);
+        final GL gl = GLContext.getCurrentGL();
+        final GLProfile glp = gl.getGLProfile();
+        final TextureData data = newTextureData(glp, url, mipmap, fileSuffix);
+        final Texture texture = newTexture(gl, data);
         data.flush();
         return texture;
     }
@@ -549,50 +550,11 @@ public class TextureIO {
      * @param target the OpenGL target type, eg GL.GL_TEXTURE_2D,
      *               GL.GL_TEXTURE_RECTANGLE_ARB
      */
-    public static Texture newTexture(int target) {
+    public static Texture newTexture(final int target) {
         return new Texture(target);
     }
 
     /**
-     * Wraps an OpenGL texture ID from an external library and allows
-     * some of the base methods from the Texture class, such as
-     * binding and querying of texture coordinates, to be used with
-     * it. Attempts to update such textures' contents will yield
-     * undefined results.
-     *
-     * @param textureID the OpenGL texture object to wrap
-     * @param target the OpenGL texture target, eg GL.GL_TEXTURE_2D,
-     *               GL2.GL_TEXTURE_RECTANGLE
-     * @param texWidth the width of the texture in pixels
-     * @param texHeight the height of the texture in pixels
-     * @param imgWidth the width of the image within the texture in
-     *          pixels (if the content is a sub-rectangle in the upper
-     *          left corner); otherwise, pass in texWidth
-     * @param imgHeight the height of the image within the texture in
-     *          pixels (if the content is a sub-rectangle in the upper
-     *          left corner); otherwise, pass in texHeight
-     * @param mustFlipVertically indicates whether the texture
-     *                           coordinates must be flipped vertically
-     *                           in order to properly display the
-     *                           texture
-     */
-    public static Texture newTexture(int textureID,
-                     int target,
-                     int texWidth,
-                     int texHeight,
-                     int imgWidth,
-                     int imgHeight,
-                     boolean mustFlipVertically) {
-    return new Texture(textureID,
-               target,
-               texWidth,
-               texHeight,
-               imgWidth,
-               imgHeight,
-               mustFlipVertically);
-    }
-
-    /**
      * Writes the given texture to a file. The type of the file is
      * inferred from its suffix. An OpenGL context must be current in
      * order to fetch the texture data back from the OpenGL pipeline.
@@ -618,31 +580,31 @@ public class TextureIO {
      * @throws GLException if no OpenGL context was current or an
      *   OpenGL-related error occurred
      */
-    public static void write(Texture texture, File file) throws IOException, GLException {
+    public static void write(final Texture texture, final File file) throws IOException, GLException {
         if (texture.getTarget() != GL.GL_TEXTURE_2D) {
             throw new GLException("Only GL_TEXTURE_2D textures are supported");
         }
 
         // First fetch the texture data
-        GL _gl = GLContext.getCurrentGL();
+        final GL _gl = GLContext.getCurrentGL();
         if (!_gl.isGL2GL3()) {
             throw new GLException("Implementation only supports GL2GL3 (Use GLReadBufferUtil and the TextureData variant), have: " + _gl);
         }
-        GL2GL3 gl = _gl.getGL2();
+        final GL2GL3 gl = _gl.getGL2();
 
         texture.bind(gl);
-        int internalFormat = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_INTERNAL_FORMAT);
-        int width  = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_WIDTH);
-        int height = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_HEIGHT);
-        int border = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_BORDER);
+        final int internalFormat = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2GL3.GL_TEXTURE_INTERNAL_FORMAT);
+        final int width  = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2GL3.GL_TEXTURE_WIDTH);
+        final int height = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2GL3.GL_TEXTURE_HEIGHT);
+        final int border = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_BORDER);
         TextureData data = null;
         if (internalFormat == GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT ||
             internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT1_EXT ||
             internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT3_EXT ||
             internalFormat == GL.GL_COMPRESSED_RGBA_S3TC_DXT5_EXT) {
             // Fetch using glGetCompressedTexImage
-            int size   = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2.GL_TEXTURE_COMPRESSED_IMAGE_SIZE);
-            ByteBuffer res = ByteBuffer.allocate(size);
+            final int size   = glGetTexLevelParameteri(gl, GL.GL_TEXTURE_2D, 0, GL2GL3.GL_TEXTURE_COMPRESSED_IMAGE_SIZE);
+            final ByteBuffer res = ByteBuffer.allocate(size);
             gl.glGetCompressedTexImage(GL.GL_TEXTURE_2D, 0, res);
             data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, internalFormat, GL.GL_UNSIGNED_BYTE,
                                    false, true, true, res, null);
@@ -651,7 +613,7 @@ public class TextureIO {
             int fetchedFormat = 0;
             switch (internalFormat) {
             case GL.GL_RGB:
-            case GL2.GL_BGR:
+            case GL2GL3.GL_BGR:
             case GL.GL_RGB8:
                 bytesPerPixel = 3;
                 fetchedFormat = GL.GL_RGB;
@@ -668,19 +630,19 @@ public class TextureIO {
             }
 
             // Fetch using glGetTexImage
-            int packAlignment  = glGetInteger(gl, GL.GL_PACK_ALIGNMENT);
-            int packRowLength  = glGetInteger(gl, GL2.GL_PACK_ROW_LENGTH);
-            int packSkipRows   = glGetInteger(gl, GL2.GL_PACK_SKIP_ROWS);
-            int packSkipPixels = glGetInteger(gl, GL2.GL_PACK_SKIP_PIXELS);
-            int packSwapBytes  = glGetInteger(gl, GL2.GL_PACK_SWAP_BYTES);
+            final int packAlignment  = glGetInteger(gl, GL.GL_PACK_ALIGNMENT);
+            final int packRowLength  = glGetInteger(gl, GL2ES3.GL_PACK_ROW_LENGTH);
+            final int packSkipRows   = glGetInteger(gl, GL2ES3.GL_PACK_SKIP_ROWS);
+            final int packSkipPixels = glGetInteger(gl, GL2ES3.GL_PACK_SKIP_PIXELS);
+            final int packSwapBytes  = glGetInteger(gl, GL2GL3.GL_PACK_SWAP_BYTES);
 
             gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, 1);
-            gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, 0);
-            gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, 0);
-            gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, 0);
-            gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, 0);
+            gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, 0);
+            gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_ROWS, 0);
+            gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_PIXELS, 0);
+            gl.glPixelStorei(GL2GL3.GL_PACK_SWAP_BYTES, 0);
 
-            ByteBuffer res = ByteBuffer.allocate((width + (2 * border)) *
+            final ByteBuffer res = ByteBuffer.allocate((width + (2 * border)) *
                                                  (height + (2 * border)) *
                                                  bytesPerPixel);
             if (DEBUG) {
@@ -690,10 +652,10 @@ public class TextureIO {
             gl.glGetTexImage(GL.GL_TEXTURE_2D, 0, fetchedFormat, GL.GL_UNSIGNED_BYTE, res);
 
             gl.glPixelStorei(GL.GL_PACK_ALIGNMENT, packAlignment);
-            gl.glPixelStorei(GL2.GL_PACK_ROW_LENGTH, packRowLength);
-            gl.glPixelStorei(GL2.GL_PACK_SKIP_ROWS, packSkipRows);
-            gl.glPixelStorei(GL2.GL_PACK_SKIP_PIXELS, packSkipPixels);
-            gl.glPixelStorei(GL2.GL_PACK_SWAP_BYTES, packSwapBytes);
+            gl.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, packRowLength);
+            gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_ROWS, packSkipRows);
+            gl.glPixelStorei(GL2ES3.GL_PACK_SKIP_PIXELS, packSkipPixels);
+            gl.glPixelStorei(GL2GL3.GL_PACK_SWAP_BYTES, packSwapBytes);
 
             data = new TextureData(gl.getGLProfile(), internalFormat, width, height, border, fetchedFormat, GL.GL_UNSIGNED_BYTE,
                                    false, false, false, res, null);
@@ -707,9 +669,9 @@ public class TextureIO {
         write(data, file);
     }
 
-    public static void write(TextureData data, File file) throws IOException, GLException {
-        for (Iterator<TextureWriter> iter = textureWriters.iterator(); iter.hasNext(); ) {
-            TextureWriter writer = iter.next();
+    public static void write(final TextureData data, final File file) throws IOException, GLException {
+        for (final Iterator<TextureWriter> iter = textureWriters.iterator(); iter.hasNext(); ) {
+            final TextureWriter writer = iter.next();
             if (writer.write(file, data)) {
                 return;
             }
@@ -728,7 +690,7 @@ public class TextureIO {
      * The last provider added, will be the first provider to be tested.
      * </p>
      */
-    public static void addTextureProvider(TextureProvider provider) {
+    public static void addTextureProvider(final TextureProvider provider) {
         // Must always add at the front so the ImageIO provider is last,
         // so we don't accidentally use it instead of a user's possibly
         // more optimal provider
@@ -741,7 +703,7 @@ public class TextureIO {
      * The last provider added, will be the first provider to be tested.
      * </p>
      */
-    public static void addTextureWriter(TextureWriter writer) {
+    public static void addTextureWriter(final TextureWriter writer) {
         // Must always add at the front so the ImageIO writer is last,
         // so we don't accidentally use it instead of a user's possibly
         // more optimal writer
@@ -766,7 +728,7 @@ public class TextureIO {
         the GL_ARB_texture_rectangle extension to be turned off globally
         for this purpose. The default is that the use of the extension
         is enabled. */
-    public static void setTexRectEnabled(boolean enabled) {
+    public static void setTexRectEnabled(final boolean enabled) {
         texRectEnabled = enabled;
     }
 
@@ -789,10 +751,10 @@ public class TextureIO {
         if(GLProfile.isAWTAvailable()) {
             try {
                 // Use reflection to avoid compile-time dependencies on AWT-related classes
-                TextureProvider provider = (TextureProvider)
+                final TextureProvider provider = (TextureProvider)
                     Class.forName("com.jogamp.opengl.util.texture.spi.awt.IIOTextureProvider").newInstance();
                 addTextureProvider(provider);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 if (DEBUG) {
                     e.printStackTrace();
                 }
@@ -810,14 +772,14 @@ public class TextureIO {
         if(GLProfile.isAWTAvailable()) {
             try {
                 // Use reflection to avoid compile-time dependencies on AWT-related classes
-                TextureWriter writer = (TextureWriter)
+                final TextureWriter writer = (TextureWriter)
                     Class.forName("com.jogamp.opengl.util.texture.spi.awt.IIOTextureWriter").newInstance();
                 addTextureWriter(writer);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 if (DEBUG) {
                     e.printStackTrace();
                 }
-            } catch (Error e) {
+            } catch (final Error e) {
                 if (DEBUG) {
                     e.printStackTrace();
                 }
@@ -833,10 +795,10 @@ public class TextureIO {
     }
 
     // Implementation methods
-    private static TextureData newTextureDataImpl(GLProfile glp, File file,
-                                                  int internalFormat,
-                                                  int pixelFormat,
-                                                  boolean mipmap,
+    private static TextureData newTextureDataImpl(final GLProfile glp, final File file,
+                                                  final int internalFormat,
+                                                  final int pixelFormat,
+                                                  final boolean mipmap,
                                                   String fileSuffix) throws IOException {
         if (file == null) {
             throw new IOException("File was null");
@@ -844,9 +806,9 @@ public class TextureIO {
 
         fileSuffix = toLowerCase(fileSuffix);
 
-        for (Iterator<TextureProvider> iter = textureProviders.iterator(); iter.hasNext(); ) {
-            TextureProvider provider = iter.next();
-            TextureData data = provider.newTextureData(glp, file,
+        for (final Iterator<TextureProvider> iter = textureProviders.iterator(); iter.hasNext(); ) {
+            final TextureProvider provider = iter.next();
+            final TextureData data = provider.newTextureData(glp, file,
                                                        internalFormat,
                                                        pixelFormat,
                                                        mipmap,
@@ -859,10 +821,10 @@ public class TextureIO {
         throw new IOException("No suitable reader for given file "+file.getAbsolutePath());
     }
 
-    private static TextureData newTextureDataImpl(GLProfile glp, InputStream stream,
-                                                  int internalFormat,
-                                                  int pixelFormat,
-                                                  boolean mipmap,
+    private static TextureData newTextureDataImpl(final GLProfile glp, InputStream stream,
+                                                  final int internalFormat,
+                                                  final int pixelFormat,
+                                                  final boolean mipmap,
                                                   String fileSuffix) throws IOException {
         if (stream == null) {
             throw new IOException("Stream was null");
@@ -875,9 +837,9 @@ public class TextureIO {
             stream = new BufferedInputStream(stream);
         }
 
-        for (Iterator<TextureProvider> iter = textureProviders.iterator(); iter.hasNext(); ) {
-            TextureProvider provider = iter.next();
-            TextureData data = provider.newTextureData(glp, stream,
+        for (final Iterator<TextureProvider> iter = textureProviders.iterator(); iter.hasNext(); ) {
+            final TextureProvider provider = iter.next();
+            final TextureData data = provider.newTextureData(glp, stream,
                                                        internalFormat,
                                                        pixelFormat,
                                                        mipmap,
@@ -890,10 +852,10 @@ public class TextureIO {
         throw new IOException("No suitable reader for given stream");
     }
 
-    private static TextureData newTextureDataImpl(GLProfile glp, URL url,
-                                                  int internalFormat,
-                                                  int pixelFormat,
-                                                  boolean mipmap,
+    private static TextureData newTextureDataImpl(final GLProfile glp, final URL url,
+                                                  final int internalFormat,
+                                                  final int pixelFormat,
+                                                  final boolean mipmap,
                                                   String fileSuffix) throws IOException {
         if (url == null) {
             throw new IOException("URL was null");
@@ -901,9 +863,9 @@ public class TextureIO {
 
         fileSuffix = toLowerCase(fileSuffix);
 
-        for (Iterator<TextureProvider> iter = textureProviders.iterator(); iter.hasNext(); ) {
-            TextureProvider provider = iter.next();
-            TextureData data = provider.newTextureData(glp, url,
+        for (final Iterator<TextureProvider> iter = textureProviders.iterator(); iter.hasNext(); ) {
+            final TextureProvider provider = iter.next();
+            final TextureData data = provider.newTextureData(glp, url,
                                                        internalFormat,
                                                        pixelFormat,
                                                        mipmap,
@@ -920,14 +882,14 @@ public class TextureIO {
     // DDS provider -- supports files only for now
     static class DDSTextureProvider implements TextureProvider {
         @Override
-        public TextureData newTextureData(GLProfile glp, File file,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
+        public TextureData newTextureData(final GLProfile glp, final File file,
+                                          final int internalFormat,
+                                          final int pixelFormat,
+                                          final boolean mipmap,
+                                          final String fileSuffix) throws IOException {
             if (DDS.equals(fileSuffix) ||
                 DDS.equals(IOUtil.getFileSuffix(file))) {
-                DDSImage image = DDSImage.read(file);
+                final DDSImage image = DDSImage.read(file);
                 return newTextureData(glp, image, internalFormat, pixelFormat, mipmap);
             }
 
@@ -935,16 +897,16 @@ public class TextureIO {
         }
 
         @Override
-        public TextureData newTextureData(GLProfile glp, InputStream stream,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
+        public TextureData newTextureData(final GLProfile glp, final InputStream stream,
+                                          final int internalFormat,
+                                          final int pixelFormat,
+                                          final boolean mipmap,
+                                          final String fileSuffix) throws IOException {
             if (DDS.equals(fileSuffix) ||
                 DDSImage.isDDSImage(stream)) {
-                byte[] data = IOUtil.copyStream2ByteArray(stream);
-                ByteBuffer buf = ByteBuffer.wrap(data);
-                DDSImage image = DDSImage.read(buf);
+                final byte[] data = IOUtil.copyStream2ByteArray(stream);
+                final ByteBuffer buf = ByteBuffer.wrap(data);
+                final DDSImage image = DDSImage.read(buf);
                 return newTextureData(glp, image, internalFormat, pixelFormat, mipmap);
             }
 
@@ -952,12 +914,12 @@ public class TextureIO {
         }
 
         @Override
-        public TextureData newTextureData(GLProfile glp, URL url,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            InputStream stream = new BufferedInputStream(url.openStream());
+        public TextureData newTextureData(final GLProfile glp, final URL url,
+                                          final int internalFormat,
+                                          final int pixelFormat,
+                                          final boolean mipmap,
+                                          final String fileSuffix) throws IOException {
+            final InputStream stream = new BufferedInputStream(url.openStream());
             try {
                 return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix);
             } finally {
@@ -965,11 +927,11 @@ public class TextureIO {
             }
         }
 
-        private TextureData newTextureData(GLProfile glp, final DDSImage image,
+        private TextureData newTextureData(final GLProfile glp, final DDSImage image,
                                            int internalFormat,
                                            int pixelFormat,
                                            boolean mipmap) {
-            DDSImage.ImageInfo info = image.getMipMap(0);
+            final DDSImage.ImageInfo info = image.getMipMap(0);
             if (pixelFormat == 0) {
                 switch (image.getPixelFormat()) {
                 case DDSImage.D3DFMT_R8G8B8:
@@ -1006,7 +968,7 @@ public class TextureIO {
                     break;
                 }
             }
-            TextureData.Flusher flusher = new TextureData.Flusher() {
+            final TextureData.Flusher flusher = new TextureData.Flusher() {
                     @Override
                     public void flush() {
                         image.close();
@@ -1014,7 +976,7 @@ public class TextureIO {
                 };
             TextureData data;
             if (mipmap && image.getNumMipMaps() > 0) {
-                Buffer[] mipmapData = new Buffer[image.getNumMipMaps()];
+                final Buffer[] mipmapData = new Buffer[image.getNumMipMaps()];
                 for (int i = 0; i < image.getNumMipMaps(); i++) {
                     mipmapData[i] = image.getMipMap(i).getData();
                 }
@@ -1052,12 +1014,12 @@ public class TextureIO {
     // Base class for SGI RGB and TGA image providers
     static abstract class StreamBasedTextureProvider implements TextureProvider {
         @Override
-        public TextureData newTextureData(GLProfile glp, File file,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            InputStream inStream = new BufferedInputStream(new FileInputStream(file));
+        public TextureData newTextureData(final GLProfile glp, final File file,
+                                          final int internalFormat,
+                                          final int pixelFormat,
+                                          final boolean mipmap,
+                                          final String fileSuffix) throws IOException {
+            final InputStream inStream = new BufferedInputStream(new FileInputStream(file));
             try {
                 // The SGIImage and TGAImage implementations use InputStreams
                 // anyway so there isn't much point in having a separate code
@@ -1073,12 +1035,12 @@ public class TextureIO {
         }
 
         @Override
-        public TextureData newTextureData(GLProfile glp, URL url,
-                                          int internalFormat,
-                                          int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
-            InputStream stream = new BufferedInputStream(url.openStream());
+        public TextureData newTextureData(final GLProfile glp, final URL url,
+                                          final int internalFormat,
+                                          final int pixelFormat,
+                                          final boolean mipmap,
+                                          final String fileSuffix) throws IOException {
+            final InputStream stream = new BufferedInputStream(url.openStream());
             try {
                 return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix);
             } finally {
@@ -1091,15 +1053,15 @@ public class TextureIO {
     // SGI RGB image provider
     static class SGITextureProvider extends StreamBasedTextureProvider {
         @Override
-        public TextureData newTextureData(GLProfile glp, InputStream stream,
+        public TextureData newTextureData(final GLProfile glp, final InputStream stream,
                                           int internalFormat,
                                           int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
+                                          final boolean mipmap,
+                                          final String fileSuffix) throws IOException {
             if (SGI.equals(fileSuffix) ||
                 SGI_RGB.equals(fileSuffix) ||
                 SGIImage.isSGIImage(stream)) {
-                SGIImage image = SGIImage.read(stream);
+                final SGIImage image = SGIImage.read(stream);
                 if (pixelFormat == 0) {
                     pixelFormat = image.getFormat();
                 }
@@ -1127,13 +1089,13 @@ public class TextureIO {
     // TGA (Targa) image provider
     static class TGATextureProvider extends StreamBasedTextureProvider {
         @Override
-        public TextureData newTextureData(GLProfile glp, InputStream stream,
+        public TextureData newTextureData(final GLProfile glp, final InputStream stream,
                                           int internalFormat,
                                           int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
+                                          final boolean mipmap,
+                                          final String fileSuffix) throws IOException {
             if (TGA.equals(fileSuffix)) {
-                TGAImage image = TGAImage.read(glp, stream);
+                final TGAImage image = TGAImage.read(glp, stream);
                 if (pixelFormat == 0) {
                     pixelFormat = image.getGLFormat();
                 }
@@ -1165,11 +1127,11 @@ public class TextureIO {
     // PNG image provider
     static class PNGTextureProvider extends StreamBasedTextureProvider {
         @Override
-        public TextureData newTextureData(GLProfile glp, InputStream stream,
+        public TextureData newTextureData(final GLProfile glp, final InputStream stream,
                                           int internalFormat,
                                           int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
+                                          final boolean mipmap,
+                                          final String fileSuffix) throws IOException {
             if (PNG.equals(fileSuffix)) {
                 final PNGPixelRect image = PNGPixelRect.read(stream, null, true /* directBuffer */, 0 /* destMinStrideInBytes */, true /* destIsGLOriented */);
                 final GLPixelAttributes glpa = GLPixelAttributes.convert(image.getPixelformat(), glp);
@@ -1205,13 +1167,13 @@ public class TextureIO {
     // JPEG image provider
     static class JPGTextureProvider extends StreamBasedTextureProvider {
         @Override
-        public TextureData newTextureData(GLProfile glp, InputStream stream,
+        public TextureData newTextureData(final GLProfile glp, final InputStream stream,
                                           int internalFormat,
                                           int pixelFormat,
-                                          boolean mipmap,
-                                          String fileSuffix) throws IOException {
+                                          final boolean mipmap,
+                                          final String fileSuffix) throws IOException {
             if (JPG.equals(fileSuffix)) {
-                JPEGImage image = JPEGImage.read(/*glp, */ stream);
+                final JPEGImage image = JPEGImage.read(/*glp, */ stream);
                 if (pixelFormat == 0) {
                     pixelFormat = image.getGLFormat();
                 }
@@ -1244,8 +1206,8 @@ public class TextureIO {
     //
     static class DDSTextureWriter implements TextureWriter {
         @Override
-        public boolean write(File file,
-                             TextureData data) throws IOException {
+        public boolean write(final File file,
+                             final TextureData data) throws IOException {
             if (DDS.equals(IOUtil.getFileSuffix(file))) {
                 // See whether the DDS writer can handle this TextureData
                 final GLPixelAttributes pixelAttribs = data.getPixelAttributes();
@@ -1278,7 +1240,7 @@ public class TextureIO {
                     mipmaps = new ByteBuffer[] { (ByteBuffer) data.getBuffer() };
                 }
 
-                DDSImage image = DDSImage.createFromData(d3dFormat,
+                final DDSImage image = DDSImage.createFromData(d3dFormat,
                                                          data.getWidth(),
                                                          data.getHeight(),
                                                          mipmaps);
@@ -1295,9 +1257,9 @@ public class TextureIO {
     //
     static class SGITextureWriter implements TextureWriter {
         @Override
-        public boolean write(File file,
-                             TextureData data) throws IOException {
-            String fileSuffix = IOUtil.getFileSuffix(file);
+        public boolean write(final File file,
+                             final TextureData data) throws IOException {
+            final String fileSuffix = IOUtil.getFileSuffix(file);
             if (SGI.equals(fileSuffix) ||
                 SGI_RGB.equals(fileSuffix)) {
                 // See whether the SGI writer can handle this TextureData
@@ -1308,7 +1270,7 @@ public class TextureIO {
                      pixelFormat == GL.GL_RGBA) &&
                     (pixelType == GL.GL_BYTE ||
                      pixelType == GL.GL_UNSIGNED_BYTE)) {
-                    ByteBuffer buf = ((data.getBuffer() != null) ?
+                    final ByteBuffer buf = ((data.getBuffer() != null) ?
                                       (ByteBuffer) data.getBuffer() :
                                       (ByteBuffer) data.getMipmapData()[0]);
                     byte[] bytes;
@@ -1321,7 +1283,7 @@ public class TextureIO {
                         buf.rewind();
                     }
 
-                    SGIImage image = SGIImage.createFromData(data.getWidth(),
+                    final SGIImage image = SGIImage.createFromData(data.getWidth(),
                                                              data.getHeight(),
                                                              (pixelFormat == GL.GL_RGBA),
                                                              bytes);
@@ -1341,8 +1303,8 @@ public class TextureIO {
 
     static class TGATextureWriter implements TextureWriter {
         @Override
-        public boolean write(File file,
-                             TextureData data) throws IOException {
+        public boolean write(final File file,
+                             final TextureData data) throws IOException {
             if (TGA.equals(IOUtil.getFileSuffix(file))) {
                 // See whether the TGA writer can handle this TextureData
                 final GLPixelAttributes pixelAttribs = data.getPixelAttributes();
@@ -1350,7 +1312,7 @@ public class TextureIO {
                 final int pixelType   = pixelAttribs.type;
                 if ((pixelFormat == GL.GL_RGB ||
                      pixelFormat == GL.GL_RGBA ||
-                     pixelFormat == GL2.GL_BGR ||
+                     pixelFormat == GL2GL3.GL_BGR ||
                      pixelFormat == GL.GL_BGRA ) &&
                     (pixelType == GL.GL_BYTE ||
                      pixelType == GL.GL_UNSIGNED_BYTE)) {
@@ -1363,16 +1325,16 @@ public class TextureIO {
 
                     if( pixelFormat == GL.GL_RGB || pixelFormat == GL.GL_RGBA ) {
                         // Must reverse order of red and blue channels to get correct results
-                        int skip = ((pixelFormat == GL.GL_RGB) ? 3 : 4);
+                        final int skip = ((pixelFormat == GL.GL_RGB) ? 3 : 4);
                         for (int i = 0; i < buf.remaining(); i += skip) {
-                            byte red  = buf.get(i + 0);
-                            byte blue = buf.get(i + 2);
+                            final byte red  = buf.get(i + 0);
+                            final byte blue = buf.get(i + 2);
                             buf.put(i + 0, blue);
                             buf.put(i + 2, red);
                         }
                     }
 
-                    TGAImage image = TGAImage.createFromData(data.getWidth(),
+                    final TGAImage image = TGAImage.createFromData(data.getWidth(),
                                                              data.getHeight(),
                                                              (pixelFormat == GL.GL_RGBA || pixelFormat == GL.GL_BGRA),
                                                              false, buf);
@@ -1392,7 +1354,7 @@ public class TextureIO {
 
     static class PNGTextureWriter implements TextureWriter {
         @Override
-        public boolean write(File file, TextureData data) throws IOException {
+        public boolean write(final File file, final TextureData data) throws IOException {
             if (PNG.equals(IOUtil.getFileSuffix(file))) {
                 // See whether the PNG writer can handle this TextureData
                 final GLPixelAttributes pixelAttribs = data.getPixelAttributes();
@@ -1442,19 +1404,19 @@ public class TextureIO {
     // Helper routines
     //
 
-    private static int glGetInteger(GL gl, int pname) {
-        int[] tmp = new int[1];
+    private static int glGetInteger(final GL gl, final int pname) {
+        final int[] tmp = new int[1];
         gl.glGetIntegerv(pname, tmp, 0);
         return tmp[0];
     }
 
-    private static int glGetTexLevelParameteri(GL2GL3 gl, int target, int level, int pname) {
-        int[] tmp = new int[1];
+    private static int glGetTexLevelParameteri(final GL2GL3 gl, final int target, final int level, final int pname) {
+        final int[] tmp = new int[1];
         gl.glGetTexLevelParameteriv(target, 0, pname, tmp, 0);
         return tmp[0];
     }
 
-    private static String toLowerCase(String arg) {
+    private static String toLowerCase(final String arg) {
         if (arg == null) {
             return null;
         }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
index ab9d1f8..5add4f6 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureSequence.java
@@ -114,11 +114,11 @@ public interface TextureSequence {
      * to associated related data.
      */
     public static class TextureFrame extends TimeFrameI {
-        public TextureFrame(Texture t, int pts, int duration) {
+        public TextureFrame(final Texture t, final int pts, final int duration) {
             super(pts, duration);
             texture = t;
         }
-        public TextureFrame(Texture t) {
+        public TextureFrame(final Texture t) {
             texture = t;
         }
 
@@ -174,6 +174,12 @@ public interface TextureSequence {
     public int[] getTextureWrapST();
 
     /**
+     * Returns true if texture source is ready <i>and</i> a texture is available
+     * via {@link #getNextTexture(GL)} and {@link #getLastTexture()}.
+     */
+    public boolean isTextureAvailable();
+
+    /**
      * Returns the last updated texture.
      * <p>
      * In case the instance is just initialized, it shall return a <code>TextureFrame</code>
@@ -251,5 +257,24 @@ public interface TextureSequence {
      *
      * @throws IllegalStateException if instance is not initialized
      */
-    public String getTextureLookupFragmentShaderImpl() throws IllegalStateException ;
+    public String getTextureLookupFragmentShaderImpl() throws IllegalStateException;
+
+    /**
+     * Returns the hash code of the strings:
+     * <ul>
+     *   <li>{@link #getTextureLookupFragmentShaderImpl()}</li>
+     *   <li>{@link #getTextureSampler2DType()}</li>
+     * </ul>
+     * <p>
+     * Returns zero if {@link #isTextureAvailable() texture is not available}.
+     * </p>
+     * The returned hash code allows selection of a matching shader program for this {@link TextureSequence} instance.
+     * <p>
+     * </p>
+     * <p>
+     * Implementation shall cache the resulting hash code,
+     * which must be reset to zero if {@link #isTextureAvailable() texture is not available}.
+     * </p>
+     */
+    public int getTextureFragmentShaderHashCode();
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
index d8320c6..467ab41 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/TextureState.java
@@ -53,7 +53,7 @@ public class TextureState {
      * Returns <code>0</code> is <code>textureTarget</code> is not supported.
      * </p>
      */
-    public static final int getTextureTargetQueryName(int textureTarget) {
+    public static final int getTextureTargetQueryName(final int textureTarget) {
         final int texBindQName;
         switch(textureTarget) {
             case GL.GL_TEXTURE_2D: texBindQName = GL.GL_TEXTURE_BINDING_2D; break;
@@ -61,7 +61,7 @@ public class TextureState {
             case GL2ES2.GL_TEXTURE_3D: texBindQName = GL2ES2.GL_TEXTURE_BINDING_3D; break;
             case GL2GL3.GL_TEXTURE_1D: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D; break;
             case GL2GL3.GL_TEXTURE_1D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_1D_ARRAY; break;
-            case GL2GL3.GL_TEXTURE_2D_ARRAY: texBindQName = GL2GL3.GL_TEXTURE_BINDING_2D_ARRAY; break;
+            case GL.GL_TEXTURE_2D_ARRAY: texBindQName = GL.GL_TEXTURE_BINDING_2D_ARRAY; break;
             case GL2GL3.GL_TEXTURE_RECTANGLE: texBindQName = GL2GL3.GL_TEXTURE_BINDING_RECTANGLE; break;
             case GL2GL3.GL_TEXTURE_BUFFER: texBindQName = GL2GL3.GL_TEXTURE_BINDING_BUFFER; break;
             case GL3.GL_TEXTURE_2D_MULTISAMPLE: texBindQName = GL3.GL_TEXTURE_BINDING_2D_MULTISAMPLE; break;
@@ -84,9 +84,9 @@ public class TextureState {
      */
     private final int[] state = new int[] { 0, 0, 0, 0, 0, 0 };
 
-    private static final String toHexString(int i) { return "0x"+Integer.toHexString(i); }
+    private static final String toHexString(final int i) { return "0x"+Integer.toHexString(i); }
 
-    private static final int activeTexture(GL gl) {
+    private static final int activeTexture(final GL gl) {
         final int[] vi = { 0 };
         gl.glGetIntegerv(GL.GL_ACTIVE_TEXTURE, vi, 0);
         return vi[0];
@@ -99,7 +99,7 @@ public class TextureState {
      * @param textureTarget
      * @throws GLException if textureTarget is not supported
      */
-    public TextureState(GL gl, int textureTarget) throws GLException {
+    public TextureState(final GL gl, final int textureTarget) throws GLException {
         this(gl, activeTexture(gl), textureTarget);
     }
 
@@ -111,7 +111,7 @@ public class TextureState {
      * @param textureTarget
      * @throws GLException if textureTarget is not supported
      */
-    public TextureState(GL gl, int textureUnit, int textureTarget) throws GLException {
+    public TextureState(final GL gl, final int textureUnit, final int textureTarget) throws GLException {
         target = textureTarget;
         state[0] = textureUnit;
         final int texBindQName = getTextureTargetQueryName(textureTarget);
@@ -132,7 +132,7 @@ public class TextureState {
      * </p>
      * @param gl current GL context's GL object
      */
-    public final void restore(GL gl) {
+    public final void restore(final GL gl) {
         gl.glActiveTexture(state[0]);
         gl.glBindTexture(target, state[1]);
         gl.glTexParameteri(target, GL.GL_TEXTURE_MAG_FILTER, state[2]);
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
index 202c08e..ccb3ecc 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureData.java
@@ -113,11 +113,11 @@ public class AWTTextureData extends TextureData {
      *                       texture
      * @param image          the image containing the texture data
      */
-    public AWTTextureData(GLProfile glp,
-                          int internalFormat,
-                          int pixelFormat,
-                          boolean mipmap,
-                          BufferedImage image) {
+    public AWTTextureData(final GLProfile glp,
+                          final int internalFormat,
+                          final int pixelFormat,
+                          final boolean mipmap,
+                          final BufferedImage image) {
         super(glp);
         if (internalFormat == 0) {
             this.internalFormat = image.getColorModel().hasAlpha() ? GL.GL_RGBA : GL.GL_RGB;
@@ -176,7 +176,7 @@ public class AWTTextureData extends TextureData {
         return buffer;
     }
 
-    private void createFromImage(GLProfile glp, BufferedImage image) {
+    private void createFromImage(final GLProfile glp, final BufferedImage image) {
         pixelAttributes = GLPixelAttributes.UNDEF; // Determine from image
         mustFlipVertically = true;
 
@@ -185,7 +185,7 @@ public class AWTTextureData extends TextureData {
 
         int scanlineStride;
 
-        SampleModel sm = image.getRaster().getSampleModel();
+        final SampleModel sm = image.getRaster().getSampleModel();
         if (sm instanceof SinglePixelPackedSampleModel) {
             scanlineStride =
                 ((SinglePixelPackedSampleModel)sm).getScanlineStride();
@@ -300,7 +300,7 @@ public class AWTTextureData extends TextureData {
                 case BufferedImage.TYPE_BYTE_INDEXED:
                 case BufferedImage.TYPE_CUSTOM:
                 default:
-                    java.awt.image.ColorModel cm = image.getColorModel();
+                    final java.awt.image.ColorModel cm = image.getColorModel();
                     if (cm.equals(rgbColorModel)) {
                         pixelAttributes = new GLPixelAttributes(GL.GL_RGB, GL.GL_UNSIGNED_BYTE);
                         rowLength = scanlineStride / 3;
@@ -362,7 +362,7 @@ public class AWTTextureData extends TextureData {
                 case BufferedImage.TYPE_BYTE_INDEXED:
                 case BufferedImage.TYPE_CUSTOM:
                 default:
-                    java.awt.image.ColorModel cm = image.getColorModel();
+                    final java.awt.image.ColorModel cm = image.getColorModel();
                     if (cm.equals(rgbColorModel)) {
                         pixelAttributes = new GLPixelAttributes(GL.GL_RGB, GL.GL_UNSIGNED_BYTE);
                         rowLength = scanlineStride / 3;
@@ -382,9 +382,9 @@ public class AWTTextureData extends TextureData {
         createNIOBufferFromImage(image);
     }
 
-    private void setupLazyCustomConversion(BufferedImage image) {
+    private void setupLazyCustomConversion(final BufferedImage image) {
         imageForLazyCustomConversion = image;
-        boolean hasAlpha = image.getColorModel().hasAlpha();
+        final boolean hasAlpha = image.getColorModel().hasAlpha();
         int pixelFormat = pixelAttributes.format;
         int pixelType = pixelAttributes.type;
         if (pixelFormat == 0) {
@@ -395,7 +395,7 @@ public class AWTTextureData extends TextureData {
 
         // Allow previously-selected pixelType (if any) to override that
         // we can infer from the DataBuffer
-        DataBuffer data = image.getRaster().getDataBuffer();
+        final DataBuffer data = image.getRaster().getDataBuffer();
         if (data instanceof DataBufferByte || isPackedInt(image)) {
             // Don't use GL_UNSIGNED_INT for BufferedImage packed int images
             if (pixelType == 0) pixelType = GL.GL_UNSIGNED_BYTE;
@@ -405,7 +405,7 @@ public class AWTTextureData extends TextureData {
             if (pixelType == 0) pixelType = GL.GL_FLOAT;
         } else if (data instanceof DataBufferInt) {
             // FIXME: should we support signed ints?
-            if (pixelType == 0) pixelType = GL2GL3.GL_UNSIGNED_INT;
+            if (pixelType == 0) pixelType = GL.GL_UNSIGNED_INT;
         } else if (data instanceof DataBufferShort) {
             if (pixelType == 0) pixelType = GL.GL_SHORT;
         } else if (data instanceof DataBufferUShort) {
@@ -416,12 +416,12 @@ public class AWTTextureData extends TextureData {
         pixelAttributes = new GLPixelAttributes(pixelFormat, pixelType);
     }
 
-    private void createFromCustom(BufferedImage image) {
-        int width = image.getWidth();
-        int height = image.getHeight();
+    private void createFromCustom(final BufferedImage image) {
+        final int width = image.getWidth();
+        final int height = image.getHeight();
 
         // create a temporary image that is compatible with OpenGL
-        boolean hasAlpha = image.getColorModel().hasAlpha();
+        final boolean hasAlpha = image.getColorModel().hasAlpha();
         java.awt.image.ColorModel cm = null;
         int dataBufferType = image.getRaster().getDataBuffer().getDataType();
         // Don't use integer components for packed int images
@@ -444,13 +444,13 @@ public class AWTTextureData extends TextureData {
             }
         }
 
-        boolean premult = cm.isAlphaPremultiplied();
-        WritableRaster raster =
+        final boolean premult = cm.isAlphaPremultiplied();
+        final WritableRaster raster =
             cm.createCompatibleWritableRaster(width, height);
-        BufferedImage texImage = new BufferedImage(cm, raster, premult, null);
+        final BufferedImage texImage = new BufferedImage(cm, raster, premult, null);
 
         // copy the source image into the temporary image
-        Graphics2D g = texImage.createGraphics();
+        final Graphics2D g = texImage.createGraphics();
         g.setComposite(AlphaComposite.Src);
         g.drawImage(image, 0, 0, null);
         g.dispose();
@@ -459,8 +459,8 @@ public class AWTTextureData extends TextureData {
         createNIOBufferFromImage(texImage);
     }
 
-    private boolean isPackedInt(BufferedImage image) {
-        int imgType = image.getType();
+    private boolean isPackedInt(final BufferedImage image) {
+        final int imgType = image.getType();
         return (imgType == BufferedImage.TYPE_INT_RGB ||
                 imgType == BufferedImage.TYPE_INT_BGR ||
                 imgType == BufferedImage.TYPE_INT_ARGB ||
@@ -476,11 +476,11 @@ public class AWTTextureData extends TextureData {
         setupLazyCustomConversion(imageForLazyCustomConversion);
     }
 
-    private void createNIOBufferFromImage(BufferedImage image) {
+    private void createNIOBufferFromImage(final BufferedImage image) {
         buffer = wrapImageDataBuffer(image);
     }
 
-    private Buffer wrapImageDataBuffer(BufferedImage image) {
+    private Buffer wrapImageDataBuffer(final BufferedImage image) {
         //
         // Note: Grabbing the DataBuffer will defeat Java2D's image
         // management mechanism (as of JDK 5/6, at least).  This shouldn't
@@ -490,7 +490,7 @@ public class AWTTextureData extends TextureData {
         // it could be.
         //
 
-        DataBuffer data = image.getRaster().getDataBuffer();
+        final DataBuffer data = image.getRaster().getDataBuffer();
         if (data instanceof DataBufferByte) {
             return ByteBuffer.wrap(((DataBufferByte) data).getData());
         } else if (data instanceof DataBufferDouble) {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java
index c70f5d0..c3b3adc 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/awt/AWTTextureIO.java
@@ -59,8 +59,8 @@ public class AWTTextureIO extends TextureIO {
      *
      * @see #newTextureData(GLProfile, BufferedImage, boolean)
      */
-    public static TextureData newTextureData(GLProfile glp, BufferedImage image,
-                                             boolean mipmap) {
+    public static TextureData newTextureData(final GLProfile glp, final BufferedImage image,
+                                             final boolean mipmap) {
         return newTextureDataImpl(glp, image, 0, 0, mipmap);
     }
 
@@ -89,10 +89,10 @@ public class AWTTextureIO extends TextureIO {
      * @throws IllegalArgumentException if either internalFormat or
      *                                  pixelFormat was 0
      */
-    public static TextureData newTextureData(GLProfile glp, BufferedImage image,
-                                             int internalFormat,
-                                             int pixelFormat,
-                                             boolean mipmap) throws IllegalArgumentException {
+    public static TextureData newTextureData(final GLProfile glp, final BufferedImage image,
+                                             final int internalFormat,
+                                             final int pixelFormat,
+                                             final boolean mipmap) throws IllegalArgumentException {
         if ((internalFormat == 0) || (pixelFormat == 0)) {
             throw new IllegalArgumentException("internalFormat and pixelFormat must be non-zero");
         }
@@ -112,18 +112,18 @@ public class AWTTextureIO extends TextureIO {
      * @throws GLException if no OpenGL context is current or if an
      *                     OpenGL error occurred
      */
-    public static Texture newTexture(GLProfile glp, BufferedImage image, boolean mipmap) throws GLException {
-        TextureData data = newTextureData(glp, image, mipmap);
-        Texture texture = newTexture(data);
+    public static Texture newTexture(final GLProfile glp, final BufferedImage image, final boolean mipmap) throws GLException {
+        final TextureData data = newTextureData(glp, image, mipmap);
+        final Texture texture = newTexture(data);
         data.flush();
         return texture;
     }
 
-    private static TextureData newTextureDataImpl(GLProfile glp,
-                                                  BufferedImage image,
-                                                  int internalFormat,
-                                                  int pixelFormat,
-                                                  boolean mipmap) {
+    private static TextureData newTextureDataImpl(final GLProfile glp,
+                                                  final BufferedImage image,
+                                                  final int internalFormat,
+                                                  final int pixelFormat,
+                                                  final boolean mipmap) {
         return new AWTTextureData(glp, internalFormat, pixelFormat, mipmap, image);
     }
 }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
index 7311f20..20fc928 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/DDSImage.java
@@ -52,6 +52,7 @@ import java.nio.channels.FileChannel;
 
 import javax.media.opengl.GL;
 
+import com.jogamp.common.nio.Buffers;
 import com.jogamp.common.util.IOUtil;
 import com.jogamp.opengl.util.GLBuffers;
 
@@ -67,13 +68,13 @@ public class DDSImage {
         that information in another way. */
 
     public static class ImageInfo {
-        private ByteBuffer data;
-        private int width;
-        private int height;
-        private boolean isCompressed;
-        private int compressionFormat;
+        private final ByteBuffer data;
+        private final int width;
+        private final int height;
+        private final boolean isCompressed;
+        private final int compressionFormat;
 
-        public ImageInfo(ByteBuffer data, int width, int height, boolean compressed, int compressionFormat) {
+        public ImageInfo(final ByteBuffer data, final int width, final int height, final boolean compressed, final int compressionFormat) {
             this.data = data; this.width = width; this.height = height;
             this.isCompressed = compressed; this.compressionFormat = compressionFormat;
         }
@@ -163,7 +164,7 @@ public class DDSImage {
         @return DDS image object
         @throws java.io.IOException if an I/O exception occurred
     */
-    public static DDSImage read(String filename) throws IOException {
+    public static DDSImage read(final String filename) throws IOException {
         return read(new File(filename));
     }
 
@@ -174,8 +175,8 @@ public class DDSImage {
         @return DDS image object
         @throws java.io.IOException if an I/O exception occurred
     */
-    public static DDSImage read(File file) throws IOException {
-        DDSImage image = new DDSImage();
+    public static DDSImage read(final File file) throws IOException {
+        final DDSImage image = new DDSImage();
         image.readFromFile(file);
         return image;
     }
@@ -187,8 +188,8 @@ public class DDSImage {
         @return DDS image object
         @throws java.io.IOException if an I/O exception occurred
     */
-    public static DDSImage read(ByteBuffer buf) throws IOException {
-        DDSImage image = new DDSImage();
+    public static DDSImage read(final ByteBuffer buf) throws IOException {
+        final DDSImage image = new DDSImage();
         image.readFromBuffer(buf);
         return image;
     }
@@ -207,7 +208,7 @@ public class DDSImage {
                 fis = null;
             }
             buf = null;
-        } catch (IOException e) {
+        } catch (final IOException e) {
             e.printStackTrace();
         }
     }
@@ -228,11 +229,11 @@ public class DDSImage {
      *   specified arguments
      * @return DDS image object
      */
-    public static DDSImage createFromData(int d3dFormat,
-                                          int width,
-                                          int height,
-                                          ByteBuffer[] mipmapData) throws IllegalArgumentException {
-        DDSImage image = new DDSImage();
+    public static DDSImage createFromData(final int d3dFormat,
+                                          final int width,
+                                          final int height,
+                                          final ByteBuffer[] mipmapData) throws IllegalArgumentException {
+        final DDSImage image = new DDSImage();
         image.initFromData(d3dFormat, width, height, mipmapData);
         return image;
     }
@@ -256,7 +257,7 @@ public class DDSImage {
         in.mark(4);
         int magic = 0;
         for (int i = 0; i < 4; i++) {
-            int tmp = in.read();
+            final int tmp = in.read();
             if (tmp < 0) {
                 in.reset();
                 return false;
@@ -272,7 +273,7 @@ public class DDSImage {
      * @param filename File name to write to
      * @throws java.io.IOException if an I/O exception occurred
      */
-    public void write(String filename) throws IOException {
+    public void write(final String filename) throws IOException {
         write(new File(filename));
     }
 
@@ -281,12 +282,12 @@ public class DDSImage {
      * @param file File object to write to
      * @throws java.io.IOException if an I/O exception occurred
      */
-    public void write(File file) throws IOException {
-        FileOutputStream stream = IOUtil.getFileOutputStream(file, true);
-        FileChannel chan = stream.getChannel();
+    public void write(final File file) throws IOException {
+        final FileOutputStream stream = IOUtil.getFileOutputStream(file, true);
+        final FileChannel chan = stream.getChannel();
         // Create ByteBuffer for header in case the start of our
         // ByteBuffer isn't actually memory-mapped
-        ByteBuffer hdr = ByteBuffer.allocate(Header.writtenSize());
+        final ByteBuffer hdr = ByteBuffer.allocate(Header.writtenSize());
         hdr.order(ByteOrder.LITTLE_ENDIAN);
         header.write(hdr);
         hdr.rewind();
@@ -302,12 +303,12 @@ public class DDSImage {
      * @param flag DDSD_* flags set to test
      * @return true if flag present or false otherwise
      */
-    public boolean isSurfaceDescFlagSet(int flag) {
+    public boolean isSurfaceDescFlagSet(final int flag) {
         return ((header.flags & flag) != 0);
     }
 
     /** Test for presence/absence of pixel format flags (DDPF_*) */
-    public boolean isPixelFormatFlagSet(int flag) {
+    public boolean isPixelFormatFlagSet(final int flag) {
         return ((header.pfFlags & flag) != 0);
     }
 
@@ -357,7 +358,7 @@ public class DDSImage {
      * @param side Side to test
      * @return true if side present or false otherwise
      */
-    public boolean isCubemapSidePresent(int side) {
+    public boolean isCubemapSidePresent(final int side) {
         return isCubemap() && (header.ddsCaps2 & side) != 0;
     }
 
@@ -402,7 +403,7 @@ public class DDSImage {
      * @param map Mipmap index
      * @return Image object
      */
-    public ImageInfo getMipMap(int map) {
+    public ImageInfo getMipMap(final int map) {
         return getMipMap( 0, map );
     }
 
@@ -412,7 +413,7 @@ public class DDSImage {
      * @param map Mipmap index
      * @return Image object
      */
-    public ImageInfo getMipMap(int side, int map) {
+    public ImageInfo getMipMap(final int side, final int map) {
         if (!isCubemap() && (side != 0)) {
             throw new RuntimeException( "Illegal side for 2D texture: " + side );
         }
@@ -434,7 +435,7 @@ public class DDSImage {
         }
         buf.limit(seek + mipMapSizeInBytes(map));
         buf.position(seek);
-        ByteBuffer next = buf.slice();
+        final ByteBuffer next = buf.slice();
         buf.position(0);
         buf.limit(buf.capacity());
         return new ImageInfo(next, mipMapWidth(map), mipMapHeight(map), isCompressed(), getCompressionFormat());
@@ -454,12 +455,12 @@ public class DDSImage {
      * @param side Cubemap side or 0 for 2D texture
      * @return Mipmap image objects set
      */
-    public ImageInfo[] getAllMipMaps( int side ) {
+    public ImageInfo[] getAllMipMaps( final int side ) {
         int numLevels = getNumMipMaps();
         if (numLevels == 0) {
             numLevels = 1;
         }
-        ImageInfo[] result = new ImageInfo[numLevels];
+        final ImageInfo[] result = new ImageInfo[numLevels];
         for (int i = 0; i < numLevels; i++) {
             result[i] = getMipMap(side, i);
         }
@@ -472,9 +473,9 @@ public class DDSImage {
         @return String format code
     */
     public static String getCompressionFormatName(int compressionFormat) {
-        StringBuilder buf = new StringBuilder();
+        final StringBuilder buf = new StringBuilder();
         for (int i = 0; i < 4; i++) {
-            char c = (char) (compressionFormat & 0xFF);
+            final char c = (char) (compressionFormat & 0xFF);
             buf.append(c);
             compressionFormat = compressionFormat >> 8;
         }
@@ -491,9 +492,9 @@ public class DDSImage {
         GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, or
         GL_COMPRESSED_RGBA_S3TC_DXT5_EXT.
     */
-    public static ByteBuffer allocateBlankBuffer(int width,
-                                                 int height,
-                                                 int openGLInternalFormat) {
+    public static ByteBuffer allocateBlankBuffer(final int width,
+                                                 final int height,
+                                                 final int openGLInternalFormat) {
         int size = width * height;
         switch (openGLInternalFormat) {
         case GL.GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
@@ -511,15 +512,15 @@ public class DDSImage {
         }
         if (size == 0)
             size = 1;
-        return GLBuffers.newDirectByteBuffer(size);
+        return Buffers.newDirectByteBuffer(size);
     }
 
     public void debugPrint() {
-        PrintStream tty = System.err;
+        final PrintStream tty = System.err;
         tty.println("Compressed texture: " + isCompressed());
         if (isCompressed()) {
-            int fmt = getCompressionFormat();
-            String name = getCompressionFormatName(fmt);
+            final int fmt = getCompressionFormat();
+            final String name = getCompressionFormatName(fmt);
             tty.println("Compression format: 0x" + Integer.toHexString(fmt) + " (" + name + ")");
         }
         tty.println("Width: " + header.width + " Height: " + header.height);
@@ -567,7 +568,7 @@ public class DDSImage {
         tty.println("Raw pixel format flags: 0x" + Integer.toHexString(header.pfFlags));
         tty.println("Depth: " + getDepth());
         tty.println("Number of mip maps: " + getNumMipMaps());
-        int fmt = getPixelFormat();
+        final int fmt = getPixelFormat();
         tty.print("Pixel format: ");
         switch (fmt) {
         case D3DFMT_R8G8B8:   tty.println("D3DFMT_R8G8B8"); break;
@@ -629,8 +630,8 @@ public class DDSImage {
         int ddsCapsReserved2;
         int textureStage;           // stage in multitexture cascade
 
-        void read(ByteBuffer buf) throws IOException {
-            int magic                     = buf.getInt();
+        void read(final ByteBuffer buf) throws IOException {
+            final int magic                     = buf.getInt();
             if (magic != MAGIC) {
                 throw new IOException("Incorrect magic number 0x" +
                                       Integer.toHexString(magic) +
@@ -671,7 +672,7 @@ public class DDSImage {
         }
 
         // buf must be in little-endian byte order
-        void write(ByteBuffer buf) {
+        void write(final ByteBuffer buf) {
             buf.putInt(MAGIC);
             buf.putInt(size);
             buf.putInt(flags);
@@ -722,15 +723,15 @@ public class DDSImage {
     private DDSImage() {
     }
 
-    private void readFromFile(File file) throws IOException {
+    private void readFromFile(final File file) throws IOException {
         fis = new FileInputStream(file);
         chan = fis.getChannel();
-        ByteBuffer buf = chan.map(FileChannel.MapMode.READ_ONLY,
+        final ByteBuffer buf = chan.map(FileChannel.MapMode.READ_ONLY,
                                   0, (int) file.length());
         readFromBuffer(buf);
     }
 
-    private void readFromBuffer(ByteBuffer buf) throws IOException {
+    private void readFromBuffer(final ByteBuffer buf) throws IOException {
         this.buf = buf;
         buf.order(ByteOrder.LITTLE_ENDIAN);
         header = new Header();
@@ -738,10 +739,10 @@ public class DDSImage {
         fixupHeader();
     }
 
-    private void initFromData(int d3dFormat,
-                              int width,
-                              int height,
-                              ByteBuffer[] mipmapData) throws IllegalArgumentException {
+    private void initFromData(final int d3dFormat,
+                              final int width,
+                              final int height,
+                              final ByteBuffer[] mipmapData) throws IllegalArgumentException {
         // Check size of mipmap data compared against format, width and
         // height
         int topmostMipmapSize = width * height;
@@ -784,7 +785,7 @@ public class DDSImage {
 
         // OK, create one large ByteBuffer to hold all of the mipmap data
         totalSize += Header.writtenSize();
-        ByteBuffer buf = ByteBuffer.allocate(totalSize);
+        final ByteBuffer buf = ByteBuffer.allocate(totalSize);
         buf.position(Header.writtenSize());
         for (int i = 0; i < mipmapData.length; i++) {
             buf.put(mipmapData[i]);
@@ -845,10 +846,10 @@ public class DDSImage {
         }
     }
 
-    private static int computeCompressedBlockSize(int width,
-                                                  int height,
-                                                  int depth,
-                                                  int compressionFormat) {
+    private static int computeCompressedBlockSize(final int width,
+                                                  final int height,
+                                                  final int depth,
+                                                  final int compressionFormat) {
         int blockSize = ((width + 3)/4) * ((height + 3)/4) * ((depth + 3)/4);
         switch (compressionFormat) {
         case D3DFMT_DXT1:  blockSize *=  8; break;
@@ -857,10 +858,10 @@ public class DDSImage {
         return blockSize;
     }
 
-    private static int computeBlockSize(int width,
-                                        int height,
-                                        int depth,
-                                        int pixelFormat) {
+    private static int computeBlockSize(final int width,
+                                        final int height,
+                                        final int depth,
+                                        final int pixelFormat) {
         int blocksize;
         switch (pixelFormat) {
         case D3DFMT_R8G8B8:
@@ -883,7 +884,7 @@ public class DDSImage {
         return blocksize;
     }
 
-    private int mipMapWidth(int map) {
+    private int mipMapWidth(final int map) {
         int width = getWidth();
         for (int i = 0; i < map; i++) {
             width >>= 1;
@@ -891,7 +892,7 @@ public class DDSImage {
         return Math.max(width, 1);
     }
 
-    private int mipMapHeight(int map) {
+    private int mipMapHeight(final int map) {
         int height = getHeight();
         for (int i = 0; i < map; i++) {
             height >>= 1;
@@ -899,11 +900,11 @@ public class DDSImage {
         return Math.max(height, 1);
     }
 
-    private int mipMapSizeInBytes(int map) {
-        int width  = mipMapWidth(map);
-        int height = mipMapHeight(map);
+    private int mipMapSizeInBytes(final int map) {
+        final int width  = mipMapWidth(map);
+        final int height = mipMapHeight(map);
         if (isCompressed()) {
-            int blockSize = (getCompressionFormat() == D3DFMT_DXT1 ? 8 : 16);
+            final int blockSize = (getCompressionFormat() == D3DFMT_DXT1 ? 8 : 16);
             return ((width+3)/4)*((height+3)/4)*blockSize;
         } else {
             return width * height * (getDepth() / 8);
@@ -924,8 +925,8 @@ public class DDSImage {
         return size;
     }
 
-    private int sideShiftInBytes(int side) {
-        int[] sides = {
+    private int sideShiftInBytes(final int side) {
+        final int[] sides = {
             DDSCAPS2_CUBEMAP_POSITIVEX,
             DDSCAPS2_CUBEMAP_NEGATIVEX,
             DDSCAPS2_CUBEMAP_POSITIVEY,
@@ -935,9 +936,9 @@ public class DDSImage {
         };
 
         int shift = 0;
-        int sideSize = sideSizeInBytes();
+        final int sideSize = sideSizeInBytes();
         for (int i = 0; i < sides.length; i++) {
-            int temp = sides[i];
+            final int temp = sides[i];
             if ((temp & side) != 0) {
                 return shift;
             }
@@ -948,7 +949,7 @@ public class DDSImage {
         throw new RuntimeException("Illegal side: " + side);
     }
 
-    private boolean printIfRecognized(PrintStream tty, int flags, int flag, String what) {
+    private boolean printIfRecognized(final PrintStream tty, final int flags, final int flag, final String what) {
         if ((flags & flag) != 0) {
             tty.println(what);
             return true;
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
index 2081788..66a486f 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/JPEGImage.java
@@ -51,12 +51,12 @@ public class JPEGImage {
      * @return
      * @throws IOException
      */
-    public static JPEGImage read(InputStream in, ColorSpace cs) throws IOException {
+    public static JPEGImage read(final InputStream in, final ColorSpace cs) throws IOException {
         return new JPEGImage(in, cs);
     }
 
     /** Reads a JPEG image from the specified InputStream, using the {@link ColorSpace#RGB}. */
-    public static JPEGImage read(InputStream in) throws IOException {
+    public static JPEGImage read(final InputStream in) throws IOException {
         return new JPEGImage(in, ColorSpace.RGB);
     }
 
@@ -68,7 +68,7 @@ public class JPEGImage {
         final ColorSpace storageCS;
         ByteBuffer data = null;
 
-        JPEGColorSink(ColorSpace storageCM) {
+        JPEGColorSink(final ColorSpace storageCM) {
             this.storageCS = storageCM;
             switch(storageCS) {
             case RGB:
@@ -81,7 +81,7 @@ public class JPEGImage {
         }
 
         @Override
-        public final ColorSpace allocate(int width, int height, ColorSpace sourceCM, int sourceComponents) throws RuntimeException {
+        public final ColorSpace allocate(final int width, final int height, final ColorSpace sourceCM, final int sourceComponents) throws RuntimeException {
             this.width = width;
             this.height = height;
             this.sourceComponents = sourceComponents;
@@ -91,7 +91,7 @@ public class JPEGImage {
         }
 
         @Override
-        public final void storeRGB(int x, int y, byte r, byte g, byte b) {
+        public final void storeRGB(final int x, final int y, final byte r, final byte g, final byte b) {
             int i = ( ( height - y - 1 ) * width + x ) * storageComponents;
             data.put(i++, r);
             data.put(i++, g);
@@ -100,12 +100,12 @@ public class JPEGImage {
         }
 
         @Override
-        public final void store2(int x, int y, byte c1, byte c2) {
+        public final void store2(final int x, final int y, final byte c1, final byte c2) {
             throw new RuntimeException("not supported yet");
         }
 
         @Override
-        public final void storeYCbCr(int x, int y, byte Y, byte Cb, byte Cr) {
+        public final void storeYCbCr(final int x, final int y, final byte Y, final byte Cb, final byte Cr) {
             int i = ( ( height - y - 1 ) * width + x ) * storageComponents;
             data.put(i++, Y);
             data.put(i++, Cb);
@@ -118,7 +118,7 @@ public class JPEGImage {
         }
     };
 
-    private JPEGImage(InputStream in, ColorSpace cs) throws IOException {
+    private JPEGImage(final InputStream in, final ColorSpace cs) throws IOException {
         pixelStorage = new JPEGColorSink(cs);
         final JPEGDecoder decoder = new JPEGDecoder();
         decoder.parse(in);
@@ -139,9 +139,9 @@ public class JPEGImage {
         }
         decoder.clear(null);
     }
-    private JPEGColorSink pixelStorage;
+    private final JPEGColorSink pixelStorage;
     private final int pixelWidth, pixelHeight, glFormat, bytesPerPixel;
-    private boolean reversedChannels;
+    private final boolean reversedChannels;
     private final ByteBuffer data;
 
     /** Returns the color space of the pixel data */
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
index 3c90d96..772df72 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataInputStream.java
@@ -76,7 +76,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
      */
     DataInputStream    dataIn;
 
-    public LEDataInputStream(InputStream in)
+    public LEDataInputStream(final InputStream in)
     {
         super(in);
         dataIn = new DataInputStream(in);
@@ -90,32 +90,32 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
     }
 
     @Override
-    public synchronized    final int read(byte    b[]) throws    IOException
+    public synchronized    final int read(final byte    b[]) throws    IOException
     {
         return dataIn.read(b, 0, b.length);
     }
 
     @Override
-    public synchronized    final int read(byte    b[], int off, int len) throws IOException
+    public synchronized    final int read(final byte    b[], final int off, final int len) throws IOException
     {
-        int    rl = dataIn.read(b,    off, len);
+        final int    rl = dataIn.read(b,    off, len);
         return rl;
     }
 
     @Override
-    public final void readFully(byte b[]) throws IOException
+    public final void readFully(final byte b[]) throws IOException
     {
         dataIn.readFully(b,    0, b.length);
     }
 
     @Override
-    public final void readFully(byte b[], int off, int len)    throws IOException
+    public final void readFully(final byte b[], final int off, final int len)    throws IOException
     {
         dataIn.readFully(b,    off, len);
     }
 
     @Override
-    public final int skipBytes(int n) throws IOException
+    public final int skipBytes(final int n) throws IOException
     {
         return dataIn.skipBytes(n);
     }
@@ -123,7 +123,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
     @Override
     public final boolean readBoolean() throws IOException
     {
-        int    ch = dataIn.read();
+        final int    ch = dataIn.read();
         if (ch < 0)
             throw new EOFException();
         return (ch != 0);
@@ -132,7 +132,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
     @Override
     public final byte readByte() throws    IOException
     {
-        int    ch = dataIn.read();
+        final int    ch = dataIn.read();
         if (ch < 0)
             throw new EOFException();
         return (byte)(ch);
@@ -141,7 +141,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
     @Override
     public final int readUnsignedByte()    throws IOException
     {
-        int    ch = dataIn.read();
+        final int    ch = dataIn.read();
         if (ch < 0)
             throw new EOFException();
         return ch;
@@ -150,8 +150,8 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
     @Override
     public final short readShort() throws IOException
     {
-        int    ch1    = dataIn.read();
-        int    ch2    = dataIn.read();
+        final int    ch1    = dataIn.read();
+        final int    ch2    = dataIn.read();
         if ((ch1 | ch2)    < 0)
             throw new EOFException();
         return (short)((ch1    << 0) +    (ch2 <<    8));
@@ -160,8 +160,8 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
     @Override
     public final int readUnsignedShort() throws    IOException
     {
-        int    ch1    = dataIn.read();
-        int    ch2    = dataIn.read();
+        final int    ch1    = dataIn.read();
+        final int    ch2    = dataIn.read();
         if ((ch1 | ch2)    < 0)
             throw new EOFException();
         return (ch1    << 0) +    (ch2 <<    8);
@@ -170,8 +170,8 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
     @Override
     public final char readChar() throws    IOException
     {
-        int    ch1    = dataIn.read();
-        int    ch2    = dataIn.read();
+        final int    ch1    = dataIn.read();
+        final int    ch2    = dataIn.read();
         if ((ch1 | ch2)    < 0)
             throw new EOFException();
         return (char)((ch1 << 0) + (ch2    << 8));
@@ -180,10 +180,10 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
     @Override
     public final int readInt() throws IOException
     {
-        int    ch1    = dataIn.read();
-        int    ch2    = dataIn.read();
-        int    ch3    = dataIn.read();
-        int    ch4    = dataIn.read();
+        final int    ch1    = dataIn.read();
+        final int    ch2    = dataIn.read();
+        final int    ch3    = dataIn.read();
+        final int    ch4    = dataIn.read();
         if ((ch1 | ch2 | ch3 | ch4)    < 0)
             throw new EOFException();
         return ((ch1 <<    0) + (ch2 << 8)    + (ch3 << 16) +    (ch4 <<    24));
@@ -192,9 +192,9 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
     @Override
     public final long readLong() throws    IOException
     {
-        int    i1 = readInt();
-        int    i2 = readInt();
-        return ((long)i1 & 0xFFFFFFFFL) + ((long)i2 << 32);
+        final int    i1 = readInt();
+        final int    i2 = readInt();
+        return (i1 & 0xFFFFFFFFL) + ((long)i2 << 32);
     }
 
     @Override
@@ -216,7 +216,7 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
     @Override
     public final String    readLine() throws IOException
     {
-        return new String();
+        return "";
     }
 
     /**
@@ -226,16 +226,16 @@ public class LEDataInputStream extends FilterInputStream implements DataInput
     @Override
     public final String    readUTF() throws IOException
     {
-        return new String();
+        return "";
     }
 
     /**
      * dont call this it is not implemented
      * @return empty new string
      **/
-    public final static    String readUTF(DataInput in) throws    IOException
+    public final static    String readUTF(final DataInput in) throws    IOException
     {
-        return new String();
+        return "";
     }
 }
 
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
index 93b0975..add1775 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/LEDataOutputStream.java
@@ -72,7 +72,7 @@ public class LEDataOutputStream extends FilterOutputStream implements DataOutput
      */
     DataOutputStream dataOut;
 
-    public LEDataOutputStream(OutputStream out)
+    public LEDataOutputStream(final OutputStream out)
     {
         super(out);
         dataOut = new DataOutputStream(out);
@@ -86,44 +86,44 @@ public class LEDataOutputStream extends FilterOutputStream implements DataOutput
     }
 
     @Override
-    public synchronized final void write(byte b[]) throws IOException
+    public synchronized final void write(final byte b[]) throws IOException
     {
         dataOut.write(b, 0, b.length);
     }
 
     @Override
-    public synchronized final void write(byte b[], int off, int len) throws IOException
+    public synchronized final void write(final byte b[], final int off, final int len) throws IOException
     {
         dataOut.write(b, off, len);
     }
 
     @Override
-    public final void write(int b) throws IOException
+    public final void write(final int b) throws IOException
     {
         dataOut.write(b);
     }
 
     @Override
-    public final void writeBoolean(boolean v) throws IOException
+    public final void writeBoolean(final boolean v) throws IOException
     {
         dataOut.writeBoolean(v);
     }
 
     @Override
-    public final void writeByte(int v) throws IOException
+    public final void writeByte(final int v) throws IOException
     {
         dataOut.writeByte(v);
     }
 
     /** Don't call this -- not implemented */
     @Override
-    public final void writeBytes(String s) throws IOException
+    public final void writeBytes(final String s) throws IOException
     {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public final void writeChar(int v) throws IOException
+    public final void writeChar(final int v) throws IOException
     {
         dataOut.writeChar(((v >> 8) & 0xff) |
                           ((v & 0xff) << 8));
@@ -131,25 +131,25 @@ public class LEDataOutputStream extends FilterOutputStream implements DataOutput
 
     /** Don't call this -- not implemented */
     @Override
-    public final void writeChars(String s) throws IOException
+    public final void writeChars(final String s) throws IOException
     {
         throw new UnsupportedOperationException();
     }
 
     @Override
-    public final void writeDouble(double v) throws IOException
+    public final void writeDouble(final double v) throws IOException
     {
         writeLong(Double.doubleToRawLongBits(v));
     }
 
     @Override
-    public final void writeFloat(float v) throws IOException
+    public final void writeFloat(final float v) throws IOException
     {
         writeInt(Float.floatToRawIntBits(v));
     }
 
     @Override
-    public final void writeInt(int v) throws IOException
+    public final void writeInt(final int v) throws IOException
     {
         dataOut.writeInt((v >>> 24) |
                          ((v >>> 8) & 0xff00) |
@@ -158,14 +158,14 @@ public class LEDataOutputStream extends FilterOutputStream implements DataOutput
     }
 
     @Override
-    public final void writeLong(long v) throws IOException
+    public final void writeLong(final long v) throws IOException
     {
         writeInt((int) v);
         writeInt((int) (v >>> 32));
     }
 
     @Override
-    public final void writeShort(int v) throws IOException
+    public final void writeShort(final int v) throws IOException
     {
         dataOut.writeShort(((v >> 8) & 0xff) |
                            ((v & 0xff) << 8));
@@ -173,7 +173,7 @@ public class LEDataOutputStream extends FilterOutputStream implements DataOutput
 
     /** Don't call this -- not implemented */
     @Override
-    public final void writeUTF(String s) throws IOException
+    public final void writeUTF(final String s) throws IOException
     {
         throw new UnsupportedOperationException();
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
index cabf4eb..461ddce 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/NetPbmTextureWriter.java
@@ -63,7 +63,7 @@ public class NetPbmTextureWriter implements TextureWriter {
      *   magic 7 - PAM binary RGB or RGBA
      * </pre>
      */
-    public NetPbmTextureWriter(int magic) {
+    public NetPbmTextureWriter(final int magic) {
         switch(magic) {
             case 0:
             case 6:
@@ -85,7 +85,7 @@ public class NetPbmTextureWriter implements TextureWriter {
     public String getSuffix() { return (magic==6)?PPM:PAM; }
 
     @Override
-    public boolean write(File file, TextureData data) throws IOException {
+    public boolean write(final File file, final TextureData data) throws IOException {
         boolean res;
         final int magic_old = magic;
 
@@ -107,12 +107,12 @@ public class NetPbmTextureWriter implements TextureWriter {
         return res;
     }
 
-    private boolean writeImpl(File file, TextureData data) throws IOException {
+    private boolean writeImpl(final File file, final TextureData data) throws IOException {
         int pixelFormat = data.getPixelFormat();
         final int pixelType   = data.getPixelType();
         if ((pixelFormat == GL.GL_RGB ||
              pixelFormat == GL.GL_RGBA ||
-             pixelFormat == GL2.GL_BGR ||
+             pixelFormat == GL2GL3.GL_BGR ||
              pixelFormat == GL.GL_BGRA ) &&
             (pixelType == GL.GL_BYTE ||
              pixelType == GL.GL_UNSIGNED_BYTE)) {
@@ -123,13 +123,13 @@ public class NetPbmTextureWriter implements TextureWriter {
             }
             buf.rewind();
 
-            int comps = ( pixelFormat == GL.GL_RGBA || pixelFormat == GL.GL_BGRA ) ? 4 : 3 ;
+            final int comps = ( pixelFormat == GL.GL_RGBA || pixelFormat == GL.GL_BGRA ) ? 4 : 3 ;
 
-            if( pixelFormat == GL2.GL_BGR || pixelFormat == GL.GL_BGRA ) {
+            if( pixelFormat == GL2GL3.GL_BGR || pixelFormat == GL.GL_BGRA ) {
                 // Must reverse order of red and blue channels to get correct results
                 for (int i = 0; i < buf.remaining(); i += comps) {
-                    byte red  = buf.get(i + 0);
-                    byte blue = buf.get(i + 2);
+                    final byte red  = buf.get(i + 0);
+                    final byte blue = buf.get(i + 2);
                     buf.put(i + 0, blue);
                     buf.put(i + 2, red);
                 }
@@ -141,9 +141,9 @@ public class NetPbmTextureWriter implements TextureWriter {
                 throw new IOException("NetPbmTextureWriter magic 6 (PPM) doesn't RGBA pixel format, use magic 7 (PAM)");
             }
 
-            FileOutputStream fos = IOUtil.getFileOutputStream(file, true);
+            final FileOutputStream fos = IOUtil.getFileOutputStream(file, true);
 
-            StringBuilder header = new StringBuilder();
+            final StringBuilder header = new StringBuilder();
             header.append("P");
             header.append(magic);
             header.append("\n");
@@ -173,7 +173,7 @@ public class NetPbmTextureWriter implements TextureWriter {
 
             fos.write(header.toString().getBytes());
 
-            FileChannel fosc = fos.getChannel();
+            final FileChannel fosc = fos.getChannel();
             fosc.write(buf);
             fosc.force(true);
             fosc.close();
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
index cbc8e65..27549df 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/SGIImage.java
@@ -54,7 +54,7 @@ import com.jogamp.common.util.IOUtil;
 */
 
 public class SGIImage {
-    private Header header;
+    private final Header header;
     private int    format;
     private byte[] data;
     // Used for decoding RLE-compressed images
@@ -105,7 +105,7 @@ public class SGIImage {
             magic = MAGIC;
         }
 
-        Header(DataInputStream in) throws IOException {
+        Header(final DataInputStream in) throws IOException {
             magic      = in.readShort();
             storage    = in.readByte();
             bpc        = in.readByte();
@@ -116,13 +116,13 @@ public class SGIImage {
             pixmin     = in.readInt();
             pixmax     = in.readInt();
             dummy      = in.readInt();
-            byte[] tmpname = new byte[80];
+            final byte[] tmpname = new byte[80];
             in.read(tmpname);
             int numChars = 0;
             while (tmpname[numChars++] != 0);
             imagename  = new String(tmpname, 0, numChars);
             colormap   = in.readInt();
-            byte[] tmp = new byte[404];
+            final byte[] tmp = new byte[404];
             in.read(tmp);
         }
 
@@ -142,21 +142,21 @@ public class SGIImage {
         }
     }
 
-    private SGIImage(Header header) {
+    private SGIImage(final Header header) {
         this.header = header;
     }
 
     /** Reads an SGI image from the specified file. */
-    public static SGIImage read(String filename) throws IOException {
+    public static SGIImage read(final String filename) throws IOException {
         return read(new FileInputStream(filename));
     }
 
     /** Reads an SGI image from the specified InputStream. */
-    public static SGIImage read(InputStream in) throws IOException {
-        DataInputStream dIn = new DataInputStream(new BufferedInputStream(in));
+    public static SGIImage read(final InputStream in) throws IOException {
+        final DataInputStream dIn = new DataInputStream(new BufferedInputStream(in));
 
-        Header header = new Header(dIn);
-        SGIImage res = new SGIImage(header);
+        final Header header = new Header(dIn);
+        final SGIImage res = new SGIImage(header);
         res.decodeImage(dIn);
         return res;
     }
@@ -164,28 +164,28 @@ public class SGIImage {
     /** Writes this SGIImage to the specified file name. If
         flipVertically is set, outputs the scanlines from top to bottom
         rather than the default bottom to top order. */
-    public void write(String filename, boolean flipVertically) throws IOException {
+    public void write(final String filename, final boolean flipVertically) throws IOException {
         write(new File(filename), flipVertically);
     }
 
     /** Writes this SGIImage to the specified file. If flipVertically is
         set, outputs the scanlines from top to bottom rather than the
         default bottom to top order. */
-    public void write(File file, boolean flipVertically) throws IOException {
+    public void write(final File file, final boolean flipVertically) throws IOException {
         writeImage(file, data, header.xsize, header.ysize, header.zsize, flipVertically);
     }
 
     /** Creates an SGIImage from the specified data in either RGB or
         RGBA format. */
-    public static SGIImage createFromData(int width,
-                                          int height,
-                                          boolean hasAlpha,
-                                          byte[] data) {
-        Header header = new Header();
+    public static SGIImage createFromData(final int width,
+                                          final int height,
+                                          final boolean hasAlpha,
+                                          final byte[] data) {
+        final Header header = new Header();
         header.xsize = (short) width;
         header.ysize = (short) height;
         header.zsize = (short) (hasAlpha ? 4 : 3);
-        SGIImage image = new SGIImage(header);
+        final SGIImage image = new SGIImage(header);
         image.data = data;
         return image;
     }
@@ -201,9 +201,9 @@ public class SGIImage {
         if (!in.markSupported()) {
             throw new IOException("Can not test non-destructively whether given InputStream is an SGI RGB image");
         }
-        DataInputStream dIn = new DataInputStream(in);
+        final DataInputStream dIn = new DataInputStream(in);
         dIn.mark(4);
-        short magic = dIn.readShort();
+        final short magic = dIn.readShort();
         dIn.reset();
         return (magic == MAGIC);
     }
@@ -236,10 +236,10 @@ public class SGIImage {
     // Internals only below this point
     //
 
-    private void decodeImage(DataInputStream in) throws IOException {
+    private void decodeImage(final DataInputStream in) throws IOException {
         if (header.storage == 1) {
             // Read RLE compression data; row starts and sizes
-            int x = header.ysize * header.zsize;
+            final int x = header.ysize * header.zsize;
             rowStart = new int[x];
             rowSize  = new int[x];
             rleEnd   = 4 * 2 * x + 512;
@@ -253,16 +253,16 @@ public class SGIImage {
         }
         tmpData = readAll(in);
 
-        int xsize = header.xsize;
-        int ysize = header.ysize;
-        int zsize = header.zsize;
+        final int xsize = header.xsize;
+        final int ysize = header.ysize;
+        final int zsize = header.zsize;
         int lptr  = 0;
 
         data = new byte[xsize * ysize * 4];
-        byte[] rbuf = new byte[xsize];
-        byte[] gbuf = new byte[xsize];
-        byte[] bbuf = new byte[xsize];
-        byte[] abuf = new byte[xsize];
+        final byte[] rbuf = new byte[xsize];
+        final byte[] gbuf = new byte[xsize];
+        final byte[] bbuf = new byte[xsize];
+        final byte[] abuf = new byte[xsize];
         for (int y = 0; y < ysize; y++) {
             if (zsize >= 4) {
                 getRow(rbuf, y, 0);
@@ -293,15 +293,15 @@ public class SGIImage {
         header.zsize = 4;
     }
 
-    private void getRow(byte[] buf, int y, int z) {
+    private void getRow(final byte[] buf, final int y, final int z) {
         if (header.storage == 1) {
-            int offs = rowStart[y + z * header.ysize] - rleEnd;
+            final int offs = rowStart[y + z * header.ysize] - rleEnd;
             System.arraycopy(tmpData, offs, tmpRead, 0, rowSize[y + z * header.ysize]);
             int iPtr = 0;
             int oPtr = 0;
             for (;;) {
                 byte pixel = tmpRead[iPtr++];
-                int count = (int) (pixel & 0x7F);
+                int count = pixel & 0x7F;
                 if (count == 0) {
                     return;
                 }
@@ -317,12 +317,12 @@ public class SGIImage {
                 }
             }
         } else {
-            int offs = (y * header.xsize) + (z * header.xsize * header.ysize);
+            final int offs = (y * header.xsize) + (z * header.xsize * header.ysize);
             System.arraycopy(tmpData, offs, buf, 0, header.xsize);
         }
     }
 
-    private void bwtorgba(byte[] b, byte[] dest, int lptr) {
+    private void bwtorgba(final byte[] b, final byte[] dest, final int lptr) {
         for (int i = 0; i < b.length; i++) {
             dest[4 * i + lptr + 0] = b[i];
             dest[4 * i + lptr + 1] = b[i];
@@ -331,7 +331,7 @@ public class SGIImage {
         }
     }
 
-    private void latorgba(byte[] b, byte[] a, byte[] dest, int lptr) {
+    private void latorgba(final byte[] b, final byte[] a, final byte[] dest, final int lptr) {
         for (int i = 0; i < b.length; i++) {
             dest[4 * i + lptr + 0] = b[i];
             dest[4 * i + lptr + 1] = b[i];
@@ -340,7 +340,7 @@ public class SGIImage {
         }
     }
 
-    private void rgbtorgba(byte[] r, byte[] g, byte[] b, byte[] dest, int lptr) {
+    private void rgbtorgba(final byte[] r, final byte[] g, final byte[] b, final byte[] dest, final int lptr) {
         for (int i = 0; i < b.length; i++) {
             dest[4 * i + lptr + 0] = r[i];
             dest[4 * i + lptr + 1] = g[i];
@@ -349,7 +349,7 @@ public class SGIImage {
         }
     }
 
-    private void rgbatorgba(byte[] r, byte[] g, byte[] b, byte[] a, byte[] dest, int lptr) {
+    private void rgbatorgba(final byte[] r, final byte[] g, final byte[] b, final byte[] a, final byte[] dest, final int lptr) {
         for (int i = 0; i < b.length; i++) {
             dest[4 * i + lptr + 0] = r[i];
             dest[4 * i + lptr + 1] = g[i];
@@ -358,19 +358,19 @@ public class SGIImage {
         }
     }
 
-    private static byte imgref(byte[] i,
-                               int x,
-                               int y,
-                               int z,
-                               int xs,
-                               int ys,
-                               int zs) {
+    private static byte imgref(final byte[] i,
+                               final int x,
+                               final int y,
+                               final int z,
+                               final int xs,
+                               final int ys,
+                               final int zs) {
         return i[(xs*ys*z)+(xs*y)+x];
     }
 
 
-    private void writeHeader(DataOutputStream stream,
-                             int xsize, int ysize, int zsize, boolean rle) throws IOException {
+    private void writeHeader(final DataOutputStream stream,
+                             final int xsize, final int ysize, final int zsize, final boolean rle) throws IOException {
         // effects: outputs the 512-byte IRIS RGB header to STREAM, using xsize,
         //          ysize, and depth as the dimensions of the image. NOTE that
         //          the following defaults are used:
@@ -415,14 +415,14 @@ public class SGIImage {
             stream.write(0);
     }
 
-    private void writeImage(File file,
+    private void writeImage(final File file,
                             byte[] data,
-                            int xsize,
-                            int ysize,
-                            int zsize,
-                            boolean yflip) throws IOException {
+                            final int xsize,
+                            final int ysize,
+                            final int zsize,
+                            final boolean yflip) throws IOException {
         // Input data is in RGBRGBRGB or RGBARGBARGBA format; first unswizzle it
-        byte[] tmpData = new byte[xsize * ysize * zsize];
+        final byte[] tmpData = new byte[xsize * ysize * zsize];
         int dest = 0;
         for (int i = 0; i < zsize; i++) {
             for (int j = i; j < (xsize * ysize * zsize); j += zsize) {
@@ -447,8 +447,8 @@ public class SGIImage {
         //          x axis).
 
         // Build the offset tables
-        int[] starttab  = new int[ysize * zsize];
-        int[] lengthtab = new int[ysize * zsize];
+        final int[] starttab  = new int[ysize * zsize];
+        final int[] lengthtab = new int[ysize * zsize];
 
         // Temporary buffer for holding RLE data.
         // Note that this makes the assumption that RLE-compressed data will
@@ -459,8 +459,8 @@ public class SGIImage {
         // empirical evidence here; the break-even point seems to be a look-
         // ahead of 3. (That is, if the three values following this one are all
         // the same as the current value, switch to repeat mode.)
-        int lookahead = 3;
-        byte[] rlebuf = new byte[2 * xsize * ysize * zsize];
+        final int lookahead = 3;
+        final byte[] rlebuf = new byte[2 * xsize * ysize * zsize];
 
         int cur_loc = 0;   // current offset location.
         int ptr = 0;
@@ -475,7 +475,7 @@ public class SGIImage {
             yincr = -1;
         }
 
-        boolean DEBUG = false;
+        final boolean DEBUG = false;
 
         for (int z = 0; z < zsize; z++) {
             for (int y = ystart; y != yend; y += yincr) {
@@ -485,7 +485,7 @@ public class SGIImage {
                 byte count = 0;
                 boolean repeat_mode = false;
                 boolean should_switch = false;
-                int start_ptr = ptr;
+                final int start_ptr = ptr;
                 int num_ptr = ptr++;
                 byte repeat_val = 0;
 
@@ -566,7 +566,7 @@ public class SGIImage {
                     x++;
                 }
                 // output this row's length into the length table
-                int rowlen = ptr - start_ptr;
+                final int rowlen = ptr - start_ptr;
                 if (yflip)
                     lengthtab[ysize*z+(ysize-y-1)] = rowlen;
                 else
@@ -587,11 +587,11 @@ public class SGIImage {
         if (DEBUG)
             System.err.println("total_size was " + total_size);
 
-        DataOutputStream stream = new DataOutputStream(new BufferedOutputStream(IOUtil.getFileOutputStream(file, true)));
+        final DataOutputStream stream = new DataOutputStream(new BufferedOutputStream(IOUtil.getFileOutputStream(file, true)));
 
         writeHeader(stream, xsize, ysize, zsize, true);
 
-        int SIZEOF_INT = 4;
+        final int SIZEOF_INT = 4;
         for (int i = 0; i < (ysize * zsize); i++)
             stream.writeInt(starttab[i] + 512 + (2 * ysize * zsize * SIZEOF_INT));
         for (int i = 0; i < (ysize * zsize); i++)
@@ -602,7 +602,7 @@ public class SGIImage {
         stream.close();
     }
 
-    private byte[] readAll(DataInputStream in) throws IOException {
+    private byte[] readAll(final DataInputStream in) throws IOException {
         byte[] dest = new byte[16384];
         int pos = 0;
         int numRead = 0;
@@ -613,7 +613,7 @@ public class SGIImage {
             numRead = in.read(dest, pos, dest.length - pos);
             if (pos == dest.length) {
                 // Resize destination buffer
-                byte[] newDest = new byte[2 * dest.length];
+                final byte[] newDest = new byte[2 * dest.length];
                 System.arraycopy(dest, 0, newDest, 0, pos);
                 dest = newDest;
             }
@@ -626,7 +626,7 @@ public class SGIImage {
 
         // Trim destination buffer
         if (pos != dest.length) {
-            byte[] finalDest = new byte[pos];
+            final byte[] finalDest = new byte[pos];
             System.arraycopy(dest, 0, finalDest, 0, pos);
             dest = finalDest;
         }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
index 15cd63e..28823ab 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/TGAImage.java
@@ -71,12 +71,12 @@ import com.jogamp.common.util.IOUtil;
  */
 
 public class TGAImage {
-    private Header header;
+    private final Header header;
     private int    format;
     private int    bpp;
     private ByteBuffer data;
 
-    private TGAImage(Header header) {
+    private TGAImage(final Header header) {
         this.header = header;
     }
 
@@ -114,7 +114,7 @@ public class TGAImage {
         public final static int I_FOURWAY = 2;
 
         /** Type of this TGA file format */
-        private int tgaType;
+        private final int tgaType;
 
         /** initial TGA image data fields */
         private int idLength;         // byte value
@@ -142,7 +142,7 @@ public class TGAImage {
             tgaType = TYPE_OLD; // dont try and get footer.
         }
 
-        Header(LEDataInputStream in) throws IOException {
+        Header(final LEDataInputStream in) throws IOException {
             tgaType = TYPE_OLD; // dont try and get footer.
 
             // initial header fields
@@ -220,24 +220,24 @@ public class TGAImage {
         public int size() { return 18 + idLength; }
 
         // buf must be in little-endian byte order
-        private void write(ByteBuffer buf) {
+        private void write(final ByteBuffer buf) {
             buf.put((byte) idLength);
             buf.put((byte) colorMapType);
             buf.put((byte) imageType);
             buf.putShort((short) firstEntryIndex);
             buf.putShort((short) colorMapLength);
-            buf.put((byte) colorMapEntrySize);
+            buf.put(colorMapEntrySize);
             buf.putShort((short) xOrigin);
             buf.putShort((short) yOrigin);
             buf.putShort((short) width);
             buf.putShort((short) height);
-            buf.put((byte) pixelDepth);
-            buf.put((byte) imageDescriptor);
+            buf.put(pixelDepth);
+            buf.put(imageDescriptor);
             if (idLength > 0) {
                 try {
-                    byte[] chars = imageID.getBytes("US-ASCII");
+                    final byte[] chars = imageID.getBytes("US-ASCII");
                     buf.put(chars);
-                } catch (UnsupportedEncodingException e) {
+                } catch (final UnsupportedEncodingException e) {
                     throw new RuntimeException(e);
                 }
             }
@@ -250,7 +250,7 @@ public class TGAImage {
      * it into the JimiImage structure. This was taken from the
      * prototype and modified for the new Jimi structure
      */
-    private void decodeImage(GLProfile glp, LEDataInputStream dIn) throws IOException {
+    private void decodeImage(final GLProfile glp, final LEDataInputStream dIn) throws IOException {
         switch (header.imageType()) {
         case Header.UCOLORMAPPED:
             throw new IOException("TGADecoder Uncompressed Colormapped images not supported");
@@ -294,14 +294,14 @@ public class TGAImage {
      * This assumes that the body is for a 24 bit or 32 bit for a
      * RGB or ARGB image respectively.
      */
-    private void decodeRGBImageU24_32(GLProfile glp, LEDataInputStream dIn) throws IOException {
+    private void decodeRGBImageU24_32(final GLProfile glp, final LEDataInputStream dIn) throws IOException {
         setupImage24_32(glp);
 
         int i;    // row index
         int y;    // output row index
-        int rawWidth = header.width() * bpp;
-        byte[] rawBuf = new byte[rawWidth];
-        byte[] tmpData = new byte[rawWidth * header.height()];
+        final int rawWidth = header.width() * bpp;
+        final byte[] rawBuf = new byte[rawWidth];
+        final byte[] tmpData = new byte[rawWidth * header.height()];
 
         for (i = 0; i < header.height(); ++i) {
             dIn.readFully(rawBuf, 0, rawWidth);
@@ -323,12 +323,12 @@ public class TGAImage {
      * This assumes that the body is for a 24 bit or 32 bit for a
      * RGB or ARGB image respectively.
      */
-    private void decodeRGBImageRLE24_32(GLProfile glp, LEDataInputStream dIn) throws IOException {
+    private void decodeRGBImageRLE24_32(final GLProfile glp, final LEDataInputStream dIn) throws IOException {
         setupImage24_32(glp);
 
-        byte[] pixel = new byte[bpp];
-        int rawWidth = header.width() * bpp;
-        byte[] tmpData = new byte[rawWidth * header.height()];
+        final byte[] pixel = new byte[bpp];
+        final int rawWidth = header.width() * bpp;
+        final byte[] tmpData = new byte[rawWidth * header.height()];
         int i = 0, j;
         int packet, len;
         while (i < tmpData.length) {
@@ -348,7 +348,7 @@ public class TGAImage {
         data = ByteBuffer.wrap(tmpData);
     }
 
-    private void setupImage24_32(GLProfile glp) {
+    private void setupImage24_32(final GLProfile glp) {
         bpp = header.pixelDepth / 8;
         switch (header.pixelDepth) {
         case 24:
@@ -367,7 +367,7 @@ public class TGAImage {
         }
     }
 
-    private static void swapBGR(byte[] data, int bWidth, int height, int bpp) {
+    private static void swapBGR(final byte[] data, final int bWidth, final int height, final int bpp) {
         byte r,b;
         int k;
         for(int i=0; i<height; ++i) {
@@ -398,30 +398,30 @@ public class TGAImage {
     public ByteBuffer getData()  { return data; }
 
     /** Reads a Targa image from the specified file. */
-    public static TGAImage read(GLProfile glp, String filename) throws IOException {
+    public static TGAImage read(final GLProfile glp, final String filename) throws IOException {
         return read(glp, new FileInputStream(filename));
     }
 
     /** Reads a Targa image from the specified InputStream. */
-    public static TGAImage read(GLProfile glp, InputStream in) throws IOException {
-        LEDataInputStream dIn = new LEDataInputStream(new BufferedInputStream(in));
+    public static TGAImage read(final GLProfile glp, final InputStream in) throws IOException {
+        final LEDataInputStream dIn = new LEDataInputStream(new BufferedInputStream(in));
 
-        Header header = new Header(dIn);
-        TGAImage res = new TGAImage(header);
+        final Header header = new Header(dIn);
+        final TGAImage res = new TGAImage(header);
         res.decodeImage(glp, dIn);
         return res;
     }
 
     /** Writes the image in Targa format to the specified file name. */
-    public void write(String filename) throws IOException {
+    public void write(final String filename) throws IOException {
         write(new File(filename));
     }
 
     /** Writes the image in Targa format to the specified file. */
-    public void write(File file) throws IOException {
-        FileOutputStream stream = IOUtil.getFileOutputStream(file, true);
-        FileChannel chan = stream.getChannel();
-        ByteBuffer buf = ByteBuffer.allocate(header.size());
+    public void write(final File file) throws IOException {
+        final FileOutputStream stream = IOUtil.getFileOutputStream(file, true);
+        final FileChannel chan = stream.getChannel();
+        final ByteBuffer buf = ByteBuffer.allocate(header.size());
         buf.order(ByteOrder.LITTLE_ENDIAN);
         header.write(buf);
         buf.rewind();
@@ -437,19 +437,19 @@ public class TGAImage {
         data with the passed ByteBuffer. Assumes the data is already in
         the correct byte order for writing to disk, i.e., BGR or
         BGRA. */
-    public static TGAImage createFromData(int width,
-                                          int height,
-                                          boolean hasAlpha,
-                                          boolean topToBottom,
-                                          ByteBuffer data) {
-        Header header = new Header();
+    public static TGAImage createFromData(final int width,
+                                          final int height,
+                                          final boolean hasAlpha,
+                                          final boolean topToBottom,
+                                          final ByteBuffer data) {
+        final Header header = new Header();
         header.imageType = Header.UTRUECOLOR;
         header.width = width;
         header.height = height;
         header.pixelDepth = (byte) (hasAlpha ? 32 : 24);
         header.imageDescriptor = (byte) (topToBottom ? Header.ID_TOPTOBOTTOM : 0);
         // Note ID not supported
-        TGAImage ret = new TGAImage(header);
+        final TGAImage ret = new TGAImage(header);
         ret.data = data;
         return ret;
     }
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
index 18ad429..4174adf 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureProvider.java
@@ -55,12 +55,12 @@ public class IIOTextureProvider implements TextureProvider {
     private static final boolean DEBUG = Debug.debug("TextureIO");
 
     @Override
-    public TextureData newTextureData(GLProfile glp, File file,
-                                      int internalFormat,
-                                      int pixelFormat,
-                                      boolean mipmap,
-                                      String fileSuffix) throws IOException {
-        BufferedImage img = ImageIO.read(file);
+    public TextureData newTextureData(final GLProfile glp, final File file,
+                                      final int internalFormat,
+                                      final int pixelFormat,
+                                      final boolean mipmap,
+                                      final String fileSuffix) throws IOException {
+        final BufferedImage img = ImageIO.read(file);
         if (img == null) {
             return null;
         }
@@ -72,12 +72,12 @@ public class IIOTextureProvider implements TextureProvider {
     }
 
     @Override
-    public TextureData newTextureData(GLProfile glp, InputStream stream,
-                                      int internalFormat,
-                                      int pixelFormat,
-                                      boolean mipmap,
-                                      String fileSuffix) throws IOException {
-        BufferedImage img = ImageIO.read(stream);
+    public TextureData newTextureData(final GLProfile glp, final InputStream stream,
+                                      final int internalFormat,
+                                      final int pixelFormat,
+                                      final boolean mipmap,
+                                      final String fileSuffix) throws IOException {
+        final BufferedImage img = ImageIO.read(stream);
         if (img == null) {
             return null;
         }
@@ -89,12 +89,12 @@ public class IIOTextureProvider implements TextureProvider {
     }
 
     @Override
-    public TextureData newTextureData(GLProfile glp, URL url,
-                                      int internalFormat,
-                                      int pixelFormat,
-                                      boolean mipmap,
-                                      String fileSuffix) throws IOException {
-        InputStream stream = url.openStream();
+    public TextureData newTextureData(final GLProfile glp, final URL url,
+                                      final int internalFormat,
+                                      final int pixelFormat,
+                                      final boolean mipmap,
+                                      final String fileSuffix) throws IOException {
+        final InputStream stream = url.openStream();
         try {
             return newTextureData(glp, stream, internalFormat, pixelFormat, mipmap, fileSuffix);
         } finally {
diff --git a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
index be82e4f..60ac568 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/texture/spi/awt/IIOTextureWriter.java
@@ -54,10 +54,10 @@ import com.jogamp.opengl.util.texture.spi.*;
 
 public class IIOTextureWriter implements TextureWriter {
     @Override
-    public boolean write(File file,
-                         TextureData data) throws IOException {
-        int pixelFormat = data.getPixelFormat();
-        int pixelType   = data.getPixelType();
+    public boolean write(final File file,
+                         final TextureData data) throws IOException {
+        final int pixelFormat = data.getPixelFormat();
+        final int pixelType   = data.getPixelType();
         if ((pixelFormat == GL.GL_RGB ||
              pixelFormat == GL.GL_RGBA) &&
             (pixelType == GL.GL_BYTE ||
@@ -68,7 +68,7 @@ public class IIOTextureWriter implements TextureWriter {
                                                     (pixelFormat == GL.GL_RGB) ?
                                                     BufferedImage.TYPE_3BYTE_BGR :
                                                     BufferedImage.TYPE_4BYTE_ABGR);
-            byte[] imageData = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();
+            final byte[] imageData = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();
             ByteBuffer buf = (ByteBuffer) data.getBuffer();
             if (buf == null) {
                 buf = (ByteBuffer) data.getMipmapData()[0];
@@ -80,17 +80,17 @@ public class IIOTextureWriter implements TextureWriter {
             // Swizzle image components to be correct
             if (pixelFormat == GL.GL_RGB) {
                 for (int i = 0; i < imageData.length; i += 3) {
-                    byte red  = imageData[i + 0];
-                    byte blue = imageData[i + 2];
+                    final byte red  = imageData[i + 0];
+                    final byte blue = imageData[i + 2];
                     imageData[i + 0] = blue;
                     imageData[i + 2] = red;
                 }
             } else {
                 for (int i = 0; i < imageData.length; i += 4) {
-                    byte red   = imageData[i + 0];
-                    byte green = imageData[i + 1];
-                    byte blue  = imageData[i + 2];
-                    byte alpha = imageData[i + 3];
+                    final byte red   = imageData[i + 0];
+                    final byte green = imageData[i + 1];
+                    final byte blue  = imageData[i + 2];
+                    final byte alpha = imageData[i + 3];
                     imageData[i + 0] = alpha;
                     imageData[i + 1] = blue;
                     imageData[i + 2] = green;
@@ -104,9 +104,9 @@ public class IIOTextureWriter implements TextureWriter {
             // Happened to notice that writing RGBA images to JPEGS is broken
             if (TextureIO.JPG.equals(IOUtil.getFileSuffix(file)) &&
                 image.getType() == BufferedImage.TYPE_4BYTE_ABGR) {
-                BufferedImage tmpImage = new BufferedImage(image.getWidth(), image.getHeight(),
+                final BufferedImage tmpImage = new BufferedImage(image.getWidth(), image.getHeight(),
                                                            BufferedImage.TYPE_3BYTE_BGR);
-                Graphics g = tmpImage.getGraphics();
+                final Graphics g = tmpImage.getGraphics();
                 g.drawImage(image, 0, 0, null);
                 g.dispose();
                 image = tmpImage;
diff --git a/src/jogl/classes/javax/media/opengl/DebugGL2.java b/src/jogl/classes/javax/media/opengl/DebugGL2.java
index 3c064a1..e0d24c4 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGL2.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGL2.java
@@ -15,7 +15,7 @@ package javax.media.opengl;
  * </p>
  */
 public class DebugGL2 extends DebugGL4bc {
-    public DebugGL2(GL2 downstream) {
+    public DebugGL2(final GL2 downstream) {
         super((GL4bc)downstream);
     }
 }
diff --git a/src/jogl/classes/javax/media/opengl/DebugGL3.java b/src/jogl/classes/javax/media/opengl/DebugGL3.java
index b490a63..678e800 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGL3.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGL3.java
@@ -15,7 +15,7 @@ package javax.media.opengl;
  * </p>
  */
 public class DebugGL3 extends DebugGL4bc {
-    public DebugGL3(GL3 downstream) {
+    public DebugGL3(final GL3 downstream) {
         super((GL4bc)downstream);
     }
 }
diff --git a/src/jogl/classes/javax/media/opengl/DebugGL3bc.java b/src/jogl/classes/javax/media/opengl/DebugGL3bc.java
index 1d42afb..2636e94 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGL3bc.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGL3bc.java
@@ -15,7 +15,7 @@ package javax.media.opengl;
  * </p>
  */
 public class DebugGL3bc extends DebugGL4bc {
-    public DebugGL3bc(GL3bc downstream) {
+    public DebugGL3bc(final GL3bc downstream) {
         super((GL4bc)downstream);
     }
 }
diff --git a/src/jogl/classes/javax/media/opengl/DebugGL4.java b/src/jogl/classes/javax/media/opengl/DebugGL4.java
index 249d850..c4f8764 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGL4.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGL4.java
@@ -15,7 +15,7 @@ package javax.media.opengl;
  * </p>
  */
 public class DebugGL4 extends DebugGL4bc {
-    public DebugGL4(GL4 downstream) {
+    public DebugGL4(final GL4 downstream) {
         super((GL4bc)downstream);
     }
 }
diff --git a/src/jogl/classes/javax/media/opengl/DebugGLES2.java b/src/jogl/classes/javax/media/opengl/DebugGLES2.java
index 6d666d8..c4e06f3 100644
--- a/src/jogl/classes/javax/media/opengl/DebugGLES2.java
+++ b/src/jogl/classes/javax/media/opengl/DebugGLES2.java
@@ -15,7 +15,7 @@ package javax.media.opengl;
  * </p>
  */
 public class DebugGLES2 extends DebugGLES3 {
-    public DebugGLES2(GLES2 downstream) {
+    public DebugGLES2(final GLES2 downstream) {
         super((GLES3)downstream);
     }
 }
diff --git a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
index 7e24347..412af25 100644
--- a/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
+++ b/src/jogl/classes/javax/media/opengl/DefaultGLCapabilitiesChooser.java
@@ -41,9 +41,13 @@
 package javax.media.opengl;
 
 import javax.media.nativewindow.NativeWindowException;
+
 import java.util.List;
+
 import javax.media.nativewindow.CapabilitiesImmutable;
 
+import com.jogamp.common.util.PropertyAccess;
+
 import jogamp.opengl.Debug;
 
 /** <P> The default implementation of the {@link
@@ -89,7 +93,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
 
   static {
       Debug.initSingleton();
-      DEBUG = Debug.isPropertyDefined("jogl.debug.CapabilitiesChooser", true);
+      DEBUG = PropertyAccess.isPropertyDefined("jogl.debug.CapabilitiesChooser", true);
   }
 
   private final static int NO_SCORE = -9999999;
@@ -142,7 +146,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
     }
 
     // Create score array
-    int[] scores = new int[availnum];
+    final int[] scores = new int[availnum];
 
     for (int i = 0; i < scores.length; i++) {
       scores[i] = NO_SCORE;
@@ -218,13 +222,13 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
     boolean gotHW = false;
     int maxAbsoluteHWScore = 0;
     for (int i = 0; i < availnum; i++) {
-      int score = scores[i];
+      final int score = scores[i];
       if (score == NO_SCORE) {
         continue;
       }
       final GLCapabilitiesImmutable cur = (GLCapabilitiesImmutable) available.get(i);
       if (cur.getHardwareAccelerated()) {
-        int absScore = Math.abs(score);
+        final int absScore = Math.abs(score);
         if (!gotHW ||
             (absScore > maxAbsoluteHWScore)) {
           gotHW = true;
@@ -265,7 +269,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
     int scoreClosestToZero = NO_SCORE;
     int chosenIndex = -1;
     for (int i = 0; i < availnum; i++) {
-      int score = scores[i];
+      final int score = scores[i];
       if (score == NO_SCORE) {
         continue;
       }
@@ -289,7 +293,7 @@ public class DefaultGLCapabilitiesChooser implements GLCapabilitiesChooser {
     return chosenIndex;
   }
 
-  private static int sign(int score) {
+  private static int sign(final int score) {
     if (score < 0) {
       return -1;
     }
diff --git a/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java b/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
index 8271456..d14ada4 100644
--- a/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
+++ b/src/jogl/classes/javax/media/opengl/GLAnimatorControl.java
@@ -33,6 +33,38 @@ package javax.media.opengl;
  * which implementation may drive a {@link javax.media.opengl.GLAutoDrawable} animation.
  */
 public interface GLAnimatorControl extends FPSCounter {
+    /**
+     * A {@link GLAnimatorControl#setUncaughtExceptionHandler(UncaughtExceptionHandler) registered}
+     * {@link UncaughtExceptionHandler} instance is invoked when an {@link GLAnimatorControl animator} abruptly {@link #stop() stops}
+     * due to an uncaught exception from one of its {@link GLAutoDrawable}s.
+     * @see #uncaughtException(GLAnimatorControl, GLAutoDrawable, Throwable)
+     * @see GLAnimatorControl#setUncaughtExceptionHandler(UncaughtExceptionHandler)
+     * @since 2.2
+     */
+    public static interface UncaughtExceptionHandler {
+        /**
+         * Method invoked when the given {@link GLAnimatorControl} is {@link GLAnimatorControl#stop() stopped} due to the
+         * given uncaught exception happened on the given {@link GLAutoDrawable}.
+         * <p>
+         * The animator thread can still be retrieved via {@link GLAnimatorControl#getThread()}.
+         * </p>
+         * <p>
+         * All {@link GLAnimatorControl} states already reflect its stopped state.
+         * </p>
+         * <p>
+         * After this handler method is called, the {@link GLAnimatorControl} is stopped.
+         * </p>
+         * <p>
+         * Any exception thrown by this method will be ignored.
+         * </p>
+         * @param animator the {@link GLAnimatorControl}
+         * @param drawable the causing {@link GLAutoDrawable}
+         * @param cause the uncaught exception
+         * @see GLAnimatorControl#setUncaughtExceptionHandler(UncaughtExceptionHandler)
+         * @since 2.2
+         */
+        void uncaughtException(final GLAnimatorControl animator, final GLAutoDrawable drawable, final Throwable cause);
+    }
 
     /**
      * Indicates whether this animator has been {@link #start() started}.
@@ -181,4 +213,24 @@ public interface GLAnimatorControl extends FPSCounter {
      * @throws IllegalArgumentException if drawable was not added to this animator
      */
     void remove(GLAutoDrawable drawable);
+
+    /**
+     * Returns the {@link UncaughtExceptionHandler} invoked when this {@link GLAnimatorControl animator} abruptly {@link #stop() stops}
+     * due to an uncaught exception from one of its {@link GLAutoDrawable}s.
+     * <p>
+     * Default is <code>null</code>.
+     * </p>
+     * @since 2.2
+     */
+    UncaughtExceptionHandler getUncaughtExceptionHandler();
+
+    /**
+     * Set the handler invoked when this {@link GLAnimatorControl animator} abruptly {@link #stop() stops}
+     * due to an uncaught exception from one of its {@link GLAutoDrawable}s.
+     * @param handler the {@link UncaughtExceptionHandler} to use as this {@link GLAnimatorControl animator}'s uncaught exception
+     * handler. Pass <code>null</code> to unset the handler.
+     * @see UncaughtExceptionHandler#uncaughtException(GLAnimatorControl, GLAutoDrawable, Throwable)
+     * @since 2.2
+     */
+    void setUncaughtExceptionHandler(final UncaughtExceptionHandler handler);
 }
diff --git a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
index bf8fe65..bded88d 100644
--- a/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLAutoDrawable.java
@@ -42,6 +42,10 @@ package javax.media.opengl;
 
 import java.util.List;
 
+import javax.media.nativewindow.NativeSurface;
+
+import com.jogamp.common.util.locks.RecursiveLock;
+
 import jogamp.opengl.Debug;
 
 /** A higher-level abstraction than {@link GLDrawable} which supplies
@@ -116,6 +120,28 @@ import jogamp.opengl.Debug;
     -Djogl.screenchange.action=true  Enable  the {@link GLDrawable} reconfiguration
     </PRE>
     </p>
+    <h5><a name="locking">GLAutoDrawable Locking</a></h5>
+    GLAutoDrawable implementations perform locking in the following order:
+    <ol>
+      <li> {@link #getUpstreamLock()}.{@link RecursiveLock#lock() lock()}</li>
+      <li> {@link #getNativeSurface()}.{@link NativeSurface#lockSurface() lockSurface()} </li>
+    </ol>
+    and releases the locks accordingly:
+    <ol>
+      <li> {@link #getNativeSurface()}.{@link NativeSurface#unlockSurface() unlockSurface()} </li>
+      <li> {@link #getUpstreamLock()}.{@link RecursiveLock#unlock() unlock()}</li>
+    </ol>
+    Above <i>locking order</i> is mandatory to guarantee
+    atomicity of operation and to avoid race-conditions.
+    A custom implementation or user applications requiring exclusive access
+    shall follow the <i>locking order</i>.
+    See:
+    <ul>
+      <li>{@link #getUpstreamLock()}</li>
+      <li>{@link #invoke(boolean, GLRunnable)}</li>
+      <li>{@link #invoke(boolean, List)}</li>
+    </ul>
+    </p>
   */
 public interface GLAutoDrawable extends GLDrawable {
   /** Flag reflecting whether the {@link GLDrawable} reconfiguration will be issued in
@@ -139,19 +165,22 @@ public interface GLAutoDrawable extends GLDrawable {
   /**
    * Associate the new context, <code>newtCtx</code>, to this auto-drawable.
    * <p>
-   * The current context will be destroyed if <code>destroyPrevCtx</code> is <code>true</code>,
-   * otherwise it will be dis-associated from this auto-drawable
-   * via {@link GLContext#setGLDrawable(GLDrawable, boolean) setGLDrawable(null, true);} first.
-   * </p>
-   * <p>
-   * The new context will be associated with this auto-drawable
-   * via {@link GLContext#setGLDrawable(GLDrawable, boolean) newCtx.setGLDrawable(drawable, true);}.
-   * </p>
-   * <p>
-   * If the old or new context was current on this thread, it is being released before switching the association.
-   * The new context will be made current afterwards, if it was current before.
-   * However the user shall take extra care that no other thread
-   * attempts to make this context current.
+   * Remarks:
+   * <ul>
+   *   <li>The currently associated context will be destroyed if <code>destroyPrevCtx</code> is <code>true</code>,
+   *       otherwise it will be disassociated from this auto-drawable
+   *       via {@link GLContext#setGLDrawable(GLDrawable, boolean) setGLDrawable(null, true);} including {@link GL#glFinish() glFinish()}.</li>
+   *   <li>The new context will be associated with this auto-drawable
+   *       via {@link GLContext#setGLDrawable(GLDrawable, boolean) newCtx.setGLDrawable(drawable, true);}.</li>
+   *   <li>If the old context was current on this thread, it is being released after disassociating this auto-drawable.</li>
+   *   <li>If the new context was current on this thread, it is being released before associating this auto-drawable
+   *       and made current afterwards.</li>
+   *   <li>Implementation may issue {@link #makeCurrent()} and {@link #release()} while drawable reassociation.</li>
+   *   <li>The user shall take extra care of thread synchronization,
+   *       i.e. lock the involved {@link GLAutoDrawable auto-drawable's}
+   *       {@link GLAutoDrawable#getUpstreamLock() upstream-locks} and {@link GLAutoDrawable#getNativeSurface() surfaces}
+   *       to avoid a race condition. See <a href="#locking">GLAutoDrawable Locking</a>.</li>
+   * </ul>
    * </p>
    *
    * @param newCtx the new context, maybe <code>null</code> for dis-association.
@@ -199,6 +228,12 @@ public interface GLAutoDrawable extends GLDrawable {
   public int getGLEventListenerCount();
 
   /**
+   * Returns true if all added {@link GLEventListener} are initialized, otherwise false.
+   * @since 2.2
+   */
+  boolean areAllGLEventListenerInitialized();
+
+  /**
    * Returns the {@link GLEventListener} at the given index of this drawable queue.
    * @param index Position of the listener to be returned.
    *              Should be within (0 <= index && index < size()).
@@ -405,17 +440,28 @@ public interface GLAutoDrawable extends GLDrawable {
    * The internal queue of {@link GLRunnable}'s is being flushed with {@link #destroy()}
    * where all blocked callers are being notified.
    * </p>
+   * <p>
+   * To avoid a deadlock situation which causes an {@link IllegalStateException} one should
+   * avoid issuing {@link #invoke(boolean, GLRunnable) invoke} while this <a href="#locking">GLAutoDrawable is being locked</a>.<br>
+   * Detected deadlock situations throwing an {@link IllegalStateException} are:
+   * <ul>
+   *   <li>{@link #getAnimator() Animator} is running on another thread and waiting and is locked on current thread, but is not {@link #isThreadGLCapable() GL-Thread}</li>
+   *   <li>No {@link #getAnimator() Animator} is running on another thread and is locked on current thread, but is not {@link #isThreadGLCapable() GL-Thread}</li>
+   * </ul>
+   * </p>
    *
    * @param wait if <code>true</code> block until execution of <code>glRunnable</code> is finished, otherwise return immediately w/o waiting
    * @param glRunnable the {@link GLRunnable} to execute within {@link #display()}
    * @return <code>true</code> if the {@link GLRunnable} has been processed or queued, otherwise <code>false</code>.
+   * @throws IllegalStateException in case of a detected deadlock situation ahead, see above.
    *
    * @see #setAnimator(GLAnimatorControl)
    * @see #display()
    * @see GLRunnable
    * @see #invoke(boolean, List)
+   * @see #flushGLRunnables()
    */
-  public boolean invoke(boolean wait, GLRunnable glRunnable);
+  public boolean invoke(boolean wait, GLRunnable glRunnable) throws IllegalStateException ;
 
   /**
    * Extends {@link #invoke(boolean, GLRunnable)} functionality
@@ -423,9 +469,23 @@ public interface GLAutoDrawable extends GLDrawable {
    * @param wait if <code>true</code> block until execution of the last <code>glRunnable</code> is finished, otherwise return immediately w/o waiting
    * @param glRunnables the {@link GLRunnable}s to execute within {@link #display()}
    * @return <code>true</code> if the {@link GLRunnable}s has been processed or queued, otherwise <code>false</code>.
+   * @throws IllegalStateException in case of a detected deadlock situation ahead, see {@link #invoke(boolean, GLRunnable)}.
    * @see #invoke(boolean, GLRunnable)
+   * @see #flushGLRunnables()
    */
-  public boolean invoke(boolean wait, List<GLRunnable> glRunnables);
+  public boolean invoke(boolean wait, List<GLRunnable> glRunnables) throws IllegalStateException;
+
+  /**
+   * Flushes all {@link #invoke(boolean, GLRunnable) enqueued} {@link GLRunnable} of this {@link GLAutoDrawable}
+   * including notifying waiting executor.
+   * <p>
+   * The executor which might have been blocked until notified
+   * will be unblocked and all tasks removed from the queue.
+   * </p>
+   * @see #invoke(boolean, GLRunnable)
+   * @since 2.2
+   */
+  public void flushGLRunnables();
 
   /** Destroys all resources associated with this GLAutoDrawable,
       inclusive the GLContext.
@@ -551,4 +611,26 @@ public interface GLAutoDrawable extends GLDrawable {
    */
   public Object getUpstreamWidget();
 
+  /**
+   * Returns the recursive lock object of the {@link #getUpstreamWidget() upstream widget}
+   * to synchronize multithreaded access on top of {@link NativeSurface#lockSurface()}.
+   * <p>
+   * See <a href="#locking">GLAutoDrawable Locking</a>.
+   * </p>
+   * @since 2.2
+   */
+  public RecursiveLock getUpstreamLock();
+
+  /**
+   * Indicates whether the current thread is capable of
+   * performing OpenGL-related work.
+   * <p>
+   * Implementation utilizes this knowledge to determine
+   * whether {@link #display()} performs the OpenGL commands on the current thread directly
+   * or spawns them on the dedicated OpenGL thread.
+   * </p>
+   * @since 2.2
+   */
+  public boolean isThreadGLCapable();
+
 }
diff --git a/src/jogl/classes/javax/media/opengl/GLBase.java b/src/jogl/classes/javax/media/opengl/GLBase.java
index 3f0c779..48455c5 100644
--- a/src/jogl/classes/javax/media/opengl/GLBase.java
+++ b/src/jogl/classes/javax/media/opengl/GLBase.java
@@ -121,13 +121,13 @@ public interface GLBase {
   public boolean isGL2();
 
   /**
-   * Indicates whether this GL object conforms to the OpenGL ES1 ≥ 1.0 profile.
+   * Indicates whether this GL object conforms to the OpenGL ES ≥ 1.0 profile.
    * @see GLContext#isGLES1()
    */
   public boolean isGLES1();
 
   /**
-   * Indicates whether this GL object conforms to the OpenGL ES2 ≥ 2.0 profile.
+   * Indicates whether this GL object conforms to the OpenGL ES ≥ 2.0 profile.
    * <p>
    * Remark: ES2 compatible desktop profiles are not included.
    * To query whether core ES2 functionality is provided, use {@link #isGLES2Compatible()}.
@@ -138,7 +138,7 @@ public interface GLBase {
   public boolean isGLES2();
 
   /**
-   * Indicates whether this GL object conforms to the OpenGL ES2 ≥ 3.0 profile.
+   * Indicates whether this GL object conforms to the OpenGL ES ≥ 3.0 profile.
    * <p>
    * Remark: ES3 compatible desktop profiles are not included.
    * To query whether core ES3 functionality is provided, use {@link #isGLES3Compatible()}.
@@ -505,10 +505,6 @@ public interface GLBase {
    public void glDepthRange(double zNear, double zFar);
 
    /**
-    * @deprecated Avoid original GL API namespace conflict. Use {@link #getBoundBuffer(int)}
-    */
-   public int glGetBoundBuffer(int target);
-   /**
     * @param target a GL buffer (VBO) target as used in {@link GL#glBindBuffer(int, int)}, ie {@link GL#GL_ELEMENT_ARRAY_BUFFER}, {@link GL#GL_ARRAY_BUFFER}, ..
     * @return the GL buffer name bound to a target via {@link GL#glBindBuffer(int, int)} or 0 if unbound.
     * @see #getBufferStorage(int)
@@ -516,10 +512,6 @@ public interface GLBase {
    public int getBoundBuffer(int target);
 
    /**
-    * @deprecated Use {@link #getBufferStorage(int)}.
-    */
-   public long glGetBufferSize(int bufferName);
-   /**
     * @param bufferName a GL buffer name, generated with e.g. {@link GL#glGenBuffers(int, int[], int)} and used in {@link GL#glBindBuffer(int, int)}, {@link GL#glBufferData(int, long, java.nio.Buffer, int)} or {@link GL2#glNamedBufferDataEXT(int, long, java.nio.Buffer, int)}.
     * @return the size of the given GL buffer storage, see {@link GLBufferStorage}
     * @see #getBoundBuffer(int)
@@ -580,19 +572,11 @@ public interface GLBase {
    public GLBufferStorage mapBufferRange(final int target, final long offset, final long length, final int access) throws GLException;
 
    /**
-    * @deprecated Avoid original GL API namespace conflict. Use {@link #isVBOArrayBound()}
-    */
-   public boolean glIsVBOArrayBound();
-   /**
     * @return true if a VBO is bound to {@link GL#GL_ARRAY_BUFFER} via {@link GL#glBindBuffer(int, int)}, otherwise false
     */
    public boolean isVBOArrayBound();
 
    /**
-    * @deprecated Avoid original GL API namespace conflict. Use {@link #isVBOElementArrayBound()}
-    */
-   public boolean glIsVBOElementArrayBound();
-   /**
     * @return true if a VBO is bound to {@link GL#GL_ELEMENT_ARRAY_BUFFER} via {@link GL#glBindBuffer(int, int)}, otherwise false
     */
    public boolean isVBOElementArrayBound();
diff --git a/src/jogl/classes/javax/media/opengl/GLBufferStorage.java b/src/jogl/classes/javax/media/opengl/GLBufferStorage.java
index 929ecf6..1101ed3 100644
--- a/src/jogl/classes/javax/media/opengl/GLBufferStorage.java
+++ b/src/jogl/classes/javax/media/opengl/GLBufferStorage.java
@@ -78,10 +78,10 @@ import java.nio.IntBuffer;
  */
 public abstract class GLBufferStorage {
         private final int name;
-        private final long size;
-        private final int mutableUsage;
-        private final int immutableFlags;
-        protected ByteBuffer mappedBuffer;
+        private /* final */ long size;
+        private /* final */ int mutableUsage;
+        private /* final */ int immutableFlags;
+        private ByteBuffer mappedBuffer;
 
         protected GLBufferStorage(final int name, final long size, final int mutableUsage, final int immutableFlags) {
             this.name = name;
@@ -91,6 +91,16 @@ public abstract class GLBufferStorage {
             this.mappedBuffer = null;
         }
 
+        protected void reset(final long size, final int mutableUsage, final int immutableFlags) {
+            this.size = size;
+            this.mutableUsage = mutableUsage;
+            this.immutableFlags = immutableFlags;
+            this.mappedBuffer = null;
+        }
+        protected void setMappedBuffer(final ByteBuffer buffer) {
+            this.mappedBuffer = buffer;
+        }
+
         /** Return the buffer name */
         public final int getName() { return name; }
 
@@ -146,5 +156,5 @@ public abstract class GLBufferStorage {
                 return s0+", mapped "+mappedBuffer+"]";
             }
         }
-        private final String msgClazzName = "GLBufferStorage";
+        private static final String msgClazzName = "GLBufferStorage";
 }
diff --git a/src/jogl/classes/javax/media/opengl/GLCapabilities.java b/src/jogl/classes/javax/media/opengl/GLCapabilities.java
index b825d63..0d65d35 100644
--- a/src/jogl/classes/javax/media/opengl/GLCapabilities.java
+++ b/src/jogl/classes/javax/media/opengl/GLCapabilities.java
@@ -80,7 +80,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
     * @param glp GLProfile, or null for the default GLProfile
     * @throws GLException if no profile is given and no default profile is available for the default device.
     */
-  public GLCapabilities(GLProfile glp) throws GLException {
+  public GLCapabilities(final GLProfile glp) throws GLException {
       glProfile = (null!=glp)?glp:GLProfile.getDefault(GLProfile.getDefaultDevice());
   }
 
@@ -93,17 +93,17 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
   public Object clone() {
     try {
       return super.clone();
-    } catch (RuntimeException e) {
+    } catch (final RuntimeException e) {
       throw new GLException(e);
     }
   }
 
   /**
-   * Copies all {@link GLCapabilities} and {@link Capabilities} values
+   * Copies all {@link GLCapabilitiesImmutable} values
    * from <code>source</code> into this instance.
    * @return this instance
    */
-  public GLCapabilities copyFrom(GLCapabilitiesImmutable source) {
+  public GLCapabilities copyFrom(final GLCapabilitiesImmutable source) {
     super.copyFrom(source);
     glProfile = source.getGLProfile();
     isPBuffer = source.isPBuffer();
@@ -145,12 +145,12 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
   }
 
   @Override
-  public boolean equals(Object obj) {
+  public boolean equals(final Object obj) {
     if(this == obj)  { return true; }
     if(!(obj instanceof GLCapabilitiesImmutable)) {
         return false;
     }
-    GLCapabilitiesImmutable other = (GLCapabilitiesImmutable)obj;
+    final GLCapabilitiesImmutable other = (GLCapabilitiesImmutable)obj;
     boolean res = super.equals(obj) &&
                   other.getGLProfile()==glProfile &&
                   other.isPBuffer()==isPBuffer &&
@@ -176,7 +176,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
   @Override
   public int compareTo(final CapabilitiesImmutable o) {
     if ( ! ( o instanceof GLCapabilitiesImmutable ) ) {
-        Class<?> c = (null != o) ? o.getClass() : null ;
+        final Class<?> c = (null != o) ? o.getClass() : null ;
         throw new ClassCastException("Not a GLCapabilitiesImmutable object, but " + c);
     }
     final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) o;
@@ -235,7 +235,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
   }
 
   /** Sets the GL profile you desire */
-  public void setGLProfile(GLProfile profile) {
+  public void setGLProfile(final GLProfile profile) {
     glProfile=profile;
   }
 
@@ -256,7 +256,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
    * Requesting offscreen pbuffer mode disables the offscreen auto selection.
    * </p>
    */
-  public void setPBuffer(boolean enable) {
+  public void setPBuffer(final boolean enable) {
     if(enable) {
       setOnscreen(false);
     }
@@ -280,7 +280,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
    * Requesting offscreen FBO mode disables the offscreen auto selection.
    * </p>
    */
-  public void setFBO(boolean enable) {
+  public void setFBO(final boolean enable) {
     if(enable) {
       setOnscreen(false);
     }
@@ -293,7 +293,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
   }
 
   /** Enables or disables double buffering. */
-  public void setDoubleBuffered(boolean enable) {
+  public void setDoubleBuffered(final boolean enable) {
     doubleBuffered = enable;
   }
 
@@ -303,7 +303,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
   }
 
   /** Enables or disables stereo viewing. */
-  public void setStereo(boolean enable) {
+  public void setStereo(final boolean enable) {
     stereo = enable;
   }
 
@@ -313,7 +313,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
   }
 
   /** Enables or disables hardware acceleration. */
-  public void setHardwareAccelerated(boolean enable) {
+  public void setHardwareAccelerated(final boolean enable) {
     hardwareAccelerated = enable;
   }
 
@@ -323,7 +323,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
   }
 
   /** Sets the number of bits requested for the depth buffer. */
-  public void setDepthBits(int depthBits) {
+  public void setDepthBits(final int depthBits) {
     this.depthBits = depthBits;
   }
 
@@ -333,7 +333,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
   }
 
   /** Sets the number of bits requested for the stencil buffer. */
-  public void setStencilBits(int stencilBits) {
+  public void setStencilBits(final int stencilBits) {
     this.stencilBits = stencilBits;
   }
 
@@ -346,7 +346,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
       red component. On some systems only the accumulation buffer
       depth, which is the sum of the red, green, and blue bits, is
       considered. */
-  public void setAccumRedBits(int accumRedBits) {
+  public void setAccumRedBits(final int accumRedBits) {
     this.accumRedBits = accumRedBits;
   }
 
@@ -359,7 +359,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
       green component. On some systems only the accumulation buffer
       depth, which is the sum of the red, green, and blue bits, is
       considered. */
-  public void setAccumGreenBits(int accumGreenBits) {
+  public void setAccumGreenBits(final int accumGreenBits) {
     this.accumGreenBits = accumGreenBits;
   }
 
@@ -372,7 +372,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
       blue component. On some systems only the accumulation buffer
       depth, which is the sum of the red, green, and blue bits, is
       considered. */
-  public void setAccumBlueBits(int accumBlueBits) {
+  public void setAccumBlueBits(final int accumBlueBits) {
     this.accumBlueBits = accumBlueBits;
   }
 
@@ -385,7 +385,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
       component. On some systems only the accumulation buffer depth,
       which is the sum of the red, green, and blue bits, is
       considered. */
-  public void setAccumAlphaBits(int accumAlphaBits) {
+  public void setAccumAlphaBits(final int accumAlphaBits) {
     this.accumAlphaBits = accumAlphaBits;
   }
 
@@ -393,7 +393,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
    * Sets the desired extension for full-scene antialiasing
    * (FSAA), default is {@link #DEFAULT_SAMPLE_EXTENSION}.
    */
-  public void setSampleExtension(String se) {
+  public void setSampleExtension(final String se) {
       sampleExtension = se;
   }
 
@@ -410,7 +410,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
    * If enabled this method also invokes {@link #setAlphaBits(int) setAlphaBits(1)}
    * if {@link #getAlphaBits()} == 0.<br>
    */
-  public void setSampleBuffers(boolean enable) {
+  public void setSampleBuffers(final boolean enable) {
     sampleBuffers = enable;
     if(sampleBuffers && getAlphaBits()==0) {
         setAlphaBits(1);
@@ -427,7 +427,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
    * to be allocated. Defaults to 2.
    * @see #getNumSamples()
    */
-  public void setNumSamples(int numSamples) {
+  public void setNumSamples(final int numSamples) {
     this.numSamples = numSamples;
   }
 
@@ -503,7 +503,7 @@ public class GLCapabilities extends Capabilities implements Cloneable, GLCapabil
       object. */
   @Override
   public String toString() {
-    StringBuilder msg = new StringBuilder();
+    final StringBuilder msg = new StringBuilder();
     msg.append("GLCaps[");
     toString(msg);
     msg.append("]");
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index 9a43117..863eb1a 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -48,6 +48,7 @@ import java.util.List;
 import java.util.Set;
 
 import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.NativeSurface;
 
 import jogamp.opengl.Debug;
 import jogamp.opengl.GLContextImpl;
@@ -227,7 +228,7 @@ public abstract class GLContext {
   /**
    * @param isInit true if called for class initialization, otherwise false (re-init or destruction).
    */
-  protected void resetStates(boolean isInit) {
+  protected void resetStates(final boolean isInit) {
       if (DEBUG) {
         System.err.println(getThreadName() + ": GLContext.resetStates(isInit "+isInit+")");
         // Thread.dumpStack();
@@ -277,20 +278,29 @@ public abstract class GLContext {
    * @param quirk the quirk to be tested, e.g. {@link GLRendererQuirks#NoDoubleBufferedPBuffer}.
    * @throws IllegalArgumentException if the quirk is out of range
    */
-  public final boolean hasRendererQuirk(int quirk) throws IllegalArgumentException {
+  public final boolean hasRendererQuirk(final int quirk) throws IllegalArgumentException {
       return null != glRendererQuirks ? glRendererQuirks.exist(quirk) : false ;
   }
 
   /**
-   * Sets the read/write drawable for framebuffer operations.
+   * Sets the read/write drawable for framebuffer operations, i.e. reassociation of the context's drawable.
    * <p>
    * If the arguments reflect the current state of this context
    * this method is a no-operation and returns the old and current {@link GLDrawable}.
    * </p>
    * <p>
-   * If the context was current on this thread, it is being released before switching the drawable
-   * and made current afterwards. However the user shall take extra care that not other thread
-   * attempts to make this context current. Otherwise a race condition may happen.
+   * Remarks:
+   * <ul>
+   *   <li>{@link GL#glFinish() glFinish()} is issued if context {@link #isCreated()} and a {@link #getGLDrawable() previous drawable} was bound before disassociation.</li>
+   *   <li>If the context was current on this thread, it is being released before drawable reassociation
+   *       and made current afterwards.</li>
+   *   <li>Implementation may issue {@link #makeCurrent()} and {@link #release()} while drawable reassociation.</li>
+   *   <li>The user shall take extra care of thread synchronization,
+   *       i.e. lock the involved {@link GLDrawable#getNativeSurface() drawable's} {@link NativeSurface}s
+   *       to avoid a race condition. In case {@link GLAutoDrawable auto-drawable's} are used,
+   *       their {@link GLAutoDrawable#getUpstreamLock() upstream-lock} must be locked beforehand
+   *       see <a href="GLAutoDrawable.html#locking">GLAutoDrawable Locking</a>.</li>
+   * </ul>
    * </p>
    * @param readWrite The read/write drawable for framebuffer operations, maybe <code>null</code> to remove association.
    * @param setWriteOnly Only change the write-drawable, if <code>setWriteOnly</code> is <code>true</code> and
@@ -460,7 +470,7 @@ public abstract class GLContext {
    * @throws GLException if no context is current
    */
   public static GL getCurrentGL() throws GLException {
-    GLContext glc = getCurrent();
+    final GLContext glc = getCurrent();
     if(null==glc) {
         throw new GLException(getThreadName()+": No OpenGL context current on this thread");
     }
@@ -495,7 +505,7 @@ public abstract class GLContext {
   }
 
   /** Returns a String representation of the {@link #makeCurrent()} result. */
-  public static final String makeCurrentResultToString(int res) {
+  public static final String makeCurrentResultToString(final int res) {
       switch(res) {
           case CONTEXT_NOT_CURRENT:   return "CONTEXT_NOT_CURRENT";
           case CONTEXT_CURRENT:       return "CONTEXT_CURRENT";
@@ -509,7 +519,7 @@ public abstract class GLContext {
    * and has no other side-effects. For use by third parties adding
    * new GLContext implementations; not for use by end users.
    */
-  protected static void setCurrent(GLContext cur) {
+  protected static void setCurrent(final GLContext cur) {
     if( TRACE_SWITCH ) {
        if(null == cur) {
            System.err.println(getThreadName()+": GLContext.ContextSwitch: - setCurrent() - NULL");
@@ -570,7 +580,7 @@ public abstract class GLContext {
   /**
    * Returns the attached user object for the given name to this GLContext.
    */
-  public final Object getAttachedObject(String name) {
+  public final Object getAttachedObject(final String name) {
     return attachedObjects.get(name);
   }
 
@@ -578,11 +588,11 @@ public abstract class GLContext {
    * Sets the attached user object for the given name to this GLContext.
    * Returns the previously set object or null.
    */
-  public final Object attachObject(String name, Object obj) {
+  public final Object attachObject(final String name, final Object obj) {
     return attachedObjects.put(name, obj);
   }
 
-  public final Object detachObject(String name) {
+  public final Object detachObject(final String name) {
       return attachedObjects.remove(name);
   }
 
@@ -591,7 +601,7 @@ public abstract class GLContext {
    */
   @Override
   public String toString() {
-    StringBuilder sb = new StringBuilder();
+    final StringBuilder sb = new StringBuilder();
     sb.append(getClass().getSimpleName());
     sb.append(" [");
     this.append(sb);
@@ -599,7 +609,7 @@ public abstract class GLContext {
     return sb.toString();
   }
 
-  public final StringBuilder append(StringBuilder sb) {
+  public final StringBuilder append(final StringBuilder sb) {
     sb.append("Version ").append(getGLVersion()).append(" [GL ").append(getGLVersionNumber()).append(", vendor ").append(getGLVendorVersionNumber());
     sb.append("], options 0x");
     sb.append(Integer.toHexString(ctxOptions));
@@ -816,7 +826,7 @@ public abstract class GLContext {
       return "#version " + ctxGLSLVersion.getMajor() + ( minor < 10 ? "0"+minor : minor ) + esSuffix + "\n" ;
   }
 
-  protected static final VersionNumber getStaticGLSLVersionNumber(int glMajorVersion, int glMinorVersion, int ctxOptions) {
+  protected static final VersionNumber getStaticGLSLVersionNumber(final int glMajorVersion, final int glMinorVersion, final int ctxOptions) {
       if( 0 != ( CTX_PROFILE_ES & ctxOptions ) ) {
           if( 3 == glMajorVersion ) {
               return Version300;           // ES 3.0  ->  GLSL 3.00
@@ -938,14 +948,14 @@ public abstract class GLContext {
           final GL gl = getGL();
           final int[] val = new int[] { 0 } ;
           try {
-              gl.glGetIntegerv(GL2GL3.GL_MAX_SAMPLES, val, 0);
+              gl.glGetIntegerv(GL2ES3.GL_MAX_SAMPLES, val, 0);
               final int glerr = gl.glGetError();
               if(GL.GL_NO_ERROR == glerr) {
                   return val[0];
               } else if(DEBUG) {
                   System.err.println("GLContext.getMaxRenderbufferSamples: GL_MAX_SAMPLES query GL Error 0x"+Integer.toHexString(glerr));
               }
-          } catch (GLException gle) { gle.printStackTrace(); }
+          } catch (final GLException gle) { gle.printStackTrace(); }
       }
       return 0;
   }
@@ -966,8 +976,7 @@ public abstract class GLContext {
    * @see GLProfile#isGL4bc()
    */
   public final boolean isGL4bc() {
-      return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
-             0 != (ctxOptions & CTX_PROFILE_COMPAT) &&
+      return 0 != (ctxOptions & CTX_PROFILE_COMPAT) &&
              ctxVersion.getMajor() >= 4;
   }
 
@@ -976,8 +985,7 @@ public abstract class GLContext {
    * @see GLProfile#isGL4()
    */
   public final boolean isGL4() {
-      return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
-             0 != (ctxOptions & (CTX_PROFILE_COMPAT|CTX_PROFILE_CORE)) &&
+      return 0 != (ctxOptions & (CTX_PROFILE_COMPAT|CTX_PROFILE_CORE)) &&
              ctxVersion.getMajor() >= 4;
   }
 
@@ -985,8 +993,7 @@ public abstract class GLContext {
    * Indicates whether this GLContext uses a GL4 core profile. <p>Includes [ GL4 ].</p>
    */
   public final boolean isGL4core() {
-      return 0 != ( ctxOptions & CTX_IS_ARB_CREATED ) &&
-             0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
+      return 0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
              ctxVersion.getMajor() >= 4;
   }
 
@@ -995,8 +1002,7 @@ public abstract class GLContext {
    * @see GLProfile#isGL3bc()
    */
   public final boolean isGL3bc() {
-      return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
-             0 != (ctxOptions & CTX_PROFILE_COMPAT) &&
+      return 0 != (ctxOptions & CTX_PROFILE_COMPAT) &&
              ctxVersion.compareTo(Version310) >= 0 ;
   }
 
@@ -1005,8 +1011,7 @@ public abstract class GLContext {
    * @see GLProfile#isGL3()
    */
   public final boolean isGL3() {
-      return 0 != (ctxOptions & CTX_IS_ARB_CREATED) &&
-             0 != (ctxOptions & (CTX_PROFILE_COMPAT|CTX_PROFILE_CORE)) &&
+      return 0 != (ctxOptions & (CTX_PROFILE_COMPAT|CTX_PROFILE_CORE)) &&
              ctxVersion.compareTo(Version310) >= 0 ;
   }
 
@@ -1014,8 +1019,7 @@ public abstract class GLContext {
    * Indicates whether this GLContext uses a GL3 core profile. <p>Includes [ GL4, GL3 ].</p>
    */
   public final boolean isGL3core() {
-      return 0 != ( ctxOptions & CTX_IS_ARB_CREATED ) &&
-             0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
+      return 0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
              ctxVersion.compareTo(Version310) >= 0;
   }
 
@@ -1024,8 +1028,7 @@ public abstract class GLContext {
    */
   public final boolean isGLcore() {
       return ( 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() >= 2 ) ||
-             ( 0 != ( ctxOptions & CTX_IS_ARB_CREATED ) &&
-               0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
+             ( 0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
                ctxVersion.compareTo(Version310) >= 0
              ) ;
   }
@@ -1041,9 +1044,9 @@ public abstract class GLContext {
   }
 
   /**
-   * Indicates whether this GLContext's native profile does not implement a default <i>vertex array object</i> (VAO),
-   * starting w/ OpenGL 3.1 core and GLES3.
-   * <p>Includes [ GL4, GL3, GLES3 ].</p>
+   * Indicates whether this GLContext's native profile does not implement a <i>default vertex array object</i> (VAO),
+   * starting w/ OpenGL 3.1 core.
+   * <p>Includes [ GL4, GL3 ].</p>
    * <pre>
      Due to GL 3.1 core spec: E.1. DEPRECATED AND REMOVED FEATURES (p 296),
             GL 3.2 core spec: E.2. DEPRECATED AND REMOVED FEATURES (p 331)
@@ -1052,8 +1055,17 @@ public abstract class GLContext {
      More clear is GL 4.3 core spec: 10.4 (p 307).
    * </pre>
    * <pre>
-     GLES3 is included, since upcoming ES releases > 3.0 may behave the same:
+     ES 3.x is <i>not</i> included here.
+     Due to it's ES 2.0 backward compatibility it still supports the following features:
+            <i>client side vertex arrays</i>
+            <i>default vertex array object</i>
+
+     Binding a custom VAO with ES 3.0 would cause <i>client side vertex arrays</i> via {@link GL2ES1#glVertexPointer(int, int, int, java.nio.Buffer) glVertexPointer}
+     to produce <code>GL_INVALID_OPERATION</code>.
+
+     However, they are marked <i>deprecated</i>:
             GL ES 3.0 spec F.1. Legacy Features (p 322).
+            GL ES 3.1 spec F.1. Legacy Features (p 454).
    * </pre>
    * <p>
    * If no default VAO is implemented in the native OpenGL profile,
@@ -1062,7 +1074,7 @@ public abstract class GLContext {
    * @see #getDefaultVAO()
    */
   public final boolean hasNoDefaultVAO() {
-      return ( 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() >= 3 ) ||
+      return // ES 3.x not included, see above. ( 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() >= 3 ) ||
              ( 0 != ( ctxOptions & CTX_IS_ARB_CREATED ) &&
                0 != ( ctxOptions & CTX_PROFILE_CORE ) &&
                ctxVersion.compareTo(Version310) >= 0
@@ -1188,7 +1200,7 @@ public abstract class GLContext {
    *
    * @throws GLException if the context is not current.
    */
-  public final boolean setSwapInterval(int interval) throws GLException {
+  public final boolean setSwapInterval(final int interval) throws GLException {
     validateCurrent();
     if(0<=interval) {
         if( !drawableRetargeted || !hasRendererQuirk(GLRendererQuirks.NoSetSwapIntervalPostRetarget) ) {
@@ -1200,7 +1212,7 @@ public abstract class GLContext {
     }
     return false;
   }
-  protected boolean setSwapIntervalImpl(int interval) {
+  protected boolean setSwapIntervalImpl(final int interval) {
       return false;
   }
   /** Return the current swap interval.
@@ -1225,27 +1237,27 @@ public abstract class GLContext {
     }
   }
 
-  public final boolean queryMaxSwapGroups(int[] maxGroups, int maxGroups_offset,
-                                          int[] maxBarriers, int maxBarriers_offset) {
+  public final boolean queryMaxSwapGroups(final int[] maxGroups, final int maxGroups_offset,
+                                          final int[] maxBarriers, final int maxBarriers_offset) {
     validateCurrent();
     return queryMaxSwapGroupsImpl(maxGroups, maxGroups_offset, maxBarriers, maxBarriers_offset);
   }
-  protected boolean queryMaxSwapGroupsImpl(int[] maxGroups, int maxGroups_offset,
-                                          int[] maxBarriers, int maxBarriers_offset) { return false; }
-  public final boolean joinSwapGroup(int group) {
+  protected boolean queryMaxSwapGroupsImpl(final int[] maxGroups, final int maxGroups_offset,
+                                          final int[] maxBarriers, final int maxBarriers_offset) { return false; }
+  public final boolean joinSwapGroup(final int group) {
     validateCurrent();
     return joinSwapGroupImpl(group);
   }
-  protected boolean joinSwapGroupImpl(int group) { /** nop per default .. **/  return false; }
+  protected boolean joinSwapGroupImpl(final int group) { /** nop per default .. **/  return false; }
   protected int currentSwapGroup = -1; // default: not set yet ..
   public int getSwapGroup() {
       return currentSwapGroup;
   }
-  public final boolean bindSwapBarrier(int group, int barrier) {
+  public final boolean bindSwapBarrier(final int group, final int barrier) {
     validateCurrent();
     return bindSwapBarrierImpl(group, barrier);
   }
-  protected boolean bindSwapBarrierImpl(int group, int barrier) { /** nop per default .. **/  return false; }
+  protected boolean bindSwapBarrierImpl(final int group, final int barrier) { /** nop per default .. **/  return false; }
 
   /**
    * Return the framebuffer name bound to this context,
@@ -1406,11 +1418,11 @@ public abstract class GLContext {
       /* 2.*/ { 0 },
       /* 3.*/ { 0 } };
 
-  public static final int getMaxMajor(int ctxProfile) {
+  public static final int getMaxMajor(final int ctxProfile) {
       return ( 0 != ( CTX_PROFILE_ES & ctxProfile ) ) ? ES_VERSIONS.length-1 : GL_VERSIONS.length-1;
   }
 
-  public static final int getMaxMinor(int ctxProfile, int major) {
+  public static final int getMaxMinor(final int ctxProfile, final int major) {
       if( 1>major ) {
           return -1;
       }
@@ -1439,7 +1451,7 @@ public abstract class GLContext {
    * and {@link #decrementGLVersion(int, int[], int[])} until invalid.
    * </p>
    */
-  public static final boolean isValidGLVersion(int ctxProfile, int major, int minor) {
+  public static final boolean isValidGLVersion(final int ctxProfile, final int major, final int minor) {
       if( 1>major || 0>minor ) {
           return false;
       }
@@ -1455,7 +1467,7 @@ public abstract class GLContext {
    * Clip the given GL version to the maximum known valid version if exceeding.
    * @return true if clipped, i.e. given value exceeds maximum, otherwise false.
    */
-  public static final boolean clipGLVersion(int ctxProfile, int major[], int minor[]) {
+  public static final boolean clipGLVersion(final int ctxProfile, final int major[], final int minor[]) {
       final int m = major[0];
       final int n = minor[0];
 
@@ -1494,7 +1506,7 @@ public abstract class GLContext {
    * @param minor
    * @return
    */
-  public static final boolean decrementGLVersion(int ctxProfile, int major[], int minor[]) {
+  public static final boolean decrementGLVersion(final int ctxProfile, final int major[], final int minor[]) {
       if( !clipGLVersion(ctxProfile, major, minor) ) {
           int m = major[0];
           int n = minor[0] - 1;
@@ -1520,13 +1532,13 @@ public abstract class GLContext {
       return true;
   }
 
-  protected static int composeBits(int a8, int b8, int c16) {
+  protected static int composeBits(final int a8, final int b8, final int c16) {
     return  ( ( a8    & 0x000000FF ) << 24 ) |
             ( ( b8    & 0x000000FF ) << 16 ) |
             ( ( c16   & 0x0000FFFF )       ) ;
   }
 
-  private static void validateProfileBits(int bits, String argName) {
+  private static void validateProfileBits(final int bits, final String argName) {
     int num = 0;
     if( 0 != ( CTX_PROFILE_COMPAT & bits ) ) { num++; }
     if( 0 != ( CTX_PROFILE_CORE   & bits ) ) { num++; }
@@ -1557,13 +1569,13 @@ public abstract class GLContext {
       GLContextImpl.shutdownImpl(); // well ..
   }
 
-  protected static boolean getAvailableGLVersionsSet(AbstractGraphicsDevice device) {
+  protected static boolean getAvailableGLVersionsSet(final AbstractGraphicsDevice device) {
       synchronized ( deviceVersionsAvailableSet ) {
         return deviceVersionsAvailableSet.containsKey(device.getUniqueID());
       }
   }
 
-  protected static void setAvailableGLVersionsSet(AbstractGraphicsDevice device) {
+  protected static void setAvailableGLVersionsSet(final AbstractGraphicsDevice device) {
       synchronized ( deviceVersionsAvailableSet ) {
           final String devKey = device.getUniqueID();
           if( null != deviceVersionsAvailableSet.put(devKey, devKey) ) {
@@ -1580,7 +1592,7 @@ public abstract class GLContext {
    * Returns a unique String object using {@link String#intern()} for the given arguments,
    * which object reference itself can be used as a key.
    */
-  protected static String getDeviceVersionAvailableKey(AbstractGraphicsDevice device, int major, int profile) {
+  protected static String getDeviceVersionAvailableKey(final AbstractGraphicsDevice device, final int major, final int profile) {
       final String r = device.getUniqueID() + "-" + toHexString(composeBits(major, profile, 0));
       return r.intern();
   }
@@ -1597,8 +1609,8 @@ public abstract class GLContext {
    *
    * @see #createContextARBMapVersionsAvailable
    */
-  protected static Integer mapAvailableGLVersion(AbstractGraphicsDevice device,
-                                                 int reqMajor, int profile, int resMajor, int resMinor, int resCtp)
+  protected static Integer mapAvailableGLVersion(final AbstractGraphicsDevice device,
+                                                 final int reqMajor, final int profile, final int resMajor, final int resMinor, int resCtp)
   {
     validateProfileBits(profile, "profile");
     validateProfileBits(resCtp, "resCtp");
@@ -1611,7 +1623,7 @@ public abstract class GLContext {
         // Thread.dumpStack();
     }
     final String objectKey = getDeviceVersionAvailableKey(device, reqMajor, profile);
-    final Integer val = new Integer(composeBits(resMajor, resMinor, resCtp));
+    final Integer val = Integer.valueOf(composeBits(resMajor, resMinor, resCtp));
     synchronized(deviceVersionAvailable) {
         return deviceVersionAvailable.put( objectKey, val );
     }
@@ -1624,7 +1636,7 @@ public abstract class GLContext {
     synchronized(deviceVersionAvailable) {
         final Set<String> keys = deviceVersionAvailable.keySet();
         boolean needsSeparator = false;
-        for(Iterator<String> i = keys.iterator(); i.hasNext(); ) {
+        for(final Iterator<String> i = keys.iterator(); i.hasNext(); ) {
             if(needsSeparator) {
                 sb.append(Platform.getNewline());
             }
@@ -1652,7 +1664,7 @@ public abstract class GLContext {
    * @param reqProfile Key Value either {@link #CTX_PROFILE_COMPAT}, {@link #CTX_PROFILE_CORE} or {@link #CTX_PROFILE_ES}
    * @return the available GL version as encoded with {@link #composeBits(int, int, int), otherwise <code>null</code>
    */
-  protected static Integer getAvailableGLVersion(AbstractGraphicsDevice device, int reqMajor, int reqProfile)  {
+  protected static Integer getAvailableGLVersion(final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile)  {
     final String objectKey = getDeviceVersionAvailableKey(device, reqMajor, reqProfile);
     Integer val;
     synchronized(deviceVersionAvailable) {
@@ -1668,8 +1680,8 @@ public abstract class GLContext {
    * @param minor if not null, returns the used minor version
    * @param ctp if not null, returns the used context profile
    */
-  protected static boolean getAvailableGLVersion(AbstractGraphicsDevice device, int reqMajor, int reqProfile,
-                                                 int[] major, int minor[], int ctp[]) {
+  protected static boolean getAvailableGLVersion(final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile,
+                                                 final int[] major, final int minor[], final int ctp[]) {
 
     final Integer valI = getAvailableGLVersion(device, reqMajor, reqProfile);
     if(null==valI) {
@@ -1694,7 +1706,7 @@ public abstract class GLContext {
    * returns the highest GLProfile string regarding the implementation version and context profile bits.
    * @throws GLException if version and context profile bits could not be mapped to a GLProfile
    */
-  protected static String getGLProfile(int major, int minor, int ctp)
+  protected static String getGLProfile(final int major, final int minor, final int ctp)
           throws GLException {
     if(0 != ( CTX_PROFILE_COMPAT & ctp )) {
         if(major >= 4)                            { return GLProfile.GL4bc; }
@@ -1714,7 +1726,7 @@ public abstract class GLContext {
   /**
    * Returns the GLProfile's major version number at reqMajorCTP[0] and it's context property (CTP) at reqMajorCTP[1] for availability mapping request.
    */
-  protected static final void getRequestMajorAndCompat(final GLProfile glp, int[/*2*/] reqMajorCTP) {
+  protected static final void getRequestMajorAndCompat(final GLProfile glp, final int[/*2*/] reqMajorCTP) {
     final GLProfile glpImpl = glp.getImpl();
     if( glpImpl.isGL4() ) {
         reqMajorCTP[0]=4;
@@ -1743,9 +1755,9 @@ public abstract class GLContext {
     final int[] reqMajorCTP = new int[] { 0, 0 };
     getRequestMajorAndCompat(glp, reqMajorCTP);
 
-    int _major[] = { 0 };
-    int _minor[] = { 0 };
-    int _ctp[] = { 0 };
+    final int _major[] = { 0 };
+    final int _minor[] = { 0 };
+    final int _ctp[] = { 0 };
     if( GLContext.getAvailableGLVersion(device, reqMajorCTP[0], reqMajorCTP[1], _major, _minor, _ctp)) {
       return _ctp[0];
     }
@@ -1758,7 +1770,7 @@ public abstract class GLContext {
    * @param profile Key Value either {@link #CTX_PROFILE_COMPAT}, {@link #CTX_PROFILE_CORE} or {@link #CTX_PROFILE_ES}
    * @return the highest GLProfile for the device regarding availability, version and profile bits.
    */
-  protected static GLProfile getAvailableGLProfile(AbstractGraphicsDevice device, int reqMajor, int reqProfile)
+  protected static GLProfile getAvailableGLProfile(final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile)
           throws GLException {
     final String glpName = getAvailableGLProfileName(device, reqMajor, reqProfile);
     return null != glpName ? GLProfile.get(device, glpName) : null;
@@ -1770,11 +1782,11 @@ public abstract class GLContext {
    * @param profile Key Value either {@link #CTX_PROFILE_COMPAT}, {@link #CTX_PROFILE_CORE} or {@link #CTX_PROFILE_ES}
    * @return the highest GLProfile name for the device regarding availability, version and profile bits.
    */
-  /* package */ static String getAvailableGLProfileName(AbstractGraphicsDevice device, int reqMajor, int reqProfile)
+  /* package */ static String getAvailableGLProfileName(final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile)
           throws GLException {
-    int major[] = { 0 };
-    int minor[] = { 0 };
-    int ctp[] = { 0 };
+    final int major[] = { 0 };
+    final int minor[] = { 0 };
+    final int ctp[] = { 0 };
     if(GLContext.getAvailableGLVersion(device, reqMajor, reqProfile, major, minor, ctp)) {
         return GLContext.getGLProfile(major[0], minor[0], ctp[0]);
     }
@@ -1786,10 +1798,10 @@ public abstract class GLContext {
    * @param major Key Value either 1, 2, 3 or 4
    * @param profile Key Value either {@link #CTX_PROFILE_COMPAT}, {@link #CTX_PROFILE_CORE} or {@link #CTX_PROFILE_ES}
    */
-  protected static String getAvailableGLVersionAsString(AbstractGraphicsDevice device, int major, int profile) {
-    int _major[] = { 0 };
-    int _minor[] = { 0 };
-    int _ctp[] = { 0 };
+  protected static String getAvailableGLVersionAsString(final AbstractGraphicsDevice device, final int major, final int profile) {
+    final int _major[] = { 0 };
+    final int _minor[] = { 0 };
+    final int _ctp[] = { 0 };
     if(getAvailableGLVersion(device, major, profile, _major, _minor, _ctp)) {
         return getGLVersion(_major[0], _minor[0], _ctp[0], null);
     }
@@ -1809,7 +1821,7 @@ public abstract class GLContext {
    * @param glp {@link GLProfile} to check for FBO capabilities
    * @see GLContext#hasBasicFBOSupport()
    */
-  public static final boolean isFBOAvailable(AbstractGraphicsDevice device, GLProfile glp) {
+  public static final boolean isFBOAvailable(final AbstractGraphicsDevice device, final GLProfile glp) {
       return 0 != ( CTX_IMPL_FBO & getAvailableContextProperties(device, glp) );
   }
 
@@ -1818,7 +1830,7 @@ public abstract class GLContext {
    * @see GLContext#isHardwareRasterizer()
    * @see GLProfile#isHardwareRasterizer()
    */
-  public static final int isHardwareRasterizer(AbstractGraphicsDevice device, GLProfile glp) {
+  public static final int isHardwareRasterizer(final AbstractGraphicsDevice device, final GLProfile glp) {
       final int r;
       final int ctp = getAvailableContextProperties(device, glp);
       if(0 == ctp) {
@@ -1838,8 +1850,8 @@ public abstract class GLContext {
    * @param isHardware return value of one boolean, whether the profile is a hardware rasterizer or not
    * @return true if the requested GL version is available regardless of a software or hardware rasterizer, otherwise false.
    */
-  protected static boolean isGLVersionAvailable(AbstractGraphicsDevice device, int reqMajor, int reqProfile, boolean isHardware[]) {
-      Integer valI = getAvailableGLVersion(device, reqMajor, reqProfile);
+  protected static boolean isGLVersionAvailable(final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile, final boolean isHardware[]) {
+      final Integer valI = getAvailableGLVersion(device, reqMajor, reqProfile);
       if(null==valI) {
           return false;
       }
@@ -1847,15 +1859,15 @@ public abstract class GLContext {
       return true;
   }
 
-  public static boolean isGLES1Available(AbstractGraphicsDevice device, boolean isHardware[]) {
+  public static boolean isGLES1Available(final AbstractGraphicsDevice device, final boolean isHardware[]) {
       return isGLVersionAvailable(device, 1, GLContext.CTX_PROFILE_ES, isHardware);
   }
 
-  public static boolean isGLES2Available(AbstractGraphicsDevice device, boolean isHardware[]) {
+  public static boolean isGLES2Available(final AbstractGraphicsDevice device, final boolean isHardware[]) {
       return isGLVersionAvailable(device, 2, GLContext.CTX_PROFILE_ES, isHardware);
   }
 
-  public static boolean isGLES3Available(AbstractGraphicsDevice device, boolean isHardware[]) {
+  public static boolean isGLES3Available(final AbstractGraphicsDevice device, final boolean isHardware[]) {
       return isGLVersionAvailable(device, 3, GLContext.CTX_PROFILE_ES, isHardware);
   }
 
@@ -1867,10 +1879,10 @@ public abstract class GLContext {
    * Includes [ GL ≥ 4.3, GL ≥ 3.1 w/ GL_ARB_ES3_compatibility and GLES3 ]
    * </p>
    */
-  public static final boolean isGLES3CompatibleAvailable(AbstractGraphicsDevice device) {
-      int major[] = { 0 };
-      int minor[] = { 0 };
-      int ctp[] = { 0 };
+  public static final boolean isGLES3CompatibleAvailable(final AbstractGraphicsDevice device) {
+      final int major[] = { 0 };
+      final int minor[] = { 0 };
+      final int ctp[] = { 0 };
       boolean ok;
 
       ok = GLContext.getAvailableGLVersion(device, 3, GLContext.CTX_PROFILE_ES, major, minor, ctp);
@@ -1878,34 +1890,34 @@ public abstract class GLContext {
           ok = GLContext.getAvailableGLVersion(device, 3, GLContext.CTX_PROFILE_CORE, major, minor, ctp);
       }
       if( !ok ) {
-          ok = GLContext.getAvailableGLVersion(device, 3, GLContext.CTX_PROFILE_COMPAT, major, minor, ctp);
+          GLContext.getAvailableGLVersion(device, 3, GLContext.CTX_PROFILE_COMPAT, major, minor, ctp);
       }
       return 0 != ( ctp[0] & CTX_IMPL_ES3_COMPAT );
   }
 
-  public static boolean isGL4bcAvailable(AbstractGraphicsDevice device, boolean isHardware[]) {
+  public static boolean isGL4bcAvailable(final AbstractGraphicsDevice device, final boolean isHardware[]) {
       return isGLVersionAvailable(device, 4, CTX_PROFILE_COMPAT, isHardware);
   }
 
-  public static boolean isGL4Available(AbstractGraphicsDevice device, boolean isHardware[]) {
+  public static boolean isGL4Available(final AbstractGraphicsDevice device, final boolean isHardware[]) {
       return isGLVersionAvailable(device, 4, CTX_PROFILE_CORE, isHardware);
   }
 
-  public static boolean isGL3bcAvailable(AbstractGraphicsDevice device, boolean isHardware[]) {
+  public static boolean isGL3bcAvailable(final AbstractGraphicsDevice device, final boolean isHardware[]) {
       return isGLVersionAvailable(device, 3, CTX_PROFILE_COMPAT, isHardware);
   }
 
-  public static boolean isGL3Available(AbstractGraphicsDevice device, boolean isHardware[]) {
+  public static boolean isGL3Available(final AbstractGraphicsDevice device, final boolean isHardware[]) {
       return isGLVersionAvailable(device, 3, CTX_PROFILE_CORE, isHardware);
   }
 
-  public static boolean isGL2Available(AbstractGraphicsDevice device, boolean isHardware[]) {
+  public static boolean isGL2Available(final AbstractGraphicsDevice device, final boolean isHardware[]) {
     return isGLVersionAvailable(device, 2, CTX_PROFILE_COMPAT, isHardware);
   }
 
-  protected static String getGLVersion(int major, int minor, int ctp, String gl_version) {
+  protected static String getGLVersion(final int major, final int minor, final int ctp, final String gl_version) {
     boolean needColon = false;
-    StringBuilder sb = new StringBuilder();
+    final StringBuilder sb = new StringBuilder();
     sb.append(major);
     sb.append(".");
     sb.append(minor);
@@ -1937,15 +1949,15 @@ public abstract class GLContext {
   // internal string utils
   //
 
-  protected static String toHexString(int hex) {
+  protected static String toHexString(final int hex) {
     return "0x" + Integer.toHexString(hex);
   }
 
-  protected static String toHexString(long hex) {
+  protected static String toHexString(final long hex) {
     return "0x" + Long.toHexString(hex);
   }
 
-  private static boolean appendString(StringBuilder sb, String string, boolean needColon, boolean condition) {
+  private static boolean appendString(final StringBuilder sb, final String string, boolean needColon, final boolean condition) {
     if(condition) {
         if(needColon) {
             sb.append(", ");
diff --git a/src/jogl/classes/javax/media/opengl/GLDebugMessage.java b/src/jogl/classes/javax/media/opengl/GLDebugMessage.java
index acb33b0..3253450 100644
--- a/src/jogl/classes/javax/media/opengl/GLDebugMessage.java
+++ b/src/jogl/classes/javax/media/opengl/GLDebugMessage.java
@@ -51,7 +51,7 @@ public class GLDebugMessage {
      * @param dbgSeverity The ARB severity level
      * @param dbgMsg The debug message
      */
-    public GLDebugMessage(GLContext source, long when, int dbgSource, int dbgType, int dbgId, int dbgSeverity, String dbgMsg) {
+    public GLDebugMessage(final GLContext source, final long when, final int dbgSource, final int dbgType, final int dbgId, final int dbgSeverity, final String dbgMsg) {
         this.source = source;
         this.when = when;
         this.dbgSource = dbgSource;
@@ -71,14 +71,14 @@ public class GLDebugMessage {
      * @param dbgMsg
      * @return
      */
-    public static GLDebugMessage translateAMDEvent(GLContext source, long when, int dbgId, int amdDbgCategory, int dbgSeverity, String dbgMsg) {
+    public static GLDebugMessage translateAMDEvent(final GLContext source, final long when, final int dbgId, final int amdDbgCategory, final int dbgSeverity, final String dbgMsg) {
         int dbgSource, dbgType;
 
         // AMD category == ARB source/type
         switch(amdDbgCategory) {
             case GL2GL3.GL_DEBUG_CATEGORY_API_ERROR_AMD:
-                dbgSource = GL2GL3.GL_DEBUG_SOURCE_API;
-                dbgType = GL2GL3.GL_DEBUG_TYPE_ERROR;
+                dbgSource = GL2ES2.GL_DEBUG_SOURCE_API;
+                dbgType = GL2ES2.GL_DEBUG_TYPE_ERROR;
                 break;
 
             //
@@ -86,18 +86,18 @@ public class GLDebugMessage {
             //
 
             case GL2GL3.GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD:
-                dbgSource = GL2GL3.GL_DEBUG_SOURCE_WINDOW_SYSTEM;
-                dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
+                dbgSource = GL2ES2.GL_DEBUG_SOURCE_WINDOW_SYSTEM;
+                dbgType = GL2ES2.GL_DEBUG_TYPE_OTHER;
                 break;
 
             case GL2GL3.GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD:
-                dbgSource = GL2GL3.GL_DEBUG_SOURCE_SHADER_COMPILER;
-                dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
+                dbgSource = GL2ES2.GL_DEBUG_SOURCE_SHADER_COMPILER;
+                dbgType = GL2ES2.GL_DEBUG_TYPE_OTHER;
                 break;
 
             case GL2GL3.GL_DEBUG_CATEGORY_APPLICATION_AMD:
-                dbgSource = GL2GL3.GL_DEBUG_SOURCE_APPLICATION;
-                dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
+                dbgSource = GL2ES2.GL_DEBUG_SOURCE_APPLICATION;
+                dbgType = GL2ES2.GL_DEBUG_TYPE_OTHER;
                 break;
 
 
@@ -106,49 +106,49 @@ public class GLDebugMessage {
             //
 
             case GL2GL3.GL_DEBUG_CATEGORY_DEPRECATION_AMD:
-                dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
-                dbgType = GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR;
+                dbgSource = GL2ES2.GL_DEBUG_SOURCE_OTHER;
+                dbgType = GL2ES2.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR;
                 break;
 
             case GL2GL3.GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD:
-                dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
-                dbgType = GL2GL3.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR;
+                dbgSource = GL2ES2.GL_DEBUG_SOURCE_OTHER;
+                dbgType = GL2ES2.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR;
                 break;
 
             case GL2GL3.GL_DEBUG_CATEGORY_PERFORMANCE_AMD:
-                dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
-                dbgType = GL2GL3.GL_DEBUG_TYPE_PERFORMANCE;
+                dbgSource = GL2ES2.GL_DEBUG_SOURCE_OTHER;
+                dbgType = GL2ES2.GL_DEBUG_TYPE_PERFORMANCE;
                 break;
 
             case GL2GL3.GL_DEBUG_CATEGORY_OTHER_AMD:
             default:
-                dbgSource = GL2GL3.GL_DEBUG_SOURCE_OTHER;
-                dbgType = GL2GL3.GL_DEBUG_TYPE_OTHER;
+                dbgSource = GL2ES2.GL_DEBUG_SOURCE_OTHER;
+                dbgType = GL2ES2.GL_DEBUG_TYPE_OTHER;
         }
 
         return new GLDebugMessage(source, when, dbgSource, dbgType, dbgId, dbgSeverity, dbgMsg);
     }
 
-    public static int translateARB2AMDCategory(int dbgSource, int dbgType) {
+    public static int translateARB2AMDCategory(final int dbgSource, final int dbgType) {
         switch (dbgSource) {
-            case GL2GL3.GL_DEBUG_SOURCE_WINDOW_SYSTEM:
+            case GL2ES2.GL_DEBUG_SOURCE_WINDOW_SYSTEM:
                 return GL2GL3.GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD;
 
-            case GL2GL3.GL_DEBUG_SOURCE_SHADER_COMPILER:
+            case GL2ES2.GL_DEBUG_SOURCE_SHADER_COMPILER:
                 return GL2GL3.GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD;
 
-            case GL2GL3.GL_DEBUG_SOURCE_APPLICATION:
+            case GL2ES2.GL_DEBUG_SOURCE_APPLICATION:
                 return GL2GL3.GL_DEBUG_CATEGORY_APPLICATION_AMD;
         }
 
         switch(dbgType) {
-            case GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR:
+            case GL2ES2.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR:
                 return GL2GL3.GL_DEBUG_CATEGORY_DEPRECATION_AMD;
 
-            case GL2GL3.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR:
+            case GL2ES2.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR:
                 return GL2GL3.GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD;
 
-            case GL2GL3.GL_DEBUG_TYPE_PERFORMANCE:
+            case GL2ES2.GL_DEBUG_TYPE_PERFORMANCE:
                 return GL2GL3.GL_DEBUG_CATEGORY_PERFORMANCE_AMD;
         }
 
@@ -207,46 +207,46 @@ public class GLDebugMessage {
         return toString(null).toString();
     }
 
-    public static String getDbgSourceString(int dbgSource) {
+    public static String getDbgSourceString(final int dbgSource) {
         switch(dbgSource) {
-            case GL2GL3.GL_DEBUG_SOURCE_API: return "GL API";
-            case GL2GL3.GL_DEBUG_SOURCE_SHADER_COMPILER: return "GLSL or extension compiler";
-            case GL2GL3.GL_DEBUG_SOURCE_WINDOW_SYSTEM: return "Native Windowing binding";
-            case GL2GL3.GL_DEBUG_SOURCE_THIRD_PARTY: return "Third party";
-            case GL2GL3.GL_DEBUG_SOURCE_APPLICATION: return "Application";
-            case GL2GL3.GL_DEBUG_SOURCE_OTHER: return "generic";
+            case GL2ES2.GL_DEBUG_SOURCE_API: return "GL API";
+            case GL2ES2.GL_DEBUG_SOURCE_SHADER_COMPILER: return "GLSL or extension compiler";
+            case GL2ES2.GL_DEBUG_SOURCE_WINDOW_SYSTEM: return "Native Windowing binding";
+            case GL2ES2.GL_DEBUG_SOURCE_THIRD_PARTY: return "Third party";
+            case GL2ES2.GL_DEBUG_SOURCE_APPLICATION: return "Application";
+            case GL2ES2.GL_DEBUG_SOURCE_OTHER: return "generic";
             default: return "Unknown (" + toHexString(dbgSource) + ")";
         }
     }
 
-    public static String getDbgTypeString(int dbgType) {
+    public static String getDbgTypeString(final int dbgType) {
         switch(dbgType) {
-            case GL2GL3.GL_DEBUG_TYPE_ERROR: return "Error";
-            case GL2GL3.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: return "Warning: marked for deprecation";
-            case GL2GL3.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: return "Warning: undefined behavior";
-            case GL2GL3.GL_DEBUG_TYPE_PERFORMANCE: return "Warning: implementation dependent performance";
-            case GL2GL3.GL_DEBUG_TYPE_PORTABILITY: return "Warning: vendor-specific extension use";
-            case GL2GL3.GL_DEBUG_TYPE_OTHER: return "Warning: generic";
+            case GL2ES2.GL_DEBUG_TYPE_ERROR: return "Error";
+            case GL2ES2.GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: return "Warning: marked for deprecation";
+            case GL2ES2.GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: return "Warning: undefined behavior";
+            case GL2ES2.GL_DEBUG_TYPE_PERFORMANCE: return "Warning: implementation dependent performance";
+            case GL2ES2.GL_DEBUG_TYPE_PORTABILITY: return "Warning: vendor-specific extension use";
+            case GL2ES2.GL_DEBUG_TYPE_OTHER: return "Warning: generic";
             default: return "Unknown (" + toHexString(dbgType) + ")";
         }
     }
 
-    public static String getDbgSeverityString(int dbgSeverity) {
+    public static String getDbgSeverityString(final int dbgSeverity) {
         switch(dbgSeverity) {
-            case GL2GL3.GL_DEBUG_SEVERITY_HIGH: return "High: dangerous undefined behavior";
-            case GL2GL3.GL_DEBUG_SEVERITY_MEDIUM: return "Medium: Severe performance/deprecation/other warnings";
-            case GL2GL3.GL_DEBUG_SEVERITY_LOW: return "Low: Performance warnings (redundancy/undefined)";
+            case GL2ES2.GL_DEBUG_SEVERITY_HIGH: return "High: dangerous undefined behavior";
+            case GL2ES2.GL_DEBUG_SEVERITY_MEDIUM: return "Medium: Severe performance/deprecation/other warnings";
+            case GL2ES2.GL_DEBUG_SEVERITY_LOW: return "Low: Performance warnings (redundancy/undefined)";
             default: return "Unknown (" + toHexString(dbgSeverity) + ")";
         }
     }
 
-    public static StringBuilder toHexString(StringBuilder sb, int i) {
+    public static StringBuilder toHexString(StringBuilder sb, final int i) {
         if(null==sb) {
             sb = new StringBuilder();
         }
         return sb.append("0x").append(Integer.toHexString(i));
     }
-    public static String toHexString(int i) {
+    public static String toHexString(final int i) {
         return "0x"+Integer.toHexString(i);
     }
 
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawable.java b/src/jogl/classes/javax/media/opengl/GLDrawable.java
index 3c354a2..7ed057e 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawable.java
@@ -42,6 +42,7 @@ package javax.media.opengl;
 
 import javax.media.nativewindow.AbstractGraphicsConfiguration;
 import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.NativeSurfaceHolder;
 
 
 /** An abstraction for an OpenGL rendering target. A GLDrawable's
@@ -50,7 +51,7 @@ import javax.media.nativewindow.NativeSurface;
     create an OpenGL context, but all implementations of {@link
     GLAutoDrawable} do so upon creation. */
 
-public interface GLDrawable {
+public interface GLDrawable extends NativeSurfaceHolder {
   /**
    * Creates a new context for drawing to this drawable that will
    * optionally share buffer objects, textures and other server-side OpenGL
@@ -140,11 +141,17 @@ public interface GLDrawable {
    */
   public boolean isRealized();
 
-  /** Returns the current width of this GLDrawable. */
-  public int getWidth();
+  /**
+   * Returns the width of this {@link GLDrawable}'s {@link #getNativeSurface() surface} client area in pixel units.
+   * @see NativeSurface#getSurfaceWidth()
+   */
+  public int getSurfaceWidth();
 
-  /** Returns the current height of this GLDrawable. */
-  public int getHeight();
+  /**
+   * Returns the height of this {@link GLDrawable}'s {@link #getNativeSurface() surface} client area in pixel units.
+   * @see NativeSurface#getSurfaceHeight()
+   */
+  public int getSurfaceHeight();
 
   /**
    * Returns <code>true</code> if the drawable is rendered in
@@ -167,28 +174,52 @@ public interface GLDrawable {
   public void swapBuffers() throws GLException;
 
   /** Fetches the {@link GLCapabilitiesImmutable} corresponding to the chosen
-      OpenGL capabilities (pixel format / visual / GLProfile) for this drawable.<br>
+      OpenGL capabilities (pixel format / visual / GLProfile) for this drawable.
+      <p>
+      This query only returns the chosen capabilities if {@link #isRealized()}.
+      </p>
+      <p>
       On some platforms, the pixel format is not directly associated
       with the drawable; a best attempt is made to return a reasonable
-      value in this case. <br>
+      value in this case.
+      </p>
+      <p>
       This object shall be directly associated to the attached {@link NativeSurface}'s
       {@link AbstractGraphicsConfiguration}, and if changes are necessary,
       they should reflect those as well.
+      </p>
       @return The immutable queried instance.
+      @see #getRequestedGLCapabilities()
     */
   public GLCapabilitiesImmutable getChosenGLCapabilities();
 
+  /** Fetches the {@link GLCapabilitiesImmutable} corresponding to the user requested
+      OpenGL capabilities (pixel format / visual / GLProfile) for this drawable.
+      <p>
+      If {@link #isRealized() realized}, {@link #getChosenGLCapabilities() the chosen capabilities}
+      reflect the actual selected OpenGL capabilities.
+      </p>
+      @return The immutable queried instance.
+      @see #getChosenGLCapabilities()
+      @since 2.2
+    */
+  public GLCapabilitiesImmutable getRequestedGLCapabilities();
+
   /** Fetches the {@link GLProfile} for this drawable.
       Returns the GLProfile object, no copy.
     */
   public GLProfile getGLProfile();
 
   /**
-   * Returns the underlying native surface which surface handle
+   * {@inheritDoc}
+   * <p>
+   * Returns the underlying {@link NativeSurface} which {@link NativeSurface#getSurfaceHandle() native handle}
    * represents this OpenGL drawable's native resource.
+   * </p>
    *
    * @see #getHandle()
    */
+  @Override
   public NativeSurface getNativeSurface();
 
   /**
diff --git a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
index 9b823a6..71568ee 100644
--- a/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLDrawableFactory.java
@@ -43,6 +43,7 @@ package javax.media.opengl;
 import java.util.ArrayList;
 import java.util.List;
 
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.common.util.ReflectionUtil;
 import com.jogamp.opengl.GLAutoDrawableDelegate;
 import com.jogamp.opengl.GLRendererQuirks;
@@ -58,10 +59,10 @@ import javax.media.nativewindow.UpstreamSurfaceHook;
 
 import jogamp.opengl.Debug;
 
-/** <P> Provides a virtual machine- and operating system-independent
-    mechanism for creating {@link GLDrawable}s. </P>
-
-    <P> The {@link javax.media.opengl.GLCapabilities} objects passed
+/** <p> Provides a virtual machine- and operating system-independent
+    mechanism for creating {@link GLDrawable}s.
+    </p>
+    <p> The {@link javax.media.opengl.GLCapabilities} objects passed
     in to the various factory methods are used as a hint for the
     properties of the returned drawable. The default capabilities
     selection algorithm (equivalent to passing in a null {@link
@@ -71,9 +72,10 @@ import jogamp.opengl.Debug;
     GLCapabilitiesChooser} which can select from the available pixel
     formats. The GLCapabilitiesChooser mechanism may not be supported
     by all implementations or on all platforms, in which case any
-    passed GLCapabilitiesChooser will be ignored. </P>
+    passed GLCapabilitiesChooser will be ignored.
+    </p>
 
-    <P> Because of the multithreaded nature of the Java platform's
+    <p> Because of the multithreaded nature of the Java platform's
     Abstract Window Toolkit, it is typically not possible to immediately
     reject a given {@link GLCapabilities} as being unsupportable by
     either returning <code>null</code> from the creation routines or
@@ -82,36 +84,20 @@ import jogamp.opengl.Debug;
     implementation will cause a {@link GLException} to be raised
     during the first repaint of the {@link javax.media.opengl.awt.GLCanvas} or {@link
     javax.media.opengl.awt.GLJPanel} if the capabilities can not be met.<br>
-    {@link javax.media.opengl.GLPbuffer} are always
-    created immediately and their creation will fail with a
-    {@link javax.media.opengl.GLException} if errors occur. </P>
+    {@link GLOffscreenAutoDrawable} are created lazily,
+    see {@link #createOffscreenAutoDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int) createOffscreenAutoDrawable(..)}.
+    </p>
 
-    <P> The concrete GLDrawableFactory subclass instantiated by {@link
+    <p> The concrete GLDrawableFactory subclass instantiated by {@link
     #getFactory getFactory} can be changed by setting the system
     property <code>opengl.factory.class.name</code> to the
-    fully-qualified name of the desired class. </P>
+    fully-qualified name of the desired class.
+    </p>
 */
 public abstract class GLDrawableFactory {
 
   protected static final boolean DEBUG = Debug.debug("GLDrawable");
 
-  /**
-   * We have to disable support for ANGLE, the D3D ES2 emulation on Windows provided w/ Firefox and Chrome.
-   * When run in the mentioned browsers, the eglInitialize(..) implementation crashes.
-   * <p>
-   * This can be overridden by explicitly enabling ANGLE on Windows by setting the property
-   * <code>jogl.enable.ANGLE</code>.
-   * </p>
-   */
-  protected static final boolean enableANGLE = Debug.isPropertyDefined("jogl.enable.ANGLE", true);
-
-  /**
-   * In case no OpenGL ES implementation is required
-   * and if the running platform may have a buggy implementation,
-   * setting the property <code>jogl.disable.opengles</code> disables querying a possible existing OpenGL ES implementation.
-   */
-  protected static final boolean disableOpenGLES = Debug.isPropertyDefined("jogl.disable.opengles", true);
-
   private static volatile boolean isInit = false;
   private static GLDrawableFactory eglFactory;
   private static GLDrawableFactory nativeOSFactory;
@@ -142,8 +128,8 @@ public abstract class GLDrawableFactory {
 
     final String nwt = NativeWindowFactory.getNativeWindowType(true);
     GLDrawableFactory tmp = null;
-    String factoryClassName = Debug.getProperty("jogl.gldrawablefactory.class.name", true);
-    ClassLoader cl = GLDrawableFactory.class.getClassLoader();
+    String factoryClassName = PropertyAccess.getProperty("jogl.gldrawablefactory.class.name", true);
+    final ClassLoader cl = GLDrawableFactory.class.getClassLoader();
     if (null == factoryClassName) {
         if ( nwt == NativeWindowFactory.TYPE_X11 ) {
           factoryClassName = "jogamp.opengl.x11.glx.X11GLXDrawableFactory";
@@ -164,7 +150,7 @@ public abstract class GLDrawableFactory {
       }
       try {
           tmp = (GLDrawableFactory) ReflectionUtil.createInstance(factoryClassName, cl);
-      } catch (Exception jre) {
+      } catch (final Exception jre) {
           if (DEBUG || GLProfile.DEBUG) {
               System.err.println("Info: GLDrawableFactory.static - Native Platform: "+nwt+" - not available: "+factoryClassName);
               jre.printStackTrace();
@@ -176,10 +162,10 @@ public abstract class GLDrawableFactory {
     }
     tmp = null;
 
-    if(!disableOpenGLES) {
+    if(!GLProfile.disableOpenGLES) {
         try {
             tmp = (GLDrawableFactory) ReflectionUtil.createInstance("jogamp.opengl.egl.EGLDrawableFactory", cl);
-        } catch (Exception jre) {
+        } catch (final Exception jre) {
             if (DEBUG || GLProfile.DEBUG) {
                 System.err.println("Info: GLDrawableFactory.static - EGLDrawableFactory - not available");
                 jre.printStackTrace();
@@ -219,10 +205,10 @@ public abstract class GLDrawableFactory {
                 System.err.println("GLDrawableFactory.shutdownAll["+(i+1)+"/"+gldfCount+"]:  "+gldf.getClass().getName());
             }
             try {
-                gldf.resetDisplayGamma();
+                gldf.resetAllDisplayGammaNoSync();
                 gldf.shutdownImpl();
-            } catch (Throwable t) {
-                System.err.println("GLDrawableFactory.shutdownImpl: Catched "+t.getClass().getName()+" during factory shutdown #"+(i+1)+"/"+gldfCount+" "+gldf.getClass().getName());
+            } catch (final Throwable t) {
+                System.err.println("GLDrawableFactory.shutdownImpl: Caught "+t.getClass().getName()+" during factory shutdown #"+(i+1)+"/"+gldfCount+" "+gldf.getClass().getName());
                 if( DEBUG ) {
                     t.printStackTrace();
                 }
@@ -256,7 +242,70 @@ public abstract class GLDrawableFactory {
 
   protected abstract void shutdownImpl();
 
-  public abstract void resetDisplayGamma();
+  /**
+   * Sets the gamma, brightness, and contrast of the display associated with the given <code>surface</code>.
+   * <p>
+   * This functionality is not available on all platforms and
+   * graphics hardware. Returns true if the settings were successfully
+   * changed, false if not. This method may return false for some
+   * values of the incoming arguments even on hardware which does
+   * support the underlying functionality. </p>
+   * <p>
+   * If this method returns true, the display settings will
+   * automatically be reset to their original values upon JVM exit
+   * (assuming the JVM does not crash); if the user wishes to change
+   * the display settings back to normal ahead of time,
+   * use {@link #resetDisplayGamma(NativeSurface)} or {@link #resetAllDisplayGamma()}.
+   * </p>
+   * <p>
+   * It is recommended to call {@link #resetDisplayGamma(NativeSurface)} or {@link #resetAllDisplayGamma()}
+   * before calling e.g. <code>System.exit()</code> from the application rather than
+   * rely on the shutdown hook functionality due to inevitable race
+   * conditions and unspecified behavior during JVM teardown.
+   * </p>
+   * <p>
+   * This method may be called multiple times during the application's
+   * execution, but calling {@link #resetDisplayGamma(NativeSurface)}
+   * will only reset the settings to the values
+   * before the first call to this method. </p>
+   *
+   * @param surface denominates the display device
+   * @param gamma The gamma value, typically > 1.0 (default values vary, but typically roughly 1.0)
+   * @param brightness The brightness value between -1.0 and 1.0, inclusive (default values vary, but typically 0)
+   * @param contrast The contrast, greater than 0.0 (default values vary, but typically 1)
+   *
+   * @return true if gamma settings were successfully changed, false if not
+   * @throws IllegalArgumentException if any of the parameters were out-of-bounds
+   * @see #resetDisplayGamma(NativeSurface)
+   * @see #resetAllDisplayGamma()
+   */
+  public abstract boolean setDisplayGamma(final NativeSurface surface, final float gamma, final float brightness, final float contrast) throws IllegalArgumentException;
+
+  /**
+   * Resets the gamma, brightness and contrast values of the display associated with the given <code>surface</code>
+   * to its original values before {@link #setDisplayGamma(NativeSurface, float, float, float) setDisplayGamma}
+   * was called the first time.
+   * <p>
+   * While it is not explicitly required that this method be called before
+   * exiting manually, calling it is recommended because of the inevitable
+   * unspecified behavior during JVM teardown.
+   * </p>
+   */
+  public abstract void resetDisplayGamma(final NativeSurface surface);
+
+  /**
+   * Resets the gamma, brightness and contrast values of all modified
+   * displays to their original values before {@link #setDisplayGamma(NativeSurface, float, float, float) setDisplayGamma}
+   * was called the first time.
+   * <p>
+   * While it is not explicitly required that this method be called before
+   * exiting manually, calling it is recommended because of the inevitable
+   * unspecified behavior during JVM teardown.
+   * </p>
+   */
+  public abstract void resetAllDisplayGamma();
+
+  protected abstract void resetAllDisplayGammaNoSync();
 
   /**
    * Retrieve the default <code>device</code> {@link AbstractGraphicsDevice#getConnection() connection},
@@ -322,7 +371,7 @@ public abstract class GLDrawableFactory {
    * @param device which {@link AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
    * @return true if a shared resource could been created, otherwise false.
    */
-  protected final boolean createSharedResource(AbstractGraphicsDevice device) {
+  protected final boolean createSharedResource(final AbstractGraphicsDevice device) {
       return createSharedResourceImpl(device);
   }
   protected abstract boolean createSharedResourceImpl(AbstractGraphicsDevice device);
@@ -343,7 +392,7 @@ public abstract class GLDrawableFactory {
    * @see #getRendererQuirks(AbstractGraphicsDevice)
    * @see GLRendererQuirks
    */
-  public final boolean hasRendererQuirk(AbstractGraphicsDevice device, int quirk) {
+  public final boolean hasRendererQuirk(final AbstractGraphicsDevice device, final int quirk) {
       final GLRendererQuirks glrq = getRendererQuirks(device);
       return null != glrq ? glrq.exist(quirk) : false;
   }
@@ -385,11 +434,11 @@ public abstract class GLDrawableFactory {
    * @param glProfile GLProfile to determine the factory type, ie EGLDrawableFactory,
    *                or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL.
    */
-  public static GLDrawableFactory getFactory(GLProfile glProfile) throws GLException {
+  public static GLDrawableFactory getFactory(final GLProfile glProfile) throws GLException {
     return getFactoryImpl(glProfile.getImplName());
   }
 
-  protected static GLDrawableFactory getFactoryImpl(String glProfileImplName) throws GLException {
+  protected static GLDrawableFactory getFactoryImpl(final String glProfileImplName) throws GLException {
     if ( GLProfile.usesNativeGLES(glProfileImplName) ) {
         if(null!=eglFactory) {
             return eglFactory;
@@ -400,7 +449,7 @@ public abstract class GLDrawableFactory {
     throw new GLException("No GLDrawableFactory available for profile: "+glProfileImplName);
   }
 
-  protected static GLDrawableFactory getFactoryImpl(AbstractGraphicsDevice device) throws GLException {
+  protected static GLDrawableFactory getFactoryImpl(final AbstractGraphicsDevice device) throws GLException {
     if(null != nativeOSFactory && nativeOSFactory.getIsDeviceCompatible(device)) {
         return nativeOSFactory;
     }
@@ -473,57 +522,11 @@ public abstract class GLDrawableFactory {
    * incl it's offscreen {@link NativeSurface} with the given capabilites and dimensions.
    * <p>
    * The {@link GLOffscreenAutoDrawable}'s {@link GLDrawable} is {@link GLDrawable#isRealized() realized}
-   * and it's {@link GLContext} assigned but not yet made current.
-   * </p>
-   * <p>
-   * In case the passed {@link GLCapabilitiesImmutable} contains default values, i.e.
-   * {@link GLCapabilitiesImmutable#isOnscreen() caps.isOnscreen()} <code> == true</code>,
-   * it is auto-configured. Auto configuration will set {@link GLCapabilitiesImmutable caps} to offscreen
-   * and FBO <i>or</i> Pbuffer, whichever is available in that order.
-   * </p>
-   * <p>
-   * A FBO based auto drawable, {@link GLOffscreenAutoDrawable.FBO}, is created if both {@link GLCapabilitiesImmutable#isFBO() caps.isFBO()}
-   * and {@link GLContext#isFBOAvailable(AbstractGraphicsDevice, GLProfile) canCreateFBO(device, caps.getGLProfile())} is true.
-   * </p>
-   * <p>
-   * A Pbuffer based auto drawable is created if both {@link GLCapabilitiesImmutable#isPBuffer() caps.isPBuffer()}
-   * and {@link #canCreateGLPbuffer(AbstractGraphicsDevice, GLProfile) canCreateGLPbuffer(device)} is true.
-   * </p>
-   * <p>
-   * If neither FBO nor Pbuffer is available,
-   * a simple pixmap/bitmap auto drawable is created, which is unlikely to be hardware accelerated.
-   * </p>
-   * <p>
-   * The resulting {@link GLOffscreenAutoDrawable} has it's own independent device instance using <code>device</code> details.
-   * </p>
-   *
-   * @param device which {@link AbstractGraphicsDevice#getConnection() connection} denotes the shared device to be used, may be <code>null</code> for the platform's default device.
-   * @param caps the requested GLCapabilties
-   * @param chooser the custom chooser, may be null for default
-   * @param width the requested offscreen width
-   * @param height the requested offscreen height
-   * @return the created and initialized offscreen {@link GLOffscreenAutoDrawable} instance
-   *
-   * @throws GLException if any window system-specific errors caused
-   *         the creation of the Offscreen to fail.
-   *
-   * @see #createOffscreenDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int)
-   * @deprecated Use {@link #createOffscreenAutoDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int)
-   */
-  public abstract GLOffscreenAutoDrawable createOffscreenAutoDrawable(AbstractGraphicsDevice device,
-                                                                      GLCapabilitiesImmutable caps,
-                                                                      GLCapabilitiesChooser chooser,
-                                                                      int width, int height,
-                                                                      GLContext shareWith) throws GLException;
-
-  /**
-   * Creates a {@link GLDrawable#isRealized() realized} {@link GLOffscreenAutoDrawable}
-   * incl it's offscreen {@link NativeSurface} with the given capabilites and dimensions.
-   * <p>
-   * The {@link GLOffscreenAutoDrawable}'s {@link GLDrawable} is {@link GLDrawable#isRealized() realized}
    * <i>without</i> an assigned {@link GLContext}, hence not initialized completely.<br>
+   *
    * The {@link GLContext} can be assigned later manually via {@link GLAutoDrawable#setContext(GLContext, boolean) setContext(ctx)}
    * <i>or</i> it will be created <i>lazily</i> at the 1st {@link GLAutoDrawable#display() display()} method call.<br>
+   *
    * <i>Lazy</i> {@link GLContext} creation will take a shared {@link GLContext} into account
    * which has been set {@link GLOffscreenAutoDrawable#setSharedContext(GLContext) directly}
    * or {@link GLOffscreenAutoDrawable#setSharedAutoDrawable(GLAutoDrawable) via another GLAutoDrawable}.
@@ -715,38 +718,6 @@ public abstract class GLDrawableFactory {
    */
   public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp);
 
-  /**
-   * Creates a GLPbuffer {@link GLAutoDrawable} with the given capabilites and dimensions.
-   * <p>
-   * The GLPbuffer drawable is realized and initialized eagerly.
-   * </p>
-   *
-   * See the note in the overview documentation in {@link GLSharedContextSetter} and on
-   * <a href="../../../spec-overview.html#SHARING">context sharing</a>.
-   *
-   * @param device which {@link AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
-   * @param capabilities the requested capabilities
-   * @param chooser the custom chooser, may be null for default
-   * @param initialWidth initial width of pbuffer
-   * @param initialHeight initial height of pbuffer
-   * @param shareWith a shared GLContext this GLPbuffer shall use
-   *
-   * @return the created and initialized {@link GLPbuffer} instance
-   *
-   * @throws GLException if any window system-specific errors caused
-   *         the creation of the GLPbuffer to fail.
-   *
-   * @deprecated {@link GLPbuffer} is deprecated, use {@link #createOffscreenAutoDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int, GLContext)}
-   */
-  public abstract GLPbuffer createGLPbuffer(AbstractGraphicsDevice device,
-                                            GLCapabilitiesImmutable capabilities,
-                                            GLCapabilitiesChooser chooser,
-                                            int initialWidth,
-                                            int initialHeight,
-                                            GLContext shareWith)
-    throws GLException;
-
-
   //----------------------------------------------------------------------
   // Methods for interacting with third-party OpenGL libraries
 
diff --git a/src/jogl/classes/javax/media/opengl/GLEventListener.java b/src/jogl/classes/javax/media/opengl/GLEventListener.java
index c8c3440..995ca26 100644
--- a/src/jogl/classes/javax/media/opengl/GLEventListener.java
+++ b/src/jogl/classes/javax/media/opengl/GLEventListener.java
@@ -80,13 +80,23 @@ public interface GLEventListener extends EventListener {
       enabled. */
   public void display(GLAutoDrawable drawable);
 
-  /** Called by the drawable during the first repaint after the
-      component has been resized. The client can update the viewport
-      and view volume of the window appropriately, for example by a
-      call to {@link javax.media.opengl.GL#glViewport}; note that for
-      convenience the component has already called <code>glViewport(x,
-      y, width, height)</code> when this method is called, so the
-      client may not have to do anything in this method.
-  */
+  /**
+   * Called by the drawable during the first repaint after the
+   * component has been resized.
+   * <p>
+   * The client can update it's viewport associated data
+   * and view volume of the window appropriately.
+   * </p>
+   * <p>
+   * For efficiency the GL viewport has already been updated
+   * via <code>glViewport(x, y, width, height)</code> when this method is called.
+   * </p>
+   *
+   * @param drawable the triggering {@link GLAutoDrawable}
+   * @param x viewport x-coord in pixel units
+   * @param y viewport y-coord in pixel units
+   * @param width viewport width in pixel units
+   * @param height viewport height in pixel units
+   */
   public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height);
 }
diff --git a/src/jogl/classes/javax/media/opengl/GLException.java b/src/jogl/classes/javax/media/opengl/GLException.java
index 460f17b..3f76a62 100644
--- a/src/jogl/classes/javax/media/opengl/GLException.java
+++ b/src/jogl/classes/javax/media/opengl/GLException.java
@@ -41,7 +41,7 @@ package javax.media.opengl;
 
 /** A generic exception for OpenGL errors used throughout the binding
     as a substitute for {@link RuntimeException}. */
-
+ at SuppressWarnings("serial")
 public class GLException extends RuntimeException {
   /** Constructs a GLException object. */
   public GLException() {
@@ -50,19 +50,37 @@ public class GLException extends RuntimeException {
 
   /** Constructs a GLException object with the specified detail
       message. */
-  public GLException(String message) {
+  public GLException(final String message) {
     super(message);
   }
 
   /** Constructs a GLException object with the specified detail
       message and root cause. */
-  public GLException(String message, Throwable cause) {
+  public GLException(final String message, final Throwable cause) {
     super(message, cause);
   }
 
   /** Constructs a GLException object with the specified root
       cause. */
-  public GLException(Throwable cause) {
+  public GLException(final Throwable cause) {
     super(cause);
   }
+
+  /**
+   * Constructs a GLException object with the specified root
+   * cause with a decorating message including the current thread name.
+   * @since 2.2
+   */
+  public static GLException newGLException(final Throwable t) {
+      return new GLException("Caught "+t.getClass().getSimpleName()+": "+t.getMessage()+" on thread "+Thread.currentThread().getName(), t);
+  }
+
+  /**
+   * Dumps a Throwable in a decorating message including the current thread name, and stack trace.
+   * @since 2.2
+   */
+  public static void dumpThrowable(final String additionalDescr, final Throwable t) {
+      System.err.println("Caught "+additionalDescr+" "+t.getClass().getSimpleName()+": "+t.getMessage()+" on thread "+Thread.currentThread().getName());
+      t.printStackTrace();
+  }
 }
diff --git a/src/jogl/classes/javax/media/opengl/GLFBODrawable.java b/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
index 052b08a..f423e0e 100644
--- a/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLFBODrawable.java
@@ -31,6 +31,8 @@ package javax.media.opengl;
 import javax.media.nativewindow.NativeWindowException;
 
 import com.jogamp.opengl.FBObject;
+import com.jogamp.opengl.FBObject.Colorbuffer;
+import com.jogamp.opengl.FBObject.ColorAttachment;
 import com.jogamp.opengl.FBObject.TextureAttachment;
 
 /**
@@ -62,12 +64,12 @@ import com.jogamp.opengl.FBObject.TextureAttachment;
  * </p>
  * <p>
  * It would be possible to implement double buffering simply using
- * {@link TextureAttachment}s with one {@link FBObject framebuffer}.
+ * {@link Colorbuffer}s with one {@link FBObject framebuffer}.
  * This would require mode selection and hence complicate the API. Besides, it would
  * not support differentiation of read and write framebuffer and hence not be spec compliant.
  * </p>
  * <p>
- * Actual swapping of the {@link TextureAttachment texture}s and/or {@link FBObject framebuffer}
+ * Actual swapping of the {@link Colorbuffer}s and/or {@link FBObject framebuffer}
  * is performed either in the {@link jogamp.opengl.GLContextImpl#contextMadeCurrent(boolean) context current hook}
  * or when {@link jogamp.opengl.GLDrawableImpl#swapBuffersImpl(boolean) swapping buffers}, whatever comes first.
  * </p>
@@ -75,19 +77,43 @@ import com.jogamp.opengl.FBObject.TextureAttachment;
 public interface GLFBODrawable extends GLDrawable {
     // public enum DoubleBufferMode { NONE, TEXTURE, FBO }; // TODO: Add or remove TEXTURE (only) DoubleBufferMode support
 
+    /** FBO Mode Bit: Use a {@link TextureAttachment} for the {@link #getColorbuffer(int) render colorbuffer} ({@link #FBOMODE_DEFAULT default}), see {@link #setFBOMode(int)}. */
+    public static final int FBOMODE_USE_TEXTURE = 1 << 0;
+    /** FBO Mode Bit: Use a depth renderbuffer ({@link #FBOMODE_DEFAULT default}), see {@link #setFBOMode(int)}. */
+    public static final int FBOMODE_USE_DEPTH   = 1 << 1;
+
+    /** FBO Default Mode Bit: {@link #FBOMODE_USE_TEXTURE} | {@link #FBOMODE_USE_DEPTH}. */
+    public static final int FBOMODE_DEFAULT   = FBOMODE_USE_TEXTURE | FBOMODE_USE_DEPTH;
+
     /**
      * @return <code>true</code> if initialized, i.e. a {@link GLContext} is bound and made current once, otherwise <code>false</code>.
      */
     public boolean isInitialized();
 
     /**
+     * Set the FBO mode bits used for FBO creation.
+     * <p>
+     * See {@link #FBOMODE_DEFAULT} values.
+     * </p>
+     *
+     * @param modeBits custom FBO mode bits like {@link #FBOMODE_USE_TEXTURE} and {@link #FBOMODE_USE_DEPTH}.
+     * @throws IllegalStateException if the underlying FBO is already {@link #isInitialized()}.
+     */
+    void setFBOMode(final int modeBits) throws IllegalStateException;
+
+    /**
+     * @return the used FBO mode bits, mutable via {@link #setFBOMode(int)}
+     */
+    int getFBOMode();
+
+    /**
      * Notify this instance about upstream size change
      * to reconfigure the {@link FBObject}.
      * @param gl GL context object bound to this drawable, will be made current during operation.
      *           A prev. current context will be make current after operation.
      * @throws GLException if resize operation failed
      */
-    void resetSize(GL gl) throws GLException;
+    void resetSize(final GL gl) throws GLException;
 
     /**
      * @return the used texture unit
@@ -98,7 +124,7 @@ public interface GLFBODrawable extends GLDrawable {
      *
      * @param unit the texture unit to be used
      */
-    void setTextureUnit(int unit);
+    void setTextureUnit(final int unit);
 
     /**
      * Set the number of sample buffers if using MSAA
@@ -108,7 +134,7 @@ public interface GLFBODrawable extends GLDrawable {
      * @param newSamples new sample size
      * @throws GLException if resetting the FBO failed
      */
-    void setNumSamples(GL gl, int newSamples) throws GLException;
+    void setNumSamples(final GL gl, final int newSamples) throws GLException;
 
     /**
      * @return the number of sample buffers if using MSAA, otherwise 0
@@ -126,7 +152,7 @@ public interface GLFBODrawable extends GLDrawable {
      * @return the new number of buffers (FBO) used, maybe different than the requested <code>bufferCount</code> (see above)
      * @throws GLException if already initialized, see {@link #isInitialized()}.
      */
-    int setNumBuffers(int bufferCount) throws GLException;
+    int setNumBuffers(final int bufferCount) throws GLException;
 
     /**
      * @return the number of buffers (FBO) being used. 1 if not using {@link GLCapabilities#getDoubleBuffered() double buffering},
@@ -162,34 +188,39 @@ public interface GLFBODrawable extends GLDrawable {
      * @return the named {@link FBObject}
      * @throws IllegalArgumentException if an illegal buffer name is being used
      */
-    FBObject getFBObject(int bufferName) throws IllegalArgumentException;
+    FBObject getFBObject(final int bufferName) throws IllegalArgumentException;
 
     /**
-     * Returns the named texture buffer.
+     * Returns the named {@link Colorbuffer} instance.
      * <p>
      * If MSAA is being used, only the {@link GL#GL_FRONT} buffer is accessible
      * and an exception is being thrown if {@link GL#GL_BACK} is being requested.
      * </p>
+     * <p>
+     * Depending on the {@link #setFBOMode(int) fbo mode} the resulting {@link Colorbuffer}
+     * is either a {@link TextureAttachment} ({@link #FBOMODE_DEFAULT default}) or a {@link ColorAttachment},
+     * see {@link Colorbuffer#isTextureAttachment()}.
+     * </p>
      * @param bufferName {@link GL#GL_FRONT} and {@link GL#GL_BACK} are valid buffer names
-     * @return the named {@link TextureAttachment}
+     * @return the named {@link Colorbuffer}
      * @throws IllegalArgumentException if using MSAA and {@link GL#GL_BACK} is requested or an illegal buffer name is being used
      */
-    FBObject.TextureAttachment getTextureBuffer(int bufferName) throws IllegalArgumentException;
+    Colorbuffer getColorbuffer(final int bufferName) throws IllegalArgumentException;
 
     /** Resizeable {@link GLFBODrawable} specialization */
     public interface Resizeable extends GLFBODrawable {
         /**
-         * Resize this drawable.
+         * Resize this {@link GLFBODrawable}'s surface.
          * <p>
          * This drawable is being locked during operation.
          * </p>
          * @param context the {@link GLContext} bound to this drawable, will be made current during operation
          *                A prev. current context will be make current after operation.
-         * @param newWidth
-         * @param newHeight
+         * @param newWidth new width in pixel units
+         * @param newHeight new width in pixel units
          * @throws NativeWindowException in case the surface could no be locked
          * @throws GLException in case an error during the resize operation occurred
          */
-        void setSize(GLContext context, int newWidth, int newHeight) throws NativeWindowException, GLException;
+        void setSurfaceSize(GLContext context, int newWidth, int newHeight) throws NativeWindowException, GLException;
     }
 }
diff --git a/src/jogl/classes/javax/media/opengl/GLOffscreenAutoDrawable.java b/src/jogl/classes/javax/media/opengl/GLOffscreenAutoDrawable.java
index d34edaf..a694802 100644
--- a/src/jogl/classes/javax/media/opengl/GLOffscreenAutoDrawable.java
+++ b/src/jogl/classes/javax/media/opengl/GLOffscreenAutoDrawable.java
@@ -37,19 +37,19 @@ import com.jogamp.opengl.FBObject;
  * exposing offscreen functionality.
  * <p>
  * This class distinguishes itself from {@link GLAutoDrawable}
- * with it's {@link #setSize(int, int)} functionality.
+ * with it's {@link #setSurfaceSize(int, int)} functionality.
  * </p>
  */
 public interface GLOffscreenAutoDrawable extends GLAutoDrawable, GLSharedContextSetter {
 
     /**
-     * Resize this auto drawable.
-     * @param newWidth
-     * @param newHeight
+     * Resize this {@link GLAutoDrawable}'s surface
+     * @param newWidth new width in pixel units
+     * @param newHeight new height in pixel units
      * @throws NativeWindowException in case the surface could no be locked
      * @throws GLException in case of an error during the resize operation
      */
-    void setSize(int newWidth, int newHeight) throws NativeWindowException, GLException;
+    void setSurfaceSize(int newWidth, int newHeight) throws NativeWindowException, GLException;
 
     /**
      * Set the upstream UI toolkit object.
diff --git a/src/jogl/classes/javax/media/opengl/GLPbuffer.java b/src/jogl/classes/javax/media/opengl/GLPbuffer.java
deleted file mode 100644
index f36a4bf..0000000
--- a/src/jogl/classes/javax/media/opengl/GLPbuffer.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- *
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package javax.media.opengl;
-
-/** Provides offscreen rendering support via pbuffers. The principal
-    addition of this interface is a {@link #destroy} method to
-    deallocate the pbuffer and its associated resources. It also
-    contains experimental methods for accessing the pbuffer's contents
-    as a texture map and enabling rendering to floating-point frame
-    buffers. These methods are not guaranteed to be supported on all
-    platforms and may be deprecated in a future release.
-
-    @deprecated Use {@link GLOffscreenAutoDrawable} w/ {@link GLCapabilities#setFBO(boolean)}
-                via {@link GLDrawableFactory#createOffscreenAutoDrawable(javax.media.nativewindow.AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int, GLContext) GLDrawableFactory.createOffscreenAutoDrawable(..)}.
-  */
-public interface GLPbuffer extends GLAutoDrawable {
-  /** Destroys the native resources associated with this pbuffer. It
-      is not valid to call display() or any other routines on this
-      pbuffer after it has been destroyed. Before destroying the
-      pbuffer, the application must destroy any additional OpenGL
-      contexts which have been created for the pbuffer via {@link
-      #createContext}. */
-  @Override
-  public void destroy();
-}
diff --git a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
index d947bad..ab12ba1 100644
--- a/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
+++ b/src/jogl/classes/javax/media/opengl/GLPipelineFactory.java
@@ -88,7 +88,7 @@ public class GLPipelineFactory {
      * @param downstream is always the 1st argument for the upstream constructor
      * @param additionalArgs additional arguments for the upstream constructor
      */
-    public static final GL create(String pipelineClazzBaseName, Class<?> reqInterface, GL downstream, Object[] additionalArgs) {
+    public static final GL create(final String pipelineClazzBaseName, final Class<?> reqInterface, final GL downstream, final Object[] additionalArgs) {
         Class<?> downstreamClazz = downstream.getClass();
         Class<?> upstreamClazz = null;
         Class<?> interfaceClazz = null;
@@ -101,7 +101,7 @@ public class GLPipelineFactory {
         do {
             // For all interfaces: right -> left == child -> parent
             //   It is important that this matches with the gluegen cfg file's 'Implements' clause !
-            Class<?>[] clazzes = downstreamClazz.getInterfaces();
+            final Class<?>[] clazzes = downstreamClazz.getInterfaces();
             for(int i=clazzes.length-1; null==upstreamClazz && i>=0; i--) {
                 if(DEBUG) {
                     System.out.println("GLPipelineFactory: Try "+downstreamClazz.getName()+" Interface["+i+"]: "+clazzes[i].getName());
@@ -142,7 +142,7 @@ public class GLPipelineFactory {
             System.out.println("GLPipelineFactory: Got : "+ upstreamClazz.getName()+", base interface: "+interfaceClazz.getName());
         }
 
-        Class<?>[] cstrArgTypes = new Class<?>[ 1 + ( ( null==additionalArgs ) ? 0 : additionalArgs.length ) ] ;
+        final Class<?>[] cstrArgTypes = new Class<?>[ 1 + ( ( null==additionalArgs ) ? 0 : additionalArgs.length ) ] ;
         {
             int i = 0;
             cstrArgTypes[i++] = interfaceClazz;
@@ -151,10 +151,10 @@ public class GLPipelineFactory {
             }
         }
         // throws exception if cstr not found!
-        Constructor<?> cstr = ReflectionUtil.getConstructor(upstreamClazz, cstrArgTypes);
+        final Constructor<?> cstr = ReflectionUtil.getConstructor(upstreamClazz, cstrArgTypes);
         Object instance = null;
         try {
-            Object[] cstrArgs = new Object[ 1 + ( ( null==additionalArgs ) ? 0 : additionalArgs.length ) ] ;
+            final Object[] cstrArgs = new Object[ 1 + ( ( null==additionalArgs ) ? 0 : additionalArgs.length ) ] ;
             {
                 int i = 0;
                 cstrArgs[i++] = downstream;
@@ -163,7 +163,7 @@ public class GLPipelineFactory {
                 }
             }
             instance = cstr.newInstance( cstrArgs ) ;
-        } catch (Throwable t) { t.printStackTrace(); }
+        } catch (final Throwable t) { t.printStackTrace(); }
         if(null==instance) {
             throw new GLException("Error: Couldn't create instance of pipeline: "+upstreamClazz.getName()+
                                   " ( "+getArgsClassNameList(downstreamClazz, additionalArgs) +" )");
@@ -174,8 +174,8 @@ public class GLPipelineFactory {
         return (GL) instance;
     }
 
-    private static final String getArgsClassNameList(Class<?> arg0, Object[] args) {
-        StringBuilder sb = new StringBuilder();
+    private static final String getArgsClassNameList(final Class<?> arg0, final Object[] args) {
+        final StringBuilder sb = new StringBuilder();
         sb.append(arg0.getName());
         if(args!=null) {
             for(int j=0; j<args.length; j++) {
@@ -186,20 +186,20 @@ public class GLPipelineFactory {
         return sb.toString();
     }
 
-    private static final Class<?> getUpstreamClazz(Class<?> downstreamClazz, String pipelineClazzBaseName) {
-        String downstreamClazzName = downstreamClazz.getName();
+    private static final Class<?> getUpstreamClazz(final Class<?> downstreamClazz, final String pipelineClazzBaseName) {
+        final String downstreamClazzName = downstreamClazz.getName();
 
-        StringTokenizer st = new StringTokenizer(downstreamClazzName, ".");
+        final StringTokenizer st = new StringTokenizer(downstreamClazzName, ".");
         String downstreamClazzBaseName = downstreamClazzName;
         while(st.hasMoreTokens()) {
             downstreamClazzBaseName = st.nextToken();
         }
-        String upstreamClazzName = pipelineClazzBaseName+downstreamClazzBaseName;
+        final String upstreamClazzName = pipelineClazzBaseName+downstreamClazzBaseName;
 
         Class<?> upstreamClazz = null;
         try {
             upstreamClazz = Class.forName(upstreamClazzName, true, GLPipelineFactory.class.getClassLoader());
-        } catch (Throwable e) { e.printStackTrace(); }
+        } catch (final Throwable e) { e.printStackTrace(); }
 
         return upstreamClazz;
     }
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index 80f4695..d39d0f1 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -37,7 +37,6 @@
 
 package javax.media.opengl;
 
-import jogamp.nativewindow.NWJNILibLoader;
 import jogamp.opengl.Debug;
 import jogamp.opengl.GLDrawableFactoryImpl;
 import jogamp.opengl.DesktopGLDynamicLookupHelper;
@@ -45,6 +44,7 @@ import jogamp.opengl.DesktopGLDynamicLookupHelper;
 import com.jogamp.common.GlueGenVersion;
 import com.jogamp.common.jvm.JNILibLoaderBase;
 import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.common.util.ReflectionUtil;
 import com.jogamp.common.util.VersionUtil;
 import com.jogamp.common.util.cache.TempJarCache;
@@ -76,11 +76,55 @@ import java.util.Map;
  */
 public class GLProfile {
 
-    public static final boolean DEBUG = Debug.debug("GLProfile");
+    public static final boolean DEBUG;
+
+    /**
+     * In case no OpenGL ES profiles are required
+     * and if one platform may have a buggy implementation,
+     * setting the property <code>jogl.disable.opengles</code> disables querying possible existing OpenGL ES profiles.
+     */
+    public static final boolean disableOpenGLES;
+
+    /**
+     * In case no native OpenGL core profiles are required
+     * and if one platform may have a buggy implementation,
+     * setting the property <code>jogl.disable.openglcore</code> disables querying possible existing native OpenGL core profiles.
+     * <p>
+     * This exclusion is disabled for {@link Platform.OSType#MACOS}.
+     * </p>
+     */
+    public static final boolean disableOpenGLCore;
+
+    /**
+     * In case the implementation of the <i>ARB_create_context</i>
+     * context creation extension is buggy on one platform,
+     * setting the property <code>jogl.disable.openglarbcontext</code> disables utilizing it.
+     * <p>
+     * This exclusion is disabled for {@link Platform.OSType#MACOS}.
+     * </p>
+     */
+    public static final boolean disableOpenGLARBContext;
+
+    /**
+     * We have to disable support for ANGLE, the D3D ES2 emulation on Windows provided w/ Firefox and Chrome.
+     * When run in the mentioned browsers, the eglInitialize(..) implementation crashes.
+     * <p>
+     * This can be overridden by explicitly enabling ANGLE on Windows by setting the property
+     * <code>jogl.enable.ANGLE</code>.
+     * </p>
+     */
+    public static final boolean enableANGLE;
 
     static {
         // Also initializes TempJarCache if shall be used.
         Platform.initSingleton();
+        final boolean isOSX = Platform.OSType.MACOS == Platform.getOSType();
+
+        DEBUG = Debug.debug("GLProfile");
+        disableOpenGLES = PropertyAccess.isPropertyDefined("jogl.disable.opengles", true);
+        disableOpenGLCore = PropertyAccess.isPropertyDefined("jogl.disable.openglcore", true) && !isOSX;
+        disableOpenGLARBContext = PropertyAccess.isPropertyDefined("jogl.disable.openglarbcontext", true) && !isOSX;
+        enableANGLE = PropertyAccess.isPropertyDefined("jogl.enable.ANGLE", true);
     }
 
     /**
@@ -132,10 +176,10 @@ public class GLProfile {
 
                         if(TempJarCache.isInitialized()) {
                            final ClassLoader cl = GLProfile.class.getClassLoader();
-                           final String newtFactoryClassName = "com.jogamp.newt.NewtFactory";
-                           final Class<?>[] classesFromJavaJars = new Class<?>[] { NWJNILibLoader.class, GLProfile.class, null };
-                           if( ReflectionUtil.isClassAvailable(newtFactoryClassName, cl) ) {
-                               classesFromJavaJars[2] = ReflectionUtil.getClass(newtFactoryClassName, false, cl);
+                           final String newtDebugClassName = "jogamp.newt.Debug";
+                           final Class<?>[] classesFromJavaJars = new Class<?>[] { jogamp.nativewindow.Debug.class, jogamp.opengl.Debug.class, null };
+                           if( ReflectionUtil.isClassAvailable(newtDebugClassName, cl) ) {
+                               classesFromJavaJars[2] = ReflectionUtil.getClass(newtDebugClassName, false, cl);
                            }
                            JNILibLoaderBase.addNativeJarLibsJoglCfg(classesFromJavaJars);
                         }
@@ -167,7 +211,7 @@ public class GLProfile {
      *
      * @throws GLException if no profile for the given device is available.
      */
-    public static void initProfiles(AbstractGraphicsDevice device) throws GLException {
+    public static void initProfiles(final AbstractGraphicsDevice device) throws GLException {
         getProfileMap(device, true);
     }
 
@@ -208,11 +252,11 @@ public class GLProfile {
      *        or <code>[ null, GL ]</code> for the default profile.
      * @return true if the profile is available for the device, otherwise false.
      */
-    public static boolean isAvailable(AbstractGraphicsDevice device, String profile) {
+    public static boolean isAvailable(final AbstractGraphicsDevice device, final String profile) {
         initSingleton();
         return isAvailableImpl(getProfileMap(device, false), profile);
     }
-    private static boolean isAvailableImpl(HashMap<String /*GLProfile_name*/, GLProfile> map, String profile) {
+    private static boolean isAvailableImpl(final HashMap<String /*GLProfile_name*/, GLProfile> map, final String profile) {
         return null != map && null != map.get(profile);
     }
 
@@ -223,7 +267,7 @@ public class GLProfile {
      *        or <code>[ null, GL ]</code> for the default profile.
      * @return true if the profile is available for the default device, otherwise false.
      */
-    public static boolean isAvailable(String profile) {
+    public static boolean isAvailable(final String profile) {
         return isAvailable(null, profile);
     }
 
@@ -236,21 +280,21 @@ public class GLProfile {
         return isAvailable(null, null);
     }
 
-    public static String glAvailabilityToString(AbstractGraphicsDevice device) {
+    public static String glAvailabilityToString(final AbstractGraphicsDevice device) {
         return glAvailabilityToString(device, null).toString();
     }
 
-    public static StringBuilder glAvailabilityToString(AbstractGraphicsDevice device, StringBuilder sb) {
+    public static StringBuilder glAvailabilityToString(final AbstractGraphicsDevice device, final StringBuilder sb) {
         return glAvailabilityToString(device, sb, null, 0);
     }
-    private static StringBuilder doIndent(StringBuilder sb, String indent, int indentCount) {
+    private static StringBuilder doIndent(final StringBuilder sb, final String indent, int indentCount) {
         while(indentCount>0) {
             sb.append(indent);
             indentCount--;
         }
         return sb;
     }
-    public static StringBuilder glAvailabilityToString(AbstractGraphicsDevice device, StringBuilder sb, String indent, int indentCount) {
+    public static StringBuilder glAvailabilityToString(AbstractGraphicsDevice device, StringBuilder sb, final String indent, int indentCount) {
         boolean avail;
         if(null == sb) {
             sb = new StringBuilder();
@@ -425,7 +469,7 @@ public class GLProfile {
         int profileCount = 0;
 
         if(null != map) {
-            for (Map.Entry<String,GLProfile> entry : map.entrySet()) {
+            for (final Map.Entry<String,GLProfile> entry : map.entrySet()) {
                 if( !GL_DEFAULT.equals(entry.getKey()) ) {
                     if(useIndent) {
                         doIndent(sb.append(Platform.getNewline()), indent, indentCount);
@@ -444,7 +488,7 @@ public class GLProfile {
             }
             try {
                 sb.append(getDefault(device));
-            } catch (GLException gle) {
+            } catch (final GLException gle) {
                 sb.append("n/a");
             }
         }
@@ -628,8 +672,8 @@ public class GLProfile {
      * @throws GLException if no profile is available for the device.
      * @see #GL_PROFILE_LIST_ALL
      */
-    public static GLProfile getDefault(AbstractGraphicsDevice device) {
-        GLProfile glp = get(device, GL_DEFAULT);
+    public static GLProfile getDefault(final AbstractGraphicsDevice device) {
+        final GLProfile glp = get(device, GL_DEFAULT);
         return glp;
     }
 
@@ -650,7 +694,7 @@ public class GLProfile {
      * @throws GLException if no profile is available for the device.
      * @see #GL_PROFILE_LIST_MAX
      */
-    public static GLProfile getMaximum(AbstractGraphicsDevice device, boolean favorHardwareRasterizer)
+    public static GLProfile getMaximum(final AbstractGraphicsDevice device, final boolean favorHardwareRasterizer)
         throws GLException
     {
         return get(device, GL_PROFILE_LIST_MAX, favorHardwareRasterizer);
@@ -660,7 +704,7 @@ public class GLProfile {
      * @throws GLException if no profile is available for the default device.
      * @see #GL_PROFILE_LIST_MAX
      */
-    public static GLProfile getMaximum(boolean favorHardwareRasterizer)
+    public static GLProfile getMaximum(final boolean favorHardwareRasterizer)
         throws GLException
     {
         return get(GL_PROFILE_LIST_MAX, favorHardwareRasterizer);
@@ -673,7 +717,7 @@ public class GLProfile {
      * @throws GLException if no desktop profile is available for the device.
      * @see #GL_PROFILE_LIST_MIN
      */
-    public static GLProfile getMinimum(AbstractGraphicsDevice device, boolean favorHardwareRasterizer)
+    public static GLProfile getMinimum(final AbstractGraphicsDevice device, final boolean favorHardwareRasterizer)
         throws GLException
     {
         return get(device, GL_PROFILE_LIST_MIN, favorHardwareRasterizer);
@@ -683,7 +727,7 @@ public class GLProfile {
      * @throws GLException if no desktop profile is available for the default device.
      * @see #GL_PROFILE_LIST_MIN
      */
-    public static GLProfile getMinimum(boolean favorHardwareRasterizer)
+    public static GLProfile getMinimum(final boolean favorHardwareRasterizer)
         throws GLException
     {
         return get(GL_PROFILE_LIST_MIN, favorHardwareRasterizer);
@@ -697,7 +741,7 @@ public class GLProfile {
      * @throws GLException if no fixed function profile is available for the device.
      * @see #GL_PROFILE_LIST_MAX_FIXEDFUNC
      */
-    public static GLProfile getMaxFixedFunc(AbstractGraphicsDevice device, boolean favorHardwareRasterizer)
+    public static GLProfile getMaxFixedFunc(final AbstractGraphicsDevice device, final boolean favorHardwareRasterizer)
         throws GLException
     {
         return get(device, GL_PROFILE_LIST_MAX_FIXEDFUNC, favorHardwareRasterizer);
@@ -707,7 +751,7 @@ public class GLProfile {
      * @throws GLException if no fixed function profile is available for the default device.
      * @see #GL_PROFILE_LIST_MAX_FIXEDFUNC
      */
-    public static GLProfile getMaxFixedFunc(boolean favorHardwareRasterizer)
+    public static GLProfile getMaxFixedFunc(final boolean favorHardwareRasterizer)
         throws GLException
     {
         return get(GL_PROFILE_LIST_MAX_FIXEDFUNC, favorHardwareRasterizer);
@@ -720,7 +764,7 @@ public class GLProfile {
      * @throws GLException if no programmable profile is available for the device.
      * @see #GL_PROFILE_LIST_MAX_PROGSHADER
      */
-    public static GLProfile getMaxProgrammable(AbstractGraphicsDevice device, boolean favorHardwareRasterizer)
+    public static GLProfile getMaxProgrammable(final AbstractGraphicsDevice device, final boolean favorHardwareRasterizer)
         throws GLException
     {
         return get(device, GL_PROFILE_LIST_MAX_PROGSHADER, favorHardwareRasterizer);
@@ -730,7 +774,7 @@ public class GLProfile {
      * @throws GLException if no programmable profile is available for the default device.
      * @see #GL_PROFILE_LIST_MAX_PROGSHADER
      */
-    public static GLProfile getMaxProgrammable(boolean favorHardwareRasterizer)
+    public static GLProfile getMaxProgrammable(final boolean favorHardwareRasterizer)
         throws GLException
     {
         return get(GL_PROFILE_LIST_MAX_PROGSHADER, favorHardwareRasterizer);
@@ -743,7 +787,7 @@ public class GLProfile {
      * @throws GLException if no programmable core profile is available for the device.
      * @see #GL_PROFILE_LIST_MAX_PROGSHADER_CORE
      */
-    public static GLProfile getMaxProgrammableCore(AbstractGraphicsDevice device, boolean favorHardwareRasterizer)
+    public static GLProfile getMaxProgrammableCore(final AbstractGraphicsDevice device, final boolean favorHardwareRasterizer)
         throws GLException
     {
         return get(device, GL_PROFILE_LIST_MAX_PROGSHADER_CORE, favorHardwareRasterizer);
@@ -753,7 +797,7 @@ public class GLProfile {
      * @throws GLException if no programmable core profile is available for the default device.
      * @see #GL_PROFILE_LIST_MAX_PROGSHADER_CORE
      */
-    public static GLProfile getMaxProgrammableCore(boolean favorHardwareRasterizer)
+    public static GLProfile getMaxProgrammableCore(final boolean favorHardwareRasterizer)
         throws GLException
     {
         return get(GL_PROFILE_LIST_MAX_PROGSHADER_CORE, favorHardwareRasterizer);
@@ -772,7 +816,7 @@ public class GLProfile {
      * @see #get(AbstractGraphicsDevice, String)
      * @see #getImpl()
      */
-    public static GLProfile getGL2ES1(AbstractGraphicsDevice device)
+    public static GLProfile getGL2ES1(final AbstractGraphicsDevice device)
         throws GLException
     {
         return get(device, GL2ES1).getImpl();
@@ -802,7 +846,7 @@ public class GLProfile {
      * @see #get(AbstractGraphicsDevice, String)
      * @see #getImpl()
      */
-    public static GLProfile getGL2ES2(AbstractGraphicsDevice device)
+    public static GLProfile getGL2ES2(final AbstractGraphicsDevice device)
         throws GLException
     {
         return get(device, GL2ES2).getImpl();
@@ -832,7 +876,7 @@ public class GLProfile {
      * @see #get(AbstractGraphicsDevice, String)
      * @see #getImpl()
      */
-    public static GLProfile getGL4ES3(AbstractGraphicsDevice device)
+    public static GLProfile getGL4ES3(final AbstractGraphicsDevice device)
         throws GLException
     {
         return get(device, GL4ES3).getImpl();
@@ -862,7 +906,7 @@ public class GLProfile {
      * @see #get(AbstractGraphicsDevice, String)
      * @see #getImpl()
      */
-    public static GLProfile getGL2GL3(AbstractGraphicsDevice device)
+    public static GLProfile getGL2GL3(final AbstractGraphicsDevice device)
         throws GLException
     {
         return get(device, GL2GL3).getImpl();
@@ -889,7 +933,7 @@ public class GLProfile {
      *        or <code>[ null, GL ]</code> for the default profile.
      * @throws GLException if the requested profile is not available for the device.
      */
-    public static GLProfile get(AbstractGraphicsDevice device, String profile)
+    public static GLProfile get(final AbstractGraphicsDevice device, String profile)
         throws GLException
     {
         if(null==profile || profile.equals("GL")) {
@@ -908,7 +952,7 @@ public class GLProfile {
      *        or <code>[ null, GL ]</code> for the default profile.
      * @throws GLException if the requested profile is not available for the default device.
      */
-    public static GLProfile get(String profile)
+    public static GLProfile get(final String profile)
         throws GLException
     {
         return get(defaultDevice, profile);
@@ -923,12 +967,12 @@ public class GLProfile {
      * @param favorHardwareRasterizer set to true, if hardware rasterizer shall be favored, otherwise false.
      * @throws GLException if the non of the requested profiles is available for the device.
      */
-    public static GLProfile get(AbstractGraphicsDevice device, String[] profiles, boolean favorHardwareRasterizer)
+    public static GLProfile get(final AbstractGraphicsDevice device, final String[] profiles, final boolean favorHardwareRasterizer)
         throws GLException
     {
         GLProfile glProfileAny = null;
 
-        HashMap<String /*GLProfile_name*/, GLProfile> map = getProfileMap(device, true);
+        final HashMap<String /*GLProfile_name*/, GLProfile> map = getProfileMap(device, true);
         for(int i=0; i<profiles.length; i++) {
             final GLProfile glProfile = map.get(profiles[i]);
             if(null!=glProfile) {
@@ -954,7 +998,7 @@ public class GLProfile {
      * @param favorHardwareRasterizer set to true, if hardware rasterizer shall be favored, otherwise false.
      * @throws GLException if the non of the requested profiles is available for the default device.
      */
-    public static GLProfile get(String[] profiles, boolean favorHardwareRasterizer)
+    public static GLProfile get(final String[] profiles, final boolean favorHardwareRasterizer)
         throws GLException
     {
         return get(defaultDevice, profiles, favorHardwareRasterizer);
@@ -963,26 +1007,26 @@ public class GLProfile {
     /** Indicates whether the native OpenGL ES1 profile is in use.
      * This requires an EGL interface.
      */
-    public static boolean usesNativeGLES1(String profileImpl) {
+    public static boolean usesNativeGLES1(final String profileImpl) {
         return GLES1.equals(profileImpl);
     }
 
     /** Indicates whether the native OpenGL ES3 or ES2 profile is in use.
      * This requires an EGL, ES3 or ES2 compatible interface.
      */
-    public static boolean usesNativeGLES2(String profileImpl) {
+    public static boolean usesNativeGLES2(final String profileImpl) {
         return GLES3.equals(profileImpl) || GLES2.equals(profileImpl);
     }
 
     /** Indicates whether the native OpenGL ES2 profile is in use.
      * This requires an EGL, ES3 compatible interface.
      */
-    public static boolean usesNativeGLES3(String profileImpl) {
+    public static boolean usesNativeGLES3(final String profileImpl) {
         return GLES3.equals(profileImpl);
     }
 
     /** Indicates whether either of the native OpenGL ES profiles are in use. */
-    public static boolean usesNativeGLES(String profileImpl) {
+    public static boolean usesNativeGLES(final String profileImpl) {
         return usesNativeGLES2(profileImpl) || usesNativeGLES1(profileImpl);
     }
 
@@ -990,7 +1034,7 @@ public class GLProfile {
         JOGL's AWT part */
     public static boolean isAWTAvailable() { return isAWTAvailable; }
 
-    public static String getGLTypeName(int type) {
+    public static String getGLTypeName(final int type) {
         switch (type) {
         case GL.GL_UNSIGNED_BYTE:
             return "GL_UNSIGNED_BYTE";
@@ -1006,9 +1050,9 @@ public class GLProfile {
             return "GL_FIXED";
         case javax.media.opengl.GL2ES2.GL_INT:
             return "GL_INT";
-        case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
+        case GL.GL_UNSIGNED_INT:
             return "GL_UNSIGNED_INT";
-        case javax.media.opengl.GL2.GL_DOUBLE:
+        case javax.media.opengl.GL2GL3.GL_DOUBLE:
             return "GL_DOUBLE";
         case javax.media.opengl.GL2.GL_2_BYTES:
             return "GL_2_BYTES";
@@ -1020,7 +1064,7 @@ public class GLProfile {
         return null;
     }
 
-    public static String getGLArrayName(int array) {
+    public static String getGLArrayName(final int array) {
         switch(array) {
         case GLPointerFunc.GL_VERTEX_ARRAY:
             return "GL_VERTEX_ARRAY";
@@ -1037,7 +1081,7 @@ public class GLProfile {
     public final String getGLImplBaseClassName() {
         return getGLImplBaseClassName(getImplName());
     }
-    private static final String getGLImplBaseClassName(String profileImpl) {
+    private static final String getGLImplBaseClassName(final String profileImpl) {
         if( GLES2 == profileImpl || GLES3 == profileImpl ) {
             return "jogamp.opengl.es3.GLES3";
         } else if( GLES1 == profileImpl ) {
@@ -1053,10 +1097,10 @@ public class GLProfile {
         }
     }
 
-    public final Constructor<?> getGLCtor(boolean glObject) {
+    public final Constructor<?> getGLCtor(final boolean glObject) {
         return getGLCtor(getImplName(), glObject);
     }
-    private static final Constructor<?> getGLCtor(String profileImpl, boolean glObject) {
+    private static final Constructor<?> getGLCtor(final String profileImpl, final boolean glObject) {
         if( GLES2 == profileImpl || GLES3 == profileImpl ) {
             return glObject ? ctorGLES3Impl : ctorGLES3ProcAddr;
         } else if( GLES1 == profileImpl ) {
@@ -1078,11 +1122,11 @@ public class GLProfile {
      *         if both, profile and profileImpl is equal with this.
      */
     @Override
-    public final boolean equals(Object o) {
+    public final boolean equals(final Object o) {
         if(this==o) { return true; }
         if(o instanceof GLProfile) {
             final GLProfile glp = (GLProfile)o;
-            return getName() == glp.getName() && getImplName() == glp.getImplName() ;
+            return getName() == glp.getName() && getImplName() == glp.getImplName() ; // uses .intern()!
         }
         return false;
     }
@@ -1099,7 +1143,7 @@ public class GLProfile {
      * @param glp GLProfile to compare with
      * @throws GLException if given GLProfile and this aren't equal
      */
-    public final void verifyEquality(GLProfile glp) throws GLException  {
+    public final void verifyEquality(final GLProfile glp) throws GLException  {
         if(!this.equals(glp)) {
             throw new GLException("GLProfiles are not equal: "+this+" != "+glp);
         }
@@ -1235,7 +1279,7 @@ public class GLProfile {
      * General validation if type is a valid GL data type
      * for the current profile
      */
-    public boolean isValidDataType(int type, boolean throwException) {
+    public boolean isValidDataType(final int type, final boolean throwException) {
         switch(type) {
             case GL.GL_UNSIGNED_BYTE:
             case GL.GL_BYTE:
@@ -1245,11 +1289,11 @@ public class GLProfile {
             case GL.GL_FIXED:
                 return true;
             case javax.media.opengl.GL2ES2.GL_INT:
-            case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
+            case GL.GL_UNSIGNED_INT:
                 if( isGL2ES2() ) {
                     return true;
                 }
-            case javax.media.opengl.GL2.GL_DOUBLE:
+            case javax.media.opengl.GL2GL3.GL_DOUBLE:
                 if( isGL3() ) {
                     return true;
                 }
@@ -1266,8 +1310,8 @@ public class GLProfile {
         return false;
     }
 
-    public boolean isValidArrayDataType(int index, int comps, int type,
-                                        boolean isVertexAttribPointer, boolean throwException) {
+    public boolean isValidArrayDataType(final int index, final int comps, final int type,
+                                        final boolean isVertexAttribPointer, final boolean throwException) {
         final String arrayName = getGLArrayName(index);
         if( isGLES1() ) {
             if(isVertexAttribPointer) {
@@ -1391,8 +1435,8 @@ public class GLProfile {
                     case GL.GL_SHORT:
                     case GL.GL_FLOAT:
                     case javax.media.opengl.GL2ES2.GL_INT:
-                    case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
-                    case javax.media.opengl.GL2.GL_DOUBLE:
+                    case GL.GL_UNSIGNED_INT:
+                    case javax.media.opengl.GL2GL3.GL_DOUBLE:
                         break;
                     default:
                         if(throwException) {
@@ -1420,7 +1464,7 @@ public class GLProfile {
                             case GL.GL_SHORT:
                             case GL.GL_FLOAT:
                             case javax.media.opengl.GL2ES2.GL_INT:
-                            case javax.media.opengl.GL2.GL_DOUBLE:
+                            case javax.media.opengl.GL2GL3.GL_DOUBLE:
                                 break;
                             default:
                                 if(throwException) {
@@ -1447,7 +1491,7 @@ public class GLProfile {
                             case GL.GL_SHORT:
                             case GL.GL_FLOAT:
                             case javax.media.opengl.GL2ES2.GL_INT:
-                            case javax.media.opengl.GL2.GL_DOUBLE:
+                            case javax.media.opengl.GL2GL3.GL_DOUBLE:
                                 break;
                             default:
                                 if(throwException) {
@@ -1474,8 +1518,8 @@ public class GLProfile {
                             case GL.GL_SHORT:
                             case GL.GL_FLOAT:
                             case javax.media.opengl.GL2ES2.GL_INT:
-                            case javax.media.opengl.GL2ES2.GL_UNSIGNED_INT:
-                            case javax.media.opengl.GL2.GL_DOUBLE:
+                            case GL.GL_UNSIGNED_INT:
+                            case javax.media.opengl.GL2GL3.GL_DOUBLE:
                                 break;
                             default:
                                 if(throwException) {
@@ -1500,7 +1544,7 @@ public class GLProfile {
                             case GL.GL_SHORT:
                             case GL.GL_FLOAT:
                             case javax.media.opengl.GL2ES2.GL_INT:
-                            case javax.media.opengl.GL2.GL_DOUBLE:
+                            case javax.media.opengl.GL2GL3.GL_DOUBLE:
                                 break;
                             default:
                                 if(throwException) {
@@ -1530,7 +1574,7 @@ public class GLProfile {
 
     @Override
     public String toString() {
-        return "GLProfile[" + getName() + "/" + getImplName() + "."+(this.isHardwareRasterizer?"hw":"sw")+"]";
+        return "GLProfile[" + getName() + "/" + getImplName() + "."+(this.isHardwareRasterizer?"hw":"sw")+(isCustom?".custom":"")+"]";
     }
 
     private static /*final*/ boolean isAWTAvailable;
@@ -1565,10 +1609,10 @@ public class GLProfile {
 
     private static final Constructor<?> getCtor(final String clazzName, final boolean glObject, final ClassLoader cl) {
         try {
-            return ReflectionUtil.getConstructor(clazzName, glObject ? ctorGLArgs : ctorProcArgs, cl);
-        } catch (Throwable t) {
+            return ReflectionUtil.getConstructor(clazzName, glObject ? ctorGLArgs : ctorProcArgs, false, cl);
+        } catch (final Throwable t) {
             if( DEBUG ) {
-                System.err.println("Catched: "+t.getMessage());
+                System.err.println("Caught: "+t.getMessage());
                 t.printStackTrace();
             }
             return null;
@@ -1656,16 +1700,16 @@ public class GLProfile {
         try {
             desktopFactory = (GLDrawableFactoryImpl) GLDrawableFactory.getFactoryImpl(GL2);
             if(null != desktopFactory) {
-                DesktopGLDynamicLookupHelper glLookupHelper = (DesktopGLDynamicLookupHelper) desktopFactory.getGLDynamicLookupHelper(0);
+                final DesktopGLDynamicLookupHelper glLookupHelper = (DesktopGLDynamicLookupHelper) desktopFactory.getGLDynamicLookupHelper(0);
                 if(null!=glLookupHelper) {
                     hasDesktopGLFactory = glLookupHelper.isLibComplete() && hasGL234Impl;
                 }
             }
-        } catch (LinkageError le) {
+        } catch (final LinkageError le) {
             t=le;
-        } catch (RuntimeException re) {
+        } catch (final RuntimeException re) {
             t=re;
-        } catch (Throwable tt) {
+        } catch (final Throwable tt) {
             t=tt;
         }
         if(DEBUG) {
@@ -1696,13 +1740,13 @@ public class GLProfile {
                     hasGLES3Impl = null!=eglFactory.getGLDynamicLookupHelper(2) && hasGLES3Impl;
                     hasGLES1Impl = null!=eglFactory.getGLDynamicLookupHelper(1) && hasGLES1Impl;
                 }
-            } catch (LinkageError le) {
+            } catch (final LinkageError le) {
                 t=le;
-            } catch (SecurityException se) {
+            } catch (final SecurityException se) {
                 t=se;
-            } catch (NullPointerException npe) {
+            } catch (final NullPointerException npe) {
                 t=npe;
-            } catch (RuntimeException re) {
+            } catch (final RuntimeException re) {
                 t=re;
             }
             if(DEBUG) {
@@ -1765,13 +1809,13 @@ public class GLProfile {
      * @param device the device for which profiles shall be initialized
      * @return true if any profile for the device exists, otherwise false
      */
-    private static boolean initProfilesForDevice(AbstractGraphicsDevice device) {
+    private static boolean initProfilesForDevice(final AbstractGraphicsDevice device) {
         if(null == device) {
             return false;
         }
         initLock.lock();
         try {
-            GLDrawableFactory factory = GLDrawableFactory.getFactoryImpl(device);
+            final GLDrawableFactory factory = GLDrawableFactory.getFactoryImpl(device);
             factory.enterThreadCriticalZone();
             try {
                 return initProfilesForDeviceCritical(device);
@@ -1782,8 +1826,8 @@ public class GLProfile {
             initLock.unlock();
         }
     }
-    private static boolean initProfilesForDeviceCritical(AbstractGraphicsDevice device) {
-        boolean isSet = GLContext.getAvailableGLVersionsSet(device);
+    private static boolean initProfilesForDeviceCritical(final AbstractGraphicsDevice device) {
+        final boolean isSet = GLContext.getAvailableGLVersionsSet(device);
 
         if(DEBUG) {
             System.err.println("Info: GLProfile.initProfilesForDevice: "+device+" ("+device.getClass().getName()+"), isSet "+isSet+", hasDesktopGLFactory "+hasDesktopGLFactory+", hasEGLFactory "+hasEGLFactory);
@@ -1791,7 +1835,7 @@ public class GLProfile {
         if(isSet) {
             // Avoid recursion and check whether impl. is sane!
             final String deviceKey = device.getUniqueID();
-            HashMap<String /*GLProfile_name*/, GLProfile> map = deviceConn2ProfileMap.get(deviceKey);
+            final HashMap<String /*GLProfile_name*/, GLProfile> map = deviceConn2ProfileMap.get(deviceKey);
             if( null == map ) {
                 throw new InternalError("GLContext Avail. GLVersion is set - but no profile map for device: "+device);
             }
@@ -1813,7 +1857,7 @@ public class GLProfile {
             if(null != sharedResourceThread) {
                 initLock.addOwner(sharedResourceThread);
             }
-            boolean desktopSharedCtxAvail = desktopFactory.createSharedResource(device);
+            final boolean desktopSharedCtxAvail = desktopFactory.createSharedResource(device);
             if(null != sharedResourceThread) {
                 initLock.removeOwner(sharedResourceThread);
             }
@@ -1841,7 +1885,7 @@ public class GLProfile {
             if(null != sharedResourceThread) {
                 initLock.addOwner(sharedResourceThread);
             }
-            boolean eglSharedCtxAvail = eglFactory.createSharedResource(device);
+            final boolean eglSharedCtxAvail = eglFactory.createSharedResource(device);
             if(null != sharedResourceThread) {
                 initLock.removeOwner(sharedResourceThread);
             }
@@ -1881,13 +1925,13 @@ public class GLProfile {
             System.err.println("GLProfile.initProfilesForDevice: "+device.getConnection()+": "+glAvailabilityToString(device));
             if(addedDesktopProfile) {
                 dumpGLInfo(desktopFactory, device);
-                List<GLCapabilitiesImmutable> availCaps = desktopFactory.getAvailableCapabilities(device);
+                final List<GLCapabilitiesImmutable> availCaps = desktopFactory.getAvailableCapabilities(device);
                 for(int i=0; i<availCaps.size(); i++) {
                     System.err.println(availCaps.get(i));
                 }
             } else if(addedEGLProfile) {
                 dumpGLInfo(eglFactory, device);
-                List<GLCapabilitiesImmutable> availCaps = eglFactory.getAvailableCapabilities(device);
+                final List<GLCapabilitiesImmutable> availCaps = eglFactory.getAvailableCapabilities(device);
                 for(int i=0; i<availCaps.size(); i++) {
                     System.err.println(availCaps.get(i));
                 }
@@ -1897,8 +1941,8 @@ public class GLProfile {
         return addedDesktopProfile || addedEGLProfile;
     }
 
-    private static void dumpGLInfo(GLDrawableFactoryImpl factory, AbstractGraphicsDevice device)  {
-        GLContext ctx = factory.getOrCreateSharedContext(device);
+    private static void dumpGLInfo(final GLDrawableFactoryImpl factory, final AbstractGraphicsDevice device)  {
+        final GLContext ctx = factory.getOrCreateSharedContext(device);
         if(null != ctx) {
             System.err.println("GLProfile.dumpGLInfo: "+ctx);
             ctx.makeCurrent();
@@ -1917,8 +1961,8 @@ public class GLProfile {
         return defaultDevice;
     }
 
-    private static String array2String(String[] list) {
-        StringBuilder msg = new StringBuilder();
+    private static String array2String(final String[] list) {
+        final StringBuilder msg = new StringBuilder();
         msg.append("[");
         for (int i = 0; i < list.length; i++) {
             if (i > 0)
@@ -1929,8 +1973,8 @@ public class GLProfile {
         return msg.toString();
     }
 
-    private static void glAvailabilityToString(AbstractGraphicsDevice device, StringBuilder sb, int major, int profile) {
-        String str = GLContext.getAvailableGLVersionAsString(device, major, profile);
+    private static void glAvailabilityToString(final AbstractGraphicsDevice device, final StringBuilder sb, final int major, final int profile) {
+        final String str = GLContext.getAvailableGLVersionAsString(device, major, profile);
         if(null==str) {
             throw new GLException("Internal Error");
         }
@@ -1939,7 +1983,7 @@ public class GLProfile {
         sb.append("]");
     }
 
-    private static boolean computeProfileMap(AbstractGraphicsDevice device, boolean desktopCtxUndef, boolean esCtxUndef) {
+    private static boolean computeProfileMap(final AbstractGraphicsDevice device, final boolean desktopCtxUndef, final boolean esCtxUndef) {
         if (DEBUG) {
             System.err.println("GLProfile.init map "+device.getConnection()+", desktopCtxUndef "+desktopCtxUndef+", esCtxUndef "+esCtxUndef);
         }
@@ -1953,13 +1997,13 @@ public class GLProfile {
             if( null != profileImpl ) {
                 final GLProfile glProfile;
                 if( profile.equals( profileImpl ) ) {
-                    glProfile = new GLProfile(profile, null, isHardwareRasterizer[0]);
+                    glProfile = new GLProfile(profile, null, isHardwareRasterizer[0], false /* custom */);
                 } else {
                     final GLProfile _mglp = _mappedProfiles.get( profileImpl );
                     if( null == _mglp ) {
                         throw new InternalError("XXX0 profile["+i+"]: "+profile+" -> profileImpl "+profileImpl+" !!! not mapped ");
                     }
-                    glProfile = new GLProfile(profile, _mglp, isHardwareRasterizer[0]);
+                    glProfile = new GLProfile(profile, _mglp, isHardwareRasterizer[0], false /* custom */);
                 }
                 _mappedProfiles.put(profile, glProfile);
                 if (DEBUG) {
@@ -1994,7 +2038,7 @@ public class GLProfile {
     /**
      * Returns the profile implementation
      */
-    private static String computeProfileImpl(AbstractGraphicsDevice device, String profile, boolean desktopCtxUndef, boolean esCtxUndef, boolean isHardwareRasterizer[]) {
+    private static String computeProfileImpl(final AbstractGraphicsDevice device, final String profile, final boolean desktopCtxUndef, final boolean esCtxUndef, final boolean isHardwareRasterizer[]) {
         if (GL2ES1.equals(profile)) {
             final boolean es1HardwareRasterizer[] = new boolean[1];
             final boolean gles1Available = hasGLES1Impl && ( esCtxUndef || GLContext.isGLES1Available(device, es1HardwareRasterizer) );
@@ -2143,7 +2187,7 @@ public class GLProfile {
      * @return the GLProfile HashMap if exists, otherwise null
      * @throws GLException if no profile for the given device is available.
      */
-    private static HashMap<String /*GLProfile_name*/, GLProfile> getProfileMap(AbstractGraphicsDevice device, boolean throwExceptionOnZeroProfile)
+    private static HashMap<String /*GLProfile_name*/, GLProfile> getProfileMap(AbstractGraphicsDevice device, final boolean throwExceptionOnZeroProfile)
         throws GLException
     {
         initSingleton();
@@ -2175,19 +2219,25 @@ public class GLProfile {
         return map;
     }
 
-    private static void setProfileMap(AbstractGraphicsDevice device, HashMap<String /*GLProfile_name*/, GLProfile> mappedProfiles) {
+    private static void setProfileMap(final AbstractGraphicsDevice device, final HashMap<String /*GLProfile_name*/, GLProfile> mappedProfiles) {
         synchronized ( deviceConn2ProfileMap ) {
             deviceConn2ProfileMap.put(device.getUniqueID(), mappedProfiles);
         }
     }
 
-    private GLProfile(String profile, GLProfile profileImpl, boolean isHardwareRasterizer) {
+    private GLProfile(final String profile, final GLProfile profileImpl, final boolean isHardwareRasterizer, final boolean isCustom) {
         this.profile = profile;
         this.profileImpl = profileImpl;
         this.isHardwareRasterizer = isHardwareRasterizer;
+        this.isCustom = isCustom;
+    }
+
+    public static GLProfile createCustomGLProfile(final String profile, final GLProfile profileImpl) {
+        return new GLProfile(profile, profileImpl, profileImpl.isHardwareRasterizer, true);
     }
 
     private final GLProfile profileImpl;
     private final String profile;
     private final boolean isHardwareRasterizer;
+    private final boolean isCustom;
 }
diff --git a/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java b/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java
index 2ea4e4c..679898d 100644
--- a/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java
+++ b/src/jogl/classes/javax/media/opengl/GLSharedContextSetter.java
@@ -99,12 +99,6 @@ package javax.media.opengl;
  */
 public interface GLSharedContextSetter extends GLAutoDrawable {
     /**
-     * Returns true if all {@link GLEventListener} are initialized, otherwise false.
-     * @deprecated Promote method to {@link GLAutoDrawable}
-     */
-    boolean areAllGLEventListenerInitialized();
-
-    /**
      * Specifies an {@link GLContext OpenGL context}, which shall be shared by this {@link GLAutoDrawable}'s {@link GLContext}.
      * <p>
      * Since the {@link GLDrawable drawable} and {@link GLContext context} is created
@@ -116,6 +110,12 @@ public interface GLSharedContextSetter extends GLAutoDrawable {
      * as long it is not {@link GLContext#isCreated() created natively}.
      * </p>
      * <p>
+     * The <i>preferred method</i> of assigning a <i>shared context</i> is
+     * to {@link #setSharedAutoDrawable(GLAutoDrawable) set the shared GLAutoDrawable},
+     * since this method also takes the {@link GLEventListener}
+     * {@link GLAutoDrawable#areAllGLEventListenerInitialized() initialization into account}.
+     * </p>
+     * <p>
      * See <a href="#lifecycle">Lifecycle Considerations</a>.
      * </p>
      *
@@ -135,12 +135,12 @@ public interface GLSharedContextSetter extends GLAutoDrawable {
      * this method shall be called beforehand to have any effect.
      * </p>
      * <p>
-     * A set <i>sharedAutoDrawable</i> will block context creation, i.e. {@link GLAutoDrawable#initialization GLAutoDrawable initialization},
+     * A set <i>sharedAutoDrawable</i> will block context creation, i.e. <a href="GLAutoDrawable.html#initialization">initialization</a>
      * as long it's
      * <ul>
      *   <li>{@link GLContext} is <code>null</code>, or</li>
      *   <li>{@link GLContext} has not been {@link GLContext#isCreated() created natively}, or</li>
-     *   <li>{@link GLEventListener} are <i>not</i> {@link GLSharedContextSetter#areAllGLEventListenerInitialized() completely initialized}</li>
+     *   <li>{@link GLEventListener} are <i>not</i> {@link GLAutoDrawable#areAllGLEventListenerInitialized() completely initialized}</li>
      * </ul>
      * </p>
      * <p>
diff --git a/src/jogl/classes/javax/media/opengl/GLUniformData.java b/src/jogl/classes/javax/media/opengl/GLUniformData.java
index 412bfb0..47f0753 100644
--- a/src/jogl/classes/javax/media/opengl/GLUniformData.java
+++ b/src/jogl/classes/javax/media/opengl/GLUniformData.java
@@ -14,8 +14,8 @@ public class GLUniformData {
      * Number of objects is 1
      *
      */
-    public GLUniformData(String name, int val) {
-        init(name, 1, new Integer(val));
+    public GLUniformData(final String name, final int val) {
+        initScalar(name, 1, Integer.valueOf(val));
     }
 
     /**
@@ -24,8 +24,8 @@ public class GLUniformData {
      * Number of objects is 1
      *
      */
-    public GLUniformData(String name, float val) {
-        init(name, 1, new Float(val));
+    public GLUniformData(final String name, final float val) {
+        initScalar(name, 1, Float.valueOf(val));
     }
 
     /**
@@ -35,8 +35,8 @@ public class GLUniformData {
      *
      * @param components number of elements of one object, ie 4 for GL_FLOAT_VEC4,
      */
-    public GLUniformData(String name, int components, IntBuffer data) {
-        init(name, components, data);
+    public GLUniformData(final String name, final int components, final IntBuffer data) {
+        initBuffer(name, components, data);
     }
 
     /**
@@ -46,8 +46,20 @@ public class GLUniformData {
      *
      * @param components number of elements of one object, ie 4 for GL_FLOAT_VEC4,
      */
-    public GLUniformData(String name, int components, FloatBuffer data) {
-        init(name, components, data);
+    public GLUniformData(final String name, final int components, final FloatBuffer data) {
+        initBuffer(name, components, data);
+    }
+
+    private GLUniformData(final int components, final String name) {
+        initBuffer(name, components, null);
+    }
+
+    public static GLUniformData creatEmptyVector(final String name, final int components) {
+        return new GLUniformData(components, name);
+    }
+
+    public static GLUniformData creatEmptyMatrix(final String name, final int rows, final int columns) {
+        return new GLUniformData(name, rows, columns, null);
     }
 
     /**
@@ -58,14 +70,14 @@ public class GLUniformData {
      * @param rows the matrix rows
      * @param column the matrix column
      */
-    public GLUniformData(String name, int rows, int columns, FloatBuffer data) {
-        init(name, rows, columns, data);
+    public GLUniformData(final String name, final int rows, final int columns, final FloatBuffer data) {
+        initBuffer(name, rows, columns, data);
     }
 
-    public GLUniformData setData(int data) { init(new Integer(data)); return this; }
-    public GLUniformData setData(float data) { init(new Float(data)); return this; }
-    public GLUniformData setData(IntBuffer data) { init(data); return this; }
-    public GLUniformData setData(FloatBuffer data) { init(data); return this; }
+    public GLUniformData setData(final int data) { initScalar(Integer.valueOf(data)); return this; }
+    public GLUniformData setData(final float data) { initScalar(Float.valueOf(data)); return this; }
+    public GLUniformData setData(final IntBuffer data) { initBuffer(data); return this; }
+    public GLUniformData setData(final FloatBuffer data) { initBuffer(data); return this; }
 
     public int       intValue()   { return ((Integer)data).intValue(); };
     public float     floatValue() { return ((Float)data).floatValue(); };
@@ -102,7 +114,7 @@ public class GLUniformData {
         return toString(null).toString();
     }
 
-    private void init(String name, int rows, int columns, Object data) {
+    private void initBuffer(final String name, final int rows, final int columns, final Buffer buffer) {
         if( 2>rows || rows>4 || 2>columns || columns>4 ) {
             throw new GLException("rowsXcolumns must be within [2..4]X[2..4], is: "+rows+"X"+columns);
         }
@@ -111,10 +123,20 @@ public class GLUniformData {
         this.columns=columns;
         this.isMatrix=true;
         this.location=-1;
-        init(data);
+        initBuffer(buffer);
     }
-
-    private void init(String name, int components, Object data) {
+    private void initScalar(final String name, final int components, final Object data) {
+        if( 1>components || components>4 ) {
+            throw new GLException("components must be within [1..4], is: "+components);
+        }
+        this.name=name;
+        this.columns=components;
+        this.rows=1;
+        this.isMatrix=false;
+        this.location=-1;
+        initScalar(data);
+    }
+    private void initBuffer(final String name, final int components, final Buffer buffer) {
         if( 1>components || components>4 ) {
             throw new GLException("components must be within [1..4], is: "+components);
         }
@@ -123,24 +145,36 @@ public class GLUniformData {
         this.rows=1;
         this.isMatrix=false;
         this.location=-1;
-        init(data);
+        initBuffer(buffer);
     }
 
-    private void init(Object data) {
+    private void initScalar(final Object data) {
         if(data instanceof Buffer) {
+            initBuffer((Buffer)data);
+        } else if( null != data ) {
+            if(isMatrix) {
+                throw new GLException("Atom type not allowed for matrix : "+this);
+            }
+            this.count=1;
+            this.data=data;
+        } else {
+            this.count=0;
+            this.data=data;
+        }
+    }
+
+    private void initBuffer(final Buffer buffer) {
+        if( null != buffer ) {
             final int sz = rows*columns;
-            final Buffer buffer = (Buffer)data;
             if(buffer.remaining()<sz || 0!=buffer.remaining()%sz) {
                 throw new GLException("remaining data buffer size invalid: buffer: "+buffer.toString()+"\n\t"+this);
             }
-            this.count=buffer.remaining()/(rows*columns);
+            this.count=buffer.remaining()/sz;
+            this.data=buffer;
         } else {
-            if(isMatrix) {
-                throw new GLException("Atom type not allowed for matrix : "+this);
-            }
-            this.count=1;
+            this.count=0;
+            this.data=null;
         }
-        this.data=data;
     }
 
     public String getName() { return name; }
@@ -151,7 +185,7 @@ public class GLUniformData {
      * Sets the given location of the shader uniform.
      * @return the given location
      */
-    public int setLocation(int location) { this.location=location; return location; }
+    public int setLocation(final int location) { this.location=location; return location; }
 
     /**
      * Retrieves the location of the shader uniform from the linked shader program.
@@ -163,7 +197,7 @@ public class GLUniformData {
      * @return ≥0 denotes a valid uniform location as found and used in the given shader program.
      *         <0 denotes an invalid location, i.e. not found or used in the given shader program.
      */
-    public int setLocation(GL2ES2 gl, int program) {
+    public int setLocation(final GL2ES2 gl, final int program) {
         location = gl.glGetUniformLocation(program, name);
         return location;
     }
diff --git a/src/jogl/classes/javax/media/opengl/Threading.java b/src/jogl/classes/javax/media/opengl/Threading.java
index 7503e9c..c8d8d00 100644
--- a/src/jogl/classes/javax/media/opengl/Threading.java
+++ b/src/jogl/classes/javax/media/opengl/Threading.java
@@ -117,10 +117,36 @@ import jogamp.opengl.ThreadingImpl;
 */
 
 public class Threading {
+    public static enum Mode {
+        /**
+         * Full multithreaded OpenGL,
+         * i.e. any {@link Threading#invoke(boolean, Runnable, Object) invoke}
+         * {@link Threading#invokeOnOpenGLThread(boolean, Runnable) commands}
+         * will be issued on the current thread immediately.
+         */
+        MT(0),
+
+        /** Single-Threaded OpenGL on AWT EDT */
+        ST_AWT(1),
+
+        /** Single-Threaded OpenGL on dedicated worker thread. */
+        ST_WORKER(2);
+
+        public final int id;
+
+        Mode(final int id){
+            this.id = id;
+        }
+    }
 
     /** No reason to ever instantiate this class */
     private Threading() {}
 
+    /** Returns the threading mode */
+    public static Mode getMode() {
+        return ThreadingImpl.getMode();
+    }
+
     /** If an implementation of the javax.media.opengl APIs offers a
         multithreading option but the default behavior is single-threading,
         this API provides a mechanism for end users to disable single-threading
@@ -129,8 +155,8 @@ public class Threading {
         consequences and are prepared to enforce some amount of
         threading restrictions in their applications. Disabling
         single-threading, for example, may have unintended consequences
-        on GLAutoDrawable implementations such as GLCanvas, GLJPanel and
-        GLPbuffer. Currently there is no supported way to re-enable it
+        on GLAutoDrawable implementations such as GLCanvas and GLJPanel.
+        Currently there is no supported way to re-enable it
         once disabled, partly to discourage careless use of this
         method. This method should be called as early as possible in an
         application. */
@@ -150,10 +176,14 @@ public class Threading {
         return ThreadingImpl.isToolkitThread();
     }
 
-    /** Indicates whether the current thread is the single thread on
-        which this implementation of the javax.media.opengl APIs
-        performs all of its OpenGL-related work. This method should only
-        be called if the single-thread model is in effect. */
+    /**
+     * Indicates whether the current thread is capable of
+     * performing OpenGL-related work.
+     * <p>
+     * Method always returns <code>true</code>
+     * if {@link #getMode()} == {@link Mode#MT} or {@link #isSingleThreaded()} == <code>false</code>.
+     * </p>
+     */
     public static final boolean isOpenGLThread() throws GLException {
         return ThreadingImpl.isOpenGLThread();
     }
@@ -168,12 +198,12 @@ public class Threading {
         current thread is the OpenGL thread and either execute the
         Runnable directly or perform the work inside it.
      **/
-    public static final void invokeOnOpenGLThread(boolean wait, Runnable r) throws GLException {
+    public static final void invokeOnOpenGLThread(final boolean wait, final Runnable r) throws GLException {
         ThreadingImpl.invokeOnOpenGLThread(wait, r);
     }
 
     /**
-     * If {@link #isSingleThreaded()} <b>and</b> not {@link #isOpenGLThread()}
+     * If not {@link #isOpenGLThread()}
      * <b>and</b> the <code>lock</code> is not being hold by this thread,
      * invoke Runnable <code>r</code> on the OpenGL thread via {@link #invokeOnOpenGLThread(boolean, Runnable)}.
      * <p>
@@ -185,8 +215,8 @@ public class Threading {
      * @param lock optional lock object to be tested
      * @throws GLException
      */
-    public static final void invoke(boolean wait, Runnable r, Object lock) throws GLException {
-        if ( isSingleThreaded() && !isOpenGLThread() &&
+    public static final void invoke(final boolean wait, final Runnable r, final Object lock) throws GLException {
+        if ( !isOpenGLThread() &&
              ( null == lock || !Thread.holdsLock(lock) ) ) {
             invokeOnOpenGLThread(wait, r);
         } else {
diff --git a/src/jogl/classes/javax/media/opengl/TraceGL2.java b/src/jogl/classes/javax/media/opengl/TraceGL2.java
index c577332..94d391d 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGL2.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGL2.java
@@ -17,7 +17,7 @@ import java.io.PrintStream;
  * </p>
  */
 public class TraceGL2 extends TraceGL4bc {
-    public TraceGL2(GL2 downstream, PrintStream stream) {
+    public TraceGL2(final GL2 downstream, final PrintStream stream) {
         super((GL4bc)downstream, stream);
     }
 }
diff --git a/src/jogl/classes/javax/media/opengl/TraceGL3.java b/src/jogl/classes/javax/media/opengl/TraceGL3.java
index 5fccf40..96e6559 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGL3.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGL3.java
@@ -17,7 +17,7 @@ import java.io.PrintStream;
  * </p>
  */
 public class TraceGL3 extends TraceGL4bc {
-    public TraceGL3(GL3 downstream, PrintStream stream) {
+    public TraceGL3(final GL3 downstream, final PrintStream stream) {
         super((GL4bc)downstream, stream);
     }
 }
diff --git a/src/jogl/classes/javax/media/opengl/TraceGL3bc.java b/src/jogl/classes/javax/media/opengl/TraceGL3bc.java
index 84f537f..2a85902 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGL3bc.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGL3bc.java
@@ -17,7 +17,7 @@ import java.io.PrintStream;
  * </p>
  */
 public class TraceGL3bc extends TraceGL4bc {
-    public TraceGL3bc(GL3bc downstream, PrintStream stream) {
+    public TraceGL3bc(final GL3bc downstream, final PrintStream stream) {
         super((GL4bc)downstream, stream);
     }
 }
diff --git a/src/jogl/classes/javax/media/opengl/TraceGL4.java b/src/jogl/classes/javax/media/opengl/TraceGL4.java
index afe2cd9..d48f992 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGL4.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGL4.java
@@ -17,7 +17,7 @@ import java.io.PrintStream;
  * </p>
  */
 public class TraceGL4 extends TraceGL4bc {
-    public TraceGL4(GL4 downstream, PrintStream stream) {
+    public TraceGL4(final GL4 downstream, final PrintStream stream) {
         super((GL4bc)downstream, stream);
     }
 }
diff --git a/src/jogl/classes/javax/media/opengl/TraceGLES2.java b/src/jogl/classes/javax/media/opengl/TraceGLES2.java
index 4740e2e..b58f169 100644
--- a/src/jogl/classes/javax/media/opengl/TraceGLES2.java
+++ b/src/jogl/classes/javax/media/opengl/TraceGLES2.java
@@ -17,7 +17,7 @@ import java.io.PrintStream;
  * </p>
  */
 public class TraceGLES2 extends TraceGLES3 {
-    public TraceGLES2(GLES2 downstream, PrintStream stream) {
+    public TraceGLES2(final GLES2 downstream, final PrintStream stream) {
         super((GLES3)downstream, stream);
     }
 }
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
index 0958908..dba1dbc 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLCanvas.java
@@ -63,6 +63,7 @@ import java.util.List;
 
 import javax.media.nativewindow.AbstractGraphicsConfiguration;
 import javax.media.nativewindow.OffscreenLayerOption;
+import javax.media.nativewindow.ScalableSurface;
 import javax.media.nativewindow.VisualIDHolder;
 import javax.media.nativewindow.WindowClosingProtocol;
 import javax.media.nativewindow.AbstractGraphicsDevice;
@@ -101,6 +102,7 @@ import com.jogamp.opengl.JoglVersion;
 import com.jogamp.opengl.util.GLDrawableUtil;
 import com.jogamp.opengl.util.TileRenderer;
 
+import jogamp.nativewindow.SurfaceScaleUtils;
 import jogamp.opengl.Debug;
 import jogamp.opengl.GLContextImpl;
 import jogamp.opengl.GLDrawableHelper;
@@ -153,10 +155,16 @@ import jogamp.opengl.awt.AWTTilePainter;
  * <ul>
  *   <li><pre>sun.awt.noerasebackground=true</pre></li>
  * </ul>
+ *
+ * <a name="contextSharing"><h5>OpenGL Context Sharing</h5></a>
+ * To share a {@link GLContext} see the following note in the documentation overview:
+ * <a href="../../../spec-overview.html#SHARING">context sharing</a>
+ * as well as {@link GLSharedContextSetter}.
  */
 
 @SuppressWarnings("serial")
-public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosingProtocol, OffscreenLayerOption, AWTPrintLifecycle, GLSharedContextSetter {
+public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosingProtocol, OffscreenLayerOption,
+                                                AWTPrintLifecycle, GLSharedContextSetter, ScalableSurface {
 
   private static final boolean DEBUG = Debug.debug("GLCanvas");
 
@@ -167,6 +175,9 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   private volatile JAWTWindow jawtWindow; // the JAWTWindow presentation of this AWT Canvas, bound to the 'drawable' lifecycle
   private volatile GLContextImpl context; // volatile: avoid locking for read-only access
   private volatile boolean sendReshape = false; // volatile: maybe written by EDT w/o locking
+  private final int[] nativePixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+  private final int[] hasPixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+  final int[] reqPixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
 
   // copy of the cstr args, mainly for recreation
   private final GLCapabilitiesImmutable capsReqUser;
@@ -178,7 +189,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   private volatile boolean isShowing;
   private final HierarchyListener hierarchyListener = new HierarchyListener() {
       @Override
-      public void hierarchyChanged(HierarchyEvent e) {
+      public void hierarchyChanged(final HierarchyEvent e) {
           isShowing = GLCanvas.this.isShowing();
       }
   };
@@ -194,6 +205,9 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   /** Creates a new GLCanvas component with a default set of OpenGL
       capabilities, using the default OpenGL capabilities selection
       mechanism, on the default screen device.
+      <p>
+      See details about <a href="#contextSharing">OpenGL context sharing</a>.
+      </p>
    * @throws GLException if no default profile is available for the default desktop device.
    */
   public GLCanvas() throws GLException {
@@ -203,27 +217,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   /** Creates a new GLCanvas component with the requested set of
       OpenGL capabilities, using the default OpenGL capabilities
       selection mechanism, on the default screen device.
+      <p>
+      See details about <a href="#contextSharing">OpenGL context sharing</a>.
+      </p>
    * @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
    * @see GLCanvas#GLCanvas(javax.media.opengl.GLCapabilitiesImmutable, javax.media.opengl.GLCapabilitiesChooser, javax.media.opengl.GLContext, java.awt.GraphicsDevice)
    */
-  public GLCanvas(GLCapabilitiesImmutable capsReqUser) throws GLException {
-    this(capsReqUser, null, null, null);
-  }
-
-  /** Creates a new GLCanvas component with the requested set of
-      OpenGL capabilities, using the default OpenGL capabilities
-      selection mechanism, on the default screen device.
-   *  This constructor variant also supports using a shared GLContext.
-   *
-   * @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
-   * @see GLCanvas#GLCanvas(javax.media.opengl.GLCapabilitiesImmutable, javax.media.opengl.GLCapabilitiesChooser, javax.media.opengl.GLContext, java.awt.GraphicsDevice)
-   * @deprecated Use {@link #GLCanvas(GLCapabilitiesImmutable)}
-   *             and set shared GLContext via {@link #setSharedContext(GLContext)} or {@link #setSharedAutoDrawable(GLAutoDrawable)}.
-   */
-  public GLCanvas(GLCapabilitiesImmutable capsReqUser, GLContext shareWith)
-          throws GLException
-  {
-    this(capsReqUser, null, shareWith, null);
+  public GLCanvas(final GLCapabilitiesImmutable capsReqUser) throws GLException {
+    this(capsReqUser, null, null);
   }
 
   /** Creates a new GLCanvas component. The passed GLCapabilities
@@ -236,39 +237,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
       which to create the GLCanvas; the GLDrawableFactory uses the
       default screen device of the local GraphicsEnvironment if null
       is passed for this argument.
+      <p>
+      See details about <a href="#contextSharing">OpenGL context sharing</a>.
+      </p>
    * @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
    */
-  public GLCanvas(GLCapabilitiesImmutable capsReqUser,
-                  GLCapabilitiesChooser chooser,
-                  GraphicsDevice device)
-      throws GLException
-  {
-      this(capsReqUser, chooser, null, device);
-  }
-
-  /** Creates a new GLCanvas component. The passed GLCapabilities
-      specifies the OpenGL capabilities for the component; if null, a
-      default set of capabilities is used. The GLCapabilitiesChooser
-      specifies the algorithm for selecting one of the available
-      GLCapabilities for the component; a DefaultGLCapabilitesChooser
-      is used if null is passed for this argument. The passed
-      GLContext specifies an OpenGL context with which to share
-      textures, display lists and other OpenGL state, and may be null
-      if sharing is not desired. See the note in the overview
-      documentation on <a
-      href="../../../spec-overview.html#SHARING">context
-      sharing</a>. The passed GraphicsDevice indicates the screen on
-      which to create the GLCanvas; the GLDrawableFactory uses the
-      default screen device of the local GraphicsEnvironment if null
-      is passed for this argument.
-   * @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
-   * @deprecated Use {@link #GLCanvas(GLCapabilitiesImmutable, GLCapabilitiesChooser, GraphicsDevice)}
-   *             and set shared GLContext via {@link #setSharedContext(GLContext)} or {@link #setSharedAutoDrawable(GLAutoDrawable)}.
-   */
-  public GLCanvas(GLCapabilitiesImmutable capsReqUser,
-                  GLCapabilitiesChooser chooser,
-                  GLContext shareWith,
-                  GraphicsDevice device)
+  public GLCanvas(final GLCapabilitiesImmutable capsReqUser,
+                  final GLCapabilitiesChooser chooser,
+                  final GraphicsDevice device)
       throws GLException
   {
     /*
@@ -281,41 +257,40 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
     super();
 
     if(null==capsReqUser) {
-        capsReqUser = new GLCapabilities(GLProfile.getDefault(GLProfile.getDefaultDevice()));
+        this.capsReqUser = new GLCapabilities(GLProfile.getDefault(GLProfile.getDefaultDevice()));
     } else {
         // don't allow the user to change data
-        capsReqUser = (GLCapabilitiesImmutable) capsReqUser.cloneMutable();
+        this.capsReqUser = (GLCapabilitiesImmutable) capsReqUser.cloneMutable();
     }
-    if(!capsReqUser.isOnscreen()) {
+    if( !this.capsReqUser.isOnscreen() ) {
         setShallUseOffscreenLayer(true); // trigger offscreen layer - if supported
     }
 
     if(null==device) {
-        GraphicsConfiguration gc = super.getGraphicsConfiguration();
+        final GraphicsConfiguration gc = super.getGraphicsConfiguration();
         if(null!=gc) {
-            device = gc.getDevice();
+            this.device = gc.getDevice();
+        } else {
+            this.device = null;
         }
+    } else {
+        this.device = device;
     }
 
     // instantiation will be issued in addNotify()
-    this.capsReqUser = capsReqUser;
     this.chooser = chooser;
-    if( null != shareWith ) {
-        helper.setSharedContext(null, shareWith);
-    }
-    this.device = device;
 
     this.addHierarchyListener(hierarchyListener);
     this.isShowing = isShowing();
   }
 
   @Override
-  public final void setSharedContext(GLContext sharedContext) throws IllegalStateException {
+  public final void setSharedContext(final GLContext sharedContext) throws IllegalStateException {
       helper.setSharedContext(this.context, sharedContext);
   }
 
   @Override
-  public final void setSharedAutoDrawable(GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
+  public final void setSharedAutoDrawable(final GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
       helper.setSharedAutoDrawable(this, sharedAutoDrawable);
   }
 
@@ -325,7 +300,13 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public void setShallUseOffscreenLayer(boolean v) {
+  public final RecursiveLock getUpstreamLock() { return lock; }
+
+  @Override
+  public final boolean isThreadGLCapable() { return Threading.isOpenGLThread(); }
+
+  @Override
+  public void setShallUseOffscreenLayer(final boolean v) {
       shallUseOffscreenLayer = v;
   }
 
@@ -378,7 +359,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
      * otherwise it is from an ancestor component that this Canvas is being
      * added to, and we go into this block.
      */
-    GraphicsConfiguration chosen =  awtConfig.getAWTGraphicsConfiguration();
+    GraphicsConfiguration chosen =  null != awtConfig ? awtConfig.getAWTGraphicsConfiguration() : null;
 
     if (gc != null && chosen != null && !chosen.equals(gc)) {
       /*
@@ -404,11 +385,11 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
          * block, both devices should have the same visual list, and the
          * same configuration should be selected here.
          */
-        AWTGraphicsConfiguration config = chooseGraphicsConfiguration( (GLCapabilitiesImmutable)awtConfig.getChosenCapabilities(),
+        final AWTGraphicsConfiguration config = chooseGraphicsConfiguration( (GLCapabilitiesImmutable)awtConfig.getChosenCapabilities(),
                                                                        (GLCapabilitiesImmutable)awtConfig.getRequestedCapabilities(),
                                                                        chooser, gc.getDevice());
-        final GraphicsConfiguration compatible = (null!=config)?config.getAWTGraphicsConfiguration():null;
-        boolean equalCaps = config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities());
+        final GraphicsConfiguration compatible = config.getAWTGraphicsConfiguration();
+        final boolean equalCaps = config.getChosenCapabilities().equals(awtConfig.getChosenCapabilities());
         if(DEBUG) {
             System.err.println(getThreadName()+": Info:");
             System.err.println("Created Config (n): HAVE    GC "+chosen);
@@ -481,13 +462,13 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
     }
   }
 
-  private final void setRealizedImpl(boolean realized) {
+  private final void setRealizedImpl(final boolean realized) {
       final RecursiveLock _lock = lock;
       _lock.lock();
       try {
           final GLDrawable _drawable = drawable;
           if( null == _drawable || realized == _drawable.isRealized() ||
-              realized && ( 0 >= _drawable.getWidth() || 0 >= _drawable.getHeight() ) ) {
+              realized && ( 0 >= _drawable.getSurfaceWidth() || 0 >= _drawable.getSurfaceHeight() ) ) {
               return;
           }
          _drawable.setRealized(realized);
@@ -508,7 +489,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   };
 
   @Override
-  public final void setRealized(boolean realized) {
+  public final void setRealized(final boolean realized) {
       // Make sure drawable realization happens on AWT-EDT and only there. Consider the AWTTree lock!
       AWTEDTExecutor.singleton.invoke(getTreeLock(), false /* allowOnNonEDT */, true /* wait */, realized ? realizeOnEDTAction : unrealizeOnEDTAction);
   }
@@ -525,7 +506,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+  public WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
       return awtWindowClosingProtocol.setDefaultCloseOperation(op);
   }
 
@@ -559,7 +540,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
     destroyImpl( false );
   }
 
-  protected void destroyImpl(boolean destroyJAWTWindowAndAWTDevice) {
+  protected void destroyImpl(final boolean destroyJAWTWindowAndAWTDevice) {
     Threading.invoke(true, destroyOnEDTAction, getTreeLock());
     if( destroyJAWTWindowAndAWTDevice ) {
         AWTEDTExecutor.singleton.invoke(getTreeLock(), true /* allowOnNonEDT */, true /* wait */, disposeJAWTWindowAndAWTDeviceOnEDT);
@@ -572,21 +553,21 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
       properly.
     */
   @Override
-  public void paint(Graphics g) {
+  public void paint(final Graphics g) {
     if( Beans.isDesignTime() ) {
       // Make GLCanvas behave better in NetBeans GUI builder
       g.setColor(Color.BLACK);
       g.fillRect(0, 0, getWidth(), getHeight());
-      FontMetrics fm = g.getFontMetrics();
+      final FontMetrics fm = g.getFontMetrics();
       String name = getName();
       if (name == null) {
         name = getClass().getName();
-        int idx = name.lastIndexOf('.');
+        final int idx = name.lastIndexOf('.');
         if (idx >= 0) {
           name = name.substring(idx + 1);
         }
       }
-      Rectangle2D bounds = fm.getStringBounds(name, g);
+      final Rectangle2D bounds = fm.getStringBounds(name, g);
       g.setColor(Color.WHITE);
       g.drawString(name,
                    (int) ((getWidth()  - bounds.getWidth())  / 2),
@@ -657,14 +638,53 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
     }
   }
 
+  @Override
+  public final void setSurfaceScale(final int[] pixelScale) {
+      SurfaceScaleUtils.validateReqPixelScale(reqPixelScale, pixelScale, DEBUG ? getClass().getSimpleName() : null);
+      if( isRealized() ) {
+          final ScalableSurface ns = jawtWindow;
+          if( null != ns ) {
+              ns.setSurfaceScale(reqPixelScale);
+              final int hadPixelScaleX = hasPixelScale[0];
+              final int hadPixelScaleY = hasPixelScale[1];
+              ns.getCurrentSurfaceScale(hasPixelScale);
+              if( hadPixelScaleX != hasPixelScale[0] || hadPixelScaleY != hasPixelScale[1] ) {
+                  reshapeImpl(getWidth(), getHeight());
+                  display();
+              }
+          }
+      }
+  }
+
+  @Override
+  public final int[] getRequestedSurfaceScale(final int[] result) {
+      System.arraycopy(reqPixelScale, 0, result, 0, 2);
+      return result;
+  }
+
+  @Override
+  public final int[] getCurrentSurfaceScale(final int[] result) {
+      System.arraycopy(hasPixelScale, 0, result, 0, 2);
+      return result;
+  }
+
+  @Override
+  public int[] getNativeSurfaceScale(final int[] result) {
+      System.arraycopy(nativePixelScale, 0, result, 0, 2);
+      return result;
+  }
+
   private void createJAWTDrawableAndContext() {
     if ( !Beans.isDesignTime() ) {
         jawtWindow = (JAWTWindow) NativeWindowFactory.getNativeWindow(this, awtConfig);
         jawtWindow.setShallUseOffscreenLayer(shallUseOffscreenLayer);
+        jawtWindow.setSurfaceScale(reqPixelScale);
         jawtWindow.lockSurface();
         try {
             drawable = (GLDrawableImpl) GLDrawableFactory.getFactory(capsReqUser.getGLProfile()).createGLDrawable(jawtWindow);
             createContextImpl(drawable);
+            jawtWindow.getCurrentSurfaceScale(hasPixelScale);
+            jawtWindow.getNativeSurfaceScale(nativePixelScale);
         } finally {
             jawtWindow.unlockSurface();
         }
@@ -696,7 +716,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
           boolean res = _drawable.isRealized();
           if( !res ) {
               // re-try drawable creation
-              if( 0 >= _drawable.getWidth() || 0 >= _drawable.getHeight() ) {
+              if( 0 >= _drawable.getSurfaceWidth() || 0 >= _drawable.getSurfaceHeight() ) {
                   return false; // early out!
               }
               setRealized(true);
@@ -756,33 +776,42 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
       <DL><DD><CODE>reshape</CODE> in class <CODE>java.awt.Component</CODE></DD></DL> */
     @SuppressWarnings("deprecation")
     @Override
-  public void reshape(int x, int y, int width, int height) {
+  public void reshape(final int x, final int y, final int width, final int height) {
     synchronized (getTreeLock()) { // super.reshape(..) claims tree lock, so we do extend it's lock over reshape
         super.reshape(x, y, width, height);
+        reshapeImpl(width, height);
+    }
+  }
 
-        if(DEBUG) {
-            final NativeSurface ns = getNativeSurface();
-            final long nsH = null != ns ? ns.getSurfaceHandle() : 0;
-            System.err.println("GLCanvas.sizeChanged: ("+getThreadName()+"): "+width+"x"+height+" - surfaceHandle 0x"+Long.toHexString(nsH));
-            // Thread.dumpStack();
-        }
-        if( validateGLDrawable() && !printActive ) {
-            final GLDrawableImpl _drawable = drawable;
-            if( ! _drawable.getChosenGLCapabilities().isOnscreen() ) {
-                final RecursiveLock _lock = lock;
-                _lock.lock();
-                try {
-                    final GLDrawableImpl _drawableNew = GLDrawableHelper.resizeOffscreenDrawable(_drawable, context, width, height);
-                    if(_drawable != _drawableNew) {
-                        // write back
-                        drawable = _drawableNew;
-                    }
-                } finally {
-                   _lock.unlock();
+  private void reshapeImpl(final int width, final int height) {
+    final int scaledWidth = width * hasPixelScale[0];
+    final int scaledHeight = height * hasPixelScale[1];
+
+    if(DEBUG) {
+        final NativeSurface ns = getNativeSurface();
+        final long nsH = null != ns ? ns.getSurfaceHandle() : 0;
+        System.err.println(getThreadName()+": GLCanvas.reshape.0 "+this.getName()+" resize"+(printActive?"WithinPrint":"")+
+                " [ this "+getWidth()+"x"+getHeight()+", pixelScale "+getPixelScaleStr()+
+                "] -> "+(printActive?"[skipped] ":"") + width+"x"+height+" * "+getPixelScaleStr()+" -> "+scaledWidth+"x"+scaledHeight+
+                " - surfaceHandle 0x"+Long.toHexString(nsH));
+        // Thread.dumpStack();
+    }
+    if( validateGLDrawable() && !printActive ) {
+        final GLDrawableImpl _drawable = drawable;
+        if( ! _drawable.getChosenGLCapabilities().isOnscreen() ) {
+            final RecursiveLock _lock = lock;
+            _lock.lock();
+            try {
+                final GLDrawableImpl _drawableNew = GLDrawableHelper.resizeOffscreenDrawable(_drawable, context, scaledWidth, scaledHeight);
+                if(_drawable != _drawableNew) {
+                    // write back
+                    drawable = _drawableNew;
                 }
+            } finally {
+               _lock.unlock();
             }
-            sendReshape = true; // async if display() doesn't get called below, but avoiding deadlock
         }
+        sendReshape = true; // async if display() doesn't get called below, but avoiding deadlock
     }
   }
 
@@ -791,7 +820,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
    * canvas from interfering with the OpenGL rendering.
    */
   @Override
-  public void update(Graphics g) {
+  public void update(final Graphics g) {
     paint(g);
   }
 
@@ -801,7 +830,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   private AWTTilePainter printAWTTiles = null;
 
   @Override
-  public void setupPrint(double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
+  public void setupPrint(final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight) {
       printActive = true;
       final int componentCount = isOpaque() ? 3 : 4;
       final TileRenderer printRenderer = new TileRenderer();
@@ -831,45 +860,48 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
               printAnimator.remove(GLCanvas.this);
           }
           printGLAD = GLCanvas.this; // _not_ default, shall be replaced by offscreen GLAD
-          final GLCapabilities caps = (GLCapabilities)getChosenGLCapabilities().cloneMutable();
-          final int printNumSamples = printAWTTiles.getNumSamples(caps);
+          final GLCapabilitiesImmutable gladCaps = getChosenGLCapabilities();
+          final int printNumSamples = printAWTTiles.getNumSamples(gladCaps);
           GLDrawable printDrawable = printGLAD.getDelegatedDrawable();
-          final boolean reqNewGLADSamples = printNumSamples != caps.getNumSamples();
-          final boolean reqNewGLADSize = printAWTTiles.customTileWidth != -1 && printAWTTiles.customTileWidth != printDrawable.getWidth() ||
-                                         printAWTTiles.customTileHeight != -1 && printAWTTiles.customTileHeight != printDrawable.getHeight();
-          final boolean reqNewGLADOnscrn = caps.isOnscreen();
-          // It is desired to use a new offscreen GLAD, however Bug 830 forbids this for AA onscreen context.
-          // Bug 830: swapGLContextAndAllGLEventListener and onscreen MSAA w/ NV/GLX
-          final boolean reqNewGLAD = !caps.getSampleBuffers() && ( reqNewGLADOnscrn || reqNewGLADSamples || reqNewGLADSize );
+          final boolean reqNewGLADSamples = printNumSamples != gladCaps.getNumSamples();
+          final boolean reqNewGLADSize = printAWTTiles.customTileWidth != -1 && printAWTTiles.customTileWidth != printDrawable.getSurfaceWidth() ||
+                                         printAWTTiles.customTileHeight != -1 && printAWTTiles.customTileHeight != printDrawable.getSurfaceHeight();
+          final boolean reqNewGLADOnscrn = gladCaps.isOnscreen();
+
+          final GLCapabilities newGLADCaps = (GLCapabilities)gladCaps.cloneMutable();
+          newGLADCaps.setDoubleBuffered(false);
+          newGLADCaps.setOnscreen(false);
+          if( printNumSamples != newGLADCaps.getNumSamples() ) {
+              newGLADCaps.setSampleBuffers(0 < printNumSamples);
+              newGLADCaps.setNumSamples(printNumSamples);
+          }
+          final boolean reqNewGLADSafe = GLDrawableUtil.isSwapGLContextSafe(getRequestedGLCapabilities(), gladCaps, newGLADCaps);
+
+          final boolean reqNewGLAD = ( reqNewGLADOnscrn || reqNewGLADSamples || reqNewGLADSize ) && reqNewGLADSafe;
+
           if( DEBUG ) {
-              System.err.println("AWT print.setup: reqNewGLAD "+reqNewGLAD+"[ onscreen "+reqNewGLADOnscrn+", samples "+reqNewGLADSamples+", size "+reqNewGLADSize+"], "+
-                                 ", drawableSize "+printDrawable.getWidth()+"x"+printDrawable.getHeight()+
+              System.err.println("AWT print.setup: reqNewGLAD "+reqNewGLAD+"[ onscreen "+reqNewGLADOnscrn+", samples "+reqNewGLADSamples+", size "+reqNewGLADSize+", safe "+reqNewGLADSafe+"], "+
+                                 ", drawableSize "+printDrawable.getSurfaceWidth()+"x"+printDrawable.getSurfaceHeight()+
                                  ", customTileSize "+printAWTTiles.customTileWidth+"x"+printAWTTiles.customTileHeight+
                                  ", scaleMat "+printAWTTiles.scaleMatX+" x "+printAWTTiles.scaleMatY+
                                  ", numSamples "+printAWTTiles.customNumSamples+" -> "+printNumSamples+", printAnimator "+printAnimator);
           }
           if( reqNewGLAD ) {
-              caps.setDoubleBuffered(false);
-              caps.setOnscreen(false);
-              if( printNumSamples != caps.getNumSamples() ) {
-                  caps.setSampleBuffers(0 < printNumSamples);
-                  caps.setNumSamples(printNumSamples);
-              }
-              final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
-              printGLAD = factory.createOffscreenAutoDrawable(null, caps, null,
+              final GLDrawableFactory factory = GLDrawableFactory.getFactory(newGLADCaps.getGLProfile());
+              printGLAD = factory.createOffscreenAutoDrawable(null, newGLADCaps, null,
                       printAWTTiles.customTileWidth != -1 ? printAWTTiles.customTileWidth : DEFAULT_PRINT_TILE_SIZE,
                       printAWTTiles.customTileHeight != -1 ? printAWTTiles.customTileHeight : DEFAULT_PRINT_TILE_SIZE);
               GLDrawableUtil.swapGLContextAndAllGLEventListener(GLCanvas.this, printGLAD);
               printDrawable = printGLAD.getDelegatedDrawable();
           }
           printAWTTiles.setGLOrientation(printGLAD.isGLOriented(), printGLAD.isGLOriented());
-          printAWTTiles.renderer.setTileSize(printDrawable.getWidth(), printDrawable.getHeight(), 0);
+          printAWTTiles.renderer.setTileSize(printDrawable.getSurfaceWidth(), printDrawable.getSurfaceHeight(), 0);
           printAWTTiles.renderer.attachAutoDrawable(printGLAD);
           if( DEBUG ) {
               System.err.println("AWT print.setup "+printAWTTiles);
-              System.err.println("AWT print.setup AA "+printNumSamples+", "+caps);
-              System.err.println("AWT print.setup printGLAD: "+printGLAD.getWidth()+"x"+printGLAD.getHeight()+", "+printGLAD);
-              System.err.println("AWT print.setup printDraw: "+printDrawable.getWidth()+"x"+printDrawable.getHeight()+", "+printDrawable);
+              System.err.println("AWT print.setup AA "+printNumSamples+", "+newGLADCaps);
+              System.err.println("AWT print.setup printGLAD: "+printGLAD.getSurfaceWidth()+"x"+printGLAD.getSurfaceHeight()+", "+printGLAD);
+              System.err.println("AWT print.setup printDraw: "+printDrawable.getSurfaceWidth()+"x"+printDrawable.getSurfaceHeight()+", "+printDrawable);
           }
       }
   };
@@ -906,7 +938,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   };
 
   @Override
-  public void print(Graphics graphics) {
+  public void print(final Graphics graphics) {
       if( !printActive || null == printGLAD ) {
           throw new IllegalStateException("setupPrint() not called");
       }
@@ -940,8 +972,8 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
                   printAWTTiles.resetGraphics2D();
               }
           }
-      } catch (NoninvertibleTransformException nte) {
-          System.err.println("Catched: Inversion failed of: "+g2d.getTransform());
+      } catch (final NoninvertibleTransformException nte) {
+          System.err.println("Caught: Inversion failed of: "+g2d.getTransform());
           nte.printStackTrace();
       }
       if( DEBUG ) {
@@ -950,12 +982,12 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public void addGLEventListener(GLEventListener listener) {
+  public void addGLEventListener(final GLEventListener listener) {
     helper.addGLEventListener(listener);
   }
 
   @Override
-  public void addGLEventListener(int index, GLEventListener listener) throws IndexOutOfBoundsException {
+  public void addGLEventListener(final int index, final GLEventListener listener) throws IndexOutOfBoundsException {
     helper.addGLEventListener(index, listener);
   }
 
@@ -965,7 +997,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException {
+  public GLEventListener getGLEventListener(final int index) throws IndexOutOfBoundsException {
       return helper.getGLEventListener(index);
   }
 
@@ -975,29 +1007,29 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public boolean getGLEventListenerInitState(GLEventListener listener) {
+  public boolean getGLEventListenerInitState(final GLEventListener listener) {
       return helper.getGLEventListenerInitState(listener);
   }
 
   @Override
-  public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
+  public void setGLEventListenerInitState(final GLEventListener listener, final boolean initialized) {
       helper.setGLEventListenerInitState(listener, initialized);
   }
 
   @Override
-  public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
+  public GLEventListener disposeGLEventListener(final GLEventListener listener, final boolean remove) {
     final DisposeGLEventListenerAction r = new DisposeGLEventListenerAction(listener, remove);
     Threading.invoke(true, r, getTreeLock());
     return r.listener;
   }
 
   @Override
-  public GLEventListener removeGLEventListener(GLEventListener listener) {
+  public GLEventListener removeGLEventListener(final GLEventListener listener) {
     return helper.removeGLEventListener(listener);
   }
 
   @Override
-  public void setAnimator(GLAnimatorControl animatorControl) {
+  public void setAnimator(final GLAnimatorControl animatorControl) {
     helper.setAnimator(animatorControl);
   }
 
@@ -1007,7 +1039,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public final Thread setExclusiveContextThread(Thread t) throws GLException {
+  public final Thread setExclusiveContextThread(final Thread t) throws GLException {
       return helper.setExclusiveContextThread(t, context);
   }
 
@@ -1017,17 +1049,22 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public boolean invoke(boolean wait, GLRunnable glRunnable) {
+  public boolean invoke(final boolean wait, final GLRunnable glRunnable) throws IllegalStateException {
     return helper.invoke(this, wait, glRunnable);
   }
 
   @Override
-  public boolean invoke(final boolean wait, final List<GLRunnable> glRunnables) {
+  public boolean invoke(final boolean wait, final List<GLRunnable> glRunnables) throws IllegalStateException {
     return helper.invoke(this, wait, glRunnables);
   }
 
   @Override
-  public GLContext setContext(GLContext newCtx, boolean destroyPrevCtx) {
+  public void flushGLRunnables() {
+      helper.flushGLRunnables();
+  }
+
+  @Override
+  public GLContext setContext(final GLContext newCtx, final boolean destroyPrevCtx) {
       final RecursiveLock _lock = lock;
       _lock.lock();
       try {
@@ -1060,7 +1097,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public GL setGL(GL gl) {
+  public GL setGL(final GL gl) {
     final GLContext _context = context;
     if (_context != null) {
       _context.setGL(gl);
@@ -1071,7 +1108,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
 
 
   @Override
-  public void setAutoSwapBufferMode(boolean onOrOff) {
+  public void setAutoSwapBufferMode(final boolean onOrOff) {
     helper.setAutoSwapBufferMode(onOrOff);
   }
 
@@ -1086,7 +1123,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public void setContextCreationFlags(int flags) {
+  public void setContextCreationFlags(final int flags) {
     additionalCtxCreationFlags = flags;
     final GLContext _context = context;
     if(null != _context) {
@@ -1114,6 +1151,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
     return (GLCapabilitiesImmutable)awtConfig.getChosenCapabilities();
   }
 
+  @Override
   public GLCapabilitiesImmutable getRequestedGLCapabilities() {
     if( null == awtConfig ) {
         return capsReqUser;
@@ -1122,6 +1160,16 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
+  public int getSurfaceWidth() {
+      return getWidth() * hasPixelScale[0];
+  }
+
+  @Override
+  public int getSurfaceHeight() {
+      return getHeight() * hasPixelScale[1];
+  }
+
+  @Override
   public boolean isGLOriented() {
     final GLDrawable _drawable = drawable;
     return null != _drawable ? _drawable.isGLOriented() : true;
@@ -1148,23 +1196,25 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   @Override
   public String toString() {
     final GLDrawable _drawable = drawable;
-    final int dw = (null!=_drawable) ? _drawable.getWidth() : -1;
-    final int dh = (null!=_drawable) ? _drawable.getHeight() : -1;
+    final int dw = (null!=_drawable) ? _drawable.getSurfaceWidth() : -1;
+    final int dh = (null!=_drawable) ? _drawable.getSurfaceHeight() : -1;
 
     return "AWT-GLCanvas[Realized "+isRealized()+
                           ",\n\t"+((null!=_drawable)?_drawable.getClass().getName():"null-drawable")+
                           ",\n\tFactory   "+getFactory()+
                           ",\n\thandle    0x"+Long.toHexString(getHandle())+
-                          ",\n\tDrawable size "+dw+"x"+dh+
-                          ",\n\tAWT pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+
+                          ",\n\tDrawable size "+dw+"x"+dh+" surface["+getSurfaceWidth()+"x"+getSurfaceHeight()+"]"+
+                          ",\n\tAWT[pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+
                           ",\n\tvisible "+isVisible()+", displayable "+isDisplayable()+", showing "+isShowing+
-                          ",\n\t"+awtConfig+"]";
+                          ",\n\t"+awtConfig+"]]";
   }
 
   //----------------------------------------------------------------------
   // Internals only below this point
   //
 
+  private final String getPixelScaleStr() { return hasPixelScale[0]+"x"+hasPixelScale[1]; }
+
   private final Runnable destroyOnEDTAction = new Runnable() {
     @Override
     public void run() {
@@ -1187,26 +1237,32 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
                 animatorPaused = false;
             }
 
+            GLException exceptionOnDisposeGL = null;
+
             // OLS will be detached by disposeGL's context destruction below
             if( null != context ) {
                 if( context.isCreated() ) {
-                    // Catch dispose GLExceptions by GLEventListener, just 'print' them
-                    // so we can continue with the destruction.
                     try {
                         helper.disposeGL(GLCanvas.this, context, true);
                         if(DEBUG) {
                             System.err.println(getThreadName()+": destroyOnEDTAction() - post ctx: "+context);
                         }
-                    } catch (GLException gle) {
-                        gle.printStackTrace();
+                    } catch (final GLException gle) {
+                        exceptionOnDisposeGL = gle;
                     }
                 }
                 context = null;
             }
+
+            Throwable exceptionOnUnrealize = null;
             if( null != drawable ) {
-                drawable.setRealized(false);
-                if(DEBUG) {
-                    System.err.println(getThreadName()+": destroyOnEDTAction() - post drawable: "+drawable);
+                try {
+                    drawable.setRealized(false);
+                    if(DEBUG) {
+                        System.err.println(getThreadName()+": destroyOnEDTAction() - post drawable: "+drawable);
+                    }
+                } catch( final Throwable re ) {
+                    exceptionOnUnrealize = re;
                 }
                 drawable = null;
             }
@@ -1215,6 +1271,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
                 animator.resume();
             }
 
+            // throw exception in order of occurrence ..
+            if( null != exceptionOnDisposeGL ) {
+                throw exceptionOnDisposeGL;
+            }
+            if( null != exceptionOnUnrealize ) {
+                throw GLException.newGLException(exceptionOnUnrealize);
+            }
+
             if(DEBUG) {
                 System.err.println(getThreadName()+": dispose() - END, animator "+animator);
             }
@@ -1247,6 +1311,10 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
             }
             jawtWindow=null;
         }
+        hasPixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+        hasPixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
+        nativePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+        nativePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
 
         if(null != awtConfig) {
             final AbstractGraphicsConfiguration aconfig = awtConfig.getNativeGraphicsConfiguration();
@@ -1257,7 +1325,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
             } else {
                 adeviceMsg = null;
             }
-            boolean closed = adevice.close();
+            final boolean closed = adevice.close();
             if(DEBUG) {
                 System.err.println(getThreadName()+": GLCanvas.disposeJAWTWindowAndAWTDeviceOnEDT(): post GraphicsDevice: "+adeviceMsg+", result: "+closed);
             }
@@ -1278,11 +1346,11 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
     public void run() {
       if (sendReshape) {
         if(DEBUG) {
-            System.err.println(getThreadName()+": Reshape: "+getWidth()+"x"+getHeight());
+            System.err.println(getThreadName()+": Reshape: "+getSurfaceWidth()+"x"+getSurfaceHeight());
         }
         // Note: we ignore the given x and y within the parent component
         // since we are drawing directly into this heavyweight component.
-        helper.reshape(GLCanvas.this, 0, 0, getWidth(), getHeight());
+        helper.reshape(GLCanvas.this, 0, 0, getSurfaceWidth(), getSurfaceHeight());
         sendReshape = false;
       }
 
@@ -1323,7 +1391,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   private class DisposeGLEventListenerAction implements Runnable {
     GLEventListener listener;
     private final boolean remove;
-    private DisposeGLEventListenerAction(GLEventListener listener, boolean remove) {
+    private DisposeGLEventListenerAction(final GLEventListener listener, final boolean remove) {
         this.listener = listener;
         this.remove = remove;
     }
@@ -1361,16 +1429,16 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
                       clazz.getDeclaredMethod("disableBackgroundErase",
                                               new Class[] { Canvas.class });
                     disableBackgroundEraseMethod.setAccessible(true);
-                  } catch (Exception e) {
+                  } catch (final Exception e) {
                     clazz = clazz.getSuperclass();
                   }
                 }
-              } catch (Exception e) {
+              } catch (final Exception e) {
               }
               return null;
             }
           });
-      } catch (Exception e) {
+      } catch (final Exception e) {
       }
       disableBackgroundEraseInitialized = true;
       if(DEBUG) {
@@ -1382,7 +1450,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
       Throwable t=null;
       try {
         disableBackgroundEraseMethod.invoke(getToolkit(), new Object[] { this });
-      } catch (Exception e) {
+      } catch (final Exception e) {
         t = e;
       }
       if(DEBUG) {
@@ -1428,7 +1496,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
             EventQueue.invokeAndWait(new Runnable() {
                 @Override
                 public void run() {
-                    AWTGraphicsConfiguration c = (AWTGraphicsConfiguration)
+                    final AWTGraphicsConfiguration c = (AWTGraphicsConfiguration)
                             GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class, GLCapabilitiesImmutable.class).chooseGraphicsConfiguration(capsChosen,
                                                                                                                          capsRequested,
                                                                                                                          chooser, aScreen, VisualIDHolder.VID_UNDEFINED);
@@ -1436,14 +1504,14 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
                 }
             });
             config = ( bucket.size() > 0 ) ? bucket.get(0) : null ;
-        } catch (InvocationTargetException e) {
+        } catch (final InvocationTargetException e) {
             throw new GLException(e.getTargetException());
-        } catch (InterruptedException e) {
+        } catch (final InterruptedException e) {
             throw new GLException(e);
         }
     }
 
-    if (config == null) {
+    if ( null == config ) {
       throw new GLException("Error: Couldn't fetch AWTGraphicsConfiguration");
     }
 
@@ -1455,7 +1523,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
   /**
    * A most simple JOGL AWT test entry
    */
-  public static void main(String args[]) {
+  public static void main(final String args[]) {
     System.err.println(VersionUtil.getPlatformInfo());
     System.err.println(GlueGenVersion.getInstance());
     // System.err.println(NativeWindowVersion.getInstance());
@@ -1472,16 +1540,16 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
 
     glCanvas.addGLEventListener(new GLEventListener() {
         @Override
-        public void init(GLAutoDrawable drawable) {
-            GL gl = drawable.getGL();
+        public void init(final GLAutoDrawable drawable) {
+            final GL gl = drawable.getGL();
             System.err.println(JoglVersion.getGLInfo(gl, null));
         }
         @Override
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         @Override
-        public void display(GLAutoDrawable drawable) { }
+        public void display(final GLAutoDrawable drawable) { }
         @Override
-        public void dispose(GLAutoDrawable drawable) { }
+        public void dispose(final GLAutoDrawable drawable) { }
     });
 
     try {
@@ -1490,7 +1558,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
             public void run() {
                 frame.setVisible(true);
             }});
-    } catch (Throwable t) {
+    } catch (final Throwable t) {
         t.printStackTrace();
     }
     glCanvas.display();
@@ -1500,7 +1568,7 @@ public class GLCanvas extends Canvas implements AWTGLAutoDrawable, WindowClosing
             public void run() {
                 frame.dispose();
             }});
-    } catch (Throwable t) {
+    } catch (final Throwable t) {
         t.printStackTrace();
     }
   }
diff --git a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
index fbd923a..1682c6d 100644
--- a/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
+++ b/src/jogl/classes/javax/media/opengl/awt/GLJPanel.java
@@ -60,6 +60,7 @@ import java.util.List;
 
 import javax.media.nativewindow.AbstractGraphicsDevice;
 import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.ScalableSurface;
 import javax.media.nativewindow.SurfaceUpdatedListener;
 import javax.media.nativewindow.WindowClosingProtocol;
 import javax.media.opengl.GL;
@@ -83,6 +84,9 @@ import javax.media.opengl.GLSharedContextSetter;
 import javax.media.opengl.Threading;
 import javax.swing.JPanel;
 
+import jogamp.nativewindow.SurfaceScaleUtils;
+import jogamp.nativewindow.WrappedSurface;
+import jogamp.nativewindow.jawt.JAWTUtil;
 import jogamp.opengl.Debug;
 import jogamp.opengl.GLContextImpl;
 import jogamp.opengl.GLDrawableFactoryImpl;
@@ -92,7 +96,10 @@ import jogamp.opengl.awt.AWTTilePainter;
 import jogamp.opengl.awt.Java2D;
 import jogamp.opengl.util.glsl.GLSLTextureRaster;
 
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.common.util.awt.AWTEDTExecutor;
+import com.jogamp.common.util.locks.LockFactory;
+import com.jogamp.common.util.locks.RecursiveLock;
 import com.jogamp.nativewindow.awt.AWTPrintLifecycle;
 import com.jogamp.nativewindow.awt.AWTWindowClosingProtocol;
 import com.jogamp.opengl.FBObject;
@@ -123,19 +130,19 @@ import com.jogamp.opengl.util.texture.TextureState;
     using {@link GLDrawableFactory#createOffscreenDrawable(AbstractGraphicsDevice, GLCapabilitiesImmutable, GLCapabilitiesChooser, int, int) GLDrawableFactory.createOffscreenDrawable(..)}.<br/>
     </p>
     <p>
-    <a name="verticalFlip">
-    In case</a> the drawable {@link #isGLOriented()} and {@link #setSkipGLOrientationVerticalFlip(boolean) vertical flip is not skipped},
-    this component performs the required vertical flip to bring the content from OpenGL's orientation into AWT's orientation.
+    <a name="verticalFlip">A vertical-flip is required</a>, if the drawable {@link #isGLOriented()} and {@link #setSkipGLOrientationVerticalFlip(boolean) vertical flip is not skipped}.<br>
+    In this case this component performs the required vertical flip to bring the content from OpenGL's orientation into AWT's orientation.<br>
+    In case <a href="#fboGLSLVerticalFlip">GLSL based vertical-flip</a> is not available,
+    the CPU intensive {@link System#arraycopy(Object, int, Object, int, int) System.arraycopy(..)} is used line by line.
     See details about <a href="#fboGLSLVerticalFlip">FBO and GLSL vertical flipping</a>.
     </p>
     <p>
-    The OpenGL path is concluded by copying the rendered pixels an {@link BufferedImage} via {@link GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer) glReadPixels(..)}
-    for later Java2D composition.
+    For performance reasons, as well as for <a href="#bug842">GL state sideeffects</a>,
+    <b>{@link #setSkipGLOrientationVerticalFlip(boolean) skipping vertical flip} is highly recommended</b>!
     </p>
     <p>
-    In case {@link #setSkipGLOrientationVerticalFlip(boolean) vertical-flip is not skipped} and <a href="#fboGLSLVerticalFlip">GLSL based vertical-flip</a> is not performed,
-    {@link System#arraycopy(Object, int, Object, int, int) System.arraycopy(..)} is used line by line.
-    This step causes more CPU load per frame and is not hardware-accelerated.
+    The OpenGL path is concluded by copying the rendered pixels an {@link BufferedImage} via {@link GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer) glReadPixels(..)}
+    for later Java2D composition.
     </p>
     <p>
     Finally the Java2D compositioning takes place via via {@link Graphics#drawImage(java.awt.Image, int, int, int, int, java.awt.image.ImageObserver) Graphics.drawImage(...)}
@@ -146,7 +153,8 @@ import com.jogamp.opengl.util.texture.TextureState;
  *  </P>
  *
     <a name="fboGLSLVerticalFlip"><h5>FBO / GLSL Vertical Flip</h5></a>
-    In case FBO is used and GLSL is available and {@link #setSkipGLOrientationVerticalFlip(boolean) vertical flip is not skipped}, a fragment shader is utilized
+    If <a href="#verticalFlip">vertical flip is required</a>,
+    FBO is used, GLSL is available and {@link #setSkipGLOrientationVerticalFlip(boolean) vertical flip is not skipped}, a fragment shader is utilized
     to flip the FBO texture vertically. This hardware-accelerated step can be disabled via system property <code>jogl.gljpanel.noglsl</code>.
     <p>
     The FBO / GLSL code path uses one texture-unit and binds the FBO texture to it's active texture-target,
@@ -160,16 +168,21 @@ import com.jogamp.opengl.util.texture.TextureState;
     The current gl-viewport is preserved.
     </p>
     <p>
-    <i>Warning (Bug 842)</i>: Certain GL states other than viewport and texture (see above)
+    <a name="bug842"><i>Warning (Bug 842)</i></a>: Certain GL states other than viewport and texture (see above)
     influencing rendering, will also influence the GLSL vertical flip, e.g. {@link GL#glFrontFace(int) glFrontFace}({@link GL#GL_CCW}).
     It is recommended to reset those states to default when leaving the {@link GLEventListener#display(GLAutoDrawable)} method!
     We may change this behavior in the future, i.e. preserve all influencing states.
     </p>
+    <a name="contextSharing"><h5>OpenGL Context Sharing</h5></a>
+    To share a {@link GLContext} see the following note in the documentation overview:
+    <a href="../../../spec-overview.html#SHARING">context sharing</a>
+    as well as {@link GLSharedContextSetter}.
 */
 
 @SuppressWarnings("serial")
-public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosingProtocol, AWTPrintLifecycle, GLSharedContextSetter {
+public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosingProtocol, AWTPrintLifecycle, GLSharedContextSetter, ScalableSurface {
   private static final boolean DEBUG;
+  private static final boolean DEBUG_FRAMES;
   private static final boolean DEBUG_VIEWPORT;
   private static final boolean USE_GLSL_TEXTURE_RASTERIZER;
   private static final boolean SKIP_VERTICAL_FLIP_DEFAULT;
@@ -186,11 +199,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   static {
       Debug.initSingleton();
       DEBUG = Debug.debug("GLJPanel");
-      DEBUG_VIEWPORT = Debug.isPropertyDefined("jogl.debug.GLJPanel.Viewport", true);
-      USE_GLSL_TEXTURE_RASTERIZER = !Debug.isPropertyDefined("jogl.gljpanel.noglsl", true);
-      SKIP_VERTICAL_FLIP_DEFAULT = Debug.isPropertyDefined("jogl.gljpanel.noverticalflip", true);
-      boolean enabled = Debug.getBooleanProperty("sun.java2d.opengl", false);
-      java2dOGLEnabledByProp = enabled && !Debug.isPropertyDefined("jogl.gljpanel.noogl", true);
+      DEBUG_FRAMES = PropertyAccess.isPropertyDefined("jogl.debug.GLJPanel.Frames", true);
+      DEBUG_VIEWPORT = PropertyAccess.isPropertyDefined("jogl.debug.GLJPanel.Viewport", true);
+      USE_GLSL_TEXTURE_RASTERIZER = !PropertyAccess.isPropertyDefined("jogl.gljpanel.noglsl", true);
+      SKIP_VERTICAL_FLIP_DEFAULT = PropertyAccess.isPropertyDefined("jogl.gljpanel.noverticalflip", true);
+      boolean enabled = PropertyAccess.getBooleanProperty("sun.java2d.opengl", false);
+      java2dOGLEnabledByProp = enabled && !PropertyAccess.isPropertyDefined("jogl.gljpanel.noogl", true);
 
       enabled = false;
       if( java2dOGLEnabledByProp ) {
@@ -223,6 +237,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       return singleAWTGLPixelBufferProvider;
   }
 
+  /** Currently not used internally, exist merely to satisfy {@link #getUpstreamLock()}. */
+  private final RecursiveLock lock = LockFactory.createRecursiveLock();
+
   private final GLDrawableHelper helper;
   private boolean autoSwapBufferMode;
 
@@ -232,8 +249,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   // Data used for either pbuffers or pixmap-based offscreen surfaces
   //
   private AWTGLPixelBufferProvider customPixelBufferProvider = null;
-  /** Single buffered offscreen caps */
-  private GLCapabilitiesImmutable offscreenCaps;
+  /** Requested single buffered offscreen caps */
+  private final GLCapabilitiesImmutable reqOffscreenCaps;
   private final GLProfile             glProfile;
   private final GLDrawableFactoryImpl factory;
   private final GLCapabilitiesChooser chooser;
@@ -243,6 +260,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   private boolean handleReshape = false;
   private boolean sendReshape = true;
 
+  private final int[] nativePixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+  private final int[] hasPixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+  private final int[] reqPixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
+
   // For handling reshape events lazily: reshapeWidth -> panelWidth -> backend.width
   private int reshapeWidth;
   private int reshapeHeight;
@@ -273,7 +294,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   private volatile boolean isShowing;
   private final HierarchyListener hierarchyListener = new HierarchyListener() {
       @Override
-      public void hierarchyChanged(HierarchyEvent e) {
+      public void hierarchyChanged(final HierarchyEvent e) {
           isShowing = GLJPanel.this.isShowing();
       }
   };
@@ -289,6 +310,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   /** Creates a new GLJPanel component with a default set of OpenGL
       capabilities and using the default OpenGL capabilities selection
       mechanism.
+      <p>
+      See details about <a href="#contextSharing">OpenGL context sharing</a>.
+      </p>
    * @throws GLException if no default profile is available for the default desktop device.
    */
   public GLJPanel() throws GLException {
@@ -298,10 +322,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   /** Creates a new GLJPanel component with the requested set of
       OpenGL capabilities, using the default OpenGL capabilities
       selection mechanism.
+      <p>
+      See details about <a href="#contextSharing">OpenGL context sharing</a>.
+      </p>
    * @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
    */
-  public GLJPanel(GLCapabilitiesImmutable userCapsRequest) throws GLException {
-    this(userCapsRequest, null, null);
+  public GLJPanel(final GLCapabilitiesImmutable userCapsRequest) throws GLException {
+    this(userCapsRequest, null);
   }
 
   /** Creates a new GLJPanel component. The passed GLCapabilities
@@ -310,32 +337,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       specifies the algorithm for selecting one of the available
       GLCapabilities for the component; a DefaultGLCapabilitesChooser
       is used if null is passed for this argument.
+      <p>
+      See details about <a href="#contextSharing">OpenGL context sharing</a>.
+      </p>
     * @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
   */
-  public GLJPanel(GLCapabilitiesImmutable userCapsRequest, GLCapabilitiesChooser chooser)
-          throws GLException
-  {
-      this(userCapsRequest, chooser, null);
-  }
-
-  /** Creates a new GLJPanel component. The passed GLCapabilities
-      specifies the OpenGL capabilities for the component; if null, a
-      default set of capabilities is used. The GLCapabilitiesChooser
-      specifies the algorithm for selecting one of the available
-      GLCapabilities for the component; a DefaultGLCapabilitesChooser
-      is used if null is passed for this argument. The passed
-      GLContext specifies an OpenGL context with which to share
-      textures, display lists and other OpenGL state, and may be null
-      if sharing is not desired. See the note in the overview documentation on
-      <a href="../../../spec-overview.html#SHARING">context sharing</a>.
-      <P>
-      Note: Sharing cannot be enabled using J2D OpenGL FBO sharing,
-      since J2D GL Context must be shared and we can only share one context.
-    * @throws GLException if no GLCapabilities are given and no default profile is available for the default desktop device.
-    * @deprecated Use {@link #GLJPanel(GLCapabilitiesImmutable, GLCapabilitiesChooser)}
-    *             and set shared GLContext via {@link #setSharedContext(GLContext)} or {@link #setSharedAutoDrawable(GLAutoDrawable)}.
-    */
-  public GLJPanel(GLCapabilitiesImmutable userCapsRequest, GLCapabilitiesChooser chooser, GLContext shareWith)
+  public GLJPanel(final GLCapabilitiesImmutable userCapsRequest, final GLCapabilitiesChooser chooser)
           throws GLException
   {
     super();
@@ -350,16 +357,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
             caps = new GLCapabilities(GLProfile.getDefault(GLProfile.getDefaultDevice()));
         }
         caps.setDoubleBuffered(false);
-        offscreenCaps = caps;
+        reqOffscreenCaps = caps;
     }
-    this.glProfile = offscreenCaps.getGLProfile();
+    this.glProfile = reqOffscreenCaps.getGLProfile();
     this.factory = GLDrawableFactoryImpl.getFactoryImpl(glProfile);
     this.chooser = chooser;
 
     helper = new GLDrawableHelper();
-    if( null != shareWith ) {
-        helper.setSharedContext(null, shareWith);
-    }
     autoSwapBufferMode = helper.getAutoSwapBufferMode();
 
     this.setFocusable(true); // allow keyboard input!
@@ -385,7 +389,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
    * <p>
    * @param offthread
    */
-  public final boolean initializeBackend(boolean offthread) {
+  public final boolean initializeBackend(final boolean offthread) {
     if( offthread ) {
         new Thread(getThreadName()+"-GLJPanel_Init") {
             public void run() {
@@ -404,12 +408,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public final void setSharedContext(GLContext sharedContext) throws IllegalStateException {
+  public final void setSharedContext(final GLContext sharedContext) throws IllegalStateException {
       helper.setSharedContext(this.getContext(), sharedContext);
   }
 
   @Override
-  public final void setSharedAutoDrawable(GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
+  public final void setSharedAutoDrawable(final GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
       helper.setSharedAutoDrawable(this, sharedAutoDrawable);
   }
 
@@ -420,7 +424,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
    * @throws IllegalArgumentException if <code>custom</code> is <code>null</code>
    * @throws IllegalStateException if backend is already realized, i.e. this instanced already painted once.
    */
-  public void setPixelBufferProvider(AWTGLPixelBufferProvider custom) throws IllegalArgumentException, IllegalStateException {
+  public void setPixelBufferProvider(final AWTGLPixelBufferProvider custom) throws IllegalArgumentException, IllegalStateException {
       if( null == custom ) {
           throw new IllegalArgumentException("Null PixelBufferProvider");
       }
@@ -436,6 +440,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
+  public final RecursiveLock getUpstreamLock() { return lock; }
+
+  @Override
+  public final boolean isThreadGLCapable() { return EventQueue.isDispatchThread(); }
+
+  @Override
   public void display() {
     if( isShowing || ( printActive && isVisible() ) ) {
         if (EventQueue.isDispatchThread()) {
@@ -446,7 +456,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
           // so do everything on the event dispatch thread
           try {
             EventQueue.invokeAndWait(paintImmediatelyAction);
-          } catch (Exception e) {
+          } catch (final Exception e) {
             throw new GLException(e);
           }
         }
@@ -461,7 +471,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
 
     if (backend != null && backend.getContext() != null) {
       boolean animatorPaused = false;
-      GLAnimatorControl animator =  getAnimator();
+      final GLAnimatorControl animator =  getAnimator();
       if(null!=animator) {
         animatorPaused = animator.pause();
       }
@@ -479,6 +489,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
         animator.resume();
       }
     }
+    hasPixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+    hasPixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
+    nativePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+    nativePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
 
     if(DEBUG) {
         System.err.println(getThreadName()+": GLJPanel.dispose() - stop");
@@ -505,16 +519,16 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       // Make GLJPanel behave better in NetBeans GUI builder
       g.setColor(Color.BLACK);
       g.fillRect(0, 0, getWidth(), getHeight());
-      FontMetrics fm = g.getFontMetrics();
+      final FontMetrics fm = g.getFontMetrics();
       String name = getName();
       if (name == null) {
         name = getClass().getName();
-        int idx = name.lastIndexOf('.');
+        final int idx = name.lastIndexOf('.');
         if (idx >= 0) {
           name = name.substring(idx + 1);
         }
       }
-      Rectangle2D bounds = fm.getStringBounds(name, g);
+      final Rectangle2D bounds = fm.getStringBounds(name, g);
       g.setColor(Color.WHITE);
       g.drawString(name,
                    (int) ((getWidth()  - bounds.getWidth())  / 2),
@@ -547,6 +561,47 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     }
   }
 
+  private final void updateWrappedSurfaceScale(final GLDrawable d) {
+      final NativeSurface s = d.getNativeSurface();
+      if( s instanceof WrappedSurface ) {
+          ((WrappedSurface)s).setSurfaceScale(hasPixelScale);
+      }
+  }
+
+  @Override
+  public final void setSurfaceScale(final int[] pixelScale) { // HiDPI support
+      SurfaceScaleUtils.validateReqPixelScale(reqPixelScale, pixelScale, DEBUG ? getClass().getSimpleName() : null);
+      final Backend b = backend;
+      if ( isInitialized && null != b ) {
+          final int hadPixelScaleX = hasPixelScale[0];
+          final int hadPixelScaleY = hasPixelScale[1];
+          SurfaceScaleUtils.computePixelScale(hasPixelScale, hasPixelScale, reqPixelScale, nativePixelScale, DEBUG ? getClass().getSimpleName() : null);
+          if( hadPixelScaleX != hasPixelScale[0] || hadPixelScaleY != hasPixelScale[1] ) {
+              updateWrappedSurfaceScale(b.getDrawable());
+              reshapeImpl(getWidth(), getHeight());
+              display();
+          }
+      }
+  }
+
+  @Override
+  public final int[] getRequestedSurfaceScale(final int[] result) {
+      System.arraycopy(reqPixelScale, 0, result, 0, 2);
+      return result;
+  }
+
+  @Override
+  public final int[] getCurrentSurfaceScale(final int[] result) {
+      System.arraycopy(hasPixelScale, 0, result, 0, 2);
+      return result;
+  }
+
+  @Override
+  public int[] getNativeSurfaceScale(final int[] result) {
+      System.arraycopy(nativePixelScale, 0, result, 0, 2);
+      return result;
+  }
+
   /** Overridden to track when this component is added to a container.
       Subclasses which override this method must call
       super.addNotify() in their addNotify() method in order to
@@ -557,8 +612,17 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   public void addNotify() {
     super.addNotify();
     awtWindowClosingProtocol.addClosingListener();
+
+    // HiDPI support
+    {
+        final int ps = JAWTUtil.getPixelScale(getGraphicsConfiguration());
+        nativePixelScale[0] = ps;
+        nativePixelScale[1] = ps;
+    }
+    SurfaceScaleUtils.computePixelScale(hasPixelScale, hasPixelScale, reqPixelScale, nativePixelScale, DEBUG ? getClass().getSimpleName() : null);
+
     if (DEBUG) {
-      System.err.println(getThreadName()+": GLJPanel.addNotify()");
+        System.err.println(getThreadName()+": GLJPanel.addNotify()");
     }
   }
 
@@ -585,18 +649,24 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
    */
   @SuppressWarnings("deprecation")
   @Override
-  public void reshape(int x, int y, int width, int height) {
+  public void reshape(final int x, final int y, final int width, final int height) {
     super.reshape(x, y, width, height);
+    reshapeImpl(width, height);
+  }
 
+  private void reshapeImpl(final int width, final int height) {
+    final int scaledWidth = width * hasPixelScale[0];
+    final int scaledHeight = height * hasPixelScale[1];
     if( DEBUG ) {
-        System.err.println(getThreadName()+": GLJPanel.reshape.0 "+this.getName()+" resize"+(printActive?"WithinPrint":"")+" [ this "+getWidth()+"x"+getHeight()+", panel "+
-                panelWidth+"x"+panelHeight +
+        System.err.println(getThreadName()+": GLJPanel.reshape.0 "+this.getName()+" resize"+(printActive?"WithinPrint":"")+
+                " [ this "+getWidth()+"x"+getHeight()+", pixelScale "+getPixelScaleStr()+
+                ", panel "+panelWidth+"x"+panelHeight +
                 ", reshape: " +reshapeWidth+"x"+reshapeHeight +
-                "] -> "+(printActive?"skipped":"") + width+"x"+height);
+                "] -> "+(printActive?"[skipped] ":"") + width+"x"+height+" * "+getPixelScaleStr()+" -> "+scaledWidth+"x"+scaledHeight);
     }
     if( !printActive ) {
-        reshapeWidth = width;
-        reshapeHeight = height;
+        reshapeWidth = scaledWidth;
+        reshapeHeight = scaledHeight;
         handleReshape = true;
     }
   }
@@ -607,7 +677,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   private AWTTilePainter printAWTTiles = null;
 
   @Override
-  public void setupPrint(double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
+  public void setupPrint(final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight) {
       printActive = true;
       final int componentCount = isOpaque() ? 3 : 4;
       final TileRenderer printRenderer = new TileRenderer();
@@ -642,40 +712,47 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
           }
 
           printGLAD = GLJPanel.this; // default: re-use
-          final GLCapabilities caps = (GLCapabilities)getChosenGLCapabilities().cloneMutable();
-          final int printNumSamples = printAWTTiles.getNumSamples(caps);
+          final GLCapabilitiesImmutable gladCaps = getChosenGLCapabilities();
+          final int printNumSamples = printAWTTiles.getNumSamples(gladCaps);
           GLDrawable printDrawable = printGLAD.getDelegatedDrawable();
-          final boolean reqNewGLADSamples = printNumSamples != caps.getNumSamples();
-          final boolean reqNewGLADSize = printAWTTiles.customTileWidth != -1 && printAWTTiles.customTileWidth != printDrawable.getWidth() ||
-                                         printAWTTiles.customTileHeight != -1 && printAWTTiles.customTileHeight != printDrawable.getHeight();
-          final boolean reqNewGLAD = reqNewGLADSamples || reqNewGLADSize ;
+          final boolean reqNewGLADSamples = printNumSamples != gladCaps.getNumSamples();
+          final boolean reqNewGLADSize = printAWTTiles.customTileWidth != -1 && printAWTTiles.customTileWidth != printDrawable.getSurfaceWidth() ||
+                                         printAWTTiles.customTileHeight != -1 && printAWTTiles.customTileHeight != printDrawable.getSurfaceHeight();
+
+          final GLCapabilities newGLADCaps = (GLCapabilities)gladCaps.cloneMutable();
+          newGLADCaps.setDoubleBuffered(false);
+          newGLADCaps.setOnscreen(false);
+          if( printNumSamples != newGLADCaps.getNumSamples() ) {
+              newGLADCaps.setSampleBuffers(0 < printNumSamples);
+              newGLADCaps.setNumSamples(printNumSamples);
+          }
+          final boolean reqNewGLADSafe = GLDrawableUtil.isSwapGLContextSafe(getRequestedGLCapabilities(), gladCaps, newGLADCaps);
+
+          final boolean reqNewGLAD = ( reqNewGLADSamples || reqNewGLADSize ) && reqNewGLADSafe;
+
           if( DEBUG ) {
-              System.err.println("AWT print.setup: reqNewGLAD "+reqNewGLAD+"[ samples "+reqNewGLADSamples+", size "+reqNewGLADSize+"], "+
-                                 ", drawableSize "+printDrawable.getWidth()+"x"+printDrawable.getHeight()+
+              System.err.println("AWT print.setup: reqNewGLAD "+reqNewGLAD+"[ samples "+reqNewGLADSamples+", size "+reqNewGLADSize+", safe "+reqNewGLADSafe+"], "+
+                                 ", drawableSize "+printDrawable.getSurfaceWidth()+"x"+printDrawable.getSurfaceHeight()+
                                  ", customTileSize "+printAWTTiles.customTileWidth+"x"+printAWTTiles.customTileHeight+
                                  ", scaleMat "+printAWTTiles.scaleMatX+" x "+printAWTTiles.scaleMatY+
                                  ", numSamples "+printAWTTiles.customNumSamples+" -> "+printNumSamples+", printAnimator "+printAnimator);
           }
           if( reqNewGLAD ) {
-              caps.setDoubleBuffered(false);
-              caps.setOnscreen(false);
-              caps.setSampleBuffers(0 < printNumSamples);
-              caps.setNumSamples(printNumSamples);
-              final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
-              printGLAD = factory.createOffscreenAutoDrawable(null, caps, null,
+              final GLDrawableFactory factory = GLDrawableFactory.getFactory(newGLADCaps.getGLProfile());
+              printGLAD = factory.createOffscreenAutoDrawable(null, newGLADCaps, null,
                       printAWTTiles.customTileWidth != -1 ? printAWTTiles.customTileWidth : DEFAULT_PRINT_TILE_SIZE,
                       printAWTTiles.customTileHeight != -1 ? printAWTTiles.customTileHeight : DEFAULT_PRINT_TILE_SIZE);
               GLDrawableUtil.swapGLContextAndAllGLEventListener(GLJPanel.this, printGLAD);
               printDrawable = printGLAD.getDelegatedDrawable();
           }
           printAWTTiles.setGLOrientation( !GLJPanel.this.skipGLOrientationVerticalFlip && printGLAD.isGLOriented(), printGLAD.isGLOriented() );
-          printAWTTiles.renderer.setTileSize(printDrawable.getWidth(), printDrawable.getHeight(), 0);
+          printAWTTiles.renderer.setTileSize(printDrawable.getSurfaceWidth(), printDrawable.getSurfaceHeight(), 0);
           printAWTTiles.renderer.attachAutoDrawable(printGLAD);
           if( DEBUG ) {
               System.err.println("AWT print.setup "+printAWTTiles);
-              System.err.println("AWT print.setup AA "+printNumSamples+", "+caps);
-              System.err.println("AWT print.setup printGLAD: "+printGLAD.getWidth()+"x"+printGLAD.getHeight()+", "+printGLAD);
-              System.err.println("AWT print.setup printDraw: "+printDrawable.getWidth()+"x"+printDrawable.getHeight()+", "+printDrawable);
+              System.err.println("AWT print.setup AA "+printNumSamples+", "+newGLADCaps);
+              System.err.println("AWT print.setup printGLAD: "+printGLAD.getSurfaceWidth()+"x"+printGLAD.getSurfaceHeight()+", "+printGLAD);
+              System.err.println("AWT print.setup printDraw: "+printDrawable.getSurfaceWidth()+"x"+printDrawable.getSurfaceHeight()+", "+printDrawable);
           }
       }
   };
@@ -711,17 +788,19 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
           // trigger reshape, i.e. gl-viewport and -listener - this component might got resized!
           final int awtWidth = GLJPanel.this.getWidth();
           final int awtHeight= GLJPanel.this.getHeight();
+          final int scaledAWTWidth = awtWidth * hasPixelScale[0];
+          final int scaledAWTHeight= awtHeight * hasPixelScale[1];
           final GLDrawable drawable = GLJPanel.this.getDelegatedDrawable();
-          if( awtWidth != panelWidth || awtHeight != panelHeight ||
-              drawable.getWidth() != panelWidth || drawable.getHeight() != panelHeight ) {
+          if( scaledAWTWidth != panelWidth || scaledAWTHeight != panelHeight ||
+              drawable.getSurfaceWidth() != panelWidth || drawable.getSurfaceHeight() != panelHeight ) {
               // -> !( awtSize == panelSize == drawableSize )
               if ( DEBUG ) {
-                  System.err.println(getThreadName()+": GLJPanel.releasePrintOnEDT.0: resizeWithinPrint panel " +panelWidth+"x"+panelHeight +
-                          ", draw "+drawable.getWidth()+"x"+drawable.getHeight()+
-                          " -> " + awtWidth+"x"+awtHeight);
+                  System.err.println(getThreadName()+": GLJPanel.releasePrintOnEDT.0: resizeWithinPrint panel " +panelWidth+"x"+panelHeight + " @ scale "+getPixelScaleStr()+
+                          ", draw "+drawable.getSurfaceWidth()+"x"+drawable.getSurfaceHeight()+
+                          " -> " + awtWidth+"x"+awtHeight+" * "+getPixelScaleStr()+" -> "+scaledAWTWidth+"x"+scaledAWTHeight);
               }
-              reshapeWidth = awtWidth;
-              reshapeHeight = awtHeight;
+              reshapeWidth = scaledAWTWidth;
+              reshapeHeight = scaledAWTHeight;
               sendReshape = handleReshape(); // reshapeSize -> panelSize, backend reshape w/ GL reshape
           } else {
               sendReshape = true; // only GL reshape
@@ -732,7 +811,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   };
 
   @Override
-  public void print(Graphics graphics) {
+  public void print(final Graphics graphics) {
       if( !printActive ) {
           throw new IllegalStateException("setupPrint() not called");
       }
@@ -767,8 +846,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
                   printAWTTiles.resetGraphics2D();
               }
           }
-      } catch (NoninvertibleTransformException nte) {
-          System.err.println("Catched: Inversion failed of: "+g2d.getTransform());
+      } catch (final NoninvertibleTransformException nte) {
+          System.err.println("Caught: Inversion failed of: "+g2d.getTransform());
           nte.printStackTrace();
       }
       if( DEBUG ) {
@@ -776,7 +855,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       }
   }
   @Override
-  protected void printComponent(Graphics g) {
+  protected void printComponent(final Graphics g) {
       if( DEBUG ) {
           System.err.println("AWT printComponent.X: "+printAWTTiles);
       }
@@ -784,7 +863,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public void setOpaque(boolean opaque) {
+  public void setOpaque(final boolean opaque) {
     if (backend != null) {
       backend.setOpaque(opaque);
     }
@@ -792,12 +871,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public void addGLEventListener(GLEventListener listener) {
+  public void addGLEventListener(final GLEventListener listener) {
     helper.addGLEventListener(listener);
   }
 
   @Override
-  public void addGLEventListener(int index, GLEventListener listener) {
+  public void addGLEventListener(final int index, final GLEventListener listener) {
     helper.addGLEventListener(index, listener);
   }
 
@@ -807,7 +886,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException {
+  public GLEventListener getGLEventListener(final int index) throws IndexOutOfBoundsException {
       return helper.getGLEventListener(index);
   }
 
@@ -817,17 +896,17 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public boolean getGLEventListenerInitState(GLEventListener listener) {
+  public boolean getGLEventListenerInitState(final GLEventListener listener) {
       return helper.getGLEventListenerInitState(listener);
   }
 
   @Override
-  public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
+  public void setGLEventListenerInitState(final GLEventListener listener, final boolean initialized) {
       helper.setGLEventListenerInitState(listener, initialized);
   }
 
   @Override
-  public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
+  public GLEventListener disposeGLEventListener(final GLEventListener listener, final boolean remove) {
     final DisposeGLEventListenerAction r = new DisposeGLEventListenerAction(listener, remove);
     if (EventQueue.isDispatchThread()) {
       r.run();
@@ -836,7 +915,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       // so do everything on the event dispatch thread
       try {
         EventQueue.invokeAndWait(r);
-      } catch (Exception e) {
+      } catch (final Exception e) {
         throw new GLException(e);
       }
     }
@@ -844,12 +923,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public GLEventListener removeGLEventListener(GLEventListener listener) {
+  public GLEventListener removeGLEventListener(final GLEventListener listener) {
     return helper.removeGLEventListener(listener);
   }
 
   @Override
-  public void setAnimator(GLAnimatorControl animatorControl) {
+  public void setAnimator(final GLAnimatorControl animatorControl) {
     helper.setAnimator(animatorControl);
   }
 
@@ -859,7 +938,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public final Thread setExclusiveContextThread(Thread t) throws GLException {
+  public final Thread setExclusiveContextThread(final Thread t) throws GLException {
       return helper.setExclusiveContextThread(t, getContext());
   }
 
@@ -869,17 +948,22 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public boolean invoke(boolean wait, GLRunnable glRunnable) {
+  public boolean invoke(final boolean wait, final GLRunnable glRunnable) throws IllegalStateException {
     return helper.invoke(this, wait, glRunnable);
   }
 
   @Override
-  public boolean invoke(final boolean wait, final List<GLRunnable> glRunnables) {
+  public boolean invoke(final boolean wait, final List<GLRunnable> glRunnables) throws IllegalStateException {
     return helper.invoke(this, wait, glRunnables);
   }
 
   @Override
-  public GLContext createContext(GLContext shareWith) {
+  public void flushGLRunnables() {
+      helper.flushGLRunnables();
+  }
+
+  @Override
+  public GLContext createContext(final GLContext shareWith) {
     final Backend b = backend;
     if ( null == b ) {
         return null;
@@ -888,7 +972,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public void setRealized(boolean realized) {
+  public void setRealized(final boolean realized) {
   }
 
   @Override
@@ -897,7 +981,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public GLContext setContext(GLContext newCtx, boolean destroyPrevCtx) {
+  public GLContext setContext(final GLContext newCtx, final boolean destroyPrevCtx) {
     final Backend b = backend;
     if ( null == b ) {
         return null;
@@ -932,13 +1016,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     if (Beans.isDesignTime()) {
       return null;
     }
-    GLContext context = getContext();
+    final GLContext context = getContext();
     return (context == null) ? null : context.getGL();
   }
 
   @Override
-  public GL setGL(GL gl) {
-    GLContext context = getContext();
+  public GL setGL(final GL gl) {
+    final GLContext context = getContext();
     if (context != null) {
       context.setGL(gl);
       return gl;
@@ -947,7 +1031,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public void setAutoSwapBufferMode(boolean enable) {
+  public void setAutoSwapBufferMode(final boolean enable) {
     this.autoSwapBufferMode = enable;
     boolean backendHandlesSwapBuffer = false;
     if( isInitialized ) {
@@ -977,7 +1061,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
-  public void setContextCreationFlags(int flags) {
+  public void setContextCreationFlags(final int flags) {
     additionalCtxCreationFlags = flags;
   }
 
@@ -1002,6 +1086,16 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     return oglPipelineUsable();
   }
 
+  @Override
+  public int getSurfaceWidth() {
+      return panelWidth; // FIXME HiDPI: Accurate or: getWidth() * hasPixelScale[0];
+  }
+
+  @Override
+  public int getSurfaceHeight() {
+      return panelHeight; // FIXME HiDPI: Accurate or: getHeight() * hasPixelScale[1];
+  }
+
   /**
    * {@inheritDoc}
    * <p>
@@ -1021,17 +1115,17 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   /**
-   * Set skipping {@link #isGLOriented()} based vertical flip,
+   * Skip {@link #isGLOriented()} based vertical flip,
    * which usually is required by the offscreen backend,
    * see details about <a href="#verticalFlip">vertical flip</a>
    * and <a href="#fboGLSLVerticalFlip">FBO / GLSL vertical flip</a>.
    * <p>
    * If set to <code>true</code>, user needs to flip the OpenGL rendered scene
-   * <i>if {@link #isGLOriented()} == true</i>, e.g. via the PMV matrix.<br/>
+   * <i>if {@link #isGLOriented()} == true</i>, e.g. via the projection matrix.<br/>
    * See constraints of {@link #isGLOriented()}.
    * </p>
    */
-  public final void setSkipGLOrientationVerticalFlip(boolean v) {
+  public final void setSkipGLOrientationVerticalFlip(final boolean v) {
       skipGLOrientationVerticalFlip = v;
   }
   /** See {@link #setSkipGLOrientationVerticalFlip(boolean)}. */
@@ -1049,6 +1143,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   }
 
   @Override
+  public final GLCapabilitiesImmutable getRequestedGLCapabilities() {
+    return reqOffscreenCaps;
+  }
+
+  @Override
   public final GLProfile getGLProfile() {
     return glProfile;
   }
@@ -1106,7 +1205,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
    * @param v requested texture unit
    * @see #getTextureUnit()
    */
-  public final void setTextureUnit(int v) {
+  public final void setTextureUnit(final int v) {
       requestedTextureUnit = v;
   }
 
@@ -1126,7 +1225,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
               }
 
               if (DEBUG) {
-                  System.err.println(getThreadName()+": GLJPanel.createAndInitializeBackend: " +panelWidth+"x"+panelHeight + " -> " + reshapeWidth+"x"+reshapeHeight);
+                  System.err.println(getThreadName()+": GLJPanel.createAndInitializeBackend: " +
+                          panelWidth+"x"+panelHeight+" @ scale "+getPixelScaleStr() + " -> " +
+                          reshapeWidth+"x"+reshapeHeight+" @ scale "+getPixelScaleStr());
               }
               // Pull down reshapeWidth and reshapeHeight into panelWidth and
               // panelHeight eagerly in order to complete initialization, and
@@ -1154,19 +1255,23 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     }
   }
 
+  private final String getPixelScaleStr() { return hasPixelScale[0]+"x"+hasPixelScale[1]; }
+
   @Override
   public WindowClosingMode getDefaultCloseOperation() {
       return awtWindowClosingProtocol.getDefaultCloseOperation();
   }
 
   @Override
-  public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+  public WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
       return awtWindowClosingProtocol.setDefaultCloseOperation(op);
   }
 
   private boolean handleReshape() {
     if (DEBUG) {
-      System.err.println(getThreadName()+": GLJPanel.handleReshape: " +panelWidth+"x"+panelHeight + " -> " + reshapeWidth+"x"+reshapeHeight);
+      System.err.println(getThreadName()+": GLJPanel.handleReshape: "+
+                         panelWidth+"x"+panelHeight+" @ scale "+getPixelScaleStr() + " -> " +
+                         reshapeWidth+"x"+reshapeHeight+" @ scale "+getPixelScaleStr());
     }
     panelWidth  = reshapeWidth;
     panelHeight = reshapeHeight;
@@ -1179,12 +1284,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   class Updater implements GLEventListener {
     private Graphics g;
 
-    public void setGraphics(Graphics g) {
+    public void setGraphics(final Graphics g) {
       this.g = g;
     }
 
     @Override
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
       if (!backend.preGL(g)) {
         return;
       }
@@ -1193,18 +1298,18 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     }
 
     @Override
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
       helper.disposeAllGLEventListener(GLJPanel.this, false);
     }
 
     @Override
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
       if (!backend.preGL(g)) {
         return;
       }
       if (sendReshape) {
         if (DEBUG) {
-          System.err.println(getThreadName()+": GLJPanel.display: reshape(" + viewportX + "," + viewportY + " " + panelWidth + "x" + panelHeight + ")");
+          System.err.println(getThreadName()+": GLJPanel.display: reshape(" + viewportX + "," + viewportY + " " + panelWidth + "x" + panelHeight + " @ scale "+getPixelScaleStr()+")");
         }
         helper.reshape(GLJPanel.this, viewportX, viewportY, panelWidth, panelHeight);
         sendReshape = false;
@@ -1214,12 +1319,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       backend.postGL(g, true);
     }
 
-    public void plainPaint(GLAutoDrawable drawable) {
+    public void plainPaint(final GLAutoDrawable drawable) {
       helper.display(GLJPanel.this);
     }
 
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
       // This is handled above and dispatched directly to the appropriate context
     }
   }
@@ -1238,20 +1343,33 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
         if ( null != backend ) {
             final GLContext _context = backend.getContext();
             final boolean backendDestroy = !backend.isUsingOwnLifecycle();
+
+            GLException exceptionOnDisposeGL = null;
             if( null != _context && _context.isCreated() ) {
-                // Catch dispose GLExceptions by GLEventListener, just 'print' them
-                // so we can continue with the destruction.
                 try {
                     helper.disposeGL(GLJPanel.this, _context, !backendDestroy);
-                } catch (GLException gle) {
-                    gle.printStackTrace();
+                } catch (final GLException gle) {
+                    exceptionOnDisposeGL = gle;
                 }
             }
+            Throwable exceptionBackendDestroy = null;
             if ( backendDestroy ) {
-                backend.destroy();
+                try {
+                    backend.destroy();
+                } catch( final Throwable re ) {
+                    exceptionBackendDestroy = re;
+                }
                 backend = null;
                 isInitialized = false;
             }
+
+            // throw exception in order of occurrence ..
+            if( null != exceptionOnDisposeGL ) {
+                throw exceptionOnDisposeGL;
+            }
+            if( null != exceptionBackendDestroy ) {
+                throw GLException.newGLException(exceptionBackendDestroy);
+            }
         }
     }
   };
@@ -1287,7 +1405,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
   private class DisposeGLEventListenerAction implements Runnable {
       GLEventListener listener;
       private final boolean remove;
-      private DisposeGLEventListenerAction(GLEventListener listener, boolean remove) {
+      private DisposeGLEventListenerAction(final GLEventListener listener, final boolean remove) {
           this.listener = listener;
           this.remove = remove;
       }
@@ -1301,8 +1419,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       }
   };
 
-  private int getGLInteger(GL gl, int which) {
-    int[] tmp = new int[1];
+  private int getGLInteger(final GL gl, final int which) {
+    final int[] tmp = new int[1];
     gl.glGetIntegerv(which, tmp, 0);
     return tmp[0];
   }
@@ -1409,7 +1527,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     protected IntBuffer readBackIntsForCPUVFlip;
 
     // Implementation using software rendering
-    private volatile GLDrawableImpl offscreenDrawable; // volatile: avoid locking for read-only access
+    private volatile GLDrawable offscreenDrawable; // volatile: avoid locking for read-only access
     private boolean offscreenIsFBO;
     private FBObject fboFlipped;
     private GLSLTextureRaster glslTextureRaster;
@@ -1421,7 +1539,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     // For saving/restoring of OpenGL state during ReadPixels
     private final GLPixelStorageModes psm =  new GLPixelStorageModes();
 
-    OffscreenBackend(GLProfile glp, AWTGLPixelBufferProvider custom) {
+    OffscreenBackend(final GLProfile glp, final AWTGLPixelBufferProvider custom) {
         if(null == custom) {
             pixelBufferProvider = getSingleAWTGLPixelBufferProvider();
         } else {
@@ -1442,25 +1560,38 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       if(DEBUG) {
           System.err.println(getThreadName()+": OffscreenBackend: initialize() - frameCount "+frameCount);
       }
+      GLException glException = null;
       try {
           final GLContext[] shareWith = { null };
           if( helper.isSharedGLContextPending(shareWith) ) {
               return; // pending ..
           }
-          offscreenDrawable = (GLDrawableImpl) factory.createOffscreenDrawable(
+          offscreenDrawable = factory.createOffscreenDrawable(
                                                     null /* default platform device */,
-                                                    offscreenCaps,
+                                                    reqOffscreenCaps,
                                                     chooser,
                                                     panelWidth, panelHeight);
+          updateWrappedSurfaceScale(offscreenDrawable);
           offscreenDrawable.setRealized(true);
-          if( DEBUG ) {
+          if( DEBUG_FRAMES ) {
               offscreenDrawable.getNativeSurface().addSurfaceUpdatedListener(new SurfaceUpdatedListener() {
                   @Override
-                  public final void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+                  public final void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
                       System.err.println(getThreadName()+": OffscreenBackend.swapBuffers - frameCount "+frameCount);
                   } } );
           }
 
+          //
+          // Pre context configuration
+          //
+          flipVertical = !GLJPanel.this.skipGLOrientationVerticalFlip && offscreenDrawable.isGLOriented();
+          offscreenIsFBO = offscreenDrawable.getRequestedGLCapabilities().isFBO();
+          final boolean useGLSLFlip_pre = flipVertical && offscreenIsFBO && reqOffscreenCaps.getGLProfile().isGL2ES2() && USE_GLSL_TEXTURE_RASTERIZER;
+          if( offscreenIsFBO && !useGLSLFlip_pre ) {
+              // Texture attachment only required for GLSL vertical flip, hence simply use a color-renderbuffer attachment.
+              ((GLFBODrawable)offscreenDrawable).setFBOMode(GLFBODrawable.FBOMODE_USE_DEPTH);
+          }
+
           offscreenContext = (GLContextImpl) offscreenDrawable.createContext(shareWith[0]);
           offscreenContext.setContextCreationFlags(additionalCtxCreationFlags);
           if( GLContext.CONTEXT_NOT_CURRENT < offscreenContext.makeCurrent() ) {
@@ -1468,29 +1599,27 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
               helper.setAutoSwapBufferMode(false); // we handle swap-buffers, see handlesSwapBuffer()
 
               final GL gl = offscreenContext.getGL();
-              flipVertical = !GLJPanel.this.skipGLOrientationVerticalFlip && offscreenDrawable.isGLOriented();
               final GLCapabilitiesImmutable chosenCaps = offscreenDrawable.getChosenGLCapabilities();
-              offscreenIsFBO = chosenCaps.isFBO();
               final boolean glslCompliant = !offscreenContext.hasRendererQuirk(GLRendererQuirks.GLSLNonCompliant);
-              final boolean useGLSLFlip = flipVertical && offscreenIsFBO && gl.isGL2ES2() && USE_GLSL_TEXTURE_RASTERIZER && glslCompliant;
+              final boolean useGLSLFlip = useGLSLFlip_pre && gl.isGL2ES2() && glslCompliant;
               if( DEBUG ) {
                   System.err.println(getThreadName()+": OffscreenBackend.initialize: useGLSLFlip "+useGLSLFlip+
                           " [flip "+flipVertical+", isFBO "+offscreenIsFBO+", isGL2ES2 "+gl.isGL2ES2()+
                           ", noglsl "+!USE_GLSL_TEXTURE_RASTERIZER+", glslNonCompliant "+!glslCompliant+
-                          ", isGL2ES2 " + gl.isGL2ES2()+"]");
+                          ", isGL2ES2 " + gl.isGL2ES2()+"\n "+offscreenDrawable+"]");
               }
               if( useGLSLFlip ) {
                   final GLFBODrawable fboDrawable = (GLFBODrawable) offscreenDrawable;
                   fboDrawable.setTextureUnit( GLJPanel.this.requestedTextureUnit );
                   try {
                       fboFlipped = new FBObject();
-                      fboFlipped.reset(gl, fboDrawable.getWidth(), fboDrawable.getHeight(), 0, false);
-                      fboFlipped.attachTexture2D(gl, 0, chosenCaps.getAlphaBits()>0);
+                      fboFlipped.reset(gl, fboDrawable.getSurfaceWidth(), fboDrawable.getSurfaceHeight(), 0, false);
+                      fboFlipped.attachColorbuffer(gl, 0, chosenCaps.getAlphaBits()>0);
                       // fboFlipped.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
                       glslTextureRaster = new GLSLTextureRaster(fboDrawable.getTextureUnit(), true);
                       glslTextureRaster.init(gl.getGL2ES2());
-                      glslTextureRaster.reshape(gl.getGL2ES2(), 0, 0, fboDrawable.getWidth(), fboDrawable.getHeight());
-                  } catch (Exception ex) {
+                      glslTextureRaster.reshape(gl.getGL2ES2(), 0, 0, fboDrawable.getSurfaceWidth(), fboDrawable.getSurfaceHeight());
+                  } catch (final Exception ex) {
                       ex.printStackTrace();
                       if(null != glslTextureRaster) {
                         glslTextureRaster.dispose(gl.getGL2ES2());
@@ -1509,6 +1638,8 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
           } else {
               isInitialized = false;
           }
+      } catch( final GLException gle ) {
+          glException = gle;
       } finally {
           if( !isInitialized ) {
               if(null != offscreenContext) {
@@ -1520,6 +1651,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
                   offscreenDrawable = null;
               }
           }
+          if( null != glException ) {
+              throw new GLException("Caught GLException: "+glException.getMessage(), glException);
+          }
       }
     }
 
@@ -1572,7 +1706,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     }
 
     @Override
-    public final void setOpaque(boolean opaque) {
+    public final void setOpaque(final boolean opaque) {
       if ( opaque != isOpaque() && !useSingletonBuffer ) {
           pixelBuffer.dispose();
           pixelBuffer = null;
@@ -1581,7 +1715,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     }
 
     @Override
-    public final boolean preGL(Graphics g) {
+    public final boolean preGL(final Graphics g) {
       // Empty in this implementation
       return true;
     }
@@ -1600,17 +1734,45 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     }
 
     @Override
-    public final void postGL(Graphics g, boolean isDisplay) {
+    public final void postGL(final Graphics g, final boolean isDisplay) {
       if (isDisplay) {
-        if(DEBUG) {
+        if( DEBUG_FRAMES ) {
             System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL.0: - frameCount "+frameCount);
         }
+
+        final GL gl = offscreenContext.getGL();
+
+        //
+        // Save TextureState ASAP, i.e. the user values for the used FBO texture-unit
+        // and the current active texture-unit (if not same)
+        //
+        final TextureState usrTexState, fboTexState;
+        final int fboTexUnit;
+
+        if( offscreenIsFBO ) {
+            fboTexUnit = GL.GL_TEXTURE0 + ((GLFBODrawable)offscreenDrawable).getTextureUnit();
+            usrTexState = new TextureState(gl, GL.GL_TEXTURE_2D);
+            if( fboTexUnit != usrTexState.getUnit() ) {
+                // glActiveTexture(..) + glBindTexture(..) are implicit performed in GLFBODrawableImpl's
+                // swapBuffers/contextMadeCurent -> swapFBOImpl.
+                // We need to cache the texture unit's bound texture-id before it's overwritten.
+                gl.glActiveTexture(fboTexUnit);
+                fboTexState = new TextureState(gl, fboTexUnit, GL.GL_TEXTURE_2D);
+            } else {
+                fboTexState = usrTexState;
+            }
+        } else {
+            fboTexUnit = 0;
+            usrTexState = null;
+            fboTexState = null;
+        }
+
+
         if( autoSwapBufferMode ) {
             // Since we only use a single-buffer non-MSAA or double-buffered MSAA offscreenDrawable,
             // we can always swap!
             offscreenDrawable.swapBuffers();
         }
-        final GL gl = offscreenContext.getGL();
 
         final int componentCount;
         final int alignment;
@@ -1643,18 +1805,18 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
               System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL.0: "+GLJPanel.this.getName()+" pixelBufferProvider isSingletonBufferProvider "+useSingletonBuffer+", 0x"+Integer.toHexString(pixelBufferProvider.hashCode())+", "+pixelBufferProvider.getClass().getSimpleName());
               System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL.0: "+GLJPanel.this.getName()+" pixelBuffer 0x"+Integer.toHexString(pixelBuffer.hashCode())+", "+pixelBuffer+", alignment "+alignment);
               System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL.0: "+GLJPanel.this.getName()+" flippedVertical "+flipVertical+", glslTextureRaster "+(null!=glslTextureRaster));
-              System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL.0: "+GLJPanel.this.getName()+" panelSize "+panelWidth+"x"+panelHeight);
+              System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL.0: "+GLJPanel.this.getName()+" panelSize "+panelWidth+"x"+panelHeight+" @ scale "+getPixelScaleStr());
           }
         }
-        if( offscreenDrawable.getWidth() != panelWidth || offscreenDrawable.getHeight() != panelHeight ) {
-            throw new InternalError("OffscreenDrawable panelSize mismatch (reshape missed): panelSize "+panelWidth+"x"+panelHeight+" != drawable "+offscreenDrawable.getWidth()+"x"+offscreenDrawable.getHeight()+", on thread "+getThreadName());
+        if( offscreenDrawable.getSurfaceWidth() != panelWidth || offscreenDrawable.getSurfaceHeight() != panelHeight ) {
+            throw new InternalError("OffscreenDrawable panelSize mismatch (reshape missed): panelSize "+panelWidth+"x"+panelHeight+" != drawable "+offscreenDrawable.getSurfaceWidth()+"x"+offscreenDrawable.getSurfaceHeight()+", on thread "+getThreadName());
         }
         if( null == alignedImage ||
             panelWidth != alignedImage.getWidth() || panelHeight != alignedImage.getHeight() ||
             !pixelBuffer.isDataBufferSource(alignedImage) ) {
             alignedImage = pixelBuffer.getAlignedImage(panelWidth, panelHeight);
             if(DEBUG) {
-                System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL.0: "+GLJPanel.this.getName()+" new alignedImage "+alignedImage.getWidth()+"x"+alignedImage.getHeight()+", "+alignedImage+", pixelBuffer "+pixelBuffer.width+"x"+pixelBuffer.height+", "+pixelBuffer);
+                System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL.0: "+GLJPanel.this.getName()+" new alignedImage "+alignedImage.getWidth()+"x"+alignedImage.getHeight()+" @ scale "+getPixelScaleStr()+", "+alignedImage+", pixelBuffer "+pixelBuffer.width+"x"+pixelBuffer.height+", "+pixelBuffer);
             }
         }
         final IntBuffer readBackInts;
@@ -1668,32 +1830,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
            readBackInts = readBackIntsForCPUVFlip;
         }
 
-        final TextureState usrTexState, fboTexState;
-        final int fboTexUnit = GL.GL_TEXTURE0 + ( offscreenIsFBO ? ((GLFBODrawable)offscreenDrawable).getTextureUnit() : 0 );
-
-        if( offscreenIsFBO ) {
-            usrTexState = new TextureState(gl, GL.GL_TEXTURE_2D);
-            if( fboTexUnit != usrTexState.getUnit() ) {
-                // glActiveTexture(..) + glBindTexture(..) are implicit performed in GLFBODrawableImpl's
-                // swapBuffers/contextMadeCurent -> swapFBOImpl.
-                // We need to cache the texture unit's bound texture-id before it's overwritten.
-                gl.glActiveTexture(fboTexUnit);
-                fboTexState = new TextureState(gl, fboTexUnit, GL.GL_TEXTURE_2D);
-            } else {
-                fboTexState = usrTexState;
-            }
-        } else {
-            usrTexState = null;
-            fboTexState = null;
-        }
-
         // Must now copy pixels from offscreen context into surface
-        if(DEBUG) {
+        if( DEBUG_FRAMES ) {
             System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL.readPixels: - frameCount "+frameCount);
         }
 
-        // Save current modes
-        psm.setAlignment(gl, alignment, alignment);
+        // Save PACK modes, reset them to defaults and set alignment
+        psm.setPackAlignment(gl, alignment);
         if(gl.isGL2ES3()) {
             final GL2ES3 gl2es3 = gl.getGL2ES3();
             gl2es3.glPixelStorei(GL2ES3.GL_PACK_ROW_LENGTH, panelWidth);
@@ -1705,19 +1848,19 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
             final int[] usrViewport = new int[] { 0, 0, 0, 0 };
             gl.glGetIntegerv(GL.GL_VIEWPORT, usrViewport, 0);
             viewportChange = 0 != usrViewport[0] || 0 != usrViewport[1] ||
-                             offscreenDrawable.getWidth() != usrViewport[2] || offscreenDrawable.getHeight() != usrViewport[3];
+                             offscreenDrawable.getSurfaceWidth() != usrViewport[2] || offscreenDrawable.getSurfaceHeight() != usrViewport[3];
             if( DEBUG_VIEWPORT ) {
                 System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.postGL: "+GLJPanel.this.getName()+" Viewport: change "+viewportChange+
                          ", "+usrViewport[0]+"/"+usrViewport[1]+" "+usrViewport[2]+"x"+usrViewport[3]+
-                         " -> 0/0 "+offscreenDrawable.getWidth()+"x"+offscreenDrawable.getHeight());
+                         " -> 0/0 "+offscreenDrawable.getSurfaceWidth()+"x"+offscreenDrawable.getSurfaceHeight());
             }
             if( viewportChange ) {
-                gl.glViewport(0, 0, offscreenDrawable.getWidth(), offscreenDrawable.getHeight());
+                gl.glViewport(0, 0, offscreenDrawable.getSurfaceWidth(), offscreenDrawable.getSurfaceHeight());
             }
 
             // perform vert-flipping via OpenGL/FBO
             final GLFBODrawable fboDrawable = (GLFBODrawable)offscreenDrawable;
-            final FBObject.TextureAttachment fboTex = fboDrawable.getTextureBuffer(GL.GL_FRONT);
+            final FBObject.TextureAttachment fboTex = fboDrawable.getColorbuffer(GL.GL_FRONT).getTextureAttachment();
 
             fboFlipped.bind(gl);
 
@@ -1732,7 +1875,6 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
             if( viewportChange ) {
                 gl.glViewport(usrViewport[0], usrViewport[1], usrViewport[2], usrViewport[3]);
             }
-            fboTexState.restore(gl);
         } else {
             gl.glReadPixels(0, 0, panelWidth, panelHeight, pixelAttribs.format, pixelAttribs.type, readBackInts);
 
@@ -1752,8 +1894,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
                 }
             }
         }
-        if( offscreenIsFBO && fboTexUnit != usrTexState.getUnit() ) {
-            usrTexState.restore(gl);
+        if( 0 != fboTexUnit ) { // implies offscreenIsFBO
+            fboTexState.restore(gl);
+            if( fboTexUnit != usrTexState.getUnit() ) {
+                usrTexState.restore(gl);
+            }
         }
 
         // Restore saved modes.
@@ -1773,15 +1918,15 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     }
 
     @Override
-    public final void doPaintComponent(Graphics g) {
+    public final void doPaintComponent(final Graphics g) {
       helper.invokeGL(offscreenDrawable, offscreenContext, updaterDisplayAction, updaterInitAction);
 
       if ( null != alignedImage ) {
-        if( DEBUG ) {
+        if( DEBUG_FRAMES ) {
             System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.doPaintComponent.drawImage: - frameCount "+frameCount);
         }
         // Draw resulting image in one shot
-        g.drawImage(alignedImage, 0, 0, alignedImage.getWidth(), alignedImage.getHeight(), null); // Null ImageObserver since image data is ready.
+        g.drawImage(alignedImage, 0, 0, alignedImage.getWidth()/hasPixelScale[0], alignedImage.getHeight()/hasPixelScale[1], null); // Null ImageObserver since image data is ready.
       }
       frameCount++;
     }
@@ -1793,27 +1938,28 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
 
     @Override
     public final boolean handleReshape() {
-        GLDrawableImpl _drawable = offscreenDrawable;
+        GLDrawableImpl _drawable = (GLDrawableImpl)offscreenDrawable;
         {
             final GLDrawableImpl _drawableNew = GLDrawableHelper.resizeOffscreenDrawable(_drawable, offscreenContext, panelWidth, panelHeight);
             if(_drawable != _drawableNew) {
                 // write back
                 _drawable = _drawableNew;
                 offscreenDrawable = _drawableNew;
+                updateWrappedSurfaceScale(offscreenDrawable);
             }
         }
         if (DEBUG) {
-            System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.handleReshape: " +panelWidth+"x"+panelHeight + " -> " + _drawable.getWidth()+"x"+_drawable.getHeight());
+            System.err.println(getThreadName()+": GLJPanel.OffscreenBackend.handleReshape: " +panelWidth+"x"+panelHeight + " @ scale "+getPixelScaleStr() + " -> " + _drawable.getSurfaceWidth()+"x"+_drawable.getSurfaceHeight());
         }
-        panelWidth = _drawable.getWidth();
-        panelHeight = _drawable.getHeight();
+        panelWidth = _drawable.getSurfaceWidth();
+        panelHeight = _drawable.getSurfaceHeight();
 
         if( null != glslTextureRaster ) {
             if( GLContext.CONTEXT_NOT_CURRENT < offscreenContext.makeCurrent() ) {
                 try {
                     final GL gl = offscreenContext.getGL();
-                    fboFlipped.reset(gl, _drawable.getWidth(), _drawable.getHeight(), 0, false);
-                    glslTextureRaster.reshape(gl.getGL2ES2(), 0, 0, _drawable.getWidth(), _drawable.getHeight());
+                    fboFlipped.reset(gl, _drawable.getSurfaceWidth(), _drawable.getSurfaceHeight(), 0, false);
+                    glslTextureRaster.reshape(gl.getGL2ES2(), 0, 0, _drawable.getSurfaceWidth(), _drawable.getSurfaceHeight());
                 } finally {
                     offscreenContext.release();
                 }
@@ -1823,12 +1969,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     }
 
     @Override
-    public final GLContext createContext(GLContext shareWith) {
+    public final GLContext createContext(final GLContext shareWith) {
       return (null != offscreenDrawable) ? offscreenDrawable.createContext(shareWith) : null;
     }
 
     @Override
-    public final void setContext(GLContext ctx) {
+    public final void setContext(final GLContext ctx) {
       offscreenContext=(GLContextImpl)ctx;
     }
 
@@ -1942,12 +2088,12 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     }
 
     @Override
-    public final void setOpaque(boolean opaque) {
+    public final void setOpaque(final boolean opaque) {
       // Empty in this implementation
     }
 
     @Override
-    public final GLContext createContext(GLContext shareWith) {
+    public final GLContext createContext(final GLContext shareWith) {
       if(null != shareWith) {
           throw new GLException("J2DOGLBackend cannot create context w/ additional shared context, since it already needs to share the context w/ J2D.");
       }
@@ -1955,7 +2101,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     }
 
     @Override
-    public final void setContext(GLContext ctx) {
+    public final void setContext(final GLContext ctx) {
         joglContext=ctx;
     }
 
@@ -1991,11 +2137,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     }
 
     @Override
-    public final boolean preGL(Graphics g) {
+    public final boolean preGL(final Graphics g) {
       final GL2 gl = joglContext.getGL().getGL2();
       // Set up needed state in JOGL context from Java2D context
-      gl.glEnable(GL2.GL_SCISSOR_TEST);
-      Rectangle r = Java2D.getOGLScissorBox(g);
+      gl.glEnable(GL.GL_SCISSOR_TEST);
+      final Rectangle r = Java2D.getOGLScissorBox(g);
 
       if (r == null) {
         if (DEBUG) {
@@ -2008,7 +2154,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       }
 
       gl.glScissor(r.x, r.y, r.width, r.height);
-      Rectangle oglViewport = Java2D.getOGLViewport(g, panelWidth, panelHeight);
+      final Rectangle oglViewport = Java2D.getOGLViewport(g, panelWidth, panelHeight);
       // If the viewport X or Y changes, in addition to the panel's
       // width or height, we need to send a reshape operation to the
       // client
@@ -2033,13 +2179,13 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
 
         // The texture target for Java2D's OpenGL pipeline when using FBOs
         // -- either GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB
-        int fboTextureTarget = Java2D.getOGLTextureType(g);
+        final int fboTextureTarget = Java2D.getOGLTextureType(g);
 
         if (!checkedForFBObjectWorkarounds) {
           checkedForFBObjectWorkarounds = true;
           gl.glBindTexture(fboTextureTarget, 0);
-          gl.glBindFramebuffer(GL2.GL_FRAMEBUFFER, frameBuffer[0]);
-          int status = gl.glCheckFramebufferStatus(GL.GL_FRAMEBUFFER);
+          gl.glBindFramebuffer(GL.GL_FRAMEBUFFER, frameBuffer[0]);
+          final int status = gl.glCheckFramebufferStatus(GL.GL_FRAMEBUFFER);
           if (status != GL.GL_FRAMEBUFFER_COMPLETE) {
               // Need to do workarounds
               fbObjectWorkarounds = true;
@@ -2069,10 +2215,10 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
           }
 
           gl.glBindTexture(fboTextureTarget, frameBufferTexture[0]);
-          int[] width = new int[1];
-          int[] height = new int[1];
-          gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL2.GL_TEXTURE_WIDTH, width, 0);
-          gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL2.GL_TEXTURE_HEIGHT, height, 0);
+          final int[] width = new int[1];
+          final int[] height = new int[1];
+          gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL2GL3.GL_TEXTURE_WIDTH, width, 0);
+          gl.glGetTexLevelParameteriv(fboTextureTarget, 0, GL2GL3.GL_TEXTURE_HEIGHT, height, 0);
 
           gl.glGenRenderbuffers(1, frameBufferDepthBuffer, 0);
           if (DEBUG) {
@@ -2082,9 +2228,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
 
           gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, frameBufferDepthBuffer[0]);
           // FIXME: may need a loop here like in Java2D
-          gl.glRenderbufferStorage(GL.GL_RENDERBUFFER, GL2GL3.GL_DEPTH_COMPONENT24, width[0], height[0]);
+          gl.glRenderbufferStorage(GL.GL_RENDERBUFFER, GL.GL_DEPTH_COMPONENT24, width[0], height[0]);
 
-          gl.glBindRenderbuffer(GL2.GL_RENDERBUFFER, 0);
+          gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, 0);
           createNewDepthBuffer = false;
         }
 
@@ -2108,7 +2254,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
         }
 
         if (DEBUG) {
-          int status = gl.glCheckFramebufferStatus(GL.GL_FRAMEBUFFER);
+          final int status = gl.glCheckFramebufferStatus(GL.GL_FRAMEBUFFER);
           if (status != GL.GL_FRAMEBUFFER_COMPLETE) {
             throw new GLException("Error: framebuffer was incomplete: status = 0x" +
                                   Integer.toHexString(status));
@@ -2141,11 +2287,11 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
     }
 
     @Override
-    public final void postGL(Graphics g, boolean isDisplay) {
+    public final void postGL(final Graphics g, final boolean isDisplay) {
       // Cause OpenGL pipeline to flush its results because
       // otherwise it's possible we will buffer up multiple frames'
       // rendering results, resulting in apparent mouse lag
-      GL gl = joglContext.getGL();
+      final GL gl = joglContext.getGL();
       gl.glFinish();
 
       if (Java2D.isFBOEnabled() &&
@@ -2209,30 +2355,30 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
               // FIXME: add more checks?
 
               j2dContext.makeCurrent();
-              GL gl = j2dContext.getGL();
-              if ((getGLInteger(gl, GL.GL_RED_BITS)         < offscreenCaps.getRedBits())        ||
-                  (getGLInteger(gl, GL.GL_GREEN_BITS)       < offscreenCaps.getGreenBits())      ||
-                  (getGLInteger(gl, GL.GL_BLUE_BITS)        < offscreenCaps.getBlueBits())       ||
+              final GL gl = j2dContext.getGL();
+              if ((getGLInteger(gl, GL.GL_RED_BITS)         < reqOffscreenCaps.getRedBits())        ||
+                  (getGLInteger(gl, GL.GL_GREEN_BITS)       < reqOffscreenCaps.getGreenBits())      ||
+                  (getGLInteger(gl, GL.GL_BLUE_BITS)        < reqOffscreenCaps.getBlueBits())       ||
                   //                  (getGLInteger(gl, GL.GL_ALPHA_BITS)       < offscreenCaps.getAlphaBits())      ||
-                  (getGLInteger(gl, GL2.GL_ACCUM_RED_BITS)   < offscreenCaps.getAccumRedBits())   ||
-                  (getGLInteger(gl, GL2.GL_ACCUM_GREEN_BITS) < offscreenCaps.getAccumGreenBits()) ||
-                  (getGLInteger(gl, GL2.GL_ACCUM_BLUE_BITS)  < offscreenCaps.getAccumBlueBits())  ||
-                  (getGLInteger(gl, GL2.GL_ACCUM_ALPHA_BITS) < offscreenCaps.getAccumAlphaBits()) ||
+                  (getGLInteger(gl, GL2.GL_ACCUM_RED_BITS)   < reqOffscreenCaps.getAccumRedBits())   ||
+                  (getGLInteger(gl, GL2.GL_ACCUM_GREEN_BITS) < reqOffscreenCaps.getAccumGreenBits()) ||
+                  (getGLInteger(gl, GL2.GL_ACCUM_BLUE_BITS)  < reqOffscreenCaps.getAccumBlueBits())  ||
+                  (getGLInteger(gl, GL2.GL_ACCUM_ALPHA_BITS) < reqOffscreenCaps.getAccumAlphaBits()) ||
                   //          (getGLInteger(gl, GL2.GL_DEPTH_BITS)       < offscreenCaps.getDepthBits())      ||
-                  (getGLInteger(gl, GL.GL_STENCIL_BITS)     < offscreenCaps.getStencilBits())) {
+                  (getGLInteger(gl, GL.GL_STENCIL_BITS)     < reqOffscreenCaps.getStencilBits())) {
                 if (DEBUG) {
                   System.err.println(getThreadName()+": GLJPanel: Falling back to pbuffer-based support because Java2D context insufficient");
                   System.err.println("                    Available              Required");
-                  System.err.println("GL_RED_BITS         " + getGLInteger(gl, GL.GL_RED_BITS)         + "              " + offscreenCaps.getRedBits());
-                  System.err.println("GL_GREEN_BITS       " + getGLInteger(gl, GL.GL_GREEN_BITS)       + "              " + offscreenCaps.getGreenBits());
-                  System.err.println("GL_BLUE_BITS        " + getGLInteger(gl, GL.GL_BLUE_BITS)        + "              " + offscreenCaps.getBlueBits());
-                  System.err.println("GL_ALPHA_BITS       " + getGLInteger(gl, GL.GL_ALPHA_BITS)       + "              " + offscreenCaps.getAlphaBits());
-                  System.err.println("GL_ACCUM_RED_BITS   " + getGLInteger(gl, GL2.GL_ACCUM_RED_BITS)   + "              " + offscreenCaps.getAccumRedBits());
-                  System.err.println("GL_ACCUM_GREEN_BITS " + getGLInteger(gl, GL2.GL_ACCUM_GREEN_BITS) + "              " + offscreenCaps.getAccumGreenBits());
-                  System.err.println("GL_ACCUM_BLUE_BITS  " + getGLInteger(gl, GL2.GL_ACCUM_BLUE_BITS)  + "              " + offscreenCaps.getAccumBlueBits());
-                  System.err.println("GL_ACCUM_ALPHA_BITS " + getGLInteger(gl, GL2.GL_ACCUM_ALPHA_BITS) + "              " + offscreenCaps.getAccumAlphaBits());
-                  System.err.println("GL_DEPTH_BITS       " + getGLInteger(gl, GL.GL_DEPTH_BITS)       + "              " + offscreenCaps.getDepthBits());
-                  System.err.println("GL_STENCIL_BITS     " + getGLInteger(gl, GL.GL_STENCIL_BITS)     + "              " + offscreenCaps.getStencilBits());
+                  System.err.println("GL_RED_BITS         " + getGLInteger(gl, GL.GL_RED_BITS)         + "              " + reqOffscreenCaps.getRedBits());
+                  System.err.println("GL_GREEN_BITS       " + getGLInteger(gl, GL.GL_GREEN_BITS)       + "              " + reqOffscreenCaps.getGreenBits());
+                  System.err.println("GL_BLUE_BITS        " + getGLInteger(gl, GL.GL_BLUE_BITS)        + "              " + reqOffscreenCaps.getBlueBits());
+                  System.err.println("GL_ALPHA_BITS       " + getGLInteger(gl, GL.GL_ALPHA_BITS)       + "              " + reqOffscreenCaps.getAlphaBits());
+                  System.err.println("GL_ACCUM_RED_BITS   " + getGLInteger(gl, GL2.GL_ACCUM_RED_BITS)   + "              " + reqOffscreenCaps.getAccumRedBits());
+                  System.err.println("GL_ACCUM_GREEN_BITS " + getGLInteger(gl, GL2.GL_ACCUM_GREEN_BITS) + "              " + reqOffscreenCaps.getAccumGreenBits());
+                  System.err.println("GL_ACCUM_BLUE_BITS  " + getGLInteger(gl, GL2.GL_ACCUM_BLUE_BITS)  + "              " + reqOffscreenCaps.getAccumBlueBits());
+                  System.err.println("GL_ACCUM_ALPHA_BITS " + getGLInteger(gl, GL2.GL_ACCUM_ALPHA_BITS) + "              " + reqOffscreenCaps.getAccumAlphaBits());
+                  System.err.println("GL_DEPTH_BITS       " + getGLInteger(gl, GL.GL_DEPTH_BITS)       + "              " + reqOffscreenCaps.getDepthBits());
+                  System.err.println("GL_STENCIL_BITS     " + getGLInteger(gl, GL.GL_STENCIL_BITS)     + "              " + reqOffscreenCaps.getStencilBits());
                 }
                 isInitialized = false;
                 backend = null;
@@ -2247,7 +2393,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
             }
             try {
               captureJ2DState(j2dContext.getGL(), g);
-              Object curSurface = Java2D.getOGLSurfaceIdentifier(g);
+              final Object curSurface = Java2D.getOGLSurfaceIdentifier(g);
               if (curSurface != null) {
                 if (j2dSurface != curSurface) {
                   if (joglContext != null) {
@@ -2263,7 +2409,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
                   j2dSurface = curSurface;
                   if (DEBUG) {
                       System.err.print(getThreadName()+": Surface type: ");
-                      int surfaceType = Java2D.getOGLSurfaceType(g);
+                      final int surfaceType = Java2D.getOGLSurfaceType(g);
                       if (surfaceType == Java2D.UNDEFINED) {
                         System.err.println("UNDEFINED");
                       } else if (surfaceType == Java2D.WINDOW) {
@@ -2282,7 +2428,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
                   }
                 }
                 if (joglContext == null) {
-                  AbstractGraphicsDevice device = j2dContext.getGLDrawable().getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
+                  final AbstractGraphicsDevice device = j2dContext.getGLDrawable().getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
                   if (factory.canCreateExternalGLDrawable(device)) {
                     joglDrawable = factory.createExternalGLDrawable();
                     joglContext = joglDrawable.createContext(j2dContext);
@@ -2311,9 +2457,9 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
       helper.invokeGL(joglDrawable, joglContext, updaterPlainDisplayAction, updaterInitAction);
     }
 
-    private final void captureJ2DState(GL gl, Graphics g) {
-      gl.glGetIntegerv(GL2.GL_DRAW_BUFFER, drawBuffer, 0);
-      gl.glGetIntegerv(GL2.GL_READ_BUFFER, readBuffer, 0);
+    private final void captureJ2DState(final GL gl, final Graphics g) {
+      gl.glGetIntegerv(GL2GL3.GL_DRAW_BUFFER, drawBuffer, 0);
+      gl.glGetIntegerv(GL2ES3.GL_READ_BUFFER, readBuffer, 0);
       if (Java2D.isFBOEnabled() &&
           Java2D.getOGLSurfaceType(g) == Java2D.FBOBJECT) {
         gl.glGetIntegerv(GL.GL_FRAMEBUFFER_BINDING, frameBuffer, 0);
@@ -2347,7 +2493,7 @@ public class GLJPanel extends JPanel implements AWTGLAutoDrawable, WindowClosing
 
         if (!checkedGLVendor) {
           checkedGLVendor = true;
-          String vendor = gl.glGetString(GL.GL_VENDOR);
+          final String vendor = gl.glGetString(GL.GL_VENDOR);
 
           if ((vendor != null) &&
               vendor.startsWith("ATI")) {
diff --git a/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
index b4d7883..87a23d1 100644
--- a/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
+++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
@@ -113,13 +113,13 @@ public interface GLMatrixFunc {
     public void glLoadMatrixf(float[] m, int m_offset);
 
     /**
-     * Multiply the current matrix
+     * Multiply the current matrix: [c] = [c] x [m]
      * @param m the FloatBuffer's position remains unchanged,
      *        which is the same behavior than the native JOGL GL impl
      */
     public void glMultMatrixf(java.nio.FloatBuffer m) ;
     /**
-     * Multiply the current matrix
+     * Multiply the current matrix: [c] = [c] x [m]
      */
     public void glMultMatrixf(float[] m, int m_offset);
 
diff --git a/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java
index 9bd6442..3264062 100644
--- a/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java
+++ b/src/jogl/classes/javax/media/opengl/fixedfunc/GLPointerFuncUtil.java
@@ -39,7 +39,7 @@ public class GLPointerFuncUtil {
      * @param glArrayIndex the fixed function array index
      * @return default fixed function array name
      */
-    public static String getPredefinedArrayIndexName(int glArrayIndex) {
+    public static String getPredefinedArrayIndexName(final int glArrayIndex) {
         return getPredefinedArrayIndexName(glArrayIndex, -1);
     }
 
@@ -48,7 +48,7 @@ public class GLPointerFuncUtil {
      * @param multiTexCoordIndex index for multiTexCoordIndex
      * @return default fixed function array name
      */
-    public static String getPredefinedArrayIndexName(int glArrayIndex, int multiTexCoordIndex) {
+    public static String getPredefinedArrayIndexName(final int glArrayIndex, final int multiTexCoordIndex) {
         switch(glArrayIndex) {
             case GLPointerFunc.GL_VERTEX_ARRAY:
                 return mgl_Vertex;
diff --git a/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java
index 15a7bb2..c293fbe 100644
--- a/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java
+++ b/src/jogl/classes/javax/media/opengl/glu/GLUtessellatorCallbackAdapter.java
@@ -65,32 +65,32 @@ package javax.media.opengl.glu;
 
 public class GLUtessellatorCallbackAdapter implements GLUtessellatorCallback {
     @Override
-    public void begin(int type) {}
+    public void begin(final int type) {}
     @Override
-    public void edgeFlag(boolean boundaryEdge) {}
+    public void edgeFlag(final boolean boundaryEdge) {}
     @Override
-    public void vertex(Object vertexData) {}
+    public void vertex(final Object vertexData) {}
     @Override
     public void end() {}
 //  public void mesh(jogamp.opengl.tessellator.GLUmesh mesh) {}
     @Override
-    public void error(int errnum) {}
+    public void error(final int errnum) {}
     @Override
-    public void combine(double[] coords, Object[] data,
-                            float[] weight, Object[] outData) {}
+    public void combine(final double[] coords, final Object[] data,
+                            final float[] weight, final Object[] outData) {}
     @Override
-    public void beginData(int type, Object polygonData) {}
+    public void beginData(final int type, final Object polygonData) {}
     @Override
-    public void edgeFlagData(boolean boundaryEdge,
-                                 Object polygonData) {}
+    public void edgeFlagData(final boolean boundaryEdge,
+                                 final Object polygonData) {}
     @Override
-    public void vertexData(Object vertexData, Object polygonData) {}
+    public void vertexData(final Object vertexData, final Object polygonData) {}
     @Override
-    public void endData(Object polygonData) {}
+    public void endData(final Object polygonData) {}
     @Override
-    public void errorData(int errnum, Object polygonData) {}
+    public void errorData(final int errnum, final Object polygonData) {}
     @Override
-    public void combineData(double[] coords, Object[] data,
-                                float[] weight, Object[] outData,
-                                Object polygonData) {}
+    public void combineData(final double[] coords, final Object[] data,
+                                final float[] weight, final Object[] outData,
+                                final Object polygonData) {}
 }
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RegionFactory.java b/src/jogl/classes/jogamp/graph/curve/opengl/RegionFactory.java
deleted file mode 100644
index 515583b..0000000
--- a/src/jogl/classes/jogamp/graph/curve/opengl/RegionFactory.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package jogamp.graph.curve.opengl;
-
-import com.jogamp.graph.curve.Region;
-import com.jogamp.graph.curve.opengl.GLRegion;
-
-/** RegionFactory to create a Context specific Region implementation.
- *
- * @see GLRegion
- */
-public class RegionFactory {
-
-    /**
-     * Create a Region using the passed render mode
-     *
-     * <p> In case {@link Region#VBAA_RENDERING_BIT} is being requested the default texture unit
-     * {@link Region#TWO_PASS_DEFAULT_TEXTURE_UNIT} is being used.</p>
-     *
-     * @param rs the RenderState to be used
-     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, {@link Region#VBAA_RENDERING_BIT}
-     */
-    public static GLRegion create(int renderModes) {
-        if( 0 != ( Region.VBAA_RENDERING_BIT & renderModes ) ){
-            return new VBORegion2PES2(renderModes, Region.TWO_PASS_DEFAULT_TEXTURE_UNIT);
-        }
-        else{
-            return new VBORegionSPES2(renderModes);
-        }
-    }
-
-    /** Create a Single Pass Region using the passed render mode
-     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT},
-     * {@link Region#VBAA_RENDERING_BIT}
-     * @return
-     */
-    public static GLRegion createSinglePass(int renderModes) {
-        return new VBORegionSPES2(renderModes);
-    }
-
-    /** Create a Two Pass (VBAA) Region using the passed render mode
-     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT},
-     * {@link Region#VBAA_RENDERING_BIT}
-     * @return
-     */
-    public static GLRegion createTwoPass(int renderModes, int textureUnit) {
-        return new VBORegion2PES2(renderModes, textureUnit);
-    }
-}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java b/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
deleted file mode 100644
index 31ad974..0000000
--- a/src/jogl/classes/jogamp/graph/curve/opengl/RegionRendererImpl01.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package jogamp.graph.curve.opengl;
-
-import javax.media.opengl.GL2ES2;
-import javax.media.opengl.GLException;
-
-import jogamp.graph.curve.opengl.shader.AttributeNames;
-
-import com.jogamp.graph.curve.Region;
-import com.jogamp.graph.curve.opengl.GLRegion;
-import com.jogamp.graph.curve.opengl.RegionRenderer;
-import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.opengl.GLExtensions;
-import com.jogamp.opengl.util.glsl.ShaderCode;
-import com.jogamp.opengl.util.glsl.ShaderProgram;
-import com.jogamp.opengl.util.glsl.ShaderState;
-
-public class RegionRendererImpl01 extends RegionRenderer {
-    public RegionRendererImpl01(RenderState rs, int renderModes) {
-        super(rs, renderModes);
-
-    }
-
-    @Override
-    protected boolean initShaderProgram(GL2ES2 gl) {
-        final ShaderState st = rs.getShaderState();
-
-        final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RegionRendererImpl01.class, "shader",
-                                                  "shader/bin", getVertexShaderName(), true);
-        final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RegionRendererImpl01.class, "shader",
-                                                  "shader/bin", getFragmentShaderName(), true);
-        rsVp.defaultShaderCustomization(gl, true, true);
-        // rsFp.defaultShaderCustomization(gl, true, true);
-        int pos = rsFp.addGLSLVersion(gl);
-        if( gl.isGLES() ) {
-            pos = rsFp.insertShaderSource(0, pos, ShaderCode.createExtensionDirective(GLExtensions.OES_standard_derivatives, ShaderCode.ENABLE));
-        }
-        final String rsFpDefPrecision =  getFragmentShaderPrecision(gl);
-        if( null != rsFpDefPrecision ) {
-            rsFp.insertShaderSource(0, pos, rsFpDefPrecision);
-        }
-
-        final ShaderProgram sp = new ShaderProgram();
-        sp.add(rsVp);
-        sp.add(rsFp);
-
-        if( !sp.init(gl) ) {
-            throw new GLException("RegionRenderer: Couldn't init program: "+sp);
-        }
-        st.attachShaderProgram(gl, sp, false);
-        st.bindAttribLocation(gl, AttributeNames.VERTEX_ATTR_IDX, AttributeNames.VERTEX_ATTR_NAME);
-        st.bindAttribLocation(gl, AttributeNames.TEXCOORD_ATTR_IDX, AttributeNames.TEXCOORD_ATTR_NAME);
-
-        if(!sp.link(gl, System.err)) {
-            throw new GLException("RegionRenderer: Couldn't link program: "+sp);
-        }
-        st.useProgram(gl, true);
-
-        if(DEBUG) {
-            System.err.println("RegionRendererImpl01 initialized: " + Thread.currentThread()+" "+st);
-        }
-        return true;
-    }
-
-    @Override
-    protected void destroyImpl(GL2ES2 gl) {
-        super.destroyImpl(gl);
-    }
-
-    @Override
-    protected void drawImpl(GL2ES2 gl, Region region, float[] position, int[] texSize) {
-        ((GLRegion)region).draw(gl, rs, vp_width, vp_height, texSize);
-    }
-}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java b/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java
deleted file mode 100644
index 68f926b..0000000
--- a/src/jogl/classes/jogamp/graph/curve/opengl/RenderStateImpl.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package jogamp.graph.curve.opengl;
-
-import java.nio.FloatBuffer;
-
-import javax.media.opengl.GLUniformData;
-
-import jogamp.graph.curve.opengl.shader.UniformNames;
-
-import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.geom.Vertex;
-import com.jogamp.opengl.util.PMVMatrix;
-import com.jogamp.opengl.util.glsl.ShaderState;
-
-public class RenderStateImpl extends RenderState {
-    /**
-     * weight is equivalent to the
-     * global off-curve vertex weight.
-     * TODO: change to per vertex
-     */
-    private final GLUniformData gcu_Weight;
-    private final GLUniformData gcu_Alpha;
-    private final GLUniformData gcu_ColorStatic;
-
-    public RenderStateImpl(ShaderState st, Vertex.Factory<? extends Vertex> pointFactory, PMVMatrix pmvMatrix) {
-        super(st, pointFactory, pmvMatrix);
-
-        gcu_Weight = new GLUniformData(UniformNames.gcu_Weight, 1.0f);
-        st.ownUniform(gcu_PMVMatrix);
-        gcu_Alpha = new GLUniformData(UniformNames.gcu_Alpha, 1.0f);
-        st.ownUniform(gcu_Alpha);
-        gcu_ColorStatic = new GLUniformData(UniformNames.gcu_ColorStatic, 3, FloatBuffer.allocate(3));
-        st.ownUniform(gcu_ColorStatic);
-//        gcu_Strength = new GLUniformData(UniformNames.gcu_Strength, 3.0f);
-//        st.ownUniform(gcu_Strength);
-    }
-
-    @Override
-    public final GLUniformData getWeight() { return gcu_Weight; }
-    @Override
-    public final GLUniformData getAlpha() { return gcu_Alpha; }
-    @Override
-    public final GLUniformData getColorStatic() { return gcu_ColorStatic; }
-    //public final GLUniformData getStrength() { return gcu_Strength; }
-
-
-}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java b/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java
deleted file mode 100644
index 4ec4d1d..0000000
--- a/src/jogl/classes/jogamp/graph/curve/opengl/TextRendererImpl01.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package jogamp.graph.curve.opengl;
-
-import javax.media.opengl.GL2ES2;
-import javax.media.opengl.GLException;
-
-import jogamp.graph.curve.opengl.shader.AttributeNames;
-import jogamp.graph.curve.text.GlyphString;
-
-import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.curve.opengl.TextRenderer;
-import com.jogamp.graph.font.Font;
-import com.jogamp.opengl.GLExtensions;
-import com.jogamp.opengl.util.glsl.ShaderCode;
-import com.jogamp.opengl.util.glsl.ShaderProgram;
-import com.jogamp.opengl.util.glsl.ShaderState;
-
-public class TextRendererImpl01 extends TextRenderer {
-    public TextRendererImpl01(RenderState rs, int type) {
-        super(rs, type);
-    }
-
-    @Override
-    protected boolean initShaderProgram(GL2ES2 gl){
-        final ShaderState st = rs.getShaderState();
-
-        final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, TextRendererImpl01.class, "shader",
-                                                  "shader/bin", getVertexShaderName(), true);
-        final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, TextRendererImpl01.class, "shader",
-                                                  "shader/bin", getFragmentShaderName(), true);
-        rsVp.defaultShaderCustomization(gl, true, true);
-        // rsFp.defaultShaderCustomization(gl, true, true);
-        int pos = rsFp.addGLSLVersion(gl);
-        if( gl.isGLES() ) {
-            pos = rsFp.insertShaderSource(0, pos, ShaderCode.createExtensionDirective(GLExtensions.OES_standard_derivatives, ShaderCode.ENABLE));
-        }
-        final String rsFpDefPrecision =  getFragmentShaderPrecision(gl);
-        if( null != rsFpDefPrecision ) {
-            rsFp.insertShaderSource(0, pos, rsFpDefPrecision);
-        }
-
-        final ShaderProgram sp = new ShaderProgram();
-        sp.add(rsVp);
-        sp.add(rsFp);
-
-        if( !sp.init(gl) ) {
-            throw new GLException("RegionRenderer: Couldn't init program: "+sp);
-        }
-        st.attachShaderProgram(gl, sp, false);
-        st.bindAttribLocation(gl, AttributeNames.VERTEX_ATTR_IDX, AttributeNames.VERTEX_ATTR_NAME);
-        st.bindAttribLocation(gl, AttributeNames.TEXCOORD_ATTR_IDX, AttributeNames.TEXCOORD_ATTR_NAME);
-
-        if(!sp.link(gl, System.err)) {
-            throw new GLException("TextRendererImpl01: Couldn't link program: "+sp);
-        }
-        st.useProgram(gl, true);
-
-        if(DEBUG) {
-            System.err.println("TextRendererImpl01 initialized: " + Thread.currentThread()+" "+st);
-        }
-        return true;
-    }
-
-    @Override
-    protected void destroyImpl(GL2ES2 gl) {
-        super.destroyImpl(gl);
-    }
-
-    @Override
-    public void drawString3D(GL2ES2 gl, Font font, String str, float[] position, int fontSize, int[/*1*/] texSize) {
-        if(!isInitialized()){
-            throw new GLException("TextRendererImpl01: not initialized!");
-        }
-        GlyphString glyphString = getCachedGlyphString(font, str, fontSize);
-        if(null == glyphString) {
-            glyphString = createString(gl, font, fontSize, str);
-            addCachedGlyphString(gl, font, str, fontSize, glyphString);
-        }
-
-        glyphString.renderString3D(gl, rs, vp_width, vp_height, texSize);
-    }
-}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
deleted file mode 100644
index 77c862e..0000000
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PES2.java
+++ /dev/null
@@ -1,343 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package jogamp.graph.curve.opengl;
-
-import java.nio.FloatBuffer;
-
-import javax.media.opengl.GL2ES2;
-// FIXME: Subsume GL2GL3.GL_DRAW_FRAMEBUFFER -> GL2ES2.GL_DRAW_FRAMEBUFFER !
-import javax.media.opengl.GL;
-import javax.media.opengl.GLUniformData;
-import javax.media.opengl.fixedfunc.GLMatrixFunc;
-
-import jogamp.graph.curve.opengl.shader.AttributeNames;
-import jogamp.graph.curve.opengl.shader.UniformNames;
-
-import com.jogamp.common.nio.Buffers;
-import com.jogamp.graph.geom.Triangle;
-import com.jogamp.graph.geom.Vertex;
-
-import com.jogamp.graph.curve.opengl.GLRegion;
-import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.opengl.FBObject;
-import com.jogamp.opengl.FBObject.Attachment;
-import com.jogamp.opengl.FBObject.TextureAttachment;
-import com.jogamp.opengl.util.GLArrayDataServer;
-import com.jogamp.opengl.util.PMVMatrix;
-import com.jogamp.opengl.util.glsl.ShaderState;
-
-public class VBORegion2PES2  extends GLRegion {
-    private GLArrayDataServer verticeTxtAttr;
-    private GLArrayDataServer texCoordTxtAttr;
-    private GLArrayDataServer indicesTxt;
-    private GLArrayDataServer verticeFboAttr;
-    private GLArrayDataServer texCoordFboAttr;
-    private GLArrayDataServer indicesFbo;
-
-
-    private FBObject fbo;
-    private TextureAttachment texA;
-    private PMVMatrix fboPMVMatrix;
-    GLUniformData mgl_fboPMVMatrix;
-
-    private int tex_width_c = 0;
-    private int tex_height_c = 0;
-    GLUniformData mgl_ActiveTexture;
-    GLUniformData mgl_TextureSize; // if GLSL < 1.30
-
-    public VBORegion2PES2(int renderModes, int textureEngine) {
-        super(renderModes);
-        fboPMVMatrix = new PMVMatrix();
-        mgl_fboPMVMatrix = new GLUniformData(UniformNames.gcu_PMVMatrix, 4, 4, fboPMVMatrix.glGetPMvMatrixf());
-        mgl_ActiveTexture = new GLUniformData(UniformNames.gcu_TextureUnit, textureEngine);
-    }
-
-    @Override
-    public void update(GL2ES2 gl, RenderState rs) {
-        if(!isDirty()) {
-            return;
-        }
-
-        if(null == indicesFbo) {
-            final int initialElementCount = 256;
-            final ShaderState st = rs.getShaderState();
-
-            indicesFbo = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
-            indicesFbo.puts((short) 0); indicesFbo.puts((short) 1); indicesFbo.puts((short) 3);
-            indicesFbo.puts((short) 1); indicesFbo.puts((short) 2); indicesFbo.puts((short) 3);
-            indicesFbo.seal(true);
-
-            texCoordFboAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
-                                                           false, initialElementCount, GL.GL_STATIC_DRAW);
-            st.ownAttribute(texCoordFboAttr, true);
-            texCoordFboAttr.putf(5); texCoordFboAttr.putf(5);
-            texCoordFboAttr.putf(5); texCoordFboAttr.putf(6);
-            texCoordFboAttr.putf(6); texCoordFboAttr.putf(6);
-            texCoordFboAttr.putf(6); texCoordFboAttr.putf(5);
-            texCoordFboAttr.seal(true);
-
-            verticeFboAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
-                                                          false, initialElementCount, GL.GL_STATIC_DRAW);
-            st.ownAttribute(verticeFboAttr, true);
-
-
-            indicesTxt = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
-
-            verticeTxtAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
-                                                          false, initialElementCount, GL.GL_STATIC_DRAW);
-            st.ownAttribute(verticeTxtAttr, true);
-
-            texCoordTxtAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
-                                                           false, initialElementCount, GL.GL_STATIC_DRAW);
-            st.ownAttribute(texCoordTxtAttr, true);
-
-            if(DEBUG_INSTANCE) {
-                System.err.println("VBORegion2PES2 Create: " + this);
-            }
-        }
-        // process triangles
-        indicesTxt.seal(gl, false);
-        indicesTxt.rewind();
-        for(int i=0; i<triangles.size(); i++) {
-            final Triangle t = triangles.get(i);
-            final Vertex[] t_vertices = t.getVertices();
-
-            if(t_vertices[0].getId() == Integer.MAX_VALUE){
-                t_vertices[0].setId(numVertices++);
-                t_vertices[1].setId(numVertices++);
-                t_vertices[2].setId(numVertices++);
-
-                vertices.add(t_vertices[0]);
-                vertices.add(t_vertices[1]);
-                vertices.add(t_vertices[2]);
-
-                indicesTxt.puts((short) t_vertices[0].getId());
-                indicesTxt.puts((short) t_vertices[1].getId());
-                indicesTxt.puts((short) t_vertices[2].getId());
-            } else {
-                indicesTxt.puts((short) t_vertices[0].getId());
-                indicesTxt.puts((short) t_vertices[1].getId());
-                indicesTxt.puts((short) t_vertices[2].getId());
-            }
-        }
-        indicesTxt.seal(gl, true);
-        indicesTxt.enableBuffer(gl, false);
-
-        // process vertices and update bbox
-        box.reset();
-        verticeTxtAttr.seal(gl, false);
-        verticeTxtAttr.rewind();
-        texCoordTxtAttr.seal(gl, false);
-        texCoordTxtAttr.rewind();
-        for(int i=0; i<vertices.size(); i++) {
-            final Vertex v = vertices.get(i);
-            verticeTxtAttr.putf(v.getX());
-            verticeTxtAttr.putf(v.getY());
-            verticeTxtAttr.putf(v.getZ());
-            box.resize(v.getX(), v.getY(), v.getZ());
-
-            final float[] tex = v.getTexCoord();
-            texCoordTxtAttr.putf(tex[0]);
-            texCoordTxtAttr.putf(tex[1]);
-        }
-        texCoordTxtAttr.seal(gl, true);
-        texCoordTxtAttr.enableBuffer(gl, false);
-        verticeTxtAttr.seal(gl, true);
-        verticeTxtAttr.enableBuffer(gl, false);
-
-        // update all bbox related data
-        verticeFboAttr.seal(gl, false);
-        verticeFboAttr.rewind();
-        verticeFboAttr.putf(box.getLow()[0]);  verticeFboAttr.putf(box.getLow()[1]);  verticeFboAttr.putf(box.getLow()[2]);
-        verticeFboAttr.putf(box.getLow()[0]);  verticeFboAttr.putf(box.getHigh()[1]); verticeFboAttr.putf(box.getLow()[2]);
-        verticeFboAttr.putf(box.getHigh()[0]); verticeFboAttr.putf(box.getHigh()[1]); verticeFboAttr.putf(box.getLow()[2]);
-        verticeFboAttr.putf(box.getHigh()[0]); verticeFboAttr.putf(box.getLow()[1]);  verticeFboAttr.putf(box.getLow()[2]);
-        verticeFboAttr.seal(gl, true);
-        verticeFboAttr.enableBuffer(gl, false);
-
-        fboPMVMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
-        fboPMVMatrix.glLoadIdentity();
-        fboPMVMatrix.glOrthof(box.getLow()[0], box.getHigh()[0], box.getLow()[1], box.getHigh()[1], -1, 1);
-
-        // push data 2 GPU ..
-        indicesFbo.seal(gl, true);
-        indicesFbo.enableBuffer(gl, false);
-
-        setDirty(false);
-
-        // the buffers were disabled, since due to real/fbo switching and other vbo usage
-    }
-
-    int[] maxTexSize = new int[] { -1 } ;
-
-    @Override
-    protected void drawImpl(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int[/*1*/] texWidth) {
-        if(vp_width <=0 || vp_height <= 0 || null==texWidth || texWidth[0] <= 0){
-            renderRegion(gl);
-        } else {
-            if(0 > maxTexSize[0]) {
-                gl.glGetIntegerv(GL.GL_MAX_TEXTURE_SIZE, maxTexSize, 0);
-            }
-            if(texWidth[0] != tex_width_c) {
-                if(texWidth[0] > maxTexSize[0]) {
-                    texWidth[0] = maxTexSize[0]; // clip to max - write-back user value!
-                }
-                renderRegion2FBO(gl, rs, texWidth);
-            }
-            // System.out.println("Scale: " + matrix.glGetMatrixf().get(1+4*3) +" " + matrix.glGetMatrixf().get(2+4*3));
-            renderFBO(gl, rs, vp_width, vp_height);
-        }
-    }
-
-    private void renderFBO(GL2ES2 gl, RenderState rs, int width, int hight) {
-        final ShaderState st = rs.getShaderState();
-
-        gl.glViewport(0, 0, width, hight);
-        st.uniform(gl, mgl_ActiveTexture);
-        gl.glActiveTexture(GL.GL_TEXTURE0 + mgl_ActiveTexture.intValue());
-        fbo.use(gl, texA);
-        verticeFboAttr.enableBuffer(gl, true);
-        texCoordFboAttr.enableBuffer(gl, true);
-        indicesFbo.bindBuffer(gl, true); // keeps VBO binding
-
-        gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
-
-        indicesFbo.bindBuffer(gl, false);
-        texCoordFboAttr.enableBuffer(gl, false);
-        verticeFboAttr.enableBuffer(gl, false);
-        fbo.unuse(gl);
-
-        // setback: gl.glActiveTexture(currentActiveTextureEngine[0]);
-    }
-
-    private void renderRegion2FBO(GL2ES2 gl, RenderState rs, int[/*1*/] texWidth) {
-        final ShaderState st = rs.getShaderState();
-
-        if(0>=texWidth[0]) {
-            throw new IllegalArgumentException("texWidth must be greater than 0: "+texWidth[0]);
-        }
-
-        tex_width_c  = texWidth[0];
-        tex_height_c = (int) ( ( ( tex_width_c * box.getHeight() ) / box.getWidth() ) + 0.5f );
-
-        // System.out.println("FBO Size: "+texWidth[0]+" -> "+tex_width_c+"x"+tex_height_c);
-        // System.out.println("FBO Scale: " + m.glGetMatrixf().get(0) +" " + m.glGetMatrixf().get(5));
-
-        if(null != fbo && fbo.getWidth() != tex_width_c && fbo.getHeight() != tex_height_c ) {
-            fbo.reset(gl, tex_width_c, tex_height_c);
-        }
-
-        if(null == fbo) {
-            fbo = new FBObject();
-            fbo.reset(gl, tex_width_c, tex_height_c);
-            // FIXME: shall not use bilinear, due to own AA ? However, w/o bilinear result is not smooth
-            texA = fbo.attachTexture2D(gl, 0, true, GL2ES2.GL_LINEAR, GL2ES2.GL_LINEAR, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
-            // texA = fbo.attachTexture2D(gl, 0, GL2ES2.GL_NEAREST, GL2ES2.GL_NEAREST, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
-            fbo.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
-        } else {
-            fbo.bind(gl);
-        }
-
-        //render texture
-        gl.glViewport(0, 0, tex_width_c, tex_height_c);
-        st.uniform(gl, mgl_fboPMVMatrix); // use orthogonal matrix
-
-        gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
-        gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT | GL2ES2.GL_DEPTH_BUFFER_BIT);
-        renderRegion(gl);
-        fbo.unbind(gl);
-
-        st.uniform(gl, rs.getPMVMatrix()); // switch back to real PMV matrix
-
-        // if( !gl.isGL3() ) {
-            // GLSL < 1.30
-            if(null == mgl_TextureSize) {
-                mgl_TextureSize = new GLUniformData(UniformNames.gcu_TextureSize, 2, Buffers.newDirectFloatBuffer(2));
-            }
-            final FloatBuffer texSize = (FloatBuffer) mgl_TextureSize.getBuffer();
-            texSize.put(0, (float)fbo.getWidth());
-            texSize.put(1, (float)fbo.getHeight());
-            st.uniform(gl, mgl_TextureSize);
-        //}
-    }
-
-    private void renderRegion(GL2ES2 gl) {
-        verticeTxtAttr.enableBuffer(gl, true);
-        texCoordTxtAttr.enableBuffer(gl, true);
-        indicesTxt.bindBuffer(gl, true); // keeps VBO binding
-
-        gl.glDrawElements(GL2ES2.GL_TRIANGLES, indicesTxt.getElementCount() * indicesTxt.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
-
-        indicesTxt.bindBuffer(gl, false);
-        texCoordTxtAttr.enableBuffer(gl, false);
-        verticeTxtAttr.enableBuffer(gl, false);
-    }
-
-    @Override
-    public void destroy(GL2ES2 gl, RenderState rs) {
-        if(DEBUG_INSTANCE) {
-            System.err.println("VBORegion2PES2 Destroy: " + this);
-        }
-        final ShaderState st = rs.getShaderState();
-        if(null != fbo) {
-            fbo.destroy(gl);
-            fbo = null;
-            texA = null;
-        }
-        if(null != verticeTxtAttr) {
-            st.ownAttribute(verticeTxtAttr, false);
-            verticeTxtAttr.destroy(gl);
-            verticeTxtAttr = null;
-        }
-        if(null != texCoordTxtAttr) {
-            st.ownAttribute(texCoordTxtAttr, false);
-            texCoordTxtAttr.destroy(gl);
-            texCoordTxtAttr = null;
-        }
-        if(null != indicesTxt) {
-            indicesTxt.destroy(gl);
-            indicesTxt = null;
-        }
-        if(null != verticeFboAttr) {
-            st.ownAttribute(verticeFboAttr, false);
-            verticeFboAttr.destroy(gl);
-            verticeFboAttr = null;
-        }
-        if(null != texCoordFboAttr) {
-            st.ownAttribute(texCoordFboAttr, false);
-            texCoordFboAttr.destroy(gl);
-            texCoordFboAttr = null;
-        }
-        if(null != indicesFbo) {
-            indicesFbo.destroy(gl);
-            indicesFbo = null;
-        }
-        triangles.clear();
-        vertices.clear();
-    }
-}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
new file mode 100644
index 0000000..ca50b5d
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PMSAAES2.java
@@ -0,0 +1,586 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.graph.curve.opengl;
+
+import java.nio.FloatBuffer;
+
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GL;
+import javax.media.opengl.GLUniformData;
+
+import jogamp.graph.curve.opengl.shader.AttributeNames;
+import jogamp.graph.curve.opengl.shader.UniformNames;
+
+import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.opengl.FBObject;
+import com.jogamp.opengl.FBObject.Attachment;
+import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.math.geom.AABBox;
+import com.jogamp.opengl.util.GLArrayDataServer;
+import com.jogamp.opengl.util.glsl.ShaderProgram;
+import com.jogamp.opengl.util.texture.Texture;
+import com.jogamp.opengl.util.texture.TextureCoords;
+import com.jogamp.opengl.util.texture.TextureSequence;
+
+public class VBORegion2PMSAAES2  extends GLRegion {
+    private static final boolean DEBUG_FBO_1 = false;
+    private static final boolean DEBUG_FBO_2 = false;
+
+    private final RenderState.ProgramLocal rsLocal;
+
+    // Pass-1:
+    private GLArrayDataServer gca_VerticesAttr;
+    private GLArrayDataServer gca_CurveParamsAttr;
+    private GLArrayDataServer gca_ColorsAttr;
+    private GLArrayDataServer indicesBuffer;
+    private final GLUniformData gcu_ColorTexUnit;
+    private final float[] colorTexBBox; // x0, y0, x1, y1
+    private final GLUniformData gcu_ColorTexBBox;
+    private ShaderProgram spPass1 = null;
+
+    // Pass-2:
+    private GLArrayDataServer gca_FboVerticesAttr;
+    private GLArrayDataServer gca_FboTexCoordsAttr;
+    private GLArrayDataServer indicesFbo;
+    private final GLUniformData gcu_FboTexUnit;
+    private final float[] pmvMatrix02 = new float[2*16]; // P + Mv
+    private final GLUniformData gcu_PMVMatrix02;
+    private ShaderProgram spPass2 = null;
+
+    private FBObject fbo;
+
+    private int fboWidth = 0;
+    private int fboHeight = 0;
+    private boolean fboDirty = true;
+
+    final int[] maxTexSize = new int[] { -1 } ;
+
+    /**
+     * <p>
+     * Since multiple {@link Region}s may share one
+     * {@link ShaderProgram}, the uniform data must always be updated.
+     * </p>
+     *
+     * @param gl
+     * @param renderer
+     * @param renderModes
+     * @param pass1
+     * @param quality
+     * @param sampleCount
+     */
+    public void useShaderProgram(final GL2ES2 gl, final RegionRenderer renderer, final int renderModes, final boolean pass1, final int quality, final int sampleCount) {
+        final RenderState rs = renderer.getRenderState();
+        final boolean updateLocGlobal = renderer.useShaderProgram(gl, renderModes, pass1, quality, sampleCount, colorTexSeq);
+        final ShaderProgram sp = renderer.getRenderState().getShaderProgram();
+        final boolean updateLocLocal;
+        if( pass1 ) {
+            updateLocLocal = !sp.equals(spPass1);
+            spPass1 = sp;
+            if( DEBUG ) {
+                System.err.println("XXX changedSP.p1 updateLocation loc "+updateLocLocal+" / glob "+updateLocGlobal);
+            }
+            if( updateLocLocal ) {
+                rs.updateAttributeLoc(gl, true, gca_VerticesAttr, true);
+                rs.updateAttributeLoc(gl, true, gca_CurveParamsAttr, true);
+                if( null != gca_ColorsAttr ) {
+                    rs.updateAttributeLoc(gl, true, gca_ColorsAttr, true);
+                }
+            }
+            rsLocal.update(gl, rs, updateLocLocal, renderModes, true, true);
+            rs.updateUniformLoc(gl, updateLocLocal, gcu_PMVMatrix02, true);
+            if( null != gcu_ColorTexUnit ) {
+                rs.updateUniformLoc(gl, updateLocLocal, gcu_ColorTexUnit, true);
+                rs.updateUniformLoc(gl, updateLocLocal, gcu_ColorTexBBox, true);
+            }
+        } else {
+            updateLocLocal = !sp.equals(spPass2);
+            spPass2 = sp;
+            if( DEBUG ) {
+                System.err.println("XXX changedSP.p2 updateLocation loc "+updateLocLocal+" / glob "+updateLocGlobal);
+            }
+            if( updateLocLocal ) {
+                rs.updateAttributeLoc(gl, true, gca_FboVerticesAttr, true);
+                rs.updateAttributeLoc(gl, true, gca_FboTexCoordsAttr, true);
+            }
+            rsLocal.update(gl, rs, updateLocLocal, renderModes, false, true);
+            rs.updateUniformDataLoc(gl, updateLocLocal, false /* updateData */, gcu_FboTexUnit, true); // FIXME always update if changing tex-unit
+        }
+    }
+
+    public VBORegion2PMSAAES2(final int renderModes, final TextureSequence colorTexSeq, final int pass2TexUnit) {
+        super(renderModes, colorTexSeq);
+
+        rsLocal = new RenderState.ProgramLocal();
+
+        final int initialElementCount = 256;
+
+        // Pass 1:
+        indicesBuffer = GLArrayDataServer.createData(3, GL.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+
+        gca_VerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL.GL_FLOAT,
+                                                      false, initialElementCount, GL.GL_STATIC_DRAW);
+
+        gca_CurveParamsAttr = GLArrayDataServer.createGLSL(AttributeNames.CURVEPARAMS_ATTR_NAME, 3, GL.GL_FLOAT,
+                                                       false, initialElementCount, GL.GL_STATIC_DRAW);
+
+        if( hasColorChannel() ) {
+            gca_ColorsAttr = GLArrayDataServer.createGLSL(AttributeNames.COLOR_ATTR_NAME, 4, GL.GL_FLOAT,
+                                                          false, initialElementCount, GL.GL_STATIC_DRAW);
+        } else {
+            gca_ColorsAttr = null;
+        }
+        if( hasColorTexture() ) {
+            gcu_ColorTexUnit = new GLUniformData(UniformNames.gcu_ColorTexUnit, colorTexSeq.getTextureUnit());
+            colorTexBBox = new float[4];
+            gcu_ColorTexBBox = new GLUniformData(UniformNames.gcu_ColorTexBBox, 4, FloatBuffer.wrap(colorTexBBox));
+        } else {
+            gcu_ColorTexUnit = null;
+            colorTexBBox = null;
+            gcu_ColorTexBBox = null;
+        }
+
+        FloatUtil.makeIdentity(pmvMatrix02, 0);
+        FloatUtil.makeIdentity(pmvMatrix02, 16);
+        gcu_PMVMatrix02 = new GLUniformData(UniformNames.gcu_PMVMatrix02, 4, 4, FloatBuffer.wrap(pmvMatrix02));
+
+        // Pass 2:
+        gcu_FboTexUnit = new GLUniformData(UniformNames.gcu_FboTexUnit, pass2TexUnit);
+
+        indicesFbo = GLArrayDataServer.createData(3, GL.GL_SHORT, 2, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+        indicesFbo.puts((short) 0); indicesFbo.puts((short) 1); indicesFbo.puts((short) 3);
+        indicesFbo.puts((short) 1); indicesFbo.puts((short) 2); indicesFbo.puts((short) 3);
+        indicesFbo.seal(true);
+
+        gca_FboTexCoordsAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_TEXCOORDS_ATTR_NAME, 2, GL.GL_FLOAT,
+                                                           false, 4, GL.GL_STATIC_DRAW);
+        gca_FboTexCoordsAttr.putf(0); gca_FboTexCoordsAttr.putf(0);
+        gca_FboTexCoordsAttr.putf(0); gca_FboTexCoordsAttr.putf(1);
+        gca_FboTexCoordsAttr.putf(1); gca_FboTexCoordsAttr.putf(1);
+        gca_FboTexCoordsAttr.putf(1); gca_FboTexCoordsAttr.putf(0);
+        gca_FboTexCoordsAttr.seal(true);
+
+        gca_FboVerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_VERTEX_ATTR_NAME, 3, GL.GL_FLOAT,
+                                                           false, 4, GL.GL_STATIC_DRAW);
+    }
+
+    @Override
+    protected final void clearImpl(final GL2ES2 gl) {
+        if( null != indicesBuffer ) {
+            indicesBuffer.seal(gl, false);
+            indicesBuffer.rewind();
+        }
+        if( null != gca_VerticesAttr ) {
+            gca_VerticesAttr.seal(gl, false);
+            gca_VerticesAttr.rewind();
+        }
+        if( null != gca_CurveParamsAttr ) {
+            gca_CurveParamsAttr.seal(gl, false);
+            gca_CurveParamsAttr.rewind();
+        }
+        if( null != gca_ColorsAttr ) {
+            gca_ColorsAttr.seal(gl, false);
+            gca_ColorsAttr.rewind();
+        }
+        fboDirty = true;
+    }
+
+    @Override
+    protected final void pushVertex(final float[] coords, final float[] texParams, final float[] rgba) {
+        gca_VerticesAttr.putf(coords[0]);
+        gca_VerticesAttr.putf(coords[1]);
+        gca_VerticesAttr.putf(coords[2]);
+
+        gca_CurveParamsAttr.putf(texParams[0]);
+        gca_CurveParamsAttr.putf(texParams[1]);
+        gca_CurveParamsAttr.putf(texParams[2]);
+
+        if( null != gca_ColorsAttr ) {
+            if( null != rgba ) {
+                gca_ColorsAttr.putf(rgba[0]);
+                gca_ColorsAttr.putf(rgba[1]);
+                gca_ColorsAttr.putf(rgba[2]);
+                gca_ColorsAttr.putf(rgba[3]);
+            } else {
+                throw new IllegalArgumentException("Null color given for COLOR_CHANNEL rendering mode");
+            }
+        }
+    }
+
+    @Override
+    protected final void pushIndex(final int idx) {
+        indicesBuffer.puts((short)idx);
+    }
+
+    @Override
+    protected void updateImpl(final GL2ES2 gl) {
+        // seal buffers
+        indicesBuffer.seal(gl, true);
+        indicesBuffer.enableBuffer(gl, false);
+        gca_CurveParamsAttr.seal(gl, true);
+        gca_CurveParamsAttr.enableBuffer(gl, false);
+        gca_VerticesAttr.seal(gl, true);
+        gca_VerticesAttr.enableBuffer(gl, false);
+        if( null != gca_ColorsAttr ) {
+            gca_ColorsAttr.seal(gl, true);
+            gca_ColorsAttr.enableBuffer(gl, false);
+        }
+        if( null != gcu_ColorTexUnit && colorTexSeq.isTextureAvailable() ) {
+            final TextureSequence.TextureFrame frame = colorTexSeq.getLastTexture();
+            final Texture tex = frame.getTexture();
+            final TextureCoords tc = tex.getImageTexCoords();
+            final float tcSx = 1f / ( tc.right() - tc.left() );
+            colorTexBBox[0] = box.getMinX() * tcSx;
+            colorTexBBox[2] = box.getMaxX() * tcSx;
+            if( tex.getMustFlipVertically() ) {
+                final float tcSy = 1f / ( tc.bottom() - tc.top() );
+                colorTexBBox[1] = box.getMaxY() * tcSy;
+                colorTexBBox[3] = box.getMinY() * tcSy;
+            } else {
+                final float tcSy = 1f / ( tc.top() - tc.bottom() );
+                colorTexBBox[1] = box.getMinY() * tcSy;
+                colorTexBBox[3] = box.getMaxY() * tcSy;
+            }
+        }
+        gca_FboVerticesAttr.seal(gl, false);
+        {
+            final FloatBuffer fb = (FloatBuffer)gca_FboVerticesAttr.getBuffer();
+            fb.put( 2, box.getMinZ());
+            fb.put( 5, box.getMinZ());
+            fb.put( 8, box.getMinZ());
+            fb.put(11, box.getMinZ());
+        }
+        // Pending gca_FboVerticesAttr-seal and fboPMVMatrix-setup, follow fboDirty
+
+        // push data 2 GPU ..
+        indicesFbo.seal(gl, true);
+        indicesFbo.enableBuffer(gl, false);
+
+        fboDirty = true;
+        // the buffers were disabled, since due to real/fbo switching and other vbo usage
+    }
+
+    private final AABBox drawWinBox = new AABBox();
+    private final int[] drawView = new int[] { 0, 0, 0, 0 };
+    private final float[] drawVec4Tmp0 = new float[4];
+    private final float[] drawVec4Tmp1 = new float[4];
+    private final float[] drawVec4Tmp2 = new float[4];
+    private final float[] drawMat4PMv = new float[16];
+
+    private static final int border = 2; // surrounding border, i.e. width += 2*border, height +=2*border
+
+    @Override
+    protected void drawImpl(final GL2ES2 gl, final RegionRenderer renderer, final int[/*1*/] sampleCount) {
+        if( 0 >= indicesBuffer.getElementCount() ) {
+            if(DEBUG_INSTANCE) {
+                System.err.printf("VBORegion2PMSAAES2.drawImpl: Empty%n");
+            }
+            return; // empty!
+        }
+        if( Float.isInfinite(box.getWidth()) || Float.isInfinite(box.getHeight()) ) {
+            if(DEBUG_INSTANCE) {
+                System.err.printf("VBORegion2PMSAAES2.drawImpl: Inf %s%n", box);
+            }
+            return; // inf
+        }
+        final int vpWidth = renderer.getWidth();
+        final int vpHeight = renderer.getHeight();
+        if(vpWidth <=0 || vpHeight <= 0 || null==sampleCount || sampleCount[0] <= 0){
+            renderRegion(gl);
+        } else {
+            if(0 > maxTexSize[0]) {
+                gl.glGetIntegerv(GL.GL_MAX_TEXTURE_SIZE, maxTexSize, 0);
+            }
+            final RenderState rs = renderer.getRenderState();
+            final float winWidth, winHeight;
+
+            final float ratioObjWinWidth, ratioObjWinHeight;
+            final float diffObjWidth, diffObjHeight;
+            final float diffObjBorderWidth, diffObjBorderHeight;
+            int targetFboWidth, targetFboHeight;
+            {
+                final float diffWinWidth, diffWinHeight;
+                final int targetWinWidth, targetWinHeight;
+
+                // Calculate perspective pixel width/height for FBO,
+                // considering the sampleCount.
+                drawView[2] = vpWidth;
+                drawView[3] = vpHeight;
+
+                renderer.getMatrix().multPMvMatrixf(drawMat4PMv, 0);
+                box.mapToWindow(drawWinBox, drawMat4PMv, drawView, true /* useCenterZ */,
+                                drawVec4Tmp0, drawVec4Tmp1, drawVec4Tmp2);
+
+                winWidth = drawWinBox.getWidth();
+                winHeight = drawWinBox.getHeight();
+                targetWinWidth = (int)Math.ceil(winWidth);
+                targetWinHeight = (int)Math.ceil(winHeight);
+                diffWinWidth = targetWinWidth-winWidth;
+                diffWinHeight = targetWinHeight-winHeight;
+
+                ratioObjWinWidth = box.getWidth() / winWidth;
+                ratioObjWinHeight= box.getHeight() / winHeight;
+                diffObjWidth = diffWinWidth * ratioObjWinWidth;
+                diffObjHeight = diffWinHeight * ratioObjWinHeight;
+                diffObjBorderWidth = border * ratioObjWinWidth;
+                diffObjBorderHeight = border * ratioObjWinHeight;
+
+                targetFboWidth = targetWinWidth+2*border;
+                targetFboHeight = targetWinHeight+2*border;
+
+                if( DEBUG_FBO_2 ) {
+                    final float ratioWinWidth, ratioWinHeight;
+                    ratioWinWidth = winWidth/targetWinWidth;
+                    ratioWinHeight = winHeight/targetWinHeight;
+
+                    System.err.printf("XXX.MinMax obj %s%n", box.toString());
+                    System.err.printf("XXX.MinMax obj d[%.3f, %.3f], r[%f, %f], b[%f, %f]%n",
+                            diffObjWidth, diffObjHeight, ratioObjWinWidth, ratioObjWinWidth, diffObjBorderWidth, diffObjBorderHeight);
+                    System.err.printf("XXX.MinMax win %s%n", drawWinBox.toString());
+                    System.err.printf("XXX.MinMax view[%d, %d] -> win[%.3f, %.3f], i[%d x %d], d[%.3f, %.3f], r[%f, %f]: FBO i[%d x %d], samples %d%n",
+                            drawView[2], drawView[3],
+                            winWidth, winHeight, targetWinWidth, targetWinHeight, diffWinWidth,
+                            diffWinHeight, ratioWinWidth, ratioWinHeight,
+                            targetFboWidth, targetFboHeight,
+                            sampleCount[0]);
+                }
+            }
+            if( 0 >= targetFboWidth || 0 >= targetFboHeight ) {
+                // Nothing ..
+                return;
+            }
+            final int deltaFboWidth = Math.abs(targetFboWidth-fboWidth);
+            final int deltaFboHeight = Math.abs(targetFboHeight-fboHeight);
+            final boolean hasDelta = 0!=deltaFboWidth || 0!=deltaFboHeight;
+            if( DEBUG_FBO_2 ) {
+                System.err.printf("XXX.maxDelta: hasDelta %b: %d / %d,  %.3f, %.3f%n",
+                        hasDelta, deltaFboWidth, deltaFboHeight, (float)deltaFboWidth/fboWidth, (float)deltaFboHeight/fboHeight);
+                System.err.printf("XXX.Scale %d * [%f x %f]: %d x %d%n",
+                        sampleCount[0], winWidth, winHeight, targetFboWidth, targetFboHeight);
+            }
+            if( hasDelta || fboDirty || isShapeDirty() || null == fbo || fbo.getNumSamples() != sampleCount[0] ) {
+                // FIXME: rescale
+                final float minX = box.getMinX()-diffObjBorderWidth;
+                final float minY = box.getMinY()-diffObjBorderHeight;
+                final float maxX = box.getMaxX()+diffObjBorderWidth+diffObjWidth;
+                final float maxY = box.getMaxY()+diffObjBorderHeight+diffObjHeight;
+                gca_FboVerticesAttr.seal(false);
+                {
+                    final FloatBuffer fb = (FloatBuffer)gca_FboVerticesAttr.getBuffer();
+                    fb.put(0, minX); fb.put( 1, minY);
+                    fb.put(3, minX); fb.put( 4, maxY);
+                    fb.put(6, maxX); fb.put( 7, maxY);
+                    fb.put(9, maxX); fb.put(10, minY);
+                    fb.position(12);
+                }
+                gca_FboVerticesAttr.seal(true);
+                FloatUtil.makeOrtho(pmvMatrix02, 0, true, minX, maxX, minY, maxY, -1, 1);
+                useShaderProgram(gl, renderer, getRenderModes(), true, getQuality(), sampleCount[0]);
+                renderRegion2FBO(gl, rs, targetFboWidth, targetFboHeight, vpWidth, vpHeight, sampleCount);
+            } else if( isStateDirty() ) {
+                useShaderProgram(gl, renderer, getRenderModes(), true, getQuality(), sampleCount[0]);
+                renderRegion2FBO(gl, rs, targetFboWidth, targetFboHeight, vpWidth, vpHeight, sampleCount);
+            }
+            useShaderProgram(gl, renderer, getRenderModes(), false, getQuality(), sampleCount[0]);
+            renderFBO(gl, rs, vpWidth, vpHeight, sampleCount[0]);
+        }
+    }
+
+    private void renderFBO(final GL2ES2 gl, final RenderState rs, final int width, final int height, final int sampleCount) {
+        gl.glViewport(0, 0, width, height);
+
+        if( rs.isHintMaskSet(RenderState.BITHINT_BLENDING_ENABLED | RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED) ) {
+            // RGB is already multiplied w/ alpha via renderRegion2FBO(..)
+            gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
+            gl.glEnable(GL.GL_DEPTH_TEST);
+
+        } else if( rs.isHintMaskSet(RenderState.BITHINT_BLENDING_ENABLED) ) {
+            // RGB is already multiplied w/ alpha via renderRegion2FBO(..)
+            gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
+        }
+
+        gl.glActiveTexture(GL.GL_TEXTURE0 + gcu_FboTexUnit.intValue());
+
+        fbo.use(gl, fbo.getSamplingSink().getTextureAttachment());
+        gca_FboVerticesAttr.enableBuffer(gl, true);
+        gca_FboTexCoordsAttr.enableBuffer(gl, true);
+        indicesFbo.bindBuffer(gl, true); // keeps VBO binding
+
+        gl.glDrawElements(GL.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
+
+        indicesFbo.bindBuffer(gl, false);
+        gca_FboTexCoordsAttr.enableBuffer(gl, false);
+        gca_FboVerticesAttr.enableBuffer(gl, false);
+        fbo.unuse(gl);
+
+        // setback: gl.glActiveTexture(currentActiveTextureEngine[0]);
+    }
+
+    private void renderRegion2FBO(final GL2ES2 gl, final RenderState rs, final int targetFboWidth, final int targetFboHeight,
+                                  final int vpWidth, final int vpHeight, final int[] sampleCount) {
+        if( 0 >= targetFboWidth || 0 >= targetFboHeight ) {
+            throw new IllegalArgumentException("fboSize must be greater than 0: "+targetFboWidth+"x"+targetFboHeight);
+        }
+
+        final boolean blendingEnabled = rs.isHintMaskSet(RenderState.BITHINT_BLENDING_ENABLED);
+
+        if(null == fbo) {
+            fboWidth  = targetFboWidth;
+            fboHeight  = targetFboHeight;
+            fbo = new FBObject();
+            fbo.reset(gl, fboWidth, fboHeight, sampleCount[0], false);
+            sampleCount[0] = fbo.getNumSamples();
+            fbo.attachColorbuffer(gl, 0, true);
+            if( !blendingEnabled ) {
+                // no depth-buffer w/ blending
+                fbo.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
+            }
+            final FBObject ssink = new FBObject();
+            {
+                ssink.reset(gl, fboWidth, fboHeight);
+                // FIXME: shall not use bilinear (GL_LINEAR), due to MSAA ???
+                // ssink.attachTexture2D(gl, 0, true, GL2ES2.GL_LINEAR, GL2ES2.GL_LINEAR, GL2ES2.GL_CLAMP_TO_EDGE, GL2ES2.GL_CLAMP_TO_EDGE);
+                ssink.attachTexture2D(gl, 0, true, GL.GL_NEAREST, GL.GL_NEAREST, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
+                if( !blendingEnabled ) {
+                    // no depth-buffer w/ blending
+                    ssink.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
+                }
+            }
+            fbo.setSamplingSink(ssink);
+            fbo.resetSamplingSink(gl); // validate
+            if( DEBUG_FBO_1 ) {
+                System.err.printf("XXX.createFBO: blending %b, %dx%d%n%s%n", blendingEnabled, fboWidth, fboHeight, fbo.toString());
+            }
+        } else if( targetFboWidth != fboWidth || targetFboHeight != fboHeight || fbo.getNumSamples() != sampleCount[0] ) {
+            fbo.reset(gl, targetFboWidth, targetFboHeight, sampleCount[0], true /* resetSamplingSink */);
+            sampleCount[0] = fbo.getNumSamples();
+            if( DEBUG_FBO_1 ) {
+                System.err.printf("XXX.resetFBO: %dx%d -> %dx%d%n%s%n", fboWidth, fboHeight, targetFboWidth, targetFboHeight, fbo );
+            }
+            fboWidth  = targetFboWidth;
+            fboHeight  = targetFboHeight;
+        }
+        fbo.bind(gl);
+
+        //render texture
+        gl.glViewport(0, 0, fboWidth, fboHeight);
+        if( blendingEnabled ) {
+            gl.glClearColor(0f, 0f, 0f, 0.0f);
+            gl.glClear(GL.GL_COLOR_BUFFER_BIT); // no depth-buffer w/ blending
+            // For already pre-multiplied alpha values, use:
+            // gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
+
+            // Multiply RGB w/ Alpha, preserve alpha for renderFBO(..)
+            gl.glBlendFuncSeparate(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA, GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
+
+            if( rs.isHintMaskSet(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED) ) {
+                gl.glDisable(GL.GL_DEPTH_TEST);
+            }
+        } else {
+            gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+        }
+
+        renderRegion(gl);
+
+        fbo.unbind(gl);
+        fboDirty = false;
+    }
+
+    private void renderRegion(final GL2ES2 gl) {
+        gl.glUniform(gcu_PMVMatrix02);
+        gca_VerticesAttr.enableBuffer(gl, true);
+        gca_CurveParamsAttr.enableBuffer(gl, true);
+        if( null != gca_ColorsAttr ) {
+            gca_ColorsAttr.enableBuffer(gl, true);
+        }
+        indicesBuffer.bindBuffer(gl, true); // keeps VBO binding
+        if( null != gcu_ColorTexUnit && colorTexSeq.isTextureAvailable() ) {
+            final TextureSequence.TextureFrame frame = colorTexSeq.getNextTexture(gl);
+            gl.glActiveTexture(GL.GL_TEXTURE0 + colorTexSeq.getTextureUnit());
+            final Texture tex = frame.getTexture();
+            tex.bind(gl);
+            tex.enable(gl); // nop on core
+            gcu_ColorTexUnit.setData(colorTexSeq.getTextureUnit());
+            gl.glUniform(gcu_ColorTexUnit); // Always update, since program maybe used by multiple regions
+            gl.glUniform(gcu_ColorTexBBox); // Always update, since program maybe used by multiple regions
+            gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
+            tex.disable(gl); // nop on core
+        } else {
+            gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
+        }
+
+        indicesBuffer.bindBuffer(gl, false);
+        if( null != gca_ColorsAttr ) {
+            gca_ColorsAttr.enableBuffer(gl, false);
+        }
+        gca_CurveParamsAttr.enableBuffer(gl, false);
+        gca_VerticesAttr.enableBuffer(gl, false);
+    }
+
+    @Override
+    protected void destroyImpl(final GL2ES2 gl) {
+        if(DEBUG_INSTANCE) {
+            System.err.println("VBORegion2PES2 Destroy: " + this);
+        }
+        if(null != fbo) {
+            fbo.destroy(gl);
+            fbo = null;
+        }
+        if(null != gca_VerticesAttr) {
+            gca_VerticesAttr.destroy(gl);
+            gca_VerticesAttr = null;
+        }
+        if(null != gca_CurveParamsAttr) {
+            gca_CurveParamsAttr.destroy(gl);
+            gca_CurveParamsAttr = null;
+        }
+        if(null != gca_ColorsAttr) {
+            gca_ColorsAttr.destroy(gl);
+            gca_ColorsAttr = null;
+        }
+        if(null != indicesBuffer) {
+            indicesBuffer.destroy(gl);
+            indicesBuffer = null;
+        }
+        if(null != gca_FboVerticesAttr) {
+            gca_FboVerticesAttr.destroy(gl);
+            gca_FboVerticesAttr = null;
+        }
+        if(null != gca_FboTexCoordsAttr) {
+            gca_FboTexCoordsAttr.destroy(gl);
+            gca_FboTexCoordsAttr = null;
+        }
+        if(null != indicesFbo) {
+            indicesFbo.destroy(gl);
+            indicesFbo = null;
+        }
+        spPass1 = null;
+        spPass2 = null;
+    }
+}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
new file mode 100644
index 0000000..24fa090
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegion2PVBAAES2.java
@@ -0,0 +1,700 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.graph.curve.opengl;
+
+import java.nio.FloatBuffer;
+
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GL;
+import javax.media.opengl.GLUniformData;
+
+import jogamp.graph.curve.opengl.shader.AttributeNames;
+import jogamp.graph.curve.opengl.shader.UniformNames;
+import jogamp.opengl.Debug;
+
+import com.jogamp.common.util.PropertyAccess;
+import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.opengl.FBObject;
+import com.jogamp.opengl.FBObject.Attachment;
+import com.jogamp.opengl.FBObject.TextureAttachment;
+import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.math.geom.AABBox;
+import com.jogamp.opengl.util.GLArrayDataServer;
+import com.jogamp.opengl.util.glsl.ShaderProgram;
+import com.jogamp.opengl.util.texture.Texture;
+import com.jogamp.opengl.util.texture.TextureCoords;
+import com.jogamp.opengl.util.texture.TextureSequence;
+
+public class VBORegion2PVBAAES2  extends GLRegion {
+    private static final boolean DEBUG_FBO_1 = false;
+    private static final boolean DEBUG_FBO_2 = false;
+
+    /**
+     * Boundary triggering FBO resize if
+     * <pre>
+     *      fbo[Width|Height] - targetFbo[Width|Height] > RESIZE_BOUNDARY.
+     * </pre>
+     * <p>
+     * Increasing the FBO will add RESIZE_BOUNDARY/2.
+     * </p>
+     * <p>
+     * Reducing FBO resize to gain performance.
+     * </p>
+     * <p>
+     * Defaults to disabled since:
+     *   - not working properly
+     *   - FBO texture rendered > than desired size
+     *   - FBO resize itself should be fast enough ?!
+     * </p>
+     */
+    private static final int RESIZE_BOUNDARY;
+
+    static {
+        Debug.initSingleton();
+        final String key = "jogl.debug.graph.curve.vbaa.resizeLowerBoundary";
+        RESIZE_BOUNDARY = Math.max(0, PropertyAccess.getIntProperty(key, true, 0));
+        if( RESIZE_BOUNDARY > 0 ) {
+            System.err.println("key: "+RESIZE_BOUNDARY);
+        }
+    }
+
+
+    private final RenderState.ProgramLocal rsLocal;
+
+    // Pass-1:
+    private GLArrayDataServer gca_VerticesAttr;
+    private GLArrayDataServer gca_CurveParamsAttr;
+    private GLArrayDataServer gca_ColorsAttr;
+    private GLArrayDataServer indicesBuffer;
+    private final GLUniformData gcu_ColorTexUnit;
+    private final float[] colorTexBBox; // x0, y0, x1, y1
+    private final GLUniformData gcu_ColorTexBBox;
+    private ShaderProgram spPass1 = null;
+
+    // Pass-2:
+    private GLArrayDataServer gca_FboVerticesAttr;
+    private GLArrayDataServer gca_FboTexCoordsAttr;
+    private GLArrayDataServer indicesFbo;
+    private final GLUniformData gcu_FboTexUnit;
+    private final GLUniformData gcu_FboTexSize;
+    private final float[] pmvMatrix02 = new float[2*16]; // P + Mv
+    private final GLUniformData gcu_PMVMatrix02;
+    private ShaderProgram spPass2 = null;
+
+    private FBObject fbo;
+    private TextureAttachment texA;
+
+    private int fboWidth = 0;
+    private int fboHeight = 0;
+    private boolean fboDirty = true;
+
+    final int[] maxTexSize = new int[] { -1 } ;
+
+    /**
+     * <p>
+     * Since multiple {@link Region}s may share one
+     * {@link ShaderProgram}, the uniform data must always be updated.
+     * </p>
+     *
+     * @param gl
+     * @param renderer
+     * @param renderModes
+     * @param pass1
+     * @param quality
+     * @param sampleCount
+     */
+    public void useShaderProgram(final GL2ES2 gl, final RegionRenderer renderer, final int renderModes, final boolean pass1, final int quality, final int sampleCount) {
+        final RenderState rs = renderer.getRenderState();
+        final boolean updateLocGlobal = renderer.useShaderProgram(gl, renderModes, pass1, quality, sampleCount, colorTexSeq);
+        final ShaderProgram sp = renderer.getRenderState().getShaderProgram();
+        final boolean updateLocLocal;
+        if( pass1 ) {
+            updateLocLocal = !sp.equals(spPass1);
+            spPass1 = sp;
+            if( DEBUG ) {
+                System.err.println("XXX changedSP.p1 updateLocation loc "+updateLocLocal+" / glob "+updateLocGlobal);
+            }
+            if( updateLocLocal ) {
+                rs.updateAttributeLoc(gl, true, gca_VerticesAttr, true);
+                rs.updateAttributeLoc(gl, true, gca_CurveParamsAttr, true);
+                if( null != gca_ColorsAttr ) {
+                    rs.updateAttributeLoc(gl, true, gca_ColorsAttr, true);
+                }
+            }
+            rsLocal.update(gl, rs, updateLocLocal, renderModes, true, true);
+            rs.updateUniformLoc(gl, updateLocLocal, gcu_PMVMatrix02, true);
+            if( null != gcu_ColorTexUnit ) {
+                rs.updateUniformLoc(gl, updateLocLocal, gcu_ColorTexUnit, true);
+                rs.updateUniformLoc(gl, updateLocLocal, gcu_ColorTexBBox, true);
+            }
+        } else {
+            updateLocLocal = !sp.equals(spPass2);
+            spPass2 = sp;
+            if( DEBUG ) {
+                System.err.println("XXX changedSP.p2 updateLocation loc "+updateLocLocal+" / glob "+updateLocGlobal);
+            }
+            if( updateLocLocal ) {
+                rs.updateAttributeLoc(gl, true, gca_FboVerticesAttr, true);
+                rs.updateAttributeLoc(gl, true, gca_FboTexCoordsAttr, true);
+            }
+            rsLocal.update(gl, rs, updateLocLocal, renderModes, false, true);
+            rs.updateUniformDataLoc(gl, updateLocLocal, false /* updateData */, gcu_FboTexUnit, true); // FIXME always update if changing tex-unit
+            rs.updateUniformLoc(gl, updateLocLocal, gcu_FboTexSize, sampleCount > 1); // maybe optimized away for sampleCount <= 1
+        }
+    }
+
+    public VBORegion2PVBAAES2(final int renderModes, final TextureSequence colorTexSeq, final int pass2TexUnit) {
+        super(renderModes, colorTexSeq);
+
+        rsLocal = new RenderState.ProgramLocal();
+
+        final int initialElementCount = 256;
+
+        // Pass 1:
+        indicesBuffer = GLArrayDataServer.createData(3, GL.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+
+        gca_VerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL.GL_FLOAT,
+                                                      false, initialElementCount, GL.GL_STATIC_DRAW);
+
+        gca_CurveParamsAttr = GLArrayDataServer.createGLSL(AttributeNames.CURVEPARAMS_ATTR_NAME, 3, GL.GL_FLOAT,
+                                                       false, initialElementCount, GL.GL_STATIC_DRAW);
+        if( hasColorChannel() ) {
+            gca_ColorsAttr = GLArrayDataServer.createGLSL(AttributeNames.COLOR_ATTR_NAME, 4, GL.GL_FLOAT,
+                                                          false, initialElementCount, GL.GL_STATIC_DRAW);
+        } else {
+            gca_ColorsAttr = null;
+        }
+        if( hasColorTexture() ) {
+            gcu_ColorTexUnit = new GLUniformData(UniformNames.gcu_ColorTexUnit, colorTexSeq.getTextureUnit());
+            colorTexBBox = new float[4];
+            gcu_ColorTexBBox = new GLUniformData(UniformNames.gcu_ColorTexBBox, 4, FloatBuffer.wrap(colorTexBBox));
+        } else {
+            gcu_ColorTexUnit = null;
+            colorTexBBox = null;
+            gcu_ColorTexBBox = null;
+        }
+
+        FloatUtil.makeIdentity(pmvMatrix02, 0);
+        FloatUtil.makeIdentity(pmvMatrix02, 16);
+        gcu_PMVMatrix02 = new GLUniformData(UniformNames.gcu_PMVMatrix02, 4, 4, FloatBuffer.wrap(pmvMatrix02));
+
+        // Pass 2:
+        gcu_FboTexUnit = new GLUniformData(UniformNames.gcu_FboTexUnit, pass2TexUnit);
+        gcu_FboTexSize = new GLUniformData(UniformNames.gcu_FboTexSize, 2, FloatBuffer.wrap(new float[2]));
+
+        indicesFbo = GLArrayDataServer.createData(3, GL.GL_SHORT, 2, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+        indicesFbo.puts((short) 0); indicesFbo.puts((short) 1); indicesFbo.puts((short) 3);
+        indicesFbo.puts((short) 1); indicesFbo.puts((short) 2); indicesFbo.puts((short) 3);
+        indicesFbo.seal(true);
+
+        gca_FboTexCoordsAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_TEXCOORDS_ATTR_NAME, 2, GL.GL_FLOAT,
+                                                           false, 4, GL.GL_STATIC_DRAW);
+        gca_FboTexCoordsAttr.putf(0); gca_FboTexCoordsAttr.putf(0);
+        gca_FboTexCoordsAttr.putf(0); gca_FboTexCoordsAttr.putf(1);
+        gca_FboTexCoordsAttr.putf(1); gca_FboTexCoordsAttr.putf(1);
+        gca_FboTexCoordsAttr.putf(1); gca_FboTexCoordsAttr.putf(0);
+        gca_FboTexCoordsAttr.seal(true);
+
+        gca_FboVerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.FBO_VERTEX_ATTR_NAME, 3, GL.GL_FLOAT,
+                                                           false, 4, GL.GL_STATIC_DRAW);
+    }
+
+    @Override
+    protected final void clearImpl(final GL2ES2 gl) {
+        if(DEBUG_INSTANCE) {
+            System.err.println("VBORegion2PES2 Clear: " + this);
+            // Thread.dumpStack();
+        }
+        if( null != indicesBuffer ) {
+            indicesBuffer.seal(gl, false);
+            indicesBuffer.rewind();
+        }
+        if( null != gca_VerticesAttr ) {
+            gca_VerticesAttr.seal(gl, false);
+            gca_VerticesAttr.rewind();
+        }
+        if( null != gca_CurveParamsAttr ) {
+            gca_CurveParamsAttr.seal(gl, false);
+            gca_CurveParamsAttr.rewind();
+        }
+        if( null != gca_ColorsAttr ) {
+            gca_ColorsAttr.seal(gl, false);
+            gca_ColorsAttr.rewind();
+        }
+        fboDirty = true;
+    }
+
+    @Override
+    protected final void pushVertex(final float[] coords, final float[] texParams, final float[] rgba) {
+        gca_VerticesAttr.putf(coords[0]);
+        gca_VerticesAttr.putf(coords[1]);
+        gca_VerticesAttr.putf(coords[2]);
+
+        gca_CurveParamsAttr.putf(texParams[0]);
+        gca_CurveParamsAttr.putf(texParams[1]);
+        gca_CurveParamsAttr.putf(texParams[2]);
+
+        if( null != gca_ColorsAttr ) {
+            if( null != rgba ) {
+                gca_ColorsAttr.putf(rgba[0]);
+                gca_ColorsAttr.putf(rgba[1]);
+                gca_ColorsAttr.putf(rgba[2]);
+                gca_ColorsAttr.putf(rgba[3]);
+            } else {
+                throw new IllegalArgumentException("Null color given for COLOR_CHANNEL rendering mode");
+            }
+        }
+    }
+
+    @Override
+    protected final void pushIndex(final int idx) {
+        indicesBuffer.puts((short)idx);
+    }
+
+    @Override
+    protected void updateImpl(final GL2ES2 gl) {
+        // seal buffers
+        indicesBuffer.seal(gl, true);
+        indicesBuffer.enableBuffer(gl, false);
+        gca_CurveParamsAttr.seal(gl, true);
+        gca_CurveParamsAttr.enableBuffer(gl, false);
+        gca_VerticesAttr.seal(gl, true);
+        gca_VerticesAttr.enableBuffer(gl, false);
+        if( null != gca_ColorsAttr ) {
+            gca_ColorsAttr.seal(gl, true);
+            gca_ColorsAttr.enableBuffer(gl, false);
+        }
+        if( null != gcu_ColorTexUnit && colorTexSeq.isTextureAvailable() ) {
+            final TextureSequence.TextureFrame frame = colorTexSeq.getLastTexture();
+            final Texture tex = frame.getTexture();
+            final TextureCoords tc = tex.getImageTexCoords();
+            final float tcSx = 1f / ( tc.right() - tc.left() );
+            colorTexBBox[0] = box.getMinX() * tcSx;
+            colorTexBBox[2] = box.getMaxX() * tcSx;
+            if( tex.getMustFlipVertically() ) {
+                final float tcSy = 1f / ( tc.bottom() - tc.top() );
+                colorTexBBox[1] = box.getMaxY() * tcSy;
+                colorTexBBox[3] = box.getMinY() * tcSy;
+            } else {
+                final float tcSy = 1f / ( tc.top() - tc.bottom() );
+                colorTexBBox[1] = box.getMinY() * tcSy;
+                colorTexBBox[3] = box.getMaxY() * tcSy;
+            }
+        }
+        gca_FboVerticesAttr.seal(gl, false);
+        {
+            final FloatBuffer fb = (FloatBuffer)gca_FboVerticesAttr.getBuffer();
+            fb.put( 2, box.getMinZ());
+            fb.put( 5, box.getMinZ());
+            fb.put( 8, box.getMinZ());
+            fb.put(11, box.getMinZ());
+        }
+        // Pending gca_FboVerticesAttr-seal and fboPMVMatrix-setup, follow fboDirty
+
+        // push data 2 GPU ..
+        indicesFbo.seal(gl, true);
+        indicesFbo.enableBuffer(gl, false);
+
+        fboDirty = true;
+        // the buffers were disabled, since due to real/fbo switching and other vbo usage
+    }
+
+    private final AABBox drawWinBox = new AABBox();
+    private final int[] drawView = new int[] { 0, 0, 0, 0 };
+    private final float[] drawVec4Tmp0 = new float[4];
+    private final float[] drawVec4Tmp1 = new float[4];
+    private final float[] drawVec4Tmp2 = new float[4];
+    private final float[] drawMat4PMv = new float[16];
+    private static final int border = 2; // surrounding border, i.e. width += 2*border, height +=2*border
+
+    @Override
+    protected void drawImpl(final GL2ES2 gl, final RegionRenderer renderer, final int[/*1*/] sampleCount) {
+        if( 0 >= indicesBuffer.getElementCount() ) {
+            if(DEBUG_INSTANCE) {
+                System.err.printf("VBORegion2PVBAAES2.drawImpl: Empty%n");
+            }
+            return; // empty!
+        }
+        if( Float.isInfinite(box.getWidth()) || Float.isInfinite(box.getHeight()) ) {
+            if(DEBUG_INSTANCE) {
+                System.err.printf("VBORegion2PVBAAES2.drawImpl: Inf %s%n", box);
+            }
+            return; // inf
+        }
+        final int vpWidth = renderer.getWidth();
+        final int vpHeight = renderer.getHeight();
+        if(vpWidth <=0 || vpHeight <= 0 || null==sampleCount || sampleCount[0] <= 0){
+            renderRegion(gl);
+        } else {
+            if(0 > maxTexSize[0]) {
+                gl.glGetIntegerv(GL.GL_MAX_TEXTURE_SIZE, maxTexSize, 0);
+            }
+            final RenderState rs = renderer.getRenderState();
+            final float winWidth, winHeight;
+
+            final float ratioObjWinWidth, ratioObjWinHeight;
+            final float diffObjWidth, diffObjHeight;
+            final float diffObjBorderWidth, diffObjBorderHeight;
+            int targetFboWidth, targetFboHeight;
+            {
+                final float diffWinWidth, diffWinHeight;
+                final int targetWinWidth, targetWinHeight;
+
+                // Calculate perspective pixel width/height for FBO,
+                // considering the sampleCount.
+                drawView[2] = vpWidth;
+                drawView[3] = vpHeight;
+
+                renderer.getMatrix().multPMvMatrixf(drawMat4PMv, 0);
+                box.mapToWindow(drawWinBox, drawMat4PMv, drawView, true /* useCenterZ */,
+                                drawVec4Tmp0, drawVec4Tmp1, drawVec4Tmp2);
+
+                winWidth = drawWinBox.getWidth();
+                winHeight = drawWinBox.getHeight();
+                targetWinWidth = (int)Math.ceil(winWidth);
+                targetWinHeight = (int)Math.ceil(winHeight);
+                diffWinWidth = targetWinWidth-winWidth;
+                diffWinHeight = targetWinHeight-winHeight;
+
+                ratioObjWinWidth = box.getWidth() / winWidth;
+                ratioObjWinHeight= box.getHeight() / winHeight;
+                diffObjWidth = diffWinWidth * ratioObjWinWidth;
+                diffObjHeight = diffWinHeight * ratioObjWinHeight;
+                diffObjBorderWidth = border * ratioObjWinWidth;
+                diffObjBorderHeight = border * ratioObjWinHeight;
+
+                targetFboWidth = (targetWinWidth+2*border)*sampleCount[0];
+                targetFboHeight = (targetWinHeight+2*border)*sampleCount[0];
+
+                if( DEBUG_FBO_2 ) {
+                    final float ratioWinWidth, ratioWinHeight;
+                    ratioWinWidth = winWidth/targetWinWidth;
+                    ratioWinHeight = winHeight/targetWinHeight;
+                    final float renderFboWidth, renderFboHeight;
+                    renderFboWidth = (winWidth+2*border)*sampleCount[0];
+                    renderFboHeight = (winHeight+2*border)*sampleCount[0];
+                    final float ratioFboWidth, ratioFboHeight;
+                    ratioFboWidth = renderFboWidth/targetFboWidth;
+                    ratioFboHeight = renderFboHeight/targetFboHeight;
+                    final float diffFboWidth, diffFboHeight;
+                    diffFboWidth = targetFboWidth-renderFboWidth;
+                    diffFboHeight = targetFboHeight-renderFboHeight;
+
+                    System.err.printf("XXX.MinMax obj %s%n", box.toString());
+                    System.err.printf("XXX.MinMax obj d[%.3f, %.3f], r[%f, %f], b[%f, %f]%n",
+                            diffObjWidth, diffObjHeight, ratioObjWinWidth, ratioObjWinWidth, diffObjBorderWidth, diffObjBorderHeight);
+                    System.err.printf("XXX.MinMax win %s%n", drawWinBox.toString());
+                    System.err.printf("XXX.MinMax view[%d, %d] -> win[%.3f, %.3f], i[%d x %d], d[%.3f, %.3f], r[%f, %f]: FBO f[%.3f, %.3f], i[%d x %d], d[%.3f, %.3f], r[%f, %f], samples %d%n",
+                            drawView[2], drawView[3],
+                            winWidth, winHeight, targetWinWidth, targetWinHeight, diffWinWidth,
+                            diffWinHeight, ratioWinWidth, ratioWinHeight,
+                            renderFboWidth, renderFboHeight, targetFboWidth, targetFboHeight,
+                            diffFboWidth, diffFboHeight, ratioFboWidth, ratioFboHeight,
+                            sampleCount[0]);
+                }
+            }
+            if( 0 >= targetFboWidth || 0 >= targetFboHeight ) {
+                // Nothing ..
+                return;
+            }
+            final int deltaFboWidth = Math.abs(targetFboWidth-fboWidth);
+            final int deltaFboHeight = Math.abs(targetFboHeight-fboHeight);
+            final boolean hasDelta = 0!=deltaFboWidth || 0!=deltaFboHeight;
+            if( DEBUG_FBO_2 ) {
+                System.err.printf("XXX.maxDelta: hasDelta %b: %d / %d,  %.3f, %.3f%n",
+                        hasDelta, deltaFboWidth, deltaFboHeight, (float)deltaFboWidth/fboWidth, (float)deltaFboHeight/fboHeight);
+                System.err.printf("XXX.Scale %d * [%f x %f]: %d x %d%n",
+                        sampleCount[0], winWidth, winHeight, targetFboWidth, targetFboHeight);
+            }
+            if( hasDelta || fboDirty || isShapeDirty() || null == fbo ) {
+                final int maxLength = Math.max(targetFboWidth, targetFboHeight);
+                if( maxLength > maxTexSize[0] ) {
+                    if( targetFboWidth > targetFboHeight ) {
+                        sampleCount[0] = (int)Math.floor(maxTexSize[0] / (winWidth+2*border));
+                    } else {
+                        sampleCount[0] = (int)Math.floor(maxTexSize[0] / (winHeight+2*border));
+                    }
+                    final float renderFboWidth, renderFboHeight;
+                    renderFboWidth = (winWidth+2*border)*sampleCount[0];
+                    renderFboHeight = (winWidth+2*border)*sampleCount[0];
+                    targetFboWidth = (int)Math.ceil(renderFboWidth);
+                    targetFboHeight = (int)Math.ceil(renderFboHeight);
+                    if( DEBUG_FBO_1 ) {
+                        System.err.printf("XXX.Rescale (MAX): win[%.3f, %.3f]: FBO f[%.3f, %.3f], i[%d x %d], msaa %d%n",
+                                winWidth, winHeight,
+                                renderFboWidth, renderFboHeight, targetFboWidth, targetFboHeight, sampleCount[0]);
+                    }
+                    if( sampleCount[0] <= 0 ) {
+                        // Last way out!
+                        renderRegion(gl);
+                        return;
+                    }
+                }
+
+                final int newFboWidth, newFboHeight, resizeCase;
+                if( 0 >= RESIZE_BOUNDARY ) {
+                    // Resize w/o optimization
+                    newFboWidth = targetFboWidth;
+                    newFboHeight = targetFboHeight;
+                    resizeCase = 0;
+                } else {
+                    if( 0 >= fboWidth || 0 >= fboHeight || null == fbo ) {
+                        // Case: New FBO
+                        newFboWidth = targetFboWidth;
+                        newFboHeight = targetFboHeight;
+                        resizeCase = 1;
+                    } else if( targetFboWidth > fboWidth || targetFboHeight > fboHeight ) {
+                        // Case: Inscrease FBO Size, add boundary/2 if avail
+                        newFboWidth = ( targetFboWidth + RESIZE_BOUNDARY/2 < maxTexSize[0] ) ? targetFboWidth + RESIZE_BOUNDARY/2 : targetFboWidth;
+                        newFboHeight = ( targetFboHeight+ RESIZE_BOUNDARY/2 < maxTexSize[0] ) ? targetFboHeight + RESIZE_BOUNDARY/2 : targetFboHeight;
+                        resizeCase = 2;
+                    } else if( targetFboWidth < fboWidth && targetFboHeight < fboHeight &&
+                               fboWidth - targetFboWidth < RESIZE_BOUNDARY &&
+                               fboHeight - targetFboHeight < RESIZE_BOUNDARY ) {
+                        // Case: Decreased FBO Size Request within boundary
+                        newFboWidth = fboWidth;
+                        newFboHeight = fboHeight;
+                        resizeCase = 3;
+                    } else {
+                        // Case: Decreased-Size-Beyond-Boundary or No-Resize
+                        newFboWidth = targetFboWidth;
+                        newFboHeight = targetFboHeight;
+                        resizeCase = 4;
+                    }
+                }
+                final int dResizeWidth = newFboWidth - targetFboWidth;
+                final int dResizeHeight = newFboHeight - targetFboHeight;
+                final float diffObjResizeWidth = dResizeWidth*ratioObjWinWidth;
+                final float diffObjResizeHeight = dResizeHeight*ratioObjWinHeight;
+                if( DEBUG_FBO_1 ) {
+                    System.err.printf("XXX.resizeFBO: case %d, has %dx%d > target %dx%d, resize: i[%d x %d], f[%.3f x %.3f] -> %dx%d%n",
+                            resizeCase, fboWidth, fboHeight, targetFboWidth, targetFboHeight,
+                            dResizeWidth, dResizeHeight, diffObjResizeWidth, diffObjResizeHeight,
+                            newFboWidth, newFboHeight);
+                }
+
+                final float minX = box.getMinX()-diffObjBorderWidth;
+                final float minY = box.getMinY()-diffObjBorderHeight;
+                final float maxX = box.getMaxX()+diffObjBorderWidth+diffObjWidth+diffObjResizeWidth;
+                final float maxY = box.getMaxY()+diffObjBorderHeight+diffObjHeight+diffObjResizeHeight;
+                gca_FboVerticesAttr.seal(false);
+                {
+                    final FloatBuffer fb = (FloatBuffer)gca_FboVerticesAttr.getBuffer();
+                    fb.put(0, minX); fb.put( 1, minY);
+                    fb.put(3, minX); fb.put( 4, maxY);
+                    fb.put(6, maxX); fb.put( 7, maxY);
+                    fb.put(9, maxX); fb.put(10, minY);
+                    fb.position(12);
+                }
+                gca_FboVerticesAttr.seal(true);
+                FloatUtil.makeOrtho(pmvMatrix02, 0, true, minX, maxX, minY, maxY, -1, 1);
+                useShaderProgram(gl, renderer, getRenderModes(), true, getQuality(), sampleCount[0]);
+                renderRegion2FBO(gl, rs, targetFboWidth, targetFboHeight, newFboWidth, newFboHeight, vpWidth, vpHeight, sampleCount[0]);
+            } else if( isStateDirty() ) {
+                useShaderProgram(gl, renderer, getRenderModes(), true, getQuality(), sampleCount[0]);
+                renderRegion2FBO(gl, rs, targetFboWidth, targetFboHeight, fboWidth, fboHeight, vpWidth, vpHeight, sampleCount[0]);
+            }
+            useShaderProgram(gl, renderer, getRenderModes(), false, getQuality(), sampleCount[0]);
+            renderFBO(gl, rs, targetFboWidth, targetFboHeight, vpWidth, vpHeight, sampleCount[0]);
+        }
+    }
+
+    private void renderFBO(final GL2ES2 gl, final RenderState rs, final int targetFboWidth, final int targetFboHeight,
+                           final int vpWidth, final int vpHeight, final int sampleCount) {
+        gl.glViewport(0, 0, vpWidth, vpHeight);
+
+        if( rs.isHintMaskSet(RenderState.BITHINT_BLENDING_ENABLED) ) {
+            // RGB is already multiplied w/ alpha via renderRegion2FBO(..)
+            gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
+        }
+
+        gl.glUniform(gcu_FboTexSize);
+
+        gl.glActiveTexture(GL.GL_TEXTURE0 + gcu_FboTexUnit.intValue());
+
+        fbo.use(gl, texA);
+        gca_FboVerticesAttr.enableBuffer(gl, true);
+        gca_FboTexCoordsAttr.enableBuffer(gl, true);
+        indicesFbo.bindBuffer(gl, true); // keeps VBO binding
+
+        gl.glDrawElements(GL.GL_TRIANGLES, indicesFbo.getElementCount() * indicesFbo.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
+
+        indicesFbo.bindBuffer(gl, false);
+        gca_FboTexCoordsAttr.enableBuffer(gl, false);
+        gca_FboVerticesAttr.enableBuffer(gl, false);
+        fbo.unuse(gl);
+
+        // setback: gl.glActiveTexture(currentActiveTextureEngine[0]);
+    }
+
+    private void renderRegion2FBO(final GL2ES2 gl, final RenderState rs,
+                                  final int targetFboWidth, final int targetFboHeight, final int newFboWidth, final int newFboHeight,
+                                  final int vpWidth, final int vpHeight, final int sampleCount) {
+        if( 0 >= targetFboWidth || 0 >= targetFboHeight ) {
+            throw new IllegalArgumentException("fboSize must be greater than 0: "+targetFboWidth+"x"+targetFboHeight);
+        }
+
+        final boolean blendingEnabled = rs.isHintMaskSet(RenderState.BITHINT_BLENDING_ENABLED);
+
+        if(null == fbo) {
+            fboWidth  = newFboWidth;
+            fboHeight  = newFboHeight;
+            final FloatBuffer fboTexSize = (FloatBuffer) gcu_FboTexSize.getBuffer();
+            {
+                fboTexSize.put(0, fboWidth);
+                fboTexSize.put(1, fboHeight);
+            }
+            fbo = new FBObject();
+            fbo.reset(gl, fboWidth, fboHeight);
+            // Shall not use bilinear (GL_LINEAR), due to own VBAA. Result is smooth w/o it now!
+            // FIXME: FXAA requires bilinear filtering!
+            // texA = fbo.attachTexture2D(gl, 0, true, GL.GL_LINEAR, GL.GL_LINEAR, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
+            texA = fbo.attachTexture2D(gl, 0, true, GL.GL_NEAREST, GL.GL_NEAREST, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
+            if( !blendingEnabled ) {
+                // no depth-buffer w/ blending
+                fbo.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
+            }
+            if( DEBUG_FBO_1 ) {
+                System.err.printf("XXX.createFBO: %dx%d%n%s%n", fboWidth, fboHeight, fbo.toString());
+            }
+        } else if( newFboWidth != fboWidth || newFboHeight != fboHeight ) {
+            fbo.reset(gl, newFboWidth, newFboHeight);
+            fbo.bind(gl);
+            if( DEBUG_FBO_1 ) {
+                System.err.printf("XXX.resetFBO: %dx%d -> %dx%d, target %dx%d%n", fboWidth, fboHeight, newFboWidth, newFboHeight, targetFboWidth, targetFboHeight);
+            }
+            fboWidth  = newFboWidth;
+            fboHeight  = newFboHeight;
+            final FloatBuffer fboTexSize = (FloatBuffer) gcu_FboTexSize.getBuffer();
+            {
+                fboTexSize.put(0, fboWidth);
+                fboTexSize.put(1, fboHeight);
+            }
+        } else {
+            fbo.bind(gl);
+        }
+
+        //render texture
+        gl.glViewport(0, 0, fboWidth, fboHeight);
+        if( blendingEnabled ) {
+            gl.glClearColor(0f, 0f, 0f, 0.0f);
+            gl.glClear(GL.GL_COLOR_BUFFER_BIT); // no depth-buffer w/ blending
+            // For already pre-multiplied alpha values, use:
+            // gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
+
+            // Multiply RGB w/ Alpha, preserve alpha for renderFBO(..)
+            gl.glBlendFuncSeparate(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA, GL.GL_ONE, GL.GL_ONE_MINUS_SRC_ALPHA);
+        } else {
+            gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+        }
+
+        renderRegion(gl);
+
+        fbo.unbind(gl);
+        fboDirty = false;
+    }
+
+    private void renderRegion(final GL2ES2 gl) {
+        gl.glUniform(gcu_PMVMatrix02);
+
+        gca_VerticesAttr.enableBuffer(gl, true);
+        gca_CurveParamsAttr.enableBuffer(gl, true);
+        if( null != gca_ColorsAttr ) {
+            gca_ColorsAttr.enableBuffer(gl, true);
+        }
+        indicesBuffer.bindBuffer(gl, true); // keeps VBO binding
+        if( null != gcu_ColorTexUnit && colorTexSeq.isTextureAvailable() ) {
+            final TextureSequence.TextureFrame frame = colorTexSeq.getNextTexture(gl);
+            gl.glActiveTexture(GL.GL_TEXTURE0 + colorTexSeq.getTextureUnit());
+            final Texture tex = frame.getTexture();
+            tex.bind(gl);
+            tex.enable(gl); // nop on core
+            gcu_ColorTexUnit.setData(colorTexSeq.getTextureUnit());
+            gl.glUniform(gcu_ColorTexUnit); // Always update, since program maybe used by multiple regions
+            gl.glUniform(gcu_ColorTexBBox); // Always update, since program maybe used by multiple regions
+            gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
+            tex.disable(gl); // nop on core
+        } else {
+            gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
+        }
+
+        indicesBuffer.bindBuffer(gl, false);
+        if( null != gca_ColorsAttr ) {
+            gca_ColorsAttr.enableBuffer(gl, false);
+        }
+        gca_CurveParamsAttr.enableBuffer(gl, false);
+        gca_VerticesAttr.enableBuffer(gl, false);
+    }
+
+    @Override
+    protected void destroyImpl(final GL2ES2 gl) {
+        if(DEBUG_INSTANCE) {
+            System.err.println("VBORegion2PES2 Destroy: " + this);
+            // Thread.dumpStack();
+        }
+        if(null != fbo) {
+            fbo.destroy(gl);
+            fbo = null;
+            texA = null;
+        }
+        if(null != gca_VerticesAttr) {
+            gca_VerticesAttr.destroy(gl);
+            gca_VerticesAttr = null;
+        }
+        if(null != gca_CurveParamsAttr) {
+            gca_CurveParamsAttr.destroy(gl);
+            gca_CurveParamsAttr = null;
+        }
+        if(null != gca_ColorsAttr) {
+            gca_ColorsAttr.destroy(gl);
+            gca_ColorsAttr = null;
+        }
+        if(null != indicesBuffer) {
+            indicesBuffer.destroy(gl);
+            indicesBuffer = null;
+        }
+
+        if(null != gca_FboVerticesAttr) {
+            gca_FboVerticesAttr.destroy(gl);
+            gca_FboVerticesAttr = null;
+        }
+        if(null != gca_FboTexCoordsAttr) {
+            gca_FboTexCoordsAttr.destroy(gl);
+            gca_FboTexCoordsAttr = null;
+        }
+        if(null != indicesFbo) {
+            indicesFbo.destroy(gl);
+            indicesFbo = null;
+        }
+        spPass1 = null;
+        spPass2 = null;
+    }
+}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
index 9feb18a..46e9918 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/VBORegionSPES2.java
@@ -27,137 +27,258 @@
  */
 package jogamp.graph.curve.opengl;
 
+import java.nio.FloatBuffer;
+
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GLUniformData;
 
 import jogamp.graph.curve.opengl.shader.AttributeNames;
+import jogamp.graph.curve.opengl.shader.UniformNames;
 
+import com.jogamp.graph.curve.Region;
 import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
 import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.geom.Vertex;
-import com.jogamp.graph.geom.Triangle;
 import com.jogamp.opengl.util.GLArrayDataServer;
-import com.jogamp.opengl.util.glsl.ShaderState;
+import com.jogamp.opengl.util.glsl.ShaderProgram;
+import com.jogamp.opengl.util.texture.Texture;
+import com.jogamp.opengl.util.texture.TextureCoords;
+import com.jogamp.opengl.util.texture.TextureSequence;
 
 public class VBORegionSPES2 extends GLRegion {
-    private GLArrayDataServer verticeAttr = null;
-    private GLArrayDataServer texCoordAttr = null;
-    private GLArrayDataServer indices = null;
+    private final RenderState.ProgramLocal rsLocal;
+
+    private GLArrayDataServer gca_VerticesAttr = null;
+    private GLArrayDataServer gca_CurveParamsAttr = null;
+    private GLArrayDataServer gca_ColorsAttr;
+    private GLArrayDataServer indicesBuffer = null;
+    private final GLUniformData gcu_ColorTexUnit;
+    private final float[] colorTexBBox; // x0, y0, x1, y1
+    private final GLUniformData gcu_ColorTexBBox;
+    private ShaderProgram spPass1 = null;
+
+    public VBORegionSPES2(final int renderModes, final TextureSequence colorTexSeq) {
+        super(renderModes, colorTexSeq);
+
+        rsLocal = new RenderState.ProgramLocal();
+
+        final int initialElementCount = 256;
+        indicesBuffer = GLArrayDataServer.createData(3, GL.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+
+        gca_VerticesAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL.GL_FLOAT,
+                                                        false, initialElementCount, GL.GL_STATIC_DRAW);
 
-    protected VBORegionSPES2(int renderModes) {
-        super(renderModes);
+        gca_CurveParamsAttr = GLArrayDataServer.createGLSL(AttributeNames.CURVEPARAMS_ATTR_NAME, 3, GL.GL_FLOAT,
+                                                           false, initialElementCount, GL.GL_STATIC_DRAW);
+
+        if( hasColorChannel() ) {
+            gca_ColorsAttr = GLArrayDataServer.createGLSL(AttributeNames.COLOR_ATTR_NAME, 4, GL.GL_FLOAT,
+                                                          false, initialElementCount, GL.GL_STATIC_DRAW);
+        } else {
+            gca_ColorsAttr = null;
+        }
+        if( hasColorTexture() ) {
+            gcu_ColorTexUnit = new GLUniformData(UniformNames.gcu_ColorTexUnit, colorTexSeq.getTextureUnit());
+            colorTexBBox = new float[4];
+            gcu_ColorTexBBox = new GLUniformData(UniformNames.gcu_ColorTexBBox, 4, FloatBuffer.wrap(colorTexBBox));
+        } else {
+            gcu_ColorTexUnit = null;
+            colorTexBBox = null;
+            gcu_ColorTexBBox = null;
+        }
     }
 
     @Override
-    protected void update(GL2ES2 gl, RenderState rs) {
-        if(!isDirty()) {
-            return;
+    protected final void clearImpl(final GL2ES2 gl) {
+        if(DEBUG_INSTANCE) {
+            System.err.println("VBORegionSPES2 Clear: " + this);
+        }
+        if( null != indicesBuffer ) {
+            indicesBuffer.seal(gl, false);
+            indicesBuffer.rewind();
         }
+        if( null != gca_VerticesAttr ) {
+            gca_VerticesAttr.seal(gl, false);
+            gca_VerticesAttr.rewind();
+        }
+        if( null != gca_CurveParamsAttr ) {
+            gca_CurveParamsAttr.seal(gl, false);
+            gca_CurveParamsAttr.rewind();
+        }
+        if( null != gca_ColorsAttr ) {
+            gca_ColorsAttr.seal(gl, false);
+            gca_ColorsAttr.rewind();
+        }
+    }
 
-        if(null == indices) {
-            final int initialElementCount = 256;
-            final ShaderState st = rs.getShaderState();
+    @Override
+    protected final void pushVertex(final float[] coords, final float[] texParams, final float[] rgba) {
+        gca_VerticesAttr.putf(coords[0]);
+        gca_VerticesAttr.putf(coords[1]);
+        gca_VerticesAttr.putf(coords[2]);
 
-            indices = GLArrayDataServer.createData(3, GL2ES2.GL_SHORT, initialElementCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+        gca_CurveParamsAttr.putf(texParams[0]);
+        gca_CurveParamsAttr.putf(texParams[1]);
+        gca_CurveParamsAttr.putf(texParams[2]);
 
-            verticeAttr = GLArrayDataServer.createGLSL(AttributeNames.VERTEX_ATTR_NAME, 3, GL2ES2.GL_FLOAT,
-                    false, initialElementCount, GL.GL_STATIC_DRAW);
-            st.ownAttribute(verticeAttr, true);
+        if( null != gca_ColorsAttr ) {
+            if( null != rgba ) {
+                gca_ColorsAttr.putf(rgba[0]);
+                gca_ColorsAttr.putf(rgba[1]);
+                gca_ColorsAttr.putf(rgba[2]);
+                gca_ColorsAttr.putf(rgba[3]);
+            } else {
+                throw new IllegalArgumentException("Null color given for COLOR_CHANNEL rendering mode");
+            }
+        }
+    }
 
-            texCoordAttr = GLArrayDataServer.createGLSL(AttributeNames.TEXCOORD_ATTR_NAME, 2, GL2ES2.GL_FLOAT,
-                    false, initialElementCount, GL.GL_STATIC_DRAW);
-            st.ownAttribute(texCoordAttr, true);
+    @Override
+    protected final void pushIndex(final int idx) {
+        indicesBuffer.puts((short)idx);
+    }
 
-            if(DEBUG_INSTANCE) {
-                System.err.println("VBORegionSPES2 Create: " + this);
+    @Override
+    protected void updateImpl(final GL2ES2 gl) {
+        // seal buffers
+        gca_VerticesAttr.seal(gl, true);
+        gca_VerticesAttr.enableBuffer(gl, false);
+        gca_CurveParamsAttr.seal(gl, true);
+        gca_CurveParamsAttr.enableBuffer(gl, false);
+        if( null != gca_ColorsAttr ) {
+            gca_ColorsAttr.seal(gl, true);
+            gca_ColorsAttr.enableBuffer(gl, false);
+        }
+        if( null != gcu_ColorTexUnit && colorTexSeq.isTextureAvailable() ) {
+            final TextureSequence.TextureFrame frame = colorTexSeq.getLastTexture();
+            final Texture tex = frame.getTexture();
+            final TextureCoords tc = tex.getImageTexCoords();
+            final float tcSx = 1f / ( tc.right() - tc.left() );
+            colorTexBBox[0] = box.getMinX() * tcSx;
+            colorTexBBox[2] = box.getMaxX() * tcSx;
+            final float tcSy;
+            if( tex.getMustFlipVertically() ) {
+                tcSy = 1f / ( tc.bottom() - tc.top() );
+                colorTexBBox[1] = box.getMaxY() * tcSy;
+                colorTexBBox[3] = box.getMinY() * tcSy;
+            } else {
+                tcSy = 1f / ( tc.top() - tc.bottom() );
+                colorTexBBox[1] = box.getMinY() * tcSy;
+                colorTexBBox[3] = box.getMaxY() * tcSy;
             }
         }
+        indicesBuffer.seal(gl, true);
+        indicesBuffer.enableBuffer(gl, false);
+        if(DEBUG_INSTANCE) {
+            System.err.println("VBORegionSPES2 idx "+indicesBuffer);
+            System.err.println("VBORegionSPES2 ver "+gca_VerticesAttr);
+            System.err.println("VBORegionSPES2 tex "+gca_CurveParamsAttr);
+        }
+    }
 
-        // process triangles
-        indices.seal(gl, false);
-        indices.rewind();
-        for(int i=0; i<triangles.size(); i++) {
-            final Triangle t = triangles.get(i);
-            final Vertex[] t_vertices = t.getVertices();
+    private static final boolean throwOnError = false; // FIXME
+    /**
+     * <p>
+     * Since multiple {@link Region}s may share one
+     * {@link ShaderProgram}, the uniform data must always be updated.
+     * </p>
+     *
+     * @param gl
+     * @param renderer
+     * @param renderModes
+     * @param quality
+     */
+    public void useShaderProgram(final GL2ES2 gl, final RegionRenderer renderer, final int renderModes, final int quality) {
+        final RenderState rs = renderer.getRenderState();
+        final boolean updateLocGlobal = renderer.useShaderProgram(gl, renderModes, true, quality, 0, colorTexSeq);
+        final ShaderProgram sp = renderer.getRenderState().getShaderProgram();
+        final boolean updateLocLocal = !sp.equals(spPass1);
+        spPass1 = sp;
+        if( DEBUG ) {
+            System.err.println("XXX changedSP.p1 updateLocation loc "+updateLocLocal+" / glob "+updateLocGlobal);
+        }
+        if( updateLocLocal ) {
+            rs.updateAttributeLoc(gl, true, gca_VerticesAttr, throwOnError);
+            rs.updateAttributeLoc(gl, true, gca_CurveParamsAttr, throwOnError);
+            if( null != gca_ColorsAttr ) {
+                rs.updateAttributeLoc(gl, true, gca_ColorsAttr, throwOnError);
+            }
+        }
+        rsLocal.update(gl, rs, updateLocLocal, renderModes, true, throwOnError);
+        if( null != gcu_ColorTexUnit ) {
+            rs.updateUniformLoc(gl, updateLocLocal, gcu_ColorTexUnit, throwOnError);
+            rs.updateUniformLoc(gl, updateLocLocal, gcu_ColorTexBBox, throwOnError);
+        }
+    }
 
-            if(t_vertices[0].getId() == Integer.MAX_VALUE){
-                t_vertices[0].setId(numVertices++);
-                t_vertices[1].setId(numVertices++);
-                t_vertices[2].setId(numVertices++);
 
-                vertices.add(t_vertices[0]);
-                vertices.add(t_vertices[1]);
-                vertices.add(t_vertices[2]);
+    @Override
+    protected void drawImpl(final GL2ES2 gl, final RegionRenderer renderer, final int[/*1*/] sampleCount) {
+        final int renderModes = getRenderModes();
+        useShaderProgram(gl, renderer, renderModes, getQuality());
 
-                indices.puts((short) t_vertices[0].getId());
-                indices.puts((short) t_vertices[1].getId());
-                indices.puts((short) t_vertices[2].getId());
-            } else {
-                indices.puts((short) t_vertices[0].getId());
-                indices.puts((short) t_vertices[1].getId());
-                indices.puts((short) t_vertices[2].getId());
+        if( 0 >= indicesBuffer.getElementCount() ) {
+            if(DEBUG_INSTANCE) {
+                System.err.printf("VBORegionSPES2.drawImpl: Empty%n");
             }
+            return; // empty!
         }
-        indices.seal(gl, true);
-        indices.enableBuffer(gl, false);
-
-        // process vertices and update bbox
-        box.reset();
-        verticeAttr.seal(gl, false);
-        verticeAttr.rewind();
-        texCoordAttr.seal(gl, false);
-        texCoordAttr.rewind();
-        for(int i=0; i<vertices.size(); i++) {
-            final Vertex v = vertices.get(i);
-            verticeAttr.putf(v.getX());
-            verticeAttr.putf(v.getY());
-            verticeAttr.putf(v.getZ());
-            box.resize(v.getX(), v.getY(), v.getZ());
-
-            final float[] tex = v.getTexCoord();
-            texCoordAttr.putf(tex[0]);
-            texCoordAttr.putf(tex[1]);
-        }
-        verticeAttr.seal(gl, true);
-        verticeAttr.enableBuffer(gl, false);
-        texCoordAttr.seal(gl, true);
-        texCoordAttr.enableBuffer(gl, false);
-
-        setDirty(false);
-    }
+        gca_VerticesAttr.enableBuffer(gl, true);
+        gca_CurveParamsAttr.enableBuffer(gl, true);
+        if( null != gca_ColorsAttr ) {
+            gca_ColorsAttr.enableBuffer(gl, true);
+        }
+        indicesBuffer.bindBuffer(gl, true); // keeps VBO binding
 
-    @Override
-    protected void drawImpl(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int[/*1*/] texWidth) {
-        verticeAttr.enableBuffer(gl, true);
-        texCoordAttr.enableBuffer(gl, true);
-        indices.bindBuffer(gl, true); // keeps VBO binding
+        if( renderer.getRenderState().isHintMaskSet(RenderState.BITHINT_BLENDING_ENABLED) ) {
+            gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);
+        }
 
-        gl.glDrawElements(GL2ES2.GL_TRIANGLES, indices.getElementCount() * indices.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+        if( null != gcu_ColorTexUnit && colorTexSeq.isTextureAvailable() ) {
+            final TextureSequence.TextureFrame frame = colorTexSeq.getNextTexture(gl);
+            gl.glActiveTexture(GL.GL_TEXTURE0 + colorTexSeq.getTextureUnit());
+            final Texture tex = frame.getTexture();
+            tex.bind(gl);
+            tex.enable(gl); // nop on core
+            gcu_ColorTexUnit.setData(colorTexSeq.getTextureUnit());
+            gl.glUniform(gcu_ColorTexUnit); // Always update, since program maybe used by multiple regions
+            gl.glUniform(gcu_ColorTexBBox); // Always update, since program maybe used by multiple regions
+            gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
+            tex.disable(gl); // nop on core
+        } else {
+            gl.glDrawElements(GL.GL_TRIANGLES, indicesBuffer.getElementCount() * indicesBuffer.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
+        }
 
-        indices.bindBuffer(gl, false);
-        texCoordAttr.enableBuffer(gl, false);
-        verticeAttr.enableBuffer(gl, false);
+        indicesBuffer.bindBuffer(gl, false);
+        if( null != gca_ColorsAttr ) {
+            gca_ColorsAttr.enableBuffer(gl, false);
+        }
+        gca_CurveParamsAttr.enableBuffer(gl, false);
+        gca_VerticesAttr.enableBuffer(gl, false);
     }
 
     @Override
-    public final void destroy(GL2ES2 gl, RenderState rs) {
+    protected void destroyImpl(final GL2ES2 gl) {
         if(DEBUG_INSTANCE) {
             System.err.println("VBORegionSPES2 Destroy: " + this);
         }
-        final ShaderState st = rs.getShaderState();
-        if(null != verticeAttr) {
-            st.ownAttribute(verticeAttr, false);
-            verticeAttr.destroy(gl);
-            verticeAttr = null;
+        if(null != gca_VerticesAttr) {
+            gca_VerticesAttr.destroy(gl);
+            gca_VerticesAttr = null;
+        }
+        if(null != gca_CurveParamsAttr) {
+            gca_CurveParamsAttr.destroy(gl);
+            gca_CurveParamsAttr = null;
         }
-        if(null != texCoordAttr) {
-            st.ownAttribute(texCoordAttr, false);
-            texCoordAttr.destroy(gl);
-            texCoordAttr = null;
+        if(null != gca_ColorsAttr) {
+            gca_ColorsAttr.destroy(gl);
+            gca_ColorsAttr = null;
         }
-        if(null != indices) {
-            indices.destroy(gl);
-            indices = null;
+        if(null != indicesBuffer) {
+            indicesBuffer.destroy(gl);
+            indicesBuffer = null;
         }
+        spPass1 = null;
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/AttributeNames.java b/src/jogl/classes/jogamp/graph/curve/opengl/shader/AttributeNames.java
index b466617..dff5366 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/AttributeNames.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/AttributeNames.java
@@ -28,18 +28,23 @@
 package jogamp.graph.curve.opengl.shader;
 
 public class AttributeNames {
-    /** The vertices index in an OGL object
+    /**
+     * The vertices index in an OGL object
      */
-    public static final int VERTEX_ATTR_IDX = 0; // FIXME: AMD needs this to be location 0 ? hu ?
     public static final String VERTEX_ATTR_NAME = "gca_Vertices";
 
-    /** The Texture Coord index in an OGL object
+    /**
+     * The Texture Coord index in an OGL object
      */
-    public static final int TEXCOORD_ATTR_IDX = 1;
-    public static final String TEXCOORD_ATTR_NAME = "gca_TexCoords";
+    public static final String CURVEPARAMS_ATTR_NAME = "gca_CurveParams";
 
-    /** The color index in an OGL object
+    /**
+     * The color index in an OGL object
      */
-    public static final int COLOR_ATTR_IDX = 2;
     public static final String COLOR_ATTR_NAME = "gca_Colors";
+
+    public static final String FBO_VERTEX_ATTR_NAME = "gca_FboVertices";
+
+    public static final String FBO_TEXCOORDS_ATTR_NAME = "gca_FboTexCoords";
+
 }
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/UniformNames.java b/src/jogl/classes/jogamp/graph/curve/opengl/shader/UniformNames.java
index ce23aad..7244851 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/UniformNames.java
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/UniformNames.java
@@ -1,10 +1,13 @@
 package jogamp.graph.curve.opengl.shader;
 
 public class UniformNames {
-    public static final String gcu_PMVMatrix = "gcu_PMVMatrix"; // gcu_PMVMatrix[3]; // P, Mv, and Mvi
+    public static final String gcu_PMVMatrix01 = "gcu_PMVMatrix01"; // gcu_PMVMatrix[3]; // P, Mv, and Mvi
     public static final String gcu_ColorStatic = "gcu_ColorStatic";
-    public static final String gcu_Alpha = "gcu_Alpha";
     public static final String gcu_Weight = "gcu_Weight";
-    public static final String gcu_TextureUnit = "gcu_TextureUnit";
-    public static final String gcu_TextureSize = "gcu_TextureSize";
+    public static final String gcu_ColorTexUnit = "gcu_ColorTexUnit";
+    public static final String gcu_ColorTexBBox = "gcu_ColorTexBBox";
+
+    public static final String gcu_PMVMatrix02 = "gcu_PMVMatrix02"; // gcu_PMVMatrix[3]; // P, Mv, and Mvi
+    public static final String gcu_FboTexUnit = "gcu_FboTexUnit";
+    public static final String gcu_FboTexSize = "gcu_FboTexSize";
 }
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/attributes.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/attributes.glsl
index 108247c..b8c68a9 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/attributes.glsl
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/attributes.glsl
@@ -4,8 +4,27 @@
 
 // attribute vec3    gca_Vertices;
 attribute vec4    gca_Vertices;
-attribute vec2    gca_TexCoords;
-//attribute vec4    gca_Colors;
+
+/**
+ * CDTriangulator2D.extractBoundaryTriangles(..):
+ *     AA line (exp)   : z > 0
+ *     line            : x ==   0, y == 0
+ *     hole or holeLike: 0 > y
+ *     !hole           : 0 < y 
+ *      
+ *     0   == gcv_CurveParams.x : vertex-0 of triangle
+ *     0.5 == gcv_CurveParams.x : vertex-1 of triangle
+ *     1   == gcv_CurveParams.x : vertex-2 of triangle
+ */
+attribute vec3    gca_CurveParams;
+
+attribute vec4    gca_FboVertices;
+attribute vec2    gca_FboTexCoords;
+
+#ifdef USE_COLOR_CHANNEL
+    attribute vec4    gca_Colors;
+#endif
+
 //attribute vec3    gca_Normals;
 
 #endif // attributes_glsl
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-1pass-weight.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-1pass-weight.fp
deleted file mode 100644
index 7643dab..0000000
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-1pass-weight.fp
+++ /dev/null
@@ -1,55 +0,0 @@
-//Copyright 2010 JogAmp Community. All rights reserved.
- 
-//
-// 1-pass shader w/ weight
-//
-
-#if __VERSION__ >= 130
-  #define varying in
-  out vec4 mgl_FragColor;
-#else
-  #define mgl_FragColor gl_FragColor
-#endif
-
-#include uniforms.glsl
-#include varyings.glsl
-
-void main (void)
-{
-    vec2 rtex = vec2(abs(gcv_TexCoord.x),abs(gcv_TexCoord.y));
-    vec3 c = gcu_ColorStatic.rgb;
-    
-    float alpha = 0.0;
-    
-    if((gcv_TexCoord.x == 0.0) && (gcv_TexCoord.y == 0.0)) {
-         alpha = gcu_Alpha;
-    }
-    else if ((gcv_TexCoord.x > 0.0) && (rtex.y > 0.0 || rtex.x == 1.0)) {
-        rtex.y -= 0.1;
-        
-        if(rtex.y < 0.0 && gcv_TexCoord.y < 0.0) {
-            // discard; // freezes NV tegra2 compiler
-            alpha = 0.0;
-        } else {
-            rtex.y = max(rtex.y, 0.0);
-
-            vec2 dtx = dFdx(rtex);
-            vec2 dty = dFdy(rtex);
-              
-            float w = gcu_Weight;
-            float pd = ((2.0 - (2.0*w))*rtex.x*rtex.x) + 2.0*(w-1.0)*rtex.x + 1.0;
-            float position = rtex.y - ((w*rtex.x*(1.0 - rtex.x))/pd);
-
-            float aph = 2.0 - 2.0*w;
-            
-            float gd = (aph*rtex.x*rtex.x + 2.0*rtex.x + 1.0)*(aph*rtex.x*rtex.x + 2.0*rtex.x + 1.0);
-            vec2 f = vec2((dtx.y - (w*dtx.x*(1.0 - 2.0*rtex.x))/gd), (dty.y - (w*dty.x*(1.0 - 2.0*rtex.x))/gd));
-
-            // FIXME: will we ever set gcu_Alpha != 1.0 ? If not, a==alpha!
-            float a = clamp(0.5 - ( position/length(f) ) * sign(gcv_TexCoord.y), 0.0, 1.0);
-            alpha = gcu_Alpha * a;
-        }
-    }
-
-    mgl_FragColor = vec4(c, alpha);
-}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-1pass.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-1pass.fp
deleted file mode 100644
index e12eef4..0000000
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-1pass.fp
+++ /dev/null
@@ -1,49 +0,0 @@
-//Copyright 2010 JogAmp Community. All rights reserved.
-
-//
-// 1-pass shader w/o weight
-//
-
-#if __VERSION__ >= 130
-  #define varying in
-  out vec4 mgl_FragColor;
-#else
-  #define mgl_FragColor gl_FragColor
-#endif
-
-#include uniforms.glsl
-#include varyings.glsl
-
-void main (void)
-{
-    vec2 rtex = vec2(abs(gcv_TexCoord.x),abs(gcv_TexCoord.y));
-    vec3 c = gcu_ColorStatic.rgb;
-    
-    float alpha = 0.0;
-    
-    if((gcv_TexCoord.x == 0.0) && (gcv_TexCoord.y == 0.0)) {
-         alpha = gcu_Alpha;
-    }
-    else if ((gcv_TexCoord.x > 0.0) && (rtex.y > 0.0 || rtex.x == 1.0)) {
-        rtex.y -= 0.1;
-          
-        if(rtex.y < 0.0 && gcv_TexCoord.y < 0.0) {
-            // discard; // freezes NV tegra2 compiler
-            alpha = 0.0;
-        } else {
-            rtex.y = max(rtex.y, 0.0);
-
-            vec2 dtx = dFdx(rtex);
-            vec2 dty = dFdy(rtex);
-              
-            vec2 f = vec2((dtx.y - dtx.x + 2.0*rtex.x*dtx.x), (dty.y - dty.x + 2.0*rtex.x*dty.x));
-            float position = rtex.y - (rtex.x * (1.0 - rtex.x));
-
-            // FIXME: will we ever set gcu_Alpha != 1.0 ? If not, a==alpha!
-            float a = clamp(0.5 - ( position/length(f) ) * sign(gcv_TexCoord.y), 0.0, 1.0);
-            alpha = gcu_Alpha * a;
-        }
-    }
-    
-    mgl_FragColor = vec4(c, alpha);
-}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass-weight.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass-weight.fp
deleted file mode 100644
index fb71abd..0000000
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass-weight.fp
+++ /dev/null
@@ -1,97 +0,0 @@
-//Copyright 2010 JogAmp Community. All rights reserved.
- 
-//
-// 2-pass shader w/ weight
-//
-
-#if __VERSION__ >= 130
-  #define varying in
-  out vec4 mgl_FragColor;
-  #define texture2D texture
-#else
-  #define mgl_FragColor gl_FragColor
-#endif
-
-#include uniforms.glsl
-#include varyings.glsl
-
-const vec4 tex_weights = vec4(0.075, 0.06, 0.045, 0.025);
-
-void main (void)
-{
-    vec2 rtex = vec2(abs(gcv_TexCoord.x),abs(gcv_TexCoord.y));
-    vec3 c = gcu_ColorStatic.rgb;
-    
-    float alpha = 0.0;
-    
-    if((gcv_TexCoord.x == 0.0) && (gcv_TexCoord.y == 0.0)) {
-         alpha = gcu_Alpha;
-    }
-    else if((gcv_TexCoord.x >= 5.0)) {
-        vec2 dfx = dFdx(gcv_TexCoord);
-        vec2 dfy = dFdy(gcv_TexCoord);
-        
-        vec2 size = 1.0/gcu_TextureSize;
-
-        rtex -= 5.0;
-        vec4 t = texture2D(gcu_TextureUnit, rtex)* 0.18;
-
-        t += texture2D(gcu_TextureUnit, rtex + size*(vec2(1, 0)))*tex_weights.x;
-        t += texture2D(gcu_TextureUnit, rtex - size*(vec2(1, 0)))*tex_weights.x;
-        t += texture2D(gcu_TextureUnit, rtex + size*(vec2(0, 1)))*tex_weights.x;
-        t += texture2D(gcu_TextureUnit, rtex - size*(vec2(0, 1)))*tex_weights.x;
-        
-        t += texture2D(gcu_TextureUnit, rtex + 2.0*size*(vec2(1, 0)))*tex_weights.y;
-        t += texture2D(gcu_TextureUnit, rtex - 2.0*size*(vec2(1, 0)))*tex_weights.y;
-        t += texture2D(gcu_TextureUnit, rtex + 2.0*size*(vec2(0, 1)))*tex_weights.y; 
-        t += texture2D(gcu_TextureUnit, rtex - 2.0*size*(vec2(0, 1)))*tex_weights.y;
-        
-        t += texture2D(gcu_TextureUnit, rtex + 3.0*size*(vec2(1, 0)))*tex_weights.z;
-        t += texture2D(gcu_TextureUnit, rtex - 3.0*size*(vec2(1, 0)))*tex_weights.z;
-        t += texture2D(gcu_TextureUnit, rtex + 3.0*size*(vec2(0, 1)))*tex_weights.z;
-        t += texture2D(gcu_TextureUnit, rtex - 3.0*size*(vec2(0, 1)))*tex_weights.z;
-        
-        t += texture2D(gcu_TextureUnit, rtex + 4.0*size*(vec2(1, 0)))*tex_weights.w;
-        t += texture2D(gcu_TextureUnit, rtex - 4.0*size*(vec2(1, 0)))*tex_weights.w;
-        t += texture2D(gcu_TextureUnit, rtex + 4.0*size*(vec2(0, 1)))*tex_weights.w;
-        t += texture2D(gcu_TextureUnit, rtex - 4.0*size*(vec2(0, 1)))*tex_weights.w;
-        
-        #if 0
-        if(t.w == 0.0) {
-            discard; // discard freezes NV tegra2 compiler
-        }
-        #endif
-        
-        c = t.xyz;
-        alpha = gcu_Alpha * t.w;
-    }
-    ///////////////////////////////////////////////////////////
-    else if ((gcv_TexCoord.x > 0.0) && (rtex.y > 0.0 || rtex.x == 1.0)) {
-        rtex.y -= 0.1;
-        
-        if(rtex.y < 0.0 && gcv_TexCoord.y < 0.0) {
-            // discard; // freezes NV tegra2 compiler
-            alpha = 0.0;
-        } else {
-            rtex.y = max(rtex.y, 0.0);
-
-            vec2 dtx = dFdx(rtex);
-            vec2 dty = dFdy(rtex);
-              
-            float w = gcu_Weight;
-            float pd = ((2.0 - (2.0*w))*rtex.x*rtex.x) + 2.0*(w-1.0)*rtex.x + 1.0;
-            float position = rtex.y - ((w*rtex.x*(1.0 - rtex.x))/pd);
-
-            float aph = 2.0 - 2.0*w;
-            
-            float gd = (aph*rtex.x*rtex.x + 2.0*rtex.x + 1.0)*(aph*rtex.x*rtex.x + 2.0*rtex.x + 1.0);
-            vec2 f = vec2((dtx.y - (w*dtx.x*(1.0 - 2.0*rtex.x))/gd), (dty.y - (w*dty.x*(1.0 - 2.0*rtex.x))/gd));
-
-            // FIXME: will we ever set gcu_Alpha != 1.0 ? If not, a==alpha!
-            float a = clamp(0.5 - ( position/length(f) ) * sign(gcv_TexCoord.y), 0.0, 1.0);
-            alpha = gcu_Alpha * a;
-        }
-    }
-
-    mgl_FragColor = vec4(c, alpha);
-}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass.fp
deleted file mode 100644
index 8e5600d..0000000
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-2pass.fp
+++ /dev/null
@@ -1,91 +0,0 @@
-//Copyright 2010 JogAmp Community. All rights reserved.
-
-//
-// 2-pass shader w/o weight
-//
-
-#if __VERSION__ >= 130
-  #define varying in
-  out vec4 mgl_FragColor;
-  #define texture2D texture
-#else
-  #define mgl_FragColor gl_FragColor
-#endif
-
-#include uniforms.glsl
-#include varyings.glsl
-
-const vec4 tex_weights = vec4(0.075, 0.06, 0.045, 0.025);
-
-void main (void)
-{
-    vec2 rtex = vec2(abs(gcv_TexCoord.x),abs(gcv_TexCoord.y));
-    vec3 c = gcu_ColorStatic.rgb;
-
-    float alpha = 0.0;
-    float enable = 1.0;
-    
-    if((gcv_TexCoord.x == 0.0) && (gcv_TexCoord.y == 0.0)) {
-         alpha = gcu_Alpha;
-    }
-    else if((gcv_TexCoord.x >= 5.0)) {
-        vec2 dfx = dFdx(gcv_TexCoord);
-        vec2 dfy = dFdy(gcv_TexCoord);
-        
-        vec2 size = 1.0/gcu_TextureSize;
-
-        rtex -= 5.0;
-        vec4 t = texture2D(gcu_TextureUnit, rtex)* 0.18;
-
-        t += texture2D(gcu_TextureUnit, rtex + size*(vec2(1, 0)))*tex_weights.x;
-        t += texture2D(gcu_TextureUnit, rtex - size*(vec2(1, 0)))*tex_weights.x;
-        t += texture2D(gcu_TextureUnit, rtex + size*(vec2(0, 1)))*tex_weights.x;
-        t += texture2D(gcu_TextureUnit, rtex - size*(vec2(0, 1)))*tex_weights.x;
-        
-        t += texture2D(gcu_TextureUnit, rtex + 2.0*size*(vec2(1, 0)))*tex_weights.y;
-        t += texture2D(gcu_TextureUnit, rtex - 2.0*size*(vec2(1, 0)))*tex_weights.y;
-        t += texture2D(gcu_TextureUnit, rtex + 2.0*size*(vec2(0, 1)))*tex_weights.y; 
-        t += texture2D(gcu_TextureUnit, rtex - 2.0*size*(vec2(0, 1)))*tex_weights.y;
-        
-        t += texture2D(gcu_TextureUnit, rtex + 3.0*size*(vec2(1, 0)))*tex_weights.z;
-        t += texture2D(gcu_TextureUnit, rtex - 3.0*size*(vec2(1, 0)))*tex_weights.z;
-        t += texture2D(gcu_TextureUnit, rtex + 3.0*size*(vec2(0, 1)))*tex_weights.z;
-        t += texture2D(gcu_TextureUnit, rtex - 3.0*size*(vec2(0, 1)))*tex_weights.z;
-        
-        t += texture2D(gcu_TextureUnit, rtex + 4.0*size*(vec2(1, 0)))*tex_weights.w;
-        t += texture2D(gcu_TextureUnit, rtex - 4.0*size*(vec2(1, 0)))*tex_weights.w;
-        t += texture2D(gcu_TextureUnit, rtex + 4.0*size*(vec2(0, 1)))*tex_weights.w;
-        t += texture2D(gcu_TextureUnit, rtex - 4.0*size*(vec2(0, 1)))*tex_weights.w;
-        
-        #if 0
-        if(t.w == 0.0){
-            discard; // discard freezes NV tegra2 compiler
-        }
-        #endif
-        
-        c = t.xyz;
-        alpha = gcu_Alpha * t.w;
-    }
-    else if ((gcv_TexCoord.x > 0.0) && (rtex.y > 0.0 || rtex.x == 1.0)) {
-        rtex.y -= 0.1;
-          
-        if(rtex.y < 0.0 && gcv_TexCoord.y < 0.0) {
-            // discard; // freezes NV tegra2 compiler
-            alpha = 0.0;
-        } else {
-            rtex.y = max(rtex.y, 0.0);
-
-            vec2 dtx = dFdx(rtex);
-            vec2 dty = dFdy(rtex);
-              
-            vec2 f = vec2((dtx.y - dtx.x + 2.0*rtex.x*dtx.x), (dty.y - dty.x + 2.0*rtex.x*dty.x));
-            float position = rtex.y - (rtex.x * (1.0 - rtex.x));
-
-            // FIXME: will we ever set gcu_Alpha != 1.0 ? If not, a==alpha!
-            float a = clamp(0.5 - ( position/length(f) ) * sign(gcv_TexCoord.y), 0.0, 1.0);
-            alpha = gcu_Alpha * a;
-        }
-    }
-
-    mgl_FragColor = vec4(c, alpha);
-}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_lineAA.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_lineAA.glsl
new file mode 100644
index 0000000..79b3dd6
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_lineAA.glsl
@@ -0,0 +1,19 @@
+
+    // if( gcv_CurveParam.x == 10.0 && gcv_CurveParam.y == 10.0 ) {
+    if( gcv_CurveParam.z > 0.0 ) {
+         // pass-1: AA Lines
+         #if 1
+             // float dist = sqrt( gcv_CurveParam.x*gcv_CurveParam.x + gcv_CurveParam.y*gcv_CurveParam.y ); // magnitude
+             float dist = sqrt( gcv_CurveParam.y*gcv_CurveParam.y ); // magnitude
+             // float a = 1.0 - smoothstep (gcv_CurveParam.y-gcv_CurveParam.z, gcv_CurveParam.y, dist);
+             float r = gcv_CurveParam.x/3.0;
+             float wa = gcv_CurveParam.x+r;
+             float waHalf = wa/2.0;
+             float a = 1.0 - smoothstep (waHalf-2.0*r, waHalf, dist);
+             // mgl_FragColor = vec4(gcu_ColorStatic.rgb, gcu_ColorStatic.a * a);
+             mgl_FragColor = vec4(0, 0, 1.0, gcu_ColorStatic.a * a);
+         #else 
+             mgl_FragColor = vec4(0, 0, 1.0, 1.0);
+         #endif 
+    } else 
+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_simple.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_simple.glsl
new file mode 100644
index 0000000..4472424
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_simple.glsl
@@ -0,0 +1,36 @@
+
+    if( gcv_CurveParam.x == 0.0 && gcv_CurveParam.y == 0.0 ) {
+        // pass-1: Lines
+#if defined(USE_COLOR_TEXTURE) && defined(USE_COLOR_CHANNEL)
+        mgl_FragColor = gcuTexture2D(gcu_ColorTexUnit, gcv_ColorTexCoord.st) * gcv_Color * gcu_ColorStatic;
+#elif defined(USE_COLOR_TEXTURE)
+        mgl_FragColor = gcuTexture2D(gcu_ColorTexUnit, gcv_ColorTexCoord.st) * gcu_ColorStatic;
+#elif defined(USE_COLOR_CHANNEL)
+        mgl_FragColor = gcv_Color * gcu_ColorStatic;
+#else
+        mgl_FragColor = gcu_ColorStatic;
+#endif
+    } else {
+        // pass-1: curves
+        vec2 rtex = vec2( abs(gcv_CurveParam.x), abs(gcv_CurveParam.y) - 0.1 );
+
+        vec2 dtx = dFdx(rtex);
+        vec2 dty = dFdy(rtex);
+          
+        vec2 f = vec2((dtx.y - dtx.x + 2.0*rtex.x*dtx.x), (dty.y - dty.x + 2.0*rtex.x*dty.x));
+        float position = rtex.y - (rtex.x * (1.0 - rtex.x));
+
+        float a = clamp(0.5 - ( position/length(f) ) * sign(gcv_CurveParam.y), 0.0, 1.0);
+#if defined(USE_COLOR_TEXTURE) && defined(USE_COLOR_CHANNEL)
+        vec4 t = gcuTexture2D(gcu_ColorTexUnit, gcv_ColorTexCoord.st);
+        mgl_FragColor = vec4(t.rgb * gcv_Color.rgb * gcu_ColorStatic.rgb, t.a * gcv_Color.a * gcu_ColorStatic.a * a);
+#elif defined(USE_COLOR_TEXTURE)
+        vec4 t = gcuTexture2D(gcu_ColorTexUnit, gcv_ColorTexCoord.st);
+        mgl_FragColor = vec4(t.rgb * gcu_ColorStatic.rgb, t.a * gcu_ColorStatic.a * a);
+#elif defined(USE_COLOR_CHANNEL)
+        mgl_FragColor = vec4(gcv_Color.rgb * gcu_ColorStatic.rgb, gcv_Color.a * gcu_ColorStatic.a * a);
+#else
+        mgl_FragColor = vec4(gcu_ColorStatic.rgb, gcu_ColorStatic.a * a);
+#endif
+    }
+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_simple.orig.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_simple.orig.glsl
new file mode 100644
index 0000000..fa26083
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_simple.orig.glsl
@@ -0,0 +1,47 @@
+
+    vec2 rtex = vec2( abs(gcv_CurveParam.x), abs(gcv_CurveParam.y) );
+
+    if( gcv_CurveParam.x == 0.0 && gcv_CurveParam.y == 0.0 ) {
+        // pass-1: Lines
+#if defined(USE_COLOR_TEXTURE) && defined(USE_COLOR_CHANNEL)
+        mgl_FragColor = gcuTexture2D(gcu_ColorTexUnit, gcv_ColorTexCoord.st) * gcv_Color * gcu_ColorStatic;
+#elif defined(USE_COLOR_TEXTURE)
+        mgl_FragColor = gcuTexture2D(gcu_ColorTexUnit, gcv_ColorTexCoord.st) * gcu_ColorStatic;
+#elif defined(USE_COLOR_CHANNEL)
+        mgl_FragColor = gcv_Color * gcu_ColorStatic;
+#else
+        mgl_FragColor = gcu_ColorStatic;
+#endif
+    } else if ( gcv_CurveParam.x > 0.0 && ( rtex.y > 0.0 || rtex.x == 1.0 ) ) {
+        // pass-1: curves
+        rtex.y -= 0.1;
+
+        if(rtex.y < 0.0 && gcv_CurveParam.y < 0.0) {
+            // discard; // freezes NV tegra2 compiler
+            mgl_FragColor = vec4(0);
+        } else {
+            rtex.y = max(rtex.y, 0.0); // always >= 0 
+
+            vec2 dtx = dFdx(rtex);
+            vec2 dty = dFdy(rtex);
+              
+            vec2 f = vec2((dtx.y - dtx.x + 2.0*rtex.x*dtx.x), (dty.y - dty.x + 2.0*rtex.x*dty.x));
+            float position = rtex.y - (rtex.x * (1.0 - rtex.x));
+
+            float a = clamp(0.5 - ( position/length(f) ) * sign(gcv_CurveParam.y), 0.0, 1.0);
+#if defined(USE_COLOR_TEXTURE) && defined(USE_COLOR_CHANNEL)
+            vec4 t = gcuTexture2D(gcu_ColorTexUnit, gcv_ColorTexCoord.st);
+            mgl_FragColor = vec4(t.rgb * gcv_Color.rgb * gcu_ColorStatic.rgb, t.a * gcv_Color.a * gcu_ColorStatic.a * a);
+#elif defined(USE_COLOR_TEXTURE)
+            vec4 t = gcuTexture2D(gcu_ColorTexUnit, gcv_ColorTexCoord.st);
+            mgl_FragColor = vec4(t.rgb * gcu_ColorStatic.rgb, t.a * gcu_ColorStatic.a * a);
+#elif defined(USE_COLOR_CHANNEL)
+            mgl_FragColor = vec4(gcv_Color.rgb * gcu_ColorStatic.rgb, gcv_Color.a * gcu_ColorStatic.a * a);
+#else
+            mgl_FragColor = vec4(gcu_ColorStatic.rgb, gcu_ColorStatic.a * a);
+#endif
+        }
+    } else {
+        mgl_FragColor = vec4(0);
+    }
+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_weight.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_weight.glsl
new file mode 100644
index 0000000..1620a95
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1-curve_weight.glsl
@@ -0,0 +1,32 @@
+
+    if( gcv_CurveParam.x == 0.0 && gcv_CurveParam.y == 0.0 ) {
+        // pass-1: Lines
+#ifdef USE_COLOR_CHANNEL
+        mgl_FragColor = gcv_Color * gcu_ColorStatic;
+#else
+        mgl_FragColor = gcu_ColorStatic;
+#endif
+    } else {
+        // pass-1: curves
+        vec2 rtex = vec2( abs(gcv_CurveParam.x), abs(gcv_CurveParam.y) - 0.1 );
+
+        vec2 dtx = dFdx(rtex);
+        vec2 dty = dFdy(rtex);
+          
+        float w = gcu_Weight;
+        float pd = ((2.0 - (2.0*w))*rtex.x*rtex.x) + 2.0*(w-1.0)*rtex.x + 1.0;
+        float position = rtex.y - ((w*rtex.x*(1.0 - rtex.x))/pd);
+
+        float aph = 2.0 - 2.0*w;
+        
+        float gd = (aph*rtex.x*rtex.x + 2.0*rtex.x + 1.0)*(aph*rtex.x*rtex.x + 2.0*rtex.x + 1.0);
+        vec2 f = vec2((dtx.y - (w*dtx.x*(1.0 - 2.0*rtex.x))/gd), (dty.y - (w*dty.x*(1.0 - 2.0*rtex.x))/gd));
+
+        float a = clamp(0.5 - ( position/length(f) ) * sign(gcv_CurveParam.y), 0.0, 1.0);
+#ifdef USE_COLOR_CHANNEL
+        mgl_FragColor = vec4(gcv_Color.rgb * gcu_ColorStatic.rgb, gcv_Color.a * gcu_ColorStatic.a * a);
+#else
+        mgl_FragColor = vec4(gcu_ColorStatic.rgb, gcu_ColorStatic.a * a);
+#endif
+    }
+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1.vp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1.vp
new file mode 100644
index 0000000..c6ed4ca
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass1.vp
@@ -0,0 +1,33 @@
+//Copyright 2010 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+  #define attribute in
+  #define varying out
+#endif
+
+#include uniforms.glsl
+#include attributes.glsl
+#include varyings.glsl
+
+void main(void)
+{
+    gl_Position = gcu_PMVMatrix02[0] * gcu_PMVMatrix02[1] * gca_Vertices;
+#if 1
+    gcv_CurveParam = gca_CurveParams;
+#else
+    if( gcv_CurveParams.x <= -10.0 ) {
+        // vec4 tc = gcu_PMVMatrix02[0] * gcu_PMVMatrix02[1] * vec4(gca_CurveParams.xy, gca_Vertices.z, 1);
+        // gcv_CurveParams = vec3(tc.xy, gca_CurveParams.z);
+        gcv_CurveParam = gca_CurveParams;
+    } else {
+        gcv_CurveParam = gca_CurveParams;
+    }
+#endif
+#ifdef USE_COLOR_TEXTURE
+    vec2 dim = vec2(gcu_ColorTexBBox.z - gcu_ColorTexBBox.x, gcu_ColorTexBBox.w - gcu_ColorTexBBox.y);
+    gcv_ColorTexCoord = vec2(gca_Vertices.x - gcu_ColorTexBBox.x, gca_Vertices.y - gcu_ColorTexBBox.y) / dim;
+#endif
+#ifdef USE_COLOR_CHANNEL
+    gcv_Color = gca_Colors;
+#endif
+}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-msaa.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-msaa.glsl
new file mode 100644
index 0000000..1872af6
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-msaa.glsl
@@ -0,0 +1,10 @@
+        // Pass-2: Dump Texture
+        vec4 t = texture2D(gcu_FboTexUnit, gcv_FboTexCoord.st);
+        #if 0
+        if( 0.0 == t.a ) {
+          discard; // discard freezes NV tegra2 compiler
+        }
+        #endif
+
+        mgl_FragColor = t;
+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_allprop01.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_allprop01.glsl
new file mode 100644
index 0000000..436dd4e
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_allprop01.glsl
@@ -0,0 +1,113 @@
+        // Pass-2: AA on Texture
+        // Note: gcv_FboTexCoord is in center of sample pixels.
+
+        float sampleCount = gcu_FboTexSize.z;
+        vec2 psize = 1.0 / gcu_FboTexSize.xy; // pixel size
+
+        // Not only the poles (NW, SW, ..) but the whole edge!
+        float pixelCount = sampleCount * sampleCount;
+
+        // sampleCount [0, 1, 3, 5, 7] are undefined!
+        float layerCount = ( sampleCount / 2.0 );
+
+        // sum of all integer [layerCount .. 1] -> Gauss
+        float denom = ( layerCount / 2.0 ) * ( layerCount + 1.0 );
+
+        vec2 texCoord = gcv_FboTexCoord.st;
+
+        vec4 t;
+
+        // Layer-1: SampleCount 2 -> 4x
+        t  = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-0.5, -0.5))); // NW
+        t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-0.5,  0.5))); // SW
+        t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 0.5,  0.5))); // SE
+        t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 0.5, -0.5))); // NE
+
+        t *= (layerCount - 0.0) / ( denom * 4.0 ); // weight layer 1
+
+        if( sampleCount > 2.0 ) {
+            // Layer-2: SampleCount 4 -> +12x = 16p
+            vec4 tn = vec4(0);
+            tn  = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-1.5, -1.5))); // NW -> SW Edge
+            tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-1.5, -0.5)));
+            tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-1.5,  0.5)));
+            tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-1.5,  1.5))); // SW -> SE Edge
+            tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-0.5,  1.5))); //
+            tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 0.5,  1.5))); //
+            tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 1.5,  1.5))); // SE -> NE Edge
+            tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 1.5,  0.5))); // 
+            tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 1.5, -0.5))); // 
+            tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 1.5, -1.5))); // NE -> NW Edge
+            tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 0.5, -1.5))); //
+            tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-0.5, -1.5))); // NW - 1 (closed)
+
+            t += tn * (layerCount - 1) / ( denom * 12.0 ); // weight layer 2
+
+            if( sampleCount > 4.0 ) {
+                // Layer-3: SampleCount 6 -> +20x = 36p
+                tn  = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-2.5, -2.5))); // NW -> SW Edge
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-2.5, -1.5)));
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-2.5, -0.5)));
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-2.5,  0.5)));
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-2.5,  1.5)));
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-2.5,  2.5))); // SW -> SE Edge
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-1.5,  2.5)));
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-0.5,  2.5)));
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 0.5,  2.5)));
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 1.5,  2.5)));
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 2.5,  2.5))); // SE -> NE Edge
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 2.5,  1.5)));
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 2.5,  0.5)));
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 2.5, -0.5)));
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 2.5, -1.5)));
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 2.5, -2.5))); // NE -> NW Edge
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 1.5, -2.5)));
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 0.5, -2.5)));
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-0.5, -2.5)));
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-1.5, -2.5))); // NW - 1 (closed)
+
+                t += tn * (layerCount - 2) / ( denom * 20.0 ); // weight layer 3
+
+                if( sampleCount > 6.0 ) {
+                    // Layer-4: SampleCount 8 -> +28x = 64p
+                    tn  = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-3.5, -3.5))); // NW -> SW Edge
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-3.5, -2.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-3.5, -1.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-3.5, -0.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-3.5,  0.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-3.5,  1.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-3.5,  2.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-3.5,  3.5))); // SW -> SE Edge
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-2.5,  3.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-1.5,  3.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-0.5,  3.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 0.5,  3.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 1.5,  3.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 2.5,  3.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 3.5,  3.5))); // SE -> NE Edge
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 3.5,  2.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 3.5,  1.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 3.5,  0.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 3.5, -0.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 3.5, -1.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 3.5, -2.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 3.5, -3.5))); // NE -> NW Edge
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 2.5, -3.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 1.5, -3.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 0.5, -3.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-0.5, -3.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-1.5, -3.5)));
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-2.5, -3.5))); // NW - 1 (closed)
+
+                    t += tn * (layerCount - 3) / ( denom * 28.0 ); // weight layer 4
+                }
+            }
+        }
+
+        #if 0
+        if(t.w == 0.0){
+            discard; // discard freezes NV tegra2 compiler
+        }
+        #endif
+        
+        mgl_FragColor = t;
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_bforce_even.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_bforce_even.glsl
new file mode 100644
index 0000000..ba7611a
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_bforce_even.glsl
@@ -0,0 +1,96 @@
+        // Pass-2: AA on Texture
+        // Note: gcv_FboTexCoord is in center of sample pixels.
+
+        // float sample_count = gcu_FboTexSize.z;
+        vec2 psize = 1.0 / gcu_FboTexSize.xy; // pixel size
+
+        // Not only the poles (NW, SW, ..) but the whole edge!
+        const float sample_weight = 1.0 / ( sample_count * sample_count );
+
+        // const vec4 tex_weights = vec4(0.075, 0.06, 0.045, 0.025);
+        vec2 texCoord = gcv_FboTexCoord.st;
+
+        vec4 t;
+
+        // SampleCount 2 -> 4x
+        t  = texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-0.5, -0.5))*sample_weight; // NW
+        t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-0.5,  0.5))*sample_weight; // SW
+        t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 0.5,  0.5))*sample_weight; // SE
+        t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 0.5, -0.5))*sample_weight; // NE
+        #if SAMPLE_COUNT > 2
+            // SampleCount 4 -> +12x = 16p
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-1.5, -1.5))*sample_weight; // NW -> SW Edge
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-1.5, -0.5))*sample_weight;
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-1.5,  0.5))*sample_weight;
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-1.5,  1.5))*sample_weight; // SW -> SE Edge
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-0.5,  1.5))*sample_weight; //
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 0.5,  1.5))*sample_weight; //
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 1.5,  1.5))*sample_weight; // SE -> NE Edge
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 1.5,  0.5))*sample_weight; // 
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 1.5, -0.5))*sample_weight; // 
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 1.5, -1.5))*sample_weight; // NE -> NW Edge
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 0.5, -1.5))*sample_weight; //
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-0.5, -1.5))*sample_weight; // NW - 1 (closed)
+
+            #if SAMPLE_COUNT > 4
+                // SampleCount 6 -> +20x = 36p
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-2.5, -2.5))*sample_weight; // NW -> SW Edge
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-2.5, -1.5))*sample_weight;
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-2.5, -0.5))*sample_weight;
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-2.5,  0.5))*sample_weight;
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-2.5,  1.5))*sample_weight;
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-2.5,  2.5))*sample_weight; // SW -> SE Edge
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-1.5,  2.5))*sample_weight;
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-0.5,  2.5))*sample_weight;
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 0.5,  2.5))*sample_weight;
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 1.5,  2.5))*sample_weight;
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 2.5,  2.5))*sample_weight; // SE -> NE Edge
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 2.5,  1.5))*sample_weight;
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 2.5,  0.5))*sample_weight;
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 2.5, -0.5))*sample_weight;
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 2.5, -1.5))*sample_weight;
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 2.5, -2.5))*sample_weight; // NE -> NW Edge
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 1.5, -2.5))*sample_weight;
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 0.5, -2.5))*sample_weight;
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-0.5, -2.5))*sample_weight;
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-1.5, -2.5))*sample_weight; // NW - 1 (closed)
+                #if SAMPLE_COUNT > 6
+                    // SampleCount 8 -> +28x = 64p
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-3.5, -3.5))*sample_weight; // NW -> SW Edge
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-3.5, -2.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-3.5, -1.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-3.5, -0.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-3.5,  0.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-3.5,  1.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-3.5,  2.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-3.5,  3.5))*sample_weight; // SW -> SE Edge
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-2.5,  3.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-1.5,  3.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-0.5,  3.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 0.5,  3.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 1.5,  3.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 2.5,  3.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 3.5,  3.5))*sample_weight; // SE -> NE Edge
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 3.5,  2.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 3.5,  1.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 3.5,  0.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 3.5, -0.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 3.5, -1.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 3.5, -2.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 3.5, -3.5))*sample_weight; // NE -> NW Edge
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 2.5, -3.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 1.5, -3.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 0.5, -3.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-0.5, -3.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-1.5, -3.5))*sample_weight;
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-2.5, -3.5))*sample_weight; // NW - 1 (closed)
+                #endif
+            #endif
+        #endif
+        #if 0
+        if(t.w == 0.0){
+            discard; // discard freezes NV tegra2 compiler
+        }
+        #endif
+        
+        mgl_FragColor = t;
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_bforce_odd.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_bforce_odd.glsl
new file mode 100644
index 0000000..7adf111
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_bforce_odd.glsl
@@ -0,0 +1,87 @@
+        // Pass-2: AA on Texture
+        // Note: gcv_FboTexCoord is in center of sample pixels.
+
+        // float sample_count = gcu_FboTexSize.z;
+        vec2 psize = 1.0 / gcu_FboTexSize.xy; // pixel size
+
+        // Not only the poles (NW, SW, ..) but the whole edge!
+        const float sample_weight = 1.0 / ( sample_count * sample_count );
+
+        // const vec4 tex_weights = vec4(0.075, 0.06, 0.045, 0.025);
+        vec2 texCoord = gcv_FboTexCoord.st;
+
+        vec4 t;
+
+        // SampleCount 1 -> 1x (raster 1x1)
+        t += texture2D(gcu_FboTexUnit, texCoord)*sample_weight; // CENTER
+
+        #if SAMPLE_COUNT > 1
+            // SampleCount 3 -> +8x = 9p (raster 3x3)
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-1.0, -1.0))*sample_weight; // top line
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 0.0, -1.0))*sample_weight; // top line
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 1.0, -1.0))*sample_weight; // top line
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-1.0,  0.0))*sample_weight; // Center Left
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 1.0,  0.0))*sample_weight; // Center Right
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-1.0,  1.0))*sample_weight; // bottom line
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 0.0,  1.0))*sample_weight; // bottom line
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 1.0,  1.0))*sample_weight; // bottom line
+
+            #if SAMPLE_COUNT > 3
+                // SampleCount 5 -> +16x = 25p (raster 5x5)
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-2.0, -1.0))*sample_weight; // top line - 1
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 2.0, -1.0))*sample_weight; // top line - 1
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-2.0,  0.0))*sample_weight; // Center Left
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 2.0,  0.0))*sample_weight; // Center Right
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-2.0,  1.0))*sample_weight; // bottom line - 1
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 2.0,  1.0))*sample_weight; // bottom line - 1
+
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-2.0, -2.0))*sample_weight; // top line
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-1.0, -2.0))*sample_weight; // top line
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 0.0, -2.0))*sample_weight; // top line
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 1.0, -2.0))*sample_weight; // top line
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 2.0, -2.0))*sample_weight; // top line
+
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-2.0,  2.0))*sample_weight; // bottom line
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-1.0,  2.0))*sample_weight; // bottom line
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 0.0,  2.0))*sample_weight; // bottom line
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 1.0,  2.0))*sample_weight; // bottom line
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 2.0,  2.0))*sample_weight; // bottom line
+
+                #if SAMPLE_COUNT > 5
+                    // SampleCount 7 -> +24x = 49p (raster 7x7)
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-3.0, -2.0))*sample_weight; // top line - 1
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 3.0, -2.0))*sample_weight; // top line - 1
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-3.0, -1.0))*sample_weight; // top line - 2
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 3.0, -1.0))*sample_weight; // top line - 2
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-3.0,  0.0))*sample_weight; // Center Left
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 3.0,  0.0))*sample_weight; // Center Right
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-3.0,  1.0))*sample_weight; // bottom line - 2
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 3.0,  1.0))*sample_weight; // bottom line - 2
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-3.0,  2.0))*sample_weight; // bottom line - 1
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 3.0,  2.0))*sample_weight; // bottom line - 1
+
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-3.0, -3.0))*sample_weight; // top line
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-2.0, -3.0))*sample_weight; // top line
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-1.0, -3.0))*sample_weight; // top line
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 0.0, -3.0))*sample_weight; // top line
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 1.0, -3.0))*sample_weight; // top line
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 2.0, -3.0))*sample_weight; // top line
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 3.0, -3.0))*sample_weight; // top line
+
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-3.0,  3.0))*sample_weight; // bottom line
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-2.0,  3.0))*sample_weight; // bottom line
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2(-1.0,  3.0))*sample_weight; // bottom line
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 0.0,  3.0))*sample_weight; // bottom line
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 1.0,  3.0))*sample_weight; // bottom line
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 2.0,  3.0))*sample_weight; // bottom line
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*vec2( 3.0,  3.0))*sample_weight; // bottom line
+                #endif
+            #endif
+        #endif
+        #if 0
+        if(t.w == 0.0){
+            discard; // discard freezes NV tegra2 compiler
+        }
+        #endif
+        
+        mgl_FragColor = t;
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad.glsl
new file mode 100644
index 0000000..3e74fb9
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad.glsl
@@ -0,0 +1,41 @@
+
+        // Pass-2: AA on Texture
+        // Note: gcv_FboTexCoord is in center of sample pixels, origin is bottom left!
+
+        float sampleCount = gcu_FboTexSize.z;
+        vec2 psize = 1.0 / gcu_FboTexSize.xy; // pixel size
+
+        // Just poles (NW, SW, ..)
+        float edge1H = sampleCount / 2.0;
+        float edge1T = sampleCount / 3.0;
+        float edgeTH = edge1H-edge1T;
+
+        vec2 normFragCoord = gl_FragCoord.xy - vec2(0.5, 0.5); // normalize center 0.5/0.5 -> 0/0
+        vec2 modPos = mod(normFragCoord, 2.0);
+        float orient = mod(modPos.x + modPos.y, 2.0); // mirrored on all odd columns, alternating each row (checker-board pattern)
+
+        vec2 texCoord = gcv_FboTexCoord.st;
+        vec4 t;
+
+        if( 0.0 == orient ) {
+                                                                                               // SWIPE LEFT -> RIGHT
+            t  = GetSample(gcu_FboTexUnit, texCoord, psize, -edge1H,  edgeTH, 0.0, 0.0)*0.25; // upper-left  [p1]
+            t += GetSample(gcu_FboTexUnit, texCoord, psize, -edgeTH, -edge1H, 0.0, 0.0)*0.25; // lower-left  [p3]
+            t += GetSample(gcu_FboTexUnit, texCoord, psize,  edgeTH,  edge1H, 0.0, 0.0)*0.25; // upper-right [p2]
+            t += GetSample(gcu_FboTexUnit, texCoord, psize,  edge1H, -edgeTH, 0.0, 0.0)*0.25; // lower-right [p4]
+        } else {
+            t  = GetSample(gcu_FboTexUnit, texCoord, psize, -edge1H, -edgeTH, 0.0, 0.0)*0.25; // lower-left  [p4]
+            t += GetSample(gcu_FboTexUnit, texCoord, psize, -edgeTH,  edge1H, 0.0, 0.0)*0.25; // upper-left  [p3]
+            t += GetSample(gcu_FboTexUnit, texCoord, psize,  edgeTH, -edge1H, 0.0, 0.0)*0.25; // lower-right [p2]
+            t += GetSample(gcu_FboTexUnit, texCoord, psize,  edge1H,  edgeTH, 0.0, 0.0)*0.25; // upper-right [p1]
+        }
+
+
+        #if 0
+        if(t.w == 0.0){
+            discard; // discard freezes NV tegra2 compiler
+        }
+        #endif
+        
+        mgl_FragColor = t;
+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad2.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad2.glsl
new file mode 100644
index 0000000..9e31e6b
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad2.glsl
@@ -0,0 +1,41 @@
+
+        // Pass-2: AA on Texture
+        // Note: gcv_FboTexCoord is in center of sample pixels, origin is bottom left!
+        // 
+        // Same as flipquad - but w/ rgss coordinates
+
+        float sampleCount = gcu_FboTexSize.z;
+        vec2 psize = 1.0 / gcu_FboTexSize.xy; // pixel size
+
+        vec2 normFragCoord = gl_FragCoord.xy - vec2(0.5, 0.5); // normalize center 0.5/0.5 -> 0/0
+        vec2 modPos = mod(normFragCoord, 2.0);
+        float orient = mod(modPos.x + modPos.y, 2.0); // mirrored on all odd columns, alternating each row (checker-board pattern)
+
+        vec2 texCoord = gcv_FboTexCoord.st;
+        float edge1Q = ( sampleCount / 2.0 ) - 1.0;
+
+        vec4 t;
+
+// #define GetSample(texUnit, texCoord, psize, cx, cy, offX, offY) texture2D(texUnit, texCoord + psize *  vec2(cx+offX, cy+offY))
+
+        if( 0.0 == orient ) {
+                                                                                               // SWIPE LEFT -> RIGHT
+            t  = GetSample(gcu_FboTexUnit, texCoord, psize, -edge1Q,     0.0, -0.5,  0.5)*0.25; // upper-left  [p1]
+            t += GetSample(gcu_FboTexUnit, texCoord, psize,     0.0, -edge1Q, -0.5, -0.5)*0.25; // lower-left  [p3]
+            t += GetSample(gcu_FboTexUnit, texCoord, psize,     0.0,  edge1Q,  0.5,  0.5)*0.25; // upper-right [p2]
+            t += GetSample(gcu_FboTexUnit, texCoord, psize,  edge1Q,     0.0,  0.5, -0.5)*0.25; // lower-right [p4]
+        } else {
+            t  = GetSample(gcu_FboTexUnit, texCoord, psize, -edge1Q,     0.0, -0.5, -0.5)*0.25; // lower-left  [p4]
+            t += GetSample(gcu_FboTexUnit, texCoord, psize,     0.0,  edge1Q, -0.5,  0.5)*0.25; // upper-left  [p3]
+            t += GetSample(gcu_FboTexUnit, texCoord, psize,     0.0, -edge1Q,  0.5, -0.5)*0.25; // lower-right [p2]
+            t += GetSample(gcu_FboTexUnit, texCoord, psize,  edge1Q,     0.0,  0.5,  0.5)*0.25; // upper-right [p1]
+        }
+
+        #if 0
+        if(t.w == 0.0){
+            discard; // discard freezes NV tegra2 compiler
+        }
+        #endif
+        
+        mgl_FragColor = t;
+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad3.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad3.glsl
new file mode 100644
index 0000000..8cc108b
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_flipquad3.glsl
@@ -0,0 +1,109 @@
+
+        // Pass-2: AA on Texture
+        // Note: gcv_FboTexCoord is in center of sample pixels, origin is bottom left!
+        // 
+        // Same as flipquad - but w/ rgss coordinates
+
+        // float sample_count = gcu_FboTexSize.z;
+        vec2 psize = 1.0 / gcu_FboTexSize.xy; // pixel size
+
+        vec2 normFragCoord = gl_FragCoord.xy - vec2(0.5, 0.5); // normalize center 0.5/0.5 -> 0/0
+        vec2 modPos = mod(normFragCoord, 2.0);
+        float orient = mod(modPos.x + modPos.y, 2.0); // mirrored on all odd columns, alternating each row (checker-board pattern)
+
+        vec2 texCoord = gcv_FboTexCoord.st;
+        vec4 t;
+
+// #define GetSample(texUnit, texCoord, psize, cx, cy, offX, offY) texture2D(texUnit, texCoord + psize *  vec2(cx+offX, cy+offY))
+
+        #if SAMPLE_COUNT == 1
+
+            t = texture2D(gcu_FboTexUnit, texCoord);
+
+        #elif SAMPLE_COUNT < 4
+
+            // SampleCount 2 -> 2p 
+            const float weight = 1.0 / 2.0;
+            const float edge = ( sample_count / 2.0 ) - 1.0;
+
+            t  = GetSample(gcu_FboTexUnit, texCoord, psize,      -edge,       edge, -0.5,  0.5)*weight;  // center
+            t += GetSample(gcu_FboTexUnit, texCoord, psize,       edge,      -edge,  0.5, -0.5)*weight;  // center
+
+        #elif SAMPLE_COUNT < 8
+
+            // SampleCount 4 -> 4p
+            const float weight = 1.0 / 4.0;
+            const float edgeS4_1Q = ( sample_count / 2.0 ) - 1.0;
+
+            if( 0.0 == orient ) {
+                                                                                                           // SWIPE LEFT -> RIGHT
+                t  = GetSample(gcu_FboTexUnit, texCoord, psize, -edgeS4_1Q,        0.0, -0.5,  0.5)*weight; // upper-left  [p1]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0, -edgeS4_1Q, -0.5, -0.5)*weight; // lower-left  [p3]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0,  edgeS4_1Q,  0.5,  0.5)*weight; // upper-right [p2]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,  edgeS4_1Q,        0.0,  0.5, -0.5)*weight; // lower-right [p4]
+            } else {
+                t  = GetSample(gcu_FboTexUnit, texCoord, psize, -edgeS4_1Q,        0.0, -0.5, -0.5)*weight; // lower-left  [p4]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0,  edgeS4_1Q, -0.5,  0.5)*weight; // upper-left  [p3]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0, -edgeS4_1Q,  0.5, -0.5)*weight; // lower-right [p2]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,  edgeS4_1Q,        0.0,  0.5,  0.5)*weight; // upper-right [p1]
+            }
+
+        #else
+
+            // SampleCount 8 -> 16p
+            const float weight = 1.0 / 16.0;
+            const float edgeS4_1Q = 1.0;
+
+            if( 0.0 == orient ) {
+                                                                                                           // SWIPE LEFT -> RIGHT
+                t  = GetSample(gcu_FboTexUnit, texCoord, psize, -edgeS4_1Q,        0.0, -2.0-0.5, -2.0+0.5)*weight; // upper-left  [p1]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0, -edgeS4_1Q, -2.0-0.5, -2.0-0.5)*weight; // lower-left  [p3]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0,  edgeS4_1Q, -2.0-0.5, -2.0-0.5)*weight; // upper-right [p2]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,  edgeS4_1Q,        0.0, -2.0-0.5, -2.0-0.5)*weight; // lower-right [p4]
+
+                t += GetSample(gcu_FboTexUnit, texCoord, psize, -edgeS4_1Q,        0.0, -2.0-0.5,  2.0-0.5)*weight; // lower-left  [p4]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0,  edgeS4_1Q, -2.0-0.5,  2.0+0.5)*weight; // upper-left  [p3]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0, -edgeS4_1Q, -2.0+0.5,  2.0-0.5)*weight; // lower-right [p2]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,  edgeS4_1Q,        0.0, -2.0+0.5,  2.0+0.5)*weight; // upper-right [p1]
+
+                t += GetSample(gcu_FboTexUnit, texCoord, psize, -edgeS4_1Q,        0.0,  2.0-0.5, -2.0-0.5)*weight; // lower-left  [p4]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0,  edgeS4_1Q,  2.0-0.5, -2.0+0.5)*weight; // upper-left  [p3]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0, -edgeS4_1Q,  2.0+0.5, -2.0-0.5)*weight; // lower-right [p2]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,  edgeS4_1Q,        0.0,  2.0+0.5, -2.0+0.5)*weight; // upper-right [p1]
+
+                t += GetSample(gcu_FboTexUnit, texCoord, psize, -edgeS4_1Q,        0.0,  2.0-0.5,  2.0+0.5)*weight; // upper-left  [p1]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0, -edgeS4_1Q,  2.0-0.5,  2.0-0.5)*weight; // lower-left  [p3]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0,  edgeS4_1Q,  2.0-0.5,  2.0-0.5)*weight; // upper-right [p2]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,  edgeS4_1Q,        0.0,  2.0-0.5,  2.0-0.5)*weight; // lower-right [p4]
+            } else {
+                t  = GetSample(gcu_FboTexUnit, texCoord, psize, -edgeS4_1Q,        0.0, -2.0-0.5, -2.0-0.5)*weight; // lower-left  [p4]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0,  edgeS4_1Q, -2.0-0.5, -2.0+0.5)*weight; // upper-left  [p3]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0, -edgeS4_1Q, -2.0+0.5, -2.0-0.5)*weight; // lower-right [p2]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,  edgeS4_1Q,        0.0, -2.0+0.5, -2.0+0.5)*weight; // upper-right [p1]
+
+                t += GetSample(gcu_FboTexUnit, texCoord, psize, -edgeS4_1Q,        0.0, -2.0-0.5,  2.0+0.5)*weight; // upper-left  [p1]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0, -edgeS4_1Q, -2.0-0.5,  2.0-0.5)*weight; // lower-left  [p3]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0,  edgeS4_1Q, -2.0-0.5,  2.0-0.5)*weight; // upper-right [p2]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,  edgeS4_1Q,        0.0, -2.0-0.5,  2.0-0.5)*weight; // lower-right [p4]
+
+                t += GetSample(gcu_FboTexUnit, texCoord, psize, -edgeS4_1Q,        0.0,  2.0-0.5, -2.0+0.5)*weight; // upper-left  [p1]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0, -edgeS4_1Q,  2.0-0.5, -2.0-0.5)*weight; // lower-left  [p3]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0,  edgeS4_1Q,  2.0-0.5, -2.0-0.5)*weight; // upper-right [p2]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,  edgeS4_1Q,        0.0,  2.0-0.5, -2.0-0.5)*weight; // lower-right [p4]
+
+                t += GetSample(gcu_FboTexUnit, texCoord, psize, -edgeS4_1Q,        0.0,  2.0-0.5,  2.0-0.5)*weight; // lower-left  [p4]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0,  edgeS4_1Q,  2.0-0.5,  2.0+0.5)*weight; // upper-left  [p3]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,        0.0, -edgeS4_1Q,  2.0+0.5,  2.0-0.5)*weight; // lower-right [p2]
+                t += GetSample(gcu_FboTexUnit, texCoord, psize,  edgeS4_1Q,        0.0,  2.0+0.5,  2.0+0.5)*weight; // upper-right [p1]
+            }
+
+        #endif
+
+        #if 0
+        if(t.w == 0.0){
+            discard; // discard freezes NV tegra2 compiler
+        }
+        #endif
+        
+        mgl_FragColor = t;
+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_fxaa3.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_fxaa3.glsl
new file mode 100644
index 0000000..015dc1b
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_fxaa3.glsl
@@ -0,0 +1,56 @@
+
+        // Pass-2: AA on Texture
+        // Note: gcv_FboTexCoord is in center of sample pixels.
+
+        if( gcu_FboTexSize.z < 4.0 ) {
+            // FXAA-2
+            const float FXAA_REDUCE_MIN  = (1.0/128.0);
+            const float FXAA_REDUCE_MUL  = (1.0/8.0);
+            const float FXAA_SPAN_MAX  = 8.0;
+
+            float sampleCount = gcu_FboTexSize.z;
+
+            vec2 texCoord = gcv_FboTexCoord.st;
+            const float poff = 1.0;
+            vec2 psize = 1.0 / texCoord; // pixel size
+
+            vec3 rgbNW = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-poff, -poff))).rgb;
+            vec3 rgbSW = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-poff,  poff))).rgb;
+            vec3 rgbSE = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( poff,  poff))).rgb;
+            vec3 rgbNE = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( poff, -poff))).rgb;
+            vec4 rgbM  = texture2D(gcu_FboTexUnit, texCoord);
+
+            const vec3 luma = vec3(0.299, 0.587, 0.114);
+            float lumaNW = dot(rgbNW, luma);
+            float lumaNE = dot(rgbNE, luma);
+            float lumaSW = dot(rgbSW, luma);
+            float lumaSE = dot(rgbSE, luma);
+            float lumaM = dot(rgbM.rgb, luma);
+            float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
+            float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
+            vec2 dir;
+            dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
+            dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));
+            float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * FXAA_REDUCE_MUL),FXAA_REDUCE_MIN);
+            float rcpDirMin = 1.0/(min(abs(dir.x), abs(dir.y)) + dirReduce);
+            dir = min( vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX),
+                       max( vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX),dir * rcpDirMin) ) * psize;
+                       
+
+            vec3 rgbA = 0.5 * ( texture2D(gcu_FboTexUnit, texCoord + dir * (1.0/3.0 - 0.5)).rgb + 
+                                texture2D(gcu_FboTexUnit, texCoord + dir * (2.0/3.0 - 0.5)).rgb );
+            vec3 rgbB = rgbA * 0.5 + 0.25 * ( texture2D(gcu_FboTexUnit, texCoord + (dir * - 0.5)).rgb + 
+                                              texture2D(gcu_FboTexUnit, texCoord + (dir *   0.5)).rgb );
+            float lumaB = dot(rgbB, luma);
+            if((lumaB < lumaMin) || (lumaB > lumaMax)) {
+                mgl_FragColor.rgb = rgbA;
+            } else {
+                mgl_FragColor.rgb = rgbB;
+            }
+            mgl_FragColor.a = gcu_Alpha * rgbM.a; // mix(0.0, gcu_Alpha, rgbM.a); // t.a one of [ 0.0, 1.0 ]
+        } else {
+
+#include curverenderer01-pass2-vbaa_poles_equalweight.glsl
+
+        }
+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_poles_bilin1.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_poles_bilin1.glsl
new file mode 100644
index 0000000..d634c1f
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_poles_bilin1.glsl
@@ -0,0 +1,91 @@
+        // Pass-2: AA on Texture
+        // Note: gcv_FboTexCoord is in center of sample pixels.
+
+        vec2 texCoord = gcv_FboTexCoord.st;
+
+        float sampleCount = gcu_FboTexSize.z;
+        vec2 tsize = gcu_FboTexSize.xy; // tex size
+        vec2 psize = 1.0 / gcu_FboTexSize.xy; // pixel size
+
+        // mix(x,y,a): x*(1-a) + y*a
+        //
+        // bilinear filtering includes 2 mix:
+        //
+        //   pix1 = tex[x0][y0] * ( 1 - u_ratio ) + tex[x1][y0] * u_ratio
+        //   pix2 = tex[x0][y1] * ( 1 - u_ratio ) + tex[x1][y1] * u_ratio
+        //   fin  =    pix1     * ( 1 - v_ratio ) +     pix2    * v_ratio
+        //
+        // so we can use the build in mix function for these 2 computations ;-)
+        //
+        vec2 uv_ratio     = fract(texCoord*tsize); // texCoord*tsize - floor(texCoord*tsize);
+
+        // Just poles (NW, SW, ..)
+        float pixelCount = 2 * sampleCount;
+
+        // sampleCount [0, 1, 3, 5, 7] are undefined!
+        float layerCount = ( sampleCount / 2.0 );
+
+        // sum of all integer [layerCount .. 1] -> Gauss
+        float denom = ( layerCount / 2.0 ) * ( layerCount + 1.0 );
+
+        vec4 t, p1, p2, p3, p4;
+
+        // Layer-1: SampleCount 2 -> 4x
+        p1 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-0.5, -0.5))); // NW
+        p2 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-0.5,  0.5))); // SW
+        p3 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 0.5,  0.5))); // SE
+        p4 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 0.5, -0.5))); // NE
+
+        p1  = mix( p1, p4, uv_ratio.x);
+        p2  = mix( p2, p3, uv_ratio.x);
+        t  = mix ( p1, p2, uv_ratio.y );
+
+        t *= (layerCount - 0.0) / ( denom ); // weight layer 1
+
+        if( sampleCount > 2.0 ) {
+            // Layer-2: SampleCount 4 -> +4x = 8p
+            p1 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-1.5, -1.5))); // NW
+            p2 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-1.5,  1.5))); // SW
+            p3 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 1.5,  1.5))); // SE
+            p4 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 1.5, -1.5))); // NE
+
+            p1  = mix( p1, p4, uv_ratio.x);
+            p2  = mix( p2, p3, uv_ratio.x);
+            p3  = mix ( p1, p2, uv_ratio.y );
+            t += p3 * (layerCount - 1) / ( denom ); // weight layer 2
+
+            if( sampleCount > 4.0 ) {
+                // Layer-3: SampleCount 6 -> +4 = 12p
+                p1 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-2.5, -2.5))); // NW
+                p2 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-2.5,  2.5))); // SW
+                p3 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 2.5,  2.5))); // SE
+                p4 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 2.5, -2.5))); // NE
+
+                p1  = mix( p1, p4, uv_ratio.x);
+                p2  = mix( p2, p3, uv_ratio.x);
+                p3  = mix ( p1, p2, uv_ratio.y );
+                t += p3 * (layerCount - 2) / ( denom ); // weight layer 3
+
+                if( sampleCount > 6.0 ) {
+                    // Layer-4: SampleCount 8 -> +4 = 16p
+                    p1 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-3.5, -3.5))); // NW
+                    p2 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-3.5,  3.5))); // SW
+                    p3 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 3.5,  3.5))); // SE
+                    p4 = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 3.5, -3.5))); // NE
+
+                    p1  = mix( p1, p4, uv_ratio.x);
+                    p2  = mix( p2, p3, uv_ratio.x);
+                    p3  = mix ( p1, p2, uv_ratio.y );
+
+                    t += p3 * (layerCount - 3) / ( denom ); // weight layer 4
+                }
+            }
+        }
+
+        #if 0
+        if(t.w == 0.0){
+            discard; // discard freezes NV tegra2 compiler
+        }
+        #endif
+        
+        mgl_FragColor = t;
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_polesequal.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_polesequal.glsl
new file mode 100644
index 0000000..0e8b6f1
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_polesequal.glsl
@@ -0,0 +1,49 @@
+
+        // Pass-2: AA on Texture
+        // Note: gcv_FboTexCoord is in center of sample pixels.
+
+        float sampleCount = gcu_FboTexSize.z;
+        vec2 psize = 1.0 / gcu_FboTexSize.xy; // pixel size
+
+        // Just poles (NW, SW, ..)
+        float sample_weight = 1 / ( 2 * sampleCount );
+
+        vec2 texCoord = gcv_FboTexCoord.st;
+
+        vec4 t;
+
+        // SampleCount 2 -> 4x
+        t  = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-0.5, -0.5)))*sample_weight; // NW
+        t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-0.5,  0.5)))*sample_weight; // SW
+        t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 0.5,  0.5)))*sample_weight; // SE
+        t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 0.5, -0.5)))*sample_weight; // NE
+        if( sampleCount > 2.0 ) {
+            // SampleCount 4 -> +4 = 8p
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-1.5, -1.5)))*sample_weight; // NW
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-1.5,  1.5)))*sample_weight; // SW
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 1.5,  1.5)))*sample_weight; // SE
+            t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 1.5, -1.5)))*sample_weight; // NE
+
+            if( sampleCount > 4.0 ) {
+                // SampleCount 6 -> +4 = 12p
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-2.5, -2.5)))*sample_weight; // NW
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-2.5,  2.5)))*sample_weight; // SW
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 2.5,  2.5)))*sample_weight; // SE
+                t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 2.5, -2.5)))*sample_weight; // NE
+                if( sampleCount > 6.0 ) {
+                    // SampleCount 8 -> +4 = 16p
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-3.5, -3.5)))*sample_weight; // NW
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-3.5,  3.5)))*sample_weight; // SW
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 3.5,  3.5)))*sample_weight; // SE
+                    t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 3.5, -3.5)))*sample_weight; // NE
+                }
+            }
+        }
+        #if 0
+        if(t.w == 0.0){
+            discard; // discard freezes NV tegra2 compiler
+        }
+        #endif
+        
+        mgl_FragColor = t;
+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_polesprop01.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_polesprop01.glsl
new file mode 100644
index 0000000..6c263b9
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_polesprop01.glsl
@@ -0,0 +1,65 @@
+        // Pass-2: AA on Texture
+        // Note: gcv_FboTexCoord is in center of sample pixels.
+
+        float sampleCount = gcu_FboTexSize.z;
+        vec2 psize = 1.0 / gcu_FboTexSize.xy; // pixel size
+
+        // Just poles (NW, SW, ..)
+        float pixelCount = 2 * sampleCount;
+
+        // sampleCount [0, 1, 3, 5, 7] are undefined!
+        float layerCount = ( sampleCount / 2.0 );
+
+        // sum of all integer [layerCount .. 1] -> Gauss
+        float denom = ( layerCount / 2.0 ) * ( layerCount + 1.0 );
+
+        vec2 texCoord = gcv_FboTexCoord.st;
+
+        vec4 t;
+
+        // Layer-1: SampleCount 2 -> 4x
+        t  = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-0.5, -0.5))); // NW
+        t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-0.5,  0.5))); // SW
+        t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 0.5,  0.5))); // SE
+        t += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 0.5, -0.5))); // NE
+
+        t *= (layerCount - 0.0) / ( denom * 4.0 ); // weight layer 1
+
+        if( sampleCount > 2.0 ) {
+            // Layer-2: SampleCount 4 -> +4x = 8p
+            vec4 tn = vec4(0);
+            tn  = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-1.5, -1.5))); // NW
+            tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-1.5,  1.5))); // SW
+            tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 1.5,  1.5))); // SE
+            tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 1.5, -1.5))); // NE
+
+            t += tn * (layerCount - 1) / ( denom * 4.0 ); // weight layer 2
+
+            if( sampleCount > 4.0 ) {
+                // Layer-3: SampleCount 6 -> +4 = 12p
+                tn  = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-2.5, -2.5))); // NW
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-2.5,  2.5))); // SW
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 2.5,  2.5))); // SE
+                tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 2.5, -2.5))); // NE
+
+                t += tn * (layerCount - 2) / ( denom * 4.0 ); // weight layer 3
+
+                if( sampleCount > 6.0 ) {
+                    // Layer-4: SampleCount 8 -> +4 = 16p
+                    tn  = texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-3.5, -3.5))); // NW
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2(-3.5,  3.5))); // SW
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 3.5,  3.5))); // SE
+                    tn += texture2D(gcu_FboTexUnit, texCoord + psize*(vec2( 3.5, -3.5))); // NE
+
+                    t += tn * (layerCount - 3) / ( denom * 4.0 ); // weight layer 4
+                }
+            }
+        }
+
+        #if 0
+        if(t.w == 0.0){
+            discard; // discard freezes NV tegra2 compiler
+        }
+        #endif
+        
+        mgl_FragColor = t;
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_quincunx.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_quincunx.glsl
new file mode 100644
index 0000000..07a9adf
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_quincunx.glsl
@@ -0,0 +1,28 @@
+
+        // Pass-2: AA on Texture
+        // Note: gcv_FboTexCoord is in center of sample pixels, origin is bottom left!
+
+        float sampleCount = gcu_FboTexSize.z;
+        vec2 psize = 1.0 / gcu_FboTexSize.xy; // pixel size
+
+        // Just poles (NW, SW, ..)
+        float edgeH = sampleCount / 2.0;
+
+        vec2 texCoord = gcv_FboTexCoord.st;
+
+        vec4 t;
+
+        t  = GetSample(gcu_FboTexUnit, texCoord, psize,    0.0,    0.0, 0.0, 0.0)*0.5;   // w1 - center
+        t += GetSample(gcu_FboTexUnit, texCoord, psize, -edgeH, -edgeH, 0.0, 0.0)*0.125; // w2 - sharing
+        t += GetSample(gcu_FboTexUnit, texCoord, psize, -edgeH,  edgeH, 0.0, 0.0)*0.125; // w3 - edges
+        t += GetSample(gcu_FboTexUnit, texCoord, psize,  edgeH, -edgeH, 0.0, 0.0)*0.125; // w4 - w/ all pixels
+        t += GetSample(gcu_FboTexUnit, texCoord, psize,  edgeH,  edgeH, 0.0, 0.0)*0.125; // w5
+
+        #if 0
+        if(t.w == 0.0){
+            discard; // discard freezes NV tegra2 compiler
+        }
+        #endif
+        
+        mgl_FragColor = t;
+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_rgss.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_rgss.glsl
new file mode 100644
index 0000000..27a5684
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2-vbaa_rgss.glsl
@@ -0,0 +1,25 @@
+
+        // Pass-2: AA on Texture
+        // Note: gcv_FboTexCoord is in center of sample pixels, origin is bottom left!
+
+        float sampleCount = gcu_FboTexSize.z;
+        vec2 psize = 1.0 / gcu_FboTexSize.xy; // pixel size
+
+        vec2 texCoord = gcv_FboTexCoord.st;
+        float edge1Q = ( sampleCount / 2.0 ) - 1.0;
+
+        vec4 t;
+                                                                                           // SWIPE LEFT -> RIGHT
+        t  = GetSample(gcu_FboTexUnit, texCoord, psize, -edge1Q,     0.0, -0.5,  0.5)*0.25; // upper-left  [p1]
+        t += GetSample(gcu_FboTexUnit, texCoord, psize,     0.0, -edge1Q, -0.5, -0.5)*0.25; // lower-left  [p3]
+        t += GetSample(gcu_FboTexUnit, texCoord, psize,     0.0,  edge1Q,  0.5,  0.5)*0.25; // upper-right [p2]
+        t += GetSample(gcu_FboTexUnit, texCoord, psize,  edge1Q,     0.0,  0.5, -0.5)*0.25; // lower-right [p4]
+
+        #if 0
+        if(t.w == 0.0){
+            discard; // discard freezes NV tegra2 compiler
+        }
+        #endif
+        
+        mgl_FragColor = t;
+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2.vp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2.vp
new file mode 100644
index 0000000..64857c9
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-pass2.vp
@@ -0,0 +1,17 @@
+//Copyright 2010 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+  #define attribute in
+  #define varying out
+#endif
+
+#include uniforms.glsl
+#include attributes.glsl
+#include varyings.glsl
+
+void main(void)
+{
+    // gl_Position = gcu_PMVMatrix01[0] * gcu_PMVMatrix01[1] * vec4(gca_FboVertices, 1);
+    gl_Position = gcu_PMVMatrix01[0] * gcu_PMVMatrix01[1] * gca_FboVertices;
+    gcv_FboTexCoord = gca_FboTexCoords;
+}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-segment-head.fp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-segment-head.fp
new file mode 100644
index 0000000..05407a4
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-segment-head.fp
@@ -0,0 +1,16 @@
+//Copyright 2010 JogAmp Community. All rights reserved.
+
+//
+// 2-pass shader w/o weight
+//
+
+#if __VERSION__ >= 130
+  #define varying in
+  out vec4 mgl_FragColor;
+  #define texture2D texture
+#else
+  #define mgl_FragColor gl_FragColor
+#endif
+
+#define GetSample(texUnit, texCoord, psize, cx, cy, offX, offY) texture2D(texUnit, texCoord + psize *  vec2(cx+offX, cy+offY))
+
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-single.vp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-single.vp
new file mode 100644
index 0000000..14210be
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01-single.vp
@@ -0,0 +1,33 @@
+//Copyright 2010 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+  #define attribute in
+  #define varying out
+#endif
+
+#include uniforms.glsl
+#include attributes.glsl
+#include varyings.glsl
+
+void main(void)
+{
+    gl_Position = gcu_PMVMatrix01[0] * gcu_PMVMatrix01[1] * gca_Vertices;
+#if 1
+    gcv_CurveParam = gca_CurveParams;
+#else
+    if( gcv_CurveParams.x <= -10.0 ) {
+        // vec4 tc = gcu_PMVMatrix01[0] * gcu_PMVMatrix01[1] * vec4(gca_CurveParams.xy, gca_Vertices.z, 1);
+        // gcv_CurveParams = vec3(tc.xy, gca_CurveParams.z);
+        gcv_CurveParam = gca_CurveParams;
+    } else {
+        gcv_CurveParam = gca_CurveParams;
+    }
+#endif
+#ifdef USE_COLOR_TEXTURE
+    vec2 dim = vec2(gcu_ColorTexBBox.z - gcu_ColorTexBBox.x, gcu_ColorTexBBox.w - gcu_ColorTexBBox.y);
+    gcv_ColorTexCoord = vec2(gca_Vertices.x - gcu_ColorTexBBox.x, gca_Vertices.y - gcu_ColorTexBBox.y) / dim;
+#endif
+#ifdef USE_COLOR_CHANNEL
+    gcv_Color = gca_Colors;
+#endif
+}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01.vp b/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01.vp
deleted file mode 100644
index 4b5c8b1..0000000
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/curverenderer01.vp
+++ /dev/null
@@ -1,17 +0,0 @@
-//Copyright 2010 JogAmp Community. All rights reserved.
-
-#if __VERSION__ >= 130
-  #define attribute in
-  #define varying out
-#endif
-
-#include uniforms.glsl
-#include attributes.glsl
-#include varyings.glsl
-
-void main(void)
-{
-  // gl_Position = gcu_PMVMatrix[0] * gcu_PMVMatrix[1] * vec4(gca_Vertices, 1);
-  gl_Position = gcu_PMVMatrix[0] * gcu_PMVMatrix[1] * gca_Vertices;
-  gcv_TexCoord = gca_TexCoords;
-}
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/uniforms.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/uniforms.glsl
index 5bbd5de..cd014b7 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/uniforms.glsl
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/uniforms.glsl
@@ -2,21 +2,20 @@
 #ifndef uniforms_glsl
 #define uniforms_glsl
 
-uniform mat4    gcu_PMVMatrix[3]; // P, Mv, and Mvi
-uniform vec3    gcu_ColorStatic;
-uniform float   gcu_Alpha;
+uniform mat4    gcu_PMVMatrix01[3]; // P, Mv, and Mvi
+uniform vec4    gcu_ColorStatic;
 uniform float   gcu_Weight;
-uniform sampler2D      gcu_TextureUnit;
 
-// #if __VERSION__ < 130
-uniform vec2    gcu_TextureSize;
-// #endif
+#ifdef USE_COLOR_TEXTURE
+    uniform vec4  gcu_ColorTexBBox;
+#endif
 
-// const   int     MAX_TEXTURE_UNITS = 8; // <= gl_MaxTextureImageUnits 
-// const   int     MAX_LIGHTS = 8; 
-// uniform mat3   gcu_NormalMatrix; // transpose(inverse(ModelView)).3x3
-// uniform int     gcu_ColorEnabled;
-// uniform int     gcu_TexCoordEnabled[MAX_TEXTURE_UNITS];
-// uniform int     gcu_CullFace;
+uniform mat4    gcu_PMVMatrix02[3]; // P, Mv, and Mvi
+uniform sampler2D  gcu_FboTexUnit;
+
+/** 
+ * .x .y : texture-, fbo- or screen-size
+ */
+uniform vec2   gcu_FboTexSize;
 
 #endif // uniforms_glsl
diff --git a/src/jogl/classes/jogamp/graph/curve/opengl/shader/varyings.glsl b/src/jogl/classes/jogamp/graph/curve/opengl/shader/varyings.glsl
index 7a9bc5a..265ab69 100644
--- a/src/jogl/classes/jogamp/graph/curve/opengl/shader/varyings.glsl
+++ b/src/jogl/classes/jogamp/graph/curve/opengl/shader/varyings.glsl
@@ -2,8 +2,17 @@
 #ifndef varyings_glsl
 #define varyings_glsl
 
-//varying vec4    gcv_FrontColor;
-varying vec2    gcv_TexCoord;
+varying vec3    gcv_CurveParam;
+
+varying vec2    gcv_FboTexCoord;
+
+#ifdef USE_COLOR_TEXTURE
+    varying vec2    gcv_ColorTexCoord;
+#endif
+
+#ifdef USE_COLOR_CHANNEL
+    varying vec4    gcv_Color;
+#endif
 
 #endif // varyings_glsl
 
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
index a60f91b..4473d04 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2D.java
@@ -29,7 +29,7 @@
 package jogamp.graph.curve.tess;
 
 import java.util.ArrayList;
-
+import java.util.List;
 
 import com.jogamp.graph.curve.tess.Triangulator;
 import com.jogamp.graph.geom.Outline;
@@ -39,21 +39,23 @@ import com.jogamp.opengl.math.VectorUtil;
 
 import jogamp.opengl.Debug;
 
-/** Constrained Delaunay Triangulation
+/**
+ * Constrained Delaunay Triangulation
  * implementation of a list of Outlines that define a set of
  * Closed Regions with optional n holes.
- *
  */
-public class CDTriangulator2D implements Triangulator{
+public class CDTriangulator2D implements Triangulator {
 
-    protected static final boolean DEBUG = Debug.debug("Triangulation");
+    protected static final boolean DEBUG = Debug.debug("graph.curve.Triangulation");
 
-    private float sharpness = 0.5f;
-    private ArrayList<Loop> loops;
-    private ArrayList<Vertex> vertices;
+    private static final boolean TEST_LINE_AA = Debug.debug("graph.curve.triangulation.LINE_AA");
+    private static final boolean TEST_MARK_LINE = Debug.debug("graph.curve.triangulation.MARK_AA");
+    private static final boolean TEST_ENABLED = TEST_LINE_AA || TEST_MARK_LINE;
 
-    private ArrayList<Triangle> triangles;
-    private int maxTriID = 0;
+    private final ArrayList<Loop> loops = new ArrayList<Loop>();
+
+    private int addedVerticeCount;
+    private int maxTriID;
 
 
     /** Constructor for a new Delaunay triangulator
@@ -62,19 +64,21 @@ public class CDTriangulator2D implements Triangulator{
         reset();
     }
 
-    /** Reset the triangulation to initial state
-     *  Clearing cached data
-     */
     @Override
-    public void reset() {
+    public final void reset() {
         maxTriID = 0;
-        vertices = new ArrayList<Vertex>();
-        triangles = new ArrayList<Triangle>(3);
-        loops = new ArrayList<Loop>();
+        addedVerticeCount = 0;
+        loops.clear();
     }
 
     @Override
-    public void addCurve(Outline polyline) {
+    public final int getAddedVerticeCount() {
+        return addedVerticeCount;
+    }
+
+
+    @Override
+    public final void addCurve(final List<Triangle> sink, final Outline polyline, final float sharpness) {
         Loop loop = null;
 
         if(!loops.isEmpty()) {
@@ -82,27 +86,28 @@ public class CDTriangulator2D implements Triangulator{
         }
 
         if(loop == null) {
-            GraphOutline outline = new GraphOutline(polyline);
-            GraphOutline innerPoly = extractBoundaryTriangles(outline, false);
-            vertices.addAll(polyline.getVertices());
+            final GraphOutline outline = new GraphOutline(polyline);
+            final GraphOutline innerPoly = extractBoundaryTriangles(sink, outline, false, sharpness);
+            // vertices.addAll(polyline.getVertices());
             loop = new Loop(innerPoly, VectorUtil.Winding.CCW);
             loops.add(loop);
         } else {
-            GraphOutline outline = new GraphOutline(polyline);
-            GraphOutline innerPoly = extractBoundaryTriangles(outline, true);
-            vertices.addAll(innerPoly.getVertices());
+            final GraphOutline outline = new GraphOutline(polyline);
+            final GraphOutline innerPoly = extractBoundaryTriangles(sink, outline, true, sharpness);
+            // vertices.addAll(innerPoly.getVertices());
             loop.addConstraintCurve(innerPoly);
         }
     }
 
     @Override
-    public ArrayList<Triangle> generate() {
-        for(int i=0;i<loops.size();i++) {
-            Loop loop = loops.get(i);
+    public final void generate(final List<Triangle> sink) {
+        final int loopsSize = loops.size();
+        for(int i=0;i<loopsSize;i++) {
+            final Loop loop = loops.get(i);
             int numTries = 0;
             int size = loop.computeLoopSize();
             while(!loop.isSimplex()){
-                Triangle tri = null;
+                final Triangle tri;
                 if(numTries > size){
                     tri = loop.cut(false);
                 }
@@ -115,39 +120,60 @@ public class CDTriangulator2D implements Triangulator{
                     numTries = 0;
                     size--;
                     tri.setId(maxTriID++);
-                    triangles.add(tri);
+                    sink.add(tri);
                     if(DEBUG){
-                        System.err.println(tri);
+                        System.err.println("CDTri.gen["+i+"].0: "+tri);
                     }
                 }
                 if(numTries > size*2){
                     if(DEBUG){
-                        System.err.println("Triangulation not complete!");
+                        System.err.println("CDTri.gen["+i+"].X: Triangulation not complete!");
                     }
                     break;
                 }
             }
-            Triangle tri = loop.cut(true);
-            if(tri != null)
-                triangles.add(tri);
+            final Triangle tri = loop.cut(true);
+            if(tri != null) {
+                sink.add(tri);
+                if(DEBUG){
+                    System.err.println("CDTri.gen["+i+"].1: "+tri);
+                }
+            }
+        }
+        if( TEST_ENABLED ) {
+            final float[] tempV2 = new float[2];
+            final CDTriangulator2DExpAddOn addOn = new CDTriangulator2DExpAddOn();
+            final int sinkSize = sink.size();
+            if( TEST_MARK_LINE ) {
+                for(int i=0; i<sinkSize; i++) {
+                    final Triangle t0 = sink.get(i);
+                    addOn.markLineInTriangle(t0, tempV2);
+                }
+            } else if ( TEST_LINE_AA ){
+                for(int i=0; i<sinkSize-1; i+=2) {
+                    final Triangle t0 = sink.get(i);
+                    final Triangle t1 = sink.get(i+1);
+                    /* final float[] rect =  */ addOn.processLineAA(i, t0, t1, tempV2);
+                }
+            }
         }
-        return triangles;
     }
 
-    private GraphOutline extractBoundaryTriangles(GraphOutline outline, boolean hole) {
-        GraphOutline innerOutline = new GraphOutline();
-        ArrayList<GraphVertex> outVertices = outline.getGraphPoint();
-        int size = outVertices.size();
+    private GraphOutline extractBoundaryTriangles(final List<Triangle> sink, final GraphOutline outline, final boolean hole, final float sharpness) {
+        final GraphOutline innerOutline = new GraphOutline();
+        final ArrayList<GraphVertex> outVertices = outline.getGraphPoint();
+        final int size = outVertices.size();
         for(int i=0; i < size; i++) {
-            GraphVertex currentVertex = outVertices.get(i);
-            GraphVertex gv0 = outVertices.get((i+size-1)%size);
-            GraphVertex gv2 = outVertices.get((i+1)%size);
-            GraphVertex gv1 = currentVertex;
+            final GraphVertex gv1 = outVertices.get(i);               // currentVertex
+            final GraphVertex gv0 = outVertices.get((i+size-1)%size); // -1
+            final GraphVertex gv2 = outVertices.get((i+1)%size);      // +1
 
-            if(!currentVertex.getPoint().isOnCurve()) {
-                Vertex v0 = gv0.getPoint().clone();
-                Vertex v2 = gv2.getPoint().clone();
-                Vertex v1 = gv1.getPoint().clone();
+            if( !gv1.getPoint().isOnCurve() ) {
+                final Vertex v0 = gv0.getPoint().clone();
+                final Vertex v2 = gv2.getPoint().clone();
+                final Vertex v1 = gv1.getPoint().clone();
+                addedVerticeCount += 3;
+                final boolean[] boundaryVertices = { true, true, true };
 
                 gv0.setBoundaryContained(true);
                 gv1.setBoundaryContained(true);
@@ -157,48 +183,50 @@ public class CDTriangulator2D implements Triangulator{
                 final boolean holeLike;
                 if(VectorUtil.ccw(v0,v1,v2)) {
                     holeLike = false;
-                    t = new Triangle(v0, v1, v2);
+                    t = new Triangle(v0, v1, v2, boundaryVertices);
                 } else {
                     holeLike = true;
-                    t = new Triangle(v2, v1, v0);
+                    t = new Triangle(v2, v1, v0, boundaryVertices);
                 }
                 t.setId(maxTriID++);
-                triangles.add(t);
+                sink.add(t);
                 if(DEBUG){
                     System.err.println(t);
                 }
                 if( hole || holeLike ) {
-                    v0.setTexCoord(0, -0.1f);
-                    v2.setTexCoord(1, -0.1f);
-                    v1.setTexCoord(0.5f, -1*sharpness -0.1f);
-                    innerOutline.addVertex(currentVertex);
+                    v0.setTexCoord(0.0f,           -0.1f, 0f);
+                    v2.setTexCoord(1.0f,           -0.1f, 0f);
+                    v1.setTexCoord(0.5f, -sharpness-0.1f, 0f);
+                    innerOutline.addVertex(gv1);
                 } else {
-                    v0.setTexCoord(0, 0.1f);
-                    v2.setTexCoord(1, 0.1f);
-                    v1.setTexCoord(0.5f, sharpness+0.1f);
+                    v0.setTexCoord(0.0f,            0.1f, 0f);
+                    v2.setTexCoord(1.0f,            0.1f, 0f);
+                    v1.setTexCoord(0.5f,  sharpness+0.1f, 0f);
                 }
-            }
-            else {
-                if(!gv2.getPoint().isOnCurve() || !gv0.getPoint().isOnCurve()){
-                    currentVertex.setBoundaryContained(true);
+                if(DEBUG) {
+                    System.err.println("CDTri.ebt["+i+"].0: hole "+(hole || holeLike)+" "+gv1+", "+t);
+                }
+            } else {
+                if( !gv2.getPoint().isOnCurve() || !gv0.getPoint().isOnCurve() ) {
+                    gv1.setBoundaryContained(true);
+                }
+                innerOutline.addVertex(gv1);
+                if(DEBUG) {
+                    System.err.println("CDTri.ebt["+i+"].1: "+gv1);
                 }
-                innerOutline.addVertex(currentVertex);
             }
         }
         return innerOutline;
     }
 
-    private Loop getContainerLoop(Outline polyline) {
-        ArrayList<Vertex> vertices = polyline.getVertices();
+    private Loop getContainerLoop(final Outline polyline) {
+        final ArrayList<Vertex> vertices = polyline.getVertices();
         for(int i=0; i < loops.size(); i++) {
-            Loop loop = loops.get(i);
-            boolean inside = false;
+            final Loop loop = loops.get(i);
             for(int j=0; j < vertices.size(); j++) {
-                Vertex v = vertices.get(j);
-                inside |= loop.checkInside(v);
-            }
-            if(inside) {
-                return loop;
+                if( loop.checkInside( vertices.get(j) ) ) {
+                    return loop;
+                }
             }
         }
         return null;
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2DExpAddOn.java b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2DExpAddOn.java
new file mode 100644
index 0000000..a836e20
--- /dev/null
+++ b/src/jogl/classes/jogamp/graph/curve/tess/CDTriangulator2DExpAddOn.java
@@ -0,0 +1,340 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package jogamp.graph.curve.tess;
+
+import com.jogamp.graph.geom.Triangle;
+import com.jogamp.graph.geom.Vertex;
+import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.math.VectorUtil;
+
+/**
+ * Experimental Add-On ..
+ *
+ *  Disabled by default
+ */
+public class CDTriangulator2DExpAddOn {
+
+    private final float[] tempV3a = new float[3];
+    private final float[] tempV3b = new float[3];
+
+    protected final void markLineInTriangle(final Triangle tri1, final float[] tempV2) {
+        if( !tri1.isOnCurve() || !tri1.isLine() ) {
+            return;
+        }
+
+        final boolean[] boundVs = tri1.getVerticesBoundary();
+        final Vertex[] triVs = tri1.getVertices();
+        final Vertex v0 = triVs[0];
+        final Vertex v1 = triVs[1];
+        final Vertex v2 = triVs[2];
+
+        int lineSegCount = 0;
+        final boolean v0IsLS, v1IsLS, v2IsLS;
+        if( v0.isOnCurve() && VectorUtil.isVec2Zero(v0.getTexCoord(), 0) && !boundVs[0] ) {
+            v0IsLS = true;
+            lineSegCount++;
+        } else {
+            v0IsLS = false;
+        }
+        if( v1.isOnCurve() && VectorUtil.isVec2Zero(v1.getTexCoord(), 0) && !boundVs[1] ) {
+            v1IsLS = true;
+            lineSegCount++;
+        } else {
+            v1IsLS = false;
+        }
+        if( v2.isOnCurve() && VectorUtil.isVec2Zero(v2.getTexCoord(), 0) && !boundVs[2] ) {
+            v2IsLS = true;
+            lineSegCount++;
+        } else {
+            v2IsLS = false;
+        }
+        if( 2 > lineSegCount ) {
+            return;
+        } else {
+            if(CDTriangulator2D.DEBUG) {
+                System.err.println("CDTri.markLine.1: "+tri1);
+                System.err.println("CDTri.markLine.1: count "+lineSegCount+", v0IsLS "+v0IsLS+", v1IsLS "+v1IsLS+", v2IsLS "+v2IsLS);
+            }
+            final float texZTag = 2f;
+            if( true ) {
+                if( v0IsLS ) {
+                    v0.setTexCoord(0f, 0f, texZTag);
+                }
+                if( v1IsLS ) {
+                    v1.setTexCoord(0f, 0f, texZTag);
+                }
+                if( v2IsLS ) {
+                    v2.setTexCoord(0f, 0f, texZTag);
+                }
+            } else {
+                if( v0IsLS ) {
+                    final Vertex v = v0.clone();
+                    v.setTexCoord(0f, 0f, texZTag);
+                    triVs[0] = v;
+                }
+                if( v1IsLS ) {
+                    final Vertex v = v1.clone();
+                    v.setTexCoord(0f, 0f, texZTag);
+                    triVs[1] = v;
+                }
+                if( v2IsLS ) {
+                    final Vertex v = v2.clone();
+                    v.setTexCoord(0f, 0f, texZTag);
+                    triVs[2] = v;
+                }
+            }
+            if ( false ) {
+                final Vertex vL1, vL2, vL3, vO;
+                if( 3 == lineSegCount ) {
+                    vL1 = v0; vL2=v1; vL3=v2; vO=null;
+                } else if( v0IsLS && v1IsLS ) {
+                    vL1 = v0; vL2=v1; vL3=null; vO=v2;
+                } else if( v0IsLS && v2IsLS ) {
+                    vL1 = v0; vL2=v2; vL3=null; vO=v1;
+                } else if( v1IsLS && v2IsLS ) {
+                    vL1 = v1; vL2=v2; vL3=null; vO=v0;
+                } else {
+                    return; // unreachable
+                }
+                if( null != vL1 ) {
+                    vL1.setTexCoord(texZTag, 0f, 0f);
+                }
+                if( null != vL2 ) {
+                    vL2.setTexCoord(texZTag, 0f, 0f);
+                }
+                if( null != vL3 ) {
+                    vL3.setTexCoord(texZTag, 0f, 0f);
+                }
+            }
+        }
+    }
+
+    /**
+     * If this and the other triangle compose a rectangle return the
+     * given <code>tempV2</code> array w/ shortest side first.
+     * Otherwise return null;
+     * <p>
+     * Experimental CODE, enabled only if {@link #TEST_LINE_AA} is set .. WIP
+     * </p>
+     * <p>
+       One test uses method: ROESSLER-2012-OGLES <http://www.cg.tuwien.ac.at/research/publications/2012/ROESSLER-2012-OGLES/>
+     * </p>
+     * <p>
+     * However, we would need to tesselate all lines appropriately,
+     * i.e. create 2 triangles sharing the middle actual line using thickness+radius.
+     *
+     * This test simply used our default font w/ a line thickness of 2 pixels,
+     * which produced mentioned rectangles.
+     * This is of course not the case for arbitrary Outline shapes.
+     * </p>
+     * @param tri2
+     * @param checkThisOnCurve
+     * @param tempV2 temp float[2] storage
+     */
+    protected final float[] processLineAA(final int i, final Triangle tri1, final Triangle tri2, final float[] tempV2) {
+        if(CDTriangulator2D.DEBUG){
+            System.err.println("CDTri.genP2["+i+"].1: ? t1 "+tri1);
+            System.err.println("CDTri.genP2["+i+"].1: ? t2 "+tri2);
+        }
+        final float[] rect = processLineAAImpl(tri1, tri2, tempV2);
+        if(CDTriangulator2D.DEBUG){
+            if( null != rect ) {
+                System.err.println("CDTri.genP2["+i+"].1: RECT ["+rect[0]+", "+rect[1]+"]");
+                System.err.println("CDTri.genP2["+i+"].1: RECT t1 "+tri1);
+                System.err.println("CDTri.genP2["+i+"].1: RECT t2 "+tri2);
+            } else {
+                System.err.println("CDTri.genP2["+i+"].1: RECT NOPE, t1 "+tri1);
+                System.err.println("CDTri.genP2["+i+"].1: RECT NOPE, t2 "+tri2);
+            }
+        }
+        return rect;
+    }
+    private final float[] processLineAAImpl(final Triangle tri1, final Triangle tri2, final float[] tempV2) {
+        if( !tri1.isOnCurve() || !tri2.isOnCurve() || !tri1.isLine() || !tri2.isLine() ) {
+            return null;
+        }
+        final float[] rect;
+        int eqCount = 0;
+        final int[] commonIdxA = { -1, -1 };
+        final int[] commonIdxB = { -1, -1 };
+        final Vertex[] verts1 = tri1.getVertices();
+        final Vertex[] verts2 = tri2.getVertices();
+        float[] coord = verts1[0].getCoord();
+        if( VectorUtil.isVec3Equal(coord, 0, verts2[0].getCoord(), 0, FloatUtil.EPSILON) ) {
+            commonIdxA[eqCount] = 0;
+            commonIdxB[eqCount] = 0;
+            eqCount++;
+        } else if( VectorUtil.isVec3Equal(coord, 0, verts2[1].getCoord(), 0, FloatUtil.EPSILON) ) {
+            commonIdxA[eqCount] = 0;
+            commonIdxB[eqCount] = 1;
+            eqCount++;
+        } else if( VectorUtil.isVec3Equal(coord, 0, verts2[2].getCoord(), 0, FloatUtil.EPSILON) ) {
+            commonIdxA[eqCount] = 0;
+            commonIdxB[eqCount] = 2;
+            eqCount++;
+        }
+        coord = verts1[1].getCoord();
+        if( VectorUtil.isVec3Equal(coord, 0, verts2[0].getCoord(), 0, FloatUtil.EPSILON) ) {
+            commonIdxA[eqCount] = 1;
+            commonIdxB[eqCount] = 0;
+            eqCount++;
+        } else if( VectorUtil.isVec3Equal(coord, 0, verts2[1].getCoord(), 0, FloatUtil.EPSILON) ) {
+            commonIdxA[eqCount] = 1;
+            commonIdxB[eqCount] = 1;
+            eqCount++;
+        } else if( VectorUtil.isVec3Equal(coord, 0, verts2[2].getCoord(), 0, FloatUtil.EPSILON) ) {
+            commonIdxA[eqCount] = 1;
+            commonIdxB[eqCount] = 2;
+            eqCount++;
+        }
+        final int otherIdxA;
+        if( 2 == eqCount ) {
+            otherIdxA = 3 - ( commonIdxA[0] + commonIdxA[1] );
+        } else {
+            coord = verts1[2].getCoord();
+            if( VectorUtil.isVec3Equal(coord, 0, verts2[0].getCoord(), 0, FloatUtil.EPSILON) ) {
+                commonIdxA[eqCount] = 2;
+                commonIdxB[eqCount] = 0;
+                eqCount++;
+            } else if( VectorUtil.isVec3Equal(coord, 0, verts2[1].getCoord(), 0, FloatUtil.EPSILON) ) {
+                commonIdxA[eqCount] = 2;
+                commonIdxB[eqCount] = 1;
+                eqCount++;
+            } else if( VectorUtil.isVec3Equal(coord, 0, verts2[2].getCoord(), 0, FloatUtil.EPSILON) ) {
+                commonIdxA[eqCount] = 2;
+                commonIdxB[eqCount] = 2;
+                eqCount++;
+            }
+            if( 2 == eqCount ) {
+                otherIdxA = 3 - ( commonIdxA[0] + commonIdxA[1] );
+            } else {
+                otherIdxA = -1;
+            }
+        }
+        if( 0 <= otherIdxA && commonIdxB[0] != commonIdxB[1] ) {
+            final int otherIdxB = 3 - ( commonIdxB[0] + commonIdxB[1] );
+            // Reference must be equal, i.e. sharing the actual same vertices!
+            if( verts1[commonIdxA[0]] != verts2[commonIdxB[0]] || verts1[commonIdxA[1]] != verts2[commonIdxB[1]] ) {
+                throw new InternalError("XXX: diff shared verts"); // FIXME remove when clear
+            }
+            final Vertex vC0A, vC1A, vOA, vOB;
+            if( false ) {
+                // Fetch only!
+                vC0A = verts1[commonIdxA[0]];
+                vC1A = verts1[commonIdxA[1]];
+                vOA = verts1[otherIdxA];
+                vOB = verts2[otherIdxB];
+            } else {
+                // Fetch and clone, write-back to triangles
+                vC0A = verts1[commonIdxA[0]].clone();
+                verts1[commonIdxA[0]] = vC0A;
+                verts2[commonIdxB[0]] = vC0A;
+                vC1A = verts1[commonIdxA[1]].clone();
+                verts1[commonIdxA[1]] = vC1A;
+                verts2[commonIdxB[1]] = vC1A;
+                vOA = verts1[otherIdxA].clone();
+                verts1[otherIdxA] = vOA;
+                vOB = verts2[otherIdxB].clone();
+                verts2[otherIdxB] = vOB;
+            }
+
+            final float texZTag = 2f;
+            final float[] vOACoords = vOA.getCoord();
+            final float dOC0A = VectorUtil.distVec3(vOACoords, vC0A.getCoord());
+            final float dOC1A = VectorUtil.distVec3(vOACoords, vC1A.getCoord());
+            if( false ) {
+                final float[] vec3Z = { 0f, 0f, -1f };
+                final float[] vecLongSide, vecLineHeight;
+                if( dOC0A < dOC1A ) {
+                    tempV2[0] = dOC0A; // line width
+                    tempV2[1] = dOC1A; // long side
+                    vecLongSide = VectorUtil.normalizeVec3( VectorUtil.subVec2(tempV3a, vOACoords, vC1A.getCoord()) ); // normal long side vector
+                    vecLineHeight = VectorUtil.crossVec3(tempV3b, vec3Z, tempV3a); // the line-height vector (normal)
+                    vOA.setTexCoord(-1f, -1f, texZTag);
+                    vC1A.setTexCoord(1f, -1f, texZTag);
+                    vOB.setTexCoord(0f,   1f, texZTag);
+                    vC0A.setTexCoord(0f,  1f, texZTag);
+                } else {
+                    tempV2[0] = dOC1A; // line width
+                    tempV2[1] = dOC0A; // long side
+                    vecLongSide = VectorUtil.normalizeVec3( VectorUtil.subVec2(tempV3a, vOACoords, vC0A.getCoord()) ); // normal long side vector
+                    vecLineHeight = VectorUtil.crossVec3(tempV3b, vec3Z, tempV3a); // the line-height vector (normal)
+                }
+                if(CDTriangulator2D.DEBUG){
+                    System.err.println("RECT.0 : long-side-vec   "+vecLongSide[0]+", "+vecLongSide[1]+", "+vecLongSide[2]);
+                    System.err.println("RECT.0 : line-height-vec "+vecLineHeight[0]+", "+vecLineHeight[1]+", "+vecLineHeight[2]);
+                }
+
+            } else {
+                /**
+                 * Using method: ROESSLER-2012-OGLES <http://www.cg.tuwien.ac.at/research/publications/2012/ROESSLER-2012-OGLES/>
+                 *
+                 * Arbitrary but consistently pick left/right and set texCoords, FIXME: validate
+                 *
+                 * Testing w/ fixed line-width 1, and radius 1/3.
+                 */
+                final float lineWidth;
+                final Vertex vL1, vL2, vR1, vR2;
+                if( dOC0A < dOC1A ) {
+                    lineWidth = dOC0A; // line width
+                    tempV2[0] = dOC0A; // line width
+                    tempV2[1] = dOC1A; // long side
+                    // Left:  vOA, vC1A
+                    // Right: vOB, vC0A
+                    vL1 = vOA; vL2 = vC1A;
+                    vR1 = vOB; vR2 = vC0A;
+                } else {
+                    lineWidth = dOC1A; // line width
+                    tempV2[0] = dOC1A; // line width
+                    tempV2[1] = dOC0A; // long side
+                    // Left:  vOB, vC1A
+                    // Right: vOA, vC0A
+                    vL1 = vOB; vL2 = vC1A;
+                    vR1 = vOA; vR2 = vC0A;
+                }
+                final float r = lineWidth/3f;
+                final float wa = lineWidth + r;
+                final float waHalf = wa / 2f;
+                vL1.setTexCoord(lineWidth,  waHalf, texZTag);
+                vL2.setTexCoord(lineWidth,  waHalf, texZTag);
+                vR1.setTexCoord(lineWidth, -waHalf, texZTag);
+                vR2.setTexCoord(lineWidth, -waHalf, texZTag);
+                if(CDTriangulator2D.DEBUG){
+                    System.err.println("RECT.0 : lineWidth: "+lineWidth+", dim "+dOC0A+" x "+dOC1A+", radius "+r);
+                    System.err.println("RECT Left.0: "+vL1+", "+vL2);
+                    System.err.println("RECT Right.0: "+vR1+", "+vR2);
+                }
+            }
+            rect = tempV2;
+        } else {
+            rect = null;
+        }
+        return rect;
+    }
+}
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java b/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java
index 2e8d4f5..81e6efd 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/GraphOutline.java
@@ -44,9 +44,9 @@ public class GraphOutline {
      * the curve pieces can be identified by onCurve flag
      * of each cp the control polyline is open by default
      */
-    public GraphOutline(Outline ol){
+    public GraphOutline(final Outline ol){
         this.outline = ol;
-        ArrayList<Vertex> vertices = this.outline.getVertices();
+        final ArrayList<Vertex> vertices = this.outline.getVertices();
         for(int i = 0; i< vertices.size(); i++){
             this.controlpoints.add(new GraphVertex(vertices.get(i)));
         }
@@ -64,7 +64,7 @@ public class GraphOutline {
         return outline.getVertices();
     }
 
-    public void addVertex(GraphVertex v) {
+    public void addVertex(final GraphVertex v) {
         controlpoints.add(v);
         outline.addVertex(v.getPoint());
     }
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java b/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java
index 1ef1d8c..391e710 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/GraphVertex.java
@@ -36,7 +36,7 @@ public class GraphVertex {
     private ArrayList<HEdge> edges = null;
     private boolean boundaryContained = false;
 
-    public GraphVertex(Vertex point) {
+    public GraphVertex(final Vertex point) {
         this.point = point;
     }
 
@@ -59,7 +59,7 @@ public class GraphVertex {
         return point.getCoord();
     }
 
-    public void setPoint(Vertex point) {
+    public void setPoint(final Vertex point) {
         this.point = point;
     }
 
@@ -67,17 +67,17 @@ public class GraphVertex {
         return edges;
     }
 
-    public void setEdges(ArrayList<HEdge> edges) {
+    public void setEdges(final ArrayList<HEdge> edges) {
         this.edges = edges;
     }
 
-    public void addEdge(HEdge edge){
+    public void addEdge(final HEdge edge){
         if(edges == null){
             edges = new ArrayList<HEdge>();
         }
         edges.add(edge);
     }
-    public void removeEdge(HEdge edge){
+    public void removeEdge(final HEdge edge){
         if(edges == null)
             return;
         edges.remove(edge);
@@ -85,9 +85,9 @@ public class GraphVertex {
             edges = null;
         }
     }
-    public HEdge findNextEdge(GraphVertex nextVert){
+    public HEdge findNextEdge(final GraphVertex nextVert){
         for(int i=0; i<edges.size(); i++) {
-            HEdge e = edges.get(i);
+            final HEdge e = edges.get(i);
             if(e.getNext().getGraphPoint() == nextVert){
                 return e;
             }
@@ -96,16 +96,16 @@ public class GraphVertex {
     }
     public HEdge findBoundEdge(){
         for(int i=0; i<edges.size(); i++) {
-            HEdge e = edges.get(i);
+            final HEdge e = edges.get(i);
             if((e.getType() == HEdge.BOUNDARY) || (e.getType() == HEdge.HOLE)){
                 return e;
             }
         }
         return null;
     }
-    public HEdge findPrevEdge(GraphVertex prevVert){
+    public HEdge findPrevEdge(final GraphVertex prevVert){
         for(int i=0; i<edges.size(); i++) {
-            HEdge e = edges.get(i);
+            final HEdge e = edges.get(i);
             if(e.getPrev().getGraphPoint() == prevVert){
                 return e;
             }
@@ -117,7 +117,11 @@ public class GraphVertex {
         return boundaryContained;
     }
 
-    public void setBoundaryContained(boolean boundaryContained) {
+    public void setBoundaryContained(final boolean boundaryContained) {
         this.boundaryContained = boundaryContained;
     }
+
+    public String toString() {
+        return "GraphVertex[contained "+boundaryContained+", "+point+"]";
+    }
 }
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java b/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java
index acaa3d7..4976fd1 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/HEdge.java
@@ -32,9 +32,9 @@ import com.jogamp.graph.geom.Triangle;
 
 
 public class HEdge {
-    public static int BOUNDARY = 3;
-    public static int INNER = 1;
-    public static int HOLE = 2;
+    public static final int BOUNDARY = 3;
+    public static final int INNER = 1;
+    public static final int HOLE = 2;
 
     private GraphVertex vert;
     private HEdge prev = null;
@@ -43,12 +43,12 @@ public class HEdge {
     private int type = BOUNDARY;
     private Triangle triangle = null;
 
-    public HEdge(GraphVertex vert, int type) {
+    public HEdge(final GraphVertex vert, final int type) {
         this.vert = vert;
         this.type = type;
     }
 
-    public HEdge(GraphVertex vert, HEdge prev, HEdge next, HEdge sibling, int type) {
+    public HEdge(final GraphVertex vert, final HEdge prev, final HEdge next, final HEdge sibling, final int type) {
         this.vert = vert;
         this.prev = prev;
         this.next = next;
@@ -56,7 +56,7 @@ public class HEdge {
         this.type = type;
     }
 
-    public HEdge(GraphVertex vert, HEdge prev, HEdge next, HEdge sibling, int type, Triangle triangle) {
+    public HEdge(final GraphVertex vert, final HEdge prev, final HEdge next, final HEdge sibling, final int type, final Triangle triangle) {
         this.vert = vert;
         this.prev = prev;
         this.next = next;
@@ -69,7 +69,7 @@ public class HEdge {
         return vert;
     }
 
-    public void setVert(GraphVertex vert) {
+    public void setVert(final GraphVertex vert) {
         this.vert = vert;
     }
 
@@ -77,7 +77,7 @@ public class HEdge {
         return prev;
     }
 
-    public void setPrev(HEdge prev) {
+    public void setPrev(final HEdge prev) {
         this.prev = prev;
     }
 
@@ -85,7 +85,7 @@ public class HEdge {
         return next;
     }
 
-    public void setNext(HEdge next) {
+    public void setNext(final HEdge next) {
         this.next = next;
     }
 
@@ -93,7 +93,7 @@ public class HEdge {
         return sibling;
     }
 
-    public void setSibling(HEdge sibling) {
+    public void setSibling(final HEdge sibling) {
         this.sibling = sibling;
     }
 
@@ -101,7 +101,7 @@ public class HEdge {
         return type;
     }
 
-    public void setType(int type) {
+    public void setType(final int type) {
         this.type = type;
     }
 
@@ -109,16 +109,16 @@ public class HEdge {
         return triangle;
     }
 
-    public void setTriangle(Triangle triangle) {
+    public void setTriangle(final Triangle triangle) {
         this.triangle = triangle;
     }
 
-    public static <T extends Vertex> void connect(HEdge first, HEdge next){
+    public static <T extends Vertex> void connect(final HEdge first, final HEdge next){
         first.setNext(next);
         next.setPrev(first);
     }
 
-    public static <T extends Vertex> void makeSiblings(HEdge first, HEdge second){
+    public static <T extends Vertex> void makeSiblings(final HEdge first, final HEdge second){
         first.setSibling(second);
         second.setSibling(first);
     }
diff --git a/src/jogl/classes/jogamp/graph/curve/tess/Loop.java b/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
index c1dafc0..6563219 100644
--- a/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
+++ b/src/jogl/classes/jogamp/graph/curve/tess/Loop.java
@@ -37,10 +37,10 @@ import com.jogamp.opengl.math.geom.AABBox;
 
 public class Loop {
     private HEdge root = null;
-    private AABBox box = new AABBox();
+    private final AABBox box = new AABBox();
     private GraphOutline initialOutline = null;
 
-    public Loop(GraphOutline polyline, VectorUtil.Winding winding){
+    public Loop(final GraphOutline polyline, final VectorUtil.Winding winding){
         initialOutline = polyline;
         this.root = initFromPolyline(initialOutline, winding);
     }
@@ -49,27 +49,25 @@ public class Loop {
         return root;
     }
 
-    public Triangle cut(boolean delaunay){
+    public Triangle cut(final boolean delaunay){
         if(isSimplex()){
-            Triangle t = new Triangle(root.getGraphPoint().getPoint(), root.getNext().getGraphPoint().getPoint(),
-                    root.getNext().getNext().getGraphPoint().getPoint());
-            t.setVerticesBoundary(checkVerticesBoundary(root));
-            return t;
+            return new Triangle(root.getGraphPoint().getPoint(), root.getNext().getGraphPoint().getPoint(),
+                                root.getNext().getNext().getGraphPoint().getPoint(), checkVerticesBoundary(root));
         }
-        HEdge prev = root.getPrev();
-        HEdge next1 = root.getNext();
+        final HEdge prev = root.getPrev();
+        final HEdge next1 = root.getNext();
 
-        HEdge next2 = findClosestValidNeighbor(next1.getNext(), delaunay);
+        final HEdge next2 = findClosestValidNeighbor(next1.getNext(), delaunay);
         if(next2 == null){
             root = root.getNext();
             return null;
         }
 
-        GraphVertex v1 = root.getGraphPoint();
-        GraphVertex v2 = next1.getGraphPoint();
-        GraphVertex v3 = next2.getGraphPoint();
+        final GraphVertex v1 = root.getGraphPoint();
+        final GraphVertex v2 = next1.getGraphPoint();
+        final GraphVertex v3 = next2.getGraphPoint();
 
-        HEdge v3Edge = new HEdge(v3, HEdge.INNER);
+        final HEdge v3Edge = new HEdge(v3, HEdge.INNER);
 
         HEdge.connect(v3Edge, root);
         HEdge.connect(next1, v3Edge);
@@ -83,7 +81,7 @@ public class Loop {
         HEdge.connect(prev, v3EdgeSib);
         HEdge.connect(v3EdgeSib, next2);
 
-        Triangle t = createTriangle(v1.getPoint(), v2.getPoint(), v3.getPoint(), root);
+        final Triangle t = createTriangle(v1.getPoint(), v2.getPoint(), v3.getPoint(), root);
         this.root = next2;
         return t;
     }
@@ -96,8 +94,8 @@ public class Loop {
      * from the boundary profile
      * @param reqWinding requested winding of edges (CCW or CW)
      */
-    private HEdge initFromPolyline(GraphOutline outline, VectorUtil.Winding reqWinding){
-        ArrayList<GraphVertex> vertices = outline.getGraphPoint();
+    private HEdge initFromPolyline(final GraphOutline outline, final VectorUtil.Winding reqWinding){
+        final ArrayList<GraphVertex> vertices = outline.getGraphPoint();
 
         if(vertices.size()<3) {
             throw new IllegalArgumentException("outline's vertices < 3: " + vertices.size());
@@ -126,10 +124,10 @@ public class Loop {
         }
 
         while(index != max){
-            GraphVertex v1 = vertices.get(index);
+            final GraphVertex v1 = vertices.get(index);
             box.resize(v1.getX(), v1.getY(), v1.getZ());
 
-            HEdge edge = new HEdge(v1, edgeType);
+            final HEdge edge = new HEdge(v1, edgeType);
 
             v1.addEdge(edge);
             if(lastEdge != null) {
@@ -157,15 +155,15 @@ public class Loop {
         return firstEdge;
     }
 
-    public void addConstraintCurve(GraphOutline polyline) {
+    public void addConstraintCurve(final GraphOutline polyline) {
         //        GraphOutline outline = new GraphOutline(polyline);
         /**needed to generate vertex references.*/
         initFromPolyline(polyline, VectorUtil.Winding.CW);
 
-        GraphVertex v3 = locateClosestVertex(polyline);
-        HEdge v3Edge = v3.findBoundEdge();
-        HEdge v3EdgeP = v3Edge.getPrev();
-        HEdge crossEdge = new HEdge(root.getGraphPoint(), HEdge.INNER);
+        final GraphVertex v3 = locateClosestVertex(polyline);
+        final HEdge v3Edge = v3.findBoundEdge();
+        final HEdge v3EdgeP = v3Edge.getPrev();
+        final HEdge crossEdge = new HEdge(root.getGraphPoint(), HEdge.INNER);
 
         HEdge.connect(root.getPrev(), crossEdge);
         HEdge.connect(crossEdge, v3Edge);
@@ -186,26 +184,26 @@ public class Loop {
      * to search for closestvertices
      * @return the vertex that is closest to the newly set root Hedge.
      */
-    private GraphVertex locateClosestVertex(GraphOutline polyline) {
+    private GraphVertex locateClosestVertex(final GraphOutline polyline) {
         HEdge closestE = null;
         GraphVertex closestV = null;
 
         float minDistance = Float.MAX_VALUE;
         boolean inValid = false;
-        ArrayList<GraphVertex> initVertices = initialOutline.getGraphPoint();
-        ArrayList<GraphVertex> vertices = polyline.getGraphPoint();
+        final ArrayList<GraphVertex> initVertices = initialOutline.getGraphPoint();
+        final ArrayList<GraphVertex> vertices = polyline.getGraphPoint();
 
         for(int i=0; i< initVertices.size()-1; i++){
-            GraphVertex v = initVertices.get(i);
-            GraphVertex nextV = initVertices.get(i+1);
+            final GraphVertex v = initVertices.get(i);
+            final GraphVertex nextV = initVertices.get(i+1);
             for(int pos=0; pos<vertices.size(); pos++) {
-                GraphVertex cand = vertices.get(pos);
-                float distance = VectorUtil.computeLength(v.getCoord(), cand.getCoord());
+                final GraphVertex cand = vertices.get(pos);
+                final float distance = VectorUtil.distVec3(v.getCoord(), cand.getCoord());
                 if(distance < minDistance){
-                    for (GraphVertex vert:vertices){
+                    for (final GraphVertex vert:vertices){
                         if(vert == v || vert == nextV || vert == cand)
                             continue;
-                        inValid = VectorUtil.inCircle(v.getPoint(), nextV.getPoint(),
+                        inValid = VectorUtil.isInCircleVec2(v.getPoint(), nextV.getPoint(),
                                 cand.getPoint(), vert.getPoint());
                         if(inValid){
                             break;
@@ -228,19 +226,19 @@ public class Loop {
         return closestV;
     }
 
-    private HEdge findClosestValidNeighbor(HEdge edge, boolean delaunay) {
-        HEdge next = root.getNext();
+    private HEdge findClosestValidNeighbor(final HEdge edge, final boolean delaunay) {
+        final HEdge next = root.getNext();
 
         if(!VectorUtil.ccw(root.getGraphPoint().getPoint(), next.getGraphPoint().getPoint(),
                 edge.getGraphPoint().getPoint())){
             return null;
         }
 
-        HEdge candEdge = edge;
+        final HEdge candEdge = edge;
         boolean inValid = false;
 
         if(delaunay){
-            Vertex cand = candEdge.getGraphPoint().getPoint();
+            final Vertex cand = candEdge.getGraphPoint().getPoint();
             HEdge e = candEdge.getNext();
             while (e != candEdge){
                 if(e.getGraphPoint() == root.getGraphPoint()
@@ -249,7 +247,7 @@ public class Loop {
                     e = e.getNext();
                     continue;
                 }
-                inValid = VectorUtil.inCircle(root.getGraphPoint().getPoint(), next.getGraphPoint().getPoint(),
+                inValid = VectorUtil.isInCircleVec2(root.getGraphPoint().getPoint(), next.getGraphPoint().getPoint(),
                                               cand, e.getGraphPoint().getPoint());
                 if(inValid){
                     break;
@@ -271,31 +269,25 @@ public class Loop {
      * @param root and edge of this triangle
      * @return the triangle iff it satisfies, null otherwise
      */
-    private Triangle createTriangle(Vertex v1, Vertex v2, Vertex v3, HEdge rootT){
-        Triangle t = new Triangle(v1, v2, v3);
-        t.setVerticesBoundary(checkVerticesBoundary(rootT));
-        return t;
+    private Triangle createTriangle(final Vertex v1, final Vertex v2, final Vertex v3, final HEdge rootT){
+        return new Triangle(v1, v2, v3, checkVerticesBoundary(rootT));
     }
 
-    private boolean[] checkVerticesBoundary(HEdge rootT) {
-        boolean[] boundary = new boolean[3];
-        HEdge e1 = rootT;
-        HEdge e2 = rootT.getNext();
-        HEdge e3 = rootT.getNext().getNext();
-
-        if(e1.getGraphPoint().isBoundaryContained()){
+    private boolean[] checkVerticesBoundary(final HEdge rootT) {
+        final boolean[] boundary = new boolean[3];
+        if(rootT.getGraphPoint().isBoundaryContained()){
                 boundary[0] = true;
         }
-        if(e2.getGraphPoint().isBoundaryContained()){
+        if(rootT.getNext().getGraphPoint().isBoundaryContained()){
                 boundary[1] = true;
         }
-        if(e3.getGraphPoint().isBoundaryContained()){
+        if(rootT.getNext().getNext().getGraphPoint().isBoundaryContained()){
                 boundary[2] = true;
         }
         return boundary;
     }
 
-    public boolean checkInside(Vertex v) {
+    public boolean checkInside(final Vertex v) {
         if(!box.contains(v.getX(), v.getY(), v.getZ())){
             return false;
         }
@@ -304,8 +296,8 @@ public class Loop {
         HEdge current = root;
         HEdge next = root.getNext();
         do {
-            Vertex v2 = current.getGraphPoint().getPoint();
-            Vertex v1 = next.getGraphPoint().getPoint();
+            final Vertex v2 = current.getGraphPoint().getPoint();
+            final Vertex v1 = next.getGraphPoint().getPoint();
 
             if ( ((v1.getY() > v.getY()) != (v2.getY() > v.getY())) &&
                   (v.getX() < (v2.getX() - v1.getX()) * (v.getY() - v1.getY()) / (v2.getY() - v1.getY()) + v1.getX()) ){
diff --git a/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java b/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java
deleted file mode 100644
index ff46c33..0000000
--- a/src/jogl/classes/jogamp/graph/curve/text/GlyphShape.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package jogamp.graph.curve.text;
-
-import java.util.ArrayList;
-
-import com.jogamp.graph.geom.Vertex;
-import com.jogamp.graph.geom.Triangle;
-import com.jogamp.graph.geom.Vertex.Factory;
-
-import com.jogamp.graph.curve.OutlineShape;
-import com.jogamp.opengl.math.Quaternion;
-
-public class GlyphShape {
-
-    private Quaternion quat= null;
-    private OutlineShape shape = null;
-
-    /** Create a new Glyph shape
-     * based on Parametric curve control polyline
-     */
-    public GlyphShape(Vertex.Factory<? extends Vertex> factory){
-        shape = new OutlineShape(factory);
-    }
-
-    /** Create a new GlyphShape from a {@link OutlineShape}
-     * @param factory vertex impl factory {@link Factory}
-     * @param shape {@link OutlineShape} representation of the Glyph
-     */
-    public GlyphShape(Vertex.Factory<? extends Vertex> factory, OutlineShape shape){
-        this(factory);
-        this.shape = shape;
-        this.shape.transformOutlines(OutlineShape.VerticesState.QUADRATIC_NURBS);
-    }
-
-    public final Vertex.Factory<? extends Vertex> vertexFactory() { return shape.vertexFactory(); }
-
-    public OutlineShape getShape() {
-        return shape;
-    }
-
-    public int getNumVertices() {
-        return shape.getVertices().size();
-    }
-
-    /** Get the rotational Quaternion attached to this Shape
-     * @return the Quaternion Object
-     */
-    public Quaternion getQuat() {
-        return quat;
-    }
-
-    /** Set the Quaternion that shall defien the rotation
-     * of this shape.
-     * @param quat
-     */
-    public void setQuat(Quaternion quat) {
-        this.quat = quat;
-    }
-
-    /** Triangluate the glyph shape
-     * @return ArrayList of triangles which define this shape
-     */
-    public ArrayList<Triangle> triangulate(){
-        return shape.triangulate();
-    }
-
-    /** Get the list of Vertices of this Object
-     * @return arrayList of Vertices
-     */
-    public ArrayList<Vertex> getVertices(){
-        return shape.getVertices();
-    }
-}
diff --git a/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java b/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java
deleted file mode 100644
index 2284ab6..0000000
--- a/src/jogl/classes/jogamp/graph/curve/text/GlyphString.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package jogamp.graph.curve.text;
-
-import java.util.ArrayList;
-
-import com.jogamp.graph.font.Font;
-import com.jogamp.graph.geom.Vertex;
-import com.jogamp.graph.geom.Triangle;
-import com.jogamp.graph.geom.Vertex.Factory;
-import com.jogamp.graph.geom.opengl.SVertex;
-
-import javax.media.opengl.GL2ES2;
-
-import jogamp.graph.curve.opengl.RegionFactory;
-import jogamp.graph.font.FontInt;
-
-import com.jogamp.graph.curve.OutlineShape;
-import com.jogamp.graph.curve.Region;
-import com.jogamp.graph.curve.opengl.GLRegion;
-import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.opengl.math.geom.AABBox;
-import com.jogamp.opengl.util.PMVMatrix;
-
-public class GlyphString {
-    /** Static font size for all default font OutlineShape generations via {@link #createString(OutlineShape, Factory, Font, String)}.
-     * <p>The actual font size shall be accomplished by the GL PMV matrix.</p>
-     */
-    public static final int STATIC_FONT_SIZE = 10;
-
-    private ArrayList<GlyphShape> glyphs = new ArrayList<GlyphShape>();
-    private CharSequence str;
-    private String fontname;
-    private GLRegion region;
-
-    private SVertex origin = new SVertex();
-
-    /**
-     * <p>Uses {@link #STATIC_FONT_SIZE}.</p>
-     * <p>No caching is performed.</p>
-     *
-     * @param shape is not null, add all {@link GlyphShape}'s {@link Outline} to this instance.
-     * @param vertexFactory vertex impl factory {@link Factory}
-     * @param font the target {@link Font}
-     * @param str string text
-     * @return the created {@link GlyphString} instance
-     */
-    public static GlyphString createString(OutlineShape shape, Factory<? extends Vertex> vertexFactory, Font font, String str) {
-        return createString(shape, vertexFactory, font, STATIC_FONT_SIZE, str);
-    }
-
-    /**
-     * <p>No caching is performed.</p>
-     *
-     * @param shape is not null, add all {@link GlyphShape}'s {@link Outline} to this instance.
-     * @param vertexFactory vertex impl factory {@link Factory}
-     * @param font the target {@link Font}
-     * @param fontSize font size
-     * @param str string text
-     * @return the created {@link GlyphString} instance
-     */
-    public static GlyphString createString(OutlineShape shape, Factory<? extends Vertex> vertexFactory, Font font, int fontSize, String str) {
-    	ArrayList<OutlineShape> shapes = ((FontInt)font).getOutlineShapes(str, fontSize, vertexFactory);
-
-        GlyphString glyphString = new GlyphString(font.getName(Font.NAME_UNIQUNAME), str);
-        glyphString.createfromOutlineShapes(vertexFactory, shapes);
-        if(null != shape) {
-            for(int i=0; i<glyphString.glyphs.size(); i++) {
-                shape.addOutlineShape(glyphString.glyphs.get(i).getShape());
-            }
-        }
-        return glyphString;
-    }
-
-    /** Create a new GlyphString object
-     * @param fontname the name of the font that this String is
-     * associated with
-     * @param str the string object
-     */
-    public GlyphString(String fontname, CharSequence str){
-        this.fontname = fontname;
-        this.str = str;
-    }
-
-    public void addGlyphShape(GlyphShape glyph){
-        glyphs.add(glyph);
-    }
-
-    public CharSequence getString(){
-        return str;
-    }
-
-    /**Creates the Curve based Glyphs from a list of {@link OutlineShape}
-     * @param vertexFactory vertex impl factory {@link Factory}
-     * @param shapes list of {@link OutlineShape}
-     */
-    public void createfromOutlineShapes(Factory<? extends Vertex> vertexFactory, ArrayList<OutlineShape> shapes) {
-        final int numGlyps = shapes.size();
-        for (int index=0;index<numGlyps;index++){
-            if(shapes.get(index) == null){
-                continue;
-            }
-            GlyphShape glyphShape = new GlyphShape(vertexFactory, shapes.get(index));
-
-            if(glyphShape.getNumVertices() < 3) {
-                continue;
-            }
-            addGlyphShape(glyphShape);
-        }
-    }
-
-
-    /** Generate a OGL Region to represent this Object.
-     * @param gl the current gl object
-     * @param rs the current attached RenderState
-     * @param renderModes bit-field of modes, e.g. {@link Region#VARIABLE_CURVE_WEIGHT_BIT}, {@link Region#VBAA_RENDERING_BIT}
-     */
-    public GLRegion createRegion(GL2ES2 gl, int renderModes){
-        region = RegionFactory.create(renderModes);
-        // region.setFlipped(true);
-
-        int numVertices = region.getNumVertices();
-
-        for(int i=0; i< glyphs.size(); i++) {
-            final GlyphShape glyph = glyphs.get(i);
-            ArrayList<Triangle> gtris = glyph.triangulate();
-            region.addTriangles(gtris);
-
-            final ArrayList<Vertex> gVertices = glyph.getVertices();
-            for(int j=0; j<gVertices.size(); j++) {
-                final Vertex gVert = gVertices.get(j);
-                gVert.setId(numVertices++);
-                region.addVertex(gVert);
-            }
-        }
-        return region;
-    }
-
-    /** Generate a Hashcode for this object
-     * @return a string defining the hashcode
-     */
-    public String getTextHashCode(){
-        return "" + fontname.hashCode() + str.hashCode();
-    }
-
-    /** Render the Object based using the associated Region
-     *  previously generated.
-     */
-    public void renderString3D(GL2ES2 gl) {
-        region.draw(gl, null, 0, 0, null);
-    }
-    /** Render the Object based using the associated Region
-     *  previously generated.
-     * @param matrix current {@link PMVMatrix}.
-     * @param rs the RenderState to be used
-     * @param vp_width current screen width
-     * @param vp_height current screen height
-     * @param texWidth desired texture width for multipass-rendering.
-     *        The actual used texture-width is written back when mp rendering is enabled, otherwise the store is untouched.
-     */
-    public void renderString3D(GL2ES2 gl, RenderState rs, int vp_width, int vp_height, int[/*1*/] texWidth) {
-        region.draw(gl, rs, vp_width, vp_height, texWidth);
-    }
-
-    /** Get the Origin of this GlyphString
-     * @return
-     */
-    public Vertex getOrigin() {
-        return origin;
-    }
-
-    /** Destroy the associated OGL objects
-     * @param rs the current attached RenderState
-     */
-    public void destroy(GL2ES2 gl, RenderState rs) {
-        if(null != gl && null != rs) {
-            region.destroy(gl, rs);
-            region = null;
-        } else if(null != region) {
-            throw new InternalError("destroy called w/o GL context, but has a region");
-        }
-        glyphs.clear();
-    }
-
-    public AABBox getBounds(){
-        return region.getBounds();
-    }
-}
diff --git a/src/jogl/classes/jogamp/graph/font/FontInt.java b/src/jogl/classes/jogamp/graph/font/FontInt.java
deleted file mode 100644
index 4366724..0000000
--- a/src/jogl/classes/jogamp/graph/font/FontInt.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * Copyright 2011 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package jogamp.graph.font;
-
-import java.util.ArrayList;
-
-import jogamp.graph.geom.plane.Path2D;
-
-import com.jogamp.graph.curve.OutlineShape;
-import com.jogamp.graph.font.Font;
-import com.jogamp.graph.geom.Vertex;
-import com.jogamp.graph.geom.Vertex.Factory;
-
-public interface FontInt extends Font {
-
-    public interface GlyphInt extends Font.Glyph {
-        public Path2D getPath();  // unscaled path
-        public Path2D getPath(float pixelSize);
-    }
-
-    public ArrayList<OutlineShape> getOutlineShapes(CharSequence string, float pixelSize, Factory<? extends Vertex> vertexFactory);
-}
diff --git a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
index e3df0af..1bb2bb5 100644
--- a/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
+++ b/src/jogl/classes/jogamp/graph/font/JavaFontLoader.java
@@ -78,7 +78,7 @@ public class JavaFontLoader implements FontSet {
         }
     }
 
-    static boolean is(int bits, int bit) {
+    static boolean is(final int bits, final int bit) {
         return 0 != ( bits & bit ) ;
     }
 
@@ -88,7 +88,7 @@ public class JavaFontLoader implements FontSet {
     }
 
     @Override
-    public Font get(int family, int style) throws IOException {
+    public Font get(final int family, final int style) throws IOException {
         Font font = (Font)fontMap.get( ( family << 8 ) | style );
         if (font != null) {
             return font;
@@ -138,7 +138,7 @@ public class JavaFontLoader implements FontSet {
         return font;
     }
 
-    Font abspath(String fname, int family, int style) throws IOException {
+    Font abspath(final String fname, final int family, final int style) throws IOException {
         if(null == javaFontPath) {
             throw new GLException("java font path undefined");
         }
@@ -151,7 +151,7 @@ public class JavaFontLoader implements FontSet {
                 return f;
             }
             throw new IOException (err);
-        } catch (IOException ioe) {
+        } catch (final IOException ioe) {
             throw new IOException(err, ioe);
         }
     }
diff --git a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
index e1e44c9..7694787 100644
--- a/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
+++ b/src/jogl/classes/jogamp/graph/font/UbuntuFontLoader.java
@@ -38,9 +38,7 @@ import com.jogamp.graph.font.Font;
 import com.jogamp.graph.font.FontSet;
 import com.jogamp.graph.font.FontFactory;
 
-import java.net.MalformedURLException;
 import java.net.URI;
-import java.net.URISyntaxException;
 import java.net.URLConnection;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
@@ -78,7 +76,7 @@ public class UbuntuFontLoader implements FontSet {
     private UbuntuFontLoader() {
     }
 
-    static boolean is(int bits, int bit) {
+    static boolean is(final int bits, final int bit) {
         return 0 != ( bits & bit ) ;
     }
 
@@ -88,7 +86,7 @@ public class UbuntuFontLoader implements FontSet {
     }
 
     @Override
-    public Font get(int family, int style) throws IOException {
+    public Font get(final int family, final int style) throws IOException {
         Font font = (Font)fontMap.get( ( family << 8 ) | style );
         if (font != null) {
             return font;
@@ -134,7 +132,7 @@ public class UbuntuFontLoader implements FontSet {
     private static boolean attemptedJARLoading = false;
     private static boolean useTempJarCache = false;
 
-    private synchronized Font abspath(String fname, int family, int style) throws IOException {
+    private synchronized Font abspath(final String fname, final int family, final int style) throws IOException {
         final String err = "Problem loading font "+fname+", stream "+relFontPath+fname;
         final Exception[] privErr = { null };
         try {
@@ -152,7 +150,7 @@ public class UbuntuFontLoader implements FontSet {
                         public Object run() {
                             try {
                                 TempJarCache.addResources(UbuntuFontLoader.class, uri);
-                            } catch (Exception e) { privErr[0] = e; }
+                            } catch (final Exception e) { privErr[0] = e; }
                             return null;
                         } } );
                     if( null == privErr[0] ) {
@@ -164,7 +162,7 @@ public class UbuntuFontLoader implements FontSet {
                     }
                 }
             }
-        } catch(Exception e) {
+        } catch(final Exception e) {
             throw new IOException(err, e);
         }
         if( null != privErr[0] ) {
@@ -184,7 +182,7 @@ public class UbuntuFontLoader implements FontSet {
                     try {
                         final URI uri = TempJarCache.getResource(absFontPath+fname);
                         privConn[0] = null != uri ? uri.toURL().openConnection() : null;
-                    } catch (Exception e) { privErr[0] = e; }
+                    } catch (final Exception e) { privErr[0] = e; }
                     return null;
                 } } );
             if( null != privErr[0] ) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
index 67ae6c3..c48ef99 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFont.java
@@ -27,9 +27,6 @@
  */
 package jogamp.graph.font.typecast;
 
-import java.util.ArrayList;
-
-import jogamp.graph.font.FontInt;
 import jogamp.graph.font.typecast.ot.OTFont;
 import jogamp.graph.font.typecast.ot.OTFontCollection;
 import jogamp.graph.font.typecast.ot.table.CmapFormat;
@@ -38,44 +35,43 @@ import jogamp.graph.font.typecast.ot.table.CmapTable;
 import jogamp.graph.font.typecast.ot.table.HdmxTable;
 import jogamp.graph.font.typecast.ot.table.ID;
 import jogamp.graph.geom.plane.AffineTransform;
-import jogamp.graph.geom.plane.Path2D;
 
 import com.jogamp.common.util.IntObjectHashMap;
 import com.jogamp.graph.curve.OutlineShape;
 import com.jogamp.graph.font.Font;
 import com.jogamp.graph.font.FontFactory;
-import com.jogamp.graph.font.Font.Glyph;
+import com.jogamp.graph.geom.SVertex;
 import com.jogamp.graph.geom.Vertex;
-import com.jogamp.graph.geom.Vertex.Factory;
 import com.jogamp.opengl.math.geom.AABBox;
 
-class TypecastFont implements FontInt {
+class TypecastFont implements Font {
     static final boolean DEBUG = false;
+    private static final Vertex.Factory<SVertex> vertexFactory = SVertex.factory();
 
-    final OTFontCollection fontset;
-    final OTFont font;
-    TypecastHMetrics metrics;
-    final CmapFormat cmapFormat;
-    int cmapentries;
-
+    // private final OTFontCollection fontset;
+    /* pp */ final OTFont font;
+    private final CmapFormat cmapFormat;
+    private final int cmapentries;
+    private final IntObjectHashMap char2Glyph;
+    private final TypecastHMetrics metrics;
+    private final float[] tmpV3 = new float[3];
     // FIXME: Add cache size to limit memory usage ??
-    IntObjectHashMap char2Glyph;
 
-    public TypecastFont(OTFontCollection fontset) {
-        this.fontset = fontset;
+    public TypecastFont(final OTFontCollection fontset) {
+        // this.fontset = fontset;
         this.font = fontset.getFont(0);
 
         // FIXME: Generic attempt to find the best CmapTable,
         // which is assumed to be the one with the most entries (stupid 'eh?)
-        CmapTable cmapTable = font.getCmapTable();
-        CmapFormat[] _cmapFormatP = { null, null, null, null };
+        final CmapTable cmapTable = font.getCmapTable();
+        final CmapFormat[] _cmapFormatP = { null, null, null, null };
         int platform = -1;
         int platformLength = -1;
         int encoding = -1;
         for(int i=0; i<cmapTable.getNumTables(); i++) {
-            CmapIndexEntry cmapIdxEntry = cmapTable.getCmapIndexEntry(i);
-            int pidx = cmapIdxEntry.getPlatformId();
-            CmapFormat cf = cmapIdxEntry.getFormat();
+            final CmapIndexEntry cmapIdxEntry = cmapTable.getCmapIndexEntry(i);
+            final int pidx = cmapIdxEntry.getPlatformId();
+            final CmapFormat cf = cmapIdxEntry.getFormat();
             if(DEBUG) {
                 System.err.println("CmapFormat["+i+"]: platform " + pidx +
                                    ", encoding "+cmapIdxEntry.getEncodingId() + ": "+cf);
@@ -124,10 +120,13 @@ class TypecastFont implements FontInt {
             }
         }
 
-        cmapentries = 0;
-        for (int i = 0; i < cmapFormat.getRangeCount(); ++i) {
-            CmapFormat.Range range = cmapFormat.getRange(i);
-            cmapentries += range.getEndCode() - range.getStartCode() + 1; // end included
+        {
+            int _cmapentries = 0;
+            for (int i = 0; i < cmapFormat.getRangeCount(); ++i) {
+                final CmapFormat.Range range = cmapFormat.getRange(i);
+                _cmapentries += range.getEndCode() - range.getStartCode() + 1; // end included
+            }
+            cmapentries = _cmapentries;
         }
         if(DEBUG) {
             System.err.println("font direction hint: "+font.getHeadTable().getFontDirectionHint());
@@ -136,28 +135,29 @@ class TypecastFont implements FontInt {
             System.err.println("num cmap ranges: "+cmapFormat.getRangeCount());
 
             for (int i = 0; i < cmapFormat.getRangeCount(); ++i) {
-                CmapFormat.Range range = cmapFormat.getRange(i);
+                final CmapFormat.Range range = cmapFormat.getRange(i);
                 for (int j = range.getStartCode(); j <= range.getEndCode(); ++j) {
                     final int code = cmapFormat.mapCharCode(j);
                     if(code < 15) {
-                        System.err.println(" char: " + (int)j + " ( " + (char)j +" ) -> " + code);
+                        System.err.println(" char: " + j + " ( " + (char)j +" ) -> " + code);
                     }
                 }
             }
         }
         char2Glyph = new IntObjectHashMap(cmapentries + cmapentries/4);
+        metrics = new TypecastHMetrics(this);
     }
 
     @Override
-    public StringBuilder getName(StringBuilder sb, int nameIndex) {
+    public StringBuilder getName(final StringBuilder sb, final int nameIndex) {
         return font.getName(nameIndex, sb);
     }
     @Override
-    public String getName(int nameIndex) {
+    public String getName(final int nameIndex) {
         return getName(null, nameIndex).toString();
     }
     @Override
-    public StringBuilder getAllNames(StringBuilder sb, String separator) {
+    public StringBuilder getAllNames(final StringBuilder sb, final String separator) {
         return font.getAllNames(sb, separator);
     }
     @Override
@@ -168,20 +168,17 @@ class TypecastFont implements FontInt {
     }
 
     @Override
-    public float getAdvanceWidth(int i, float pixelSize) {
-        return font.getHmtxTable().getAdvanceWidth(i) * metrics.getScale(pixelSize);
+    public float getAdvanceWidth(final int glyphID, final float pixelSize) {
+        return font.getHmtxTable().getAdvanceWidth(glyphID) * metrics.getScale(pixelSize);
     }
 
     @Override
-    public Metrics getMetrics() {
-        if (metrics == null) {
-            metrics = new TypecastHMetrics(this);
-        }
+    public final Metrics getMetrics() {
         return metrics;
     }
 
     @Override
-    public Glyph getGlyph(char symbol) {
+    public Glyph getGlyph(final char symbol) {
         TypecastGlyph result = (TypecastGlyph) char2Glyph.get(symbol);
         if (null == result) {
             // final short code = (short) char2Code.get(symbol);
@@ -202,11 +199,13 @@ class TypecastFont implements FontInt {
             if(null == glyph) {
                 throw new RuntimeException("Could not retrieve glyph for symbol: <"+symbol+"> "+(int)symbol+" -> glyph id "+code);
             }
-            Path2D path = TypecastRenderer.buildPath(glyph);
-            result = new TypecastGlyph(this, symbol, code, glyph.getBBox(), glyph.getAdvanceWidth(), path);
+            final OutlineShape shape = TypecastRenderer.buildShape(symbol, glyph, vertexFactory);
+            result = new TypecastGlyph(this, symbol, code, glyph.getBBox(), glyph.getAdvanceWidth(), shape);
             if(DEBUG) {
-                System.err.println("New glyph: " + (int)symbol + " ( " + (char)symbol +" ) -> " + code + ", contours " + glyph.getPointCount() + ": " + path);
+                System.err.println("New glyph: " + (int)symbol + " ( " + symbol +" ) -> " + code + ", contours " + glyph.getPointCount() + ": " + shape);
             }
+            glyph.clearPointData();
+
             final HdmxTable hdmx = font.getHdmxTable();
             if (null!= result && null != hdmx) {
                 /*if(DEBUG) {
@@ -227,40 +226,45 @@ class TypecastFont implements FontInt {
     }
 
     @Override
-    public ArrayList<OutlineShape> getOutlineShapes(CharSequence string, float pixelSize, Factory<? extends Vertex> vertexFactory) {
-    	AffineTransform transform = new AffineTransform(vertexFactory);
-    	return TypecastRenderer.getOutlineShapes(this, string, pixelSize, transform, vertexFactory);
+    public final float getPixelSize(final float fontSize /* points per inch */, final float resolution) {
+        return fontSize * resolution / ( 72f /* points per inch */ );
+    }
+
+    @Override
+    public float getLineHeight(final float pixelSize) {
+        final Metrics metrics = getMetrics();
+        final float lineGap = metrics.getLineGap(pixelSize) ; // negative value!
+        final float ascent = metrics.getAscent(pixelSize) ; // negative value!
+        final float descent = metrics.getDescent(pixelSize) ; // positive value!
+        final float advanceY = lineGap - descent + ascent;  // negative value!
+        return -advanceY;
     }
 
     @Override
-    public float getStringWidth(CharSequence string, float pixelSize) {
+    public float getMetricWidth(final CharSequence string, final float pixelSize) {
         float width = 0;
         final int len = string.length();
-        for (int i=0; i< len; i++)
-        {
-            char character = string.charAt(i);
+        for (int i=0; i< len; i++) {
+            final char character = string.charAt(i);
             if (character == '\n') {
                 width = 0;
             } else {
-                Glyph glyph = getGlyph(character);
+                final Glyph glyph = getGlyph(character);
                 width += glyph.getAdvance(pixelSize, false);
             }
         }
-
         return (int)(width + 0.5f);
     }
 
     @Override
-    public float getStringHeight(CharSequence string, float pixelSize) {
+    public float getMetricHeight(final CharSequence string, final float pixelSize, final AABBox tmp) {
         int height = 0;
 
-        for (int i=0; i<string.length(); i++)
-        {
-            char character = string.charAt(i);
-            if (character != ' ')
-            {
-                Glyph glyph = getGlyph(character);
-                AABBox bbox = glyph.getBBox(pixelSize);
+        for (int i=0; i<string.length(); i++) {
+            final char character = string.charAt(i);
+            if (character != ' ') {
+                final Glyph glyph = getGlyph(character);
+                final AABBox bbox = glyph.getBBox(tmp, pixelSize, tmpV3);
                 height = (int)Math.ceil(Math.max(bbox.getHeight(), height));
             }
         }
@@ -268,35 +272,77 @@ class TypecastFont implements FontInt {
     }
 
     @Override
-    public AABBox getStringBounds(CharSequence string, float pixelSize) {
+    public AABBox getMetricBounds(final CharSequence string, final float pixelSize) {
         if (string == null) {
             return new AABBox();
         }
-        final Metrics metrics = getMetrics();
-        final float lineGap = metrics.getLineGap(pixelSize);
-        final float ascent = metrics.getAscent(pixelSize);
-        final float descent = metrics.getDescent(pixelSize);
-        final float advanceY = lineGap - descent + ascent;
+        final int charCount = string.length();
+        final float lineHeight = getLineHeight(pixelSize);
         float totalHeight = 0;
         float totalWidth = 0;
         float curLineWidth = 0;
-        for (int i=0; i<string.length(); i++) {
-            char character = string.charAt(i);
+        for (int i=0; i<charCount; i++) {
+            final char character = string.charAt(i);
             if (character == '\n') {
                 totalWidth = Math.max(curLineWidth, totalWidth);
                 curLineWidth = 0;
-                totalHeight -= advanceY;
+                totalHeight += lineHeight;
                 continue;
             }
-            Glyph glyph = getGlyph(character);
+            final Glyph glyph = getGlyph(character);
             curLineWidth += glyph.getAdvance(pixelSize, true);
         }
         if (curLineWidth > 0) {
-            totalHeight -= advanceY;
+            totalHeight += lineHeight;
             totalWidth = Math.max(curLineWidth, totalWidth);
         }
         return new AABBox(0, 0, 0, totalWidth, totalHeight,0);
     }
+    @Override
+    public AABBox getPointsBounds(final AffineTransform transform, final CharSequence string, final float pixelSize,
+                                  final AffineTransform temp1, final AffineTransform temp2) {
+        if (string == null) {
+            return new AABBox();
+        }
+        final int charCount = string.length();
+        final float lineHeight = getLineHeight(pixelSize);
+        final float scale = getMetrics().getScale(pixelSize);
+        final AABBox tbox = new AABBox();
+        final AABBox res = new AABBox();
+
+        float y = 0;
+        float advanceTotal = 0;
+
+        for(int i=0; i< charCount; i++) {
+            final char character = string.charAt(i);
+            if( '\n' == character ) {
+                y -= lineHeight;
+                advanceTotal = 0;
+            } else if (character == ' ') {
+                advanceTotal += getAdvanceWidth(Glyph.ID_SPACE, pixelSize);
+            } else {
+                // reset transform
+                if( null != transform ) {
+                    temp1.setTransform(transform);
+                } else {
+                    temp1.setToIdentity();
+                }
+                temp1.translate(advanceTotal, y, temp2);
+                temp1.scale(scale, scale, temp2);
+                tbox.reset();
+
+                final Font.Glyph glyph = getGlyph(character);
+                res.resize(temp1.transform(glyph.getBBox(), tbox));
+
+                final OutlineShape glyphShape = glyph.getShape();
+                if( null == glyphShape ) {
+                    continue;
+                }
+                advanceTotal += glyph.getAdvance(pixelSize, true);
+            }
+        }
+        return res;
+    }
 
     @Override
     final public int getNumGlyphs() {
@@ -304,7 +350,7 @@ class TypecastFont implements FontInt {
     }
 
     @Override
-    public boolean isPrintableChar( char c ) {
+    public boolean isPrintableChar( final char c ) {
         return FontFactory.isPrintableChar(c);
     }
 
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
index d7db981..6154484 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastFontConstructor.java
@@ -45,14 +45,14 @@ public class TypecastFontConstructor implements FontConstructor  {
 
     @Override
     public Font create(final File ffile) throws IOException {
-        Object o = AccessController.doPrivileged(new PrivilegedAction<Object>() {
+        final Object o = AccessController.doPrivileged(new PrivilegedAction<Object>() {
             @Override
             public Object run() {
                 OTFontCollection fontset;
                 try {
                     fontset = OTFontCollection.create(ffile);
                     return new TypecastFont(fontset);
-                } catch (IOException e) {
+                } catch (final IOException e) {
                     return e;
                 }
             }
@@ -83,7 +83,7 @@ public class TypecastFontConstructor implements FontConstructor  {
                     }
                     f = create(tf);
                     tf.delete();
-                } catch (IOException e) {
+                } catch (final IOException e) {
                     e.printStackTrace();
                 }
                 return f;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
index 574aeb8..5bd49dc 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastGlyph.java
@@ -27,56 +27,55 @@
  */
 package jogamp.graph.font.typecast;
 
-import java.util.HashMap;
-
-import jogamp.graph.font.FontInt;
-import jogamp.graph.geom.plane.AffineTransform;
-import jogamp.graph.geom.plane.Path2D;
-
+import com.jogamp.common.util.IntIntHashMap;
+import com.jogamp.graph.curve.OutlineShape;
 import com.jogamp.graph.font.Font;
 import com.jogamp.opengl.math.geom.AABBox;
 
-public class TypecastGlyph implements FontInt.GlyphInt {
-    public class Advance
+public class TypecastGlyph implements Font.Glyph {
+    public static class Advance
     {
-        final Font      font;
-        final float     advance;
-        HashMap<Float, Float> size2advance = new HashMap<Float, Float>();
+        private final Font      font;
+        private final float     advance;
+        private final IntIntHashMap size2advanceI = new IntIntHashMap();
 
-        public Advance(Font font, float advance)
+        public Advance(final Font font, final float advance)
         {
             this.font = font;
             this.advance = advance;
+            size2advanceI.setKeyNotFoundValue(0);
         }
 
         public void reset() {
-            size2advance.clear();
+            size2advanceI.clear();
         }
 
-        public float getScale(float pixelSize)
+        public float getScale(final float pixelSize)
         {
             return this.font.getMetrics().getScale(pixelSize);
         }
 
-        public void add(float advance, float size)
+        public void add(final float advance, final float size)
         {
-            size2advance.put(size, advance);
+            size2advanceI.put(Float.floatToIntBits(size), Float.floatToIntBits(advance));
         }
 
-        public float get(float size, boolean useFrationalMetrics)
+        public float get(final float size, final boolean useFrationalMetrics)
         {
-            Float fo = size2advance.get(size);
-            if(null == fo) {
-                float value = (this.advance * getScale(size));
-                if (useFrationalMetrics == false) {
-                    //value = (float)Math.ceil(value);
-                    // value = (int)value;
-                    value = (int) ( value + 0.5f ) ; // TODO: check
-                }
-                size2advance.put(size, value);
-                return value;
+            final int sI = Float.floatToIntBits(size);
+            final int aI = size2advanceI.get(sI);
+            if( 0 != aI ) {
+                return Float.intBitsToFloat(aI);
+            }
+            final float a;
+            if ( useFrationalMetrics ) {
+                a = this.advance * getScale(size);
+            } else {
+                // a = Math.ceil(this.advance * getScale(size));
+                a = Math.round(this.advance * getScale(size)); // TODO: check whether ceil should be used instead?
             }
-            return fo.floatValue();
+            size2advanceI.put(sI, Float.floatToIntBits(a));
+            return a;
         }
 
         @Override
@@ -84,16 +83,16 @@ public class TypecastGlyph implements FontInt.GlyphInt {
         {
             return "\nAdvance:"+
                 "\n  advance: "+this.advance+
-                "\n advances: \n"+size2advance;
+                "\n advances: \n"+size2advanceI;
         }
     }
 
-    public class Metrics
+    public static class Metrics
     {
-        AABBox    bbox;
-        Advance advance;
+        private final AABBox    bbox;
+        private final Advance advance;
 
-        public Metrics(Font font, AABBox bbox, float advance)
+        public Metrics(final Font font, final AABBox bbox, final float advance)
         {
             this.bbox = bbox;
             this.advance = new Advance(font, advance);
@@ -103,7 +102,7 @@ public class TypecastGlyph implements FontInt.GlyphInt {
             advance.reset();
         }
 
-        public float getScale(float pixelSize)
+        public float getScale(final float pixelSize)
         {
             return this.advance.getScale(pixelSize);
         }
@@ -113,12 +112,12 @@ public class TypecastGlyph implements FontInt.GlyphInt {
             return this.bbox;
         }
 
-        public void addAdvance(float advance, float size)
+        public void addAdvance(final float advance, final float size)
         {
             this.advance.add(advance, size);
         }
 
-        public float getAdvance(float size, boolean useFrationalMetrics)
+        public float getAdvance(final float size, final boolean useFrationalMetrics)
         {
             return this.advance.get(size, useFrationalMetrics);
         }
@@ -136,105 +135,83 @@ public class TypecastGlyph implements FontInt.GlyphInt {
     public static final short MAX_ID        = (short)((1 << 16) - 2);
 
     private final Font font;
+    private final char symbol;
+    private final OutlineShape shape; // in EM units
+    private final short id;
+    private final int advance;
+    private final Metrics metrics;
 
-    char        symbol;
-    short       id;
-    int         advance;
-    Metrics     metrics;
-
-    protected Path2D path; // in EM units
-    protected Path2D pathSized;
-    protected float numberSized;
-
-    protected TypecastGlyph(Font font, char symbol) {
+    protected TypecastGlyph(final Font font, final char symbol, final short id, final AABBox bbox, final int advance, final OutlineShape shape) {
         this.font = font;
         this.symbol = symbol;
-    }
-
-    protected TypecastGlyph(Font font,
-                            char symbol, short id, AABBox bbox, int advance, Path2D path) {
-        this.font = font;
-        this.symbol = symbol;
-        this.advance = advance;
-
-        init(id, bbox, advance);
-
-        this.path = path;
-        this.pathSized = null;
-        this.numberSized = 0.0f;
-    }
-
-    void init(short id, AABBox bbox, int advance) {
+        this.shape = shape;
         this.id = id;
         this.advance = advance;
         this.metrics = new Metrics(this.font, bbox, this.advance);
     }
 
+    /**
     public void reset(Path2D path) {
         this.path = path;
         this.metrics.reset();
-    }
+    } */
 
     @Override
-    public Font getFont() {
+    public final Font getFont() {
         return this.font;
     }
 
     @Override
-    public char getSymbol() {
+    public final char getSymbol() {
         return this.symbol;
     }
 
-    AABBox getBBoxUnsized() {
+    final AABBox getBBoxUnsized() {
         return this.metrics.getBBox();
     }
 
-    public AABBox getBBox() {
+    @Override
+    public final AABBox getBBox() {
         return this.metrics.getBBox();
     }
 
-    public Metrics getMetrics() {
+    public final Metrics getMetrics() {
         return this.metrics;
     }
 
-    public short getID() {
+    @Override
+    public final short getID() {
         return this.id;
     }
 
-    public float getScale(float pixelSize) {
+    @Override
+    public final float getScale(final float pixelSize) {
         return this.metrics.getScale(pixelSize);
     }
 
     @Override
-    public AABBox getBBox(float pixelSize) {
-        final float size = getScale(pixelSize);
-        AABBox newBox = getBBox().clone();
-        newBox.scale(size);
-        return newBox;
+    public final AABBox getBBox(final AABBox dest, final float pixelSize, final float[] tmpV3) {
+        return dest.copy(getBBox()).scale(getScale(pixelSize), tmpV3);
     }
 
-    protected void addAdvance(float advance, float size) {
+    protected final void addAdvance(final float advance, final float size) {
         this.metrics.addAdvance(advance, size);
     }
 
     @Override
-    public float getAdvance(float pixelSize, boolean useFrationalMetrics) {
+    public final float getAdvance(final float pixelSize, final boolean useFrationalMetrics) {
         return this.metrics.getAdvance(pixelSize, useFrationalMetrics);
     }
 
     @Override
-    public Path2D getPath() {
-        return this.path;
+    public final OutlineShape getShape() {
+        return this.shape;
     }
 
     @Override
-    public Path2D getPath(float pixelSize) {
-        final float size = getScale(pixelSize);
-
-        if (this.numberSized != size) {
-            this.numberSized = size;
-            this.pathSized = AffineTransform.getScaleInstance(null, size, size).createTransformedShape(getPath());
-        }
-        return this.pathSized;
+    public final int hashCode() {
+        // 31 * x == (x << 5) - x
+        final int hash = 31 + font.getName(Font.NAME_UNIQUNAME).hashCode();
+        return ((hash << 5) - hash) + id;
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
index ecc41e4..d5e30a5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastHMetrics.java
@@ -45,46 +45,44 @@ class TypecastHMetrics implements Metrics {
     // VheaTable (for horizontal fonts)
     // private final VheaTable vheaTable;
 
-    public TypecastHMetrics(TypecastFont fontImpl) {
+    public TypecastHMetrics(final TypecastFont fontImpl) {
         this.fontImpl = fontImpl;
         headTable = this.fontImpl.font.getHeadTable();
         hheaTable = this.fontImpl.font.getHheaTable();
         // vheaTable = this.fontImpl.font.getVheaTable();
-        unitsPerEM_Inv = 1.0f / ( (float) headTable.getUnitsPerEm() );
+        unitsPerEM_Inv = 1.0f / ( headTable.getUnitsPerEm() );
 
-        int maxWidth = headTable.getXMax() - headTable.getXMin();
-        int maxHeight = headTable.getYMax() - headTable.getYMin();
-        float lowx= headTable.getXMin();
-        float lowy = -(headTable.getYMin()+maxHeight);
-        float highx = lowx + maxWidth;
-        float highy = lowy + maxHeight;
+        final int maxWidth = headTable.getXMax() - headTable.getXMin();
+        final int maxHeight = headTable.getYMax() - headTable.getYMin();
+        final float lowx= headTable.getXMin();
+        final float lowy = -(headTable.getYMin()+maxHeight);
+        final float highx = lowx + maxWidth;
+        final float highy = lowy + maxHeight;
         bbox = new AABBox(lowx, lowy, 0, highx, highy, 0); // invert
     }
 
     @Override
-    public final float getAscent(float pixelSize) {
+    public final float getAscent(final float pixelSize) {
         return getScale(pixelSize) * -hheaTable.getAscender(); // invert
     }
     @Override
-    public final float getDescent(float pixelSize) {
+    public final float getDescent(final float pixelSize) {
         return getScale(pixelSize) * -hheaTable.getDescender(); // invert
     }
     @Override
-    public final float getLineGap(float pixelSize) {
+    public final float getLineGap(final float pixelSize) {
         return getScale(pixelSize) * -hheaTable.getLineGap(); // invert
     }
     @Override
-    public final float getMaxExtend(float pixelSize) {
+    public final float getMaxExtend(final float pixelSize) {
         return getScale(pixelSize) * hheaTable.getXMaxExtent();
     }
     @Override
-    public final float getScale(float pixelSize) {
+    public final float getScale(final float pixelSize) {
         return pixelSize * unitsPerEM_Inv;
     }
     @Override
-    public final AABBox getBBox(float pixelSize) {
-        AABBox res = new AABBox(bbox.getLow(), bbox.getHigh());
-        res.scale(getScale(pixelSize));
-        return res;
+    public final AABBox getBBox(final AABBox dest, final float pixelSize, final float[] tmpV3) {
+        return dest.setSize(bbox.getLow(), bbox.getHigh()).scale(getScale(pixelSize), tmpV3);
     }
 }
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java b/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
index 127e260..f78656b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/TypecastRenderer.java
@@ -27,196 +27,197 @@
  */
 package jogamp.graph.font.typecast;
 
-import java.util.ArrayList;
-
-import jogamp.graph.font.FontInt.GlyphInt;
 import jogamp.graph.font.typecast.ot.OTGlyph;
 import jogamp.graph.font.typecast.ot.Point;
-import jogamp.graph.geom.plane.AffineTransform;
-import jogamp.graph.geom.plane.Path2D;
-import jogamp.graph.geom.plane.PathIterator;
+import jogamp.opengl.Debug;
 
 import com.jogamp.graph.curve.OutlineShape;
-import com.jogamp.graph.font.Font;
-import com.jogamp.graph.font.Font.Glyph;
 import com.jogamp.graph.geom.Vertex;
 import com.jogamp.graph.geom.Vertex.Factory;
 
 /**
- * Factory to build a {@link com.jogamp.graph.geom.Path2D Path2D} from
+ * Factory to build an {@link OutlineShape} from
  * {@link jogamp.graph.font.typecast.ot.OTGlyph Glyph}s.
+ *
+ * http://www.freetype.org/freetype2/docs/glyphs/glyphs-3.html
+ * http://walon.org/pub/ttf/ttf_glyphs.htm
  */
 public class TypecastRenderer {
+    private static final boolean DEBUG = Debug.debug("graph.font.Renderer");
 
-    private static void getPaths(TypecastFont font,
-            CharSequence string, float pixelSize, AffineTransform transform, Path2D[] p)
-    {
-        if (string == null) {
-            return;
-        }
-        Font.Metrics metrics = font.getMetrics();
-        float advanceTotal = 0;
-        float lineGap = metrics.getLineGap(pixelSize) ;
-        float ascent = metrics.getAscent(pixelSize) ;
-        float descent = metrics.getDescent(pixelSize) ;
-        if (transform == null) {
-            transform = new AffineTransform();
-        }
-        AffineTransform t = new AffineTransform();
-
-        float advanceY = lineGap - descent + ascent;
-        float y = 0;
-        for (int i=0; i<string.length(); i++)
-        {
-            p[i] = new Path2D();
-            p[i].reset();
-            t.setTransform(transform);
-            char character = string.charAt(i);
-            if (character == '\n') {
-                y += advanceY;
-                advanceTotal = 0;
-                continue;
-            } else if (character == ' ') {
-                advanceTotal += font.getAdvanceWidth(Glyph.ID_SPACE, pixelSize);
-                continue;
-            }
-            Glyph glyph = font.getGlyph(character);
-            Path2D gp = ((GlyphInt)glyph).getPath();
-            float scale = metrics.getScale(pixelSize);
-            t.translate(advanceTotal, y);
-            t.scale(scale, scale);
-            p[i].append(gp.iterator(t), false);
-            advanceTotal += glyph.getAdvance(pixelSize, true);
-        }
+    private static void addShapeMoveTo(final OutlineShape shape, final Factory<? extends Vertex> vertexFactory, final Point p1) {
+        if( DEBUG ) { System.err.println("Shape.MoveTo: "+p1); }
+        shape.closeLastOutline(false);
+        shape.addEmptyOutline();
+        shape.addVertex(0, vertexFactory.create(p1.x,  p1.y, 0, p1.onCurve));
     }
-
-    public static ArrayList<OutlineShape> getOutlineShapes(TypecastFont font, CharSequence string, float pixelSize, AffineTransform transform, Factory<? extends Vertex> vertexFactory) {
-        Path2D[] paths = new Path2D[string.length()];
-        getPaths(font, string, pixelSize, transform, paths);
-
-        ArrayList<OutlineShape> shapes = new ArrayList<OutlineShape>();
-        final int numGlyps = paths.length;
-        for (int index=0;index<numGlyps;index++) {
-            if(paths[index] == null){
-                continue;
-            }
-            OutlineShape shape = new OutlineShape(vertexFactory);
-            shapes.add(shape);
-            PathIterator iterator = paths[index].iterator(transform);
-            if(null != iterator){
-                while(!iterator.isDone()){
-                    float[] coords = new float[6];
-                    int segmentType = iterator.currentSegment(coords);
-                    addPathVertexToOutline(shape, vertexFactory, coords, segmentType);
-                    iterator.next();
-                }
-            }
-        }
-        return shapes;
+    private static void addShapeLineTo(final OutlineShape shape, final Factory<? extends Vertex> vertexFactory, final Point p1) {
+        if( DEBUG ) { System.err.println("Shape.LineTo: "+p1); }
+        shape.addVertex(0, vertexFactory.create(p1.x,  p1.y, 0, p1.onCurve));
     }
-    private static void addPathVertexToOutline(OutlineShape shape, Factory<? extends Vertex> vertexFactory, float[] coords, int segmentType){
-        switch(segmentType) {
-        case PathIterator.SEG_MOVETO:
-            shape.closeLastOutline();
-            shape.addEmptyOutline();
-            shape.addVertex(0, vertexFactory.create(coords, 0, 2, true));
-            break;
-        case PathIterator.SEG_LINETO:
-            shape.addVertex(0, vertexFactory.create(coords, 0, 2, true));
-            break;
-        case PathIterator.SEG_QUADTO:
-            shape.addVertex(0, vertexFactory.create(coords, 0, 2, false));
-            shape.addVertex(0, vertexFactory.create(coords, 2, 2, true));
-            break;
-        case PathIterator.SEG_CUBICTO:
-            shape.addVertex(0, vertexFactory.create(coords, 0, 2, false));
-            shape.addVertex(0, vertexFactory.create(coords, 2, 2, false));
-            shape.addVertex(0, vertexFactory.create(coords, 4, 2, true));
-            break;
-        case PathIterator.SEG_CLOSE:
-            shape.closeLastOutline();
-            break;
-        default:
-            throw new IllegalArgumentException("Unhandled Segment Type: "+segmentType);
-        }
+    private static void addShapeQuadTo(final OutlineShape shape, final Factory<? extends Vertex> vertexFactory, final Point p1, final Point p2) {
+        if( DEBUG ) { System.err.println("Shape.QuadTo: "+p1+", "+p2); }
+        shape.addVertex(0, vertexFactory.create(p1.x,  p1.y, 0, p1.onCurve));
+        shape.addVertex(0, vertexFactory.create(p2.x,  p2.y, 0, p2.onCurve));
+    }
+    private static void addShapeQuadTo(final OutlineShape shape, final Factory<? extends Vertex> vertexFactory, final Point p1,
+                                       final float p2x, final float p2y, final boolean p2OnCurve) {
+        if( DEBUG ) { System.err.println("Shape.QuadTo: "+p1+", p2 "+p2x+", "+p2y+", onCurve "+p2OnCurve); }
+        shape.addVertex(0, vertexFactory.create(p1.x,  p1.y, 0, p1.onCurve));
+        shape.addVertex(0, vertexFactory.create(p2x,    p2y, 0, p2OnCurve));
     }
-
     /**
-     * Build a {@link com.jogamp.graph.geom.Path2D Path2D} from a
-     * {@link jogamp.graph.font.typecast.ot.OTGlyph Glyph}.  This glyph path can then
-     * be transformed and rendered.
-     */
-    public static Path2D buildPath(OTGlyph glyph) {
+    private static void addShapeCubicTo(final OutlineShape shape, Factory<? extends Vertex> vertexFactory, Point p1, Point p2, Point p3) {
+        shape.addVertex(0, vertexFactory.create(p1.x,  p1.y, 0, p1.onCurve));
+        shape.addVertex(0, vertexFactory.create(p2.x,  p2.y, 0, p2.onCurve));
+        shape.addVertex(0, vertexFactory.create(p3.x,  p3.y, 0, p3.onCurve));
+    } */
+
+    public static OutlineShape buildShape(final char symbol, final OTGlyph glyph, final Factory<? extends Vertex> vertexFactory) {
+        //
+        // See Typecast: GlyphPathFactory.addContourToPath(..)
+        //
 
         if (glyph == null) {
             return null;
         }
 
-        Path2D glyphPath = new Path2D();
+        final OutlineShape shape = new OutlineShape(vertexFactory);
+        buildShapeImpl(shape, symbol, glyph, vertexFactory);
+        shape.setIsQuadraticNurbs();
+        return shape;
+    }
 
+    /**
+    private static void buildShapeImpl02(final OutlineShape shape, char symbol, OTGlyph glyph, Factory<? extends Vertex> vertexFactory) {
         // Iterate through all of the points in the glyph.  Each time we find a
         // contour end point, add the point range to the path.
-        int firstIndex = 0;
+        int startIndex = 0;
         int count = 0;
         for (int i = 0; i < glyph.getPointCount(); i++) {
             count++;
-            if (glyph.getPoint(i).endOfContour) {
-                addContourToPath(glyphPath, glyph, firstIndex, count);
-                firstIndex = i + 1;
+            if ( glyph.getPoint(i).endOfContour ) {
+                for(int j=0; j<count; j++) {
+                    final Point p = glyph.getPoint(startIndex + j);
+                    shape.addVertex(0, vertexFactory.create(p.x,  p.y, 0, p.onCurve));
+                }
+                shape.closeLastOutline(false);
+                startIndex = i + 1;
                 count = 0;
             }
         }
-        return glyphPath;
-    }
+    } */
 
-    private static void addContourToPath(Path2D gp, OTGlyph glyph, int startIndex, int count) {
-        int offset = 0;
-        while (offset < count) {
-            Point point = glyph.getPoint(startIndex + offset%count);
-            Point point_plus1 = glyph.getPoint(startIndex + (offset+1)%count);
-            Point point_plus2 = glyph.getPoint(startIndex + (offset+2)%count);
-            if(offset == 0)
-            {
-                gp.moveTo(point.x, point.y);
-            }
+    private static void buildShapeImpl(final OutlineShape shape, final char symbol, final OTGlyph glyph, final Factory<? extends Vertex> vertexFactory) {
+        // Iterate through all of the points in the glyph.  Each time we find a
+        // contour end point, add the point range to the path.
+        int startIndex = 0;
+        int count = 0;
+        final int totalPoints = glyph.getPointCount();
+        for (int i = 0; i < totalPoints; i++) {
+            count++;
+            if ( glyph.getPoint(i).endOfContour ) {
+                int offset = 0;
+                while ( offset < count - 1 ) { // require at least +1 point (last one is end-of-contour)
+                    final Point p0 = glyph.getPoint(startIndex + offset%count);
+                    final Point p1 = glyph.getPoint(startIndex + (offset+1)%count);
+                    final Point p2 = glyph.getPoint(startIndex + (offset+2)%count);
+                    final Point p3 = offset+3 < count ? glyph.getPoint(startIndex + offset+3) : null;
+                    if( DEBUG  ) {
+                        System.err.println("GlyphShape<"+symbol+">: offset "+offset+" of "+count+"/"+totalPoints+" points");
+                        final int pMIdx= (offset==0) ? startIndex+count-1 : startIndex+(offset-1)%count;
+                        final Point pM = glyph.getPoint(pMIdx);
+                        final int p0Idx = startIndex + offset%count;
+                        final int p1Idx = startIndex + (offset+1)%count;
+                        final int p2Idx = startIndex + (offset+2)%count;
+                        final int p3Idx = startIndex + (offset+3)%count;
+                        System.err.println("\t pM["+pMIdx+"] "+pM);
+                        System.err.println("\t p0["+p0Idx+"] "+p0);
+                        System.err.println("\t p1["+p1Idx+"] "+p1);
+                        System.err.println("\t p2["+p2Idx+"] "+p2);
+                        System.err.println("\t p3["+p3Idx+"] "+p3);
+                    }
+                    if(offset == 0) {
+                        addShapeMoveTo(shape, vertexFactory, p0);
+                        // gp.moveTo(point.x, point.y);
+                    }
 
-            if (point.onCurve) {
-                if (point_plus1.onCurve) {
-                    // s = new Line2D.Float(point.x, point.y, point_plus1.x, point_plus1.y);
-                    gp.lineTo( point_plus1.x, point_plus1.y );
-                    offset++;
-                } else {
-                    if (point_plus2.onCurve) {
-                        // s = new QuadCurve2D.Float( point.x, point.y, point_plus1.x, point_plus1.y, point_plus2.x, point_plus2.y);
-                        gp.quadTo(point_plus1.x, point_plus1.y, point_plus2.x, point_plus2.y);
-                        offset+=2;
+                    if( p0.endOfContour ) {
+                        // Branch-0: EOC ** SHALL NEVER HAPPEN **
+                        if( DEBUG ) { System.err.println("B0 .. end-of-contour **** EOC"); }
+                        shape.closeLastOutline(false);
+                        break;
+                    } else if (p0.onCurve) {
+                        if (p1.onCurve) {
+                            // Branch-1: point.onCurve && p1.onCurve
+                            if( DEBUG ) { System.err.println("B1 .. line-to p0-p1"); }
+
+                            // s = new Line2D.Float(point.x, point.y, p1.x, p1.y);
+                            // gp.lineTo( p1.x, p1.y );
+                            addShapeLineTo(shape, vertexFactory, p1);
+                            offset++;
+                        } else {
+                            if (p2.onCurve) {
+                                // Branch-2: point.onCurve && !p1.onCurve && p2.onCurve
+                                if( DEBUG ) { System.err.println("B2 .. quad-to p0-p1-p2"); }
+
+                                // s = new QuadCurve2D.Float( point.x, point.y, p1.x, p1.y, p2.x, p2.y);
+                                // gp.quadTo(p1.x, p1.y, p2.x, p2.y);
+                                addShapeQuadTo(shape, vertexFactory, p1, p2);
+                                offset+=2;
+                            } else {
+                                if (null != p3 && p3.onCurve) {
+                                    // Branch-3: point.onCurve && !p1.onCurve && !p2.onCurve && p3.onCurve
+                                    if( DEBUG ) { System.err.println("B3 .. 2-quad p0-p1-p1_2, p1_2-p2-p3 **** 2QUAD"); }
+                                    // addShapeCubicTo(shape, vertexFactory, p1, p2, p3);
+                                    addShapeQuadTo(shape, vertexFactory, p1,
+                                                   midValue(p1.x, p2.x),
+                                                   midValue(p1.y, p2.y), true);
+                                    addShapeQuadTo(shape, vertexFactory, p2, p3);
+                                    offset+=3;
+                                } else {
+                                    // Branch-4: point.onCurve && !p1.onCurve && !p2.onCurve && !p3.onCurve
+                                    if( DEBUG ) { System.err.println("B4 .. quad-to p0-p1-p2h **** MID"); }
+
+                                    // s = new QuadCurve2D.Float(point.x,point.y,p1.x,p1.y,
+                                    //                           midValue(p1.x, p2.x), midValue(p1.y, p2.y));
+                                    // gp.quadTo(p1.x, p1.y, midValue(p1.x, p2.x), midValue(p1.y, p2.y));
+                                    addShapeQuadTo(shape, vertexFactory, p1,
+                                                   midValue(p1.x, p2.x),
+                                                   midValue(p1.y, p2.y), true);
+                                    offset+=2; // Skip p2 as done in Typecast
+                                }
+                            }
+                        }
                     } else {
-                        // s = new QuadCurve2D.Float(point.x,point.y,point_plus1.x,point_plus1.y,
-                        //                           midValue(point_plus1.x, point_plus2.x), midValue(point_plus1.y, point_plus2.y));
-                        gp.quadTo(point_plus1.x, point_plus1.y, midValue(point_plus1.x, point_plus2.x), midValue(point_plus1.y, point_plus2.y));
-                        offset+=2;
+                        if (!p1.onCurve) {
+                            // Branch-5: !point.onCurve && !p1.onCurve
+                            if( DEBUG ) { System.err.println("B5 .. quad-to pMh-p0-p1h ***** MID"); }
+                            // s = new QuadCurve2D.Float(midValue(pM.x, point.x), midValue(pM.y, point.y),
+                            //                           point.x, point.y,
+                            //                           midValue(point.x, p1.x), midValue(point.y, p1.y));
+                            addShapeQuadTo(shape, vertexFactory, p0,
+                                           midValue(p0.x, p1.x), midValue(p0.y, p1.y), true);
+                            offset++;
+                        } else {
+                            // Branch-6: !point.onCurve && p1.onCurve
+                            if( DEBUG ) { System.err.println("B6 .. quad-to pMh-p0-p1"); }
+                            // s = new QuadCurve2D.Float(midValue(pM.x, point.x), midValue(pM.y, point.y),
+                            //                           point.x, point.y, p1.x, p1.y);
+                            // gp.quadTo(point.x, point.y, p1.x, p1.y);
+                            addShapeQuadTo(shape, vertexFactory, p0, p1);
+                            offset++;
+                        }
                     }
                 }
-            } else {
-                if (point_plus1.onCurve) {
-                    // s = new QuadCurve2D.Float(midValue(point_minus1.x, point.x), midValue(point_minus1.y, point.y),
-                    //                           point.x, point.y, point_plus1.x, point_plus1.y);
-                    //gp.curve3(point_plus1.x, point_plus1.y, point.x, point.y);
-                    gp.quadTo(point.x, point.y, point_plus1.x, point_plus1.y);
-                    offset++;
-
-                } else {
-                    // s = new QuadCurve2D.Float(midValue(point_minus1.x, point.x), midValue(point_minus1.y, point.y), point.x, point.y,
-                    //                           midValue(point.x, point_plus1.x), midValue(point.y, point_plus1.y));
-                    //gp.curve3(midValue(point.x, point_plus1.x), midValue(point.y, point_plus1.y), point.x, point.y);
-                    gp.quadTo(point.x, point.y, midValue(point.x, point_plus1.x), midValue(point.y, point_plus1.y));
-                    offset++;
-                }
+                shape.closeLastOutline(false);
+                startIndex = i + 1;
+                count = 0;
             }
         }
     }
 
-    private static int midValue(int a, int b) {
-        return a + (b - a)/2;
+    private static float midValue(final float a, final float b) {
+        return a + (b - a)/2f;
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java
index 8b68565..181f77e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Disassembler.java
@@ -22,7 +22,7 @@ public class Disassembler {
      * @param ip The current instruction pointer
      * @return The new instruction pointer
      */
-    public static int advanceIP(short[] instructions, int ip) {
+    public static int advanceIP(final short[] instructions, int ip) {
 
         // The high word specifies font, cvt, or glyph program
         int i = ip & 0xffff;
@@ -46,8 +46,8 @@ public class Disassembler {
         return ip;
     }
 
-    public static short getPushCount(short[] instructions, int ip) {
-        short instr = instructions[ip & 0xffff];
+    public static short getPushCount(final short[] instructions, final int ip) {
+        final short instr = instructions[ip & 0xffff];
         if ((Mnemonic.NPUSHB == instr) || (Mnemonic.NPUSHW == instr)) {
             return instructions[(ip & 0xffff) + 1];
         } else if ((Mnemonic.PUSHB == (instr & 0xf8)) || (Mnemonic.PUSHW == (instr & 0xf8))) {
@@ -56,11 +56,11 @@ public class Disassembler {
         return 0;
     }
 
-    public static int[] getPushData(short[] instructions, int ip) {
-        int count = getPushCount(instructions, ip);
-        int[] data = new int[count];
-        int i = ip & 0xffff;
-        short instr = instructions[i];
+    public static int[] getPushData(final short[] instructions, final int ip) {
+        final int count = getPushCount(instructions, ip);
+        final int[] data = new int[count];
+        final int i = ip & 0xffff;
+        final short instr = instructions[i];
         if (Mnemonic.NPUSHB == instr) {
             for (int j = 0; j < count; j++) {
                 data[j] = instructions[i + j + 2];
@@ -81,8 +81,8 @@ public class Disassembler {
         return data;
     }
 
-     public static String disassemble(short[] instructions, int leadingSpaces) {
-        StringBuilder sb = new StringBuilder();
+     public static String disassemble(final short[] instructions, final int leadingSpaces) {
+        final StringBuilder sb = new StringBuilder();
         int ip = 0;
         while (ip < instructions.length) {
             for (int i = 0; i < leadingSpaces; i++) {
@@ -91,7 +91,7 @@ public class Disassembler {
             sb.append(ip).append(": ");
             sb.append(Mnemonic.getMnemonic(instructions[ip]));
             if (getPushCount(instructions, ip) > 0) {
-                int[] data = getPushData(instructions, ip);
+                final int[] data = getPushData(instructions, ip);
                 for(int j = 0; j < data.length; j++) {
                     if ((instructions[ip] == Mnemonic.PUSHW) ||
                         (instructions[ip] == Mnemonic.NPUSHW)) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
index 0a4786f..14e8381 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Fixed.java
@@ -812,7 +812,7 @@ public class Fixed {
      * @param num Input
      * @return Output
      */
-    public static int arctan( int num ) {
+    public static int arctan( final int num ) {
         return 0;
     }
 
@@ -822,7 +822,7 @@ public class Fixed {
      * @param num The 26.6 fixed number in question
      * @return The resulting square root
      */
-    public static int squareRoot(int num) {
+    public static int squareRoot(final int num) {
         int n = num;
         int divisor = num;
         int nSquared;
@@ -841,12 +841,12 @@ public class Fixed {
         return n;
     }
 
-    public static float floatValue(long fixed) {
+    public static float floatValue(final long fixed) {
         return (fixed >> 16) + (float)(fixed & 0xffff) / 0x10000;
     }
 
-    public static float roundedFloatValue(long fixed, int decimalPlaces) {
-        int factor = 10 * decimalPlaces;
+    public static float roundedFloatValue(final long fixed, final int decimalPlaces) {
+        final int factor = 10 * decimalPlaces;
         return (float)((int)(floatValue(fixed) * factor)) / factor;
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java
index d6c9da2..6df892d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Mnemonic.java
@@ -143,7 +143,7 @@ public class Mnemonic {
      * @param opcode The opcode for which the mnemonic is required
      * @return The mnemonic, with a description
      */
-    public static String getMnemonic(short opcode) {
+    public static String getMnemonic(final short opcode) {
         if (opcode >= MIRP) return "MIRP["+((opcode&16)==0?"nrp0,":"srp0,")+((opcode&8)==0?"nmd,":"md,")+((opcode&4)==0?"nrd,":"rd,")+(opcode&3)+"]";
         else if (opcode >= MDRP) return "MDRP["+((opcode&16)==0?"nrp0,":"srp0,")+((opcode&8)==0?"nmd,":"md,")+((opcode&4)==0?"nrd,":"rd,")+(opcode&3)+"]";
         else if (opcode >= PUSHW) return "PUSHW["+((opcode&7)+1)+"]";
@@ -269,7 +269,7 @@ public class Mnemonic {
         else return "????";
     }
 
-    public static String getComment(short opcode) {
+    public static String getComment(final short opcode) {
         if (opcode >= MIRP) return "MIRP["+((opcode&16)==0?"nrp0,":"srp0,")+((opcode&8)==0?"nmd,":"md,")+((opcode&4)==0?"nrd,":"rd,")+(opcode&3)+"]\t\tMove Indirect Relative Point";
         else if (opcode >= MDRP) return "MDRP["+((opcode&16)==0?"nrp0,":"srp0,")+((opcode&8)==0?"nmd,":"md,")+((opcode&4)==0?"nrd,":"rd,")+(opcode&3)+"]\t\tMove Direct Relative Point";
         else if (opcode >= PUSHW) return "PUSHW["+((opcode&7)+1)+"]";
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
index 7c3b32e..e83a428 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFont.java
@@ -79,7 +79,7 @@ import jogamp.graph.font.typecast.ot.table.VheaTable;
  */
 public class OTFont {
 
-    private OTFontCollection _fc;
+    private final OTFontCollection _fc;
     private TableDirectory _tableDirectory = null;
     private Table[] _tables;
     private Os2Table _os2;
@@ -98,17 +98,17 @@ public class OTFont {
     /**
      * Constructor
      */
-    public OTFont(OTFontCollection fc) {
+    public OTFont(final OTFontCollection fc) {
         _fc = fc;
     }
-    public StringBuilder getName(int nameIndex, StringBuilder sb) {
+    public StringBuilder getName(final int nameIndex, StringBuilder sb) {
         if(null == sb) {
             sb = new StringBuilder();
         }
         return _name.getRecordsRecordString(sb, nameIndex);
     }
 
-    public StringBuilder getAllNames(StringBuilder sb, String separator) {
+    public StringBuilder getAllNames(StringBuilder sb, final String separator) {
         if(null != _name) {
             if(null == sb) {
                 sb = new StringBuilder();
@@ -120,7 +120,7 @@ public class OTFont {
         return sb;
     }
 
-    public Table getTable(int tableType) {
+    public Table getTable(final int tableType) {
         for (int i = 0; i < _tables.length; i++) {
             if ((_tables[i] != null) && (_tables[i].getType() == tableType)) {
                 return _tables[i];
@@ -185,7 +185,7 @@ public class OTFont {
         return _maxp.getNumGlyphs();
     }
 
-    public OTGlyph getGlyph(int i) {
+    public OTGlyph getGlyph(final int i) {
 
         final GlyfDescript _glyfDescr = _glyf.getDescription(i);
         return (null != _glyfDescr)
@@ -201,11 +201,11 @@ public class OTFont {
     }
 
     private Table readTable(
-            DataInputStream dis,
-            int tablesOrigin,
-            int tag) throws IOException {
+            final DataInputStream dis,
+            final int tablesOrigin,
+            final int tag) throws IOException {
         dis.reset();
-        DirectoryEntry entry = _tableDirectory.getEntryByTag(tag);
+        final DirectoryEntry entry = _tableDirectory.getEntryByTag(tag);
         if (entry == null) {
             return null;
         }
@@ -225,9 +225,9 @@ public class OTFont {
      * individual font resource data.
      */
     protected void read(
-            DataInputStream dis,
-            int directoryOffset,
-            int tablesOrigin) throws IOException {
+            final DataInputStream dis,
+            final int directoryOffset,
+            final int tablesOrigin) throws IOException {
 
         // Load the table directory
         dis.reset();
@@ -255,7 +255,7 @@ public class OTFont {
 
         // Load all other tables
         for (int i = 0; i < _tableDirectory.getNumTables(); i++) {
-            DirectoryEntry entry = _tableDirectory.getEntry(i);
+            final DirectoryEntry entry = _tableDirectory.getEntry(i);
             if (entry.getTag() == Table.head
                     || entry.getTag() == Table.hhea
                     || entry.getTag() == Table.maxp
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java
index c79380f..e5ad290 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTFontCollection.java
@@ -48,7 +48,7 @@ public class OTFontCollection {
     private String _fileName;
     private TTCHeader _ttcHeader;
     private OTFont[] _fonts;
-    private ArrayList<Table> _tables = new ArrayList<Table>();
+    private final ArrayList<Table> _tables = new ArrayList<Table>();
     private boolean _resourceFork = false;
 
     /** Creates new FontCollection */
@@ -58,8 +58,8 @@ public class OTFontCollection {
     /**
      * @param file The OpenType font file
      */
-    public static OTFontCollection create(File file) throws IOException {
-        OTFontCollection fc = new OTFontCollection();
+    public static OTFontCollection create(final File file) throws IOException {
+        final OTFontCollection fc = new OTFontCollection();
         fc.read(file);
         return fc;
     }
@@ -72,7 +72,7 @@ public class OTFontCollection {
         return _fileName;
     }
 
-    public OTFont getFont(int i) {
+    public OTFont getFont(final int i) {
         return _fonts[i];
     }
 
@@ -84,9 +84,9 @@ public class OTFontCollection {
         return _ttcHeader;
     }
 
-    public Table getTable(DirectoryEntry de) {
+    public Table getTable(final DirectoryEntry de) {
         for (int i = 0; i < _tables.size(); i++) {
-            Table table = _tables.get(i);
+            final Table table = _tables.get(i);
             if ((table.getDirectoryEntry().getTag() == de.getTag()) &&
                 (table.getDirectoryEntry().getOffset() == de.getOffset())) {
                 return table;
@@ -95,7 +95,7 @@ public class OTFontCollection {
         return null;
     }
 
-    public void addTable(Table table) {
+    public void addTable(final Table table) {
         _tables.add(table);
     }
 
@@ -120,7 +120,7 @@ public class OTFontCollection {
             _resourceFork = true;
         }
 
-        DataInputStream dis = new DataInputStream(
+        final DataInputStream dis = new DataInputStream(
             new BufferedInputStream(
                 new FileInputStream(file), (int) file.length()));
         dis.mark((int) file.length());
@@ -128,22 +128,22 @@ public class OTFontCollection {
         if (_resourceFork || _pathName.endsWith(".dfont")) {
 
             // This is a Macintosh font suitcase resource
-            ResourceHeader resourceHeader = new ResourceHeader(dis);
+            final ResourceHeader resourceHeader = new ResourceHeader(dis);
 
             // Seek to the map offset and read the map
             dis.reset();
             dis.skip(resourceHeader.getMapOffset());
-            ResourceMap map = new ResourceMap(dis);
+            final ResourceMap map = new ResourceMap(dis);
 
             // Get the 'sfnt' resources
-            ResourceType resourceType = map.getResourceType("sfnt");
+            final ResourceType resourceType = map.getResourceType("sfnt");
 
             // Load the font data
             _fonts = new OTFont[resourceType.getCount()];
             for (int i = 0; i < resourceType.getCount(); i++) {
-                ResourceReference resourceReference = resourceType.getReference(i);
+                final ResourceReference resourceReference = resourceType.getReference(i);
                 _fonts[i] = new OTFont(this);
-                int offset = resourceHeader.getDataOffset() +
+                final int offset = resourceHeader.getDataOffset() +
                         resourceReference.getDataOffset() + 4;
                 _fonts[i].read(dis, offset, offset);
             }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java
index e0d652b..7bfffd5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/OTGlyph.java
@@ -79,7 +79,7 @@ public class OTGlyph {
      * @param lsb The Left Side Bearing.
      * @param advance The advance width.
      */
-    public OTGlyph(GlyphDescription gd, short lsb, int advance) {
+    public OTGlyph(final GlyphDescription gd, final short lsb, final int advance) {
         _leftSideBearing = lsb;
         _advanceWidth = advance;
         describe(gd);
@@ -91,17 +91,21 @@ public class OTGlyph {
      * @param lsb The Left Side Bearing.
      * @param advance The advance width.
      */
-    public OTGlyph(Charstring cs, short lsb, int advance) {
+    public OTGlyph(final Charstring cs, final short lsb, final int advance) {
         _leftSideBearing = lsb;
         _advanceWidth = advance;
         if (cs instanceof CharstringType2) {
-            T2Interpreter t2i = new T2Interpreter();
+            final T2Interpreter t2i = new T2Interpreter();
             _points = t2i.execute((CharstringType2) cs);
         } else {
             //throw unsupported charstring type
         }
     }
 
+    public void clearPointData() {
+        _points = null;
+    }
+
     public AABBox getBBox() {
         return _bbox;
     }
@@ -114,24 +118,18 @@ public class OTGlyph {
         return _leftSideBearing;
     }
 
-    public Point getPoint(int i) {
+    public Point getPoint(final int i) {
         return _points[i];
     }
 
     public int getPointCount() {
-        return _points.length;
-    }
-
-    /**
-     * Resets the glyph to the TrueType table settings
-     */
-    public void reset() {
+        return null != _points ? _points.length : 0;
     }
 
     /**
      * @param factor a 16.16 fixed value
      */
-    public void scale(int factor) {
+    public void scale(final int factor) {
         for (int i = 0; i < _points.length; i++) {
             //points[i].x = ( points[i].x * factor ) >> 6;
             //points[i].y = ( points[i].y * factor ) >> 6;
@@ -145,11 +143,11 @@ public class OTGlyph {
     /**
      * Set the points of a glyph from the GlyphDescription
      */
-    private void describe(GlyphDescription gd) {
+    private void describe(final GlyphDescription gd) {
         int endPtIndex = 0;
         _points = new Point[gd.getPointCount() /* + 2 */ ];
         for (int i = 0; i < gd.getPointCount(); i++) {
-            boolean endPt = gd.getEndPtOfContours(endPtIndex) == i;
+            final boolean endPt = gd.getEndPtOfContours(endPtIndex) == i;
             if (endPt) {
                 endPtIndex++;
             }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/Point.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/Point.java
index f1a090d..76b0f90 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/Point.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/Point.java
@@ -18,12 +18,15 @@ public class Point {
     public int y = 0;
     public boolean onCurve = true;
     public boolean endOfContour = false;
-    public boolean touched = false;
 
-    public Point(int x, int y, boolean onCurve, boolean endOfContour) {
+    public Point(final int x, final int y, final boolean onCurve, final boolean endOfContour) {
         this.x = x;
         this.y = y;
         this.onCurve = onCurve;
         this.endOfContour = endOfContour;
     }
+
+    public String toString() {
+        return "P["+x+"/"+y+", on "+onCurve+", end "+endOfContour+"]";
+    }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java
index 7a5b0c4..709ff9e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceData.java
@@ -30,11 +30,11 @@ import java.io.IOException;
  */
 public class ResourceData {
 
-    private byte[] data;
+    private final byte[] data;
 
     /** Creates new ResourceData */
-    public ResourceData(DataInput di) throws IOException {
-        int dataLen = di.readInt();
+    public ResourceData(final DataInput di) throws IOException {
+        final int dataLen = di.readInt();
         data = new byte[dataLen];
         di.readFully(data);
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java
index 468ab2e..767eafb 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceFile.java
@@ -31,11 +31,11 @@ import java.io.RandomAccessFile;
  */
 public class ResourceFile {
 
-    private ResourceHeader header;
-    private ResourceMap map;
+    private final ResourceHeader header;
+    private final ResourceMap map;
 
     /** Creates new Resource */
-    public ResourceFile(RandomAccessFile raf) throws IOException {
+    public ResourceFile(final RandomAccessFile raf) throws IOException {
 
         // Read header at the beginning of the file
         raf.seek(0);
@@ -50,13 +50,13 @@ public class ResourceFile {
         return map;
     }
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         try {
             //RandomAccessFile raf = new RandomAccessFile("/Library/Fonts/GillSans.dfont", "r");
 
             // Tests loading a font from a resource fork on Mac OS X
-            RandomAccessFile raf = new RandomAccessFile("/Library/Fonts/Georgia/..namedfork/rsrc", "r");
-            ResourceFile resource = new ResourceFile(raf);
+            final RandomAccessFile raf = new RandomAccessFile("/Library/Fonts/Georgia/..namedfork/rsrc", "r");
+            final ResourceFile resource = new ResourceFile(raf);
             for (int i = 0; i < resource.getResourceMap().getResourceTypeCount(); i++) {
                 System.out.println(resource.getResourceMap().getResourceType(i).getTypeAsString());
             }
@@ -70,7 +70,7 @@ public class ResourceFile {
                 reference = type.getReference(i);
                 System.out.println(reference.getName());
             }
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
         }
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java
index de13b11..dea0b98 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceHeader.java
@@ -30,13 +30,13 @@ import java.io.IOException;
  */
 public class ResourceHeader {
 
-    private int dataOffset;
-    private int mapOffset;
-    private int dataLen;
-    private int mapLen;
+    private final int dataOffset;
+    private final int mapOffset;
+    private final int dataLen;
+    private final int mapLen;
 
     /** Creates new ResourceHeader */
-    public ResourceHeader(DataInput di) throws IOException {
+    public ResourceHeader(final DataInput di) throws IOException {
         dataOffset = di.readInt();
         mapOffset = di.readInt();
         dataLen = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
index d348c64..781e0ad 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceMap.java
@@ -30,21 +30,21 @@ import java.io.IOException;
  */
 public class ResourceMap {
 
-    private byte[] headerCopy = new byte[16];
-    private int nextResourceMap;
-    private int fileReferenceNumber;
-    private int attributes;
-    private ResourceType[] types;
+    private final byte[] headerCopy = new byte[16];
+    // private final int nextResourceMap;
+    // private final int fileReferenceNumber;
+    // private final int attributes;
+    private final ResourceType[] types;
 
     /** Creates new ResourceMap */
-    public ResourceMap(DataInput di) throws IOException {
+    public ResourceMap(final DataInput di) throws IOException {
         di.readFully(headerCopy);
-        nextResourceMap = di.readInt();
-        fileReferenceNumber = di.readUnsignedShort();
-        attributes = di.readUnsignedShort();
-        int typeOffset = di.readUnsignedShort();
-        int nameOffset = di.readUnsignedShort();
-        int typeCount = di.readUnsignedShort() + 1;
+        /* nextResourceMap = */ di.readInt();
+        /* fileReferenceNumber = */ di.readUnsignedShort();
+        /* attributes = */ di.readUnsignedShort();
+        /* final int typeOffset = */ di.readUnsignedShort();
+        /* final int nameOffset = */ di.readUnsignedShort();
+        final int typeCount = di.readUnsignedShort() + 1;
 
         // Read types
         types = new ResourceType[typeCount];
@@ -63,9 +63,8 @@ public class ResourceMap {
         }
     }
 
-    public ResourceType getResourceType(String typeName) {
+    public ResourceType getResourceType(final String typeName) {
         for (int i = 0; i < types.length; i++) {
-            String s = types[i].getTypeAsString();
             if (types[i].getTypeAsString().equals(typeName)) {
                 return types[i];
             }
@@ -73,7 +72,7 @@ public class ResourceMap {
         return null;
     }
 
-    public ResourceType getResourceType(int i) {
+    public ResourceType getResourceType(final int i) {
         return types[i];
     }
 
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java
index 9d15348..f76b85c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceReference.java
@@ -30,15 +30,15 @@ import java.io.IOException;
  */
 public class ResourceReference {
 
-    private int id;
-    private short nameOffset;
-    private short attributes;
-    private int dataOffset;
-    private int handle;
+    private final int id;
+    private final short nameOffset;
+    private final short attributes;
+    private final int dataOffset;
+    private final int handle;
     private String name;
 
     /** Creates new ResourceReference */
-    protected ResourceReference(DataInput di) throws IOException {
+    protected ResourceReference(final DataInput di) throws IOException {
         id = di.readUnsignedShort();
         nameOffset = di.readShort();
         attributes = (short) di.readUnsignedByte();
@@ -46,10 +46,10 @@ public class ResourceReference {
         handle = di.readInt();
     }
 
-    protected void readName(DataInput di) throws IOException {
+    protected void readName(final DataInput di) throws IOException {
         if (nameOffset > -1) {
-            int len = di.readUnsignedByte();
-            byte[] buf = new byte[len];
+            final int len = di.readUnsignedByte();
+            final byte[] buf = new byte[len];
             di.readFully(buf);
             name = new String(buf);
         }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java
index 2ad002e..903fe1a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/mac/ResourceType.java
@@ -30,26 +30,26 @@ import java.io.IOException;
  */
 public class ResourceType {
 
-    private int type;
-    private int count;
-    private int offset;
-    private ResourceReference[] references;
+    private final int type;
+    private final int count;
+    private final int offset;
+    private final ResourceReference[] references;
 
     /** Creates new ResourceType */
-    protected ResourceType(DataInput di) throws IOException {
+    protected ResourceType(final DataInput di) throws IOException {
         type = di.readInt();
         count = di.readUnsignedShort() + 1;
         offset = di.readUnsignedShort();
         references = new ResourceReference[count];
     }
 
-    protected void readRefs(DataInput di) throws IOException {
+    protected void readRefs(final DataInput di) throws IOException {
         for (int i = 0; i < count; i++) {
             references[i] = new ResourceReference(di);
         }
     }
 
-    protected void readNames(DataInput di) throws IOException {
+    protected void readNames(final DataInput di) throws IOException {
         for (int i = 0; i < count; i++) {
             references[i].readName(di);
         }
@@ -76,7 +76,7 @@ public class ResourceType {
         return offset;
     }
 
-    public ResourceReference getReference(int i) {
+    public ResourceReference getReference(final int i) {
         return references[i];
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
index 60975dd..002f83e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/BaseTable.java
@@ -32,103 +32,103 @@ import java.io.IOException;
  */
 public class BaseTable implements Table {
 
-    private abstract class BaseCoord {
+    abstract class BaseCoord {
 
-        public abstract int getBaseCoordFormat();
+        abstract int getBaseCoordFormat();
 
-        public abstract short getCoordinate();
+        abstract short getCoordinate();
     }
 
-    private class BaseCoordFormat1 extends BaseCoord {
+    class BaseCoordFormat1 extends BaseCoord {
 
-        private short _coordinate;
+        private final short _coordinate;
 
-        protected BaseCoordFormat1(DataInput di) throws IOException {
+        protected BaseCoordFormat1(final DataInput di) throws IOException {
             _coordinate = di.readShort();
         }
 
         @Override
-        public int getBaseCoordFormat() {
+        int getBaseCoordFormat() {
             return 1;
         }
 
         @Override
-        public short getCoordinate() {
+        short getCoordinate() {
             return _coordinate;
         }
 
     }
 
-    private class BaseCoordFormat2 extends BaseCoord {
+    class BaseCoordFormat2 extends BaseCoord {
 
-        private short _coordinate;
-        private int _referenceGlyph;
-        private int _baseCoordPoint;
+        private final short _coordinate;
+        // private final int _referenceGlyph;
+        // private final int _baseCoordPoint;
 
-        protected BaseCoordFormat2(DataInput di) throws IOException {
+        protected BaseCoordFormat2(final DataInput di) throws IOException {
             _coordinate = di.readShort();
-            _referenceGlyph = di.readUnsignedShort();
-            _baseCoordPoint = di.readUnsignedShort();
+            /* _referenceGlyph = */ di.readUnsignedShort();
+            /* _baseCoordPoint = */ di.readUnsignedShort();
         }
 
         @Override
-        public int getBaseCoordFormat() {
+        int getBaseCoordFormat() {
             return 2;
         }
 
         @Override
-        public short getCoordinate() {
+        short getCoordinate() {
             return _coordinate;
         }
 
     }
 
-    private class BaseCoordFormat3 extends BaseCoord {
+    class BaseCoordFormat3 extends BaseCoord {
 
-        private short _coordinate;
-        private int _deviceTableOffset;
+        private final short _coordinate;
+        // private final int _deviceTableOffset;
 
-        protected BaseCoordFormat3(DataInput di) throws IOException {
+        protected BaseCoordFormat3(final DataInput di) throws IOException {
             _coordinate = di.readShort();
-            _deviceTableOffset = di.readUnsignedShort();
+            /* _deviceTableOffset = */ di.readUnsignedShort();
         }
 
         @Override
-        public int getBaseCoordFormat() {
+        int getBaseCoordFormat() {
             return 2;
         }
 
         @Override
-        public short getCoordinate() {
+        short getCoordinate() {
             return _coordinate;
         }
 
     }
 
-    private class FeatMinMaxRecord {
+    static class FeatMinMaxRecord {
 
-        private int _tag;
-        private int _minCoordOffset;
-        private int _maxCoordOffset;
+        // private final int _tag;
+        // private final int _minCoordOffset;
+        // private final int _maxCoordOffset;
 
-        protected FeatMinMaxRecord(DataInput di) throws IOException {
-            _tag = di.readInt();
-            _minCoordOffset = di.readUnsignedShort();
-            _maxCoordOffset = di.readUnsignedShort();
+        protected FeatMinMaxRecord(final DataInput di) throws IOException {
+            /* _tag = */ di.readInt();
+            /* _minCoordOffset = */ di.readUnsignedShort();
+            /* _maxCoordOffset = */ di.readUnsignedShort();
         }
     }
 
-    private class MinMax {
+    class MinMax {
 
-        private int _minCoordOffset;
-        private int _maxCoordOffset;
-        private int _featMinMaxCount;
-        private FeatMinMaxRecord[] _featMinMaxRecord;
+        // private final int _minCoordOffset;
+        // private final int _maxCoordOffset;
+        private final int _featMinMaxCount;
+        private final FeatMinMaxRecord[] _featMinMaxRecord;
 
-        protected MinMax(int minMaxOffset) throws IOException {
-            DataInput di = getDataInputForOffset(minMaxOffset);
-            _minCoordOffset = di.readUnsignedShort();
-            _maxCoordOffset = di.readUnsignedShort();
+        protected MinMax(final int minMaxOffset) throws IOException {
+            final DataInput di = getDataInputForOffset(minMaxOffset);
+            /* _minCoordOffset = */ di.readUnsignedShort();
+            /* _maxCoordOffset = */ di.readUnsignedShort();
             _featMinMaxCount = di.readUnsignedShort();
             _featMinMaxRecord = new FeatMinMaxRecord[_featMinMaxCount];
             for (int i = 0; i < _featMinMaxCount; ++i) {
@@ -137,16 +137,16 @@ public class BaseTable implements Table {
         }
     }
 
-    private class BaseValues {
+    class BaseValues {
 
-        private int _defaultIndex;
-        private int _baseCoordCount;
-        private int[] _baseCoordOffset;
-        private BaseCoord[] _baseCoords;
+        // private final int _defaultIndex;
+        private final int _baseCoordCount;
+        private final int[] _baseCoordOffset;
+        private final BaseCoord[] _baseCoords;
 
-        protected BaseValues(int baseValuesOffset) throws IOException {
-            DataInput di = getDataInputForOffset(baseValuesOffset);
-            _defaultIndex = di.readUnsignedShort();
+        protected BaseValues(final int baseValuesOffset) throws IOException {
+            final DataInput di = getDataInputForOffset(baseValuesOffset);
+            /* _defaultIndex = */ di.readUnsignedShort();
             _baseCoordCount = di.readUnsignedShort();
             _baseCoordOffset = new int[_baseCoordCount];
             for (int i = 0; i < _baseCoordCount; ++i) {
@@ -154,7 +154,7 @@ public class BaseTable implements Table {
             }
             _baseCoords = new BaseCoord[_baseCoordCount];
             for (int i = 0; i < _baseCoordCount; ++i) {
-                int format = di.readUnsignedShort();
+                final int format = di.readUnsignedShort();
                 switch (format) {
                     case 1:
                         _baseCoords[i] = new BaseCoordFormat1(di);
@@ -170,38 +170,39 @@ public class BaseTable implements Table {
         }
     }
 
-    private class BaseLangSysRecord {
+    static class BaseLangSysRecord {
 
-        private int _baseLangSysTag;
-        private int _minMaxOffset;
+        // private final int _baseLangSysTag;
+        private final int _minMaxOffset;
 
-        protected BaseLangSysRecord(DataInput di) throws IOException {
-            _baseLangSysTag = di.readInt();
+        protected BaseLangSysRecord(final DataInput di) throws IOException {
+            /* _baseLangSysTag = */ di.readInt();
             _minMaxOffset = di.readUnsignedShort();
         }
 
-        public int getBaseLangSysTag() {
+        /**
+        int getBaseLangSysTag() {
             return _baseLangSysTag;
-        }
+        } */
 
-        public int getMinMaxOffset() {
+        int getMinMaxOffset() {
             return _minMaxOffset;
         }
     }
 
-    private class BaseScript {
+    class BaseScript {
 
-        private int _thisOffset;
-        private int _baseValuesOffset;
-        private int _defaultMinMaxOffset;
-        private int _baseLangSysCount;
-        private BaseLangSysRecord[] _baseLangSysRecord;
+        private final int _thisOffset;
+        private final int _baseValuesOffset;
+        private final int _defaultMinMaxOffset;
+        private final int _baseLangSysCount;
+        private final BaseLangSysRecord[] _baseLangSysRecord;
         private BaseValues _baseValues;
         private MinMax[] _minMax;
 
-        protected BaseScript(int baseScriptOffset) throws IOException {
+        protected BaseScript(final int baseScriptOffset) throws IOException {
             _thisOffset = baseScriptOffset;
-            DataInput di = getDataInputForOffset(baseScriptOffset);
+            final DataInput di = getDataInputForOffset(baseScriptOffset);
             _baseValuesOffset = di.readUnsignedShort();
             _defaultMinMaxOffset = di.readUnsignedShort();
             _baseLangSysCount = di.readUnsignedShort();
@@ -219,7 +220,7 @@ public class BaseTable implements Table {
 
         @Override
         public String toString() {
-            StringBuilder sb = new StringBuilder()
+            final StringBuilder sb = new StringBuilder()
                 .append("\nBaseScript BaseScriptT").append(Integer.toHexString(_thisOffset))
                 .append("\nBaseValuesT").append(Integer.toHexString(_thisOffset + _baseValuesOffset))
                 .append("\nMinMaxT").append(Integer.toHexString(_thisOffset + _defaultMinMaxOffset))
@@ -239,35 +240,35 @@ public class BaseTable implements Table {
         }
     }
 
-    private class BaseScriptRecord {
+    static class BaseScriptRecord {
 
-        private int _baseScriptTag;
-        private int _baseScriptOffset;
+        private final int _baseScriptTag;
+        private final int _baseScriptOffset;
 
-        protected BaseScriptRecord(DataInput di) throws IOException {
+        protected BaseScriptRecord(final DataInput di) throws IOException {
             _baseScriptTag = di.readInt();
             _baseScriptOffset = di.readUnsignedShort();
         }
 
-        public int getBaseScriptTag() {
+        int getBaseScriptTag() {
             return _baseScriptTag;
         }
 
-        public int getBaseScriptOffset() {
+        int getBaseScriptOffset() {
             return _baseScriptOffset;
         }
     }
 
-    private class BaseScriptList {
+    class BaseScriptList {
 
-        private int _thisOffset;
-        private int _baseScriptCount;
-        private BaseScriptRecord[] _baseScriptRecord;
-        private BaseScript[] _baseScripts;
+        private final int _thisOffset;
+        private final int _baseScriptCount;
+        private final BaseScriptRecord[] _baseScriptRecord;
+        private final BaseScript[] _baseScripts;
 
-        protected BaseScriptList(int baseScriptListOffset) throws IOException {
+        protected BaseScriptList(final int baseScriptListOffset) throws IOException {
             _thisOffset = baseScriptListOffset;
-            DataInput di = getDataInputForOffset(baseScriptListOffset);
+            final DataInput di = getDataInputForOffset(baseScriptListOffset);
             _baseScriptCount = di.readUnsignedShort();
             _baseScriptRecord = new BaseScriptRecord[_baseScriptCount];
             for (int i = 0; i < _baseScriptCount; ++i) {
@@ -282,7 +283,7 @@ public class BaseTable implements Table {
 
         @Override
         public String toString() {
-            StringBuilder sb = new StringBuilder()
+            final StringBuilder sb = new StringBuilder()
                 .append("\nBaseScriptList BaseScriptListT").append(Integer.toHexString(_thisOffset))
                 .append("\n").append(Integer.toHexString(_baseScriptCount));
             for (int i = 0; i < _baseScriptCount; ++i) {
@@ -297,15 +298,15 @@ public class BaseTable implements Table {
         }
      }
 
-    private class BaseTagList {
+    class BaseTagList {
 
-        private int _thisOffset;
-        private int _baseTagCount;
-        private int[] _baselineTag;
+        private final int _thisOffset;
+        private final int _baseTagCount;
+        private final int[] _baselineTag;
 
-        protected BaseTagList(int baseTagListOffset) throws IOException {
+        protected BaseTagList(final int baseTagListOffset) throws IOException {
             _thisOffset = baseTagListOffset;
-            DataInput di = getDataInputForOffset(baseTagListOffset);
+            final DataInput di = getDataInputForOffset(baseTagListOffset);
             _baseTagCount = di.readUnsignedShort();
             _baselineTag = new int[_baseTagCount];
             for (int i = 0; i < _baseTagCount; ++i) {
@@ -315,7 +316,7 @@ public class BaseTable implements Table {
 
         @Override
         public String toString() {
-            StringBuilder sb = new StringBuilder()
+            final StringBuilder sb = new StringBuilder()
                 .append("\nBaseTagList BaseTagListT").append(Integer.toHexString(_thisOffset))
                 .append("\n").append(Integer.toHexString(_baseTagCount));
             for (int i = 0; i < _baseTagCount; ++i) {
@@ -325,17 +326,17 @@ public class BaseTable implements Table {
         }
     }
 
-    private class Axis {
+    class Axis {
 
-        private int _thisOffset;
-        private int _baseTagListOffset;
-        private int _baseScriptListOffset;
+        private final int _thisOffset;
+        private final int _baseTagListOffset;
+        private final int _baseScriptListOffset;
         private BaseTagList _baseTagList;
         private BaseScriptList _baseScriptList;
 
-        protected Axis(int axisOffset) throws IOException {
+        protected Axis(final int axisOffset) throws IOException {
             _thisOffset = axisOffset;
-            DataInput di = getDataInputForOffset(axisOffset);
+            final DataInput di = getDataInputForOffset(axisOffset);
             _baseTagListOffset = di.readUnsignedShort();
             _baseScriptListOffset = di.readUnsignedShort();
             if (_baseTagListOffset != 0) {
@@ -359,22 +360,22 @@ public class BaseTable implements Table {
         }
     }
 
-    private DirectoryEntry _de;
-    private int _version;
-    private int _horizAxisOffset;
-    private int _vertAxisOffset;
+    private final DirectoryEntry _de;
+    private final int _version;
+    private final int _horizAxisOffset;
+    private final int _vertAxisOffset;
     private Axis _horizAxis;
     private Axis _vertAxis;
     private byte[] _buf;
 
     /** Creates a new instance of BaseTable */
-    protected BaseTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected BaseTable(final DirectoryEntry de, final DataInput di) throws IOException {
         _de = (DirectoryEntry) de.clone();
 
         // Load entire table into a buffer, and create another input stream
         _buf = new byte[de.getLength()];
         di.readFully(_buf);
-        DataInput di2 = getDataInputForOffset(0);
+        final DataInput di2 = getDataInputForOffset(0);
 
         _version = di2.readInt();
         _horizAxisOffset = di2.readUnsignedShort();
@@ -390,7 +391,7 @@ public class BaseTable implements Table {
         _buf = null;
     }
 
-    private DataInput getDataInputForOffset(int offset) {
+    private DataInput getDataInputForOffset(final int offset) {
         return new DataInputStream(new ByteArrayInputStream(
                 _buf, offset,
                 _de.getLength() - offset));
@@ -404,8 +405,8 @@ public class BaseTable implements Table {
 //        return String.format("%1$8x", value);
 //    }
 
-    static protected String tagAsString(int tag) {
-        char[] c = new char[4];
+    static protected String tagAsString(final int tag) {
+        final char[] c = new char[4];
         c[0] = (char)((tag >> 24) & 0xff);
         c[1] = (char)((tag >> 16) & 0xff);
         c[2] = (char)((tag >> 8) & 0xff);
@@ -420,7 +421,7 @@ public class BaseTable implements Table {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder()
+        final StringBuilder sb = new StringBuilder()
             .append("; 'BASE' Table - Baseline\n;-------------------------------------\n\n")
             .append("BASEHeader BASEHeaderT").append(Integer.toHexString(0))
             .append("\n").append(Integer.toHexString(_version))
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
index a36a499..d6643f2 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CffTable.java
@@ -37,13 +37,13 @@ import java.util.Hashtable;
  */
 public class CffTable implements Table {
 
-    public class Dict {
+    public static class Dict {
 
-        private Dictionary<Integer, Object> _entries = new Hashtable<Integer, Object>();
-        private int[] _data;
+        private final Dictionary<Integer, Object> _entries = new Hashtable<Integer, Object>();
+        private final int[] _data;
         private int _index;
 
-        protected Dict(int[] data, int offset, int length) {
+        protected Dict(final int[] data, final int offset, final int length) {
             _data = data;
             _index = offset;
             while (_index < offset + length) {
@@ -51,12 +51,12 @@ public class CffTable implements Table {
             }
         }
 
-        public Object getValue(int key) {
+        public Object getValue(final int key) {
             return _entries.get(key);
         }
 
         private boolean addKeyAndValueEntry() {
-            ArrayList<Object> operands = new ArrayList<Object>();
+            final ArrayList<Object> operands = new ArrayList<Object>();
             Object operand = null;
             while (isOperandAtIndex()) {
                 operand = nextOperand();
@@ -76,7 +76,7 @@ public class CffTable implements Table {
         }
 
         private boolean isOperandAtIndex() {
-            int b0 = _data[_index];
+            final int b0 = _data[_index];
             if ((32 <= b0 && b0 <= 254)
                     || b0 == 28
                     || b0 == 29
@@ -87,7 +87,7 @@ public class CffTable implements Table {
         }
 
         private boolean isOperatorAtIndex() {
-            int b0 = _data[_index];
+            final int b0 = _data[_index];
             if (0 <= b0 && b0 <= 21) {
                 return true;
             }
@@ -95,44 +95,44 @@ public class CffTable implements Table {
         }
 
         private Object nextOperand() {
-            int b0 = _data[_index];
+            final int b0 = _data[_index];
             if (32 <= b0 && b0 <= 246) {
 
                 // 1 byte integer
                 ++_index;
-                return new Integer(b0 - 139);
+                return Integer.valueOf(b0 - 139);
             } else if (247 <= b0 && b0 <= 250) {
 
                 // 2 byte integer
-                int b1 = _data[_index + 1];
+                final int b1 = _data[_index + 1];
                 _index += 2;
-                return new Integer((b0 - 247) * 256 + b1 + 108);
+                return Integer.valueOf((b0 - 247) * 256 + b1 + 108);
             } else if (251 <= b0 && b0 <= 254) {
 
                 // 2 byte integer
-                int b1 = _data[_index + 1];
+                final int b1 = _data[_index + 1];
                 _index += 2;
-                return new Integer(-(b0 - 251) * 256 - b1 - 108);
+                return Integer.valueOf(-(b0 - 251) * 256 - b1 - 108);
             } else if (b0 == 28) {
 
                 // 3 byte integer
-                int b1 = _data[_index + 1];
-                int b2 = _data[_index + 2];
+                final int b1 = _data[_index + 1];
+                final int b2 = _data[_index + 2];
                 _index += 3;
-                return new Integer(b1 << 8 | b2);
+                return Integer.valueOf(b1 << 8 | b2);
             } else if (b0 == 29) {
 
                 // 5 byte integer
-                int b1 = _data[_index + 1];
-                int b2 = _data[_index + 2];
-                int b3 = _data[_index + 3];
-                int b4 = _data[_index + 4];
+                final int b1 = _data[_index + 1];
+                final int b2 = _data[_index + 2];
+                final int b3 = _data[_index + 3];
+                final int b4 = _data[_index + 4];
                 _index += 5;
-                return new Integer(b1 << 24 | b2 << 16 | b3 << 8 | b4);
+                return Integer.valueOf(b1 << 24 | b2 << 16 | b3 << 8 | b4);
             } else if (b0 == 30) {
 
                 // Real number
-                StringBuilder fString = new StringBuilder();
+                final StringBuilder fString = new StringBuilder();
                 int nibble1 = 0;
                 int nibble2 = 0;
                 ++_index;
@@ -143,13 +143,13 @@ public class CffTable implements Table {
                     fString.append(decodeRealNibble(nibble1));
                     fString.append(decodeRealNibble(nibble2));
                 }
-                return new Float(fString.toString());
+                return Float.valueOf(fString.toString());
             } else {
                 return null;
             }
         }
 
-        private String decodeRealNibble(int nibble) {
+        private String decodeRealNibble(final int nibble) {
             if (nibble < 0xa) {
                 return Integer.toString(nibble);
             } else if (nibble == 0xa) {
@@ -166,10 +166,10 @@ public class CffTable implements Table {
 
         @Override
         public String toString() {
-            StringBuilder sb = new StringBuilder();
-            Enumeration<Integer> keys = _entries.keys();
+            final StringBuilder sb = new StringBuilder();
+            final Enumeration<Integer> keys = _entries.keys();
             while (keys.hasMoreElements()) {
-                Integer key = keys.nextElement();
+                final Integer key = keys.nextElement();
                 if ((key.intValue() & 0xc00) == 0xc00) {
                     sb.append("12 ").append(key.intValue() & 0xff).append(": ");
                 } else {
@@ -183,12 +183,12 @@ public class CffTable implements Table {
 
     public class Index {
 
-        private int _count;
-        private int _offSize;
-        private int[] _offset;
-        private int[] _data;
+        private final int _count;
+        private final int _offSize;
+        private final int[] _offset;
+        private final int[] _data;
 
-        protected Index(DataInput di) throws IOException {
+        protected Index(final DataInput di) throws IOException {
             _count = di.readUnsignedShort();
             _offset = new int[_count + 1];
             _offSize = di.readUnsignedByte();
@@ -209,7 +209,7 @@ public class CffTable implements Table {
             return _count;
         }
 
-        public int getOffset(int index) {
+        public int getOffset(final int index) {
             return _offset[index];
         }
 
@@ -223,7 +223,7 @@ public class CffTable implements Table {
 
         @Override
         public String toString() {
-            StringBuilder sb = new StringBuilder();
+            final StringBuilder sb = new StringBuilder();
             sb.append("DICT\n");
             sb.append("count: ").append(_count).append("\n");
             sb.append("offSize: ").append(_offSize).append("\n");
@@ -246,19 +246,19 @@ public class CffTable implements Table {
 
     public class TopDictIndex extends Index {
 
-        protected TopDictIndex(DataInput di) throws IOException {
+        protected TopDictIndex(final DataInput di) throws IOException {
             super(di);
         }
 
-        public Dict getTopDict(int index) {
-            int offset = getOffset(index) - 1;
-            int len = getOffset(index + 1) - offset - 1;
+        public Dict getTopDict(final int index) {
+            final int offset = getOffset(index) - 1;
+            final int len = getOffset(index + 1) - offset - 1;
             return new Dict(getData(), offset, len);
         }
 
         @Override
         public String toString() {
-            StringBuilder sb = new StringBuilder();
+            final StringBuilder sb = new StringBuilder();
             for (int i = 0; i < getCount(); ++i) {
                 sb.append(getTopDict(i).toString()).append("\n");
             }
@@ -268,18 +268,18 @@ public class CffTable implements Table {
 
     public class NameIndex extends Index {
 
-        protected NameIndex(DataInput di) throws IOException {
+        protected NameIndex(final DataInput di) throws IOException {
             super(di);
         }
 
-        public String getName(int index) {
+        public String getName(final int index) {
             String name = null;
-            int offset = getOffset(index) - 1;
-            int len = getOffset(index + 1) - offset - 1;
+            final int offset = getOffset(index) - 1;
+            final int len = getOffset(index + 1) - offset - 1;
 
             // Ensure the name hasn't been deleted
             if (getData()[offset] != 0) {
-                StringBuilder sb = new StringBuilder();
+                final StringBuilder sb = new StringBuilder();
                 for (int i = offset; i < offset + len; ++i) {
                     sb.append((char) getData()[i]);
                 }
@@ -292,7 +292,7 @@ public class CffTable implements Table {
 
         @Override
         public String toString() {
-            StringBuilder sb = new StringBuilder();
+            final StringBuilder sb = new StringBuilder();
             for (int i = 0; i < getCount(); ++i) {
                 sb.append(getName(i)).append("\n");
             }
@@ -302,7 +302,7 @@ public class CffTable implements Table {
 
     public class StringIndex extends Index {
 
-        protected StringIndex(DataInput di) throws IOException {
+        protected StringIndex(final DataInput di) throws IOException {
             super(di);
         }
 
@@ -314,10 +314,10 @@ public class CffTable implements Table {
                 if (index >= getCount()) {
                     return null;
                 }
-                int offset = getOffset(index) - 1;
-                int len = getOffset(index + 1) - offset - 1;
+                final int offset = getOffset(index) - 1;
+                final int len = getOffset(index + 1) - offset - 1;
 
-                StringBuilder sb = new StringBuilder();
+                final StringBuilder sb = new StringBuilder();
                 for (int i = offset; i < offset + len; ++i) {
                     sb.append((char) getData()[i]);
                 }
@@ -327,8 +327,8 @@ public class CffTable implements Table {
 
         @Override
         public String toString() {
-            int nonStandardBase = CffStandardStrings.standardStrings.length;
-            StringBuilder sb = new StringBuilder();
+            final int nonStandardBase = CffStandardStrings.standardStrings.length;
+            final StringBuilder sb = new StringBuilder();
             for (int i = 0; i < getCount(); ++i) {
                 sb.append(nonStandardBase + i).append(": ");
                 sb.append(getString(nonStandardBase + i)).append("\n");
@@ -346,7 +346,7 @@ public class CffTable implements Table {
             return _first;
         }
 
-        protected void setFirst(int first) {
+        protected void setFirst(final int first) {
             _first = first;
         }
 
@@ -354,14 +354,14 @@ public class CffTable implements Table {
             return _left;
         }
 
-        protected void setLeft(int left) {
+        protected void setLeft(final int left) {
             _left = left;
         }
     }
 
     private class CharsetRange1 extends CharsetRange {
 
-        protected CharsetRange1(DataInput di) throws IOException {
+        protected CharsetRange1(final DataInput di) throws IOException {
             setFirst(di.readUnsignedShort());
             setLeft(di.readUnsignedByte());
         }
@@ -369,7 +369,7 @@ public class CffTable implements Table {
 
     private class CharsetRange2 extends CharsetRange {
 
-        protected CharsetRange2(DataInput di) throws IOException {
+        protected CharsetRange2(final DataInput di) throws IOException {
             setFirst(di.readUnsignedShort());
             setLeft(di.readUnsignedShort());
         }
@@ -384,9 +384,9 @@ public class CffTable implements Table {
 
     private class CharsetFormat0 extends Charset {
 
-        private int[] _glyph;
+        private final int[] _glyph;
 
-        protected CharsetFormat0(DataInput di, int glyphCount) throws IOException {
+        protected CharsetFormat0(final DataInput di, final int glyphCount) throws IOException {
             _glyph = new int[glyphCount - 1];  // minus 1 because .notdef is omitted
             for (int i = 0; i < glyphCount - 1; ++i) {
                 _glyph[i] = di.readUnsignedShort();
@@ -399,7 +399,7 @@ public class CffTable implements Table {
         }
 
         @Override
-        public int getSID(int gid) {
+        public int getSID(final int gid) {
             if (gid == 0) {
                 return 0;
             }
@@ -409,12 +409,12 @@ public class CffTable implements Table {
 
     private class CharsetFormat1 extends Charset {
 
-        private ArrayList<CharsetRange> _charsetRanges = new ArrayList<CharsetRange>();
+        private final ArrayList<CharsetRange> _charsetRanges = new ArrayList<CharsetRange>();
 
-        protected CharsetFormat1(DataInput di, int glyphCount) throws IOException {
+        protected CharsetFormat1(final DataInput di, final int glyphCount) throws IOException {
             int glyphsCovered = glyphCount - 1;  // minus 1 because .notdef is omitted
             while (glyphsCovered > 0) {
-                CharsetRange range = new CharsetRange1(di);
+                final CharsetRange range = new CharsetRange1(di);
                 _charsetRanges.add(range);
                 glyphsCovered -= range.getLeft() + 1;
             }
@@ -426,17 +426,17 @@ public class CffTable implements Table {
         }
 
         @Override
-        public int getSID(int gid) {
+        public int getSID(final int gid) {
             if (gid == 0) {
                 return 0;
             }
 
             // Count through the ranges to find the one of interest
             int count = 0;
-            for (CharsetRange range : _charsetRanges) {
+            for (final CharsetRange range : _charsetRanges) {
                 count += range.getLeft();
                 if (gid < count) {
-                    int sid = gid - count + range.getFirst();
+                    final int sid = gid - count + range.getFirst();
                     return sid;
                 }
             }
@@ -446,12 +446,12 @@ public class CffTable implements Table {
 
     private class CharsetFormat2 extends Charset {
 
-        private ArrayList<CharsetRange> _charsetRanges = new ArrayList<CharsetRange>();
+        private final ArrayList<CharsetRange> _charsetRanges = new ArrayList<CharsetRange>();
 
-        protected CharsetFormat2(DataInput di, int glyphCount) throws IOException {
+        protected CharsetFormat2(final DataInput di, final int glyphCount) throws IOException {
             int glyphsCovered = glyphCount - 1;  // minus 1 because .notdef is omitted
             while (glyphsCovered > 0) {
-                CharsetRange range = new CharsetRange2(di);
+                final CharsetRange range = new CharsetRange2(di);
                 _charsetRanges.add(range);
                 glyphsCovered -= range.getLeft() + 1;
             }
@@ -463,16 +463,16 @@ public class CffTable implements Table {
         }
 
         @Override
-        public int getSID(int gid) {
+        public int getSID(final int gid) {
             if (gid == 0) {
                 return 0;
             }
 
             // Count through the ranges to find the one of interest
             int count = 0;
-            for (CharsetRange range : _charsetRanges) {
+            for (final CharsetRange range : _charsetRanges) {
                 if (gid < range.getLeft() + count) {
-                    int sid = gid - count + range.getFirst() - 1;
+                    final int sid = gid - count + range.getFirst() - 1;
                     return sid;
                 }
                 count += range.getLeft();
@@ -481,23 +481,23 @@ public class CffTable implements Table {
         }
     }
 
-    private DirectoryEntry _de;
-    private int _major;
-    private int _minor;
-    private int _hdrSize;
-    private int _offSize;
-    private NameIndex _nameIndex;
-    private TopDictIndex _topDictIndex;
-    private StringIndex _stringIndex;
-    private Index _globalSubrIndex;
-    private Index _charStringsIndexArray[];
-    private Charset[] _charsets;
-    private Charstring[][] _charstringsArray;
-
-    private byte[] _buf;
+    private final DirectoryEntry _de;
+    private final int _major;
+    private final int _minor;
+    private final int _hdrSize;
+    private final int _offSize;
+    private final NameIndex _nameIndex;
+    private final TopDictIndex _topDictIndex;
+    private final StringIndex _stringIndex;
+    private final Index _globalSubrIndex;
+    private final Index _charStringsIndexArray[];
+    private final Charset[] _charsets;
+    private final Charstring[][] _charstringsArray;
+
+    private final byte[] _buf;
 
     /** Creates a new instance of CffTable */
-    protected CffTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected CffTable(final DirectoryEntry de, final DataInput di) throws IOException {
         _de = (DirectoryEntry) de.clone();
 
         // Load entire table into a buffer, and create another input stream
@@ -537,15 +537,15 @@ public class CffTable implements Table {
             // Charstrings INDEX
             // We load this before Charsets because we may need to know the number
             // of glyphs
-            Integer charStringsOffset = (Integer) _topDictIndex.getTopDict(i).getValue(17);
+            final Integer charStringsOffset = (Integer) _topDictIndex.getTopDict(i).getValue(17);
             di2 = getDataInputForOffset(charStringsOffset);
             _charStringsIndexArray[i] = new Index(di2);
-            int glyphCount = _charStringsIndexArray[i].getCount();
+            final int glyphCount = _charStringsIndexArray[i].getCount();
 
             // Charsets
-            Integer charsetOffset = (Integer) _topDictIndex.getTopDict(i).getValue(15);
+            final Integer charsetOffset = (Integer) _topDictIndex.getTopDict(i).getValue(15);
             di2 = getDataInputForOffset(charsetOffset);
-            int format = di2.readUnsignedByte();
+            final int format = di2.readUnsignedByte();
             switch (format) {
                 case 0:
                     _charsets[i] = new CharsetFormat0(di2, glyphCount);
@@ -561,8 +561,8 @@ public class CffTable implements Table {
             // Create the charstrings
             _charstringsArray[i] = new Charstring[glyphCount];
             for (int j = 0; j < glyphCount; ++j) {
-                int offset = _charStringsIndexArray[i].getOffset(j) - 1;
-                int len = _charStringsIndexArray[i].getOffset(j + 1) - offset - 1;
+                final int offset = _charStringsIndexArray[i].getOffset(j) - 1;
+                final int len = _charStringsIndexArray[i].getOffset(j + 1) - offset - 1;
                 _charstringsArray[i][j] = new CharstringType2(
                         i,
                         _stringIndex.getString(_charsets[i].getSID(j)),
@@ -575,7 +575,7 @@ public class CffTable implements Table {
         }
     }
 
-    private DataInput getDataInputForOffset(int offset) {
+    private DataInput getDataInputForOffset(final int offset) {
         return new DataInputStream(new ByteArrayInputStream(
                 _buf, offset,
                 _de.getLength() - offset));
@@ -585,15 +585,15 @@ public class CffTable implements Table {
         return _nameIndex;
     }
 
-    public Charset getCharset(int fontIndex) {
+    public Charset getCharset(final int fontIndex) {
         return _charsets[fontIndex];
     }
 
-    public Charstring getCharstring(int fontIndex, int gid) {
+    public Charstring getCharstring(final int fontIndex, final int gid) {
         return _charstringsArray[fontIndex][gid];
     }
 
-    public int getCharstringCount(int fontIndex) {
+    public int getCharstringCount(final int fontIndex) {
         return _charstringsArray[fontIndex].length;
     }
 
@@ -604,7 +604,7 @@ public class CffTable implements Table {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("'CFF' Table - Compact Font Format\n---------------------------------\n");
         sb.append("\nName INDEX\n");
         sb.append(_nameIndex.toString());
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
index 7a7b518..d96a584 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CharstringType2.java
@@ -106,24 +106,24 @@ public class CharstringType2 extends Charstring {
         "-Reserved-"
     };
 
-    private int _index;
-    private String _name;
-    private int[] _data;
-    private int _offset;
-    private int _length;
-    private CffTable.Index _localSubrIndex;
-    private CffTable.Index _globalSubrIndex;
+    private final int _index;
+    private final String _name;
+    private final int[] _data;
+    private final int _offset;
+    private final int _length;
+    private final CffTable.Index _localSubrIndex;
+    private final CffTable.Index _globalSubrIndex;
     private int _ip;
 
     /** Creates a new instance of CharstringType2 */
     protected CharstringType2(
-            int index,
-            String name,
-            int[] data,
-            int offset,
-            int length,
-            CffTable.Index localSubrIndex,
-            CffTable.Index globalSubrIndex) {
+            final int index,
+            final String name,
+            final int[] data,
+            final int offset,
+            final int length,
+            final CffTable.Index localSubrIndex,
+            final CffTable.Index globalSubrIndex) {
         _index = index;
         _name = name;
         _data = data;
@@ -143,7 +143,7 @@ public class CharstringType2 extends Charstring {
         return _name;
     }
 
-    private void disassemble(StringBuilder sb) {
+    private void disassemble(final StringBuilder sb) {
         Number operand = null;
         while (isOperandAtIndex()) {
             operand = nextOperand();
@@ -170,7 +170,7 @@ public class CharstringType2 extends Charstring {
     }
 
     public boolean isOperandAtIndex() {
-        int b0 = _data[_ip];
+        final int b0 = _data[_ip];
         if ((32 <= b0 && b0 <= 255) || b0 == 28) {
             return true;
         }
@@ -178,40 +178,40 @@ public class CharstringType2 extends Charstring {
     }
 
     public Number nextOperand() {
-        int b0 = _data[_ip];
+        final int b0 = _data[_ip];
         if (32 <= b0 && b0 <= 246) {
 
             // 1 byte integer
             ++_ip;
-            return new Integer(b0 - 139);
+            return Integer.valueOf(b0 - 139);
         } else if (247 <= b0 && b0 <= 250) {
 
             // 2 byte integer
-            int b1 = _data[_ip + 1];
+            final int b1 = _data[_ip + 1];
             _ip += 2;
-            return new Integer((b0 - 247) * 256 + b1 + 108);
+            return Integer.valueOf((b0 - 247) * 256 + b1 + 108);
         } else if (251 <= b0 && b0 <= 254) {
 
             // 2 byte integer
-            int b1 = _data[_ip + 1];
+            final int b1 = _data[_ip + 1];
             _ip += 2;
-            return new Integer(-(b0 - 251) * 256 - b1 - 108);
+            return Integer.valueOf(-(b0 - 251) * 256 - b1 - 108);
         } else if (b0 == 28) {
 
             // 3 byte integer
-            int b1 = _data[_ip + 1];
-            int b2 = _data[_ip + 2];
+            final int b1 = _data[_ip + 1];
+            final int b2 = _data[_ip + 2];
             _ip += 3;
-            return new Integer(b1 << 8 | b2);
+            return Integer.valueOf(b1 << 8 | b2);
         } else if (b0 == 255) {
 
             // 16-bit signed integer with 16 bits of fraction
-            int b1 = (byte) _data[_ip + 1];
-            int b2 = _data[_ip + 2];
-            int b3 = _data[_ip + 3];
-            int b4 = _data[_ip + 4];
+            final int b1 = (byte) _data[_ip + 1];
+            final int b2 = _data[_ip + 2];
+            final int b3 = _data[_ip + 3];
+            final int b4 = _data[_ip + 4];
             _ip += 5;
-            return new Float((b1 << 8 | b2) + ((b3 << 8 | b4) / 65536.0));
+            return Float.valueOf((b1 << 8 | b2) + ((b3 << 8 | b4) / 65536f));
         } else {
             return null;
         }
@@ -227,7 +227,7 @@ public class CharstringType2 extends Charstring {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         resetIP();
         while (moreBytes()) {
             disassemble(sb);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java
index 21698c7..a65bcd5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDef.java
@@ -20,9 +20,9 @@ public abstract class ClassDef {
 
     public abstract int getFormat();
 
-    protected static ClassDef read(RandomAccessFile raf) throws IOException {
+    protected static ClassDef read(final RandomAccessFile raf) throws IOException {
         ClassDef c = null;
-        int format = raf.readUnsignedShort();
+        final int format = raf.readUnsignedShort();
         if (format == 1) {
             c = new ClassDefFormat1(raf);
         } else if (format == 2) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
index 94910e4..cbc0539 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat1.java
@@ -18,12 +18,12 @@ import java.io.RandomAccessFile;
  */
 public class ClassDefFormat1 extends ClassDef {
 
-    private int startGlyph;
-    private int glyphCount;
-    private int[] classValues;
+    private final int startGlyph;
+    private final int glyphCount;
+    private final int[] classValues;
 
     /** Creates new ClassDefFormat1 */
-    public ClassDefFormat1(RandomAccessFile raf) throws IOException {
+    public ClassDefFormat1(final RandomAccessFile raf) throws IOException {
         startGlyph = raf.readUnsignedShort();
         glyphCount = raf.readUnsignedShort();
         classValues = new int[glyphCount];
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
index 9906ecf..99283f0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ClassDefFormat2.java
@@ -18,11 +18,11 @@ import java.io.RandomAccessFile;
  */
 public class ClassDefFormat2 extends ClassDef {
 
-    private int classRangeCount;
-    private RangeRecord[] classRangeRecords;
+    private final int classRangeCount;
+    private final RangeRecord[] classRangeRecords;
 
     /** Creates new ClassDefFormat2 */
-    public ClassDefFormat2(RandomAccessFile raf) throws IOException {
+    public ClassDefFormat2(final RandomAccessFile raf) throws IOException {
         classRangeCount = raf.readUnsignedShort();
         classRangeRecords = new RangeRecord[classRangeCount];
         for (int i = 0; i < classRangeCount; i++) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
index f705485..6028973 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat.java
@@ -59,12 +59,12 @@ import java.io.IOException;
  */
 public abstract class CmapFormat {
 
-    public class Range {
+    public static class Range {
 
-        private int _startCode;
-        private int _endCode;
+        private final int _startCode;
+        private final int _endCode;
 
-        protected Range(int startCode, int endCode) {
+        protected Range(final int startCode, final int endCode) {
             _startCode = startCode;
             _endCode = endCode;
         }
@@ -82,12 +82,12 @@ public abstract class CmapFormat {
     protected int _length;
     protected int _language;
 
-    protected CmapFormat(DataInput di) throws IOException {
+    protected CmapFormat(final DataInput di) throws IOException {
         _length = di.readUnsignedShort();
         _language = di.readUnsignedShort();
     }
 
-    protected static CmapFormat create(int format, DataInput di)
+    protected static CmapFormat create(final int format, final DataInput di)
     throws IOException {
         switch(format) {
             case 0:
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
index dd1ede2..505e8c9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat0.java
@@ -61,9 +61,9 @@ import java.io.IOException;
  */
 public class CmapFormat0 extends CmapFormat {
 
-    private int[] _glyphIdArray = new int[256];
+    private final int[] _glyphIdArray = new int[256];
 
-    protected CmapFormat0(DataInput di) throws IOException {
+    protected CmapFormat0(final DataInput di) throws IOException {
         super(di);
         _format = 0;
         for (int i = 0; i < 256; i++) {
@@ -77,7 +77,7 @@ public class CmapFormat0 extends CmapFormat {
     }
 
     @Override
-    public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
+    public Range getRange(final int index) throws ArrayIndexOutOfBoundsException {
         if (index != 0) {
             throw new ArrayIndexOutOfBoundsException();
         }
@@ -85,7 +85,7 @@ public class CmapFormat0 extends CmapFormat {
     }
 
     @Override
-    public int mapCharCode(int charCode) {
+    public int mapCharCode(final int charCode) {
         if (0 <= charCode && charCode < 256) {
             return _glyphIdArray[charCode];
         } else {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
index d071e94..743fc93 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat2.java
@@ -60,7 +60,7 @@ import java.io.IOException;
  */
 public class CmapFormat2 extends CmapFormat {
 
-    private class SubHeader {
+    static class SubHeader {
         int _firstCode;
         int _entryCount;
         short _idDelta;
@@ -68,11 +68,11 @@ public class CmapFormat2 extends CmapFormat {
         int _arrayIndex;
     }
 
-    private int[] _subHeaderKeys = new int[256];
-    private SubHeader[] _subHeaders;
-    private int[] _glyphIndexArray;
+    private final int[] _subHeaderKeys = new int[256];
+    private final SubHeader[] _subHeaders;
+    private final int[] _glyphIndexArray;
 
-    protected CmapFormat2(DataInput di) throws IOException {
+    protected CmapFormat2(final DataInput di) throws IOException {
         super(di);
         _format = 2;
 
@@ -86,15 +86,15 @@ public class CmapFormat2 extends CmapFormat {
             highest = Math.max(highest, _subHeaderKeys[i]);
             pos += 2;
         }
-        int subHeaderCount = highest / 8 + 1;
+        final int subHeaderCount = highest / 8 + 1;
         _subHeaders = new SubHeader[subHeaderCount];
 
         // Read the subheaders, once again noting the highest glyphIndexArray
         // index range.
-        int indexArrayOffset = 8 * subHeaderCount + 518;
+        final int indexArrayOffset = 8 * subHeaderCount + 518;
         highest = 0;
         for (int i = 0; i < _subHeaders.length; ++i) {
-            SubHeader sh = new SubHeader();
+            final SubHeader sh = new SubHeader();
             sh._firstCode = di.readUnsignedShort();
             sh._entryCount = di.readUnsignedShort();
             sh._idDelta = di.readShort();
@@ -124,7 +124,7 @@ public class CmapFormat2 extends CmapFormat {
     }
 
     @Override
-    public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
+    public Range getRange(final int index) throws ArrayIndexOutOfBoundsException {
         if (index < 0 || index >= _subHeaders.length) {
             throw new ArrayIndexOutOfBoundsException();
         }
@@ -147,18 +147,18 @@ public class CmapFormat2 extends CmapFormat {
     }
 
     @Override
-    public int mapCharCode(int charCode) {
+    public int mapCharCode(final int charCode) {
 
         // Get the appropriate subheader
         int index = 0;
-        int highByte = charCode >> 8;
+        final int highByte = charCode >> 8;
         if (highByte != 0) {
             index = _subHeaderKeys[highByte] / 8;
         }
-        SubHeader sh = _subHeaders[index];
+        final SubHeader sh = _subHeaders[index];
 
         // Is the charCode out-of-range?
-        int lowByte = charCode & 0xff;
+        final int lowByte = charCode & 0xff;
         if (lowByte < sh._firstCode ||
                 lowByte >= (sh._firstCode + sh._entryCount)) {
             return 0;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
index 2ae23d0..c8be6c7 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat4.java
@@ -59,18 +59,18 @@ import java.io.IOException;
  */
 public class CmapFormat4 extends CmapFormat {
 
-    private int _segCountX2;
-    private int _searchRange;
-    private int _entrySelector;
-    private int _rangeShift;
-    private int[] _endCode;
-    private int[] _startCode;
-    private int[] _idDelta;
-    private int[] _idRangeOffset;
-    private int[] _glyphIdArray;
-    private int _segCount;
-
-    protected CmapFormat4(DataInput di) throws IOException {
+    private final int _segCountX2;
+    private final int _searchRange;
+    private final int _entrySelector;
+    private final int _rangeShift;
+    private final int[] _endCode;
+    private final int[] _startCode;
+    private final int[] _idDelta;
+    private final int[] _idRangeOffset;
+    private final int[] _glyphIdArray;
+    private final int _segCount;
+
+    protected CmapFormat4(final DataInput di) throws IOException {
         super(di); // 6
         _format = 4;
         _segCountX2 = di.readUnsignedShort(); // +2 (8)
@@ -97,7 +97,7 @@ public class CmapFormat4 extends CmapFormat {
         } // + 2*segCount (8*segCount + 16)
 
         // Whatever remains of this header belongs in glyphIdArray
-        int count = (_length - (8*_segCount + 16)) / 2;
+        final int count = (_length - (8*_segCount + 16)) / 2;
         _glyphIdArray = new int[count];
         for (int i = 0; i < count; i++) {
             _glyphIdArray[i] = di.readUnsignedShort();
@@ -116,7 +116,7 @@ public class CmapFormat4 extends CmapFormat {
     }
 
     @Override
-    public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
+    public Range getRange(final int index) throws ArrayIndexOutOfBoundsException {
         if (index < 0 || index >= _segCount) {
             throw new ArrayIndexOutOfBoundsException();
         }
@@ -124,7 +124,7 @@ public class CmapFormat4 extends CmapFormat {
     }
 
     @Override
-    public int mapCharCode(int charCode) {
+    public int mapCharCode(final int charCode) {
         try {
             for (int i = 0; i < _segCount; i++) {
                 if (_endCode[i] >= charCode) {
@@ -139,7 +139,7 @@ public class CmapFormat4 extends CmapFormat {
                     }
                 }
             }
-        } catch (ArrayIndexOutOfBoundsException e) {
+        } catch (final ArrayIndexOutOfBoundsException e) {
             System.err.println("error: Array out of bounds - " + e.getMessage());
         }
         return 0;
@@ -157,13 +157,13 @@ public class CmapFormat4 extends CmapFormat {
             .append(_entrySelector)
             .append(", rangeShift: ")
             .append(_rangeShift)
-            .append(", endCode: ")
-            .append(_endCode)
-            .append(", startCode: ")
-            .append(_endCode)
-            .append(", idDelta: ")
-            .append(_idDelta)
-            .append(", idRangeOffset: ")
-            .append(_idRangeOffset).toString();
+            .append(", endCodeLen: ")
+            .append(_endCode.length)
+            .append(", startCodeLen: ")
+            .append(_endCode.length)
+            .append(", idDeltaLen: ")
+            .append(_idDelta.length)
+            .append(", idRangeOffsetLen: ")
+            .append(_idRangeOffset.length).toString();
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
index 2a33d8d..eff3d2f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormat6.java
@@ -64,7 +64,7 @@ public class CmapFormat6 extends CmapFormat {
     private short _entryCount;
     private short[] _glyphIdArray;
 
-    protected CmapFormat6(DataInput di) throws IOException {
+    protected CmapFormat6(final DataInput di) throws IOException {
         super(di);
         _format = 6;
 
@@ -79,12 +79,12 @@ public class CmapFormat6 extends CmapFormat {
     }
 
     @Override
-    public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
+    public Range getRange(final int index) throws ArrayIndexOutOfBoundsException {
         throw new ArrayIndexOutOfBoundsException();
     }
 
     @Override
-    public int mapCharCode(int charCode) {
+    public int mapCharCode(final int charCode) {
         return 0;
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
index 392683b..e9aa1d4 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapFormatUnknown.java
@@ -32,7 +32,7 @@ import java.io.IOException;
 public class CmapFormatUnknown extends CmapFormat {
 
     /** Creates a new instance of CmapFormatUnknown */
-    protected CmapFormatUnknown(int format, DataInput di) throws IOException {
+    protected CmapFormatUnknown(final int format, final DataInput di) throws IOException {
         super(di);
         _format = format;
 
@@ -46,12 +46,12 @@ public class CmapFormatUnknown extends CmapFormat {
     }
 
     @Override
-    public Range getRange(int index) throws ArrayIndexOutOfBoundsException {
+    public Range getRange(final int index) throws ArrayIndexOutOfBoundsException {
         throw new ArrayIndexOutOfBoundsException();
     }
 
     @Override
-    public int mapCharCode(int charCode) {
+    public int mapCharCode(final int charCode) {
         return 0;
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
index 4833318..1f2c802 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapIndexEntry.java
@@ -59,12 +59,12 @@ import java.io.IOException;
  */
 public class CmapIndexEntry implements Comparable {
 
-    private int _platformId;
-    private int _encodingId;
-    private int _offset;
+    private final int _platformId;
+    private final int _encodingId;
+    private final int _offset;
     private CmapFormat _format;
 
-    protected CmapIndexEntry(DataInput di) throws IOException {
+    protected CmapIndexEntry(final DataInput di) throws IOException {
         _platformId = di.readUnsignedShort();
         _encodingId = di.readUnsignedShort();
         _offset = di.readInt();
@@ -86,7 +86,7 @@ public class CmapIndexEntry implements Comparable {
         return _format;
     }
 
-    public void setFormat(CmapFormat format) {
+    public void setFormat(final CmapFormat format) {
         _format = format;
     }
 
@@ -106,8 +106,8 @@ public class CmapIndexEntry implements Comparable {
     }
 
     @Override
-    public int compareTo(java.lang.Object obj) {
-        CmapIndexEntry entry = (CmapIndexEntry) obj;
+    public int compareTo(final java.lang.Object obj) {
+        final CmapIndexEntry entry = (CmapIndexEntry) obj;
         if (getOffset() < entry.getOffset()) {
             return -1;
         } else if (getOffset() > entry.getOffset()) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
index 2cdddb3..4623eb5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CmapTable.java
@@ -61,12 +61,12 @@ import java.util.Arrays;
  */
 public class CmapTable implements Table {
 
-    private DirectoryEntry _de;
-    private int _version;
-    private int _numTables;
-    private CmapIndexEntry[] _entries;
+    private final DirectoryEntry _de;
+    private final int _version;
+    private final int _numTables;
+    private final CmapIndexEntry[] _entries;
 
-    protected CmapTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected CmapTable(final DirectoryEntry de, final DataInput di) throws IOException {
         _de = (DirectoryEntry) de.clone();
         _version = di.readUnsignedShort();
         _numTables = di.readUnsignedShort();
@@ -98,7 +98,7 @@ public class CmapTable implements Table {
                 // Something is amiss
                 throw new IOException();
             }
-            int formatType = di.readUnsignedShort();
+            final int formatType = di.readUnsignedShort();
             lastFormat = CmapFormat.create(formatType, di);
             lastOffset = _entries[i].getOffset();
             _entries[i].setFormat(lastFormat);
@@ -114,11 +114,11 @@ public class CmapTable implements Table {
         return _numTables;
     }
 
-    public CmapIndexEntry getCmapIndexEntry(int i) {
+    public CmapIndexEntry getCmapIndexEntry(final int i) {
         return _entries[i];
     }
 
-    public CmapFormat getCmapFormat(short platformId, short encodingId) {
+    public CmapFormat getCmapFormat(final short platformId, final short encodingId) {
 
         // Find the requested format
         for (int i = 0; i < _numTables; i++) {
@@ -137,7 +137,7 @@ public class CmapTable implements Table {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder().append("cmap\n");
+        final StringBuilder sb = new StringBuilder().append("cmap\n");
 
         // Get each of the index entries
         for (int i = 0; i < _numTables; i++) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java
index 4f526f5..a6f994f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Coverage.java
@@ -69,9 +69,9 @@ public abstract class Coverage {
      */
     public abstract int findGlyph(int glyphId);
 
-    protected static Coverage read(DataInput di) throws IOException {
+    protected static Coverage read(final DataInput di) throws IOException {
         Coverage c = null;
-        int format = di.readUnsignedShort();
+        final int format = di.readUnsignedShort();
         if (format == 1) {
             c = new CoverageFormat1(di);
         } else if (format == 2) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java
index 715bf11..3deb602 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat1.java
@@ -60,11 +60,11 @@ import java.io.IOException;
  */
 public class CoverageFormat1 extends Coverage {
 
-    private int _glyphCount;
-    private int[] _glyphIds;
+    private final int _glyphCount;
+    private final int[] _glyphIds;
 
     /** Creates new CoverageFormat1 */
-    protected CoverageFormat1(DataInput di) throws IOException {
+    protected CoverageFormat1(final DataInput di) throws IOException {
         _glyphCount = di.readUnsignedShort();
         _glyphIds = new int[_glyphCount];
         for (int i = 0; i < _glyphCount; i++) {
@@ -78,7 +78,7 @@ public class CoverageFormat1 extends Coverage {
     }
 
     @Override
-    public int findGlyph(int glyphId) {
+    public int findGlyph(final int glyphId) {
         for (int i = 0; i < _glyphCount; i++) {
             if (_glyphIds[i] == glyphId) {
                 return i;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java
index bd2a28f..9397f37 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CoverageFormat2.java
@@ -60,11 +60,11 @@ import java.io.IOException;
  */
 public class CoverageFormat2 extends Coverage {
 
-    private int _rangeCount;
-    private RangeRecord[] _rangeRecords;
+    private final int _rangeCount;
+    private final RangeRecord[] _rangeRecords;
 
     /** Creates new CoverageFormat2 */
-    protected CoverageFormat2(DataInput di) throws IOException {
+    protected CoverageFormat2(final DataInput di) throws IOException {
         _rangeCount = di.readUnsignedShort();
         _rangeRecords = new RangeRecord[_rangeCount];
         for (int i = 0; i < _rangeCount; i++) {
@@ -78,9 +78,9 @@ public class CoverageFormat2 extends Coverage {
     }
 
     @Override
-    public int findGlyph(int glyphId) {
+    public int findGlyph(final int glyphId) {
         for (int i = 0; i < _rangeCount; i++) {
-            int n = _rangeRecords[i].getCoverageIndex(glyphId);
+            final int n = _rangeRecords[i].getCoverageIndex(glyphId);
             if (n > -1) {
                 return n;
             }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
index 9e1c47d..7f62d26 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/CvtTable.java
@@ -17,12 +17,12 @@ import java.io.IOException;
  */
 public class CvtTable implements Table {
 
-    private DirectoryEntry de;
-    private short[] values;
+    private final DirectoryEntry de;
+    private final short[] values;
 
-    protected CvtTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected CvtTable(final DirectoryEntry de, final DataInput di) throws IOException {
         this.de = (DirectoryEntry) de.clone();
-        int len = de.getLength() / 2;
+        final int len = de.getLength() / 2;
         values = new short[len];
         for (int i = 0; i < len; i++) {
             values[i] = di.readShort();
@@ -40,7 +40,7 @@ public class CvtTable implements Table {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("'cvt ' Table - Control Value Table\n----------------------------------\n");
         sb.append("Size = ").append(0).append(" bytes, ").append(values.length).append(" entries\n");
         sb.append("        Values\n        ------\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java
index 5451f45..a0b10e1 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Device.java
@@ -18,13 +18,13 @@ import java.io.RandomAccessFile;
  */
 public class Device extends Object {
 
-    private int startSize;
-    private int endSize;
-    private int deltaFormat;
-    private int[] deltaValues;
+    private final int startSize;
+    private final int endSize;
+    private final int deltaFormat;
+    private final int[] deltaValues;
 
     /** Creates new Device */
-    public Device(RandomAccessFile raf) throws IOException {
+    public Device(final RandomAccessFile raf) throws IOException {
         startSize = raf.readUnsignedShort();
         endSize = raf.readUnsignedShort();
         deltaFormat = raf.readUnsignedShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
index e34fa32..54684b8 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DirectoryEntry.java
@@ -59,12 +59,12 @@ import java.io.IOException;
  */
 public class DirectoryEntry implements Cloneable {
 
-    private int _tag;
-    private int _checksum;
-    private int _offset;
-    private int _length;
+    private final int _tag;
+    private final int _checksum;
+    private final int _offset;
+    private final int _length;
 
-    protected DirectoryEntry(DataInput di) throws IOException {
+    protected DirectoryEntry(final DataInput di) throws IOException {
         _tag = di.readInt();
         _checksum = di.readInt();
         _offset = di.readInt();
@@ -75,7 +75,7 @@ public class DirectoryEntry implements Cloneable {
     public Object clone() {
         try {
             return super.clone();
-        } catch (CloneNotSupportedException e) {
+        } catch (final CloneNotSupportedException e) {
             return null;
         }
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java
index 4a09a4c..ec7b503 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigEntry.java
@@ -18,12 +18,12 @@ import java.io.DataInput;
  */
 public class DsigEntry {
 
-    private int format;
-    private int length;
-    private int offset;
+    private final int format;
+    private final int length;
+    private final int offset;
 
     /** Creates new DsigEntry */
-    protected DsigEntry(DataInput di) throws IOException {
+    protected DsigEntry(final DataInput di) throws IOException {
         format = di.readInt();
         length = di.readInt();
         offset = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
index 2b85f52..f2b1322 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/DsigTable.java
@@ -18,15 +18,15 @@ import java.io.DataInput;
  */
 public class DsigTable implements Table {
 
-    private DirectoryEntry de;
-    private int version;
-    private int numSigs;
-    private int flag;
-    private DsigEntry[] dsigEntry;
-    private SignatureBlock[] sigBlocks;
+    private final DirectoryEntry de;
+    private final int version;
+    private final int numSigs;
+    private final int flag;
+    private final DsigEntry[] dsigEntry;
+    private final SignatureBlock[] sigBlocks;
 
     /** Creates new DsigTable */
-    protected DsigTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected DsigTable(final DirectoryEntry de, final DataInput di) throws IOException {
         this.de = (DirectoryEntry) de.clone();
         version = di.readInt();
         numSigs = di.readUnsignedShort();
@@ -63,7 +63,7 @@ public class DsigTable implements Table {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder().append("DSIG\n");
+        final StringBuilder sb = new StringBuilder().append("DSIG\n");
         for (int i = 0; i < numSigs; i++) {
             sb.append(sigBlocks[i].toString());
         }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Feature.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Feature.java
index ee27896..c6f9125 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Feature.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Feature.java
@@ -60,12 +60,12 @@ import java.io.IOException;
  */
 public class Feature {
 
-    private int _featureParams;
-    private int _lookupCount;
-    private int[] _lookupListIndex;
+    private final int _featureParams;
+    private final int _lookupCount;
+    private final int[] _lookupListIndex;
 
     /** Creates new Feature */
-    protected Feature(DataInput di) throws IOException {
+    protected Feature(final DataInput di) throws IOException {
         _featureParams = di.readUnsignedShort();
         _lookupCount = di.readUnsignedShort();
         _lookupListIndex = new int[_lookupCount];
@@ -78,7 +78,7 @@ public class Feature {
         return _lookupCount;
     }
 
-    public int getLookupListIndex(int i) {
+    public int getLookupListIndex(final int i) {
         return _lookupListIndex[i];
     }
 
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java
index fdedca9..9333780 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureList.java
@@ -60,12 +60,12 @@ import java.io.IOException;
  */
 public class FeatureList {
 
-    private int _featureCount;
-    private FeatureRecord[] _featureRecords;
-    private Feature[] _features;
+    private final int _featureCount;
+    private final FeatureRecord[] _featureRecords;
+    private final Feature[] _features;
 
     /** Creates new FeatureList */
-    public FeatureList(DataInputStream dis, int offset) throws IOException {
+    public FeatureList(final DataInputStream dis, final int offset) throws IOException {
 
         // Ensure we're in the right place
         dis.reset();
@@ -89,19 +89,19 @@ public class FeatureList {
         return _featureCount;
     }
 
-    public FeatureRecord getFeatureRecord(int i) {
+    public FeatureRecord getFeatureRecord(final int i) {
         return _featureRecords[i];
     }
 
-    public Feature getFeature(int i) {
+    public Feature getFeature(final int i) {
         return _features[i];
     }
 
-    public Feature findFeature(LangSys langSys, String tag) {
+    public Feature findFeature(final LangSys langSys, final String tag) {
         if (tag.length() != 4) {
             return null;
         }
-        int tagVal = ((tag.charAt(0)<<24)
+        final int tagVal = ((tag.charAt(0)<<24)
             | (tag.charAt(1)<<16)
             | (tag.charAt(2)<<8)
             | tag.charAt(3));
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java
index 1da74f4..0650690 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FeatureRecord.java
@@ -60,11 +60,11 @@ import java.io.IOException;
  */
 public class FeatureRecord {
 
-    private int _tag;
-    private int _offset;
+    private final int _tag;
+    private final int _offset;
 
     /** Creates new FeatureRecord */
-    protected FeatureRecord(DataInput di) throws IOException {
+    protected FeatureRecord(final DataInput di) throws IOException {
         _tag = di.readInt();
         _offset = di.readUnsignedShort();
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
index 467a4f3..e44acfa 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/FpgmTable.java
@@ -19,9 +19,9 @@ import jogamp.graph.font.typecast.ot.Disassembler;
  */
 public class FpgmTable extends Program implements Table {
 
-    private DirectoryEntry de;
+    private final DirectoryEntry de;
 
-    protected FpgmTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected FpgmTable(final DirectoryEntry de, final DataInput di) throws IOException {
         this.de = (DirectoryEntry) de.clone();
         readInstructions(di, de.getLength());
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
index cc87b19..cebc516 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspRange.java
@@ -21,18 +21,18 @@ public class GaspRange {
     public static final int GASP_GRIDFIT = 1;
     public static final int GASP_DOGRAY = 2;
 
-    private int rangeMaxPPEM;
-    private int rangeGaspBehavior;
+    private final int rangeMaxPPEM;
+    private final int rangeGaspBehavior;
 
     /** Creates new GaspRange */
-    protected GaspRange(DataInput di) throws IOException {
+    protected GaspRange(final DataInput di) throws IOException {
         rangeMaxPPEM = di.readUnsignedShort();
         rangeGaspBehavior = di.readUnsignedShort();
     }
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("  rangeMaxPPEM:        ").append(rangeMaxPPEM)
             .append("\n  rangeGaspBehavior:   0x").append(rangeGaspBehavior);
         if ((rangeGaspBehavior & GASP_GRIDFIT) != 0) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
index 8f91e6d..7bf7f96 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GaspTable.java
@@ -18,13 +18,13 @@ import java.io.IOException;
  */
 public class GaspTable implements Table {
 
-    private DirectoryEntry de;
-    private int version;
-    private int numRanges;
-    private GaspRange[] gaspRange;
+    private final DirectoryEntry de;
+    private final int version;
+    private final int numRanges;
+    private final GaspRange[] gaspRange;
 
     /** Creates new GaspTable */
-    protected GaspTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected GaspTable(final DirectoryEntry de, final DataInput di) throws IOException {
         this.de = (DirectoryEntry) de.clone();
         version = di.readUnsignedShort();
         numRanges = di.readUnsignedShort();
@@ -41,7 +41,7 @@ public class GaspTable implements Table {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("'gasp' Table - Grid-fitting And Scan-conversion Procedure\n---------------------------------------------------------");
         sb.append("\n  'gasp' version:      ").append(version);
         sb.append("\n  numRanges:           ").append(numRanges);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeComp.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeComp.java
index e5c8687..4db4ddc 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeComp.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeComp.java
@@ -69,12 +69,12 @@ public class GlyfCompositeComp {
     public static final short WE_HAVE_INSTRUCTIONS = 0x0100;
     public static final short USE_MY_METRICS = 0x0200;
 
-    private int _firstIndex;
-    private int _firstContour;
+    private final int _firstIndex;
+    private final int _firstContour;
     private short _argument1;
     private short _argument2;
-    private int _flags;
-    private int _glyphIndex;
+    private final int _flags;
+    private final int _glyphIndex;
     private double _xscale = 1.0;
     private double _yscale = 1.0;
     private double _scale01 = 0.0;
@@ -84,7 +84,7 @@ public class GlyfCompositeComp {
     private int _point1 = 0;
     private int _point2 = 0;
 
-    protected GlyfCompositeComp(int firstIndex, int firstContour, DataInput di)
+    protected GlyfCompositeComp(final int firstIndex, final int firstContour, final DataInput di)
     throws IOException {
         _firstIndex = firstIndex;
         _firstContour = firstContour;
@@ -96,8 +96,8 @@ public class GlyfCompositeComp {
             _argument1 = di.readShort();
             _argument2 = di.readShort();
         } else {
-            _argument1 = (short) di.readByte();
-            _argument2 = (short) di.readByte();
+            _argument1 = di.readByte();
+            _argument2 = di.readByte();
         }
 
         // Assign the arguments according to the flags
@@ -111,7 +111,7 @@ public class GlyfCompositeComp {
 
         // Get the scale values (if any)
         if ((_flags & WE_HAVE_A_SCALE) != 0) {
-            int i = di.readShort();
+            final int i = di.readShort();
             _xscale = _yscale = (double) i / (double) 0x4000;
         } else if ((_flags & WE_HAVE_AN_X_AND_Y_SCALE) != 0) {
             short i = di.readShort();
@@ -184,8 +184,8 @@ public class GlyfCompositeComp {
      * @param y The y-coordinate of the point to transform
      * @return The transformed x-coordinate
      */
-    public int scaleX(int x, int y) {
-        return (int)((double) x * _xscale + (double) y * _scale10);
+    public int scaleX(final int x, final int y) {
+        return (int)(x * _xscale + y * _scale10);
     }
 
     /**
@@ -194,7 +194,7 @@ public class GlyfCompositeComp {
      * @param y The y-coordinate of the point to transform
      * @return The transformed y-coordinate
      */
-    public int scaleY(int x, int y) {
-        return (int)((double) x * _scale01 + (double) y * _yscale);
+    public int scaleY(final int x, final int y) {
+        return (int)(x * _scale01 + y * _yscale);
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
index 50e0fa3..3879da0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfCompositeDescript.java
@@ -65,13 +65,13 @@ import java.util.ArrayList;
  */
 public class GlyfCompositeDescript extends GlyfDescript {
 
-    private ArrayList<GlyfCompositeComp> _components =
+    private final ArrayList<GlyfCompositeComp> _components =
         new ArrayList<GlyfCompositeComp>();
 
     public GlyfCompositeDescript(
-            GlyfTable parentTable,
-            int glyphIndex,
-            DataInput di) throws IOException {
+            final GlyfTable parentTable,
+            final int glyphIndex,
+            final DataInput di) throws IOException {
         super(parentTable, glyphIndex, (short) -1, di);
 
         // Get all of the composite components
@@ -81,7 +81,7 @@ public class GlyfCompositeDescript extends GlyfDescript {
         try {
             do {
                 _components.add(comp = new GlyfCompositeComp(firstIndex, firstContour, di));
-                GlyfDescript desc = parentTable.getDescription(comp.getGlyphIndex());
+                final GlyfDescript desc = parentTable.getDescription(comp.getGlyphIndex());
                 if (desc != null) {
                     firstIndex += desc.getPointCount();
                     firstContour += desc.getContourCount();
@@ -92,7 +92,7 @@ public class GlyfCompositeDescript extends GlyfDescript {
             if ((comp.getFlags() & GlyfCompositeComp.WE_HAVE_INSTRUCTIONS) != 0) {
                 readInstructions(di, di.readShort());
             }
-        } catch (IOException e) {
+        } catch (final IOException e) {
             throw e;
 //        } catch (Exception e) {
 //            int foo = 0;
@@ -100,33 +100,33 @@ public class GlyfCompositeDescript extends GlyfDescript {
     }
 
     @Override
-    public int getEndPtOfContours(int i) {
-        GlyfCompositeComp c = getCompositeCompEndPt(i);
+    public int getEndPtOfContours(final int i) {
+        final GlyfCompositeComp c = getCompositeCompEndPt(i);
         if (c != null) {
-            GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+            final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
             return gd.getEndPtOfContours(i - c.getFirstContour()) + c.getFirstIndex();
         }
         return 0;
     }
 
     @Override
-    public byte getFlags(int i) {
-        GlyfCompositeComp c = getCompositeComp(i);
+    public byte getFlags(final int i) {
+        final GlyfCompositeComp c = getCompositeComp(i);
         if (c != null) {
-            GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+            final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
             return gd.getFlags(i - c.getFirstIndex());
         }
         return 0;
     }
 
     @Override
-    public short getXCoordinate(int i) {
-        GlyfCompositeComp c = getCompositeComp(i);
+    public short getXCoordinate(final int i) {
+        final GlyfCompositeComp c = getCompositeComp(i);
         if (c != null) {
-            GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
-            int n = i - c.getFirstIndex();
-            int x = gd.getXCoordinate(n);
-            int y = gd.getYCoordinate(n);
+            final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+            final int n = i - c.getFirstIndex();
+            final int x = gd.getXCoordinate(n);
+            final int y = gd.getYCoordinate(n);
             short x1 = (short) c.scaleX(x, y);
             x1 += c.getXTranslate();
             return x1;
@@ -135,13 +135,13 @@ public class GlyfCompositeDescript extends GlyfDescript {
     }
 
     @Override
-    public short getYCoordinate(int i) {
-        GlyfCompositeComp c = getCompositeComp(i);
+    public short getYCoordinate(final int i) {
+        final GlyfCompositeComp c = getCompositeComp(i);
         if (c != null) {
-            GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
-            int n = i - c.getFirstIndex();
-            int x = gd.getXCoordinate(n);
-            int y = gd.getYCoordinate(n);
+            final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+            final int n = i - c.getFirstIndex();
+            final int x = gd.getXCoordinate(n);
+            final int y = gd.getYCoordinate(n);
             short y1 = (short) c.scaleY(x, y);
             y1 += c.getYTranslate();
             return y1;
@@ -156,8 +156,8 @@ public class GlyfCompositeDescript extends GlyfDescript {
 
     @Override
     public int getPointCount() {
-        GlyfCompositeComp c = _components.get(_components.size()-1);
-        GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+        final GlyfCompositeComp c = _components.get(_components.size()-1);
+        final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
         if (gd != null) {
             return c.getFirstIndex() + gd.getPointCount();
         } else {
@@ -167,11 +167,12 @@ public class GlyfCompositeDescript extends GlyfDescript {
 
     @Override
     public int getContourCount() {
-        GlyfCompositeComp c = _components.get(_components.size()-1);
-        return c.getFirstContour() + _parentTable.getDescription(c.getGlyphIndex()).getContourCount();
+        final GlyfCompositeComp c = _components.get(_components.size()-1);
+        final GlyfDescript d = _parentTable.getDescription(c.getGlyphIndex());
+        return c.getFirstContour() + ( null != d ? d.getContourCount() : 0 );
     }
 
-    public int getComponentIndex(int i) {
+    public int getComponentIndex(final int i) {
         return _components.get(i).getFirstIndex();
     }
 
@@ -179,15 +180,15 @@ public class GlyfCompositeDescript extends GlyfDescript {
         return _components.size();
     }
 
-    public GlyfCompositeComp getComponent(int i) {
+    public GlyfCompositeComp getComponent(final int i) {
         return _components.get(i);
     }
 
-    protected GlyfCompositeComp getCompositeComp(int i) {
+    protected GlyfCompositeComp getCompositeComp(final int i) {
         GlyfCompositeComp c;
         for (int n = 0; n < _components.size(); n++) {
             c = _components.get(n);
-            GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+            final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
             if (c.getFirstIndex() <= i && i < (c.getFirstIndex() + gd.getPointCount())) {
                 return c;
             }
@@ -195,11 +196,11 @@ public class GlyfCompositeDescript extends GlyfDescript {
         return null;
     }
 
-    protected GlyfCompositeComp getCompositeCompEndPt(int i) {
+    protected GlyfCompositeComp getCompositeCompEndPt(final int i) {
         GlyfCompositeComp c;
         for (int j = 0; j < _components.size(); j++) {
             c = _components.get(j);
-            GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
+            final GlyphDescription gd = _parentTable.getDescription(c.getGlyphIndex());
             if (c.getFirstContour() <= i && i < (c.getFirstContour() + gd.getContourCount())) {
                 return c;
             }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
index 6b06eb3..3d2154d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfDescript.java
@@ -69,17 +69,17 @@ public abstract class GlyfDescript extends Program implements GlyphDescription {
 
     protected GlyfTable _parentTable;
     private int _glyphIndex;
-    private int _numberOfContours;
-    private short _xMin;
-    private short _yMin;
-    private short _xMax;
-    private short _yMax;
+    private final int _numberOfContours;
+    private final short _xMin;
+    private final short _yMin;
+    private final short _xMax;
+    private final short _yMax;
 
     protected GlyfDescript(
-            GlyfTable parentTable,
-            int glyphIndex,
-            short numberOfContours,
-            DataInput di) throws IOException {
+            final GlyfTable parentTable,
+            final int glyphIndex,
+            final short numberOfContours,
+            final DataInput di) throws IOException {
         _parentTable = parentTable;
         _numberOfContours = numberOfContours;
         _xMin = di.readShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
index c06ceaa..041c0f0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfSimpleDescript.java
@@ -61,17 +61,17 @@ import jogamp.graph.font.typecast.ot.Disassembler;
  */
 public class GlyfSimpleDescript extends GlyfDescript {
 
-    private int[] _endPtsOfContours;
-    private byte[] _flags;
-    private short[] _xCoordinates;
-    private short[] _yCoordinates;
-    private int _count;
+    private final int[] _endPtsOfContours;
+    private final byte[] _flags;
+    private final short[] _xCoordinates;
+    private final short[] _yCoordinates;
+    private final int _count;
 
     public GlyfSimpleDescript(
-            GlyfTable parentTable,
-            int glyphIndex,
-            short numberOfContours,
-            DataInput di) throws IOException {
+            final GlyfTable parentTable,
+            final int glyphIndex,
+            final short numberOfContours,
+            final DataInput di) throws IOException {
         super(parentTable, glyphIndex, numberOfContours, di);
 
         // Simple glyph description
@@ -86,29 +86,29 @@ public class GlyfSimpleDescript extends GlyfDescript {
         _xCoordinates = new short[_count];
         _yCoordinates = new short[_count];
 
-        int instructionCount = di.readShort();
+        final int instructionCount = di.readShort();
         readInstructions(di, instructionCount);
         readFlags(_count, di);
         readCoords(_count, di);
     }
 
     @Override
-    public int getEndPtOfContours(int i) {
+    public int getEndPtOfContours(final int i) {
         return _endPtsOfContours[i];
     }
 
     @Override
-    public byte getFlags(int i) {
+    public byte getFlags(final int i) {
         return _flags[i];
     }
 
     @Override
-    public short getXCoordinate(int i) {
+    public short getXCoordinate(final int i) {
         return _xCoordinates[i];
     }
 
     @Override
-    public short getYCoordinate(int i) {
+    public short getYCoordinate(final int i) {
         return _yCoordinates[i];
     }
 
@@ -138,7 +138,7 @@ public class GlyfSimpleDescript extends GlyfDescript {
     /**
      * The table is stored as relative values, but we'll store them as absolutes
      */
-    private void readCoords(int count, DataInput di) throws IOException {
+    private void readCoords(final int count, final DataInput di) throws IOException {
         short x = 0;
         short y = 0;
         for (int i = 0; i < count; i++) {
@@ -175,26 +175,26 @@ public class GlyfSimpleDescript extends GlyfDescript {
     /**
      * The flags are run-length encoded
      */
-    private void readFlags(int flagCount, DataInput di) throws IOException {
+    private void readFlags(final int flagCount, final DataInput di) throws IOException {
         try {
             for (int index = 0; index < flagCount; index++) {
                 _flags[index] = di.readByte();
                 if ((_flags[index] & repeat) != 0) {
-                    int repeats = di.readByte();
+                    final int repeats = di.readByte();
                     for (int i = 1; i <= repeats; i++) {
                         _flags[index + i] = _flags[index];
                     }
                     index += repeats;
                 }
             }
-        } catch (ArrayIndexOutOfBoundsException e) {
+        } catch (final ArrayIndexOutOfBoundsException e) {
             System.out.println("error: array index out of bounds");
         }
     }
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append(super.toString());
         sb.append("\n\n        EndPoints\n        ---------");
         for (int i = 0; i < _endPtsOfContours.length; i++) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
index 4b196c9..6750e93 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GlyfTable.java
@@ -61,30 +61,30 @@ import java.io.IOException;
  */
 public class GlyfTable implements Table {
 
-    private DirectoryEntry _de;
-    private GlyfDescript[] _descript;
+    private final DirectoryEntry _de;
+    private final GlyfDescript[] _descript;
 
     protected GlyfTable(
-            DirectoryEntry de,
-            DataInput di,
-            MaxpTable maxp,
-            LocaTable loca) throws IOException {
+            final DirectoryEntry de,
+            final DataInput di,
+            final MaxpTable maxp,
+            final LocaTable loca) throws IOException {
         _de = (DirectoryEntry) de.clone();
         _descript = new GlyfDescript[maxp.getNumGlyphs()];
 
         // Buffer the whole table so we can randomly access it
-        byte[] buf = new byte[de.getLength()];
+        final byte[] buf = new byte[de.getLength()];
         di.readFully(buf);
-        ByteArrayInputStream bais = new ByteArrayInputStream(buf);
+        final ByteArrayInputStream bais = new ByteArrayInputStream(buf);
 
         // Process all the simple glyphs
         for (int i = 0; i < maxp.getNumGlyphs(); i++) {
-            int len = loca.getOffset(i + 1) - loca.getOffset(i);
+            final int len = loca.getOffset(i + 1) - loca.getOffset(i);
             if (len > 0) {
                 bais.reset();
                 bais.skip(loca.getOffset(i));
-                DataInputStream dis = new DataInputStream(bais);
-                short numberOfContours = dis.readShort();
+                final DataInputStream dis = new DataInputStream(bais);
+                final short numberOfContours = dis.readShort();
                 if (numberOfContours >= 0) {
                     _descript[i] = new GlyfSimpleDescript(this, i, numberOfContours, dis);
                 }
@@ -95,12 +95,12 @@ public class GlyfTable implements Table {
 
         // Now do all the composite glyphs
         for (int i = 0; i < maxp.getNumGlyphs(); i++) {
-            int len = loca.getOffset(i + 1) - loca.getOffset(i);
+            final int len = loca.getOffset(i + 1) - loca.getOffset(i);
             if (len > 0) {
                 bais.reset();
                 bais.skip(loca.getOffset(i));
-                DataInputStream dis = new DataInputStream(bais);
-                short numberOfContours = dis.readShort();
+                final DataInputStream dis = new DataInputStream(bais);
+                final short numberOfContours = dis.readShort();
                 if (numberOfContours < 0) {
                     _descript[i] = new GlyfCompositeDescript(this, i, dis);
                 }
@@ -108,7 +108,7 @@ public class GlyfTable implements Table {
         }
     }
 
-    public GlyfDescript getDescription(int i) {
+    public GlyfDescript getDescription(final int i) {
         if (i < _descript.length) {
             return _descript[i];
         } else {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
index 30ecdd0..ce6f308 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GposTable.java
@@ -30,16 +30,16 @@ import java.io.IOException;
  */
 public class GposTable implements Table {
 
-    private DirectoryEntry _de;
+    private final DirectoryEntry _de;
 
-    protected GposTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected GposTable(final DirectoryEntry de, final DataInput di) throws IOException {
         _de = (DirectoryEntry) de.clone();
 
         // GPOS Header
-        int version = di.readInt();
-        int scriptList = di.readInt();
-        int featureList = di.readInt();
-        int lookupList = di.readInt();
+        /* final int version = */ di.readInt();
+        /* final int scriptList = */ di.readInt();
+        /* final int featureList = */ di.readInt();
+        /* final int lookupList = */ di.readInt();
     }
 
     /** Get the table type, as a table directory value.
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
index c23d420..3147fc8 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/GsubTable.java
@@ -62,24 +62,24 @@ import java.io.IOException;
  */
 public class GsubTable implements Table, LookupSubtableFactory {
 
-    private DirectoryEntry _de;
-    private ScriptList _scriptList;
-    private FeatureList _featureList;
-    private LookupList _lookupList;
+    private final DirectoryEntry _de;
+    private final ScriptList _scriptList;
+    private final FeatureList _featureList;
+    private final LookupList _lookupList;
 
-    protected GsubTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected GsubTable(final DirectoryEntry de, final DataInput di) throws IOException {
         _de = (DirectoryEntry) de.clone();
 
         // Load into a temporary buffer, and create another input stream
-        byte[] buf = new byte[de.getLength()];
+        final byte[] buf = new byte[de.getLength()];
         di.readFully(buf);
-        DataInputStream dis = new DataInputStream(new ByteArrayInputStream(buf));
+        final DataInputStream dis = new DataInputStream(new ByteArrayInputStream(buf));
 
         // GSUB Header
-        int version = dis.readInt();
-        int scriptListOffset = dis.readUnsignedShort();
-        int featureListOffset = dis.readUnsignedShort();
-        int lookupListOffset = dis.readUnsignedShort();
+        /* final int version = */ dis.readInt();
+        final int scriptListOffset = dis.readUnsignedShort();
+        final int featureListOffset = dis.readUnsignedShort();
+        final int lookupListOffset = dis.readUnsignedShort();
 
         // Script List
         _scriptList = new ScriptList(dis, scriptListOffset);
@@ -101,9 +101,9 @@ public class GsubTable implements Table, LookupSubtableFactory {
      */
     @Override
     public LookupSubtable read(
-            int type,
-            DataInputStream dis,
-            int offset) throws IOException {
+            final int type,
+            final DataInputStream dis,
+            final int offset) throws IOException {
         LookupSubtable s = null;
         switch (type) {
         case 1:
@@ -153,7 +153,7 @@ public class GsubTable implements Table, LookupSubtableFactory {
         return "GSUB";
     }
 
-    public static String lookupTypeAsString(int type) {
+    public static String lookupTypeAsString(final int type) {
         switch (type) {
         case 1:
             return "Single";
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
index 64f5e64..2bd51c1 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HdmxTable.java
@@ -31,13 +31,13 @@ import java.io.IOException;
  */
 public class HdmxTable implements Table {
 
-    public class DeviceRecord {
+    public static class DeviceRecord {
 
-        private short _pixelSize;
-        private short _maxWidth;
-        private short[] _widths;
+        private final short _pixelSize;
+        private final short _maxWidth;
+        private final short[] _widths;
 
-        protected DeviceRecord(int numGlyphs, DataInput di) throws IOException {
+        protected DeviceRecord(final int numGlyphs, final DataInput di) throws IOException {
             _pixelSize = di.readByte();
             _maxWidth = di.readByte();
             _widths = new short[numGlyphs];
@@ -58,20 +58,20 @@ public class HdmxTable implements Table {
             return _widths;
         }
 
-        public short getWidth(int glyphidx) {
+        public short getWidth(final int glyphidx) {
             return _widths[glyphidx];
         }
 
     }
 
-    private DirectoryEntry _de;
-    private int _version;
-    private short _numRecords;
-    private int _sizeDeviceRecords;
-    private DeviceRecord[] _records;
+    private final DirectoryEntry _de;
+    private final int _version;
+    private final short _numRecords;
+    private final int _sizeDeviceRecords;
+    private final DeviceRecord[] _records;
 
     /** Creates a new instance of HdmxTable */
-    protected HdmxTable(DirectoryEntry de, DataInput di, MaxpTable maxp)
+    protected HdmxTable(final DirectoryEntry de, final DataInput di, final MaxpTable maxp)
     throws IOException {
         _de = (DirectoryEntry) de.clone();
         _version = di.readUnsignedShort();
@@ -89,7 +89,7 @@ public class HdmxTable implements Table {
         return _numRecords;
     }
 
-    public DeviceRecord getRecord(int i) {
+    public DeviceRecord getRecord(final int i) {
         return _records[i];
     }
 
@@ -100,7 +100,7 @@ public class HdmxTable implements Table {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("'hdmx' Table - Horizontal Device Metrics\n----------------------------------------\n");
         sb.append("Size = ").append(_de.getLength()).append(" bytes\n")
             .append("\t'hdmx' version:         ").append(_version).append("\n")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
index 47e60f9..85158ea 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HeadTable.java
@@ -62,26 +62,26 @@ import jogamp.graph.font.typecast.ot.Fixed;
  */
 public class HeadTable implements Table {
 
-    private DirectoryEntry _de;
-    private int _versionNumber;
-    private int _fontRevision;
-    private int _checkSumAdjustment;
-    private int _magicNumber;
-    private short _flags;
-    private short _unitsPerEm;
-    private long _created;
-    private long _modified;
-    private short _xMin;
-    private short _yMin;
-    private short _xMax;
-    private short _yMax;
-    private short _macStyle;
-    private short _lowestRecPPEM;
-    private short _fontDirectionHint;
-    private short _indexToLocFormat;
-    private short _glyphDataFormat;
-
-    protected HeadTable(DirectoryEntry de, DataInput di) throws IOException {
+    private final DirectoryEntry _de;
+    private final int _versionNumber;
+    private final int _fontRevision;
+    private final int _checkSumAdjustment;
+    private final int _magicNumber;
+    private final short _flags;
+    private final short _unitsPerEm;
+    private final long _created;
+    private final long _modified;
+    private final short _xMin;
+    private final short _yMin;
+    private final short _xMax;
+    private final short _yMax;
+    private final short _macStyle;
+    private final short _lowestRecPPEM;
+    private final short _fontDirectionHint;
+    private final short _indexToLocFormat;
+    private final short _glyphDataFormat;
+
+    protected HeadTable(final DirectoryEntry de, final DataInput di) throws IOException {
         this._de = (DirectoryEntry) de.clone();
         _versionNumber = di.readInt();
         _fontRevision = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
index 242c9b1..e67a037 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HheaTable.java
@@ -19,21 +19,21 @@ import jogamp.graph.font.typecast.ot.Fixed;
  */
 public class HheaTable implements Table {
 
-    private DirectoryEntry de;
-    private int version;
-    private short ascender;
-    private short descender;
-    private short lineGap;
-    private short advanceWidthMax;
-    private short minLeftSideBearing;
-    private short minRightSideBearing;
-    private short xMaxExtent;
-    private short caretSlopeRise;
-    private short caretSlopeRun;
-    private short metricDataFormat;
-    private int numberOfHMetrics;
-
-    protected HheaTable(DirectoryEntry de, DataInput di) throws IOException {
+    private final DirectoryEntry de;
+    private final int version;
+    private final short ascender;
+    private final short descender;
+    private final short lineGap;
+    private final short advanceWidthMax;
+    private final short minLeftSideBearing;
+    private final short minRightSideBearing;
+    private final short xMaxExtent;
+    private final short caretSlopeRise;
+    private final short caretSlopeRun;
+    private final short metricDataFormat;
+    private final int numberOfHMetrics;
+
+    protected HheaTable(final DirectoryEntry de, final DataInput di) throws IOException {
         this.de = (DirectoryEntry) de.clone();
         version = di.readInt();
         ascender = di.readShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java
index 122a0a8..3a9672a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/HmtxTable.java
@@ -59,15 +59,15 @@ import java.io.IOException;
  */
 public class HmtxTable implements Table {
 
-    private DirectoryEntry _de;
+    private final DirectoryEntry _de;
     private int[] _hMetrics = null;
     private short[] _leftSideBearing = null;
 
     protected HmtxTable(
-            DirectoryEntry de,
-            DataInput di,
-            HheaTable hhea,
-            MaxpTable maxp) throws IOException {
+            final DirectoryEntry de,
+            final DataInput di,
+            final HheaTable hhea,
+            final MaxpTable maxp) throws IOException {
         _de = (DirectoryEntry) de.clone();
         _hMetrics = new int[hhea.getNumberOfHMetrics()];
         for (int i = 0; i < hhea.getNumberOfHMetrics(); ++i) {
@@ -77,14 +77,14 @@ public class HmtxTable implements Table {
                     | di.readUnsignedByte()<<8
                     | di.readUnsignedByte();
         }
-        int lsbCount = maxp.getNumGlyphs() - hhea.getNumberOfHMetrics();
+        final int lsbCount = maxp.getNumGlyphs() - hhea.getNumberOfHMetrics();
         _leftSideBearing = new short[lsbCount];
         for (int i = 0; i < lsbCount; ++i) {
             _leftSideBearing[i] = di.readShort();
         }
     }
 
-    public int getAdvanceWidth(int i) {
+    public int getAdvanceWidth(final int i) {
         if (_hMetrics == null) {
             return 0;
         }
@@ -95,7 +95,7 @@ public class HmtxTable implements Table {
         }
     }
 
-    public short getLeftSideBearing(int i) {
+    public short getLeftSideBearing(final int i) {
         if (_hMetrics == null) {
             return 0;
         }
@@ -113,7 +113,7 @@ public class HmtxTable implements Table {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("'hmtx' Table - Horizontal Metrics\n---------------------------------\n");
         sb.append("Size = ").append(_de.getLength()).append(" bytes, ")
             .append(_hMetrics.length).append(" entries\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java
index eed8c18..ad7e4e3 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ID.java
@@ -190,7 +190,7 @@ public abstract class ID {
     public static final short nameSampleText = 19;
     public static final short namePostScriptCIDFindfontName = 20;
 
-    public static String getPlatformName(short platformId) {
+    public static String getPlatformName(final short platformId) {
         switch (platformId) {
             case platformUnicode:   return "Unicode";
             case platformMacintosh: return "Macintosh";
@@ -200,7 +200,7 @@ public abstract class ID {
         }
     }
 
-    public static String getEncodingName(short platformId, short encodingId) {
+    public static String getEncodingName(final short platformId, final short encodingId) {
 
         if (platformId == platformUnicode) {
 
@@ -284,7 +284,7 @@ public abstract class ID {
         return "";
     }
 
-    public static String getLanguageName(short platformId, short languageId) {
+    public static String getLanguageName(final short platformId, final short languageId) {
 
         if (platformId == platformMacintosh) {
             switch (languageId) {
@@ -371,7 +371,7 @@ public abstract class ID {
         return "";
     }
 
-    public static String getNameName(short nameId) {
+    public static String getNameName(final short nameId) {
         switch (nameId) {
             case nameCopyrightNotice: return "Copyright notice";
             case nameFontFamilyName: return "Font Family name";
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
index 04fd646..dcf02cb 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtable.java
@@ -26,12 +26,12 @@ public abstract class KernSubtable {
 
     public abstract KerningPair getKerningPair(int i);
 
-    public static KernSubtable read(DataInput di) throws IOException {
+    public static KernSubtable read(final DataInput di) throws IOException {
         KernSubtable table = null;
-        int version = di.readUnsignedShort();
-        int length = di.readUnsignedShort();
-        int coverage = di.readUnsignedShort();
-        int format = coverage >> 8;
+        /* final int version = */ di.readUnsignedShort();
+        /* final int length = */ di.readUnsignedShort();
+        final int coverage = di.readUnsignedShort();
+        final int format = coverage >> 8;
 
         switch (format) {
         case 0:
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
index 1e7ff8c..2d1acdd 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat0.java
@@ -18,14 +18,14 @@ import java.io.IOException;
  */
 public class KernSubtableFormat0 extends KernSubtable {
 
-    private int nPairs;
-    private int searchRange;
-    private int entrySelector;
-    private int rangeShift;
-    private KerningPair[] kerningPairs;
+    private final int nPairs;
+    private final int searchRange;
+    private final int entrySelector;
+    private final int rangeShift;
+    private final KerningPair[] kerningPairs;
 
     /** Creates new KernSubtableFormat0 */
-    protected KernSubtableFormat0(DataInput di) throws IOException {
+    protected KernSubtableFormat0(final DataInput di) throws IOException {
         nPairs = di.readUnsignedShort();
         searchRange = di.readUnsignedShort();
         entrySelector = di.readUnsignedShort();
@@ -42,7 +42,7 @@ public class KernSubtableFormat0 extends KernSubtable {
     }
 
     @Override
-    public KerningPair getKerningPair(int i) {
+    public KerningPair getKerningPair(final int i) {
         return kerningPairs[i];
     }
 
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
index 9c7fc81..deb56c9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernSubtableFormat2.java
@@ -18,13 +18,13 @@ import java.io.IOException;
  */
 public class KernSubtableFormat2 extends KernSubtable {
 
-    private int rowWidth;
-    private int leftClassTable;
-    private int rightClassTable;
-    private int array;
+    private final int rowWidth;
+    private final int leftClassTable;
+    private final int rightClassTable;
+    private final int array;
 
     /** Creates new KernSubtableFormat2 */
-    protected KernSubtableFormat2(DataInput di) throws IOException {
+    protected KernSubtableFormat2(final DataInput di) throws IOException {
         rowWidth = di.readUnsignedShort();
         leftClassTable = di.readUnsignedShort();
         rightClassTable = di.readUnsignedShort();
@@ -37,7 +37,7 @@ public class KernSubtableFormat2 extends KernSubtable {
     }
 
     @Override
-    public KerningPair getKerningPair(int i) {
+    public KerningPair getKerningPair(final int i) {
         return null;
     }
 
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
index 006a868..6f1d682 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KernTable.java
@@ -18,13 +18,13 @@ import java.io.IOException;
  */
 public class KernTable implements Table {
 
-    private DirectoryEntry de;
-    private int version;
-    private int nTables;
-    private KernSubtable[] tables;
+    private final DirectoryEntry de;
+    private final int version;
+    private final int nTables;
+    private final KernSubtable[] tables;
 
     /** Creates new KernTable */
-    protected KernTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected KernTable(final DirectoryEntry de, final DataInput di) throws IOException {
         this.de = (DirectoryEntry) de.clone();
         version = di.readUnsignedShort();
         nTables = di.readUnsignedShort();
@@ -38,7 +38,7 @@ public class KernTable implements Table {
         return nTables;
     }
 
-    public KernSubtable getSubtable(int i) {
+    public KernSubtable getSubtable(final int i) {
         return tables[i];
     }
 
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java
index 52f82cc..dd5d0ba 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/KerningPair.java
@@ -18,12 +18,12 @@ import java.io.IOException;
  */
 public class KerningPair {
 
-    private int left;
-    private int right;
-    private short value;
+    private final int left;
+    private final int right;
+    private final short value;
 
     /** Creates new KerningPair */
-    protected KerningPair(DataInput di) throws IOException {
+    protected KerningPair(final DataInput di) throws IOException {
         left = di.readUnsignedShort();
         right = di.readUnsignedShort();
         value = di.readShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java
index 1ab112a..e12d2e2 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSys.java
@@ -60,13 +60,13 @@ import java.io.IOException;
  */
 public class LangSys {
 
-    private int _lookupOrder;
-    private int _reqFeatureIndex;
-    private int _featureCount;
-    private int[] _featureIndex;
+    private final int _lookupOrder;
+    private final int _reqFeatureIndex;
+    private final int _featureCount;
+    private final int[] _featureIndex;
 
     /** Creates new LangSys */
-    protected LangSys(DataInput di) throws IOException {
+    protected LangSys(final DataInput di) throws IOException {
         _lookupOrder = di.readUnsignedShort();
         _reqFeatureIndex = di.readUnsignedShort();
         _featureCount = di.readUnsignedShort();
@@ -88,11 +88,11 @@ public class LangSys {
         return _featureCount;
     }
 
-    public int getFeatureIndex(int i) {
+    public int getFeatureIndex(final int i) {
         return _featureIndex[i];
     }
 
-    protected boolean isFeatureIndexed(int n) {
+    protected boolean isFeatureIndexed(final int n) {
         for (int i = 0; i < _featureCount; i++) {
             if (_featureIndex[i] == n) {
                 return true;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java
index f3befe3..08ea719 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LangSysRecord.java
@@ -60,11 +60,11 @@ import java.io.IOException;
  */
 public class LangSysRecord {
 
-    private int _tag;
-    private int _offset;
+    private final int _tag;
+    private final int _offset;
 
     /** Creates new LangSysRecord */
-    public LangSysRecord(DataInput di) throws IOException {
+    public LangSysRecord(final DataInput di) throws IOException {
         _tag = di.readInt();
         _offset = di.readUnsignedShort();
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java
index de862a9..dfd19e7 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Ligature.java
@@ -60,12 +60,12 @@ import java.io.IOException;
  */
 public class Ligature {
 
-    private int _ligGlyph;
-    private int _compCount;
-    private int[] _components;
+    private final int _ligGlyph;
+    private final int _compCount;
+    private final int[] _components;
 
     /** Creates new Ligature */
-    public Ligature(DataInput di) throws IOException {
+    public Ligature(final DataInput di) throws IOException {
         _ligGlyph = di.readUnsignedShort();
         _compCount = di.readUnsignedShort();
         _components = new int[_compCount - 1];
@@ -78,7 +78,7 @@ public class Ligature {
         return _compCount;
     }
 
-    public int getGlyphId(int i) {
+    public int getGlyphId(final int i) {
         return (i == 0) ? _ligGlyph : _components[i-1];
     }
 
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSet.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSet.java
index e261f3a..8b77389 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSet.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSet.java
@@ -60,12 +60,12 @@ import java.io.IOException;
  */
 public class LigatureSet {
 
-    private int _ligatureCount;
-    private int[] _ligatureOffsets;
-    private Ligature[] _ligatures;
+    private final int _ligatureCount;
+    private final int[] _ligatureOffsets;
+    private final Ligature[] _ligatures;
 
     /** Creates new LigatureSet */
-    public LigatureSet(DataInputStream dis, int offset) throws IOException {
+    public LigatureSet(final DataInputStream dis, final int offset) throws IOException {
         dis.reset();
         dis.skipBytes(offset);
         _ligatureCount = dis.readUnsignedShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubst.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubst.java
index c0570cd..36a44a1 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubst.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubst.java
@@ -60,10 +60,10 @@ import java.io.IOException;
  */
 public abstract class LigatureSubst extends LookupSubtable {
 
-    public static LigatureSubst read(DataInputStream dis, int offset) throws IOException {
+    public static LigatureSubst read(final DataInputStream dis, final int offset) throws IOException {
         dis.reset();
         dis.skipBytes(offset);
-        int format = dis.readUnsignedShort();
+        final int format = dis.readUnsignedShort();
         if (format == 1) {
             return new LigatureSubstFormat1(dis, offset);
         }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
index 1979ea5..02d4479 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LigatureSubstFormat1.java
@@ -60,16 +60,16 @@ import java.io.IOException;
  */
 public class LigatureSubstFormat1 extends LigatureSubst {
 
-    private int _coverageOffset;
-    private int _ligSetCount;
-    private int[] _ligatureSetOffsets;
-    private Coverage _coverage;
-    private LigatureSet[] _ligatureSets;
+    private final int _coverageOffset;
+    private final int _ligSetCount;
+    private final int[] _ligatureSetOffsets;
+    private final Coverage _coverage;
+    private final LigatureSet[] _ligatureSets;
 
     /** Creates new LigatureSubstFormat1 */
     protected LigatureSubstFormat1(
-            DataInputStream dis,
-            int offset) throws IOException {
+            final DataInputStream dis,
+            final int offset) throws IOException {
         _coverageOffset = dis.readUnsignedShort();
         _ligSetCount = dis.readUnsignedShort();
         _ligatureSetOffsets = new int[_ligSetCount];
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
index 2c7079f..a955ad3 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LocaTable.java
@@ -17,18 +17,18 @@ import java.io.IOException;
  */
 public class LocaTable implements Table {
 
-    private DirectoryEntry _de;
+    private final DirectoryEntry _de;
     private int[] _offsets = null;
     private short _factor = 0;
 
     protected LocaTable(
-            DirectoryEntry de,
-            DataInput di,
-            HeadTable head,
-            MaxpTable maxp) throws IOException {
+            final DirectoryEntry de,
+            final DataInput di,
+            final HeadTable head,
+            final MaxpTable maxp) throws IOException {
         _de = (DirectoryEntry) de.clone();
         _offsets = new int[maxp.getNumGlyphs() + 1];
-        boolean shortEntries = head.getIndexToLocFormat() == 0;
+        final boolean shortEntries = head.getIndexToLocFormat() == 0;
         if (shortEntries) {
             _factor = 2;
             for (int i = 0; i <= maxp.getNumGlyphs(); i++) {
@@ -42,7 +42,7 @@ public class LocaTable implements Table {
         }
     }
 
-    public int getOffset(int i) {
+    public int getOffset(final int i) {
         if (_offsets == null) {
             return 0;
         }
@@ -56,7 +56,7 @@ public class LocaTable implements Table {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("'loca' Table - Index To Location Table\n--------------------------------------\n")
             .append("Size = ").append(_de.getLength()).append(" bytes, ")
             .append(_offsets.length).append(" entries\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java
index 6496c37..b80ebbe 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Lookup.java
@@ -66,14 +66,14 @@ public class Lookup {
     public static final int IGNORE_BASE_MARKS = 0x0008;
     public static final int MARK_ATTACHMENT_TYPE = 0xFF00;
 
-    private int _type;
-    private int _flag;
-    private int _subTableCount;
-    private int[] _subTableOffsets;
-    private LookupSubtable[] _subTables;
+    private final int _type;
+    private final int _flag;
+    private final int _subTableCount;
+    private final int[] _subTableOffsets;
+    private final LookupSubtable[] _subTables;
 
     /** Creates new Lookup */
-    public Lookup(LookupSubtableFactory factory, DataInputStream dis, int offset)
+    public Lookup(final LookupSubtableFactory factory, final DataInputStream dis, final int offset)
     throws IOException {
 
         // Ensure we're in the right place
@@ -102,7 +102,7 @@ public class Lookup {
         return _subTableCount;
     }
 
-    public LookupSubtable getSubtable(int i) {
+    public LookupSubtable getSubtable(final int i) {
         return _subTables[i];
     }
 
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java
index e70a932..6d8ca2a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LookupList.java
@@ -60,12 +60,12 @@ import java.io.IOException;
  */
 public class LookupList {
 
-    private int _lookupCount;
-    private int[] _lookupOffsets;
-    private Lookup[] _lookups;
+    private final int _lookupCount;
+    private final int[] _lookupOffsets;
+    private final Lookup[] _lookups;
 
     /** Creates new LookupList */
-    public LookupList(DataInputStream dis, int offset, LookupSubtableFactory factory)
+    public LookupList(final DataInputStream dis, final int offset, final LookupSubtableFactory factory)
     throws IOException {
 
         // Ensure we're in the right place
@@ -88,17 +88,17 @@ public class LookupList {
         return _lookupCount;
     }
 
-    public int getLookupOffset(int i) {
+    public int getLookupOffset(final int i) {
         return _lookupOffsets[i];
     }
 
-    public Lookup getLookup(int i) {
+    public Lookup getLookup(final int i) {
         return _lookups[i];
     }
 
-    public Lookup getLookup(Feature feature, int index) {
+    public Lookup getLookup(final Feature feature, final int index) {
         if (feature.getLookupCount() > index) {
-            int i = feature.getLookupListIndex(index);
+            final int i = feature.getLookupListIndex(index);
             return _lookups[i];
         }
         return null;
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
index 47874cc..efafe7b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/LtshTable.java
@@ -18,13 +18,13 @@ import java.io.IOException;
  */
 public class LtshTable implements Table {
 
-    private DirectoryEntry de;
-    private int version;
-    private int numGlyphs;
-    private int[] yPels;
+    private final DirectoryEntry de;
+    private final int version;
+    private final int numGlyphs;
+    private final int[] yPels;
 
     /** Creates new LtshTable */
-    protected LtshTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected LtshTable(final DirectoryEntry de, final DataInput di) throws IOException {
         this.de = (DirectoryEntry) de.clone();
         version = di.readUnsignedShort();
         numGlyphs = di.readUnsignedShort();
@@ -45,7 +45,7 @@ public class LtshTable implements Table {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("'LTSH' Table - Linear Threshold Table\n-------------------------------------")
             .append("\n 'LTSH' Version:       ").append(version)
             .append("\n Number of Glyphs:     ").append(numGlyphs)
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
index abb6047..0e9a617 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/MaxpTable.java
@@ -19,8 +19,8 @@ import jogamp.graph.font.typecast.ot.Fixed;
  */
 public class MaxpTable implements Table {
 
-    private DirectoryEntry de;
-    private int versionNumber;
+    private final DirectoryEntry de;
+    private final int versionNumber;
     private int numGlyphs;
     private int maxPoints;
     private int maxContours;
@@ -36,7 +36,7 @@ public class MaxpTable implements Table {
     private int maxComponentElements;
     private int maxComponentDepth;
 
-    protected MaxpTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected MaxpTable(final DirectoryEntry de, final DataInput di) throws IOException {
         this.de = (DirectoryEntry) de.clone();
         versionNumber = di.readInt();
 
@@ -128,7 +128,7 @@ public class MaxpTable implements Table {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("'maxp' Table - Maximum Profile\n------------------------------")
             .append("\n        'maxp' version:         ").append(Fixed.floatValue(versionNumber))
             .append("\n        numGlyphs:              ").append(numGlyphs);
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
index a1787e3..5ac9ada 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameRecord.java
@@ -59,15 +59,15 @@ import java.io.IOException;
  */
 public class NameRecord {
 
-    private short _platformId;
-    private short _encodingId;
-    private short _languageId;
-    private short _nameId;
-    private short _stringLength;
-    private short _stringOffset;
+    private final short _platformId;
+    private final short _encodingId;
+    private final short _languageId;
+    private final short _nameId;
+    private final short _stringLength;
+    private final short _stringOffset;
     private String _record;
 
-    protected NameRecord(DataInput di) throws IOException {
+    protected NameRecord(final DataInput di) throws IOException {
         _platformId = di.readShort();
         _encodingId = di.readShort();
         _languageId = di.readShort();
@@ -92,13 +92,13 @@ public class NameRecord {
         return _platformId;
     }
 
-    public StringBuilder getRecordString(StringBuilder sb) {
+    public StringBuilder getRecordString(final StringBuilder sb) {
         sb.append(_record);
         return sb;
     }
 
-    protected void loadString(DataInput di) throws IOException {
-        StringBuilder sb = new StringBuilder();
+    protected void loadString(final DataInput di) throws IOException {
+        final StringBuilder sb = new StringBuilder();
         di.skipBytes(_stringOffset);
         if (_platformId == ID.platformUnicode) {
 
@@ -132,7 +132,7 @@ public class NameRecord {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
 
         sb.append("             Platform ID:       ").append(_platformId)
             .append("\n             Specific ID:       ").append(_encodingId)
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
index ad8198b..ba9292a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/NameTable.java
@@ -63,13 +63,13 @@ import java.io.IOException;
  * @author <a href="mailto:davidsch at dev.java.net">David Schweinsberg</a>
  */
 public class NameTable implements Table {
-    private DirectoryEntry _de;
-    private short _formatSelector;
-    private short _numberOfNameRecords;
-    private short _stringStorageOffset;
-    private NameRecord[] _records;
+    private final DirectoryEntry _de;
+    private final short _formatSelector;
+    private final short _numberOfNameRecords;
+    private final short _stringStorageOffset;
+    private final NameRecord[] _records;
 
-    protected NameTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected NameTable(final DirectoryEntry de, final DataInput di) throws IOException {
         _de = (DirectoryEntry) de.clone();
         _formatSelector = di.readShort();
         _numberOfNameRecords = di.readShort();
@@ -84,7 +84,7 @@ public class NameTable implements Table {
 
         // Load the string data into a buffer so the records can copy out the
         // bits they are interested in
-        byte[] buffer = new byte[_de.getLength() - _stringStorageOffset];
+        final byte[] buffer = new byte[_de.getLength() - _stringStorageOffset];
         di.readFully(buffer);
 
         // Now let the records get their hands on them
@@ -99,14 +99,14 @@ public class NameTable implements Table {
     }
 
 
-    public NameRecord getRecord(int i) {
+    public NameRecord getRecord(final int i) {
         if(_numberOfNameRecords > i) {
             return _records[i];
         }
         return null;
     }
 
-    public StringBuilder getRecordsRecordString(StringBuilder sb, int i) {
+    public StringBuilder getRecordsRecordString(final StringBuilder sb, final int i) {
         if(_numberOfNameRecords > i) {
             _records[i].getRecordString(sb);
         } else {
@@ -115,7 +115,7 @@ public class NameTable implements Table {
         return sb;
     }
 
-    public StringBuilder getNamedRecordString(StringBuilder sb, short nameId) {
+    public StringBuilder getNamedRecordString(final StringBuilder sb, final short nameId) {
         // Search for the first instance of this name ID
         boolean done = false;
         for (int i = 0; !done && i < _numberOfNameRecords; i++) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
index 5340b29..c911273 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Os2Table.java
@@ -59,46 +59,46 @@ import java.io.IOException;
  */
 public class Os2Table implements Table {
 
-    private DirectoryEntry _de;
-    private int _version;
-    private short _xAvgCharWidth;
-    private int _usWeightClass;
-    private int _usWidthClass;
-    private short _fsType;
-    private short _ySubscriptXSize;
-    private short _ySubscriptYSize;
-    private short _ySubscriptXOffset;
-    private short _ySubscriptYOffset;
-    private short _ySuperscriptXSize;
-    private short _ySuperscriptYSize;
-    private short _ySuperscriptXOffset;
-    private short _ySuperscriptYOffset;
-    private short _yStrikeoutSize;
-    private short _yStrikeoutPosition;
-    private short _sFamilyClass;
-    private Panose _panose;
-    private int _ulUnicodeRange1;
-    private int _ulUnicodeRange2;
-    private int _ulUnicodeRange3;
-    private int _ulUnicodeRange4;
-    private int _achVendorID;
-    private short _fsSelection;
-    private int _usFirstCharIndex;
-    private int _usLastCharIndex;
-    private short _sTypoAscender;
-    private short _sTypoDescender;
-    private short _sTypoLineGap;
-    private int _usWinAscent;
-    private int _usWinDescent;
-    private int _ulCodePageRange1;
-    private int _ulCodePageRange2;
+    private final DirectoryEntry _de;
+    private final int _version;
+    private final short _xAvgCharWidth;
+    private final int _usWeightClass;
+    private final int _usWidthClass;
+    private final short _fsType;
+    private final short _ySubscriptXSize;
+    private final short _ySubscriptYSize;
+    private final short _ySubscriptXOffset;
+    private final short _ySubscriptYOffset;
+    private final short _ySuperscriptXSize;
+    private final short _ySuperscriptYSize;
+    private final short _ySuperscriptXOffset;
+    private final short _ySuperscriptYOffset;
+    private final short _yStrikeoutSize;
+    private final short _yStrikeoutPosition;
+    private final short _sFamilyClass;
+    private final Panose _panose;
+    private final int _ulUnicodeRange1;
+    private final int _ulUnicodeRange2;
+    private final int _ulUnicodeRange3;
+    private final int _ulUnicodeRange4;
+    private final int _achVendorID;
+    private final short _fsSelection;
+    private final int _usFirstCharIndex;
+    private final int _usLastCharIndex;
+    private final short _sTypoAscender;
+    private final short _sTypoDescender;
+    private final short _sTypoLineGap;
+    private final int _usWinAscent;
+    private final int _usWinDescent;
+    private final int _ulCodePageRange1;
+    private final int _ulCodePageRange2;
     private short _sxHeight;
     private short _sCapHeight;
     private int _usDefaultChar;
     private int _usBreakChar;
     private int _usMaxContext;
 
-    protected Os2Table(DirectoryEntry de, DataInput di) throws IOException {
+    protected Os2Table(final DirectoryEntry de, final DataInput di) throws IOException {
         this._de = (DirectoryEntry) de.clone();
         _version = di.readUnsignedShort();
         _xAvgCharWidth = di.readShort();
@@ -116,7 +116,7 @@ public class Os2Table implements Table {
         _yStrikeoutSize = di.readShort();
         _yStrikeoutPosition = di.readShort();
         _sFamilyClass = di.readShort();
-        byte[] buf = new byte[10];
+        final byte[] buf = new byte[10];
         di.readFully(buf);
         _panose = new Panose(buf);
         _ulUnicodeRange1 = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
index 7713181..493f43b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Panose.java
@@ -26,7 +26,7 @@ public class Panose {
   byte bXHeight = 0;
 
   /** Creates new Panose */
-  public Panose(byte[] panose) {
+  public Panose(final byte[] panose) {
     bFamilyType = panose[0];
     bSerifStyle = panose[1];
     bWeight = panose[2];
@@ -81,7 +81,7 @@ public class Panose {
 
   @Override
   public String toString() {
-    StringBuilder sb = new StringBuilder();
+    final StringBuilder sb = new StringBuilder();
     sb.append(String.valueOf(bFamilyType)).append(" ")
       .append(String.valueOf(bSerifStyle)).append(" ")
       .append(String.valueOf(bWeight)).append(" ")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
index a1f603d..63399cf 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PcltTable.java
@@ -18,25 +18,25 @@ import java.io.IOException;
  */
 public class PcltTable implements Table {
 
-    private DirectoryEntry de;
-    private int version;
-    private long fontNumber;
-    private int pitch;
-    private int xHeight;
-    private int style;
-    private int typeFamily;
-    private int capHeight;
-    private int symbolSet;
-    private char[] typeface = new char[16];
-    private short[] characterComplement = new short[8];
-    private char[] fileName = new char[6];
-    private short strokeWeight;
-    private short widthType;
-    private byte serifStyle;
-    private byte reserved;
+    private final DirectoryEntry de;
+    private final int version;
+    private final long fontNumber;
+    private final int pitch;
+    private final int xHeight;
+    private final int style;
+    private final int typeFamily;
+    private final int capHeight;
+    private final int symbolSet;
+    private final char[] typeface = new char[16];
+    private final short[] characterComplement = new short[8];
+    private final char[] fileName = new char[6];
+    private final short strokeWeight;
+    private final short widthType;
+    private final byte serifStyle;
+    private final byte reserved;
 
     /** Creates new PcltTable */
-    protected PcltTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected PcltTable(final DirectoryEntry de, final DataInput di) throws IOException {
         this.de = (DirectoryEntry) de.clone();
         version = di.readInt();
         fontNumber = di.readInt();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
index 188b441..f4dd314 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PostTable.java
@@ -284,16 +284,16 @@ public class PostTable implements Table {
         ""              // 257
     };
 
-    private DirectoryEntry de;
-    private int version;
-    private int italicAngle;
-    private short underlinePosition;
-    private short underlineThickness;
-    private int isFixedPitch;
-    private int minMemType42;
-    private int maxMemType42;
-    private int minMemType1;
-    private int maxMemType1;
+    private final DirectoryEntry de;
+    private final int version;
+    private final int italicAngle;
+    private final short underlinePosition;
+    private final short underlineThickness;
+    private final int isFixedPitch;
+    private final int minMemType42;
+    private final int maxMemType42;
+    private final int minMemType1;
+    private final int maxMemType1;
 
     // v2
     private int numGlyphs;
@@ -301,7 +301,7 @@ public class PostTable implements Table {
     private String[] psGlyphName;
 
     /** Creates new PostTable */
-    protected PostTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected PostTable(final DirectoryEntry de, final DataInput di) throws IOException {
         this.de = (DirectoryEntry) de.clone();
         version = di.readInt();
         italicAngle = di.readInt();
@@ -324,14 +324,14 @@ public class PostTable implements Table {
                 h -= 257;
                 psGlyphName = new String[h];
                 for (int i = 0; i < h; i++) {
-                    int len = di.readUnsignedByte();
-                    byte[] buf = new byte[len];
+                    final int len = di.readUnsignedByte();
+                    final byte[] buf = new byte[len];
                     di.readFully(buf);
                     psGlyphName[i] = new String(buf);
                 }
             }
-        } else if (version == 0x00025000) {
-        } else if (version == 0x00030000) {
+        // } else if (version == 0x00025000) {
+        // } else if (version == 0x00030000) {
         }
     }
 
@@ -349,7 +349,7 @@ public class PostTable implements Table {
         return high;
     }
 
-    public String getGlyphName(int i) {
+    public String getGlyphName(final int i) {
         if (version == 0x00020000) {
             return (glyphNameIndex[i] > 257)
                 ? psGlyphName[glyphNameIndex[i] - 258]
@@ -359,7 +359,7 @@ public class PostTable implements Table {
         }
     }
 
-    private boolean isMacGlyphName(int i) {
+    private boolean isMacGlyphName(final int i) {
         if (version == 0x00020000) {
             return glyphNameIndex[i] <= 257;
         } else {
@@ -377,7 +377,7 @@ public class PostTable implements Table {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("'post' Table - PostScript Metrics\n---------------------------------\n")
             .append("\n        'post' version:        ").append(Fixed.floatValue(version))
             .append("\n        italicAngle:           ").append(Fixed.floatValue(italicAngle))
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
index 4c64673..039789d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/PrepTable.java
@@ -19,9 +19,9 @@ import jogamp.graph.font.typecast.ot.Disassembler;
  */
 public class PrepTable extends Program implements Table {
 
-    private DirectoryEntry de;
+    private final DirectoryEntry de;
 
-    public PrepTable(DirectoryEntry de, DataInput di) throws IOException {
+    public PrepTable(final DirectoryEntry de, final DataInput di) throws IOException {
         this.de = (DirectoryEntry) de.clone();
         readInstructions(di, de.getLength());
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java
index e3beabe..c0d2c1b 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Program.java
@@ -23,7 +23,7 @@ public abstract class Program {
         return instructions;
     }
 
-    protected void readInstructions(DataInput di, int count) throws IOException {
+    protected void readInstructions(final DataInput di, final int count) throws IOException {
         instructions = new short[count];
         for (int i = 0; i < count; i++) {
             instructions[i] = (short) di.readUnsignedByte();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java
index 40ddf42..4177797 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/RangeRecord.java
@@ -61,22 +61,22 @@ import java.io.IOException;
  */
 public class RangeRecord {
 
-    private int _start;
-    private int _end;
-    private int _startCoverageIndex;
+    private final int _start;
+    private final int _end;
+    private final int _startCoverageIndex;
 
     /** Creates new RangeRecord */
-    public RangeRecord(DataInput di) throws IOException {
+    public RangeRecord(final DataInput di) throws IOException {
         _start = di.readUnsignedShort();
         _end = di.readUnsignedShort();
         _startCoverageIndex = di.readUnsignedShort();
     }
 
-    public boolean isInRange(int glyphId) {
+    public boolean isInRange(final int glyphId) {
         return (_start <= glyphId && glyphId <= _end);
     }
 
-    public int getCoverageIndex(int glyphId) {
+    public int getCoverageIndex(final int glyphId) {
         if (isInRange(glyphId)) {
             return _startCoverageIndex + glyphId - _start;
         }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java
index 04781a8..8846de5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/Script.java
@@ -60,14 +60,14 @@ import java.io.IOException;
  */
 public class Script {
 
-    private int _defaultLangSysOffset;
-    private int _langSysCount;
+    private final int _defaultLangSysOffset;
+    private final int _langSysCount;
     private LangSysRecord[] _langSysRecords;
     private LangSys _defaultLangSys;
     private LangSys[] _langSys;
 
     /** Creates new ScriptTable */
-    protected Script(DataInputStream dis, int offset) throws IOException {
+    protected Script(final DataInputStream dis, final int offset) throws IOException {
 
         // Ensure we're in the right place
         dis.reset();
@@ -103,7 +103,7 @@ public class Script {
         return _langSysCount;
     }
 
-    public LangSysRecord getLangSysRecord(int i) {
+    public LangSysRecord getLangSysRecord(final int i) {
         return _langSysRecords[i];
     }
 
@@ -111,7 +111,7 @@ public class Script {
         return _defaultLangSys;
     }
 
-    public LangSys getLangSys(int i) {
+    public LangSys getLangSys(final int i) {
         return _langSys[i];
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java
index 18589b7..1c1be0d 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptList.java
@@ -61,11 +61,11 @@ import java.io.IOException;
 public class ScriptList {
 
     private int _scriptCount = 0;
-    private ScriptRecord[] _scriptRecords;
-    private Script[] _scripts;
+    private final ScriptRecord[] _scriptRecords;
+    private final Script[] _scripts;
 
     /** Creates new ScriptList */
-    protected ScriptList(DataInputStream dis, int offset) throws IOException {
+    protected ScriptList(final DataInputStream dis, final int offset) throws IOException {
 
         // Ensure we're in the right place
         dis.reset();
@@ -87,19 +87,19 @@ public class ScriptList {
         return _scriptCount;
     }
 
-    public ScriptRecord getScriptRecord(int i) {
+    public ScriptRecord getScriptRecord(final int i) {
         return _scriptRecords[i];
     }
 
-    public Script getScript(int i) {
+    public Script getScript(final int i) {
         return _scripts[i];
     }
 
-    public Script findScript(String tag) {
+    public Script findScript(final String tag) {
         if (tag.length() != 4) {
             return null;
         }
-        int tagVal = ((tag.charAt(0)<<24)
+        final int tagVal = ((tag.charAt(0)<<24)
             | (tag.charAt(1)<<16)
             | (tag.charAt(2)<<8)
             | tag.charAt(3));
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java
index 183ca2f..18eefe5 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/ScriptRecord.java
@@ -60,11 +60,11 @@ import java.io.IOException;
  */
 public class ScriptRecord {
 
-    private int _tag;
-    private int _offset;
+    private final int _tag;
+    private final int _offset;
 
     /** Creates new ScriptRecord */
-    protected ScriptRecord(DataInput di) throws IOException {
+    protected ScriptRecord(final DataInput di) throws IOException {
         _tag = di.readInt();
         _offset = di.readUnsignedShort();
     }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
index 31a2d17..e6841b9 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SignatureBlock.java
@@ -18,13 +18,13 @@ import java.io.DataInput;
  */
 public class SignatureBlock {
 
-    private int reserved1;
-    private int reserved2;
-    private int signatureLen;
-    private byte[] signature;
+    private final int reserved1;
+    private final int reserved2;
+    private final int signatureLen;
+    private final byte[] signature;
 
     /** Creates new SignatureBlock */
-    protected SignatureBlock(DataInput di) throws IOException {
+    protected SignatureBlock(final DataInput di) throws IOException {
         reserved1 = di.readUnsignedShort();
         reserved2 = di.readUnsignedShort();
         signatureLen = di.readInt();
@@ -34,7 +34,7 @@ public class SignatureBlock {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         for (int i = 0; i < signatureLen; i += 16) {
             if (signatureLen - i >= 16) {
                 sb.append(new String(signature, i, 16)).append("\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java
index e31281f..c398b4f 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubst.java
@@ -64,11 +64,11 @@ public abstract class SingleSubst extends LookupSubtable {
 
     public abstract int substitute(int glyphId);
 
-    public static SingleSubst read(DataInputStream dis, int offset) throws IOException {
+    public static SingleSubst read(final DataInputStream dis, final int offset) throws IOException {
         SingleSubst s = null;
         dis.reset();
         dis.skipBytes(offset);
-        int format = dis.readUnsignedShort();
+        final int format = dis.readUnsignedShort();
         if (format == 1) {
             s = new SingleSubstFormat1(dis, offset);
         } else if (format == 2) {
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
index e97e62a..b2e65dd 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat1.java
@@ -60,12 +60,12 @@ import java.io.IOException;
  */
 public class SingleSubstFormat1 extends SingleSubst {
 
-    private int _coverageOffset;
-    private short _deltaGlyphID;
-    private Coverage _coverage;
+    private final int _coverageOffset;
+    private final short _deltaGlyphID;
+    private final Coverage _coverage;
 
     /** Creates new SingleSubstFormat1 */
-    protected SingleSubstFormat1(DataInputStream dis, int offset) throws IOException {
+    protected SingleSubstFormat1(final DataInputStream dis, final int offset) throws IOException {
         _coverageOffset = dis.readUnsignedShort();
         _deltaGlyphID = dis.readShort();
         dis.reset();
@@ -79,8 +79,8 @@ public class SingleSubstFormat1 extends SingleSubst {
     }
 
     @Override
-    public int substitute(int glyphId) {
-        int i = _coverage.findGlyph(glyphId);
+    public int substitute(final int glyphId) {
+        final int i = _coverage.findGlyph(glyphId);
         if (i > -1) {
             return glyphId + _deltaGlyphID;
         }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
index 4d46b07..449c14c 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/SingleSubstFormat2.java
@@ -60,13 +60,13 @@ import java.io.IOException;
  */
 public class SingleSubstFormat2 extends SingleSubst {
 
-    private int _coverageOffset;
-    private int _glyphCount;
-    private int[] _substitutes;
-    private Coverage _coverage;
+    private final int _coverageOffset;
+    private final int _glyphCount;
+    private final int[] _substitutes;
+    private final Coverage _coverage;
 
     /** Creates new SingleSubstFormat2 */
-    protected SingleSubstFormat2(DataInputStream dis, int offset) throws IOException {
+    protected SingleSubstFormat2(final DataInputStream dis, final int offset) throws IOException {
         _coverageOffset = dis.readUnsignedShort();
         _glyphCount = dis.readUnsignedShort();
         _substitutes = new int[_glyphCount];
@@ -84,8 +84,8 @@ public class SingleSubstFormat2 extends SingleSubst {
     }
 
     @Override
-    public int substitute(int glyphId) {
-        int i = _coverage.findGlyph(glyphId);
+    public int substitute(final int glyphId) {
+        final int i = _coverage.findGlyph(glyphId);
         if (i > -1) {
             return _substitutes[i];
         }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java
index f7c7d99..a6ec618 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TTCHeader.java
@@ -20,16 +20,16 @@ public class TTCHeader {
 
     public static final int ttcf = 0x74746366;
 
-    private int ttcTag;
-    private int version;
-    private int directoryCount;
-    private int[] tableDirectory;
+    private final int ttcTag;
+    private final int version;
+    private final int directoryCount;
+    private final int[] tableDirectory;
     private int dsigTag;
-    private int dsigLength;
-    private int dsigOffset;
+    private final int dsigLength;
+    private final int dsigOffset;
 
     /** Creates new TTCHeader */
-    public TTCHeader(DataInput di) throws IOException {
+    public TTCHeader(final DataInput di) throws IOException {
         ttcTag = di.readInt();
         version = di.readInt();
         directoryCount = di.readInt();
@@ -48,12 +48,12 @@ public class TTCHeader {
         return directoryCount;
     }
 
-    public int getTableDirectory(int i) {
+    public int getTableDirectory(final int i) {
         return tableDirectory[i];
     }
 
-    public static boolean isTTC(DataInput di) throws IOException {
-        int ttcTag = di.readInt();
+    public static boolean isTTC(final DataInput di) throws IOException {
+        final int ttcTag = di.readInt();
         return ttcTag == ttcf;
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
index 23ecba8..b9448cc 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableDirectory.java
@@ -66,9 +66,9 @@ public class TableDirectory {
     private short _searchRange = 0;
     private short _entrySelector = 0;
     private short _rangeShift = 0;
-    private DirectoryEntry[] _entries;
+    private final DirectoryEntry[] _entries;
 
-    public TableDirectory(DataInput di) throws IOException {
+    public TableDirectory(final DataInput di) throws IOException {
         _version = di.readInt();
         _numTables = di.readShort();
         _searchRange = di.readShort();
@@ -80,11 +80,11 @@ public class TableDirectory {
         }
     }
 
-    public DirectoryEntry getEntry(int index) {
+    public DirectoryEntry getEntry(final int index) {
         return _entries[index];
     }
 
-    public DirectoryEntry getEntryByTag(int tag) {
+    public DirectoryEntry getEntryByTag(final int tag) {
         for (int i = 0; i < _numTables; i++) {
             if (_entries[i].getTag() == tag) {
                 return _entries[i];
@@ -115,7 +115,7 @@ public class TableDirectory {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder()
+        final StringBuilder sb = new StringBuilder()
             .append("Offset Table\n------ -----")
             .append("\n  sfnt version:     ").append(Fixed.floatValue(_version))
             .append("\n  numTables =       ").append(_numTables)
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java
index 65aa84b..e0433f0 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableException.java
@@ -40,7 +40,7 @@ public class TableException extends java.lang.Exception {
      * Constructs an instance of <code>TableException</code> with the specified detail message.
      * @param msg the detail message.
      */
-    public TableException(String msg) {
+    public TableException(final String msg) {
         super(msg);
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java
index 956d1ae..d24f3b3 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/TableFactory.java
@@ -64,10 +64,10 @@ import jogamp.graph.font.typecast.ot.OTFontCollection;
 public class TableFactory {
 
     public static Table create(
-            OTFontCollection fc,
-            OTFont font,
-            DirectoryEntry de,
-            DataInputStream dis) throws IOException {
+            final OTFontCollection fc,
+            final OTFont font,
+            final DirectoryEntry de,
+            final DataInputStream dis) throws IOException {
         Table t = null;
 
         // First, if we have a font collection, look for the table there
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
index bebd7f9..679502e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VdmxTable.java
@@ -30,14 +30,14 @@ import java.io.IOException;
  */
 public class VdmxTable implements Table {
 
-    private class Ratio {
+    static class Ratio {
 
-        private byte _bCharSet;
-        private byte _xRatio;
-        private byte _yStartRatio;
-        private byte _yEndRatio;
+        private final byte _bCharSet;
+        private final byte _xRatio;
+        private final byte _yStartRatio;
+        private final byte _yEndRatio;
 
-        protected Ratio(DataInput di) throws IOException {
+        protected Ratio(final DataInput di) throws IOException {
             _bCharSet = di.readByte();
             _xRatio = di.readByte();
             _yStartRatio = di.readByte();
@@ -61,13 +61,13 @@ public class VdmxTable implements Table {
         }
     }
 
-    private class VTableRecord {
+    static class VTableRecord {
 
-        private int _yPelHeight;
-        private short _yMax;
-        private short _yMin;
+        private final int _yPelHeight;
+        private final short _yMax;
+        private final short _yMin;
 
-        protected VTableRecord(DataInput di) throws IOException {
+        protected VTableRecord(final DataInput di) throws IOException {
             _yPelHeight = di.readUnsignedShort();
             _yMax = di.readShort();
             _yMin = di.readShort();
@@ -86,14 +86,14 @@ public class VdmxTable implements Table {
         }
     }
 
-    private class Group {
+    static class Group {
 
-        private int _recs;
-        private int _startsz;
-        private int _endsz;
-        private VTableRecord[] _entry;
+        private final int _recs;
+        private final int _startsz;
+        private final int _endsz;
+        private final VTableRecord[] _entry;
 
-        protected Group(DataInput di) throws IOException {
+        protected Group(final DataInput di) throws IOException {
             _recs = di.readUnsignedShort();
             _startsz = di.readUnsignedByte();
             _endsz = di.readUnsignedByte();
@@ -120,16 +120,16 @@ public class VdmxTable implements Table {
         }
     }
 
-    private DirectoryEntry _de;
-    private int _version;
-    private int _numRecs;
-    private int _numRatios;
-    private Ratio[] _ratRange;
-    private int _offset[];
-    private Group[] _groups;
+    private final DirectoryEntry _de;
+    private final int _version;
+    private final int _numRecs;
+    private final int _numRatios;
+    private final Ratio[] _ratRange;
+    private final int _offset[];
+    private final Group[] _groups;
 
     /** Creates a new instance of VdmxTable */
-    protected VdmxTable(DirectoryEntry de, DataInput di) throws IOException {
+    protected VdmxTable(final DirectoryEntry de, final DataInput di) throws IOException {
         _de = (DirectoryEntry) de.clone();
         _version = di.readUnsignedShort();
         _numRecs = di.readUnsignedShort();
@@ -155,7 +155,7 @@ public class VdmxTable implements Table {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("'VDMX' Table - Precomputed Vertical Device Metrics\n")
             .append("--------------------------------------------------\n")
             .append("  Version:                 ").append(_version).append("\n")
@@ -172,7 +172,7 @@ public class VdmxTable implements Table {
         sb.append("\n   VDMX Height Record Groups\n")
             .append("   -------------------------\n");
         for (int i = 0; i < _numRecs; ++i) {
-            Group group = _groups[i];
+            final Group group = _groups[i];
             sb.append("   ").append(i + 1)
                 .append(".   Number of Hgt Records  ").append(group.getRecs()).append("\n")
                 .append("        Starting Y Pel Height  ").append(group.getStartSZ()).append("\n")
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
index 521b87c..cef7b52 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VheaTable.java
@@ -32,21 +32,21 @@ import jogamp.graph.font.typecast.ot.Fixed;
  */
 public class VheaTable implements Table {
 
-    private DirectoryEntry _de;
-    private int _version;
-    private short _ascent;
-    private short _descent;
-    private short _lineGap;
-    private short _advanceHeightMax;
-    private short _minTopSideBearing;
-    private short _minBottomSideBearing;
-    private short _yMaxExtent;
-    private short _caretSlopeRise;
-    private short _caretSlopeRun;
-    private short _metricDataFormat;
-    private int _numberOfLongVerMetrics;
-
-    protected VheaTable(DirectoryEntry de, DataInput di) throws IOException {
+    private final DirectoryEntry _de;
+    private final int _version;
+    private final short _ascent;
+    private final short _descent;
+    private final short _lineGap;
+    private final short _advanceHeightMax;
+    private final short _minTopSideBearing;
+    private final short _minBottomSideBearing;
+    private final short _yMaxExtent;
+    private final short _caretSlopeRise;
+    private final short _caretSlopeRun;
+    private final short _metricDataFormat;
+    private final int _numberOfLongVerMetrics;
+
+    protected VheaTable(final DirectoryEntry de, final DataInput di) throws IOException {
         _de = (DirectoryEntry) de.clone();
         _version = di.readInt();
         _ascent = di.readShort();
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java
index 1b77a6f..b76ed7e 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/ot/table/VmtxTable.java
@@ -30,15 +30,15 @@ import java.io.IOException;
  */
 public class VmtxTable implements Table {
 
-    private DirectoryEntry _de;
+    private final DirectoryEntry _de;
     private int[] _vMetrics = null;
     private short[] _topSideBearing = null;
 
     protected VmtxTable(
-            DirectoryEntry de,
-            DataInput di,
-            VheaTable vhea,
-            MaxpTable maxp) throws IOException {
+            final DirectoryEntry de,
+            final DataInput di,
+            final VheaTable vhea,
+            final MaxpTable maxp) throws IOException {
         _de = (DirectoryEntry) de.clone();
         _vMetrics = new int[vhea.getNumberOfLongVerMetrics()];
         for (int i = 0; i < vhea.getNumberOfLongVerMetrics(); ++i) {
@@ -48,14 +48,14 @@ public class VmtxTable implements Table {
                     | di.readUnsignedByte()<<8
                     | di.readUnsignedByte();
         }
-        int tsbCount = maxp.getNumGlyphs() - vhea.getNumberOfLongVerMetrics();
+        final int tsbCount = maxp.getNumGlyphs() - vhea.getNumberOfLongVerMetrics();
         _topSideBearing = new short[tsbCount];
         for (int i = 0; i < tsbCount; ++i) {
             _topSideBearing[i] = di.readShort();
         }
     }
 
-    public int getAdvanceHeight(int i) {
+    public int getAdvanceHeight(final int i) {
         if (_vMetrics == null) {
             return 0;
         }
@@ -66,7 +66,7 @@ public class VmtxTable implements Table {
         }
     }
 
-    public short getTopSideBearing(int i) {
+    public short getTopSideBearing(final int i) {
         if (_vMetrics == null) {
             return 0;
         }
@@ -84,7 +84,7 @@ public class VmtxTable implements Table {
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append("'vmtx' Table - Vertical Metrics\n-------------------------------\n");
         sb.append("Size = ").append(_de.getLength()).append(" bytes, ")
             .append(_vMetrics.length).append(" entries\n");
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java b/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
index 181ec7e..80d76a7 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/t2/T2Interpreter.java
@@ -39,11 +39,11 @@ public class T2Interpreter {
     private static final int SUBR_STACK_LIMIT = 10;
     private static final int TRANSIENT_ARRAY_ELEMENT_COUNT = 32;
 
-    private Number[] _argStack = new Number[ARGUMENT_STACK_LIMIT];
+    private final Number[] _argStack = new Number[ARGUMENT_STACK_LIMIT];
     private int _argStackIndex = 0;
-    private int[] _subrStack = new int[SUBR_STACK_LIMIT];
+    private final int[] _subrStack = new int[SUBR_STACK_LIMIT];
     private int _subrStackIndex = 0;
-    private Number[] _transientArray = new Number[TRANSIENT_ARRAY_ELEMENT_COUNT];
+    private final Number[] _transientArray = new Number[TRANSIENT_ARRAY_ELEMENT_COUNT];
 
     private ArrayList<Point> _points;
 
@@ -56,10 +56,10 @@ public class T2Interpreter {
      * (dx1, dy1).
      */
     private void _rmoveto() {
-        int dy1 = popArg().intValue();
-        int dx1 = popArg().intValue();
+        final int dy1 = popArg().intValue();
+        final int dx1 = popArg().intValue();
         clearArg();
-        Point lastPoint = getLastPoint();
+        final Point lastPoint = getLastPoint();
         moveTo(lastPoint.x + dx1, lastPoint.y + dy1);
     }
 
@@ -67,9 +67,9 @@ public class T2Interpreter {
      * Moves the current point dx1 units in the horizontal direction.
      */
     private void _hmoveto() {
-        int dx1 = popArg().intValue();
+        final int dx1 = popArg().intValue();
         clearArg();
-        Point lastPoint = getLastPoint();
+        final Point lastPoint = getLastPoint();
         moveTo(lastPoint.x + dx1, lastPoint.y);
     }
 
@@ -77,9 +77,9 @@ public class T2Interpreter {
      * Moves the current point dy1 units in the vertical direction.
      */
     private void _vmoveto() {
-        int dy1 = popArg().intValue();
+        final int dy1 = popArg().intValue();
         clearArg();
-        Point lastPoint = getLastPoint();
+        final Point lastPoint = getLastPoint();
         moveTo(lastPoint.x, lastPoint.y + dy1);
     }
 
@@ -90,15 +90,15 @@ public class T2Interpreter {
      * lines is determined from the number of arguments on the stack.
      */
     private void _rlineto() {
-        int count = getArgCount() / 2;
-        int[] dx = new int[count];
-        int[] dy = new int[count];
+        final int count = getArgCount() / 2;
+        final int[] dx = new int[count];
+        final int[] dy = new int[count];
         for (int i = 0; i < count; ++i) {
             dy[count - i - 1] = popArg().intValue();
             dx[count - i - 1] = popArg().intValue();
         }
         for (int i = 0; i < count; ++i) {
-            Point lastPoint = getLastPoint();
+            final Point lastPoint = getLastPoint();
             lineTo(lastPoint.x + dx[i], lastPoint.y + dy[i]);
         }
         clearArg();
@@ -115,13 +115,13 @@ public class T2Interpreter {
      * number of arguments on the stack.
      */
     private void _hlineto() {
-        int count = getArgCount();
-        Number[] nums = new Number[count];
+        final int count = getArgCount();
+        final Number[] nums = new Number[count];
         for (int i = 0; i < count; ++i) {
             nums[count - i - 1] = popArg();
         }
         for (int i = 0; i < count; ++i) {
-            Point lastPoint = getLastPoint();
+            final Point lastPoint = getLastPoint();
             if (i % 2 == 0) {
                 lineTo(lastPoint.x + nums[i].intValue(), lastPoint.y);
             } else {
@@ -142,13 +142,13 @@ public class T2Interpreter {
      * number of arguments on the stack.
      */
     private void _vlineto() {
-        int count = getArgCount();
-        Number[] nums = new Number[count];
+        final int count = getArgCount();
+        final Number[] nums = new Number[count];
         for (int i = 0; i < count; ++i) {
             nums[count - i - 1] = popArg();
         }
         for (int i = 0; i < count; ++i) {
-            Point lastPoint = getLastPoint();
+            final Point lastPoint = getLastPoint();
             if (i % 2 == 0) {
                 lineTo(lastPoint.x, lastPoint.y + nums[i].intValue());
             } else {
@@ -167,13 +167,13 @@ public class T2Interpreter {
      * stack.
      */
     private void _rrcurveto() {
-        int count = getArgCount() / 6;
-        int[] dxa = new int[count];
-        int[] dya = new int[count];
-        int[] dxb = new int[count];
-        int[] dyb = new int[count];
-        int[] dxc = new int[count];
-        int[] dyc = new int[count];
+        final int count = getArgCount() / 6;
+        final int[] dxa = new int[count];
+        final int[] dya = new int[count];
+        final int[] dxb = new int[count];
+        final int[] dyb = new int[count];
+        final int[] dxc = new int[count];
+        final int[] dyc = new int[count];
         for (int i = 0; i < count; ++i) {
             dyc[count - i - 1] = popArg().intValue();
             dxc[count - i - 1] = popArg().intValue();
@@ -183,13 +183,13 @@ public class T2Interpreter {
             dxa[count - i - 1] = popArg().intValue();
         }
         for (int i = 0; i < count; ++i) {
-            Point lastPoint = getLastPoint();
-            int xa = lastPoint.x + dxa[i];
-            int ya = lastPoint.y + dya[i];
-            int xb = xa + dxb[i];
-            int yb = ya + dyb[i];
-            int xc = xb + dxc[i];
-            int yc = yb + dyc[i];
+            final Point lastPoint = getLastPoint();
+            final int xa = lastPoint.x + dxa[i];
+            final int ya = lastPoint.y + dya[i];
+            final int xb = xa + dxb[i];
+            final int yb = ya + dyb[i];
+            final int xc = xb + dxc[i];
+            final int yc = yb + dyc[i];
             curveTo(xa, ya, xb, yb, xc, yc);
         }
         clearArg();
@@ -203,12 +203,12 @@ public class T2Interpreter {
      * case). Note the argument order for the odd argument case.
      */
     private void _hhcurveto() {
-        int count = getArgCount() / 4;
+        final int count = getArgCount() / 4;
         int dy1 = 0;
-        int[] dxa = new int[count];
-        int[] dxb = new int[count];
-        int[] dyb = new int[count];
-        int[] dxc = new int[count];
+        final int[] dxa = new int[count];
+        final int[] dxb = new int[count];
+        final int[] dyb = new int[count];
+        final int[] dxc = new int[count];
         for (int i = 0; i < count; ++i) {
             dxc[count - i - 1] = popArg().intValue();
             dyb[count - i - 1] = popArg().intValue();
@@ -219,13 +219,13 @@ public class T2Interpreter {
             dy1 = popArg().intValue();
         }
         for (int i = 0; i < count; ++i) {
-            Point lastPoint = getLastPoint();
-            int xa = lastPoint.x + dxa[i];
-            int ya = lastPoint.y + (i == 0 ? dy1 : 0);
-            int xb = xa + dxb[i];
-            int yb = ya + dyb[i];
-            int xc = xb + dxc[i];
-            int yc = yb;
+            final Point lastPoint = getLastPoint();
+            final int xa = lastPoint.x + dxa[i];
+            final int ya = lastPoint.y + (i == 0 ? dy1 : 0);
+            final int xb = xa + dxb[i];
+            final int yb = ya + dyb[i];
+            final int xc = xb + dxc[i];
+            final int yc = yb;
             curveTo(xa, ya, xb, yb, xc, yc);
         }
         clearArg();
@@ -243,15 +243,15 @@ public class T2Interpreter {
      */
     private void _hvcurveto() {
         if (getArgCount() % 8 <= 1) {
-            int count = getArgCount() / 8;
-            int[] dxa = new int[count];
-            int[] dxb = new int[count];
-            int[] dyb = new int[count];
-            int[] dyc = new int[count];
-            int[] dyd = new int[count];
-            int[] dxe = new int[count];
-            int[] dye = new int[count];
-            int[] dxf = new int[count];
+            final int count = getArgCount() / 8;
+            final int[] dxa = new int[count];
+            final int[] dxb = new int[count];
+            final int[] dyb = new int[count];
+            final int[] dyc = new int[count];
+            final int[] dyd = new int[count];
+            final int[] dxe = new int[count];
+            final int[] dye = new int[count];
+            final int[] dxf = new int[count];
             int dyf = 0;
             if (getArgCount() % 8 == 1) {
                 dyf = popArg().intValue();
@@ -267,32 +267,32 @@ public class T2Interpreter {
                 dxa[count - i - 1] = popArg().intValue();
             }
             for (int i = 0; i < count; ++i) {
-                Point lastPoint = getLastPoint();
-                int xa = lastPoint.x + dxa[i];
-                int ya = lastPoint.y;
-                int xb = xa + dxb[i];
-                int yb = ya + dyb[i];
-                int xc = xb;
-                int yc = yb + dyc[i];
-                int xd = xc;
-                int yd = yc + dyd[i];
-                int xe = xd + dxe[i];
-                int ye = yd + dye[i];
-                int xf = xe + dxf[i];
-                int yf = ye + dyf;
+                final Point lastPoint = getLastPoint();
+                final int xa = lastPoint.x + dxa[i];
+                final int ya = lastPoint.y;
+                final int xb = xa + dxb[i];
+                final int yb = ya + dyb[i];
+                final int xc = xb;
+                final int yc = yb + dyc[i];
+                final int xd = xc;
+                final int yd = yc + dyd[i];
+                final int xe = xd + dxe[i];
+                final int ye = yd + dye[i];
+                final int xf = xe + dxf[i];
+                final int yf = ye + dyf;
                 curveTo(xa, ya, xb, yb, xc, yc);
                 curveTo(xd, yd, xe, ye, xf, yf);
             }
         } else {
-            int count = getArgCount() / 8;
-            int[] dya = new int[count];
-            int[] dxb = new int[count];
-            int[] dyb = new int[count];
-            int[] dxc = new int[count];
-            int[] dxd = new int[count];
-            int[] dxe = new int[count];
-            int[] dye = new int[count];
-            int[] dyf = new int[count];
+            final int count = getArgCount() / 8;
+            final int[] dya = new int[count];
+            final int[] dxb = new int[count];
+            final int[] dyb = new int[count];
+            final int[] dxc = new int[count];
+            final int[] dxd = new int[count];
+            final int[] dxe = new int[count];
+            final int[] dye = new int[count];
+            final int[] dyf = new int[count];
             int dxf = 0;
             if (getArgCount() % 8 == 1) {
                 dxf = popArg().intValue();
@@ -307,24 +307,34 @@ public class T2Interpreter {
                 dxb[count - i - 1] = popArg().intValue();
                 dya[count - i - 1] = popArg().intValue();
             }
-            int dy3 = popArg().intValue();
-            int dy2 = popArg().intValue();
-            int dx2 = popArg().intValue();
-            int dx1 = popArg().intValue();
+            /**
+             * Not using the 'popped' arguments,
+             * hence simply pop them from stack!
+             *
+            final int dy3 = popArg().intValue();
+            final int dy2 = popArg().intValue();
+            final int dx2 = popArg().intValue();
+            final int dx1 = popArg().intValue();
+            */
+            popArg();
+            popArg();
+            popArg();
+            popArg();
+
             for (int i = 0; i < count; ++i) {
-                Point lastPoint = getLastPoint();
-                int xa = lastPoint.x;
-                int ya = lastPoint.y + dya[i];
-                int xb = xa + dxb[i];
-                int yb = ya + dyb[i];
-                int xc = xb + dxc[i];
-                int yc = yb;
-                int xd = xc + dxd[i];
-                int yd = yc;
-                int xe = xd + dxe[i];
-                int ye = yd + dye[i];
-                int xf = xe + dxf;
-                int yf = ye + dyf[i];
+                final Point lastPoint = getLastPoint();
+                final int xa = lastPoint.x;
+                final int ya = lastPoint.y + dya[i];
+                final int xb = xa + dxb[i];
+                final int yb = ya + dyb[i];
+                final int xc = xb + dxc[i];
+                final int yc = yb;
+                final int xd = xc + dxd[i];
+                final int yd = yc;
+                final int xe = xd + dxe[i];
+                final int ye = yd + dye[i];
+                final int xf = xe + dxf;
+                final int yf = ye + dyf[i];
                 curveTo(xa, ya, xb, yb, xc, yc);
                 curveTo(xd, yd, xe, ye, xf, yf);
 
@@ -341,15 +351,15 @@ public class T2Interpreter {
      * on the argument stack.
      */
     private void _rcurveline() {
-        int count = (getArgCount() - 2) / 6;
-        int[] dxa = new int[count];
-        int[] dya = new int[count];
-        int[] dxb = new int[count];
-        int[] dyb = new int[count];
-        int[] dxc = new int[count];
-        int[] dyc = new int[count];
-        int dyd = popArg().intValue();
-        int dxd = popArg().intValue();
+        final int count = (getArgCount() - 2) / 6;
+        final int[] dxa = new int[count];
+        final int[] dya = new int[count];
+        final int[] dxb = new int[count];
+        final int[] dyb = new int[count];
+        final int[] dxc = new int[count];
+        final int[] dyc = new int[count];
+        final int dyd = popArg().intValue();
+        final int dxd = popArg().intValue();
         for (int i = 0; i < count; ++i) {
             dyc[count - i - 1] = popArg().intValue();
             dxc[count - i - 1] = popArg().intValue();
@@ -361,11 +371,11 @@ public class T2Interpreter {
         int xc = 0;
         int yc = 0;
         for (int i = 0; i < count; ++i) {
-            Point lastPoint = getLastPoint();
-            int xa = lastPoint.x + dxa[i];
-            int ya = lastPoint.y + dya[i];
-            int xb = xa + dxb[i];
-            int yb = ya + dyb[i];
+            final Point lastPoint = getLastPoint();
+            final int xa = lastPoint.x + dxa[i];
+            final int ya = lastPoint.y + dya[i];
+            final int xb = xa + dxb[i];
+            final int yb = ya + dyb[i];
             xc = xb + dxc[i];
             yc = yb + dyc[i];
             curveTo(xa, ya, xb, yb, xc, yc);
@@ -381,15 +391,15 @@ public class T2Interpreter {
      * items on the argument stack.
      */
     private void _rlinecurve() {
-        int count = (getArgCount() - 6) / 2;
-        int[] dxa = new int[count];
-        int[] dya = new int[count];
-        int dyd = popArg().intValue();
-        int dxd = popArg().intValue();
-        int dyc = popArg().intValue();
-        int dxc = popArg().intValue();
-        int dyb = popArg().intValue();
-        int dxb = popArg().intValue();
+        final int count = (getArgCount() - 6) / 2;
+        final int[] dxa = new int[count];
+        final int[] dya = new int[count];
+        final int dyd = popArg().intValue();
+        final int dxd = popArg().intValue();
+        final int dyc = popArg().intValue();
+        final int dxc = popArg().intValue();
+        final int dyb = popArg().intValue();
+        final int dxb = popArg().intValue();
         for (int i = 0; i < count; ++i) {
             dya[count - i - 1] = popArg().intValue();
             dxa[count - i - 1] = popArg().intValue();
@@ -397,17 +407,17 @@ public class T2Interpreter {
         int xa = 0;
         int ya = 0;
         for (int i = 0; i < count; ++i) {
-            Point lastPoint = getLastPoint();
+            final Point lastPoint = getLastPoint();
             xa = lastPoint.x + dxa[i];
             ya = lastPoint.y + dya[i];
             lineTo(xa, ya);
         }
-        int xb = xa + dxb;
-        int yb = ya + dyb;
-        int xc = xb + dxc;
-        int yc = yb + dyc;
-        int xd = xc + dxd;
-        int yd = yc + dyd;
+        final int xb = xa + dxb;
+        final int yb = ya + dyb;
+        final int xc = xb + dxc;
+        final int yc = yb + dyc;
+        final int xd = xc + dxd;
+        final int yd = yc + dyd;
         curveTo(xb, yb, xc, yc, xd, yd);
         clearArg();
     }
@@ -420,15 +430,15 @@ public class T2Interpreter {
      */
     private void _vhcurveto() {
         if (getArgCount() % 8 <= 1) {
-            int count = getArgCount() / 8;
-            int[] dya = new int[count];
-            int[] dxb = new int[count];
-            int[] dyb = new int[count];
-            int[] dxc = new int[count];
-            int[] dxd = new int[count];
-            int[] dxe = new int[count];
-            int[] dye = new int[count];
-            int[] dyf = new int[count];
+            final int count = getArgCount() / 8;
+            final int[] dya = new int[count];
+            final int[] dxb = new int[count];
+            final int[] dyb = new int[count];
+            final int[] dxc = new int[count];
+            final int[] dxd = new int[count];
+            final int[] dxe = new int[count];
+            final int[] dye = new int[count];
+            final int[] dyf = new int[count];
             int dxf = 0;
             if (getArgCount() % 8 == 1) {
                 dxf = popArg().intValue();
@@ -444,24 +454,24 @@ public class T2Interpreter {
                 dya[count - i - 1] = popArg().intValue();
             }
             for (int i = 0; i < count; ++i) {
-                Point lastPoint = getLastPoint();
-                int xa = lastPoint.x;
-                int ya = lastPoint.y + dya[i];
-                int xb = xa + dxb[i];
-                int yb = ya + dyb[i];
-                int xc = xb + dxc[i];
-                int yc = yb;
-                int xd = xc + dxd[i];
-                int yd = yc;
-                int xe = xd + dxe[i];
-                int ye = yd + dye[i];
-                int xf = xe + dxf;
-                int yf = ye + dyf[i];
+                final Point lastPoint = getLastPoint();
+                final int xa = lastPoint.x;
+                final int ya = lastPoint.y + dya[i];
+                final int xb = xa + dxb[i];
+                final int yb = ya + dyb[i];
+                final int xc = xb + dxc[i];
+                final int yc = yb;
+                final int xd = xc + dxd[i];
+                final int yd = yc;
+                final int xe = xd + dxe[i];
+                final int ye = yd + dye[i];
+                final int xf = xe + dxf;
+                final int yf = ye + dyf[i];
                 curveTo(xa, ya, xb, yb, xc, yc);
                 curveTo(xd, yd, xe, ye, xf, yf);
             }
         } else {
-            int foo = 0;
+            final int foo = 0;
         }
         clearArg();
     }
@@ -565,7 +575,7 @@ public class T2Interpreter {
      * Returns the absolute value of num.
      */
     private void _abs() {
-        double num = popArg().doubleValue();
+        final double num = popArg().doubleValue();
         pushArg(Math.abs(num));
     }
 
@@ -573,8 +583,8 @@ public class T2Interpreter {
      * Returns the sum of the two numbers num1 and num2.
      */
     private void _add() {
-        double num2 = popArg().doubleValue();
-        double num1 = popArg().doubleValue();
+        final double num2 = popArg().doubleValue();
+        final double num1 = popArg().doubleValue();
         pushArg(num1 + num2);
     }
 
@@ -582,8 +592,8 @@ public class T2Interpreter {
      * Returns the result of subtracting num2 from num1.
      */
     private void _sub() {
-        double num2 = popArg().doubleValue();
-        double num1 = popArg().doubleValue();
+        final double num2 = popArg().doubleValue();
+        final double num1 = popArg().doubleValue();
         pushArg(num1 - num2);
     }
 
@@ -592,8 +602,8 @@ public class T2Interpreter {
      * undefined if overflow occurs and is zero for underflow.
      */
     private void _div() {
-        double num2 = popArg().doubleValue();
-        double num1 = popArg().doubleValue();
+        final double num2 = popArg().doubleValue();
+        final double num1 = popArg().doubleValue();
         pushArg(num1 / num2);
     }
 
@@ -601,7 +611,7 @@ public class T2Interpreter {
      * Returns the negative of num.
      */
     private void _neg() {
-        double num = popArg().doubleValue();
+        final double num = popArg().doubleValue();
         pushArg(-num);
     }
 
@@ -618,8 +628,8 @@ public class T2Interpreter {
      * result is undefined, and zero is returned for underflow.
      */
     private void _mul() {
-        double num2 = popArg().doubleValue();
-        double num1 = popArg().doubleValue();
+        final double num2 = popArg().doubleValue();
+        final double num1 = popArg().doubleValue();
         pushArg(num1 * num2);
     }
 
@@ -628,7 +638,7 @@ public class T2Interpreter {
      * undefined.
      */
     private void _sqrt() {
-        double num = popArg().doubleValue();
+        final double num = popArg().doubleValue();
         pushArg(Math.sqrt(num));
     }
 
@@ -643,8 +653,8 @@ public class T2Interpreter {
      * Exchanges the top two elements on the argument stack.
      */
     private void _exch() {
-        Number num2 = popArg();
-        Number num1 = popArg();
+        final Number num2 = popArg();
+        final Number num1 = popArg();
         pushArg(num2);
         pushArg(num1);
     }
@@ -656,8 +666,8 @@ public class T2Interpreter {
      * undefined.
      */
     private void _index() {
-        int i = popArg().intValue();
-        Number[] nums = new Number[i];
+        final int i = popArg().intValue();
+        final Number[] nums = new Number[i];
         for (int j = 0; j < i; ++j) {
             nums[j] = popArg();
         }
@@ -675,9 +685,9 @@ public class T2Interpreter {
      * operation is undefined.
      */
     private void _roll() {
-        int j = popArg().intValue();
-        int n = popArg().intValue();
-        Number[] nums = new Number[n];
+        final int j = popArg().intValue();
+        final int n = popArg().intValue();
+        final Number[] nums = new Number[n];
         for (int i = 0; i < n; ++i) {
             nums[i] = popArg();
         }
@@ -690,7 +700,7 @@ public class T2Interpreter {
      * Duplicates the top element on the argument stack.
      */
     private void _dup() {
-        Number any = popArg();
+        final Number any = popArg();
         pushArg(any);
         pushArg(any);
     }
@@ -699,8 +709,8 @@ public class T2Interpreter {
      * Stores val into the transient array at the location given by i.
      */
     private void _put() {
-        int i = popArg().intValue();
-        Number val = popArg();
+        final int i = popArg().intValue();
+        final Number val = popArg();
         _transientArray[i] = val;
     }
 
@@ -711,7 +721,7 @@ public class T2Interpreter {
      * charstring, the value returned is undefined.
      */
     private void _get() {
-        int i = popArg().intValue();
+        final int i = popArg().intValue();
         pushArg(_transientArray[i]);
     }
 
@@ -720,8 +730,8 @@ public class T2Interpreter {
      * puts a 0 on the stack if either argument is zero.
      */
     private void _and() {
-        double num2 = popArg().doubleValue();
-        double num1 = popArg().doubleValue();
+        final double num2 = popArg().doubleValue();
+        final double num1 = popArg().doubleValue();
         pushArg((num1!=0.0) && (num2!=0.0) ? 1 : 0);
     }
 
@@ -730,8 +740,8 @@ public class T2Interpreter {
      * puts a 0 on the stack if both arguments are zero.
      */
     private void _or() {
-        double num2 = popArg().doubleValue();
-        double num1 = popArg().doubleValue();
+        final double num2 = popArg().doubleValue();
+        final double num1 = popArg().doubleValue();
         pushArg((num1!=0.0) || (num2!=0.0) ? 1 : 0);
     }
 
@@ -739,7 +749,7 @@ public class T2Interpreter {
      * Returns a 0 if num1 is non-zero; returns a 1 if num1 is zero.
      */
     private void _not() {
-        double num1 = popArg().doubleValue();
+        final double num1 = popArg().doubleValue();
         pushArg((num1!=0.0) ? 0 : 1);
     }
 
@@ -748,8 +758,8 @@ public class T2Interpreter {
      * is put on the stack.
      */
     private void _eq() {
-        double num2 = popArg().doubleValue();
-        double num1 = popArg().doubleValue();
+        final double num2 = popArg().doubleValue();
+        final double num1 = popArg().doubleValue();
         pushArg(num1 == num2 ? 1 : 0);
     }
 
@@ -759,10 +769,10 @@ public class T2Interpreter {
      * number of a subroutine.
      */
     private void _ifelse() {
-        double v2 = popArg().doubleValue();
-        double v1 = popArg().doubleValue();
-        Number s2 = popArg();
-        Number s1 = popArg();
+        final double v2 = popArg().doubleValue();
+        final double v1 = popArg().doubleValue();
+        final Number s2 = popArg();
+        final Number s1 = popArg();
         pushArg(v1 <= v2 ? s1 : s2);
     }
 
@@ -796,7 +806,7 @@ public class T2Interpreter {
 
     }
 
-    public Point[] execute(CharstringType2 cs) {
+    public Point[] execute(final CharstringType2 cs) {
         _points = new ArrayList<Point>();
         cs.resetIP();
         while (cs.moreBytes()) {
@@ -964,7 +974,7 @@ public class T2Interpreter {
                 }
             }
         }
-        Point[] pointArray = new Point[_points.size()];
+        final Point[] pointArray = new Point[_points.size()];
         _points.toArray(pointArray);
         return pointArray;
     }
@@ -986,7 +996,7 @@ public class T2Interpreter {
     /**
      * Push a value on to the argument stack
      */
-    private void pushArg(Number n) {
+    private void pushArg(final Number n) {
         _argStack[_argStackIndex++] = n;
     }
 
@@ -1000,7 +1010,7 @@ public class T2Interpreter {
     /**
      * Push a value on to the subroutine stack
      */
-    private void pushSubr(int n) {
+    private void pushSubr(final int n) {
         _subrStack[_subrStackIndex++] = n;
     }
 
@@ -1012,7 +1022,7 @@ public class T2Interpreter {
     }
 
     private Point getLastPoint() {
-        int size = _points.size();
+        final int size = _points.size();
         if (size > 0) {
             return _points.get(size - 1);
         } else {
@@ -1020,23 +1030,23 @@ public class T2Interpreter {
         }
     }
 
-    private void moveTo(int x, int y) {
+    private void moveTo(final int x, final int y) {
         endContour();
         _points.add(new Point(x, y, true, false));
     }
 
-    private void lineTo(int x, int y) {
+    private void lineTo(final int x, final int y) {
         _points.add(new Point(x, y, true, false));
     }
 
-    private void curveTo(int cx1, int cy1, int cx2, int cy2, int x, int y) {
+    private void curveTo(final int cx1, final int cy1, final int cx2, final int cy2, final int x, final int y) {
         _points.add(new Point(cx1, cy1, false, false));
         _points.add(new Point(cx2, cy2, false, false));
         _points.add(new Point(x, y, true, false));
     }
 
     private void endContour() {
-        Point lastPoint = getLastPoint();
+        final Point lastPoint = getLastPoint();
         if (lastPoint != null) {
             lastPoint.endOfContour = true;
         }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
index 2bb5cec..a7408e3 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Interpreter.java
@@ -33,16 +33,16 @@ import jogamp.graph.font.typecast.ot.Point;
 public class Interpreter {
 
     private Parser parser = null;
-    private GraphicsState gs = new GraphicsState();
-    private Point[][] zone = new Point[2][];
+    private final GraphicsState gs = new GraphicsState();
+    private final Point[][] zone = new Point[2][];
     private int[] stack = null;
     private int[] store = null;
-    private int[] cvt = new int[256];
+    private final int[] cvt = new int[256];
     private int[] functionMap = null;
     private int stackIndex = 0;
     private boolean inFuncDef = false;
 
-    public Interpreter(int stackMax, int storeMax, int funcMax) {
+    public Interpreter(final int stackMax, final int storeMax, final int funcMax) {
         zone[0] = new Point[256];
         zone[1] = new Point[256];
         stack = new int[stackMax];
@@ -54,7 +54,7 @@ public class Interpreter {
      * ABSolute value
      */
     private void _abs() {
-        int n = pop();
+        final int n = pop();
         if (n >= 0) {
             push(n);
         } else {
@@ -66,8 +66,8 @@ public class Interpreter {
      * ADD
      */
     private void _add() {
-        int n1 = pop();
-        int n2 = pop();
+        final int n1 = pop();
+        final int n2 = pop();
         push(n2 + n1);
     }
 
@@ -92,8 +92,8 @@ public class Interpreter {
      * logical AND
      */
     private void _and() {
-        int e2 = pop();
-        int e1 = pop();
+        final int e2 = pop();
+        final int e1 = pop();
         push(((e1 != 0) && (e2 != 0)) ? 1 : 0);
     }
 
@@ -108,7 +108,7 @@ public class Interpreter {
      * CEILING
      */
     private void _ceiling() {
-        int n = pop();
+        final int n = pop();
         if (n >= 0) {
             push((n & 0xffc0) + (((n & 0x3f) != 0) ? 0x40 : 0));
         } else {
@@ -138,7 +138,7 @@ public class Interpreter {
      * DELTA exception C1
      */
     private void _deltac1() {
-        int n = pop();
+        final int n = pop();
         for (int i = 0; i < n; i++) {
             pop();    // pn
             pop();    // argn
@@ -149,7 +149,7 @@ public class Interpreter {
      * DELTA exception C2
      */
     private void _deltac2() {
-        int n = pop();
+        final int n = pop();
         for (int i = 0; i < n; i++) {
             pop();    // pn
             pop();    // argn
@@ -160,7 +160,7 @@ public class Interpreter {
      * DELTA exception C3
      */
     private void _deltac3() {
-        int n = pop();
+        final int n = pop();
         for (int i = 0; i < n; i++) {
             pop();    // pn
             pop();    // argn
@@ -171,7 +171,7 @@ public class Interpreter {
      * DELTA exception P1
      */
     private void _deltap1() {
-        int n = pop();
+        final int n = pop();
         for (int i = 0; i < n; i++) {
             pop();    // pn
             pop();    // argn
@@ -182,7 +182,7 @@ public class Interpreter {
      * DELTA exception P2
      */
     private void _deltap2() {
-        int n = pop();
+        final int n = pop();
         for (int i = 0; i < n; i++) {
             pop();    // pn
             pop();    // argn
@@ -193,7 +193,7 @@ public class Interpreter {
      * DELTA exception P3
      */
     private void _deltap3() {
-        int n = pop();
+        final int n = pop();
         for (int i = 0; i < n; i++) {
             pop();    // pn
             pop();    // argn
@@ -211,8 +211,8 @@ public class Interpreter {
      * DIVide
      */
     private void _div() {
-        int n1 = pop();
-        int n2 = pop();
+        final int n1 = pop();
+        final int n2 = pop();
         push((n2 / n1) >> 6);
     }
 
@@ -220,7 +220,7 @@ public class Interpreter {
      * DUPlicate top stack element
      */
     private void _dup() {
-        int n = pop();
+        final int n = pop();
         push(n);
         push(n);
     }
@@ -228,7 +228,7 @@ public class Interpreter {
     /**
      * ELSE
      */
-    private int _else(int instructionIndex) {
+    private int _else(final int instructionIndex) {
         return parser.handleElse(instructionIndex);
     }
 
@@ -236,8 +236,8 @@ public class Interpreter {
      * EQual
      */
     private void _eq() {
-        int e2 = pop();
-        int e1 = pop();
+        final int e2 = pop();
+        final int e1 = pop();
         push((e1 == e2) ? 1 : 0);
     }
 
@@ -249,7 +249,7 @@ public class Interpreter {
     /**
      * Function DEFinition
      */
-    private void _fdef(int instructionIndex) {
+    private void _fdef(final int instructionIndex) {
         functionMap[pop()] = instructionIndex;
         inFuncDef = true;
     }
@@ -275,7 +275,7 @@ public class Interpreter {
      */
     private void _flippt() {
         while(gs.loop-- > 0) {
-            int index = pop();
+            final int index = pop();
             zone[gs.zp0][index].onCurve = !zone[gs.zp0][index].onCurve;
         }
         gs.loop = 1;
@@ -285,8 +285,8 @@ public class Interpreter {
      * FLIP RanGe OFF
      */
     private void _fliprgoff() {
-        int end = pop();
-        int start = pop();
+        final int end = pop();
+        final int start = pop();
         for (int i = start; i <= end; i++) {
             zone[1][i].onCurve = false;
         }
@@ -296,8 +296,8 @@ public class Interpreter {
      * FLIP RanGe ON
      */
     private void _fliprgon() {
-        int end = pop();
-        int start = pop();
+        final int end = pop();
+        final int start = pop();
         for (int i = start; i <= end; i++) {
             zone[1][i].onCurve = true;
         }
@@ -307,7 +307,7 @@ public class Interpreter {
      * FLOOR
      */
     private void _floor() {
-        int n = pop();
+        final int n = pop();
         if (n >= 0) {
             push(n & 0xffc0);
         } else {
@@ -315,7 +315,7 @@ public class Interpreter {
         }
     }
 
-    private void _gc(short param) {
+    private void _gc(final short param) {
         pop();
         push(0);
     }
@@ -345,8 +345,8 @@ public class Interpreter {
      * Greater Than
      */
     private void _gt() {
-        int e2 = pop();
-        int e1 = pop();
+        final int e2 = pop();
+        final int e1 = pop();
         push((e1 > e2) ? 1 : 0);
     }
 
@@ -354,8 +354,8 @@ public class Interpreter {
      * Greater Than or EQual
      */
     private void _gteq() {
-        int e2 = pop();
-        int e1 = pop();
+        final int e2 = pop();
+        final int e1 = pop();
         push((e1 >= e2) ? 1 : 0);
     }
 
@@ -370,7 +370,7 @@ public class Interpreter {
     /**
      * IF test
      */
-    private int _if(int instructionIndex) {
+    private int _if(final int instructionIndex) {
         return parser.handleIf(pop() != 0, instructionIndex);
     }
 
@@ -425,8 +425,8 @@ public class Interpreter {
      * will be used in glyph instructions.
      */
     private void _instctrl() {
-        int s = pop();
-        int v = pop();
+        final int s = pop();
+        final int v = pop();
         if (s == 1) {
             gs.instruction_control |= v;
         } else if (s == 2) {
@@ -446,22 +446,22 @@ public class Interpreter {
         pop();
     }
 
-    private void _iup(short param) {
+    private void _iup(final short param) {
     }
 
     /**
      * JuMP Relative
      */
-    private int _jmpr(int instructionIndex) {
-        return instructionIndex += pop() - 1;
+    private int _jmpr(final int instructionIndex) {
+        return instructionIndex + ( pop() - 1 );
     }
 
     /**
      * Jump Relative On False
      */
     private int _jrof(int instructionIndex) {
-        boolean test = pop() != 0;
-        int offset = pop();
+        final boolean test = pop() != 0;
+        final int offset = pop();
         if (!test) {
             instructionIndex += offset - 1;
         }
@@ -472,8 +472,8 @@ public class Interpreter {
      * Jump Relative On True
      */
     private int _jrot(int instructionIndex) {
-        boolean test = pop() != 0;
-        int offset = pop();
+        final boolean test = pop() != 0;
+        final int offset = pop();
         if (test) {
             instructionIndex += offset - 1;
         }
@@ -484,8 +484,8 @@ public class Interpreter {
      * LOOP and CALL function
      */
     private void _loopcall() {
-        int index = pop();
-        int count = pop();
+        /* final int index = */ pop();
+        final int count = pop();
         for (int i = 0; i < count; i++) {
             execute(functionMap[i]);
         }
@@ -495,8 +495,8 @@ public class Interpreter {
      * Less Than
      */
     private void _lt() {
-        int e2 = pop();
-        int e1 = pop();
+        final int e2 = pop();
+        final int e1 = pop();
         push((e1 < e2) ? 1 : 0);
     }
 
@@ -504,8 +504,8 @@ public class Interpreter {
      * Less Than or EQual
      */
     private void _lteq() {
-        int e2 = pop();
-        int e1 = pop();
+        final int e2 = pop();
+        final int e1 = pop();
         push((e1 <= e2) ? 1 : 0);
     }
 
@@ -513,26 +513,26 @@ public class Interpreter {
      * MAXimum of top two stack elements
      */
     private void _max() {
-        int n1 = pop();
-        int n2 = pop();
+        final int n1 = pop();
+        final int n2 = pop();
         push((n1 > n2) ? n1 : n2);
     }
 
-    private void _md(short param) {
+    private void _md(final short param) {
         pop();
         pop();
         push(0);
     }
 
-    private void _mdap(short param) {
+    private void _mdap(final short param) {
         pop();
     }
 
-    private void _mdrp(short param) {
+    private void _mdrp(final short param) {
         pop();
     }
 
-    private void _miap(short param) {
+    private void _miap(final short param) {
         pop();
         pop();
     }
@@ -540,8 +540,8 @@ public class Interpreter {
      * MINimum of top two stack elements
      */
     private void _min() {
-        int n1 = pop();
-        int n2 = pop();
+        final int n1 = pop();
+        final int n2 = pop();
         push((n1 < n2) ? n1 : n2);
     }
 
@@ -550,15 +550,15 @@ public class Interpreter {
      */
     private void _mindex() {
         // Move the indexed element to stackIndex, and shift the others down
-        int k = pop();
-        int e = stack[stackIndex - k];
+        final int k = pop();
+        final int e = stack[stackIndex - k];
         for (int i = stackIndex - k; i < stackIndex - 1; i++) {
             stack[i] = stack[i+1];
         }
         stack[stackIndex - 1] = e;
     }
 
-    private void _mirp(short param) {
+    private void _mirp(final short param) {
         pop();
         pop();
     }
@@ -571,7 +571,7 @@ public class Interpreter {
         push(0);
     }
 
-    private void _msirp(short param) {
+    private void _msirp(final short param) {
         pop();
         pop();
     }
@@ -580,8 +580,8 @@ public class Interpreter {
      * MULtiply
      */
     private void _mul() {
-        int n1 = pop();
-        int n2 = pop();
+        final int n1 = pop();
+        final int n2 = pop();
         push((n1 * n2) >> 6);
     }
 
@@ -596,8 +596,8 @@ public class Interpreter {
      * Not EQual
      */
     private void _neq() {
-        int e2 = pop();
-        int e1 = pop();
+        final int e2 = pop();
+        final int e1 = pop();
         push((e1 != e2) ? 1 : 0);
     }
 
@@ -608,7 +608,7 @@ public class Interpreter {
         push((pop() != 0) ? 0 : 1);
     }
 
-    private void _nround(short param) {
+    private void _nround(final short param) {
         pop();
         push(0);
     }
@@ -622,8 +622,8 @@ public class Interpreter {
      * logical OR
      */
     private void _or() {
-        int e2 = pop();
-        int e1 = pop();
+        final int e2 = pop();
+        final int e1 = pop();
         push(((e1 != 0) || (e2 != 0)) ? 1 : 0);
     }
 
@@ -633,7 +633,7 @@ public class Interpreter {
      * PUSH Bytes
      * PUSH Words
      */
-    private void _push(int[] data) {
+    private void _push(final int[] data) {
         for (int j = 0; j < data.length; j++) {
             push(data[j]);
         }
@@ -664,15 +664,15 @@ public class Interpreter {
      * ROLL the top three stack elements
      */
     private void _roll() {
-        int a = pop();
-        int b = pop();
-        int c = pop();
+        final int a = pop();
+        final int b = pop();
+        final int c = pop();
         push(b);
         push(a);
         push(c);
     }
 
-    private void _round(short param) {
+    private void _round(final short param) {
         pop();
         push(0);
     }
@@ -907,7 +907,7 @@ public class Interpreter {
     /**
      * Set Dual Projection_Vector To Line
      */
-    private void _sdpvtl(short param) {
+    private void _sdpvtl(final short param) {
         pop();
         pop();
     }
@@ -930,7 +930,7 @@ public class Interpreter {
     /*
      * Set Freedom_Vector to Coordinate Axis
      */
-    private void _sfvtca(short param) {
+    private void _sfvtca(final short param) {
         if (param == 1) {
             gs.freedom_vector[0] = 0x4000;
             gs.freedom_vector[1] = 0x0000;
@@ -943,16 +943,16 @@ public class Interpreter {
     /*
      * Set Freedom_Vector To Line
      */
-    private void _sfvtl(short param) {
+    private void _sfvtl(final short param) {
         pop();
         pop();
-        if (param == 1) {
-            gs.freedom_vector[0] = 0x0000;
-            gs.freedom_vector[1] = 0x0000;
-        } else {
+        // if (param == 1) {
             gs.freedom_vector[0] = 0x0000;
             gs.freedom_vector[1] = 0x0000;
-        }
+        // } else {
+        //    gs.freedom_vector[0] = 0x0000;
+        //    gs.freedom_vector[1] = 0x0000;
+        //}
     }
 
     /**
@@ -963,7 +963,7 @@ public class Interpreter {
         gs.freedom_vector[1] = gs.projection_vector[1];
     }
 
-    private void _shc(short param) {
+    private void _shc(final short param) {
         pop();
     }
 
@@ -972,7 +972,7 @@ public class Interpreter {
      *
      * USES: loop
      */
-    private void _shp(short param) {
+    private void _shp(final short param) {
         while(gs.loop-- > 0) {
             pop();
             if(param == 0) {
@@ -995,7 +995,7 @@ public class Interpreter {
         gs.loop = 1;
     }
 
-    private void _shz(short param) {
+    private void _shz(final short param) {
         pop();
     }
 
@@ -1024,7 +1024,7 @@ public class Interpreter {
     /*
      * Set Projection_Vector To Coordinate Axis
      */
-    private void _spvtca(short param) {
+    private void _spvtca(final short param) {
         if (param == 1) {
             gs.projection_vector[0] = 0x4000;
             gs.projection_vector[1] = 0x0000;
@@ -1037,21 +1037,26 @@ public class Interpreter {
     /**
      * Set Projection_Vector To Line
      */
-    private void _spvtl(short param) {
+    private void _spvtl(final short param) {
 
+        // below block is dead code, reduce to pop() calls.
+        pop();
+        pop();
+        /**
         // We'll get a copy of the line and normalize it -
         // divide the x- and y-coords by the vector's dot product.
-        Point p1 = zone[gs.zp2][pop()];
-        Point p2 = zone[gs.zp1][pop()];
-        int x = p2.x - p1.x;
-        int y = p2.y - p1.y;
-        if(param == 1) {
+        final Point p1 = zone[gs.zp2][pop()];
+        final Point p2 = zone[gs.zp1][pop()];
+        final int x = p2.x - p1.x;
+        final int y = p2.y - p1.y;
+         */
+        // if(param == 1) {
             gs.projection_vector[0] = 0x0000;
             gs.projection_vector[1] = 0x0000;
-        } else {
-            gs.projection_vector[0] = 0x0000;
-            gs.projection_vector[1] = 0x0000;
-        }
+        // } else {
+        //    gs.projection_vector[0] = 0x0000;
+        //    gs.projection_vector[1] = 0x0000;
+        // }
     }
 
     private void _sround() {
@@ -1097,15 +1102,15 @@ public class Interpreter {
      * SUBtract
      */
     private void _sub() {
-        int n1 = pop();
-        int n2 = pop();
+        final int n1 = pop();
+        final int n2 = pop();
         push(n2 - n1);
     }
 
     /**
      * Set freedom and projection Vectors To Coordinate Axis
      */
-    private void _svtca(short param) {
+    private void _svtca(final short param) {
         if (param == 1) {
             gs.projection_vector[0] = 0x4000;
             gs.projection_vector[1] = 0x0000;
@@ -1123,8 +1128,8 @@ public class Interpreter {
      * SWAP the top two elements on the stack
      */
     private void _swap() {
-        int n1 = pop();
-        int n2 = pop();
+        final int n1 = pop();
+        final int n2 = pop();
         push(n1);
         push(n2);
     }
@@ -1165,7 +1170,7 @@ public class Interpreter {
      * Write Control Value Table in FUnits
      */
     private void _wcvtf() {
-        int value = pop();
+        final int value = pop();
         // Conversion of value goes here
         cvt[pop()] = value;
     }
@@ -1174,7 +1179,7 @@ public class Interpreter {
      * Write Control Value Table in Pixel units
      */
     private void _wcvtp() {
-        int value = pop();
+        final int value = pop();
         // Conversion of value goes here
         cvt[pop()] = value;
     }
@@ -1188,7 +1193,7 @@ public class Interpreter {
 
     public void execute(int ip) {
         while (ip < ((ip & 0xffff0000) | parser.getISLength(ip >> 16))) {
-            short opcode = parser.getOpcode(ip);
+            final short opcode = parser.getOpcode(ip);
             if (inFuncDef) {
 
                 // We're within a function definition, so don't execute the code
@@ -1332,7 +1337,7 @@ public class Interpreter {
         return stack[--stackIndex];
     }
 
-    private void push(int i) {
+    private void push(final int i) {
         stack[stackIndex++] = i;
     }
 
@@ -1351,7 +1356,7 @@ public class Interpreter {
         }
     }
 
-    public void setParser(Parser p) {
+    public void setParser(final Parser p) {
         parser = p;
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java
index 1159b2c..ff1795a 100644
--- a/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java
+++ b/src/jogl/classes/jogamp/graph/font/typecast/tt/engine/Parser.java
@@ -28,7 +28,7 @@ import jogamp.graph.font.typecast.ot.Mnemonic;
  */
 public class Parser {
 
-    private short[][] instructions = new short[3][];
+    private final short[][] instructions = new short[3][];
 
     /**
      * Advance the instruction pointer to the next executable opcode.
@@ -41,7 +41,7 @@ public class Parser {
     public int advanceIP(int ip) {
 
         // The high word specifies font, cvt, or glyph program
-        int prog = ip >> 16;
+        final int prog = ip >> 16;
         int i = ip & 0xffff;
         int dataCount;
         ip++;
@@ -63,16 +63,16 @@ public class Parser {
         return ip;
     }
 
-    public int getISLength(int prog) {
+    public int getISLength(final int prog) {
         return instructions[prog].length;
     }
 
-    public short getOpcode(int ip) {
+    public short getOpcode(final int ip) {
         return instructions[ip >> 16][ip & 0xffff];
     }
 
-    public short getPushCount(int ip) {
-        short instr = instructions[ip >> 16][ip & 0xffff];
+    public short getPushCount(final int ip) {
+        final short instr = instructions[ip >> 16][ip & 0xffff];
         if ((Mnemonic.NPUSHB == instr) || (Mnemonic.NPUSHW == instr)) {
             return instructions[ip >> 16][(ip & 0xffff) + 1];
         } else if ((Mnemonic.PUSHB == (instr & 0xf8)) || (Mnemonic.PUSHW == (instr & 0xf8))) {
@@ -81,12 +81,12 @@ public class Parser {
         return 0;
     }
 
-    public int[] getPushData(int ip) {
-        int count = getPushCount(ip);
-        int[] data = new int[count];
-        int prog = ip >> 16;
-        int i = ip & 0xffff;
-        short instr = instructions[prog][i];
+    public int[] getPushData(final int ip) {
+        final int count = getPushCount(ip);
+        final int[] data = new int[count];
+        final int prog = ip >> 16;
+        final int i = ip & 0xffff;
+        final short instr = instructions[prog][i];
         if (Mnemonic.NPUSHB == instr) {
             for (int j = 0; j < count; j++) {
                 data[j] = instructions[prog][i + j + 2];
@@ -114,7 +114,7 @@ public class Parser {
         return ip;
     }
 
-    public int handleIf(boolean test, int ip) {
+    public int handleIf(final boolean test, int ip) {
         if (test == false) {
             // The TrueType spec says that we merely jump to the *next* ELSE or EIF
             // instruction in the instruction stream.  So therefore no nesting!
@@ -130,32 +130,32 @@ public class Parser {
     /**
      * This program is run everytime we scale the font
      */
-    public void setCvtProgram(short[] program) {
+    public void setCvtProgram(final short[] program) {
         instructions[1] = program;
     }
 
     /**
      * This program is only run once
      */
-    public void setFontProgram(short[] program) {
+    public void setFontProgram(final short[] program) {
         instructions[0] = program;
     }
 
     /**
      * This program is run everytime we scale the glyph
      */
-    public void setGlyphProgram(short[] program) {
+    public void setGlyphProgram(final short[] program) {
         instructions[2] = program;
     }
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         int ip = 0;
         while (ip < instructions[0].length) {
             sb.append(Mnemonic.getMnemonic(getOpcode(ip)));
             if (getPushCount(ip) > 0) {
-                int[] data = getPushData(ip);
+                final int[] data = getPushData(ip);
                 for(int j = 0; j < data.length; j++)
                 sb.append(" ").append(data[j]);
             }
@@ -167,7 +167,7 @@ public class Parser {
         while (ip < (0x10000 | instructions[1].length)) {
             sb.append(Mnemonic.getMnemonic(getOpcode(ip)));
             if(getPushCount(ip) > 0) {
-                int[] data = getPushData(ip);
+                final int[] data = getPushData(ip);
                 for (int j = 0; j < data.length; j++) {
                     sb.append(" ").append(data[j]);
                 }
@@ -180,7 +180,7 @@ public class Parser {
         while (ip < (0x20000 | instructions[2].length)) {
             sb.append(Mnemonic.getMnemonic(getOpcode(ip)));
             if (getPushCount(ip) > 0) {
-                int[] data = getPushData(ip);
+                final int[] data = getPushData(ip);
                 for (int j = 0; j < data.length; j++) {
                     sb.append(" ").append(data[j]);
                 }
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java b/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java
index 32e2b6a..a9978ab 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/AffineTransform.java
@@ -19,18 +19,13 @@
  */
 package jogamp.graph.geom.plane;
 
-import java.io.IOException;
-import java.io.Serializable;
-
 // import jogamp.opengl.util.HashCode;
 
 import com.jogamp.graph.geom.Vertex;
-import com.jogamp.graph.geom.Vertex.Factory;
 import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.math.geom.AABBox;
 
-public class AffineTransform implements Cloneable, Serializable {
-
-    private static final long serialVersionUID = 1330973210523860834L;
+public class AffineTransform implements Cloneable {
 
     static final String determinantIsZero = "Determinant is zero";
 
@@ -55,8 +50,6 @@ public class AffineTransform implements Cloneable, Serializable {
      */
     static final float ZERO = (float) 1E-10;
 
-    private final Vertex.Factory<? extends Vertex> pointFactory;
-
     /**
      * The values of transformation matrix
      */
@@ -73,21 +66,10 @@ public class AffineTransform implements Cloneable, Serializable {
     transient int type;
 
     public AffineTransform() {
-        pointFactory = null;
-        type = TYPE_IDENTITY;
-        m00 = m11 = 1.0f;
-        m10 = m01 = m02 = m12 = 0.0f;
-    }
-
-    public AffineTransform(Factory<? extends Vertex> factory) {
-        pointFactory = factory;
-        type = TYPE_IDENTITY;
-        m00 = m11 = 1.0f;
-        m10 = m01 = m02 = m12 = 0.0f;
+        setToIdentity();
     }
 
-    public AffineTransform(AffineTransform t) {
-        this.pointFactory = t.pointFactory;
+    public AffineTransform(final AffineTransform t) {
         this.type = t.type;
         this.m00 = t.m00;
         this.m10 = t.m10;
@@ -97,8 +79,7 @@ public class AffineTransform implements Cloneable, Serializable {
         this.m12 = t.m12;
     }
 
-    public AffineTransform(Vertex.Factory<? extends Vertex> factory, float m00, float m10, float m01, float m11, float m02, float m12) {
-        pointFactory = factory;
+    public AffineTransform(final float m00, final float m10, final float m01, final float m11, final float m02, final float m12) {
         this.type = TYPE_UNKNOWN;
         this.m00 = m00;
         this.m10 = m10;
@@ -108,8 +89,7 @@ public class AffineTransform implements Cloneable, Serializable {
         this.m12 = m12;
     }
 
-    public AffineTransform(Vertex.Factory<? extends Vertex> factory, float[] matrix) {
-        pointFactory = factory;
+    public AffineTransform(final float[] matrix) {
         this.type = TYPE_UNKNOWN;
         m00 = matrix[0];
         m10 = matrix[1];
@@ -164,8 +144,8 @@ public class AffineTransform implements Cloneable, Serializable {
             type |= TYPE_FLIP;
         }
 
-        float dx = m00 * m00 + m10 * m10;
-        float dy = m01 * m01 + m11 * m11;
+        final float dx = m00 * m00 + m10 * m10;
+        final float dy = m01 * m01 + m11 * m11;
         if (dx != dy) {
             type |= TYPE_GENERAL_SCALE;
         } else
@@ -185,35 +165,35 @@ public class AffineTransform implements Cloneable, Serializable {
         return type;
     }
 
-    public float getScaleX() {
+    public final float getScaleX() {
         return m00;
     }
 
-    public float getScaleY() {
+    public final float getScaleY() {
         return m11;
     }
 
-    public float getShearX() {
+    public final float getShearX() {
         return m01;
     }
 
-    public float getShearY() {
+    public final float getShearY() {
         return m10;
     }
 
-    public float getTranslateX() {
+    public final float getTranslateX() {
         return m02;
     }
 
-    public float getTranslateY() {
+    public final float getTranslateY() {
         return m12;
     }
 
-    public boolean isIdentity() {
+    public final boolean isIdentity() {
         return getType() == TYPE_IDENTITY;
     }
 
-    public void getMatrix(float[] matrix) {
+    public final void getMatrix(final float[] matrix) {
         matrix[0] = m00;
         matrix[1] = m10;
         matrix[2] = m01;
@@ -224,11 +204,11 @@ public class AffineTransform implements Cloneable, Serializable {
         }
     }
 
-    public float getDeterminant() {
+    public final float getDeterminant() {
         return m00 * m11 - m01 * m10;
     }
 
-    public void setTransform(float m00, float m10, float m01, float m11, float m02, float m12) {
+    public final AffineTransform setTransform(final float m00, final float m10, final float m01, final float m11, final float m02, final float m12) {
         this.type = TYPE_UNKNOWN;
         this.m00 = m00;
         this.m10 = m10;
@@ -236,20 +216,23 @@ public class AffineTransform implements Cloneable, Serializable {
         this.m11 = m11;
         this.m02 = m02;
         this.m12 = m12;
+        return this;
     }
 
-    public void setTransform(AffineTransform t) {
+    public final AffineTransform setTransform(final AffineTransform t) {
         type = t.type;
         setTransform(t.m00, t.m10, t.m01, t.m11, t.m02, t.m12);
+        return this;
     }
 
-    public void setToIdentity() {
+    public final AffineTransform setToIdentity() {
         type = TYPE_IDENTITY;
         m00 = m11 = 1.0f;
         m10 = m01 = m02 = m12 = 0.0f;
+        return this;
     }
 
-    public void setToTranslation(float mx, float my) {
+    public final AffineTransform setToTranslation(final float mx, final float my) {
         m00 = m11 = 1.0f;
         m01 = m10 = 0.0f;
         m02 = mx;
@@ -259,9 +242,10 @@ public class AffineTransform implements Cloneable, Serializable {
         } else {
             type = TYPE_TRANSLATION;
         }
+        return this;
     }
 
-    public void setToScale(float scx, float scy) {
+    public final AffineTransform setToScale(final float scx, final float scy) {
         m00 = scx;
         m11 = scy;
         m10 = m01 = m02 = m12 = 0.0f;
@@ -270,9 +254,10 @@ public class AffineTransform implements Cloneable, Serializable {
         } else {
             type = TYPE_IDENTITY;
         }
+        return this;
     }
 
-    public void setToShear(float shx, float shy) {
+    public final AffineTransform setToShear(final float shx, final float shy) {
         m00 = m11 = 1.0f;
         m02 = m12 = 0.0f;
         m01 = shx;
@@ -282,9 +267,10 @@ public class AffineTransform implements Cloneable, Serializable {
         } else {
             type = TYPE_IDENTITY;
         }
+        return this;
     }
 
-    public void setToRotation(float angle) {
+    public final AffineTransform setToRotation(final float angle) {
         float sin = FloatUtil.sin(angle);
         float cos = FloatUtil.cos(angle);
         if (FloatUtil.abs(cos) < ZERO) {
@@ -300,98 +286,108 @@ public class AffineTransform implements Cloneable, Serializable {
         m10 = sin;
         m02 = m12 = 0.0f;
         type = TYPE_UNKNOWN;
+        return this;
     }
 
-    public void setToRotation(float angle, float px, float py) {
+    public final AffineTransform setToRotation(final float angle, final float px, final float py) {
         setToRotation(angle);
         m02 = px * (1.0f - m00) + py * m10;
         m12 = py * (1.0f - m00) - px * m10;
         type = TYPE_UNKNOWN;
+        return this;
     }
 
-    public static <T extends Vertex> AffineTransform getTranslateInstance(Vertex.Factory<? extends Vertex> factory, float mx, float my) {
-        AffineTransform t = new AffineTransform(factory);
-        t.setToTranslation(mx, my);
-        return t;
-    }
-
-    public static <T extends Vertex> AffineTransform getScaleInstance(Vertex.Factory<? extends Vertex> factory, float scx, float scY) {
-        AffineTransform t = new AffineTransform(factory);
-        t.setToScale(scx, scY);
-        return t;
-    }
-
-    public static <T extends Vertex> AffineTransform getShearInstance(Vertex.Factory<? extends Vertex> factory, float shx, float shy) {
-        AffineTransform t = new AffineTransform(factory);
-        t.setToShear(shx, shy);
-        return t;
-    }
-
-    public static <T extends Vertex> AffineTransform getRotateInstance(Vertex.Factory<? extends Vertex> factory, float angle) {
-        AffineTransform t = new AffineTransform(factory);
-        t.setToRotation(angle);
-        return t;
-    }
-
-    public static <T extends Vertex> AffineTransform getRotateInstance(Vertex.Factory<? extends Vertex> factory, float angle, float x, float y) {
-        AffineTransform t = new AffineTransform(factory);
-        t.setToRotation(angle, x, y);
-        return t;
-    }
-
-    public void translate(float mx, float my) {
-        concatenate(AffineTransform.getTranslateInstance(pointFactory, mx, my));
+    public final AffineTransform translate(final float mx, final float my, final AffineTransform tmp) {
+        return concatenate(tmp.setToTranslation(mx, my));
     }
 
-    public void scale(float scx, float scy) {
-        concatenate(AffineTransform.getScaleInstance(pointFactory, scx, scy));
+    public final AffineTransform scale(final float scx, final float scy, final AffineTransform tmp) {
+        return concatenate(tmp.setToScale(scx, scy));
     }
 
-    public void shear(float shx, float shy) {
-        concatenate(AffineTransform.getShearInstance(pointFactory, shx, shy));
+    public final AffineTransform shear(final float shx, final float shy, final AffineTransform tmp) {
+        return concatenate(tmp.setToShear(shx, shy));
     }
 
-    public void rotate(float angle) {
-        concatenate(AffineTransform.getRotateInstance(pointFactory, angle));
+    public final AffineTransform rotate(final float angle, final AffineTransform tmp) {
+        return concatenate(tmp.setToRotation(angle));
     }
 
-    public void rotate(float angle, float px, float py) {
-        concatenate(AffineTransform.getRotateInstance(pointFactory, angle, px, py));
+    public final AffineTransform rotate(final float angle, final float px, final float py, final AffineTransform tmp) {
+        return concatenate(tmp.setToRotation(angle, px, py));
     }
 
     /**
      * Multiply matrix of two AffineTransform objects.
-     * The first argument's {@link Vertex.Factory} is being used.
+     * @param tL - the AffineTransform object is a multiplicand (left argument)
+     * @param tR - the AffineTransform object is a multiplier (right argument)
      *
-     * @param t1 - the AffineTransform object is a multiplicand
-     * @param t2 - the AffineTransform object is a multiplier
-     * @return an AffineTransform object that is a result of t1 multiplied by matrix t2.
+     * @return A new AffineTransform object containing the result of [tL] X [tR].
      */
-    AffineTransform multiply(AffineTransform t1, AffineTransform t2) {
-        return new AffineTransform(t1.pointFactory,
-                t1.m00 * t2.m00 + t1.m10 * t2.m01,          // m00
-                t1.m00 * t2.m10 + t1.m10 * t2.m11,          // m01
-                t1.m01 * t2.m00 + t1.m11 * t2.m01,          // m10
-                t1.m01 * t2.m10 + t1.m11 * t2.m11,          // m11
-                t1.m02 * t2.m00 + t1.m12 * t2.m01 + t2.m02, // m02
-                t1.m02 * t2.m10 + t1.m12 * t2.m11 + t2.m12);// m12
-    }
-
-    public void concatenate(AffineTransform t) {
-        setTransform(multiply(t, this));
+    public final static AffineTransform multiply(final AffineTransform tL, final AffineTransform tR) {
+        return new AffineTransform(
+                tR.m00 * tL.m00 + tR.m10 * tL.m01,          // m00
+                tR.m00 * tL.m10 + tR.m10 * tL.m11,          // m10
+                tR.m01 * tL.m00 + tR.m11 * tL.m01,          // m01
+                tR.m01 * tL.m10 + tR.m11 * tL.m11,          // m11
+                tR.m02 * tL.m00 + tR.m12 * tL.m01 + tL.m02, // m02
+                tR.m02 * tL.m10 + tR.m12 * tL.m11 + tL.m12);// m12
     }
 
-    public void preConcatenate(AffineTransform t) {
-        setTransform(multiply(this, t));
+    /**
+     * Concatenates the given matrix to this.
+     * <p>
+     * Implementations performs the matrix multiplication:
+     * <pre>
+     *   [this] = [this] X [tR]
+     * </pre>
+     * </p>
+     * @param tR the right-argument of the matrix multiplication
+     * @return this transform for chaining
+     */
+    public final AffineTransform concatenate(final AffineTransform tR) {
+        // setTransform(multiply(this, tR));
+        type = TYPE_UNKNOWN;
+        setTransform(
+                tR.m00 * m00 + tR.m10 * m01,       // m00
+                tR.m00 * m10 + tR.m10 * m11,       // m10
+                tR.m01 * m00 + tR.m11 * m01,       // m01
+                tR.m01 * m10 + tR.m11 * m11,       // m11
+                tR.m02 * m00 + tR.m12 * m01 + m02, // m02
+                tR.m02 * m10 + tR.m12 * m11 + m12);// m12
+        return this;
     }
 
-    public AffineTransform createInverse() throws NoninvertibleTransformException {
-        float det = getDeterminant();
+    /**
+     * Pre-concatenates the given matrix to this.
+     * <p>
+     * Implementations performs the matrix multiplication:
+     * <pre>
+     *   [this] = [tL] X [this]
+     * </pre>
+     * </p>
+     * @param tL the left-argument of the matrix multiplication
+     * @return this transform for chaining
+     */
+    public final AffineTransform preConcatenate(final AffineTransform tL) {
+        // setTransform(multiply(tL, this));
+        type = TYPE_UNKNOWN;
+        setTransform(
+                m00 * tL.m00 + m10 * tL.m01,          // m00
+                m00 * tL.m10 + m10 * tL.m11,          // m10
+                m01 * tL.m00 + m11 * tL.m01,          // m01
+                m01 * tL.m10 + m11 * tL.m11,          // m11
+                m02 * tL.m00 + m12 * tL.m01 + tL.m02, // m02
+                m02 * tL.m10 + m12 * tL.m11 + tL.m12);// m12
+        return this;
+    }
+
+    public final AffineTransform createInverse() throws NoninvertibleTransformException {
+        final float det = getDeterminant();
         if (FloatUtil.abs(det) < ZERO) {
             throw new NoninvertibleTransformException(determinantIsZero);
         }
         return new AffineTransform(
-                this.pointFactory,
                  m11 / det, // m00
                 -m10 / det, // m10
                 -m01 / det, // m01
@@ -401,33 +397,67 @@ public class AffineTransform implements Cloneable, Serializable {
         );
     }
 
-    public Vertex transform(Vertex src, Vertex dst) {
-        if (dst == null) {
-            dst = pointFactory.create();
-        }
-
-        float x = src.getX();
-        float y = src.getY();
+    /**
+     *
+     * @param src
+     * @param dst
+     * @return dst for chaining
+     */
+    public final AABBox transform(final AABBox src, final AABBox dst) {
+        final float[] srcLo = src.getLow();
+        final float[] srcHi = src.getHigh();
+        dst.setSize(srcLo[0] * m00 + srcLo[1] * m01 + m02, srcLo[0] * m10 + srcLo[1] * m11 + m12, srcLo[2],
+                    srcHi[0] * m00 + srcHi[1] * m01 + m02, srcHi[0] * m10 + srcHi[1] * m11 + m12, srcHi[2]);
+        return dst;
+    }
 
-        dst.setCoord(x * m00 + y * m01 + m02, x * m10 + y * m11 + m12, 0f);
+    /**
+     * @param src
+     * @param dst
+     * @return dst for chaining
+     */
+    public final Vertex transform(final Vertex src, final Vertex dst) {
+        final float x = src.getX();
+        final float y = src.getY();
+        dst.setCoord(x * m00 + y * m01 + m02, x * m10 + y * m11 + m12, src.getZ());
         return dst;
     }
 
-    public void transform(Vertex[] src, int srcOff, Vertex[] dst, int dstOff, int length) {
+    public final void transform(final Vertex[] src, int srcOff, final Vertex[] dst, int dstOff, int length) {
         while (--length >= 0) {
-            Vertex srcPoint = src[srcOff++];
-            float x = srcPoint.getX();
-            float y = srcPoint.getY();
-            Vertex dstPoint = dst[dstOff];
+            final Vertex srcPoint = src[srcOff++];
+            final Vertex dstPoint = dst[dstOff];
             if (dstPoint == null) {
                 throw new IllegalArgumentException("dst["+dstOff+"] is null");
             }
-            dstPoint.setCoord(x * m00 + y * m01 + m02, x * m10 + y * m11 + m12, 0f);
+            final float x = srcPoint.getX();
+            final float y = srcPoint.getY();
+            dstPoint.setCoord(x * m00 + y * m01 + m02, x * m10 + y * m11 + m12, srcPoint.getZ());
             dst[dstOff++] = dstPoint;
         }
     }
 
-    public void transform(float[] src, int srcOff, float[] dst, int dstOff, int length) {
+    /**
+     * @param src float[2] source of transformation
+     * @param dst float[2] destination of transformation, maybe be equal to <code>src</code>
+     * @return dst for chaining
+     */
+    public final float[] transform(final float[] src, final float[] dst) {
+        final float x = src[0];
+        final float y = src[1];
+        dst[0] = x * m00 + y * m01 + m02;
+        dst[1] = x * m10 + y * m11 + m12;
+        return dst;
+    }
+
+    public final void transform(final float[] src, final int srcOff, final float[] dst, final int dstOff) {
+        final float x = src[srcOff + 0];
+        final float y = src[srcOff + 1];
+        dst[dstOff + 0] = x * m00 + y * m01 + m02;
+        dst[dstOff + 1] = x * m10 + y * m11 + m12;
+    }
+
+    public final void transform(final float[] src, int srcOff, final float[] dst, int dstOff, int length) {
         int step = 2;
         if (src == dst && srcOff < dstOff && dstOff < srcOff + length * 2) {
             srcOff = srcOff + length * 2 - 2;
@@ -435,8 +465,8 @@ public class AffineTransform implements Cloneable, Serializable {
             step = -2;
         }
         while (--length >= 0) {
-            float x = src[srcOff + 0];
-            float y = src[srcOff + 1];
+            final float x = src[srcOff + 0];
+            final float y = src[srcOff + 1];
             dst[dstOff + 0] = x * m00 + y * m01 + m02;
             dst[dstOff + 1] = x * m10 + y * m11 + m12;
             srcOff += step;
@@ -444,74 +474,78 @@ public class AffineTransform implements Cloneable, Serializable {
         }
     }
 
-    public Vertex deltaTransform(Vertex src, Vertex dst) {
-        if (dst == null) {
-            dst = pointFactory.create();
-        }
-
-        float x = src.getX();
-        float y = src.getY();
-
-        dst.setCoord(x * m00 + y * m01, x * m10 + y * m11, 0f);
+    /**
+     *
+     * @param src
+     * @param dst
+     * @return return dst for chaining
+     */
+    public final Vertex deltaTransform(final Vertex src, final Vertex dst) {
+        final float x = src.getX();
+        final float y = src.getY();
+        dst.setCoord(x * m00 + y * m01, x * m10 + y * m11, src.getZ());
         return dst;
     }
 
-    public void deltaTransform(float[] src, int srcOff, float[] dst, int dstOff, int length) {
+    public final void deltaTransform(final float[] src, int srcOff, final float[] dst, int dstOff, int length) {
         while (--length >= 0) {
-            float x = src[srcOff++];
-            float y = src[srcOff++];
+            final float x = src[srcOff++];
+            final float y = src[srcOff++];
             dst[dstOff++] = x * m00 + y * m01;
             dst[dstOff++] = x * m10 + y * m11;
         }
     }
 
-    public Vertex inverseTransform(Vertex src, Vertex dst) throws NoninvertibleTransformException {
-        float det = getDeterminant();
+    /**
+     *
+     * @param src
+     * @param dst
+     * @return return dst for chaining
+     * @throws NoninvertibleTransformException
+     */
+    public final Vertex inverseTransform(final Vertex src, final Vertex dst) throws NoninvertibleTransformException {
+        final float det = getDeterminant();
         if (FloatUtil.abs(det) < ZERO) {
             throw new NoninvertibleTransformException(determinantIsZero);
         }
-        if (dst == null) {
-            dst = pointFactory.create();
-        }
-
-        float x = src.getX() - m02;
-        float y = src.getY() - m12;
-
-        dst.setCoord((x * m11 - y * m01) / det, (y * m00 - x * m10) / det, 0f);
+        final float x = src.getX() - m02;
+        final float y = src.getY() - m12;
+        dst.setCoord((x * m11 - y * m01) / det, (y * m00 - x * m10) / det, src.getZ());
         return dst;
     }
 
-    public void inverseTransform(float[] src, int srcOff, float[] dst, int dstOff, int length)
+    public final void inverseTransform(final float[] src, int srcOff, final float[] dst, int dstOff, int length)
         throws NoninvertibleTransformException
     {
-        float det = getDeterminant();
+        final float det = getDeterminant();
         if (FloatUtil.abs(det) < ZERO) {
             throw new NoninvertibleTransformException(determinantIsZero);
         }
 
         while (--length >= 0) {
-            float x = src[srcOff++] - m02;
-            float y = src[srcOff++] - m12;
+            final float x = src[srcOff++] - m02;
+            final float y = src[srcOff++] - m12;
             dst[dstOff++] = (x * m11 - y * m01) / det;
             dst[dstOff++] = (y * m00 - x * m10) / det;
         }
     }
 
-    public Path2D createTransformedShape(Path2D src) {
+    public final Path2D createTransformedShape(final Path2D src) {
         if (src == null) {
             return null;
         }
-        if (src instanceof Path2D) {
-            return ((Path2D)src).createTransformedShape(this);
-        }
-        PathIterator path = src.iterator(this);
-        Path2D dst = new Path2D(path.getWindingRule());
-        dst.append(path, false);
-        return dst;
+        return src.createTransformedShape(this);
+        /**
+         * If !(src instanceof Path2D): (but here it always is)
+            final PathIterator path = src.iterator(this);
+            final Path2D dst = new Path2D(path.getWindingRule());
+            dst.append(path, false);
+            return dst;
+         */
     }
 
     @Override
-    public String toString() {
+    public final String toString() {
         return
             getClass().getName() +
             "[[" + m00 + ", " + m01 + ", " + m02 + "], [" //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
@@ -519,10 +553,10 @@ public class AffineTransform implements Cloneable, Serializable {
     }
 
     @Override
-    public AffineTransform clone() {
+    public final AffineTransform clone() {
         try {
             return (AffineTransform) super.clone();
-        } catch (CloneNotSupportedException e) {
+        } catch (final CloneNotSupportedException e) {
             throw new InternalError();
         }
     }
@@ -540,12 +574,12 @@ public class AffineTransform implements Cloneable, Serializable {
     } */
 
     @Override
-    public boolean equals(Object obj) {
+    public final boolean equals(final Object obj) {
         if (obj == this) {
             return true;
         }
         if (obj instanceof AffineTransform) {
-            AffineTransform t = (AffineTransform)obj;
+            final AffineTransform t = (AffineTransform)obj;
             return
                 m00 == t.m00 && m01 == t.m01 &&
                 m02 == t.m02 && m10 == t.m10 &&
@@ -553,28 +587,9 @@ public class AffineTransform implements Cloneable, Serializable {
         }
         return false;
     }
-
-
-    /**
-     * Write AffineTrasform object to the output steam.
-     * @param stream - the output stream
-     * @throws IOException - if there are I/O errors while writing to the output strem
-     */
-    private void writeObject(java.io.ObjectOutputStream stream) throws IOException {
-        stream.defaultWriteObject();
-    }
-
-
-    /**
-     * Read AffineTransform object from the input stream
-     * @param stream - the input steam
-     * @throws IOException - if there are I/O errors while reading from the input strem
-     * @throws ClassNotFoundException - if class could not be found
-     */
-    private void readObject(java.io.ObjectInputStream stream) throws IOException, ClassNotFoundException {
-        stream.defaultReadObject();
-        type = TYPE_UNKNOWN;
+    @Override
+    public final int hashCode() {
+        throw new InternalError("hashCode not designed");
     }
-
 }
 
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java b/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java
index 4ee0c25..2ae9d18 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/Crossing.java
@@ -51,10 +51,10 @@ public class Crossing {
      * @param res - the roots of the equation
      * @return a number of roots
      */
-    public static int solveQuad(float eqn[], float res[]) {
-        float a = eqn[2];
-        float b = eqn[1];
-        float c = eqn[0];
+    public static int solveQuad(final float eqn[], final float res[]) {
+        final float a = eqn[2];
+        final float b = eqn[1];
+        final float c = eqn[0];
         int rc = 0;
         if (a == 0.0) {
             if (b == 0.0) {
@@ -83,26 +83,26 @@ public class Crossing {
      * @param res - the roots of the equation
      * @return a number of roots
      */
-    public static int solveCubic(float eqn[], float res[]) {
-        float d = eqn[3];
+    public static int solveCubic(final float eqn[], final float res[]) {
+        final float d = eqn[3];
         if (d == 0) {
             return solveQuad(eqn, res);
         }
-        float a = eqn[2] / d;
-        float b = eqn[1] / d;
-        float c = eqn[0] / d;
+        final float a = eqn[2] / d;
+        final float b = eqn[1] / d;
+        final float c = eqn[0] / d;
         int rc = 0;
 
-        float Q = (a * a - 3.0f * b) / 9.0f;
-        float R = (2.0f * a * a * a - 9.0f * a * b + 27.0f * c) / 54.0f;
-        float Q3 = Q * Q * Q;
-        float R2 = R * R;
-        float n = - a / 3.0f;
+        final float Q = (a * a - 3.0f * b) / 9.0f;
+        final float R = (2.0f * a * a * a - 9.0f * a * b + 27.0f * c) / 54.0f;
+        final float Q3 = Q * Q * Q;
+        final float R2 = R * R;
+        final float n = - a / 3.0f;
 
         if (R2 < Q3) {
-            float t = FloatUtil.acos(R / FloatUtil.sqrt(Q3)) / 3.0f;
-            float p = 2.0f * FloatUtil.PI / 3.0f;
-            float m = -2.0f * FloatUtil.sqrt(Q);
+            final float t = FloatUtil.acos(R / FloatUtil.sqrt(Q3)) / 3.0f;
+            final float p = 2.0f * FloatUtil.PI / 3.0f;
+            final float m = -2.0f * FloatUtil.sqrt(Q);
             res[rc++] = m * FloatUtil.cos(t) + n;
             res[rc++] = m * FloatUtil.cos(t + p) + n;
             res[rc++] = m * FloatUtil.cos(t - p) + n;
@@ -116,10 +116,10 @@ public class Crossing {
             if (-ROOT_DELTA < A && A < ROOT_DELTA) {
                 res[rc++] = n;
             } else {
-                float B = Q / A;
+                final float B = Q / A;
                 res[rc++] = A + B + n;
 //              if (R2 == Q3) {
-                float delta = R2 - Q3;
+                final float delta = R2 - Q3;
                 if (-ROOT_DELTA < delta && delta < ROOT_DELTA) {
                     res[rc++] = - (A + B) / 2.0f + n;
                 }
@@ -135,7 +135,7 @@ public class Crossing {
      * @param rc - the roots count
      * @return new roots count
      */
-    static int fixRoots(float res[], int rc) {
+    static int fixRoots(final float res[], final int rc) {
         int tc = 0;
         for(int i = 0; i < rc; i++) {
             out: {
@@ -158,7 +158,7 @@ public class Crossing {
         float ax, ay, bx, by;
         float Ax, Ay, Bx, By;
 
-        public QuadCurve(float x1, float y1, float cx, float cy, float x2, float y2) {
+        public QuadCurve(final float x1, final float y1, final float cx, final float cy, final float x2, final float y2) {
             ax = x2 - x1;
             ay = y2 - y1;
             bx = cx - x1;
@@ -171,11 +171,11 @@ public class Crossing {
             Ay = ay - By;   // Ay = ay - 2.0 * by
         }
 
-        int cross(float res[], int rc, float py1, float py2) {
+        int cross(final float res[], final int rc, final float py1, final float py2) {
             int cross = 0;
 
             for (int i = 0; i < rc; i++) {
-                float t = res[i];
+                final float t = res[i];
 
                 // CURVE-OUTSIDE
                 if (t < -DELTA || t > 1 + DELTA) {
@@ -190,16 +190,17 @@ public class Crossing {
                 }
                 // CURVE-END
                 if (t > 1 - DELTA) {
+                    // FIXME: consider using FloatUtil.isEqual(ax, bx, epsilon), ...
                     if (py1 < ay && (ax != bx ? ax - bx : bx) > 0.0) {
                         cross++;
                     }
                     continue;
                 }
                 // CURVE-INSIDE
-                float ry = t * (t * Ay + By);
+                final float ry = t * (t * Ay + By);
                 // ry = t * t * Ay + t * By
                 if (ry > py2) {
-                    float rxt = t * Ax + bx;
+                    final float rxt = t * Ax + bx;
                     // rxt = 2.0 * t * Ax + Bx = 2.0 * t * Ax + 2.0 * bx
                     if (rxt > -DELTA && rxt < DELTA) {
                         continue;
@@ -211,12 +212,12 @@ public class Crossing {
             return cross;
         }
 
-        int solvePoint(float res[], float px) {
-            float eqn[] = {-px, Bx, Ax};
+        int solvePoint(final float res[], final float px) {
+            final float eqn[] = {-px, Bx, Ax};
             return solveQuad(eqn, res);
         }
 
-        int solveExtrem(float res[]) {
+        int solveExtrem(final float res[]) {
             int rc = 0;
             if (Ax != 0.0) {
                 res[rc++] = - Bx / (Ax + Ax);
@@ -227,11 +228,11 @@ public class Crossing {
             return rc;
         }
 
-        int addBound(float bound[], int bc, float res[], int rc, float minX, float maxX, boolean changeId, int id) {
+        int addBound(final float bound[], int bc, final float res[], final int rc, final float minX, final float maxX, final boolean changeId, int id) {
             for(int i = 0; i < rc; i++) {
-                float t = res[i];
+                final float t = res[i];
                 if (t > -DELTA && t < 1 + DELTA) {
-                    float rx = t * (t * Ax + Bx);
+                    final float rx = t * (t * Ax + Bx);
                     if (minX <= rx && rx <= maxX) {
                         bound[bc++] = t;
                         bound[bc++] = rx;
@@ -257,7 +258,7 @@ public class Crossing {
         float Ax, Ay, Bx, By, Cx, Cy;
         float Ax3, Bx2;
 
-        public CubicCurve(float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2) {
+        public CubicCurve(final float x1, final float y1, final float cx1, final float cy1, final float cx2, final float cy2, final float x2, final float y2) {
             ax = x2 - x1;
             ay = y2 - y1;
             bx = cx1 - x1;
@@ -277,10 +278,10 @@ public class Crossing {
             Bx2 = Bx + Bx;
         }
 
-        int cross(float res[], int rc, float py1, float py2) {
+        int cross(final float res[], final int rc, final float py1, final float py2) {
             int cross = 0;
             for (int i = 0; i < rc; i++) {
-                float t = res[i];
+                final float t = res[i];
 
                 // CURVE-OUTSIDE
                 if (t < -DELTA || t > 1 + DELTA) {
@@ -288,6 +289,7 @@ public class Crossing {
                 }
                 // CURVE-START
                 if (t < DELTA) {
+                    // FIXME: consider using FloatUtil.isZero(bx, epsilon), ...
                     if (py1 < 0.0 && (bx != 0.0 ? bx : (cx != bx ? cx - bx : ax - cx)) < 0.0) {
                         cross--;
                     }
@@ -301,7 +303,7 @@ public class Crossing {
                     continue;
                 }
                 // CURVE-INSIDE
-                float ry = t * (t * (t * Ay + By) + Cy);
+                final float ry = t * (t * (t * Ay + By) + Cy);
                 // ry = t * t * t * Ay + t * t * By + t * Cy
                 if (ry > py2) {
                     float rxt = t * (t * Ax3 + Bx2) + Cx;
@@ -322,26 +324,26 @@ public class Crossing {
             return cross;
         }
 
-        int solvePoint(float res[], float px) {
-            float eqn[] = {-px, Cx, Bx, Ax};
+        int solvePoint(final float res[], final float px) {
+            final float eqn[] = {-px, Cx, Bx, Ax};
             return solveCubic(eqn, res);
         }
 
-        int solveExtremX(float res[]) {
-            float eqn[] = {Cx, Bx2, Ax3};
+        int solveExtremX(final float res[]) {
+            final float eqn[] = {Cx, Bx2, Ax3};
             return solveQuad(eqn, res);
         }
 
-        int solveExtremY(float res[]) {
-            float eqn[] = {Cy, By + By, Ay + Ay + Ay};
+        int solveExtremY(final float res[]) {
+            final float eqn[] = {Cy, By + By, Ay + Ay + Ay};
             return solveQuad(eqn, res);
         }
 
-        int addBound(float bound[], int bc, float res[], int rc, float minX, float maxX, boolean changeId, int id) {
+        int addBound(final float bound[], int bc, final float res[], final int rc, final float minX, final float maxX, final boolean changeId, int id) {
             for(int i = 0; i < rc; i++) {
-                float t = res[i];
+                final float t = res[i];
                 if (t > -DELTA && t < 1 + DELTA) {
-                    float rx = t * (t * (t * Ax + Bx) + Cx);
+                    final float rx = t * (t * (t * Ax + Bx) + Cx);
                     if (minX <= rx && rx <= maxX) {
                         bound[bc++] = t;
                         bound[bc++] = rx;
@@ -361,7 +363,7 @@ public class Crossing {
     /**
      * Returns how many times ray from point (x,y) cross line.
      */
-    public static int crossLine(float x1, float y1, float x2, float y2, float x, float y) {
+    public static int crossLine(final float x1, final float y1, final float x2, final float y2, final float x, final float y) {
 
         // LEFT/RIGHT/UP/EMPTY
         if ((x < x1 && x < x2) ||
@@ -399,7 +401,7 @@ public class Crossing {
     /**
      * Returns how many times ray from point (x,y) cross quard curve
      */
-    public static int crossQuad(float x1, float y1, float cx, float cy, float x2, float y2, float x, float y) {
+    public static int crossQuad(final float x1, final float y1, final float cx, final float cy, final float x2, final float y2, final float x, final float y) {
 
         // LEFT/RIGHT/UP/EMPTY
         if ((x < x1 && x < cx && x < x2) ||
@@ -419,11 +421,11 @@ public class Crossing {
         }
 
         // INSIDE
-        QuadCurve c = new QuadCurve(x1, y1, cx, cy, x2, y2);
-        float px = x - x1;
-        float py = y - y1;
-        float res[] = new float[3];
-        int rc = c.solvePoint(res, px);
+        final QuadCurve c = new QuadCurve(x1, y1, cx, cy, x2, y2);
+        final float px = x - x1;
+        final float py = y - y1;
+        final float res[] = new float[3];
+        final int rc = c.solvePoint(res, px);
 
         return c.cross(res, rc, py, py);
     }
@@ -431,7 +433,7 @@ public class Crossing {
     /**
      * Returns how many times ray from point (x,y) cross cubic curve
      */
-    public static int crossCubic(float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, float x, float y) {
+    public static int crossCubic(final float x1, final float y1, final float cx1, final float cy1, final float cx2, final float cy2, final float x2, final float y2, final float x, final float y) {
 
         // LEFT/RIGHT/UP/EMPTY
         if ((x < x1 && x < cx1 && x < cx2 && x < x2) ||
@@ -451,18 +453,18 @@ public class Crossing {
         }
 
         // INSIDE
-        CubicCurve c = new CubicCurve(x1, y1, cx1, cy1, cx2, cy2, x2, y2);
-        float px = x - x1;
-        float py = y - y1;
-        float res[] = new float[3];
-        int rc = c.solvePoint(res, px);
+        final CubicCurve c = new CubicCurve(x1, y1, cx1, cy1, cx2, cy2, x2, y2);
+        final float px = x - x1;
+        final float py = y - y1;
+        final float res[] = new float[3];
+        final int rc = c.solvePoint(res, px);
         return c.cross(res, rc, py, py);
     }
 
     /**
      * Returns how many times ray from point (x,y) cross path
      */
-    public static int crossPath(PathIterator p, float x, float y) {
+    public static int crossPath(final PathIterator p, final float x, final float y) {
         int cross = 0;
         float mx, my, cx, cy;
         mx = my = cx = cy = 0.0f;
@@ -513,7 +515,7 @@ public class Crossing {
     /**
      * Returns how many times ray from point (x,y) cross shape
      */
-    public static int crossShape(Path2D s, float x, float y) {
+    public static int crossShape(final Path2D s, final float x, final float y) {
         if (!s.getBounds2D().contains(x, y)) {
             return 0;
         }
@@ -523,14 +525,14 @@ public class Crossing {
     /**
      * Returns true if value enough small
      */
-    public static boolean isZero(float val) {
+    public static boolean isZero(final float val) {
         return -DELTA < val && val < DELTA;
     }
 
     /**
      * Sort bound array
      */
-    static void sortBound(float bound[], int bc) {
+    static void sortBound(final float bound[], final int bc) {
         for(int i = 0; i < bc - 4; i += 4) {
             int k = i;
             for(int j = i + 4; j < bc; j += 4) {
@@ -558,7 +560,7 @@ public class Crossing {
     /**
      * Returns are bounds intersect or not intersect rectangle
      */
-    static int crossBound(float bound[], int bc, float py1, float py2) {
+    static int crossBound(final float bound[], final int bc, final float py1, final float py2) {
 
         // LEFT/RIGHT
         if (bc == 0) {
@@ -590,7 +592,7 @@ public class Crossing {
             sortBound(bound, bc);
             boolean sign = bound[2] > py2;
             for(int i = 6; i < bc; i += 4) {
-                boolean sign2 = bound[i] > py2;
+                final boolean sign2 = bound[i] > py2;
                 if (sign != sign2 && bound[i + 1] != bound[i - 3]) {
                     return CROSSING;
                 }
@@ -603,7 +605,7 @@ public class Crossing {
     /**
      * Returns how many times rectangle stripe cross line or the are intersect
      */
-    public static int intersectLine(float x1, float y1, float x2, float y2, float rx1, float ry1, float rx2, float ry2) {
+    public static int intersectLine(final float x1, final float y1, final float x2, final float y2, final float rx1, final float ry1, final float rx2, final float ry2) {
 
         // LEFT/RIGHT/UP
         if ((rx2 < x1 && rx2 < x2) ||
@@ -631,9 +633,9 @@ public class Crossing {
                 bx1 = x2 < rx1 ? rx1 : x2;
                 bx2 = x1 < rx2 ? x1 : rx2;
             }
-            float k = (y2 - y1) / (x2 - x1);
-            float by1 = k * (bx1 - x1) + y1;
-            float by2 = k * (bx2 - x1) + y1;
+            final float k = (y2 - y1) / (x2 - x1);
+            final float by1 = k * (bx1 - x1) + y1;
+            final float by2 = k * (bx2 - x1) + y1;
 
             // BOUND-UP
             if (by1 < ry1 && by2 < ry1) {
@@ -672,7 +674,7 @@ public class Crossing {
     /**
      * Returns how many times rectangle stripe cross quad curve or the are intersect
      */
-    public static int intersectQuad(float x1, float y1, float cx, float cy, float x2, float y2, float rx1, float ry1, float rx2, float ry2) {
+    public static int intersectQuad(final float x1, final float y1, final float cx, final float cy, final float x2, final float y2, final float rx1, final float ry1, final float rx2, final float ry2) {
 
         // LEFT/RIGHT/UP ------------------------------------------------------
         if ((rx2 < x1 && rx2 < cx && rx2 < x2) ||
@@ -691,15 +693,15 @@ public class Crossing {
         }
 
         // INSIDE -------------------------------------------------------------
-        QuadCurve c = new QuadCurve(x1, y1, cx, cy, x2, y2);
-        float px1 = rx1 - x1;
-        float py1 = ry1 - y1;
-        float px2 = rx2 - x1;
-        float py2 = ry2 - y1;
-
-        float res1[] = new float[3];
-        float res2[] = new float[3];
-        int rc1 = c.solvePoint(res1, px1);
+        final QuadCurve c = new QuadCurve(x1, y1, cx, cy, x2, y2);
+        final float px1 = rx1 - x1;
+        final float py1 = ry1 - y1;
+        final float px2 = rx2 - x1;
+        final float py2 = ry2 - y1;
+
+        final float res1[] = new float[3];
+        final float res2[] = new float[3];
+        final int rc1 = c.solvePoint(res1, px1);
         int rc2 = c.solvePoint(res2, px2);
 
         // INSIDE-LEFT/RIGHT
@@ -708,9 +710,9 @@ public class Crossing {
         }
 
         // Build bound --------------------------------------------------------
-        float minX = px1 - DELTA;
-        float maxX = px2 + DELTA;
-        float bound[] = new float[28];
+        final float minX = px1 - DELTA;
+        final float maxX = px2 + DELTA;
+        final float bound[] = new float[28];
         int bc = 0;
         // Add roots
         bc = c.addBound(bound, bc, res1, rc1, minX, maxX, false, 0);
@@ -733,7 +735,7 @@ public class Crossing {
         }
         // End build bound ----------------------------------------------------
 
-        int cross = crossBound(bound, bc, py1, py2);
+        final int cross = crossBound(bound, bc, py1, py2);
         if (cross != UNKNOWN) {
             return cross;
         }
@@ -743,7 +745,7 @@ public class Crossing {
     /**
      * Returns how many times rectangle stripe cross cubic curve or the are intersect
      */
-    public static int intersectCubic(float x1, float y1, float cx1, float cy1, float cx2, float cy2, float x2, float y2, float rx1, float ry1, float rx2, float ry2) {
+    public static int intersectCubic(final float x1, final float y1, final float cx1, final float cy1, final float cx2, final float cy2, final float x2, final float y2, final float rx1, final float ry1, final float rx2, final float ry2) {
 
         // LEFT/RIGHT/UP
         if ((rx2 < x1 && rx2 < cx1 && rx2 < cx2 && rx2 < x2) ||
@@ -762,15 +764,15 @@ public class Crossing {
         }
 
         // INSIDE
-        CubicCurve c = new CubicCurve(x1, y1, cx1, cy1, cx2, cy2, x2, y2);
-        float px1 = rx1 - x1;
-        float py1 = ry1 - y1;
-        float px2 = rx2 - x1;
-        float py2 = ry2 - y1;
-
-        float res1[] = new float[3];
-        float res2[] = new float[3];
-        int rc1 = c.solvePoint(res1, px1);
+        final CubicCurve c = new CubicCurve(x1, y1, cx1, cy1, cx2, cy2, x2, y2);
+        final float px1 = rx1 - x1;
+        final float py1 = ry1 - y1;
+        final float px2 = rx2 - x1;
+        final float py2 = ry2 - y1;
+
+        final float res1[] = new float[3];
+        final float res2[] = new float[3];
+        final int rc1 = c.solvePoint(res1, px1);
         int rc2 = c.solvePoint(res2, px2);
 
         // LEFT/RIGHT
@@ -778,11 +780,11 @@ public class Crossing {
             return 0;
         }
 
-        float minX = px1 - DELTA;
-        float maxX = px2 + DELTA;
+        final float minX = px1 - DELTA;
+        final float maxX = px2 + DELTA;
 
         // Build bound --------------------------------------------------------
-        float bound[] = new float[40];
+        final float bound[] = new float[40];
         int bc = 0;
         // Add roots
         bc = c.addBound(bound, bc, res1, rc1, minX, maxX, false, 0);
@@ -807,7 +809,7 @@ public class Crossing {
         }
         // End build bound ----------------------------------------------------
 
-        int cross = crossBound(bound, bc, py1, py2);
+        final int cross = crossBound(bound, bc, py1, py2);
         if (cross != UNKNOWN) {
             return cross;
         }
@@ -817,7 +819,7 @@ public class Crossing {
     /**
      * Returns how many times rectangle stripe cross path or the are intersect
      */
-    public static int intersectPath(PathIterator p, float x, float y, float w, float h) {
+    public static int intersectPath(final PathIterator p, final float x, final float y, final float w, final float h) {
 
         int cross = 0;
         int count;
@@ -825,10 +827,10 @@ public class Crossing {
         mx = my = cx = cy = 0.0f;
         final float coords[] = new float[6];
 
-        float rx1 = x;
-        float ry1 = y;
-        float rx2 = x + w;
-        float ry2 = y + h;
+        final float rx1 = x;
+        final float ry1 = y;
+        final float rx2 = x + w;
+        final float ry2 = y + h;
 
         while (!p.isDone()) {
             count = 0;
@@ -879,8 +881,8 @@ public class Crossing {
     /**
      * Returns how many times rectangle stripe cross shape or the are intersect
      */
-    public static int intersectShape(Path2D s, float x, float y, float w, float h) {
-        if (!s.getBounds2D().intersects(x, y, w, h)) {
+    public static int intersectShape(final Path2D s, final float x, final float y, final float w, final float h) {
+        if (!s.getBounds2D().intersects2DRegion(x, y, w, h)) {
             return 0;
         }
         return intersectPath(s.iterator(null), x, y, w, h);
@@ -889,14 +891,14 @@ public class Crossing {
     /**
      * Returns true if cross count correspond inside location for non zero path rule
      */
-    public static boolean isInsideNonZero(int cross) {
+    public static boolean isInsideNonZero(final int cross) {
         return cross != 0;
     }
 
     /**
      * Returns true if cross count correspond inside location for even-odd path rule
      */
-    public static boolean isInsideEvenOdd(int cross) {
+    public static boolean isInsideEvenOdd(final int cross) {
         return (cross & 1) != 0;
     }
 }
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/IllegalPathStateException.java b/src/jogl/classes/jogamp/graph/geom/plane/IllegalPathStateException.java
index 55211b3..2c18e08 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/IllegalPathStateException.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/IllegalPathStateException.java
@@ -26,7 +26,7 @@ public class IllegalPathStateException extends RuntimeException {
     public IllegalPathStateException() {
     }
 
-    public IllegalPathStateException(String s) {
+    public IllegalPathStateException(final String s) {
         super(s);
     }
 
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/NoninvertibleTransformException.java b/src/jogl/classes/jogamp/graph/geom/plane/NoninvertibleTransformException.java
index 398a03f..6e49607 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/NoninvertibleTransformException.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/NoninvertibleTransformException.java
@@ -23,7 +23,7 @@ public class NoninvertibleTransformException extends java.lang.Exception {
 
     private static final long serialVersionUID = 6137225240503990466L;
 
-    public NoninvertibleTransformException(String s) {
+    public NoninvertibleTransformException(final String s) {
         super(s);
     }
 
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
index 33b80d6..191b191 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
@@ -21,8 +21,8 @@ package jogamp.graph.geom.plane;
 
 import java.util.NoSuchElementException;
 
+import com.jogamp.graph.geom.SVertex;
 import com.jogamp.graph.geom.Vertex;
-import com.jogamp.graph.geom.opengl.SVertex;
 import com.jogamp.opengl.math.geom.AABBox;
 
 
@@ -82,7 +82,7 @@ public final class Path2D implements Cloneable {
     /*
      * GeneralPath path iterator
      */
-    class Iterator implements PathIterator {
+    static class Iterator implements PathIterator {
 
         /**
          * The current cursor position in types buffer
@@ -108,7 +108,7 @@ public final class Path2D implements Cloneable {
          * Constructs a new GeneralPath.Iterator for given general path
          * @param path - the source GeneralPath object
          */
-        Iterator(Path2D path) {
+        Iterator(final Path2D path) {
             this(path, null);
         }
 
@@ -117,7 +117,7 @@ public final class Path2D implements Cloneable {
          * @param path - the source GeneralPath object
          * @param at - the AffineTransform object to apply rectangle path
          */
-        Iterator(Path2D path, AffineTransform at) {
+        Iterator(final Path2D path, final AffineTransform at) {
             this.p = path;
             this.t = at;
         }
@@ -138,12 +138,12 @@ public final class Path2D implements Cloneable {
         }
 
         @Override
-        public int currentSegment(float[] coords) {
+        public int currentSegment(final float[] coords) {
             if (isDone()) {
                 throw new NoSuchElementException(iteratorOutOfBounds);
             }
-            int type = p.types[typeIndex];
-            int count = Path2D.pointShift[type];
+            final int type = p.types[typeIndex];
+            final int count = Path2D.pointShift[type];
             System.arraycopy(p.points, pointIndex, coords, 0, count);
             if (t != null) {
                 t.transform(coords, 0, coords, 0, count / 2);
@@ -158,24 +158,24 @@ public final class Path2D implements Cloneable {
         this(WIND_NON_ZERO, BUFFER_SIZE);
     }
 
-    public Path2D(int rule) {
+    public Path2D(final int rule) {
         this(rule, BUFFER_SIZE);
     }
 
-    public Path2D(int rule, int initialCapacity) {
+    public Path2D(final int rule, final int initialCapacity) {
         setWindingRule(rule);
         types = new byte[initialCapacity];
         points = new float[initialCapacity * 2];
     }
 
-    public Path2D(Path2D path) {
+    public Path2D(final Path2D path) {
         this(WIND_NON_ZERO, BUFFER_SIZE);
-        PathIterator p = path.iterator(null);
+        final PathIterator p = path.iterator(null);
         setWindingRule(p.getWindingRule());
         append(p, false);
     }
 
-    public void setWindingRule(int rule) {
+    public void setWindingRule(final int rule) {
         if (rule != WIND_EVEN_ODD && rule != WIND_NON_ZERO) {
             throw new NoSuchElementException(invalidWindingRuleValue);
         }
@@ -190,23 +190,23 @@ public final class Path2D implements Cloneable {
      * Checks points and types buffer size to add pointCount points. If necessary realloc buffers to enlarge size.
      * @param pointCount - the point count to be added in buffer
      */
-    void checkBuf(int pointCount, boolean checkMove) {
+    void checkBuf(final int pointCount, final boolean checkMove) {
         if (checkMove && typeSize == 0) {
             throw new IllegalPathStateException("First segment should be SEG_MOVETO type");
         }
         if (typeSize == types.length) {
-            byte tmp[] = new byte[typeSize + BUFFER_CAPACITY];
+            final byte tmp[] = new byte[typeSize + BUFFER_CAPACITY];
             System.arraycopy(types, 0, tmp, 0, typeSize);
             types = tmp;
         }
         if (pointSize + pointCount > points.length) {
-            float tmp[] = new float[pointSize + Math.max(BUFFER_CAPACITY * 2, pointCount)];
+            final float tmp[] = new float[pointSize + Math.max(BUFFER_CAPACITY * 2, pointCount)];
             System.arraycopy(points, 0, tmp, 0, pointSize);
             points = tmp;
         }
     }
 
-    public void moveTo(float x, float y) {
+    public void moveTo(final float x, final float y) {
         if (typeSize > 0 && types[typeSize - 1] == PathIterator.SEG_MOVETO) {
             points[pointSize - 2] = x;
             points[pointSize - 1] = y;
@@ -218,14 +218,14 @@ public final class Path2D implements Cloneable {
         }
     }
 
-    public void lineTo(float x, float y) {
+    public void lineTo(final float x, final float y) {
         checkBuf(2, true);
         types[typeSize++] = PathIterator.SEG_LINETO;
         points[pointSize++] = x;
         points[pointSize++] = y;
     }
 
-    public void quadTo(float x1, float y1, float x2, float y2) {
+    public void quadTo(final float x1, final float y1, final float x2, final float y2) {
         checkBuf(4, true);
         types[typeSize++] = PathIterator.SEG_QUADTO;
         points[pointSize++] = x1;
@@ -234,7 +234,7 @@ public final class Path2D implements Cloneable {
         points[pointSize++] = y2;
     }
 
-    public void curveTo(float x1, float y1, float x2, float y2, float x3, float y3) {
+    public void curveTo(final float x1, final float y1, final float x2, final float y2, final float x3, final float y3) {
         checkBuf(6, true);
         types[typeSize++] = PathIterator.SEG_CUBICTO;
         points[pointSize++] = x1;
@@ -265,12 +265,12 @@ public final class Path2D implements Cloneable {
         return "[size "+size()+", closed "+isClosed()+"]";
     }
 
-    public void append(Path2D path, boolean connect) {
-        PathIterator p = path.iterator(null);
+    public void append(final Path2D path, final boolean connect) {
+        final PathIterator p = path.iterator(null);
         append(p, connect);
     }
 
-    public void append(PathIterator path, boolean connect) {
+    public void append(final PathIterator path, boolean connect) {
         while (!path.isDone()) {
             final float coords[] = new float[6];
             final int segmentType = path.currentSegment(coords);
@@ -315,7 +315,7 @@ public final class Path2D implements Cloneable {
         if (types[typeSize - 1] == PathIterator.SEG_CLOSE) {
 
             for (int i = typeSize - 2; i > 0; i--) {
-                int type = types[i];
+                final int type = types[i];
                 if (type == PathIterator.SEG_MOVETO) {
                     break;
                 }
@@ -330,12 +330,12 @@ public final class Path2D implements Cloneable {
         pointSize = 0;
     }
 
-    public void transform(AffineTransform t) {
+    public void transform(final AffineTransform t) {
         t.transform(points, 0, points, 0, pointSize / 2);
     }
 
-    public Path2D createTransformedShape(AffineTransform t) {
-        Path2D p = (Path2D)clone();
+    public Path2D createTransformedShape(final AffineTransform t) {
+        final Path2D p = (Path2D)clone();
         if (t != null) {
             p.transform(t);
         }
@@ -351,8 +351,8 @@ public final class Path2D implements Cloneable {
             ry1 = ry2 = points[i--];
             rx1 = rx2 = points[i--];
             while (i > 0) {
-                float y = points[i--];
-                float x = points[i--];
+                final float y = points[i--];
+                final float x = points[i--];
                 if (x < rx1) {
                     rx1 = x;
                 } else
@@ -375,36 +375,36 @@ public final class Path2D implements Cloneable {
      * @param cross - the point cross count
      * @return true if point is inside path, or false otherwise
      */
-    boolean isInside(int cross) {
+    boolean isInside(final int cross) {
         if (rule == WIND_NON_ZERO) {
             return Crossing.isInsideNonZero(cross);
         }
         return Crossing.isInsideEvenOdd(cross);
     }
 
-    public boolean contains(float px, float py) {
+    public boolean contains(final float px, final float py) {
         return isInside(Crossing.crossShape(this, px, py));
     }
 
-    public boolean contains(float rx, float ry, float rw, float rh) {
-        int cross = Crossing.intersectShape(this, rx, ry, rw, rh);
+    public boolean contains(final float rx, final float ry, final float rw, final float rh) {
+        final int cross = Crossing.intersectShape(this, rx, ry, rw, rh);
         return cross != Crossing.CROSSING && isInside(cross);
     }
 
-    public boolean intersects(float rx, float ry, float rw, float rh) {
-        int cross = Crossing.intersectShape(this, rx, ry, rw, rh);
+    public boolean intersects(final float rx, final float ry, final float rw, final float rh) {
+        final int cross = Crossing.intersectShape(this, rx, ry, rw, rh);
         return cross == Crossing.CROSSING || isInside(cross);
     }
 
-    public boolean contains(Vertex p) {
+    public boolean contains(final Vertex p) {
         return contains(p.getX(), p.getY());
     }
 
-    public boolean contains(AABBox r) {
+    public boolean contains(final AABBox r) {
         return contains(r.getMinX(), r.getMinY(), r.getWidth(), r.getHeight());
     }
 
-    public boolean intersects(AABBox r) {
+    public boolean intersects(final AABBox r) {
         return intersects(r.getMinX(), r.getMinY(), r.getWidth(), r.getHeight());
     }
 
@@ -412,7 +412,7 @@ public final class Path2D implements Cloneable {
         return new Iterator(this);
     }
 
-    public PathIterator iterator(AffineTransform t) {
+    public PathIterator iterator(final AffineTransform t) {
         return new Iterator(this, t);
     }
 
@@ -423,11 +423,11 @@ public final class Path2D implements Cloneable {
     @Override
     public Object clone() {
         try {
-            Path2D p = (Path2D) super.clone();
+            final Path2D p = (Path2D) super.clone();
             p.types = types.clone();
             p.points = points.clone();
             return p;
-        } catch (CloneNotSupportedException e) {
+        } catch (final CloneNotSupportedException e) {
             throw new InternalError();
         }
     }
diff --git a/src/jogl/classes/jogamp/opengl/Debug.java b/src/jogl/classes/jogamp/opengl/Debug.java
index 9332b67..5bee56d 100644
--- a/src/jogl/classes/jogamp/opengl/Debug.java
+++ b/src/jogl/classes/jogamp/opengl/Debug.java
@@ -1,41 +1,29 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
  *
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
  *
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
  *
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- *
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
  */
 
 package jogamp.opengl;
@@ -63,7 +51,7 @@ public class Debug extends PropertyAccess {
     verbose = isPropertyDefined("jogl.verbose", true);
     debugAll = isPropertyDefined("jogl.debug", true);
     if (verbose) {
-       Package p = Package.getPackage("javax.media.opengl");
+       final Package p = Package.getPackage("javax.media.opengl");
        System.err.println("JOGL specification version " + p.getSpecificationVersion());
        System.err.println("JOGL implementation version " + p.getImplementationVersion());
        System.err.println("JOGL implementation vendor " + p.getImplementationVendor());
@@ -81,7 +69,7 @@ public class Debug extends PropertyAccess {
     return debugAll;
   }
 
-  public static final boolean debug(String subcomponent) {
+  public static final boolean debug(final String subcomponent) {
     return debugAll() || isPropertyDefined("jogl.debug." + subcomponent, true);
   }
 }
diff --git a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java
index 578f416..270a658 100644
--- a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLibraryBundleInfo.java
@@ -49,7 +49,7 @@ public abstract class DesktopGLDynamicLibraryBundleInfo extends GLDynamicLibrary
     }
 
     @Override
-    public final boolean useToolGetProcAdressFirst(String funcName) {
+    public final boolean useToolGetProcAdressFirst(final String funcName) {
         return true;
     }
 
diff --git a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
index c1e1d18..6025b45 100644
--- a/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
+++ b/src/jogl/classes/jogamp/opengl/DesktopGLDynamicLookupHelper.java
@@ -33,7 +33,7 @@ import java.util.*;
 
 public class DesktopGLDynamicLookupHelper extends GLDynamicLookupHelper {
 
-    public DesktopGLDynamicLookupHelper(DesktopGLDynamicLibraryBundleInfo info) {
+    public DesktopGLDynamicLookupHelper(final DesktopGLDynamicLibraryBundleInfo info) {
         super(info);
     }
 
@@ -43,7 +43,7 @@ public class DesktopGLDynamicLookupHelper extends GLDynamicLookupHelper {
     public final synchronized boolean loadGLULibrary() {
         /** hacky code .. where all platform GLU libs are tried ..*/
         if(null==gluLib) {
-            List<String> gluLibNames = new ArrayList<String>();
+            final List<String> gluLibNames = new ArrayList<String>();
             gluLibNames.add("/System/Library/Frameworks/OpenGL.framework/Libraries/libGLU.dylib"); // osx
             gluLibNames.add("libGLU.so"); // unix
             gluLibNames.add("GLU32"); // windows
diff --git a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
index fd59ecf..1b33e1a 100644
--- a/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
+++ b/src/jogl/classes/jogamp/opengl/ExtensionAvailabilityCache.java
@@ -44,6 +44,7 @@ import java.util.HashMap;
 import java.util.StringTokenizer;
 
 import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES3;
 import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLContext;
 
@@ -77,7 +78,7 @@ final class ExtensionAvailabilityCache {
   /**
    * Flush and rebuild the cache.
    */
-  final void reset(GLContextImpl context) {
+  final void reset(final GLContextImpl context) {
     flush();
     initAvailableExtensions(context);
   }
@@ -91,7 +92,7 @@ final class ExtensionAvailabilityCache {
     return availableExtensionCache.size();
   }
 
-  final boolean isExtensionAvailable(String glExtensionName) {
+  final boolean isExtensionAvailable(final String glExtensionName) {
     validateInitialization();
     return null != availableExtensionCache.get(glExtensionName);
   }
@@ -124,8 +125,8 @@ final class ExtensionAvailabilityCache {
           throw new InternalError("ExtensionAvailabilityCache not initialized!");
       }
   }
-  private final void initAvailableExtensions(GLContextImpl context) {
-      GL gl = context.getGL();
+  private final void initAvailableExtensions(final GLContextImpl context) {
+      final GL gl = context.getGL();
       // if hash is empty (meaning it was flushed), pre-cache it with the list
       // of extensions that are in the GL_EXTENSIONS string
       if (isInitialized()) {
@@ -155,14 +156,14 @@ final class ExtensionAvailabilityCache {
       }
 
       if(useGetStringi) {
-          GL2GL3 gl2gl3 = gl.getGL2GL3();
+          final GL2GL3 gl2gl3 = gl.getGL2GL3();
           final int count;
           {
-              int[] val = { 0 } ;
-              gl2gl3.glGetIntegerv(GL2GL3.GL_NUM_EXTENSIONS, val, 0);
+              final int[] val = { 0 } ;
+              gl2gl3.glGetIntegerv(GL2ES3.GL_NUM_EXTENSIONS, val, 0);
               count = val[0];
           }
-          StringBuilder sb = new StringBuilder();
+          final StringBuilder sb = new StringBuilder();
           for (int i = 0; i < count; i++) {
               final String ext = gl2gl3.glGetStringi(GL.GL_EXTENSIONS, i);
               if( null == availableExtensionCache.put(ext, ext) ) {
@@ -229,8 +230,8 @@ final class ExtensionAvailabilityCache {
 
       final int ctxOptions = context.getCtxOptions();
       final VersionNumber version = context.getGLVersionNumber();
-      int major[] = new int[] { version.getMajor() };
-      int minor[] = new int[] { version.getMinor() };
+      final int major[] = new int[] { version.getMajor() };
+      final int minor[] = new int[] { version.getMinor() };
       do{
           final String GL_XX_VERSION = ( context.isGLES() ? "GL_ES_VERSION_" : "GL_VERSION_" ) + major[0] + "_" + minor[0];
           availableExtensionCache.put(GL_XX_VERSION, GL_XX_VERSION);
diff --git a/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java b/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
index 08a1fe8..d7ac6eb 100644
--- a/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
+++ b/src/jogl/classes/jogamp/opengl/FPSCounterImpl.java
@@ -60,11 +60,11 @@ public class FPSCounterImpl implements FPSCounter {
             final long now = TimeUnit.NANOSECONDS.toMillis(System.nanoTime());
             fpsLastPeriod = now - fpsLastUpdateTime;
             fpsLastPeriod = Math.max(fpsLastPeriod, 1); // div 0
-            fpsLast = ( (float)fpsUpdateFramesInterval * 1000f ) / ( (float) fpsLastPeriod ) ;
+            fpsLast = ( fpsUpdateFramesInterval * 1000f ) / ( fpsLastPeriod ) ;
 
             fpsTotalDuration = now - fpsStartTime;
             fpsTotalDuration = Math.max(fpsTotalDuration, 1); // div 0
-            fpsTotal= ( (float)fpsTotalFrames * 1000f ) / ( (float) fpsTotalDuration ) ;
+            fpsTotal= ( fpsTotalFrames * 1000f ) / ( fpsTotalDuration ) ;
 
             if(null != fpsOutputStream) {
                 fpsOutputStream.println(toString());
@@ -93,7 +93,7 @@ public class FPSCounterImpl implements FPSCounter {
     }
 
     @Override
-    public final synchronized void setUpdateFPSFrames(int frames, PrintStream out) {
+    public final synchronized void setUpdateFPSFrames(final int frames, final PrintStream out) {
         fpsUpdateFramesInterval = frames;
         fpsOutputStream = out;
         resetFPSCounter();
diff --git a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
index 7cd685d..6e6aaf5 100644
--- a/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
+++ b/src/jogl/classes/jogamp/opengl/GLAutoDrawableBase.java
@@ -57,9 +57,11 @@ import com.jogamp.opengl.GLStateKeeper;
 
 
 /**
- * Abstract common code for GLAutoDrawable implementations.
+ * Abstract common code for GLAutoDrawable implementations
+ * utilizing multithreading, i.e. {@link #isThreadGLCapable()} always returns <code>true</code>.
  *
  * @see GLAutoDrawable
+ * @see GLAutoDrawable#getThreadingMode()
  * @see GLAutoDrawableDelegate
  * @see GLOffscreenAutoDrawable
  * @see GLOffscreenAutoDrawableImpl
@@ -100,7 +102,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
      *                   the drawable is created w/ it's own new instance, e.g. offscreen drawables,
      *                   and no further lifecycle handling is applied.
      */
-    public GLAutoDrawableBase(GLDrawableImpl drawable, GLContextImpl context, boolean ownsDevice) {
+    public GLAutoDrawableBase(final GLDrawableImpl drawable, final GLContextImpl context, final boolean ownsDevice) {
         this.drawable = drawable;
         this.context = context;
         this.preserveGLELSAtDestroy = false;
@@ -114,27 +116,24 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     }
 
     @Override
-    public final void setSharedContext(GLContext sharedContext) throws IllegalStateException {
+    public final void setSharedContext(final GLContext sharedContext) throws IllegalStateException {
         helper.setSharedContext(this.context, sharedContext);
     }
 
     @Override
-    public final void setSharedAutoDrawable(GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
+    public final void setSharedAutoDrawable(final GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
         helper.setSharedAutoDrawable(this, sharedAutoDrawable);
     }
 
-    /** Returns the recursive lock object of the upstream implementation, which synchronizes multithreaded access on top of {@link NativeSurface#lockSurface()}. */
-    protected abstract RecursiveLock getLock();
-
     @Override
-    public final GLStateKeeper.Listener setGLStateKeeperListener(Listener l) {
+    public final GLStateKeeper.Listener setGLStateKeeperListener(final Listener l) {
         final GLStateKeeper.Listener pre = glStateKeeperListener;
         glStateKeeperListener = l;
         return pre;
     }
 
     @Override
-    public final boolean preserveGLStateAtDestroy(boolean value) {
+    public final boolean preserveGLStateAtDestroy(final boolean value) {
         final boolean res = isGLStatePreservationSupported() ? true : false;
         if( res ) {
             if( DEBUG ) {
@@ -216,8 +215,23 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
         }
     }
 
-    /** Default implementation to handle resize events from the windowing system. All required locks are being claimed. */
-    protected final void defaultWindowResizedOp(int newWidth, int newHeight) throws NativeWindowException, GLException {
+    /**
+     * Handling resize events from the windowing system.
+     * <p>
+     * Implementation:
+     * <ul>
+     *   <li>resizes {@link #getDelegatedDrawable() the GLDrawable}, if offscreen,</li>
+     *   <li>triggers a pending {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape events}, and</li>
+     *   <li>issues a {@link #display()} call, if no animator is present.</li>
+     * </ul>
+     * </p>
+     * <p>
+     * All required locks are being claimed.
+     * </p>
+     * @param newWidth new width in pixel units
+     * @param newWidth new height in pixel units
+     */
+    protected final void defaultWindowResizedOp(final int newWidth, final int newHeight) throws NativeWindowException, GLException {
         GLDrawableImpl _drawable = drawable;
         if( null!=_drawable ) {
             if(DEBUG) {
@@ -225,7 +239,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
                 System.err.println("GLAutoDrawableBase.sizeChanged: ("+getThreadName()+"): "+newWidth+"x"+newHeight+" - surfaceHandle 0x"+Long.toHexString(surfaceHandle));
             }
             if( ! _drawable.getChosenGLCapabilities().isOnscreen() ) {
-                final RecursiveLock _lock = getLock();
+                final RecursiveLock _lock = getUpstreamLock();
                 _lock.lock();
                 try {
                     final GLDrawableImpl _drawableNew = GLDrawableHelper.resizeOffscreenDrawable(_drawable, context, newWidth, newHeight);
@@ -265,7 +279,13 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
             shallClose = true;
         }
         if( shallClose ) {
-            destroyAvoidAwareOfLocking();
+            try {
+                destroyAvoidAwareOfLocking();
+            } catch( final Throwable t ) {
+                // Intentionally catch and ignore exception,
+                // so the destroy mechanism of the native windowing system is not corrupted!
+                GLException.dumpThrowable("ignored", t);
+            }
         }
     }
 
@@ -317,7 +337,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
      * Calls {@link #destroyImplInLock()} while claiming the lock.
      */
     protected final void defaultDestroy() {
-        final RecursiveLock lock = getLock();
+        final RecursiveLock lock = getUpstreamLock();
         lock.lock();
         try {
             destroyImplInLock();
@@ -342,30 +362,52 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
             preserveGLStateAtDestroy(false);
             preserveGLEventListenerState();
         }
+
+        GLException exceptionOnDisposeGL = null;
         if( null != context ) {
             if( context.isCreated() ) {
-                // Catch dispose GLExceptions by GLEventListener, just 'print' them
-                // so we can continue with the destruction.
                 try {
                     helper.disposeGL(this, context, true);
-                } catch (GLException gle) {
-                    gle.printStackTrace();
+                } catch (final GLException gle) {
+                    exceptionOnDisposeGL = gle;
                 }
             }
             context = null;
         }
+
+        Throwable exceptionOnUnrealize = null;
+        Throwable exceptionOnDeviceClose = null;
         if( null != drawable ) {
             final AbstractGraphicsDevice device = drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
-            drawable.setRealized(false);
+            try {
+                drawable.setRealized(false);
+            } catch( final Throwable re ) {
+                exceptionOnUnrealize = re;
+            }
             drawable = null;
-            if( ownsDevice ) {
-                device.close();
+            try {
+                if( ownsDevice ) {
+                    device.close();
+                }
+            } catch (final Throwable re) {
+                exceptionOnDeviceClose = re;
             }
         }
+
+        // throw exception in order of occurrence ..
+        if( null != exceptionOnDisposeGL ) {
+            throw exceptionOnDisposeGL;
+        }
+        if( null != exceptionOnUnrealize ) {
+            throw GLException.newGLException(exceptionOnUnrealize);
+        }
+        if( null != exceptionOnDeviceClose ) {
+            throw GLException.newGLException(exceptionOnDeviceClose);
+        }
     }
 
     public final void defaultSwapBuffers() throws GLException {
-        final RecursiveLock _lock = getLock();
+        final RecursiveLock _lock = getUpstreamLock();
         _lock.lock();
         try {
             if(null != drawable) {
@@ -393,7 +435,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
         public final void run() {
             // Lock: Locked Surface/Window by display _and_ MakeCurrent/Release
             if (sendReshape) {
-                helper.reshape(GLAutoDrawableBase.this, 0, 0, getWidth(), getHeight());
+                helper.reshape(GLAutoDrawableBase.this, 0, 0, getSurfaceWidth(), getSurfaceHeight());
                 sendReshape = false;
             }
             helper.display(GLAutoDrawableBase.this);
@@ -406,13 +448,13 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
             destroy();
             return;
         }
-        final RecursiveLock _lock = getLock();
+        final RecursiveLock _lock = getUpstreamLock();
         _lock.lock();
         try {
             if( null == context ) {
                 boolean contextCreated = false;
                 final GLDrawableImpl _drawable = drawable;
-                if ( null != _drawable && _drawable.isRealized() && 0<_drawable.getWidth()*_drawable.getHeight() ) {
+                if ( null != _drawable && _drawable.isRealized() && 0<_drawable.getSurfaceWidth()*_drawable.getSurfaceHeight() ) {
                     final GLContext[] shareWith = { null };
                     if( !helper.isSharedGLContextPending(shareWith) ) {
                         if( !restoreGLEventListenerState() ) {
@@ -436,8 +478,8 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
         }
     }
 
-    protected final GLEventListener defaultDisposeGLEventListener(GLEventListener listener, boolean remove) {
-        final RecursiveLock _lock = getLock();
+    protected final GLEventListener defaultDisposeGLEventListener(final GLEventListener listener, final boolean remove) {
+        final RecursiveLock _lock = getUpstreamLock();
         _lock.lock();
         try {
             return helper.disposeGLEventListener(GLAutoDrawableBase.this, drawable, context, listener, remove);
@@ -457,8 +499,8 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     }
 
     @Override
-    public final GLContext setContext(GLContext newCtx, boolean destroyPrevCtx) {
-        final RecursiveLock lock = getLock();
+    public final GLContext setContext(final GLContext newCtx, final boolean destroyPrevCtx) {
+        final RecursiveLock lock = getUpstreamLock();
         lock.lock();
         try {
             final GLContext oldCtx = context;
@@ -480,7 +522,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     }
 
     @Override
-    public final GL setGL(GL gl) {
+    public final GL setGL(final GL gl) {
         final GLContext _context = context;
         if (_context != null) {
             _context.setGL(gl);
@@ -490,12 +532,12 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     }
 
     @Override
-    public final void addGLEventListener(GLEventListener listener) {
+    public final void addGLEventListener(final GLEventListener listener) {
         helper.addGLEventListener(listener);
     }
 
     @Override
-    public final void addGLEventListener(int index, GLEventListener listener) throws IndexOutOfBoundsException {
+    public final void addGLEventListener(final int index, final GLEventListener listener) throws IndexOutOfBoundsException {
         helper.addGLEventListener(index, listener);
     }
 
@@ -505,7 +547,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     }
 
     @Override
-    public GLEventListener getGLEventListener(int index) throws IndexOutOfBoundsException {
+    public GLEventListener getGLEventListener(final int index) throws IndexOutOfBoundsException {
         return helper.getGLEventListener(index);
     }
 
@@ -515,27 +557,27 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     }
 
     @Override
-    public boolean getGLEventListenerInitState(GLEventListener listener) {
+    public boolean getGLEventListenerInitState(final GLEventListener listener) {
         return helper.getGLEventListenerInitState(listener);
     }
 
     @Override
-    public void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
+    public void setGLEventListenerInitState(final GLEventListener listener, final boolean initialized) {
         helper.setGLEventListenerInitState(listener, initialized);
     }
 
     @Override
-    public GLEventListener disposeGLEventListener(GLEventListener listener, boolean remove) {
+    public GLEventListener disposeGLEventListener(final GLEventListener listener, final boolean remove) {
         return defaultDisposeGLEventListener(listener, remove);
     }
 
     @Override
-    public final GLEventListener removeGLEventListener(GLEventListener listener) {
+    public final GLEventListener removeGLEventListener(final GLEventListener listener) {
         return helper.removeGLEventListener(listener);
     }
 
     @Override
-    public final void setAnimator(GLAnimatorControl animatorControl)
+    public final void setAnimator(final GLAnimatorControl animatorControl)
             throws GLException {
         helper.setAnimator(animatorControl);
     }
@@ -546,7 +588,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     }
 
     @Override
-    public final Thread setExclusiveContextThread(Thread t) throws GLException {
+    public final Thread setExclusiveContextThread(final Thread t) throws GLException {
         return helper.setExclusiveContextThread(t, context);
     }
 
@@ -556,17 +598,22 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     }
 
     @Override
-    public final boolean invoke(boolean wait, GLRunnable glRunnable) {
+    public final boolean invoke(final boolean wait, final GLRunnable glRunnable) throws IllegalStateException {
         return helper.invoke(this, wait, glRunnable);
     }
 
     @Override
-    public boolean invoke(final boolean wait, final List<GLRunnable> glRunnables) {
+    public boolean invoke(final boolean wait, final List<GLRunnable> glRunnables) throws IllegalStateException {
         return helper.invoke(this, wait, glRunnables);
     }
 
     @Override
-    public final void setAutoSwapBufferMode(boolean enable) {
+    public void flushGLRunnables() {
+        helper.flushGLRunnables();
+    }
+
+    @Override
+    public final void setAutoSwapBufferMode(final boolean enable) {
         helper.setAutoSwapBufferMode(enable);
     }
 
@@ -576,7 +623,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     }
 
     @Override
-    public final void setContextCreationFlags(int flags) {
+    public final void setContextCreationFlags(final int flags) {
         additionalCtxCreationFlags = flags;
         final GLContext _context = context;
         if(null != _context) {
@@ -589,12 +636,21 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
         return additionalCtxCreationFlags;
     }
 
+    /**
+     * {@inheritDoc}
+     * <p>
+     * Implementation always supports multithreading, hence method always returns <code>true</code>.
+     * </p>
+     */
+    @Override
+    public final boolean isThreadGLCapable() { return true; }
+
     //
     // FPSCounter
     //
 
     @Override
-    public final void setUpdateFPSFrames(int frames, PrintStream out) {
+    public final void setUpdateFPSFrames(final int frames, final PrintStream out) {
         fpsCounter.setUpdateFPSFrames(frames, out);
     }
 
@@ -649,7 +705,7 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
 
     @Override
     public final GLContext createContext(final GLContext shareWith) {
-        final RecursiveLock lock = getLock();
+        final RecursiveLock lock = getUpstreamLock();
         lock.lock();
         try {
             if(drawable != null) {
@@ -664,12 +720,12 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     }
 
     @Override
-    public final void setRealized(boolean realized) {
-        final RecursiveLock _lock = getLock();
+    public final void setRealized(final boolean realized) {
+        final RecursiveLock _lock = getUpstreamLock();
         _lock.lock();
         try {
             final GLDrawable _drawable = drawable;
-            if( null == _drawable || realized && ( 0 >= _drawable.getWidth() || 0 >= _drawable.getHeight() ) ) {
+            if( null == _drawable || realized && ( 0 >= _drawable.getSurfaceWidth() || 0 >= _drawable.getSurfaceHeight() ) ) {
                 return;
             }
             _drawable.setRealized(realized);
@@ -688,15 +744,15 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     }
 
     @Override
-    public int getWidth() {
+    public int getSurfaceWidth() {
         final GLDrawable _drawable = drawable;
-        return null != _drawable ? _drawable.getWidth() : 0;
+        return null != _drawable ? _drawable.getSurfaceWidth() : 0;
     }
 
     @Override
-    public int getHeight() {
+    public int getSurfaceHeight() {
         final GLDrawable _drawable = drawable;
-        return null != _drawable ? _drawable.getHeight() : 0;
+        return null != _drawable ? _drawable.getSurfaceHeight() : 0;
     }
 
     @Override
@@ -712,6 +768,12 @@ public abstract class GLAutoDrawableBase implements GLAutoDrawable, GLStateKeepe
     }
 
     @Override
+    public final GLCapabilitiesImmutable getRequestedGLCapabilities() {
+        final GLDrawable _drawable = drawable;
+        return null != _drawable ? _drawable.getRequestedGLCapabilities() : null;
+    }
+
+    @Override
     public final GLProfile getGLProfile() {
         final GLDrawable _drawable = drawable;
         return null != _drawable ? _drawable.getGLProfile() : null;
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferObjectTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferObjectTracker.java
index 2351826..7e49b34 100644
--- a/src/jogl/classes/jogamp/opengl/GLBufferObjectTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLBufferObjectTracker.java
@@ -36,6 +36,7 @@ import javax.media.opengl.*;
 
 import com.jogamp.common.nio.Buffers;
 import com.jogamp.common.util.IntObjectHashMap;
+import com.jogamp.common.util.PropertyAccess;
 
 /**
  * Tracking of {@link GLBufferStorage} instances via GL API callbacks.
@@ -102,18 +103,18 @@ public class GLBufferObjectTracker {
 
     static {
         Debug.initSingleton();
-        DEBUG = Debug.isPropertyDefined("jogl.debug.GLBufferObjectTracker", true);
+        DEBUG = PropertyAccess.isPropertyDefined("jogl.debug.GLBufferObjectTracker", true);
     }
 
     static final class GLBufferStorageImpl extends GLBufferStorage {
         GLBufferStorageImpl(final int name, final long size, final int mutableUsage, final int immutableFlags) {
             super(name, size, mutableUsage, immutableFlags);
         }
-        final void setMappedBuffer(final ByteBuffer bb) {
-            if (DEBUG) {
-                System.err.printf("%s.GLBufferStorage.setMappedBuffer: %s: %s -> %s%n", msgClazzName, toString(true), mappedBuffer, bb);
-            }
-            mappedBuffer = bb;
+        protected final void reset(final long size, final int mutableUsage, final int immutableFlags) {
+            super.reset(size, mutableUsage, immutableFlags);
+        }
+        protected final void setMappedBuffer(final ByteBuffer buffer) {
+            super.setMappedBuffer(buffer);
         }
     }
 
@@ -146,7 +147,7 @@ public class GLBufferObjectTracker {
      * @throws GLException if a native GL-Error occurs
      */
     public synchronized final void createBufferStorage(final GLBufferStateTracker bufferStateTracker, final GL caller,
-                                                       final int target, final long size, final Buffer data, int mutableUsage, int immutableFlags,
+                                                       final int target, final long size, final Buffer data, final int mutableUsage, final int immutableFlags,
                                                        final CreateStorageDispatch dispatch, final long glProcAddress) throws GLException {
         final int glerrPre = caller.glGetError(); // clear
         if (DEBUG && GL.GL_NO_ERROR != glerrPre) {
@@ -169,13 +170,18 @@ public class GLBufferObjectTracker {
             throw new GLException(String.format("GL-Error 0x%X while creating %s storage for target 0x%X -> buffer %d of size %d with data %s",
                     glerrPost, mutableBuffer ? "mutable" : "immutable", target, bufferName, size, data));
         }
-        final GLBufferStorageImpl objNew = new GLBufferStorageImpl(bufferName, size, mutableUsage, immutableFlags);
-        final GLBufferStorageImpl objOld = (GLBufferStorageImpl) bufferName2StorageMap.put(bufferName, objNew);
-        if (DEBUG) {
-            System.err.printf("%s.%s target: 0x%X -> %d: %s -> %s%n", msgClazzName, msgCreateBound, target, bufferName, objOld, objNew);
-        }
+        final GLBufferStorageImpl objOld = (GLBufferStorageImpl) bufferName2StorageMap.get(bufferName);
         if( null != objOld ) {
-            objOld.setMappedBuffer(null);
+            objOld.reset(size, mutableUsage, immutableFlags);
+            if (DEBUG) {
+                System.err.printf("%s.%s target: 0x%X -> reset %d: %s%n", msgClazzName, msgCreateBound, target, bufferName, objOld);
+            }
+        } else {
+            final GLBufferStorageImpl objNew = new GLBufferStorageImpl(bufferName, size, mutableUsage, immutableFlags);
+            bufferName2StorageMap.put(bufferName, objNew);
+            if (DEBUG) {
+                System.err.printf("%s.%s target: 0x%X -> new %d: %s%n", msgClazzName, msgCreateBound, target, bufferName, objNew);
+            }
         }
     }
 
@@ -190,7 +196,7 @@ public class GLBufferObjectTracker {
      * @throws GLException if a native GL-Error occurs
      */
     public synchronized final void createBufferStorage(final GL caller,
-                                                       final int bufferName, final long size, final Buffer data, final int mutableUsage, int immutableFlags,
+                                                       final int bufferName, final long size, final Buffer data, final int mutableUsage, final int immutableFlags,
                                                        final CreateStorageDispatch dispatch, final long glProcAddress) throws GLException {
         final int glerrPre = caller.glGetError(); // clear
         if (DEBUG && GL.GL_NO_ERROR != glerrPre) {
@@ -209,13 +215,18 @@ public class GLBufferObjectTracker {
             throw new GLException(String.format("GL-Error 0x%X while creating %s storage for buffer %d of size %d with data %s",
                                                 glerrPost, "mutable", bufferName, size, data));
         }
-        final GLBufferStorageImpl objNew = new GLBufferStorageImpl(bufferName, size, mutableUsage, 0 /* immutableFlags */);
-        final GLBufferStorageImpl objOld = (GLBufferStorageImpl) bufferName2StorageMap.put(bufferName, objNew);
-        if (DEBUG) {
-            System.err.printf("%s.%s direct: %d: %s -> %s%n", msgClazzName, msgCreateNamed, bufferName, objOld, objNew);
-        }
+        final GLBufferStorageImpl objOld = (GLBufferStorageImpl) bufferName2StorageMap.get(bufferName);
         if( null != objOld ) {
-            objOld.setMappedBuffer(null);
+            objOld.reset(size, mutableUsage, immutableFlags);
+            if (DEBUG) {
+                System.err.printf("%s.%s direct: reset %d: %s%n", msgClazzName, msgCreateNamed, bufferName, objOld);
+            }
+        } else {
+            final GLBufferStorageImpl objNew = new GLBufferStorageImpl(bufferName, size, mutableUsage, immutableFlags);
+            bufferName2StorageMap.put(bufferName, objNew);
+            if (DEBUG) {
+                System.err.printf("%s.%s direct: new %d: %s%n", msgClazzName, msgCreateNamed, bufferName, objNew);
+            }
         }
     }
 
@@ -330,7 +341,7 @@ public class GLBufferObjectTracker {
      */
     private synchronized final GLBufferStorage mapBufferImpl(final GLBufferStateTracker bufferStateTracker,
                                                              final GL caller, final int target, final boolean useRange,
-                                                             long offset, long length, final int access,
+                                                             final long offset, final long length, final int access,
                                                              final MapBufferDispatch dispatch, final long glProcAddress) throws GLException {
         final int bufferName = bufferStateTracker.getBoundBufferObject(target, caller);
         if( 0 == bufferName ) {
@@ -480,18 +491,6 @@ public class GLBufferObjectTracker {
         return res;
     }
 
-    public synchronized final long getBufferSize(final int bufferName) {
-        final GLBufferStorageImpl store = (GLBufferStorageImpl)bufferName2StorageMap.get(bufferName);
-        if ( null == store ) {
-            if (DEBUG) {
-                System.err.printf("%s: %s.getBufferSize(): Buffer %d not tracked%n", warning, msgClazzName, bufferName);
-                Thread.dumpStack();
-            }
-            return 0;
-        }
-        return store.getSize();
-    }
-
     public synchronized final GLBufferStorage getBufferStorage(final int bufferName) {
         return (GLBufferStorageImpl)bufferName2StorageMap.get(bufferName);
     }
diff --git a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
index 511c1b9..825ad05 100644
--- a/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLBufferStateTracker.java
@@ -43,6 +43,7 @@ package jogamp.opengl;
 import javax.media.opengl.*;
 
 import com.jogamp.common.util.IntIntHashMap;
+import com.jogamp.common.util.PropertyAccess;
 
 /**
  * Tracks as closely as possible which OpenGL buffer object is bound
@@ -82,7 +83,7 @@ public class GLBufferStateTracker {
 
   static {
       Debug.initSingleton();
-      DEBUG = Debug.isPropertyDefined("jogl.debug.GLBufferStateTracker", true);
+      DEBUG = PropertyAccess.isPropertyDefined("jogl.debug.GLBufferStateTracker", true);
   }
 
   // Maps binding targets to buffer objects. A null value indicates
@@ -91,7 +92,7 @@ public class GLBufferStateTracker {
   // OpenGL specifications.
   // http://www.opengl.org/sdk/docs/man/xhtml/glBindBuffer.xml
   private final IntIntHashMap bindingMap;
-  private final int bindingNotFound = 0xFFFFFFFF;
+  private static final int bindingNotFound = 0xFFFFFFFF;
 
   private final int[] bufTmp = new int[1];
 
@@ -104,8 +105,8 @@ public class GLBufferStateTracker {
     setBoundBufferObject(GL.GL_ARRAY_BUFFER,         0);
     setBoundBufferObject(GL4.GL_DRAW_INDIRECT_BUFFER, 0);
     setBoundBufferObject(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
-    setBoundBufferObject(GL2.GL_PIXEL_PACK_BUFFER,   0);
-    setBoundBufferObject(GL2.GL_PIXEL_UNPACK_BUFFER, 0);
+    setBoundBufferObject(GL2ES3.GL_PIXEL_PACK_BUFFER,   0);
+    setBoundBufferObject(GL2ES3.GL_PIXEL_UNPACK_BUFFER, 0);
   }
 
 
@@ -136,8 +137,8 @@ public class GLBufferStateTracker {
         case GL4.GL_DRAW_INDIRECT_BUFFER:         return GL4.GL_DRAW_INDIRECT_BUFFER_BINDING;
         case GL4.GL_DISPATCH_INDIRECT_BUFFER:     return GL4.GL_DISPATCH_INDIRECT_BUFFER_BINDING;
         case GL.GL_ELEMENT_ARRAY_BUFFER:          return GL.GL_ELEMENT_ARRAY_BUFFER_BINDING;
-        case GL2.GL_PIXEL_PACK_BUFFER:            return GL2.GL_PIXEL_PACK_BUFFER_BINDING;
-        case GL2.GL_PIXEL_UNPACK_BUFFER:          return GL2.GL_PIXEL_UNPACK_BUFFER_BINDING;
+        case GL2ES3.GL_PIXEL_PACK_BUFFER:            return GL2ES3.GL_PIXEL_PACK_BUFFER_BINDING;
+        case GL2ES3.GL_PIXEL_UNPACK_BUFFER:          return GL2ES3.GL_PIXEL_UNPACK_BUFFER_BINDING;
         // FIXME case GL4.GL_QUERY_BUFFER:              return GL4.GL_QUERY_BUFFER_BINDING;
         case GL4.GL_SHADER_STORAGE_BUFFER:        return GL4.GL_SHADER_STORAGE_BUFFER_BINDING;
         case GL2GL3.GL_TEXTURE_BUFFER:            return GL2GL3.GL_TEXTURE_BINDING_BUFFER;
@@ -159,8 +160,8 @@ public class GLBufferStateTracker {
         case GL4.GL_DRAW_INDIRECT_BUFFER:
         case GL4.GL_DISPATCH_INDIRECT_BUFFER:
         case GL.GL_ELEMENT_ARRAY_BUFFER:
-        case GL2.GL_PIXEL_PACK_BUFFER:
-        case GL2.GL_PIXEL_UNPACK_BUFFER:
+        case GL2ES3.GL_PIXEL_PACK_BUFFER:
+        case GL2ES3.GL_PIXEL_UNPACK_BUFFER:
         // FIXME case GL4.GL_QUERY_BUFFER:
         case GL4.GL_SHADER_STORAGE_BUFFER:
         case GL2GL3.GL_TEXTURE_BUFFER:
@@ -185,7 +186,7 @@ public class GLBufferStateTracker {
    * @param target
    * @param bufferName
    */
-  public final void setBoundBufferObject(int target, int bufferName) {
+  public final void setBoundBufferObject(final int target, final int bufferName) {
     checkTargetName(target);
     final int oldBufferName = bindingMap.put(target, bufferName);
     /***
@@ -215,7 +216,7 @@ public class GLBufferStateTracker {
       specified target (e.g. GL_ARRAY_BUFFER) is currently unknown.
       You must use isBoundBufferObjectKnown() to see whether the
       return value is valid. */
-  public final int getBoundBufferObject(int target, GL caller) {
+  public final int getBoundBufferObject(final int target, final GL caller) {
     int value = bindingMap.get(target);
     if (bindingNotFound == value) {
       // User probably either called glPushClientAttrib /
@@ -263,5 +264,5 @@ public class GLBufferStateTracker {
     }
     bindingMap.clear();
   }
-  private final String toHexString(int i) { return Integer.toHexString(i); }
+  private final String toHexString(final int i) { return Integer.toHexString(i); }
 }
diff --git a/src/jogl/classes/jogamp/opengl/GLContextImpl.java b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
index 9ccd785..be0088f 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextImpl.java
@@ -134,7 +134,7 @@ public abstract class GLContextImpl extends GLContext {
       mappedGLXProcAddress.clear();
   }
 
-  public GLContextImpl(GLDrawableImpl drawable, GLContext shareWith) {
+  public GLContextImpl(final GLDrawableImpl drawable, final GLContext shareWith) {
     super();
 
     bufferStateTracker = new GLBufferStateTracker();
@@ -162,7 +162,7 @@ public abstract class GLContextImpl extends GLContext {
   }
 
   @Override
-  protected void resetStates(boolean isInit) {
+  protected void resetStates(final boolean isInit) {
       if( !isInit ) {
           clearStates();
       }
@@ -177,7 +177,7 @@ public abstract class GLContextImpl extends GLContext {
       glRendererLowerCase = glRenderer;
       glVersion = glVendor;
 
-      if (boundFBOTarget != null) { // <init>
+      if ( !isInit && null != boundFBOTarget ) { // <init>: boundFBOTarget is not written yet
           boundFBOTarget[0] = 0; // draw
           boundFBOTarget[1] = 0; // read
       }
@@ -188,7 +188,7 @@ public abstract class GLContextImpl extends GLContext {
   }
 
   @Override
-  public final GLDrawable setGLReadDrawable(GLDrawable read) {
+  public final GLDrawable setGLReadDrawable(final GLDrawable read) {
     if(!isGLReadDrawableAvailable()) {
         throw new GLException("Setting read drawable feature not available");
     }
@@ -212,7 +212,7 @@ public abstract class GLContextImpl extends GLContext {
   }
 
   @Override
-  public final GLDrawable setGLDrawable(GLDrawable readWrite, boolean setWriteOnly) {
+  public final GLDrawable setGLDrawable(final GLDrawable readWrite, final boolean setWriteOnly) {
     if( drawable == readWrite && ( setWriteOnly || drawableRead == readWrite ) ) {
         return drawable; // no change.
     }
@@ -230,6 +230,8 @@ public abstract class GLContextImpl extends GLContext {
         if(!lockHeld) {
             makeCurrent();
         }
+        // sync GL ctx w/ drawable's framebuffer before de-association
+        gl.glFinish();
         associateDrawable(false);
         if(!lockHeld) {
             release();
@@ -278,7 +280,7 @@ public abstract class GLContextImpl extends GLContext {
   }
 
   @Override
-  public GL setGL(GL gl) {
+  public GL setGL(final GL gl) {
     if( DEBUG ) {
         final String sgl1 = (null!=this.gl)?this.gl.getClass().getSimpleName()+", "+this.gl.toString():"<null>";
         final String sgl2 = (null!=gl)?gl.getClass().getSimpleName()+", "+gl.toString():"<null>";
@@ -314,7 +316,7 @@ public abstract class GLContextImpl extends GLContext {
   public void release() throws GLException {
     release(false);
   }
-  private void release(boolean inDestruction) throws GLException {
+  private void release(final boolean inDestruction) throws GLException {
     if( TRACE_SWITCH ) {
         System.err.println(getThreadName() +": GLContext.ContextSwitch[release.0]: obj " + toHexString(hashCode()) + ", ctx "+toHexString(contextHandle)+", surf "+toHexString(drawable.getHandle())+", inDestruction: "+inDestruction+", "+lock);
     }
@@ -339,7 +341,7 @@ public abstract class GLContextImpl extends GLContext {
             if( !inDestruction ) {
                 try {
                     contextMadeCurrent(false);
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     drawableContextMadeCurrentException = t;
                 }
             }
@@ -409,7 +411,7 @@ public abstract class GLContextImpl extends GLContext {
                   }
                   try {
                       associateDrawable(false);
-                  } catch (Throwable t) {
+                  } catch (final Throwable t) {
                       associateDrawableException = t;
                   }
                   if ( 0 != defaultVAO ) {
@@ -452,7 +454,7 @@ public abstract class GLContextImpl extends GLContext {
   protected abstract void destroyImpl() throws GLException;
 
   @Override
-  public final void copy(GLContext source, int mask) throws GLException {
+  public final void copy(final GLContext source, final int mask) throws GLException {
     if (source.getHandle() == 0) {
       throw new GLException("Source OpenGL context has not been created");
     }
@@ -568,7 +570,7 @@ public abstract class GLContextImpl extends GLContext {
                         tracker.ref();
                     }
                  */
-            } catch (RuntimeException e) {
+            } catch (final RuntimeException e) {
               unlockResources = true;
               throw e;
             } finally {
@@ -580,7 +582,7 @@ public abstract class GLContextImpl extends GLContext {
               }
             }
         } /* if ( drawable.isRealized() ) */
-    } catch (RuntimeException e) {
+    } catch (final RuntimeException e) {
       unlockResources = true;
       throw e;
     } finally {
@@ -632,9 +634,9 @@ public abstract class GLContextImpl extends GLContext {
     return res;
   }
 
-  private final int makeCurrentWithinLock(int surfaceLockRes) throws GLException {
+  private final int makeCurrentWithinLock(final int surfaceLockRes) throws GLException {
       if (!isCreated()) {
-        if( 0 >= drawable.getWidth() || 0 >= drawable.getHeight() ) {
+        if( 0 >= drawable.getSurfaceWidth() || 0 >= drawable.getSurfaceHeight() ) {
             if ( DEBUG_TRACE_SWITCH ) {
                 System.err.println(getThreadName() + ": Create GL context REJECTED (zero surface size) obj " + toHexString(hashCode()) + ", surf "+toHexString(drawable.getHandle())+" for " + getClass().getName());
                 System.err.println(drawable.toString());
@@ -702,13 +704,32 @@ public abstract class GLContextImpl extends GLContext {
                     } else {
                         reqMajor = ctxVersion.getMajor();
                     }
+                    final boolean isCompat;
                     if( 0 != ( ctxOptions & GLContext.CTX_PROFILE_CORE) ) {
                         reqProfile = GLContext.CTX_PROFILE_CORE;
+                        isCompat = false;
                     } else {
                         reqProfile = GLContext.CTX_PROFILE_COMPAT;
+                        isCompat = true;
+                    }
+                    GLContext.mapAvailableGLVersion(device, reqMajor, reqProfile, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
+                    // Perform all required profile mappings
+                    if( isCompat ) {
+                        // COMPAT via non ARB
+                        GLContext.mapAvailableGLVersion(device, reqMajor, GLContext.CTX_PROFILE_CORE, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
+                        if( reqMajor >= 4 ) {
+                            GLContext.mapAvailableGLVersion(device, 3, reqProfile, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
+                            GLContext.mapAvailableGLVersion(device, 3, GLContext.CTX_PROFILE_CORE, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
+                        }
+                        if( reqMajor >= 3 ) {
+                            GLContext.mapAvailableGLVersion(device, 2, reqProfile, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
+                        }
+                    } else {
+                        // CORE via non ARB, unlikely, however ..
+                        if( reqMajor >= 4 ) {
+                            GLContext.mapAvailableGLVersion(device, 3, reqProfile, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
+                        }
                     }
-                    GLContext.mapAvailableGLVersion(device, reqMajor, reqProfile,
-                                                    ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
                     GLContext.setAvailableGLVersionsSet(device);
 
                     if (DEBUG) {
@@ -728,14 +749,14 @@ public abstract class GLContextImpl extends GLContext {
   /**
    * Calls {@link GLDrawableImpl#associateContext(GLContext, boolean)}
    */
-  protected void associateDrawable(boolean bound) {
+  protected void associateDrawable(final boolean bound) {
       drawable.associateContext(this, bound);
   }
 
   /**
    * Calls {@link GLDrawableImpl#contextMadeCurrent(GLContext, boolean)}
    */
-  protected void contextMadeCurrent(boolean current) {
+  protected void contextMadeCurrent(final boolean current) {
       drawable.contextMadeCurrent(this, current);
   }
 
@@ -818,6 +839,9 @@ public abstract class GLContextImpl extends GLContext {
    */
   protected final long createContextARB(final long share, final boolean direct)
   {
+    if( GLProfile.disableOpenGLARBContext ) {
+        return 0;
+    }
     final AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration();
     final AbstractGraphicsDevice device = config.getScreen().getDevice();
 
@@ -840,9 +864,9 @@ public abstract class GLContextImpl extends GLContext {
     if(DEBUG) {
         System.err.println(getThreadName() + ": createContextARB: Requested "+GLContext.getGLVersion(reqMajorCTP[0], 0, reqMajorCTP[0], null));
     }
-    int _major[] = { 0 };
-    int _minor[] = { 0 };
-    int _ctp[] = { 0 };
+    final int _major[] = { 0 };
+    final int _minor[] = { 0 };
+    final int _ctp[] = { 0 };
     long _ctx = 0;
     if( GLContext.getAvailableGLVersion(device, reqMajorCTP[0], reqMajorCTP[1],
                                         _major, _minor, _ctp)) {
@@ -860,7 +884,7 @@ public abstract class GLContextImpl extends GLContext {
     return _ctx;
   }
 
-  private final boolean mapGLVersions(AbstractGraphicsDevice device) {
+  private final boolean mapGLVersions(final AbstractGraphicsDevice device) {
     synchronized (GLContext.deviceVersionAvailable) {
         final long t0 = ( DEBUG ) ? System.nanoTime() : 0;
         boolean success = false;
@@ -879,7 +903,7 @@ public abstract class GLContextImpl extends GLContext {
             /**
              * OSX 10.9 GLRendererQuirks.GL4NeedsGL3Request, quirk is added as usual @ setRendererQuirks(..)
              */
-            if( !hasGL4 && !hasGL3 ) {
+            if( !GLProfile.disableOpenGLCore && !hasGL4 && !hasGL3 ) {
                 hasGL3   = createContextARBMapVersionsAvailable(3, CTX_PROFILE_CORE);    // GL3
                 success |= hasGL3;
                 if( hasGL3 ) {
@@ -896,25 +920,27 @@ public abstract class GLContextImpl extends GLContext {
                 }
             }
         }
-        if( !hasGL4 ) {
-            hasGL4   = createContextARBMapVersionsAvailable(4, CTX_PROFILE_CORE);    // GL4
-            success |= hasGL4;
-            if( hasGL4 ) {
-                if( 0 == ( CTX_IMPL_ACCEL_SOFT & ctxOptions ) ) {
-                    // Map hw-accel GL4 to all lower core profiles: GL3
-                    GLContext.mapAvailableGLVersion(device, 3, CTX_PROFILE_CORE, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
-                    if( PROFILE_ALIASING ) {
-                        hasGL3   = true;
+        if( !GLProfile.disableOpenGLCore ) {
+            if( !hasGL4 ) {
+                hasGL4   = createContextARBMapVersionsAvailable(4, CTX_PROFILE_CORE);    // GL4
+                success |= hasGL4;
+                if( hasGL4 ) {
+                    if( 0 == ( CTX_IMPL_ACCEL_SOFT & ctxOptions ) ) {
+                        // Map hw-accel GL4 to all lower core profiles: GL3
+                        GLContext.mapAvailableGLVersion(device, 3, CTX_PROFILE_CORE, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
+                        if( PROFILE_ALIASING ) {
+                            hasGL3   = true;
+                        }
                     }
+                    resetStates(false); // clean context states, since creation was temporary
                 }
-                resetStates(false); // clean context states, since creation was temporary
             }
-        }
-        if( !hasGL3 ) {
-            hasGL3   = createContextARBMapVersionsAvailable(3, CTX_PROFILE_CORE);    // GL3
-            success |= hasGL3;
-            if( hasGL3 ) {
-                resetStates(false); // clean this context states, since creation was temporary
+            if( !hasGL3 ) {
+                hasGL3   = createContextARBMapVersionsAvailable(3, CTX_PROFILE_CORE);    // GL3
+                success |= hasGL3;
+                if( hasGL3 ) {
+                    resetStates(false); // clean this context states, since creation was temporary
+                }
             }
         }
         if( !hasGL4bc ) {
@@ -985,7 +1011,7 @@ public abstract class GLContextImpl extends GLContext {
    * Note: Since context creation is temporary, caller need to issue {@link #resetStates(boolean)}, if creation was successful, i.e. returns true.
    * This method does not reset the states, allowing the caller to utilize the state variables.
    **/
-  private final boolean createContextARBMapVersionsAvailable(int reqMajor, int reqProfile) {
+  private final boolean createContextARBMapVersionsAvailable(final int reqMajor, final int reqProfile) {
     long _context;
     int ctp = CTX_IS_ARB_CREATED | reqProfile;
 
@@ -994,8 +1020,8 @@ public abstract class GLContextImpl extends GLContext {
     // so the user can always cast to the highest available one.
     int majorMax, minorMax;
     int majorMin, minorMin;
-    int major[] = new int[1];
-    int minor[] = new int[1];
+    final int major[] = new int[1];
+    final int minor[] = new int[1];
     if( 4 == reqMajor ) {
         majorMax=4; minorMax=GLContext.getMaxMinor(ctp, majorMax);
         majorMin=4; minorMin=0;
@@ -1034,7 +1060,7 @@ public abstract class GLContextImpl extends GLContext {
     }
     final boolean res;
     if( 0 != _context ) {
-        AbstractGraphicsDevice device = drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
+        final AbstractGraphicsDevice device = drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice();
         // ctxMajorVersion, ctxMinorVersion, ctxOptions is being set by
         //   createContextARBVersions(..) -> setGLFunctionAvailbility(..) -> setContextVersion(..)
         GLContext.mapAvailableGLVersion(device, reqMajor, reqProfile, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
@@ -1052,10 +1078,10 @@ public abstract class GLContextImpl extends GLContext {
     return res;
   }
 
-  private final long createContextARBVersions(long share, boolean direct, int ctxOptionFlags,
-                                              int majorMax, int minorMax,
-                                              int majorMin, int minorMin,
-                                              int major[], int minor[]) {
+  private final long createContextARBVersions(final long share, final boolean direct, final int ctxOptionFlags,
+                                              final int majorMax, final int minorMax,
+                                              final int majorMin, final int minorMin,
+                                              final int major[], final int minor[]) {
     major[0]=majorMax;
     minor[0]=minorMax;
     long _context=0;
@@ -1097,7 +1123,7 @@ public abstract class GLContextImpl extends GLContext {
    * If major > 0 || minor > 0 : Use passed values, determined at creation time
    * Otherwise .. don't touch ..
    */
-  private final void setContextVersion(int major, int minor, int ctp, VersionNumberString glVendorVersion, boolean useGL) {
+  private final void setContextVersion(final int major, final int minor, final int ctp, final VersionNumberString glVendorVersion, final boolean useGL) {
       if ( 0 == ctp ) {
         throw new GLException("Invalid GL Version "+major+"."+minor+", ctp "+toHexString(ctp));
       }
@@ -1126,16 +1152,16 @@ public abstract class GLContextImpl extends GLContext {
   // Helpers for various context implementations
   //
 
-  private Object createInstance(GLProfile glp, boolean glObject, Object[] cstrArgs) {
+  private Object createInstance(final GLProfile glp, final boolean glObject, final Object[] cstrArgs) {
       return ReflectionUtil.createInstance(glp.getGLCtor(glObject), cstrArgs);
   }
 
-  private boolean verifyInstance(GLProfile glp, String suffix, Object instance) {
+  private boolean verifyInstance(final GLProfile glp, final String suffix, final Object instance) {
       return ReflectionUtil.instanceOf(instance, glp.getGLImplBaseClassName()+suffix);
   }
 
   /** Create the GL for this context. */
-  protected GL createGL(GLProfile glp) {
+  protected GL createGL(final GLProfile glp) {
     final GL gl = (GL) createInstance(glp, true, new Object[] { glp, this } );
 
     /* FIXME: refactor dependence on Java 2D / JOGL bridge
@@ -1152,13 +1178,13 @@ public abstract class GLContextImpl extends GLContext {
    * Method calls 'void finalizeInit()' of instance 'gl' as retrieved by reflection, if exist.
    * </p>
    */
-  private void finalizeInit(GL gl) {
+  private void finalizeInit(final GL gl) {
       Method finalizeInit = null;
       try {
           finalizeInit = ReflectionUtil.getMethod(gl.getClass(), "finalizeInit", new Class<?>[]{ });
-      } catch ( Throwable t ) {
+      } catch ( final Throwable t ) {
           if(DEBUG) {
-              System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage());
+              System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage());
               t.printStackTrace();
           }
       }
@@ -1198,9 +1224,9 @@ public abstract class GLContextImpl extends GLContext {
   /** Maps the given "platform-independent" function name to a real function
       name. Currently this is only used to map "glAllocateMemoryNV" and
       associated routines to wglAllocateMemoryNV / glXAllocateMemoryNV. */
-  protected final String mapToRealGLFunctionName(String glFunctionName) {
-    Map<String, String> map = getFunctionNameMap();
-    String lookup = ( null != map ) ? map.get(glFunctionName) : null;
+  protected final String mapToRealGLFunctionName(final String glFunctionName) {
+    final Map<String, String> map = getFunctionNameMap();
+    final String lookup = ( null != map ) ? map.get(glFunctionName) : null;
     if (lookup != null) {
       return lookup;
     }
@@ -1213,9 +1239,9 @@ public abstract class GLContextImpl extends GLContext {
       "GL_ARB_pbuffer"      to  "WGL_ARB_pbuffer/GLX_SGIX_pbuffer" and
       "GL_ARB_pixel_format" to  "WGL_ARB_pixel_format/n.a."
    */
-  protected final String mapToRealGLExtensionName(String glExtensionName) {
-    Map<String, String> map = getExtensionNameMap();
-    String lookup = ( null != map ) ? map.get(glExtensionName) : null;
+  protected final String mapToRealGLExtensionName(final String glExtensionName) {
+    final Map<String, String> map = getExtensionNameMap();
+    final String lookup = ( null != map ) ? map.get(glExtensionName) : null;
     if (lookup != null) {
       return lookup;
     }
@@ -1287,12 +1313,12 @@ public abstract class GLContextImpl extends GLContext {
    * Note: Non ARB ctx is limited to GL 3.0.
    * </p>
    */
-  private static final VersionNumber getGLVersionNumber(int ctp, String glVersionStr) {
+  private static final VersionNumber getGLVersionNumber(final int ctp, final String glVersionStr) {
       if( null != glVersionStr ) {
           final GLVersionNumber version = GLVersionNumber.create(glVersionStr);
           if ( version.isValid() ) {
-              int[] major = new int[] { version.getMajor() };
-              int[] minor = new int[] { version.getMinor() };
+              final int[] major = new int[] { version.getMajor() };
+              final int[] minor = new int[] { version.getMinor() };
               if ( GLContext.isValidGLVersion(ctp, major[0], minor[0]) ) {
                   return new VersionNumber(major[0], minor[0], 0);
               }
@@ -1308,7 +1334,7 @@ public abstract class GLContextImpl extends GLContext {
    * If the GL query fails, major will be zero.
    * </p>
    */
-  private final boolean getGLIntVersion(int[] glIntMajor, int[] glIntMinor)  {
+  private final boolean getGLIntVersion(final int[] glIntMajor, final int[] glIntMinor)  {
     glIntMajor[0] = 0; // clear
     final GLDynamicLookupHelper glDynLookupHelper = getDrawableImpl().getGLDynamicLookupHelper();
     final long _glGetIntegerv = glDynLookupHelper.dynamicLookupFunction("glGetIntegerv");
@@ -1319,8 +1345,8 @@ public abstract class GLContextImpl extends GLContext {
         }
         return false;
     } else {
-        glGetIntegervInt(GL2GL3.GL_MAJOR_VERSION, glIntMajor, 0, _glGetIntegerv);
-        glGetIntegervInt(GL2GL3.GL_MINOR_VERSION, glIntMinor, 0, _glGetIntegerv);
+        glGetIntegervInt(GL2ES3.GL_MAJOR_VERSION, glIntMajor, 0, _glGetIntegerv);
+        glGetIntegervInt(GL2ES3.GL_MINOR_VERSION, glIntMinor, 0, _glGetIntegerv);
         return true;
     }
   }
@@ -1351,7 +1377,7 @@ public abstract class GLContextImpl extends GLContext {
    *                      <li>match ES major versions</li>
    *                    </ul>, otherwise method aborts and returns <code>false</code>.<br>
    *                    if <code>false</code> no version check is performed.
-   * @param withinGLVersionsMapping if <code>true</code> GL version mapping is in process, i.e. quering avail versions.
+   * @param withinGLVersionsMapping if <code>true</code> GL version mapping is in process, i.e. querying avail versions.
    *                                Otherwise normal user context creation.
    * @return returns <code>true</code> if successful, otherwise <code>false</code>.<br>
    *                 If <code>strictMatch</code> is <code>false</code> method shall always return <code>true</code> or throw an exception.
@@ -1361,8 +1387,8 @@ public abstract class GLContextImpl extends GLContext {
    * @see javax.media.opengl.GLContext#CTX_PROFILE_COMPAT
    * @see javax.media.opengl.GLContext#CTX_IMPL_ES2_COMPAT
    */
-  protected final boolean setGLFunctionAvailability(boolean force, int major, int minor, int ctxProfileBits,
-                                                    boolean strictMatch, boolean withinGLVersionsMapping) {
+  protected final boolean setGLFunctionAvailability(final boolean force, int major, int minor, int ctxProfileBits,
+                                                    final boolean strictMatch, final boolean withinGLVersionsMapping) {
     if(null!=this.gl && null!=glProcAddressTable && !force) {
         return true; // already done and not forced
     }
@@ -1666,10 +1692,10 @@ public abstract class GLContextImpl extends GLContext {
   }
 
   private final void setRendererQuirks(final AbstractGraphicsDevice adevice, final GLDrawableFactoryImpl factory,
-                                       int reqMajor, int reqMinor, int reqCTP,
-                                       int major, int minor, int ctp, final VersionNumberString vendorVersion,
-                                       boolean withinGLVersionsMapping) {
-    int[] quirks = new int[GLRendererQuirks.COUNT + 1]; // + 1 ( NoFullFBOSupport )
+                                       final int reqMajor, final int reqMinor, final int reqCTP,
+                                       final int major, final int minor, final int ctp, final VersionNumberString vendorVersion,
+                                       final boolean withinGLVersionsMapping) {
+    final int[] quirks = new int[GLRendererQuirks.COUNT + 1]; // + 1 ( NoFullFBOSupport )
     int i = 0;
 
     final String MesaSP = "Mesa ";
@@ -1869,13 +1895,26 @@ public abstract class GLContextImpl extends GLContext {
           quirks[i++] = quirk;
         }
         if( glRenderer.contains( MesaRendererIntelsp ) &&
-            vendorVersion.compareTo(mesaIntelBuggySharedCtx921) >= 0 && isX11 ) {
+            vendorVersion.compareTo(mesaIntelBuggySharedCtx921) >= 0 && isX11 ) { // FIXME: When is it fixed ?
           final int quirk = GLRendererQuirks.GLSharedContextBuggy;
           if(DEBUG) {
               System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: X11 / Renderer " + glRenderer + " / Mesa-Version "+vendorVersion);
           }
           quirks[i++] = quirk;
         }
+        if( glVendor.contains( "nouveau" )
+            // FIXME: && vendorVersion.compareTo(nouveauBuggyMSAAFixed) < 0
+          ) {
+          final int quirk = GLRendererQuirks.NoMultiSamplingBuffers;
+          if(DEBUG) {
+              System.err.println("Quirk: "+GLRendererQuirks.toString(quirk)+": cause: X11 / Renderer " + glRenderer + " / Vendor "+glVendor);
+          }
+          quirks[i++] = quirk;
+          if( withinGLVersionsMapping ) {
+              // Thread safe due to single threaded initialization!
+              GLRendererQuirks.addStickyDeviceQuirks(adevice, quirks, i-1, 1);
+          }
+        }
         if( isWindows && glRenderer.contains("SVGA3D") ) {
             final VersionNumber mesaSafeFBOVersion = new VersionNumber(8, 0, 0);
             if ( vendorVersion.compareTo(mesaSafeFBOVersion) < 0 ) { // includes: vendorVersion.isZero()
@@ -1925,23 +1964,24 @@ public abstract class GLContextImpl extends GLContext {
     }
   }
 
-  private static final boolean hasFBOImpl(int major, int ctp, ExtensionAvailabilityCache extCache) {
-    return ( 0 != (ctp & CTX_PROFILE_ES) && major >= 2 ) ||   // ES >= 2.0
+  private static final boolean hasFBOImpl(final int major, final int ctp, final ExtensionAvailabilityCache extCache) {
+    return ( 0 != (ctp & CTX_PROFILE_ES) && major >= 2 ) ||                           // ES >= 2.0
 
-           major >= 3 ||                                                 // any >= 3.0 GL ctx (core, compat and ES)
+           major >= 3 ||                                                              // any >= 3.0 GL ctx (core, compat and ES)
 
            ( null != extCache &&
+             (
+               extCache.isExtensionAvailable(GLExtensions.ARB_ES2_compatibility)  ||  // ES 2.0 compatible
 
-               extCache.isExtensionAvailable(GLExtensions.ARB_ES2_compatibility)  ||         // ES 2.0 compatible
+               extCache.isExtensionAvailable(GLExtensions.ARB_framebuffer_object) ||  // ARB_framebuffer_object
 
-               extCache.isExtensionAvailable(GLExtensions.ARB_framebuffer_object) ||         // ARB_framebuffer_object
+               extCache.isExtensionAvailable(GLExtensions.EXT_framebuffer_object) ||  // EXT_framebuffer_object
 
-               extCache.isExtensionAvailable(GLExtensions.EXT_framebuffer_object) ||         // EXT_framebuffer_object
-
-               extCache.isExtensionAvailable(GLExtensions.OES_framebuffer_object) ) ;        // OES_framebuffer_object excluded
+               extCache.isExtensionAvailable(GLExtensions.OES_framebuffer_object)     // OES_framebuffer_object
+             ) );
   }
 
-  private final void removeCachedVersion(int major, int minor, int ctxProfileBits) {
+  private final void removeCachedVersion(final int major, final int minor, int ctxProfileBits) {
     if(!isCurrentContextHardwareRasterizer()) {
         ctxProfileBits |= GLContext.CTX_IMPL_ACCEL_SOFT;
     }
@@ -1993,14 +2033,14 @@ public abstract class GLContextImpl extends GLContext {
   protected abstract StringBuilder getPlatformExtensionsStringImpl();
 
   @Override
-  public final boolean isFunctionAvailable(String glFunctionName) {
+  public final boolean isFunctionAvailable(final String glFunctionName) {
     // Check GL 1st (cached)
     if(null!=glProcAddressTable) { // null if this context wasn't not created
         try {
             if( glProcAddressTable.isFunctionAvailable( glFunctionName ) ) {
                 return true;
             }
-        } catch (Exception e) {}
+        } catch (final Exception e) {}
     }
 
     // Check platform extensions 2nd (cached) - context had to be enabled once
@@ -2010,25 +2050,25 @@ public abstract class GLContextImpl extends GLContext {
             if( pTable.isFunctionAvailable( glFunctionName ) ) {
                 return true;
             }
-        } catch (Exception e) {}
+        } catch (final Exception e) {}
     }
 
     // dynamic function lookup at last incl name aliasing (not cached)
     final DynamicLookupHelper dynLookup = getDrawableImpl().getGLDynamicLookupHelper();
     final String tmpBase = GLNameResolver.normalizeVEN(GLNameResolver.normalizeARB(glFunctionName, true), true);
     boolean res = false;
-    int  variants = GLNameResolver.getFuncNamePermutationNumber(tmpBase);
+    final int  variants = GLNameResolver.getFuncNamePermutationNumber(tmpBase);
     for(int i = 0; !res && i < variants; i++) {
         final String tmp = GLNameResolver.getFuncNamePermutation(tmpBase, i);
         try {
             res = dynLookup.isFunctionAvailable(tmp);
-        } catch (Exception e) { }
+        } catch (final Exception e) { }
     }
     return res;
   }
 
   @Override
-  public final boolean isExtensionAvailable(String glExtensionName) {
+  public final boolean isExtensionAvailable(final String glExtensionName) {
       if(null!=extensionAvailability) {
         return extensionAvailability.isExtensionAvailable(mapToRealGLExtensionName(glExtensionName));
       }
@@ -2068,7 +2108,7 @@ public abstract class GLContextImpl extends GLContext {
       return false;
   }
 
-  protected static String getContextFQN(AbstractGraphicsDevice device, int major, int minor, int ctxProfileBits) {
+  protected static String getContextFQN(final AbstractGraphicsDevice device, final int major, final int minor, int ctxProfileBits) {
       // remove non-key values
       ctxProfileBits &= CTX_IMPL_CACHE_MASK;
 
@@ -2079,13 +2119,6 @@ public abstract class GLContextImpl extends GLContext {
       return contextFQN;
   }
 
-  /** Indicates which floating-point pbuffer implementation is in
-      use. Returns one of GLPbuffer.APPLE_FLOAT, GLPbuffer.ATI_FLOAT,
-      or GLPbuffer.NV_FLOAT. */
-  public int getFloatingPointMode() throws GLException {
-    throw new GLException("Not supported on non-pbuffer contexts");
-  }
-
   @Override
   public int getDefaultPixelDataType() {
       evalPixelDataType();
@@ -2157,7 +2190,7 @@ public abstract class GLContextImpl extends GLContext {
    * Method exists merely for code validation of {@link #isCurrent()}.
    * </p>
    */
-  public final boolean isOwner(Thread thread) {
+  public final boolean isOwner(final Thread thread) {
       return lock.isOwner(thread);
   }
 
@@ -2195,7 +2228,7 @@ public abstract class GLContextImpl extends GLContext {
    *
    * <p>Does not throw an exception if <code>target</code> is unknown or <code>framebufferName</code> invalid.</p>
    */
-  public final void setBoundFramebuffer(int target, int framebufferName) {
+  public final void setBoundFramebuffer(final int target, final int framebufferName) {
       if(0 > framebufferName) {
           return; // ignore invalid name
       }
@@ -2204,22 +2237,22 @@ public abstract class GLContextImpl extends GLContext {
               boundFBOTarget[0] = framebufferName; // draw
               boundFBOTarget[1] = framebufferName; // read
               break;
-          case GL2GL3.GL_DRAW_FRAMEBUFFER:
+          case GL2ES3.GL_DRAW_FRAMEBUFFER:
               boundFBOTarget[0] = framebufferName; // draw
               break;
-          case GL2GL3.GL_READ_FRAMEBUFFER:
+          case GL2ES3.GL_READ_FRAMEBUFFER:
               boundFBOTarget[1] = framebufferName; // read
               break;
           default: // ignore untracked target
       }
   }
   @Override
-  public final int getBoundFramebuffer(int target) {
+  public final int getBoundFramebuffer(final int target) {
       switch(target) {
           case GL.GL_FRAMEBUFFER:
-          case GL2GL3.GL_DRAW_FRAMEBUFFER:
+          case GL2ES3.GL_DRAW_FRAMEBUFFER:
               return boundFBOTarget[0]; // draw
-          case GL2GL3.GL_READ_FRAMEBUFFER:
+          case GL2ES3.GL_READ_FRAMEBUFFER:
               return boundFBOTarget[1]; // read
           default:
               throw new InternalError("Invalid FBO target name: "+toHexString(target));
@@ -2253,7 +2286,7 @@ public abstract class GLContextImpl extends GLContext {
   }
 
   @Override
-  public final void setContextCreationFlags(int flags) {
+  public final void setContextCreationFlags(final int flags) {
       if(!isCreated()) {
           additionalCtxCreationFlags = flags & GLContext.CTX_OPTION_DEBUG;
       }
@@ -2263,12 +2296,12 @@ public abstract class GLContextImpl extends GLContext {
   public final boolean isGLDebugSynchronous() { return glDebugHandler.isSynchronous(); }
 
   @Override
-  public final void setGLDebugSynchronous(boolean synchronous) {
+  public final void setGLDebugSynchronous(final boolean synchronous) {
       glDebugHandler.setSynchronous(synchronous);
   }
 
   @Override
-  public final void enableGLDebugMessage(boolean enable) throws GLException {
+  public final void enableGLDebugMessage(final boolean enable) throws GLException {
       if(!isCreated()) {
           if(enable) {
               additionalCtxCreationFlags |=  GLContext.CTX_OPTION_DEBUG;
@@ -2282,17 +2315,17 @@ public abstract class GLContextImpl extends GLContext {
   }
 
   @Override
-  public final void addGLDebugListener(GLDebugListener listener) {
+  public final void addGLDebugListener(final GLDebugListener listener) {
       glDebugHandler.addListener(listener);
   }
 
   @Override
-  public final void removeGLDebugListener(GLDebugListener listener) {
+  public final void removeGLDebugListener(final GLDebugListener listener) {
       glDebugHandler.removeListener(listener);
   }
 
   @Override
-  public final void glDebugMessageControl(int source, int type, int severity, int count, IntBuffer ids, boolean enabled) {
+  public final void glDebugMessageControl(final int source, final int type, final int severity, final int count, final IntBuffer ids, final boolean enabled) {
       if(glDebugHandler.isExtensionARB()) {
           gl.getGL2GL3().glDebugMessageControl(source, type, severity, count, ids, enabled);
       } else if(glDebugHandler.isExtensionAMD()) {
@@ -2301,7 +2334,7 @@ public abstract class GLContextImpl extends GLContext {
   }
 
   @Override
-  public final void glDebugMessageControl(int source, int type, int severity, int count, int[] ids, int ids_offset, boolean enabled) {
+  public final void glDebugMessageControl(final int source, final int type, final int severity, final int count, final int[] ids, final int ids_offset, final boolean enabled) {
       if(glDebugHandler.isExtensionARB()) {
           gl.getGL2GL3().glDebugMessageControl(source, type, severity, count, ids, ids_offset, enabled);
       } else if(glDebugHandler.isExtensionAMD()) {
@@ -2310,7 +2343,7 @@ public abstract class GLContextImpl extends GLContext {
   }
 
   @Override
-  public final void glDebugMessageInsert(int source, int type, int id, int severity, String buf) {
+  public final void glDebugMessageInsert(final int source, final int type, final int id, final int severity, final String buf) {
       final int len = (null != buf) ? buf.length() : 0;
       if(glDebugHandler.isExtensionARB()) {
           gl.getGL2GL3().glDebugMessageInsert(source, type, id, severity, len, buf);
diff --git a/src/jogl/classes/jogamp/opengl/GLContextShareSet.java b/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
index c057c90..209707f 100644
--- a/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
+++ b/src/jogl/classes/jogamp/opengl/GLContextShareSet.java
@@ -143,7 +143,7 @@ public class GLContextShareSet {
     if (lastContext == null) {
       throw new IllegalArgumentException("Last context is null");
     }
-    ShareSet share = entryFor(lastContext);
+    final ShareSet share = entryFor(lastContext);
     if (share == null) {
       throw new GLException("Last context is unknown: "+lastContext);
     }
@@ -159,8 +159,8 @@ public class GLContextShareSet {
       System.err.println("GLContextShareSet: unregisterSharing: " +
               toHexString(lastContext.getHandle())+", entries: "+s.size());
     }
-    for(Iterator<GLContext> iter = s.iterator() ; iter.hasNext() ; ) {
-        GLContext ctx = iter.next();
+    for(final Iterator<GLContext> iter = s.iterator() ; iter.hasNext() ; ) {
+        final GLContext ctx = iter.next();
         if(null == removeEntry(ctx)) {
             throw new GLException("Removal of shareSet for context failed");
         }
@@ -207,7 +207,7 @@ public class GLContextShareSet {
   }
 
   /** Returns true if the given GLContext has shared and created GLContext left including itself, otherwise false. */
-  public static synchronized boolean hasCreatedSharedLeft(GLContext context) {
+  public static synchronized boolean hasCreatedSharedLeft(final GLContext context) {
       final Set<GLContext> s = getCreatedSharesImpl(context);
       return null != s && s.size() > 0;
   }
@@ -279,7 +279,7 @@ public class GLContextShareSet {
     return shareMap.remove(context);
   }
 
-  private static String toHexString(long hex) {
+  private static String toHexString(final long hex) {
     return "0x" + Long.toHexString(hex);
   }
 }
diff --git a/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
index 2c94769..7519d56 100644
--- a/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
+++ b/src/jogl/classes/jogamp/opengl/GLDebugMessageHandler.java
@@ -32,11 +32,14 @@ import java.security.PrivilegedAction;
 import java.util.ArrayList;
 
 import javax.media.nativewindow.NativeWindowException;
+import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLDebugListener;
 import javax.media.opengl.GLDebugMessage;
 import javax.media.opengl.GLException;
 
+import jogamp.common.os.PlatformPropsImpl;
+
 import com.jogamp.common.os.Platform;
 import com.jogamp.gluegen.runtime.ProcAddressTable;
 import com.jogamp.opengl.GLExtensions;
@@ -84,7 +87,7 @@ public class GLDebugMessageHandler {
      * @param ctx the associated GLContext
      * @param glDebugExtension chosen extension to use
      */
-    public GLDebugMessageHandler(GLContextImpl ctx) {
+    public GLDebugMessageHandler(final GLContextImpl ctx) {
         this.ctx = ctx;
         this.listenerImpl = new ListenerSyncedImplStub<GLDebugListener>();
         this.glDebugMessageCallbackProcAddress = 0;
@@ -95,7 +98,7 @@ public class GLDebugMessageHandler {
         this.synchronous = true;
     }
 
-    public void init(boolean enable) {
+    public void init(final boolean enable) {
         if(DEBUG) {
             System.err.println("GLDebugMessageHandler.init("+enable+")");
         }
@@ -113,7 +116,7 @@ public class GLDebugMessageHandler {
             public Long run() {
                 try {
                     return Long.valueOf( table.getAddressFor(functionName) );
-                } catch (IllegalArgumentException iae) {
+                } catch (final IllegalArgumentException iae) {
                     return Long.valueOf(0);
                 }
             }
@@ -132,7 +135,7 @@ public class GLDebugMessageHandler {
             }
             return;
         }
-        if(Platform.OS_TYPE == Platform.OSType.WINDOWS && Platform.is32Bit()) {
+        if(PlatformPropsImpl.OS_TYPE == Platform.OSType.WINDOWS && Platform.is32Bit()) {
             // Currently buggy, ie. throws an exception after leaving the native callback.
             // Probably a 32bit on 64bit JVM / OpenGL-driver issue.
             if(DEBUG) {
@@ -216,7 +219,7 @@ public class GLDebugMessageHandler {
     /**
      * @see javax.media.opengl.GLContext#setGLDebugSynchronous(boolean)
      */
-    public final void setSynchronous(boolean synchronous) {
+    public final void setSynchronous(final boolean synchronous) {
         this.synchronous = synchronous;
         if( isEnabled() ) {
             setSynchronousImpl();
@@ -225,9 +228,9 @@ public class GLDebugMessageHandler {
     private final void setSynchronousImpl() {
         if(isExtensionARB()) {
             if(synchronous) {
-                ctx.getGL().glEnable(GL2GL3.GL_DEBUG_OUTPUT_SYNCHRONOUS);
+                ctx.getGL().glEnable(GL2ES2.GL_DEBUG_OUTPUT_SYNCHRONOUS);
             } else {
-                ctx.getGL().glDisable(GL2GL3.GL_DEBUG_OUTPUT_SYNCHRONOUS);
+                ctx.getGL().glDisable(GL2ES2.GL_DEBUG_OUTPUT_SYNCHRONOUS);
             }
             if(DEBUG) {
                 System.err.println("GLDebugMessageHandler: synchronous "+synchronous);
@@ -238,14 +241,14 @@ public class GLDebugMessageHandler {
     /**
      * @see javax.media.opengl.GLContext#enableGLDebugMessage(boolean)
      */
-    public final void enable(boolean enable) throws GLException {
+    public final void enable(final boolean enable) throws GLException {
         ctx.validateCurrent();
         if(!isAvailable()) {
             return;
         }
         enableImpl(enable);
     }
-    final void enableImpl(boolean enable) throws GLException {
+    final void enableImpl(final boolean enable) throws GLException {
         if(enable) {
             if(0 == handle) {
                 setSynchronousImpl();
@@ -271,19 +274,19 @@ public class GLDebugMessageHandler {
         return listenerImpl.size();
     }
 
-    public final void addListener(GLDebugListener listener) {
+    public final void addListener(final GLDebugListener listener) {
         listenerImpl.addListener(-1, listener);
     }
 
-    public final void addListener(int index, GLDebugListener listener) {
+    public final void addListener(final int index, final GLDebugListener listener) {
         listenerImpl.addListener(index, listener);
     }
 
-    public final void removeListener(GLDebugListener listener) {
+    public final void removeListener(final GLDebugListener listener) {
         listenerImpl.removeListener(listener);
     }
 
-    private final void sendMessage(GLDebugMessage msg) {
+    private final void sendMessage(final GLDebugMessage msg) {
         synchronized(listenerImpl) {
             if(DEBUG) {
                 System.err.println("GLDebugMessageHandler: "+msg);
@@ -298,11 +301,11 @@ public class GLDebugMessageHandler {
     public static class StdErrGLDebugListener implements GLDebugListener {
         boolean threadDump;
 
-        public StdErrGLDebugListener(boolean threadDump) {
+        public StdErrGLDebugListener(final boolean threadDump) {
             this.threadDump = threadDump;
         }
         @Override
-        public void messageSent(GLDebugMessage event) {
+        public void messageSent(final GLDebugMessage event) {
             System.err.println(event);
             if(threadDump) {
                 Thread.dumpStack();
@@ -314,12 +317,12 @@ public class GLDebugMessageHandler {
     // native -> java
     //
 
-    protected final void glDebugMessageARB(int source, int type, int id, int severity, String msg) {
+    protected final void glDebugMessageARB(final int source, final int type, final int id, final int severity, final String msg) {
         final GLDebugMessage event = new GLDebugMessage(ctx, System.currentTimeMillis(), source, type, id, severity, msg);
         sendMessage(event);
     }
 
-    protected final void glDebugMessageAMD(int id, int category, int severity, String msg) {
+    protected final void glDebugMessageAMD(final int id, final int category, final int severity, final String msg) {
         final GLDebugMessage event = GLDebugMessage.translateAMDEvent(ctx, System.currentTimeMillis(), id, category, severity, msg);
         sendMessage(event);
     }
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
index c914b5e..8d65f16 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableFactoryImpl.java
@@ -41,8 +41,14 @@
 package jogamp.opengl;
 
 import java.nio.Buffer;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Set;
 
+import javax.media.nativewindow.AbstractGraphicsConfiguration;
 import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.AbstractGraphicsScreen;
 import javax.media.nativewindow.NativeSurface;
 import javax.media.nativewindow.NativeWindowFactory;
 import javax.media.nativewindow.OffscreenLayerSurface;
@@ -59,7 +65,6 @@ import javax.media.opengl.GLDrawableFactory;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLFBODrawable;
 import javax.media.opengl.GLOffscreenAutoDrawable;
-import javax.media.opengl.GLPbuffer;
 import javax.media.opengl.GLProfile;
 
 import com.jogamp.nativewindow.MutableGraphicsConfiguration;
@@ -74,7 +79,6 @@ import com.jogamp.opengl.GLRendererQuirks;
     Independent Bitmaps on Windows, pixmaps on X11). Direct access to
     these GLDrawables is not supplied directly to end users, though
     they may be instantiated by the GLJPanel implementation. */
- at SuppressWarnings("deprecation")
 public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   protected static final boolean DEBUG = GLDrawableFactory.DEBUG; // allow package access
 
@@ -95,9 +99,9 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
           if( null != device) {
               return getOrCreateSharedResourceImpl( device );
           }
-      } catch (GLException gle) {
+      } catch (final GLException gle) {
           if(DEBUG) {
-              System.err.println("Catched Exception on thread "+getThreadName());
+              System.err.println("Caught exception on thread "+getThreadName());
               gle.printStackTrace();
           }
       }
@@ -112,7 +116,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
    *
    * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared the target device, may be <code>null</code> for the platform's default device.
    */
-  public final GLContext getOrCreateSharedContext(AbstractGraphicsDevice device) {
+  public final GLContext getOrCreateSharedContext(final AbstractGraphicsDevice device) {
       final SharedResourceRunner.Resource sr = getOrCreateSharedResource( device );
       if(null!=sr) {
         return sr.getContext();
@@ -121,7 +125,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   }
 
   @Override
-  protected final boolean createSharedResourceImpl(AbstractGraphicsDevice device) {
+  protected final boolean createSharedResourceImpl(final AbstractGraphicsDevice device) {
       final SharedResourceRunner.Resource sr = getOrCreateSharedResource( device );
       if(null!=sr) {
           return sr.isValid();
@@ -130,7 +134,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   }
 
   @Override
-  public final GLRendererQuirks getRendererQuirks(AbstractGraphicsDevice device) {
+  public final GLRendererQuirks getRendererQuirks(final AbstractGraphicsDevice device) {
       final SharedResourceRunner.Resource sr = getOrCreateSharedResource( device );
       if(null!=sr) {
           return sr.getRendererQuirks();
@@ -145,7 +149,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
    *
    * @param device which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared device to be used, may be <code>null</code> for the platform's default device.
    */
-  protected final AbstractGraphicsDevice getOrCreateSharedDevice(AbstractGraphicsDevice device) {
+  protected final AbstractGraphicsDevice getOrCreateSharedDevice(final AbstractGraphicsDevice device) {
       final SharedResourceRunner.Resource sr = getOrCreateSharedResource( device );
       if(null!=sr) {
         return sr.getDevice();
@@ -164,7 +168,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   // Dispatching GLDrawable construction in respect to the NativeSurface Capabilities
   //
   @Override
-  public final GLDrawable createGLDrawable(NativeSurface target) {
+  public final GLDrawable createGLDrawable(final NativeSurface target) {
     if (target == null) {
       throw new IllegalArgumentException("Null target");
     }
@@ -251,42 +255,14 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   @Override
   public abstract boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp);
 
-  @Override
-  public final GLPbuffer createGLPbuffer(AbstractGraphicsDevice deviceReq,
-                                   GLCapabilitiesImmutable capsRequested,
-                                   GLCapabilitiesChooser chooser,
-                                   int width,
-                                   int height,
-                                   GLContext shareWith) {
-    if(width<=0 || height<=0) {
-        throw new GLException("initial size must be positive (were (" + width + " x " + height + "))");
-    }
-    AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
-    if(null == device) {
-        throw new GLException("No shared device for requested: "+deviceReq);
-    }
-    if ( !canCreateGLPbuffer(device, capsRequested.getGLProfile()) ) {
-        throw new GLException("Pbuffer not available with device: "+device);
-    }
-
-    final GLCapabilitiesImmutable capsChosen = GLGraphicsConfigurationUtil.fixGLPBufferGLCapabilities(capsRequested);
-    final GLDrawableImpl drawable = createOffscreenDrawableImpl( createMutableSurfaceImpl(device, true, capsChosen, capsRequested, chooser,
-                                                                 new UpstreamSurfaceHookMutableSize(width, height) ) );
-    if(null != drawable) {
-        drawable.setRealized(true);
-    }
-
-    return new GLPbufferImpl( drawable, (GLContextImpl) drawable.createContext(shareWith) );
-  }
-
   //---------------------------------------------------------------------------
   //
   // Offscreen GLDrawable construction
   //
 
   @Override
-  public final boolean canCreateFBO(AbstractGraphicsDevice deviceReq, GLProfile glp) {
-    AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
+  public final boolean canCreateFBO(final AbstractGraphicsDevice deviceReq, final GLProfile glp) {
+    final AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
     if(null == device) {
         throw new GLException("No shared device for requested: "+deviceReq);
     }
@@ -294,25 +270,10 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   }
 
   @Override
-  public final GLOffscreenAutoDrawable createOffscreenAutoDrawable(AbstractGraphicsDevice deviceReq,
-                                                             GLCapabilitiesImmutable capsRequested,
-                                                             GLCapabilitiesChooser chooser,
-                                                             int width, int height,
-                                                             GLContext shareWith) {
-    final GLDrawable drawable = createOffscreenDrawable( deviceReq, capsRequested, chooser, width, height );
-    drawable.setRealized(true);
-    final GLContext context = drawable.createContext(shareWith);
-    if(drawable instanceof GLFBODrawableImpl) {
-        return new GLOffscreenAutoDrawableImpl.FBOImpl( (GLFBODrawableImpl)drawable, context, null, null );
-    }
-    return new GLOffscreenAutoDrawableImpl( drawable, context, null, null);
-  }
-
-  @Override
-  public final GLOffscreenAutoDrawable createOffscreenAutoDrawable(AbstractGraphicsDevice deviceReq,
-                                                             GLCapabilitiesImmutable capsRequested,
-                                                             GLCapabilitiesChooser chooser,
-                                                             int width, int height) {
+  public final GLOffscreenAutoDrawable createOffscreenAutoDrawable(final AbstractGraphicsDevice deviceReq,
+                                                             final GLCapabilitiesImmutable capsRequested,
+                                                             final GLCapabilitiesChooser chooser,
+                                                             final int width, final int height) {
     final GLDrawable drawable = createOffscreenDrawable( deviceReq, capsRequested, chooser, width, height );
     drawable.setRealized(true);
     if(drawable instanceof GLFBODrawableImpl) {
@@ -322,7 +283,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   }
 
   @Override
-  public final GLAutoDrawable createDummyAutoDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+  public final GLAutoDrawable createDummyAutoDrawable(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser) {
       final GLDrawable drawable = createDummyDrawable(deviceReq, createNewDevice, capsRequested, chooser);
       drawable.setRealized(true);
       final GLAutoDrawable sharedDrawable = new GLAutoDrawableDelegate(drawable, null, null, true /*ownDevice*/, null) { };
@@ -330,10 +291,10 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   }
 
   @Override
-  public final GLDrawable createOffscreenDrawable(AbstractGraphicsDevice deviceReq,
-                                            GLCapabilitiesImmutable capsRequested,
-                                            GLCapabilitiesChooser chooser,
-                                            int width, int height) {
+  public final GLDrawable createOffscreenDrawable(final AbstractGraphicsDevice deviceReq,
+                                            final GLCapabilitiesImmutable capsRequested,
+                                            final GLCapabilitiesChooser chooser,
+                                            final int width, final int height) {
     if(width<=0 || height<=0) {
         throw new GLException("initial size must be positive (were (" + width + " x " + height + "))");
     }
@@ -355,7 +316,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   }
 
   @Override
-  public final GLDrawable createDummyDrawable(AbstractGraphicsDevice deviceReq, boolean createNewDevice, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+  public final GLDrawable createDummyDrawable(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser) {
     final AbstractGraphicsDevice device = createNewDevice ? getOrCreateSharedDevice(deviceReq) : deviceReq;
     if(null == device) {
         throw new GLException("No shared device for requested: "+deviceReq+", createNewDevice "+createNewDevice);
@@ -374,7 +335,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   }
 
   /** Creates a platform independent unrealized FBO offscreen GLDrawable */
-  protected final GLFBODrawable createFBODrawableImpl(NativeSurface dummySurface, GLCapabilitiesImmutable fboCaps, int textureUnit) {
+  protected final GLFBODrawable createFBODrawableImpl(final NativeSurface dummySurface, final GLCapabilitiesImmutable fboCaps, final int textureUnit) {
     final GLDrawableImpl dummyDrawable = createOnscreenDrawableImpl(dummySurface);
     return new GLFBODrawableImpl(this, dummyDrawable, dummySurface, fboCaps, textureUnit);
   }
@@ -417,15 +378,15 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
    * @param deviceReq which {@link javax.media.nativewindow.AbstractGraphicsDevice#getConnection() connection} denotes the shared device to be used, may be <code>null</code> for the platform's default device.
    * @param requestedCaps
    * @param chooser the custom chooser, may be null for default
-   * @param width the initial width as returned by {@link NativeSurface#getWidth()}, not the actual dummy surface width.
+   * @param width the initial width as returned by {@link NativeSurface#getSurfaceWidth()}, not the actual dummy surface width.
    *        The latter is platform specific and small
-   * @param height the initial height as returned by {@link NativeSurface#getHeight()}, not the actual dummy surface height,
+   * @param height the initial height as returned by {@link NativeSurface#getSurfaceHeight()}, not the actual dummy surface height,
    *        The latter is platform specific and small
    *
    * @return the created {@link ProxySurface} instance w/o defined surface handle but platform specific {@link UpstreamSurfaceHook}.
    */
-  public final ProxySurface createDummySurface(AbstractGraphicsDevice deviceReq, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser,
-                                          int width, int height) {
+  public final ProxySurface createDummySurface(final AbstractGraphicsDevice deviceReq, final GLCapabilitiesImmutable requestedCaps, final GLCapabilitiesChooser chooser,
+                                          final int width, final int height) {
     final AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
     if(null == device) {
         throw new GLException("No shared device for requested: "+deviceReq);
@@ -446,9 +407,9 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
    * @param chosenCaps
    * @param requestedCaps
    * @param chooser the custom chooser, may be null for default
-   * @param width the initial width as returned by {@link NativeSurface#getWidth()}, not the actual dummy surface width.
+   * @param width the initial width as returned by {@link NativeSurface#getSurfaceWidth()}, not the actual dummy surface width.
    *        The latter is platform specific and small
-   * @param height the initial height as returned by {@link NativeSurface#getHeight()}, not the actual dummy surface height,
+   * @param height the initial height as returned by {@link NativeSurface#getSurfaceHeight()}, not the actual dummy surface height,
    *        The latter is platform specific and small
    * @return the created {@link ProxySurface} instance w/o defined surface handle but platform specific {@link UpstreamSurfaceHook}.
    */
@@ -461,8 +422,8 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   //
 
   @Override
-  public ProxySurface createProxySurface(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle,
-                                         GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
+  public ProxySurface createProxySurface(final AbstractGraphicsDevice deviceReq, final int screenIdx, final long windowHandle,
+                                         final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstream) {
     final AbstractGraphicsDevice device = getOrCreateSharedDevice(deviceReq);
     if(null == device) {
         throw new GLException("No shared device for requested: "+deviceReq);
@@ -520,7 +481,7 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
    * @param glProfile GLProfile to determine the factory type, ie EGLDrawableFactory,
    *                or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL.
    */
-  public static GLDrawableFactoryImpl getFactoryImpl(GLProfile glp) {
+  public static GLDrawableFactoryImpl getFactoryImpl(final GLProfile glp) {
     return (GLDrawableFactoryImpl) getFactory(glp);
   }
 
@@ -561,61 +522,98 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
    * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */
 
-  /**
-   * Sets the gamma, brightness, and contrast of the current main
-   * display. Returns true if the settings were changed, false if
-   * not. If this method returns true, the display settings will
-   * automatically be reset upon JVM exit (assuming the JVM does not
-   * crash); if the user wishes to change the display settings back to
-   * normal ahead of time, use resetDisplayGamma(). Throws
-   * IllegalArgumentException if any of the parameters were
-   * out-of-bounds.
-   *
-   * @param gamma The gamma value, typically > 1.0 (default value is
-   *   1.0)
-   * @param brightness The brightness value between -1.0 and 1.0,
-   *   inclusive (default value is 0)
-   * @param contrast The contrast, greater than 0.0 (default value is 1)
-   * @throws IllegalArgumentException if any of the parameters were
-   *   out-of-bounds
-   */
-  public boolean setDisplayGamma(float gamma, float brightness, float contrast) throws IllegalArgumentException {
+  @Override
+  public synchronized final boolean setDisplayGamma(final NativeSurface surface, final float gamma, final float brightness, final float contrast) throws IllegalArgumentException {
     if ((brightness < -1.0f) || (brightness > 1.0f)) {
       throw new IllegalArgumentException("Brightness must be between -1.0 and 1.0");
     }
     if (contrast < 0) {
       throw new IllegalArgumentException("Contrast must be greater than 0.0");
     }
-    // FIXME: ensure gamma is > 1.0? Are smaller / negative values legal?
-    int rampLength = getGammaRampLength();
-    if (rampLength == 0) {
-      return false;
+    if( NativeSurface.LOCK_SURFACE_NOT_READY >= surface.lockSurface() ) {
+        return false;
     }
-    float[] gammaRamp = new float[rampLength];
-    for (int i = 0; i < rampLength; i++) {
-      float intensity = (float) i / (float) (rampLength - 1);
-      // apply gamma
-      float rampEntry = (float) java.lang.Math.pow(intensity, gamma);
-      // apply brightness
-      rampEntry += brightness;
-      // apply contrast
-      rampEntry = (rampEntry - 0.5f) * contrast + 0.5f;
-      // Clamp entry to [0, 1]
-      if (rampEntry > 1.0f)
-        rampEntry = 1.0f;
-      else if (rampEntry < 0.0f)
-        rampEntry = 0.0f;
-      gammaRamp[i] = rampEntry;
+    try {
+        // FIXME: ensure gamma is > 1.0? Are smaller / negative values legal?
+        final int rampLength = getGammaRampLength(surface);
+        if (rampLength == 0) {
+          return false;
+        }
+        final float[] gammaRamp = new float[rampLength];
+        for (int i = 0; i < rampLength; i++) {
+          final float intensity = (float) i / (float) (rampLength - 1);
+          // apply gamma
+          float rampEntry = (float) java.lang.Math.pow(intensity, gamma);
+          // apply brightness
+          rampEntry += brightness;
+          // apply contrast
+          rampEntry = (rampEntry - 0.5f) * contrast + 0.5f;
+          // Clamp entry to [0, 1]
+          if (rampEntry > 1.0f)
+            rampEntry = 1.0f;
+          else if (rampEntry < 0.0f)
+            rampEntry = 0.0f;
+          gammaRamp[i] = rampEntry;
+        }
+        final AbstractGraphicsScreen screen = surface.getGraphicsConfiguration().getScreen();
+        final DeviceScreenID deviceScreenID = new DeviceScreenID(screen.getDevice().getConnection(), screen.getIndex());
+        if( null == screen2OrigGammaRamp.get(deviceScreenID) ) {
+            screen2OrigGammaRamp.put(deviceScreenID, getGammaRamp(surface)); // cache original gamma ramp once
+            if( DEBUG ) {
+                System.err.println("DisplayGamma: Stored: "+deviceScreenID);
+                dumpGammaStore();
+            }
+        }
+        return setGammaRamp(surface, gammaRamp);
+    } finally {
+        surface.unlockSurface();
     }
-    needsGammaRampReset = true;
-    return setGammaRamp(gammaRamp);
   }
 
   @Override
-  public synchronized void resetDisplayGamma() {
-    if( needsGammaRampReset ) {
-        resetGammaRamp(originalGammaRamp);
-        needsGammaRampReset = false;
+  public synchronized final void resetDisplayGamma(final NativeSurface surface) {
+    if( NativeSurface.LOCK_SURFACE_NOT_READY >= surface.lockSurface() ) {
+        return;
+    }
+    try {
+        final AbstractGraphicsScreen screen = surface.getGraphicsConfiguration().getScreen();
+        final DeviceScreenID deviceScreenID = new DeviceScreenID(screen.getDevice().getConnection(), screen.getIndex());
+        final Buffer originalGammaRamp = screen2OrigGammaRamp.remove(deviceScreenID);
+        if( null != originalGammaRamp ) {
+            resetGammaRamp(surface, originalGammaRamp);
+        }
+    } finally {
+        surface.unlockSurface();
+    }
+  }
+
+  @Override
+  public synchronized final void resetAllDisplayGamma() {
+    resetAllDisplayGammaNoSync();
+  }
+
+  @Override
+  protected final void resetAllDisplayGammaNoSync() {
+    if( DEBUG ) {
+        System.err.println("DisplayGamma: Reset");
+        dumpGammaStore();
+    }
+    final Set<DeviceScreenID> deviceScreenIDs = screen2OrigGammaRamp.keySet();
+    for( final Iterator<DeviceScreenID> i = deviceScreenIDs.iterator(); i.hasNext(); ) {
+        final DeviceScreenID deviceScreenID = i.next();
+        final Buffer originalGammaRamp = screen2OrigGammaRamp.remove(deviceScreenID);
+        if( null != originalGammaRamp ) {
+            resetGammaRamp(deviceScreenID, originalGammaRamp);
+        }
+    }
+  }
+  private void dumpGammaStore() {
+    final Set<DeviceScreenID> deviceScreenIDs = screen2OrigGammaRamp.keySet();
+    int count = 0;
+    for( final Iterator<DeviceScreenID> i = deviceScreenIDs.iterator(); i.hasNext(); count++) {
+        final DeviceScreenID deviceScreenID = i.next();
+        final Buffer originalGammaRamp = screen2OrigGammaRamp.get(deviceScreenID);
+        System.err.printf("%4d/%4d: %s -> %s%n", count, deviceScreenIDs.size(), deviceScreenID, originalGammaRamp);
     }
   }
 
@@ -624,30 +622,64 @@ public abstract class GLDrawableFactoryImpl extends GLDrawableFactory {
   //
 
   /** Returns the length of the computed gamma ramp for this OS and
-      hardware. Returns 0 if gamma changes are not supported. */
-  protected int getGammaRampLength() {
+      hardware. Returns 0 if gamma changes are not supported.
+ * @param surface TODO*/
+  protected int getGammaRampLength(final NativeSurface surface) {
     return 0;
   }
 
   /** Sets the gamma ramp for the main screen. Returns false if gamma
-      ramp changes were not supported. */
-  protected boolean setGammaRamp(float[] ramp) {
+      ramp changes were not supported.
+ * @param surface TODO*/
+  protected boolean setGammaRamp(final NativeSurface surface, final float[] ramp) {
     return false;
   }
 
   /** Gets the current gamma ramp. This is basically an opaque value
       used only on some platforms to reset the gamma ramp to its
-      original settings. */
-  protected Buffer getGammaRamp() {
+      original settings.
+ * @param surface TODO*/
+  protected Buffer getGammaRamp(final NativeSurface surface) {
     return null;
   }
 
   /** Resets the gamma ramp, potentially using the specified Buffer as
-      data to restore the original values. */
-  protected void resetGammaRamp(Buffer originalGammaRamp) {
+      data to restore the original values.
+ * @param surface TODO*/
+  protected void resetGammaRamp(final NativeSurface surface, final Buffer originalGammaRamp) {
+  }
+  protected void resetGammaRamp(final DeviceScreenID deviceScreenID, final Buffer originalGammaRamp) {
   }
 
   // Shutdown hook mechanism for resetting gamma
-  private volatile Buffer originalGammaRamp;
-  private volatile boolean needsGammaRampReset = false;
+  public final class DeviceScreenID {
+      public final String deviceConnection;
+      public final int screenIdx;
+      DeviceScreenID(final String deviceConnection, final int screenIdx) {
+          this.deviceConnection = deviceConnection;
+          this.screenIdx = screenIdx;
+      }
+      @Override
+      public int hashCode() {
+          // 31 * x == (x << 5) - x
+          int hash = 31 + deviceConnection.hashCode();
+          hash = ((hash << 5) - hash) + screenIdx;
+          return hash;
+      }
+      @Override
+      public boolean equals(final Object obj) {
+          if(this == obj)  { return true; }
+          if (obj instanceof DeviceScreenID) {
+              final DeviceScreenID other = (DeviceScreenID)obj;
+              return this.deviceConnection.equals(other.deviceConnection) &&
+                     this.screenIdx == other.screenIdx;
+          }
+          return false;
+      }
+      @Override
+      public String toString() {
+          return "DeviceScreenID[devCon "+deviceConnection+", screenIdx "+screenIdx+", hash 0x"+Integer.toHexString(hashCode())+"]";
+      }
+  }
+  private final Map<DeviceScreenID, Buffer> screen2OrigGammaRamp = new HashMap<DeviceScreenID, Buffer>();
 }
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
index 0e135d5..f91e1bd 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableHelper.java
@@ -40,6 +40,7 @@
 
 package jogamp.opengl;
 
+import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.HashSet;
@@ -58,7 +59,8 @@ import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLFBODrawable;
 import javax.media.opengl.GLRunnable;
-import javax.media.opengl.GLSharedContextSetter;
+
+import com.jogamp.common.util.PropertyAccess;
 
 /** Encapsulates the implementation of most of the GLAutoDrawable's
     methods to be able to share it between GLAutoDrawable implementations like GLAutoDrawableBase, GLCanvas and GLJPanel. */
@@ -68,7 +70,7 @@ public class GLDrawableHelper {
 
   static {
       Debug.initSingleton();
-      PERF_STATS = Debug.isPropertyDefined("jogl.debug.GLDrawable.PerfStats", true);
+      PERF_STATS = PropertyAccess.isPropertyDefined("jogl.debug.GLDrawable.PerfStats", true);
   }
 
   protected static final boolean DEBUG = GLDrawableImpl.DEBUG;
@@ -108,7 +110,7 @@ public class GLDrawableHelper {
     sharedAutoDrawable = null;
   }
 
-  public final void setSharedContext(GLContext thisContext, GLContext sharedContext) throws IllegalStateException {
+  public final void setSharedContext(final GLContext thisContext, final GLContext sharedContext) throws IllegalStateException {
       if( null == sharedContext ) {
           throw new IllegalStateException("Null shared GLContext");
       }
@@ -124,7 +126,7 @@ public class GLDrawableHelper {
       this.sharedContext = sharedContext;
   }
 
-  public final void setSharedAutoDrawable(GLAutoDrawable thisAutoDrawable, GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
+  public final void setSharedAutoDrawable(final GLAutoDrawable thisAutoDrawable, final GLAutoDrawable sharedAutoDrawable) throws IllegalStateException {
       if( null == sharedAutoDrawable ) {
           throw new IllegalStateException("Null shared GLAutoDrawable");
       }
@@ -146,18 +148,12 @@ public class GLDrawableHelper {
    * @return true if initialization is pending due to a set shared GLAutoDrawable or GLContext
    *         which is not ready yet. Otherwise false.
    */
-  public boolean isSharedGLContextPending(GLContext[] shared) {
+  public boolean isSharedGLContextPending(final GLContext[] shared) {
       final GLContext shareWith;
       final boolean pending;
       if ( null != sharedAutoDrawable ) {
-          final boolean allGLELInitialized;
-          if( sharedAutoDrawable instanceof GLSharedContextSetter ) {
-              allGLELInitialized = ((GLSharedContextSetter)sharedAutoDrawable).areAllGLEventListenerInitialized();
-          } else {
-              allGLELInitialized = true; // we have to assume 'yes'
-          }
           shareWith = sharedAutoDrawable.getContext();
-          pending = null == shareWith || !shareWith.isCreated() || !allGLELInitialized;
+          pending = null == shareWith || !shareWith.isCreated() || !sharedAutoDrawable.areAllGLEventListenerInitialized();
       } else {
           shareWith = sharedContext;
           pending = null != shareWith && !shareWith.isCreated();
@@ -168,12 +164,12 @@ public class GLDrawableHelper {
 
   @Override
   public final String toString() {
-    StringBuilder sb = new StringBuilder();
+    final StringBuilder sb = new StringBuilder();
     sb.append("GLAnimatorControl: "+animatorCtrl+", ");
     synchronized(listenersLock) {
         sb.append("GLEventListeners num "+listeners.size()+" [");
         for (int i=0; i < listeners.size(); i++) {
-          Object l = listeners.get(i);
+          final Object l = listeners.get(i);
           sb.append(l);
           sb.append("[init ");
           sb.append( !listenersToBeInit.contains(l) );
@@ -195,7 +191,7 @@ public class GLDrawableHelper {
    * </p>
    * @param ctx
    */
-  public static final void forceNativeRelease(GLContext ctx) {
+  public static final void forceNativeRelease(final GLContext ctx) {
       int releaseCount = 0;
       do {
           ctx.release();
@@ -213,19 +209,23 @@ public class GLDrawableHelper {
   /**
    * Switch {@link GLContext} / {@link GLDrawable} association.
    * <p>
-   * The <code>oldCtx</code> will be destroyed if <code>destroyPrevCtx</code> is <code>true</code>,
-   * otherwise dis-associate <code>oldCtx</code> from <code>drawable</code>
-   * via {@link GLContext#setGLDrawable(GLDrawable, boolean) oldCtx.setGLDrawable(null, true);}.
-   * </p>
-   * <p>
-   * Re-associate <code>newCtx</code> with <code>drawable</code>
-   * via {@link GLContext#setGLDrawable(GLDrawable, boolean) newCtx.setGLDrawable(drawable, true);}.
-   * </p>
-   * <p>
-   * If the old or new context was current on this thread, it is being released before switching the drawable.
-   * </p>
-   * <p>
-   * No locking is being performed on the drawable, caller is required to take care of it.
+   * Remarks:
+   * <ul>
+   *   <li>The <code>oldCtx</code> will be destroyed if <code>destroyPrevCtx</code> is <code>true</code>,
+   *       otherwise disassociate <code>oldCtx</code> from <code>drawable</code>
+   *       via {@link GLContext#setGLDrawable(GLDrawable, boolean) oldCtx.setGLDrawable(null, true);} including {@link GL#glFinish() glFinish()}.</li>
+   *   <li>Reassociate <code>newCtx</code> with <code>drawable</code>
+   *       via {@link GLContext#setGLDrawable(GLDrawable, boolean) newCtx.setGLDrawable(drawable, true);}.</li>
+   *   <li>If the old context was current on this thread, it is being released after disassociating the drawable.</li>
+   *   <li>If the new context was current on this thread, it is being released before associating the drawable
+   *       and made current afterwards.</li>
+   *   <li>Implementation may issue {@link #makeCurrent()} and {@link #release()} while drawable reassociation.</li>
+   *   <li>The user shall take extra care of thread synchronization,
+   *       i.e. lock the involved {@link GLDrawable#getNativeSurface() drawable's} {@link NativeSurface}s
+   *       to avoid a race condition. In case {@link GLAutoDrawable auto-drawable's} are used,
+   *       their {@link GLAutoDrawable#getUpstreamLock() upstream-lock} must be locked beforehand
+   *       see <a href="../../javax/media/opengl/GLAutoDrawable.html#locking">GLAutoDrawable Locking</a>.</li>
+   * </ul>
    * </p>
    *
    * @param drawable the drawable which context is changed
@@ -236,7 +236,7 @@ public class GLDrawableHelper {
    *
    * @see GLAutoDrawable#setContext(GLContext, boolean)
    */
-  public static final void switchContext(GLDrawable drawable, GLContext oldCtx, boolean destroyOldCtx, GLContext newCtx, int newCtxCreationFlags) {
+  public static final void switchContext(final GLDrawable drawable, final GLContext oldCtx, final boolean destroyOldCtx, final GLContext newCtx, final int newCtxCreationFlags) {
       if( null != oldCtx ) {
           if( destroyOldCtx ) {
               oldCtx.destroy();
@@ -268,7 +268,7 @@ public class GLDrawableHelper {
    * @param context maybe null
    * @return the new drawable
    */
-  public static final GLDrawableImpl recreateGLDrawable(GLDrawableImpl drawable, GLContext context) {
+  public static final GLDrawableImpl recreateGLDrawable(GLDrawableImpl drawable, final GLContext context) {
       if( ! drawable.isRealized() ) {
           return drawable;
       }
@@ -335,7 +335,7 @@ public class GLDrawableHelper {
    * @throws NativeWindowException is drawable is not offscreen or it's surface lock couldn't be claimed
    * @throws GLException may be thrown a resize operation
    */
-  public static final GLDrawableImpl resizeOffscreenDrawable(GLDrawableImpl drawable, GLContext context, int newWidth, int newHeight)
+  public static final GLDrawableImpl resizeOffscreenDrawable(GLDrawableImpl drawable, final GLContext context, int newWidth, int newHeight)
           throws NativeWindowException, GLException
   {
       final NativeSurface ns = drawable.getNativeSurface();
@@ -362,7 +362,7 @@ public class GLDrawableHelper {
               final ProxySurface ps = (ProxySurface) ns;
               final UpstreamSurfaceHook ush = ps.getUpstreamSurfaceHook();
               if(ush instanceof UpstreamSurfaceHook.MutableSize) {
-                  ((UpstreamSurfaceHook.MutableSize)ush).setSize(newWidth, newHeight);
+                  ((UpstreamSurfaceHook.MutableSize)ush).setSurfaceSize(newWidth, newHeight);
               } else if(DEBUG) { // we have to assume UpstreamSurfaceHook contains the new size already, hence size check @ bottom
                   System.err.println("GLDrawableHelper.resizeOffscreenDrawable: Drawable's offscreen ProxySurface n.a. UpstreamSurfaceHook.MutableSize, but "+ush.getClass().getName()+": "+ush);
               }
@@ -379,17 +379,17 @@ public class GLDrawableHelper {
       } finally {
           ns.unlockSurface();
       }
-      if( validateSize && ( drawable.getWidth() != newWidth || drawable.getHeight() != newHeight ) ) {
+      if( validateSize && ( drawable.getSurfaceWidth() != newWidth || drawable.getSurfaceHeight() != newHeight ) ) {
           throw new InternalError("Incomplete resize operation: expected "+newWidth+"x"+newHeight+", has: "+drawable);
       }
       return drawable;
   }
 
-  public final void addGLEventListener(GLEventListener listener) {
+  public final void addGLEventListener(final GLEventListener listener) {
     addGLEventListener(-1, listener);
   }
 
-  public final void addGLEventListener(int index, GLEventListener listener) {
+  public final void addGLEventListener(int index, final GLEventListener listener) {
     synchronized(listenersLock) {
         if(0>index) {
             index = listeners.size();
@@ -408,7 +408,7 @@ public class GLDrawableHelper {
    * Consider calling {@link #disposeGLEventListener(GLAutoDrawable, GLDrawable, GLContext, GLEventListener)}.
    * @return the removed listener, or null if listener was not added
    */
-  public final GLEventListener removeGLEventListener(GLEventListener listener) {
+  public final GLEventListener removeGLEventListener(final GLEventListener listener) {
     synchronized(listenersLock) {
         listenersToBeInit.remove(listener);
         return listeners.remove(listener) ? listener : null;
@@ -447,13 +447,13 @@ public class GLDrawableHelper {
     }
   }
 
-  public final boolean getGLEventListenerInitState(GLEventListener listener) {
+  public final boolean getGLEventListenerInitState(final GLEventListener listener) {
     synchronized(listenersLock) {
         return !listenersToBeInit.contains(listener);
     }
   }
 
-  public final void setGLEventListenerInitState(GLEventListener listener, boolean initialized) {
+  public final void setGLEventListenerInitState(final GLEventListener listener, final boolean initialized) {
     synchronized(listenersLock) {
         if(initialized) {
             listenersToBeInit.remove(listener);
@@ -478,7 +478,7 @@ public class GLDrawableHelper {
    * @param remove if true, the listener gets removed
    * @return the disposed and/or removed listener, otherwise null if neither action is performed
    */
-  public final GLEventListener disposeGLEventListener(GLAutoDrawable autoDrawable, GLEventListener listener, boolean remove) {
+  public final GLEventListener disposeGLEventListener(final GLAutoDrawable autoDrawable, final GLEventListener listener, final boolean remove) {
       synchronized(listenersLock) {
           if( remove ) {
               if( listeners.remove(listener) ) {
@@ -511,15 +511,25 @@ public class GLDrawableHelper {
    * </p>
    * @param autoDrawable
    * @return the disposal count
+   * @throws GLException caused by {@link GLEventListener#dispose(GLAutoDrawable)}
    */
-  public final int disposeAllGLEventListener(GLAutoDrawable autoDrawable, boolean remove) {
+  public final int disposeAllGLEventListener(final GLAutoDrawable autoDrawable, final boolean remove) throws GLException {
+    Throwable firstCaught = null;
     int disposeCount = 0;
     synchronized(listenersLock) {
         if( remove ) {
             for (int count = listeners.size(); 0 < count && 0 < listeners.size(); count--) {
               final GLEventListener listener = listeners.remove(0);
               if( !listenersToBeInit.remove(listener) ) {
-                  listener.dispose(autoDrawable);
+                  try {
+                      listener.dispose(autoDrawable);
+                  } catch (final Throwable t) {
+                      if( null == firstCaught ) {
+                          firstCaught = t;
+                      } else {
+                          GLException.dumpThrowable("subsequent", t);
+                      }
+                  }
                   disposeCount++;
               }
             }
@@ -527,13 +537,25 @@ public class GLDrawableHelper {
             for (int i = 0; i < listeners.size(); i++) {
               final GLEventListener listener = listeners.get(i);
               if( !listenersToBeInit.contains(listener) ) {
-                  listener.dispose(autoDrawable);
+                  try {
+                      listener.dispose(autoDrawable);
+                  } catch (final Throwable t) {
+                      if( null == firstCaught ) {
+                          firstCaught = t;
+                      } else {
+                          GLException.dumpThrowable("subsequent", t);
+                      }
+                  }
                   listenersToBeInit.add(listener);
                   disposeCount++;
               }
             }
         }
     }
+    if( null != firstCaught ) {
+        flushGLRunnables();
+        throw GLException.newGLException(firstCaught);
+    }
     return disposeCount;
   }
 
@@ -613,10 +635,10 @@ public class GLDrawableHelper {
       }
   }
 
-  private final void init(GLEventListener l, GLAutoDrawable drawable, boolean sendReshape, boolean setViewport) {
+  private final void init(final GLEventListener l, final GLAutoDrawable drawable, final boolean sendReshape, final boolean setViewport) {
       l.init(drawable);
       if(sendReshape) {
-          reshape(l, drawable, 0, 0, drawable.getWidth(), drawable.getHeight(), setViewport, false /* checkInit */);
+          reshape(l, drawable, 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), setViewport, false /* checkInit */);
       }
   }
 
@@ -624,7 +646,7 @@ public class GLDrawableHelper {
    * The default init action to be called once after ctx is being created @ 1st makeCurrent().
    * @param sendReshape set to true if the subsequent display call won't reshape, otherwise false to avoid double reshape.
    **/
-  public final void init(GLAutoDrawable drawable, boolean sendReshape) {
+  public final void init(final GLAutoDrawable drawable, final boolean sendReshape) {
     synchronized(listenersLock) {
         final ArrayList<GLEventListener> _listeners = listeners;
         final int listenerCount = _listeners.size();
@@ -639,19 +661,21 @@ public class GLDrawableHelper {
               init( listener, drawable, sendReshape, 0==i /* setViewport */);
             }
         } else {
-            // Expose same GL initialization if not using GLEventListener
-            drawable.getGL().glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
+            // Expose same GL initialization if not using any GLEventListener
+            drawable.getGL().glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
         }
     }
   }
 
-  public final void display(GLAutoDrawable drawable) {
+  public final void display(final GLAutoDrawable drawable) {
     displayImpl(drawable);
+    // runForAllGLEventListener(drawable, displayAction);
     if( glRunnables.size()>0 && !execGLRunnables(drawable) ) { // glRunnables volatile OK; execGL.. only executed if size > 0
         displayImpl(drawable);
+        // runForAllGLEventListener(drawable, displayAction);
     }
   }
-  private final void displayImpl(GLAutoDrawable drawable) {
+  private final void displayImpl(final GLAutoDrawable drawable) {
       synchronized(listenersLock) {
           final ArrayList<GLEventListener> _listeners = listeners;
           final int listenerCount = _listeners.size();
@@ -667,8 +691,33 @@ public class GLDrawableHelper {
       }
   }
 
-  private final void reshape(GLEventListener listener, GLAutoDrawable drawable,
-                             int x, int y, int width, int height, boolean setViewport, boolean checkInit) {
+  public static interface GLEventListenerAction {
+      public void run(final GLAutoDrawable drawable, final GLEventListener listener);
+  }
+  /**
+  private static GLEventListenerAction displayAction = new GLEventListenerAction() {
+      public void run(final GLAutoDrawable drawable, final GLEventListener listener) {
+          listener.display(drawable);
+      }  }; */
+
+  public final void runForAllGLEventListener(final GLAutoDrawable drawable, final GLEventListenerAction action) {
+      synchronized(listenersLock) {
+          final ArrayList<GLEventListener> _listeners = listeners;
+          final int listenerCount = _listeners.size();
+          for (int i=0; i < listenerCount; i++) {
+            final GLEventListener listener = _listeners.get(i) ;
+            // GLEventListener may need to be init,
+            // in case this one is added after the realization of the GLAutoDrawable
+            if( listenersToBeInit.remove(listener) ) {
+                init( listener, drawable, true /* sendReshape */, listenersToBeInit.size() + 1 == listenerCount /* setViewport if 1st init */ );
+            }
+            action.run(drawable, listener);
+          }
+      }
+  }
+
+  private final void reshape(final GLEventListener listener, final GLAutoDrawable drawable,
+                             final int x, final int y, final int width, final int height, final boolean setViewport, final boolean checkInit) {
     if(checkInit) {
         // GLEventListener may need to be init,
         // in case this one is added after the realization of the GLAutoDrawable
@@ -692,7 +741,7 @@ public class GLDrawableHelper {
     listener.reshape(drawable, x, y, width, height);
   }
 
-  public final void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+  public final void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
     synchronized(listenersLock) {
         for (int i=0; i < listeners.size(); i++) {
           reshape(listeners.get(i), drawable, x, y, width, height, 0==i /* setViewport */, true /* checkInit */);
@@ -700,7 +749,7 @@ public class GLDrawableHelper {
     }
   }
 
-  private final boolean execGLRunnables(GLAutoDrawable drawable) { // glRunnables.size()>0
+  private final boolean execGLRunnables(final GLAutoDrawable drawable) { // glRunnables.size()>0
     boolean res = true;
     // swap one-shot list asap
     final ArrayList<GLRunnableTask> _glRunnables;
@@ -742,7 +791,7 @@ public class GLDrawableHelper {
     }
   }
 
-  public final void setAnimator(GLAnimatorControl animator) throws GLException {
+  public final void setAnimator(final GLAnimatorControl animator) throws GLException {
     synchronized(glRunnablesLock) {
         if(animatorCtrl!=animator && null!=animator && null!=animatorCtrl) {
             throw new GLException("Trying to register GLAnimatorControl "+animator+", where "+animatorCtrl+" is already registered. Unregister first.");
@@ -773,6 +822,30 @@ public class GLDrawableHelper {
     return ( null != animatorCtrl ) ? animatorCtrl.isAnimating() : false ;
   }
 
+  public static final boolean isLockedByOtherThread(final GLAutoDrawable d) {
+      final Thread currentThread = Thread.currentThread();
+      final Thread upstreamLockOwner = d.getUpstreamLock().getOwner();
+      if( null != upstreamLockOwner && currentThread != upstreamLockOwner ) {
+          return true;
+      } else {
+          final NativeSurface s = d.getNativeSurface();
+          final Thread surfaceLockOwner = null != s ? s.getSurfaceLockOwner() : null;
+          return null != surfaceLockOwner  && currentThread != surfaceLockOwner;
+      }
+  }
+
+  public static final boolean isLockedByThisThread(final GLAutoDrawable d) {
+      final Thread currentThread = Thread.currentThread();
+      final Thread upstreamLockOwner = d.getUpstreamLock().getOwner();
+      if( currentThread == upstreamLockOwner ) {
+          return true;
+      } else {
+          final NativeSurface s = d.getNativeSurface();
+          final Thread surfaceLockOwner = null != s ? s.getSurfaceLockOwner() : null;
+          return currentThread == surfaceLockOwner;
+      }
+  }
+
   /**
    * <p>
    * If <code>wait</code> is <code>true</code> the call blocks until the <code>glRunnable</code>
@@ -783,39 +856,73 @@ public class GLDrawableHelper {
    * the call is ignored and returns <code>false</code>.<br>
    * This helps avoiding deadlocking the caller.
    * </p>
+   * <p>
+   * <pre>
+   * 0 == deferredHere && 0 == isGLThread -> display() will issue on GL thread, blocking!
+   *
+   *         deferredHere wait isGLThread   lockedByThisThread  Note
+   *  OK     0            x    1            x
+   *  OK     0            x    0            0
+   *  ERROR  0            x    0            1                   Will be deferred on GL thread by display() (blocking),
+   *                                                            but locked by this thread -> ERROR
+   *
+   *         1            0    x            x                   All good, due to no wait, non blocking
+   *
+   *         1            1    1            0
+   *         1            1    0            0
+   *  SWITCH 1            1    1            1                   Run immediately, don't defer since locked by this thread, but isGLThread
+   *  ERROR  1            1    0            1                   Locked by this thread, but _not_ isGLThread -> ERROR
+   * </pre>
+   * </p>
    *
    * @param drawable the {@link GLAutoDrawable} to be used
    * @param wait if <code>true</code> block until execution of <code>glRunnable</code> is finished, otherwise return immediatly w/o waiting
    * @param glRunnable the {@link GLRunnable} to execute within {@link #display()}
    * @return <code>true</code> if the {@link GLRunnable} has been processed or queued, otherwise <code>false</code>.
+   * @throws IllegalStateException in case the drawable is locked by this thread, no animator is running on another thread and <code>wait</code> is <code>true</code>.
    */
-  public final boolean invoke(GLAutoDrawable drawable, boolean wait, GLRunnable glRunnable) {
+  public final boolean invoke(final GLAutoDrawable drawable, boolean wait, final GLRunnable glRunnable) throws IllegalStateException {
     if( null == glRunnable || null == drawable ||
         wait && ( !drawable.isRealized() || null==drawable.getContext() ) ) {
         return false;
     }
 
     GLRunnableTask rTask = null;
-    Object rTaskLock = new Object();
+    final Object rTaskLock = new Object();
     Throwable throwable = null;
     synchronized(rTaskLock) {
-        final boolean deferred;
+        boolean deferredHere;
         synchronized(glRunnablesLock) {
-            deferred = isAnimatorAnimatingOnOtherThread();
-            if(!deferred) {
-                wait = false; // don't wait if exec immediatly
+            final boolean isGLThread = drawable.isThreadGLCapable();
+            deferredHere = isAnimatorAnimatingOnOtherThread();
+            if( deferredHere ) {
+                if( wait && isLockedByThisThread(drawable) ) {
+                    if( isGLThread ) {
+                        // Run immediately, don't defer since locked by this thread, but isGLThread
+                        deferredHere = false;
+                    } else {
+                        // Locked by this thread, but _not_ isGLThread -> ERROR
+                        throw new IllegalStateException("Deferred, wait, isLocked on current and not GL-Thread: thread "+Thread.currentThread());
+                    }
+                }
+            } else {
+                if( !isGLThread && isLockedByThisThread(drawable) ) {
+                    // Will be deferred on GL thread by display() (blocking), but locked by this thread -> ERROR
+                    throw new IllegalStateException("Not deferred, isLocked on current and not GL-Thread: thread "+Thread.currentThread());
+                }
+                wait = false; // don't wait if exec immediately
             }
             rTask = new GLRunnableTask(glRunnable,
                                        wait ? rTaskLock : null,
                                        wait  /* catch Exceptions if waiting for result */);
             glRunnables.add(rTask);
         }
-        if( !deferred ) {
+        if( !deferredHere ) {
             drawable.display();
         } else if( wait ) {
             try {
                 rTaskLock.wait(); // free lock, allow execution of rTask
-            } catch (InterruptedException ie) {
+            } catch (final InterruptedException ie) {
                 throwable = ie;
             }
             if(null==throwable) {
@@ -829,7 +936,16 @@ public class GLDrawableHelper {
     return true;
   }
 
-  public final boolean invoke(GLAutoDrawable drawable, boolean wait, List<GLRunnable> newGLRunnables) {
+  /**
+   * @see #invoke(GLAutoDrawable, boolean, GLRunnable)
+   *
+   * @param drawable
+   * @param wait
+   * @param newGLRunnables
+   * @return
+   * @throws IllegalStateException
+   */
+  public final boolean invoke(final GLAutoDrawable drawable, boolean wait, final List<GLRunnable> newGLRunnables) throws IllegalStateException {
     if( null == newGLRunnables || newGLRunnables.size() == 0 || null == drawable ||
         wait && ( !drawable.isRealized() || null==drawable.getContext() ) ) {
         return false;
@@ -837,13 +953,28 @@ public class GLDrawableHelper {
 
     final int count = newGLRunnables.size();
     GLRunnableTask rTask = null;
-    Object rTaskLock = new Object();
+    final Object rTaskLock = new Object();
     Throwable throwable = null;
     synchronized(rTaskLock) {
-        final boolean deferred;
+        boolean deferredHere;
         synchronized(glRunnablesLock) {
-            deferred = isAnimatorAnimatingOnOtherThread() || !drawable.isRealized();
-            if(!deferred) {
+            final boolean isGLThread = drawable.isThreadGLCapable();
+            deferredHere = isAnimatorAnimatingOnOtherThread();
+            if( deferredHere ) {
+                if( wait && isLockedByThisThread(drawable) ) {
+                    if( isGLThread ) {
+                        // Run immediately, don't defer since locked by this thread, but isGLThread
+                        deferredHere = false;
+                    } else {
+                        // Locked by this thread, but _not_ isGLThread -> ERROR
+                        throw new IllegalStateException("Deferred, wait, isLocked on current and not GL-Thread: thread "+Thread.currentThread());
+                    }
+                }
+            } else {
+                if( !isGLThread && isLockedByThisThread(drawable) ) {
+                    // Will be deferred on GL thread by display() (blocking), but locked by this thread -> ERROR
+                    throw new IllegalStateException("Not deferred, isLocked on current and not GL-Thread: thread "+Thread.currentThread());
+                }
                 wait = false; // don't wait if exec immediately
             }
             for(int i=0; i<count-1; i++) {
@@ -854,12 +985,12 @@ public class GLDrawableHelper {
                                        wait  /* catch Exceptions if waiting for result */);
             glRunnables.add(rTask);
         }
-        if( !deferred ) {
+        if( !deferredHere ) {
             drawable.display();
         } else if( wait ) {
             try {
                 rTaskLock.wait(); // free lock, allow execution of rTask
-            } catch (InterruptedException ie) {
+            } catch (final InterruptedException ie) {
                 throwable = ie;
             }
             if(null==throwable) {
@@ -873,7 +1004,7 @@ public class GLDrawableHelper {
     return true;
   }
 
-  public final void enqueue(GLRunnable glRunnable) {
+  public final void enqueue(final GLRunnable glRunnable) {
     if( null == glRunnable) {
         return;
     }
@@ -882,7 +1013,7 @@ public class GLDrawableHelper {
     }
   }
 
-  public final void setAutoSwapBufferMode(boolean enable) {
+  public final void setAutoSwapBufferMode(final boolean enable) {
     autoSwapBufferMode = enable;
   }
 
@@ -921,7 +1052,7 @@ public class GLDrawableHelper {
    * @return previous exclusive context thread
    * @throws GLException If an exclusive thread is still active but a new one is attempted to be set
    */
-  public final Thread setExclusiveContextThread(Thread t, GLContext context) throws GLException {
+  public final Thread setExclusiveContextThread(final Thread t, final GLContext context) throws GLException {
     if (DEBUG) {
       System.err.println("GLDrawableHelper.setExclusiveContextThread(): START switch "+getExclusiveContextSwitchString()+", thread "+exclusiveContextThread+" -> "+t+" -- currentThread "+Thread.currentThread());
     }
@@ -938,9 +1069,9 @@ public class GLDrawableHelper {
         if( null != context && context.isCurrent() ) {
             try {
                 forceNativeRelease(context);
-            } catch (Throwable ex) {
-                ex.printStackTrace();
-                throw new GLException(ex);
+            } catch (final Throwable ex) {
+                flushGLRunnables();
+                throw GLException.newGLException(ex);
             }
         }
         exclusiveContextThread = t;
@@ -958,7 +1089,21 @@ public class GLDrawableHelper {
     return exclusiveContextThread;
   }
 
-  private static final ThreadLocal<Runnable> perThreadInitAction = new ThreadLocal<Runnable>();
+  private static final ThreadLocal<WeakReference<Runnable>> perThreadInitAction = new ThreadLocal<WeakReference<Runnable>>();
+  private static final Runnable getLastInitAction() {
+      final WeakReference<Runnable> lastInitActionWR = perThreadInitAction.get();
+      if( null != lastInitActionWR ) {
+          final Runnable lastInitAction = lastInitActionWR.get();
+          if( null == lastInitAction ) {
+              perThreadInitAction.set(null);
+          }
+          return lastInitAction;
+      }
+      return null;
+  }
+  private static final void setLastInitAction(final Runnable initAction) {
+      perThreadInitAction.set(new WeakReference<Runnable>(initAction));
+  }
 
   /** Principal helper method which runs a Runnable with the context
       made current. This could have been made part of GLContext, but a
@@ -982,8 +1127,7 @@ public class GLDrawableHelper {
                              final Runnable  initAction) {
     if(null==context) {
         if (DEBUG) {
-            Exception e = new GLException(getThreadName()+" Info: GLDrawableHelper " + this + ".invokeGL(): NULL GLContext");
-            e.printStackTrace();
+            GLException.dumpThrowable("informal", new GLException("Info: GLDrawableHelper " + this + ".invokeGL(): NULL GLContext"));
         }
         return;
     }
@@ -1008,9 +1152,11 @@ public class GLDrawableHelper {
    * @param autoDrawable
    * @param context
    * @param destroyContext destroy context in the end while holding the lock
+   * @throws GLException caused by {@link GLEventListener#dispose(GLAutoDrawable)} or context closing
+   *
    */
   public final void disposeGL(final GLAutoDrawable autoDrawable,
-                              final GLContext context, boolean destroyContext) {
+                              final GLContext context, final boolean destroyContext) throws GLException {
     // Support for recursive makeCurrent() calls as well as calling
     // other drawables' display() methods from within another one's
     GLContext lastContext = GLContext.getCurrent();
@@ -1020,20 +1166,27 @@ public class GLDrawableHelper {
             lastContext = null;
         } else {
             // utilize recursive locking
-            lastInitAction = perThreadInitAction.get();
+            lastInitAction = getLastInitAction();
             lastContext.release();
         }
     }
 
+    GLException disposeCaught = null;
+    Throwable contextCloseCaught = null;
+
     int res;
     try {
       res = context.makeCurrent();
       if (GLContext.CONTEXT_NOT_CURRENT != res) {
         if(GLContext.CONTEXT_CURRENT_NEW == res) {
-            throw new GLException(getThreadName()+" GLDrawableHelper " + this + ".invokeGL(): Dispose case (no init action given): Native context was not created (new ctx): "+context);
+            throw new GLException(GLDrawableHelper.getThreadName()+" GLDrawableHelper " + this + ".invokeGL(): Dispose case (no init action given): Native context was not created (new ctx): "+context);
         }
         if( listeners.size() > 0 && null != autoDrawable ) {
-            disposeAllGLEventListener(autoDrawable, false);
+            try {
+                disposeAllGLEventListener(autoDrawable, false);
+            } catch(final GLException t) {
+                disposeCaught = t;
+            }
         }
       }
     } finally {
@@ -1043,17 +1196,26 @@ public class GLDrawableHelper {
           } else {
               forceNativeRelease(context);
           }
-          flushGLRunnables();
-      } catch (Exception e) {
-          System.err.println("Catched Exception on thread "+getThreadName());
-          e.printStackTrace();
+      } catch (final Throwable t) {
+          contextCloseCaught = t;
       }
+      flushGLRunnables(); // always flush GLRunnables at dispose
+
       if (lastContext != null) {
         final int res2 = lastContext.makeCurrent();
         if (null != lastInitAction && res2 == GLContext.CONTEXT_CURRENT_NEW) {
           lastInitAction.run();
         }
       }
+      if( null != disposeCaught ) {
+          if( null != contextCloseCaught ) {
+              GLException.dumpThrowable("subsequent", contextCloseCaught);
+          }
+          throw disposeCaught;
+      }
+      if( null != contextCloseCaught ) {
+          throw GLException.newGLException(contextCloseCaught);
+      }
     }
   }
 
@@ -1063,6 +1225,9 @@ public class GLDrawableHelper {
           final Runnable  initAction) {
       final Thread currentThread = Thread.currentThread();
 
+      Throwable glEventListenerCaught = null;
+      Throwable contextReleaseCaught = null;
+
       // Exclusive Cases:
       //   1: lock - unlock  : default
       //   2: lock - -       : exclusive,    not locked yet
@@ -1094,7 +1259,7 @@ public class GLDrawableHelper {
               lastContext = null;
           } else {
               // utilize recursive locking
-              lastInitAction = perThreadInitAction.get();
+              lastInitAction = getLastInitAction();
               lastContext.release();
           }
       }
@@ -1109,7 +1274,7 @@ public class GLDrawableHelper {
           }
           if (GLContext.CONTEXT_NOT_CURRENT != res) {
               try {
-                  perThreadInitAction.set(initAction);
+                  setLastInitAction(initAction);
                   if (GLContext.CONTEXT_CURRENT_NEW == res) {
                       if (DEBUG) {
                           System.err.println("GLDrawableHelper " + this + ".invokeGL(): Running initAction");
@@ -1120,6 +1285,8 @@ public class GLDrawableHelper {
                   if ( autoSwapBufferMode ) {
                       drawable.swapBuffers();
                   }
+              } catch (final Throwable t) {
+                  glEventListenerCaught = t;
               } finally {
                   if( _releaseExclusiveThread ) {
                       exclusiveContextThread = null;
@@ -1130,9 +1297,8 @@ public class GLDrawableHelper {
                   if( releaseContext ) {
                       try {
                           context.release();
-                      } catch (Exception e) {
-                          System.err.println("Catched Exception on thread "+getThreadName());
-                          e.printStackTrace();
+                      } catch (final Throwable t) {
+                          contextReleaseCaught = t;
                       }
                   }
               }
@@ -1144,6 +1310,17 @@ public class GLDrawableHelper {
                   lastInitAction.run();
               }
           }
+          if( null != glEventListenerCaught ) {
+              flushGLRunnables();
+              if( null != contextReleaseCaught ) {
+                  GLException.dumpThrowable("subsequent", contextReleaseCaught);
+              }
+              throw GLException.newGLException(glEventListenerCaught);
+          }
+          if( null != contextReleaseCaught ) {
+              flushGLRunnables();
+              throw GLException.newGLException(contextReleaseCaught);
+          }
       }
   }
 
@@ -1153,6 +1330,9 @@ public class GLDrawableHelper {
           final Runnable  initAction) {
       final Thread currentThread = Thread.currentThread();
 
+      Throwable glEventListenerCaught = null;
+      Throwable contextReleaseCaught = null;
+
       // Exclusive Cases:
       //   1: lock - unlock  : default
       //   2: lock - -       : exclusive, not locked yet
@@ -1183,19 +1363,19 @@ public class GLDrawableHelper {
               lastContext = null;
           } else {
               // utilize recursive locking
-              lastInitAction = perThreadInitAction.get();
+              lastInitAction = getLastInitAction();
               lastContext.release();
           }
       }
 
-      long t0 = System.currentTimeMillis();
+      final long t0 = System.currentTimeMillis();
       long tdA = 0; // makeCurrent
       long tdR = 0; // render time
       long tdS = 0; // swapBuffers
       long tdX = 0; // release
       boolean ctxClaimed = false;
       boolean ctxReleased = false;
-      boolean ctxDestroyed = false;
+      final boolean ctxDestroyed = false;
       try {
           final boolean releaseContext;
           if( GLContext.CONTEXT_NOT_CURRENT == res ) {
@@ -1207,7 +1387,7 @@ public class GLDrawableHelper {
           }
           if (GLContext.CONTEXT_NOT_CURRENT != res) {
               try {
-                  perThreadInitAction.set(initAction);
+                  setLastInitAction(initAction);
                   if (GLContext.CONTEXT_CURRENT_NEW == res) {
                       if (DEBUG) {
                           System.err.println("GLDrawableHelper " + this + ".invokeGL(): Running initAction");
@@ -1224,6 +1404,8 @@ public class GLDrawableHelper {
                       tdX = System.currentTimeMillis();
                       tdS = tdX - tdS; // swapBuffers
                   }
+              } catch (final Throwable t) {
+                  glEventListenerCaught = t;
               } finally {
                   if( _releaseExclusiveThread ) {
                       exclusiveContextSwitch = 0;
@@ -1236,9 +1418,8 @@ public class GLDrawableHelper {
                       try {
                           context.release();
                           ctxReleased = true;
-                      } catch (Exception e) {
-                          System.err.println("Catched Exception on thread "+getThreadName());
-                          e.printStackTrace();
+                      } catch (final Throwable t) {
+                          contextReleaseCaught = t;
                       }
                   }
               }
@@ -1251,11 +1432,21 @@ public class GLDrawableHelper {
                   lastInitAction.run();
               }
           }
+          if( null != glEventListenerCaught ) {
+              flushGLRunnables();
+              if( null != contextReleaseCaught ) {
+                  GLException.dumpThrowable("subsequent", contextReleaseCaught);
+              }
+              throw GLException.newGLException(glEventListenerCaught);
+          }
+          if( null != contextReleaseCaught ) {
+              flushGLRunnables();
+              throw GLException.newGLException(contextReleaseCaught);
+          }
       }
-      long td = System.currentTimeMillis() - t0;
+      final long td = System.currentTimeMillis() - t0;
       System.err.println("td0 "+td+"ms, fps "+(1.0/(td/1000.0))+", td-makeCurrent: "+tdA+"ms, td-render "+tdR+"ms, td-swap "+tdS+"ms, td-release "+tdX+"ms, ctx claimed: "+ctxClaimed+", ctx release: "+ctxReleased+", ctx destroyed "+ctxDestroyed);
   }
 
   protected static String getThreadName() { return Thread.currentThread().getName(); }
-
 }
diff --git a/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
index d112745..544aaf0 100644
--- a/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLDrawableImpl.java
@@ -54,11 +54,11 @@ import javax.media.opengl.GLProfile;
 public abstract class GLDrawableImpl implements GLDrawable {
   protected static final boolean DEBUG = GLDrawableFactoryImpl.DEBUG;
 
-  protected GLDrawableImpl(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
+  protected GLDrawableImpl(final GLDrawableFactory factory, final NativeSurface comp, final boolean realized) {
       this(factory, comp, (GLCapabilitiesImmutable) comp.getGraphicsConfiguration().getRequestedCapabilities(), realized);
   }
 
-  protected GLDrawableImpl(GLDrawableFactory factory, NativeSurface comp, GLCapabilitiesImmutable requestedCapabilities, boolean realized) {
+  protected GLDrawableImpl(final GLDrawableFactory factory, final NativeSurface comp, final GLCapabilitiesImmutable requestedCapabilities, final boolean realized) {
       this.factory = factory;
       this.surface = comp;
       this.realized = realized;
@@ -120,7 +120,7 @@ public abstract class GLDrawableImpl implements GLDrawable {
    */
   protected abstract void swapBuffersImpl(boolean doubleBuffered);
 
-  public final static String toHexString(long hex) {
+  public final static String toHexString(final long hex) {
     return "0x" + Long.toHexString(hex);
   }
 
@@ -130,10 +130,11 @@ public abstract class GLDrawableImpl implements GLDrawable {
   }
 
   @Override
-  public GLCapabilitiesImmutable getChosenGLCapabilities() {
+  public final GLCapabilitiesImmutable getChosenGLCapabilities() {
     return  (GLCapabilitiesImmutable) surface.getGraphicsConfiguration().getChosenCapabilities();
   }
 
+  @Override
   public final GLCapabilitiesImmutable getRequestedGLCapabilities() {
     return requestedCapabilities;
   }
@@ -170,14 +171,14 @@ public abstract class GLDrawableImpl implements GLDrawable {
   }
 
   @Override
-  public final void setRealized(boolean realizedArg) {
+  public final void setRealized(final boolean realizedArg) {
     if ( realized != realizedArg ) { // volatile: OK (locked below)
         final boolean isProxySurface = surface instanceof ProxySurface;
         if(DEBUG) {
             System.err.println(getThreadName() + ": setRealized: drawable "+getClass().getSimpleName()+", surface "+surface.getClass().getSimpleName()+", isProxySurface "+isProxySurface+": "+realized+" -> "+realizedArg);
             Thread.dumpStack();
         }
-        AbstractGraphicsDevice aDevice = surface.getGraphicsConfiguration().getScreen().getDevice();
+        final AbstractGraphicsDevice aDevice = surface.getGraphicsConfiguration().getScreen().getDevice();
         if(realizedArg) {
             if(isProxySurface) {
                 ((ProxySurface)surface).createNotify();
@@ -238,7 +239,7 @@ public abstract class GLDrawableImpl implements GLDrawable {
    * @param ctx the just bounded or unbounded context
    * @param bound if <code>true</code> create an association, otherwise remove it
    */
-  protected void associateContext(GLContext ctx, boolean bound) { }
+  protected void associateContext(final GLContext ctx, final boolean bound) { }
 
   /**
    * Callback for special implementations, allowing GLContext to trigger GL related lifecycle: <code>makeCurrent</code>, <code>release</code>.
@@ -253,14 +254,14 @@ public abstract class GLDrawableImpl implements GLDrawable {
    * </p>
    * @see #associateContext(GLContext, boolean)
    */
-  protected void contextMadeCurrent(GLContext glc, boolean current) { }
+  protected void contextMadeCurrent(final GLContext glc, final boolean current) { }
 
   /** Callback for special implementations, allowing GLContext to fetch a custom default render framebuffer. Defaults to zero.*/
   protected int getDefaultDrawFramebuffer() { return 0; }
   /** Callback for special implementations, allowing GLContext to fetch a custom default read framebuffer. Defaults to zero. */
   protected int getDefaultReadFramebuffer() { return 0; }
   /** Callback for special implementations, allowing GLContext to fetch a custom default read buffer of current framebuffer. */
-  protected int getDefaultReadBuffer(GL gl, boolean hasDedicatedDrawableRead) {
+  protected int getDefaultReadBuffer(final GL gl, final boolean hasDedicatedDrawableRead) {
       if( gl.isGLES() || hasDedicatedDrawableRead || getChosenGLCapabilities().getDoubleBuffered() ) {
           // Note-1: Neither ES1 nor ES2 supports selecting the read buffer via glReadBuffer
           // Note-2: ES3 only supports GL_BACK, GL_NONE or GL_COLOR_ATTACHMENT0+i
@@ -275,13 +276,13 @@ public abstract class GLDrawableImpl implements GLDrawable {
   }
 
   @Override
-  public int getWidth() {
-    return surface.getWidth();
+  public int getSurfaceWidth() {
+    return surface.getSurfaceWidth();
   }
 
   @Override
-  public int getHeight() {
-    return surface.getHeight();
+  public int getSurfaceHeight() {
+    return surface.getSurfaceHeight();
   }
 
   @Override
diff --git a/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java b/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
index 421f062..95e13e2 100644
--- a/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
+++ b/src/jogl/classes/jogamp/opengl/GLDynamicLookupHelper.java
@@ -32,7 +32,7 @@ import com.jogamp.common.os.DynamicLibraryBundle;
 
 public class GLDynamicLookupHelper extends DynamicLibraryBundle {
 
-    public GLDynamicLookupHelper(GLDynamicLibraryBundleInfo info) {
+    public GLDynamicLookupHelper(final GLDynamicLibraryBundleInfo info) {
         super(info);
     }
 
diff --git a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
index 6f5fa3e..a779fed 100644
--- a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
@@ -11,6 +11,7 @@ import javax.media.opengl.GLContext;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLFBODrawable;
 
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.common.util.VersionUtil;
 import com.jogamp.nativewindow.MutableGraphicsConfiguration;
 import com.jogamp.opengl.FBObject;
@@ -43,13 +44,14 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
     static {
         Debug.initSingleton();
         DEBUG = GLDrawableImpl.DEBUG || Debug.debug("FBObject");
-        DEBUG_SWAP = DEBUG || Debug.isPropertyDefined("jogl.debug.FBObject.Swap", true);
+        DEBUG_SWAP = DEBUG || PropertyAccess.isPropertyDefined("jogl.debug.FBObject.Swap", true);
     }
 
     private final GLDrawableImpl parent;
     private GLCapabilitiesImmutable origParentChosenCaps;
 
     private boolean initialized;
+    private int fboModeBits;
     private int texUnit;
     private int samples;
     private boolean fboResetQuirk;
@@ -84,10 +86,11 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
      * @param fboCaps the requested FBO capabilities
      * @param textureUnit
      */
-    protected GLFBODrawableImpl(GLDrawableFactoryImpl factory, GLDrawableImpl parent, NativeSurface surface,
-                                GLCapabilitiesImmutable fboCaps, int textureUnit) {
+    protected GLFBODrawableImpl(final GLDrawableFactoryImpl factory, final GLDrawableImpl parent, final NativeSurface surface,
+                                final GLCapabilitiesImmutable fboCaps, final int textureUnit) {
         super(factory, surface, fboCaps, false);
         this.initialized = false;
+        this.fboModeBits = FBOMODE_USE_TEXTURE | FBOMODE_USE_DEPTH;
 
         this.parent = parent;
         this.origParentChosenCaps = getChosenGLCapabilities(); // just to avoid null, will be reset at initialize(..)
@@ -101,7 +104,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
         this.swapBufferContext = null;
     }
 
-    private final void initialize(boolean realize, GL gl) {
+    private final void initialize(final boolean realize, final GL gl) {
         if( !initialized && !realize ) {
             if( DEBUG ) {
                 System.err.println("GLFBODrawableImpl.initialize(): WARNING - Already unrealized!");
@@ -137,25 +140,56 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
             fboIBack = 0;                // head
             fboIFront = fbos.length - 1; // tail
 
+            final boolean useTexture = 0 != ( FBOMODE_USE_TEXTURE & fboModeBits );
+            final boolean useDepth   = 0 != ( FBOMODE_USE_DEPTH   & fboModeBits );
+            final boolean useStencil = chosenFBOCaps.getStencilBits() > 0;
+            final boolean useAlpha = chosenFBOCaps.getAlphaBits() > 0;
+            final int width = getSurfaceWidth();
+            final int height = getSurfaceHeight();
+
             for(int i=0; i<fbosN; i++) {
                 fbos[i] = new FBObject();
-                fbos[i].reset(gl, getWidth(), getHeight(), samples, false);
+                fbos[i].reset(gl, width, height, samples, false);
                 if(fbos[i].getNumSamples() != samples) {
                     throw new InternalError("Sample number mismatch: "+samples+", fbos["+i+"] "+fbos[i]);
                 }
-                if(samples > 0) {
-                    fbos[i].attachColorbuffer(gl, 0, chosenFBOCaps.getAlphaBits()>0);
+                if(samples > 0 || !useTexture) {
+                    fbos[i].attachColorbuffer(gl, 0, useAlpha);
                 } else {
-                    fbos[i].attachTexture2D(gl, 0, chosenFBOCaps.getAlphaBits()>0);
+                    fbos[i].attachTexture2D(gl, 0, useAlpha);
                 }
-                if( chosenFBOCaps.getStencilBits() > 0 ) {
-                    fbos[i].attachRenderbuffer(gl, Attachment.Type.DEPTH_STENCIL, 24);
-                } else {
+                if( useStencil ) {
+                    if( useDepth ) {
+                        fbos[i].attachRenderbuffer(gl, Attachment.Type.DEPTH_STENCIL, 24);
+                    } else {
+                        fbos[i].attachRenderbuffer(gl, Attachment.Type.STENCIL, 24);
+                    }
+                } else if( useDepth ) {
                     fbos[i].attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
                 }
+                if(samples > 0) {
+                    final FBObject ssink = new FBObject();
+                    {
+                        ssink.reset(gl, width, height);
+                        if( !useTexture ) {
+                            ssink.attachColorbuffer(gl, 0, useAlpha);
+                        } else {
+                            ssink.attachTexture2D(gl, 0, useAlpha);
+                        }
+                        if( useStencil ) {
+                            if( useDepth ) {
+                                ssink.attachRenderbuffer(gl, Attachment.Type.DEPTH_STENCIL, 24);
+                            } else {
+                                ssink.attachRenderbuffer(gl, Attachment.Type.STENCIL, 24);
+                            }
+                        } else if( useDepth ) {
+                            ssink.attachRenderbuffer(gl, Attachment.Type.DEPTH, 24);
+                        }
+                    }
+                    fbos[i].setSamplingSink(ssink);
+                    fbos[i].resetSamplingSink(gl); // validate
+                }
             }
-            fbos[fboIFront].resetSamplingSink(gl);
-
             fbos[0].formatToGLCapabilities(chosenFBOCaps);
             chosenFBOCaps.setDoubleBuffered( chosenFBOCaps.getDoubleBuffered() || samples > 0 );
         } else {
@@ -175,11 +209,11 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
         }
     }
 
-    public final void setSwapBufferContext(SwapBufferContext sbc) {
+    public final void setSwapBufferContext(final SwapBufferContext sbc) {
         swapBufferContext = sbc;
     }
 
-    private final void reset(GL gl, int idx, int width, int height, int samples, int alphaBits, int stencilBits) {
+    private final void reset(final GL gl, final int idx, final int width, final int height, final int samples, final int alphaBits, final int stencilBits) {
         if( !fboResetQuirk ) {
             try {
                 fbos[idx].reset(gl, width, height, samples, false);
@@ -187,7 +221,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
                     throw new InternalError("Sample number mismatch: "+samples+", fbos["+idx+"] "+fbos[idx]);
                 }
                 return;
-            } catch (GLException e) {
+            } catch (final GLException e) {
                 fboResetQuirk = true;
                 if(DEBUG) {
                     if(!resetQuirkInfoDumped) {
@@ -211,7 +245,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
         // resetQuirk fallback
         fbos[idx].destroy(gl);
         fbos[idx] = new FBObject();
-        fbos[idx].reset(gl, getWidth(), getHeight(), samples, false);
+        fbos[idx].reset(gl, getSurfaceWidth(), getSurfaceHeight(), samples, false);
         if(fbos[idx].getNumSamples() != samples) {
             throw new InternalError("Sample number mismatch: "+samples+", fbos["+idx+"] "+fbos[idx]);
         }
@@ -227,7 +261,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
         }
     }
 
-    private final void reset(GL gl, int newSamples) throws GLException {
+    private final void reset(final GL gl, int newSamples) throws GLException {
         if(!initialized) {
             // NOP if not yet initializes
             return;
@@ -262,8 +296,8 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
                 if(DEBUG) {
                     System.err.println("GLFBODrawableImpl.reset(): simple reconfig: "+samples+" -> "+newSamples+"/"+maxSamples);
                 }
-                final int nWidth = getWidth();
-                final int nHeight = getHeight();
+                final int nWidth = getSurfaceWidth();
+                final int nHeight = getSurfaceHeight();
                 samples = newSamples;
                 pendingFBOReset = ( 1 < fbos.length ) ? fboIFront : -1; // pending-front reset only w/ double buffering (or zero samples)
                 final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) surface.getGraphicsConfiguration().getChosenCapabilities();
@@ -275,7 +309,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
                 final GLCapabilities fboCapsNative = (GLCapabilities) surface.getGraphicsConfiguration().getChosenCapabilities();
                 fbos[0].formatToGLCapabilities(fboCapsNative);
             }
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             tFBO = t;
         } finally {
             try {
@@ -283,15 +317,15 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
                 if(ctxSwitch) {
                     curContext.makeCurrent();
                 }
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 tGL = t;
             }
         }
         if(null != tFBO) {
-            throw new GLException("GLFBODrawableImpl.reset(..) FBObject.reset(..) exception", tFBO);
+            throw GLException.newGLException(tFBO);
         }
         if(null != tGL) {
-            throw new GLException("GLFBODrawableImpl.reset(..) GLContext.release() exception", tGL);
+            throw GLException.newGLException(tGL);
         }
         if(DEBUG) {
             System.err.println("GLFBODrawableImpl.reset(newSamples "+newSamples+"): END "+this);
@@ -303,7 +337,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
     //
 
     @Override
-    public final GLContext createContext(GLContext shareWith) {
+    public final GLContext createContext(final GLContext shareWith) {
         final GLContext ctx = parent.createContext(shareWith);
         ctx.setGLDrawable(this, false);
         return ctx;
@@ -325,7 +359,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
     protected final int getDefaultReadFramebuffer() { return initialized ? fbos[fboIFront].getReadFramebuffer() : 0; }
 
     @Override
-    protected final int getDefaultReadBuffer(GL gl, boolean hasDedicatedDrawableRead) {
+    protected final int getDefaultReadBuffer(final GL gl, final boolean hasDedicatedDrawableRead) {
         return initialized ? fbos[fboIFront].getDefaultReadBuffer() : GL.GL_COLOR_ATTACHMENT0 ;
     }
 
@@ -335,8 +369,8 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
         if(realized) {
             parent.setRealized(true);
             origParentChosenCaps = (GLCapabilitiesImmutable) msConfig.getChosenCapabilities();
-            final GLCapabilities chosenFBOCaps = (GLCapabilities) origParentChosenCaps.cloneMutable();
-            chosenFBOCaps.copyFrom(getRequestedGLCapabilities());
+            final GLCapabilities chosenFBOCaps = (GLCapabilities) origParentChosenCaps.cloneMutable(); // incl. <Type>GLCapabilities, e.g. X11GLCapabilities
+            chosenFBOCaps.copyFrom(getRequestedGLCapabilities()); // copy user values
             msConfig.setChosenCapabilities(chosenFBOCaps);
         } else {
             msConfig.setChosenCapabilities(origParentChosenCaps);
@@ -345,12 +379,12 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
     }
 
     @Override
-    protected void associateContext(GLContext glc, boolean bound) {
+    protected void associateContext(final GLContext glc, final boolean bound) {
         initialize(bound, glc.getGL());
     }
 
     @Override
-    protected final void contextMadeCurrent(GLContext glc, boolean current) {
+    protected final void contextMadeCurrent(final GLContext glc, final boolean current) {
         final GL gl = glc.getGL();
         if(current) {
             if( !initialized ) {
@@ -371,7 +405,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
     }
 
     @Override
-    protected void swapBuffersImpl(boolean doubleBuffered) {
+    protected void swapBuffersImpl(final boolean doubleBuffered) {
         final GLContext ctx = GLContext.getCurrent();
         boolean doPostSwap;
         if( null != ctx && ctx.getGLDrawable() == this && fboBound ) {
@@ -392,38 +426,37 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
         }
     }
 
-    private final void swapFBOImplPost(GLContext glc) {
+    private final void swapFBOImplPost(final GLContext glc) {
         // Safely reset the previous front FBO - after completing propagating swap
         if(0 <= pendingFBOReset) {
             final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) surface.getGraphicsConfiguration().getChosenCapabilities();
-            reset(glc.getGL(), pendingFBOReset, getWidth(), getHeight(), samples, caps.getAlphaBits(), caps.getStencilBits());
+            reset(glc.getGL(), pendingFBOReset, getSurfaceWidth(), getSurfaceHeight(), samples, caps.getAlphaBits(), caps.getStencilBits());
             pendingFBOReset = -1;
         }
     }
 
-    private final void swapFBOImpl(GLContext glc) {
+    private final void swapFBOImpl(final GLContext glc) {
         final GL gl = glc.getGL();
         fbos[fboIBack].markUnbound(); // fast path, use(gl,..) is called below
 
         if(DEBUG) {
-            int _fboIFront = ( fboIFront + 1 ) % fbos.length;
+            final int _fboIFront = ( fboIFront + 1 ) % fbos.length;
             if(_fboIFront != fboIBack) { throw new InternalError("XXX: "+_fboIFront+"!="+fboIBack); }
         }
         fboIFront = fboIBack;
         fboIBack  = ( fboIBack  + 1 ) % fbos.length;
 
         final Colorbuffer colorbuffer = samples > 0 ? fbos[fboIFront].getSamplingSink() : fbos[fboIFront].getColorbuffer(0);
+        if(null == colorbuffer) {
+            throw new GLException("Front colorbuffer is null: samples "+samples+", "+this);
+        }
         final TextureAttachment texAttachment;
-        if(colorbuffer instanceof TextureAttachment) {
-            texAttachment = (TextureAttachment) colorbuffer;
+        if( colorbuffer.isTextureAttachment() ) {
+            texAttachment = colorbuffer.getTextureAttachment();
+            gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit);
         } else {
-            if(null == colorbuffer) {
-                throw new GLException("Front colorbuffer is null: samples "+samples+", "+this);
-            } else {
-                throw new GLException("Front colorbuffer is not a texture: "+colorbuffer.getClass().getName()+": samples "+samples+", "+colorbuffer+", "+this);
-            }
+            texAttachment = null;
         }
-        gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit);
         fbos[fboIFront].use(gl, texAttachment);
 
         /* Included in above use command:
@@ -446,7 +479,20 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
     }
 
     @Override
-    public final void resetSize(GL gl) throws GLException {
+    public final void setFBOMode(final int modeBits) throws IllegalStateException {
+        if( isInitialized() ) {
+            throw new IllegalStateException("Already initialized: "+this);
+        }
+        this.fboModeBits = modeBits;
+    }
+
+    @Override
+    public final int getFBOMode() {
+        return fboModeBits;
+    }
+
+    @Override
+    public final void resetSize(final GL gl) throws GLException {
         reset(gl, samples);
     }
 
@@ -454,20 +500,20 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
     public final int getTextureUnit() { return texUnit; }
 
     @Override
-    public final void setTextureUnit(int u) { texUnit = u; }
+    public final void setTextureUnit(final int u) { texUnit = u; }
 
     @Override
     public final int getNumSamples() { return samples; }
 
     @Override
-    public void setNumSamples(GL gl, int newSamples) throws GLException {
+    public void setNumSamples(final GL gl, final int newSamples) throws GLException {
         if(samples != newSamples) {
             reset(gl, newSamples);
         }
     }
 
     @Override
-    public final int setNumBuffers(int bufferCount) throws GLException {
+    public final int setNumBuffers(final int bufferCount) throws GLException {
         // FIXME: Implement
         return bufferCount;
     }
@@ -495,7 +541,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
     } */
 
     @Override
-    public FBObject getFBObject(int bufferName) throws IllegalArgumentException {
+    public FBObject getFBObject(final int bufferName) throws IllegalArgumentException {
         if(!initialized) {
             return null;
         }
@@ -518,24 +564,24 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
     }
 
     @Override
-    public final TextureAttachment getTextureBuffer(int bufferName) throws IllegalArgumentException {
+    public final Colorbuffer getColorbuffer(final int bufferName) throws IllegalArgumentException {
         if(!initialized) {
             return null;
         }
-        final TextureAttachment res;
+        final Colorbuffer res;
         switch(bufferName) {
             case GL.GL_FRONT:
                 if( samples > 0 ) {
                     res = fbos[0].getSamplingSink();
                 } else {
-                    res = (TextureAttachment) fbos[fboIFront].getColorbuffer(0);
+                    res = fbos[fboIFront].getColorbuffer(0);
                 }
                 break;
             case GL.GL_BACK:
                 if( samples > 0 ) {
                     throw new IllegalArgumentException("Cannot access GL_BACK buffer of MSAA FBO: "+this);
                 } else {
-                    res = (TextureAttachment) fbos[fboIBack].getColorbuffer(0);
+                    res = fbos[fboIBack].getColorbuffer(0);
                 }
                 break;
             default:
@@ -559,17 +605,17 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
     }
 
     public static class ResizeableImpl extends GLFBODrawableImpl implements GLFBODrawable.Resizeable {
-        protected ResizeableImpl(GLDrawableFactoryImpl factory, GLDrawableImpl parent, ProxySurface surface,
-                                 GLCapabilitiesImmutable fboCaps, int textureUnit) {
+        protected ResizeableImpl(final GLDrawableFactoryImpl factory, final GLDrawableImpl parent, final ProxySurface surface,
+                                 final GLCapabilitiesImmutable fboCaps, final int textureUnit) {
             super(factory, parent, surface, fboCaps, textureUnit);
         }
 
         @Override
-        public final void setSize(GLContext context, int newWidth, int newHeight) throws NativeWindowException, GLException {
+        public final void setSurfaceSize(final GLContext context, final int newWidth, final int newHeight) throws NativeWindowException, GLException {
             if(DEBUG) {
                 System.err.println("GLFBODrawableImpl.ResizeableImpl setSize: ("+getThreadName()+"): "+newWidth+"x"+newHeight+" - surfaceHandle 0x"+Long.toHexString(getNativeSurface().getSurfaceHandle()));
             }
-            int lockRes = lockSurface();
+            final int lockRes = lockSurface();
             if (NativeSurface.LOCK_SURFACE_NOT_READY >= lockRes) {
                 throw new NativeWindowException("Could not lock surface: "+this);
             }
@@ -578,7 +624,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
                 final ProxySurface ps = (ProxySurface) getNativeSurface();
                 final UpstreamSurfaceHook ush = ps.getUpstreamSurfaceHook();
                 if(ush instanceof UpstreamSurfaceHook.MutableSize) {
-                    ((UpstreamSurfaceHook.MutableSize)ush).setSize(newWidth, newHeight);
+                    ((UpstreamSurfaceHook.MutableSize)ush).setSurfaceSize(newWidth, newHeight);
                 } else {
                     throw new InternalError("GLFBODrawableImpl.ResizableImpl's ProxySurface doesn't hold a UpstreamSurfaceHookMutableSize but "+ush.getClass().getName()+", "+ps+", ush");
                 }
diff --git a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationFactory.java
index 5c6b475..90d18eb 100644
--- a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationFactory.java
@@ -37,8 +37,8 @@ import javax.media.opengl.DefaultGLCapabilitiesChooser;
 
 public abstract class GLGraphicsConfigurationFactory extends GraphicsConfigurationFactory {
 
-    protected static int chooseCapabilities(CapabilitiesChooser chooser, CapabilitiesImmutable capsRequested,
-                                            List<? extends CapabilitiesImmutable> availableCaps, int recommendedIndex) {
+    protected static int chooseCapabilities(CapabilitiesChooser chooser, final CapabilitiesImmutable capsRequested,
+                                            final List<? extends CapabilitiesImmutable> availableCaps, final int recommendedIndex) {
         if (null == capsRequested) {
             throw new NativeWindowException("Null requested capabilities");
         }
@@ -69,7 +69,7 @@ public abstract class GLGraphicsConfigurationFactory extends GraphicsConfigurati
                 }
                 return chosenIndex;
             }
-        } catch (NativeWindowException e) {
+        } catch (final NativeWindowException e) {
             if (DEBUG) {
                 e.printStackTrace();
             }
diff --git a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java
index 702fb77..1fb27cf 100644
--- a/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java
+++ b/src/jogl/classes/jogamp/opengl/GLGraphicsConfigurationUtil.java
@@ -45,7 +45,7 @@ public class GLGraphicsConfigurationUtil {
     public static final int FBO_BIT     = 1 << 3; // generic bit must be mapped to native one at impl. level
     public static final int ALL_BITS    = WINDOW_BIT | BITMAP_BIT | PBUFFER_BIT | FBO_BIT ;
 
-    public static final StringBuilder winAttributeBits2String(StringBuilder sb, int winattrbits) {
+    public static final StringBuilder winAttributeBits2String(StringBuilder sb, final int winattrbits) {
         if(null==sb) {
             sb = new StringBuilder();
         }
@@ -101,7 +101,7 @@ public class GLGraphicsConfigurationUtil {
     /**
      * @return bitmask representing the input boolean in exclusive or logic, ie only one bit will be set.
      */
-    public static final int getExclusiveWinAttributeBits(boolean isOnscreen, boolean isFBO, boolean isPBuffer, boolean isBitmap) {
+    public static final int getExclusiveWinAttributeBits(final boolean isOnscreen, final boolean isFBO, final boolean isPBuffer, final boolean isBitmap) {
         final int winattrbits;
         if(isOnscreen) {
             winattrbits = WINDOW_BIT;
@@ -120,11 +120,11 @@ public class GLGraphicsConfigurationUtil {
     /**
      * @see #getExclusiveWinAttributeBits(boolean, boolean, boolean, boolean)
      */
-    public static final int getExclusiveWinAttributeBits(GLCapabilitiesImmutable caps) {
+    public static final int getExclusiveWinAttributeBits(final GLCapabilitiesImmutable caps) {
         return getExclusiveWinAttributeBits(caps.isOnscreen(), caps.isFBO(), caps.isPBuffer(), caps.isBitmap());
     }
 
-    public static final GLCapabilities fixWinAttribBitsAndHwAccel(AbstractGraphicsDevice device, int winattrbits, GLCapabilities caps) {
+    public static final GLCapabilities fixWinAttribBitsAndHwAccel(final AbstractGraphicsDevice device, final int winattrbits, final GLCapabilities caps) {
         caps.setBitmap  ( 0 != ( BITMAP_BIT  & winattrbits ) );
         caps.setPBuffer ( 0 != ( PBUFFER_BIT & winattrbits ) );
         caps.setFBO     ( 0 != ( FBO_BIT     & winattrbits ) );
@@ -150,15 +150,15 @@ public class GLGraphicsConfigurationUtil {
      * @param device the device on which the drawable will be created, maybe null for the {@link GLDrawableFactory#getDefaultDevice() default device}.
      * @return either the given requested {@link GLCapabilitiesImmutable} instance if no modifications were required, or a modified {@link GLCapabilitiesImmutable} instance.
      */
-    public static GLCapabilitiesImmutable fixGLCapabilities(GLCapabilitiesImmutable capsRequested,
-                                                            GLDrawableFactory factory, AbstractGraphicsDevice device) {
+    public static GLCapabilitiesImmutable fixGLCapabilities(final GLCapabilitiesImmutable capsRequested,
+                                                            final GLDrawableFactory factory, final AbstractGraphicsDevice device) {
         if( !capsRequested.isOnscreen() ) {
             return fixOffscreenGLCapabilities(capsRequested, factory, device);
         }
         return capsRequested;
     }
 
-    public static GLCapabilitiesImmutable fixOnscreenGLCapabilities(GLCapabilitiesImmutable capsRequested)
+    public static GLCapabilitiesImmutable fixOnscreenGLCapabilities(final GLCapabilitiesImmutable capsRequested)
     {
         if( !capsRequested.isOnscreen() || capsRequested.isFBO() || capsRequested.isPBuffer() || capsRequested.isBitmap() ) {
             // fix caps ..
@@ -172,7 +172,7 @@ public class GLGraphicsConfigurationUtil {
         return capsRequested;
     }
 
-    public static GLCapabilitiesImmutable fixOffscreenBitOnly(GLCapabilitiesImmutable capsRequested)
+    public static GLCapabilitiesImmutable fixOffscreenBitOnly(final GLCapabilitiesImmutable capsRequested)
     {
         if( capsRequested.isOnscreen() ) {
             // fix caps ..
@@ -195,8 +195,8 @@ public class GLGraphicsConfigurationUtil {
      * @param device the device on which the drawable will be created, maybe null for the {@link GLDrawableFactory#getDefaultDevice() default device}.
      * @return either the given requested {@link GLCapabilitiesImmutable} instance if no modifications were required, or a modified {@link GLCapabilitiesImmutable} instance.
      */
-    public static GLCapabilitiesImmutable fixOffscreenGLCapabilities(GLCapabilitiesImmutable capsRequested,
-                                                                     GLDrawableFactory factory, AbstractGraphicsDevice device) {
+    public static GLCapabilitiesImmutable fixOffscreenGLCapabilities(final GLCapabilitiesImmutable capsRequested,
+                                                                     final GLDrawableFactory factory, AbstractGraphicsDevice device) {
         if(null == device) {
             device = factory.getDefaultDevice();
         }
@@ -250,7 +250,7 @@ public class GLGraphicsConfigurationUtil {
         return capsRequested;
     }
 
-    public static GLCapabilitiesImmutable fixGLPBufferGLCapabilities(GLCapabilitiesImmutable capsRequested)
+    public static GLCapabilitiesImmutable fixGLPBufferGLCapabilities(final GLCapabilitiesImmutable capsRequested)
     {
         if( capsRequested.isOnscreen() ||
             !capsRequested.isPBuffer() ||
@@ -268,7 +268,7 @@ public class GLGraphicsConfigurationUtil {
     }
 
     /** Fix opaque setting while preserve alpha bits */
-    public static GLCapabilities fixOpaqueGLCapabilities(GLCapabilities capsRequested, boolean isOpaque)
+    public static GLCapabilities fixOpaqueGLCapabilities(final GLCapabilities capsRequested, final boolean isOpaque)
     {
         if( capsRequested.isBackgroundOpaque() != isOpaque) {
             final int alphaBits = capsRequested.getAlphaBits();
@@ -279,7 +279,7 @@ public class GLGraphicsConfigurationUtil {
     }
 
     /** Fix double buffered setting */
-    public static GLCapabilitiesImmutable fixDoubleBufferedGLCapabilities(GLCapabilitiesImmutable capsRequested, boolean doubleBuffered)
+    public static GLCapabilitiesImmutable fixDoubleBufferedGLCapabilities(final GLCapabilitiesImmutable capsRequested, final boolean doubleBuffered)
     {
         if( capsRequested.getDoubleBuffered() != doubleBuffered) {
             final GLCapabilities caps2 = (GLCapabilities) capsRequested.cloneMutable();
@@ -289,7 +289,7 @@ public class GLGraphicsConfigurationUtil {
         return capsRequested;
     }
 
-    public static GLCapabilitiesImmutable clipRGBAGLCapabilities(GLCapabilitiesImmutable caps, boolean allowRGB555, boolean allowAlpha)
+    public static GLCapabilitiesImmutable clipRGBAGLCapabilities(final GLCapabilitiesImmutable caps, final boolean allowRGB555, final boolean allowAlpha)
     {
         final int iR = caps.getRedBits();
         final int iG = caps.getGreenBits();
@@ -320,7 +320,7 @@ public class GLGraphicsConfigurationUtil {
         return compOut;
     }
 
-    public static GLCapabilitiesImmutable fixGLProfile(GLCapabilitiesImmutable caps, GLProfile glp)
+    public static GLCapabilitiesImmutable fixGLProfile(final GLCapabilitiesImmutable caps, final GLProfile glp)
     {
         if( caps.getGLProfile() != glp ) {
             final GLCapabilities caps2 = (GLCapabilities) caps.cloneMutable();
diff --git a/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
index 345f08e..60cc9f0 100644
--- a/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLOffscreenAutoDrawableImpl.java
@@ -52,12 +52,12 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
      * @param upstreamWidget optional UI element holding this instance, see {@link #getUpstreamWidget()}.
      * @param lock optional upstream lock, may be null
      */
-    public GLOffscreenAutoDrawableImpl(GLDrawable drawable, GLContext context, Object upstreamWidget, RecursiveLock lock) {
+    public GLOffscreenAutoDrawableImpl(final GLDrawable drawable, final GLContext context, final Object upstreamWidget, final RecursiveLock lock) {
         super(drawable, context, upstreamWidget, true, lock);
     }
 
     @Override
-    public void setSize(int newWidth, int newHeight) throws NativeWindowException, GLException {
+    public void setSurfaceSize(final int newWidth, final int newHeight) throws NativeWindowException, GLException {
         this.defaultWindowResizedOp(newWidth, newHeight);
     }
 
@@ -71,7 +71,7 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
          * @param upstreamWidget optional UI element holding this instance, see {@link #getUpstreamWidget()}.
          * @param lock optional upstream lock, may be null
          */
-        public FBOImpl(GLFBODrawableImpl drawable, GLContext context, Object upstreamWidget, RecursiveLock lock) {
+        public FBOImpl(final GLFBODrawableImpl drawable, final GLContext context, final Object upstreamWidget, final RecursiveLock lock) {
             super(drawable, context, upstreamWidget, lock);
         }
 
@@ -86,7 +86,7 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
         }
 
         @Override
-        public final void setTextureUnit(int unit) {
+        public final void setTextureUnit(final int unit) {
             ((GLFBODrawableImpl)drawable).setTextureUnit(unit);
         }
 
@@ -96,13 +96,13 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
         }
 
         @Override
-        public final void setNumSamples(GL gl, int newSamples) throws GLException {
+        public final void setNumSamples(final GL gl, final int newSamples) throws GLException {
             ((GLFBODrawableImpl)drawable).setNumSamples(gl, newSamples);
             windowRepaintOp();
         }
 
         @Override
-        public final int setNumBuffers(int bufferCount) throws GLException {
+        public final int setNumBuffers(final int bufferCount) throws GLException {
             return ((GLFBODrawableImpl)drawable).setNumBuffers(bufferCount);
         }
 
@@ -123,18 +123,29 @@ public class GLOffscreenAutoDrawableImpl extends GLAutoDrawableDelegate implemen
         } */
 
         @Override
-        public final FBObject getFBObject(int bufferName) {
+        public final FBObject getFBObject(final int bufferName) {
             return ((GLFBODrawableImpl)drawable).getFBObject(bufferName);
         }
 
         @Override
-        public final FBObject.TextureAttachment getTextureBuffer(int bufferName) {
-            return ((GLFBODrawableImpl)drawable).getTextureBuffer(bufferName);
+        public final FBObject.Colorbuffer getColorbuffer(final int bufferName) {
+            return ((GLFBODrawableImpl)drawable).getColorbuffer(bufferName);
         }
 
         @Override
-        public void resetSize(GL gl) throws GLException {
+        public void resetSize(final GL gl) throws GLException {
             ((GLFBODrawableImpl)drawable).resetSize(gl);
         }
+
+        @Override
+        public final void setFBOMode(final int modeBits) throws IllegalStateException {
+            ((GLFBODrawableImpl)drawable).setFBOMode(modeBits);
+
+        }
+
+        @Override
+        public final int getFBOMode() {
+            return ((GLFBODrawableImpl)drawable).getFBOMode();
+        }
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java b/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
deleted file mode 100644
index c32957b..0000000
--- a/src/jogl/classes/jogamp/opengl/GLPbufferImpl.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
- *
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
- *
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- *
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
- */
-
-package jogamp.opengl;
-
-import javax.media.opengl.GLDrawableFactory;
-import javax.media.opengl.GLException;
-import javax.media.opengl.GLPbuffer;
-
-import com.jogamp.common.util.locks.LockFactory;
-import com.jogamp.common.util.locks.RecursiveLock;
-
- at SuppressWarnings("deprecation")
-public class GLPbufferImpl extends GLAutoDrawableBase implements GLPbuffer {
-
-  public GLPbufferImpl(GLDrawableImpl pbufferDrawable, GLContextImpl pbufferContext) {
-    super(pbufferDrawable, pbufferContext, true); // drawable := pbufferDrawable, context := pbufferContext
-  }
-
-  //
-  // pbuffer specifics
-  //
-
-  //
-  // GLDrawable delegation
-  //
-
-  @Override
-  public final void swapBuffers() throws GLException {
-      defaultSwapBuffers();
-  }
-
-  //
-  // GLAutoDrawable completion
-  //
-  private final RecursiveLock lock = LockFactory.createRecursiveLock();  // instance wide lock
-
-  @Override
-  protected final RecursiveLock getLock() { return lock; }
-
-  @Override
-  public final Object getUpstreamWidget() {
-    return null;
-  }
-
-  @Override
-  public void destroy() {
-    defaultDestroy();
-  }
-
-  @Override
-  public GLDrawableFactory getFactory() {
-    return drawable.getFactory();
-  }
-
-  @Override
-  public final void display() {
-    final RecursiveLock _lock = lock;
-    _lock.lock(); // sync: context/drawable could been recreated/destroyed while animating
-    try {
-        if( null != context ) {
-          helper.invokeGL(drawable, context, defaultDisplayAction, defaultInitAction);
-        }
-    } finally {
-        _lock.unlock();
-    }
-  }
-}
diff --git a/src/jogl/classes/jogamp/opengl/GLRunnableTask.java b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
index 6de92f5..ca1c186 100644
--- a/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
+++ b/src/jogl/classes/jogamp/opengl/GLRunnableTask.java
@@ -44,7 +44,7 @@ public class GLRunnableTask implements GLRunnable {
 
     Throwable runnableException;
 
-    public GLRunnableTask(GLRunnable runnable, Object notifyObject, boolean catchExceptions) {
+    public GLRunnableTask(final GLRunnable runnable, final Object notifyObject, final boolean catchExceptions) {
         this.runnable = runnable ;
         this.notifyObject = notifyObject ;
         this.catchExceptions = catchExceptions;
@@ -53,12 +53,12 @@ public class GLRunnableTask implements GLRunnable {
     }
 
     @Override
-    public boolean run(GLAutoDrawable drawable) {
+    public boolean run(final GLAutoDrawable drawable) {
         boolean res = true;
         if(null == notifyObject) {
             try {
                 res = runnable.run(drawable);
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 runnableException = t;
                 if(catchExceptions) {
                     runnableException.printStackTrace();
@@ -72,7 +72,7 @@ public class GLRunnableTask implements GLRunnable {
             synchronized (notifyObject) {
                 try {
                     res = runnable.run(drawable);
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     runnableException = t;
                     if(catchExceptions) {
                         runnableException.printStackTrace();
@@ -90,8 +90,10 @@ public class GLRunnableTask implements GLRunnable {
 
     /**
      * Simply flush this task and notify a waiting executor.
+     * <p>
      * The executor which might have been blocked until notified
      * will be unblocked and the task removed from the queue.
+     * </p>
      *
      * @see #isFlushed()
      * @see #isInQueue()
diff --git a/src/jogl/classes/jogamp/opengl/GLStateTracker.java b/src/jogl/classes/jogamp/opengl/GLStateTracker.java
index 0e45174..d532a25 100644
--- a/src/jogl/classes/jogamp/opengl/GLStateTracker.java
+++ b/src/jogl/classes/jogamp/opengl/GLStateTracker.java
@@ -57,10 +57,11 @@ public class GLStateTracker {
   /** Minimum value of MAX_CLIENT_ATTRIB_STACK_DEPTH */
   public static final int MIN_CLIENT_ATTRIB_STACK_DEPTH = 16;
 
-  /** static size of pixel state map */
-  static final int PIXEL_STATE_MAP_SIZE = 16;
+  /** static size of pixel state map
+  private static final int PIXEL_STATE_MAP_SIZE = 16;
+  */
   /** avoid rehash of static size pixel state map */
-  static final int PIXEL_STATE_MAP_CAPACITY = 32;
+  private static final int PIXEL_STATE_MAP_CAPACITY = 32;
 
   private volatile boolean enabled = true;
 
@@ -77,7 +78,7 @@ public class GLStateTracker {
     /**
      * set (client) pixel-store state, deep copy
      */
-    private final void setPixelStateMap(IntIntHashMap pixelStateMap) {
+    private final void setPixelStateMap(final IntIntHashMap pixelStateMap) {
         this.pixelStateMap = (IntIntHashMap) pixelStateMap.clone();
     }
 
@@ -101,7 +102,7 @@ public class GLStateTracker {
     pixelStateMap.clear();
   }
 
-  public final void setEnabled(boolean on) {
+  public final void setEnabled(final boolean on) {
     enabled = on;
   }
 
@@ -111,7 +112,7 @@ public class GLStateTracker {
 
   /** @return true if found in our map, otherwise false,
    *  which forces the caller to query GL. */
-  public final boolean getInt(int pname, int[] params, int params_offset) {
+  public final boolean getInt(final int pname, final int[] params, final int params_offset) {
     if(enabled) {
         final int value = pixelStateMap.get(pname);
         if(0xFFFFFFFF != value) {
@@ -124,7 +125,7 @@ public class GLStateTracker {
 
   /** @return true if found in our map, otherwise false,
    *  which forces the caller to query GL. */
-  public final boolean getInt(int pname, IntBuffer params, int dummy) {
+  public final boolean getInt(final int pname, final IntBuffer params, final int dummy) {
     if(enabled) {
         final int value = pixelStateMap.get(pname);
         if(0xFFFFFFFF != value) {
@@ -135,15 +136,15 @@ public class GLStateTracker {
     return false;
   }
 
-  public final void setInt(int pname, int param) {
+  public final void setInt(final int pname, final int param) {
     if(enabled) {
         pixelStateMap.put(pname, param);
     }
   }
 
-  public final void pushAttrib(int flags) {
+  public final void pushAttrib(final int flags) {
     if(enabled) {
-        SavedState state = new SavedState(); // empty-slot
+        final SavedState state = new SavedState(); // empty-slot
         if( 0 != (flags&GL2.GL_CLIENT_PIXEL_STORE_BIT) ) {
             // save client pixel-store state
             state.setPixelStateMap(pixelStateMap);
@@ -157,7 +158,7 @@ public class GLStateTracker {
         if(stack.isEmpty()) {
             throw new GLException("stack contains no elements");
         }
-        SavedState state = stack.remove(stack.size()-1); // pop
+        final SavedState state = stack.remove(stack.size()-1); // pop
 
         if(null==state) {
             throw new GLException("null stack element (remaining stack size "+stack.size()+")");
diff --git a/src/jogl/classes/jogamp/opengl/GLVersionNumber.java b/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
index 431c1a3..ddcd962 100644
--- a/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
+++ b/src/jogl/classes/jogamp/opengl/GLVersionNumber.java
@@ -39,7 +39,7 @@ public class GLVersionNumber extends VersionNumberString {
 
     private final boolean valid;
 
-    private GLVersionNumber(int[] val, int strEnd, short state, String versionString, boolean valid) {
+    private GLVersionNumber(final int[] val, final int strEnd, final short state, final String versionString, final boolean valid) {
         super(val[0], val[1], val[2], strEnd, state, versionString);
         this.valid = valid;
     }
@@ -56,8 +56,8 @@ public class GLVersionNumber extends VersionNumberString {
     }
     private static volatile java.util.regex.Pattern _Pattern = null;
 
-    public static final GLVersionNumber create(String versionString) {
-        int[] val = new int[] { 0, 0, 0 };
+    public static final GLVersionNumber create(final String versionString) {
+        final int[] val = new int[] { 0, 0, 0 };
         int strEnd = 0;
         short state = 0;
         boolean valid = false;
@@ -67,7 +67,7 @@ public class GLVersionNumber extends VersionNumberString {
                 if (versionString.startsWith("GL_VERSION_")) {
                     versionPattern = getUnderscorePattern();
                 } else {
-                    versionPattern = VersionNumberString.getDefaultVersionNumberPattern();
+                    versionPattern = VersionNumber.getDefaultVersionNumberPattern();
                 }
                 final VersionNumberString version = new VersionNumberString(versionString, versionPattern);
                 strEnd = version.endOfStringMatch();
@@ -76,7 +76,7 @@ public class GLVersionNumber extends VersionNumberString {
                 state = (short) ( ( version.hasMajor() ? VersionNumber.HAS_MAJOR : (short)0 ) |
                                   ( version.hasMinor() ? VersionNumber.HAS_MINOR : (short)0 ) );
                 valid = version.hasMajor() && version.hasMinor(); // Requires at least a defined major and minor version component!
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
                 System.err.println("Info: ExtensionAvailabilityCache: FunctionAvailabilityCache.Version.<init>: " + e);
                 val[0] = 1;
@@ -101,7 +101,7 @@ public class GLVersionNumber extends VersionNumberString {
      *   4.3.0 NVIDIA 310.32 -> 310.32 (310.32)
      * </pre>
      */
-    public static final VersionNumberString createVendorVersion(String versionString) {
+    public static final VersionNumberString createVendorVersion(final String versionString) {
         if (versionString == null || versionString.length() <= 0) {
             return null;
         }
diff --git a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
index 100b46a..131e6f3 100644
--- a/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
+++ b/src/jogl/classes/jogamp/opengl/GLWorkerThread.java
@@ -86,7 +86,7 @@ public class GLWorkerThread {
             thread.start();
             try {
               lock.wait();
-            } catch (InterruptedException e) {
+            } catch (final InterruptedException e) {
             }
           }
 
@@ -149,7 +149,7 @@ public class GLWorkerThread {
     }
   }
 
-  public static void invoke(boolean wait, Runnable runnable)
+  public static void invoke(final boolean wait, final Runnable runnable)
       throws InvocationTargetException, InterruptedException {
       if(wait) {
           invokeAndWait(runnable);
@@ -158,13 +158,13 @@ public class GLWorkerThread {
       }
   }
 
-  public static void invokeAndWait(Runnable runnable)
+  public static void invokeAndWait(final Runnable runnable)
     throws InvocationTargetException, InterruptedException {
     if (!started) {
       throw new RuntimeException(getThreadName()+": May not invokeAndWait on worker thread without starting it first");
     }
 
-    Object lockTemp = lock;
+    final Object lockTemp = lock;
     if (lockTemp == null) {
       return; // Terminating
     }
@@ -179,19 +179,19 @@ public class GLWorkerThread {
       lockTemp.notifyAll();
       lockTemp.wait();
       if (exception != null) {
-        Throwable localException = exception;
+        final Throwable localException = exception;
         exception = null;
         throw new InvocationTargetException(localException);
       }
     }
   }
 
-  public static void invokeLater(Runnable runnable) {
+  public static void invokeLater(final Runnable runnable) {
     if (!started) {
       throw new RuntimeException(getThreadName()+": May not invokeLater on worker thread without starting it first");
     }
 
-    Object lockTemp = lock;
+    final Object lockTemp = lock;
     if (lockTemp == null) {
       return; // Terminating
     }
@@ -237,7 +237,7 @@ public class GLWorkerThread {
             try {
               // Avoid race conditions with wanting to release contexts on this thread
               lock.wait(1000);
-            } catch (InterruptedException e) {
+            } catch (final InterruptedException e) {
             }
 
             if (GLContext.getCurrent() != null) {
@@ -256,7 +256,7 @@ public class GLWorkerThread {
           if (work != null) {
             try {
               work.run();
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
               exception = t;
             } finally {
               work = null;
@@ -266,19 +266,19 @@ public class GLWorkerThread {
 
           while (!queue.isEmpty()) {
             try {
-              Runnable curAsync = queue.remove(0);
+              final Runnable curAsync = queue.remove(0);
               curAsync.run();
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
               System.err.println(getThreadName()+": Exception occurred on JOGL OpenGL worker thread:");
               t.printStackTrace();
             }
           }
 
           // See about releasing current context
-          GLContext curContext = GLContext.getCurrent();
+          final GLContext curContext = GLContext.getCurrent();
           if (curContext != null &&
               (curContext instanceof GLContextImpl)) {
-            GLContextImpl impl = (GLContextImpl) curContext;
+            final GLContextImpl impl = (GLContextImpl) curContext;
             if (impl.hasWaiters()) {
               impl.release();
             }
diff --git a/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java b/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
index a64a2f5..12384ad 100644
--- a/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
+++ b/src/jogl/classes/jogamp/opengl/ListenerSyncedImplStub.java
@@ -58,18 +58,18 @@ public class ListenerSyncedImplStub<E> {
     return listeners.size();
   }
 
-  public synchronized final void addListener(E listener) {
+  public synchronized final void addListener(final E listener) {
     addListener(-1, listener);
   }
 
-  public synchronized final void addListener(int index, E listener) {
+  public synchronized final void addListener(int index, final E listener) {
     if(0>index) {
         index = listeners.size();
     }
     listeners.add(index, listener);
   }
 
-  public synchronized final void removeListener(E listener) {
+  public synchronized final void removeListener(final E listener) {
     listeners.remove(listener);
   }
 
diff --git a/src/jogl/classes/jogamp/opengl/MemoryObject.java b/src/jogl/classes/jogamp/opengl/MemoryObject.java
deleted file mode 100644
index 6ebefc5..0000000
--- a/src/jogl/classes/jogamp/opengl/MemoryObject.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package jogamp.opengl;
-
-import java.nio.ByteBuffer;
-import java.util.HashMap;
-
-import javax.media.opengl.GLBufferStorage;
-
-import com.jogamp.common.util.HashUtil;
-
-/**
- * @deprecated No more used for GL buffer storage tracking, see {@link GLBufferStorage} and {@link GLBufferObjectTracker}.
- */
-public class MemoryObject {
-    private final long addr;
-    private final long size;
-    private final int  hash;
-    private ByteBuffer buffer=null;
-    public MemoryObject(long addr, long size) {
-        this.addr = addr;
-        this.size = size;
-        this.hash = HashUtil.getAddrSizeHash32_EqualDist(addr, size);
-    }
-
-    public void setBuffer(ByteBuffer buffer) {
-        this.buffer = buffer;
-    }
-
-    public ByteBuffer getBuffer() {
-        return this.buffer;
-    }
-
-    /**
-     * @return the 32bit hash value generated via {@link HashUtil#getAddrSizeHash32_EqualDist(long, long)}.
-     */
-    @Override
-    public int hashCode() {
-        return hash;
-    }
-
-    @Override
-    public String toString() {
-        return "MemoryObject[addr 0x"+Long.toHexString(addr)+", size 0x"+Long.toHexString(size)+", hash32: 0x"+Integer.toHexString(hash)+"]";
-    }
-
-    /**
-     * Ignores the optional attached <code>ByteBuffer</code> intentionally.<br>
-     *
-     * @return true of reference is equal or <code>obj</code> is of type <code>MemoryObject</code>
-     *         and <code>addr</code> and <code>size</code> is equal.<br>
-     */
-    public boolean equals(Object obj) {
-        if(this == obj) { return true; }
-        if(obj instanceof MemoryObject) {
-            final MemoryObject m = (MemoryObject) obj;
-            return addr == m.addr && size == m.size ;
-        }
-        return false;
-    }
-
-    /**
-     * @param map the identity HashMap, MemoryObject to MemoryObject
-     * @param obj0 the MemoryObject
-     * @return either the already mapped MemoryObject - not changing the map, or the newly mapped one.
-     */
-    public static MemoryObject getOrAddSafe(HashMap<MemoryObject,MemoryObject> map, MemoryObject obj0) {
-        final MemoryObject obj1 = map.get(obj0); // get identity (fast)
-        if(null == obj1) {
-            map.put(obj0, obj0);
-            return obj0;
-        } else {
-            return obj1;
-        }
-    }
-
-}
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/ProjectFloat.java b/src/jogl/classes/jogamp/opengl/ProjectFloat.java
index d4fd1c9..5921eb9 100644
--- a/src/jogl/classes/jogamp/opengl/ProjectFloat.java
+++ b/src/jogl/classes/jogamp/opengl/ProjectFloat.java
@@ -115,13 +115,11 @@
  */
 package jogamp.opengl;
 
-import java.nio.Buffer;
 import java.nio.FloatBuffer;
 import java.nio.IntBuffer;
 
 import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
-import com.jogamp.common.nio.Buffers;
 import com.jogamp.opengl.math.FloatUtil;
 
 /**
@@ -145,195 +143,14 @@ public class ProjectFloat {
   // simpler) to simply have the array-based entry points delegate to
   // the versions taking Buffers by wrapping the arrays.
 
-  // Array-based implementation
-  private final float[] matrix = new float[16];
-  private final float[][] tempInvertMatrix = new float[4][4];
-
-  private final float[] in = new float[4];
-  private final float[] out = new float[4];
-
-  // Buffer-based implementation
-  private FloatBuffer matrixBuf; // 4x4
-
-  private final float[] forward = new float[3];  // 3
-  private final float[] side    = new float[3];  // 3
-  private final float[] up      = new float[3];  // 3
+  private final float[] mat4Tmp1 = new float[16];
+  private final float[] mat4Tmp2 = new float[16];
+  private final float[] mat4Tmp3 = new float[16];
 
   public ProjectFloat() {
-      this(true);
-  }
-
-  public ProjectFloat(boolean useBackingArray) {
-      this(useBackingArray ? null : Buffers.newDirectByteBuffer(getRequiredFloatBufferSize() * Buffers.SIZEOF_FLOAT),
-           useBackingArray ? new float[getRequiredFloatBufferSize()] : null,
-           0);
-  }
-
-  /**
-   * @param floatBuffer source buffer, may be ByteBuffer (recommended) or FloatBuffer or <code>null</code>.
-   *                    If used, shall be ≥ {@link #getRequiredFloatBufferSize()} + floatOffset.
-   *                    Buffer's position is ignored and floatPos is being used.
-   * @param floatArray source float array or <code>null</code>.
-   *                   If used, size shall be ≥ {@link #getRequiredFloatBufferSize()} + floatOffset.
-   * @param floatOffset Offset for either of the given sources (buffer or array)
-   */
-  public ProjectFloat(Buffer floatBuffer, float[] floatArray, int floatOffset) {
-    matrixBuf = Buffers.slice2Float(floatBuffer, floatArray, floatOffset, 16);
-  }
-
-  public void destroy() {
-    matrixBuf = null;
   }
 
   /**
-   * @param src
-   * @param srcOffset
-   * @param inverse
-   * @param inverseOffset
-   * @return
-   */
-  public boolean gluInvertMatrixf(float[] src, int srcOffset, float[] inverse, int inverseOffset) {
-    int i, j, k, swap;
-    float t;
-    final float[][] temp = tempInvertMatrix;
-
-    for (i = 0; i < 4; i++) {
-      for (j = 0; j < 4; j++) {
-        temp[i][j] = src[i*4+j+srcOffset];
-      }
-    }
-    FloatUtil.makeIdentityf(inverse, inverseOffset);
-
-    for (i = 0; i < 4; i++) {
-      //
-      // Look for largest element in column
-      //
-      swap = i;
-      for (j = i + 1; j < 4; j++) {
-        if (Math.abs(temp[j][i]) > Math.abs(temp[i][i])) {
-          swap = j;
-        }
-      }
-
-      if (swap != i) {
-        //
-        // Swap rows.
-        //
-        for (k = 0; k < 4; k++) {
-          t = temp[i][k];
-          temp[i][k] = temp[swap][k];
-          temp[swap][k] = t;
-
-          t = inverse[i*4+k+inverseOffset];
-          inverse[i*4+k+inverseOffset] = inverse[swap*4+k+inverseOffset];
-          inverse[swap*4+k+inverseOffset] = t;
-        }
-      }
-
-      if (temp[i][i] == 0) {
-        //
-        // No non-zero pivot. The matrix is singular, which shouldn't
-        // happen. This means the user gave us a bad matrix.
-        //
-        return false;
-      }
-
-      t = temp[i][i];
-      for (k = 0; k < 4; k++) {
-        temp[i][k] /= t;
-        inverse[i*4+k+inverseOffset] /= t;
-      }
-      for (j = 0; j < 4; j++) {
-        if (j != i) {
-          t = temp[j][i];
-          for (k = 0; k < 4; k++) {
-            temp[j][k] -= temp[i][k] * t;
-            inverse[j*4+k+inverseOffset] -= inverse[i*4+k+inverseOffset]*t;
-          }
-        }
-      }
-    }
-    return true;
-  }
-
-  /**
-   * @param src
-   * @param inverse
-   *
-   * @return
-   */
-  public boolean gluInvertMatrixf(FloatBuffer src, FloatBuffer inverse) {
-    int i, j, k, swap;
-    float t;
-
-    final int srcPos = src.position();
-    final int invPos = inverse.position();
-
-    final float[][] temp = tempInvertMatrix;
-
-    for (i = 0; i < 4; i++) {
-      for (j = 0; j < 4; j++) {
-        temp[i][j] = src.get(i*4+j + srcPos);
-      }
-    }
-    FloatUtil.makeIdentityf(inverse);
-
-    for (i = 0; i < 4; i++) {
-      //
-      // Look for largest element in column
-      //
-      swap = i;
-      for (j = i + 1; j < 4; j++) {
-        if (Math.abs(temp[j][i]) > Math.abs(temp[i][i])) {
-          swap = j;
-        }
-      }
-
-      if (swap != i) {
-        //
-        // Swap rows.
-        //
-        for (k = 0; k < 4; k++) {
-          t = temp[i][k];
-          temp[i][k] = temp[swap][k];
-          temp[swap][k] = t;
-
-          t = inverse.get(i*4+k + invPos);
-          inverse.put(i*4+k + invPos, inverse.get(swap*4+k + invPos));
-          inverse.put(swap*4+k + invPos, t);
-        }
-      }
-
-      if (temp[i][i] == 0) {
-        //
-        // No non-zero pivot. The matrix is singular, which shouldn't
-        // happen. This means the user gave us a bad matrix.
-        //
-        return false;
-      }
-
-      t = temp[i][i];
-      for (k = 0; k < 4; k++) {
-        temp[i][k] /= t;
-        final int z = i*4+k + invPos;
-        inverse.put(z, inverse.get(z) / t);
-      }
-      for (j = 0; j < 4; j++) {
-        if (j != i) {
-          t = temp[j][i];
-          for (k = 0; k < 4; k++) {
-            temp[j][k] -= temp[i][k] * t;
-            final int z = j*4+k + invPos;
-            inverse.put(z, inverse.get(z) - inverse.get(i*4+k + invPos) * t);
-          }
-        }
-      }
-    }
-    return true;
-  }
-
-
-  /**
    * Method gluOrtho2D.
    *
    * @param left
@@ -341,41 +158,20 @@ public class ProjectFloat {
    * @param bottom
    * @param top
    */
-  public void gluOrtho2D(GLMatrixFunc gl, float left, float right, float bottom, float top) {
+  public void gluOrtho2D(final GLMatrixFunc gl, final float left, final float right, final float bottom, final float top) {
     gl.glOrthof(left, right, bottom, top, -1, 1);
   }
 
   /**
    * Method gluPerspective.
    *
-   * @param fovy
+   * @param fovy_deg fov angle in degrees
    * @param aspect
    * @param zNear
    * @param zFar
    */
-  public void gluPerspective(GLMatrixFunc gl, float fovy, float aspect, float zNear, float zFar) {
-    final float radians = fovy / 2 * (float) Math.PI / 180;
-    float sine, cotangent, deltaZ;
-
-    deltaZ = zFar - zNear;
-    sine = (float) Math.sin(radians);
-
-    if ((deltaZ == 0) || (sine == 0) || (aspect == 0)) {
-      return;
-    }
-
-    cotangent = (float) Math.cos(radians) / sine;
-
-    FloatUtil.makeIdentityf(matrixBuf);
-    final int mPos = matrixBuf.position();
-    matrixBuf.put(0 * 4 + 0 + mPos, cotangent / aspect);
-    matrixBuf.put(1 * 4 + 1 + mPos, cotangent);
-    matrixBuf.put(2 * 4 + 2 + mPos, - (zFar + zNear) / deltaZ);
-    matrixBuf.put(2 * 4 + 3 + mPos, -1);
-    matrixBuf.put(3 * 4 + 2 + mPos, -2 * zNear * zFar / deltaZ);
-    matrixBuf.put(3 * 4 + 3 + mPos, 0);
-
-    gl.glMultMatrixf(matrixBuf);
+  public void gluPerspective(final GLMatrixFunc gl, final float fovy_deg, final float aspect, final float zNear, final float zFar) {
+    gl.glMultMatrixf(FloatUtil.makePerspective(mat4Tmp1, 0, true, fovy_deg * FloatUtil.PI / 180.0f, aspect, zNear, zFar), 0);
   }
 
   /**
@@ -391,117 +187,70 @@ public class ProjectFloat {
    * @param upy
    * @param upz
    */
-  public void gluLookAt(GLMatrixFunc gl,
-                        float eyex, float eyey, float eyez,
-                        float centerx, float centery, float centerz,
-                        float upx, float upy, float upz) {
-    final float[] forward = this.forward;
-    final float[] side = this.side;
-    final float[] up = this.up;
-
-    forward[0] = centerx - eyex;
-    forward[1] = centery - eyey;
-    forward[2] = centerz - eyez;
-
-    up[0] = upx;
-    up[1] = upy;
-    up[2] = upz;
-
-    FloatUtil.normalize(forward);
-
-    /* Side = forward x up */
-    FloatUtil.cross(forward, up, side);
-    FloatUtil.normalize(side);
-
-    /* Recompute up as: up = side x forward */
-    FloatUtil.cross(side, forward, up);
-
-    FloatUtil.makeIdentityf(matrixBuf);
-    final int mPos = matrixBuf.position();
-    matrixBuf.put(0 * 4 + 0 + mPos, side[0]);
-    matrixBuf.put(1 * 4 + 0 + mPos, side[1]);
-    matrixBuf.put(2 * 4 + 0 + mPos, side[2]);
-
-    matrixBuf.put(0 * 4 + 1 + mPos, up[0]);
-    matrixBuf.put(1 * 4 + 1 + mPos, up[1]);
-    matrixBuf.put(2 * 4 + 1 + mPos, up[2]);
-
-    matrixBuf.put(0 * 4 + 2 + mPos, -forward[0]);
-    matrixBuf.put(1 * 4 + 2 + mPos, -forward[1]);
-    matrixBuf.put(2 * 4 + 2 + mPos, -forward[2]);
-
-    gl.glMultMatrixf(matrixBuf);
-    gl.glTranslatef(-eyex, -eyey, -eyez);
+  public void gluLookAt(final GLMatrixFunc gl,
+                        final float eyex, final float eyey, final float eyez,
+                        final float centerx, final float centery, final float centerz,
+                        final float upx, final float upy, final float upz) {
+    mat4Tmp2[0+0] = eyex;
+    mat4Tmp2[1+0] = eyey;
+    mat4Tmp2[2+0] = eyez;
+    mat4Tmp2[0+4] = centerx;
+    mat4Tmp2[1+4] = centery;
+    mat4Tmp2[2+4] = centerz;
+    mat4Tmp2[0+8] = upx;
+    mat4Tmp2[1+8] = upy;
+    mat4Tmp2[2+8] = upz;
+    gl.glMultMatrixf(
+            FloatUtil.makeLookAt(mat4Tmp1, 0, mat4Tmp2 /* eye */, 0, mat4Tmp2 /* center */, 4, mat4Tmp2 /* up */, 8, mat4Tmp3), 0);
   }
 
   /**
    * Map object coordinates to window coordinates.
+   * <p>
+   * Traditional <code>gluProject</code> implementation.
+   * </p>
    *
    * @param objx
    * @param objy
    * @param objz
-   * @param modelMatrix
-   * @param projMatrix
-   * @param viewport
-   * @param win_pos
-   *
-   * @return
+   * @param viewport 4 component viewport vector
+   * @param viewport_offset
+   * @param win_pos 3 component window coordinate, the result
+   * @param win_pos_offset
+   * @return true if successful, otherwise false (z is 1)
    */
-  public boolean gluProject(float objx, float objy, float objz,
-                            float[] modelMatrix, int modelMatrix_offset,
-                            float[] projMatrix, int projMatrix_offset,
-                            int[] viewport, int viewport_offset,
-                            float[] win_pos, int win_pos_offset ) {
-
-    final float[] in = this.in;
-    final float[] out = this.out;
-
-    in[0] = objx;
-    in[1] = objy;
-    in[2] = objz;
-    in[3] = 1.0f;
-
-    FloatUtil.multMatrixVecf(modelMatrix, modelMatrix_offset, in, 0, out, 0);
-    FloatUtil.multMatrixVecf(projMatrix, projMatrix_offset, out, 0, in, 0);
-
-    if (in[3] == 0.0f) {
-      return false;
-    }
-
-    in[3] = (1.0f / in[3]) * 0.5f;
-
-    // Map x, y and z to range 0-1
-    in[0] = in[0] * in[3] + 0.5f;
-    in[1] = in[1] * in[3] + 0.5f;
-    in[2] = in[2] * in[3] + 0.5f;
-
-    // Map x,y to viewport
-    win_pos[0+win_pos_offset] = in[0] * viewport[2+viewport_offset] + viewport[0+viewport_offset];
-    win_pos[1+win_pos_offset] = in[1] * viewport[3+viewport_offset] + viewport[1+viewport_offset];
-    win_pos[2+win_pos_offset] = in[2];
-
-    return true;
+  public boolean gluProject(final float objx, final float objy, final float objz,
+                            final float[] modelMatrix, final int modelMatrix_offset,
+                            final float[] projMatrix, final int projMatrix_offset,
+                            final int[] viewport, final int viewport_offset,
+                            final float[] win_pos, final int win_pos_offset ) {
+    return FloatUtil.mapObjToWinCoords(objx, objy, objz,
+                      modelMatrix, modelMatrix_offset,
+                      projMatrix, projMatrix_offset,
+                      viewport, viewport_offset,
+                      win_pos, win_pos_offset,
+                      mat4Tmp1, mat4Tmp2);
   }
 
   /**
    * Map object coordinates to window coordinates.
    */
-  public boolean gluProject(float objx, float objy, float objz,
-                            FloatBuffer modelMatrix,
-                            FloatBuffer projMatrix,
-                            int[] viewport, int viewport_offset,
-                            float[] win_pos, int win_pos_offset ) {
-
-    final float[] in = this.in;
-    final float[] out = this.out;
+  @SuppressWarnings("deprecation")
+  public boolean gluProject(final float objx, final float objy, final float objz,
+                            final FloatBuffer modelMatrix,
+                            final FloatBuffer projMatrix,
+                            final int[] viewport, final int viewport_offset,
+                            final float[] win_pos, final int win_pos_offset ) {
+    final float[] in = this.mat4Tmp1;
+    final float[] out = this.mat4Tmp2;
 
     in[0] = objx;
     in[1] = objy;
     in[2] = objz;
     in[3] = 1.0f;
 
-    FloatUtil.multMatrixVecf(modelMatrix, in, out);
-    FloatUtil.multMatrixVecf(projMatrix, out, in);
+    FloatUtil.multMatrixVec(modelMatrix, in, out);
+    FloatUtil.multMatrixVec(projMatrix, out, in);
 
     if (in[3] == 0.0f) {
       return false;
@@ -535,22 +284,23 @@ public class ProjectFloat {
    *
    * @return
    */
-  public boolean gluProject(float objx, float objy, float objz,
-                            FloatBuffer modelMatrix,
-                            FloatBuffer projMatrix,
-                            IntBuffer viewport,
-                            FloatBuffer win_pos) {
+  @SuppressWarnings("deprecation")
+  public boolean gluProject(final float objx, final float objy, final float objz,
+                            final FloatBuffer modelMatrix,
+                            final FloatBuffer projMatrix,
+                            final IntBuffer viewport,
+                            final FloatBuffer win_pos) {
 
-    final float[] in = this.in;
-    final float[] out = this.out;
+    final float[] in = this.mat4Tmp1;
+    final float[] out = this.mat4Tmp2;
 
     in[0] = objx;
     in[1] = objy;
     in[2] = objz;
     in[3] = 1.0f;
 
-    FloatUtil.multMatrixVecf(modelMatrix, in, out);
-    FloatUtil.multMatrixVecf(projMatrix, out, in);
+    FloatUtil.multMatrixVec(modelMatrix, in, out);
+    FloatUtil.multMatrixVec(projMatrix, out, in);
 
     if (in[3] == 0.0f) {
       return false;
@@ -576,58 +326,30 @@ public class ProjectFloat {
 
   /**
    * Map window coordinates to object coordinates.
+   * <p>
+   * Traditional <code>gluUnProject</code> implementation.
+   * </p>
    *
    * @param winx
    * @param winy
    * @param winz
-   * @param modelMatrix
-   * @param projMatrix
-   * @param viewport
-   * @param obj_pos
-   *
-   * @return
+   * @param viewport 4 component viewport vector
+   * @param viewport_offset
+   * @param obj_pos 3 component object coordinate, the result
+   * @param obj_pos_offset
+   * @return true if successful, otherwise false (failed to invert matrix, or becomes infinity due to zero z)
    */
-  public boolean gluUnProject(float winx, float winy, float winz,
-                              float[] modelMatrix, int modelMatrix_offset,
-                              float[] projMatrix, int projMatrix_offset,
-                              int[] viewport, int viewport_offset,
-                              float[] obj_pos, int obj_pos_offset) {
-    final float[] in = this.in;
-    final float[] out = this.out;
-
-    FloatUtil.multMatrixf(projMatrix, projMatrix_offset, modelMatrix, modelMatrix_offset, matrix, 0);
-
-    if (!gluInvertMatrixf(matrix, 0, matrix, 0)) {
-      return false;
-    }
-
-    in[0] = winx;
-    in[1] = winy;
-    in[2] = winz;
-    in[3] = 1.0f;
-
-    // Map x and y from window coordinates
-    in[0] = (in[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
-    in[1] = (in[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
-
-    // Map to range -1 to 1
-    in[0] = in[0] * 2 - 1;
-    in[1] = in[1] * 2 - 1;
-    in[2] = in[2] * 2 - 1;
-
-    FloatUtil.multMatrixVecf(matrix, in, out);
-
-    if (out[3] == 0.0) {
-      return false;
-    }
-
-    out[3] = 1.0f / out[3];
-
-    obj_pos[0+obj_pos_offset] = out[0] * out[3];
-    obj_pos[1+obj_pos_offset] = out[1] * out[3];
-    obj_pos[2+obj_pos_offset] = out[2] * out[3];
-
-    return true;
+  public boolean gluUnProject(final float winx, final float winy, final float winz,
+                              final float[] modelMatrix, final int modelMatrix_offset,
+                              final float[] projMatrix, final int projMatrix_offset,
+                              final int[] viewport, final int viewport_offset,
+                              final float[] obj_pos, final int obj_pos_offset) {
+    return FloatUtil.mapWinToObjCoords(winx, winy, winz,
+                                   modelMatrix, modelMatrix_offset,
+                                   projMatrix, projMatrix_offset,
+                                   viewport, viewport_offset,
+                                   obj_pos, obj_pos_offset,
+                                   mat4Tmp1, mat4Tmp2);
   }
 
 
@@ -643,47 +365,49 @@ public class ProjectFloat {
    * @param viewport_offset
    * @param obj_pos
    * @param obj_pos_offset
-   * @return
+   * @return true if successful, otherwise false (failed to invert matrix, or becomes z is infinity)
    */
-  public boolean gluUnProject(float winx, float winy, float winz,
-                              FloatBuffer modelMatrix,
-                              FloatBuffer projMatrix,
-                              int[] viewport, int viewport_offset,
-                              float[] obj_pos, int obj_pos_offset) {
-    final float[] in = this.in;
-    final float[] out = this.out;
-
-    FloatUtil.multMatrixf(projMatrix, modelMatrix, matrixBuf);
-
-    if (!gluInvertMatrixf(matrixBuf, matrixBuf)) {
+  @SuppressWarnings("deprecation")
+  public boolean gluUnProject(final float winx, final float winy, final float winz,
+                              final FloatBuffer modelMatrix,
+                              final FloatBuffer projMatrix,
+                              final int[] viewport, final int viewport_offset,
+                              final float[] obj_pos, final int obj_pos_offset) {
+    // mat4Tmp1 = P x M
+    FloatUtil.multMatrix(projMatrix, modelMatrix, mat4Tmp1);
+
+    // mat4Tmp1 = Inv(P x M)
+    if ( null == FloatUtil.invertMatrix(mat4Tmp1, mat4Tmp1) ) {
       return false;
     }
 
-    in[0] = winx;
-    in[1] = winy;
-    in[2] = winz;
-    in[3] = 1.0f;
+    mat4Tmp2[0] = winx;
+    mat4Tmp2[1] = winy;
+    mat4Tmp2[2] = winz;
+    mat4Tmp2[3] = 1.0f;
 
     // Map x and y from window coordinates
-    in[0] = (in[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
-    in[1] = (in[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
+    mat4Tmp2[0] = (mat4Tmp2[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
+    mat4Tmp2[1] = (mat4Tmp2[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
 
     // Map to range -1 to 1
-    in[0] = in[0] * 2 - 1;
-    in[1] = in[1] * 2 - 1;
-    in[2] = in[2] * 2 - 1;
+    mat4Tmp2[0] = mat4Tmp2[0] * 2 - 1;
+    mat4Tmp2[1] = mat4Tmp2[1] * 2 - 1;
+    mat4Tmp2[2] = mat4Tmp2[2] * 2 - 1;
 
-    FloatUtil.multMatrixVecf(matrixBuf, in, out);
+    final int raw_off = 4;
+    // object raw coords = Inv(P x M) *  winPos  -> mat4Tmp2
+    FloatUtil.multMatrixVec(mat4Tmp1, 0, mat4Tmp2, 0, mat4Tmp2, raw_off);
 
-    if (out[3] == 0.0) {
+    if (mat4Tmp2[3+raw_off] == 0.0) {
       return false;
     }
 
-    out[3] = 1.0f / out[3];
+    mat4Tmp2[3+raw_off] = 1.0f / mat4Tmp2[3+raw_off];
 
-    obj_pos[0+obj_pos_offset] = out[0] * out[3];
-    obj_pos[1+obj_pos_offset] = out[1] * out[3];
-    obj_pos[2+obj_pos_offset] = out[2] * out[3];
+    obj_pos[0+obj_pos_offset] = mat4Tmp2[0+raw_off] * mat4Tmp2[3+raw_off];
+    obj_pos[1+obj_pos_offset] = mat4Tmp2[1+raw_off] * mat4Tmp2[3+raw_off];
+    obj_pos[2+obj_pos_offset] = mat4Tmp2[2+raw_off] * mat4Tmp2[3+raw_off];
 
     return true;
   }
@@ -699,49 +423,52 @@ public class ProjectFloat {
    * @param viewport
    * @param obj_pos
    *
-   * @return
+   * @return true if successful, otherwise false (failed to invert matrix, or becomes z is infinity)
    */
-  public boolean gluUnProject(float winx, float winy, float winz,
-                              FloatBuffer modelMatrix,
-                              FloatBuffer projMatrix,
-                              IntBuffer viewport,
-                              FloatBuffer obj_pos) {
-    final float[] in = this.in;
-    final float[] out = this.out;
+  @SuppressWarnings("deprecation")
+  public boolean gluUnProject(final float winx, final float winy, final float winz,
+                              final FloatBuffer modelMatrix,
+                              final FloatBuffer projMatrix,
+                              final IntBuffer viewport,
+                              final FloatBuffer obj_pos) {
+    final int vPos = viewport.position();
+    final int oPos = obj_pos.position();
 
-    FloatUtil.multMatrixf(projMatrix, modelMatrix, matrixBuf);
+    // mat4Tmp1 = P x M
+    FloatUtil.multMatrix(projMatrix, modelMatrix, mat4Tmp1);
 
-    if (!gluInvertMatrixf(matrixBuf, matrixBuf)) {
+    // mat4Tmp1 = Inv(P x M)
+    if ( null == FloatUtil.invertMatrix(mat4Tmp1, mat4Tmp1) ) {
       return false;
     }
 
-    in[0] = winx;
-    in[1] = winy;
-    in[2] = winz;
-    in[3] = 1.0f;
+    mat4Tmp2[0] = winx;
+    mat4Tmp2[1] = winy;
+    mat4Tmp2[2] = winz;
+    mat4Tmp2[3] = 1.0f;
 
     // Map x and y from window coordinates
-    final int vPos = viewport.position();
-    final int oPos = obj_pos.position();
-    in[0] = (in[0] - viewport.get(0+vPos)) / viewport.get(2+vPos);
-    in[1] = (in[1] - viewport.get(1+vPos)) / viewport.get(3+vPos);
+    mat4Tmp2[0] = (mat4Tmp2[0] - viewport.get(0+vPos)) / viewport.get(2+vPos);
+    mat4Tmp2[1] = (mat4Tmp2[1] - viewport.get(1+vPos)) / viewport.get(3+vPos);
 
     // Map to range -1 to 1
-    in[0] = in[0] * 2 - 1;
-    in[1] = in[1] * 2 - 1;
-    in[2] = in[2] * 2 - 1;
+    mat4Tmp2[0] = mat4Tmp2[0] * 2 - 1;
+    mat4Tmp2[1] = mat4Tmp2[1] * 2 - 1;
+    mat4Tmp2[2] = mat4Tmp2[2] * 2 - 1;
 
-    FloatUtil.multMatrixVecf(matrixBuf, in, out);
+    final int raw_off = 4;
+    // object raw coords = Inv(P x M) *  winPos  -> mat4Tmp2
+    FloatUtil.multMatrixVec(mat4Tmp1, 0, mat4Tmp2, 0, mat4Tmp2, raw_off);
 
-    if (out[3] == 0.0) {
+    if (mat4Tmp2[3+raw_off] == 0.0) {
       return false;
     }
 
-    out[3] = 1.0f / out[3];
+    mat4Tmp2[3+raw_off] = 1.0f / mat4Tmp2[3+raw_off];
 
-    obj_pos.put(0+oPos, out[0] * out[3]);
-    obj_pos.put(1+oPos, out[1] * out[3]);
-    obj_pos.put(2+oPos, out[2] * out[3]);
+    obj_pos.put(0+oPos, mat4Tmp2[0+raw_off] * mat4Tmp2[3+raw_off]);
+    obj_pos.put(1+oPos, mat4Tmp2[1+raw_off] * mat4Tmp2[3+raw_off]);
+    obj_pos.put(2+oPos, mat4Tmp2[2+raw_off] * mat4Tmp2[3+raw_off]);
 
     return true;
   }
@@ -749,68 +476,39 @@ public class ProjectFloat {
 
   /**
    * Map window coordinates to object coordinates.
+   * <p>
+   * Traditional <code>gluUnProject4</code> implementation.
+   * </p>
    *
    * @param winx
    * @param winy
    * @param winz
    * @param clipw
-   * @param modelMatrix
-   * @param projMatrix
-   * @param viewport
+   * @param modelMatrix 4x4 modelview matrix
+   * @param modelMatrix_offset
+   * @param projMatrix 4x4 projection matrix
+   * @param projMatrix_offset
+   * @param viewport 4 component viewport vector
+   * @param viewport_offset
    * @param near
    * @param far
-   * @param obj_pos
-   *
-   * @return
+   * @param obj_pos 4 component object coordinate, the result
+   * @param obj_pos_offset
+   * @return true if successful, otherwise false (failed to invert matrix, or becomes infinity due to zero z)
    */
-  public boolean gluUnProject4(float winx,
-                               float winy,
-                               float winz,
-                               float clipw,
-                               float[] modelMatrix,
-                               int modelMatrix_offset,
-                               float[] projMatrix,
-                               int projMatrix_offset,
-                               int[] viewport,
-                               int viewport_offset,
-                               float near,
-                               float far,
-                               float[] obj_pos,
-                               int obj_pos_offset ) {
-    final float[] in = this.in;
-    final float[] out = this.out;
-
-    FloatUtil.multMatrixf(projMatrix, projMatrix_offset, modelMatrix, modelMatrix_offset, matrix, 0);
-
-    if (!gluInvertMatrixf(matrix, 0, matrix, 0))
-      return false;
-
-    in[0] = winx;
-    in[1] = winy;
-    in[2] = winz;
-    in[3] = clipw;
-
-    // Map x and y from window coordinates
-    in[0] = (in[0] - viewport[0+viewport_offset]) / viewport[2+viewport_offset];
-    in[1] = (in[1] - viewport[1+viewport_offset]) / viewport[3+viewport_offset];
-    in[2] = (in[2] - near) / (far - near);
-
-    // Map to range -1 to 1
-    in[0] = in[0] * 2 - 1;
-    in[1] = in[1] * 2 - 1;
-    in[2] = in[2] * 2 - 1;
-
-    FloatUtil.multMatrixVecf(matrix, in, out);
-
-    if (out[3] == 0.0f) {
-      return false;
-    }
-
-    obj_pos[0+obj_pos_offset] = out[0];
-    obj_pos[1+obj_pos_offset] = out[1];
-    obj_pos[2+obj_pos_offset] = out[2];
-    obj_pos[3+obj_pos_offset] = out[3];
-    return true;
+   public boolean gluUnProject4(final float winx, final float winy, final float winz, final float clipw,
+                                final float[] modelMatrix, final int modelMatrix_offset,
+                                final float[] projMatrix, final int projMatrix_offset,
+                                final int[] viewport, final int viewport_offset,
+                                final float near, final float far,
+                                final float[] obj_pos, final int obj_pos_offset ) {
+    return FloatUtil.mapWinToObjCoords(winx, winy, winz, clipw,
+                                       modelMatrix, modelMatrix_offset,
+                                       projMatrix, projMatrix_offset,
+                                       viewport, viewport_offset,
+                                       near, far,
+                                       obj_pos, obj_pos_offset,
+                                       mat4Tmp1, mat4Tmp2);
   }
 
   /**
@@ -827,72 +525,68 @@ public class ProjectFloat {
    * @param far
    * @param obj_pos
    *
-   * @return
+   * @return true if successful, otherwise false (failed to invert matrix, or becomes z is infinity)
    */
-  public boolean gluUnProject4(float winx,
-                               float winy,
-                               float winz,
-                               float clipw,
-                               FloatBuffer modelMatrix,
-                               FloatBuffer projMatrix,
-                               IntBuffer viewport,
-                               float near,
-                               float far,
-                               FloatBuffer obj_pos) {
-    final float[] in = this.in;
-    final float[] out = this.out;
-
-    FloatUtil.multMatrixf(projMatrix, modelMatrix, matrixBuf);
-
-    if (!gluInvertMatrixf(matrixBuf, matrixBuf))
+  @SuppressWarnings("deprecation")
+  public boolean gluUnProject4(final float winx, final float winy, final float winz, final float clipw,
+                               final FloatBuffer modelMatrix, final FloatBuffer projMatrix,
+                               final IntBuffer viewport,
+                               final float near, final float far,
+                               final FloatBuffer obj_pos) {
+    FloatUtil.multMatrix(projMatrix, modelMatrix, mat4Tmp1);
+
+    if ( null == FloatUtil.invertMatrix(mat4Tmp1, mat4Tmp1) ) {
       return false;
+    }
 
-    in[0] = winx;
-    in[1] = winy;
-    in[2] = winz;
-    in[3] = clipw;
+    mat4Tmp2[0] = winx;
+    mat4Tmp2[1] = winy;
+    mat4Tmp2[2] = winz;
+    mat4Tmp2[3] = clipw;
 
     // Map x and y from window coordinates
     final int vPos = viewport.position();
-    in[0] = (in[0] - viewport.get(0+vPos)) / viewport.get(2+vPos);
-    in[1] = (in[1] - viewport.get(1+vPos)) / viewport.get(3+vPos);
-    in[2] = (in[2] - near) / (far - near);
+    mat4Tmp2[0] = (mat4Tmp2[0] - viewport.get(0+vPos)) / viewport.get(2+vPos);
+    mat4Tmp2[1] = (mat4Tmp2[1] - viewport.get(1+vPos)) / viewport.get(3+vPos);
+    mat4Tmp2[2] = (mat4Tmp2[2] - near) / (far - near);
 
     // Map to range -1 to 1
-    in[0] = in[0] * 2 - 1;
-    in[1] = in[1] * 2 - 1;
-    in[2] = in[2] * 2 - 1;
+    mat4Tmp2[0] = mat4Tmp2[0] * 2 - 1;
+    mat4Tmp2[1] = mat4Tmp2[1] * 2 - 1;
+    mat4Tmp2[2] = mat4Tmp2[2] * 2 - 1;
 
-    FloatUtil.multMatrixVecf(matrixBuf, in, out);
+    final int raw_off = 4;
+    FloatUtil.multMatrixVec(mat4Tmp1, 0, mat4Tmp2, 0, mat4Tmp2, raw_off);
 
-    if (out[3] == 0.0f) {
+    if (mat4Tmp2[3+raw_off] == 0.0f) {
       return false;
     }
 
     final int oPos = obj_pos.position();
-    obj_pos.put(0+oPos, out[0]);
-    obj_pos.put(1+oPos, out[1]);
-    obj_pos.put(2+oPos, out[2]);
-    obj_pos.put(3+oPos, out[3]);
+    obj_pos.put(0+oPos, mat4Tmp2[0+raw_off]);
+    obj_pos.put(1+oPos, mat4Tmp2[1+raw_off]);
+    obj_pos.put(2+oPos, mat4Tmp2[2+raw_off]);
+    obj_pos.put(3+oPos, mat4Tmp2[3+raw_off]);
     return true;
   }
 
 
   /**
-   * Method gluPickMatrix
-   *
+   * Make given matrix the <i>pick</i> matrix based on given parameters.
+   * <p>
+   * Traditional <code>gluPickMatrix</code> implementation.
+   * </p>
    * @param x
    * @param y
    * @param deltaX
    * @param deltaY
-   * @param viewport
+   * @param viewport 4 component viewport vector
+   * @param viewport_offset
    */
-  public void gluPickMatrix(GLMatrixFunc gl,
-                            float x,
-                            float y,
-                            float deltaX,
-                            float deltaY,
-                            IntBuffer viewport) {
+  public void gluPickMatrix(final GLMatrixFunc gl,
+                            final float x, final float y,
+                            final float deltaX, final float deltaY,
+                            final IntBuffer viewport) {
     if (deltaX <= 0 || deltaY <= 0) {
       return;
     }
@@ -906,31 +600,24 @@ public class ProjectFloat {
   }
 
   /**
-   * Method gluPickMatrix
-   *
+   * Make given matrix the <i>pick</i> matrix based on given parameters.
+   * <p>
+   * Traditional <code>gluPickMatrix</code> implementation.
+   * </p>
    * @param x
    * @param y
    * @param deltaX
    * @param deltaY
-   * @param viewport
+   * @param viewport 4 component viewport vector
    * @param viewport_offset
    */
-  public void gluPickMatrix(GLMatrixFunc gl,
-                            float x,
-                            float y,
-                            float deltaX,
-                            float deltaY,
-                            int[] viewport,
-                            int viewport_offset) {
-    if (deltaX <= 0 || deltaY <= 0) {
-      return;
+  public void gluPickMatrix(final GLMatrixFunc gl,
+                            final float x, final float y,
+                            final float deltaX, final float deltaY,
+                            final int[] viewport, final int viewport_offset) {
+    if( null != FloatUtil.makePick(mat4Tmp1, 0, x, y, deltaX, deltaY, viewport, viewport_offset, mat4Tmp2) ) {
+        gl.glMultMatrixf(mat4Tmp1, 0);
     }
-
-    /* Translate and scale the picked region to the entire window */
-    gl.glTranslatef((viewport[2+viewport_offset] - 2 * (x - viewport[0+viewport_offset])) / deltaX,
-                    (viewport[3+viewport_offset] - 2 * (y - viewport[1+viewport_offset])) / deltaY,
-                    0);
-    gl.glScalef(viewport[2+viewport_offset] / deltaX, viewport[3+viewport_offset] / deltaY, 1.0f);
   }
 
 }
diff --git a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
index 283ecdb..93a4eb3 100644
--- a/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
+++ b/src/jogl/classes/jogamp/opengl/SharedResourceRunner.java
@@ -89,17 +89,17 @@ public class SharedResourceRunner implements Runnable {
     String initConnection;
     String releaseConnection;
 
-    private boolean getDeviceTried(String connection) { // synchronized call
+    private boolean getDeviceTried(final String connection) { // synchronized call
         return devicesTried.contains(connection);
     }
-    private void addDeviceTried(String connection) { // synchronized call
+    private void addDeviceTried(final String connection) { // synchronized call
         devicesTried.add(connection);
     }
-    private void removeDeviceTried(String connection) { // synchronized call
+    private void removeDeviceTried(final String connection) { // synchronized call
         devicesTried.remove(connection);
     }
 
-    public SharedResourceRunner(Implementation impl) {
+    public SharedResourceRunner(final Implementation impl) {
         this.impl = impl;
         resetState();
     }
@@ -144,7 +144,7 @@ public class SharedResourceRunner implements Runnable {
                 while (!running) {
                     try {
                         this.wait();
-                    } catch (InterruptedException ex) { }
+                    } catch (final InterruptedException ex) { }
                 }
             }
         }
@@ -164,14 +164,14 @@ public class SharedResourceRunner implements Runnable {
                     while (running) {
                         try {
                             this.wait();
-                        } catch (InterruptedException ex) { }
+                        } catch (final InterruptedException ex) { }
                     }
                 }
             }
         }
     }
 
-    public SharedResourceRunner.Resource getOrCreateShared(AbstractGraphicsDevice device) {
+    public SharedResourceRunner.Resource getOrCreateShared(final AbstractGraphicsDevice device) {
         SharedResourceRunner.Resource sr = null;
         if(null != device) {
             synchronized (this) {
@@ -198,7 +198,7 @@ public class SharedResourceRunner implements Runnable {
         return sr;
     }
 
-    public SharedResourceRunner.Resource releaseShared(AbstractGraphicsDevice device) {
+    public SharedResourceRunner.Resource releaseShared(final AbstractGraphicsDevice device) {
         SharedResourceRunner.Resource sr = null;
         if(null != device) {
             synchronized (this) {
@@ -219,7 +219,7 @@ public class SharedResourceRunner implements Runnable {
         return sr;
     }
 
-    private final void doAndWait(String initConnection, String releaseConnection) {
+    private final void doAndWait(final String initConnection, final String releaseConnection) {
         synchronized (this) {
             // wait until thread becomes ready to init new device,
             // pass the device and release the sync
@@ -230,7 +230,7 @@ public class SharedResourceRunner implements Runnable {
             while (!ready && running) {
                 try {
                     this.wait();
-                } catch (InterruptedException ex) { }
+                } catch (final InterruptedException ex) { }
             }
             if (DEBUG) {
                 System.err.println("SharedResourceRunner.doAndWait() set command: " + initConnection + ", release: "+releaseConnection+" - "+threadName);
@@ -243,7 +243,7 @@ public class SharedResourceRunner implements Runnable {
             while ( running && ( !ready || null != this.initConnection || null != this.releaseConnection ) ) {
                 try {
                     this.wait();
-                } catch (InterruptedException ex) { }
+                } catch (final InterruptedException ex) { }
             }
             if (DEBUG) {
                 System.err.println("SharedResourceRunner.initializeAndWait END init: " + initConnection + ", release: "+releaseConnection+" - "+threadName);
@@ -272,7 +272,7 @@ public class SharedResourceRunner implements Runnable {
                     }
                     notifyAll();
                     this.wait();
-                } catch (InterruptedException ex) {
+                } catch (final InterruptedException ex) {
                     shouldRelease = true;
                     if(DEBUG) {
                         System.err.println("SharedResourceRunner.run(): INTERRUPTED - "+threadName);
@@ -293,7 +293,7 @@ public class SharedResourceRunner implements Runnable {
                         Resource sr = null;
                         try {
                             sr = impl.createSharedResource(initConnection);
-                        } catch (Exception e) {
+                        } catch (final Exception e) {
                             e.printStackTrace();
                         }
                         if (null != sr) {
@@ -304,12 +304,12 @@ public class SharedResourceRunner implements Runnable {
                         if (DEBUG) {
                             System.err.println("SharedResourceRunner.run(): release Shared for: " + releaseConnection + " - " + threadName);
                         }
-                        Resource sr = impl.mapGet(releaseConnection);
+                        final Resource sr = impl.mapGet(releaseConnection);
                         if (null != sr) {
                             try {
                                 impl.releaseSharedResource(sr);
                                 impl.mapPut(releaseConnection, null);
-                            } catch (Exception e) {
+                            } catch (final Exception e) {
                                 e.printStackTrace();
                             }
                         }
@@ -338,12 +338,12 @@ public class SharedResourceRunner implements Runnable {
 
     private void releaseSharedResources() { // synchronized call
         devicesTried.clear();
-        Collection<Resource> sharedResources = impl.mapValues();
-        for (Iterator<Resource> iter = sharedResources.iterator(); iter.hasNext();) {
+        final Collection<Resource> sharedResources = impl.mapValues();
+        for (final Iterator<Resource> iter = sharedResources.iterator(); iter.hasNext();) {
             try {
                 impl.releaseSharedResource(iter.next());
-            } catch (Throwable t) {
-                System.err.println("Catched Exception on thread "+getThreadName());
+            } catch (final Throwable t) {
+                System.err.println("Caught exception on thread "+getThreadName());
                 t.printStackTrace();
             }
         }
diff --git a/src/jogl/classes/jogamp/opengl/SystemUtil.java b/src/jogl/classes/jogamp/opengl/SystemUtil.java
index befe1a3..e7f0780 100644
--- a/src/jogl/classes/jogamp/opengl/SystemUtil.java
+++ b/src/jogl/classes/jogamp/opengl/SystemUtil.java
@@ -5,11 +5,11 @@ public class SystemUtil {
     private static volatile boolean getenvSupported = true;
     /** Wrapper for System.getenv(), which doesn't work on platforms
         earlier than JDK 5 */
-    public static String getenv(String variableName) {
+    public static String getenv(final String variableName) {
         if (getenvSupported) {
             try {
                 return System.getenv(variableName);
-            } catch (Error e) {
+            } catch (final Error e) {
                 getenvSupported = false;
             }
         }
diff --git a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
index bf700d9..7b405e5 100644
--- a/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
+++ b/src/jogl/classes/jogamp/opengl/ThreadingImpl.java
@@ -41,23 +41,15 @@ import java.security.PrivilegedAction;
 import javax.media.nativewindow.NativeWindowFactory;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLProfile;
+import javax.media.opengl.Threading.Mode;
 
 import com.jogamp.common.JogampRuntimeException;
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.common.util.ReflectionUtil;
 
 /** Implementation of the {@link javax.media.opengl.Threading} class. */
 
 public class ThreadingImpl {
-    public enum Mode {
-        MT(0), ST_AWT(1), ST_WORKER(2);
-
-        public final int id;
-
-        Mode(int id){
-            this.id = id;
-        }
-    }
-
     protected static final boolean DEBUG = Debug.debug("Threading");
 
     private static boolean singleThreaded;
@@ -76,10 +68,10 @@ public class ThreadingImpl {
                     public ToolkitThreadingPlugin run() {
                         final String singleThreadProp;
                         {
-                            final String w = Debug.getProperty("jogl.1thread", true);
+                            final String w = PropertyAccess.getProperty("jogl.1thread", true);
                             singleThreadProp = null != w ? w.toLowerCase() : null;
                         }
-                        ClassLoader cl = ThreadingImpl.class.getClassLoader();
+                        final ClassLoader cl = ThreadingImpl.class.getClassLoader();
                         // Default to using the AWT thread on all platforms except
                         // Windows. On OS X there is instability apparently due to
                         // using the JAWT on non-AWT threads. On X11 platforms there
@@ -92,28 +84,23 @@ public class ThreadingImpl {
 
                         _isX11 = NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(false);
 
-                        // default setting
-                        singleThreaded = true;
-                        mode  = ( hasAWT ? Mode.ST_AWT : Mode.ST_WORKER );
-
                         if (singleThreadProp != null) {
                             if (singleThreadProp.equals("true") ||
                                 singleThreadProp.equals("auto")) {
-                                singleThreaded = true;
-                                mode  = ( hasAWT ? Mode.ST_AWT : Mode.ST_WORKER );
+                                mode  = ( hasAWT ? Mode.ST_AWT : Mode.MT );
                             } else if (singleThreadProp.equals("worker")) {
-                                singleThreaded = true;
                                 mode = Mode.ST_WORKER;
                             } else if (hasAWT && singleThreadProp.equals("awt")) {
-                                singleThreaded = true;
                                 mode = Mode.ST_AWT;
                             } else if (singleThreadProp.equals("false")) {
-                                singleThreaded = false;
                                 mode = Mode.MT;
                             } else {
                                 throw new RuntimeException("Unsupported value for property jogl.1thread: "+singleThreadProp+", should be [true/auto, worker, awt or false]");
                             }
+                        } else {
+                            mode  = ( hasAWT ? Mode.ST_AWT : Mode.MT );
                         }
+                        singleThreaded = Mode.MT != mode;
 
                         ToolkitThreadingPlugin threadingPlugin=null;
                         if(hasAWT) {
@@ -121,7 +108,7 @@ public class ThreadingImpl {
                             Exception error=null;
                             try {
                                 threadingPlugin = (ToolkitThreadingPlugin) ReflectionUtil.createInstance("jogamp.opengl.awt.AWTThreadingPlugin", cl);
-                            } catch (JogampRuntimeException jre) { error = jre; }
+                            } catch (final JogampRuntimeException jre) { error = jre; }
                             if( Mode.ST_AWT == mode && null==threadingPlugin ) {
                                 throw new GLException("Mode is AWT, but class 'jogamp.opengl.awt.AWTThreadingPlugin' is not available", error);
                             }
@@ -154,9 +141,11 @@ public class ThreadingImpl {
         method. This method should be called as early as possible in an
         application. */
     public static final void disableSingleThreading() {
-        singleThreaded = false;
-        if (Debug.verbose()) {
-            System.err.println("Application forced disabling of single-threading of javax.media.opengl implementation");
+        if( Mode.MT != mode ) {
+            singleThreaded = false;
+            if (Debug.verbose()) {
+                System.err.println("Application forced disabling of single-threading of javax.media.opengl implementation");
+            }
         }
     }
 
@@ -166,22 +155,28 @@ public class ThreadingImpl {
         return singleThreaded;
     }
 
-    /** Indicates whether the current thread is the single thread on
-        which this implementation of the javax.media.opengl APIs
-        performs all of its OpenGL-related work. This method should only
-        be called if the single-thread model is in effect. */
+    /**
+     * Indicates whether the current thread is capable of
+     * performing OpenGL-related work.
+     * <p>
+     * Method always returns <code>true</code>
+     * if {@link #getMode()} == {@link Mode#MT} or {@link #isSingleThreaded()} == <code>false</code>.
+     * </p>
+     */
     public static final boolean isOpenGLThread() throws GLException {
-        if(null!=threadingPlugin) {
+        if( Mode.MT == mode || !singleThreaded ) {
+            return true;
+        } else if( null != threadingPlugin ) {
             return threadingPlugin.isOpenGLThread();
-        }
-
-        switch (mode) {
-            case ST_AWT:
-                throw new InternalError();
-            case ST_WORKER:
-                return GLWorkerThread.isWorkerThread();
-            default:
-                throw new InternalError("Illegal single-threading mode " + mode);
+        } else {
+            switch (mode) {
+                case ST_AWT:
+                    throw new InternalError();
+                case ST_WORKER:
+                    return GLWorkerThread.isWorkerThread();
+                default:
+                    throw new InternalError("Illegal single-threading mode " + mode);
+            }
         }
     }
 
@@ -201,7 +196,7 @@ public class ThreadingImpl {
         false). It is up to the end user to check to see whether the
         current thread is the OpenGL thread and either execute the
         Runnable directly or perform the work inside it. */
-    public static final void invokeOnOpenGLThread(boolean wait, Runnable r) throws GLException {
+    public static final void invokeOnOpenGLThread(final boolean wait, final Runnable r) throws GLException {
         if(null!=threadingPlugin) {
             threadingPlugin.invokeOnOpenGLThread(wait, r);
             return;
@@ -212,18 +207,22 @@ public class ThreadingImpl {
                 invokeOnWorkerThread(wait, r);
                 break;
 
+            case MT:
+                r.run();
+                break;
+
             default:
                 throw new InternalError("Illegal single-threading mode " + mode);
         }
     }
 
-    public static final void invokeOnWorkerThread(boolean wait, Runnable r) throws GLException {
+    public static final void invokeOnWorkerThread(final boolean wait, final Runnable r) throws GLException {
         GLWorkerThread.start(); // singleton start via volatile-dbl-checked-locking
         try {
             GLWorkerThread.invoke(wait, r);
-        } catch (InvocationTargetException e) {
+        } catch (final InvocationTargetException e) {
             throw new GLException(e.getTargetException());
-        } catch (InterruptedException e) {
+        } catch (final InterruptedException e) {
             throw new GLException(e);
         }
     }
diff --git a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
index 25a0bc1..24b89cd 100644
--- a/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
+++ b/src/jogl/classes/jogamp/opengl/android/av/AndroidGLMediaPlayerAPI14.java
@@ -41,9 +41,9 @@ import com.jogamp.opengl.util.av.GLMediaPlayer;
 import com.jogamp.opengl.util.texture.Texture;
 import com.jogamp.opengl.util.texture.TextureSequence;
 
+import jogamp.common.os.PlatformPropsImpl;
 import jogamp.common.os.android.StaticContext;
 import jogamp.opengl.util.av.GLMediaPlayerImpl;
-
 import android.graphics.SurfaceTexture;
 import android.graphics.SurfaceTexture.OnFrameAvailableListener;
 import android.hardware.Camera;
@@ -81,7 +81,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
 
     static {
         boolean _avail = false;
-        if(Platform.OS_TYPE.equals(Platform.OSType.ANDROID)) {
+        if(PlatformPropsImpl.OS_TYPE.equals(Platform.OSType.ANDROID)) {
             if(AndroidVersion.SDK_INT >= 14) {
                 _avail = true;
             }
@@ -116,18 +116,18 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected final boolean setPlaySpeedImpl(float rate) {
+    protected final boolean setPlaySpeedImpl(final float rate) {
         // FIXME
         return false;
     }
 
     @Override
-    protected final boolean setAudioVolumeImpl(float v) {
+    protected final boolean setAudioVolumeImpl(final float v) {
         if(null != mp) {
             try {
                 mp.setVolume(v, v);
                 return true;
-            } catch (IllegalStateException ise) {
+            } catch (final IllegalStateException ise) {
                 if(DEBUG) {
                     ise.printStackTrace();
                 }
@@ -145,7 +145,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
                 eos = false;
                 mp.setOnCompletionListener(onCompletionListener);
                 return true;
-            } catch (IllegalStateException ise) {
+            } catch (final IllegalStateException ise) {
                 if(DEBUG) {
                     ise.printStackTrace();
                 }
@@ -156,7 +156,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
                     cam.startPreview();
                 }
                 return true;
-            } catch (IllegalStateException ise) {
+            } catch (final IllegalStateException ise) {
                 if(DEBUG) {
                     ise.printStackTrace();
                 }
@@ -172,7 +172,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
             try {
                 mp.pause();
                 return true;
-            } catch (IllegalStateException ise) {
+            } catch (final IllegalStateException ise) {
                 if(DEBUG) {
                     ise.printStackTrace();
                 }
@@ -182,7 +182,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
             try {
                 cam.stopPreview();
                 return true;
-            } catch (IllegalStateException ise) {
+            } catch (final IllegalStateException ise) {
                 if(DEBUG) {
                     ise.printStackTrace();
                 }
@@ -192,7 +192,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected final int seekImpl(int msec) {
+    protected final int seekImpl(final int msec) {
         if(null != mp) {
             mp.seekTo(msec);
             return mp.getCurrentPosition();
@@ -200,7 +200,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
         return 0;
     }
 
-    private void wakeUp(boolean newFrame) {
+    private void wakeUp(final boolean newFrame) {
         synchronized(updateSurfaceLock) {
             if(newFrame) {
                 updateSurface = true;
@@ -213,12 +213,12 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     protected final int getAudioPTSImpl() { return null != mp ? mp.getCurrentPosition() : 0; }
 
     @Override
-    protected final void destroyImpl(GL gl) {
+    protected final void destroyImpl(final GL gl) {
         if(null != mp) {
             wakeUp(false);
             try {
                 mp.stop();
-            } catch (IllegalStateException ise) {
+            } catch (final IllegalStateException ise) {
                 if(DEBUG) {
                     ise.printStackTrace();
                 }
@@ -230,7 +230,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
             wakeUp(false);
             try {
                 cam.stopPreview();
-            } catch (IllegalStateException ise) {
+            } catch (final IllegalStateException ise) {
                 if(DEBUG) {
                     ise.printStackTrace();
                 }
@@ -241,7 +241,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
     }
 
     public static class SurfaceTextureFrame extends TextureSequence.TextureFrame {
-        public SurfaceTextureFrame(Texture t, SurfaceTexture stex) {
+        public SurfaceTextureFrame(final Texture t, final SurfaceTexture stex) {
             super(t);
             this.surfaceTex = stex;
         }
@@ -254,7 +254,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
 
     @Override
     protected final void initStreamImpl(final int vid, final int aid) throws IOException {
-        if( null == streamLoc ) {
+        if( null == getURI() ) {
             return;
         }
         if( null == mp && null == cam ) {
@@ -263,8 +263,8 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
             } else {
                 int cameraId = 0;
                 try {
-                    cameraId = Integer.valueOf(cameraPath);
-                } catch (NumberFormatException nfe) {}
+                    cameraId = Integer.parseInt(cameraPath);
+                } catch (final NumberFormatException nfe) {}
                 if( 0 <= cameraId && cameraId < Camera.getNumberOfCameras() ) {
                     cam = Camera.open(cameraId);
                 } else {
@@ -280,20 +280,20 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
             } // else FIXME: Select aid !
             // Note: Both FIXMEs seem to be n/a via Android's MediaPlayer -> Switch to API level 16 MediaCodec/MediaExtractor ..
             try {
-                final Uri _uri = Uri.parse(streamLoc.toString());
+                final Uri _uri = Uri.parse(getURI().toString());
                 mp.setDataSource(StaticContext.getContext(), _uri);
-            } catch (IllegalArgumentException e) {
+            } catch (final IllegalArgumentException e) {
                 throw new RuntimeException(e);
-            } catch (SecurityException e) {
+            } catch (final SecurityException e) {
                 throw new RuntimeException(e);
-            } catch (IllegalStateException e) {
+            } catch (final IllegalStateException e) {
                 throw new RuntimeException(e);
             }
             mp.setSurface(null);
             try {
                 mp.prepare();
-            } catch (IOException ioe) {
-                throw new IOException("MediaPlayer failed to process stream <"+streamLoc.toString()+">: "+ioe.getMessage(), ioe);
+            } catch (final IOException ioe) {
+                throw new IOException("MediaPlayer failed to process stream <"+getURI().toString()+">: "+ioe.getMessage(), ioe);
             }
             final int r_aid = GLMediaPlayer.STREAM_ID_NONE == aid ? GLMediaPlayer.STREAM_ID_NONE : 1 /* fake */;
             final String icodec = "android";
@@ -340,7 +340,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
                              0, 0, 0, icodec, icodec);
         }
     }
-    private static String camSz2Str(Camera.Size csize) {
+    private static String camSz2Str(final Camera.Size csize) {
         if( null != csize ) {
             return csize.width+"x"+csize.height;
         } else {
@@ -348,7 +348,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
         }
     }
     @Override
-    protected final void initGLImpl(GL gl) throws IOException, GLException {
+    protected final void initGLImpl(final GL gl) throws IOException, GLException {
         // NOP
     }
 
@@ -359,12 +359,12 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
      * </p>
      */
     @Override
-    protected int validateTextureCount(int desiredTextureCount) {
+    protected int validateTextureCount(final int desiredTextureCount) {
         return TEXTURE_COUNT_MIN;
     }
 
     @Override
-    protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
+    protected final int getNextTextureImpl(final GL gl, final TextureFrame nextFrame) {
         int pts = TimeFrameI.INVALID_PTS;
         if(null != mp || null != cam) {
             final SurfaceTextureFrame sTexFrame = null != nextFrame ? (SurfaceTextureFrame) nextFrame : singleSTexFrame;
@@ -380,8 +380,8 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
                     try {
                         cam.setPreviewTexture(sTexFrame.surfaceTex);
                         cam.startPreview();
-                    } catch (IOException ioe) {
-                        throw new RuntimeException("MediaPlayer failed to process stream <"+streamLoc.toString()+">: "+ioe.getMessage(), ioe);
+                    } catch (final IOException ioe) {
+                        throw new RuntimeException("MediaPlayer failed to process stream <"+getURI().toString()+">: "+ioe.getMessage(), ioe);
                     }
                 }
                 if( null != surface ) {
@@ -401,7 +401,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
                         if(!updateSurface) { // volatile OK.
                             try {
                                 updateSurfaceLock.wait();
-                            } catch (InterruptedException e) {
+                            } catch (final InterruptedException e) {
                                 e.printStackTrace();
                             }
                         }
@@ -420,7 +420,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
                     // stex.getTransformMatrix(atex.getSTMatrix());
                 }
             }
-            nextFrame.setPTS( pts );
+            sTexFrame.setPTS( pts );
         }
         return pts;
     }
@@ -432,7 +432,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
      * </p>
      */
     @Override
-    protected TextureFrame[] createTexFrames(GL gl, final int count) {
+    protected TextureFrame[] createTexFrames(final GL gl, final int count) {
         final int[] texNames = new int[1];
         gl.glGenTextures(1, texNames, 0);
         final int err = gl.glGetError();
@@ -452,10 +452,10 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
      * </p>
      */
     @Override
-    protected final TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
+    protected final TextureSequence.TextureFrame createTexImage(final GL gl, final int texName) {
         sTexFrameCount++;
         if( 1 == sTexFrameCount ) {
-            singleSTexFrame = new SurfaceTextureFrame( createTexImageImpl(gl, texName, width, height), new SurfaceTexture(texName) );
+            singleSTexFrame = new SurfaceTextureFrame( createTexImageImpl(gl, texName, getWidth(), getHeight()), new SurfaceTexture(texName) );
         }
         return singleSTexFrame;
     }
@@ -467,7 +467,7 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
      * </p>
      */
     @Override
-    protected final void destroyTexFrame(GL gl, TextureSequence.TextureFrame frame) {
+    protected final void destroyTexFrame(final GL gl, final TextureSequence.TextureFrame frame) {
         sTexFrameCount--;
         if( 0 == sTexFrameCount ) {
             singleSTexFrame = null;
@@ -480,14 +480,14 @@ public class AndroidGLMediaPlayerAPI14 extends GLMediaPlayerImpl {
 
     private final OnFrameAvailableListener onFrameAvailableListener = new OnFrameAvailableListener() {
         @Override
-        public void onFrameAvailable(SurfaceTexture surfaceTexture) {
+        public void onFrameAvailable(final SurfaceTexture surfaceTexture) {
             wakeUp(true);
         }
     };
 
     private final OnCompletionListener onCompletionListener = new OnCompletionListener() {
         @Override
-        public void onCompletion(MediaPlayer mp) {
+        public void onCompletion(final MediaPlayer mp) {
             eos = true;
         }
     };
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
index 72c9ac5..3f8910f 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTThreadingPlugin.java
@@ -86,7 +86,7 @@ public class AWTThreadingPlugin implements ToolkitThreadingPlugin {
   }
 
   @Override
-  public final void invokeOnOpenGLThread(boolean wait, Runnable r) throws GLException {
+  public final void invokeOnOpenGLThread(final boolean wait, final Runnable r) throws GLException {
     switch (ThreadingImpl.getMode()) {
       case ST_AWT:
         // FIXME: ideally should run all OpenGL work on the Java2D QFT
@@ -108,6 +108,10 @@ public class AWTThreadingPlugin implements ToolkitThreadingPlugin {
         ThreadingImpl.invokeOnWorkerThread(wait, r);
         break;
 
+      case MT:
+        r.run();
+        break;
+
       default:
         throw new InternalError("Illegal single-threading mode " + ThreadingImpl.getMode());
     }
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
index 1c1d235..a5f5b47 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTTilePainter.java
@@ -83,11 +83,11 @@ public class AWTTilePainter {
     private Graphics2D g2d = null;
     private AffineTransform saveAT = null;
 
-    public static void dumpHintsAndScale(Graphics2D g2d) {
+    public static void dumpHintsAndScale(final Graphics2D g2d) {
           final RenderingHints rHints = g2d.getRenderingHints();
           final Set<Entry<Object, Object>> rEntries = rHints.entrySet();
           int count = 0;
-          for(Iterator<Entry<Object, Object>> rEntryIter = rEntries.iterator(); rEntryIter.hasNext(); count++) {
+          for(final Iterator<Entry<Object, Object>> rEntryIter = rEntries.iterator(); rEntryIter.hasNext(); count++) {
               final Entry<Object, Object> rEntry = rEntryIter.next();
               System.err.println("Hint["+count+"]: "+rEntry.getKey()+" -> "+rEntry.getValue());
           }
@@ -105,7 +105,7 @@ public class AWTTilePainter {
     /**
      * @return resulting number of samples by comparing w/ {@link #customNumSamples} and the caps-config, 0 if disabled
      */
-    public int getNumSamples(GLCapabilitiesImmutable caps) {
+    public int getNumSamples(final GLCapabilitiesImmutable caps) {
           if( 0 > customNumSamples ) {
               return 0;
           } else if( 0 < customNumSamples ) {
@@ -137,7 +137,7 @@ public class AWTTilePainter {
      * @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
      * @param verbose
      */
-    public AWTTilePainter(TileRenderer renderer, int componentCount, double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight, boolean verbose) {
+    public AWTTilePainter(final TileRenderer renderer, final int componentCount, final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight, final boolean verbose) {
         this.renderer = renderer;
         this.renderer.setGLEventListener(preTileGLEL, postTileGLEL);
         this.componentCount = componentCount;
@@ -160,16 +160,16 @@ public class AWTTilePainter {
      * @param flipVertical if <code>true</code>, the image will be flipped vertically (Default for OpenGL).
      * @param originBottomLeft if <code>true</code>, the image's origin is on the bottom left (Default for OpenGL).
      */
-    public void setGLOrientation(boolean flipVertical, boolean originBottomLeft) {
+    public void setGLOrientation(final boolean flipVertical, final boolean originBottomLeft) {
         this.flipVertical = flipVertical;
         this.originBottomLeft = originBottomLeft;
     }
 
-    private static Rectangle2D getClipBounds2D(Graphics2D g) {
+    private static Rectangle2D getClipBounds2D(final Graphics2D g) {
         final Shape shape = g.getClip();
         return null != shape ? shape.getBounds2D() : null;
     }
-    private static Rectangle2D clipNegative(Rectangle2D in) {
+    private static Rectangle2D clipNegative(final Rectangle2D in) {
         if( null == in ) { return null; }
         double x=in.getX(), y=in.getY(), width=in.getWidth(), height=in.getHeight();
         if( 0 > x ) {
@@ -201,7 +201,7 @@ public class AWTTilePainter {
      * @throws NoninvertibleTransformException if the {@link Graphics2D}'s {@link AffineTransform} {@link AffineTransform#invert() inversion} fails.
      *                                         Since inversion is tested before scaling the given {@link Graphics2D}, caller shall ignore the whole <i>term</i>.
      */
-    public void setupGraphics2DAndClipBounds(Graphics2D g2d, int width, int height) throws NoninvertibleTransformException {
+    public void setupGraphics2DAndClipBounds(final Graphics2D g2d, final int width, final int height) throws NoninvertibleTransformException {
         this.g2d = g2d;
         saveAT = g2d.getTransform();
         if( null == saveAT ) {
@@ -278,11 +278,11 @@ public class AWTTilePainter {
 
     final GLEventListener preTileGLEL = new GLEventListener() {
         @Override
-        public void init(GLAutoDrawable drawable) {}
+        public void init(final GLAutoDrawable drawable) {}
         @Override
-        public void dispose(GLAutoDrawable drawable) {}
+        public void dispose(final GLAutoDrawable drawable) {}
         @Override
-        public void display(GLAutoDrawable drawable) {
+        public void display(final GLAutoDrawable drawable) {
             final GL gl = drawable.getGL();
             if( null == tBuffer ) {
                 final int tWidth = renderer.getParam(TileRenderer.TR_TILE_WIDTH);
@@ -302,17 +302,17 @@ public class AWTTilePainter {
             }
         }
         @Override
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
     };
     static int _counter = 0;
     final GLEventListener postTileGLEL = new GLEventListener() {
         @Override
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
         }
         @Override
-        public void dispose(GLAutoDrawable drawable) {}
+        public void dispose(final GLAutoDrawable drawable) {}
         @Override
-        public void display(GLAutoDrawable drawable) {
+        public void display(final GLAutoDrawable drawable) {
             final DimensionImmutable cis = renderer.getClippedImageSize();
             final int tWidth = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_WIDTH);
             final int tHeight = renderer.getParam(TileRendererBase.TR_CURRENT_TILE_HEIGHT);
@@ -337,7 +337,7 @@ public class AWTTilePainter {
                 final File fout = new File(fname);
                 try {
                     ImageIO.write(tBuffer.image, "png", fout);
-                } catch (IOException e) {
+                } catch (final IOException e) {
                     e.printStackTrace();
                 }
             }
@@ -368,7 +368,7 @@ public class AWTTilePainter {
                 final File fout = new File(fname);
                 try {
                     ImageIO.write(dstImage, "png", fout);
-                } catch (IOException e) {
+                } catch (final IOException e) {
                     e.printStackTrace();
                 }
                 _counter++;
@@ -395,6 +395,6 @@ public class AWTTilePainter {
             }
         }
         @Override
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
     };
 }
diff --git a/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java b/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
index dc286ca..e34ec18 100644
--- a/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
+++ b/src/jogl/classes/jogamp/opengl/awt/AWTUtil.java
@@ -59,7 +59,7 @@ public class AWTUtil {
             isOGLPipelineActive = j2dClazz.getMethod("isOGLPipelineActive", (Class[])null);
             isQueueFlusherThread = j2dClazz.getMethod("isQueueFlusherThread", (Class[])null);
             j2dOk = true;
-        } catch (Exception e) {}
+        } catch (final Exception e) {}
     }
   }
 
@@ -84,7 +84,7 @@ public class AWTUtil {
             !((Boolean)isQueueFlusherThread.invoke(null, (Object[])null)).booleanValue() ) {
           NativeWindowFactory.getAWTToolkitLock().lock();
         }
-      } catch (Exception e) { j2dOk=false; }
+      } catch (final Exception e) { j2dOk=false; }
     }
     if(!j2dOk) {
       NativeWindowFactory.getAWTToolkitLock().lock();
@@ -107,7 +107,7 @@ public class AWTUtil {
                 !((Boolean)isQueueFlusherThread.invoke(null, (Object[])null)).booleanValue() ) {
               NativeWindowFactory.getAWTToolkitLock().unlock();
             }
-          } catch (Exception e) { j2dOk=false; }
+          } catch (final Exception e) { j2dOk=false; }
         }
         if(!j2dOk) {
           NativeWindowFactory.getAWTToolkitLock().unlock();
diff --git a/src/jogl/classes/jogamp/opengl/awt/Java2D.java b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
index 886cd93..5521202 100644
--- a/src/jogl/classes/jogamp/opengl/awt/Java2D.java
+++ b/src/jogl/classes/jogamp/opengl/awt/Java2D.java
@@ -59,6 +59,7 @@ import javax.media.opengl.GLProfile;
 
 import com.jogamp.common.os.Platform;
 
+import jogamp.common.os.PlatformPropsImpl;
 import jogamp.opengl.Debug;
 
 
@@ -121,14 +122,14 @@ public class Java2D {
           if (DEBUG) {
             System.err.println("Checking for Java2D/OpenGL support");
           }
-          Throwable catched = null;
+          Throwable caught = null;
           try {
             isHeadless = true;
             // Figure out whether the default graphics configuration is an
             // OpenGL graphics configuration
             final GraphicsConfiguration cfg;
             final String cfgName;
-            final boolean java2dOGLDisabledByOS = Platform.OS_TYPE == Platform.OSType.MACOS;
+            final boolean java2dOGLDisabledByOS = PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS;
             final boolean java2dOGLDisabledByProp;
             {
                 boolean enabled = true;
@@ -160,7 +161,7 @@ public class Java2D {
             if (isOGLPipelineActive) {
               try {
                 // Try to get methods we need to integrate
-                Class<?> utils = Class.forName("sun.java2d.opengl.OGLUtilities");
+                final Class<?> utils = Class.forName("sun.java2d.opengl.OGLUtilities");
                 invokeWithOGLContextCurrentMethod = utils.getDeclaredMethod("invokeWithOGLContextCurrent",
                                                                             new Class[] {
                                                                               Graphics.class,
@@ -208,7 +209,7 @@ public class Java2D {
                                                                           Graphics.class
                                                                         });
                       getOGLSurfaceTypeMethod.setAccessible(true);
-                    } catch (Exception e) {
+                    } catch (final Exception e) {
                       fbObjectSupportInitialized = false;
                       if (DEBUG) {
                         e.printStackTrace();
@@ -223,7 +224,7 @@ public class Java2D {
                                                                           Graphics.class
                                                                         });
                       getOGLTextureTypeMethod.setAccessible(true);
-                    } catch (Exception e) {
+                    } catch (final Exception e) {
                       if (DEBUG) {
                         e.printStackTrace();
                         System.err.println("Info: GL_ARB_texture_rectangle FBO support disabled");
@@ -236,7 +237,7 @@ public class Java2D {
                     Class<?> cglSurfaceData = null;
                     try {
                       cglSurfaceData = Class.forName("sun.java2d.opengl.CGLSurfaceData");
-                    } catch (Exception e) {
+                    } catch (final Exception e) {
                       if (DEBUG) {
                         e.printStackTrace();
                         System.err.println("Info: Unable to find class sun.java2d.opengl.CGLSurfaceData for OS X");
@@ -268,8 +269,8 @@ public class Java2D {
                       destroyOGLContextMethod.setAccessible(true);
                     }
                 }
-              } catch (Exception e) {
-                catched = e;
+              } catch (final Exception e) {
+                caught = e;
                 if (DEBUG) {
                   System.err.println("Info: Disabling Java2D/JOGL integration");
                 }
@@ -277,16 +278,16 @@ public class Java2D {
                 isOGLPipelineResourceCompatible = false;
               }
             }
-          } catch (HeadlessException e) {
+          } catch (final HeadlessException e) {
             // The AWT is running in headless mode, so the Java 2D / JOGL bridge is clearly disabled
-          } catch (Error e) {
+          } catch (final Error e) {
             // issued on OSX Java7: java.lang.Error: Could not find class: sun.awt.HeadlessGraphicsEnvironment
-            catched = e;
+            caught = e;
           }
 
           if (DEBUG) {
-            if(null != catched) {
-                catched.printStackTrace();
+            if(null != caught) {
+                caught.printStackTrace();
             }
             System.err.println("JOGL/Java2D OGL Pipeline active " + isOGLPipelineActive + ", resourceCompatible "+isOGLPipelineResourceCompatible);
           }
@@ -312,9 +313,9 @@ public class Java2D {
 
     try {
       return ((Boolean) isQueueFlusherThreadMethod.invoke(null, (Object[])null)).booleanValue();
-    } catch (InvocationTargetException e) {
+    } catch (final InvocationTargetException e) {
       throw new GLException(e.getTargetException());
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw (InternalError) new InternalError().initCause(e);
     }
   }
@@ -322,7 +323,7 @@ public class Java2D {
   /** Makes current the OpenGL context associated with the passed
       Graphics object and runs the given Runnable on the Queue
       Flushing Thread in one atomic action. */
-  public static void invokeWithOGLContextCurrent(Graphics g, Runnable r) throws GLException {
+  public static void invokeWithOGLContextCurrent(final Graphics g, final Runnable r) throws GLException {
     checkActive();
 
     try {
@@ -341,9 +342,9 @@ public class Java2D {
       } finally {
         AWTUtil.unlockToolkit();
       }
-    } catch (InvocationTargetException e) {
+    } catch (final InvocationTargetException e) {
       throw new GLException(e.getTargetException());
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw (InternalError) new InternalError().initCause(e);
     }
   }
@@ -356,7 +357,7 @@ public class Java2D {
       JOGL must share textures and display lists with it. Returns
       false if the passed GraphicsConfiguration was not an OpenGL
       GraphicsConfiguration. */
-  public static boolean invokeWithOGLSharedContextCurrent(GraphicsConfiguration g, Runnable r) throws GLException {
+  public static boolean invokeWithOGLSharedContextCurrent(final GraphicsConfiguration g, final Runnable r) throws GLException {
     checkCompatible();
 
     try {
@@ -366,9 +367,9 @@ public class Java2D {
       } finally {
         AWTUtil.unlockToolkit();
       }
-    } catch (InvocationTargetException e) {
+    } catch (final InvocationTargetException e) {
       throw new GLException(e.getTargetException());
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw (InternalError) new InternalError().initCause(e);
     }
   }
@@ -379,18 +380,18 @@ public class Java2D {
       call glViewport() with the returned rectangle's bounds in order
       to get correct rendering results. Should only be called from the
       Queue Flusher Thread. */
-  public static Rectangle getOGLViewport(Graphics g,
-                                         int componentWidth,
-                                         int componentHeight) {
+  public static Rectangle getOGLViewport(final Graphics g,
+                                         final int componentWidth,
+                                         final int componentHeight) {
     checkCompatible();
 
     try {
       return (Rectangle) getOGLViewportMethod.invoke(null, new Object[] {g,
-                                                                         new Integer(componentWidth),
-                                                                         new Integer(componentHeight)});
-    } catch (InvocationTargetException e) {
+                                                                         Integer.valueOf(componentWidth),
+                                                                         Integer.valueOf(componentHeight)});
+    } catch (final InvocationTargetException e) {
       throw new GLException(e.getTargetException());
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw (InternalError) new InternalError().initCause(e);
     }
   }
@@ -401,14 +402,14 @@ public class Java2D {
       method should be called and the resulting rectangle's bounds
       passed to a call to glScissor(). Should only be called from the
       Queue Flusher Thread. */
-  public static Rectangle getOGLScissorBox(Graphics g) {
+  public static Rectangle getOGLScissorBox(final Graphics g) {
     checkCompatible();
 
     try {
       return (Rectangle) getOGLScissorBoxMethod.invoke(null, new Object[] {g});
-    } catch (InvocationTargetException e) {
+    } catch (final InvocationTargetException e) {
       throw new GLException(e.getTargetException());
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw (InternalError) new InternalError().initCause(e);
     }
   }
@@ -419,14 +420,14 @@ public class Java2D {
       changed and a new external GLDrawable and GLContext should be
       created (and the old ones destroyed). Should only be called from
       the Queue Flusher Thread.*/
-  public static Object getOGLSurfaceIdentifier(Graphics g) {
+  public static Object getOGLSurfaceIdentifier(final Graphics g) {
     checkCompatible();
 
     try {
       return getOGLSurfaceIdentifierMethod.invoke(null, new Object[] {g});
-    } catch (InvocationTargetException e) {
+    } catch (final InvocationTargetException e) {
       throw new GLException(e.getTargetException());
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw (InternalError) new InternalError().initCause(e);
     }
   }
@@ -434,7 +435,7 @@ public class Java2D {
   /** Returns the underlying surface type for the given Graphics
       object. This indicates, in particular, whether Java2D is
       currently rendering into a pbuffer or FBO. */
-  public static int getOGLSurfaceType(Graphics g) {
+  public static int getOGLSurfaceType(final Graphics g) {
     checkCompatible();
 
     try {
@@ -445,9 +446,9 @@ public class Java2D {
       }
 
       return ((Integer) getOGLSurfaceTypeMethod.invoke(null, new Object[] { g })).intValue();
-    } catch (InvocationTargetException e) {
+    } catch (final InvocationTargetException e) {
       throw new GLException(e.getTargetException());
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw (InternalError) new InternalError().initCause(e);
     }
   }
@@ -455,7 +456,7 @@ public class Java2D {
   /** Returns the underlying texture target of the given Graphics
       object assuming it is rendering to an FBO. Returns either
       GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB. */
-  public static int getOGLTextureType(Graphics g) {
+  public static int getOGLTextureType(final Graphics g) {
     checkCompatible();
 
     if (getOGLTextureTypeMethod == null) {
@@ -464,9 +465,9 @@ public class Java2D {
 
     try {
       return ((Integer) getOGLTextureTypeMethod.invoke(null, new Object[] { g })).intValue();
-    } catch (InvocationTargetException e) {
+    } catch (final InvocationTargetException e) {
       throw new GLException(e.getTargetException());
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw (InternalError) new InternalError().initCause(e);
     }
   }
@@ -477,7 +478,7 @@ public class Java2D {
       used for rendering. FIXME: may need to alter the API in the
       future to indicate which GraphicsDevice the source context is
       associated with. */
-  public static GLContext filterShareContext(GLContext shareContext) {
+  public static GLContext filterShareContext(final GLContext shareContext) {
     if (isHeadless)
       return shareContext;
 
@@ -495,7 +496,7 @@ public class Java2D {
       context", with which all contexts created by JOGL must share
       textures and display lists when the FBO option is enabled for
       the Java2D/OpenGL pipeline. */
-  public static GLContext getShareContext(GraphicsDevice device) {
+  public static GLContext getShareContext(final GraphicsDevice device) {
     initFBOShareContext(device);
     // FIXME: for full generality probably need to have multiple of
     // these, one per GraphicsConfiguration seen?
@@ -509,41 +510,41 @@ public class Java2D {
   /** (Mac OS X-specific) Creates a new OpenGL context on the surface
       associated with the given Graphics object, sharing textures and
       display lists with the specified (CGLContextObj) share context. */
-  public static long createOGLContextOnSurface(Graphics g, long shareCtx) {
+  public static long createOGLContextOnSurface(final Graphics g, final long shareCtx) {
     checkCompatible();
 
     try {
-      return ((Long) createOGLContextOnSurfaceMethod.invoke(null, new Object[] { g, new Long(shareCtx) })).longValue();
-    } catch (InvocationTargetException e) {
+      return ((Long) createOGLContextOnSurfaceMethod.invoke(null, new Object[] { g, Long.valueOf(shareCtx) })).longValue();
+    } catch (final InvocationTargetException e) {
       throw new GLException(e.getTargetException());
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw (InternalError) new InternalError().initCause(e);
     }
   }
 
   /** (Mac OS X-specific) Makes the given OpenGL context current on
       the surface associated with the given Graphics object. */
-  public static boolean makeOGLContextCurrentOnSurface(Graphics g, long ctx) {
+  public static boolean makeOGLContextCurrentOnSurface(final Graphics g, final long ctx) {
     checkCompatible();
 
     try {
-      return ((Boolean) makeOGLContextCurrentOnSurfaceMethod.invoke(null, new Object[] { g, new Long(ctx) })).booleanValue();
-    } catch (InvocationTargetException e) {
+      return ((Boolean) makeOGLContextCurrentOnSurfaceMethod.invoke(null, new Object[] { g, Long.valueOf(ctx) })).booleanValue();
+    } catch (final InvocationTargetException e) {
       throw new GLException(e.getTargetException());
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw (InternalError) new InternalError().initCause(e);
     }
   }
 
   /** (Mac OS X-specific) Destroys the given OpenGL context. */
-  public static void destroyOGLContext(long ctx) {
+  public static void destroyOGLContext(final long ctx) {
     checkCompatible();
 
     try {
-      destroyOGLContextMethod.invoke(null, new Object[] { new Long(ctx) });
-    } catch (InvocationTargetException e) {
+      destroyOGLContextMethod.invoke(null, new Object[] { Long.valueOf(ctx) });
+    } catch (final InvocationTargetException e) {
       throw new GLException(e.getTargetException());
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw (InternalError) new InternalError().initCause(e);
     }
   }
@@ -565,15 +566,15 @@ public class Java2D {
   }
 
   private static int getOGLUtilitiesIntField(final String name) {
-    Integer i = AccessController.doPrivileged(new PrivilegedAction<Integer>() {
+    final Integer i = AccessController.doPrivileged(new PrivilegedAction<Integer>() {
         @Override
         public Integer run() {
           try {
-            Class<?> utils = Class.forName("sun.java2d.opengl.OGLUtilities");
-            Field f = utils.getField(name);
+            final Class<?> utils = Class.forName("sun.java2d.opengl.OGLUtilities");
+            final Field f = utils.getField(name);
             f.setAccessible(true);
             return (Integer) f.get(null);
-          } catch (Exception e) {
+          } catch (final Exception e) {
             if (DEBUG) {
               e.printStackTrace();
             }
diff --git a/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
index 9173a38..2f87f01 100644
--- a/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
+++ b/src/jogl/classes/jogamp/opengl/awt/VersionApplet.java
@@ -31,12 +31,12 @@ public class VersionApplet extends Applet {
   TextArea tareaCaps;
   GLCanvas canvas;
 
-  public static void main(String[] args) {
-    Frame frame = new Frame("JOGL Version Applet");
+  public static void main(final String[] args) {
+    final Frame frame = new Frame("JOGL Version Applet");
     frame.setSize(800, 600);
     frame.setLayout(new BorderLayout());
 
-    VersionApplet va = new VersionApplet();
+    final VersionApplet va = new VersionApplet();
     frame.addWindowListener(new ClosingWindowAdapter(frame, va));
 
     va.init();
@@ -50,12 +50,12 @@ public class VersionApplet extends Applet {
   static class ClosingWindowAdapter extends WindowAdapter {
     Frame f;
     VersionApplet va;
-    public ClosingWindowAdapter(Frame f, VersionApplet va) {
+    public ClosingWindowAdapter(final Frame f, final VersionApplet va) {
         this.f = f;
         this.va = va;
     }
     @Override
-    public void windowClosing(WindowEvent ev) {
+    public void windowClosing(final WindowEvent ev) {
         f.setVisible(false);
         va.stop();
         va.destroy();
@@ -70,8 +70,8 @@ public class VersionApplet extends Applet {
 
     setEnabled(true);
 
-    GLProfile glp = GLProfile.getDefault();
-    GLCapabilities glcaps = new GLCapabilities(glp);
+    final GLProfile glp = GLProfile.getDefault();
+    final GLCapabilities glcaps = new GLCapabilities(glp);
 
     setLayout(new BorderLayout());
     String s;
@@ -96,16 +96,16 @@ public class VersionApplet extends Applet {
     tareaVersion.append(s);
 
     tareaCaps = new TextArea(120, 20);
-    GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
-    List<GLCapabilitiesImmutable> availCaps = factory.getAvailableCapabilities(null);
+    final GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
+    final List<GLCapabilitiesImmutable> availCaps = factory.getAvailableCapabilities(null);
     for(int i=0; i<availCaps.size(); i++) {
-        s = ((GLCapabilitiesImmutable) availCaps.get(i)).toString();
+        s = availCaps.get(i).toString();
         System.err.println(s);
         tareaCaps.append(s);
         tareaCaps.append(Platform.getNewline());
     }
 
-    Container grid = new Container();
+    final Container grid = new Container();
     grid.setLayout(new GridLayout(2, 1));
     grid.add(tareaVersion);
     grid.add(tareaCaps);
@@ -160,23 +160,23 @@ public class VersionApplet extends Applet {
 
   class GLInfo implements GLEventListener {
     @Override
-    public void init(GLAutoDrawable drawable) {
-        GL gl = drawable.getGL();
-        String s = JoglVersion.getGLInfo(gl, null).toString();
+    public void init(final GLAutoDrawable drawable) {
+        final GL gl = drawable.getGL();
+        final String s = JoglVersion.getGLInfo(gl, null).toString();
         System.err.println(s);
         tareaVersion.append(s);
     }
 
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
     }
 
     @Override
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
     }
 
     @Override
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
     }
   }
 
diff --git a/src/jogl/classes/jogamp/opengl/cg/CgPackagePlaceholder.java b/src/jogl/classes/jogamp/opengl/cg/CgPackagePlaceholder.java
new file mode 100644
index 0000000..7a7e1ae
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/cg/CgPackagePlaceholder.java
@@ -0,0 +1,5 @@
+package jogamp.opengl.cg;
+
+public class CgPackagePlaceholder {
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
index 7b85c3e..8c60912 100644
--- a/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/DesktopES2DynamicLibraryBundleInfo.java
@@ -49,18 +49,18 @@ public final class DesktopES2DynamicLibraryBundleInfo extends GLDynamicLibraryBu
 
     @Override
     public final List<String> getToolGetProcAddressFuncNameList() {
-        List<String> res = new ArrayList<String>();
+        final List<String> res = new ArrayList<String>();
         res.add("eglGetProcAddress");
         return res;
     }
 
     @Override
-    public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+    public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
         return EGL.eglGetProcAddress(toolGetProcAddressHandle, funcName);
     }
 
     @Override
-    public final boolean useToolGetProcAdressFirst(String funcName) {
+    public final boolean useToolGetProcAdressFirst(final String funcName) {
         return true;
     }
 
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
index f89ded4..9644012 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLContext.java
@@ -65,13 +65,13 @@ public class EGLContext extends GLContextImpl {
     // EGL extension functions.
     private EGLExtProcAddressTable eglExtProcAddressTable;
 
-    EGLContext(GLDrawableImpl drawable,
-               GLContext shareWith) {
+    EGLContext(final GLDrawableImpl drawable,
+               final GLContext shareWith) {
         super(drawable, shareWith);
     }
 
     @Override
-    protected void resetStates(boolean isInit) {
+    protected void resetStates(final boolean isInit) {
         eglQueryStringInitialized = false;
         eglQueryStringAvailable = false;
         eglExtProcAddressTable = null;
@@ -140,12 +140,12 @@ public class EGLContext extends GLContextImpl {
     }
 
     @Override
-    protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
+    protected long createContextARBImpl(final long share, final boolean direct, final int ctp, final int major, final int minor) {
         return 0; // FIXME
     }
 
     @Override
-    protected void destroyContextARBImpl(long _context) {
+    protected void destroyContextARBImpl(final long _context) {
         if (!EGL.eglDestroyContext(drawable.getNativeSurface().getDisplayHandle(), _context)) {
             final int eglError = EGL.eglGetError();
             if(EGL.EGL_SUCCESS != eglError) { /* oops, Mesa EGL impl. may return false, but has no EGL error */
@@ -173,9 +173,9 @@ public class EGLContext extends GLContextImpl {
         try {
             // might be unavailable on EGL < 1.2
             if( !EGL.eglBindAPI(EGL.EGL_OPENGL_ES_API) ) {
-                throw new GLException("Catched: eglBindAPI to ES failed , error "+toHexString(EGL.eglGetError()));
+                throw new GLException("Caught: eglBindAPI to ES failed , error "+toHexString(EGL.eglGetError()));
             }
-        } catch (GLException glex) {
+        } catch (final GLException glex) {
             if (DEBUG) {
                 glex.printStackTrace();
             }
@@ -272,7 +272,7 @@ public class EGLContext extends GLContextImpl {
 
     @Override
     protected final StringBuilder getPlatformExtensionsStringImpl() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         if (!eglQueryStringInitialized) {
           eglQueryStringAvailable = getDrawableImpl().getGLDynamicLookupHelper().isFunctionAvailable("eglQueryString");
           eglQueryStringInitialized = true;
@@ -288,7 +288,7 @@ public class EGLContext extends GLContextImpl {
     }
 
     @Override
-    protected boolean setSwapIntervalImpl(int interval) {
+    protected boolean setSwapIntervalImpl(final int interval) {
         if( hasRendererQuirk(GLRendererQuirks.NoSetSwapInterval) ) {
             return false;
         }
@@ -299,11 +299,11 @@ public class EGLContext extends GLContextImpl {
     // Accessible ..
     //
 
-    /* pp */ void mapCurrentAvailableGLVersion(AbstractGraphicsDevice device) {
+    /* pp */ void mapCurrentAvailableGLVersion(final AbstractGraphicsDevice device) {
         mapStaticGLVersion(device, ctxVersion.getMajor(), ctxVersion.getMinor(), ctxOptions);
     }
     /* pp */ int getContextOptions() { return ctxOptions; }
-    /* pp */ static void mapStaticGLESVersion(AbstractGraphicsDevice device, GLCapabilitiesImmutable caps) {
+    /* pp */ static void mapStaticGLESVersion(final AbstractGraphicsDevice device, final GLCapabilitiesImmutable caps) {
         final GLProfile glp = caps.getGLProfile();
         final int[] reqMajorCTP = new int[2];
         GLContext.getRequestMajorAndCompat(glp, reqMajorCTP);
@@ -319,7 +319,7 @@ public class EGLContext extends GLContextImpl {
         }
         mapStaticGLVersion(device, reqMajorCTP[0], 0, reqMajorCTP[1]);
     }
-    /* pp */ static void mapStaticGLVersion(AbstractGraphicsDevice device, int major, int minor, int ctp) {
+    /* pp */ static void mapStaticGLVersion(final AbstractGraphicsDevice device, final int major, final int minor, final int ctp) {
         if( 0 != ( ctp & GLContext.CTX_PROFILE_ES) ) {
             // ES1, ES2, ES3, ..
             mapStaticGLVersion(device, major /* reqMajor */, major, minor, ctp);
@@ -329,28 +329,28 @@ public class EGLContext extends GLContextImpl {
             }
         }
     }
-    private static void mapStaticGLVersion(AbstractGraphicsDevice device, int reqMajor, int major, int minor, int ctp) {
+    private static void mapStaticGLVersion(final AbstractGraphicsDevice device, final int reqMajor, final int major, final int minor, final int ctp) {
         GLContext.mapAvailableGLVersion(device, reqMajor, GLContext.CTX_PROFILE_ES, major, minor, ctp);
         if(! ( device instanceof EGLGraphicsDevice ) ) {
             final EGLGraphicsDevice eglDevice = new EGLGraphicsDevice(device.getHandle(), EGL.EGL_NO_DISPLAY, device.getConnection(), device.getUnitID(), null);
             GLContext.mapAvailableGLVersion(eglDevice, reqMajor, GLContext.CTX_PROFILE_ES, major, minor, ctp);
         }
     }
-    protected static String getGLVersion(int major, int minor, int ctp, String gl_version) {
+    protected static String getGLVersion(final int major, final int minor, final int ctp, final String gl_version) {
         return GLContext.getGLVersion(major, minor, ctp, gl_version);
     }
 
-    protected static boolean getAvailableGLVersionsSet(AbstractGraphicsDevice device) {
+    protected static boolean getAvailableGLVersionsSet(final AbstractGraphicsDevice device) {
         return GLContext.getAvailableGLVersionsSet(device);
     }
-    protected static void setAvailableGLVersionsSet(AbstractGraphicsDevice device) {
+    protected static void setAvailableGLVersionsSet(final AbstractGraphicsDevice device) {
         GLContext.setAvailableGLVersionsSet(device);
     }
 
-    protected static String toHexString(int hex) {
+    protected static String toHexString(final int hex) {
         return GLContext.toHexString(hex);
     }
-    protected static String toHexString(long hex) {
+    protected static String toHexString(final long hex) {
         return GLContext.toHexString(hex);
     }
 
@@ -359,17 +359,17 @@ public class EGLContext extends GLContextImpl {
     //
 
     @Override
-    protected void copyImpl(GLContext source, int mask) throws GLException {
+    protected void copyImpl(final GLContext source, final int mask) throws GLException {
         throw new GLException("Not yet implemented");
     }
 
     @Override
-    public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {
+    public final ByteBuffer glAllocateMemoryNV(final int size, final float readFrequency, final float writeFrequency, final float priority) {
         throw new GLException("Should not call this");
     }
 
     @Override
-    public final void glFreeMemoryNV(ByteBuffer pointer) {
+    public final void glFreeMemoryNV(final ByteBuffer pointer) {
         throw new GLException("Should not call this");
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java b/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
index c5f76f6..9499c70 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDisplayUtil.java
@@ -75,7 +75,7 @@ public class EGLDisplayUtil {
          * </p>
          */
         static EGLDisplayRef getOrCreateOpened(final long eglDisplay, final IntBuffer major, final IntBuffer minor) {
-            EGLDisplayRef o = (EGLDisplayRef) openEGLDisplays.get(eglDisplay);
+            final EGLDisplayRef o = (EGLDisplayRef) openEGLDisplays.get(eglDisplay);
             if( null == o ) {
                 if( EGL.eglInitialize(eglDisplay, major, minor) ) {
                     final EGLDisplayRef n = new EGLDisplayRef(eglDisplay);
@@ -123,7 +123,7 @@ public class EGLDisplayUtil {
             return o;
         }
 
-        private EGLDisplayRef(long eglDisplay) {
+        private EGLDisplayRef(final long eglDisplay) {
             this.eglDisplay = eglDisplay;
             this.initRefCount = 0;
             this.createdStack = DEBUG ? new Throwable() : null;
@@ -144,7 +144,7 @@ public class EGLDisplayUtil {
     /**
      * @return number of unclosed EGL Displays.<br>
      */
-    public static int shutdown(boolean verbose) {
+    public static int shutdown(final boolean verbose) {
         if(DEBUG || verbose || openEGLDisplays.size() > 0 ) {
             System.err.println("EGLDisplayUtil.EGLDisplays: Shutdown (open: "+openEGLDisplays.size()+")");
             if(DEBUG) {
@@ -160,7 +160,7 @@ public class EGLDisplayUtil {
     public static void dumpOpenDisplayConnections() {
         System.err.println("EGLDisplayUtil: Open EGL Display Connections: "+openEGLDisplays.size());
         int i=0;
-        for(Iterator<LongObjectHashMap.Entry> iter = openEGLDisplays.iterator(); iter.hasNext(); i++) {
+        for(final Iterator<LongObjectHashMap.Entry> iter = openEGLDisplays.iterator(); iter.hasNext(); i++) {
             final LongObjectHashMap.Entry e = iter.next();
             final EGLDisplayRef v = (EGLDisplayRef) e.value;
             System.err.println("EGLDisplayUtil: Open["+i+"]: 0x"+Long.toHexString(e.key)+": "+v);
@@ -170,9 +170,9 @@ public class EGLDisplayUtil {
         }
     }
 
-    /* pp */ static synchronized void setSingletonEGLDisplayOnly(boolean v) { useSingletonEGLDisplay = v; }
+    /* pp */ static synchronized void setSingletonEGLDisplayOnly(final boolean v) { useSingletonEGLDisplay = v; }
 
-    private static synchronized long eglGetDisplay(long nativeDisplay_id)  {
+    private static synchronized long eglGetDisplay(final long nativeDisplay_id)  {
         if( useSingletonEGLDisplay && null != singletonEGLDisplay ) {
             if(DEBUG) {
                 System.err.println("EGLDisplayUtil.eglGetDisplay.s: eglDisplay("+EGLContext.toHexString(nativeDisplay_id)+"): "+
@@ -198,7 +198,7 @@ public class EGLDisplayUtil {
      *
      * @see EGL#eglInitialize(long, IntBuffer, IntBuffer)
      */
-    private static synchronized boolean eglInitialize(long eglDisplay, IntBuffer major, IntBuffer minor)  {
+    private static synchronized boolean eglInitialize(final long eglDisplay, final IntBuffer major, final IntBuffer minor)  {
         if( EGL.EGL_NO_DISPLAY == eglDisplay) {
             return false;
         }
@@ -222,7 +222,7 @@ public class EGLDisplayUtil {
      * @see #eglGetDisplay(long)
      * @see #eglInitialize(long, IntBuffer, IntBuffer)
      */
-    private static synchronized int eglGetDisplayAndInitialize(long nativeDisplayID, long[] eglDisplay, int[] eglErr, IntBuffer major, IntBuffer minor) {
+    private static synchronized int eglGetDisplayAndInitialize(final long nativeDisplayID, final long[] eglDisplay, final int[] eglErr, final IntBuffer major, final IntBuffer minor) {
         eglDisplay[0] = EGL.EGL_NO_DISPLAY;
         final long _eglDisplay = eglGetDisplay( nativeDisplayID );
         if ( EGL.EGL_NO_DISPLAY == _eglDisplay ) {
@@ -247,7 +247,7 @@ public class EGLDisplayUtil {
      * @return the initialized EGL display ID
      * @throws GLException if not successful
      */
-    private static synchronized long eglGetDisplayAndInitialize(long[] nativeDisplayID) {
+    private static synchronized long eglGetDisplayAndInitialize(final long[] nativeDisplayID) {
         final long[] eglDisplay = new long[1];
         final int[] eglError = new int[1];
         int eglRes = EGLDisplayUtil.eglGetDisplayAndInitialize(nativeDisplayID[0], eglDisplay, eglError, null, null);
@@ -271,7 +271,7 @@ public class EGLDisplayUtil {
      * @param eglDisplay the EGL display handle
      * @return true if the eglDisplay is valid and it's reference counter becomes zero and {@link EGL#eglTerminate(long)} was successful, otherwise false
      */
-    private static synchronized boolean eglTerminate(long eglDisplay)  {
+    private static synchronized boolean eglTerminate(final long eglDisplay)  {
         if( EGL.EGL_NO_DISPLAY == eglDisplay) {
             return false;
         }
@@ -286,11 +286,11 @@ public class EGLDisplayUtil {
 
     private static final EGLGraphicsDevice.EGLDisplayLifecycleCallback eglLifecycleCallback = new EGLGraphicsDevice.EGLDisplayLifecycleCallback() {
         @Override
-        public long eglGetAndInitDisplay(long[] nativeDisplayID) {
+        public long eglGetAndInitDisplay(final long[] nativeDisplayID) {
             return eglGetDisplayAndInitialize(nativeDisplayID);
         }
         @Override
-        public void eglTerminate(long eglDisplayHandle) {
+        public void eglTerminate(final long eglDisplayHandle) {
             EGLDisplayUtil.eglTerminate(eglDisplayHandle);
         }
     };
@@ -309,7 +309,7 @@ public class EGLDisplayUtil {
      * @param unitID
      * @return an uninitialized {@link EGLGraphicsDevice}
      */
-    public static EGLGraphicsDevice eglCreateEGLGraphicsDevice(long nativeDisplayID, String connection, int unitID)  {
+    public static EGLGraphicsDevice eglCreateEGLGraphicsDevice(final long nativeDisplayID, final String connection, final int unitID)  {
         return new EGLGraphicsDevice(nativeDisplayID, EGL.EGL_NO_DISPLAY, connection, unitID, eglLifecycleCallback);
     }
 
@@ -325,7 +325,7 @@ public class EGLDisplayUtil {
      * @param surface
      * @return an uninitialized EGLGraphicsDevice
      */
-    public static EGLGraphicsDevice eglCreateEGLGraphicsDevice(NativeSurface surface)  {
+    public static EGLGraphicsDevice eglCreateEGLGraphicsDevice(final NativeSurface surface)  {
         final long nativeDisplayID;
         if( NativeWindowFactory.TYPE_WINDOWS == NativeWindowFactory.getNativeWindowType(false) ) {
             nativeDisplayID = surface.getSurfaceHandle(); // don't even ask ..
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
index f184eda..bacf9f1 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawable.java
@@ -52,7 +52,7 @@ import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
 
 public abstract class EGLDrawable extends GLDrawableImpl {
 
-    protected EGLDrawable(EGLDrawableFactory factory, NativeSurface component) throws GLException {
+    protected EGLDrawable(final EGLDrawableFactory factory, final NativeSurface component) throws GLException {
         super(factory, component, false);
     }
 
@@ -66,7 +66,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
         final EGLGraphicsConfiguration eglConfig = (EGLGraphicsConfiguration) eglws.getGraphicsConfiguration();
         final NativeSurface upstreamSurface = eglws.getUpstreamSurface();
 
-        long eglSurface = createSurface(eglConfig, eglws.getWidth(), eglws.getHeight(), upstreamSurface.getSurfaceHandle());
+        long eglSurface = createSurface(eglConfig, eglws.getSurfaceWidth(), eglws.getSurfaceHeight(), upstreamSurface.getSurfaceHandle());
 
         int eglError0;
         if (EGL.EGL_NO_SURFACE == eglSurface) {
@@ -80,7 +80,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
                         if(DEBUG) {
                             System.err.println(getThreadName() + ": Info: Creation of window surface w/ surface handle failed: "+eglConfig+", error "+toHexString(eglError0)+", retry w/ windowHandle");
                         }
-                        eglSurface = createSurface(eglConfig, eglws.getWidth(), eglws.getHeight(), nw.getWindowHandle());
+                        eglSurface = createSurface(eglConfig, eglws.getSurfaceWidth(), eglws.getSurfaceHeight(), nw.getWindowHandle());
                         if (EGL.EGL_NO_SURFACE == eglSurface) {
                             eglError0 = EGL.eglGetError();
                         }
@@ -131,7 +131,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
         }
     }
 
-    protected static boolean isValidEGLSurface(long eglDisplayHandle, long surfaceHandle) {
+    protected static boolean isValidEGLSurface(final long eglDisplayHandle, final long surfaceHandle) {
         if( 0 == surfaceHandle ) {
             return false;
         }
@@ -154,7 +154,7 @@ public abstract class EGLDrawable extends GLDrawableImpl {
     }
 
     @Override
-    protected final void swapBuffersImpl(boolean doubleBuffered) {
+    protected final void swapBuffersImpl(final boolean doubleBuffered) {
         if(doubleBuffered) {
             final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) surface.getGraphicsConfiguration().getScreen().getDevice();
             // single-buffer is already filtered out @ GLDrawableImpl#swapBuffers()
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
index 9ee0134..2edb223 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
@@ -65,6 +65,7 @@ import javax.media.opengl.GLDrawableFactory;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLProfile;
 
+import jogamp.common.os.PlatformPropsImpl;
 import jogamp.nativewindow.WrappedSurface;
 import jogamp.opengl.Debug;
 import jogamp.opengl.GLContextImpl;
@@ -77,6 +78,7 @@ import jogamp.opengl.SharedResourceRunner;
 import com.jogamp.common.nio.Buffers;
 import com.jogamp.common.nio.PointerBuffer;
 import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.common.util.ReflectionUtil;
 import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
 import com.jogamp.opengl.GLRendererQuirks;
@@ -88,14 +90,14 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
 
     static {
         Debug.initSingleton();
-        QUERY_EGL_ES_NATIVE_TK = Debug.isPropertyDefined("jogl.debug.EGLDrawableFactory.QueryNativeTK", true);
+        QUERY_EGL_ES_NATIVE_TK = PropertyAccess.isPropertyDefined("jogl.debug.EGLDrawableFactory.QueryNativeTK", true);
     }
 
     private static GLDynamicLookupHelper eglES1DynamicLookupHelper = null;
     private static GLDynamicLookupHelper eglES2DynamicLookupHelper = null;
 
-    private static final boolean isANGLE(GLDynamicLookupHelper dl) {
-        if(Platform.OSType.WINDOWS == Platform.OS_TYPE) {
+    private static final boolean isANGLE(final GLDynamicLookupHelper dl) {
+        if(Platform.OSType.WINDOWS == PlatformPropsImpl.OS_TYPE) {
             return dl.isFunctionAvailable("eglQuerySurfacePointerANGLE") ||
                    dl.isFunctionAvailable("glBlitFramebufferANGLE") ||
                    dl.isFunctionAvailable("glRenderbufferStorageMultisampleANGLE");
@@ -104,7 +106,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         }
     }
 
-    private static final boolean includesES1(GLDynamicLookupHelper dl) {
+    private static final boolean includesES1(final GLDynamicLookupHelper dl) {
         return dl.isFunctionAvailable("glLoadIdentity") &&
                dl.isFunctionAvailable("glEnableClientState") &&
                dl.isFunctionAvailable("glColorPointer");
@@ -122,7 +124,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
             hasX11 = true;
             try {
                 ReflectionUtil.createInstance("jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory", EGLDrawableFactory.class.getClassLoader());
-            } catch (Exception jre) { /* n/a .. */ }
+            } catch (final Exception jre) { /* n/a .. */ }
         }
 
         // FIXME: Probably need to move EGL from a static model
@@ -136,7 +138,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                 GLDynamicLookupHelper tmp=null;
                 try {
                     tmp = new GLDynamicLookupHelper(new EGLES1DynamicLibraryBundleInfo());
-                } catch (GLException gle) {
+                } catch (final GLException gle) {
                     if(DEBUG) {
                         gle.printStackTrace();
                     }
@@ -157,7 +159,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                 GLDynamicLookupHelper tmp=null;
                 try {
                     tmp = new GLDynamicLookupHelper(new EGLES2DynamicLibraryBundleInfo());
-                } catch (GLException gle) {
+                } catch (final GLException gle) {
                     if(DEBUG) {
                         gle.printStackTrace();
                     }
@@ -182,7 +184,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                 }
             }
             if( null != eglES2DynamicLookupHelper || null != eglES1DynamicLookupHelper ) {
-                if(isANGLE && !enableANGLE) {
+                if(isANGLE && !GLProfile.enableANGLE) {
                     if(DEBUG || GLProfile.DEBUG) {
                         System.err.println("Info: EGLDrawableFactory.init - EGL/ES2 ANGLE disabled");
                     }
@@ -214,9 +216,9 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
             if(DEBUG) {
                 dumpMap();
             }
-            Collection<SharedResource> srl = sharedMap.values();
-            for(Iterator<SharedResource> sri = srl.iterator(); sri.hasNext(); ) {
-                SharedResource sr = sri.next();
+            final Collection<SharedResource> srl = sharedMap.values();
+            for(final Iterator<SharedResource> sri = srl.iterator(); sri.hasNext(); ) {
+                final SharedResource sr = sri.next();
                 if(DEBUG) {
                     System.err.println("EGLDrawableFactory.shutdown: "+sr.device.toString());
                 }
@@ -253,10 +255,10 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         synchronized(sharedMap) {
             System.err.println("EGLDrawableFactory.map "+sharedMap.size());
             int i=0;
-            Set<String> keys = sharedMap.keySet();
-            for(Iterator<String> keyI = keys.iterator(); keyI.hasNext(); i++) {
-                String key = keyI.next();
-                SharedResource sr = sharedMap.get(key);
+            final Set<String> keys = sharedMap.keySet();
+            for(final Iterator<String> keyI = keys.iterator(); keyI.hasNext(); i++) {
+                final String key = keyI.next();
+                final SharedResource sr = sharedMap.get(key);
                 System.err.println("EGLDrawableFactory.map["+i+"] "+key+" -> "+sr.getDevice()+", "+
                                    "es1   [avail "+sr.wasES1ContextCreated+", pbuffer "+sr.hasPBufferES1+", quirks "+sr.rendererQuirksES1+", ctp "+EGLContext.getGLVersion(1, 0, sr.ctpES1, null)+"], "+
                                    "es2/3 [es2 "+sr.wasES2ContextCreated+", es3 "+sr.wasES3ContextCreated+", [pbuffer "+sr.hasPBufferES3ES2+", quirks "+sr.rendererQuirksES3ES2+", ctp "+EGLContext.getGLVersion(2, 0, sr.ctpES3ES2, null)+"]]");
@@ -287,10 +289,10 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
       private final boolean hasPBufferES1;
       private final boolean hasPBufferES3ES2;
 
-      SharedResource(EGLGraphicsDevice dev,
-                     boolean wasContextES1Created, boolean hasPBufferES1, GLRendererQuirks rendererQuirksES1, int ctpES1,
-                     boolean wasContextES2Created, boolean wasContextES3Created,
-                     boolean hasPBufferES3ES2, GLRendererQuirks rendererQuirksES3ES2, int ctpES3ES2) {
+      SharedResource(final EGLGraphicsDevice dev,
+                     final boolean wasContextES1Created, final boolean hasPBufferES1, final GLRendererQuirks rendererQuirksES1, final int ctpES1,
+                     final boolean wasContextES2Created, final boolean wasContextES3Created,
+                     final boolean hasPBufferES3ES2, final GLRendererQuirks rendererQuirksES3ES2, final int ctpES3ES2) {
           this.device = dev;
           // this.contextES1 = ctxES1;
           this.wasES1ContextCreated = wasContextES1Created;
@@ -340,12 +342,12 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
     }
 
     @Override
-    public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
+    public final boolean getIsDeviceCompatible(final AbstractGraphicsDevice device) {
       // via mappings (X11/WGL/.. -> EGL) we shall be able to handle all types.
       return null != sharedMap ; // null!=eglES2DynamicLookupHelper || null!=eglES1DynamicLookupHelper;
     }
 
-    private static List<GLCapabilitiesImmutable> getAvailableEGLConfigs(EGLGraphicsDevice eglDisplay, GLCapabilitiesImmutable caps) {
+    private static List<GLCapabilitiesImmutable> getAvailableEGLConfigs(final EGLGraphicsDevice eglDisplay, final GLCapabilitiesImmutable caps) {
         final IntBuffer numConfigs = Buffers.newDirectIntBuffer(1);
         if(!EGL.eglGetConfigs(eglDisplay.getHandle(), null, 0, numConfigs)) {
             throw new GLException("EGLDrawableFactory.getAvailableEGLConfigs: Get maxConfigs (eglGetConfigs) call failed, error "+EGLContext.toHexString(EGL.eglGetError()));
@@ -368,8 +370,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         System.err.println(prefix+"EGL vendor "+eglVendor+", version "+eglVersion+", clientAPIs "+eglClientAPIs);
     }
 
-    private boolean mapAvailableEGLESConfig(AbstractGraphicsDevice adevice, int[] esProfile,
-                                            boolean[] hasPBuffer, GLRendererQuirks[] rendererQuirks, int[] ctp) {
+    private boolean mapAvailableEGLESConfig(final AbstractGraphicsDevice adevice, final int[] esProfile,
+                                            final boolean[] hasPBuffer, final GLRendererQuirks[] rendererQuirks, final int[] ctp) {
         final String profileString;
         switch( esProfile[0] ) {
             case 3:
@@ -379,7 +381,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
             case 1:
                 profileString = GLProfile.GLES1; break;
             default:
-                throw new GLException("Invalid ES profile number "+esProfile);
+                throw new GLException("Invalid ES profile number "+esProfile[0]);
         }
         if ( !GLProfile.isAvailable(adevice, profileString) ) {
             if( DEBUG ) {
@@ -393,7 +395,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         final boolean mapsADeviceToDefaultDevice = !QUERY_EGL_ES_NATIVE_TK || initDefaultDevice ||
                                                    null == desktopFactory || adevice instanceof EGLGraphicsDevice ;
         if( DEBUG ) {
-            System.err.println("EGLDrawableFactory.mapAvailableEGLESConfig: "+profileString+" ( "+esProfile+" ), "+
+            System.err.println("EGLDrawableFactory.mapAvailableEGLESConfig: "+profileString+" ( "+esProfile[0]+" ), "+
                                "defaultSharedResourceSet "+(null!=defaultSharedResource)+", mapsADeviceToDefaultDevice "+mapsADeviceToDefaultDevice+
                                " (QUERY_EGL_ES_NATIVE_TK "+QUERY_EGL_ES_NATIVE_TK+", hasDesktopFactory "+(null != desktopFactory)+
                                ", isEGLGraphicsDevice "+(adevice instanceof EGLGraphicsDevice)+")");
@@ -476,8 +478,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                     downstreamSurface = createDummySurfaceImpl(defaultDevice, false, reqCapsPBuffer, reqCapsPBuffer, null, 64, 64); // egl pbuffer offscreen
                     if( null != downstreamSurface ) {
                         downstreamSurface.createNotify();
+                        surface = downstreamSurface;
                     }
-                    surface = downstreamSurface;
                 } else {
                     // 3rd case fake creation of defaultDevice shared resource, no pbuffer available
                     final List<GLCapabilitiesImmutable> capsAnyL = getAvailableEGLConfigs(defaultDevice, reqCapsAny);
@@ -497,14 +499,14 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                 upstreamSurface = desktopFactory.createDummySurface(adevice, reqCapsAny, null, 64, 64); // X11, WGL, .. dummy window
                 if(null != upstreamSurface) {
                     upstreamSurface.createNotify();
+                    eglDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(upstreamSurface);
+                    eglDevice.open();
+                    if( DEBUG ) {
+                        dumpEGLInfo("EGLDrawableFactory.mapAvailableEGLESConfig: ", eglDevice.getHandle());
+                    }
+                    hasPBuffer[0] = true;
+                    surface = upstreamSurface;
                 }
-                surface = upstreamSurface;
-                eglDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(surface);
-                eglDevice.open();
-                if( DEBUG ) {
-                    dumpEGLInfo("EGLDrawableFactory.mapAvailableEGLESConfig: ", eglDevice.getHandle());
-                }
-                hasPBuffer[0] = true;
             }
 
             if(null != surface) {
@@ -532,7 +534,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                                 }
                             }
                         }
-                    } catch (Throwable t) {
+                    } catch (final Throwable t) {
                         if (DEBUG) {
                             System.err.println("EGLDrawableFactory.mapAvailableEGLESConfig: INFO: context create/makeCurrent failed");
                             t.printStackTrace();
@@ -543,9 +545,9 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
                 }
                 drawable.setRealized(false);
             }
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             if(DEBUG) {
-                System.err.println("Catched Exception on thread "+getThreadName());
+                System.err.println("Caught exception on thread "+getThreadName());
                 t.printStackTrace();
             }
             success = false;
@@ -565,7 +567,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         return success;
     }
 
-    private final boolean needsToCreateSharedResource(String key, SharedResource[] existing) {
+    private final boolean needsToCreateSharedResource(final String key, final SharedResource[] existing) {
         synchronized(sharedMap) {
             final SharedResource sr = sharedMap.get(key);
             if( null == sr ) {
@@ -584,7 +586,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
     }
 
     @Override
-    protected final SharedResource getOrCreateSharedResourceImpl(AbstractGraphicsDevice adevice) {
+    protected final SharedResource getOrCreateSharedResourceImpl(final AbstractGraphicsDevice adevice) {
         if(null == sharedMap) { // null == eglES1DynamicLookupHelper && null == eglES2DynamicLookupHelper
             return null;
         }
@@ -617,16 +619,16 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         }
     }
 
-    private SharedResource createEGLSharedResourceImpl(AbstractGraphicsDevice adevice) {
+    private SharedResource createEGLSharedResourceImpl(final AbstractGraphicsDevice adevice) {
         final boolean madeCurrentES1;
-        boolean[] hasPBufferES1 = new boolean[] { false };
-        boolean[] hasPBufferES3ES2 = new boolean[] { false };
+        final boolean[] hasPBufferES1 = new boolean[] { false };
+        final boolean[] hasPBufferES3ES2 = new boolean[] { false };
         // EGLContext[] eglCtxES1 = new EGLContext[] { null };
         // EGLContext[] eglCtxES2 = new EGLContext[] { null };
-        GLRendererQuirks[] rendererQuirksES1 = new GLRendererQuirks[] { null };
-        GLRendererQuirks[] rendererQuirksES3ES2 = new GLRendererQuirks[] { null };
-        int[] ctpES1 = new int[] { -1 };
-        int[] ctpES3ES2 = new int[] { -1 };
+        final GLRendererQuirks[] rendererQuirksES1 = new GLRendererQuirks[] { null };
+        final GLRendererQuirks[] rendererQuirksES3ES2 = new GLRendererQuirks[] { null };
+        final int[] ctpES1 = new int[] { -1 };
+        final int[] ctpES3ES2 = new int[] { -1 };
 
 
         if (DEBUG) {
@@ -682,7 +684,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         return sr;
     }
 
-    private void handleDontCloseX11DisplayQuirk(GLRendererQuirks quirks) {
+    private void handleDontCloseX11DisplayQuirk(final GLRendererQuirks quirks) {
         if( null != quirks && quirks.exist( GLRendererQuirks.DontCloseX11Display ) ) {
             jogamp.nativewindow.x11.X11Util.markAllDisplaysUnclosable();
         }
@@ -698,7 +700,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
     }
 
     @Override
-    public GLDynamicLookupHelper getGLDynamicLookupHelper(int esProfile) {
+    public GLDynamicLookupHelper getGLDynamicLookupHelper(final int esProfile) {
         if ( 2==esProfile || 3==esProfile ) {
             return eglES2DynamicLookupHelper;
         } else if (1==esProfile) {
@@ -709,7 +711,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
     }
 
     @Override
-    protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(AbstractGraphicsDevice device) {
+    protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(final AbstractGraphicsDevice device) {
         if(null == sharedMap) { // null == eglES1DynamicLookupHelper && null == eglES2DynamicLookupHelper
             return new ArrayList<GLCapabilitiesImmutable>(); // null
         }
@@ -717,7 +719,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
     }
 
     @Override
-    protected GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
+    protected GLDrawableImpl createOnscreenDrawableImpl(final NativeSurface target) {
         if (target == null) {
           throw new IllegalArgumentException("Null target");
         }
@@ -725,12 +727,12 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
     }
 
     @Override
-    protected GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
+    protected GLDrawableImpl createOffscreenDrawableImpl(final NativeSurface target) {
         if (target == null) {
           throw new IllegalArgumentException("Null target");
         }
-        AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
-        GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+        final AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
+        final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
         if(!caps.isPBuffer()) {
             throw new GLException("Non pbuffer not yet implemented");
         }
@@ -739,16 +741,16 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
     }
 
     @Override
-    public boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp) {
+    public boolean canCreateGLPbuffer(final AbstractGraphicsDevice device, final GLProfile glp) {
         // SharedResource sr = getOrCreateEGLSharedResource(device);
         // return sr.hasES1PBuffer() || sr.hasES2PBuffer();
         return true;
     }
 
     @Override
-    protected ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
-                                                    GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
-                                                    GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
+    protected ProxySurface createMutableSurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+                                                    final GLCapabilitiesImmutable capsChosen, final GLCapabilitiesImmutable capsRequested,
+                                                    final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstreamHook) {
         final boolean ownDevice;
         final EGLGraphicsDevice device;
         if( createNewDevice || ! (deviceReq instanceof EGLGraphicsDevice) ) {
@@ -770,8 +772,8 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
     }
 
     @Override
-    public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
-                                                     GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
+    public final ProxySurface createDummySurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+                                                     GLCapabilitiesImmutable chosenCaps, final GLCapabilitiesImmutable requestedCaps, final GLCapabilitiesChooser chooser, final int width, final int height) {
         chosenCaps = GLGraphicsConfigurationUtil.fixGLPBufferGLCapabilities(chosenCaps); // complete validation in EGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(..) above
         return createMutableSurfaceImpl(deviceReq, createNewDevice, chosenCaps, requestedCaps, chooser, new EGLDummyUpstreamSurfaceHook(width, height));
     }
@@ -782,10 +784,10 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
      * @param useTexture
      * @return the passed {@link MutableSurface} which now has the EGL pbuffer surface set as it's handle
      */
-    protected static MutableSurface createPBufferSurfaceImpl(MutableSurface ms, boolean useTexture) {
+    protected static MutableSurface createPBufferSurfaceImpl(final MutableSurface ms, final boolean useTexture) {
         return null;
     }
-    protected static long createPBufferSurfaceImpl(EGLGraphicsConfiguration config, int width, int height, boolean useTexture) {
+    protected static long createPBufferSurfaceImpl(final EGLGraphicsConfiguration config, final int width, final int height, final boolean useTexture) {
         final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) config.getScreen().getDevice();
         final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
         final int texFormat;
@@ -811,7 +813,7 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
     }
 
     @Override
-    protected ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
+    protected ProxySurface createProxySurfaceImpl(final AbstractGraphicsDevice deviceReq, final int screenIdx, final long windowHandle, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstream) {
         final EGLGraphicsDevice eglDeviceReq = (EGLGraphicsDevice) deviceReq;
         final EGLGraphicsDevice device = EGLDisplayUtil.eglCreateEGLGraphicsDevice(eglDeviceReq.getNativeDisplayID(), deviceReq.getConnection(), deviceReq.getUnitID());
         device.open();
@@ -822,12 +824,12 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
 
     @Override
     protected GLContext createExternalGLContextImpl() {
-        AbstractGraphicsScreen absScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_EGL);
+        final AbstractGraphicsScreen absScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_EGL);
         return new EGLExternalContext(absScreen);
     }
 
     @Override
-    public boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
+    public boolean canCreateExternalGLDrawable(final AbstractGraphicsDevice device) {
         return false;
     }
 
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java b/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java
index 818f326..f00d705 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDummyUpstreamSurfaceHook.java
@@ -10,19 +10,19 @@ import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
 /** Uses a PBuffer offscreen surface */
 public class EGLDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize {
     /**
-     * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)},
+     * @param width the initial width as returned by {@link NativeSurface#getSurfaceWidth()} via {@link UpstreamSurfaceHook#getSurfaceWidth(ProxySurface)},
      *        not the actual dummy surface width.
      *        The latter is platform specific and small
-     * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)},
+     * @param height the initial height as returned by {@link NativeSurface#getSurfaceHeight()} via {@link UpstreamSurfaceHook#getSurfaceHeight(ProxySurface)},
      *        not the actual dummy surface height,
      *        The latter is platform specific and small
      */
-    public EGLDummyUpstreamSurfaceHook(int width, int height) {
+    public EGLDummyUpstreamSurfaceHook(final int width, final int height) {
         super(width, height);
     }
 
     @Override
-    public final void create(ProxySurface s) {
+    public final void create(final ProxySurface s) {
         final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) s.getGraphicsConfiguration().getScreen().getDevice();
         eglDevice.lock();
         try {
@@ -41,7 +41,7 @@ public class EGLDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
     }
 
     @Override
-    public final void destroy(ProxySurface s) {
+    public final void destroy(final ProxySurface s) {
         if( s.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
             final EGLGraphicsDevice eglDevice = (EGLGraphicsDevice) s.getGraphicsConfiguration().getScreen().getDevice();
             if( EGL.EGL_NO_SURFACE == s.getSurfaceHandle() ) {
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
index ebe8f49..05dae0b 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDynamicLibraryBundleInfo.java
@@ -33,6 +33,7 @@ import com.jogamp.common.os.Platform;
 
 import java.util.*;
 
+import jogamp.common.os.PlatformPropsImpl;
 import jogamp.opengl.*;
 
 /**
@@ -61,7 +62,7 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
      */
     @Override
     public final boolean shallLookupGlobal() {
-        if ( Platform.OSType.ANDROID == Platform.OS_TYPE ) {
+        if ( Platform.OSType.ANDROID == PlatformPropsImpl.OS_TYPE ) {
             // Android requires global symbol lookup
             return true;
         }
@@ -71,18 +72,18 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
 
     @Override
     public final List<String> getToolGetProcAddressFuncNameList() {
-        List<String> res = new ArrayList<String>();
+        final List<String> res = new ArrayList<String>();
         res.add("eglGetProcAddress");
         return res;
     }
 
     @Override
-    public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+    public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
         return EGL.eglGetProcAddress(toolGetProcAddressHandle, funcName);
     }
 
     @Override
-    public final boolean useToolGetProcAdressFirst(String funcName) {
+    public final boolean useToolGetProcAdressFirst(final String funcName) {
         if ( AndroidVersion.isAvailable ) {
             // Android requires global dlsym lookup
             return false;
@@ -92,7 +93,7 @@ public abstract class EGLDynamicLibraryBundleInfo extends GLDynamicLibraryBundle
     }
 
     protected final List<String> getEGLLibNamesList() {
-        List<String> eglLibNames = new ArrayList<String>();
+        final List<String> eglLibNames = new ArrayList<String>();
 
         // this is the default EGL lib name, according to the spec
         eglLibNames.add("libEGL.so.1");
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java b/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java
index aff18fc..babea42 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLExternalContext.java
@@ -43,7 +43,7 @@ import javax.media.nativewindow.*;
 
 public class EGLExternalContext extends EGLContext {
 
-    public EGLExternalContext(AbstractGraphicsScreen screen) {
+    public EGLExternalContext(final AbstractGraphicsScreen screen) {
         super(null, null);
         GLContextShareSet.contextCreated(this);
         if( !setGLFunctionAvailability(false, 0, 0, CTX_PROFILE_ES, false /* strictMatch */, false /* withinGLVersionsMapping */) ) { // use GL_VERSION
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java b/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
index e28b532..a8dd7d5 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGLCapabilities.java
@@ -52,7 +52,7 @@ public class EGLGLCapabilities extends GLCapabilities {
    *
    * May throw GLException if given GLProfile is not compatible w/ renderableType
    */
-  public EGLGLCapabilities(long eglcfg, int eglcfgid, int visualID, GLProfile glp, int renderableType) {
+  public EGLGLCapabilities(final long eglcfg, final int eglcfgid, final int visualID, final GLProfile glp, final int renderableType) {
       super( glp );
       this.eglcfg = eglcfg;
       this.eglcfgid = eglcfgid;
@@ -73,19 +73,19 @@ public class EGLGLCapabilities extends GLCapabilities {
   public Object clone() {
     try {
       return super.clone();
-    } catch (RuntimeException e) {
+    } catch (final RuntimeException e) {
       throw new GLException(e);
     }
   }
 
-  final protected void setEGLConfig(long v) { eglcfg=v; }
+  final protected void setEGLConfig(final long v) { eglcfg=v; }
   final public long getEGLConfig() { return eglcfg; }
   final public int getEGLConfigID() { return eglcfgid; }
   final public int getRenderableType() { return renderableType; }
   final public int getNativeVisualID() { return nativeVisualID; }
 
   @Override
-  final public int getVisualID(VIDType type) throws NativeWindowException {
+  final public int getVisualID(final VIDType type) throws NativeWindowException {
       switch(type) {
           case INTRINSIC:
           case EGL_CONFIG:
@@ -97,7 +97,7 @@ public class EGLGLCapabilities extends GLCapabilities {
       }
   }
 
-  public static boolean isCompatible(GLProfile glp, int renderableType) {
+  public static boolean isCompatible(final GLProfile glp, final int renderableType) {
     if(null == glp) {
         return true;
     }
@@ -116,7 +116,7 @@ public class EGLGLCapabilities extends GLCapabilities {
     return false;
   }
 
-  public static GLProfile getCompatible(EGLGraphicsDevice device, int renderableType) {
+  public static GLProfile getCompatible(final EGLGraphicsDevice device, final int renderableType) {
     if(0 != (renderableType & EGLExt.EGL_OPENGL_ES3_BIT_KHR) && GLProfile.isAvailable(device, GLProfile.GLES3)) {
         return GLProfile.get(device, GLProfile.GLES3);
     }
@@ -132,7 +132,7 @@ public class EGLGLCapabilities extends GLCapabilities {
     return null;
   }
 
-  public static StringBuilder renderableTypeToString(StringBuilder sink, int renderableType) {
+  public static StringBuilder renderableTypeToString(StringBuilder sink, final int renderableType) {
     if(null == sink) {
         sink = new StringBuilder();
     }
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
index 88ed0be..1d90e63 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfiguration.java
@@ -72,8 +72,8 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
         return ((EGLGLCapabilities)capabilitiesChosen).getEGLConfigID();
     }
 
-    EGLGraphicsConfiguration(AbstractGraphicsScreen absScreen,
-                             EGLGLCapabilities capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+    EGLGraphicsConfiguration(final AbstractGraphicsScreen absScreen,
+                             final EGLGLCapabilities capsChosen, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser) {
         super(absScreen, capsChosen, capsRequested);
         this.chooser = chooser;
     }
@@ -85,7 +85,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
      * @return
      * @throws GLException if invalid EGL display.
      */
-    public static EGLGraphicsConfiguration create(GLCapabilitiesImmutable capsRequested, AbstractGraphicsScreen absScreen, int eglConfigID) {
+    public static EGLGraphicsConfiguration create(final GLCapabilitiesImmutable capsRequested, final AbstractGraphicsScreen absScreen, final int eglConfigID) {
         final AbstractGraphicsDevice absDevice = absScreen.getDevice();
         if(null==absDevice || !(absDevice instanceof EGLGraphicsDevice)) {
             throw new GLException("GraphicsDevice must be a valid EGLGraphicsDevice");
@@ -110,8 +110,8 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
     }
 
     void updateGraphicsConfiguration() {
-        CapabilitiesImmutable capsChosen = getChosenCapabilities();
-        EGLGraphicsConfiguration newConfig = (EGLGraphicsConfiguration)
+        final CapabilitiesImmutable capsChosen = getChosenCapabilities();
+        final EGLGraphicsConfiguration newConfig = (EGLGraphicsConfiguration)
             GraphicsConfigurationFactory.getFactory(getScreen().getDevice(), capsChosen).chooseGraphicsConfiguration(
                 capsChosen, getRequestedCapabilities(), chooser, getScreen(), VisualIDHolder.VID_UNDEFINED);
         if(null!=newConfig) {
@@ -123,7 +123,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
         }
     }
 
-    public static long EGLConfigId2EGLConfig(long display, int configID) {
+    public static long EGLConfigId2EGLConfig(final long display, final int configID) {
         final IntBuffer attrs = Buffers.newDirectIntBuffer(new int[] {
                 EGL.EGL_CONFIG_ID, configID,
                 EGL.EGL_NONE
@@ -142,7 +142,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
         return configs.get(0);
     }
 
-    public static boolean isEGLConfigValid(long display, long config) {
+    public static boolean isEGLConfigValid(final long display, final long config) {
         if(0 == config) {
             return false;
         }
@@ -190,8 +190,8 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
      * @param forceTransparentFlag
      * @return
      */
-    public static EGLGLCapabilities EGLConfig2Capabilities(GLRendererQuirks defaultQuirks, EGLGraphicsDevice device, GLProfile glp,
-                                                           long config, int winattrmask, boolean forceTransparentFlag) {
+    public static EGLGLCapabilities EGLConfig2Capabilities(final GLRendererQuirks defaultQuirks, final EGLGraphicsDevice device, GLProfile glp,
+                                                           final long config, final int winattrmask, final boolean forceTransparentFlag) {
         final long display = device.getHandle();
         final int cfgID;
         final int rType;
@@ -267,7 +267,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
                 return null;
             }
             caps = new EGLGLCapabilities(config, cfgID, visualID, glp, rType);
-        } catch (GLException gle) {
+        } catch (final GLException gle) {
             if(DEBUG) {
                 System.err.println("config "+toHexString(config)+": "+gle);
             }
@@ -381,7 +381,7 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
         return (EGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, caps);
     }
 
-    public static IntBuffer GLCapabilities2AttribList(GLCapabilitiesImmutable caps) {
+    public static IntBuffer GLCapabilities2AttribList(final GLCapabilitiesImmutable caps) {
         final IntBuffer attrs = Buffers.newDirectIntBuffer(32);
         int idx=0;
 
@@ -480,8 +480,8 @@ public class EGLGraphicsConfiguration extends MutableGraphicsConfiguration imple
         return attrs;
     }
 
-    public static IntBuffer CreatePBufferSurfaceAttribList(int width, int height, int texFormat) {
-        IntBuffer attrs = Buffers.newDirectIntBuffer(16);
+    public static IntBuffer CreatePBufferSurfaceAttribList(final int width, final int height, final int texFormat) {
+        final IntBuffer attrs = Buffers.newDirectIntBuffer(16);
         int idx=0;
 
         attrs.put(idx++, EGL.EGL_WIDTH);
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
index 5cfa378..d4e5e7d 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLGraphicsConfigurationFactory.java
@@ -77,7 +77,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
     static GraphicsConfigurationFactory fallbackGraphicsConfigurationFactory = null;
 
     static void registerFactory() {
-        GraphicsConfigurationFactory eglFactory = new EGLGraphicsConfigurationFactory();
+        final GraphicsConfigurationFactory eglFactory = new EGLGraphicsConfigurationFactory();
 
         // become the pre-selector for X11/.. to match the native visual id w/ EGL, if native ES is selected
         final String nwType = NativeWindowFactory.getNativeWindowType(false);
@@ -117,8 +117,8 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
 
     @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl (
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+            final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+            final CapabilitiesChooser chooser, final AbstractGraphicsScreen absScreen, final int nativeVisualID) {
         if (absScreen == null) {
             throw new IllegalArgumentException("This NativeWindowFactory accepts only AbstractGraphicsDevice objects");
         }
@@ -137,7 +137,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
             throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
         }
 
-        AbstractGraphicsDevice absDevice = absScreen.getDevice();
+        final AbstractGraphicsDevice absDevice = absScreen.getDevice();
         if(null==absDevice) {
             throw new GLException("Null AbstractGraphicsDevice");
         }
@@ -181,7 +181,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
         return cfg;
     }
 
-    protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(EGLDrawableFactory factory, AbstractGraphicsDevice device) {
+    protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(final EGLDrawableFactory factory, final AbstractGraphicsDevice device) {
         final EGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
         if(null == sharedResource) {
             throw new GLException("Shared resource for device n/a: "+device);
@@ -192,7 +192,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
             throw new GLException("null eglDisplay");
         }
         List<GLCapabilitiesImmutable> availableCaps = null;
-        IntBuffer numConfigs = Buffers.newDirectIntBuffer(1);
+        final IntBuffer numConfigs = Buffers.newDirectIntBuffer(1);
 
         if(!EGL.eglGetConfigs(eglDisplay, null, 0, numConfigs)) {
             throw new GLException("Graphics configuration get maxConfigs (eglGetConfigs) call failed, error "+toHexString(EGL.eglGetError()));
@@ -201,7 +201,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
             throw new GLException("Graphics configuration get maxConfigs (eglGetConfigs) no configs");
         }
 
-        PointerBuffer configs = PointerBuffer.allocateDirect(numConfigs.get(0));
+        final PointerBuffer configs = PointerBuffer.allocateDirect(numConfigs.get(0));
 
         if(!EGL.eglGetConfigs(eglDisplay, configs, configs.capacity(), numConfigs)) {
             throw new GLException("Graphics configuration get all configs (eglGetConfigs) call failed, error "+toHexString(EGL.eglGetError()));
@@ -216,10 +216,10 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
     }
 
     public static EGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
-                                                                             GLCapabilitiesImmutable capsReq,
-                                                                             GLCapabilitiesChooser chooser,
-                                                                             AbstractGraphicsScreen absScreen, int nativeVisualID,
-                                                                             boolean forceTransparentFlag) {
+                                                                             final GLCapabilitiesImmutable capsReq,
+                                                                             final GLCapabilitiesChooser chooser,
+                                                                             final AbstractGraphicsScreen absScreen, final int nativeVisualID,
+                                                                             final boolean forceTransparentFlag) {
         if (capsChosen == null) {
             capsChosen = new GLCapabilities(null);
         }
@@ -227,7 +227,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
         if(null==absScreen) {
             throw new GLException("Null AbstractGraphicsScreen");
         }
-        AbstractGraphicsDevice absDevice = absScreen.getDevice();
+        final AbstractGraphicsDevice absDevice = absScreen.getDevice();
         if(null==absDevice) {
             throw new GLException("Null AbstractGraphicsDevice");
         }
@@ -323,18 +323,17 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
     }
 
 
-    static EGLGraphicsConfiguration eglChooseConfig(EGLGraphicsDevice device,
-                                                    GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
-                                                    GLCapabilitiesChooser chooser,
-                                                    AbstractGraphicsScreen absScreen,
-                                                    int nativeVisualID, boolean forceTransparentFlag) {
+    static EGLGraphicsConfiguration eglChooseConfig(final EGLGraphicsDevice device,
+                                                    final GLCapabilitiesImmutable capsChosen, final GLCapabilitiesImmutable capsRequested,
+                                                    final GLCapabilitiesChooser chooser,
+                                                    final AbstractGraphicsScreen absScreen,
+                                                    final int nativeVisualID, final boolean forceTransparentFlag) {
         final long eglDisplay = device.getHandle();
         final GLProfile glp = capsChosen.getGLProfile();
         final int winattrmask = GLGraphicsConfigurationUtil.getExclusiveWinAttributeBits(capsChosen);
         List<GLCapabilitiesImmutable> availableCaps = null;
         int recommendedIndex = -1;
-        long recommendedEGLConfig = -1;
-        IntBuffer numConfigs = Buffers.newDirectIntBuffer(1);
+        final IntBuffer numConfigs = Buffers.newDirectIntBuffer(1);
 
         if(!EGL.eglGetConfigs(eglDisplay, null, 0, numConfigs)) {
             throw new GLException("EGLGraphicsConfiguration.eglChooseConfig: Get maxConfigs (eglGetConfigs) call failed, error "+toHexString(EGL.eglGetError()));
@@ -353,7 +352,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
         }
 
         final IntBuffer attrs = EGLGraphicsConfiguration.GLCapabilities2AttribList(capsChosen);
-        PointerBuffer configs = PointerBuffer.allocateDirect(numConfigs.get(0));
+        final PointerBuffer configs = PointerBuffer.allocateDirect(numConfigs.get(0));
 
         // 1st choice: get GLCapabilities based on users GLCapabilities
         //             setting recommendedIndex as preferred choice
@@ -380,7 +379,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
         if( hasEGLChosenCaps ) {
             availableCaps = eglConfigs2GLCaps(device, glp, configs, numConfigs.get(0), winattrmask, forceTransparentFlag, skipCapsChooser /* onlyFirsValid */);
             if(availableCaps.size() > 0) {
-                recommendedEGLConfig =  configs.get(0);
+                final long recommendedEGLConfig =  configs.get(0);
                 recommendedIndex = 0;
                 if (DEBUG) {
                     System.err.println("EGLGraphicsConfiguration.eglChooseConfig: #1 eglChooseConfig: recommended fbcfg " + toHexString(recommendedEGLConfig) + ", idx " + recommendedIndex);
@@ -399,7 +398,6 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
         // 2nd choice: get all GLCapabilities available, no preferred recommendedIndex available
         if( null == availableCaps || 0 == availableCaps.size() ) {
             // reset ..
-            recommendedEGLConfig = -1;
             recommendedIndex = -1;
 
             if(!EGL.eglGetConfigs(eglDisplay, configs, configs.capacity(), numConfigs)) {
@@ -428,7 +426,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
         }
 
         if( VisualIDHolder.VID_UNDEFINED != nativeVisualID ) { // implies !hasEGLChosenCaps
-            List<GLCapabilitiesImmutable> removedCaps = new ArrayList<GLCapabilitiesImmutable>();
+            final List<GLCapabilitiesImmutable> removedCaps = new ArrayList<GLCapabilitiesImmutable>();
             for(int i=0; i<availableCaps.size(); ) {
                 final GLCapabilitiesImmutable aCap = availableCaps.get(i);
                 if(aCap.getVisualID(VIDType.NATIVE) != nativeVisualID) {
@@ -475,9 +473,9 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
         return res;
     }
 
-    static List<GLCapabilitiesImmutable> eglConfigs2GLCaps(EGLGraphicsDevice device, GLProfile glp, PointerBuffer configs, int num, int winattrmask, boolean forceTransparentFlag, boolean onlyFirstValid) {
+    static List<GLCapabilitiesImmutable> eglConfigs2GLCaps(final EGLGraphicsDevice device, final GLProfile glp, final PointerBuffer configs, final int num, final int winattrmask, final boolean forceTransparentFlag, final boolean onlyFirstValid) {
         final GLRendererQuirks defaultQuirks = GLRendererQuirks.getStickyDeviceQuirks( GLDrawableFactory.getEGLFactory().getDefaultDevice() );
-        List<GLCapabilitiesImmutable> bucket = new ArrayList<GLCapabilitiesImmutable>(num);
+        final List<GLCapabilitiesImmutable> bucket = new ArrayList<GLCapabilitiesImmutable>(num);
         for(int i=0; i<num; i++) {
             final GLCapabilitiesImmutable caps = EGLGraphicsConfiguration.EGLConfig2Capabilities(defaultQuirks, device, glp, configs.get(i), winattrmask, forceTransparentFlag);
             if(null != caps) {
@@ -490,7 +488,7 @@ public class EGLGraphicsConfigurationFactory extends GLGraphicsConfigurationFact
         return bucket;
     }
 
-    static void printCaps(String prefix, List<GLCapabilitiesImmutable> caps, PrintStream out) {
+    static void printCaps(final String prefix, final List<GLCapabilitiesImmutable> caps, final PrintStream out) {
         for(int i=0; i<caps.size(); i++) {
             out.println(prefix+"["+i+"] "+caps.get(i));
         }
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java
index 065f80d..4c018fe 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLOnscreenDrawable.java
@@ -44,17 +44,17 @@ import javax.media.opengl.*;
 import javax.media.nativewindow.*;
 
 public class EGLOnscreenDrawable extends EGLDrawable {
-    protected EGLOnscreenDrawable(EGLDrawableFactory factory, NativeSurface component) throws GLException {
+    protected EGLOnscreenDrawable(final EGLDrawableFactory factory, final NativeSurface component) throws GLException {
         super(factory, component);
     }
 
     @Override
-    public GLContext createContext(GLContext shareWith) {
+    public GLContext createContext(final GLContext shareWith) {
         return new EGLContext(this, shareWith);
     }
 
     @Override
-    protected long createSurface(EGLGraphicsConfiguration config, int width, int height, long nativeSurfaceHandle) {
+    protected long createSurface(final EGLGraphicsConfiguration config, final int width, final int height, final long nativeSurfaceHandle) {
         return EGL.eglCreateWindowSurface(config.getScreen().getDevice().getHandle(), config.getNativeConfig(), nativeSurfaceHandle, null);
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLPbufferDrawable.java b/src/jogl/classes/jogamp/opengl/egl/EGLPbufferDrawable.java
index 45e39f5..8842edb 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLPbufferDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLPbufferDrawable.java
@@ -46,17 +46,17 @@ import javax.media.opengl.GLContext;
 public class EGLPbufferDrawable extends EGLDrawable {
     protected static final boolean useTexture = false; // No yet ..
 
-    protected EGLPbufferDrawable(EGLDrawableFactory factory, NativeSurface target) {
+    protected EGLPbufferDrawable(final EGLDrawableFactory factory, final NativeSurface target) {
         super(factory, target);
     }
 
     @Override
-    protected long createSurface(EGLGraphicsConfiguration config, int width, int height, long nativeSurfaceHandle) {
+    protected long createSurface(final EGLGraphicsConfiguration config, final int width, final int height, final long nativeSurfaceHandle) {
         return EGLDrawableFactory.createPBufferSurfaceImpl(config, width, height, false);
     }
 
     @Override
-    public GLContext createContext(GLContext shareWith) {
+    public GLContext createContext(final GLContext shareWith) {
         return new EGLContext(this, shareWith);
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java b/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java
index 5b91157..cc15f0c 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLUpstreamSurfaceHook.java
@@ -17,7 +17,7 @@ import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
  * <pre>
  * EGLWrappedSurface [ is_a -> WrappedSurface -> ProxySurfaceImpl -> ProxySurface -> MutableSurface -> NativeSurface] has_a
  *     EGLUpstreamSurfaceHook [ is_a -> UpstreamSurfaceHook.MutableSize -> UpstreamSurfaceHook ] has_a
- *        NativeSurface (i.e. native X11 surface)
+ *        NativeSurface (e.g. native X11 surface)
  * </pre>
  */
 public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
@@ -25,7 +25,7 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
     private final NativeSurface upstreamSurface;
     private final UpstreamSurfaceHook.MutableSize upstreamSurfaceHookMutableSize;
 
-    public EGLUpstreamSurfaceHook(NativeSurface upstream) {
+    public EGLUpstreamSurfaceHook(final NativeSurface upstream) {
         upstreamSurface = upstream;
         if(upstreamSurface instanceof ProxySurface) {
             final UpstreamSurfaceHook ush = ((ProxySurface)upstreamSurface).getUpstreamSurfaceHook();
@@ -40,19 +40,26 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
         }
     }
 
-    public final NativeSurface getUpstreamSurface() { return upstreamSurface; }
-
     static String getThreadName() { return Thread.currentThread().getName(); }
 
+    /**
+     * {@inheritDoc}
+     * <p>
+     * Returns the actual upstream {@link NativeSurface}, e.g. native X11 surface.
+     * </p>
+     */
     @Override
-    public final void setSize(int width, int height) {
+    public final NativeSurface getUpstreamSurface() { return upstreamSurface; }
+
+    @Override
+    public final void setSurfaceSize(final int width, final int height) {
         if(null != upstreamSurfaceHookMutableSize) {
-            upstreamSurfaceHookMutableSize.setSize(width, height);
+            upstreamSurfaceHookMutableSize.setSurfaceSize(width, height);
         }
     }
 
     @Override
-    public final void create(ProxySurface surface) {
+    public final void create(final ProxySurface surface) {
         final String dbgPrefix;
         if(DEBUG) {
             dbgPrefix = getThreadName() + ": EGLUpstreamSurfaceHook.create( up "+upstreamSurface.getClass().getSimpleName()+" -> this "+surface.getClass().getSimpleName()+" ): ";
@@ -77,7 +84,7 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
         }
     }
 
-    private final void evalUpstreamSurface(String dbgPrefix, ProxySurface surface) {
+    private final void evalUpstreamSurface(final String dbgPrefix, final ProxySurface surface) {
         //
         // evaluate nature of upstreamSurface, may create EGL instances if required
         //
@@ -188,7 +195,7 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
     }
 
     @Override
-    public final void destroy(ProxySurface surface) {
+    public final void destroy(final ProxySurface surface) {
         if(EGLDrawableFactory.DEBUG) {
             System.err.println("EGLUpstreamSurfaceHook.destroy("+surface.getClass().getSimpleName()+"): "+this);
         }
@@ -199,19 +206,29 @@ public class EGLUpstreamSurfaceHook implements UpstreamSurfaceHook.MutableSize {
     }
 
     @Override
-    public final int getWidth(ProxySurface s) {
-        return upstreamSurface.getWidth();
+    public final int getSurfaceWidth(final ProxySurface s) {
+        return upstreamSurface.getSurfaceWidth();
     }
 
     @Override
-    public final int getHeight(ProxySurface s) {
-        return upstreamSurface.getHeight();
+    public final int getSurfaceHeight(final ProxySurface s) {
+        return upstreamSurface.getSurfaceHeight();
     }
 
     @Override
     public String toString() {
-        final String us_s = null != upstreamSurface ? ( upstreamSurface.getClass().getName() + ": 0x" + Long.toHexString(upstreamSurface.getSurfaceHandle()) ) : "nil";
-        return "EGLUpstreamSurfaceHook[ "+ upstreamSurface.getWidth() + "x" + upstreamSurface.getHeight() + ", " + us_s+ "]";
+        final String us_s;
+        final int sw, sh;
+        if( null != upstreamSurface ) {
+            us_s = upstreamSurface.getClass().getName() + ": 0x" + Long.toHexString(upstreamSurface.getSurfaceHandle());
+            sw = upstreamSurface.getSurfaceWidth();
+            sh = upstreamSurface.getSurfaceHeight();
+        } else {
+            us_s = "nil";
+            sw = -1;
+            sh = -1;
+        }
+        return "EGLUpstreamSurfaceHook[ "+ sw + "x" + sh + ", " + us_s+ "]";
     }
 
 }
diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java b/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java
index e6d43d9..89024ee 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLWrappedSurface.java
@@ -13,22 +13,18 @@ import jogamp.nativewindow.WrappedSurface;
  */
 public class EGLWrappedSurface extends WrappedSurface {
 
-    public static EGLWrappedSurface get(NativeSurface surface) {
+    public static EGLWrappedSurface get(final NativeSurface surface) {
         if(surface instanceof EGLWrappedSurface) {
             return (EGLWrappedSurface)surface;
         }
         return new EGLWrappedSurface(surface);
     }
 
-    public EGLWrappedSurface(NativeSurface surface) {
+    public EGLWrappedSurface(final NativeSurface surface) {
         super(surface.getGraphicsConfiguration(), EGL.EGL_NO_SURFACE, new EGLUpstreamSurfaceHook(surface), false /* tbd in UpstreamSurfaceHook */);
         if(EGLDrawableFactory.DEBUG) {
             System.err.println("EGLWrappedSurface.ctor(): "+this);
         }
     }
 
-    @Override
-    public final NativeSurface getUpstreamSurface() {
-        return ((EGLUpstreamSurfaceHook)super.getUpstreamSurfaceHook()).getUpstreamSurface();
-    }
 }
diff --git a/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java b/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
index a4aa1c7..f092264 100644
--- a/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
+++ b/src/jogl/classes/jogamp/opengl/gl2/ProjectDouble.java
@@ -114,10 +114,11 @@
  */
 package jogamp.opengl.gl2;
 
-import java.nio.*;
+import java.nio.DoubleBuffer;
+import java.nio.IntBuffer;
+
+import javax.media.opengl.GL2;
 
-import javax.media.opengl.*;
-import jogamp.opengl.*;
 import com.jogamp.common.nio.Buffers;
 
 /**
@@ -152,12 +153,7 @@ public class ProjectDouble {
   private final double[] in = new double[4];
   private final double[] out = new double[4];
 
-  private final double[] forward = new double[3];
-  private final double[] side = new double[3];
-  private final double[] up = new double[3];
-
   // Buffer-based implementation
-  private DoubleBuffer locbuf;
   private final DoubleBuffer matrixBuf;
 
   private final DoubleBuffer tempMatrixBuf;
@@ -174,7 +170,7 @@ public class ProjectDouble {
     // Slice up one big buffer because some NIO implementations
     // allocate a huge amount of memory to back even the smallest of
     // buffers.
-    DoubleBuffer locbuf = Buffers.newDirectDoubleBuffer(128);
+    final DoubleBuffer locbuf = Buffers.newDirectDoubleBuffer(128);
     int pos = 0;
     int sz = 16;
     matrixBuf = slice(locbuf, pos, sz);
@@ -194,14 +190,7 @@ public class ProjectDouble {
     upBuf = slice(locbuf, pos, sz);
   }
 
-  public void destroy() {
-    if(locbuf!=null) {
-        locbuf.clear();
-        locbuf=null;
-    }
-  }
-
-  private static DoubleBuffer slice(DoubleBuffer buf, int pos, int len) {
+  private static DoubleBuffer slice(final DoubleBuffer buf, final int pos, final int len) {
     buf.position(pos);
     buf.limit(pos + len);
     return buf.slice();
@@ -210,8 +199,8 @@ public class ProjectDouble {
   /**
    * Make matrix an identity matrix
    */
-  private void __gluMakeIdentityd(DoubleBuffer m) {
-    int oldPos = m.position();
+  private void __gluMakeIdentityd(final DoubleBuffer m) {
+    final int oldPos = m.position();
     m.put(IDENTITY_MATRIX);
     m.position(oldPos);
   }
@@ -219,7 +208,7 @@ public class ProjectDouble {
   /**
    * Make matrix an identity matrix
    */
-  private void __gluMakeIdentityd(double[] m) {
+  private void __gluMakeIdentityd(final double[] m) {
     for (int i = 0; i < 16; i++) {
       m[i] = IDENTITY_MATRIX[i];
     }
@@ -232,7 +221,7 @@ public class ProjectDouble {
    * @param in
    * @param out
    */
-  private void __gluMultMatrixVecd(double[] matrix, int matrix_offset, double[] in, double[] out) {
+  private void __gluMultMatrixVecd(final double[] matrix, final int matrix_offset, final double[] in, final double[] out) {
     for (int i = 0; i < 4; i++) {
       out[i] =
         in[0] * matrix[0*4+i+matrix_offset] +
@@ -249,10 +238,10 @@ public class ProjectDouble {
    * @param in
    * @param out
    */
-  private void __gluMultMatrixVecd(DoubleBuffer matrix, DoubleBuffer in, DoubleBuffer out) {
-    int inPos = in.position();
-    int outPos = out.position();
-    int matrixPos = matrix.position();
+  private void __gluMultMatrixVecd(final DoubleBuffer matrix, final DoubleBuffer in, final DoubleBuffer out) {
+    final int inPos = in.position();
+    final int outPos = out.position();
+    final int matrixPos = matrix.position();
     for (int i = 0; i < 4; i++) {
       out.put(i + outPos,
               in.get(0+inPos) * matrix.get(0*4+i+matrixPos) +
@@ -268,10 +257,10 @@ public class ProjectDouble {
    *
    * @return
    */
-  private boolean __gluInvertMatrixd(double[] src, double[] inverse) {
+  private boolean __gluInvertMatrixd(final double[] src, final double[] inverse) {
     int i, j, k, swap;
     double t;
-    double[][] temp = tempMatrix;
+    final double[][] temp = tempMatrix;
 
     for (i = 0; i < 4; i++) {
       for (j = 0; j < 4; j++) {
@@ -338,14 +327,14 @@ public class ProjectDouble {
    *
    * @return
    */
-  private boolean __gluInvertMatrixd(DoubleBuffer src, DoubleBuffer inverse) {
+  private boolean __gluInvertMatrixd(final DoubleBuffer src, final DoubleBuffer inverse) {
     int i, j, k, swap;
     double t;
 
-    int srcPos = src.position();
-    int invPos = inverse.position();
+    final int srcPos = src.position();
+    final int invPos = inverse.position();
 
-    DoubleBuffer temp = tempMatrixBuf;
+    final DoubleBuffer temp = tempMatrixBuf;
 
     for (i = 0; i < 4; i++) {
       for (j = 0; j < 4; j++) {
@@ -412,7 +401,7 @@ public class ProjectDouble {
    * @param b
    * @param r
    */
-  private void __gluMultMatricesd(double[] a, int a_offset, double[] b, int b_offset, double[] r) {
+  private void __gluMultMatricesd(final double[] a, final int a_offset, final double[] b, final int b_offset, final double[] r) {
     for (int i = 0; i < 4; i++) {
       for (int j = 0; j < 4; j++) {
         r[i*4+j] =
@@ -430,10 +419,10 @@ public class ProjectDouble {
    * @param b
    * @param r
    */
-  private void __gluMultMatricesd(DoubleBuffer a, DoubleBuffer b, DoubleBuffer r) {
-    int aPos = a.position();
-    int bPos = b.position();
-    int rPos = r.position();
+  private void __gluMultMatricesd(final DoubleBuffer a, final DoubleBuffer b, final DoubleBuffer r) {
+    final int aPos = a.position();
+    final int bPos = b.position();
+    final int rPos = r.position();
 
     for (int i = 0; i < 4; i++) {
       for (int j = 0; j < 4; j++) {
@@ -451,31 +440,10 @@ public class ProjectDouble {
    *
    * @param v
    */
-  private static void normalize(double[] v) {
-    double r;
-
-    r = Math.sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-    if ( r == 0.0 )
-      return;
-
-    r = 1.0 / r;
-
-    v[0] *= r;
-    v[1] *= r;
-    v[2] *= r;
-
-    return;
-  }
-
-  /**
-   * Normalize vector
-   *
-   * @param v
-   */
-  private static void normalize(DoubleBuffer v) {
+  private static void normalize(final DoubleBuffer v) {
     double r;
 
-    int vPos = v.position();
+    final int vPos = v.position();
 
     r = Math.sqrt(v.get(0+vPos) * v.get(0+vPos) +
                   v.get(1+vPos) * v.get(1+vPos) +
@@ -500,23 +468,10 @@ public class ProjectDouble {
    * @param v2
    * @param result
    */
-  private static void cross(double[] v1, double[] v2, double[] result) {
-    result[0] = v1[1] * v2[2] - v1[2] * v2[1];
-    result[1] = v1[2] * v2[0] - v1[0] * v2[2];
-    result[2] = v1[0] * v2[1] - v1[1] * v2[0];
-  }
-
-  /**
-   * Calculate cross-product
-   *
-   * @param v1
-   * @param v2
-   * @param result
-   */
-  private static void cross(DoubleBuffer v1, DoubleBuffer v2, DoubleBuffer result) {
-    int v1Pos = v1.position();
-    int v2Pos = v2.position();
-    int rPos  = result.position();
+  private static void cross(final DoubleBuffer v1, final DoubleBuffer v2, final DoubleBuffer result) {
+    final int v1Pos = v1.position();
+    final int v2Pos = v2.position();
+    final int rPos  = result.position();
 
     result.put(0+rPos, v1.get(1+v1Pos) * v2.get(2+v2Pos) - v1.get(2+v1Pos) * v2.get(1+v2Pos));
     result.put(1+rPos, v1.get(2+v1Pos) * v2.get(0+v2Pos) - v1.get(0+v1Pos) * v2.get(2+v2Pos));
@@ -531,7 +486,7 @@ public class ProjectDouble {
    * @param bottom
    * @param top
    */
-  public void gluOrtho2D(GL2 gl, double left, double right, double bottom, double top) {
+  public void gluOrtho2D(final GL2 gl, final double left, final double right, final double bottom, final double top) {
     gl.glOrtho(left, right, bottom, top, -1, 1);
   }
 
@@ -543,9 +498,9 @@ public class ProjectDouble {
    * @param zNear
    * @param zFar
    */
-  public void gluPerspective(GL2 gl, double fovy, double aspect, double zNear, double zFar) {
+  public void gluPerspective(final GL2 gl, final double fovy, final double aspect, final double zNear, final double zFar) {
     double sine, cotangent, deltaZ;
-    double radians = fovy / 2 * Math.PI / 180;
+    final double radians = fovy / 2 * Math.PI / 180;
 
     deltaZ = zFar - zNear;
     sine = Math.sin(radians);
@@ -581,19 +536,19 @@ public class ProjectDouble {
    * @param upy
    * @param upz
    */
-  public void gluLookAt(GL2 gl,
-                        double eyex,
-                        double eyey,
-                        double eyez,
-                        double centerx,
-                        double centery,
-                        double centerz,
-                        double upx,
-                        double upy,
-                        double upz) {
-    DoubleBuffer forward = this.forwardBuf;
-    DoubleBuffer side = this.sideBuf;
-    DoubleBuffer up = this.upBuf;
+  public void gluLookAt(final GL2 gl,
+                        final double eyex,
+                        final double eyey,
+                        final double eyez,
+                        final double centerx,
+                        final double centery,
+                        final double centerz,
+                        final double upx,
+                        final double upy,
+                        final double upz) {
+    final DoubleBuffer forward = this.forwardBuf;
+    final DoubleBuffer side = this.sideBuf;
+    final DoubleBuffer up = this.upBuf;
 
     forward.put(0, centerx - eyex);
     forward.put(1, centery - eyey);
@@ -642,20 +597,20 @@ public class ProjectDouble {
    *
    * @return
    */
-  public boolean gluProject(double objx,
-                            double objy,
-                            double objz,
-                            double[] modelMatrix,
-                            int modelMatrix_offset,
-                            double[] projMatrix,
-                            int projMatrix_offset,
-                            int[] viewport,
-                            int viewport_offset,
-                            double[] win_pos,
-                            int win_pos_offset ) {
-
-    double[] in = this.in;
-    double[] out = this.out;
+  public boolean gluProject(final double objx,
+                            final double objy,
+                            final double objz,
+                            final double[] modelMatrix,
+                            final int modelMatrix_offset,
+                            final double[] projMatrix,
+                            final int projMatrix_offset,
+                            final int[] viewport,
+                            final int viewport_offset,
+                            final double[] win_pos,
+                            final int win_pos_offset ) {
+
+    final double[] in = this.in;
+    final double[] out = this.out;
 
     in[0] = objx;
     in[1] = objy;
@@ -696,16 +651,16 @@ public class ProjectDouble {
    *
    * @return
    */
-  public boolean gluProject(double objx,
-                            double objy,
-                            double objz,
-                            DoubleBuffer modelMatrix,
-                            DoubleBuffer projMatrix,
-                            IntBuffer viewport,
-                            DoubleBuffer win_pos) {
+  public boolean gluProject(final double objx,
+                            final double objy,
+                            final double objz,
+                            final DoubleBuffer modelMatrix,
+                            final DoubleBuffer projMatrix,
+                            final IntBuffer viewport,
+                            final DoubleBuffer win_pos) {
 
-    DoubleBuffer in = this.inBuf;
-    DoubleBuffer out = this.outBuf;
+    final DoubleBuffer in = this.inBuf;
+    final DoubleBuffer out = this.outBuf;
 
     in.put(0, objx);
     in.put(1, objy);
@@ -726,8 +681,8 @@ public class ProjectDouble {
     in.put(2, in.get(2) * in.get(3) + 0.5f);
 
     // Map x,y to viewport
-    int vPos = viewport.position();
-    int wPos = win_pos.position();
+    final int vPos = viewport.position();
+    final int wPos = win_pos.position();
     win_pos.put(0+wPos, in.get(0) * viewport.get(2+vPos) + viewport.get(0+vPos));
     win_pos.put(1+wPos, in.get(1) * viewport.get(3+vPos) + viewport.get(1+vPos));
     win_pos.put(2+wPos, in.get(2));
@@ -749,19 +704,19 @@ public class ProjectDouble {
    *
    * @return
    */
-  public boolean gluUnProject(double winx,
-                              double winy,
-                              double winz,
-                              double[] modelMatrix,
-                              int modelMatrix_offset,
-                              double[] projMatrix,
-                              int projMatrix_offset,
-                              int[] viewport,
-                              int viewport_offset,
-                              double[] obj_pos,
-                              int obj_pos_offset) {
-    double[] in = this.in;
-    double[] out = this.out;
+  public boolean gluUnProject(final double winx,
+                              final double winy,
+                              final double winz,
+                              final double[] modelMatrix,
+                              final int modelMatrix_offset,
+                              final double[] projMatrix,
+                              final int projMatrix_offset,
+                              final int[] viewport,
+                              final int viewport_offset,
+                              final double[] obj_pos,
+                              final int obj_pos_offset) {
+    final double[] in = this.in;
+    final double[] out = this.out;
 
     __gluMultMatricesd(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
 
@@ -810,15 +765,15 @@ public class ProjectDouble {
    *
    * @return
    */
-  public boolean gluUnProject(double winx,
-                              double winy,
-                              double winz,
-                              DoubleBuffer modelMatrix,
-                              DoubleBuffer projMatrix,
-                              IntBuffer viewport,
-                              DoubleBuffer obj_pos) {
-    DoubleBuffer in = this.inBuf;
-    DoubleBuffer out = this.outBuf;
+  public boolean gluUnProject(final double winx,
+                              final double winy,
+                              final double winz,
+                              final DoubleBuffer modelMatrix,
+                              final DoubleBuffer projMatrix,
+                              final IntBuffer viewport,
+                              final DoubleBuffer obj_pos) {
+    final DoubleBuffer in = this.inBuf;
+    final DoubleBuffer out = this.outBuf;
 
     __gluMultMatricesd(modelMatrix, projMatrix, matrixBuf);
 
@@ -831,8 +786,8 @@ public class ProjectDouble {
     in.put(3, 1.0);
 
     // Map x and y from window coordinates
-    int vPos = viewport.position();
-    int oPos = obj_pos.position();
+    final int vPos = viewport.position();
+    final int oPos = obj_pos.position();
     in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
     in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
 
@@ -872,22 +827,22 @@ public class ProjectDouble {
    *
    * @return
    */
-  public boolean gluUnProject4(double winx,
-                               double winy,
-                               double winz,
-                               double clipw,
-                               double[] modelMatrix,
-                               int modelMatrix_offset,
-                               double[] projMatrix,
-                               int projMatrix_offset,
-                               int[] viewport,
-                               int viewport_offset,
-                               double near,
-                               double far,
-                               double[] obj_pos,
-                               int obj_pos_offset ) {
-    double[] in = this.in;
-    double[] out = this.out;
+  public boolean gluUnProject4(final double winx,
+                               final double winy,
+                               final double winz,
+                               final double clipw,
+                               final double[] modelMatrix,
+                               final int modelMatrix_offset,
+                               final double[] projMatrix,
+                               final int projMatrix_offset,
+                               final int[] viewport,
+                               final int viewport_offset,
+                               final double near,
+                               final double far,
+                               final double[] obj_pos,
+                               final int obj_pos_offset ) {
+    final double[] in = this.in;
+    final double[] out = this.out;
 
     __gluMultMatricesd(modelMatrix, modelMatrix_offset, projMatrix, projMatrix_offset, matrix);
 
@@ -937,18 +892,18 @@ public class ProjectDouble {
    *
    * @return
    */
-  public boolean gluUnProject4(double winx,
-                               double winy,
-                               double winz,
-                               double clipw,
-                               DoubleBuffer modelMatrix,
-                               DoubleBuffer projMatrix,
-                               IntBuffer viewport,
-                               double near,
-                               double far,
-                               DoubleBuffer obj_pos) {
-    DoubleBuffer in = this.inBuf;
-    DoubleBuffer out = this.outBuf;
+  public boolean gluUnProject4(final double winx,
+                               final double winy,
+                               final double winz,
+                               final double clipw,
+                               final DoubleBuffer modelMatrix,
+                               final DoubleBuffer projMatrix,
+                               final IntBuffer viewport,
+                               final double near,
+                               final double far,
+                               final DoubleBuffer obj_pos) {
+    final DoubleBuffer in = this.inBuf;
+    final DoubleBuffer out = this.outBuf;
 
     __gluMultMatricesd(modelMatrix, projMatrix, matrixBuf);
 
@@ -961,7 +916,7 @@ public class ProjectDouble {
     in.put(3, clipw);
 
     // Map x and y from window coordinates
-    int vPos = viewport.position();
+    final int vPos = viewport.position();
     in.put(0, (in.get(0) - viewport.get(0+vPos)) / viewport.get(2+vPos));
     in.put(1, (in.get(1) - viewport.get(1+vPos)) / viewport.get(3+vPos));
     in.put(2, (in.get(2) - near) / (far - near));
@@ -976,7 +931,7 @@ public class ProjectDouble {
     if (out.get(3) == 0.0)
       return false;
 
-    int oPos = obj_pos.position();
+    final int oPos = obj_pos.position();
     obj_pos.put(0+oPos, out.get(0));
     obj_pos.put(1+oPos, out.get(1));
     obj_pos.put(2+oPos, out.get(2));
@@ -994,18 +949,18 @@ public class ProjectDouble {
    * @param deltaY
    * @param viewport
    */
-  public void gluPickMatrix(GL2 gl,
-                            double x,
-                            double y,
-                            double deltaX,
-                            double deltaY,
-                            IntBuffer viewport) {
+  public void gluPickMatrix(final GL2 gl,
+                            final double x,
+                            final double y,
+                            final double deltaX,
+                            final double deltaY,
+                            final IntBuffer viewport) {
     if (deltaX <= 0 || deltaY <= 0) {
       return;
     }
 
     /* Translate and scale the picked region to the entire window */
-    int vPos = viewport.position();
+    final int vPos = viewport.position();
     gl.glTranslated((viewport.get(2+vPos) - 2 * (x - viewport.get(0+vPos))) / deltaX,
                     (viewport.get(3+vPos) - 2 * (y - viewport.get(1+vPos))) / deltaY,
                     0);
@@ -1022,13 +977,13 @@ public class ProjectDouble {
    * @param viewport
    * @param viewport_offset
    */
-  public void gluPickMatrix(GL2 gl,
-                            double x,
-                            double y,
-                            double deltaX,
-                            double deltaY,
-                            int[] viewport,
-                            int viewport_offset) {
+  public void gluPickMatrix(final GL2 gl,
+                            final double x,
+                            final double y,
+                            final double deltaX,
+                            final double deltaY,
+                            final int[] viewport,
+                            final int viewport_offset) {
     if (deltaX <= 0 || deltaY <= 0) {
       return;
     }
diff --git a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
index 717b125..c91a045 100644
--- a/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/GLUquadricImpl.java
@@ -119,6 +119,7 @@ import javax.media.opengl.GL;
 import javax.media.opengl.glu.GLU;
 import javax.media.opengl.glu.GLUquadric;
 
+import com.jogamp.opengl.math.FloatUtil;
 import com.jogamp.opengl.util.ImmModeSink;
 import com.jogamp.opengl.util.glsl.ShaderState;
 
@@ -132,7 +133,7 @@ import com.jogamp.opengl.util.glsl.ShaderState;
  */
 
 public class GLUquadricImpl implements GLUquadric {
-  private boolean useGLSL;
+  private final boolean useGLSL;
   private int drawStyle;
   private int orientation;
   private boolean textureFlag;
@@ -149,7 +150,7 @@ public class GLUquadricImpl implements GLUquadric {
 
   private ImmModeSink immModeSink=null;
 
-  public GLUquadricImpl(GL gl, boolean useGLSL, ShaderState st, int shaderProgram) {
+  public GLUquadricImpl(final GL gl, final boolean useGLSL, final ShaderState st, final int shaderProgram) {
     this.gl=gl;
     this.useGLSL = useGLSL;
     this.drawStyle = GLU.GLU_FILL;
@@ -165,7 +166,7 @@ public class GLUquadricImpl implements GLUquadric {
   }
 
   @Override
-  public void enableImmModeSink(boolean val) {
+  public void enableImmModeSink(final boolean val) {
     if(gl.isGL2()) {
         immModeSinkEnabled=val;
     } else {
@@ -182,7 +183,7 @@ public class GLUquadricImpl implements GLUquadric {
   }
 
   @Override
-  public void setImmMode(boolean val) {
+  public void setImmMode(final boolean val) {
     if(immModeSinkEnabled) {
         immModeSinkImmediate=val;
     } else {
@@ -199,7 +200,7 @@ public class GLUquadricImpl implements GLUquadric {
   public ImmModeSink replaceImmModeSink() {
     if(!immModeSinkEnabled) return null;
 
-    ImmModeSink res = immModeSink;
+    final ImmModeSink res = immModeSink;
     if(useGLSL) {
         if(null != shaderState) {
             immModeSink = ImmModeSink.createGLSL (32,
@@ -228,7 +229,7 @@ public class GLUquadricImpl implements GLUquadric {
   }
 
   @Override
-  public void resetImmModeSink(GL gl) {
+  public void resetImmModeSink(final GL gl) {
     if(immModeSinkEnabled) {
         immModeSink.reset(gl);
     }
@@ -252,7 +253,7 @@ public class GLUquadricImpl implements GLUquadric {
    *
    * @param drawStyle The drawStyle to set
    */
-  public void setDrawStyle(int drawStyle) {
+  public void setDrawStyle(final int drawStyle) {
     this.drawStyle = drawStyle;
   }
 
@@ -269,7 +270,7 @@ public class GLUquadricImpl implements GLUquadric {
    *
    * @param normals The normals to set
    */
-  public void setNormals(int normals) {
+  public void setNormals(final int normals) {
     this.normals = normals;
   }
 
@@ -286,7 +287,7 @@ public class GLUquadricImpl implements GLUquadric {
    *
    * @param orientation The orientation to set
    */
-  public void setOrientation(int orientation) {
+  public void setOrientation(final int orientation) {
     this.orientation = orientation;
   }
 
@@ -301,7 +302,7 @@ public class GLUquadricImpl implements GLUquadric {
    *
    * @param textureFlag The textureFlag to set
    */
-  public void setTextureFlag(boolean textureFlag) {
+  public void setTextureFlag(final boolean textureFlag) {
     this.textureFlag = textureFlag;
   }
 
@@ -363,7 +364,7 @@ public class GLUquadricImpl implements GLUquadric {
    * @param slices      Specifies the number of subdivisions around the z axis.
    * @param stacks      Specifies the number of subdivisions along the z axis.
    */
-  public void drawCylinder(GL gl, float baseRadius, float topRadius, float height, int slices, int stacks) {
+  public void drawCylinder(final GL gl, final float baseRadius, final float topRadius, final float height, final int slices, final int stacks) {
 
     float da, r, dr, dz;
     float x, y, z, nz, nsign;
@@ -375,7 +376,7 @@ public class GLUquadricImpl implements GLUquadric {
       nsign = 1.0f;
     }
 
-    da = 2.0f * PI / slices;
+    da = PI_2 / slices;
     dr = (topRadius - baseRadius) / stacks;
     dz = height / stacks;
     nz = (baseRadius - topRadius) / height;
@@ -446,8 +447,8 @@ public class GLUquadricImpl implements GLUquadric {
       }
       glEnd(gl);
     } else if (drawStyle == GLU.GLU_FILL) {
-      float ds = 1.0f / slices;
-      float dt = 1.0f / stacks;
+      final float ds = 1.0f / slices;
+      final float dt = 1.0f / stacks;
       float t = 0.0f;
       z = 0.0f;
       r = baseRadius;
@@ -462,21 +463,21 @@ public class GLUquadricImpl implements GLUquadric {
             x = sin((i * da));
             y = cos((i * da));
           }
-          if (nsign == 1.0f) {
+          // if (nsign == 1.0f) {
             normal3f(gl, (x * nsign), (y * nsign), (nz * nsign));
             TXTR_COORD(gl, s, t);
             glVertex3f(gl, (x * r), (y * r), z);
             normal3f(gl, (x * nsign), (y * nsign), (nz * nsign));
             TXTR_COORD(gl, s, t + dt);
             glVertex3f(gl, (x * (r + dr)), (y * (r + dr)), (z + dz));
-          } else {
+          /* } else {
             normal3f(gl, x * nsign, y * nsign, nz * nsign);
             TXTR_COORD(gl, s, t);
             glVertex3f(gl, (x * r), (y * r), z);
             normal3f(gl, x * nsign, y * nsign, nz * nsign);
             TXTR_COORD(gl, s, t + dt);
             glVertex3f(gl, (x * (r + dr)), (y * (r + dr)), (z + dz));
-          }
+          } */
           s += ds;
         } // for slices
         glEnd(gl);
@@ -505,7 +506,7 @@ public class GLUquadricImpl implements GLUquadric {
    * (1, 0.5), at (0, r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5), and at
    * (0, -r, 0) it is (0.5, 0).
    */
-  public void drawDisk(GL gl, float innerRadius, float outerRadius, int slices, int loops)
+  public void drawDisk(final GL gl, final float innerRadius, final float outerRadius, final int slices, final int loops)
   {
     float da, dr;
 
@@ -519,7 +520,7 @@ public class GLUquadricImpl implements GLUquadric {
       }
     }
 
-    da = 2.0f * PI / slices;
+    da = PI_2 / slices;
     dr = (outerRadius - innerRadius) /  loops;
 
     switch (drawStyle) {
@@ -529,12 +530,12 @@ public class GLUquadricImpl implements GLUquadric {
          * x, y in [-outerRadius, +outerRadius]; s, t in [0, 1]
          * (linear mapping)
          */
-        float dtc = 2.0f * outerRadius;
+        final float dtc = 2.0f * outerRadius;
         float sa, ca;
         float r1 = innerRadius;
         int l;
         for (l = 0; l < loops; l++) {
-          float r2 = r1 + dr;
+          final float r2 = r1 + dr;
           if (orientation == GLU.GLU_OUTSIDE) {
             int s;
             glBegin(gl, ImmModeSink.GL_QUAD_STRIP);
@@ -580,22 +581,22 @@ public class GLUquadricImpl implements GLUquadric {
         int l, s;
         /* draw loops */
         for (l = 0; l <= loops; l++) {
-          float r = innerRadius + l * dr;
+          final float r = innerRadius + l * dr;
           glBegin(gl, GL.GL_LINE_LOOP);
           for (s = 0; s < slices; s++) {
-            float a = s * da;
+            final float a = s * da;
             glVertex2f(gl, r * sin(a), r * cos(a));
           }
           glEnd(gl);
         }
         /* draw spokes */
         for (s = 0; s < slices; s++) {
-          float a = s * da;
-          float x = sin(a);
-          float y = cos(a);
+          final float a = s * da;
+          final float x = sin(a);
+          final float y = cos(a);
           glBegin(gl, GL.GL_LINE_STRIP);
           for (l = 0; l <= loops; l++) {
-            float r = innerRadius + l * dr;
+            final float r = innerRadius + l * dr;
             glVertex2f(gl, r * x, r * y);
           }
           glEnd(gl);
@@ -607,12 +608,12 @@ public class GLUquadricImpl implements GLUquadric {
         int s;
         glBegin(gl, GL.GL_POINTS);
         for (s = 0; s < slices; s++) {
-          float a = s * da;
-          float x = sin(a);
-          float y = cos(a);
+          final float a = s * da;
+          final float x = sin(a);
+          final float y = cos(a);
           int l;
           for (l = 0; l <= loops; l++) {
-            float r = innerRadius * l * dr;
+            final float r = innerRadius * l * dr;
             glVertex2f(gl, r * x, r * y);
           }
         }
@@ -624,9 +625,9 @@ public class GLUquadricImpl implements GLUquadric {
         if (innerRadius != 0.0) {
           float a;
           glBegin(gl, GL.GL_LINE_LOOP);
-          for (a = 0.0f; a < 2.0 * PI; a += da) {
-            float x = innerRadius * sin(a);
-            float y = innerRadius * cos(a);
+          for (a = 0.0f; a < PI_2; a += da) {
+            final float x = innerRadius * sin(a);
+            final float y = innerRadius * cos(a);
             glVertex2f(gl, x, y);
           }
           glEnd(gl);
@@ -634,9 +635,9 @@ public class GLUquadricImpl implements GLUquadric {
         {
           float a;
           glBegin(gl, GL.GL_LINE_LOOP);
-          for (a = 0; a < 2.0f * PI; a += da) {
-            float x = outerRadius * sin(a);
-            float y = outerRadius * cos(a);
+          for (a = 0; a < PI_2; a += da) {
+            final float x = outerRadius * sin(a);
+            final float y = outerRadius * cos(a);
             glVertex2f(gl, x, y);
           }
           glEnd(gl);
@@ -671,16 +672,16 @@ public class GLUquadricImpl implements GLUquadric {
    * is (1, 0.5), at (0, r, 0) it is (0.5, 1), at (-r, 0, 0) it is (0, 0.5),
    * and at (0, -r, 0) it is (0.5, 0).
    */
-  public void drawPartialDisk(GL gl,
-                              float innerRadius,
-                              float outerRadius,
+  public void drawPartialDisk(final GL gl,
+                              final float innerRadius,
+                              final float outerRadius,
                               int slices,
-                              int loops,
+                              final int loops,
                               float startAngle,
                               float sweepAngle) {
     int i, j;
-    float[] sinCache = new float[CACHE_SIZE];
-    float[] cosCache = new float[CACHE_SIZE];
+    final float[] sinCache = new float[CACHE_SIZE];
+    final float[] cosCache = new float[CACHE_SIZE];
     float angle;
     float sintemp, costemp;
     float deltaRadius;
@@ -952,7 +953,7 @@ public class GLUquadricImpl implements GLUquadric {
    * 0.0 at the +y axis, to 0.25 at the +x axis, to 0.5 at the -y axis, to 0.75
    * at the -x axis, and back to 1.0 at the +y axis.
    */
-  public void drawSphere(GL gl, float radius, int slices, int stacks) {
+  public void drawSphere(final GL gl, final float radius, final int slices, final int stacks) {
     // TODO
 
     float rho, drho, theta, dtheta;
@@ -971,7 +972,7 @@ public class GLUquadricImpl implements GLUquadric {
     }
 
     drho = PI / stacks;
-    dtheta = 2.0f * PI / slices;
+    dtheta = PI_2 / slices;
 
     if (drawStyle == GLU.GLU_FILL) {
       if (!textureFlag) {
@@ -1118,10 +1119,11 @@ public class GLUquadricImpl implements GLUquadric {
   // Internals only below this point
   //
 
-  private static final float PI = (float)Math.PI;
+  private static final float PI = FloatUtil.PI;
+  private static final float PI_2 = 2f * PI;
   private static final int CACHE_SIZE = 240;
 
-  private final void glBegin(GL gl, int mode) {
+  private final void glBegin(final GL gl, final int mode) {
       if(immModeSinkEnabled) {
           immModeSink.glBegin(mode);
       } else {
@@ -1129,7 +1131,7 @@ public class GLUquadricImpl implements GLUquadric {
       }
   }
 
-  private final void glEnd(GL gl) {
+  private final void glEnd(final GL gl) {
       if(immModeSinkEnabled) {
           immModeSink.glEnd(gl, immModeSinkImmediate);
       } else {
@@ -1137,7 +1139,7 @@ public class GLUquadricImpl implements GLUquadric {
       }
   }
 
-  private final void glVertex2f(GL gl, float x, float y) {
+  private final void glVertex2f(final GL gl, final float x, final float y) {
       if(immModeSinkEnabled) {
           immModeSink.glVertex2f(x, y);
       } else {
@@ -1145,7 +1147,7 @@ public class GLUquadricImpl implements GLUquadric {
       }
   }
 
-  private final void glVertex3f(GL gl, float x, float y, float z) {
+  private final void glVertex3f(final GL gl, final float x, final float y, final float z) {
       if(immModeSinkEnabled) {
           immModeSink.glVertex3f(x, y, z);
       } else {
@@ -1153,10 +1155,10 @@ public class GLUquadricImpl implements GLUquadric {
       }
   }
 
-  private final void glNormal3f_s(GL gl, float x, float y, float z) {
-      short a=(short)(x*0xFFFF);
-      short b=(short)(y*0xFFFF);
-      short c=(short)(z*0xFFFF);
+  private final void glNormal3f_s(final GL gl, final float x, final float y, final float z) {
+      final short a=(short)(x*0xFFFF);
+      final short b=(short)(y*0xFFFF);
+      final short c=(short)(z*0xFFFF);
       if(immModeSinkEnabled) {
           immModeSink.glNormal3s(a, b, c);
       } else {
@@ -1164,10 +1166,10 @@ public class GLUquadricImpl implements GLUquadric {
       }
   }
 
-  private final void glNormal3f_b(GL gl, float x, float y, float z) {
-      byte a=(byte)(x*0xFF);
-      byte b=(byte)(y*0xFF);
-      byte c=(byte)(z*0xFF);
+  private final void glNormal3f_b(final GL gl, final float x, final float y, final float z) {
+      final byte a=(byte)(x*0xFF);
+      final byte b=(byte)(y*0xFF);
+      final byte c=(byte)(z*0xFF);
       if(immModeSinkEnabled) {
           immModeSink.glNormal3b(a, b, c);
       } else {
@@ -1175,7 +1177,7 @@ public class GLUquadricImpl implements GLUquadric {
       }
   }
 
-  private final void glNormal3f(GL gl, float x, float y, float z) {
+  private final void glNormal3f(final GL gl, final float x, final float y, final float z) {
     switch(normalType) {
         case GL.GL_FLOAT:
             if(immModeSinkEnabled) {
@@ -1193,7 +1195,7 @@ public class GLUquadricImpl implements GLUquadric {
     }
   }
 
-  private final void glTexCoord2f(GL gl, float x, float y) {
+  private final void glTexCoord2f(final GL gl, final float x, final float y) {
       if(immModeSinkEnabled) {
           immModeSink.glTexCoord2f(x, y);
       } else {
@@ -1208,7 +1210,7 @@ public class GLUquadricImpl implements GLUquadric {
    * @param y
    * @param z
    */
-  private void normal3f(GL gl, float x, float y, float z) {
+  private void normal3f(final GL gl, float x, float y, float z) {
     float mag;
 
     mag = (float)Math.sqrt(x * x + y * y + z * z);
@@ -1220,15 +1222,15 @@ public class GLUquadricImpl implements GLUquadric {
     glNormal3f(gl, x, y, z);
   }
 
-  private final void TXTR_COORD(GL gl, float x, float y) {
+  private final void TXTR_COORD(final GL gl, final float x, final float y) {
     if (textureFlag) glTexCoord2f(gl, x,y);
   }
 
-  private float sin(float r) {
+  private float sin(final float r) {
     return (float)Math.sin(r);
   }
 
-  private float cos(float r) {
+  private float cos(final float r) {
     return (float)Math.cos(r);
   }
 }
diff --git a/src/jogl/classes/jogamp/opengl/glu/Glue.java b/src/jogl/classes/jogamp/opengl/glu/Glue.java
index 2ad3d8c..fc85b13 100644
--- a/src/jogl/classes/jogamp/opengl/glu/Glue.java
+++ b/src/jogl/classes/jogamp/opengl/glu/Glue.java
@@ -94,7 +94,7 @@ public class Glue {
   public Glue() {
   }
 
-  public static String __gluNURBSErrorString( int errno ) {
+  public static String __gluNURBSErrorString( final int errno ) {
     return( __gluNurbsErrors[ errno ] );
   }
 
@@ -108,7 +108,7 @@ public class Glue {
     "need combine callback"
   };
 
-  public static String __gluTessErrorString( int errno ) {
+  public static String __gluTessErrorString( final int errno ) {
     return( __gluTessErrors[ errno ] );
   }
 }
diff --git a/src/jogl/classes/jogamp/opengl/glu/error/Error.java b/src/jogl/classes/jogamp/opengl/glu/error/Error.java
index ffb8d94..235c597 100644
--- a/src/jogl/classes/jogamp/opengl/glu/error/Error.java
+++ b/src/jogl/classes/jogamp/opengl/glu/error/Error.java
@@ -76,7 +76,7 @@ public class Error {
   public Error() {
   }
 
-  public static String gluErrorString( int errorCode ) {
+  public static String gluErrorString( final int errorCode ) {
     if( errorCode == 0 ) {
       return( "no error" );
     }
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
index 4213dfd..96da49a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2CurveEvaluator.java
@@ -1,42 +1,9 @@
 package jogamp.opengl.glu.gl2.nurbs;
 import jogamp.opengl.glu.nurbs.*;
 
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
+import javax.media.opengl.GL2GL3;
 import javax.media.opengl.glu.GLU;
 import javax.media.opengl.glu.gl2.GLUgl2;
 
@@ -55,7 +22,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
   /**
    * OpenGL object
    */
-  private GL2 gl;
+  private final GL2 gl;
 
   /**
    * Not used
@@ -130,8 +97,8 @@ class GL2CurveEvaluator implements CurveEvaluator {
    * @param ps control points
    */
   @Override
-  public void map1f(int type, float ulo, float uhi, int stride, int order,
-                    CArrayOfFloats ps) {
+  public void map1f(final int type, final float ulo, final float uhi, final int stride, final int order,
+                    final CArrayOfFloats ps) {
     if (output_triangles) {
       // TODO code for callback (output_triangles probably indicates callback)
       //                System.out.println("TODO curveevaluator.map1f-output_triangles");
@@ -157,7 +124,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
    * @param type what to enable
    */
   @Override
-  public void enable(int type) {
+  public void enable(final int type) {
     // DONE
     gl.glEnable(type);
   }
@@ -169,7 +136,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
    * @param u2 high u
    */
   @Override
-  public void mapgrid1f(int nu, float u1, float u2) {
+  public void mapgrid1f(final int nu, final float u1, final float u2) {
     if (output_triangles) {
       //                System.out.println("TODO curveevaluator.mapgrid1f");
     } else
@@ -185,7 +152,7 @@ class GL2CurveEvaluator implements CurveEvaluator {
    * @param to highest param
    */
   @Override
-  public void mapmesh1f(int style, int from, int to) {
+  public void mapmesh1f(final int style, final int from, final int to) {
     /* //DEBUG drawing control points
        this.poradi++;
        if (poradi % 2 == 0)
@@ -200,10 +167,10 @@ class GL2CurveEvaluator implements CurveEvaluator {
       switch (style) {
       case Backend.N_MESHFILL:
       case Backend.N_MESHLINE:
-        gl.glEvalMesh1(GL2.GL_LINE, from, to);
+        gl.glEvalMesh1(GL2GL3.GL_LINE, from, to);
         break;
       case Backend.N_MESHPOINT:
-        gl.glEvalMesh1(GL2.GL_POINT, from, to);
+        gl.glEvalMesh1(GL2GL3.GL_POINT, from, to);
         break;
       }
     }
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
index e9c9fca..e5cb715 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GL2SurfaceEvaluator.java
@@ -1,42 +1,9 @@
 package jogamp.opengl.glu.gl2.nurbs;
 import jogamp.opengl.glu.nurbs.*;
 
-/*
- ** License Applicability. Except to the extent portions of this file are
- ** made subject to an alternative license as permitted in the SGI Free
- ** Software License B, Version 2.0 (the "License"), the contents of this
- ** file are subject only to the provisions of the License. You may not use
- ** this file except in compliance with the License. You may obtain a copy
- ** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
- ** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
- **
- ** http://oss.sgi.com/projects/FreeB
- **
- ** Note that, as provided in the License, the Software is distributed on an
- ** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
- ** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
- ** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
- ** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
- **
- ** Original Code. The Original Code is: OpenGL Sample Implementation,
- ** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
- ** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
- ** Copyright in any portions created by third parties is as indicated
- ** elsewhere herein. All Rights Reserved.
- **
- ** Additional Notice Provisions: The application programming interfaces
- ** established by SGI in conjunction with the Original Code are The
- ** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
- ** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
- ** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
- ** Window System(R) (Version 1.3), released October 19, 1998. This software
- ** was created using the OpenGL(R) version 1.2.1 Sample Implementation
- ** published by SGI, but has not been independently verified as being
- ** compliant with the OpenGL(R) version 1.2.1 Specification.
- */
-
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
+import javax.media.opengl.GL2GL3;
 import javax.media.opengl.glu.GLU;
 import javax.media.opengl.glu.gl2.GLUgl2;
 
@@ -50,7 +17,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
   /**
    * JOGL OpenGL object
    */
-  private GL2 gl;
+  private final GL2 gl;
 
   /**
    * Output triangles (callback)
@@ -90,18 +57,18 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
    * @param style polygon mode (N_MESHFILL/N_MESHLINE/N_MESHPOINT)
    */
   @Override
-  public void polymode(int style) {
+  public void polymode(final int style) {
     if (!output_triangles) {
       switch (style) {
       default:
       case NurbsConsts.N_MESHFILL:
-        gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_FILL);
+        gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_FILL);
         break;
       case NurbsConsts.N_MESHLINE:
-        gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_LINE);
+        gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_LINE);
         break;
       case NurbsConsts.N_MESHPOINT:
-        gl.glPolygonMode(GL2.GL_FRONT_AND_BACK, GL2.GL_POINT);
+        gl.glPolygonMode(GL.GL_FRONT_AND_BACK, GL2GL3.GL_POINT);
         break;
       }
     }
@@ -130,7 +97,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
    * @param vhi
    */
   @Override
-  public void domain2f(float ulo, float uhi, float vlo, float vhi) {
+  public void domain2f(final float ulo, final float uhi, final float vlo, final float vhi) {
     // DONE
   }
 
@@ -144,7 +111,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
    * @param v1 highest v
    */
   @Override
-  public void mapgrid2f(int nu, float u0, float u1, int nv, float v0, float v1) {
+  public void mapgrid2f(final int nu, final float u0, final float u1, final int nv, final float v0, final float v1) {
 
     if (output_triangles) {
       //            System.out.println("TODO openglsurfaceavaluator.mapgrid2f output_triangles");
@@ -163,7 +130,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
    * @param vmax maximum V
    */
   @Override
-  public void mapmesh2f(int style, int umin, int umax, int vmin, int vmax) {
+  public void mapmesh2f(final int style, final int umin, final int umax, final int vmin, final int vmax) {
     if (output_triangles) {
       //            System.out.println("TODO openglsurfaceavaluator.mapmesh2f output_triangles");
     } else {
@@ -176,13 +143,13 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
       */
       switch (style) {
       case NurbsConsts.N_MESHFILL:
-        gl.glEvalMesh2(GL2.GL_FILL, umin, umax, vmin, vmax);
+        gl.glEvalMesh2(GL2GL3.GL_FILL, umin, umax, vmin, vmax);
         break;
       case NurbsConsts.N_MESHLINE:
-        gl.glEvalMesh2(GL2.GL_LINE, umin, umax, vmin, vmax);
+        gl.glEvalMesh2(GL2GL3.GL_LINE, umin, umax, vmin, vmax);
         break;
       case NurbsConsts.N_MESHPOINT:
-        gl.glEvalMesh2(GL2.GL_POINT, umin, umax, vmin, vmax);
+        gl.glEvalMesh2(GL2GL3.GL_POINT, umin, umax, vmin, vmax);
         break;
       }
     }
@@ -202,8 +169,8 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
    * @param pts control points
    */
   @Override
-  public void map2f(int type, float ulo, float uhi, int ustride, int uorder,
-                    float vlo, float vhi, int vstride, int vorder, CArrayOfFloats pts) {
+  public void map2f(final int type, final float ulo, final float uhi, final int ustride, final int uorder,
+                    final float vlo, final float vhi, final int vstride, final int vorder, final CArrayOfFloats pts) {
     // TODO Auto-generated method stub
     if (output_triangles) {
       //            System.out.println("TODO openglsurfaceevaluator.map2f output_triangles");
@@ -218,7 +185,7 @@ class GL2SurfaceEvaluator implements SurfaceEvaluator {
    * @param type what to enable
    */
   @Override
-  public void enable(int type) {
+  public void enable(final int type) {
     //DONE
     gl.glEnable(type);
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
index f83b3a8..a4507b7 100644
--- a/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/gl2/nurbs/GLUgl2nurbsImpl.java
@@ -37,7 +37,6 @@ import jogamp.opengl.glu.nurbs.*;
 
 import java.lang.reflect.Method;
 
-import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
 import javax.media.opengl.glu.GLUnurbs;
 
@@ -67,17 +66,17 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
   /**
    * Matrixes autoloading
    */
-  private boolean autoloadmode;
+  private final boolean autoloadmode;
 
   /**
    * Using callback
+   * private final int callBackFlag;
    */
-  private int callBackFlag;
 
   /**
    * Object for error call backs
+   * private final Object errorCallback;
    */
-  private Object errorCallback;
 
   /**
    * List of map definitions
@@ -116,33 +115,33 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Is curve modified
+   * private int isCurveModified;
    */
-  private int isCurveModified;
 
   /**
    * Object holding rendering settings
    */
-  private Renderhints renderhints;
+  private final Renderhints renderhints;
 
   /**
    * Display list
+   * private DisplayList dl;
    */
-  private DisplayList dl;
 
   /**
    * Object for subdividing curves and surfaces
    */
-  private Subdivider subdivider;
+  private final Subdivider subdivider;
 
   /**
    * Object responsible for rendering
+   * private Backend backend;
    */
-  private Backend backend;
 
   /**
    * Next picewise linear curve in linked list
+   * private O_pwlcurve nextPwlcurve;
    */
-  private O_pwlcurve nextPwlcurve;
 
   /**
    * Next trimming NURBS curve in linked list
@@ -156,13 +155,13 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Are there any changes in trimming
+   * private boolean isTrimModified;
    */
-  private boolean isTrimModified;
 
   /**
    * Are there any changes in surface data
+   * private boolean isDataSurfaceModified;
    */
-  private boolean isDataSurfaceModified;
 
   /**
    * Nurber of trmims of processed surface
@@ -181,20 +180,20 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
   /**
    * Nextr surface in linked list
+   * private O_nurbssurface nextNurbssurface;
    */
-  private O_nurbssurface nextNurbssurface;
 
   /**
    * Are there any changes in surface
+   * private boolean isSurfaceModified;
    */
-  private boolean isSurfaceModified;
 
   /**
    * Initializes default GLUgl2nurbs object
    */
   public GLUgl2nurbsImpl() {
     // DONE
-    maplist = new Maplist(backend);
+    maplist = new Maplist();
     renderhints = new Renderhints();
     subdivider = new Subdivider();
     // original code
@@ -221,13 +220,13 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
     defineMap(GL2.GL_MAP1_INDEX, 0, 1);
 
     setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_SAMPLINGMETHOD,
-                     (float) NurbsConsts.N_PATHLENGTH);
+                     NurbsConsts.N_PATHLENGTH);
     setnurbsproperty(GL2.GL_MAP1_VERTEX_4, NurbsConsts.N_SAMPLINGMETHOD,
-                     (float) NurbsConsts.N_PATHLENGTH);
+                     NurbsConsts.N_PATHLENGTH);
     setnurbsproperty(GL2.GL_MAP2_VERTEX_3, NurbsConsts.N_SAMPLINGMETHOD,
-                     (float) NurbsConsts.N_PATHLENGTH);
+                     NurbsConsts.N_PATHLENGTH);
     setnurbsproperty(GL2.GL_MAP2_VERTEX_4, NurbsConsts.N_SAMPLINGMETHOD,
-                     (float) NurbsConsts.N_PATHLENGTH);
+                     NurbsConsts.N_PATHLENGTH);
 
     setnurbsproperty(GL2.GL_MAP1_VERTEX_3, NurbsConsts.N_PIXEL_TOLERANCE,
                      (float) 50.0);
@@ -265,9 +264,9 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
     this.autoloadmode = true;
 
-    this.callBackFlag = 0;
+    // this.callBackFlag = 0;
 
-    this.errorCallback = null;
+    // this.errorCallback = null;
   }
 
   /**
@@ -276,7 +275,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param d
    *            distance
    */
-  private void set_domain_distance_u_rate(double d) {
+  private void set_domain_distance_u_rate(final double d) {
     // DONE
     subdivider.set_domain_distance_u_rate(d);
   }
@@ -287,7 +286,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param d
    *            distance
    */
-  private void set_domain_distance_v_rate(double d) {
+  private void set_domain_distance_v_rate(final double d) {
     // DONE
     subdivider.set_domain_distance_v_rate(d);
   }
@@ -297,7 +296,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    */
   public void bgncurve() {
     // DONE
-    O_curve o_curve = new O_curve();
+    final O_curve o_curve = new O_curve();
     thread("do_bgncurve", o_curve);
   }
 
@@ -309,19 +308,19 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param arg
    *            parameter to be passed to called method
    */
-  private void thread(String name, Object arg) {
+  private void thread(final String name, final Object arg) {
     // DONE
-    Class partype[] = new Class[1];
+    final Class<?> partype[] = new Class[1];
     partype[0] = arg.getClass();
     Method m;
     try {
       m = this.getClass().getMethod(name, partype);
-      if (dl != null) {
+      /* if (dl != null) {
         dl.append(this, m, arg);
-      } else {
+      } else */ {
         m.invoke(this, new Object[] { arg });
       }
-    } catch (Throwable e) {
+    } catch (final Throwable e) {
       e.printStackTrace();
     }
 
@@ -333,16 +332,16 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param name
    *            name of a method to be called
    */
-  private void thread2(String name) {
+  private void thread2(final String name) {
     // DONE
     try {
-      Method m = this.getClass().getMethod(name, (Class[]) null);
-      if (dl != null) {
+      final Method m = this.getClass().getMethod(name, (Class[]) null);
+      /* if (dl != null) {
         dl.append(this, m, null);
-      } else {
+      } else */ {
         m.invoke(this, (Object[]) null);
       }
-    } catch (Throwable e) {
+    } catch (final Throwable e) {
       e.printStackTrace();
     }
   }
@@ -353,7 +352,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param o_curve
    *            curve object
    */
-  public void do_bgncurve(O_curve o_curve) {
+  public void do_bgncurve(final O_curve o_curve) {
     if (inCurve > 0) {
       do_nurbserror(6);
       endcurve();
@@ -365,7 +364,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
     if (inTrim) {
       if (!nextCurve.equals(o_curve)) {
-        isCurveModified = 1;
+        // isCurveModified = 1;
         nextCurve = o_curve;
       }
     } else {
@@ -375,7 +374,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
     }
     nextCurve = o_curve.next;
     // kind of solution of union
-    nextPwlcurve = o_curve.o_pwlcurve;
+    // nextPwlcurve = o_curve.o_pwlcurve;
     nextNurbscurve = o_curve.o_nurbscurve;
   }
 
@@ -385,7 +384,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param o_surface
    *            surface object
    */
-  public void do_bgnsurface(O_surface o_surface) {
+  public void do_bgnsurface(final O_surface o_surface) {
     // DONE
     if (inSurface > 0) {
       do_nurbserror(27);
@@ -395,13 +394,13 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
     if (!playBack)
       bgnrender();
 
-    isTrimModified = false;
-    isDataSurfaceModified = false;
+    // isTrimModified = false;
+    // isDataSurfaceModified = false;
     isDataValid = 1;
     numTrims = 0;
     currentSurface = o_surface;
     nextTrim = o_surface.o_trim;
-    nextNurbssurface = o_surface.o_nurbssurface;
+    // nextNurbssurface = o_surface.o_nurbssurface;
   }
 
   /**
@@ -429,14 +428,14 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
     inSurface = 0;
 
-    nextNurbssurface = null;
+    // nextNurbssurface = null;
 
     if (isDataValid <= 0) {
       return;
     }
 
     if (nextTrim != null) {
-      isTrimModified = true;
+      // isTrimModified = true;
       nextTrim = null;
     }
 
@@ -507,7 +506,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param i
    *            error code
    */
-  private void do_nurbserror(int i) {
+  private void do_nurbserror(final int i) {
     // TODO nurberror
     //            System.out.println("TODO nurbserror " + i);
   }
@@ -553,10 +552,10 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param realType
    *            type of the curve
    */
-  public void nurbscurve(int nknots, float[] knot, int stride,
-                         float[] ctlarray, int order, int realType) {
+  public void nurbscurve(final int nknots, final float[] knot, final int stride,
+                         final float[] ctlarray, final int order, final int realType) {
     // DONE
-    Mapdesc mapdesc = maplist.locate(realType);
+    final Mapdesc mapdesc = maplist.locate(realType);
     if (mapdesc == null) {
       do_nurbserror(35);
       isDataValid = 0;
@@ -572,14 +571,14 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
       isDataValid = 0;
       return;
     }
-    Knotvector knots = new Knotvector(nknots, stride, order, knot);
+    final Knotvector knots = new Knotvector(nknots, stride, order, knot);
 
     if (!do_check_knots(knots, "curve"))
       return;
 
-    O_nurbscurve o_nurbscurve = new O_nurbscurve(realType);
+    final O_nurbscurve o_nurbscurve = new O_nurbscurve(realType);
     o_nurbscurve.bezier_curves = new Quilt(mapdesc);
-    CArrayOfFloats ctrlcarr = new CArrayOfFloats(ctlarray);
+    final CArrayOfFloats ctrlcarr = new CArrayOfFloats(ctlarray);
     o_nurbscurve.bezier_curves.toBezier(knots, ctrlcarr, mapdesc
                                         .getNCoords());
     thread("do_nurbscurve", o_nurbscurve);
@@ -594,9 +593,9 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    *            error message
    * @return knot vector is / is not valid
    */
-  public boolean do_check_knots(Knotvector knots, String msg) {
+  public boolean do_check_knots(final Knotvector knots, final String msg) {
     // DONE
-    int status = knots.validate();
+    final int status = knots.validate();
     if (status > 0) {
       do_nurbserror(status);
       if (renderhints.errorchecking != NurbsConsts.N_NOMSG)
@@ -611,7 +610,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param o_nurbscurve
    *            NURBS curve object
    */
-  public void do_nurbscurve(O_nurbscurve o_nurbscurve) {
+  public void do_nurbscurve(final O_nurbscurve o_nurbscurve) {
     // DONE
 
     if (inCurve <= 0) {
@@ -638,7 +637,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
 
     // if(!o_nurbscurve.equals(nextNurbscurve)){
     if (!o_nurbscurve.equals(currentCurve.o_nurbscurve)) {
-      isCurveModified = 1;
+      // isCurveModified = 1;
       currentCurve.o_nurbscurve = o_nurbscurve;
       // nextNurbscurve=o_nurbscurve;
 
@@ -647,15 +646,19 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
     nextNurbscurve = o_nurbscurve.next;
 
     if (!currentCurve.equals(o_nurbscurve.owner)) {
-      isCurveModified = 1;
+      // isCurveModified = 1;
       o_nurbscurve.owner = currentCurve;
     }
 
-    if (o_nurbscurve.owner == null)
+
+    /**
+    if (o_nurbscurve.owner == null) {
       isCurveModified = 1;
+    } */
 
-    if (inCurve == 2)
+    if (inCurve == 2) {
       endcurve();
+    }
   }
 
   /**
@@ -664,7 +667,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param o_nurbssurface
    *            NURBS surface object
    */
-  public void do_nurbssurface(O_nurbssurface o_nurbssurface) {
+  public void do_nurbssurface(final O_nurbssurface o_nurbssurface) {
     // DONE
     if (inSurface <= 0) {
       bgnsurface();
@@ -677,18 +680,18 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
     } else
       o_nurbssurface.used = true;
 
-    if (!o_nurbssurface.equals(nextNurbscurve)) {
-      isSurfaceModified = true;
+    // Always true, instances of diff classes are compared: if (!o_nurbssurface.equals(nextNurbscurve)) {
+      // isSurfaceModified = true;
       // nextNurbssurface=o_nurbssurface;
       currentSurface.o_nurbssurface = o_nurbssurface;
-    }
+    // }
 
     if (!currentSurface.equals(o_nurbssurface.owner)) {
-      isSurfaceModified = true;
+      // isSurfaceModified = true;
       o_nurbssurface.owner = currentSurface;
     }
 
-    nextNurbssurface = o_nurbssurface.next;
+    // nextNurbssurface = o_nurbssurface.next;
 
     if (inSurface == 2)
       endsurface();
@@ -712,7 +715,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param ncoords
    *            number of control point coordinates
    */
-  public void defineMap(int type, int rational, int ncoords) {
+  public void defineMap(final int type, final int rational, final int ncoords) {
     // DONE
     maplist.define(type, rational, ncoords);
   }
@@ -727,9 +730,9 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param value
    *            property value
    */
-  public void setnurbsproperty(int type, int tag, float value) {
+  public void setnurbsproperty(final int type, final int tag, final float value) {
     // DONE
-    Mapdesc mapdesc = maplist.locate(type);
+    final Mapdesc mapdesc = maplist.locate(type);
     if (mapdesc == null) {
       do_nurbserror(35);
       return;
@@ -738,7 +741,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
       do_nurbserror(26);
       return;
     }
-    Property prop = new Property(type, tag, value);
+    final Property prop = new Property(type, tag, value);
     thread("do_setnurbsproperty2", prop);
   }
 
@@ -748,8 +751,8 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param prop
    *            property
    */
-  public void do_setnurbsproperty2(Property prop) {
-    Mapdesc mapdesc = maplist.find(prop.type);
+  public void do_setnurbsproperty2(final Property prop) {
+    final Mapdesc mapdesc = maplist.find(prop.type);
     mapdesc.setProperty(prop.tag, prop.value);
   }
 
@@ -759,7 +762,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param prop
    *            property to be set
    */
-  public void do_setnurbsproperty(Property prop) {
+  public void do_setnurbsproperty(final Property prop) {
     // DONE
     renderhints.setProperty(prop);
     // TODO freeproperty?
@@ -771,7 +774,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param i
    *            domain distance sampling flag
    */
-  public void set_is_domain_distance_sampling(int i) {
+  public void set_is_domain_distance_sampling(final int i) {
     // DONE
     subdivider.set_is_domain_distance_sampling(i);
   }
@@ -781,7 +784,7 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    */
   public void bgnsurface() {
     // DONE
-    O_surface o_surface = new O_surface();
+    final O_surface o_surface = new O_surface();
     // TODO nuid
     //            System.out.println("TODO glunurbs.bgnsurface nuid");
     thread("do_bgnsurface", o_surface);
@@ -827,11 +830,11 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
    * @param type
    *            NURBS surface type (rational,...)
    */
-  public void nurbssurface(int sknot_count, float[] sknot, int tknot_count,
-                           float[] tknot, int s_stride, int t_stride, float[] ctlarray,
-                           int sorder, int torder, int type) {
+  public void nurbssurface(final int sknot_count, final float[] sknot, final int tknot_count,
+                           final float[] tknot, final int s_stride, final int t_stride, final float[] ctlarray,
+                           final int sorder, final int torder, final int type) {
     // DONE
-    Mapdesc mapdesc = maplist.locate(type);
+    final Mapdesc mapdesc = maplist.locate(type);
     if (mapdesc == null) {
       do_nurbserror(35);
       isDataValid = 0;
@@ -842,19 +845,19 @@ public class GLUgl2nurbsImpl implements GLUnurbs {
       isDataValid = 0;
       return;
     }
-    Knotvector sknotvector = new Knotvector(sknot_count, s_stride, sorder,
+    final Knotvector sknotvector = new Knotvector(sknot_count, s_stride, sorder,
                                             sknot);
     if (!do_check_knots(sknotvector, "surface"))
       return;
-    Knotvector tknotvector = new Knotvector(tknot_count, t_stride, torder,
+    final Knotvector tknotvector = new Knotvector(tknot_count, t_stride, torder,
                                             tknot);
     if (!do_check_knots(tknotvector, "surface"))
       return;
 
-    O_nurbssurface o_nurbssurface = new O_nurbssurface(type);
+    final O_nurbssurface o_nurbssurface = new O_nurbssurface(type);
     o_nurbssurface.bezier_patches = new Quilt(mapdesc);
 
-    CArrayOfFloats ctrlarr = new CArrayOfFloats(ctlarray);
+    final CArrayOfFloats ctrlarr = new CArrayOfFloats(ctlarray);
     o_nurbssurface.bezier_patches.toBezier(sknotvector, tknotvector,
                                            ctrlarr, mapdesc.getNCoords());
     thread("do_nurbssurface", o_nurbssurface);
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
index 81a99be..337d93b 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/BuildMipmap.java
@@ -46,9 +46,15 @@ package jogamp.opengl.glu.mipmap;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GL2ES3;
+import javax.media.opengl.GL2GL3;
 import javax.media.opengl.glu.GLU;
+
 import jogamp.opengl.Debug;
+
 import com.jogamp.common.nio.Buffers;
+
 import java.nio.*;
 import java.io.*;
 
@@ -65,9 +71,9 @@ public class BuildMipmap {
   public BuildMipmap() {
   }
 
-  public static int gluBuild1DMipmapLevelsCore( GL gl, int target, int internalFormat,
-                  int width, int widthPowerOf2, int format, int type, int userLevel,
-                  int baseLevel, int maxLevel, ByteBuffer data ) {
+  public static int gluBuild1DMipmapLevelsCore( final GL gl, final int target, final int internalFormat,
+                  final int width, final int widthPowerOf2, final int format, final int type, final int userLevel,
+                  final int baseLevel, final int maxLevel, final ByteBuffer data ) {
     int newwidth;
     int level, levels;
     ShortBuffer newImage = null;
@@ -75,9 +81,9 @@ public class BuildMipmap {
     ShortBuffer otherImage = null;
     ShortBuffer imageTemp = null;
     int memReq;
-    int maxsize;
+    final int maxsize;
     int cmpts;
-    PixelStorageModes psm = new PixelStorageModes();
+    final PixelStorageModes psm = new PixelStorageModes();
 
     assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
     assert( width >= 1 );
@@ -90,40 +96,40 @@ public class BuildMipmap {
     Mipmap.retrieveStoreModes( gl, psm );
     try {
       newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, 1, format,
-            GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
-    } catch( OutOfMemoryError ome ) {
+            GL.GL_UNSIGNED_SHORT ) ).asShortBuffer();
+    } catch( final OutOfMemoryError ome ) {
       return( GLU.GLU_OUT_OF_MEMORY );
     }
     newImage_width = width;
 
     Image.fill_image( psm, width, 1, format, type, Mipmap.is_index( format ), data, newImage );
     cmpts = Mipmap.elements_per_group( format, type );
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+    gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, 2 );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, 0 );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, 0 );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, 0 );
 
     // if swap_bytes was set, swapping occurred in fill_image
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+    gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, GL.GL_FALSE );
 
     for( level = userLevel; level <= levels; level++ ) {
       if( newImage_width == newwidth ) {
         // user newimage for this level
         if( baseLevel <= level && level <= maxLevel ) {
           gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0, format,
-                        GL2.GL_UNSIGNED_SHORT, newImage );
+                        GL.GL_UNSIGNED_SHORT, newImage );
         }
       } else {
         if( otherImage == null ) {
-          memReq = Mipmap.image_size( newwidth, 1, format, GL2.GL_UNSIGNED_SHORT );
+          memReq = Mipmap.image_size( newwidth, 1, format, GL.GL_UNSIGNED_SHORT );
           try {
             otherImage = Buffers.newDirectByteBuffer( memReq ).asShortBuffer();
-          } catch( OutOfMemoryError ome ) {
-            gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-            gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+          } catch( final OutOfMemoryError ome ) {
+            gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+            gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+            gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+            gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+            gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
             return( GLU.GLU_OUT_OF_MEMORY );
           }
         }
@@ -136,26 +142,26 @@ public class BuildMipmap {
         newImage_width = newwidth;
         if( baseLevel <= level && level <= maxLevel ) {
           gl.getGL2().glTexImage1D( target, level, internalFormat, newImage_width, 0,
-                            format, GL2.GL_UNSIGNED_SHORT, newImage );
+                            format, GL.GL_UNSIGNED_SHORT, newImage );
         }
       }
       if( newwidth > 1 ) {
         newwidth /= 2;
       }
     }
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+    gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+    gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
 
     return( 0 );
   }
 
-  public static int bitmapBuild2DMipmaps( GL gl, int target, int internalFormat,
-            int width, int height, int format, int type, ByteBuffer data ) {
-    int newwidth[] = new int[1];
-    int newheight[] = new int[1];
+  public static int bitmapBuild2DMipmaps( final GL gl, final int target, final int internalFormat,
+            final int width, final int height, final int format, final int type, final ByteBuffer data ) {
+    final int newwidth[] = new int[1];
+    final int newheight[] = new int[1];
     int level, levels;
     ShortBuffer newImage = null;
     int newImage_width;
@@ -163,9 +169,9 @@ public class BuildMipmap {
     ShortBuffer otherImage = null;
     ShortBuffer tempImage = null;
     int memReq;
-    int maxsize;
+    final int maxsize;
     int cmpts;
-    PixelStorageModes psm = new PixelStorageModes();
+    final PixelStorageModes psm = new PixelStorageModes();
 
     Mipmap.retrieveStoreModes( gl, psm );
 
@@ -179,8 +185,8 @@ public class BuildMipmap {
 
     try {
       newImage = Buffers.newDirectByteBuffer( Mipmap.image_size( width, height,
-            format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
-    } catch( OutOfMemoryError ome ) {
+            format, GL.GL_UNSIGNED_SHORT ) ).asShortBuffer();
+    } catch( final OutOfMemoryError ome ) {
       return( GLU.GLU_OUT_OF_MEMORY );
     }
     newImage_width = width;
@@ -189,30 +195,30 @@ public class BuildMipmap {
     Image.fill_image( psm, width, height, format, type, Mipmap.is_index( format ), data, newImage );
 
     cmpts = Mipmap.elements_per_group( format, type );
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 2 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+    gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, 2 );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, 0 );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, 0 );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, 0 );
 
     // if swap_bytes is set, swapping occurred in fill_image
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+    gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, GL.GL_FALSE );
 
     for( level = 0; level < levels; level++ ) {
       if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
         newImage.rewind();
         gl.glTexImage2D( target, level, internalFormat, newImage_width,
-            newImage_height, 0, format, GL2.GL_UNSIGNED_SHORT, newImage );
+            newImage_height, 0, format, GL.GL_UNSIGNED_SHORT, newImage );
       } else {
         if( otherImage == null ) {
-          memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL2.GL_UNSIGNED_SHORT );
+          memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL.GL_UNSIGNED_SHORT );
           try {
             otherImage = Buffers.newDirectByteBuffer( memReq ).asShortBuffer();
-          } catch( OutOfMemoryError ome ) {
-            gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-            gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+          } catch( final OutOfMemoryError ome ) {
+            gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+            gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+            gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+            gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+            gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
             return( GLU.GLU_OUT_OF_MEMORY );
           }
         }
@@ -227,7 +233,7 @@ public class BuildMipmap {
         newImage_height = newheight[0];
         newImage.rewind();
         gl.glTexImage2D( target, level, internalFormat, newImage_width, newImage_height,
-                                    0, format, GL2.GL_UNSIGNED_SHORT, newImage );
+                                    0, format, GL.GL_UNSIGNED_SHORT, newImage );
       }
       if( newheight[0] > 1 ) {
         newwidth[0] /= 2;
@@ -236,38 +242,38 @@ public class BuildMipmap {
         newheight[0] /= 2;
       }
     }
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+    gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+    gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
 
     return( 0 );
   }
 
-  public static int gluBuild2DMipmapLevelsCore( GL gl, int target, int internalFormat,
-                int width, int height, int widthPowerOf2, int heightPowerOf2,
-                int format, int type, int userLevel, int baseLevel, int maxLevel,
-                ByteBuffer data ) { // PointerWrapper data
+  public static int gluBuild2DMipmapLevelsCore( final GL gl, final int target, final int internalFormat,
+                final int width, final int height, final int widthPowerOf2, final int heightPowerOf2,
+                final int format, final int type, final int userLevel, final int baseLevel, final int maxLevel,
+                final ByteBuffer data ) { // PointerWrapper data
     int newwidth;
     int newheight;
     int level, levels;
-    int usersImage;
+    final int usersImage;
     ByteBuffer srcImage = null;
     ByteBuffer dstImage = null;
     ByteBuffer tempImage = null;
-    int newImage_width;
-    int newImage_height;
-    short[] SWAP_IMAGE = null;
+    final int newImage_width;
+    final int newImage_height;
+    final short[] SWAP_IMAGE = null;
     int memReq;
-    int maxsize;
+    final int maxsize;
     int cmpts;
     int mark=-1;
 
     boolean myswap_bytes;
     int groups_per_line, element_size, group_size;
     int rowsize, padding;
-    PixelStorageModes psm = new PixelStorageModes();
+    final PixelStorageModes psm = new PixelStorageModes();
 
     assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
     assert( width >= 1 && height >= 1 );
@@ -310,9 +316,9 @@ public class BuildMipmap {
     mark = psm.getUnpackSkipRows() * rowsize + psm.getUnpackSkipPixels() * group_size;
     data.position( mark );
 
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, 0 );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, 0 );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, 0 );
 
     level = userLevel;
 
@@ -324,11 +330,11 @@ public class BuildMipmap {
         gl.glTexImage2D( target, level, internalFormat, width, height, 0, format, type, data );
       }
       if( levels == 0 ) { /* we're done. clean up and return */
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+        gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
         return( 0 );
       }
       int nextWidth = newwidth / 2;
@@ -345,97 +351,97 @@ public class BuildMipmap {
 
       try {
         switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
-          case( GL2.GL_BYTE ):
-          case( GL2.GL_UNSIGNED_SHORT ):
-          case( GL2.GL_SHORT ):
-          case( GL2.GL_UNSIGNED_INT ):
-          case( GL2.GL_INT ):
-          case( GL2.GL_FLOAT ):
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+          case( GL.GL_UNSIGNED_BYTE ):
+          case( GL.GL_BYTE ):
+          case( GL.GL_UNSIGNED_SHORT ):
+          case( GL.GL_SHORT ):
+          case( GL.GL_UNSIGNED_INT ):
+          case( GL2ES2.GL_INT ):
+          case( GL.GL_FLOAT ):
+          case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+          case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+          case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
             dstImage = Buffers.newDirectByteBuffer( memReq );
             break;
           default:
             return( GLU.GLU_INVALID_ENUM );
         }
-      } catch( OutOfMemoryError ome ) {
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+      } catch( final OutOfMemoryError ome ) {
+        gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
         return( GLU.GLU_OUT_OF_MEMORY );
       }
       if( dstImage != null ) {
         switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
+          case( GL.GL_UNSIGNED_BYTE ):
             HalveImage.halveImage_ubyte( cmpts, width, height, data, dstImage, element_size, rowsize, group_size );
             break;
-          case( GL2.GL_BYTE ):
+          case( GL.GL_BYTE ):
             HalveImage.halveImage_byte( cmpts, width, height, data, dstImage, element_size, rowsize, group_size );
             break;
-          case( GL2.GL_UNSIGNED_SHORT ):
+          case( GL.GL_UNSIGNED_SHORT ):
             HalveImage.halveImage_ushort( cmpts, width, height, data, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
             break;
-          case( GL2.GL_SHORT ):
+          case( GL.GL_SHORT ):
             HalveImage.halveImage_short( cmpts, width, height, data, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
             break;
-          case( GL2.GL_UNSIGNED_INT ):
+          case( GL.GL_UNSIGNED_INT ):
             HalveImage.halveImage_uint( cmpts, width, height, data, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
             break;
-          case( GL2.GL_INT ):
+          case( GL2ES2.GL_INT ):
             HalveImage.halveImage_int( cmpts, width, height, data, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
             break;
-          case( GL2.GL_FLOAT ):
+          case( GL.GL_FLOAT ):
             HalveImage.halveImage_float( cmpts, width, height, data, dstImage.asFloatBuffer(), element_size, rowsize, group_size, myswap_bytes );
             break;
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-            assert( format == GL2.GL_RGB );
+          case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+            assert( format == GL.GL_RGB );
             HalveImage.halveImagePackedPixel( 3, new Extract332(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
             break;
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-            assert( format == GL2.GL_RGB );
+          case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+            assert( format == GL.GL_RGB );
             HalveImage.halveImagePackedPixel( 3, new Extract233rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
             break;
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+          case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
             HalveImage.halveImagePackedPixel( 3, new Extract565(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
             break;
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
             HalveImage.halveImagePackedPixel( 3, new Extract565rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
             break;
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
             HalveImage.halveImagePackedPixel( 4, new Extract4444(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
             break;
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
             HalveImage.halveImagePackedPixel( 4, new Extract4444rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
             break;
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
             HalveImage.halveImagePackedPixel( 4, new Extract5551(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
             break;
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
             HalveImage.halveImagePackedPixel( 4, new Extract1555rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
             break;
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
             HalveImage.halveImagePackedPixel( 4, new Extract8888(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
             break;
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
             HalveImage.halveImagePackedPixel( 4, new Extract8888rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
             break;
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+          case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
             HalveImage.halveImagePackedPixel( 4, new Extract1010102(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
             break;
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+          case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
             HalveImage.halveImagePackedPixel( 4, new Extract2101010rev(), width, height, data, dstImage, element_size, rowsize, myswap_bytes );
             break;
           default:
@@ -462,36 +468,36 @@ public class BuildMipmap {
       dstImage = tempImage;
       try {
         switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
-          case( GL2.GL_BYTE ):
-          case( GL2.GL_UNSIGNED_SHORT ):
-          case( GL2.GL_SHORT ):
-          case( GL2.GL_UNSIGNED_INT ):
-          case( GL2.GL_INT ):
-          case( GL2.GL_FLOAT ):
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+          case( GL.GL_UNSIGNED_BYTE ):
+          case( GL.GL_BYTE ):
+          case( GL.GL_UNSIGNED_SHORT ):
+          case( GL.GL_SHORT ):
+          case( GL.GL_UNSIGNED_INT ):
+          case( GL2ES2.GL_INT ):
+          case( GL.GL_FLOAT ):
+          case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+          case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+          case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
             dstImage = Buffers.newDirectByteBuffer( memReq );
             break;
           default:
             return( GLU.GLU_INVALID_ENUM );
         }
-      } catch( OutOfMemoryError ome ) {
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+      } catch( final OutOfMemoryError ome ) {
+        gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
         return( GLU.GLU_OUT_OF_MEMORY );
       }
       // level userLevel+1 is in srcImage; level userLevel already saved
@@ -500,113 +506,113 @@ public class BuildMipmap {
       memReq = Mipmap.image_size( newwidth, newheight, format, type );
       try {
         switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
-          case( GL2.GL_BYTE ):
-          case( GL2.GL_UNSIGNED_SHORT ):
-          case( GL2.GL_SHORT ):
-          case( GL2.GL_UNSIGNED_INT ):
-          case( GL2.GL_INT ):
-          case( GL2.GL_FLOAT ):
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+          case( GL.GL_UNSIGNED_BYTE ):
+          case( GL.GL_BYTE ):
+          case( GL.GL_UNSIGNED_SHORT ):
+          case( GL.GL_SHORT ):
+          case( GL.GL_UNSIGNED_INT ):
+          case( GL2ES2.GL_INT ):
+          case( GL.GL_FLOAT ):
+          case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+          case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+          case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
             dstImage = Buffers.newDirectByteBuffer( memReq );
             break;
           default:
             return( GLU.GLU_INVALID_ENUM );
         }
-      } catch( OutOfMemoryError ome ) {
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+      } catch( final OutOfMemoryError ome ) {
+        gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
         return( GLU.GLU_OUT_OF_MEMORY );
       }
       data.position( mark );
       switch( type ) {
-        case( GL2.GL_UNSIGNED_BYTE ):
+        case( GL.GL_UNSIGNED_BYTE ):
           ScaleInternal.scale_internal_ubyte( cmpts, width, height, data,
                 newwidth, newheight, dstImage, element_size, rowsize, group_size );
           break;
-        case( GL2.GL_BYTE ):
+        case( GL.GL_BYTE ):
           ScaleInternal.scale_internal_byte( cmpts, width, height, data, newwidth,
                   newheight, dstImage, element_size, rowsize, group_size );
           break;
-        case( GL2.GL_UNSIGNED_SHORT ):
+        case( GL.GL_UNSIGNED_SHORT ):
           ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth,
                   newheight, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
           break;
-        case( GL2.GL_SHORT ):
+        case( GL.GL_SHORT ):
           ScaleInternal.scale_internal_ushort( cmpts, width, height, data, newwidth,
                   newheight, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
           break;
-        case( GL2.GL_UNSIGNED_INT ):
+        case( GL.GL_UNSIGNED_INT ):
           ScaleInternal.scale_internal_uint( cmpts, width, height, data, newwidth,
                   newheight, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
           break;
-        case( GL2.GL_INT ):
+        case( GL2ES2.GL_INT ):
           ScaleInternal.scale_internal_int( cmpts, width, height, data, newwidth,
                   newheight, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
           break;
-        case( GL2.GL_FLOAT ):
+        case( GL.GL_FLOAT ):
           ScaleInternal.scale_internal_float( cmpts, width, height, data, newwidth,
                   newheight, dstImage.asFloatBuffer(), element_size, rowsize, group_size, myswap_bytes );
           break;
-        case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+        case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
           ScaleInternal.scaleInternalPackedPixel( 3, new Extract332(), width, height, data, newwidth,
               newheight, dstImage, element_size, rowsize, myswap_bytes );
           break;
-        case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+        case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
           ScaleInternal.scaleInternalPackedPixel( 3, new Extract233rev(), width, height, data, newwidth,
               newheight, dstImage, element_size, rowsize, myswap_bytes );
           break;
-        case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+        case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
           ScaleInternal.scaleInternalPackedPixel( 3, new Extract565(), width, height, data, newwidth,
               newheight, dstImage, element_size, rowsize, myswap_bytes );
           break;
-        case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+        case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
           ScaleInternal.scaleInternalPackedPixel( 3, new Extract565rev(), width, height, data, newwidth,
               newheight, dstImage, element_size, rowsize, myswap_bytes );
           break;
-        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+        case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
           ScaleInternal.scaleInternalPackedPixel( 4, new Extract4444(), width, height, data, newwidth,
               newheight, dstImage, element_size, rowsize, myswap_bytes );
           break;
-        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+        case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
           ScaleInternal.scaleInternalPackedPixel( 4, new Extract4444rev(), width, height, data, newwidth,
               newheight, dstImage, element_size, rowsize, myswap_bytes );
           break;
-        case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+        case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
           ScaleInternal.scaleInternalPackedPixel( 4, new Extract5551(), width, height, data, newwidth,
               newheight, dstImage, element_size, rowsize, myswap_bytes );
           break;
-        case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+        case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
           ScaleInternal.scaleInternalPackedPixel( 4, new Extract1555rev(), width, height, data, newwidth,
               newheight, dstImage, element_size, rowsize, myswap_bytes );
           break;
-        case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+        case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
           ScaleInternal.scaleInternalPackedPixel( 4, new Extract8888(), width, height, data, newwidth,
               newheight, dstImage, element_size, rowsize, myswap_bytes );
           break;
-        case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+        case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
           ScaleInternal.scaleInternalPackedPixel( 4, new Extract8888rev(), width, height, data, newwidth,
               newheight, dstImage, element_size, rowsize, myswap_bytes );
           break;
-        case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+        case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
           ScaleInternal.scaleInternalPackedPixel( 4, new Extract1010102(), width, height, data, newwidth,
               newheight, dstImage, element_size, rowsize, myswap_bytes );
           break;
-        case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+        case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
           ScaleInternal.scaleInternalPackedPixel( 4, new Extract2101010rev(), width, height, data, newwidth,
               newheight, dstImage, element_size, rowsize, myswap_bytes );
           break;
@@ -634,36 +640,36 @@ public class BuildMipmap {
         memReq = Mipmap.image_size( nextWidth, nextHeight, format, type );
         try {
           switch( type ) {
-            case( GL2.GL_UNSIGNED_BYTE ):
-            case( GL2.GL_BYTE ):
-            case( GL2.GL_UNSIGNED_SHORT ):
-            case( GL2.GL_SHORT ):
-            case( GL2.GL_UNSIGNED_INT ):
-            case( GL2.GL_INT ):
-            case( GL2.GL_FLOAT ):
-            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+            case( GL.GL_UNSIGNED_BYTE ):
+            case( GL.GL_BYTE ):
+            case( GL.GL_UNSIGNED_SHORT ):
+            case( GL.GL_SHORT ):
+            case( GL.GL_UNSIGNED_INT ):
+            case( GL2ES2.GL_INT ):
+            case( GL.GL_FLOAT ):
+            case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+            case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+            case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+            case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+            case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+            case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+            case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+            case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+            case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
               dstImage = Buffers.newDirectByteBuffer( memReq );
               break;
             default:
               return( GLU.GLU_INVALID_ENUM );
           }
-        } catch( OutOfMemoryError ome ) {
-          gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-          gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+        } catch( final OutOfMemoryError ome ) {
+          gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+          gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+          gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+          gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+          gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
           return( GLU.GLU_OUT_OF_MEMORY );
         }
       }
@@ -671,7 +677,7 @@ public class BuildMipmap {
       level = userLevel;
     }
 
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+    gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, GL.GL_FALSE );
     if( baseLevel <= level && level <= maxLevel ) {
       srcImage.rewind();
       gl.glTexImage2D( target, level, internalFormat, newwidth, newheight, 0, format, type, srcImage );
@@ -691,63 +697,63 @@ public class BuildMipmap {
       srcImage.rewind();
       dstImage.rewind();
       switch( type ) {
-        case( GL2.GL_UNSIGNED_BYTE ):
+        case( GL.GL_UNSIGNED_BYTE ):
           HalveImage.halveImage_ubyte( cmpts, newwidth, newheight, srcImage, dstImage, element_size, rowsize, group_size );
           break;
-        case( GL2.GL_BYTE ):
+        case( GL.GL_BYTE ):
           HalveImage.halveImage_byte( cmpts, newwidth, newheight, srcImage, dstImage, element_size, rowsize, group_size );
           break;
-        case( GL2.GL_UNSIGNED_SHORT ):
+        case( GL.GL_UNSIGNED_SHORT ):
           HalveImage.halveImage_ushort( cmpts, newwidth, newheight, srcImage, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
           break;
-        case( GL2.GL_SHORT ):
+        case( GL.GL_SHORT ):
           HalveImage.halveImage_short( cmpts, newwidth, newheight, srcImage, dstImage.asShortBuffer(), element_size, rowsize, group_size, myswap_bytes );
           break;
-        case( GL2.GL_UNSIGNED_INT ):
+        case( GL.GL_UNSIGNED_INT ):
           HalveImage.halveImage_uint( cmpts, newwidth, newheight, srcImage, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
           break;
-        case( GL2.GL_INT ):
+        case( GL2ES2.GL_INT ):
           HalveImage.halveImage_int( cmpts, newwidth, newheight, srcImage, dstImage.asIntBuffer(), element_size, rowsize, group_size, myswap_bytes );
           break;
-        case( GL2.GL_FLOAT ):
+        case( GL.GL_FLOAT ):
           HalveImage.halveImage_float( cmpts, newwidth, newheight, srcImage, dstImage.asFloatBuffer(), element_size, rowsize, group_size, myswap_bytes );
           break;
-        case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          assert( format == GL2.GL_RGB );
+        case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+          assert( format == GL.GL_RGB );
           HalveImage.halveImagePackedPixel( 3, new Extract332(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
             break;
-        case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          assert( format == GL2.GL_RGB );
+        case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          assert( format == GL.GL_RGB );
           HalveImage.halveImagePackedPixel( 3, new Extract233rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
             break;
-        case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+        case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
           HalveImage.halveImagePackedPixel( 3, new Extract565(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
             break;
-        case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+        case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
           HalveImage.halveImagePackedPixel( 3, new Extract565rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
             break;
-        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+        case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
           HalveImage.halveImagePackedPixel( 4, new Extract4444(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
             break;
-        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+        case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
           HalveImage.halveImagePackedPixel( 4, new Extract4444rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
             break;
-        case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+        case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
           HalveImage.halveImagePackedPixel( 4, new Extract5551(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
             break;
-        case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+        case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
           HalveImage.halveImagePackedPixel( 4, new Extract1555rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
             break;
-        case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+        case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
           HalveImage.halveImagePackedPixel( 4, new Extract8888(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
             break;
-        case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+        case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
           HalveImage.halveImagePackedPixel( 4, new Extract8888rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
             break;
-        case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+        case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
           HalveImage.halveImagePackedPixel( 4, new Extract1010102(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
             break;
-        case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+        case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
           HalveImage.halveImagePackedPixel( 4, new Extract2101010rev(), newwidth, newheight, srcImage, dstImage, element_size, rowsize, myswap_bytes );
             break;
         default:
@@ -768,7 +774,7 @@ public class BuildMipmap {
         newheight /= 2;
       }
       // compute amount to pad per row if any
-      int rowPad = rowsize % psm.getUnpackAlignment();
+      final int rowPad = rowsize % psm.getUnpackAlignment();
 
       // should row be padded
       if( rowPad == 0 ) {
@@ -788,21 +794,21 @@ public class BuildMipmap {
         }
       } else {
         // compute length of new row in bytes, including padding
-        int newRowLength = rowsize + psm.getUnpackAlignment() - rowPad;
+        final int newRowLength = rowsize + psm.getUnpackAlignment() - rowPad;
         int ii, jj;
-        int dstTrav;
-        int srcTrav;
+        final int dstTrav;
+        final int srcTrav;
 
         // allocate new image for mipmap of size newRowLength x newheight
         ByteBuffer newMipmapImage = null;
         try {
           newMipmapImage = ByteBuffer.allocateDirect( newRowLength * newheight );
-        } catch( OutOfMemoryError ome ) {
-          gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-          gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+        } catch( final OutOfMemoryError ome ) {
+          gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+          gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+          gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+          gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+          gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
           return( GLU.GLU_OUT_OF_MEMORY );
         }
         srcImage.rewind();
@@ -828,19 +834,19 @@ public class BuildMipmap {
         }
       }
     }
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
+    gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+    gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, (psm.getUnpackSwapBytes() ? 1 : 0) );
 
     return( 0 );
   }
 
-  public static int fastBuild2DMipmaps( GL gl, PixelStorageModes psm, int target,
-          int components, int width, int height, int format, int type, ByteBuffer data ) {
-    int[] newwidth = new int[1];
-    int[] newheight = new int[1];
+  public static int fastBuild2DMipmaps( final GL gl, final PixelStorageModes psm, final int target,
+          final int components, final int width, final int height, final int format, final int type, final ByteBuffer data ) {
+    final int[] newwidth = new int[1];
+    final int[] newheight = new int[1];
     int level, levels;
     ByteBuffer newImage;
     int newImage_width;
@@ -848,7 +854,7 @@ public class BuildMipmap {
     ByteBuffer otherImage;
     ByteBuffer imageTemp;
     int memReq;
-    int maxsize;
+    final int maxsize;
     int cmpts;
 
     Mipmap.closestFit( gl, target, width, height, components, format, type, newwidth,
@@ -876,12 +882,12 @@ public class BuildMipmap {
       int elements_per_line;
       int start;
       int iter;
-      int iter2;
+      final int iter2;
       int i, j;
 
       try {
-        newImage = Buffers.newDirectByteBuffer( Mipmap.image_size(width, height, format, GL2.GL_UNSIGNED_BYTE ) );
-      } catch( OutOfMemoryError err ) {
+        newImage = Buffers.newDirectByteBuffer( Mipmap.image_size(width, height, format, GL.GL_UNSIGNED_BYTE ) );
+      } catch( final OutOfMemoryError err ) {
         return( GLU.GLU_OUT_OF_MEMORY );
       }
       newImage_width = width;
@@ -907,29 +913,29 @@ public class BuildMipmap {
       }
     }
 
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, 1 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+    gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, 1 );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, 0 );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, 0 );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, 0 );
+    gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, GL.GL_FALSE );
 
     for( level = 0; level <= levels; level++ ) {
       if( newImage_width == newwidth[0] && newImage_height == newheight[0] ) {
         // use newImage for this level
         newImage.rewind();
         gl.glTexImage2D( target, level, components, newImage_width, newImage_height,
-                0, format, GL2.GL_UNSIGNED_BYTE, newImage );
+                0, format, GL.GL_UNSIGNED_BYTE, newImage );
       } else {
         if( otherImage == null ) {
-          memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL2.GL_UNSIGNED_BYTE );
+          memReq = Mipmap.image_size( newwidth[0], newheight[0], format, GL.GL_UNSIGNED_BYTE );
           try {
             otherImage = Buffers.newDirectByteBuffer( memReq );
-          } catch( OutOfMemoryError err ) {
-            gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-            gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-            gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
+          } catch( final OutOfMemoryError err ) {
+            gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+            gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+            gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+            gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+            gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
             return( GLU.GLU_OUT_OF_MEMORY );
           }
         }
@@ -942,7 +948,7 @@ public class BuildMipmap {
         newImage_height = newheight[0];
         newImage.rewind();
         gl.glTexImage2D( target, level, components, newImage_width, newImage_height,
-                0, format, GL2.GL_UNSIGNED_BYTE, newImage );
+                0, format, GL.GL_UNSIGNED_BYTE, newImage );
       }
       if( newwidth[0] > 1 ) {
         newwidth[0] /= 2;
@@ -951,30 +957,30 @@ public class BuildMipmap {
         newheight[0] /= 2;
       }
     }
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
+    gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+    gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, ( psm.getUnpackSwapBytes() ? 1 : 0 ) ) ;
 
     return( 0 );
   }
 
-  public static int gluBuild3DMipmapLevelsCore( GL gl, int target, int internalFormat,
-          int width, int height, int depth, int widthPowerOf2, int heightPowerOf2,
-          int depthPowerOf2, int format, int type, int userLevel, int baseLevel,
-          int maxLevel, ByteBuffer data ) {
+  public static int gluBuild3DMipmapLevelsCore( final GL gl, final int target, final int internalFormat,
+          final int width, final int height, final int depth, final int widthPowerOf2, final int heightPowerOf2,
+          final int depthPowerOf2, final int format, final int type, final int userLevel, final int baseLevel,
+          final int maxLevel, final ByteBuffer data ) {
     int newWidth;
     int newHeight;
     int newDepth;
     int level, levels;
     ByteBuffer usersImage;
     ByteBuffer srcImage, dstImage, tempImage;
-    int newImageWidth;
-    int newImageHeight;
-    int newImageDepth;
+    final int newImageWidth;
+    final int newImageHeight;
+    final int newImageDepth;
     int memReq;
-    int maxSize;
+    final int maxSize;
     int cmpts;
     int mark=-1;
 
@@ -982,7 +988,7 @@ public class BuildMipmap {
     int groupsPerLine, elementSize, groupSize;
     int rowsPerImage, imageSize;
     int rowSize, padding;
-    PixelStorageModes psm = new PixelStorageModes();
+    final PixelStorageModes psm = new PixelStorageModes();
 
     assert( Mipmap.checkMipmapArgs( internalFormat, format, type ) == 0 );
     assert( width >= 1 && height >= 1 && depth >= 1 );
@@ -1041,11 +1047,11 @@ public class BuildMipmap {
            psm.getUnpackSkipImages() * imageSize;
     usersImage.position( mark );
 
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, 0 );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, 0 );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, 0 );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, 0 );
+    gl.glPixelStorei( GL2ES3.GL_UNPACK_SKIP_IMAGES, 0 );
+    gl.glPixelStorei( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, 0 );
 
     level = userLevel;
 
@@ -1056,13 +1062,13 @@ public class BuildMipmap {
                 0, format, type, usersImage );
       }
       if( levels == 0 ) { /* we're done. clean up and return */
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
-        gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+        gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+        gl.glPixelStorei( GL2ES3.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+        gl.glPixelStorei( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
         return( 0 );
       }
       int nextWidth = newWidth / 2;
@@ -1082,44 +1088,44 @@ public class BuildMipmap {
       memReq = Mipmap.imageSize3D( nextWidth, nextHeight, nextDepth, format, type );
       try {
         switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
-          case( GL2.GL_BYTE ):
-          case( GL2.GL_UNSIGNED_SHORT ):
-          case( GL2.GL_SHORT ):
-          case( GL2.GL_UNSIGNED_INT ):
-          case( GL2.GL_INT ):
-          case( GL2.GL_FLOAT ):
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+          case( GL.GL_UNSIGNED_BYTE ):
+          case( GL.GL_BYTE ):
+          case( GL.GL_UNSIGNED_SHORT ):
+          case( GL.GL_SHORT ):
+          case( GL.GL_UNSIGNED_INT ):
+          case( GL2ES2.GL_INT ):
+          case( GL.GL_FLOAT ):
+          case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+          case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+          case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
             dstImage = Buffers.newDirectByteBuffer( memReq );
             break;
           default:
             return( GLU.GLU_INVALID_ENUM );
         }
-      } catch( OutOfMemoryError err ) {
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
-        gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+      } catch( final OutOfMemoryError err ) {
+        gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+        gl.glPixelStorei( GL2ES3.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+        gl.glPixelStorei( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
         return( GLU.GLU_OUT_OF_MEMORY );
       }
 
       if( dstImage != null ) {
         switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
+          case( GL.GL_UNSIGNED_BYTE ):
             if( depth > 1 ) {
               HalveImage.halveImage3D( cmpts, new ExtractUByte(), width, height, depth,
                       usersImage, dstImage, elementSize,
@@ -1129,7 +1135,7 @@ public class BuildMipmap {
                       dstImage, elementSize, rowSize, groupSize );
             }
             break;
-          case( GL2.GL_BYTE ):
+          case( GL.GL_BYTE ):
             if( depth > 1 ) {
               HalveImage.halveImage3D( cmpts, new ExtractSByte(), width, height, depth,
                       usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1139,7 +1145,7 @@ public class BuildMipmap {
                       dstImage, elementSize, rowSize, groupSize );
             }
             break;
-          case( GL2.GL_UNSIGNED_SHORT ):
+          case( GL.GL_UNSIGNED_SHORT ):
             if( depth > 1 ) {
               HalveImage.halveImage3D( cmpts, new ExtractUShort(), width, height, depth,
                       usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1149,7 +1155,7 @@ public class BuildMipmap {
                       dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
             }
             break;
-          case( GL2.GL_SHORT ):
+          case( GL.GL_SHORT ):
             if( depth > 1 ) {
               HalveImage.halveImage3D( cmpts, new ExtractSShort(), width, height, depth,
                       usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1159,7 +1165,7 @@ public class BuildMipmap {
                       dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
             }
             break;
-          case( GL2.GL_UNSIGNED_INT ):
+          case( GL.GL_UNSIGNED_INT ):
             if( depth > 1 ) {
               HalveImage.halveImage3D( cmpts, new ExtractUInt(), width, height, depth,
                       usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1169,7 +1175,7 @@ public class BuildMipmap {
                       dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
             }
             break;
-          case( GL2.GL_INT ):
+          case( GL2ES2.GL_INT ):
             if( depth > 1 ) {
               HalveImage.halveImage3D( cmpts, new ExtractSInt(), width, height, depth,
                       usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1179,7 +1185,7 @@ public class BuildMipmap {
                       dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
             }
             break;
-          case( GL2.GL_FLOAT ):
+          case( GL.GL_FLOAT ):
             if( depth > 1 ) {
               HalveImage.halveImage3D( cmpts, new ExtractFloat(), width, height, depth,
                       usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1189,53 +1195,53 @@ public class BuildMipmap {
                       dstImage.asFloatBuffer(), elementSize, rowSize, groupSize, myswapBytes );
             }
             break;
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-            assert( format == GL2.GL_RGB );
+          case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+            assert( format == GL.GL_RGB );
             HalveImage.halveImagePackedPixel3D( 3, new Extract332(), width, height, depth, usersImage,
                     dstImage, elementSize, rowSize, imageSize, myswapBytes );
             break;
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-            assert( format == GL2.GL_RGB );
+          case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+            assert( format == GL.GL_RGB );
             HalveImage.halveImagePackedPixel3D( 3, new Extract233rev(), width, height, depth, usersImage,
                     dstImage, elementSize, rowSize, imageSize, myswapBytes );
             break;
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+          case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
             HalveImage.halveImagePackedPixel3D( 3, new Extract565(), width, height, depth, usersImage,
                     dstImage, elementSize, rowSize, imageSize, myswapBytes );
             break;
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
             HalveImage.halveImagePackedPixel3D( 3, new Extract565rev(), width, height, depth, usersImage,
                     dstImage, elementSize, rowSize, imageSize, myswapBytes );
             break;
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
             HalveImage.halveImagePackedPixel3D( 4, new Extract4444(), width, height, depth, usersImage,
                     dstImage, elementSize, rowSize, imageSize, myswapBytes );
             break;
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
             HalveImage.halveImagePackedPixel3D( 4, new Extract4444rev(), width, height, depth, usersImage,
                     dstImage, elementSize, rowSize, imageSize, myswapBytes );
             break;
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
             HalveImage.halveImagePackedPixel3D( 4, new Extract5551(), width, height, depth, usersImage,
                     dstImage, elementSize, rowSize, imageSize, myswapBytes );
             break;
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
             HalveImage.halveImagePackedPixel3D( 4, new Extract1555rev(), width, height, depth, usersImage,
                     dstImage, elementSize, rowSize, imageSize, myswapBytes );
             break;
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
             HalveImage.halveImagePackedPixel3D( 4, new Extract8888(), width, height, depth, usersImage,
                     dstImage, elementSize, rowSize, imageSize, myswapBytes );
             break;
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
             HalveImage.halveImagePackedPixel3D( 4, new Extract8888rev(), width, height, depth, usersImage,
                     dstImage, elementSize, rowSize, imageSize, myswapBytes );
             break;
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+          case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
             HalveImage.halveImagePackedPixel3D( 4, new Extract1010102(), width, height, depth, usersImage,
                     dstImage, elementSize, rowSize, imageSize, myswapBytes );
             break;
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+          case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
             HalveImage.halveImagePackedPixel3D( 4, new Extract2101010rev(), width, height, depth, usersImage,
                     dstImage, elementSize, rowSize, imageSize, myswapBytes );
             break;
@@ -1268,38 +1274,38 @@ public class BuildMipmap {
       dstImage = tempImage;
       try {
         switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
-          case( GL2.GL_BYTE ):
-          case( GL2.GL_UNSIGNED_SHORT ):
-          case( GL2.GL_SHORT ):
-          case( GL2.GL_UNSIGNED_INT ):
-          case( GL2.GL_INT ):
-          case( GL2.GL_FLOAT ):
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+          case( GL.GL_UNSIGNED_BYTE ):
+          case( GL.GL_BYTE ):
+          case( GL.GL_UNSIGNED_SHORT ):
+          case( GL.GL_SHORT ):
+          case( GL.GL_UNSIGNED_INT ):
+          case( GL2ES2.GL_INT ):
+          case( GL.GL_FLOAT ):
+          case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+          case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+          case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
             dstImage = Buffers.newDirectByteBuffer( memReq );
             break;
           default:
             return( GLU.GLU_INVALID_ENUM );
         }
-      } catch( OutOfMemoryError err ) {
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
-        gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+      } catch( final OutOfMemoryError err ) {
+        gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+        gl.glPixelStorei( GL2ES3.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+        gl.glPixelStorei( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
         return( GLU.GLU_OUT_OF_MEMORY );
       }
 
@@ -1309,38 +1315,38 @@ public class BuildMipmap {
       memReq = Mipmap.imageSize3D( newWidth, newHeight, newDepth, format, type );
       try {
         switch( type ) {
-          case( GL2.GL_UNSIGNED_BYTE ):
-          case( GL2.GL_BYTE ):
-          case( GL2.GL_UNSIGNED_SHORT ):
-          case( GL2.GL_SHORT ):
-          case( GL2.GL_UNSIGNED_INT ):
-          case( GL2.GL_INT ):
-          case( GL2.GL_FLOAT ):
-          case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-          case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-          case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-          case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-          case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-          case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-          case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-          case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-          case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+          case( GL.GL_UNSIGNED_BYTE ):
+          case( GL.GL_BYTE ):
+          case( GL.GL_UNSIGNED_SHORT ):
+          case( GL.GL_SHORT ):
+          case( GL.GL_UNSIGNED_INT ):
+          case( GL2ES2.GL_INT ):
+          case( GL.GL_FLOAT ):
+          case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+          case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+          case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+          case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+          case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+          case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+          case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+          case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+          case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
             dstImage = Buffers.newDirectByteBuffer( memReq );
             break;
           default:
             return( GLU.GLU_INVALID_ENUM );
         }
-      } catch( OutOfMemoryError err ) {
-        gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-        gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-        gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
-        gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
-        gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+      } catch( final OutOfMemoryError err ) {
+        gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+        gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+        gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+        gl.glPixelStorei( GL2ES3.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+        gl.glPixelStorei( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
         return( GLU.GLU_OUT_OF_MEMORY );
       }
 
@@ -1371,38 +1377,38 @@ public class BuildMipmap {
         memReq = Mipmap.imageSize3D( nextWidth, nextHeight, nextDepth, format, type );
         try {
           switch( type ) {
-            case( GL2.GL_UNSIGNED_BYTE ):
-            case( GL2.GL_BYTE ):
-            case( GL2.GL_UNSIGNED_SHORT ):
-            case( GL2.GL_SHORT ):
-            case( GL2.GL_UNSIGNED_INT ):
-            case( GL2.GL_INT ):
-            case( GL2.GL_FLOAT ):
-            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
-            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
-            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
-            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
-            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+            case( GL.GL_UNSIGNED_BYTE ):
+            case( GL.GL_BYTE ):
+            case( GL.GL_UNSIGNED_SHORT ):
+            case( GL.GL_SHORT ):
+            case( GL.GL_UNSIGNED_INT ):
+            case( GL2ES2.GL_INT ):
+            case( GL.GL_FLOAT ):
+            case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
+            case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
+            case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
+            case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+            case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+            case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
+            case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
+            case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+            case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
               dstImage = Buffers.newDirectByteBuffer( memReq );
               break;
             default:
               return( GLU.GLU_INVALID_ENUM );
           }
-        } catch( OutOfMemoryError err ) {
-          gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-          gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-          gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
-          gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
-          gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+        } catch( final OutOfMemoryError err ) {
+          gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+          gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+          gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+          gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+          gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+          gl.glPixelStorei( GL2ES3.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+          gl.glPixelStorei( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
           return( GLU.GLU_OUT_OF_MEMORY );
         }
       }
@@ -1410,7 +1416,7 @@ public class BuildMipmap {
       level = userLevel;
     }
 
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, GL2.GL_FALSE );
+    gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, GL.GL_FALSE );
     if( baseLevel <= level && level <= maxLevel ) {
       usersImage.position( mark );
       gl.getGL2().glTexImage3D( target, level, internalFormat, width, height, depth,
@@ -1419,7 +1425,7 @@ public class BuildMipmap {
     level++;
     for( ; level <= levels; level++ ) {
       switch( type ) {
-        case( GL2.GL_UNSIGNED_BYTE ):
+        case( GL.GL_UNSIGNED_BYTE ):
           if( depth > 1 ) {
             HalveImage.halveImage3D( cmpts, new ExtractUByte(), width, height, depth,
                     usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1429,7 +1435,7 @@ public class BuildMipmap {
                     dstImage, elementSize, rowSize, groupSize );
           }
           break;
-        case( GL2.GL_BYTE ):
+        case( GL.GL_BYTE ):
           if( depth > 1 ) {
             HalveImage.halveImage3D( cmpts, new ExtractSByte(), width, height, depth,
                     usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1439,7 +1445,7 @@ public class BuildMipmap {
                     dstImage, elementSize, rowSize, groupSize );
           }
           break;
-        case( GL2.GL_UNSIGNED_SHORT ):
+        case( GL.GL_UNSIGNED_SHORT ):
           if( depth > 1 ) {
             HalveImage.halveImage3D( cmpts, new ExtractUShort(), width, height, depth,
                     usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1449,7 +1455,7 @@ public class BuildMipmap {
                     dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
           }
           break;
-        case( GL2.GL_SHORT ):
+        case( GL.GL_SHORT ):
           if( depth > 1 ) {
             HalveImage.halveImage3D( cmpts, new ExtractSShort(), width, height, depth,
                     usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1459,7 +1465,7 @@ public class BuildMipmap {
                     dstImage.asShortBuffer(), elementSize, rowSize, groupSize, myswapBytes );
           }
           break;
-        case( GL2.GL_UNSIGNED_INT ):
+        case( GL.GL_UNSIGNED_INT ):
           if( depth > 1 ) {
             HalveImage.halveImage3D( cmpts, new ExtractUInt(), width, height, depth,
                     usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1469,7 +1475,7 @@ public class BuildMipmap {
                     dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
           }
           break;
-        case( GL2.GL_INT ):
+        case( GL2ES2.GL_INT ):
           if( depth > 1 ) {
             HalveImage.halveImage3D( cmpts, new ExtractSInt(), width, height, depth,
                     usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1479,7 +1485,7 @@ public class BuildMipmap {
                     dstImage.asIntBuffer(), elementSize, rowSize, groupSize, myswapBytes );
           }
           break;
-        case( GL2.GL_FLOAT ):
+        case( GL.GL_FLOAT ):
           if( depth > 1 ) {
             HalveImage.halveImage3D( cmpts, new ExtractFloat(), width, height, depth,
                     usersImage, dstImage, elementSize, groupSize, rowSize,
@@ -1489,51 +1495,51 @@ public class BuildMipmap {
                     dstImage.asFloatBuffer(), elementSize, rowSize, groupSize, myswapBytes );
           }
           break;
-        case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+        case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
           HalveImage.halveImagePackedPixel3D( 3, new Extract332(), width, height, depth, usersImage,
                   dstImage, elementSize, rowSize, imageSize, myswapBytes );
           break;
-        case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+        case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
           HalveImage.halveImagePackedPixel3D( 3, new Extract233rev(), width, height, depth, usersImage,
                   dstImage, elementSize, rowSize, imageSize, myswapBytes );
           break;
-        case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+        case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
           HalveImage.halveImagePackedPixel3D( 3, new Extract565(), width, height, depth, usersImage,
                   dstImage, elementSize, rowSize, imageSize, myswapBytes );
           break;
-        case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+        case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
           HalveImage.halveImagePackedPixel3D( 3, new Extract565rev(), width, height, depth, usersImage,
                   dstImage, elementSize, rowSize, imageSize, myswapBytes );
           break;
-        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+        case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
           HalveImage.halveImagePackedPixel3D( 4, new Extract4444(), width, height, depth, usersImage,
                   dstImage, elementSize, rowSize, imageSize, myswapBytes );
           break;
-        case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+        case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
           HalveImage.halveImagePackedPixel3D( 4, new Extract4444rev(), width, height, depth, usersImage,
                   dstImage, elementSize, rowSize, imageSize, myswapBytes );
           break;
-        case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+        case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
           HalveImage.halveImagePackedPixel3D( 4, new Extract5551(), width, height, depth, usersImage,
                   dstImage, elementSize, rowSize, imageSize, myswapBytes );
           break;
-        case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+        case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
           HalveImage.halveImagePackedPixel3D( 4, new Extract1555rev(), width, height, depth, usersImage,
                   dstImage, elementSize, rowSize, imageSize, myswapBytes );
           break;
-        case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+        case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
           HalveImage.halveImagePackedPixel3D( 4, new Extract8888(), width, height, depth, usersImage,
                   dstImage, elementSize, rowSize, imageSize, myswapBytes );
           break;
-        case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+        case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
           HalveImage.halveImagePackedPixel3D( 4, new Extract8888rev(), width, height, depth, usersImage,
                   dstImage, elementSize, rowSize, imageSize, myswapBytes );
           break;
-        case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+        case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
           HalveImage.halveImagePackedPixel3D( 4, new Extract1010102(), width, height, depth, usersImage,
                   dstImage, elementSize, rowSize, imageSize, myswapBytes );
           break;
-        case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+        case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
           HalveImage.halveImagePackedPixel3D( 4, new Extract2101010rev(), width, height, depth, usersImage,
                   dstImage, elementSize, rowSize, imageSize, myswapBytes );
           break;
@@ -1563,22 +1569,22 @@ public class BuildMipmap {
                 0, format, type, usersImage );
       }
     }
-    gl.glPixelStorei( GL2.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
-    gl.glPixelStorei( GL2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
-    gl.glPixelStorei( GL2.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
-    gl.glPixelStorei( GL2.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
-    gl.glPixelStorei( GL2.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
+    gl.glPixelStorei( GL.GL_UNPACK_ALIGNMENT, psm.getUnpackAlignment() );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_ROWS, psm.getUnpackSkipRows() );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_SKIP_PIXELS, psm.getUnpackSkipPixels() );
+    gl.glPixelStorei( GL2ES2.GL_UNPACK_ROW_LENGTH, psm.getUnpackRowLength() );
+    gl.glPixelStorei( GL2GL3.GL_UNPACK_SWAP_BYTES, psm.getUnpackSwapBytes() ? 1 : 0 );
+    gl.glPixelStorei( GL2ES3.GL_UNPACK_SKIP_IMAGES, psm.getUnpackSkipImages() );
+    gl.glPixelStorei( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, psm.getUnpackImageHeight() );
     return( 0 );
   }
 
   private static final int TARGA_HEADER_SIZE = 18;
-  private static void writeTargaFile(String filename, ByteBuffer data,
-                                     int width, int height) {
+  private static void writeTargaFile(final String filename, final ByteBuffer data,
+                                     final int width, final int height) {
     try {
-      FileOutputStream fos = new FileOutputStream(new File(filename));
-      ByteBuffer header = ByteBuffer.allocateDirect(TARGA_HEADER_SIZE);
+      final FileOutputStream fos = new FileOutputStream(new File(filename));
+      final ByteBuffer header = ByteBuffer.allocateDirect(TARGA_HEADER_SIZE);
       header.put(0, (byte) 0).put(1, (byte) 0);
       header.put(2, (byte) 2); // uncompressed type
       header.put(12, (byte) (width & 0xFF)); // width
@@ -1590,7 +1596,7 @@ public class BuildMipmap {
       fos.write(data.array());
       data.clear();
       fos.close();
-    } catch (IOException e) {
+    } catch (final IOException e) {
       e.printStackTrace();
     }
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
index 0c155ff..fe9c15e 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1010102.java
@@ -57,7 +57,7 @@ public class Extract1010102 implements Extract {
   }
 
   @Override
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+  public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
     long uint = 0;
 
     if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract1010102 implements Extract {
     // 00000000,00000000,00001111,11111100 == 0x00000FFC
     // 00000000,00000000,00000000,00000011 == 0x00000003
 
-    extractComponents[0] = (float)( ( uint & 0xFFC00000 ) >> 22 ) / 1023.0f;
-    extractComponents[1] = (float)( ( uint & 0x003FF000 ) >> 12 ) / 1023.0f;
-    extractComponents[2] = (float)( ( uint & 0x00000FFC ) >>  2 ) / 1023.0f;
-    extractComponents[3] = (float)( ( uint & 0x00000003 )       ) / 3.0f;
+    extractComponents[0] = ( ( uint & 0xFFC00000 ) >> 22 ) / 1023.0f;
+    extractComponents[1] = ( ( uint & 0x003FF000 ) >> 12 ) / 1023.0f;
+    extractComponents[2] = ( ( uint & 0x00000FFC ) >>  2 ) / 1023.0f;
+    extractComponents[3] = ( ( uint & 0x00000003 )       ) / 3.0f;
   }
 
   @Override
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+  public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
     // 00000000,11110000 == 0x00F0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
index 5208ea5..d619502 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract1555rev.java
@@ -57,7 +57,7 @@ public class Extract1555rev implements Extract {
   }
 
   @Override
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+  public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
     int ushort = 0;
 
     if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract1555rev implements Extract {
     // 01111100,00000000 == 0x7C00
     // 10000000,00000000 == 0x8000
 
-    extractComponents[0] = (float)( ( ushort & 0x001F )       ) / 31.0f;
-    extractComponents[1] = (float)( ( ushort & 0x003E ) >>  5 ) / 31.0f;
-    extractComponents[2] = (float)( ( ushort & 0x7C00 ) >>  10) / 31.0f;
-    extractComponents[3] = (float)( ( ushort & 0x8000 ) >>  15);
+    extractComponents[0] = ( ( ushort & 0x001F )       ) / 31.0f;
+    extractComponents[1] = ( ( ushort & 0x003E ) >>  5 ) / 31.0f;
+    extractComponents[2] = ( ( ushort & 0x7C00 ) >>  10) / 31.0f;
+    extractComponents[3] = ( ushort & 0x8000 ) >>  15;
   }
 
   @Override
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+  public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
     // 00000000,00011111 == 0x001F
     // 00000011,11100000 == 0x03E0
     // 01111100,00000000 == 0x7C00
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
index 1bf8abc..9d00bad 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract2101010rev.java
@@ -57,7 +57,7 @@ public class Extract2101010rev implements Extract {
   }
 
   @Override
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+  public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
     long uint = 0;
 
     if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract2101010rev implements Extract {
     // 00000000,00000000,00001111,11111100 == 0x00000FFC
     // 00000000,00000000,00000000,00000011 == 0x00000003
 
-    extractComponents[0] = (float)( ( uint & 0x000003FF )       ) / 1023.0f;
-    extractComponents[1] = (float)( ( uint & 0x000FFC00 ) >> 10 ) / 1023.0f;
-    extractComponents[2] = (float)( ( uint & 0x3FF00000 ) >> 20 ) / 1023.0f;
-    extractComponents[3] = (float)( ( uint & 0xC0000000 ) >> 30 ) / 3.0f;
+    extractComponents[0] = ( ( uint & 0x000003FF )       ) / 1023.0f;
+    extractComponents[1] = ( ( uint & 0x000FFC00 ) >> 10 ) / 1023.0f;
+    extractComponents[2] = ( ( uint & 0x3FF00000 ) >> 20 ) / 1023.0f;
+    extractComponents[3] = ( ( uint & 0xC0000000 ) >> 30 ) / 3.0f;
   }
 
   @Override
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+  public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
     // 00000000,11110000 == 0x00F0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
index c86b39e..3bc7975 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract233rev.java
@@ -57,18 +57,18 @@ public class Extract233rev implements Extract {
   }
 
   @Override
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+  public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
     // 11100000 == 0xe0
     // 00011100 == 0x1c
     // 00000011 == 0x03
-    byte ubyte = packedPixel.get();
-    extractComponents[0] = (float)((ubyte & 0x07) ) / 7.0f;
-    extractComponents[1] = (float)((ubyte & 0x38) >> 3) / 7.0f;
-    extractComponents[2] = (float)((ubyte & 0xC0) >> 6) / 3.0f;
+    final byte ubyte = packedPixel.get();
+    extractComponents[0] = ((ubyte & 0x07) ) / 7.0f;
+    extractComponents[1] = ((ubyte & 0x38) >> 3) / 7.0f;
+    extractComponents[2] = ((ubyte & 0xC0) >> 6) / 3.0f;
   }
 
   @Override
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+  public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
     // 11100000 == 0xE0
     // 00011100 == 0x1C
     // 00000011 == 0x03
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
index 706f0c3..93983f1 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract332.java
@@ -57,18 +57,18 @@ public class Extract332 implements Extract {
   }
 
   @Override
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+  public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
     // 11100000 == 0xe0
     // 00011100 == 0x1c
     // 00000011 == 0x03
-    byte ubyte = packedPixel.get();
-    extractComponents[0] = (float)((ubyte & 0xe0) >> 5) / 7.0f;
-    extractComponents[1] = (float)((ubyte & 0x1c) >> 2) / 7.0f;
-    extractComponents[2] = (float)((ubyte & 0x03)) / 3.0f;
+    final byte ubyte = packedPixel.get();
+    extractComponents[0] = ((ubyte & 0xe0) >> 5) / 7.0f;
+    extractComponents[1] = ((ubyte & 0x1c) >> 2) / 7.0f;
+    extractComponents[2] = ((ubyte & 0x03)) / 3.0f;
   }
 
   @Override
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+  public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
     // 11100000 == 0xE0
     // 00011100 == 0x1C
     // 00000011 == 0x03
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
index 182d66c..323ca7f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444.java
@@ -57,7 +57,7 @@ public class Extract4444 implements Extract {
   }
 
   @Override
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+  public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
     int ushort = 0;
 
     if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract4444 implements Extract {
     // 00000000,11110000 == 0x00F0
     // 00000000,00001111 == 0x000F
 
-    extractComponents[0] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
-    extractComponents[1] = (float)( ( ushort & 0x0F00 ) >> 8  ) / 15.0f;
-    extractComponents[2] = (float)( ( ushort & 0x00F0 ) >> 4  ) / 15.0f;
-    extractComponents[3] = (float)( ( ushort & 0x000F )       ) / 15.0f;
+    extractComponents[0] = ( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
+    extractComponents[1] = ( ( ushort & 0x0F00 ) >> 8  ) / 15.0f;
+    extractComponents[2] = ( ( ushort & 0x00F0 ) >> 4  ) / 15.0f;
+    extractComponents[3] = ( ( ushort & 0x000F )       ) / 15.0f;
   }
 
   @Override
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+  public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
     // 00000000,11110000 == 0x00F0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
index 52ecdc1..2672865 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract4444rev.java
@@ -57,7 +57,7 @@ public class Extract4444rev implements Extract {
   }
 
   @Override
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+  public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
     int ushort = 0;
 
     if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract4444rev implements Extract {
     // 00001111,00000000 == 0x0F00
     // 11110000,00000000 == 0xF000
 
-    extractComponents[0] = (float)( ( ushort & 0x000F )       ) / 15.0f;
-    extractComponents[1] = (float)( ( ushort & 0x00F0 ) >> 4  ) / 15.0f;
-    extractComponents[2] = (float)( ( ushort & 0x0F00 ) >> 8  ) / 15.0f;
-    extractComponents[3] = (float)( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
+    extractComponents[0] = ( ( ushort & 0x000F )       ) / 15.0f;
+    extractComponents[1] = ( ( ushort & 0x00F0 ) >> 4  ) / 15.0f;
+    extractComponents[2] = ( ( ushort & 0x0F00 ) >> 8  ) / 15.0f;
+    extractComponents[3] = ( ( ushort & 0xF000 ) >> 12 ) / 15.0f;
   }
 
   @Override
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+  public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
     // 00000000,11110000 == 0x00F0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
index 21f53aa..ee33ca7 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract5551.java
@@ -57,7 +57,7 @@ public class Extract5551 implements Extract {
   }
 
   @Override
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+  public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
     int ushort = 0;
 
     if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract5551 implements Extract {
     // 00000000,00111110 == 0x003E
     // 00000000,00000001 == 0x0001
 
-    extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
-    extractComponents[1] = (float)( ( ushort & 0x00F0 ) >>  6 ) / 31.0f;
-    extractComponents[2] = (float)( ( ushort & 0x0F00 ) >>  1 ) / 31.0f;
-    extractComponents[3] = (float)( ( ushort & 0xF000 )       );
+    extractComponents[0] = ( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
+    extractComponents[1] = ( ( ushort & 0x00F0 ) >>  6 ) / 31.0f;
+    extractComponents[2] = ( ( ushort & 0x0F00 ) >>  1 ) / 31.0f;
+    extractComponents[3] = ( ( ushort & 0xF000 )       );
   }
 
   @Override
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+  public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
     // 00000000,11110000 == 0x00F0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
index 7408c45..d63943a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565.java
@@ -57,7 +57,7 @@ public class Extract565 implements Extract {
   }
 
   @Override
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+  public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
     int ushort = 0;
 
     if( isSwap ) {
@@ -70,13 +70,13 @@ public class Extract565 implements Extract {
     // 00000111,11100000 == 0x07E0
     // 00000000,00111111 == 0x001F
 
-    extractComponents[0] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
-    extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
-    extractComponents[2] = (float)( ( ushort & 0x001F ) ) / 31.0f;
+    extractComponents[0] = ( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
+    extractComponents[1] = ( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
+    extractComponents[2] = ( ( ushort & 0x001F ) ) / 31.0f;
   }
 
   @Override
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+  public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
     // 11111000,00000000 == 0xF800
     // 00000111,11100000 == 0x07E0
     // 00000000,00111111 == 0x001F
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
index adaafa7..cfea714 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract565rev.java
@@ -57,7 +57,7 @@ public class Extract565rev implements Extract {
   }
 
   @Override
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+  public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
     int ushort = 0;
 
     if( isSwap ) {
@@ -70,13 +70,13 @@ public class Extract565rev implements Extract {
     // 00000111,11100000 == 0x07E0
     // 11111000,00000000 == 0xF800
 
-    extractComponents[0] = (float)( ( ushort & 0x001F ) ) / 31.0f;
-    extractComponents[1] = (float)( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
-    extractComponents[2] = (float)( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
+    extractComponents[0] = ( ( ushort & 0x001F ) ) / 31.0f;
+    extractComponents[1] = ( ( ushort & 0x07E0 ) >> 5 ) / 63.0f;
+    extractComponents[2] = ( ( ushort & 0xF800 ) >> 11 ) / 31.0f;
   }
 
   @Override
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+  public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
     // 00000000,00111111 == 0x001F
     // 00000111,11100000 == 0x07E0
     // 11111000,00000000 == 0xF800
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
index be155d5..f6fe92c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888.java
@@ -57,7 +57,7 @@ public class Extract8888 implements Extract {
   }
 
   @Override
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+  public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
     long uint = 0;
 
     if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract8888 implements Extract {
     // 00000000,00111110 == 0x003E
     // 00000000,00000001 == 0x0001
 
-    extractComponents[0] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
-    extractComponents[1] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
-    extractComponents[2] = (float)( ( uint & 0x0000FF00 ) >>  8 ) / 255.0f;
-    extractComponents[3] = (float)( ( uint & 0x000000FF )       ) / 255.0f;
+    extractComponents[0] = ( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
+    extractComponents[1] = ( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
+    extractComponents[2] = ( ( uint & 0x0000FF00 ) >>  8 ) / 255.0f;
+    extractComponents[3] = ( ( uint & 0x000000FF )       ) / 255.0f;
   }
 
   @Override
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+  public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
     // 00000000,11110000 == 0x00F0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
index 294e60e..942f6d8 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Extract8888rev.java
@@ -57,7 +57,7 @@ public class Extract8888rev implements Extract {
   }
 
   @Override
-  public void extract( boolean isSwap, ByteBuffer packedPixel, float[] extractComponents ) {
+  public void extract( final boolean isSwap, final ByteBuffer packedPixel, final float[] extractComponents ) {
     long uint = 0;
 
     if( isSwap ) {
@@ -71,14 +71,14 @@ public class Extract8888rev implements Extract {
     // 00000000,00111110 == 0x003E
     // 00000000,00000001 == 0x0001
 
-    extractComponents[0] = (float)( ( uint & 0x000000FF )       ) / 255.0f;
-    extractComponents[1] = (float)( ( uint & 0x0000FF00 ) >>  8 ) / 255.0f;
-    extractComponents[2] = (float)( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
-    extractComponents[3] = (float)( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
+    extractComponents[0] = ( ( uint & 0x000000FF )       ) / 255.0f;
+    extractComponents[1] = ( ( uint & 0x0000FF00 ) >>  8 ) / 255.0f;
+    extractComponents[2] = ( ( uint & 0x00FF0000 ) >> 16 ) / 255.0f;
+    extractComponents[3] = ( ( uint & 0xFF000000 ) >> 24 ) / 255.0f;
   }
 
   @Override
-  public void shove( float[] shoveComponents, int index, ByteBuffer packedPixel ) {
+  public void shove( final float[] shoveComponents, final int index, final ByteBuffer packedPixel ) {
     // 11110000,00000000 == 0xF000
     // 00001111,00000000 == 0x0F00
     // 00000000,11110000 == 0x00F0
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
index 1dd8bff..09d70e4 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractFloat.java
@@ -57,7 +57,7 @@ public class ExtractFloat implements ExtractPrimitive {
   }
 
   @Override
-  public double extract( boolean isSwap, ByteBuffer data ) {
+  public double extract( final boolean isSwap, final ByteBuffer data ) {
     float f = 0;
     if( isSwap ) {
       f = Mipmap.GLU_SWAP_4_BYTES( data.getInt() );
@@ -69,7 +69,7 @@ public class ExtractFloat implements ExtractPrimitive {
   }
 
   @Override
-  public void shove( double value, int index, ByteBuffer data ) {
+  public void shove( final double value, final int index, final ByteBuffer data ) {
     assert(0.0 <= value && value < 1.0);
     data.asFloatBuffer().put( index, (float)value );
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
index dcbe52a..76c3433 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSByte.java
@@ -57,14 +57,12 @@ public class ExtractSByte implements ExtractPrimitive {
   }
 
   @Override
-  public double extract( boolean isSwap, ByteBuffer sbyte ) {
-    byte b = sbyte.get();
-    assert( b <= 127 );
-    return( b );
+  public double extract( final boolean isSwap, final ByteBuffer sbyte ) {
+    return sbyte.get(); // <= 127
   }
 
   @Override
-  public void shove( double value, int index, ByteBuffer data ) {
+  public void shove( final double value, final int index, final ByteBuffer data ) {
     data.position( index );
     data.put( (byte)value );
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
index 547bd94..9532fda 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSInt.java
@@ -57,7 +57,7 @@ public class ExtractSInt implements ExtractPrimitive {
   }
 
   @Override
-  public double extract( boolean isSwap, ByteBuffer uint ) {
+  public double extract( final boolean isSwap, final ByteBuffer uint ) {
     int i = 0;
     if( isSwap ) {
       i = Mipmap.GLU_SWAP_4_BYTES( uint.getInt() );
@@ -69,9 +69,9 @@ public class ExtractSInt implements ExtractPrimitive {
   }
 
   @Override
-  public void shove( double value, int index, ByteBuffer data ) {
+  public void shove( final double value, final int index, final ByteBuffer data ) {
     assert(0.0 <= value && value < Integer.MAX_VALUE);
-    IntBuffer ib = data.asIntBuffer();
+    final IntBuffer ib = data.asIntBuffer();
     ib.position( index );
     ib.put( (int)value );
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
index 7dc1729..6e14f89 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractSShort.java
@@ -57,7 +57,7 @@ public class ExtractSShort implements ExtractPrimitive {
   }
 
   @Override
-  public double extract( boolean isSwap, ByteBuffer ushort ) {
+  public double extract( final boolean isSwap, final ByteBuffer ushort ) {
     short s = 0;
     if( isSwap ) {
       s = Mipmap.GLU_SWAP_2_BYTES( ushort.getShort() );
@@ -69,9 +69,9 @@ public class ExtractSShort implements ExtractPrimitive {
   }
 
   @Override
-  public void shove( double value, int index, ByteBuffer data ) {
+  public void shove( final double value, final int index, final ByteBuffer data ) {
     assert(0.0 <= value && value < 32768.0);
-    ShortBuffer sb = data.asShortBuffer();
+    final ShortBuffer sb = data.asShortBuffer();
     sb.position( index );
     sb.put( (short)value );
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
index 3e93381..d9db001 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUByte.java
@@ -57,14 +57,14 @@ public class ExtractUByte implements ExtractPrimitive {
   }
 
   @Override
-  public double extract( boolean isSwap, ByteBuffer ubyte ) {
-    int i = 0x000000FF & ubyte.get();
+  public double extract( final boolean isSwap, final ByteBuffer ubyte ) {
+    final int i = 0x000000FF & ubyte.get();
     assert( i <= 255 );
     return( i );
   }
 
   @Override
-  public void shove( double value, int index, ByteBuffer data ) {
+  public void shove( final double value, final int index, final ByteBuffer data ) {
     assert(0.0 <= value && value < 256.0);
     data.position( index );
     data.put( (byte)value );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
index 1c34828..3e4ad41 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUInt.java
@@ -57,7 +57,7 @@ public class ExtractUInt implements ExtractPrimitive {
   }
 
   @Override
-  public double extract( boolean isSwap, ByteBuffer uint ) {
+  public double extract( final boolean isSwap, final ByteBuffer uint ) {
     long i = 0;
     if( isSwap ) {
       i = 0xFFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( uint.getInt() );
@@ -69,9 +69,9 @@ public class ExtractUInt implements ExtractPrimitive {
   }
 
   @Override
-  public void shove( double value, int index, ByteBuffer data ) {
+  public void shove( final double value, final int index, final ByteBuffer data ) {
     assert(0.0 <= value && value < 0xFFFFFFFF);
-    IntBuffer ib = data.asIntBuffer();
+    final IntBuffer ib = data.asIntBuffer();
     ib.position( index );
     ib.put( (int)value );
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
index 8e0d25c..b121c10 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ExtractUShort.java
@@ -57,7 +57,7 @@ public class ExtractUShort implements ExtractPrimitive {
   }
 
   @Override
-  public double extract( boolean isSwap, ByteBuffer ushort ) {
+  public double extract( final boolean isSwap, final ByteBuffer ushort ) {
     int i = 0;
     if( isSwap ) {
       i = 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( ushort.getShort() );
@@ -69,9 +69,9 @@ public class ExtractUShort implements ExtractPrimitive {
   }
 
   @Override
-  public void shove( double value, int index, ByteBuffer data ) {
+  public void shove( final double value, final int index, final ByteBuffer data ) {
     assert(0.0 <= value && value < 65536.0);
-    ShortBuffer sb = data.asShortBuffer();
+    final ShortBuffer sb = data.asShortBuffer();
     sb.position( index );
     sb.put( (short)value );
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
index 184c5fd..95ce86a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/HalveImage.java
@@ -57,8 +57,8 @@ public class HalveImage {
   private static final int BOX4 = 4;
   private static final int BOX8 = 8;
 
-  public static void halveImage( int components, int width, int height,
-          ShortBuffer datain, ShortBuffer dataout ) {
+  public static void halveImage( final int components, final int width, final int height,
+          final ShortBuffer datain, final ShortBuffer dataout ) {
     int i, j, k;
     int newwidth, newheight;
     int delta;
@@ -92,9 +92,9 @@ public class HalveImage {
     }
   }
 
-  public static void halveImage_ubyte( int components, int width, int height,
-                                      ByteBuffer datain, ByteBuffer dataout,
-                                      int element_size, int ysize, int group_size ) {
+  public static void halveImage_ubyte( final int components, final int width, final int height,
+                                      final ByteBuffer datain, final ByteBuffer dataout,
+                                      final int element_size, final int ysize, final int group_size ) {
     int i, j, k;
     int newwidth, newheight;
     int s;
@@ -134,9 +134,9 @@ public class HalveImage {
     }
   }
 
-  public static void halve1Dimage_ubyte( int components, int width, int height,
-                      ByteBuffer datain, ByteBuffer dataout,
-                      int element_size, int ysize, int group_size ) {
+  public static void halve1Dimage_ubyte( final int components, final int width, final int height,
+                      final ByteBuffer datain, final ByteBuffer dataout,
+                      final int element_size, final int ysize, final int group_size ) {
     int halfWidth = width / 2;
     int halfHeight = height / 2;
     int src = 0;
@@ -170,10 +170,10 @@ public class HalveImage {
         }
         src += group_size; // skip to next 2
       }
-      int padBytes = ysize - ( width * group_size );
+      final int padBytes = ysize - ( width * group_size );
       src += padBytes; // for assertion only
     } else if( width == 1 ) { // 1 column
-      int padBytes = ysize - ( width * group_size );
+      final int padBytes = ysize - ( width * group_size );
       assert( height != 1 );
       halfWidth = 1;
       // one vertical column with possible pad bytes per row
@@ -203,12 +203,12 @@ public class HalveImage {
     assert( dest == components * element_size * halfWidth * halfHeight );
   }
 
-  public static void halveImage_byte( int components, int width, int height,
-                    ByteBuffer datain, ByteBuffer dataout, int element_size,
-                    int ysize, int group_size ) {
+  public static void halveImage_byte( final int components, final int width, final int height,
+                    final ByteBuffer datain, final ByteBuffer dataout, final int element_size,
+                    final int ysize, final int group_size ) {
     int i, j, k;
     int newwidth, newheight;
-    int s = 0;
+    final int s = 0;
     int t = 0;
     byte temp = (byte)0;
 
@@ -245,9 +245,9 @@ public class HalveImage {
     }
   }
 
-  public static void halve1Dimage_byte( int components, int width, int height,
-                      ByteBuffer datain, ByteBuffer dataout,
-                      int element_size, int ysize, int group_size ) {
+  public static void halve1Dimage_byte( final int components, final int width, final int height,
+                      final ByteBuffer datain, final ByteBuffer dataout,
+                      final int element_size, final int ysize, final int group_size ) {
     int halfWidth = width / 2;
     int halfHeight = width / 2;
     int src = 0;
@@ -276,10 +276,10 @@ public class HalveImage {
         }
         src += group_size; // skip to next 2
       }
-      int padBytes = ysize - ( width * group_size );
+      final int padBytes = ysize - ( width * group_size );
       src += padBytes; // for assert only
     } else if( width == 1 ) { // 1 column
-      int padBytes = ysize - ( width * group_size );
+      final int padBytes = ysize - ( width * group_size );
       assert( height != 1 ); // widthxheight can't be 1
       halfWidth = 1;
       // one vertical column with possible pad bytes per row
@@ -304,12 +304,13 @@ public class HalveImage {
     assert( dest == components * element_size * halfWidth * halfHeight );
   }
 
-  public static void halveImage_ushort( int components, int width, int height,
-                          ByteBuffer datain, ShortBuffer dataout, int element_size,
-                          int ysize, int group_size, boolean myswap_bytes ) {
-    int i, j, k, l;
+  public static void halveImage_ushort( final int components, final int width, final int height,
+                          final ByteBuffer datain, final ShortBuffer dataout, final int element_size,
+                          final int ysize, final int group_size, final boolean myswap_bytes ) {
+    int i, j, k;
+    final int l;
     int newwidth, newheight;
-    int s = 0;
+    final int s = 0;
     int t = 0;
     int temp = 0;
     // handle case where there is only 1 column/row
@@ -365,9 +366,9 @@ public class HalveImage {
     }
   }
 
-  public static void halve1Dimage_ushort( int components, int width, int height,
-                      ByteBuffer datain, ShortBuffer dataout, int element_size,
-                      int ysize, int group_size, boolean myswap_bytes ) {
+  public static void halve1Dimage_ushort( final int components, final int width, final int height,
+                      final ByteBuffer datain, final ShortBuffer dataout, final int element_size,
+                      final int ysize, final int group_size, final boolean myswap_bytes ) {
     int halfWidth = width / 2;
     int halfHeight = height / 2;
     int src = 0;
@@ -384,7 +385,7 @@ public class HalveImage {
       for( jj = 0; jj < halfWidth; jj++ ) {
         int kk;
         for( kk = 0; kk < halfHeight; kk++ ) {
-          int[] ushort = new int[BOX2];
+          final int[] ushort = new int[BOX2];
           if( myswap_bytes ) {
             datain.position( src );
             ushort[0] = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
@@ -402,10 +403,10 @@ public class HalveImage {
         }
         src += group_size; // skip to next 2
       }
-      int padBytes = ysize - ( width * group_size );
+      final int padBytes = ysize - ( width * group_size );
       src += padBytes; // for assertion only
     } else if( width == 1 ) { // 1 column
-      int padBytes = ysize - ( width * group_size );
+      final int padBytes = ysize - ( width * group_size );
       assert( height != 1 ); // widthxheight can't be 1
       halfWidth = 1;
       // one vertical column with possible pad bytes per row
@@ -414,7 +415,7 @@ public class HalveImage {
       for( jj = 0; jj < halfHeight; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
-          int[] ushort = new int[BOX2];
+          final int[] ushort = new int[BOX2];
           if( myswap_bytes ) {
             datain.position( src );
             ushort[0] = ( 0x0000FFFF & Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ) );
@@ -438,12 +439,13 @@ public class HalveImage {
     assert( dest == components * element_size * halfWidth * halfHeight );
   }
 
-  public static void halveImage_short( int components, int width, int height,
-                        ByteBuffer datain, ShortBuffer dataout, int element_size,
-                        int ysize, int group_size, boolean myswap_bytes ) {
-    int i, j, k, l;
+  public static void halveImage_short( final int components, final int width, final int height,
+                        final ByteBuffer datain, final ShortBuffer dataout, final int element_size,
+                        final int ysize, final int group_size, final boolean myswap_bytes ) {
+    int i, j, k;
+    final int l;
     int newwidth, newheight;
-    int s = 0;
+    final int s = 0;
     int t = 0;
     short temp = (short)0;
     // handle case where there is only 1 column/row
@@ -472,7 +474,7 @@ public class HalveImage {
             temp += datain.getShort();
             temp += 2;
             temp /= 4;
-            dataout.put( (short)temp );
+            dataout.put( temp );
             t += element_size;
           }
           t += group_size;
@@ -483,8 +485,8 @@ public class HalveImage {
       for( i = 0; i < newheight; i++ ) {
         for( j = 0; j < newwidth; j++ ) {
           for( k = 0; k < components; k++ ) {
-            short b;
-            int buf;
+            final short b;
+            final int buf;
             datain.position( t );
             temp = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
             datain.position( t + group_size );
@@ -505,9 +507,9 @@ public class HalveImage {
     }
   }
 
-  public static void halve1Dimage_short( int components, int width, int height,
-              ByteBuffer datain, ShortBuffer dataout, int element_size, int ysize,
-              int group_size, boolean myswap_bytes ) {
+  public static void halve1Dimage_short( final int components, final int width, final int height,
+              final ByteBuffer datain, final ShortBuffer dataout, final int element_size, final int ysize,
+              final int group_size, final boolean myswap_bytes ) {
     int halfWidth = width / 2;
     int halfHeight = height / 2;
     int src = 0;
@@ -524,7 +526,7 @@ public class HalveImage {
       for( jj = 0; jj < halfWidth; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
-          short[] sshort = new short[BOX2];
+          final short[] sshort = new short[BOX2];
           if( myswap_bytes ) {
             datain.position( src );
             sshort[0] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
@@ -542,10 +544,10 @@ public class HalveImage {
         }
         src += group_size; // skip to next 2
       }
-      int padBytes = ysize - ( width * group_size );
+      final int padBytes = ysize - ( width * group_size );
       src += padBytes; // for assertion only
     } else if( width == 1 ) {
-      int padBytes = ysize - ( width * group_size );
+      final int padBytes = ysize - ( width * group_size );
       assert( height != 1 );
       halfWidth = 1;
       // one vertical column with possible pad bytes per row
@@ -554,7 +556,7 @@ public class HalveImage {
       for( jj = 0; jj < halfHeight; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
-          short[] sshort = new short[BOX2];
+          final short[] sshort = new short[BOX2];
           if( myswap_bytes ) {
             datain.position( src );
             sshort[0] = Mipmap.GLU_SWAP_2_BYTES( datain.getShort() );
@@ -578,12 +580,13 @@ public class HalveImage {
     assert( dest == ( components * element_size * halfWidth * halfHeight ) );
   }
 
-  public static void halveImage_uint( int components, int width, int height,
-                          ByteBuffer datain, IntBuffer dataout, int element_size,
-                          int ysize, int group_size, boolean myswap_bytes ) {
-    int i, j, k, l;
+  public static void halveImage_uint( final int components, final int width, final int height,
+                          final ByteBuffer datain, final IntBuffer dataout, final int element_size,
+                          final int ysize, final int group_size, final boolean myswap_bytes ) {
+    int i, j, k;
+    final int l;
     int newwidth, newheight;
-    int s = 0;
+    final int s = 0;
     int t = 0;
     double temp = 0;
 
@@ -644,9 +647,9 @@ public class HalveImage {
     }
   }
 
-  public static void halve1Dimage_uint( int components, int width, int height,
-                      ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
-                      int group_size, boolean myswap_bytes ) {
+  public static void halve1Dimage_uint( final int components, final int width, final int height,
+                      final ByteBuffer datain, final IntBuffer dataout, final int element_size, final int ysize,
+                      final int group_size, final boolean myswap_bytes ) {
     int halfWidth = width / 2;
     int halfHeight = height / 2;
     int src = 0;
@@ -663,7 +666,7 @@ public class HalveImage {
       for( jj = 0; jj < halfWidth; jj++ ) {
         int kk;
         for( kk = 0; kk < halfHeight; kk++ ) {
-          long[] uint = new long[BOX2];
+          final long[] uint = new long[BOX2];
           if( myswap_bytes ) {
             datain.position( src );
             uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
@@ -681,10 +684,10 @@ public class HalveImage {
         }
         src += group_size; // skip to next 2
       }
-      int padBytes = ysize - ( width * group_size );
+      final int padBytes = ysize - ( width * group_size );
       src += padBytes; // for assertion only
     } else if( width == 1 ) { // 1 column
-      int padBytes = ysize - ( width * group_size );
+      final int padBytes = ysize - ( width * group_size );
       assert( height != 1 ); // widthxheight can't be 1
       halfWidth = 1;
       // one vertical column with possible pad bytes per row
@@ -693,7 +696,7 @@ public class HalveImage {
       for( jj = 0; jj < halfHeight; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
-          long[] uint = new long[BOX2];
+          final long[] uint = new long[BOX2];
           if( myswap_bytes ) {
             datain.position( src );
             uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
@@ -717,12 +720,13 @@ public class HalveImage {
     assert( dest == components * element_size * halfWidth * halfHeight );
   }
 
-  public static void halveImage_int( int components, int width, int height,
-                        ByteBuffer datain, IntBuffer dataout, int element_size,
-                        int ysize, int group_size, boolean myswap_bytes ) {
-    int i, j, k, l;
+  public static void halveImage_int( final int components, final int width, final int height,
+                        final ByteBuffer datain, final IntBuffer dataout, final int element_size,
+                        final int ysize, final int group_size, final boolean myswap_bytes ) {
+    int i, j, k;
+    final int l;
     int newwidth, newheight;
-    int s = 0;
+    final int s = 0;
     int t = 0;
     int temp = 0;
 
@@ -786,9 +790,9 @@ public class HalveImage {
     }
   }
 
-  public static void halve1Dimage_int( int components, int width, int height,
-              ByteBuffer datain, IntBuffer dataout, int element_size, int ysize,
-              int group_size, boolean myswap_bytes ) {
+  public static void halve1Dimage_int( final int components, final int width, final int height,
+              final ByteBuffer datain, final IntBuffer dataout, final int element_size, final int ysize,
+              final int group_size, final boolean myswap_bytes ) {
     int halfWidth = width / 2;
     int halfHeight = height / 2;
     int src = 0;
@@ -805,7 +809,7 @@ public class HalveImage {
       for( jj = 0; jj < halfWidth; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
-          long[] uint = new long[BOX2];
+          final long[] uint = new long[BOX2];
           if( myswap_bytes ) {
             datain.position( src );
             uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
@@ -823,10 +827,10 @@ public class HalveImage {
         }
         src += group_size; // skip to next 2
       }
-      int padBytes = ysize - ( width * group_size );
+      final int padBytes = ysize - ( width * group_size );
       src += padBytes; // for assertion only
     } else if( width == 1 ) {
-      int padBytes = ysize - ( width * group_size );
+      final int padBytes = ysize - ( width * group_size );
       assert( height != 1 );
       halfWidth = 1;
       // one vertical column with possible pad bytes per row
@@ -835,7 +839,7 @@ public class HalveImage {
       for( jj = 0; jj < halfHeight; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
-          long[] uint = new long[BOX2];
+          final long[] uint = new long[BOX2];
           if( myswap_bytes ) {
             datain.position( src );
             uint[0] = ( 0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt() ) );
@@ -859,12 +863,13 @@ public class HalveImage {
     assert( dest == ( components * element_size * halfWidth * halfHeight ) );
   }
 
-  public static void halveImage_float( int components, int width, int height,
-                    ByteBuffer datain, FloatBuffer dataout, int element_size,
-                    int ysize, int group_size, boolean myswap_bytes ) {
-    int i, j, k, l;
+  public static void halveImage_float( final int components, final int width, final int height,
+                    final ByteBuffer datain, final FloatBuffer dataout, final int element_size,
+                    final int ysize, final int group_size, final boolean myswap_bytes ) {
+    int i, j, k;
+    final int l;
     int newwidth, newheight;
-    int s = 0;
+    final int s = 0;
     int t = 0;
     float temp = 0.0f;
     // handle case where there is only 1 column/row
@@ -921,9 +926,9 @@ public class HalveImage {
     }
   }
 
-  public static void halve1Dimage_float( int components, int width, int height,
-              ByteBuffer datain, FloatBuffer dataout, int element_size, int ysize,
-              int group_size, boolean myswap_bytes ) {
+  public static void halve1Dimage_float( final int components, final int width, final int height,
+              final ByteBuffer datain, final FloatBuffer dataout, final int element_size, final int ysize,
+              final int group_size, final boolean myswap_bytes ) {
     int halfWidth = width / 2;
     int halfHeight = height / 2;
     int src = 0;
@@ -940,7 +945,7 @@ public class HalveImage {
       for( jj = 0; jj < halfWidth; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
-          float[] sfloat = new float[BOX2];
+          final float[] sfloat = new float[BOX2];
           if( myswap_bytes ) {
             datain.position( src );
             sfloat[0] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
@@ -958,10 +963,10 @@ public class HalveImage {
         }
         src += group_size; // skip to next 2
       }
-      int padBytes = ysize - ( width * group_size );
+      final int padBytes = ysize - ( width * group_size );
       src += padBytes; // for assertion only
     } else if( width == 1 ) {
-      int padBytes = ysize - ( width * group_size );
+      final int padBytes = ysize - ( width * group_size );
       assert( height != 1 );
       halfWidth = 1;
       // one vertical column with possible pad bytes per row
@@ -970,7 +975,7 @@ public class HalveImage {
       for( jj = 0; jj < halfHeight; jj++ ) {
         int kk;
         for( kk = 0; kk < components; kk++ ) {
-          float[] sfloat = new float[BOX2];
+          final float[] sfloat = new float[BOX2];
           if( myswap_bytes ) {
             datain.position( src );
             sfloat[0] = Mipmap.GLU_SWAP_4_BYTES( datain.getFloat() );
@@ -994,9 +999,9 @@ public class HalveImage {
     assert( dest == ( components * element_size * halfWidth * halfHeight ) );
   }
 
-  public static void halveImagePackedPixel( int components, Extract extract, int width,
-          int height, ByteBuffer datain, ByteBuffer dataout,
-          int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
+  public static void halveImagePackedPixel( final int components, final Extract extract, final int width,
+          final int height, final ByteBuffer datain, final ByteBuffer dataout,
+          final int pixelSizeInBytes, final int rowSizeInBytes, final boolean isSwap ) {
     if( width == 1 || height == 1 ) {
       assert( !( width == 1 && height == 1 ) );
       halve1DimagePackedPixel( components, extract, width, height, datain, dataout,
@@ -1005,16 +1010,16 @@ public class HalveImage {
     }
     int ii, jj;
 
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
+    final int halfWidth = width / 2;
+    final int halfHeight = height / 2;
     int src = 0;
-    int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+    final int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
     int outIndex = 0;
 
     for( ii = 0; ii < halfHeight; ii++ ) {
       for( jj = 0; jj < halfWidth; jj++ ) {
-        float totals[] = new float[4];
-        float extractTotals[][] = new float[BOX4][4];
+        final float totals[] = new float[4];
+        final float extractTotals[][] = new float[BOX4][4];
         int cc;
 
         datain.position( src );
@@ -1046,9 +1051,9 @@ public class HalveImage {
     assert( outIndex == halfWidth * halfHeight );
   }
 
-  public static void halve1DimagePackedPixel( int components, Extract extract, int width,
-              int height, ByteBuffer datain, ByteBuffer dataout,
-              int pixelSizeInBytes, int rowSizeInBytes, boolean isSwap ) {
+  public static void halve1DimagePackedPixel( final int components, final Extract extract, final int width,
+              final int height, final ByteBuffer datain, final ByteBuffer dataout,
+              final int pixelSizeInBytes, final int rowSizeInBytes, final boolean isSwap ) {
     int halfWidth = width / 2;
     int halfHeight = height / 2;
     int src = 0;
@@ -1066,8 +1071,8 @@ public class HalveImage {
       // one horizontal row with possible pad bytes
 
       for( jj = 0; jj < halfWidth; jj++ ) {
-        float[] totals = new float[4];
-        float[][] extractTotals = new float[BOX2][4];
+        final float[] totals = new float[4];
+        final float[][] extractTotals = new float[BOX2][4];
         int cc;
 
         datain.position( src );
@@ -1088,7 +1093,7 @@ public class HalveImage {
         // skip over to next group of 2
         src += pixelSizeInBytes + pixelSizeInBytes;
       }
-      int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+      final int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
       src += padBytes;
 
       assert( src == rowSizeInBytes );
@@ -1102,8 +1107,8 @@ public class HalveImage {
       // average two at a time
 
       for( jj = 0; jj < halfHeight; jj++ ) {
-        float[] totals = new float[4];
-        float[][] extractTotals = new float[BOX2][4];
+        final float[] totals = new float[4];
+        final float[][] extractTotals = new float[BOX2][4];
         int cc;
         // average two at a time, instead of four
         datain.position( src );
@@ -1129,16 +1134,16 @@ public class HalveImage {
     }
   }
 
-  public static void halveImagePackedPixelSlice( int components, Extract extract,
-          int width, int height, int depth, ByteBuffer dataIn,
-          ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
-          int imageSizeInBytes, boolean isSwap ) {
+  public static void halveImagePackedPixelSlice( final int components, final Extract extract,
+          final int width, final int height, final int depth, final ByteBuffer dataIn,
+          final ByteBuffer dataOut, final int pixelSizeInBytes, final int rowSizeInBytes,
+          final int imageSizeInBytes, final boolean isSwap ) {
     int ii, jj;
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int halfDepth = depth / 2;
+    final int halfWidth = width / 2;
+    // final int halfHeight = height / 2;
+    final int halfDepth = depth / 2;
     int src = 0;
-    int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+    // final int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
     int outIndex = 0;
 
     assert( (width == 1 || height == 1) && depth >= 2 );
@@ -1148,8 +1153,8 @@ public class HalveImage {
       assert( depth >= 2 );
 
       for( ii = 0; ii < halfDepth; ii++ ) {
-        float totals[] = new float[4];
-        float extractTotals[][] = new float[BOX2][4];
+        final float totals[] = new float[4];
+        final float extractTotals[][] = new float[BOX2][4];
         int cc;
 
         dataIn.position( src );
@@ -1178,8 +1183,8 @@ public class HalveImage {
 
       for( ii = 0; ii < halfDepth; ii++ ) {
         for( jj = 0; jj < halfWidth; jj++ ) {
-          float totals[] = new float[4];
-          float extractTotals[][] = new float[BOX4][4];
+          final float totals[] = new float[4];
+          final float extractTotals[][] = new float[BOX4][4];
           int cc;
 
           dataIn.position( src );
@@ -1199,7 +1204,7 @@ public class HalveImage {
             for( kk = 0; kk < BOX4; kk++ ) {
               totals[cc]+= extractTotals[kk][cc];
             }
-            totals[cc]/= (float)BOX4;
+            totals[cc]/= BOX4;
           }
           extract.shove( totals, outIndex, dataOut );
           outIndex++;
@@ -1212,8 +1217,8 @@ public class HalveImage {
 
       for( ii = 0; ii < halfDepth; ii++ ) {
         for( jj = 0; jj < halfWidth; jj++ ) {
-          float totals[] = new float[4];
-          float extractTotals[][] = new float[BOX4][4];
+          final float totals[] = new float[4];
+          final float extractTotals[][] = new float[BOX4][4];
           int cc;
 
           dataIn.position( src );
@@ -1233,7 +1238,7 @@ public class HalveImage {
             for( kk = 0; kk < BOX4; kk++ ) {
               totals[cc]+= extractTotals[kk][cc];
             }
-            totals[cc]/= (float)BOX4;
+            totals[cc]/= BOX4;
           }
           extract.shove( totals, outIndex, dataOut );
           outIndex++;
@@ -1244,16 +1249,16 @@ public class HalveImage {
     }
   }
 
-  public static void halveImageSlice( int components, ExtractPrimitive extract, int width,
-          int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
-          int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
-          int imageSizeInBytes, boolean isSwap ) {
+  public static void halveImageSlice( final int components, final ExtractPrimitive extract, final int width,
+          final int height, final int depth, final ByteBuffer dataIn, final ByteBuffer dataOut,
+          final int elementSizeInBytes, final int groupSizeInBytes, final int rowSizeInBytes,
+          final int imageSizeInBytes, final boolean isSwap ) {
     int ii, jj;
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int halfDepth = depth / 2;
+    final int halfWidth = width / 2;
+    final int halfHeight = height / 2;
+    final int halfDepth = depth / 2;
     int src = 0;
-    int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
+    final int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
     int outIndex = 0;
 
     assert( (width == 1 || height == 1) && depth >= 2 );
@@ -1265,8 +1270,8 @@ public class HalveImage {
       for( ii = 0; ii < halfDepth; ii++ ) {
         int cc;
         for( cc = 0; cc < components; cc++ ) {
-          double[] totals = new double[4];
-          double[][] extractTotals = new double[BOX2][4];
+          final double[] totals = new double[4];
+          final double[][] extractTotals = new double[BOX2][4];
           int kk;
 
           dataIn.position( src );
@@ -1281,7 +1286,7 @@ public class HalveImage {
           for( kk = 0; kk < BOX2; kk++ ) {
             totals[cc] += extractTotals[kk][cc];
           }
-          totals[cc] /= (double)BOX2;
+          totals[cc] /= BOX2;
 
           extract.shove( totals[cc], outIndex, dataOut );
           outIndex++;
@@ -1301,8 +1306,8 @@ public class HalveImage {
           int cc;
           for( cc = 0; cc < components; cc++ ) {
             int kk;
-            double totals[] = new double[4];
-            double extractTotals[][] = new double[BOX4][4];
+            final double totals[] = new double[4];
+            final double extractTotals[][] = new double[BOX4][4];
 
             dataIn.position( src );
             extractTotals[0][cc] = extract.extract( isSwap, dataIn );
@@ -1321,7 +1326,7 @@ public class HalveImage {
             for( kk = 0; kk < BOX4; kk++ ) {
               totals[cc] += extractTotals[kk][cc];
             }
-            totals[cc] /= (double)BOX4;
+            totals[cc] /= BOX4;
 
             extract.shove( totals[cc], outIndex, dataOut );
             outIndex++;
@@ -1343,8 +1348,8 @@ public class HalveImage {
           int cc;
           for( cc = 0; cc < components; cc++ ) {
             int kk;
-            double totals[] = new double[4];
-            double extractTotals[][] = new double[BOX4][4];
+            final double totals[] = new double[4];
+            final double extractTotals[][] = new double[BOX4][4];
 
             dataIn.position( src );
             extractTotals[0][cc] = extract.extract( isSwap, dataIn );
@@ -1364,7 +1369,7 @@ public class HalveImage {
             for( kk = 0; kk < BOX4; kk++ ) {
               totals[cc] += extractTotals[kk][cc];
             }
-            totals[cc] /= (double)BOX4;
+            totals[cc] /= BOX4;
 
             extract.shove( totals[cc], outIndex, dataOut );
             outIndex++;
@@ -1381,10 +1386,10 @@ public class HalveImage {
     }
   }
 
-  public static void halveImage3D( int components, ExtractPrimitive extract,
-          int width, int height, int depth, ByteBuffer dataIn, ByteBuffer dataOut,
-          int elementSizeInBytes, int groupSizeInBytes, int rowSizeInBytes,
-          int imageSizeInBytes, boolean isSwap ) {
+  public static void halveImage3D( final int components, final ExtractPrimitive extract,
+          final int width, final int height, final int depth, final ByteBuffer dataIn, final ByteBuffer dataOut,
+          final int elementSizeInBytes, final int groupSizeInBytes, final int rowSizeInBytes,
+          final int imageSizeInBytes, final boolean isSwap ) {
     assert( depth > 1 );
 
     // horizontal/vertical/onecolumn slice viewed from top
@@ -1399,11 +1404,11 @@ public class HalveImage {
 
     int ii, jj, dd;
 
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int halfDepth = depth / 2;
+    final int halfWidth = width / 2;
+    final int halfHeight = height / 2;
+    final int halfDepth = depth / 2;
     int src = 0;
-    int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
+    final int padBytes = rowSizeInBytes - ( width * groupSizeInBytes );
     int outIndex = 0;
 
     for( dd = 0; dd < halfDepth; dd++ ) {
@@ -1412,8 +1417,8 @@ public class HalveImage {
           int cc;
           for( cc = 0; cc < components; cc++ ) {
             int kk;
-            double totals[] = new double[4];
-            double extractTotals[][] = new double[BOX8][4];
+            final double totals[] = new double[4];
+            final double extractTotals[][] = new double[BOX8][4];
 
             dataIn.position( src );
             extractTotals[0][cc] = extract.extract( isSwap, dataIn );
@@ -1437,7 +1442,7 @@ public class HalveImage {
             for( kk = 0; kk < BOX8; kk++ ) {
               totals[cc] += extractTotals[kk][cc];
             }
-            totals[cc] /= (double)BOX8;
+            totals[cc] /= BOX8;
 
             extract.shove( totals[cc], outIndex, dataOut );
             outIndex++;
@@ -1457,10 +1462,10 @@ public class HalveImage {
     assert( outIndex == halfWidth * halfHeight * halfDepth * components );
   }
 
-  public static void halveImagePackedPixel3D( int components, Extract extract,
-          int width, int height, int depth, ByteBuffer dataIn,
-          ByteBuffer dataOut, int pixelSizeInBytes, int rowSizeInBytes,
-          int imageSizeInBytes, boolean isSwap ) {
+  public static void halveImagePackedPixel3D( final int components, final Extract extract,
+          final int width, final int height, final int depth, final ByteBuffer dataIn,
+          final ByteBuffer dataOut, final int pixelSizeInBytes, final int rowSizeInBytes,
+          final int imageSizeInBytes, final boolean isSwap ) {
     if( depth == 1 ) {
       assert( 1 <= width && 1 <= height );
 
@@ -1476,18 +1481,18 @@ public class HalveImage {
     }
     int ii, jj, dd;
 
-    int halfWidth = width / 2;
-    int halfHeight = height / 2;
-    int halfDepth = depth / 2;
+    final int halfWidth = width / 2;
+    final int halfHeight = height / 2;
+    final int halfDepth = depth / 2;
     int src = 0;
-    int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
+    final int padBytes = rowSizeInBytes - ( width * pixelSizeInBytes );
     int outIndex = 0;
 
     for( dd = 0; dd < halfDepth; dd++ ) {
       for( ii = 0; ii < halfHeight; ii++ ) {
         for( jj = 0; jj < halfWidth; jj++ ) {
-          float totals[] = new float[4]; // 4 is max components
-          float extractTotals[][] = new float[BOX8][4];
+          final float totals[] = new float[4]; // 4 is max components
+          final float extractTotals[][] = new float[BOX8][4];
           int cc;
 
           dataIn.position( src );
@@ -1514,7 +1519,7 @@ public class HalveImage {
             for( kk = 0; kk < BOX8; kk++ ) {
               totals[cc] += extractTotals[kk][cc];
             }
-            totals[cc] /= (float)BOX8;
+            totals[cc] /= BOX8;
           }
           extract.shove( totals, outIndex, dataOut );
           outIndex++;
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
index 18f814d..ef77f35 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Image.java
@@ -46,6 +46,9 @@ package jogamp.opengl.glu.mipmap;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GL2GL3;
+
 import java.nio.*;
 
 /**
@@ -58,14 +61,14 @@ public class Image {
   public Image() {
   }
 
-  public static short getShortFromByteArray( byte[] array, int index ) {
+  public static short getShortFromByteArray( final byte[] array, final int index ) {
     short s;
     s = (short)(array[index] << 8 );
     s |= (short)(0x00FF & array[index+1]);
     return( s );
   }
 
-  public static int getIntFromByteArray( byte[] array, int index ) {
+  public static int getIntFromByteArray( final byte[] array, final int index ) {
     int i;
     i = ( array[index] << 24 ) & 0xFF000000;
     i |= ( array[index+1] << 16 ) & 0x00FF0000;
@@ -74,8 +77,8 @@ public class Image {
     return( i );
   }
 
-  public static float getFloatFromByteArray( byte[] array, int index ) {
-    int i = getIntFromByteArray( array, index );
+  public static float getFloatFromByteArray( final byte[] array, final int index ) {
+    final int i = getIntFromByteArray( array, index );
     return( Float.intBitsToFloat(i) );
   }
 
@@ -83,9 +86,9 @@ public class Image {
    *  Extract array from user's data applying all pixel store modes.
    *  The internal format used is an array of unsigned shorts.
    */
-  public static void fill_image( PixelStorageModes psm, int width, int height,
-                  int format, int type, boolean index_format, ByteBuffer userdata,
-                  ShortBuffer newimage ) {
+  public static void fill_image( final PixelStorageModes psm, final int width, final int height,
+                  final int format, final int type, final boolean index_format, final ByteBuffer userdata,
+                  final ShortBuffer newimage ) {
     int components;
     int element_size;
     int rowsize;
@@ -102,40 +105,40 @@ public class Image {
     // Create a Extract interface object
     Extract extract = null;
     switch( type ) {
-      case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+      case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
         extract = new Extract332();
         break;
-      case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+      case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
         extract = new Extract233rev();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+      case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
         extract = new Extract565();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
         extract = new Extract565rev();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+      case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
         extract = new Extract4444();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
         extract = new Extract4444rev();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+      case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
         extract = new Extract5551();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
         extract = new Extract1555rev();
         break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
         extract = new Extract8888();
         break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
         extract = new Extract8888rev();
         break;
-      case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+      case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
         extract = new Extract1010102();
         break;
-      case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+      case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
         extract = new Extract2101010rev();
         break;
     }
@@ -214,74 +217,74 @@ public class Image {
         iter = start;
         userdata.position( iter ); //***************************************
         for( j = 0; j < elements_per_line; j++ ) {
-          Type_Widget widget = new Type_Widget();
-          float[] extractComponents = new float[4];
+          final Type_Widget widget = new Type_Widget();
+          final float[] extractComponents = new float[4];
           userdata.position( iter );
           switch( type ) {
-            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+            case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
               extract.extract( false, userdata /*userdata[iter]*/, extractComponents );
               for( k = 0; k < 3; k++ ) {
                 newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+            case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
               extract.extract( false, userdata /*userdata[iter]*/, extractComponents );
               for( k = 0; k < 3; k++ ) {
                 newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_BYTE ):
+            case( GL.GL_UNSIGNED_BYTE ):
               if( index_format ) {
                 newimage.put( iter2++, (short)( 0x000000FF & userdata.get() ) );//userdata[iter];
               } else {
                 newimage.put( iter2++, (short)( 0x000000FF & userdata.get()/*userdata[iter]*/ * 257 ) );
               }
               break;
-            case( GL2.GL_BYTE ):
+            case( GL.GL_BYTE ):
               if( index_format ) {
                 newimage.put( iter2++, userdata.get() ); //userdata[iter];
               } else {
                 newimage.put( iter2++, (short)(userdata.get()/*userdata[iter]*/ * 516 ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+            case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
               extract.extract( myswap_bytes, userdata/*userdata[iter]*/, extractComponents );
               for( k = 0; k < 3; k++ ) {
                 newimage.put( iter2++, (short)(extractComponents[k] * 65535) );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
               extract.extract( myswap_bytes, userdata, extractComponents );
               for( k = 0; k < 3; k++ ) {
                 newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+            case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
               extract.extract( myswap_bytes, userdata, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
               extract.extract( myswap_bytes, userdata, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+            case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
               extract.extract( myswap_bytes, userdata, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newimage.put( iter2++, (short)(extractComponents[k] * 65535 ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
               extract.extract( myswap_bytes, userdata, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT ):
-            case( GL2.GL_SHORT ):
+            case( GL.GL_UNSIGNED_SHORT ):
+            case( GL.GL_SHORT ):
               if( myswap_bytes ) {
                 widget.setUB1( userdata.get() );
                 widget.setUB0( userdata.get() );
@@ -289,7 +292,7 @@ public class Image {
                 widget.setUB0( userdata.get() );
                 widget.setUB1( userdata.get() );
               }
-              if( type == GL2.GL_SHORT ) {
+              if( type == GL.GL_SHORT ) {
                 if( index_format ) {
                   newimage.put( iter2++, widget.getS0() );
                 } else {
@@ -299,33 +302,33 @@ public class Image {
                 newimage.put( iter2++, widget.getUS0() );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+            case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
               extract.extract( myswap_bytes, userdata, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+            case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
               extract.extract( myswap_bytes, userdata, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+            case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
               extract.extract( myswap_bytes, userdata, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+            case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
               extract.extract( myswap_bytes, userdata, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newimage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
               }
               break;
-            case( GL2.GL_INT ):
-            case( GL2.GL_UNSIGNED_INT ):
-            case( GL2.GL_FLOAT ):
+            case( GL2ES2.GL_INT ):
+            case( GL.GL_UNSIGNED_INT ):
+            case( GL.GL_FLOAT ):
               if( myswap_bytes ) {
                 widget.setUB3( userdata.get() );
                 widget.setUB2( userdata.get() );
@@ -337,13 +340,13 @@ public class Image {
                 widget.setUB2( userdata.get() );
                 widget.setUB3( userdata.get() );
               }
-              if( type == GL2.GL_FLOAT ) {
+              if( type == GL.GL_FLOAT ) {
                 if( index_format ) {
                   newimage.put( iter2++, (short)widget.getF() );
                 } else {
                   newimage.put( iter2++, (short)(widget.getF() * 65535 ) );
                 }
-              } else if( type == GL2.GL_UNSIGNED_INT ) {
+              } else if( type == GL.GL_UNSIGNED_INT ) {
                 if( index_format ) {
                   newimage.put( iter2++, (short)( widget.getUI() ) );
                 } else {
@@ -380,9 +383,9 @@ public class Image {
    *  Theinternal format is an array of unsigned shorts.
    *  empty_image() because it is the opposet of fill_image().
    */
-  public static void empty_image( PixelStorageModes psm, int width, int height,
-                                  int format, int type, boolean index_format,
-                                  ShortBuffer oldimage, ByteBuffer userdata ) {
+  public static void empty_image( final PixelStorageModes psm, final int width, final int height,
+                                  final int format, final int type, final boolean index_format,
+                                  final ShortBuffer oldimage, final ByteBuffer userdata ) {
 
     int components;
     int element_size;
@@ -400,40 +403,40 @@ public class Image {
     // Create a Extract interface object
     Extract extract = null;
     switch( type ) {
-      case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+      case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
         extract = new Extract332();
         break;
-      case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+      case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
         extract = new Extract233rev();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+      case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
         extract = new Extract565();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
         extract = new Extract565rev();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+      case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
         extract = new Extract4444();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
         extract = new Extract4444rev();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+      case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
         extract = new Extract5551();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
         extract = new Extract1555rev();
         break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
         extract = new Extract8888();
         break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
         extract = new Extract8888rev();
         break;
-      case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+      case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
         extract = new Extract1010102();
         break;
-      case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+      case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
         extract = new Extract2101010rev();
         break;
     }
@@ -499,7 +502,7 @@ public class Image {
         start += rowsize;
       }
     } else {
-      float shoveComponents[] = new float[4];
+      final float shoveComponents[] = new float[4];
 
       element_size = Mipmap.bytes_per_element( type );
       group_size = element_size * components;
@@ -519,22 +522,22 @@ public class Image {
       for( i = 0; i < height; i++ ) {
         iter = start;
         for( j = 0; j < elements_per_line; j++ ) {
-          Type_Widget widget = new Type_Widget();
+          final Type_Widget widget = new Type_Widget();
 
           switch( type ) {
-            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+            case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
               for( k = 0; k < 3; k++ ) {
                 shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
               }
               extract.shove( shoveComponents, 0, userdata );
               break;
-            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+            case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
               for( k = 0; k < 3; k++ ) {
                 shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
               }
               extract.shove( shoveComponents, 0, userdata );
               break;
-            case( GL2.GL_UNSIGNED_BYTE ):
+            case( GL.GL_UNSIGNED_BYTE ):
               if( index_format ) {
                 //userdata[iter] = (byte)oldimage[iter2++];
                 userdata.put( iter, (byte)oldimage.get(iter2++) );
@@ -543,7 +546,7 @@ public class Image {
                 userdata.put( iter, (byte)( oldimage.get(iter2++) ) );
               }
               break;
-            case( GL2.GL_BYTE ):
+            case( GL.GL_BYTE ):
               if( index_format ) {
                 //userdata[iter] = (byte)oldimage[iter2++];
                 userdata.put( iter, (byte)oldimage.get(iter2++) );
@@ -552,7 +555,7 @@ public class Image {
                 userdata.put( iter, (byte)( oldimage.get(iter2++) ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+            case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
               for( k = 0; k < 3; k++ ) {
                 shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
               }
@@ -569,7 +572,7 @@ public class Image {
                 userdata.put( iter + 1, widget.getUB1() );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
               for( k = 0; k < 3; k++ ) {
                 shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
               }
@@ -586,7 +589,7 @@ public class Image {
                 userdata.put( iter, widget.getUB1() );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+            case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldimage.get(iter2++) / 65535.0f;
               }
@@ -603,7 +606,7 @@ public class Image {
                 userdata.put( iter + 1, widget.getUB1() );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
               }
@@ -620,7 +623,7 @@ public class Image {
                 userdata.put( iter + 1, widget.getUB1() );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+            case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
               }
@@ -637,7 +640,7 @@ public class Image {
                 userdata.put( iter + 1, widget.getUB1() );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
               }
@@ -654,9 +657,9 @@ public class Image {
                 userdata.put( iter + 1, widget.getUB1() );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT ):
-            case( GL2.GL_SHORT ):
-              if( type == GL2.GL_SHORT ) {
+            case( GL.GL_UNSIGNED_SHORT ):
+            case( GL.GL_SHORT ):
+              if( type == GL.GL_SHORT ) {
                 if( index_format ) {
                   widget.setS0( oldimage.get( iter2++ ) );
                 } else {
@@ -677,7 +680,7 @@ public class Image {
                 userdata.put( iter + 1, widget.getUB1() );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+            case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
               }
@@ -695,7 +698,7 @@ public class Image {
                 userdata.putInt( iter, widget.getUI() );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+            case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
               }
@@ -713,7 +716,7 @@ public class Image {
                 userdata.putInt( iter, widget.getUI() );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+            case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
               }
@@ -731,7 +734,7 @@ public class Image {
                 userdata.putInt( iter, widget.getUI() );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+            case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldimage.get( iter2++ ) / 65535.0f;
               }
@@ -749,16 +752,16 @@ public class Image {
                 userdata.putInt( iter, widget.getUI() );
               }
               break;
-            case( GL2.GL_INT ):
-            case( GL2.GL_UNSIGNED_INT ):
-            case( GL2.GL_FLOAT ):
-              if( type == GL2.GL_FLOAT ) {
+            case( GL2ES2.GL_INT ):
+            case( GL.GL_UNSIGNED_INT ):
+            case( GL.GL_FLOAT ):
+              if( type == GL.GL_FLOAT ) {
                 if( index_format ) {
                   widget.setF( oldimage.get( iter2++ ) );
                 } else {
                   widget.setF( oldimage.get( iter2++ ) / 65535.0f );
                 }
-              } else if( type == GL2.GL_UNSIGNED_INT ) {
+              } else if( type == GL.GL_UNSIGNED_INT ) {
                 if( index_format ) {
                   widget.setUI( oldimage.get( iter2++ ) );
                 } else {
@@ -800,9 +803,9 @@ public class Image {
     }
   }
 
-  public static void fillImage3D( PixelStorageModes psm, int width, int height,
-          int depth, int format, int type, boolean indexFormat, ByteBuffer userImage,
-          ShortBuffer newImage ) {
+  public static void fillImage3D( final PixelStorageModes psm, final int width, final int height,
+          final int depth, final int format, final int type, final boolean indexFormat, final ByteBuffer userImage,
+          final ShortBuffer newImage ) {
     boolean myswapBytes;
     int components;
     int groupsPerLine;
@@ -817,46 +820,46 @@ public class Image {
     int iter = 0;
     int iter2 = 0;
     int ww, hh, dd, k;
-    Type_Widget widget = new Type_Widget();
-    float extractComponents[] = new float[4];
+    final Type_Widget widget = new Type_Widget();
+    final float extractComponents[] = new float[4];
 
     // Create a Extract interface object
     Extract extract = null;
     switch( type ) {
-      case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+      case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
         extract = new Extract332();
         break;
-      case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+      case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
         extract = new Extract233rev();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+      case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
         extract = new Extract565();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
         extract = new Extract565rev();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+      case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
         extract = new Extract4444();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
         extract = new Extract4444rev();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+      case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
         extract = new Extract5551();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
         extract = new Extract1555rev();
         break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
         extract = new Extract8888();
         break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
         extract = new Extract8888rev();
         break;
-      case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+      case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
         extract = new Extract1010102();
         break;
-      case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+      case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
         extract = new Extract2101010rev();
         break;
     }
@@ -903,78 +906,78 @@ public class Image {
         for( ww = 0; ww < elementsPerLine; ww++ ) {
 
           switch( type ) {
-            case( GL2.GL_UNSIGNED_BYTE ):
+            case( GL.GL_UNSIGNED_BYTE ):
               if( indexFormat ) {
                 newImage.put( iter2++, (short)(0x000000FF & userImage.get( iter ) ) );
               } else {
                 newImage.put( iter2++, (short)((0x000000FF & userImage.get( iter ) ) * 257 ) );
               }
               break;
-            case( GL2.GL_BYTE ):
+            case( GL.GL_BYTE ):
               if( indexFormat ) {
                 newImage.put( iter2++, userImage.get( iter ) );
               } else {
                 newImage.put( iter2++, (short)(userImage.get( iter ) * 516 ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+            case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
               userImage.position( iter );
               extract.extract( false, userImage, extractComponents );
               for( k = 0; k < 3; k++ ) {
                 newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
               }
               break;
-            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+            case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
               userImage.position( iter );
               extract.extract( false, userImage, extractComponents );
               for( k = 0; k < 3; k++ ) {
                 newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+            case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
               userImage.position( iter );
               extract.extract( myswapBytes, userImage, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
               userImage.position( iter );
               extract.extract( myswapBytes, userImage, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+            case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
               userImage.position( iter );
               extract.extract( myswapBytes, userImage, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
               userImage.position( iter );
               extract.extract( myswapBytes, userImage, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+            case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
               userImage.position( iter );
               extract.extract( myswapBytes, userImage, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
               userImage.position( iter );
               extract.extract( myswapBytes, userImage, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newImage.put( iter2++, (short)(extractComponents[k] * 65535) );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT ):
-            case( GL2.GL_SHORT ):
+            case( GL.GL_UNSIGNED_SHORT ):
+            case( GL.GL_SHORT ):
               if( myswapBytes ) {
                 widget.setUB0( userImage.get( iter + 1 ) );
                 widget.setUB1( userImage.get( iter ) );
@@ -982,7 +985,7 @@ public class Image {
                 widget.setUB0( userImage.get( iter ) );
                 widget.setUB1( userImage.get( iter + 1 ) );
               }
-              if( type == GL2.GL_SHORT ) {
+              if( type == GL.GL_SHORT ) {
                 if( indexFormat ) {
                   newImage.put( iter2++, widget.getUS0() );
                 } else {
@@ -992,36 +995,36 @@ public class Image {
                 newImage.put( iter2++, widget.getUS0() );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+            case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
               userImage.position( iter );
               extract.extract( myswapBytes, userImage, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+            case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
               userImage.position( iter );
               extract.extract( myswapBytes, userImage, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+            case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
               userImage.position( iter );
               extract.extract( myswapBytes, userImage, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+            case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
               extract.extract( myswapBytes, userImage, extractComponents );
               for( k = 0; k < 4; k++ ) {
                 newImage.put( iter2++, (short)( extractComponents[k] * 65535 ) );
               }
               break;
-            case( GL2.GL_INT ):
-            case( GL2.GL_UNSIGNED_INT ):
-            case( GL2.GL_FLOAT ):
+            case( GL2ES2.GL_INT ):
+            case( GL.GL_UNSIGNED_INT ):
+            case( GL.GL_FLOAT ):
               if( myswapBytes ) {
                 widget.setUB0( userImage.get( iter + 3 ) );
                 widget.setUB1( userImage.get( iter + 2 ) );
@@ -1033,13 +1036,13 @@ public class Image {
                 widget.setUB2( userImage.get( iter + 2 ) );
                 widget.setUB3( userImage.get( iter + 3 ) );
               }
-              if( type == GL2.GL_FLOAT ) {
+              if( type == GL.GL_FLOAT ) {
                 if( indexFormat ) {
                   newImage.put( iter2++, (short)widget.getF() );
                 } else {
                   newImage.put( iter2++, (short)( widget.getF() * 65535.0f ) );
                 }
-              } else if( type == GL2.GL_UNSIGNED_INT ) {
+              } else if( type == GL.GL_UNSIGNED_INT ) {
                 if( indexFormat ) {
                   newImage.put( iter2++, (short)widget.getUI() );
                 } else {
@@ -1075,8 +1078,8 @@ public class Image {
             psm.getUnpackSkipImages() * imageSize );
   }
 
-  public static void emptyImage3D( PixelStorageModes psm, int width, int height, int depth,
-          int format, int type, boolean indexFormat, ShortBuffer oldImage, ByteBuffer userImage ) {
+  public static void emptyImage3D( final PixelStorageModes psm, final int width, final int height, final int depth,
+          final int format, final int type, final boolean indexFormat, final ShortBuffer oldImage, final ByteBuffer userImage ) {
     boolean myswapBytes;
     int components;
     int groupsPerLine;
@@ -1090,46 +1093,46 @@ public class Image {
     int ii, jj, dd, k;
     int rowsPerImage;
     int imageSize;
-    Type_Widget widget = new Type_Widget();
-    float[] shoveComponents = new float[4];
+    final Type_Widget widget = new Type_Widget();
+    final float[] shoveComponents = new float[4];
 
     // Create a Extract interface object
     Extract extract = null;
     switch( type ) {
-      case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+      case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
         extract = new Extract332();
         break;
-      case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+      case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
         extract = new Extract233rev();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+      case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
         extract = new Extract565();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
         extract = new Extract565rev();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+      case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
         extract = new Extract4444();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
         extract = new Extract4444rev();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+      case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
         extract = new Extract5551();
         break;
-      case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+      case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
         extract = new Extract1555rev();
         break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
         extract = new Extract8888();
         break;
-      case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+      case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
         extract = new Extract8888rev();
         break;
-      case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+      case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
         extract = new Extract1010102();
         break;
-      case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+      case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
         extract = new Extract2101010rev();
         break;
     }
@@ -1182,33 +1185,33 @@ public class Image {
         for( jj = 0; jj < elementsPerLine; jj++ ) {
 
           switch( type ) {
-            case( GL2.GL_UNSIGNED_BYTE ):
+            case( GL.GL_UNSIGNED_BYTE ):
               if( indexFormat ) {
                 userImage.put( iter, (byte)(oldImage.get( iter2++ ) ) );
               } else {
                 userImage.put( iter, (byte)(oldImage.get( iter2++ ) >> 8 ) );
               }
               break;
-            case( GL2.GL_BYTE ):
+            case( GL.GL_BYTE ):
               if( indexFormat ) {
                 userImage.put( iter, (byte)(oldImage.get(iter2++) ) );
               } else {
                 userImage.put( iter, (byte)(oldImage.get(iter2++) >> 9) );
               }
               break;
-            case( GL2.GL_UNSIGNED_BYTE_3_3_2 ):
+            case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
               for( k = 0; k < 3; k++ ) {
                 shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
               }
               extract.shove( shoveComponents, 0, userImage );
               break;
-            case( GL2.GL_UNSIGNED_BYTE_2_3_3_REV ):
+            case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
               for( k = 0; k < 3; k++ ) {
                 shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
               }
               extract.shove( shoveComponents, 0, userImage );
               break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5 ):
+            case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
               }
@@ -1220,7 +1223,7 @@ public class Image {
                 userImage.putShort( iter, widget.getUS0() );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_5_6_5_REV ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
               }
@@ -1232,7 +1235,7 @@ public class Image {
                 userImage.putShort( iter, widget.getUS0() );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4 ):
+            case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
               }
@@ -1244,7 +1247,7 @@ public class Image {
                 userImage.putShort( iter, widget.getUS0() );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
               }
@@ -1256,7 +1259,7 @@ public class Image {
                 userImage.putShort( iter, widget.getUS0() );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_5_5_5_1 ):
+            case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
               }
@@ -1268,7 +1271,7 @@ public class Image {
                 userImage.putShort( iter, widget.getUS0() );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
+            case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
               }
@@ -1280,16 +1283,16 @@ public class Image {
                 userImage.putShort( iter, widget.getUS0() );
               }
               break;
-            case( GL2.GL_UNSIGNED_SHORT ):
-            case( GL2.GL_SHORT ):
-              if( type == GL2.GL_SHORT ) {
+            case( GL.GL_UNSIGNED_SHORT ):
+            case( GL.GL_SHORT ):
+              if( type == GL.GL_SHORT ) {
                 if( indexFormat ) {
-                  widget.setS0( (short)oldImage.get( iter2++ ) );
+                  widget.setS0( oldImage.get( iter2++ ) );
                 } else {
                   widget.setS0( (short)(oldImage.get( iter2++ ) >> 1) );
                 }
               } else {
-                widget.setUS0( (short)oldImage.get( iter2++ ) );
+                widget.setUS0( oldImage.get( iter2++ ) );
               }
               if( myswapBytes ) {
                 userImage.put( iter, widget.getUB1() );
@@ -1299,7 +1302,7 @@ public class Image {
                 userImage.put( iter + 1, widget.getUB1() );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8 ):
+            case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
               }
@@ -1313,7 +1316,7 @@ public class Image {
                 userImage.putInt( iter, widget.getUI() );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_8_8_8_8_REV ):
+            case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
               }
@@ -1327,7 +1330,7 @@ public class Image {
                 userImage.putInt( iter, widget.getUI() );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_10_10_10_2 ):
+            case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
               }
@@ -1341,7 +1344,7 @@ public class Image {
                 userImage.putInt( iter, widget.getUI() );
               }
               break;
-            case( GL2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+            case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
               for( k = 0; k < 4; k++ ) {
                 shoveComponents[k] = oldImage.get( iter2++ ) / 65535.0f;
               }
@@ -1355,16 +1358,16 @@ public class Image {
                 userImage.putInt( iter, widget.getUI() );
               }
               break;
-            case( GL2.GL_INT ):
-            case( GL2.GL_UNSIGNED_INT ):
-            case( GL2.GL_FLOAT ):
-              if( type == GL2.GL_FLOAT ) {
+            case( GL2ES2.GL_INT ):
+            case( GL.GL_UNSIGNED_INT ):
+            case( GL.GL_FLOAT ):
+              if( type == GL.GL_FLOAT ) {
                 if( indexFormat ) {
                   widget.setF( oldImage.get( iter2++ ) );
                 } else {
                   widget.setF( oldImage.get( iter2++ ) / 65535.0f );
                 }
-              } else if( type == GL2.GL_UNSIGNED_INT ) {
+              } else if( type == GL.GL_UNSIGNED_INT ) {
                 if( indexFormat ) {
                   widget.setUI( oldImage.get( iter2++ ) );
                 } else {
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
index 938873e..9ff6bd6 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Mipmap.java
@@ -46,10 +46,14 @@ package jogamp.opengl.glu.mipmap;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GL2ES3;
 import javax.media.opengl.GL2GL3;
 import javax.media.opengl.glu.GLU;
 import javax.media.opengl.GLException;
+
 import java.nio.*;
+
 import com.jogamp.common.nio.Buffers;
 
 /**
@@ -108,7 +112,7 @@ public class Mipmap {
     return( s );
   }
 
-  public static int GLU_SWAP_4_BYTES( int i ) {
+  public static int GLU_SWAP_4_BYTES( final int i ) {
     int t = i << 24;
     t |= 0x00FF0000 & ( i << 8 );
     t |= 0x0000FF00 & ( i >>> 8 );
@@ -116,17 +120,17 @@ public class Mipmap {
     return( t );
   }
 
-  public static float GLU_SWAP_4_BYTES( float f ) {
-    int i = Float.floatToRawIntBits( f );
-    float temp = Float.intBitsToFloat( i );
+  public static float GLU_SWAP_4_BYTES( final float f ) {
+    final int i = Float.floatToRawIntBits( f );
+    final float temp = Float.intBitsToFloat( i );
     return( temp );
   }
 
-  public static int checkMipmapArgs( int internalFormat, int format, int type ) {
+  public static int checkMipmapArgs( final int internalFormat, final int format, final int type ) {
     if( !legalFormat( format ) || !legalType( type ) ) {
       return( GLU.GLU_INVALID_ENUM );
     }
-    if( format == GL2GL3.GL_STENCIL_INDEX ) {
+    if( format == GL2ES2.GL_STENCIL_INDEX ) {
       return( GLU.GLU_INVALID_ENUM );
     }
     if( !isLegalFormatForPackedPixelType( format, type ) ) {
@@ -135,19 +139,19 @@ public class Mipmap {
     return( 0 );
   }
 
-  public static boolean legalFormat( int format ) {
+  public static boolean legalFormat( final int format ) {
     switch( format ) {
       case( GL2.GL_COLOR_INDEX ):
-      case( GL2GL3.GL_STENCIL_INDEX ):
-      case( GL2GL3.GL_DEPTH_COMPONENT ):
-      case( GL2GL3.GL_RED ):
-      case( GL2GL3.GL_GREEN ):
-      case( GL2GL3.GL_BLUE ):
-      case( GL2GL3.GL_ALPHA ):
-      case( GL2GL3.GL_RGB ):
-      case( GL2GL3.GL_RGBA ):
-      case( GL2GL3.GL_LUMINANCE ):
-      case( GL2GL3.GL_LUMINANCE_ALPHA ):
+      case( GL2ES2.GL_STENCIL_INDEX ):
+      case( GL2ES2.GL_DEPTH_COMPONENT ):
+      case( GL2ES2.GL_RED ):
+      case( GL2ES3.GL_GREEN ):
+      case( GL2ES3.GL_BLUE ):
+      case( GL.GL_ALPHA ):
+      case( GL.GL_RGB ):
+      case( GL.GL_RGBA ):
+      case( GL.GL_LUMINANCE ):
+      case( GL.GL_LUMINANCE_ALPHA ):
       case( GL2GL3.GL_BGR ):
       case( GL.GL_BGRA ):
         return( true );
@@ -156,55 +160,55 @@ public class Mipmap {
     }
   }
 
-  public static boolean legalType( int type ) {
+  public static boolean legalType( final int type ) {
     switch( type ) {
       case( GL2.GL_BITMAP ):
-      case( GL2GL3.GL_BYTE ):
-      case( GL2GL3.GL_UNSIGNED_BYTE ):
-      case( GL2GL3.GL_SHORT ):
-      case( GL2GL3.GL_UNSIGNED_SHORT ):
-      case( GL2GL3.GL_INT ):
-      case( GL2GL3.GL_UNSIGNED_INT ):
-      case( GL2GL3.GL_FLOAT ):
+      case( GL.GL_BYTE ):
+      case( GL.GL_UNSIGNED_BYTE ):
+      case( GL.GL_SHORT ):
+      case( GL.GL_UNSIGNED_SHORT ):
+      case( GL2ES2.GL_INT ):
+      case( GL.GL_UNSIGNED_INT ):
+      case( GL.GL_FLOAT ):
       case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
       case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ):
+      case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
       case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ):
+      case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
       case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ):
+      case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
       case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
       case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
       case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
-      case( GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ):
-      case( GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ):
+      case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+      case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
         return( true );
       default:
         return( false );
     }
   }
 
-  public static boolean isTypePackedPixel( int type ) {
+  public static boolean isTypePackedPixel( final int type ) {
     assert( legalType( type ) );
 
     if( type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ||
         type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ||
+        type == GL.GL_UNSIGNED_SHORT_5_6_5 ||
         type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ||
+        type == GL.GL_UNSIGNED_SHORT_4_4_4_4 ||
         type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ||
+        type == GL.GL_UNSIGNED_SHORT_5_5_5_1 ||
         type == GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ||
         type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ||
         type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ||
-        type == GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ||
-        type == GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ) {
+        type == GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ||
+        type == GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ) {
           return( true );
     }
     return( false );
   }
 
-  public static boolean isLegalFormatForPackedPixelType( int format, int type ) {
+  public static boolean isLegalFormatForPackedPixelType( final int format, final int type ) {
     // if not a packed pixel type then return true
     if( isTypePackedPixel( type ) ) {
       return( true );
@@ -212,29 +216,29 @@ public class Mipmap {
 
     // 3_3_2/2_3_3_REV & 5_6_5/5_6_5_REV are only compatible with RGB
     if( (type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 || type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 || type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV )
-        & format != GL2GL3.GL_RGB ) {
+        type == GL.GL_UNSIGNED_SHORT_5_6_5 || type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV )
+        & format != GL.GL_RGB ) {
           return( false );
     }
 
     // 4_4_4_4/4_4_4_4_REV & 5_5_5_1/1_5_5_5_REV & 8_8_8_8/8_8_8_8_REV &
     // 10_10_10_2/2_10_10_10_REV are only campatible with RGBA, BGRA & ARGB_EXT
-    if( ( type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ||
+    if( ( type == GL.GL_UNSIGNED_SHORT_4_4_4_4 ||
           type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ||
-          type == GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ||
+          type == GL.GL_UNSIGNED_SHORT_5_5_5_1 ||
           type == GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ||
           type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ||
           type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ||
-          type == GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ||
-          type == GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ) &&
+          type == GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ||
+          type == GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ) &&
           (format != GL.GL_RGBA && format != GL.GL_BGRA) ) {
             return( false );
     }
     return( true );
   }
 
-  public static boolean isLegalLevels( int userLevel, int baseLevel, int maxLevel,
-                                            int totalLevels ) {
+  public static boolean isLegalLevels( final int userLevel, final int baseLevel, final int maxLevel,
+                                            final int totalLevels ) {
     if( (baseLevel < 0) || (baseLevel < userLevel) || (maxLevel < baseLevel) ||
                                                   (totalLevels < maxLevel) ) {
       return( false );
@@ -249,13 +253,13 @@ public class Mipmap {
    * advertise the texture extension.
    * Note that proxy textures are implemented but not according to spec in IMPACT*
    */
-  public static void closestFit( GL gl, int target, int width, int height, int internalFormat,
-                                int format, int type, int[] newWidth, int[] newHeight ) {
+  public static void closestFit( final GL gl, final int target, final int width, final int height, final int internalFormat,
+                                final int format, final int type, final int[] newWidth, final int[] newHeight ) {
     // Use proxy textures if OpenGL version >= 1.1
     if( Double.parseDouble( gl.glGetString( GL.GL_VERSION ).trim().substring( 0, 3 ) ) >= 1.1 ) {
       int widthPowerOf2 = nearestPower( width );
       int heightPowerOf2 = nearestPower( height );
-      int[] proxyWidth = new int[1];
+      final int[] proxyWidth = new int[1];
       boolean noProxyTextures = false;
 
       // Some drivers (in particular, ATI's) seem to set a GL error
@@ -265,24 +269,24 @@ public class Mipmap {
       try {
         do {
           // compute level 1 width & height, clamping each at 1
-          int widthAtLevelOne = ( ( width > 1 ) ? (widthPowerOf2 >> 1) : widthPowerOf2 );
-          int heightAtLevelOne = ( ( height > 1 ) ? (heightPowerOf2 >> 1) : heightPowerOf2 );
+          final int widthAtLevelOne = ( ( width > 1 ) ? (widthPowerOf2 >> 1) : widthPowerOf2 );
+          final int heightAtLevelOne = ( ( height > 1 ) ? (heightPowerOf2 >> 1) : heightPowerOf2 );
           int proxyTarget;
 
           assert( widthAtLevelOne > 0 );
           assert( heightAtLevelOne > 0 );
 
           // does width x height at level 1 & all their mipmaps fit?
-          if( target == GL2GL3.GL_TEXTURE_2D || target == GL2GL3.GL_PROXY_TEXTURE_2D ) {
+          if( target == GL.GL_TEXTURE_2D || target == GL2GL3.GL_PROXY_TEXTURE_2D ) {
             proxyTarget = GL2GL3.GL_PROXY_TEXTURE_2D;
             gl.glTexImage2D( proxyTarget, 1, internalFormat, widthAtLevelOne,
                              heightAtLevelOne, 0, format, type, null );
-          } else if( (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_X) ||
-                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_X) ||
-                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Y) ||
-                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) ||
-                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_POSITIVE_Z) ||
-                     (target == GL2GL3.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) ) {
+          } else if( (target == GL.GL_TEXTURE_CUBE_MAP_POSITIVE_X) ||
+                     (target == GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_X) ||
+                     (target == GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Y) ||
+                     (target == GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Y) ||
+                     (target == GL.GL_TEXTURE_CUBE_MAP_POSITIVE_Z) ||
+                     (target == GL.GL_TEXTURE_CUBE_MAP_NEGATIVE_Z) ) {
             proxyTarget = GL2GL3.GL_PROXY_TEXTURE_CUBE_MAP;
             gl.glTexImage2D( proxyTarget, 1, internalFormat, widthAtLevelOne,
                              heightAtLevelOne, 0, format, type, null );
@@ -313,7 +317,7 @@ public class Mipmap {
           }
           // else it does fit
         } while( proxyWidth[0] == 0 );
-      } catch (GLException e) {
+      } catch (final GLException e) {
         noProxyTextures = true;
       }
       // loop must terminate
@@ -324,8 +328,8 @@ public class Mipmap {
         return;
       }
     }
-    int[] maxsize = new int[1];
-    gl.glGetIntegerv( GL2GL3.GL_MAX_TEXTURE_SIZE, maxsize , 0);
+    final int[] maxsize = new int[1];
+    gl.glGetIntegerv( GL.GL_MAX_TEXTURE_SIZE, maxsize , 0);
     // clamp user's texture sizes to maximum sizes, if necessary
     newWidth[0] = nearestPower( width );
     if( newWidth[0] > maxsize[0] ) {
@@ -337,26 +341,26 @@ public class Mipmap {
     }
   }
 
-  public static void closestFit3D( GL gl, int target, int width, int height, int depth,
-          int internalFormat, int format, int type, int[] newWidth, int[] newHeight,
-          int[] newDepth ) {
+  public static void closestFit3D( final GL gl, final int target, final int width, final int height, final int depth,
+          final int internalFormat, final int format, final int type, final int[] newWidth, final int[] newHeight,
+          final int[] newDepth ) {
     int widthPowerOf2 = nearestPower( width );
     int heightPowerOf2 = nearestPower( height );
     int depthPowerOf2 = nearestPower( depth );
-    int[] proxyWidth = new int[1];
+    final int[] proxyWidth = new int[1];
 
     do {
       // compute level 1 width & height & depth, clamping each at 1
-      int widthAtLevelOne = (widthPowerOf2 > 1) ? widthPowerOf2 >> 1 : widthPowerOf2;
-      int heightAtLevelOne = (heightPowerOf2 > 1) ? heightPowerOf2 >> 1 : heightPowerOf2;
-      int depthAtLevelOne = (depthPowerOf2 > 1) ? depthPowerOf2 >> 1 : depthPowerOf2;
+      final int widthAtLevelOne = (widthPowerOf2 > 1) ? widthPowerOf2 >> 1 : widthPowerOf2;
+      final int heightAtLevelOne = (heightPowerOf2 > 1) ? heightPowerOf2 >> 1 : heightPowerOf2;
+      final int depthAtLevelOne = (depthPowerOf2 > 1) ? depthPowerOf2 >> 1 : depthPowerOf2;
       int proxyTarget = 0;
       assert( widthAtLevelOne > 0 );
       assert( heightAtLevelOne > 0 );
       assert( depthAtLevelOne > 0 );
 
       // does width x height x depth at level 1 & all their mipmaps fit?
-      if( target == GL2GL3.GL_TEXTURE_3D || target == GL2GL3.GL_PROXY_TEXTURE_3D ) {
+      if( target == GL2ES2.GL_TEXTURE_3D || target == GL2GL3.GL_PROXY_TEXTURE_3D ) {
         proxyTarget = GL2GL3.GL_PROXY_TEXTURE_3D;
         gl.getGL2GL3().glTexImage3D( proxyTarget, 1, internalFormat, widthAtLevelOne,
                 heightAtLevelOne, depthAtLevelOne, 0, format, type, null );
@@ -385,31 +389,31 @@ public class Mipmap {
     newDepth[0] = depthPowerOf2;
   }
 
-  public static int elements_per_group( int format, int type ) {
+  public static int elements_per_group( final int format, final int type ) {
     // Return the number of elements per grtoup of a specified gromat
 
     // If the type is packedpixels then answer is 1
     if( type == GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ||
         type == GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ||
+        type == GL.GL_UNSIGNED_SHORT_5_6_5 ||
         type == GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ||
+        type == GL.GL_UNSIGNED_SHORT_4_4_4_4 ||
         type == GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ||
-        type == GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ||
+        type == GL.GL_UNSIGNED_SHORT_5_5_5_1 ||
         type == GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ||
         type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ||
         type == GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ||
-        type == GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ||
-        type == GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ) {
+        type == GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ||
+        type == GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ) {
           return( 1 );
     }
 
     // Types are not packed pixels so get elements per group
     switch( format ) {
-      case( GL2GL3.GL_RGB ):
+      case( GL.GL_RGB ):
       case( GL2GL3.GL_BGR ):
         return( 3 );
-      case( GL2GL3.GL_LUMINANCE_ALPHA ):
+      case( GL.GL_LUMINANCE_ALPHA ):
         return( 2 );
       case( GL.GL_RGBA ):
       case( GL.GL_BGRA ):
@@ -419,45 +423,45 @@ public class Mipmap {
     }
   }
 
-  public static int bytes_per_element( int type ) {
+  public static int bytes_per_element( final int type ) {
     // return the number of bytes per element, based on the element type
 
     switch( type ) {
       case( GL2.GL_BITMAP ):
-      case( GL2GL3.GL_BYTE ):
-      case( GL2GL3.GL_UNSIGNED_BYTE ):
+      case( GL.GL_BYTE ):
+      case( GL.GL_UNSIGNED_BYTE ):
       case( GL2GL3.GL_UNSIGNED_BYTE_3_3_2 ):
       case( GL2GL3.GL_UNSIGNED_BYTE_2_3_3_REV ):
         return( 1 );
-      case( GL2GL3.GL_SHORT ):
-      case( GL2GL3.GL_UNSIGNED_SHORT ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5 ):
+      case( GL.GL_SHORT ):
+      case( GL.GL_UNSIGNED_SHORT ):
+      case( GL.GL_UNSIGNED_SHORT_5_6_5 ):
       case( GL2GL3.GL_UNSIGNED_SHORT_5_6_5_REV ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4 ):
+      case( GL.GL_UNSIGNED_SHORT_4_4_4_4 ):
       case( GL2GL3.GL_UNSIGNED_SHORT_4_4_4_4_REV ):
-      case( GL2GL3.GL_UNSIGNED_SHORT_5_5_5_1 ):
+      case( GL.GL_UNSIGNED_SHORT_5_5_5_1 ):
       case( GL2GL3.GL_UNSIGNED_SHORT_1_5_5_5_REV ):
         return( 2 );
-      case( GL2GL3.GL_INT ):
-      case( GL2GL3.GL_UNSIGNED_INT ):
+      case( GL2ES2.GL_INT ):
+      case( GL.GL_UNSIGNED_INT ):
       case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8 ):
       case( GL2GL3.GL_UNSIGNED_INT_8_8_8_8_REV ):
-      case( GL2GL3.GL_UNSIGNED_INT_10_10_10_2 ):
-      case( GL2GL3.GL_UNSIGNED_INT_2_10_10_10_REV ):
-      case( GL2GL3.GL_FLOAT ):
+      case( GL2ES2.GL_UNSIGNED_INT_10_10_10_2 ):
+      case( GL2ES2.GL_UNSIGNED_INT_2_10_10_10_REV ):
+      case( GL.GL_FLOAT ):
         return( 4 );
       default:
         return( 4 );
     }
   }
 
-  public static boolean is_index( int format ) {
-    return( format == GL2.GL_COLOR_INDEX || format == GL2GL3.GL_STENCIL_INDEX );
+  public static boolean is_index( final int format ) {
+    return( format == GL2.GL_COLOR_INDEX || format == GL2ES2.GL_STENCIL_INDEX );
   }
 
   /* Compute memory required for internal packed array of data of given type and format. */
 
-  public static int image_size( int width, int height, int format, int type ) {
+  public static int image_size( final int width, final int height, final int format, final int type ) {
     int bytes_per_row;
     int components;
 
@@ -472,9 +476,9 @@ public class Mipmap {
     return( bytes_per_row * height * components );
   }
 
-  public static int imageSize3D( int width, int height, int depth, int format, int type ) {
-    int components = elements_per_group( format, type );
-    int bytes_per_row = bytes_per_element( type ) * width;
+  public static int imageSize3D( final int width, final int height, final int depth, final int format, final int type ) {
+    final int components = elements_per_group( format, type );
+    final int bytes_per_row = bytes_per_element( type ) * width;
 
     assert( width > 0 && height > 0 && depth > 0 );
     assert( type != GL2.GL_BITMAP );
@@ -482,28 +486,28 @@ public class Mipmap {
     return( bytes_per_row * height * depth * components );
   }
 
-  public static void retrieveStoreModes( GL gl, PixelStorageModes psm ) {
-    int[] a = new int[1];
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0);
+  public static void retrieveStoreModes( final GL gl, final PixelStorageModes psm ) {
+    final int[] a = new int[1];
+    gl.glGetIntegerv( GL.GL_UNPACK_ALIGNMENT, a, 0);
     psm.setUnpackAlignment( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_ROW_LENGTH, a, 0);
+    gl.glGetIntegerv( GL2ES2.GL_UNPACK_ROW_LENGTH, a, 0);
     psm.setUnpackRowLength( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_ROWS, a, 0);
+    gl.glGetIntegerv( GL2ES2.GL_UNPACK_SKIP_ROWS, a, 0);
     psm.setUnpackSkipRows( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_PIXELS, a, 0);
+    gl.glGetIntegerv( GL2ES2.GL_UNPACK_SKIP_PIXELS, a, 0);
     psm.setUnpackSkipPixels( a[0] );
     gl.glGetIntegerv( GL2GL3.GL_UNPACK_LSB_FIRST, a, 0);
     psm.setUnpackLsbFirst( ( a[0] == 1 ) );
     gl.glGetIntegerv( GL2GL3.GL_UNPACK_SWAP_BYTES, a, 0);
     psm.setUnpackSwapBytes( ( a[0] == 1 ) );
 
-    gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0);
+    gl.glGetIntegerv( GL.GL_PACK_ALIGNMENT, a, 0);
     psm.setPackAlignment( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0);
+    gl.glGetIntegerv( GL2ES3.GL_PACK_ROW_LENGTH, a, 0);
     psm.setPackRowLength( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_ROWS, a, 0);
+    gl.glGetIntegerv( GL2ES3.GL_PACK_SKIP_ROWS, a, 0);
     psm.setPackSkipRows( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_PIXELS, a, 0);
+    gl.glGetIntegerv( GL2ES3.GL_PACK_SKIP_PIXELS, a, 0);
     psm.setPackSkipPixels( a[0] );
     gl.glGetIntegerv( GL2GL3.GL_PACK_LSB_FIRST, a, 0);
     psm.setPackLsbFirst( ( a[0] == 1 ) );
@@ -511,32 +515,32 @@ public class Mipmap {
     psm.setPackSwapBytes( ( a[0] == 1 ) );
   }
 
-  public static void retrieveStoreModes3D( GL gl, PixelStorageModes psm ) {
-    int[] a = new int[1];
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_ALIGNMENT, a, 0);
+  public static void retrieveStoreModes3D( final GL gl, final PixelStorageModes psm ) {
+    final int[] a = new int[1];
+    gl.glGetIntegerv( GL.GL_UNPACK_ALIGNMENT, a, 0);
     psm.setUnpackAlignment( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_ROW_LENGTH, a, 0);
+    gl.glGetIntegerv( GL2ES2.GL_UNPACK_ROW_LENGTH, a, 0);
     psm.setUnpackRowLength( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_ROWS, a, 0);
+    gl.glGetIntegerv( GL2ES2.GL_UNPACK_SKIP_ROWS, a, 0);
     psm.setUnpackSkipRows( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_PIXELS, a, 0);
+    gl.glGetIntegerv( GL2ES2.GL_UNPACK_SKIP_PIXELS, a, 0);
     psm.setUnpackSkipPixels( a[0] );
     gl.glGetIntegerv( GL2GL3.GL_UNPACK_LSB_FIRST, a, 0);
     psm.setUnpackLsbFirst( ( a[0] == 1 ) );
     gl.glGetIntegerv( GL2GL3.GL_UNPACK_SWAP_BYTES, a, 0);
     psm.setUnpackSwapBytes( ( a[0] == 1 ) );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_SKIP_IMAGES, a, 0);
+    gl.glGetIntegerv( GL2ES3.GL_UNPACK_SKIP_IMAGES, a, 0);
     psm.setUnpackSkipImages( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_UNPACK_IMAGE_HEIGHT, a, 0);
+    gl.glGetIntegerv( GL2ES3.GL_UNPACK_IMAGE_HEIGHT, a, 0);
     psm.setUnpackImageHeight( a[0] );
 
-    gl.glGetIntegerv( GL2GL3.GL_PACK_ALIGNMENT, a, 0);
+    gl.glGetIntegerv( GL.GL_PACK_ALIGNMENT, a, 0);
     psm.setPackAlignment( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_ROW_LENGTH, a, 0);
+    gl.glGetIntegerv( GL2ES3.GL_PACK_ROW_LENGTH, a, 0);
     psm.setPackRowLength( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_ROWS, a, 0);
+    gl.glGetIntegerv( GL2ES3.GL_PACK_SKIP_ROWS, a, 0);
     psm.setPackSkipRows( a[0] );
-    gl.glGetIntegerv( GL2GL3.GL_PACK_SKIP_PIXELS, a, 0 );
+    gl.glGetIntegerv( GL2ES3.GL_PACK_SKIP_PIXELS, a, 0 );
     psm.setPackSkipPixels( a[0] );
     gl.glGetIntegerv( GL2GL3.GL_PACK_LSB_FIRST, a, 0 );
     psm.setPackLsbFirst( ( a[0] == 1 ) );
@@ -548,17 +552,17 @@ public class Mipmap {
     psm.setPackImageHeight( a[0] );
   }
 
-  public static int gluScaleImage( GL gl, int format, int widthin, int heightin,
-          int typein, ByteBuffer datain, int widthout, int heightout,
-          int typeout, ByteBuffer dataout ) {
-    int datainPos = datain.position();
-    int dataoutPos = dataout.position();
+  public static int gluScaleImage( final GL gl, final int format, final int widthin, final int heightin,
+          final int typein, final ByteBuffer datain, final int widthout, final int heightout,
+          final int typeout, final ByteBuffer dataout ) {
+    final int datainPos = datain.position();
+    final int dataoutPos = dataout.position();
     try {
 
       int components;
       ByteBuffer beforeimage;
       ByteBuffer afterimage;
-      PixelStorageModes psm = new PixelStorageModes();
+      final PixelStorageModes psm = new PixelStorageModes();
 
       if( (widthin == 0)  || (heightin == 0) || (widthout == 0) || (heightout == 0) ) {
         return( 0 );
@@ -575,8 +579,8 @@ public class Mipmap {
       if( !isLegalFormatForPackedPixelType( format, typeout ) ) {
         return( GLU.GLU_INVALID_OPERATION );
       }
-      beforeimage = Buffers.newDirectByteBuffer( image_size( widthin, heightin, format, GL2GL3.GL_UNSIGNED_SHORT ) );
-      afterimage = Buffers.newDirectByteBuffer( image_size( widthout, heightout, format, GL2GL3.GL_UNSIGNED_SHORT ) );
+      beforeimage = Buffers.newDirectByteBuffer( image_size( widthin, heightin, format, GL.GL_UNSIGNED_SHORT ) );
+      afterimage = Buffers.newDirectByteBuffer( image_size( widthout, heightout, format, GL.GL_UNSIGNED_SHORT ) );
       if( beforeimage == null || afterimage == null ) {
         return( GLU.GLU_OUT_OF_MEMORY );
       }
@@ -594,15 +598,15 @@ public class Mipmap {
     }
   }
 
-  public static int gluBuild1DMipmapLevels( GL gl, int target, int internalFormat,
-                          int width, int format, int type, int userLevel, int baseLevel,
-                          int maxLevel, ByteBuffer data ) {
-    int dataPos = data.position();
+  public static int gluBuild1DMipmapLevels( final GL gl, final int target, final int internalFormat,
+                          final int width, final int format, final int type, final int userLevel, final int baseLevel,
+                          final int maxLevel, final ByteBuffer data ) {
+    final int dataPos = data.position();
     try {
 
       int levels;
 
-      int rc = checkMipmapArgs( internalFormat, format, type );
+      final int rc = checkMipmapArgs( internalFormat, format, type );
       if( rc != 0 ) {
         return( rc );
       }
@@ -625,16 +629,16 @@ public class Mipmap {
     }
   }
 
-  public static int gluBuild1DMipmaps( GL gl, int target, int internalFormat, int width,
-              int format, int type, ByteBuffer data ) {
-    int dataPos = data.position();
+  public static int gluBuild1DMipmaps( final GL gl, final int target, final int internalFormat, final int width,
+              final int format, final int type, final ByteBuffer data ) {
+    final int dataPos = data.position();
 
     try {
-      int[] widthPowerOf2 = new int[1];
+      final int[] widthPowerOf2 = new int[1];
       int levels;
-      int[] dummy = new int[1];
+      final int[] dummy = new int[1];
 
-      int rc = checkMipmapArgs( internalFormat, format, type );
+      final int rc = checkMipmapArgs( internalFormat, format, type );
       if( rc != 0 ) {
         return( rc );
       }
@@ -654,14 +658,12 @@ public class Mipmap {
   }
 
 
-  public static int gluBuild2DMipmapLevels( GL gl, int target, int internalFormat,
-          int width, int height, int format, int type, int userLevel,
-          int baseLevel, int maxLevel, Object data ) {
-    int dataPos = 0;
-
+  public static int gluBuild2DMipmapLevels( final GL gl, final int target, final int internalFormat,
+          final int width, final int height, final int format, final int type, final int userLevel,
+          final int baseLevel, final int maxLevel, final Object data ) {
     int level, levels;
 
-    int rc = checkMipmapArgs( internalFormat, format, type );
+    final int rc = checkMipmapArgs( internalFormat, format, type );
     if( rc != 0 ) {
       return( rc );
     }
@@ -682,31 +684,34 @@ public class Mipmap {
     }
 
     //PointerWrapper pointer = PointerWrapperFactory.getPointerWrapper( data );
-    ByteBuffer buffer = null;
+    final ByteBuffer buffer;
     if( data instanceof ByteBuffer ) {
         buffer = (ByteBuffer)data;
-        dataPos = buffer.position();
     } else if( data instanceof byte[] ) {
-      byte[] array = (byte[])data;
-      buffer = ByteBuffer.allocateDirect(array.length);
-      buffer.put(array);
+        final byte[] array = (byte[])data;
+        buffer = ByteBuffer.allocateDirect(array.length);
+        buffer.put(array);
+        buffer.flip();
     } else if( data instanceof short[] ) {
-        short[] array = (short[])data;
+        final short[] array = (short[])data;
         buffer = ByteBuffer.allocateDirect( array.length * 2 );
-        ShortBuffer sb = buffer.asShortBuffer();
+        final ShortBuffer sb = buffer.asShortBuffer();
         sb.put( array );
     } else if( data instanceof int[] ) {
-        int[] array = (int[])data;
+        final int[] array = (int[])data;
         buffer = ByteBuffer.allocateDirect( array.length * 4 );
-        IntBuffer ib = buffer.asIntBuffer();
+        final IntBuffer ib = buffer.asIntBuffer();
         ib.put( array );
     } else if( data instanceof float[] ) {
-        float[] array = (float[])data;
+        final float[] array = (float[])data;
         buffer = ByteBuffer.allocateDirect( array.length * 4 );
-        FloatBuffer fb = buffer.asFloatBuffer();
+        final FloatBuffer fb = buffer.asFloatBuffer();
         fb.put( array );
+    } else {
+        throw new IllegalArgumentException("Unhandled data type: "+data.getClass().getName());
     }
 
+    final int dataPos = buffer.position();
     try {
       return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat,
               width, height, width, height, format, type, userLevel, baseLevel,
@@ -717,15 +722,13 @@ public class Mipmap {
   }
 
 
-  public static int gluBuild2DMipmaps( GL gl, int target, int internalFormat,
-          int width, int height, int format, int type, Object data ) {
-    int dataPos = 0;
-
-    int[] widthPowerOf2 = new int[1];
-    int[] heightPowerOf2 = new int[1];
+  public static int gluBuild2DMipmaps( final GL gl, final int target, final int internalFormat,
+          final int width, final int height, final int format, final int type, final Object data ) {
+    final int[] widthPowerOf2 = new int[1];
+    final int[] heightPowerOf2 = new int[1];
     int level, levels;
 
-    int rc = checkMipmapArgs( internalFormat, format, type );
+    final int rc = checkMipmapArgs( internalFormat, format, type );
     if( rc != 0 ) {
       return( rc );
     }
@@ -744,31 +747,34 @@ public class Mipmap {
     }
 
     //PointerWrapper pointer = PointerWrapperFactory.getPointerWrapper( data );
-    ByteBuffer buffer = null;
+    final ByteBuffer buffer;
     if( data instanceof ByteBuffer ) {
         buffer = (ByteBuffer)data;
-        dataPos = buffer.position();
     } else if( data instanceof byte[] ) {
-      byte[] array = (byte[])data;
-      buffer = ByteBuffer.allocateDirect(array.length);
-      buffer.put(array);
+        final byte[] array = (byte[])data;
+        buffer = ByteBuffer.allocateDirect(array.length);
+        buffer.put(array);
+        buffer.flip();
     } else if( data instanceof short[] ) {
-        short[] array = (short[])data;
+        final short[] array = (short[])data;
         buffer = ByteBuffer.allocateDirect( array.length * 2 );
-        ShortBuffer sb = buffer.asShortBuffer();
+        final ShortBuffer sb = buffer.asShortBuffer();
         sb.put( array );
     } else if( data instanceof int[] ) {
-        int[] array = (int[])data;
+        final int[] array = (int[])data;
         buffer = ByteBuffer.allocateDirect( array.length * 4 );
-        IntBuffer ib = buffer.asIntBuffer();
+        final IntBuffer ib = buffer.asIntBuffer();
         ib.put( array );
     } else if( data instanceof float[] ) {
-        float[] array = (float[])data;
+        final float[] array = (float[])data;
         buffer = ByteBuffer.allocateDirect( array.length * 4 );
-        FloatBuffer fb = buffer.asFloatBuffer();
+        final FloatBuffer fb = buffer.asFloatBuffer();
         fb.put( array );
+    } else {
+        throw new IllegalArgumentException("Unhandled data type: "+data.getClass().getName());
     }
 
+    final int dataPos = buffer.position();
     try {
       return( BuildMipmap.gluBuild2DMipmapLevelsCore( gl, target, internalFormat,
               width, height, widthPowerOf2[0], heightPowerOf2[0], format, type, 0,
@@ -779,17 +785,17 @@ public class Mipmap {
   }
 
 
-  public static int gluBuild3DMipmaps( GL gl, int target, int internalFormat,
-          int width, int height, int depth, int format, int type, ByteBuffer data ) {
-    int dataPos = data.position();
+  public static int gluBuild3DMipmaps( final GL gl, final int target, final int internalFormat,
+          final int width, final int height, final int depth, final int format, final int type, final ByteBuffer data ) {
+    final int dataPos = data.position();
     try {
 
-      int[] widthPowerOf2 = new int[1];
-      int[] heightPowerOf2 = new int[1];
-      int[] depthPowerOf2 = new int[1];
+      final int[] widthPowerOf2 = new int[1];
+      final int[] heightPowerOf2 = new int[1];
+      final int[] depthPowerOf2 = new int[1];
       int level, levels;
 
-      int rc = checkMipmapArgs( internalFormat, format, type );
+      final int rc = checkMipmapArgs( internalFormat, format, type );
       if( rc != 0 ) {
         return( rc );
       }
@@ -823,14 +829,14 @@ public class Mipmap {
     }
   }
 
-  public static int gluBuild3DMipmapLevels( GL gl, int target, int internalFormat,
-          int width, int height, int depth, int format, int type, int userLevel,
-          int baseLevel, int maxLevel, ByteBuffer data ) {
-    int dataPos = data.position();
+  public static int gluBuild3DMipmapLevels( final GL gl, final int target, final int internalFormat,
+          final int width, final int height, final int depth, final int format, final int type, final int userLevel,
+          final int baseLevel, final int maxLevel, final ByteBuffer data ) {
+    final int dataPos = data.position();
     try {
       int level, levels;
 
-      int rc = checkMipmapArgs( internalFormat, format, type );
+      final int rc = checkMipmapArgs( internalFormat, format, type );
       if( rc != 0 ) {
         return( rc );
       }
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
index 7eb98db..9b26647 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/PixelStorageModes.java
@@ -147,7 +147,7 @@ public class PixelStorageModes {
    * Setter for property packAlignment.
    * @param packAlignment New value of property packAlignment.
    */
-  public void setPackAlignment(int packAlignment) {
+  public void setPackAlignment(final int packAlignment) {
 
     this.packAlignment = packAlignment;
   }
@@ -165,7 +165,7 @@ public class PixelStorageModes {
    * Setter for property packRowLength.
    * @param packRowLength New value of property packRowLength.
    */
-  public void setPackRowLength(int packRowLength) {
+  public void setPackRowLength(final int packRowLength) {
 
     this.packRowLength = packRowLength;
   }
@@ -183,7 +183,7 @@ public class PixelStorageModes {
    * Setter for property packSkipRows.
    * @param packSkipRows New value of property packSkipRows.
    */
-  public void setPackSkipRows(int packSkipRows) {
+  public void setPackSkipRows(final int packSkipRows) {
 
     this.packSkipRows = packSkipRows;
   }
@@ -201,7 +201,7 @@ public class PixelStorageModes {
    * Setter for property packSkipPixels.
    * @param packSkipPixels New value of property packSkipPixels.
    */
-  public void setPackSkipPixels(int packSkipPixels) {
+  public void setPackSkipPixels(final int packSkipPixels) {
 
     this.packSkipPixels = packSkipPixels;
   }
@@ -219,7 +219,7 @@ public class PixelStorageModes {
    * Setter for property packLsbFirst.
    * @param packLsbFirst New value of property packLsbFirst.
    */
-  public void setPackLsbFirst(boolean packLsbFirst) {
+  public void setPackLsbFirst(final boolean packLsbFirst) {
 
     this.packLsbFirst = packLsbFirst;
   }
@@ -237,7 +237,7 @@ public class PixelStorageModes {
    * Setter for property packSwapBytes.
    * @param packSwapBytes New value of property packSwapBytes.
    */
-  public void setPackSwapBytes(boolean packSwapBytes) {
+  public void setPackSwapBytes(final boolean packSwapBytes) {
 
     this.packSwapBytes = packSwapBytes;
   }
@@ -255,7 +255,7 @@ public class PixelStorageModes {
    * Setter for property packSkipImages.
    * @param packSkipImages New value of property packSkipImages.
    */
-  public void setPackSkipImages(int packSkipImages) {
+  public void setPackSkipImages(final int packSkipImages) {
 
     this.packSkipImages = packSkipImages;
   }
@@ -273,7 +273,7 @@ public class PixelStorageModes {
    * Setter for property packImageHeight.
    * @param packImageHeight New value of property packImageHeight.
    */
-  public void setPackImageHeight(int packImageHeight) {
+  public void setPackImageHeight(final int packImageHeight) {
 
     this.packImageHeight = packImageHeight;
   }
@@ -291,7 +291,7 @@ public class PixelStorageModes {
    * Setter for property unpackAlignment.
    * @param unpackAlignment New value of property unpackAlignment.
    */
-  public void setUnpackAlignment(int unpackAlignment) {
+  public void setUnpackAlignment(final int unpackAlignment) {
 
     this.unpackAlignment = unpackAlignment;
   }
@@ -309,7 +309,7 @@ public class PixelStorageModes {
    * Setter for property unpackRowLength.
    * @param unpackRowLength New value of property unpackRowLength.
    */
-  public void setUnpackRowLength(int unpackRowLength) {
+  public void setUnpackRowLength(final int unpackRowLength) {
 
     this.unpackRowLength = unpackRowLength;
   }
@@ -327,7 +327,7 @@ public class PixelStorageModes {
    * Setter for property unpackSkipRows.
    * @param unpackSkipRows New value of property unpackSkipRows.
    */
-  public void setUnpackSkipRows(int unpackSkipRows) {
+  public void setUnpackSkipRows(final int unpackSkipRows) {
 
     this.unpackSkipRows = unpackSkipRows;
   }
@@ -345,7 +345,7 @@ public class PixelStorageModes {
    * Setter for property unpackSkipPixels.
    * @param unpackSkipPixels New value of property unpackSkipPixels.
    */
-  public void setUnpackSkipPixels(int unpackSkipPixels) {
+  public void setUnpackSkipPixels(final int unpackSkipPixels) {
 
     this.unpackSkipPixels = unpackSkipPixels;
   }
@@ -363,7 +363,7 @@ public class PixelStorageModes {
    * Setter for property unpackLsbFirst.
    * @param unpackLsbFirst New value of property unpackLsbFirst.
    */
-  public void setUnpackLsbFirst(boolean unpackLsbFirst) {
+  public void setUnpackLsbFirst(final boolean unpackLsbFirst) {
 
     this.unpackLsbFirst = unpackLsbFirst;
   }
@@ -381,7 +381,7 @@ public class PixelStorageModes {
    * Setter for property unpackSwapBytes.
    * @param unpackSwapBytes New value of property unpackSwapBytes.
    */
-  public void setUnpackSwapBytes(boolean unpackSwapBytes) {
+  public void setUnpackSwapBytes(final boolean unpackSwapBytes) {
 
     this.unpackSwapBytes = unpackSwapBytes;
   }
@@ -399,7 +399,7 @@ public class PixelStorageModes {
    * Setter for property unpackSkipImages.
    * @param unpackSkipImages New value of property unpackSkipImages.
    */
-  public void setUnpackSkipImages(int unpackSkipImages) {
+  public void setUnpackSkipImages(final int unpackSkipImages) {
 
     this.unpackSkipImages = unpackSkipImages;
   }
@@ -417,7 +417,7 @@ public class PixelStorageModes {
    * Setter for property unpackImageHeight.
    * @param unpackImageHeight New value of property unpackImageHeight.
    */
-  public void setUnpackImageHeight(int unpackImageHeight) {
+  public void setUnpackImageHeight(final int unpackImageHeight) {
 
     this.unpackImageHeight = unpackImageHeight;
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
index 9aca1fb..ccb7509 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/ScaleInternal.java
@@ -56,16 +56,16 @@ import com.jogamp.common.nio.Buffers;
  */
 public class ScaleInternal {
 
-  public static final float UINT_MAX = (float)(0x00000000FFFFFFFF);
+  public static final float UINT_MAX = (0x00000000FFFFFFFF);
 
-  public static void scale_internal( int components, int widthin, int heightin,
-          ShortBuffer datain, int widthout, int heightout, ShortBuffer dataout ) {
+  public static void scale_internal( final int components, final int widthin, final int heightin,
+          final ShortBuffer datain, final int widthout, final int heightout, final ShortBuffer dataout ) {
     float x, lowx, highx, convx, halfconvx;
     float y, lowy, highy, convy, halfconvy;
     float xpercent, ypercent;
     float percent;
     // Max components in a format is 4, so...
-    float[] totals = new float[4];
+    final float[] totals = new float[4];
     float area;
     int i, j, k, yint, xint, xindex, yindex;
     int temp;
@@ -147,14 +147,16 @@ public class ScaleInternal {
     }
   }
 
-  public static void scale_internal_ubyte( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout,
-                              ByteBuffer dataout, int element_size, int ysize, int group_size ) {
-    float x, convx;
-    float y, convy;
+  public static void scale_internal_ubyte( final int components, final int widthin, final int heightin,
+                              final ByteBuffer datain, final int widthout, final int heightout,
+                              final ByteBuffer dataout, final int element_size, final int ysize, final int group_size ) {
+    final float x;
+    float convx;
+    final float y;
+    float convy;
     float percent;
     // Max components in a format is 4, so...
-    float[] totals = new float[4];
+    final float[] totals = new float[4];
     float area;
     int i, j, k, xindex;
 
@@ -356,7 +358,7 @@ public class ScaleInternal {
 
         // Clamp to make sure we don't run off the right edge
         if (highx_int > widthin - 1) {
-          int delta = (highx_int - widthin + 1);
+          final int delta = (highx_int - widthin + 1);
           lowx_int -= delta;
           highx_int -= delta;
         }
@@ -372,15 +374,17 @@ public class ScaleInternal {
     }
   }
 
-  public static void scale_internal_byte( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout,
-                              ByteBuffer dataout, int element_size, int ysize,
-                              int group_size ) {
-    float x, convx;
-    float y, convy;
+  public static void scale_internal_byte( final int components, final int widthin, final int heightin,
+                              final ByteBuffer datain, final int widthout, final int heightout,
+                              final ByteBuffer dataout, final int element_size, final int ysize,
+                              final int group_size ) {
+    final float x;
+    float convx;
+    final float y;
+    float convy;
     float percent;
     // Max components in a format is 4, so...
-    float[] totals = new float[4];
+    final float[] totals = new float[4];
     float area;
     int i, j, k, xindex;
 
@@ -581,7 +585,7 @@ public class ScaleInternal {
 
         // Clamp to make sure we don't run off the right edge
         if (highx_int > widthin - 1) {
-          int delta = (highx_int - widthin + 1);
+          final int delta = (highx_int - widthin + 1);
           lowx_int -= delta;
           highx_int -= delta;
         }
@@ -597,15 +601,17 @@ public class ScaleInternal {
     }
   }
 
-  public static void scale_internal_ushort( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout,
-                              ShortBuffer dataout, int element_size, int ysize,
-                              int group_size, boolean myswap_bytes ) {
-    float x, convx;
-    float y, convy;
+  public static void scale_internal_ushort( final int components, final int widthin, final int heightin,
+                              final ByteBuffer datain, final int widthout, final int heightout,
+                              final ShortBuffer dataout, final int element_size, final int ysize,
+                              final int group_size, final boolean myswap_bytes ) {
+    final float x;
+    float convx;
+    final float y;
+    float convy;
     float percent;
     // Max components in a format is 4, so...
-    float[] totals = new float[4];
+    final float[] totals = new float[4];
     float area;
     int i, j, k, xindex;
 
@@ -673,7 +679,7 @@ public class ScaleInternal {
           for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
             datain.position( temp_index );
             if( myswap_bytes ) {
-              totals[k] += ( 0x0000FFFF & ((int)Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * percent;
+              totals[k] += ( 0x0000FFFF & (Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * percent;
             } else {
               totals[k] += ( 0x0000FFFF & datain.getShort() ) * percent;
             }
@@ -684,7 +690,7 @@ public class ScaleInternal {
             for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
               datain.position( temp_index );
               if( myswap_bytes ) {
-                totals[k] += ( 0x0000FFFF & ((int)Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * y_percent;
+                totals[k] += ( 0x0000FFFF & (Mipmap.GLU_SWAP_2_BYTES( datain.getShort() ))) * y_percent;
               } else {
                 totals[k] += ( 0x0000FFFF & datain.getShort()) * y_percent;
               }
@@ -869,7 +875,7 @@ public class ScaleInternal {
 
         // Clamp to make sure we don't run off the right edge
         if (highx_int > widthin - 1) {
-          int delta = (highx_int - widthin + 1);
+          final int delta = (highx_int - widthin + 1);
           lowx_int -= delta;
           highx_int -= delta;
         }
@@ -885,15 +891,17 @@ public class ScaleInternal {
     }
   }
 
-  public static void scale_internal_short( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout,
-                              ShortBuffer dataout, int element_size, int ysize,
-                              int group_size, boolean myswap_bytes ) {
-    float x, convx;
-    float y, convy;
+  public static void scale_internal_short( final int components, final int widthin, final int heightin,
+                              final ByteBuffer datain, final int widthout, final int heightout,
+                              final ShortBuffer dataout, final int element_size, final int ysize,
+                              final int group_size, final boolean myswap_bytes ) {
+    final float x;
+    float convx;
+    final float y;
+    float convy;
     float percent;
     // Max components in a format is 4, so...
-    float[] totals = new float[4];
+    final float[] totals = new float[4];
     float area;
     int i, j, k, xindex;
 
@@ -1173,7 +1181,7 @@ public class ScaleInternal {
 
         // Clamp to make sure we don't run off the right edge
         if (highx_int > widthin - 1) {
-          int delta = (highx_int - widthin + 1);
+          final int delta = (highx_int - widthin + 1);
           lowx_int -= delta;
           highx_int -= delta;
         }
@@ -1189,15 +1197,17 @@ public class ScaleInternal {
     }
   }
 
-  public static void scale_internal_uint( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout,
-                              IntBuffer dataout, int element_size, int ysize,
-                              int group_size, boolean myswap_bytes ) {
-    float x, convx;
-    float y, convy;
+  public static void scale_internal_uint( final int components, final int widthin, final int heightin,
+                              final ByteBuffer datain, final int widthout, final int heightout,
+                              final IntBuffer dataout, final int element_size, final int ysize,
+                              final int group_size, final boolean myswap_bytes ) {
+    final float x;
+    float convx;
+    final float y;
+    float convy;
     float percent;
     // Max components in a format is 4, so...
-    float[] totals = new float[4];
+    final float[] totals = new float[4];
     float area;
     int i, j, k, xindex;
 
@@ -1416,9 +1426,9 @@ public class ScaleInternal {
           percent = ( highy_float - lowy_float ) * ( highx_float - lowx_float );
           temp = xindex + (lowy_int * ysize);
           for( k = 0, temp_index = temp; k < components; k++, temp_index += element_size ) {
-            long tempInt0 = ( 0xFFFFFFFFL & datain.getInt( temp_index ) );
+            final long tempInt0 = ( 0xFFFFFFFFL & datain.getInt( temp_index ) );
             datain.position( temp_index );
-            long tempInt1 = ( 0xFFFFFFFFL & datain.getInt() );
+            final long tempInt1 = ( 0xFFFFFFFFL & datain.getInt() );
             datain.position( temp_index );
             if( myswap_bytes ) {
               totals[k] += (0x00000000FFFFFFFF & Mipmap.GLU_SWAP_4_BYTES( datain.getInt())) * percent;
@@ -1468,7 +1478,7 @@ public class ScaleInternal {
 
         // Clamp to make sure we don't run off the right edge
         if (highx_int > widthin - 1) {
-          int delta = (highx_int - widthin + 1);
+          final int delta = (highx_int - widthin + 1);
           lowx_int -= delta;
           highx_int -= delta;
         }
@@ -1484,15 +1494,17 @@ public class ScaleInternal {
     }
   }
 
-  public static void scale_internal_int( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout,
-                              IntBuffer dataout, int element_size, int ysize,
-                              int group_size, boolean myswap_bytes ) {
-    float x, convx;
-    float y, convy;
+  public static void scale_internal_int( final int components, final int widthin, final int heightin,
+                              final ByteBuffer datain, final int widthout, final int heightout,
+                              final IntBuffer dataout, final int element_size, final int ysize,
+                              final int group_size, final boolean myswap_bytes ) {
+    final float x;
+    float convx;
+    final float y;
+    float convy;
     float percent;
     // Max components in a format is 4, so...
-    float[] totals = new float[4];
+    final float[] totals = new float[4];
     float area;
     int i, j, k, xindex;
 
@@ -1772,7 +1784,7 @@ public class ScaleInternal {
 
         // Clamp to make sure we don't run off the right edge
         if (highx_int > widthin - 1) {
-          int delta = (highx_int - widthin + 1);
+          final int delta = (highx_int - widthin + 1);
           lowx_int -= delta;
           highx_int -= delta;
         }
@@ -1788,15 +1800,17 @@ public class ScaleInternal {
     }
   }
 
-  public static void scale_internal_float( int components, int widthin, int heightin,
-                              ByteBuffer datain, int widthout, int heightout,
-                              FloatBuffer dataout, int element_size, int ysize,
-                              int group_size, boolean myswap_bytes ) {
-    float x, convx;
-    float y, convy;
+  public static void scale_internal_float( final int components, final int widthin, final int heightin,
+                              final ByteBuffer datain, final int widthout, final int heightout,
+                              final FloatBuffer dataout, final int element_size, final int ysize,
+                              final int group_size, final boolean myswap_bytes ) {
+    final float x;
+    float convx;
+    final float y;
+    float convy;
     float percent;
     // Max components in a format is 4, so...
-    float[] totals = new float[4];
+    final float[] totals = new float[4];
     float area;
     int i, j, k, xindex;
 
@@ -2076,7 +2090,7 @@ public class ScaleInternal {
 
         // Clamp to make sure we don't run off the right edge
         if (highx_int > widthin - 1) {
-          int delta = (highx_int - widthin + 1);
+          final int delta = (highx_int - widthin + 1);
           lowx_int -= delta;
           highx_int -= delta;
         }
@@ -2092,25 +2106,27 @@ public class ScaleInternal {
     }
   }
 
-  public static void scaleInternalPackedPixel( int components, Extract extract,
-              int widthIn, int heightIn, ByteBuffer dataIn, int widthOut,
-              int heightOut, ByteBuffer dataOut, int pixelSizeInBytes,
-              int rowSizeInBytes, boolean isSwap ) {
-    float x, convx;
-    float y, convy;
+  public static void scaleInternalPackedPixel( final int components, final Extract extract,
+              final int widthIn, final int heightIn, final ByteBuffer dataIn, final int widthOut,
+              final int heightOut, final ByteBuffer dataOut, final int pixelSizeInBytes,
+              final int rowSizeInBytes, final boolean isSwap ) {
+    final float x;
+    float convx;
+    final float y;
+    float convy;
     float percent;
 
     // max components in a format is 4, so
-    float[] totals = new float[4];
-    float[] extractTotals = new float[4];
-    float[] extractMoreTotals = new float[4];
-    float[] shoveTotals = new float[4];
+    final float[] totals = new float[4];
+    final float[] extractTotals = new float[4];
+    final float[] extractMoreTotals = new float[4];
+    final float[] shoveTotals = new float[4];
 
     float area;
     int i, j, k, xindex;
 
     int temp, temp0;
-    int temp_index;
+    final int temp_index;
     int outIndex = 0;
 
     int lowx_int, highx_int, lowy_int, highy_int;
@@ -2309,7 +2325,7 @@ public class ScaleInternal {
 
         // Clamp to make sure we don't run off the right edge
         if (highx_int > widthIn - 1) {
-          int delta = (highx_int - widthIn + 1);
+          final int delta = (highx_int - widthIn + 1);
           lowx_int -= delta;
           highx_int -= delta;
         }
@@ -2326,16 +2342,16 @@ public class ScaleInternal {
     assert( outIndex == ( widthOut * heightOut - 1) );
   }
 
-  public static void scaleInternal3D( int components, int widthIn, int heightIn,
-          int depthIn, ShortBuffer dataIn, int widthOut, int heightOut,
-          int depthOut, ShortBuffer dataOut ) {
+  public static void scaleInternal3D( final int components, final int widthIn, final int heightIn,
+          final int depthIn, final ShortBuffer dataIn, final int widthOut, final int heightOut,
+          final int depthOut, final ShortBuffer dataOut ) {
     float x, lowx, highx, convx, halfconvx;
     float y, lowy, highy, convy, halfconvy;
     float z, lowz, highz, convz, halfconvz;
     float xpercent, ypercent, zpercent;
     float percent;
     // max compnents in a format is 4
-    float[] totals = new float[4];
+    final float[] totals = new float[4];
     float volume;
     int i, j, d, k, zint, yint, xint, xindex, yindex, zindex;
     int temp;
@@ -2442,12 +2458,12 @@ public class ScaleInternal {
     }
   }
 
-  public static int gluScaleImage3D( GL gl, int format, int widthIn, int heightIn,
-          int depthIn, int typeIn, ByteBuffer dataIn, int widthOut, int heightOut,
-          int depthOut, int typeOut, ByteBuffer dataOut ) {
+  public static int gluScaleImage3D( final GL gl, final int format, final int widthIn, final int heightIn,
+          final int depthIn, final int typeIn, final ByteBuffer dataIn, final int widthOut, final int heightOut,
+          final int depthOut, final int typeOut, final ByteBuffer dataOut ) {
     int components;
     ShortBuffer beforeImage, afterImage;
-    PixelStorageModes psm = new PixelStorageModes();
+    final PixelStorageModes psm = new PixelStorageModes();
 
     if( widthIn == 0 || heightIn == 0 || depthIn == 0 ||
             widthOut == 0 || heightOut == 0 || depthOut == 0 ) {
@@ -2475,10 +2491,10 @@ public class ScaleInternal {
 
     try {
         beforeImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
-                heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
+                heightIn, depthIn, format, GL.GL_UNSIGNED_SHORT ) ).asShortBuffer();
         afterImage = Buffers.newDirectByteBuffer( Mipmap.imageSize3D( widthIn,
-                heightIn, depthIn, format, GL2.GL_UNSIGNED_SHORT ) ).asShortBuffer();
-    } catch( OutOfMemoryError err ) {
+                heightIn, depthIn, format, GL.GL_UNSIGNED_SHORT ) ).asShortBuffer();
+    } catch( final OutOfMemoryError err ) {
       return( GLU.GLU_OUT_OF_MEMORY );
     }
     Mipmap.retrieveStoreModes3D( gl, psm );
diff --git a/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java b/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
index dc40188..8683f75 100644
--- a/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
+++ b/src/jogl/classes/jogamp/opengl/glu/mipmap/Type_Widget.java
@@ -61,7 +61,7 @@ public class Type_Widget {
     buffer = ByteBuffer.allocate( 4 );
   }
 
-  public void setUB0( byte b ) {
+  public void setUB0( final byte b ) {
     buffer.position( 0 );
     buffer.put( b );
   }
@@ -71,7 +71,7 @@ public class Type_Widget {
     return( buffer.get() );
   }
 
-  public void setUB1( byte b ) {
+  public void setUB1( final byte b ) {
     buffer.position( 1 );
     buffer.put( b );
   }
@@ -81,7 +81,7 @@ public class Type_Widget {
     return( buffer.get() );
   }
 
-  public void setUB2( byte b ) {
+  public void setUB2( final byte b ) {
     buffer.position( 2 );
     buffer.put( b );
   }
@@ -91,7 +91,7 @@ public class Type_Widget {
     return( buffer.get() );
   }
 
-  public void setUB3( byte b ) {
+  public void setUB3( final byte b ) {
     buffer.position( 3 );
     buffer.put( b );
   }
@@ -101,7 +101,7 @@ public class Type_Widget {
     return( buffer.get() );
   }
 
-  public void setUS0( short s ) {
+  public void setUS0( final short s ) {
     buffer.position( 0 );
     buffer.putShort( s );
   }
@@ -111,7 +111,7 @@ public class Type_Widget {
     return( buffer.getShort() );
   }
 
-  public void setUS1( short s ) {
+  public void setUS1( final short s ) {
     buffer.position( 2 );
     buffer.putShort( s );
   }
@@ -121,7 +121,7 @@ public class Type_Widget {
    return( buffer.getShort() );
   }
 
-  public void setUI( int i ) {
+  public void setUI( final int i ) {
     buffer.position( 0 );
     buffer.putInt( i );
   }
@@ -131,7 +131,7 @@ public class Type_Widget {
     return( buffer.getInt() );
   }
 
-  public void setB0( byte b ) {
+  public void setB0( final byte b ) {
     buffer.position( 0 );
     buffer.put( b );
   }
@@ -141,7 +141,7 @@ public class Type_Widget {
     return( buffer.get() );
   }
 
-  public void setB1( byte b ) {
+  public void setB1( final byte b ) {
     buffer.position( 1 );
     buffer.put( b );
   }
@@ -151,7 +151,7 @@ public class Type_Widget {
     return( buffer.get() );
   }
 
-  public void setB2( byte b ) {
+  public void setB2( final byte b ) {
     buffer.position( 2 );
     buffer.put( b );
   }
@@ -161,7 +161,7 @@ public class Type_Widget {
     return( buffer.get() );
   }
 
-  public void setB3( byte b ) {
+  public void setB3( final byte b ) {
     buffer.position( 3 );
     buffer.put( b );
   }
@@ -171,7 +171,7 @@ public class Type_Widget {
     return( buffer.get() );
   }
 
-  public void setS0( short s ) {
+  public void setS0( final short s ) {
     buffer.position( 0 );
     buffer.putShort( s );
   }
@@ -181,7 +181,7 @@ public class Type_Widget {
     return( buffer.getShort() );
   }
 
-  public void setS1( short s ) {
+  public void setS1( final short s ) {
     buffer.position( 2 );
     buffer.putShort( s );
   }
@@ -191,7 +191,7 @@ public class Type_Widget {
     return( buffer.getShort() );
   }
 
-  public void setI( int i ) {
+  public void setI( final int i ) {
     buffer.position( 0 );
     buffer.putInt( i );
   }
@@ -201,7 +201,7 @@ public class Type_Widget {
     return( buffer.getInt() );
   }
 
-  public void setF( float f ) {
+  public void setF( final float f ) {
     buffer.position( 0 );
     buffer.putFloat( f );
   }
@@ -216,8 +216,8 @@ public class Type_Widget {
     return( buffer );
   }
 
-  public static void main( String args[] ) {
-    Type_Widget t = new Type_Widget();
+  public static void main( final String args[] ) {
+    final Type_Widget t = new Type_Widget();
     t.setI( 1000000 );
 
     System.out.println("int: " + Integer.toHexString( t.getI() ) );
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
index df2b9a1..2194eb6 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Arc.java
@@ -68,7 +68,7 @@ public class Arc {
   /**
    * Corresponding berizer type arc
    */
-  private BezierArc bezierArc;
+  private final BezierArc bezierArc;
 
   /**
    * Makes new arc at specified side
@@ -76,7 +76,7 @@ public class Arc {
    * @param side
    *            which side doeas this arc form
    */
-  public Arc(int side) {
+  public Arc(final int side) {
     bezierArc = null;
     pwlArc = null;
     type = 0;
@@ -90,7 +90,7 @@ public class Arc {
    * @param side
    *            arc side
    */
-  private void setside(int side) {
+  private void setside(final int side) {
     // DONE
     clearside();
     type |= side << 8;
@@ -152,7 +152,7 @@ public class Arc {
    *            arc to be append
    * @return this
    */
-  public Arc append(Arc jarc) {
+  public Arc append(final Arc jarc) {
     // DONE
     if (jarc != null) {
       next = jarc.next;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
index c299b10..68263b9 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcSdirSorter.java
@@ -45,7 +45,7 @@ public class ArcSdirSorter {
    * Makes new ArcSdirSorter with Subdivider
    * @param subdivider subdivider
    */
-  public ArcSdirSorter(Subdivider subdivider) {
+  public ArcSdirSorter(final Subdivider subdivider) {
     //TODO
     //            System.out.println("TODO arcsdirsorter.constructor");
   }
@@ -55,7 +55,7 @@ public class ArcSdirSorter {
    * @param list  arc list to be sorted
    * @param count size of list
    */
-  public void qsort(CArrayOfArcs list, int count) {
+  public void qsort(final CArrayOfArcs list, final int count) {
     // TODO
     //            System.out.println("TODO arcsdirsorter.qsort");
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
index 1a584c3..dcd7d9f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTdirSorter.java
@@ -44,7 +44,7 @@ public class ArcTdirSorter {
    * Makes new ArcSdirSorter with Subdivider
    * @param subdivider subdivider
    */
-  public ArcTdirSorter(Subdivider subdivider) {
+  public ArcTdirSorter(final Subdivider subdivider) {
     // TODO Auto-generated constructor stub
     //            System.out.println("TODO arcTsorter.konstruktor");
   }
@@ -53,7 +53,7 @@ public class ArcTdirSorter {
    * @param list  arc list to be sorted
    * @param count size of list
    */
-  public void qsort(CArrayOfArcs list, int count) {
+  public void qsort(final CArrayOfArcs list, final int count) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO arcTsorter.qsort");
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java
index bd63114..119ccbc 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/ArcTesselator.java
@@ -49,9 +49,9 @@ public class ArcTesselator {
    * @param t1 minimum t param
    * @param t2 maximum s param
    */
-  public void bezier(Arc arc, float s1, float s2, float t1, float t2) {
+  public void bezier(final Arc arc, final float s1, final float s2, final float t1, final float t2) {
     // DONE
-    TrimVertex[] p = new TrimVertex[2];
+    final TrimVertex[] p = new TrimVertex[2];
     p[0] = new TrimVertex();
     p[1] = new TrimVertex();
     arc.pwlArc = new PwlArc(2, p);
@@ -70,7 +70,7 @@ public class ArcTesselator {
    * @param t1 third tail
    * @param f stepsize
    */
-  public void pwl_right(Arc newright, float s, float t1, float t2, float f) {
+  public void pwl_right(final Arc newright, final float s, final float t1, final float t2, final float f) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO arctesselator.pwl_right");
   }
@@ -83,7 +83,7 @@ public class ArcTesselator {
    * @param t1 third tail
    * @param f stepsize
    */
-  public void pwl_left(Arc newright, float s, float t2, float t1, float f) {
+  public void pwl_left(final Arc newright, final float s, final float t2, final float t1, final float f) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO arctesselator.pwl_left");
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
index 3e97424..bde1e2c 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Backend.java
@@ -101,8 +101,8 @@ public abstract class Backend {
    * @param ulo smallest u
    * @param uhi highest u
    */
-  public void curvpts(int type, CArrayOfFloats ps, int stride, int order,
-                      float ulo, float uhi) {
+  public void curvpts(final int type, final CArrayOfFloats ps, final int stride, final int order,
+                      final float ulo, final float uhi) {
     // DONE
     curveEvaluator.map1f(type, ulo, uhi, stride, order, ps);
     curveEvaluator.enable(type);
@@ -114,7 +114,7 @@ public abstract class Backend {
    * @param u2 highest u
    * @param nu number of pieces
    */
-  public void curvgrid(float u1, float u2, int nu) {
+  public void curvgrid(final float u1, final float u2, final int nu) {
     // DONE
     curveEvaluator.mapgrid1f(nu, u1, u2);
 
@@ -125,7 +125,7 @@ public abstract class Backend {
    * @param from low param
    * @param n step
    */
-  public void curvmesh(int from, int n) {
+  public void curvmesh(final int from, final int n) {
     // DONE
     curveEvaluator.mapmesh1f(N_MESHFILL, from, from + n);
   }
@@ -135,7 +135,7 @@ public abstract class Backend {
    * @param wiretris use triangles
    * @param wirequads use quads
    */
-  public void bgnsurf(int wiretris, int wirequads) {
+  public void bgnsurf(final int wiretris, final int wirequads) {
     // DONE
     surfaceEvaluator.bgnmap2f();
 
@@ -160,7 +160,7 @@ public abstract class Backend {
    * @param vlo low v param
    * @param vhi high v param
    */
-  public void patch(float ulo, float uhi, float vlo, float vhi) {
+  public void patch(final float ulo, final float uhi, final float vlo, final float vhi) {
     // DONE
     surfaceEvaluator.domain2f(ulo, uhi, vlo, vhi);
   }
@@ -174,7 +174,7 @@ public abstract class Backend {
    * @param v1 highest v
    * @param nv number of pieces in v direction
    */
-  public void surfgrid(float u0, float u1, int nu, float v0, float v1, int nv) {
+  public void surfgrid(final float u0, final float u1, final int nu, final float v0, final float v1, final int nv) {
     // DONE
     surfaceEvaluator.mapgrid2f(nu, u0, u1, nv, v0, v1);
 
@@ -187,7 +187,7 @@ public abstract class Backend {
    * @param n step in u direction
    * @param m step in v direction
    */
-  public void surfmesh(int u, int v, int n, int m) {
+  public void surfmesh(final int u, final int v, final int n, final int m) {
     //            System.out.println("TODO backend.surfmesh wireframequads");
     // TODO wireframequads
     surfaceEvaluator.mapmesh2f(NurbsConsts.N_MESHFILL, u, u + n, v, v + m);
@@ -206,8 +206,8 @@ public abstract class Backend {
    * @param vlo lowest v
    * @param vhi hightest v
    */
-  public void surfpts(int type, CArrayOfFloats pts, int ustride, int vstride,
-                      int uorder, int vorder, float ulo, float uhi, float vlo, float vhi) {
+  public void surfpts(final int type, final CArrayOfFloats pts, final int ustride, final int vstride,
+                      final int uorder, final int vorder, final float ulo, final float uhi, final float vlo, final float vhi) {
     // DONE
     surfaceEvaluator.map2f(type, ulo, uhi, ustride, uorder, vlo, vhi,
                            vstride, vorder, pts);
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
index 17437ef..638b018 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Bin.java
@@ -64,7 +64,7 @@ public class Bin {
    * Adds and arc to linked list
    * @param jarc added arc
    */
-  public void addarc(Arc jarc) {
+  public void addarc(final Arc jarc) {
     // DONE
     // if (head == null)
     // head = jarc;
@@ -93,7 +93,7 @@ public class Bin {
    */
   public Arc removearc() {
     // DONE
-    Arc jarc = head;
+    final Arc jarc = head;
     if (jarc != null)
       head = jarc.link;
     return jarc;
@@ -147,7 +147,7 @@ public class Bin {
    */
   private Arc nextarc() {
     // DONE
-    Arc jarc = current;
+    final Arc jarc = current;
     if (jarc != null)
       current = jarc.link;
     return jarc;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
index b67764c..6d2ab36 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfArcs.java
@@ -20,7 +20,7 @@ public class CArrayOfArcs {
   /**
    * Don't check for array borders?
    */
-  private boolean noCheck = true;
+  private final boolean noCheck = true;
 
   /**
    * Makes new CArray
@@ -30,7 +30,7 @@ public class CArrayOfArcs {
    * @param pointer
    *            pointer (index) to array
    */
-  public CArrayOfArcs(Arc[] array, int pointer) {
+  public CArrayOfArcs(final Arc[] array, final int pointer) {
     this.array = array;
     // this.pointer=pointer;
     setPointer(pointer);
@@ -42,7 +42,7 @@ public class CArrayOfArcs {
    * @param carray
    *            reference array
    */
-  public CArrayOfArcs(CArrayOfArcs carray) {
+  public CArrayOfArcs(final CArrayOfArcs carray) {
     this.array = carray.array;
     // this.pointer=carray.pointer;
     setPointer(carray.pointer);
@@ -54,7 +54,7 @@ public class CArrayOfArcs {
    * @param ctlarray
    *            underlaying array
    */
-  public CArrayOfArcs(Arc[] ctlarray) {
+  public CArrayOfArcs(final Arc[] ctlarray) {
     this.array = ctlarray;
     this.pointer = 0;
   }
@@ -82,7 +82,7 @@ public class CArrayOfArcs {
    * @param f
    *            desired value
    */
-  public void set(Arc f) {
+  public void set(final Arc f) {
     array[pointer] = f;
 
   }
@@ -94,7 +94,7 @@ public class CArrayOfArcs {
    *            array index
    * @return element at index
    */
-  public Arc get(int i) {
+  public Arc get(final int i) {
     return array[i];
   }
 
@@ -105,7 +105,7 @@ public class CArrayOfArcs {
    *            relative index
    * @return element at relative index
    */
-  public Arc getRelative(int i) {
+  public Arc getRelative(final int i) {
     return array[pointer + i];
   }
 
@@ -117,7 +117,7 @@ public class CArrayOfArcs {
    * @param value
    *            value to be set
    */
-  public void setRelative(int i, Arc value) {
+  public void setRelative(final int i, final Arc value) {
     array[pointer + i] = value;
   }
 
@@ -127,7 +127,7 @@ public class CArrayOfArcs {
    * @param i
    *            lessen by
    */
-  public void lessenPointerBy(int i) {
+  public void lessenPointerBy(final int i) {
     // pointer-=i;
     setPointer(pointer - i);
   }
@@ -147,7 +147,7 @@ public class CArrayOfArcs {
    * @param pointer
    *            pointer value to be set
    */
-  public void setPointer(int pointer) {
+  public void setPointer(final int pointer) {
     if (!noCheck && pointer > array.length)
       throw new IllegalArgumentException("Pointer " + pointer
                                          + " out of bounds " + array.length);
@@ -160,7 +160,7 @@ public class CArrayOfArcs {
    * @param i
    *            raise by
    */
-  public void raisePointerBy(int i) {
+  public void raisePointerBy(final int i) {
     // pointer+=i;
     setPointer(pointer + i);
   }
@@ -188,7 +188,7 @@ public class CArrayOfArcs {
    * @param array
    *            underlaying array
    */
-  public void setArray(Arc[] array) {
+  public void setArray(final Arc[] array) {
     this.array = array;
   }
 }
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
index b5f5889..1c80289 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfBreakpts.java
@@ -10,7 +10,7 @@ public class CArrayOfBreakpts {
   /**
    * Underlaying array
    */
-  private Breakpt[] pole;
+  private final Breakpt[] pole;
 
   /**
    * Pointer to array member
@@ -25,7 +25,7 @@ public class CArrayOfBreakpts {
    * @param pointer
    *            pointer (index) to array
    */
-  public CArrayOfBreakpts(Breakpt[] array, int pointer) {
+  public CArrayOfBreakpts(final Breakpt[] array, final int pointer) {
     this.pole = array;
     this.pointer = pointer;
   }
@@ -36,7 +36,7 @@ public class CArrayOfBreakpts {
    * @param carray
    *            reference array
    */
-  public CArrayOfBreakpts(CArrayOfBreakpts carray) {
+  public CArrayOfBreakpts(final CArrayOfBreakpts carray) {
     this.pole = carray.pole;
     this.pointer = carray.pointer;
   }
@@ -63,7 +63,7 @@ public class CArrayOfBreakpts {
    * @param f
    *            desired value
    */
-  public void set(Breakpt f) {
+  public void set(final Breakpt f) {
     pole[pointer] = f;
 
   }
@@ -75,7 +75,7 @@ public class CArrayOfBreakpts {
    *            array index
    * @return element at index
    */
-  public Breakpt get(int i) {
+  public Breakpt get(final int i) {
     return pole[i];
   }
 
@@ -85,7 +85,7 @@ public class CArrayOfBreakpts {
    * @param i
    *            lessen by
    */
-  public void lessenPointerBy(int i) {
+  public void lessenPointerBy(final int i) {
     pointer -= i;
 
   }
@@ -105,7 +105,7 @@ public class CArrayOfBreakpts {
    * @param pointer
    *            pointer value to be set
    */
-  public void setPointer(int pointer) {
+  public void setPointer(final int pointer) {
     this.pointer = pointer;
   }
 
@@ -115,7 +115,7 @@ public class CArrayOfBreakpts {
    * @param i
    *            raise by
    */
-  public void raisePointerBy(int i) {
+  public void raisePointerBy(final int i) {
     pointer += i;
 
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
index d9e4d0f..c9d6a59 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfFloats.java
@@ -21,7 +21,7 @@ public class CArrayOfFloats {
   /**
    * Don't check for array borders?
    */
-  private boolean noCheck = true;
+  private final boolean noCheck = true;
 
   /**
    * Makes new CArray
@@ -31,7 +31,7 @@ public class CArrayOfFloats {
    * @param pointer
    *            pointer (index) to array
    */
-  public CArrayOfFloats(float[] array, int pointer) {
+  public CArrayOfFloats(final float[] array, final int pointer) {
     this.array = array;
     // this.pointer=pointer;
     setPointer(pointer);
@@ -43,7 +43,7 @@ public class CArrayOfFloats {
    * @param carray
    *            reference array
    */
-  public CArrayOfFloats(CArrayOfFloats carray) {
+  public CArrayOfFloats(final CArrayOfFloats carray) {
     this.array = carray.array;
     // this.pointer=carray.pointer;
     setPointer(carray.pointer);
@@ -55,7 +55,7 @@ public class CArrayOfFloats {
    * @param ctlarray
    *            underlaying array
    */
-  public CArrayOfFloats(float[] ctlarray) {
+  public CArrayOfFloats(final float[] ctlarray) {
     this.array = ctlarray;
     this.pointer = 0;
   }
@@ -83,7 +83,7 @@ public class CArrayOfFloats {
    * @param f
    *            desired value
    */
-  public void set(float f) {
+  public void set(final float f) {
     array[pointer] = f;
 
   }
@@ -95,7 +95,7 @@ public class CArrayOfFloats {
    *            array index
    * @return element at index
    */
-  public float get(int i) {
+  public float get(final int i) {
     return array[i];
   }
 
@@ -106,7 +106,7 @@ public class CArrayOfFloats {
    *            relative index
    * @return element at relative index
    */
-  public float getRelative(int i) {
+  public float getRelative(final int i) {
     return array[pointer + i];
   }
 
@@ -118,7 +118,7 @@ public class CArrayOfFloats {
    * @param value
    *            value to be set
    */
-  public void setRelative(int i, float value) {
+  public void setRelative(final int i, final float value) {
     array[pointer + i] = value;
   }
 
@@ -128,7 +128,7 @@ public class CArrayOfFloats {
    * @param i
    *            lessen by
    */
-  public void lessenPointerBy(int i) {
+  public void lessenPointerBy(final int i) {
     // pointer-=i;
     setPointer(pointer - i);
   }
@@ -148,7 +148,7 @@ public class CArrayOfFloats {
    * @param pointer
    *            pointer value to be set
    */
-  public void setPointer(int pointer) {
+  public void setPointer(final int pointer) {
     if (!noCheck && pointer > array.length)
       throw new IllegalArgumentException("Pointer " + pointer
                                          + " out of bounds " + array.length);
@@ -161,7 +161,7 @@ public class CArrayOfFloats {
    * @param i
    *            raise by
    */
-  public void raisePointerBy(int i) {
+  public void raisePointerBy(final int i) {
     // pointer+=i;
     setPointer(pointer + i);
   }
@@ -189,7 +189,7 @@ public class CArrayOfFloats {
    * @param array
    *            underlaying array
    */
-  public void setArray(float[] array) {
+  public void setArray(final float[] array) {
     this.array = array;
   }
 }
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
index e7bbac1..0d76900 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/CArrayOfQuiltspecs.java
@@ -25,7 +25,7 @@ public class CArrayOfQuiltspecs {
    * @param pointer
    *            pointer (index) to array
    */
-  public CArrayOfQuiltspecs(Quiltspec[] array, int pointer) {
+  public CArrayOfQuiltspecs(final Quiltspec[] array, final int pointer) {
     this.array = array;
     this.pointer = pointer;
   }
@@ -36,7 +36,7 @@ public class CArrayOfQuiltspecs {
    * @param carray
    *            reference array
    */
-  public CArrayOfQuiltspecs(CArrayOfQuiltspecs carray) {
+  public CArrayOfQuiltspecs(final CArrayOfQuiltspecs carray) {
     this.array = carray.array;
     this.pointer = carray.pointer;
   }
@@ -47,7 +47,7 @@ public class CArrayOfQuiltspecs {
    * @param array
    *            underlaying array
    */
-  public CArrayOfQuiltspecs(Quiltspec[] array) {
+  public CArrayOfQuiltspecs(final Quiltspec[] array) {
     this.array = array;
     this.pointer = 0;
   }
@@ -74,7 +74,7 @@ public class CArrayOfQuiltspecs {
    * @param f
    *            desired value
    */
-  public void set(Quiltspec f) {
+  public void set(final Quiltspec f) {
     array[pointer] = f;
 
   }
@@ -86,7 +86,7 @@ public class CArrayOfQuiltspecs {
    *            array index
    * @return element at index
    */
-  public Quiltspec get(int i) {
+  public Quiltspec get(final int i) {
     return array[i];
   }
 
@@ -96,7 +96,7 @@ public class CArrayOfQuiltspecs {
    * @param i
    *            lessen by
    */
-  public void lessenPointerBy(int i) {
+  public void lessenPointerBy(final int i) {
     pointer -= i;
 
   }
@@ -116,7 +116,7 @@ public class CArrayOfQuiltspecs {
    * @param pointer
    *            pointer value to be set
    */
-  public void setPointer(int pointer) {
+  public void setPointer(final int pointer) {
     this.pointer = pointer;
   }
 
@@ -126,7 +126,7 @@ public class CArrayOfQuiltspecs {
    * @param i
    *            raise by
    */
-  public void raisePointerBy(int i) {
+  public void raisePointerBy(final int i) {
     pointer += i;
 
   }
@@ -154,7 +154,7 @@ public class CArrayOfQuiltspecs {
    * @param array
    *            underlaying array
    */
-  public void setArray(Quiltspec[] array) {
+  public void setArray(final Quiltspec[] array) {
     this.array = array;
   }
 }
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
index ea3a3d1..ce0387b 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curve.java
@@ -59,32 +59,32 @@ public class Curve {
   /**
    * OpenGL maps
    */
-  private Mapdesc mapdesc;
+  private final Mapdesc mapdesc;
 
   /**
    * Does the curve need sampling
    */
-  private boolean needsSampling;
+  private final boolean needsSampling;
 
   /**
    * Culling
    */
-  private int cullval;
+  private final int cullval;
 
   /**
    * Number of coords
    */
-  private int stride;
+  private final int stride;
 
   /**
    * Curve order
    */
-  private int order;
+  private final int order;
 
   /**
    * Holds conversion range borders
    */
-  private float[] range;
+  private final float[] range;
 
   /**
    * Subdivision stepsize
@@ -110,7 +110,7 @@ public class Curve {
    * @param c
    *            next curve in linked list
    */
-  public Curve(Quilt geo, float[] pta, float[] ptb, Curve c) {
+  public Curve(final Quilt geo, final float[] pta, final float[] ptb, final Curve c) {
 
     spts = new float[MAXORDER * MAXCOORDS];
 
@@ -125,8 +125,8 @@ public class Curve {
     stride = MAXCOORDS;
 
     // CArrayOfFloats ps = geo.cpts;
-    CArrayOfFloats ps = new CArrayOfFloats(geo.cpts.getArray(), 0);
-    CArrayOfQuiltspecs qs = geo.qspec;
+    final CArrayOfFloats ps = new CArrayOfFloats(geo.cpts.getArray(), 0);
+    final CArrayOfQuiltspecs qs = geo.qspec;
     ps.raisePointerBy(qs.get().offset);
     ps.raisePointerBy(qs.get().index * qs.get().order * qs.get().stride);
 
@@ -182,27 +182,31 @@ public class Curve {
     } else {
       assert (order <= MAXORDER);
 
-      float tmp[][] = new float[MAXORDER][MAXCOORDS];
+      setstepsize(mapdesc.maxrate);
+
+      /***
+          final float tmp[][] = new float[MAXORDER][MAXCOORDS];
 
-      int tstride = (MAXORDER);
+          final int tstride = (MAXORDER);
 
-      int val = 0;
-      // mapdesc.project(spts,stride,tmp,tstride,order);
+          final int val = 0;
+          // mapdesc.project(spts,stride,tmp,tstride,order);
 
-      //                System.out.println("TODO curve.getsptepsize mapdesc.project");
+          //                System.out.println("TODO curve.getsptepsize mapdesc.project");
 
-      if (val == 0) {
-        setstepsize(mapdesc.maxrate);
-      } else {
-        float t = mapdesc.getProperty(NurbsConsts.N_PIXEL_TOLERANCE);
-        if (mapdesc.isParametricDistanceSampling()) {
-          //                        System.out.println("TODO curve.getstepsize - parametric");
-        } else if (mapdesc.isPathLengthSampling()) {
-          //                        System.out.println("TODO curve.getstepsize - pathlength");
-        } else {
-          setstepsize(mapdesc.maxrate);
-        }
-      }
+          if (val == 0) {
+            setstepsize(mapdesc.maxrate);
+          } else {
+            final float t = mapdesc.getProperty(NurbsConsts.N_PIXEL_TOLERANCE);
+            if (mapdesc.isParametricDistanceSampling()) {
+              //                        System.out.println("TODO curve.getstepsize - parametric");
+            } else if (mapdesc.isPathLengthSampling()) {
+              //                        System.out.println("TODO curve.getstepsize - pathlength");
+            } else {
+              setstepsize(mapdesc.maxrate);
+            }
+          }
+      */
 
     }
 
@@ -212,7 +216,7 @@ public class Curve {
    * Sets maximum subdivision step size
    * @param max maximum subdivision step size
    */
-  private void setstepsize(float max) {
+  private void setstepsize(final float max) {
     // DONE
     stepsize = (max >= 1) ? (range[2] / max) : range[2];
     minstepsize = stepsize;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curvelist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curvelist.java
index 80baf20..96081a8 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Curvelist.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Curvelist.java
@@ -67,7 +67,7 @@ public class Curvelist {
    * @param pta range start
    * @param ptb range end
    */
-  public Curvelist(Quilt qlist, float[] pta, float[] ptb) {
+  public Curvelist(final Quilt qlist, final float[] pta, final float[] ptb) {
     // DONE
     curve = null;
     range = new float[3];
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java
index d9d0126..e1b4cb2 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/DisplayList.java
@@ -49,7 +49,7 @@ public class DisplayList {
    * @param m invoked method
    * @param arg method argument
    */
-  public void append(Object src, Method m, Object arg) {
+  public void append(final Object src, final Method m, final Object arg) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO displaylist append");
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
index f9c4c2d..30f52d5 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Flist.java
@@ -68,7 +68,7 @@ public class Flist {
    * Grows list
    * @param maxpts maximum desired size
    */
-  public void grow(int maxpts) {
+  public void grow(final int maxpts) {
     // DONE
     if (npts < maxpts) {
       // npts=2*maxpts;
@@ -106,7 +106,7 @@ public class Flist {
    * @param from start from
    * @param to end at
    */
-  public void taper(float from, float to) {
+  public void taper(final float from, final float to) {
     // DONE
 
     while (pts[start] != from) {
@@ -123,7 +123,7 @@ public class Flist {
    * Adds breakpoint value
    * @param f value
    */
-  public void add(float f) {
+  public void add(final float f) {
     //DONE
     pts[end++] = f;
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
index 1dcf393..b7fa722 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotspec.java
@@ -175,7 +175,7 @@ public class Knotspec {
         break;
     }
 
-    CArrayOfFloats k = new CArrayOfFloats(kfirst);
+    final CArrayOfFloats k = new CArrayOfFloats(kfirst);
     k.mm();
 
     for (; k.getPointer() >= inkbegin.getPointer(); k.mm())
@@ -183,7 +183,7 @@ public class Knotspec {
         break;
     k.pp();
 
-    Breakpt[] bbeginArray = new Breakpt[(klast.getPointer() - kfirst
+    final Breakpt[] bbeginArray = new Breakpt[(klast.getPointer() - kfirst
                                          .getPointer()) + 1];
     for (int i = 0; i < bbeginArray.length; i++)
       bbeginArray[i] = new Breakpt();
@@ -218,7 +218,7 @@ public class Knotspec {
    */
   private void factors() {
     // DONE
-    CArrayOfFloats mid = new CArrayOfFloats(outkend.getArray(), (outkend
+    final CArrayOfFloats mid = new CArrayOfFloats(outkend.getArray(), (outkend
                                                                  .getPointer() - 1)
                                             - order + bend.get().multi);
 
@@ -226,18 +226,18 @@ public class Knotspec {
     if (sbegin != null)
       fptr = new CArrayOfFloats(sbegin);
 
-    for (CArrayOfBreakpts bpt = new CArrayOfBreakpts(bend); bpt
+    for (final CArrayOfBreakpts bpt = new CArrayOfBreakpts(bend); bpt
            .getPointer() >= bbegin.getPointer(); bpt.mm()) {
       mid.lessenPointerBy(bpt.get().multi);
-      int def = bpt.get().def - 1;
+      final int def = bpt.get().def - 1;
       if (def < 0)
         continue;
-      float kv = bpt.get().value;
+      final float kv = bpt.get().value;
 
-      CArrayOfFloats kf = new CArrayOfFloats(mid.getArray(), (mid
+      final CArrayOfFloats kf = new CArrayOfFloats(mid.getArray(), (mid
                                                               .getPointer() - def)
                                              + (order - 1));
-      for (CArrayOfFloats kl = new CArrayOfFloats(kf.getArray(), kf
+      for (final CArrayOfFloats kl = new CArrayOfFloats(kf.getArray(), kf
                                                   .getPointer()
                                                   + def); kl.getPointer() != kf.getPointer(); kl.mm()) {
         CArrayOfFloats kh, kt;
@@ -257,10 +257,10 @@ public class Knotspec {
    */
   private void knots() {
     // DONE
-    CArrayOfFloats inkpt = new CArrayOfFloats(kleft.getArray(), kleft
+    final CArrayOfFloats inkpt = new CArrayOfFloats(kleft.getArray(), kleft
                                               .getPointer()
                                               - order);
-    CArrayOfFloats inkend = new CArrayOfFloats(kright.getArray(), kright
+    final CArrayOfFloats inkend = new CArrayOfFloats(kright.getArray(), kright
                                                .getPointer()
                                                + bend.get().def);
 
@@ -279,8 +279,8 @@ public class Knotspec {
    */
   private void breakpoints() {
     // DONE
-    CArrayOfBreakpts ubpt = new CArrayOfBreakpts(bbegin);
-    CArrayOfBreakpts ubend = new CArrayOfBreakpts(bend);
+    final CArrayOfBreakpts ubpt = new CArrayOfBreakpts(bbegin);
+    final CArrayOfBreakpts ubend = new CArrayOfBreakpts(bend);
     int nfactors = 0;
 
     ubpt.get().value = ubend.get().value;
@@ -320,13 +320,13 @@ public class Knotspec {
    * @param _outpt
    *            output control points
    */
-  public void copy(CArrayOfFloats _inpt, CArrayOfFloats _outpt) {
-    CArrayOfFloats inpt = new CArrayOfFloats(_inpt);
-    CArrayOfFloats outpt = new CArrayOfFloats(_outpt);
+  public void copy(final CArrayOfFloats _inpt, final CArrayOfFloats _outpt) {
+    final CArrayOfFloats inpt = new CArrayOfFloats(_inpt);
+    final CArrayOfFloats outpt = new CArrayOfFloats(_outpt);
 
     inpt.raisePointerBy(preoffset);
     if (next != null) {
-      for (CArrayOfFloats lpt = new CArrayOfFloats(outpt.getArray(),
+      for (final CArrayOfFloats lpt = new CArrayOfFloats(outpt.getArray(),
                                                    outpt.getPointer() + prewidth); outpt.getPointer() != lpt
              .getPointer(); outpt.raisePointerBy(poststride)) {
         next.copy(inpt, outpt);
@@ -334,7 +334,7 @@ public class Knotspec {
       }
 
     } else {
-      for (CArrayOfFloats lpt = new CArrayOfFloats(outpt.getArray(),
+      for (final CArrayOfFloats lpt = new CArrayOfFloats(outpt.getArray(),
                                                    outpt.getPointer() + prewidth); outpt.getPointer() != lpt
              .getPointer(); outpt.raisePointerBy(poststride)) {
         pt_io_copy(outpt, inpt);
@@ -352,7 +352,7 @@ public class Knotspec {
    * @param frompt
    *            destination control point
    */
-  private void pt_io_copy(CArrayOfFloats topt, CArrayOfFloats frompt) {
+  private void pt_io_copy(final CArrayOfFloats topt, final CArrayOfFloats frompt) {
     // DONE
     switch (ncoords) {
     case 4:
@@ -378,8 +378,8 @@ public class Knotspec {
    * @param _p
    *            inserted knot
    */
-  public void transform(CArrayOfFloats _p) {
-    CArrayOfFloats p = new CArrayOfFloats(_p);
+  public void transform(final CArrayOfFloats _p) {
+    final CArrayOfFloats p = new CArrayOfFloats(_p);
     // DONE
     if (next != null) {//surface code
       if (this.equals(kspectotrans)) {
@@ -387,13 +387,13 @@ public class Knotspec {
       } else {
         if (istransformed) {
           p.raisePointerBy(postoffset);
-          for (CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
+          for (final CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
                             p.getPointer() + postwidth); p.getPointer() != pend
                  .getPointer(); p.raisePointerBy(poststride))
             next.transform(p);
 
         } else {
-          CArrayOfFloats pend = new CArrayOfFloats(p.getArray(), p
+          final CArrayOfFloats pend = new CArrayOfFloats(p.getArray(), p
                                                    .getPointer()
                                                    + prewidth);
           for (; p.getPointer() != pend.getPointer(); p
@@ -408,13 +408,13 @@ public class Knotspec {
       } else {
         if (istransformed) {
           p.raisePointerBy(postoffset);
-          for (CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
+          for (final CArrayOfFloats pend = new CArrayOfFloats(p.getArray(),
                             p.getPointer() + postwidth); p.getPointer() != pend
                  .getPointer(); p.raisePointerBy(poststride)) {
             kspectotrans.insert(p);
           }
         } else {
-          CArrayOfFloats pend = new CArrayOfFloats(p.getArray(), p
+          final CArrayOfFloats pend = new CArrayOfFloats(p.getArray(), p
                                                    .getPointer()
                                                    + prewidth);
           for (; p.getPointer() != pend.getPointer(); p
@@ -432,27 +432,27 @@ public class Knotspec {
    * @param p
    *            inserted knot
    */
-  private void insert(CArrayOfFloats p) {
+  private void insert(final CArrayOfFloats p) {
     // DONE
     CArrayOfFloats fptr = null;
     if (sbegin != null)
       fptr = new CArrayOfFloats(sbegin);
-    CArrayOfFloats srcpt = new CArrayOfFloats(p.getArray(), p.getPointer()
+    final CArrayOfFloats srcpt = new CArrayOfFloats(p.getArray(), p.getPointer()
                                               + prewidth - poststride);
     // CArrayOfFloats srcpt = new CArrayOfFloats(p.getArray(), prewidth -
     // poststride);
-    CArrayOfFloats dstpt = new CArrayOfFloats(p.getArray(), p.getPointer()
+    final CArrayOfFloats dstpt = new CArrayOfFloats(p.getArray(), p.getPointer()
                                               + postwidth + postoffset - poststride);
     // CArrayOfFloats dstpt = new CArrayOfFloats(p.getArray(), postwidth +
     // postoffset - poststride);
-    CArrayOfBreakpts bpt = new CArrayOfBreakpts(bend);
+    final CArrayOfBreakpts bpt = new CArrayOfBreakpts(bend);
 
-    for (CArrayOfFloats pend = new CArrayOfFloats(srcpt.getArray(), srcpt
+    for (final CArrayOfFloats pend = new CArrayOfFloats(srcpt.getArray(), srcpt
                                                   .getPointer()
                                                   - poststride * bpt.get().def); srcpt.getPointer() != pend
            .getPointer(); pend.raisePointerBy(poststride)) {
-      CArrayOfFloats p1 = new CArrayOfFloats(srcpt);
-      for (CArrayOfFloats p2 = new CArrayOfFloats(srcpt.getArray(), srcpt
+      final CArrayOfFloats p1 = new CArrayOfFloats(srcpt);
+      for (final CArrayOfFloats p2 = new CArrayOfFloats(srcpt.getArray(), srcpt
                                                   .getPointer()
                                                   - poststride); p2.getPointer() != pend.getPointer(); p1
              .setPointer(p2.getPointer()), p2
@@ -469,15 +469,15 @@ public class Knotspec {
         dstpt.lessenPointerBy(poststride);
         srcpt.lessenPointerBy(poststride);
       }
-      for (CArrayOfFloats pend = new CArrayOfFloats(srcpt.getArray(),
+      for (final CArrayOfFloats pend = new CArrayOfFloats(srcpt.getArray(),
                                                     srcpt.getPointer() - poststride * bpt.get().def); srcpt
              .getPointer() != pend.getPointer(); pend
              .raisePointerBy(poststride), dstpt
              .lessenPointerBy(poststride)) {
         pt_oo_copy(dstpt, srcpt);
-        CArrayOfFloats p1 = new CArrayOfFloats(srcpt);
+        final CArrayOfFloats p1 = new CArrayOfFloats(srcpt);
 
-        for (CArrayOfFloats p2 = new CArrayOfFloats(srcpt.getArray(),
+        for (final CArrayOfFloats p2 = new CArrayOfFloats(srcpt.getArray(),
                                                     srcpt.getPointer() - poststride); p2.getPointer() != pend
                .getPointer(); p1.setPointer(p2.getPointer()), p2
                .lessenPointerBy(poststride)) {
@@ -496,7 +496,7 @@ public class Knotspec {
    * @param frompt
    *            distance ctrl point
    */
-  private void pt_oo_copy(CArrayOfFloats topt, CArrayOfFloats frompt) {
+  private void pt_oo_copy(final CArrayOfFloats topt, final CArrayOfFloats frompt) {
     // DONE
     // this is a "trick" with case - "break" is omitted so it comes through all cases
     switch (ncoords) {
@@ -531,8 +531,8 @@ public class Knotspec {
    * @param b
    *            1 - alpha
    */
-  private void pt_oo_sum(CArrayOfFloats x, CArrayOfFloats y,
-                         CArrayOfFloats z, float a, double b) {
+  private void pt_oo_sum(final CArrayOfFloats x, final CArrayOfFloats y,
+                         final CArrayOfFloats z, final float a, final double b) {
     // DONE
     switch (ncoords) {
     case 4:
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
index 571f44f..76b5923 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Knotvector.java
@@ -85,7 +85,7 @@ public class Knotvector {
    * @param knot
    *            knots
    */
-  public Knotvector(int nknots, int stride, int order, float[] knot) {
+  public Knotvector(final int nknots, final int stride, final int order, final float[] knot) {
     // DONE
     init(nknots, stride, order, knot);
   }
@@ -102,7 +102,7 @@ public class Knotvector {
    * @param knot
    *            knots
    */
-  public void init(int nknots, int stride, int order, float[] knot) {
+  public void init(final int nknots, final int stride, final int order, final float[] knot) {
     // DONE
     this.knotcount = nknots;
     this.stride = stride;
@@ -158,7 +158,7 @@ public class Knotvector {
    * @param msg
    *            message to be shown
    */
-  public void show(String msg) {
+  public void show(final String msg) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO knotvector.show");
 
@@ -173,7 +173,7 @@ public class Knotvector {
    *            second knot
    * @return knots are/are not equal
    */
-  public static boolean identical(float a, float b) {
+  public static boolean identical(final float a, final float b) {
     return ((a - b) < TOLERANCE) ? true : false;
   }
 }
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
index 86638a8..b6e83d9 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Mapdesc.java
@@ -64,22 +64,22 @@ public class Mapdesc {
   /**
    * Map type
    */
-  private int type;
+  private final int type;
 
   /**
    * Number of homogenous coords
    */
-  private int hcoords;
+  private final int hcoords;
 
   /**
    * Number of inhomogenous coords
    */
-  private int inhcoords;
+  private final int inhcoords;
 
   /**
    * Not used
    */
-  private int mask;
+  private final int mask;
 
   /**
    * Value of N_PIXEL_TOLERANCE property
@@ -144,31 +144,30 @@ public class Mapdesc {
   /**
    * Not used
    */
-  private float[][] bmat;
+  private final float[][] bmat;
 
   /**
    * Sampling matrix
    */
-  private float[][] smat;
+  private final float[][] smat;
 
   /**
    * Not used
    */
-  private float[][] cmat;
+  private final float[][] cmat;
 
   /**
    * Not used
    */
-  private float[] bboxsize;
+  private final float[] bboxsize;
 
   /**
    * Makes new mapdesc
    * @param type map type
    * @param rational is rational
    * @param ncoords number of control points coords
-   * @param backend backend object
    */
-  public Mapdesc(int type, int rational, int ncoords, Backend backend) {
+  public Mapdesc(final int type, final int rational, final int ncoords) {
     // DONE
     this.type = type;
     this.isrational = rational;
@@ -210,7 +209,7 @@ public class Mapdesc {
    * Make matrix identity matrix
    * @param arr matrix
    */
-  private void identify(float[][] arr) {
+  private void identify(final float[][] arr) {
     // DONE
     for (int i = 0; i < MAXCOORDS; i++)
       for (int j = 0; j < MAXCOORDS; j++)
@@ -225,7 +224,7 @@ public class Mapdesc {
    * @param tag property tag
    * @return is/is not property
    */
-  public boolean isProperty(int tag) {
+  public boolean isProperty(final int tag) {
     boolean ret;
     switch (tag) {
     case NurbsConsts.N_PIXEL_TOLERANCE:
@@ -347,7 +346,7 @@ public class Mapdesc {
    * @param tag property tag
    * @return property value
    */
-  public float getProperty(int tag) {
+  public float getProperty(final int tag) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO mapdesc.getproperty");
     return 0;
@@ -358,7 +357,7 @@ public class Mapdesc {
    * @param tag property tag
    * @param value desired value
    */
-  public void setProperty(int tag, float value) {
+  public void setProperty(final int tag, float value) {
     // TODO Auto-generated method stub
     switch (tag) {
     case NurbsConsts.N_PIXEL_TOLERANCE:
@@ -412,8 +411,8 @@ public class Mapdesc {
    * @param sp breakpoints
    * @param outstride output number of control points' coordinates
    */
-  public void xformSampling(CArrayOfFloats pts, int order, int stride,
-                            float[] sp, int outstride) {
+  public void xformSampling(final CArrayOfFloats pts, final int order, final int stride,
+                            final float[] sp, final int outstride) {
     // DONE
     xFormMat(smat, pts, order, stride, sp, outstride);
   }
@@ -427,8 +426,8 @@ public class Mapdesc {
    * @param cp breakpoints
    * @param outstride output number of control points' coordinates
    */
-  private void xFormMat(float[][] mat, CArrayOfFloats pts, int order,
-            int stride, float[] cp, int outstride) {
+  private void xFormMat(final float[][] mat, final CArrayOfFloats pts, final int order,
+            final int stride, final float[] cp, final int outstride) {
     // TODO Auto-generated method stub
 
     //        System.out.println("TODO mapdsc.xformmat ; change cp from float[] to carrayoffloats");
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Maplist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Maplist.java
index af80241..2cb92ae 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Maplist.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Maplist.java
@@ -47,15 +47,14 @@ public class Maplist {
 
   /**
    * Backend class
+   * private final Backend backend;
    */
-  private Backend backend;
 
   /**
    * Makes new Maplist
-   * @param backend Backend class
    */
-  public Maplist(Backend backend) {
-    this.backend = backend;
+  public Maplist(/* final Backend backend */) {
+    // this.backend = backend;
   }
 
   /**
@@ -72,9 +71,9 @@ public class Maplist {
    * @param rational is map rational
    * @param ncoords number of coords
    */
-  public void define(int type, int rational, int ncoords) {
+  public void define(final int type, final int rational, final int ncoords) {
     // DONE
-    Mapdesc m = locate(type);
+    final Mapdesc m = locate(type);
     assert (m == null || (m.isrational == rational && m.ncoords == ncoords));
     add(type, rational, ncoords);
 
@@ -86,9 +85,9 @@ public class Maplist {
    * @param rational is map rational
    * @param ncoords number of coords
    */
-  private void add(int type, int rational, int ncoords) {
+  private void add(final int type, final int rational, final int ncoords) {
     // DONE
-    Mapdesc map = new Mapdesc(type, rational, ncoords, backend);
+    final Mapdesc map = new Mapdesc(type, rational, ncoords);
     if (maps == null) {
       maps = map;
     } else {
@@ -102,7 +101,7 @@ public class Maplist {
    * @param type map type
    * @return Mapdesc of type or null if there is no such map
    */
-  public Mapdesc locate(int type) {
+  public Mapdesc locate(final int type) {
     // DONE
     Mapdesc m = null;
     for (m = maps; m != null; m = m.next)
@@ -116,7 +115,7 @@ public class Maplist {
    * @param type maptype
    * @return Mapdesc of type or null if there is no such map
    */
-  public Mapdesc find(int type) {
+  public Mapdesc find(final int type) {
     return locate(type);
   }
 }
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
index a686da6..a957c21 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbscurve.java
@@ -70,7 +70,7 @@ public class O_nurbscurve {
    * Makes new O_nurbscurve
    * @param realType type of curve
    */
-  public O_nurbscurve(int realType) {
+  public O_nurbscurve(final int realType) {
     // DONE
     this.type = realType;
     this.owner = null;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbssurface.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbssurface.java
index 867f436..4df3c14 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbssurface.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/O_nurbssurface.java
@@ -64,13 +64,13 @@ public class O_nurbssurface {
   /**
    * Surface type
    */
-  private int type;
+  private final int type;
 
   /**
    * Makes new O_nurbssurface of type
    * @param type surface type
    */
-  public O_nurbssurface(int type) {
+  public O_nurbssurface(final int type) {
     this.type = type;
     this.owner = null;
     this.next = null;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java
index a44f245..0fd4baa 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patch.java
@@ -48,7 +48,7 @@ public class Patch {
    * @param ptb
    * @param patch
    */
-  public Patch(Quilt q, float[] pta, float[] ptb, Patch patch) {
+  public Patch(final Quilt q, final float[] pta, final float[] ptb, final Patch patch) {
     //            System.out.println("TODO patch.constructor");
   }
 }
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
index 8c29225..68b01d8 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Patchlist.java
@@ -57,12 +57,13 @@ public class Patchlist {
    * @param pta low border
    * @param ptb high border
    */
-  public Patchlist(Quilt quilts, float[] pta, float[] ptb) {
+  public Patchlist(final Quilt quilts, final float[] pta, final float[] ptb) {
     // DONE
     patch = null;
 
     for (Quilt q = quilts; q != null; q = q.next)
       patch = new Patch(q, pta, ptb, patch);
+    pspec = new Pspec[2];
     pspec[0] = new Pspec();
     pspec[0].range[0] = pta[0];
     pspec[0].range[1] = ptb[0];
@@ -80,7 +81,7 @@ public class Patchlist {
    * @param param
    * @param mid
    */
-  public Patchlist(Patchlist patchlist, int param, float mid) {
+  public Patchlist(final Patchlist patchlist, final int param, final float mid) {
     // TODO Auto-generated constructor stub
     //            System.out.println("TODO patchlist.konstruktor 2");
   }
@@ -119,7 +120,7 @@ public class Patchlist {
    * @param i
    * @return false
    */
-  public boolean needsSubdivision(int i) {
+  public boolean needsSubdivision(final int i) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO patchlist.needsSubdivision");
     return false;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
index 79f36ce..155549b 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Property.java
@@ -67,7 +67,7 @@ public class Property {
    * @param value
    *            property value
    */
-  public Property(int type, int tag, float value) {
+  public Property(final int type, final int tag, final float value) {
     this.type = type;
     this.tag = tag;
     this.value = value;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/PwlArc.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/PwlArc.java
index bcbd20a..8e04baf 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/PwlArc.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/PwlArc.java
@@ -44,7 +44,7 @@ public class PwlArc {
   /**
    * Number of points
    */
-  private int npts;
+  private final int npts;
 
   /**
    * Vertexes
@@ -54,14 +54,14 @@ public class PwlArc {
   /**
    * Arc type
    */
-  private int type;
+  private final int type;
 
   /**
    * Makes new trimming arc
    * @param i num ber of vertexes
    * @param p trimming vertexes array
    */
-  public PwlArc(int i, TrimVertex[] p) {
+  public PwlArc(final int i, final TrimVertex[] p) {
     // DONE
     this.npts = i;
     this.pts = p;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java
index 6bea492..2e2532a 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Quilt.java
@@ -74,10 +74,10 @@ public class Quilt {
    * Makes new quilt with mapdesc
    * @param mapdesc map description
    */
-  public Quilt(Mapdesc mapdesc) {
+  public Quilt(final Mapdesc mapdesc) {
     // DONE
     this.mapdesc = mapdesc;
-    Quiltspec[] tmpquilts = new Quiltspec[MAXDIM];
+    final Quiltspec[] tmpquilts = new Quiltspec[MAXDIM];
     for (int i = 0; i < tmpquilts.length; i++)
       tmpquilts[i] = new Quiltspec();
     this.qspec = new CArrayOfQuiltspecs(tmpquilts);
@@ -91,9 +91,9 @@ public class Quilt {
    * @param ctrlarr control points
    * @param coords control points coords
    */
-  public void toBezier(Knotvector sknotvector, Knotvector tknotvector,
-                       CArrayOfFloats ctrlarr, int coords) {
-    Splinespec spline = new Splinespec(2);
+  public void toBezier(final Knotvector sknotvector, final Knotvector tknotvector,
+                       final CArrayOfFloats ctrlarr, final int coords) {
+    final Splinespec spline = new Splinespec(2);
     spline.kspecinit(sknotvector, tknotvector);
     spline.select();
     spline.layout(coords);
@@ -108,9 +108,9 @@ public class Quilt {
    * @param ctlarray control points
    * @param ncoords number of coordinates
    */
-  public void toBezier(Knotvector knots, CArrayOfFloats ctlarray, int ncoords) {
+  public void toBezier(final Knotvector knots, final CArrayOfFloats ctlarray, final int ncoords) {
     // DONE
-    Splinespec spline = new Splinespec(1);
+    final Splinespec spline = new Splinespec(1);
     spline.kspecinit(knots);
     spline.select();
     spline.layout(ncoords);
@@ -125,7 +125,7 @@ public class Quilt {
    * @param ptb high border
    * @param backend Backend
    */
-  public void downloadAll(float[] pta, float[] ptb, Backend backend) {
+  public void downloadAll(final float[] pta, final float[] ptb, final Backend backend) {
     // DONE
     for (Quilt m = this; m != null; m = m.next) {
       m.select(pta, ptb);
@@ -138,11 +138,11 @@ public class Quilt {
    * Renders arcs/patches
    * @param backend Backend for rendering
    */
-  private void download(Backend backend) {
+  private void download(final Backend backend) {
     // DONE
     if (getDimension() == 2) {
 
-      CArrayOfFloats ps = new CArrayOfFloats(cpts);
+      final CArrayOfFloats ps = new CArrayOfFloats(cpts);
       ps.raisePointerBy(qspec.get(0).offset);
       ps.raisePointerBy(qspec.get(1).offset);
       ps.raisePointerBy(qspec.get(0).index * qspec.get(0).order
@@ -159,7 +159,7 @@ public class Quilt {
 
     } else {// code for curves
       // CArrayOfFloats ps=new CArrayOfFloats(cpts);
-      CArrayOfFloats ps = new CArrayOfFloats(cpts.getArray(), 0);
+      final CArrayOfFloats ps = new CArrayOfFloats(cpts.getArray(), 0);
       ps.raisePointerBy(qspec.get(0).offset);
       ps.raisePointerBy(qspec.get(0).index * qspec.get(0).order
                         * qspec.get(0).stride);
@@ -185,9 +185,9 @@ public class Quilt {
    * @param pta range
    * @param ptb range
    */
-  private void select(float[] pta, float[] ptb) {
+  private void select(final float[] pta, final float[] ptb) {
     // DONE
-    int dim = eqspec.getPointer() - qspec.getPointer();
+    final int dim = eqspec.getPointer() - qspec.getPointer();
     int i, j;
     for (i = 0; i < dim; i++) {
       for (j = qspec.get(i).width - 1; j >= 0; j--)
@@ -205,7 +205,7 @@ public class Quilt {
    * @param to high param
    * @param bpts breakpoints
    */
-  public void getRange(float[] from, float[] to, Flist bpts) {
+  public void getRange(final float[] from, final float[] to, final Flist bpts) {
     // DONE
     getRange(from, to, 0, bpts);
 
@@ -218,9 +218,9 @@ public class Quilt {
    * @param i from/to array index
    * @param list breakpoints
    */
-  private void getRange(float[] from, float[] to, int i, Flist list) {
+  private void getRange(final float[] from, final float[] to, final int i, final Flist list) {
     // DONE
-    Quilt maps = this;
+    final Quilt maps = this;
     from[i] = maps.qspec.get(i).breakpoints[0];
     to[i] = maps.qspec.get(i).breakpoints[maps.qspec.get(i).width];
     int maxpts = 0;
@@ -262,7 +262,7 @@ public class Quilt {
    * @param slist u direction breakpoints
    * @param tlist v direction breakpoints
    */
-  public void getRange(float[] from, float[] to, Flist slist, Flist tlist) {
+  public void getRange(final float[] from, final float[] to, final Flist slist, final Flist tlist) {
     // DONE
     getRange(from, to, 0, slist);
     getRange(from, to, 1, tlist);
@@ -275,7 +275,7 @@ public class Quilt {
    * @param tbrkpts
    * @param rate
    */
-  public void findRates(Flist sbrkpts, Flist tbrkpts, float[] rate) {
+  public void findRates(final Flist sbrkpts, final Flist tbrkpts, final float[] rate) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO quilt.findrates");
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
index 7c63612..5c180f3 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Renderhints.java
@@ -85,7 +85,7 @@ public class Renderhints {
    * Set property value
    * @param prop property
    */
-  public void setProperty(Property prop) {
+  public void setProperty(final Property prop) {
     switch (prop.type) {
     case NurbsConsts.N_DISPLAY:
       display_method = (int) prop.value;
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Splinespec.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Splinespec.java
index f1c779c..5e44c32 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Splinespec.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Splinespec.java
@@ -44,7 +44,7 @@ public class Splinespec {
   /**
    * Dimension
    */
-  private int dim;
+  private final int dim;
 
   /**
    * Knot vector specs
@@ -60,7 +60,7 @@ public class Splinespec {
    * Makes new Splinespec with given dimension
    * @param i dimension
    */
-  public Splinespec(int i) {
+  public Splinespec(final int i) {
     // DONE
     this.dim = i;
   }
@@ -69,7 +69,7 @@ public class Splinespec {
    * Initializes knotspec according to knotvector
    * @param knotvector basic knotvector
    */
-  public void kspecinit(Knotvector knotvector) {
+  public void kspecinit(final Knotvector knotvector) {
     // DONE
     this.kspec = new Knotspec();
     kspec.inkbegin = new CArrayOfFloats(knotvector.knotlist, 0);
@@ -85,10 +85,10 @@ public class Splinespec {
    * @param sknotvector knotvector in u dir
    * @param tknotvector knotvector in v dir
    */
-  public void kspecinit(Knotvector sknotvector, Knotvector tknotvector) {
+  public void kspecinit(final Knotvector sknotvector, final Knotvector tknotvector) {
     // DONE
     this.kspec = new Knotspec();
-    Knotspec tkspec = new Knotspec();
+    final Knotspec tkspec = new Knotspec();
 
     kspec.inkbegin = new CArrayOfFloats(sknotvector.knotlist, 0);
     kspec.inkend = new CArrayOfFloats(sknotvector.knotlist,
@@ -121,7 +121,7 @@ public class Splinespec {
    * Prepares for conversion
    * @param ncoords number of coords
    */
-  public void layout(int ncoords) {
+  public void layout(final int ncoords) {
     // DONE
     int stride = ncoords;
     for (Knotspec knotspec = kspec; knotspec != null; knotspec = knotspec.next) {
@@ -143,9 +143,9 @@ public class Splinespec {
    * Prepares quilt for conversion
    * @param quilt quilt to work with
    */
-  public void setupquilt(Quilt quilt) {
+  public void setupquilt(final Quilt quilt) {
     // DONE
-    CArrayOfQuiltspecs qspec = new CArrayOfQuiltspecs(quilt.qspec);
+    final CArrayOfQuiltspecs qspec = new CArrayOfQuiltspecs(quilt.qspec);
     quilt.eqspec = new CArrayOfQuiltspecs(qspec.getArray(), dim);
     for (Knotspec knotspec = kspec; knotspec != null;) {
       qspec.get().stride = knotspec.poststride;
@@ -159,8 +159,8 @@ public class Splinespec {
       qspec.get().bdry[1] = (knotspec.kright.getPointer() == knotspec.klast
                              .getPointer()) ? 1 : 0;
       qspec.get().breakpoints = new float[qspec.get().width + 1];
-      CArrayOfFloats k = new CArrayOfFloats(qspec.get().breakpoints, 0);
-      for (CArrayOfBreakpts bk = new CArrayOfBreakpts(knotspec.bbegin); bk
+      final CArrayOfFloats k = new CArrayOfFloats(qspec.get().breakpoints, 0);
+      for (final CArrayOfBreakpts bk = new CArrayOfBreakpts(knotspec.bbegin); bk
              .getPointer() <= knotspec.bend.getPointer(); bk.pp()) {
         k.set(bk.get().value);
         k.pp();
@@ -177,7 +177,7 @@ public class Splinespec {
    * Copies array of control points to output array
    * @param ctlarray control points array
    */
-  public void copy(CArrayOfFloats ctlarray) {
+  public void copy(final CArrayOfFloats ctlarray) {
     // DONE
     kspec.copy(ctlarray, outcpts);
 
diff --git a/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java b/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
index 4d8296c..573c7df 100644
--- a/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
+++ b/src/jogl/classes/jogamp/opengl/glu/nurbs/Subdivider.java
@@ -133,12 +133,12 @@ public class Subdivider {
   /**
    * Breakpoints
    */
-  private Flist smbrkpts;
+  private final Flist smbrkpts = new Flist();
 
   /**
    * Not used
+   * private float[] stepsizes;
    */
-  private float[] stepsizes;
 
   /**
    * Domain distance in V direction
@@ -148,7 +148,7 @@ public class Subdivider {
   /**
    * Initializes quilt list
    */
-  public void beginQuilts(Backend backend) {
+  public void beginQuilts(final Backend backend) {
     // DONE
     qlist = null;
     renderhints = new Renderhints();
@@ -162,7 +162,7 @@ public class Subdivider {
    * Adds quilt to linked list
    * @param quilt added quilt
    */
-  public void addQuilt(Quilt quilt) {
+  public void addQuilt(final Quilt quilt) {
     // DONE
     if (qlist == null)
       qlist = quilt;
@@ -198,8 +198,8 @@ public class Subdivider {
       }
     }
 
-    float[] from = new float[2];
-    float[] to = new float[2];
+    final float[] from = new float[2];
+    final float[] to = new float[2];
 
     spbrkpts = new Flist();
     tpbrkpts = new Flist();
@@ -215,7 +215,7 @@ public class Subdivider {
         makeBorderTrim(from, to);
       }
     } else {
-      float[] rate = new float[2];
+      final float[] rate = new float[2];
       qlist.findRates(spbrkpts, tpbrkpts, rate);
       //                System.out.println("subdivider.drawsurfaces decompose");
     }
@@ -231,8 +231,8 @@ public class Subdivider {
       int num_v_steps;
       for (i = spbrkpts.start; i < spbrkpts.end - 1; i++) {
         for (j = tpbrkpts.start; j < tpbrkpts.end - 1; j++) {
-          float[] pta = new float[2];
-          float[] ptb = new float[2];
+          final float[] pta = new float[2];
+          final float[] ptb = new float[2];
 
           pta[0] = spbrkpts.pts[i];
           ptb[0] = spbrkpts.pts[i + 1];
@@ -266,7 +266,7 @@ public class Subdivider {
    * Empty method
    * @param initialbin2
    */
-  private void freejarcs(Bin initialbin2) {
+  private void freejarcs(final Bin initialbin2) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.freejarcs");
   }
@@ -275,7 +275,7 @@ public class Subdivider {
    * Subdivide in U direction
    * @param source Trimming arcs source
    */
-  private void subdivideInS(Bin source) {
+  private void subdivideInS(final Bin source) {
     // DONE
     if (renderhints.display_method == NurbsConsts.N_OUTLINE_PARAM) {
       outline(source);
@@ -294,13 +294,13 @@ public class Subdivider {
    * @param start breakpoints start
    * @param end breakpoints end
    */
-  private void splitInS(Bin source, int start, int end) {
+  private void splitInS(final Bin source, final int start, final int end) {
     // DONE
     if (source.isnonempty()) {
       if (start != end) {
-        int i = start + (end - start) / 2;
-        Bin left = new Bin();
-        Bin right = new Bin();
+        final int i = start + (end - start) / 2;
+        final Bin left = new Bin();
+        final Bin right = new Bin();
 
         split(source, left, right, 0, spbrkpts.pts[i]);
         splitInS(left, start, i);
@@ -329,15 +329,15 @@ public class Subdivider {
    * @param start
    * @param end
    */
-  private void splitInT(Bin source, int start, int end) {
+  private void splitInT(final Bin source, final int start, final int end) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.splitint");
 
     if (source.isnonempty()) {
       if (start != end) {
-        int i = start + (end - start) / 2;
-        Bin left = new Bin();
-        Bin right = new Bin();
+        final int i = start + (end - start) / 2;
+        final Bin left = new Bin();
+        final Bin right = new Bin();
         split(source, left, right, 1, tpbrkpts.pts[i + 1]);
         splitInT(left, start, i);
         splitInT(right, i + 1, end);
@@ -352,8 +352,8 @@ public class Subdivider {
           setArcTypeBezier();
           setDegenerate();
 
-          float[] pta = new float[2];
-          float[] ptb = new float[2];
+          final float[] pta = new float[2];
+          final float[] ptb = new float[2];
 
           pta[0] = spbrkpts.pts[s_index - 1];
           pta[1] = tpbrkpts.pts[t_index - 1];
@@ -362,7 +362,7 @@ public class Subdivider {
           ptb[1] = tpbrkpts.pts[t_index];
           qlist.downloadAll(pta, ptb, backend);
 
-          Patchlist patchlist = new Patchlist(qlist, pta, ptb);
+          final Patchlist patchlist = new Patchlist(qlist, pta, ptb);
 
           samplingSplit(source, patchlist,
                         renderhints.maxsubdivisions, 0);
@@ -381,8 +381,8 @@ public class Subdivider {
    * @param subdivisions
    * @param param
    */
-  private void samplingSplit(Bin source, Patchlist patchlist,
-                             int subdivisions, int param) {
+  private void samplingSplit(final Bin source, final Patchlist patchlist,
+                             final int subdivisions, int param) {
     // DONE
     if (!source.isnonempty())
       return;
@@ -408,13 +408,13 @@ public class Subdivider {
       else
         param = 1 - param;
 
-      Bin left = new Bin();
-      Bin right = new Bin();
+      final Bin left = new Bin();
+      final Bin right = new Bin();
 
-      float mid = (float) ((patchlist.pspec[param].range[0] + patchlist.pspec[param].range[1]) * .5);
+      final float mid = (float) ((patchlist.pspec[param].range[0] + patchlist.pspec[param].range[1]) * .5);
 
       split(source, left, right, param, mid);
-      Patchlist subpatchlist = new Patchlist(patchlist, param, mid);
+      final Patchlist subpatchlist = new Patchlist(patchlist, param, mid);
       samplingSplit(left, subpatchlist, subdivisions - 1, param);
       samplingSplit(right, subpatchlist, subdivisions - 1, param);
     } else {
@@ -433,18 +433,18 @@ public class Subdivider {
    * @param subdivisions
    * @param param
    */
-  private void nonSamplingSplit(Bin source, Patchlist patchlist,
-                                int subdivisions, int param) {
+  private void nonSamplingSplit(final Bin source, final Patchlist patchlist,
+                                final int subdivisions, int param) {
     // DONE
     if (patchlist.needsNonSamplingSubdivision() && subdivisions > 0) {
       param = 1 - param;
 
-      Bin left = new Bin();
-      Bin right = new Bin();
+      final Bin left = new Bin();
+      final Bin right = new Bin();
 
-      float mid = (float) ((patchlist.pspec[param].range[0] + patchlist.pspec[param].range[1]) * .5);
+      final float mid = (float) ((patchlist.pspec[param].range[0] + patchlist.pspec[param].range[1]) * .5);
       split(source, left, right, param, mid);
-      Patchlist subpatchlist = new Patchlist(patchlist, param, mid);
+      final Patchlist subpatchlist = new Patchlist(patchlist, param, mid);
       if (left.isnonempty()) {
         if (subpatchlist.cullCheck() == CULL_TRIVIAL_REJECT)
           freejarcs(left);
@@ -483,7 +483,7 @@ public class Subdivider {
    * @param start
    * @param end
    */
-  private void monosplitInS(Bin source, int start, int end) {
+  private void monosplitInS(final Bin source, final int start, final int end) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.monosplitins");
   }
@@ -492,7 +492,7 @@ public class Subdivider {
    * Not used
    * @param source
    */
-  private void findIrregularS(Bin source) {
+  private void findIrregularS(final Bin source) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.findIrregularS");
   }
@@ -510,7 +510,7 @@ public class Subdivider {
    * @param source
    * @param patchlist
    */
-  private void tesselation(Bin source, Patchlist patchlist) {
+  private void tesselation(final Bin source, final Patchlist patchlist) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.tesselation");
   }
@@ -531,19 +531,19 @@ public class Subdivider {
    * @param param
    * @param value
    */
-  private void split(Bin bin, Bin left, Bin right, int param, float value) {
+  private void split(final Bin bin, final Bin left, final Bin right, final int param, final float value) {
     // DONE
-    Bin intersections = new Bin();
-    Bin unknown = new Bin();
+    final Bin intersections = new Bin();
+    final Bin unknown = new Bin();
 
     partition(bin, left, intersections, right, unknown, param, value);
 
-    int count = intersections.numarcs();
+    final int count = intersections.numarcs();
     // TODO jumpbuffer ??
 
     if (count % 2 == 0) {
 
-      Arc[] arclist = new Arc[MAXARCS];
+      final Arc[] arclist = new Arc[MAXARCS];
       CArrayOfArcs list;
       if (count >= MAXARCS) {
         list = new CArrayOfArcs(new Arc[count]);
@@ -559,7 +559,7 @@ public class Subdivider {
         last.set(jarc);
 
       if (param == 0) {// sort into incrasing t order
-        ArcSdirSorter sorter = new ArcSdirSorter(this);
+        final ArcSdirSorter sorter = new ArcSdirSorter(this);
         sorter.qsort(list, count);
 
         for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
@@ -578,7 +578,7 @@ public class Subdivider {
         }
 
       } else {// sort into decreasing s order
-        ArcTdirSorter sorter = new ArcTdirSorter(this);
+        final ArcTdirSorter sorter = new ArcTdirSorter(this);
         sorter.qsort(list, count);
 
         for (lptr = new CArrayOfArcs(list); lptr.getPointer() < last
@@ -609,7 +609,7 @@ public class Subdivider {
    * @param arc
    * @param relative
    */
-  private void join_t(Bin left, Bin right, Arc arc, Arc relative) {
+  private void join_t(final Bin left, final Bin right, final Arc arc, final Arc relative) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.join_t");
   }
@@ -619,7 +619,7 @@ public class Subdivider {
    * @param arc
    * @param relative
    */
-  private void check_t(Arc arc, Arc relative) {
+  private void check_t(final Arc arc, final Arc relative) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.check_t");
   }
@@ -631,28 +631,28 @@ public class Subdivider {
    * @param jarc1
    * @param jarc2
    */
-  private void join_s(Bin left, Bin right, Arc jarc1, Arc jarc2) {
+  private void join_s(final Bin left, final Bin right, Arc jarc1, Arc jarc2) {
     // DONE
     if (!jarc1.getitail())
       jarc1 = jarc1.next;
     if (!jarc2.getitail())
       jarc2 = jarc2.next;
 
-    float s = jarc1.tail()[0];
-    float t1 = jarc1.tail()[1];
-    float t2 = jarc2.tail()[1];
+    final float s = jarc1.tail()[0];
+    final float t1 = jarc1.tail()[1];
+    final float t2 = jarc2.tail()[1];
 
     if (t1 == t2) {
       simplelink(jarc1, jarc2);
     } else {
-      Arc newright = new Arc(Arc.ARC_RIGHT);
-      Arc newleft = new Arc(Arc.ARC_LEFT);
+      final Arc newright = new Arc(Arc.ARC_RIGHT);
+      final Arc newleft = new Arc(Arc.ARC_LEFT);
       if (isBezierArcType()) {
         arctesselator.bezier(newright, s, s, t1, t2);
         arctesselator.bezier(newleft, s, s, t2, t1);
       } else {
-        arctesselator.pwl_right(newright, s, t1, t2, stepsizes[0]);
-        arctesselator.pwl_left(newright, s, t2, t1, stepsizes[2]);
+        arctesselator.pwl_right(newright, s, t1, t2, 0 /* stepsizes[0] */);
+        arctesselator.pwl_left(newright, s, t2, t1, 0 /* stepsizes[2] */);
       }
       link(jarc1, jarc2, newright, newleft);
       left.addarc(newright);
@@ -668,7 +668,7 @@ public class Subdivider {
    * @param newright
    * @param newleft
    */
-  private void link(Arc jarc1, Arc jarc2, Arc newright, Arc newleft) {
+  private void link(final Arc jarc1, final Arc jarc2, final Arc newright, final Arc newleft) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.link");
   }
@@ -688,7 +688,7 @@ public class Subdivider {
    * @param jarc1
    * @param jarc2
    */
-  private void simplelink(Arc jarc1, Arc jarc2) {
+  private void simplelink(final Arc jarc1, final Arc jarc2) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.simplelink");
   }
@@ -698,7 +698,7 @@ public class Subdivider {
    * @param arc
    * @param relative
    */
-  private void check_s(Arc arc, Arc relative) {
+  private void check_s(final Arc arc, final Arc relative) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.check_s");
 
@@ -714,17 +714,17 @@ public class Subdivider {
    * @param param
    * @param value
    */
-  private void partition(Bin bin, Bin left, Bin intersections, Bin right,
-                         Bin unknown, int param, float value) {
+  private void partition(final Bin bin, final Bin left, final Bin intersections, final Bin right,
+                         final Bin unknown, final int param, final float value) {
 
-    Bin headonleft = new Bin();
-    Bin headonright = new Bin();
-    Bin tailonleft = new Bin();
-    Bin tailonright = new Bin();
+    final Bin headonleft = new Bin();
+    final Bin headonright = new Bin();
+    final Bin tailonleft = new Bin();
+    final Bin tailonright = new Bin();
 
     for (Arc jarc = bin.removearc(); jarc != null; jarc = bin.removearc()) {
-      float tdiff = jarc.tail()[param] - value;
-      float hdiff = jarc.head()[param] - value;
+      final float tdiff = jarc.tail()[param] - value;
+      final float hdiff = jarc.head()[param] - value;
 
       if (tdiff > 0) {
         if (hdiff > 0) {
@@ -732,7 +732,6 @@ public class Subdivider {
         } else if (hdiff == 0) {
           tailonright.addarc(jarc);
         } else {
-          Arc jtemp;
           switch (arc_split(jarc, param, value, 0)) {
           case 2:
             tailonright.addarc(jarc);
@@ -785,8 +784,8 @@ public class Subdivider {
    * @param right
    * @param value
    */
-  private void classify_tailonright_t(Bin tailonright, Bin intersections,
-                                      Bin right, float value) {
+  private void classify_tailonright_t(final Bin tailonright, final Bin intersections,
+                                      final Bin right, final float value) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.classify_tailonright_t");
 
@@ -799,14 +798,14 @@ public class Subdivider {
    * @param out
    * @param val
    */
-  private void classify_tailonleft_s(Bin bin, Bin in, Bin out, float val) {
+  private void classify_tailonleft_s(final Bin bin, final Bin in, final Bin out, final float val) {
 
     // DONE
     Arc j;
     while ((j = bin.removearc()) != null) {
       j.clearitail();
 
-      float diff = j.next.head()[0] - val;
+      final float diff = j.next.head()[0] - val;
       if (diff > 0) {
         in.addarc(j);
       } else if (diff < 0) {
@@ -831,13 +830,13 @@ public class Subdivider {
    * @param out
    * @param val
    */
-  private void classify_headonright_s(Bin bin, Bin in, Bin out, float val) {
+  private void classify_headonright_s(final Bin bin, final Bin in, final Bin out, final float val) {
     // DONE
     Arc j;
     while ((j = bin.removearc()) != null) {
       j.setitail();
 
-      float diff = j.prev.tail()[0] - val;
+      final float diff = j.prev.tail()[0] - val;
       if (diff > 0) {
         if (ccwTurn_sr(j.prev, j))
           out.addarc(j);
@@ -860,7 +859,7 @@ public class Subdivider {
    * @param j
    * @return false
    */
-  private boolean ccwTurn_sr(Arc prev, Arc j) {
+  private boolean ccwTurn_sr(final Arc prev, final Arc j) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO ccwTurn_sr");
     return false;
@@ -873,8 +872,8 @@ public class Subdivider {
    * @param right
    * @param value
    */
-  private void classify_headonright_t(Bin headonright, Bin intersections,
-                                      Bin right, float value) {
+  private void classify_headonright_t(final Bin headonright, final Bin intersections,
+                                      final Bin right, final float value) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.classify_headonright_t");
   }
@@ -886,8 +885,8 @@ public class Subdivider {
    * @param left
    * @param value
    */
-  private void classify_tailonleft_t(Bin tailonleft, Bin intersections,
-                                     Bin left, float value) {
+  private void classify_tailonleft_t(final Bin tailonleft, final Bin intersections,
+                                     final Bin left, final float value) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.classify_tailonleft_t");
   }
@@ -899,13 +898,13 @@ public class Subdivider {
    * @param out
    * @param val
    */
-  private void classify_headonleft_t(Bin bin, Bin in, Bin out, float val) {
+  private void classify_headonleft_t(final Bin bin, final Bin in, final Bin out, final float val) {
     // DONE
     Arc j;
     while ((j = bin.removearc()) != null) {
       j.setitail();
 
-      float diff = j.prev.tail()[1] - val;
+      final float diff = j.prev.tail()[1] - val;
       if (diff > 0) {
         out.addarc(j);
       } else if (diff < 0) {
@@ -928,7 +927,7 @@ public class Subdivider {
    * @param j
    * @return false
    */
-  private boolean ccwTurn_tl(Arc prev, Arc j) {
+  private boolean ccwTurn_tl(final Arc prev, final Arc j) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.ccwTurn_tl");
     return false;
@@ -941,13 +940,13 @@ public class Subdivider {
    * @param out
    * @param val
    */
-  private void classify_tailonright_s(Bin bin, Bin in, Bin out, float val) {
+  private void classify_tailonright_s(final Bin bin, final Bin in, final Bin out, final float val) {
     // DONE
     Arc j;
     while ((j = bin.removearc()) != null) {
       j.clearitail();
 
-      float diff = j.next.head()[0] - val;
+      final float diff = j.next.head()[0] - val;
       if (diff > 0) {
         if (ccwTurn_sr(j, j.next))
           out.addarc(j);
@@ -972,13 +971,13 @@ public class Subdivider {
    * @param out
    * @param val
    */
-  private void classify_headonleft_s(Bin bin, Bin in, Bin out, float val) {
+  private void classify_headonleft_s(final Bin bin, final Bin in, final Bin out, final float val) {
     // DONE
     Arc j;
     while ((j = bin.removearc()) != null) {
       j.setitail();
 
-      float diff = j.prev.tail()[0] - val;
+      final float diff = j.prev.tail()[0] - val;
       if (diff > 0) {
         out.addarc(j);
       } else if (diff < 0) {
@@ -1002,7 +1001,7 @@ public class Subdivider {
    * @param j
    * @return false
    */
-  private boolean ccwTurn_sl(Arc prev, Arc j) {
+  private boolean ccwTurn_sl(final Arc prev, final Arc j) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.ccwTurn_sl");
     return false;
@@ -1016,7 +1015,7 @@ public class Subdivider {
    * @param i
    * @return 0
    */
-  private int arc_split(Arc jarc, int param, float value, int i) {
+  private int arc_split(final Arc jarc, final int param, final float value, final int i) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.arc_split");
     return 0;
@@ -1043,7 +1042,7 @@ public class Subdivider {
    * Not used
    * @param source
    */
-  private void outline(Bin source) {
+  private void outline(final Bin source) {
     // TODO Auto-generated method stub
     //            System.out.println("TODO subdivider.outline");
   }
@@ -1053,13 +1052,13 @@ public class Subdivider {
    * @param from range beginnings
    * @param to range ends
    */
-  private void makeBorderTrim(float[] from, float[] to) {
+  private void makeBorderTrim(final float[] from, final float[] to) {
     // DONE
-    float smin = from[0];
-    float smax = to[0];
+    final float smin = from[0];
+    final float smax = to[0];
 
-    float tmin = from[1];
-    float tmax = to[1];
+    final float tmin = from[1];
+    final float tmax = to[1];
 
     pjarc = null;
     Arc jarc = null;
@@ -1092,10 +1091,10 @@ public class Subdivider {
    */
   public void drawCurves() {
     // DONE
-    float[] from = new float[1];
-    float[] to = new float[1];
+    final float[] from = new float[1];
+    final float[] to = new float[1];
 
-    Flist bpts = new Flist();
+    final Flist bpts = new Flist();
     qlist.getRange(from, to, bpts);
 
     renderhints.init();
@@ -1103,13 +1102,13 @@ public class Subdivider {
     backend.bgncurv();
 
     for (int i = bpts.start; i < bpts.end - 1; i++) {
-      float[] pta = new float[1];
-      float[] ptb = new float[1];
+      final float[] pta = new float[1];
+      final float[] ptb = new float[1];
       pta[0] = bpts.pts[i];
       ptb[0] = bpts.pts[i + 1];
 
       qlist.downloadAll(pta, ptb, backend);
-      Curvelist curvelist = new Curvelist(qlist, pta, ptb);
+      final Curvelist curvelist = new Curvelist(qlist, pta, ptb);
       samplingSplit(curvelist, renderhints.maxsubdivisions);
     }
     backend.endcurv();
@@ -1120,7 +1119,7 @@ public class Subdivider {
    * @param curvelist list of curves
    * @param maxsubdivisions maximum number of subdivisions
    */
-  private void samplingSplit(Curvelist curvelist, int maxsubdivisions) {
+  private void samplingSplit(final Curvelist curvelist, final int maxsubdivisions) {
     if (curvelist.cullCheck() == CULL_TRIVIAL_REJECT)
       return;
 
@@ -1130,7 +1129,7 @@ public class Subdivider {
       // TODO kód
       //                System.out.println("TODO subdivider-needsSamplingSubdivision");
     } else {
-      int nu = (int) (1 + curvelist.range[2] / curvelist.stepsize);
+      final int nu = (int) (1 + curvelist.range[2] / curvelist.stepsize);
       backend.curvgrid(curvelist.range[0], curvelist.range[1], nu);
       backend.curvmesh(0, nu);
     }
@@ -1142,7 +1141,7 @@ public class Subdivider {
    * @param d new domain_distance_u_rate value
 
   */
-  public void set_domain_distance_u_rate(double d) {
+  public void set_domain_distance_u_rate(final double d) {
     // DONE
     domain_distance_u_rate = (float) d;
   }
@@ -1151,7 +1150,7 @@ public class Subdivider {
    * Sets new domain_distance_v_rate value
    * @param d new domain_distance_v_rate value
    */
-  public void set_domain_distance_v_rate(double d) {
+  public void set_domain_distance_v_rate(final double d) {
     // DONE
     domain_distance_v_rate = (float) d;
   }
@@ -1160,7 +1159,7 @@ public class Subdivider {
    * Sets new is_domain_distance_sampling value
    * @param i new is_domain_distance_sampling value
    */
-  public void set_is_domain_distance_sampling(int i) {
+  public void set_is_domain_distance_sampling(final int i) {
     // DONE
     this.is_domain_distance_sampling = i;
   }
diff --git a/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java b/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
index 9c8523e..5cae679 100644
--- a/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
+++ b/src/jogl/classes/jogamp/opengl/glu/registry/Registry.java
@@ -56,7 +56,7 @@ public class Registry {
   public Registry() {
   }
 
-  public static String gluGetString(int name) {
+  public static String gluGetString(final int name) {
     if( name == GLU.GLU_VERSION ) {
       return( "1.3" );
     } else if( name == GLU.GLU_EXTENSIONS ) {
@@ -65,7 +65,7 @@ public class Registry {
     return( null );
   }
 
-  public static boolean gluCheckExtension( String extName, String extString ) {
+  public static boolean gluCheckExtension( final String extName, final String extString ) {
     if( extName == null || extString == null ) {
       return( false );
     }
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java
index 3ac9df6..3bb7593 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Dict.java
@@ -60,8 +60,8 @@ class Dict {
     private Dict() {
     }
 
-    static Dict dictNewDict(Object frame, DictLeq leq) {
-        Dict dict = new Dict();
+    static Dict dictNewDict(final Object frame, final DictLeq leq) {
+        final Dict dict = new Dict();
         dict.head = new DictNode();
 
         dict.head.key = null;
@@ -74,22 +74,22 @@ class Dict {
         return dict;
     }
 
-    static void dictDeleteDict(Dict dict) {
+    static void dictDeleteDict(final Dict dict) {
         dict.head = null;
         dict.frame = null;
         dict.leq = null;
     }
 
-    static DictNode dictInsert(Dict dict, Object key) {
+    static DictNode dictInsert(final Dict dict, final Object key) {
         return dictInsertBefore(dict, dict.head, key);
     }
 
-    static DictNode dictInsertBefore(Dict dict, DictNode node, Object key) {
+    static DictNode dictInsertBefore(final Dict dict, DictNode node, final Object key) {
         do {
             node = node.prev;
         } while (node.key != null && !dict.leq.leq(dict.frame, node.key, key));
 
-        DictNode newNode = new DictNode();
+        final DictNode newNode = new DictNode();
         newNode.key = key;
         newNode.next = node.next;
         node.next.prev = newNode;
@@ -99,32 +99,32 @@ class Dict {
         return newNode;
     }
 
-    static Object dictKey(DictNode aNode) {
+    static Object dictKey(final DictNode aNode) {
         return aNode.key;
     }
 
-    static DictNode dictSucc(DictNode aNode) {
+    static DictNode dictSucc(final DictNode aNode) {
         return aNode.next;
     }
 
-    static DictNode dictPred(DictNode aNode) {
+    static DictNode dictPred(final DictNode aNode) {
         return aNode.prev;
     }
 
-    static DictNode dictMin(Dict aDict) {
+    static DictNode dictMin(final Dict aDict) {
         return aDict.head.next;
     }
 
-    static DictNode dictMax(Dict aDict) {
+    static DictNode dictMax(final Dict aDict) {
         return aDict.head.prev;
     }
 
-    static void dictDelete(Dict dict, DictNode node) {
+    static void dictDelete(final Dict dict, final DictNode node) {
         node.next.prev = node.prev;
         node.prev.next = node.next;
     }
 
-    static DictNode dictSearch(Dict dict, Object key) {
+    static DictNode dictSearch(final Dict dict, final Object key) {
         DictNode node = dict.head;
 
         do {
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java
index 29944f9..a849058 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUhalfEdge.java
@@ -65,7 +65,7 @@ class GLUhalfEdge {
     public int winding;    /* change in winding number when crossing */
     public boolean first;
 
-    public GLUhalfEdge(boolean first) {
+    public GLUhalfEdge(final boolean first) {
         this.first = first;
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java
index d594cb3..f2a9c78 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/GLUtessellatorImpl.java
@@ -177,11 +177,11 @@ public class GLUtessellatorImpl implements GLUtessellator {
         mesh = null;
     }
 
-    private void requireState(int newState) {
+    private void requireState(final int newState) {
         if (state != newState) gotoState(newState);
     }
 
-    private void gotoState(int newState) {
+    private void gotoState(final int newState) {
         while (state != newState) {
             /* We change the current state one level at a time, to get to
              * the desired state.
@@ -211,7 +211,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
         requireState(TessState.T_DORMANT);
     }
 
-    public void gluTessProperty(int which, double value) {
+    public void gluTessProperty(final int which, final double value) {
         switch (which) {
             case GLU.GLU_TESS_TOLERANCE:
                 if (value < 0.0 || value > 1.0) break;
@@ -219,7 +219,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
                 return;
 
             case GLU.GLU_TESS_WINDING_RULE:
-                int windingRule = (int) value;
+                final int windingRule = (int) value;
                 if (windingRule != value) break;    /* not an integer */
 
                 switch (windingRule) {
@@ -250,7 +250,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
     }
 
 /* Returns tessellator property */
-    public void gluGetTessProperty(int which, double[] value, int value_offset) {
+    public void gluGetTessProperty(final int which, final double[] value, final int value_offset) {
         switch (which) {
             case GLU.GLU_TESS_TOLERANCE:
 /* tolerance should be in range [0..1] */
@@ -279,13 +279,13 @@ public class GLUtessellatorImpl implements GLUtessellator {
         }
     } /* gluGetTessProperty() */
 
-    public void gluTessNormal(double x, double y, double z) {
+    public void gluTessNormal(final double x, final double y, final double z) {
         normal[0] = x;
         normal[1] = y;
         normal[2] = z;
     }
 
-    public void gluTessCallback(int which, GLUtessellatorCallback aCallback) {
+    public void gluTessCallback(final int which, final GLUtessellatorCallback aCallback) {
         switch (which) {
             case GLU.GLU_TESS_BEGIN:
                 callBegin = aCallback == null ? NULL_CB : aCallback;
@@ -340,7 +340,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
         }
     }
 
-    private boolean addVertex(double[] coords, Object vertexData) {
+    private boolean addVertex(final double[] coords, final Object vertexData) {
         GLUhalfEdge e;
 
         e = lastEdge;
@@ -354,7 +354,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
 /* Create a new vertex and edge which immediately follow e
  * in the ordering around the left face.
  */
-            if (Mesh.__gl_meshSplitEdge(e) == null) return false;
+            Mesh.__gl_meshSplitEdge(e);
             e = e.Lnext;
         }
 
@@ -377,12 +377,12 @@ public class GLUtessellatorImpl implements GLUtessellator {
         return true;
     }
 
-    private void cacheVertex(double[] coords, Object vertexData) {
+    private void cacheVertex(final double[] coords, final Object vertexData) {
         if (cache[cacheCount] == null) {
             cache[cacheCount] = new CachedVertex();
         }
 
-        CachedVertex v = cache[cacheCount];
+        final CachedVertex v = cache[cacheCount];
 
         v.data = vertexData;
         v.coords[0] = coords[0];
@@ -393,14 +393,15 @@ public class GLUtessellatorImpl implements GLUtessellator {
 
 
     private boolean flushCache() {
-        CachedVertex[] v = cache;
+        final CachedVertex[] v = cache;
 
         mesh = Mesh.__gl_meshNewMesh();
-        if (mesh == null) return false;
 
         for (int i = 0; i < cacheCount; i++) {
-            CachedVertex vertex = v[i];
-            if (!addVertex(vertex.coords, vertex.data)) return false;
+            final CachedVertex vertex = v[i];
+            if (!addVertex(vertex.coords, vertex.data)) {
+                return false;
+            }
         }
         cacheCount = 0;
         flushCacheOnNextVertex = false;
@@ -408,11 +409,11 @@ public class GLUtessellatorImpl implements GLUtessellator {
         return true;
     }
 
-    public void gluTessVertex(double[] coords, int coords_offset, Object vertexData) {
+    public void gluTessVertex(final double[] coords, final int coords_offset, final Object vertexData) {
         int i;
         boolean tooLarge = false;
         double x;
-        double[] clamped = new double[3];
+        final double[] clamped = new double[3];
 
         requireState(TessState.T_IN_CONTOUR);
 
@@ -456,7 +457,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
     }
 
 
-    public void gluTessBeginPolygon(Object data) {
+    public void gluTessBeginPolygon(final Object data) {
         requireState(TessState.T_DORMANT);
 
         state = TessState.T_IN_POLYGON;
@@ -573,7 +574,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
             Mesh.__gl_meshDeleteMesh(mesh);
             polygonData = null;
             mesh = null;
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
             callErrorOrErrorData(GLU.GLU_OUT_OF_MEMORY);
         }
@@ -590,7 +591,7 @@ public class GLUtessellatorImpl implements GLUtessellator {
 
 
 /*ARGSUSED*/
-    public void gluNextContour(int type) {
+    public void gluNextContour(final int type) {
         gluTessEndContour();
         gluTessBeginContour();
     }
@@ -601,21 +602,21 @@ public class GLUtessellatorImpl implements GLUtessellator {
         gluTessEndPolygon();
     }
 
-    void callBeginOrBeginData(int a) {
+    void callBeginOrBeginData(final int a) {
         if (callBeginData != NULL_CB)
             callBeginData.beginData(a, polygonData);
         else
             callBegin.begin(a);
     }
 
-    void callVertexOrVertexData(Object a) {
+    void callVertexOrVertexData(final Object a) {
         if (callVertexData != NULL_CB)
             callVertexData.vertexData(a, polygonData);
         else
             callVertex.vertex(a);
     }
 
-    void callEdgeFlagOrEdgeFlagData(boolean a) {
+    void callEdgeFlagOrEdgeFlagData(final boolean a) {
         if (callEdgeFlagData != NULL_CB)
             callEdgeFlagData.edgeFlagData(a, polygonData);
         else
@@ -629,14 +630,14 @@ public class GLUtessellatorImpl implements GLUtessellator {
             callEnd.end();
     }
 
-    void callCombineOrCombineData(double[] coords, Object[] vertexData, float[] weights, Object[] outData) {
+    void callCombineOrCombineData(final double[] coords, final Object[] vertexData, final float[] weights, final Object[] outData) {
         if (callCombineData != NULL_CB)
             callCombineData.combineData(coords, vertexData, weights, outData, polygonData);
         else
             callCombine.combine(coords, vertexData, weights, outData);
     }
 
-    void callErrorOrErrorData(int a) {
+    void callErrorOrErrorData(final int a) {
         if (callErrorData != NULL_CB)
             callErrorData.errorData(a, polygonData);
         else
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java
index 3da2d26..493052f 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Geom.java
@@ -66,7 +66,7 @@ class Geom {
      * let r be the negated result (this evaluates (uw)(v->s)), then
      * r is guaranteed to satisfy MIN(u->t,w->t) <= r <= MAX(u->t,w->t).
      */
-    static double EdgeEval(GLUvertex u, GLUvertex v, GLUvertex w) {
+    static double EdgeEval(final GLUvertex u, final GLUvertex v, final GLUvertex w) {
         double gapL, gapR;
 
         assert (VertLeq(u, v) && VertLeq(v, w));
@@ -85,7 +85,7 @@ class Geom {
         return 0;
     }
 
-    static double EdgeSign(GLUvertex u, GLUvertex v, GLUvertex w) {
+    static double EdgeSign(final GLUvertex u, final GLUvertex v, final GLUvertex w) {
         double gapL, gapR;
 
         assert (VertLeq(u, v) && VertLeq(v, w));
@@ -105,7 +105,7 @@ class Geom {
      * Define versions of EdgeSign, EdgeEval with s and t transposed.
      */
 
-    static double TransEval(GLUvertex u, GLUvertex v, GLUvertex w) {
+    static double TransEval(final GLUvertex u, final GLUvertex v, final GLUvertex w) {
         /* Given three vertices u,v,w such that TransLeq(u,v) && TransLeq(v,w),
          * evaluates the t-coord of the edge uw at the s-coord of the vertex v.
          * Returns v->s - (uw)(v->t), ie. the signed distance from uw to v.
@@ -134,7 +134,7 @@ class Geom {
         return 0;
     }
 
-    static double TransSign(GLUvertex u, GLUvertex v, GLUvertex w) {
+    static double TransSign(final GLUvertex u, final GLUvertex v, final GLUvertex w) {
         /* Returns a number whose sign matches TransEval(u,v,w) but which
          * is cheaper to evaluate.  Returns > 0, == 0 , or < 0
          * as v is above, on, or below the edge uw.
@@ -154,7 +154,7 @@ class Geom {
     }
 
 
-    static boolean VertCCW(GLUvertex u, GLUvertex v, GLUvertex w) {
+    static boolean VertCCW(final GLUvertex u, final GLUvertex v, final GLUvertex w) {
         /* For almost-degenerate situations, the results are not reliable.
          * Unless the floating-point arithmetic can be performed without
          * rounding errors, *any* implementation will give incorrect results
@@ -172,7 +172,7 @@ class Geom {
  * MIN(x,y) <= r <= MAX(x,y), and the results are very accurate
  * even when a and b differ greatly in magnitude.
  */
-    static double Interpolate(double a, double x, double b, double y) {
+    static double Interpolate(double a, final double x, double b, final double y) {
         a = (a < 0) ? 0 : a;
         b = (b < 0) ? 0 : b;
         if (a <= b) {
@@ -188,7 +188,7 @@ class Geom {
 
     static void EdgeIntersect(GLUvertex o1, GLUvertex d1,
                               GLUvertex o2, GLUvertex d2,
-                              GLUvertex v)
+                              final GLUvertex v)
 /* Given edges (o1,d1) and (o2,d2), compute their point of intersection.
  * The computed point is guaranteed to lie in the intersection of the
  * bounding rectangles defined by each edge.
@@ -204,12 +204,12 @@ class Geom {
          */
 
         if (!VertLeq(o1, d1)) {
-            GLUvertex temp = o1;
+            final GLUvertex temp = o1;
             o1 = d1;
             d1 = temp;
         }
         if (!VertLeq(o2, d2)) {
-            GLUvertex temp = o2;
+            final GLUvertex temp = o2;
             o2 = d2;
             d2 = temp;
         }
@@ -248,12 +248,12 @@ class Geom {
         /* Now repeat the process for t */
 
         if (!TransLeq(o1, d1)) {
-            GLUvertex temp = o1;
+            final GLUvertex temp = o1;
             o1 = d1;
             d1 = temp;
         }
         if (!TransLeq(o2, d2)) {
-            GLUvertex temp = o2;
+            final GLUvertex temp = o2;
             o2 = d2;
             d2 = temp;
         }
@@ -290,29 +290,29 @@ class Geom {
         }
     }
 
-    static boolean VertEq(GLUvertex u, GLUvertex v) {
+    static boolean VertEq(final GLUvertex u, final GLUvertex v) {
         return u.s == v.s && u.t == v.t;
     }
 
-    static boolean VertLeq(GLUvertex u, GLUvertex v) {
+    static boolean VertLeq(final GLUvertex u, final GLUvertex v) {
         return u.s < v.s || (u.s == v.s && u.t <= v.t);
     }
 
 /* Versions of VertLeq, EdgeSign, EdgeEval with s and t transposed. */
 
-    static boolean TransLeq(GLUvertex u, GLUvertex v) {
+    static boolean TransLeq(final GLUvertex u, final GLUvertex v) {
         return u.t < v.t || (u.t == v.t && u.s <= v.s);
     }
 
-    static boolean EdgeGoesLeft(GLUhalfEdge e) {
+    static boolean EdgeGoesLeft(final GLUhalfEdge e) {
         return VertLeq(e.Sym.Org, e.Org);
     }
 
-    static boolean EdgeGoesRight(GLUhalfEdge e) {
+    static boolean EdgeGoesRight(final GLUhalfEdge e) {
         return VertLeq(e.Org, e.Sym.Org);
     }
 
-    static double VertL1dist(GLUvertex u, GLUvertex v) {
+    static double VertL1dist(final GLUvertex u, final GLUvertex v) {
         return Math.abs(u.s - v.s) + Math.abs(u.t - v.t);
     }
 
@@ -320,13 +320,13 @@ class Geom {
 
     // Compute the cosine of the angle between the edges between o and
     // v1 and between o and v2
-    static double EdgeCos(GLUvertex o, GLUvertex v1, GLUvertex v2) {
-        double ov1s = v1.s - o.s;
-        double ov1t = v1.t - o.t;
-        double ov2s = v2.s - o.s;
-        double ov2t = v2.t - o.t;
+    static double EdgeCos(final GLUvertex o, final GLUvertex v1, final GLUvertex v2) {
+        final double ov1s = v1.s - o.s;
+        final double ov1t = v1.t - o.t;
+        final double ov2s = v2.s - o.s;
+        final double ov2t = v2.t - o.t;
         double dotp = ov1s * ov2s + ov1t * ov2t;
-        double len = Math.sqrt(ov1s * ov1s + ov1t * ov1t) * Math.sqrt(ov2s * ov2s + ov2t * ov2t);
+        final double len = Math.sqrt(ov1s * ov1s + ov1t * ov1t) * Math.sqrt(ov2s * ov2s + ov2t * ov2t);
         if (len > 0.0) {
             dotp /= len;
         }
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java
index eb48aa5..e855a55 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Mesh.java
@@ -115,9 +115,9 @@ class Mesh {
  * depending on whether a and b belong to different face or vertex rings.
  * For more explanation see __gl_meshSplice() below.
  */
-    static void Splice(jogamp.opengl.glu.tessellator.GLUhalfEdge a, jogamp.opengl.glu.tessellator.GLUhalfEdge b) {
-        jogamp.opengl.glu.tessellator.GLUhalfEdge aOnext = a.Onext;
-        jogamp.opengl.glu.tessellator.GLUhalfEdge bOnext = b.Onext;
+    static void Splice(final jogamp.opengl.glu.tessellator.GLUhalfEdge a, final jogamp.opengl.glu.tessellator.GLUhalfEdge b) {
+        final jogamp.opengl.glu.tessellator.GLUhalfEdge aOnext = a.Onext;
+        final jogamp.opengl.glu.tessellator.GLUhalfEdge bOnext = b.Onext;
 
         aOnext.Sym.Lnext = b;
         bOnext.Sym.Lnext = a;
@@ -131,11 +131,11 @@ class Mesh {
  * the new vertex *before* vNext so that algorithms which walk the vertex
  * list will not see the newly created vertices.
  */
-    static void MakeVertex(jogamp.opengl.glu.tessellator.GLUvertex newVertex,
-                           jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig, jogamp.opengl.glu.tessellator.GLUvertex vNext) {
+    static void MakeVertex(final jogamp.opengl.glu.tessellator.GLUvertex newVertex,
+                           final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig, final jogamp.opengl.glu.tessellator.GLUvertex vNext) {
         jogamp.opengl.glu.tessellator.GLUhalfEdge e;
         jogamp.opengl.glu.tessellator.GLUvertex vPrev;
-        jogamp.opengl.glu.tessellator.GLUvertex vNew = newVertex;
+        final jogamp.opengl.glu.tessellator.GLUvertex vNew = newVertex;
 
         assert (vNew != null);
 
@@ -164,10 +164,10 @@ class Mesh {
  * the new face *before* fNext so that algorithms which walk the face
  * list will not see the newly created faces.
  */
-    static void MakeFace(jogamp.opengl.glu.tessellator.GLUface newFace, jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig, jogamp.opengl.glu.tessellator.GLUface fNext) {
+    static void MakeFace(final jogamp.opengl.glu.tessellator.GLUface newFace, final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig, final jogamp.opengl.glu.tessellator.GLUface fNext) {
         jogamp.opengl.glu.tessellator.GLUhalfEdge e;
         jogamp.opengl.glu.tessellator.GLUface fPrev;
-        jogamp.opengl.glu.tessellator.GLUface fNew = newFace;
+        final jogamp.opengl.glu.tessellator.GLUface fNew = newFace;
 
         assert (fNew != null);
 
@@ -218,8 +218,9 @@ class Mesh {
 /* KillVertex( vDel ) destroys a vertex and removes it from the global
  * vertex list.  It updates the vertex loop to point to a given new vertex.
  */
-    static void KillVertex(jogamp.opengl.glu.tessellator.GLUvertex vDel, jogamp.opengl.glu.tessellator.GLUvertex newOrg) {
-        jogamp.opengl.glu.tessellator.GLUhalfEdge e, eStart = vDel.anEdge;
+    static void KillVertex(final jogamp.opengl.glu.tessellator.GLUvertex vDel, final jogamp.opengl.glu.tessellator.GLUvertex newOrg) {
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e;
+        final jogamp.opengl.glu.tessellator.GLUhalfEdge eStart = vDel.anEdge;
         jogamp.opengl.glu.tessellator.GLUvertex vPrev, vNext;
 
         /* change the origin of all affected edges */
@@ -239,8 +240,9 @@ class Mesh {
 /* KillFace( fDel ) destroys a face and removes it from the global face
  * list.  It updates the face loop to point to a given new face.
  */
-    static void KillFace(jogamp.opengl.glu.tessellator.GLUface fDel, jogamp.opengl.glu.tessellator.GLUface newLface) {
-        jogamp.opengl.glu.tessellator.GLUhalfEdge e, eStart = fDel.anEdge;
+    static void KillFace(final jogamp.opengl.glu.tessellator.GLUface fDel, final jogamp.opengl.glu.tessellator.GLUface newLface) {
+        jogamp.opengl.glu.tessellator.GLUhalfEdge e;
+        final jogamp.opengl.glu.tessellator.GLUhalfEdge eStart = fDel.anEdge;
         jogamp.opengl.glu.tessellator.GLUface fPrev, fNext;
 
         /* change the left face of all affected edges */
@@ -263,10 +265,10 @@ class Mesh {
 /* __gl_meshMakeEdge creates one edge, two vertices, and a loop (face).
  * The loop consists of the two new half-edges.
  */
-    public static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshMakeEdge(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
-        jogamp.opengl.glu.tessellator.GLUvertex newVertex1 = new jogamp.opengl.glu.tessellator.GLUvertex();
-        jogamp.opengl.glu.tessellator.GLUvertex newVertex2 = new jogamp.opengl.glu.tessellator.GLUvertex();
-        jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+    public static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshMakeEdge(final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+        final jogamp.opengl.glu.tessellator.GLUvertex newVertex1 = new jogamp.opengl.glu.tessellator.GLUvertex();
+        final jogamp.opengl.glu.tessellator.GLUvertex newVertex2 = new jogamp.opengl.glu.tessellator.GLUvertex();
+        final jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
         jogamp.opengl.glu.tessellator.GLUhalfEdge e;
 
         e = MakeEdge(mesh.eHead);
@@ -302,7 +304,7 @@ class Mesh {
  * If eDst == eOrg->Onext, the new vertex will have a single edge.
  * If eDst == eOrg->Oprev, the old vertex will have a single edge.
  */
-    public static boolean __gl_meshSplice(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg, jogamp.opengl.glu.tessellator.GLUhalfEdge eDst) {
+    public static boolean __gl_meshSplice(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg, final jogamp.opengl.glu.tessellator.GLUhalfEdge eDst) {
         boolean joiningLoops = false;
         boolean joiningVertices = false;
 
@@ -323,7 +325,7 @@ class Mesh {
         Splice(eDst, eOrg);
 
         if (!joiningVertices) {
-            jogamp.opengl.glu.tessellator.GLUvertex newVertex = new jogamp.opengl.glu.tessellator.GLUvertex();
+            final jogamp.opengl.glu.tessellator.GLUvertex newVertex = new jogamp.opengl.glu.tessellator.GLUvertex();
 
             /* We split one vertex into two -- the new vertex is eDst.Org.
              * Make sure the old vertex points to a valid half-edge.
@@ -332,7 +334,7 @@ class Mesh {
             eOrg.Org.anEdge = eOrg;
         }
         if (!joiningLoops) {
-            jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+            final jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
 
             /* We split one loop into two -- the new loop is eDst.Lface.
              * Make sure the old face points to a valid half-edge.
@@ -355,8 +357,8 @@ class Mesh {
  * plus a few calls to memFree, but this would allocate and delete
  * unnecessary vertices and faces.
  */
-    static boolean __gl_meshDelete(jogamp.opengl.glu.tessellator.GLUhalfEdge eDel) {
-        jogamp.opengl.glu.tessellator.GLUhalfEdge eDelSym = eDel.Sym;
+    static boolean __gl_meshDelete(final jogamp.opengl.glu.tessellator.GLUhalfEdge eDel) {
+        final jogamp.opengl.glu.tessellator.GLUhalfEdge eDelSym = eDel.Sym;
         boolean joiningLoops = false;
 
         /* First step: disconnect the origin vertex eDel.Org.  We make all
@@ -377,7 +379,7 @@ class Mesh {
 
             Splice(eDel, eDel.Sym.Lnext);
             if (!joiningLoops) {
-                jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+                final jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
 
                 /* We are splitting one loop into two -- create a new loop for eDel. */
                 MakeFace(newFace, eDel, eDel.Lface);
@@ -415,9 +417,9 @@ class Mesh {
  * eNew == eOrg.Lnext, and eNew.Dst is a newly created vertex.
  * eOrg and eNew will have the same left face.
  */
-    static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshAddEdgeVertex(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg) {
+    static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshAddEdgeVertex(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg) {
         jogamp.opengl.glu.tessellator.GLUhalfEdge eNewSym;
-        jogamp.opengl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
+        final jogamp.opengl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
 
         eNewSym = eNew.Sym;
 
@@ -427,7 +429,7 @@ class Mesh {
         /* Set the vertex and face information */
         eNew.Org = eOrg.Sym.Org;
         {
-            jogamp.opengl.glu.tessellator.GLUvertex newVertex = new jogamp.opengl.glu.tessellator.GLUvertex();
+            final jogamp.opengl.glu.tessellator.GLUvertex newVertex = new jogamp.opengl.glu.tessellator.GLUvertex();
 
             MakeVertex(newVertex, eNewSym, eNew.Org);
         }
@@ -441,9 +443,9 @@ class Mesh {
  * such that eNew == eOrg.Lnext.  The new vertex is eOrg.Sym.Org == eNew.Org.
  * eOrg and eNew will have the same left face.
  */
-    public static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshSplitEdge(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg) {
+    public static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshSplitEdge(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg) {
         jogamp.opengl.glu.tessellator.GLUhalfEdge eNew;
-        jogamp.opengl.glu.tessellator.GLUhalfEdge tempHalfEdge = __gl_meshAddEdgeVertex(eOrg);
+        final jogamp.opengl.glu.tessellator.GLUhalfEdge tempHalfEdge = __gl_meshAddEdgeVertex(eOrg);
 
         eNew = tempHalfEdge.Sym;
 
@@ -472,10 +474,10 @@ class Mesh {
  * If (eOrg.Lnext == eDst), the old face is reduced to a single edge.
  * If (eOrg.Lnext.Lnext == eDst), the old face is reduced to two edges.
  */
-    static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshConnect(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg, jogamp.opengl.glu.tessellator.GLUhalfEdge eDst) {
+    static jogamp.opengl.glu.tessellator.GLUhalfEdge __gl_meshConnect(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrg, final jogamp.opengl.glu.tessellator.GLUhalfEdge eDst) {
         jogamp.opengl.glu.tessellator.GLUhalfEdge eNewSym;
         boolean joiningLoops = false;
-        jogamp.opengl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
+        final jogamp.opengl.glu.tessellator.GLUhalfEdge eNew = MakeEdge(eOrg);
 
         eNewSym = eNew.Sym;
 
@@ -498,7 +500,7 @@ class Mesh {
         eOrg.Lface.anEdge = eNewSym;
 
         if (!joiningLoops) {
-            jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
+            final jogamp.opengl.glu.tessellator.GLUface newFace = new jogamp.opengl.glu.tessellator.GLUface();
 
             /* We split one loop into two -- the new loop is eNew.Lface */
             MakeFace(newFace, eNew, eOrg.Lface);
@@ -516,8 +518,8 @@ class Mesh {
  * An entire mesh can be deleted by zapping its faces, one at a time,
  * in any order.  Zapped faces cannot be used in further mesh operations!
  */
-    static void __gl_meshZapFace(jogamp.opengl.glu.tessellator.GLUface fZap) {
-        jogamp.opengl.glu.tessellator.GLUhalfEdge eStart = fZap.anEdge;
+    static void __gl_meshZapFace(final jogamp.opengl.glu.tessellator.GLUface fZap) {
+        final jogamp.opengl.glu.tessellator.GLUhalfEdge eStart = fZap.anEdge;
         jogamp.opengl.glu.tessellator.GLUhalfEdge e, eNext, eSym;
         jogamp.opengl.glu.tessellator.GLUface fPrev, fNext;
 
@@ -566,7 +568,7 @@ class Mesh {
         jogamp.opengl.glu.tessellator.GLUface f;
         jogamp.opengl.glu.tessellator.GLUhalfEdge e;
         jogamp.opengl.glu.tessellator.GLUhalfEdge eSym;
-        jogamp.opengl.glu.tessellator.GLUmesh mesh = new jogamp.opengl.glu.tessellator.GLUmesh();
+        final jogamp.opengl.glu.tessellator.GLUmesh mesh = new jogamp.opengl.glu.tessellator.GLUmesh();
 
         v = mesh.vHead;
         f = mesh.fHead;
@@ -609,13 +611,13 @@ class Mesh {
 /* __gl_meshUnion( mesh1, mesh2 ) forms the union of all structures in
  * both meshes, and returns the new mesh (the old meshes are destroyed).
  */
-    static jogamp.opengl.glu.tessellator.GLUmesh __gl_meshUnion(jogamp.opengl.glu.tessellator.GLUmesh mesh1, jogamp.opengl.glu.tessellator.GLUmesh mesh2) {
-        jogamp.opengl.glu.tessellator.GLUface f1 = mesh1.fHead;
-        jogamp.opengl.glu.tessellator.GLUvertex v1 = mesh1.vHead;
-        jogamp.opengl.glu.tessellator.GLUhalfEdge e1 = mesh1.eHead;
-        jogamp.opengl.glu.tessellator.GLUface f2 = mesh2.fHead;
-        jogamp.opengl.glu.tessellator.GLUvertex v2 = mesh2.vHead;
-        jogamp.opengl.glu.tessellator.GLUhalfEdge e2 = mesh2.eHead;
+    static jogamp.opengl.glu.tessellator.GLUmesh __gl_meshUnion(final jogamp.opengl.glu.tessellator.GLUmesh mesh1, final jogamp.opengl.glu.tessellator.GLUmesh mesh2) {
+        final jogamp.opengl.glu.tessellator.GLUface f1 = mesh1.fHead;
+        final jogamp.opengl.glu.tessellator.GLUvertex v1 = mesh1.vHead;
+        final jogamp.opengl.glu.tessellator.GLUhalfEdge e1 = mesh1.eHead;
+        final jogamp.opengl.glu.tessellator.GLUface f2 = mesh2.fHead;
+        final jogamp.opengl.glu.tessellator.GLUvertex v2 = mesh2.vHead;
+        final jogamp.opengl.glu.tessellator.GLUhalfEdge e2 = mesh2.eHead;
 
         /* Add the faces, vertices, and edges of mesh2 to those of mesh1 */
         if (f2.next != f2) {
@@ -645,8 +647,8 @@ class Mesh {
 
 /* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
  */
-    static void __gl_meshDeleteMeshZap(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
-        jogamp.opengl.glu.tessellator.GLUface fHead = mesh.fHead;
+    static void __gl_meshDeleteMeshZap(final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+        final jogamp.opengl.glu.tessellator.GLUface fHead = mesh.fHead;
 
         while (fHead.next != fHead) {
             __gl_meshZapFace(fHead.next);
@@ -656,7 +658,7 @@ class Mesh {
 
 /* __gl_meshDeleteMesh( mesh ) will free all storage for any valid mesh.
  */
-    public static void __gl_meshDeleteMesh(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+    public static void __gl_meshDeleteMesh(final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
         jogamp.opengl.glu.tessellator.GLUface f, fNext;
         jogamp.opengl.glu.tessellator.GLUvertex v, vNext;
         jogamp.opengl.glu.tessellator.GLUhalfEdge e, eNext;
@@ -677,10 +679,10 @@ class Mesh {
 
 /* __gl_meshCheckMesh( mesh ) checks a mesh for self-consistency.
  */
-    public static void __gl_meshCheckMesh(jogamp.opengl.glu.tessellator.GLUmesh mesh) {
-        jogamp.opengl.glu.tessellator.GLUface fHead = mesh.fHead;
-        jogamp.opengl.glu.tessellator.GLUvertex vHead = mesh.vHead;
-        jogamp.opengl.glu.tessellator.GLUhalfEdge eHead = mesh.eHead;
+    public static void __gl_meshCheckMesh(final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+        final jogamp.opengl.glu.tessellator.GLUface fHead = mesh.fHead;
+        final jogamp.opengl.glu.tessellator.GLUvertex vHead = mesh.vHead;
+        final jogamp.opengl.glu.tessellator.GLUhalfEdge eHead = mesh.eHead;
         jogamp.opengl.glu.tessellator.GLUface f, fPrev;
         jogamp.opengl.glu.tessellator.GLUvertex v, vPrev;
         jogamp.opengl.glu.tessellator.GLUhalfEdge e, ePrev;
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java
index 196e6cf..44668a9 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Normal.java
@@ -83,11 +83,11 @@ class Normal {
         }
     }
 
-    private static double Dot(double[] u, double[] v) {
+    private static double Dot(final double[] u, final double[] v) {
         return (u[0] * v[0] + u[1] * v[1] + u[2] * v[2]);
     }
 
-    static void Normalize(double[] v) {
+    static void Normalize(final double[] v) {
         double len = v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
 
         assert (len > 0);
@@ -97,7 +97,7 @@ class Normal {
         v[2] /= len;
     }
 
-    static int LongAxis(double[] v) {
+    static int LongAxis(final double[] v) {
         int i = 0;
 
         if (Math.abs(v[1]) > Math.abs(v[0])) {
@@ -109,12 +109,12 @@ class Normal {
         return i;
     }
 
-    static void ComputeNormal(GLUtessellatorImpl tess, double[] norm) {
+    static void ComputeNormal(final GLUtessellatorImpl tess, final double[] norm) {
         jogamp.opengl.glu.tessellator.GLUvertex v, v1, v2;
         double c, tLen2, maxLen2;
         double[] maxVal, minVal, d1, d2, tNorm;
         jogamp.opengl.glu.tessellator.GLUvertex[] maxVert, minVert;
-        jogamp.opengl.glu.tessellator.GLUvertex vHead = tess.mesh.vHead;
+        final jogamp.opengl.glu.tessellator.GLUvertex vHead = tess.mesh.vHead;
         int i;
 
         maxVal = new double[3];
@@ -192,10 +192,12 @@ class Normal {
         }
     }
 
-    static void CheckOrientation(GLUtessellatorImpl tess) {
+    static void CheckOrientation(final GLUtessellatorImpl tess) {
         double area;
-        jogamp.opengl.glu.tessellator.GLUface f, fHead = tess.mesh.fHead;
-        jogamp.opengl.glu.tessellator.GLUvertex v, vHead = tess.mesh.vHead;
+        jogamp.opengl.glu.tessellator.GLUface f;
+        final jogamp.opengl.glu.tessellator.GLUface fHead = tess.mesh.fHead;
+        jogamp.opengl.glu.tessellator.GLUvertex v;
+        final jogamp.opengl.glu.tessellator.GLUvertex vHead = tess.mesh.vHead;
         jogamp.opengl.glu.tessellator.GLUhalfEdge e;
 
 /* When we compute the normal automatically, we choose the orientation
@@ -224,10 +226,11 @@ class Normal {
 /* Determine the polygon normal and project vertices onto the plane
  * of the polygon.
  */
-    public static void __gl_projectPolygon(GLUtessellatorImpl tess) {
-        jogamp.opengl.glu.tessellator.GLUvertex v, vHead = tess.mesh.vHead;
+    public static void __gl_projectPolygon(final GLUtessellatorImpl tess) {
+        jogamp.opengl.glu.tessellator.GLUvertex v;
+        final jogamp.opengl.glu.tessellator.GLUvertex vHead = tess.mesh.vHead;
         double w;
-        double[] norm = new double[3];
+        final double[] norm = new double[3];
         double[] sUnit, tUnit;
         int i;
         boolean computedNormal = false;
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java
index 25405ad..1f9b9e5 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQ.java
@@ -75,11 +75,11 @@ abstract class PriorityQ {
 //    #else
 /* Violates modularity, but a little faster */
 //    #include "geom.h"
-    public static boolean LEQ(Leq leq, Object x, Object y) {
+    public static boolean LEQ(final Leq leq, final Object x, final Object y) {
         return jogamp.opengl.glu.tessellator.Geom.VertLeq((jogamp.opengl.glu.tessellator.GLUvertex) x, (jogamp.opengl.glu.tessellator.GLUvertex) y);
     }
 
-    static PriorityQ pqNewPriorityQ(Leq leq) {
+    static PriorityQ pqNewPriorityQ(final Leq leq) {
         return new PriorityQSort(leq);
     }
 
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
index 1ac0fd4..fa29db8 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQHeap.java
@@ -61,7 +61,7 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
     jogamp.opengl.glu.tessellator.PriorityQ.Leq leq;
 
 /* really __gl_pqHeapNewPriorityQ */
-    public PriorityQHeap(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq) {
+    public PriorityQHeap(final jogamp.opengl.glu.tessellator.PriorityQ.Leq leq) {
         size = 0;
         max = jogamp.opengl.glu.tessellator.PriorityQ.INIT_SIZE;
         nodes = new jogamp.opengl.glu.tessellator.PriorityQ.PQnode[jogamp.opengl.glu.tessellator.PriorityQ.INIT_SIZE + 1];
@@ -88,8 +88,8 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
     }
 
     void FloatDown(int curr) {
-        jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
-        jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+        final jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+        final jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
         int hCurr, hChild;
         int child;
 
@@ -117,8 +117,8 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
 
 
     void FloatUp(int curr) {
-        jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
-        jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+        final jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+        final jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
         int hCurr, hParent;
         int parent;
 
@@ -155,40 +155,42 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
 /* really __gl_pqHeapInsert */
 /* returns LONG_MAX iff out of memory */
     @Override
-    int pqInsert(Object keyNew) {
+    int pqInsert(final Object keyNew) {
         int curr;
         int free;
 
         curr = ++size;
         if ((curr * 2) > max) {
-            jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] saveNodes = nodes;
-            jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] saveHandles = handles;
+            final jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] saveNodes = nodes;
+            final jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] saveHandles = handles;
 
             /* If the heap overflows, double its size. */
             max <<= 1;
 //            pq->nodes = (PQnode *)memRealloc( pq->nodes, (size_t) ((pq->max + 1) * sizeof( pq->nodes[0] )));
-            PriorityQ.PQnode[] pqNodes = new PriorityQ.PQnode[max + 1];
+            final PriorityQ.PQnode[] pqNodes = new PriorityQ.PQnode[max + 1];
             System.arraycopy( nodes, 0, pqNodes, 0, nodes.length );
             for (int i = nodes.length; i < pqNodes.length; i++) {
                 pqNodes[i] = new PQnode();
             }
             nodes = pqNodes;
+            /** Cannot be null
             if (nodes == null) {
-                nodes = saveNodes;    /* restore ptr to free upon return */
+                nodes = saveNodes;    // restore ptr to free upon return
                 return Integer.MAX_VALUE;
-            }
+            } */
 
 //            pq->handles = (PQhandleElem *)memRealloc( pq->handles,(size_t)((pq->max + 1) * sizeof( pq->handles[0] )));
-            PriorityQ.PQhandleElem[] pqHandles = new PriorityQ.PQhandleElem[max + 1];
+            final PriorityQ.PQhandleElem[] pqHandles = new PriorityQ.PQhandleElem[max + 1];
             System.arraycopy( handles, 0, pqHandles, 0, handles.length );
             for (int i = handles.length; i < pqHandles.length; i++) {
                 pqHandles[i] = new PQhandleElem();
             }
             handles = pqHandles;
+            /** cannot be null
             if (handles == null) {
-                handles = saveHandles; /* restore ptr to free upon return */
+                handles = saveHandles; // restore ptr to free upon return
                 return Integer.MAX_VALUE;
-            }
+            } */
         }
 
         if (freeList == 0) {
@@ -212,10 +214,10 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
 /* really __gl_pqHeapExtractMin */
     @Override
     Object pqExtractMin() {
-        jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
-        jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
-        int hMin = n[1].handle;
-        Object min = h[hMin].key;
+        final jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+        final jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+        final int hMin = n[1].handle;
+        final Object min = h[hMin].key;
 
         if (size > 0) {
             n[1].handle = n[size].handle;
@@ -234,9 +236,9 @@ class PriorityQHeap extends jogamp.opengl.glu.tessellator.PriorityQ {
 
 /* really __gl_pqHeapDelete */
     @Override
-    void pqDelete(int hCurr) {
-        jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
-        jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
+    void pqDelete(final int hCurr) {
+        final jogamp.opengl.glu.tessellator.PriorityQ.PQnode[] n = nodes;
+        final jogamp.opengl.glu.tessellator.PriorityQ.PQhandleElem[] h = handles;
         int curr;
 
         assert (hCurr >= 1 && hCurr <= max && h[hCurr].key != null);
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
index cf54b15..d88f584 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/PriorityQSort.java
@@ -59,7 +59,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
     boolean initialized;
     jogamp.opengl.glu.tessellator.PriorityQ.Leq leq;
 
-    public PriorityQSort(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq) {
+    public PriorityQSort(final jogamp.opengl.glu.tessellator.PriorityQ.Leq leq) {
         heap = new jogamp.opengl.glu.tessellator.PriorityQHeap(leq);
 
         keys = new Object[jogamp.opengl.glu.tessellator.PriorityQ.INIT_SIZE];
@@ -78,17 +78,17 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
         keys = null;
     }
 
-    private static boolean LT(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq, Object x, Object y) {
-        return (!jogamp.opengl.glu.tessellator.PriorityQHeap.LEQ(leq, y, x));
+    private static boolean LT(final jogamp.opengl.glu.tessellator.PriorityQ.Leq leq, final Object x, final Object y) {
+        return (!PriorityQ.LEQ(leq, y, x));
     }
 
-    private static boolean GT(jogamp.opengl.glu.tessellator.PriorityQ.Leq leq, Object x, Object y) {
-        return (!jogamp.opengl.glu.tessellator.PriorityQHeap.LEQ(leq, x, y));
+    private static boolean GT(final jogamp.opengl.glu.tessellator.PriorityQ.Leq leq, final Object x, final Object y) {
+        return (!PriorityQ.LEQ(leq, x, y));
     }
 
-    private static void Swap(int[] array, int a, int b) {
+    private static void Swap(final int[] array, final int a, final int b) {
         if (true) {
-            int tmp = array[a];
+            final int tmp = array[a];
             array[a] = array[b];
             array[b] = tmp;
         } else {
@@ -105,7 +105,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
     boolean pqInit() {
         int p, r, i, j;
         int piv;
-        Stack[] stack = new Stack[50];
+        final Stack[] stack = new Stack[50];
         for (int k = 0; k < stack.length; k++) {
             stack[k] = new Stack();
         }
@@ -194,7 +194,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
 /* really __gl_pqSortInsert */
 /* returns LONG_MAX iff out of memory */
     @Override
-    int pqInsert(Object keyNew) {
+    int pqInsert(final Object keyNew) {
         int curr;
 
         if (initialized) {
@@ -202,18 +202,19 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
         }
         curr = size;
         if (++size >= max) {
-            Object[] saveKey = keys;
+            // final Object[] saveKey = keys;
 
             /* If the heap overflows, double its size. */
             max <<= 1;
 //            pq->keys = (PQHeapKey *)memRealloc( pq->keys,(size_t)(pq->max * sizeof( pq->keys[0] )));
-            Object[] pqKeys = new Object[max];
+            final Object[] pqKeys = new Object[max];
             System.arraycopy( keys, 0, pqKeys, 0, keys.length );
             keys = pqKeys;
+            /** Cannot be null
             if (keys == null) {
-                keys = saveKey;    /* restore ptr to free upon return */
+                keys = saveKey;    // restore ptr to free upon return
                 return Integer.MAX_VALUE;
-            }
+            } */
         }
         assert curr != Integer.MAX_VALUE;
         keys[curr] = keyNew;
@@ -254,7 +255,7 @@ class PriorityQSort extends jogamp.opengl.glu.tessellator.PriorityQ {
         sortMin = keys[order[size - 1]];
         if (!heap.pqIsEmpty()) {
             heapMin = heap.pqMinimum();
-            if (jogamp.opengl.glu.tessellator.PriorityQHeap.LEQ(leq, heapMin, sortMin)) {
+            if (PriorityQ.LEQ(leq, heapMin, sortMin)) {
                 return heapMin;
             }
         }
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
index a2e9735..6325de8 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Render.java
@@ -73,7 +73,7 @@ class Render {
         public FaceCount() {
         }
 
-        public FaceCount(long size, jogamp.opengl.glu.tessellator.GLUhalfEdge eStart, renderCallBack render) {
+        public FaceCount(final long size, final jogamp.opengl.glu.tessellator.GLUhalfEdge eStart, final renderCallBack render) {
             this.size = size;
             this.eStart = eStart;
             this.render = render;
@@ -97,7 +97,7 @@ class Render {
  *
  * The rendering output is provided as callbacks (see the api).
  */
-    public static void __gl_renderMesh(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+    public static void __gl_renderMesh(final GLUtessellatorImpl tess, final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
         jogamp.opengl.glu.tessellator.GLUface f;
 
         /* Make a list of separate triangles so we can render them all at once */
@@ -124,7 +124,7 @@ class Render {
     }
 
 
-    static void RenderMaximumFaceGroup(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUface fOrig) {
+    static void RenderMaximumFaceGroup(final GLUtessellatorImpl tess, final jogamp.opengl.glu.tessellator.GLUface fOrig) {
         /* We want to find the largest triangle fan or strip of unmarked faces
          * which includes the given face fOrig.  There are 3 possible fans
          * passing through fOrig (one centered at each vertex), and 3 possible
@@ -132,7 +132,7 @@ class Render {
          * is to try all of these, and take the primitive which uses the most
          * triangles (a greedy approach).
          */
-        jogamp.opengl.glu.tessellator.GLUhalfEdge e = fOrig.anEdge;
+        final jogamp.opengl.glu.tessellator.GLUhalfEdge e = fOrig.anEdge;
         FaceCount max = new FaceCount();
         FaceCount newFace = new FaceCount();
 
@@ -178,11 +178,11 @@ class Render {
  * more complicated, and we need a general tracking method like the
  * one here.
  */
-    private static boolean Marked(jogamp.opengl.glu.tessellator.GLUface f) {
+    private static boolean Marked(final jogamp.opengl.glu.tessellator.GLUface f) {
         return !f.inside || f.marked;
     }
 
-    private static GLUface AddToTrail(jogamp.opengl.glu.tessellator.GLUface f, jogamp.opengl.glu.tessellator.GLUface t) {
+    private static GLUface AddToTrail(final jogamp.opengl.glu.tessellator.GLUface f, final jogamp.opengl.glu.tessellator.GLUface t) {
         f.trail = t;
         f.marked = true;
         return f;
@@ -199,12 +199,12 @@ class Render {
         }
     }
 
-    static FaceCount MaximumFan(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig) {
+    static FaceCount MaximumFan(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig) {
         /* eOrig.Lface is the face we want to render.  We want to find the size
          * of a maximal fan around eOrig.Org.  To do this we just walk around
          * the origin vertex as far as possible in both directions.
          */
-        FaceCount newFace = new FaceCount(0, null, renderFan);
+        final FaceCount newFace = new FaceCount(0, null, renderFan);
         jogamp.opengl.glu.tessellator.GLUface trail = null;
         jogamp.opengl.glu.tessellator.GLUhalfEdge e;
 
@@ -223,11 +223,11 @@ class Render {
     }
 
 
-    private static boolean IsEven(long n) {
+    private static boolean IsEven(final long n) {
         return (n & 0x1L) == 0;
     }
 
-    static FaceCount MaximumStrip(jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig) {
+    static FaceCount MaximumStrip(final jogamp.opengl.glu.tessellator.GLUhalfEdge eOrig) {
         /* Here we are looking for a maximal strip that contains the vertices
          * eOrig.Org, eOrig.Dst, eOrig.Lnext.Dst (in that order or the
          * reverse, such that all triangles are oriented CCW).
@@ -238,7 +238,7 @@ class Render {
          * We walk the strip starting on a side with an even number of triangles;
          * if both side have an odd number, we are forced to shorten one side.
          */
-        FaceCount newFace = new FaceCount(0, null, renderStrip);
+        final FaceCount newFace = new FaceCount(0, null, renderStrip);
         long headSize = 0, tailSize = 0;
         jogamp.opengl.glu.tessellator.GLUface trail = null;
         jogamp.opengl.glu.tessellator.GLUhalfEdge e, eTail, eHead;
@@ -280,7 +280,7 @@ class Render {
 
     private static class RenderTriangle implements renderCallBack {
         @Override
-        public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
+        public void render(final GLUtessellatorImpl tess, final jogamp.opengl.glu.tessellator.GLUhalfEdge e, final long size) {
             /* Just add the triangle to a triangle list, so we can render all
              * the separate triangles at once.
              */
@@ -290,7 +290,7 @@ class Render {
     }
 
 
-    static void RenderLonelyTriangles(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUface f) {
+    static void RenderLonelyTriangles(final GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUface f) {
         /* Now we render all the separate triangles which could not be
          * grouped into a triangle fan or strip.
          */
@@ -325,7 +325,7 @@ class Render {
 
     private static class RenderFan implements renderCallBack {
         @Override
-        public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
+        public void render(final GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
             /* Render as many CCW triangles as possible in a fan starting from
              * edge "e".  The fan *should* contain exactly "size" triangles
              * (otherwise we've goofed up somewhere).
@@ -348,7 +348,7 @@ class Render {
 
     private static class RenderStrip implements renderCallBack {
         @Override
-        public void render(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
+        public void render(final GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUhalfEdge e, long size) {
             /* Render as many CCW triangles as possible in a strip starting from
              * edge "e".  The strip *should* contain exactly "size" triangles
              * (otherwise we've goofed up somewhere).
@@ -381,7 +381,7 @@ class Render {
  * contour for each face marked "inside".  The rendering output is
  * provided as callbacks (see the api).
  */
-    public static void __gl_renderBoundary(GLUtessellatorImpl tess, jogamp.opengl.glu.tessellator.GLUmesh mesh) {
+    public static void __gl_renderBoundary(final GLUtessellatorImpl tess, final jogamp.opengl.glu.tessellator.GLUmesh mesh) {
         jogamp.opengl.glu.tessellator.GLUface f;
         jogamp.opengl.glu.tessellator.GLUhalfEdge e;
 
@@ -403,7 +403,7 @@ class Render {
 
     private static final int SIGN_INCONSISTENT = 2;
 
-    static int ComputeNormal(GLUtessellatorImpl tess, double[] norm, boolean check)
+    static int ComputeNormal(final GLUtessellatorImpl tess, final double[] norm, final boolean check)
 /*
  * If check==false, we compute the polygon normal and place it in norm[].
  * If check==true, we check that each triangle in the fan from v0 has a
@@ -412,13 +412,13 @@ class Render {
  * are degenerate return 0; otherwise (no consistent orientation) return
  * SIGN_INCONSISTENT.
  */ {
-        jogamp.opengl.glu.tessellator.CachedVertex[] v = tess.cache;
+        final jogamp.opengl.glu.tessellator.CachedVertex[] v = tess.cache;
 //            CachedVertex vn = v0 + tess.cacheCount;
-        int vn = tess.cacheCount;
+        final int vn = tess.cacheCount;
 //            CachedVertex vc;
         int vc;
         double dot, xc, yc, zc, xp, yp, zp;
-        double[] n = new double[3];
+        final double[] n = new double[3];
         int sign = 0;
 
         /* Find the polygon normal.  It is important to get a reasonable
@@ -490,13 +490,13 @@ class Render {
  * Returns true if the polygon was successfully rendered.  The rendering
  * output is provided as callbacks (see the api).
  */
-    public static boolean __gl_renderCache(GLUtessellatorImpl tess) {
-        jogamp.opengl.glu.tessellator.CachedVertex[] v = tess.cache;
+    public static boolean __gl_renderCache(final GLUtessellatorImpl tess) {
+        final jogamp.opengl.glu.tessellator.CachedVertex[] v = tess.cache;
 //            CachedVertex vn = v0 + tess.cacheCount;
-        int vn = tess.cacheCount;
+        final int vn = tess.cacheCount;
 //            CachedVertex vc;
         int vc;
-        double[] norm = new double[3];
+        final double[] norm = new double[3];
         int sign;
 
         if (tess.cacheCount < 3) {
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
index d2c0db6..b6c6005 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/Sweep.java
@@ -62,7 +62,7 @@ class Sweep {
 //    #ifdef FOR_TRITE_TEST_PROGRAM
 //    extern void DebugEvent( GLUtessellator *tess );
 //    #else
-    private static void DebugEvent(GLUtessellatorImpl tess) {
+    private static void DebugEvent(final GLUtessellatorImpl tess) {
 
     }
 //    #endif
@@ -100,21 +100,21 @@ class Sweep {
 /* When we merge two edges into one, we need to compute the combined
  * winding of the new edge.
  */
-    private static void AddWinding(GLUhalfEdge eDst, GLUhalfEdge eSrc) {
+    private static void AddWinding(final GLUhalfEdge eDst, final GLUhalfEdge eSrc) {
         eDst.winding += eSrc.winding;
         eDst.Sym.winding += eSrc.Sym.winding;
     }
 
 
-    private static ActiveRegion RegionBelow(ActiveRegion r) {
+    private static ActiveRegion RegionBelow(final ActiveRegion r) {
         return ((ActiveRegion) Dict.dictKey(Dict.dictPred(r.nodeUp)));
     }
 
-    private static ActiveRegion RegionAbove(ActiveRegion r) {
+    private static ActiveRegion RegionAbove(final ActiveRegion r) {
         return ((ActiveRegion) Dict.dictKey(Dict.dictSucc(r.nodeUp)));
     }
 
-    static boolean EdgeLeq(GLUtessellatorImpl tess, ActiveRegion reg1, ActiveRegion reg2)
+    static boolean EdgeLeq(final GLUtessellatorImpl tess, final ActiveRegion reg1, final ActiveRegion reg2)
 /*
  * Both edges must be directed from right to left (this is the canonical
  * direction for the upper edge of each region).
@@ -126,7 +126,7 @@ class Sweep {
  * Special case: if both edge destinations are at the sweep event,
  * we sort the edges by slope (they would otherwise compare equally).
  */ {
-        GLUvertex event = tess.event;
+        final GLUvertex event = tess.event;
         GLUhalfEdge e1, e2;
         double t1, t2;
 
@@ -156,7 +156,7 @@ class Sweep {
     }
 
 
-    static void DeleteRegion(GLUtessellatorImpl tess, ActiveRegion reg) {
+    static void DeleteRegion(final GLUtessellatorImpl tess, final ActiveRegion reg) {
         if (reg.fixUpperEdge) {
             /* It was created with zero winding number, so it better be
              * deleted with zero winding number (ie. it better not get merged
@@ -169,7 +169,7 @@ class Sweep {
     }
 
 
-    static boolean FixUpperEdge(ActiveRegion reg, GLUhalfEdge newEdge)
+    static boolean FixUpperEdge(final ActiveRegion reg, final GLUhalfEdge newEdge)
 /*
  * Replace an upper edge which needs fixing (see ConnectRightVertex).
  */ {
@@ -183,7 +183,7 @@ class Sweep {
     }
 
     static ActiveRegion TopLeftRegion(ActiveRegion reg) {
-        GLUvertex org = reg.eUp.Org;
+        final GLUvertex org = reg.eUp.Org;
         GLUhalfEdge e;
 
         /* Find the region above the uppermost edge with the same origin */
@@ -204,7 +204,7 @@ class Sweep {
     }
 
     static ActiveRegion TopRightRegion(ActiveRegion reg) {
-        GLUvertex dst = reg.eUp.Sym.Org;
+        final GLUvertex dst = reg.eUp.Sym.Org;
 
         /* Find the region above the uppermost edge with the same destination */
         do {
@@ -213,16 +213,16 @@ class Sweep {
         return reg;
     }
 
-    static ActiveRegion AddRegionBelow(GLUtessellatorImpl tess,
-                                       ActiveRegion regAbove,
-                                       GLUhalfEdge eNewUp)
+    static ActiveRegion AddRegionBelow(final GLUtessellatorImpl tess,
+                                       final ActiveRegion regAbove,
+                                       final GLUhalfEdge eNewUp)
 /*
  * Add a new active region to the sweep line, *somewhere* below "regAbove"
  * (according to where the new edge belongs in the sweep-line dictionary).
  * The upper edge of the new region will be "eNewUp".
  * Winding number and "inside" flag are not updated.
  */ {
-        ActiveRegion regNew = new ActiveRegion();
+        final ActiveRegion regNew = new ActiveRegion();
         if (regNew == null) throw new RuntimeException();
 
         regNew.eUp = eNewUp;
@@ -237,7 +237,7 @@ class Sweep {
         return regNew;
     }
 
-    static boolean IsWindingInside(GLUtessellatorImpl tess, int n) {
+    static boolean IsWindingInside(final GLUtessellatorImpl tess, final int n) {
         switch (tess.windingRule) {
             case GLU.GLU_TESS_WINDING_ODD:
                 return (n & 1) != 0;
@@ -257,13 +257,13 @@ class Sweep {
     }
 
 
-    static void ComputeWinding(GLUtessellatorImpl tess, ActiveRegion reg) {
+    static void ComputeWinding(final GLUtessellatorImpl tess, final ActiveRegion reg) {
         reg.windingNumber = RegionAbove(reg).windingNumber + reg.eUp.winding;
         reg.inside = IsWindingInside(tess, reg.windingNumber);
     }
 
 
-    static void FinishRegion(GLUtessellatorImpl tess, ActiveRegion reg)
+    static void FinishRegion(final GLUtessellatorImpl tess, final ActiveRegion reg)
 /*
  * Delete a region from the sweep line.  This happens when the upper
  * and lower chains of a region meet (at a vertex on the sweep line).
@@ -271,8 +271,8 @@ class Sweep {
  * not do this before -- since the structure of the mesh is always
  * changing, this face may not have even existed until now).
  */ {
-        GLUhalfEdge e = reg.eUp;
-        GLUface f = e.Lface;
+        final GLUhalfEdge e = reg.eUp;
+        final GLUface f = e.Lface;
 
         f.inside = reg.inside;
         f.anEdge = e;   /* optimization for __gl_meshTessellateMonoRegion() */
@@ -280,8 +280,8 @@ class Sweep {
     }
 
 
-    static GLUhalfEdge FinishLeftRegions(GLUtessellatorImpl tess,
-                                         ActiveRegion regFirst, ActiveRegion regLast)
+    static GLUhalfEdge FinishLeftRegions(final GLUtessellatorImpl tess,
+                                         final ActiveRegion regFirst, final ActiveRegion regLast)
 /*
  * We are given a vertex with one or more left-going edges.  All affected
  * edges should be in the edge dictionary.  Starting at regFirst.eUp,
@@ -335,9 +335,9 @@ class Sweep {
     }
 
 
-    static void AddRightEdges(GLUtessellatorImpl tess, ActiveRegion regUp,
-                              GLUhalfEdge eFirst, GLUhalfEdge eLast, GLUhalfEdge eTopLeft,
-                              boolean cleanUp)
+    static void AddRightEdges(final GLUtessellatorImpl tess, final ActiveRegion regUp,
+                              final GLUhalfEdge eFirst, final GLUhalfEdge eLast, GLUhalfEdge eTopLeft,
+                              final boolean cleanUp)
 /*
  * Purpose: insert right-going edges into the edge dictionary, and update
  * winding numbers and mesh connectivity appropriately.  All right-going
@@ -406,16 +406,16 @@ class Sweep {
     }
 
 
-    static void CallCombine(GLUtessellatorImpl tess, GLUvertex isect,
-                            Object[] data, float[] weights, boolean needed) {
-        double[] coords = new double[3];
+    static void CallCombine(final GLUtessellatorImpl tess, final GLUvertex isect,
+                            final Object[] data, final float[] weights, final boolean needed) {
+        final double[] coords = new double[3];
 
         /* Copy coord data in case the callback changes it. */
         coords[0] = isect.coords[0];
         coords[1] = isect.coords[1];
         coords[2] = isect.coords[2];
 
-        Object[] outData = new Object[1];
+        final Object[] outData = new Object[1];
         tess.callCombineOrCombineData(coords, data, weights, outData);
         isect.data = outData[0];
         if (isect.data == null) {
@@ -432,14 +432,14 @@ class Sweep {
         }
     }
 
-    static void SpliceMergeVertices(GLUtessellatorImpl tess, GLUhalfEdge e1,
-                                    GLUhalfEdge e2)
+    static void SpliceMergeVertices(final GLUtessellatorImpl tess, final GLUhalfEdge e1,
+                                    final GLUhalfEdge e2)
 /*
  * Two vertices with idential coordinates are combined into one.
  * e1.Org is kept, while e2.Org is discarded.
  */ {
-        Object[] data = new Object[4];
-        float[] weights = new float[]{0.5f, 0.5f, 0.0f, 0.0f};
+        final Object[] data = new Object[4];
+        final float[] weights = new float[]{0.5f, 0.5f, 0.0f, 0.0f};
 
         data[0] = e1.Org.data;
         data[1] = e2.Org.data;
@@ -447,8 +447,8 @@ class Sweep {
         if (!Mesh.__gl_meshSplice(e1, e2)) throw new RuntimeException();
     }
 
-    static void VertexWeights(GLUvertex isect, GLUvertex org, GLUvertex dst,
-                              float[] weights)
+    static void VertexWeights(final GLUvertex isect, final GLUvertex org, final GLUvertex dst,
+                              final float[] weights)
 /*
  * Find some weights which describe how the intersection vertex is
  * a linear combination of "org" and "dest".  Each of the two edges
@@ -456,8 +456,8 @@ class Sweep {
  * splits the weight between its org and dst according to the
  * relative distance to "isect".
  */ {
-        double t1 = Geom.VertL1dist(org, isect);
-        double t2 = Geom.VertL1dist(dst, isect);
+        final double t1 = Geom.VertL1dist(org, isect);
+        final double t2 = Geom.VertL1dist(dst, isect);
 
         weights[0] = (float) (0.5 * t2 / (t1 + t2));
         weights[1] = (float) (0.5 * t1 / (t1 + t2));
@@ -467,18 +467,18 @@ class Sweep {
     }
 
 
-    static void GetIntersectData(GLUtessellatorImpl tess, GLUvertex isect,
-                                 GLUvertex orgUp, GLUvertex dstUp,
-                                 GLUvertex orgLo, GLUvertex dstLo)
+    static void GetIntersectData(final GLUtessellatorImpl tess, final GLUvertex isect,
+                                 final GLUvertex orgUp, final GLUvertex dstUp,
+                                 final GLUvertex orgLo, final GLUvertex dstLo)
 /*
  * We've computed a new intersection point, now we need a "data" pointer
  * from the user so that we can refer to this new vertex in the
  * rendering callbacks.
  */ {
-        Object[] data = new Object[4];
-        float[] weights = new float[4];
-        float[] weights1 = new float[2];
-        float[] weights2 = new float[2];
+        final Object[] data = new Object[4];
+        final float[] weights = new float[4];
+        final float[] weights1 = new float[2];
+        final float[] weights2 = new float[2];
 
         data[0] = orgUp.data;
         data[1] = dstUp.data;
@@ -494,7 +494,7 @@ class Sweep {
         CallCombine(tess, isect, data, weights, true);
     }
 
-    static boolean CheckForRightSplice(GLUtessellatorImpl tess, ActiveRegion regUp)
+    static boolean CheckForRightSplice(final GLUtessellatorImpl tess, final ActiveRegion regUp)
 /*
  * Check the upper and lower edge of "regUp", to make sure that the
  * eUp.Org is above eLo, or eLo.Org is below eUp (depending on which
@@ -520,9 +520,9 @@ class Sweep {
  * This is a guaranteed solution, no matter how degenerate things get.
  * Basically this is a combinatorial solution to a numerical problem.
  */ {
-        ActiveRegion regLo = RegionBelow(regUp);
-        GLUhalfEdge eUp = regUp.eUp;
-        GLUhalfEdge eLo = regLo.eUp;
+        final ActiveRegion regLo = RegionBelow(regUp);
+        final GLUhalfEdge eUp = regUp.eUp;
+        final GLUhalfEdge eLo = regLo.eUp;
 
         if (Geom.VertLeq(eUp.Org, eLo.Org)) {
             if (Geom.EdgeSign(eLo.Sym.Org, eUp.Org, eLo.Org) > 0) return false;
@@ -550,7 +550,7 @@ class Sweep {
         return true;
     }
 
-    static boolean CheckForLeftSplice(GLUtessellatorImpl tess, ActiveRegion regUp)
+    static boolean CheckForLeftSplice(final GLUtessellatorImpl tess, final ActiveRegion regUp)
 /*
  * Check the upper and lower edge of "regUp", to make sure that the
  * eUp.Sym.Org is above eLo, or eLo.Sym.Org is below eUp (depending on which
@@ -569,9 +569,9 @@ class Sweep {
  * We fix the problem by just splicing the offending vertex into the
  * other edge.
  */ {
-        ActiveRegion regLo = RegionBelow(regUp);
-        GLUhalfEdge eUp = regUp.eUp;
-        GLUhalfEdge eLo = regLo.eUp;
+        final ActiveRegion regLo = RegionBelow(regUp);
+        final GLUhalfEdge eUp = regUp.eUp;
+        final GLUhalfEdge eLo = regLo.eUp;
         GLUhalfEdge e;
 
         assert (!Geom.VertEq(eUp.Sym.Org, eLo.Sym.Org));
@@ -599,7 +599,7 @@ class Sweep {
     }
 
 
-    static boolean CheckForIntersect(GLUtessellatorImpl tess, ActiveRegion regUp)
+    static boolean CheckForIntersect(final GLUtessellatorImpl tess, ActiveRegion regUp)
 /*
  * Check the upper and lower edges of the given region to see if
  * they intersect.  If so, create the intersection and add it
@@ -612,12 +612,12 @@ class Sweep {
         ActiveRegion regLo = RegionBelow(regUp);
         GLUhalfEdge eUp = regUp.eUp;
         GLUhalfEdge eLo = regLo.eUp;
-        GLUvertex orgUp = eUp.Org;
-        GLUvertex orgLo = eLo.Org;
-        GLUvertex dstUp = eUp.Sym.Org;
-        GLUvertex dstLo = eLo.Sym.Org;
+        final GLUvertex orgUp = eUp.Org;
+        final GLUvertex orgLo = eLo.Org;
+        final GLUvertex dstUp = eUp.Sym.Org;
+        final GLUvertex dstLo = eLo.Sym.Org;
         double tMinUp, tMaxLo;
-        GLUvertex isect = new GLUvertex();
+        final GLUvertex isect = new GLUvertex();
         GLUvertex orgMin;
         GLUhalfEdge e;
 
@@ -752,7 +752,7 @@ class Sweep {
         return false;
     }
 
-    static void WalkDirtyRegions(GLUtessellatorImpl tess, ActiveRegion regUp)
+    static void WalkDirtyRegions(final GLUtessellatorImpl tess, ActiveRegion regUp)
 /*
  * When the upper or lower edge of any region changes, the region is
  * marked "dirty".  This routine walks through all the dirty regions
@@ -837,7 +837,7 @@ class Sweep {
     }
 
 
-    static void ConnectRightVertex(GLUtessellatorImpl tess, ActiveRegion regUp,
+    static void ConnectRightVertex(final GLUtessellatorImpl tess, ActiveRegion regUp,
                                    GLUhalfEdge eBottomLeft)
 /*
  * Purpose: connect a "right" vertex vEvent (one where all edges go left)
@@ -872,9 +872,9 @@ class Sweep {
  */ {
         GLUhalfEdge eNew;
         GLUhalfEdge eTopLeft = eBottomLeft.Onext;
-        ActiveRegion regLo = RegionBelow(regUp);
-        GLUhalfEdge eUp = regUp.eUp;
-        GLUhalfEdge eLo = regLo.eUp;
+        final ActiveRegion regLo = RegionBelow(regUp);
+        final GLUhalfEdge eUp = regUp.eUp;
+        final GLUhalfEdge eLo = regLo.eUp;
         boolean degenerate = false;
 
         if (eUp.Sym.Org != eLo.Sym.Org) {
@@ -930,8 +930,8 @@ class Sweep {
  */
     private static final boolean TOLERANCE_NONZERO = false;
 
-    static void ConnectLeftDegenerate(GLUtessellatorImpl tess,
-                                      ActiveRegion regUp, GLUvertex vEvent)
+    static void ConnectLeftDegenerate(final GLUtessellatorImpl tess,
+                                      ActiveRegion regUp, final GLUvertex vEvent)
 /*
  * The event vertex lies exacty on an already-processed edge or vertex.
  * Adding the new vertex involves splicing it into the already-processed
@@ -989,7 +989,7 @@ class Sweep {
     }
 
 
-    static void ConnectLeftVertex(GLUtessellatorImpl tess, GLUvertex vEvent)
+    static void ConnectLeftVertex(final GLUtessellatorImpl tess, final GLUvertex vEvent)
 /*
  * Purpose: connect a "left" vertex (one where both edges go right)
  * to the processed portion of the mesh.  Let R be the active region
@@ -1007,7 +1007,7 @@ class Sweep {
  */ {
         ActiveRegion regUp, regLo, reg;
         GLUhalfEdge eUp, eLo, eNew;
-        ActiveRegion tmp = new ActiveRegion();
+        final ActiveRegion tmp = new ActiveRegion();
 
         /* assert ( vEvent.anEdge.Onext.Onext == vEvent.anEdge ); */
 
@@ -1035,7 +1035,7 @@ class Sweep {
                 eNew = Mesh.__gl_meshConnect(vEvent.anEdge.Sym, eUp.Lnext);
                 if (eNew == null) throw new RuntimeException();
             } else {
-                GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(eLo.Sym.Onext.Sym, vEvent.anEdge);
+                final GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(eLo.Sym.Onext.Sym, vEvent.anEdge);
                 if (tempHalfEdge == null) throw new RuntimeException();
 
                 eNew = tempHalfEdge.Sym;
@@ -1055,7 +1055,7 @@ class Sweep {
     }
 
 
-    static void SweepEvent(GLUtessellatorImpl tess, GLUvertex vEvent)
+    static void SweepEvent(final GLUtessellatorImpl tess, final GLUvertex vEvent)
 /*
  * Does everything necessary when the sweep line crosses a vertex.
  * Updates the mesh and the edge dictionary.
@@ -1114,13 +1114,13 @@ class Sweep {
  */
     private static final double SENTINEL_COORD = (4.0 * GLU.GLU_TESS_MAX_COORD);
 
-    static void AddSentinel(GLUtessellatorImpl tess, double t)
+    static void AddSentinel(final GLUtessellatorImpl tess, final double t)
 /*
  * We add two sentinel edges above and below all other edges,
  * to avoid special cases at the top and bottom.
  */ {
         GLUhalfEdge e;
-        ActiveRegion reg = new ActiveRegion();
+        final ActiveRegion reg = new ActiveRegion();
         if (reg == null) throw new RuntimeException();
 
         e = Mesh.__gl_meshMakeEdge(tess.mesh);
@@ -1151,7 +1151,7 @@ class Sweep {
         /* __gl_dictListNewDict */
         tess.dict = Dict.dictNewDict(tess, new Dict.DictLeq() {
             @Override
-            public boolean leq(Object frame, Object key1, Object key2) {
+            public boolean leq(final Object frame, final Object key1, final Object key2) {
                 return EdgeLeq(tess, (ActiveRegion) key1, (ActiveRegion) key2);
             }
         });
@@ -1162,7 +1162,7 @@ class Sweep {
     }
 
 
-    static void DoneEdgeDict(GLUtessellatorImpl tess) {
+    static void DoneEdgeDict(final GLUtessellatorImpl tess) {
         ActiveRegion reg;
         int fixedEdges = 0;
 
@@ -1185,12 +1185,12 @@ class Sweep {
     }
 
 
-    static void RemoveDegenerateEdges(GLUtessellatorImpl tess)
+    static void RemoveDegenerateEdges(final GLUtessellatorImpl tess)
 /*
  * Remove zero-length edges, and contours with fewer than 3 vertices.
  */ {
         GLUhalfEdge e, eNext, eLnext;
-        GLUhalfEdge eHead = tess.mesh.eHead;
+        final GLUhalfEdge eHead = tess.mesh.eHead;
 
         /*LINTED*/
         for (e = eHead.next; e != eHead; e = eNext) {
@@ -1222,7 +1222,7 @@ class Sweep {
         }
     }
 
-    static boolean InitPriorityQ(GLUtessellatorImpl tess)
+    static boolean InitPriorityQ(final GLUtessellatorImpl tess)
 /*
  * Insert all vertices into the priority queue which determines the
  * order in which vertices cross the sweep line.
@@ -1233,11 +1233,10 @@ class Sweep {
         /* __gl_pqSortNewPriorityQ */
         pq = tess.pq = PriorityQ.pqNewPriorityQ(new PriorityQ.Leq() {
             @Override
-            public boolean leq(Object key1, Object key2) {
+            public boolean leq(final Object key1, final Object key2) {
                 return Geom.VertLeq(((GLUvertex) key1), (GLUvertex) key2);
             }
         });
-        if (pq == null) return false;
 
         vHead = tess.mesh.vHead;
         for (v = vHead.next; v != vHead; v = v.next) {
@@ -1254,12 +1253,12 @@ class Sweep {
     }
 
 
-    static void DonePriorityQ(GLUtessellatorImpl tess) {
+    static void DonePriorityQ(final GLUtessellatorImpl tess) {
         tess.pq.pqDeletePriorityQ(); /* __gl_pqSortDeletePriorityQ */
     }
 
 
-    static boolean RemoveDegenerateFaces(GLUmesh mesh)
+    static boolean RemoveDegenerateFaces(final GLUmesh mesh)
 /*
  * Delete any degenerate faces with only two edges.  WalkDirtyRegions()
  * will catch almost all of these, but it won't catch degenerate faces
@@ -1292,7 +1291,7 @@ class Sweep {
         return true;
     }
 
-    public static boolean __gl_computeInterior(GLUtessellatorImpl tess)
+    public static boolean __gl_computeInterior(final GLUtessellatorImpl tess)
 /*
  * __gl_computeInterior( tess ) computes the planar arrangement specified
  * by the given contours, and further subdivides this arrangement
diff --git a/src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java b/src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java
index 5db543c..63994ba 100644
--- a/src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java
+++ b/src/jogl/classes/jogamp/opengl/glu/tessellator/TessMono.java
@@ -80,7 +80,7 @@ class TessMono {
  * to the fan is a simple orientation test.  By making the fan as large
  * as possible, we restore the invariant (check it yourself).
  */
-    static boolean __gl_meshTessellateMonoRegion(GLUface face, boolean avoidDegenerateTris) {
+    static boolean __gl_meshTessellateMonoRegion(final GLUface face, final boolean avoidDegenerateTris) {
         GLUhalfEdge up, lo;
 
         /* All edges are oriented CCW around the boundary of the region.
@@ -135,7 +135,7 @@ class TessMono {
                  */
                 while (lo.Lnext != up && (Geom.EdgeGoesLeft(lo.Lnext)
                         || Geom.EdgeSign(lo.Org, lo.Sym.Org, lo.Lnext.Sym.Org) <= 0)) {
-                    GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
+                    final GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
                     mustConnect = false;
                     if (tempHalfEdge == null) return false;
                     lo = tempHalfEdge.Sym;
@@ -145,7 +145,7 @@ class TessMono {
                 /* lo.Org is on the left.  We can make CCW triangles from up.Sym.Org. */
                 while (lo.Lnext != up && (Geom.EdgeGoesRight(up.Onext.Sym)
                         || Geom.EdgeSign(up.Sym.Org, up.Org, up.Onext.Sym.Org) >= 0)) {
-                    GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(up, up.Onext.Sym);
+                    final GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(up, up.Onext.Sym);
                     mustConnect = false;
                     if (tempHalfEdge == null) return false;
                     up = tempHalfEdge.Sym;
@@ -159,7 +159,7 @@ class TessMono {
          */
         assert (lo.Lnext != up);
         while (lo.Lnext.Lnext != up) {
-            GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
+            final GLUhalfEdge tempHalfEdge = Mesh.__gl_meshConnect(lo.Lnext, lo);
             if (tempHalfEdge == null) return false;
             lo = tempHalfEdge.Sym;
         }
@@ -172,7 +172,7 @@ class TessMono {
  * the mesh which is marked "inside" the polygon.  Each such region
  * must be monotone.
  */
-    public static boolean __gl_meshTessellateInterior(GLUmesh mesh, boolean avoidDegenerateTris) {
+    public static boolean __gl_meshTessellateInterior(final GLUmesh mesh, final boolean avoidDegenerateTris) {
         GLUface f, next;
 
         /*LINTED*/
@@ -193,7 +193,7 @@ class TessMono {
  * on NULL faces are not allowed, the main purpose is to clean up the
  * mesh so that exterior loops are not represented in the data structure.
  */
-    public static void __gl_meshDiscardExterior(GLUmesh mesh) {
+    public static void __gl_meshDiscardExterior(final GLUmesh mesh) {
         GLUface f, next;
 
         /*LINTED*/
@@ -216,7 +216,7 @@ class TessMono {
  * If keepOnlyBoundary is TRUE, it also deletes all edges which do not
  * separate an interior region from an exterior one.
  */
-    public static boolean __gl_meshSetWindingNumber(GLUmesh mesh, int value, boolean keepOnlyBoundary) {
+    public static boolean __gl_meshSetWindingNumber(final GLUmesh mesh, final int value, final boolean keepOnlyBoundary) {
         GLUhalfEdge e, eNext;
 
         for (e = mesh.eHead.next; e != mesh.eHead; e = eNext) {
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
index 259c706..7066a6d 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLContext.java
@@ -59,6 +59,7 @@ import javax.media.opengl.GLContext;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLProfile;
 import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import jogamp.nativewindow.macosx.OSXUtil;
 import jogamp.opengl.GLContextImpl;
@@ -107,9 +108,9 @@ public class MacOSXCGLContext extends GLContextImpl
     isMavericksOrLater = osvn.compareTo(Platform.OSXVersion.Mavericks) >= 0;
   }
 
-  static boolean isGLProfileSupported(int ctp, int major, int minor) {
-    boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
-    boolean ctCore      = 0 != ( CTX_PROFILE_CORE & ctp ) ;
+  static boolean isGLProfileSupported(final int ctp, final int major, final int minor) {
+    final boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
+    final boolean ctCore      = 0 != ( CTX_PROFILE_CORE & ctp ) ;
 
     // We exclude 3.0, since we would map it's core to GL2. Hence we force mapping 2.1 to GL2
     if( 3 < major || 3 == major && 1 <= minor ) {
@@ -135,7 +136,7 @@ public class MacOSXCGLContext extends GLContextImpl
     }
     return false; // 3.0 && > 3.2
   }
-  static int GLProfile2CGLOGLProfileValue(AbstractGraphicsDevice device, int ctp, int major, int minor) {
+  static int GLProfile2CGLOGLProfileValue(final AbstractGraphicsDevice device, final int ctp, final int major, final int minor) {
     if(!MacOSXCGLContext.isGLProfileSupported(ctp, major, minor)) {
         throw new GLException("OpenGL profile not supported: "+getGLVersion(major, minor, ctp, "@GLProfile2CGLOGLProfileVersion"));
     }
@@ -158,7 +159,7 @@ public class MacOSXCGLContext extends GLContextImpl
 
   private static final String shaderBasename = "texture01_xxx";
 
-  private static ShaderProgram createCALayerShader(GL3ES3 gl) {
+  private static ShaderProgram createCALayerShader(final GL3ES3 gl) {
       // Create & Link the shader program
       final ShaderProgram sp = new ShaderProgram();
       final ShaderCode vp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MacOSXCGLContext.class,
@@ -176,9 +177,9 @@ public class MacOSXCGLContext extends GLContextImpl
 
       // setup mgl_PMVMatrix
       final PMVMatrix pmvMatrix = new PMVMatrix();
-      pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+      pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
       pmvMatrix.glLoadIdentity();
-      pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+      pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
       pmvMatrix.glLoadIdentity();
       final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
       pmvMatrixUniform.setLocation(gl, sp.program());
@@ -203,14 +204,14 @@ public class MacOSXCGLContext extends GLContextImpl
   private long updateHandle = 0;
   private int lastWidth, lastHeight;
 
-  protected MacOSXCGLContext(GLDrawableImpl drawable,
-                   GLContext shareWith) {
+  protected MacOSXCGLContext(final GLDrawableImpl drawable,
+                   final GLContext shareWith) {
     super(drawable, shareWith);
     initOpenGLImpl(getOpenGLMode());
   }
 
   @Override
-  protected void resetStates(boolean isInit) {
+  protected void resetStates(final boolean isInit) {
     // no inner state _cglExt = null;
     cglExtProcAddressTable = null;
     super.resetStates(isInit);
@@ -248,7 +249,7 @@ public class MacOSXCGLContext extends GLContextImpl
   protected Map<String, String> getExtensionNameMap() { return null; }
 
   @Override
-  protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
+  protected long createContextARBImpl(final long share, final boolean direct, final int ctp, final int major, final int minor) {
     if(!isGLProfileSupported(ctp, major, minor)) {
         if(DEBUG) {
             System.err.println(getThreadName() + ": createContextARBImpl: Not supported "+getGLVersion(major, minor, ctp, "@creation on OSX "+Platform.getOSVersionNumber()));
@@ -276,7 +277,7 @@ public class MacOSXCGLContext extends GLContextImpl
   }
 
   @Override
-  protected void destroyContextARBImpl(long _context) {
+  protected void destroyContextARBImpl(final long _context) {
       impl.release(_context);
       impl.destroy(_context);
   }
@@ -364,8 +365,8 @@ public class MacOSXCGLContext extends GLContextImpl
   protected void drawableUpdatedNotify() throws GLException {
     if( drawable.getChosenGLCapabilities().isOnscreen() ) {
         final long _updateHandle = getUpdateHandle();
-        final int w = drawable.getWidth();
-        final int h = drawable.getHeight();
+        final int w = drawable.getSurfaceWidth();
+        final int h = drawable.getSurfaceHeight();
         final boolean updateContext = ( 0!=_updateHandle && CGL.updateContextNeedsUpdate(_updateHandle) ) ||
                                       w != lastWidth || h != lastHeight;
         if(updateContext) {
@@ -380,7 +381,7 @@ public class MacOSXCGLContext extends GLContextImpl
   }
 
   @Override
-  protected void associateDrawable(boolean bound) {
+  protected void associateDrawable(final boolean bound) {
       // context stuff depends on drawable stuff
       if(bound) {
           super.associateDrawable(true);   // 1) init drawable stuff
@@ -399,7 +400,7 @@ public class MacOSXCGLContext extends GLContextImpl
 
 
   @Override
-  protected void copyImpl(GLContext source, int mask) throws GLException {
+  protected void copyImpl(final GLContext source, final int mask) throws GLException {
     if( isNSContext() != ((MacOSXCGLContext)source).isNSContext() ) {
         throw new GLException("Source/Destination OpenGL Context tyoe mismatch: source "+source+", dest: "+this);
     }
@@ -416,18 +417,18 @@ public class MacOSXCGLContext extends GLContextImpl
   }
 
   @Override
-  protected boolean setSwapIntervalImpl(int interval) {
+  protected boolean setSwapIntervalImpl(final int interval) {
     return impl.setSwapInterval(interval);
   }
 
   @Override
-  public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {
+  public final ByteBuffer glAllocateMemoryNV(final int size, final float readFrequency, final float writeFrequency, final float priority) {
     // FIXME: apparently the Apple extension doesn't require a custom memory allocator
     throw new GLException("Not yet implemented");
   }
 
   @Override
-  public final void glFreeMemoryNV(ByteBuffer pointer) {
+  public final void glFreeMemoryNV(final ByteBuffer pointer) {
     // FIXME: apparently the Apple extension doesn't require a custom memory allocator
     throw new GLException("Not yet implemented");
   }
@@ -467,7 +468,7 @@ public class MacOSXCGLContext extends GLContextImpl
   }
 
   // Support for "mode switching" as described in MacOSXCGLDrawable
-  public void setOpenGLMode(GLBackendType mode) {
+  public void setOpenGLMode(final GLBackendType mode) {
       if (mode == openGLMode) {
         return;
       }
@@ -485,7 +486,7 @@ public class MacOSXCGLContext extends GLContextImpl
   }
   public final GLBackendType getOpenGLMode() { return openGLMode; }
 
-  protected void initOpenGLImpl(GLBackendType backend) {
+  protected void initOpenGLImpl(final GLBackendType backend) {
     switch (backend) {
       case NSOPENGL:
         impl = new NSOpenGLImpl();
@@ -500,7 +501,7 @@ public class MacOSXCGLContext extends GLContextImpl
 
   @Override
   public String toString() {
-    StringBuilder sb = new StringBuilder();
+    final StringBuilder sb = new StringBuilder();
     sb.append(getClass().getSimpleName());
     sb.append(" [");
     super.append(sb);
@@ -528,14 +529,14 @@ public class MacOSXCGLContext extends GLContextImpl
 
 
       /** Only returns a valid NSView. If !NSView, return null and mark either pbuffer and FBO. */
-      private long getNSViewHandle(boolean[] isPBuffer, boolean[] isFBO) {
+      private long getNSViewHandle(final boolean[] isPBuffer, final boolean[] isFBO) {
           final long nsViewHandle;
           if(drawable instanceof GLFBODrawableImpl) {
               nsViewHandle = 0;
               isPBuffer[0] = false;
               isFBO[0] = true;
               if(DEBUG) {
-                  System.err.println("NS viewHandle.1: GLFBODrawableImpl drawable: isFBO "+isFBO+", isPBuffer "+isPBuffer+", "+drawable.getClass().getName()+",\n\t"+drawable);
+                  System.err.println("NS viewHandle.1: GLFBODrawableImpl drawable: isFBO "+isFBO[0]+", isPBuffer "+isPBuffer[0]+", "+drawable.getClass().getName()+",\n\t"+drawable);
               }
           } else {
               final long drawableHandle = drawable.getHandle();
@@ -562,7 +563,7 @@ public class MacOSXCGLContext extends GLContextImpl
       }
 
       @Override
-      public long create(long share, int ctp, int major, int minor) {
+      public long create(final long share, final int ctp, final int major, final int minor) {
           long ctx = 0;
           final NativeSurface surface = drawable.getNativeSurface();
           final MacOSXCGLGraphicsConfiguration config = (MacOSXCGLGraphicsConfiguration) surface.getGraphicsConfiguration();
@@ -571,8 +572,8 @@ public class MacOSXCGLContext extends GLContextImpl
           final boolean isPBuffer;
           final boolean isFBO;
           {
-              boolean[] _isPBuffer = { false };
-              boolean[] _isFBO = { false };
+              final boolean[] _isPBuffer = { false };
+              final boolean[] _isFBO = { false };
               nsViewHandle = getNSViewHandle(_isPBuffer, _isFBO);
               isPBuffer = _isPBuffer[0];
               isFBO = _isFBO[0];
@@ -654,7 +655,7 @@ public class MacOSXCGLContext extends GLContextImpl
       }
 
       @Override
-      public boolean destroy(long ctx) {
+      public boolean destroy(final long ctx) {
           if(0!=pixelFormat) {
               CGL.deletePixelFormat(pixelFormat);
               pixelFormat = 0;
@@ -681,14 +682,17 @@ public class MacOSXCGLContext extends GLContextImpl
           final long pbuffer;
           final int texID;
           final boolean isOpaque;
-          final int width;
-          final int height;
+          final int texWidth;
+          final int texHeight;
+          final int winWidth;
+          final int winHeight;
           /** Synchronized by instance's monitor */
           long nsOpenGLLayer;
           /** Synchronized by instance's monitor */
           boolean valid;
 
-          AttachGLLayerCmd(OffscreenLayerSurface ols, long ctx, int shaderProgram, long pfmt, long pbuffer, int texID, boolean isOpaque, int width, int height) {
+          AttachGLLayerCmd(final OffscreenLayerSurface ols, final long ctx, final int shaderProgram, final long pfmt, final long pbuffer, final int texID,
+                           final boolean isOpaque, final int texWidth, final int texHeight, final int winWidth, final int winHeight) {
               this.ols = ols;
               this.ctx = ctx;
               this.shaderProgram = shaderProgram;
@@ -696,14 +700,16 @@ public class MacOSXCGLContext extends GLContextImpl
               this.pbuffer = pbuffer;
               this.texID = texID;
               this.isOpaque = isOpaque;
-              this.width = width;
-              this.height = height;
+              this.texWidth = texWidth;
+              this.texHeight = texHeight;
+              this.winWidth = winWidth;
+              this.winHeight = winHeight;
               this.valid = false;
               this.nsOpenGLLayer = 0;
           }
 
           public final String contentToString() {
-              return "valid "+valid+", size "+width+"x"+height+", ctx "+toHexString(ctx)+", opaque "+isOpaque+", texID "+texID+", pbuffer "+toHexString(pbuffer)+", nsOpenGLLayer "+toHexString(nsOpenGLLayer);
+              return "valid "+valid+", size tex["+texWidth+"x"+texHeight+"], win["+winWidth+"x"+winHeight+"], ctx "+toHexString(ctx)+", opaque "+isOpaque+", texID "+texID+", pbuffer "+toHexString(pbuffer)+", nsOpenGLLayer "+toHexString(nsOpenGLLayer);
           }
 
           @Override
@@ -722,7 +728,8 @@ public class MacOSXCGLContext extends GLContextImpl
                               try {
                                   if( MacOSXCGLContext.this.lock.tryLock( maxwait ) ) {
                                       try {
-                                          nsOpenGLLayer = CGL.createNSOpenGLLayer(ctx, shaderProgram, pfmt, pbuffer, texID, isOpaque, width, height);
+                                          nsOpenGLLayer = CGL.createNSOpenGLLayer(ctx, shaderProgram, pfmt, pbuffer, texID, isOpaque,
+                                                                                  texWidth, texHeight, winWidth, winHeight);
                                           ols.attachSurfaceLayer(nsOpenGLLayer);
                                           final int currentInterval = MacOSXCGLContext.this.getSwapInterval();
                                           final int interval = 0 <= currentInterval ? currentInterval : 1;
@@ -739,7 +746,7 @@ public class MacOSXCGLContext extends GLContextImpl
                                   surfaceLock.unlock();
                               }
                           }
-                      } catch (InterruptedException e) {
+                      } catch (final InterruptedException e) {
                           e.printStackTrace();
                       }
                       if( !valid ) {
@@ -758,7 +765,7 @@ public class MacOSXCGLContext extends GLContextImpl
       class DetachGLLayerCmd implements Runnable {
         final AttachGLLayerCmd cmd;
 
-        DetachGLLayerCmd(AttachGLLayerCmd cmd) {
+        DetachGLLayerCmd(final AttachGLLayerCmd cmd) {
             this.cmd = cmd;
         }
 
@@ -778,8 +785,8 @@ public class MacOSXCGLContext extends GLContextImpl
                         if( 0 != l ) {
                             ols.detachSurfaceLayer();
                         }
-                    } catch(Throwable t) {
-                        System.err.println("Catched Exception on thread "+getThreadName());
+                    } catch(final Throwable t) {
+                        System.err.println("Caught exception on thread "+getThreadName());
                         t.printStackTrace();
                     }
                     CGL.releaseNSOpenGLLayer(cmd.nsOpenGLLayer);
@@ -796,7 +803,7 @@ public class MacOSXCGLContext extends GLContextImpl
       }
 
       @Override
-      public void associateDrawable(boolean bound) {
+      public void associateDrawable(final boolean bound) {
           backingLayerHost = NativeWindowFactory.getOffscreenLayerSurface(drawable.getNativeSurface(), true);
 
           if(DEBUG) {
@@ -821,11 +828,11 @@ public class MacOSXCGLContext extends GLContextImpl
                   final long drawableHandle = drawable.getHandle();
                   if(drawable instanceof GLFBODrawableImpl) {
                       final GLFBODrawableImpl fbod = (GLFBODrawableImpl)drawable;
-                      texID = fbod.getTextureBuffer(GL.GL_FRONT).getName();
+                      texID = fbod.getColorbuffer(GL.GL_FRONT).getName();
                       pbufferHandle = 0;
                       fbod.setSwapBufferContext(new GLFBODrawableImpl.SwapBufferContext() {
                           @Override
-                          public void swapBuffers(boolean doubleBuffered) {
+                          public void swapBuffers(final boolean doubleBuffered) {
                               MacOSXCGLContext.NSOpenGLImpl.this.swapBuffers();
                           } } ) ;
                   } else if( CGL.isNSOpenGLPixelBuffer(drawableHandle) ) {
@@ -838,8 +845,8 @@ public class MacOSXCGLContext extends GLContextImpl
                   } else {
                       throw new GLException("BackingLayerHost w/ unknown handle (!FBO, !PBuffer): "+drawable);
                   }
-                  lastWidth = drawable.getWidth();
-                  lastHeight = drawable.getHeight();
+                  lastWidth = drawable.getSurfaceWidth();
+                  lastHeight = drawable.getSurfaceHeight();
                   if(0>=lastWidth || 0>=lastHeight || !drawable.isRealized()) {
                       throw new GLException("Drawable not realized yet or invalid texture size, texSize "+lastWidth+"x"+lastHeight+", "+drawable);
                   }
@@ -853,18 +860,19 @@ public class MacOSXCGLContext extends GLContextImpl
                   }
 
                   // All CALayer lifecycle ops are deferred on main-thread
+                  final int[] winSize = drawable.getNativeSurface().convertToWindowUnits(new int[]{ lastWidth, lastHeight });
                   attachGLLayerCmd = new AttachGLLayerCmd(
                           backingLayerHost, ctx, gl3ShaderProgramName, pixelFormat, pbufferHandle, texID,
-                          chosenCaps.isBackgroundOpaque(), lastWidth, lastHeight );
+                          chosenCaps.isBackgroundOpaque(), lastWidth, lastHeight, winSize[0], winSize[1] );
                   if(DEBUG) {
                       System.err.println("MaxOSXCGLContext.NSOpenGLImpl.associateDrawable(true): "+attachGLLayerCmd);
                   }
-                  OSXUtil.RunOnMainThread(false, attachGLLayerCmd);
+                  OSXUtil.RunOnMainThread(false, false /* kickNSApp */, attachGLLayerCmd);
               } else { // -> null == backingLayerHost
-                  lastWidth = drawable.getWidth();
-                  lastHeight = drawable.getHeight();
-                  boolean[] isPBuffer = { false };
-                  boolean[] isFBO = { false };
+                  lastWidth = drawable.getSurfaceWidth();
+                  lastHeight = drawable.getSurfaceHeight();
+                  final boolean[] isPBuffer = { false };
+                  final boolean[] isFBO = { false };
                   CGL.setContextView(contextHandle, getNSViewHandle(isPBuffer, isFBO));
               }
           } else { // -> !bound
@@ -886,7 +894,7 @@ public class MacOSXCGLContext extends GLContextImpl
                           if(DEBUG) {
                               System.err.println("MaxOSXCGLContext.NSOpenGLImpl.associateDrawable(false): "+dCmd);
                           }
-                          OSXUtil.RunOnMainThread(false, dCmd);
+                          OSXUtil.RunOnMainThread(false, true /* kickNSApp */, dCmd);
                           if( null != gl3ShaderProgram ) {
                               gl3ShaderProgram.destroy(MacOSXCGLContext.this.gl.getGL3());
                               gl3ShaderProgram = null;
@@ -899,7 +907,7 @@ public class MacOSXCGLContext extends GLContextImpl
           }
       }
 
-      private final void validatePBufferConfig(long ctx) {
+      private final void validatePBufferConfig(final long ctx) {
           final long drawableHandle = drawable.getHandle();
           if( needsSetContextPBuffer && 0 != drawableHandle && CGL.isNSOpenGLPixelBuffer(drawableHandle) ) {
               // Must associate the pbuffer with our newly-created context
@@ -912,12 +920,12 @@ public class MacOSXCGLContext extends GLContextImpl
       }
 
       /** Returns true if size has been updated, otherwise false (same size). */
-      private final boolean validateDrawableSizeConfig(long ctx) {
-          final int width = drawable.getWidth();
-          final int height = drawable.getHeight();
+      private final boolean validateDrawableSizeConfig(final long ctx) {
+          final int width = drawable.getSurfaceWidth();
+          final int height = drawable.getSurfaceHeight();
           if( lastWidth != width || lastHeight != height ) {
-              lastWidth = drawable.getWidth();
-              lastHeight = drawable.getHeight();
+              lastWidth = drawable.getSurfaceWidth();
+              lastHeight = drawable.getSurfaceHeight();
               if(DEBUG) {
                   System.err.println("NS.validateDrawableConfig size changed");
               }
@@ -927,13 +935,13 @@ public class MacOSXCGLContext extends GLContextImpl
       }
 
       @Override
-      public boolean copyImpl(long src, int mask) {
+      public boolean copyImpl(final long src, final int mask) {
           CGL.copyContext(contextHandle, src, mask);
           return true;
       }
 
       @Override
-      public boolean makeCurrent(long ctx) {
+      public boolean makeCurrent(final long ctx) {
           final long cglCtx = CGL.getCGLContext(ctx);
           if(0 == cglCtx) {
               throw new InternalError("Null CGLContext for: "+this);
@@ -949,14 +957,14 @@ public class MacOSXCGLContext extends GLContextImpl
       }
 
       @Override
-      public boolean release(long ctx) {
+      public boolean release(final long ctx) {
           try {
               if( hasRendererQuirk(GLRendererQuirks.GLFlushBeforeRelease) && null != MacOSXCGLContext.this.getGLProcAddressTable() ) {
                   gl.glFlush();
               }
-          } catch (GLException gle) {
+          } catch (final GLException gle) {
               if(DEBUG) {
-                  System.err.println("MacOSXCGLContext.NSOpenGLImpl.release: INFO: glFlush() catched exception:");
+                  System.err.println("MacOSXCGLContext.NSOpenGLImpl.release: INFO: glFlush() caught exception:");
                   gle.printStackTrace();
               }
           }
@@ -980,7 +988,7 @@ public class MacOSXCGLContext extends GLContextImpl
       }
 
       @Override
-      public boolean setSwapInterval(int interval) {
+      public boolean setSwapInterval(final int interval) {
           final AttachGLLayerCmd cmd = attachGLLayerCmd;
           if(null != cmd) {
               synchronized(cmd) {
@@ -994,7 +1002,7 @@ public class MacOSXCGLContext extends GLContextImpl
           return true;
       }
 
-      private void setSwapIntervalImpl(final long l, int interval) {
+      private void setSwapIntervalImpl(final long l, final int interval) {
           if( 0 != l ) {
               CGL.setNSOpenGLLayerSwapInterval(l, interval);
               if( 0 < interval ) {
@@ -1035,7 +1043,7 @@ public class MacOSXCGLContext extends GLContextImpl
                       final boolean valid;
                       final boolean isFBO = drawable instanceof GLFBODrawableImpl;
                       if( isFBO ){
-                          texID = ((GLFBODrawableImpl)drawable).getTextureBuffer(GL.GL_FRONT).getName();
+                          texID = ((GLFBODrawableImpl)drawable).getColorbuffer(GL.GL_FRONT).getName();
                           valid = 0 != texID;
                       } else {
                           texID = 0;
@@ -1117,7 +1125,7 @@ public class MacOSXCGLContext extends GLContextImpl
       public boolean isNSContext() { return false; }
 
       @Override
-      public long create(long share, int ctp, int major, int minor) {
+      public long create(final long share, final int ctp, final int major, final int minor) {
           long ctx = 0;
           final MacOSXCGLGraphicsConfiguration config = (MacOSXCGLGraphicsConfiguration) drawable.getNativeSurface().getGraphicsConfiguration();
           final GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable)config.getChosenCapabilities();
@@ -1128,7 +1136,7 @@ public class MacOSXCGLContext extends GLContextImpl
           }
           try {
               // Create new context
-              PointerBuffer ctxPB = PointerBuffer.allocateDirect(1);
+              final PointerBuffer ctxPB = PointerBuffer.allocateDirect(1);
               if (DEBUG) {
                   System.err.println("Share context for CGL-based pbuffer context is " + toHexString(share));
               }
@@ -1166,22 +1174,22 @@ public class MacOSXCGLContext extends GLContextImpl
       }
 
       @Override
-      public boolean destroy(long ctx) {
+      public boolean destroy(final long ctx) {
           return CGL.CGLDestroyContext(ctx) == CGL.kCGLNoError;
       }
 
       @Override
-      public void associateDrawable(boolean bound) {
+      public void associateDrawable(final boolean bound) {
       }
 
       @Override
-      public boolean copyImpl(long src, int mask) {
+      public boolean copyImpl(final long src, final int mask) {
           CGL.CGLCopyContext(src, contextHandle, mask);
           return true;
       }
 
       @Override
-      public boolean makeCurrent(long ctx) {
+      public boolean makeCurrent(final long ctx) {
           int err = CGL.CGLLockContext(ctx);
           if(CGL.kCGLNoError == err) {
               err = CGL.CGLSetCurrentContext(ctx);
@@ -1197,22 +1205,22 @@ public class MacOSXCGLContext extends GLContextImpl
       }
 
       @Override
-      public boolean release(long ctx) {
+      public boolean release(final long ctx) {
           try {
               if( hasRendererQuirk(GLRendererQuirks.GLFlushBeforeRelease) && null != MacOSXCGLContext.this.getGLProcAddressTable() ) {
                   gl.glFlush();
               }
-          } catch (GLException gle) {
+          } catch (final GLException gle) {
               if(DEBUG) {
-                  System.err.println("MacOSXCGLContext.CGLImpl.release: INFO: glFlush() catched exception:");
+                  System.err.println("MacOSXCGLContext.CGLImpl.release: INFO: glFlush() caught exception:");
                   gle.printStackTrace();
               }
           }
-          int err = CGL.CGLSetCurrentContext(0);
+          final int err = CGL.CGLSetCurrentContext(0);
           if(DEBUG && CGL.kCGLNoError != err) {
               System.err.println("CGL: Could not release current context: err 0x"+Integer.toHexString(err)+": "+this);
           }
-          int err2 = CGL.CGLUnlockContext(ctx);
+          final int err2 = CGL.CGLUnlockContext(ctx);
           if(DEBUG && CGL.kCGLNoError != err2) {
               System.err.println("CGL: Could not unlock context: err 0x"+Integer.toHexString(err2)+": "+this);
           }
@@ -1230,7 +1238,7 @@ public class MacOSXCGLContext extends GLContextImpl
       }
 
       @Override
-      public boolean setSwapInterval(int interval) {
+      public boolean setSwapInterval(final int interval) {
           final IntBuffer lval = Buffers.newDirectIntBuffer(1);
           lval.put(0, interval);
           CGL.CGLSetParameter(contextHandle, CGL.kCGLCPSwapInterval, lval);
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
index 448e3e2..8ea84a3 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawable.java
@@ -91,7 +91,7 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
 
     public final int id;
 
-    GLBackendType(int id){
+    GLBackendType(final int id){
         this.id = id;
     }
   }
@@ -100,7 +100,7 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
   private boolean haveSetOpenGLMode = false;
   private GLBackendType openGLMode = GLBackendType.NSOPENGL;
 
-  public MacOSXCGLDrawable(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
+  public MacOSXCGLDrawable(final GLDrawableFactory factory, final NativeSurface comp, final boolean realized) {
     super(factory, comp, realized);
     initOpenGLImpl(getOpenGLMode());
   }
@@ -110,7 +110,7 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
   }
 
   @Override
-  protected void associateContext(GLContext ctx, boolean bound) {
+  protected void associateContext(final GLContext ctx, final boolean bound) {
     // NOTE: we need to keep track of the created contexts in order to
     // implement swapBuffers() because of how Mac OS X implements its
     // OpenGL window interface
@@ -132,7 +132,7 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
   }
 
   @Override
-  protected final void swapBuffersImpl(boolean doubleBuffered) {
+  protected final void swapBuffersImpl(final boolean doubleBuffered) {
     if(doubleBuffered) {
         synchronized (createdContexts) {
             for(int i=0; i<createdContexts.size(); ) {
@@ -154,7 +154,7 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
   }
 
   // Support for "mode switching" as described in MacOSXCGLDrawable
-  public void setOpenGLMode(GLBackendType mode) {
+  public void setOpenGLMode(final GLBackendType mode) {
       if (mode == openGLMode) {
         return;
       }
@@ -171,6 +171,6 @@ public abstract class MacOSXCGLDrawable extends GLDrawableImpl {
   }
   public final GLBackendType getOpenGLMode() { return openGLMode; }
 
-  protected void initOpenGLImpl(GLBackendType backend) { /* nop */ }
+  protected void initOpenGLImpl(final GLBackendType backend) { /* nop */ }
 
 }
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
index 9ce71cf..045abca 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDrawableFactory.java
@@ -42,6 +42,7 @@ package jogamp.opengl.macosx.cgl;
 
 import java.nio.Buffer;
 import java.nio.FloatBuffer;
+import java.nio.ShortBuffer;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -89,7 +90,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
             DesktopGLDynamicLookupHelper tmp = null;
             try {
                 tmp = new DesktopGLDynamicLookupHelper(new MacOSXCGLDynamicLibraryBundleInfo());
-            } catch (GLException gle) {
+            } catch (final GLException gle) {
                 if(DEBUG) {
                     gle.printStackTrace();
                 }
@@ -113,7 +114,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
             try {
               ReflectionUtil.callStaticMethod("jogamp.opengl.macosx.cgl.awt.MacOSXAWTCGLGraphicsConfigurationFactory",
                                               "registerFactory", null, null, getClass().getClassLoader());
-            } catch (Exception jre) { /* n/a .. */ }
+            } catch (final Exception jre) { /* n/a .. */ }
         }
 
         sharedMap = new HashMap<String, SharedResource>();
@@ -144,7 +145,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  public GLDynamicLookupHelper getGLDynamicLookupHelper(int profile) {
+  public GLDynamicLookupHelper getGLDynamicLookupHelper(final int profile) {
       return macOSXCGLDynamicLookupHelper;
   }
 
@@ -161,9 +162,9 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
       boolean hasRECTTextures;
       boolean hasAppleFloatPixels;
 
-      SharedResource(MacOSXGraphicsDevice device, boolean valid,
-                     boolean hasNPOTTextures, boolean hasRECTTextures, boolean hasAppletFloatPixels
-                     /* MacOSXCGLDrawable draw, MacOSXCGLContext ctx */, GLRendererQuirks glRendererQuirks) {
+      SharedResource(final MacOSXGraphicsDevice device, final boolean valid,
+                     final boolean hasNPOTTextures, final boolean hasRECTTextures, final boolean hasAppletFloatPixels
+                     /* MacOSXCGLDrawable draw, MacOSXCGLContext ctx */, final GLRendererQuirks glRendererQuirks) {
           // drawable = draw;
           // this.context = ctx;
           this.glRendererQuirks = glRendererQuirks;
@@ -207,7 +208,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
+  public final boolean getIsDeviceCompatible(final AbstractGraphicsDevice device) {
       if(null!=macOSXCGLDynamicLookupHelper && device instanceof MacOSXGraphicsDevice) {
           return true;
       }
@@ -216,24 +217,24 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
 
   private final HashSet<String> devicesTried = new HashSet<String>();
 
-  private boolean getDeviceTried(String connection) {
+  private boolean getDeviceTried(final String connection) {
       synchronized (devicesTried) {
           return devicesTried.contains(connection);
       }
   }
-  private void addDeviceTried(String connection) {
+  private void addDeviceTried(final String connection) {
       synchronized (devicesTried) {
           devicesTried.add(connection);
       }
   }
-  private void removeDeviceTried(String connection) {
+  private void removeDeviceTried(final String connection) {
       synchronized (devicesTried) {
           devicesTried.remove(connection);
       }
   }
 
   @Override
-  protected final SharedResource getOrCreateSharedResourceImpl(AbstractGraphicsDevice adevice) {
+  protected final SharedResource getOrCreateSharedResourceImpl(final AbstractGraphicsDevice adevice) {
     final String connection = adevice.getConnection();
     SharedResource sr;
     synchronized(sharedMap) {
@@ -248,7 +249,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
         boolean hasRECTTextures = false;
         boolean hasAppleFloatPixels = false;
         {
-            GLProfile glp = GLProfile.get(sharedDevice, GLProfile.GL_PROFILE_LIST_MIN_DESKTOP, false);
+            final GLProfile glp = GLProfile.get(sharedDevice, GLProfile.GL_PROFILE_LIST_MIN_DESKTOP, false);
             if (null == glp) {
                 throw new GLException("Couldn't get default GLProfile for device: "+sharedDevice);
             }
@@ -265,23 +266,23 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
                 sharedContext.makeCurrent(); // could cause exception
                 isValid = sharedContext.isCurrent();
                 if(isValid) {
-                    GL gl = sharedContext.getGL();
+                    final GL gl = sharedContext.getGL();
                     hasNPOTTextures = gl.isNPOTTextureAvailable();
                     hasRECTTextures = gl.isExtensionAvailable(GLExtensions.EXT_texture_rectangle);
                     hasAppleFloatPixels = gl.isExtensionAvailable(GLExtensions.APPLE_float_pixels);
                     glRendererQuirks = sharedContext.getRendererQuirks();
                 }
-            } catch (GLException gle) {
+            } catch (final GLException gle) {
                 if (DEBUG) {
-                    System.err.println("MacOSXCGLDrawableFactory.createShared: INFO: makeCurrent catched exception:");
+                    System.err.println("MacOSXCGLDrawableFactory.createShared: INFO: makeCurrent caught exception:");
                     gle.printStackTrace();
                 }
             } finally {
                 try {
                     sharedContext.destroy();
-                } catch (GLException gle) {
+                } catch (final GLException gle) {
                     if (DEBUG) {
-                        System.err.println("MacOSXCGLDrawableFactory.createShared: INFO: destroy catched exception:");
+                        System.err.println("MacOSXCGLDrawableFactory.createShared: INFO: destroy caught exception:");
                         gle.printStackTrace();
                     }
                 }
@@ -308,12 +309,12 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(AbstractGraphicsDevice device) {
+  protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(final AbstractGraphicsDevice device) {
       return MacOSXCGLGraphicsConfiguration.getAvailableCapabilities(this, device);
   }
 
   @Override
-  protected GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
+  protected GLDrawableImpl createOnscreenDrawableImpl(final NativeSurface target) {
     if (target == null) {
       throw new IllegalArgumentException("Null target");
     }
@@ -321,7 +322,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  protected GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
+  protected GLDrawableImpl createOffscreenDrawableImpl(final NativeSurface target) {
     final MutableGraphicsConfiguration config = (MutableGraphicsConfiguration) target.getGraphicsConfiguration();
     final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
     if(!caps.isPBuffer()) {
@@ -336,7 +337,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  public boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp) {
+  public boolean canCreateGLPbuffer(final AbstractGraphicsDevice device, final GLProfile glp) {
     if( glp.isGL2() ) {
         // OSX only supports pbuffer w/ compatible, non-core, context.
         return true;
@@ -346,9 +347,9 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  protected ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
-                                                  GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
-                                                  GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
+  protected ProxySurface createMutableSurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+                                                  final GLCapabilitiesImmutable capsChosen, final GLCapabilitiesImmutable capsRequested,
+                                                  final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstreamHook) {
     final MacOSXGraphicsDevice device;
     if( createNewDevice || !(deviceReq instanceof MacOSXGraphicsDevice) ) {
         device = new MacOSXGraphicsDevice(deviceReq.getUnitID());
@@ -364,15 +365,15 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
-                                                   GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
+  public final ProxySurface createDummySurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+                                                   GLCapabilitiesImmutable chosenCaps, final GLCapabilitiesImmutable requestedCaps, final GLCapabilitiesChooser chooser, final int width, final int height) {
     chosenCaps = GLGraphicsConfigurationUtil.fixOnscreenGLCapabilities(chosenCaps);
     return createMutableSurfaceImpl(deviceReq, createNewDevice, chosenCaps, requestedCaps, chooser,
                                     new OSXDummyUpstreamSurfaceHook(width, height));
   }
 
   @Override
-  protected ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
+  protected ProxySurface createProxySurfaceImpl(final AbstractGraphicsDevice deviceReq, final int screenIdx, final long windowHandle, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstream) {
     final MacOSXGraphicsDevice device = new MacOSXGraphicsDevice(deviceReq.getUnitID());
     final AbstractGraphicsScreen screen = new DefaultGraphicsScreen(device, screenIdx);
     final MacOSXCGLGraphicsConfiguration config = MacOSXCGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsRequested, capsRequested, chooser, screen, true);
@@ -385,7 +386,7 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  public boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
+  public boolean canCreateExternalGLDrawable(final AbstractGraphicsDevice device) {
     return false;
   }
 
@@ -404,24 +405,29 @@ public class MacOSXCGLDrawableFactory extends GLDrawableFactoryImpl {
   /** Returns the length of the computed gamma ramp for this OS and
       hardware. Returns 0 if gamma changes are not supported. */
   @Override
-  protected int getGammaRampLength() {
+  protected int getGammaRampLength(final NativeSurface surface) {
     return GAMMA_RAMP_LENGTH;
   }
 
   @Override
-  protected boolean setGammaRamp(float[] ramp) {
+  protected boolean setGammaRamp(final NativeSurface surface, final float[] ramp) {
     final FloatBuffer rampNIO = Buffers.newDirectFloatBuffer(ramp);
-
     return CGL.setGammaRamp(ramp.length, rampNIO, rampNIO, rampNIO);
   }
 
   @Override
-  protected Buffer getGammaRamp() {
-    return null;
+  protected Buffer getGammaRamp(final NativeSurface surface) {
+    return ShortBuffer.allocate(0); // return a dummy gamma ramp default for reset
   }
 
   @Override
-  protected void resetGammaRamp(Buffer originalGammaRamp) {
+  protected void resetGammaRamp(final NativeSurface surface, final Buffer originalGammaRamp) {
     CGL.resetGammaRamp();
   }
+
+  @Override
+  protected final void resetGammaRamp(final DeviceScreenID deviceScreenID, final Buffer originalGammaRamp) {
+      CGL.resetGammaRamp();
+  }
+
 }
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
index cda8307..3ec40ff 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLDynamicLibraryBundleInfo.java
@@ -56,7 +56,7 @@ public final class MacOSXCGLDynamicLibraryBundleInfo extends DesktopGLDynamicLib
     }
 
     @Override
-    public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+    public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
         return 0;
         /** OSX manual says: NSImage use is discouraged
             return CGL.getProcAddress(glFuncName); // manual implementation
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
index 481c0b9..cd89ad5 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfiguration.java
@@ -53,8 +53,8 @@ import com.jogamp.nativewindow.MutableGraphicsConfiguration;
 
 public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration implements Cloneable {
 
-    MacOSXCGLGraphicsConfiguration(AbstractGraphicsScreen screen,
-                                   GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested) {
+    MacOSXCGLGraphicsConfiguration(final AbstractGraphicsScreen screen,
+                                   final GLCapabilitiesImmutable capsChosen, final GLCapabilitiesImmutable capsRequested) {
         super(screen, capsChosen, capsRequested);
     }
 
@@ -63,8 +63,8 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
         return super.clone();
     }
 
-    protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(MacOSXCGLDrawableFactory factory, AbstractGraphicsDevice device) {
-        MacOSXCGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
+    protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(final MacOSXCGLDrawableFactory factory, final AbstractGraphicsDevice device) {
+        final MacOSXCGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
         if(null == sharedResource) {
             throw new GLException("Shared resource for device n/a: "+device);
         }
@@ -88,7 +88,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
         CGL.NSOpenGLPFASampleBuffers,
         CGL.NSOpenGLPFASamples });
 
-    static IntBuffer GLCapabilities2NSAttribList(AbstractGraphicsDevice device, IntBuffer attrToken, GLCapabilitiesImmutable caps, int ctp, int major, int minor) {
+    static IntBuffer GLCapabilities2NSAttribList(final AbstractGraphicsDevice device, final IntBuffer attrToken, final GLCapabilitiesImmutable caps, final int ctp, final int major, final int minor) {
         final int len = attrToken.remaining();
         final int off = attrToken.position();
         final IntBuffer ivalues = Buffers.newDirectIntBuffer(len);
@@ -155,7 +155,7 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
         return ivalues;
     }
 
-    static long GLCapabilities2NSPixelFormat(AbstractGraphicsDevice device, GLCapabilitiesImmutable caps, int ctp, int major, int minor) {
+    static long GLCapabilities2NSPixelFormat(final AbstractGraphicsDevice device, final GLCapabilitiesImmutable caps, final int ctp, final int major, final int minor) {
         final IntBuffer attrToken = cglInternalAttributeToken.duplicate();
         if ( !MacOSXCGLContext.isLionOrLater ) {
             // no OpenGLProfile
@@ -165,11 +165,11 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
         return CGL.createPixelFormat(attrToken, attrToken.remaining(), ivalues);
     }
 
-    static GLCapabilities NSPixelFormat2GLCapabilities(GLProfile glp, long pixelFormat) {
+    static GLCapabilities NSPixelFormat2GLCapabilities(final GLProfile glp, final long pixelFormat) {
         return PixelFormat2GLCapabilities(glp, pixelFormat, true);
     }
 
-    static long GLCapabilities2CGLPixelFormat(AbstractGraphicsDevice device, GLCapabilitiesImmutable caps, int ctp, int major, int minor) {
+    static long GLCapabilities2CGLPixelFormat(final AbstractGraphicsDevice device, final GLCapabilitiesImmutable caps, final int ctp, final int major, final int minor) {
       // Set up pixel format attributes
       final IntBuffer attrs = Buffers.newDirectIntBuffer(256);
       int i = 0;
@@ -214,20 +214,20 @@ public class MacOSXCGLGraphicsConfiguration extends MutableGraphicsConfiguration
       }
 
       // Use attribute array to select pixel format
-      PointerBuffer fmt = PointerBuffer.allocateDirect(1);
-      IntBuffer numScreens = Buffers.newDirectIntBuffer(1);
-      int res = CGL.CGLChoosePixelFormat(attrs, fmt, numScreens);
+      final PointerBuffer fmt = PointerBuffer.allocateDirect(1);
+      final IntBuffer numScreens = Buffers.newDirectIntBuffer(1);
+      final int res = CGL.CGLChoosePixelFormat(attrs, fmt, numScreens);
       if (res != CGL.kCGLNoError) {
         throw new GLException("Error code " + res + " while choosing pixel format");
       }
       return fmt.get(0);
     }
 
-    static GLCapabilities CGLPixelFormat2GLCapabilities(long pixelFormat) {
+    static GLCapabilities CGLPixelFormat2GLCapabilities(final long pixelFormat) {
         return PixelFormat2GLCapabilities(null, pixelFormat, false);
     }
 
-    private static GLCapabilities PixelFormat2GLCapabilities(GLProfile glp, long pixelFormat, boolean nsUsage) {
+    private static GLCapabilities PixelFormat2GLCapabilities(GLProfile glp, final long pixelFormat, final boolean nsUsage) {
         final IntBuffer attrToken = cglInternalAttributeToken.duplicate();
         final int off;
         if ( !MacOSXCGLContext.isLionOrLater ) {
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
index db2a1df..50de702 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXCGLGraphicsConfigurationFactory.java
@@ -61,8 +61,8 @@ public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurati
 
     @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+            final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+            final CapabilitiesChooser chooser, final AbstractGraphicsScreen absScreen, final int nativeVisualID) {
 
         if (absScreen == null) {
             throw new IllegalArgumentException("AbstractGraphicsScreen is null");
@@ -84,15 +84,15 @@ public class MacOSXCGLGraphicsConfigurationFactory extends GLGraphicsConfigurati
     }
 
     static MacOSXCGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
-                                                                            GLCapabilitiesImmutable capsRequested,
-                                                                            GLCapabilitiesChooser chooser,
-                                                                            AbstractGraphicsScreen absScreen, boolean usePBuffer) {
+                                                                            final GLCapabilitiesImmutable capsRequested,
+                                                                            final GLCapabilitiesChooser chooser,
+                                                                            final AbstractGraphicsScreen absScreen, final boolean usePBuffer) {
         if (absScreen == null) {
             throw new IllegalArgumentException("AbstractGraphicsScreen is null");
         }
         final AbstractGraphicsDevice device = absScreen.getDevice();
         capsChosen = GLGraphicsConfigurationUtil.fixGLCapabilities( capsChosen, GLDrawableFactory.getDesktopFactory(), device);
 
-        return new MacOSXCGLGraphicsConfiguration(absScreen, (GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested);
+        return new MacOSXCGLGraphicsConfiguration(absScreen, capsChosen, capsRequested);
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java
index ebb0fc6..c17ed7d 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXExternalCGLContext.java
@@ -56,7 +56,7 @@ import jogamp.opengl.macosx.cgl.MacOSXCGLDrawable.GLBackendType;
 
 public class MacOSXExternalCGLContext extends MacOSXCGLContext {
 
-  private MacOSXExternalCGLContext(Drawable drawable, boolean isNSContext, long handle) {
+  private MacOSXExternalCGLContext(final Drawable drawable, final boolean isNSContext, final long handle) {
     super(drawable, null);
     setOpenGLMode(isNSContext ? GLBackendType.NSOPENGL : GLBackendType.CGL );
     this.contextHandle = handle;
@@ -67,13 +67,13 @@ public class MacOSXExternalCGLContext extends MacOSXCGLContext {
     getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
   }
 
-  protected static MacOSXExternalCGLContext create(GLDrawableFactory factory) {
+  protected static MacOSXExternalCGLContext create(final GLDrawableFactory factory) {
     long pixelFormat = 0;
     long currentDrawable = 0;
     long contextHandle = CGL.getCurrentContext(); // Check: MacOSX 10.3 ..
-    boolean isNSContext = 0 != contextHandle;
+    final boolean isNSContext = 0 != contextHandle;
     if( isNSContext ) {
-        long ctx = CGL.getCGLContext(contextHandle);
+        final long ctx = CGL.getCGLContext(contextHandle);
         if (ctx == 0) {
           throw new GLException("Error: NULL Context (CGL) of Context (NS) 0x" +Long.toHexString(contextHandle));
         }
@@ -100,19 +100,19 @@ public class MacOSXExternalCGLContext extends MacOSXCGLContext {
     if (0 == pixelFormat) {
       throw new GLException("Error: current pixelformat of current Context 0x"+Long.toHexString(contextHandle)+" is null");
     }
-    GLCapabilitiesImmutable caps = MacOSXCGLGraphicsConfiguration.CGLPixelFormat2GLCapabilities(pixelFormat);
+    final GLCapabilitiesImmutable caps = MacOSXCGLGraphicsConfiguration.CGLPixelFormat2GLCapabilities(pixelFormat);
     if(DEBUG) {
         System.err.println("MacOSXExternalCGLContext Create "+caps);
     }
 
-    AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_MACOSX);
-    MacOSXCGLGraphicsConfiguration cfg = new MacOSXCGLGraphicsConfiguration(aScreen, caps, caps);
+    final AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_MACOSX);
+    final MacOSXCGLGraphicsConfiguration cfg = new MacOSXCGLGraphicsConfiguration(aScreen, caps, caps);
 
     if(0 == currentDrawable) {
         // set a fake marker stating a valid drawable
         currentDrawable = 1;
     }
-    WrappedSurface ns = new WrappedSurface(cfg, currentDrawable, 64, 64, true);
+    final WrappedSurface ns = new WrappedSurface(cfg, currentDrawable, 64, 64, true);
     return new MacOSXExternalCGLContext(new Drawable(factory, ns), isNSContext, contextHandle);
   }
 
@@ -135,26 +135,26 @@ public class MacOSXExternalCGLContext extends MacOSXCGLContext {
 
   // Need to provide the display connection to extension querying APIs
   static class Drawable extends MacOSXCGLDrawable {
-    Drawable(GLDrawableFactory factory, NativeSurface comp) {
+    Drawable(final GLDrawableFactory factory, final NativeSurface comp) {
       super(factory, comp, true);
     }
 
     @Override
-    public GLContext createContext(GLContext shareWith) {
+    public GLContext createContext(final GLContext shareWith) {
       throw new GLException("Should not call this");
     }
 
     @Override
-    public int getWidth() {
+    public int getSurfaceWidth() {
       throw new GLException("Should not call this");
     }
 
     @Override
-    public int getHeight() {
+    public int getSurfaceHeight() {
       throw new GLException("Should not call this");
     }
 
-    public void setSize(int width, int height) {
+    public void setSize(final int width, final int height) {
       throw new GLException("Should not call this");
     }
   }
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
index 446a834..c613efa 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOffscreenCGLDrawable.java
@@ -46,13 +46,13 @@ import javax.media.opengl.GLDrawableFactory;
 
 public class MacOSXOffscreenCGLDrawable extends MacOSXPbufferCGLDrawable {
 
-  public MacOSXOffscreenCGLDrawable(GLDrawableFactory factory,
-                                    NativeSurface target) {
+  public MacOSXOffscreenCGLDrawable(final GLDrawableFactory factory,
+                                    final NativeSurface target) {
     super(factory, target);
   }
 
   @Override
-  public GLContext createContext(GLContext shareWith) {
+  public GLContext createContext(final GLContext shareWith) {
     return new MacOSXCGLContext(this, shareWith);
   }
 }
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOnscreenCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOnscreenCGLDrawable.java
index c6f0c13..e9ea2ff 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOnscreenCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXOnscreenCGLDrawable.java
@@ -46,12 +46,12 @@ import javax.media.opengl.GLDrawableFactory;
 
 public class MacOSXOnscreenCGLDrawable extends MacOSXCGLDrawable {
 
-  protected MacOSXOnscreenCGLDrawable(GLDrawableFactory factory, NativeSurface component) {
+  protected MacOSXOnscreenCGLDrawable(final GLDrawableFactory factory, final NativeSurface component) {
     super(factory, component, false);
   }
 
   @Override
-  public GLContext createContext(GLContext shareWith) {
+  public GLContext createContext(final GLContext shareWith) {
     return new MacOSXCGLContext(this, shareWith);
   }
 
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
index f6e8b8f..bc88d9c 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/MacOSXPbufferCGLDrawable.java
@@ -46,12 +46,9 @@ import javax.media.nativewindow.DefaultGraphicsConfiguration;
 import javax.media.nativewindow.NativeSurface;
 import javax.media.nativewindow.MutableSurface;
 import javax.media.opengl.GL;
-import javax.media.opengl.GL2;
-import javax.media.opengl.GLCapabilitiesImmutable;
 import javax.media.opengl.GLContext;
 import javax.media.opengl.GLDrawableFactory;
 import javax.media.opengl.GLException;
-import javax.media.opengl.GLProfile;
 
 import com.jogamp.common.nio.PointerBuffer;
 import com.jogamp.opengl.util.GLBuffers;
@@ -73,7 +70,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
 
   protected int pBufferTexTarget, pBufferTexWidth, pBufferTexHeight;
 
-  public MacOSXPbufferCGLDrawable(GLDrawableFactory factory, NativeSurface target) {
+  public MacOSXPbufferCGLDrawable(final GLDrawableFactory factory, final NativeSurface target) {
     super(factory, target, false);
   }
 
@@ -87,7 +84,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
   }
 
   @Override
-  public GLContext createContext(GLContext shareWith) {
+  public GLContext createContext(final GLContext shareWith) {
     return new MacOSXCGLContext(this, shareWith);
   }
 
@@ -119,9 +116,7 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
   private void createPbuffer() {
     final MutableSurface ms = (MutableSurface) getNativeSurface();
     final DefaultGraphicsConfiguration config = (DefaultGraphicsConfiguration) ms.getGraphicsConfiguration();
-    final GLCapabilitiesImmutable capabilities = (GLCapabilitiesImmutable)config.getChosenCapabilities();
-    final GLProfile glProfile = capabilities.getGLProfile();
-    MacOSXCGLDrawableFactory.SharedResource sr = ((MacOSXCGLDrawableFactory)factory).getOrCreateSharedResourceImpl(config.getScreen().getDevice());
+    final MacOSXCGLDrawableFactory.SharedResource sr = ((MacOSXCGLDrawableFactory)factory).getOrCreateSharedResourceImpl(config.getScreen().getDevice());
 
     if (DEBUG) {
         System.out.println(getThreadName()+": Pbuffer config: " + config);
@@ -135,18 +130,18 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
 
     pBufferTexTarget = GL.GL_TEXTURE_2D;
     if ( null!=sr && sr.isNPOTTextureAvailable() ) {
-      pBufferTexWidth = getWidth();
-      pBufferTexHeight = getHeight();
+      pBufferTexWidth = getSurfaceWidth();
+      pBufferTexHeight = getSurfaceHeight();
     } else {
-      pBufferTexWidth = GLBuffers.getNextPowerOf2(getWidth());
-      pBufferTexHeight = GLBuffers.getNextPowerOf2(getHeight());
+      pBufferTexWidth = GLBuffers.getNextPowerOf2(getSurfaceWidth());
+      pBufferTexHeight = GLBuffers.getNextPowerOf2(getSurfaceHeight());
     }
 
     final int internalFormat = GL.GL_RGBA;
-    final long pBuffer = impl.create(pBufferTexTarget, internalFormat, getWidth(), getHeight());
+    final long pBuffer = impl.create(pBufferTexTarget, internalFormat, getSurfaceWidth(), getSurfaceHeight());
     if(DEBUG) {
         System.err.println("MacOSXPbufferCGLDrawable tex: target "+toHexString(pBufferTexTarget)+
-                            ", pbufferSize "+getWidth()+"x"+getHeight()+
+                            ", pbufferSize "+getSurfaceWidth()+"x"+getSurfaceHeight()+
                             ", texSize "+pBufferTexWidth+"x"+pBufferTexHeight+
                             ", internal-fmt "+toHexString(internalFormat));
         System.err.println("MacOSXPbufferCGLDrawable pBuffer: "+toHexString(pBuffer));
@@ -160,13 +155,13 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
   }
 
   @Override
-  public void setOpenGLMode(GLBackendType mode) {
+  public void setOpenGLMode(final GLBackendType mode) {
     super.setOpenGLMode(mode);
     createPbuffer(); // recreate
   }
 
   @Override
-  protected void initOpenGLImpl(GLBackendType backend) {
+  protected void initOpenGLImpl(final GLBackendType backend) {
     switch (backend) {
       case NSOPENGL:
         impl = new NSOpenGLImpl();
@@ -180,24 +175,24 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
   }
 
   // NSOpenGLPixelBuffer implementation
-  class NSOpenGLImpl implements GLBackendImpl {
+  static class NSOpenGLImpl implements GLBackendImpl {
     @Override
-    public long create(int renderTarget, int internalFormat, int width, int height) {
+    public long create(final int renderTarget, final int internalFormat, final int width, final int height) {
       return CGL.createPBuffer(renderTarget, internalFormat, width, height);
     }
 
     @Override
-    public void destroy(long pbuffer) {
+    public void destroy(final long pbuffer) {
       CGL.destroyPBuffer(pbuffer);
     }
   }
 
   // CGL implementation
-  class CGLImpl implements GLBackendImpl {
+  static class CGLImpl implements GLBackendImpl {
     @Override
-    public long create(int renderTarget, int internalFormat, int width, int height) {
-      PointerBuffer pbuffer = PointerBuffer.allocateDirect(1);
-      int res = CGL.CGLCreatePBuffer(width, height, renderTarget, internalFormat, 0, pbuffer);
+    public long create(final int renderTarget, final int internalFormat, final int width, final int height) {
+      final PointerBuffer pbuffer = PointerBuffer.allocateDirect(1);
+      final int res = CGL.CGLCreatePBuffer(width, height, renderTarget, internalFormat, 0, pbuffer);
       if (res != CGL.kCGLNoError) {
         throw new GLException("Error creating CGL-based pbuffer: error code " + res);
       }
@@ -205,8 +200,8 @@ public class MacOSXPbufferCGLDrawable extends MacOSXCGLDrawable {
     }
 
     @Override
-    public void destroy(long pbuffer) {
-      int res = CGL.CGLDestroyPBuffer(pbuffer);
+    public void destroy(final long pbuffer) {
+      final int res = CGL.CGLDestroyPBuffer(pbuffer);
       if (res != CGL.kCGLNoError) {
         throw new GLException("Error destroying CGL-based pbuffer: error code " + res);
       }
diff --git a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
index 2192353..01300b0 100644
--- a/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/macosx/cgl/awt/MacOSXAWTCGLGraphicsConfigurationFactory.java
@@ -65,8 +65,8 @@ public class MacOSXAWTCGLGraphicsConfigurationFactory extends GLGraphicsConfigur
 
     @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+            final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+            final CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, final int nativeVisualID) {
         GraphicsDevice device = null;
         if (absScreen != null &&
             !(absScreen instanceof AWTGraphicsScreen)) {
@@ -76,7 +76,7 @@ public class MacOSXAWTCGLGraphicsConfigurationFactory extends GLGraphicsConfigur
         if(null==absScreen) {
             absScreen = AWTGraphicsScreen.createDefault();
         }
-        AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
+        final AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
         device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice();
 
         if ( !(capsChosen instanceof GLCapabilitiesImmutable) ) {
@@ -96,14 +96,14 @@ public class MacOSXAWTCGLGraphicsConfigurationFactory extends GLGraphicsConfigur
             System.err.println("MacOSXAWTCGLGraphicsConfigurationFactory: got "+absScreen);
         }
 
-        MacOSXGraphicsDevice macDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
-        DefaultGraphicsScreen macScreen = new DefaultGraphicsScreen(macDevice, awtScreen.getIndex());
+        final MacOSXGraphicsDevice macDevice = new MacOSXGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
+        final DefaultGraphicsScreen macScreen = new DefaultGraphicsScreen(macDevice, awtScreen.getIndex());
         if(DEBUG) {
             System.err.println("MacOSXAWTCGLGraphicsConfigurationFactory: made "+macScreen);
         }
 
-        GraphicsConfiguration gc = device.getDefaultConfiguration();
-        MacOSXCGLGraphicsConfiguration macConfig = (MacOSXCGLGraphicsConfiguration)
+        final GraphicsConfiguration gc = device.getDefaultConfiguration();
+        final MacOSXCGLGraphicsConfiguration macConfig = (MacOSXCGLGraphicsConfiguration)
             GraphicsConfigurationFactory.getFactory(macDevice, capsChosen).chooseGraphicsConfiguration(capsChosen,
                                                                                            capsRequested,
                                                                                            chooser, macScreen, nativeVisualID);
diff --git a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
index eeaaa58..003b914 100644
--- a/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/openal/av/ALAudioSink.java
@@ -34,13 +34,16 @@ import java.util.Arrays;
 import jogamp.opengl.Debug;
 
 import com.jogamp.common.util.LFRingbuffer;
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.common.util.Ringbuffer;
 import com.jogamp.common.util.locks.LockFactory;
 import com.jogamp.common.util.locks.RecursiveLock;
 import com.jogamp.openal.AL;
 import com.jogamp.openal.ALC;
+import com.jogamp.openal.ALCConstants;
 import com.jogamp.openal.ALCcontext;
 import com.jogamp.openal.ALCdevice;
+import com.jogamp.openal.ALConstants;
 import com.jogamp.openal.ALExt;
 import com.jogamp.openal.ALFactory;
 import com.jogamp.openal.util.ALHelpers;
@@ -74,10 +77,10 @@ public class ALAudioSink implements AudioSink {
     static class ALAudioFrame extends AudioFrame {
         private final int alBuffer;
 
-        ALAudioFrame(int alBuffer) {
+        ALAudioFrame(final int alBuffer) {
             this.alBuffer = alBuffer;
         }
-        public ALAudioFrame(int alBuffer, int pts, int duration, int dataSize) {
+        public ALAudioFrame(final int alBuffer, final int pts, final int duration, final int dataSize) {
             super(pts, duration, dataSize);
             this.alBuffer = alBuffer;
         }
@@ -112,7 +115,7 @@ public class ALAudioSink implements AudioSink {
 
     static {
         Debug.initSingleton();
-        DEBUG_TRACE = Debug.isPropertyDefined("jogl.debug.AudioSink.trace", true);
+        DEBUG_TRACE = PropertyAccess.isPropertyDefined("jogl.debug.AudioSink.trace", true);
 
         ALC _alc = null;
         AL _al = null;
@@ -121,9 +124,9 @@ public class ALAudioSink implements AudioSink {
             _alc = ALFactory.getALC();
             _al = ALFactory.getAL();
             _alExt = ALFactory.getALExt();
-        } catch(Throwable t) {
+        } catch(final Throwable t) {
             if( DEBUG ) {
-                System.err.println("ALAudioSink: Catched "+t.getClass().getName()+": "+t.getMessage());
+                System.err.println("ALAudioSink: Caught "+t.getClass().getName()+": "+t.getMessage());
                 t.printStackTrace();
             }
         }
@@ -133,6 +136,19 @@ public class ALAudioSink implements AudioSink {
         staticAvailable = null != alc && null != al && null != alExt;
     }
 
+    private void clearPreALError(final String prefix) {
+        checkALError(prefix);
+    }
+    private boolean checkALError(final String prefix) {
+        final int alcErr = alc.alcGetError(device);
+        final int alErr = al.alGetError();
+        final boolean ok = ALCConstants.ALC_NO_ERROR == alcErr && ALConstants.AL_NO_ERROR == alErr;
+        if( DEBUG ) {
+            System.err.println("ALAudioSink."+prefix+": ok "+ok+", err [alc "+toHexString(alcErr)+", al "+toHexString(alErr)+"]");
+        }
+        return ok;
+    }
+
     public ALAudioSink() {
         initialized = false;
         chosenFormat = null;
@@ -147,14 +163,19 @@ public class ALAudioSink implements AudioSink {
                 if (device == null) {
                     throw new RuntimeException(getThreadName()+": ALAudioSink: Error opening default OpenAL device");
                 }
+                int checkErrIter = 1;
+
+                clearPreALError("init."+checkErrIter++);
 
                 // Get the device specifier.
-                deviceSpecifier = alc.alcGetString(device, ALC.ALC_DEVICE_SPECIFIER);
+                deviceSpecifier = alc.alcGetString(device, ALCConstants.ALC_DEVICE_SPECIFIER);
                 if (deviceSpecifier == null) {
                     throw new RuntimeException(getThreadName()+": ALAudioSink: Error getting specifier for default OpenAL device");
                 }
 
                 // Create audio context.
+                // final int[] attrs = new int[] { ALC.ALC_FREQUENCY, DefaultFormat.sampleRate, 0 };
+                // context = alc.alcCreateContext(device, attrs, 0);
                 context = alc.alcCreateContext(device, null);
                 if (context == null) {
                     throw new RuntimeException(getThreadName()+": ALAudioSink: Error creating OpenAL context for "+deviceSpecifier);
@@ -163,21 +184,25 @@ public class ALAudioSink implements AudioSink {
                 lockContext();
                 try {
                     // Check for an error.
-                    if ( alc.alcGetError(device) != ALC.ALC_NO_ERROR ) {
+                    if ( alc.alcGetError(device) != ALCConstants.ALC_NO_ERROR ) {
                         throw new RuntimeException(getThreadName()+": ALAudioSink: Error making OpenAL context current");
                     }
 
                     hasSOFTBufferSamples = al.alIsExtensionPresent(AL_SOFT_buffer_samples);
                     hasALC_thread_local_context = alc.alcIsExtensionPresent(null, ALC_EXT_thread_local_context) ||
                                                   alc.alcIsExtensionPresent(device, ALC_EXT_thread_local_context) ;
-                    preferredAudioFormat = queryPreferredAudioFormat();
+                    clearPreALError("init."+checkErrIter++);
+                    preferredAudioFormat = new AudioFormat(querySampleRate(), DefaultFormat.sampleSize, DefaultFormat.channelCount, DefaultFormat.signed, DefaultFormat.fixedP, DefaultFormat.planar, DefaultFormat.littleEndian);
                     if( DEBUG ) {
-                        System.out.println("ALAudioSink: OpenAL Extensions:"+al.alGetString(AL.AL_EXTENSIONS));
-                        System.out.println("ALAudioSink: Null device OpenAL Extensions:"+alc.alcGetString(null, ALC.ALC_EXTENSIONS));
-                        System.out.println("ALAudioSink: Device "+deviceSpecifier+" OpenAL Extensions:"+alc.alcGetString(device, ALC.ALC_EXTENSIONS));
+                        System.out.println("ALAudioSink: OpenAL Extensions:"+al.alGetString(ALConstants.AL_EXTENSIONS));
+                        clearPreALError("init."+checkErrIter++);
+                        System.out.println("ALAudioSink: Null device OpenAL Extensions:"+alc.alcGetString(null, ALCConstants.ALC_EXTENSIONS));
+                        clearPreALError("init."+checkErrIter++);
+                        System.out.println("ALAudioSink: Device "+deviceSpecifier+" OpenAL Extensions:"+alc.alcGetString(device, ALCConstants.ALC_EXTENSIONS));
                         System.out.println("ALAudioSink: hasSOFTBufferSamples "+hasSOFTBufferSamples);
                         System.out.println("ALAudioSink: hasALC_thread_local_context "+hasALC_thread_local_context);
                         System.out.println("ALAudioSink: preferredAudioFormat "+preferredAudioFormat);
+                        clearPreALError("init."+checkErrIter++);
                     }
 
                     // Create source
@@ -185,7 +210,7 @@ public class ALAudioSink implements AudioSink {
                         alSource = new int[1];
                         al.alGenSources(1, alSource, 0);
                         final int err = al.alGetError();
-                        if( AL.AL_NO_ERROR != err ) {
+                        if( ALConstants.AL_NO_ERROR != err ) {
                             alSource = null;
                             throw new RuntimeException(getThreadName()+": ALAudioSink: Error generating Source: 0x"+Integer.toHexString(err));
                         }
@@ -199,23 +224,31 @@ public class ALAudioSink implements AudioSink {
                     unlockContext();
                 }
                 return;
-            } catch ( Exception e ) {
+            } catch ( final Exception e ) {
                 if( DEBUG ) {
                     System.err.println(e.getMessage());
+                    e.printStackTrace();
                 }
                 destroy();
             }
         }
     }
 
-    private final AudioFormat queryPreferredAudioFormat() {
-        int sampleRate = DefaultFormat.sampleRate;
+    private final int querySampleRate() {
+        final int sampleRate;
         final int[] value = new int[1];
-        alc.alcGetIntegerv(device, ALC.ALC_FREQUENCY, 1, value, 0);
-        if ( alc.alcGetError(device) == ALC.ALC_NO_ERROR ) {
+        alc.alcGetIntegerv(device, ALCConstants.ALC_FREQUENCY, 1, value, 0);
+        final int alcErr = alc.alcGetError(device);
+        final int alErr = al.alGetError();
+        if ( ALCConstants.ALC_NO_ERROR == alcErr && ALConstants.AL_NO_ERROR == alErr && 0 != value[0] ) {
             sampleRate = value[0];
+        } else {
+            sampleRate = DefaultFormat.sampleRate;
         }
-        return new AudioFormat(sampleRate, DefaultFormat.sampleSize, DefaultFormat.channelCount, DefaultFormat.signed, DefaultFormat.fixedP, DefaultFormat.planar, DefaultFormat.littleEndian);
+        if( DEBUG ) {
+            System.err.println("ALAudioSink.querySampleRate: err [alc "+toHexString(alcErr)+", al "+toHexString(alErr)+"], freq: "+value[0]+" -> "+sampleRate);
+        }
+        return sampleRate;
     }
 
     private final void lockContext() {
@@ -226,7 +259,7 @@ public class ALAudioSink implements AudioSink {
             alc.alcMakeContextCurrent(context);
         }
         final int alcErr = alc.alcGetError(null);
-        if( ALC.ALC_NO_ERROR != alcErr ) {
+        if( ALCConstants.ALC_NO_ERROR != alcErr ) {
             final String err = getThreadName()+": ALCError "+toHexString(alcErr)+" while makeCurrent. "+this;
             System.err.println(err);
             Thread.dumpStack();
@@ -234,7 +267,7 @@ public class ALAudioSink implements AudioSink {
             throw new RuntimeException(err);
         }
         final int alErr = al.alGetError();
-        if( ALC.ALC_NO_ERROR != alErr ) {
+        if( ALCConstants.ALC_NO_ERROR != alErr ) {
             if( DEBUG ) {
                 System.err.println(getThreadName()+": Prev - ALError "+toHexString(alErr)+" @ makeCurrent. "+this);
                 Thread.dumpStack();
@@ -255,9 +288,9 @@ public class ALAudioSink implements AudioSink {
             if( null != context ) {
                 try {
                     alc.alcDestroyContext(context);
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     if( DEBUG ) {
-                        System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage());
+                        System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage());
                         t.printStackTrace();
                     }
                 }
@@ -316,7 +349,7 @@ public class ALAudioSink implements AudioSink {
     }
 
     @Override
-    public final boolean isSupported(AudioFormat format) {
+    public final boolean isSupported(final AudioFormat format) {
         if( !staticAvailable ) {
             return false;
         }
@@ -325,13 +358,13 @@ public class ALAudioSink implements AudioSink {
             return false;
         }
         final int alChannelLayout = ALHelpers.getDefaultALChannelLayout(format.channelCount);
-        if( AL.AL_NONE != alChannelLayout ) {
+        if( ALConstants.AL_NONE != alChannelLayout ) {
             final int alSampleType = ALHelpers.getALSampleType(format.sampleSize, format.signed, format.fixedP);
-            if( AL.AL_NONE != alSampleType ) {
+            if( ALConstants.AL_NONE != alSampleType ) {
                 lockContext();
                 try {
                     final int alFormat = ALHelpers.getALFormat(alChannelLayout, alSampleType, hasSOFTBufferSamples, al, alExt);
-                    return AL.AL_NONE != alFormat;
+                    return ALConstants.AL_NONE != alFormat;
                 } finally {
                     unlockContext();
                 }
@@ -341,7 +374,7 @@ public class ALAudioSink implements AudioSink {
     }
 
     @Override
-    public final boolean init(AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) {
+    public final boolean init(final AudioFormat requestedFormat, final float frameDuration, final int initialQueueSize, final int queueGrowAmount, final int queueLimit) {
         if( !staticAvailable ) {
             return false;
         }
@@ -349,12 +382,12 @@ public class ALAudioSink implements AudioSink {
         alSampleType = ALHelpers.getALSampleType(requestedFormat.sampleSize, requestedFormat.signed, requestedFormat.fixedP);
         lockContext();
         try {
-            if( AL.AL_NONE != alChannelLayout && AL.AL_NONE != alSampleType ) {
+            if( ALConstants.AL_NONE != alChannelLayout && ALConstants.AL_NONE != alSampleType ) {
                 alFormat = ALHelpers.getALFormat(alChannelLayout, alSampleType, hasSOFTBufferSamples, al, alExt);
             } else {
-                alFormat = AL.AL_NONE;
+                alFormat = ALConstants.AL_NONE;
             }
-            if( AL.AL_NONE == alFormat ) {
+            if( ALConstants.AL_NONE == alFormat ) {
                 // not supported
                 return false;
             }
@@ -368,7 +401,7 @@ public class ALAudioSink implements AudioSink {
                 alBufferNames = new int[initialFrameCount];
                 al.alGenBuffers(initialFrameCount, alBufferNames, 0);
                 final int err = al.alGetError();
-                if( AL.AL_NO_ERROR != err ) {
+                if( ALConstants.AL_NO_ERROR != err ) {
                     alBufferNames = null;
                     throw new RuntimeException(getThreadName()+": ALAudioSink: Error generating Buffers: 0x"+Integer.toHexString(err));
                 }
@@ -396,7 +429,12 @@ public class ALAudioSink implements AudioSink {
         return true;
     }
 
-    private static int[] concat(int[] first, int[] second) {
+    @Override
+    public final AudioFormat getChosenFormat() {
+        return chosenFormat;
+    }
+
+    private static int[] concat(final int[] first, final int[] second) {
         final int[] result = Arrays.copyOf(first, first.length + second.length);
         System.arraycopy(second, 0, result, first.length, second.length);
         return result;
@@ -422,7 +460,7 @@ public class ALAudioSink implements AudioSink {
         final int[] newALBufferNames = new int[frameGrowAmount];
         al.alGenBuffers(frameGrowAmount, newALBufferNames, 0);
         final int err = al.alGetError();
-        if( AL.AL_NO_ERROR != err ) {
+        if( ALConstants.AL_NO_ERROR != err ) {
             if( DEBUG ) {
                 System.err.println(getThreadName()+": ALAudioSink.growBuffers: Error generating "+frameGrowAmount+" new Buffers: 0x"+Integer.toHexString(err));
             }
@@ -458,9 +496,9 @@ public class ALAudioSink implements AudioSink {
         if( null != alBufferNames ) {
             try {
                 al.alDeleteBuffers(alBufferNames.length, alBufferNames, 0);
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 if( DEBUG ) {
-                    System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage());
+                    System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage());
                     t.printStackTrace();
                 }
             }
@@ -488,9 +526,9 @@ public class ALAudioSink implements AudioSink {
             if( null != alSource ) {
                 try {
                     al.alDeleteSources(1, alSource, 0);
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     if( DEBUG ) {
-                        System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage());
+                        System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage());
                         t.printStackTrace();
                     }
                 }
@@ -504,9 +542,9 @@ public class ALAudioSink implements AudioSink {
         if( null != device ) {
             try {
                 alc.alcCloseDevice(device);
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 if( DEBUG ) {
-                    System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage());
+                    System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage());
                     t.printStackTrace();
                 }
             }
@@ -521,16 +559,16 @@ public class ALAudioSink implements AudioSink {
     }
 
     private final int dequeueBuffer(final boolean wait, final boolean ignoreBufferInconsistency) {
-        int alErr = AL.AL_NO_ERROR;
+        int alErr = ALConstants.AL_NO_ERROR;
         final int releaseBufferCount;
         if( alBufferBytesQueued > 0 ) {
             final int releaseBufferLimes = Math.max(1, alFramesPlaying.size() / 4 );
             final int[] val=new int[1];
             int i=0;
             do {
-                al.alGetSourcei(alSource[0], AL.AL_BUFFERS_PROCESSED, val, 0);
+                al.alGetSourcei(alSource[0], ALConstants.AL_BUFFERS_PROCESSED, val, 0);
                 alErr = al.alGetError();
-                if( AL.AL_NO_ERROR != alErr ) {
+                if( ALConstants.AL_NO_ERROR != alErr ) {
                     throw new RuntimeException(getThreadName()+": ALError "+toHexString(alErr)+" while quering processed buffers at source. "+this);
                 }
                 if( wait && val[0] < releaseBufferLimes ) {
@@ -539,12 +577,12 @@ public class ALAudioSink implements AudioSink {
                     final int avgBufferDura = chosenFormat.getBytesDuration( alBufferBytesQueued / alFramesPlaying.size() );
                     final int sleep = Math.max(2, Math.min(100, releaseBufferLimes * avgBufferDura));
                     if( DEBUG ) {
-                        System.err.println(getThreadName()+": ALAudioSink: Dequeue.wait["+i+"]: avgBufferDura "+avgBufferDura+", releaseBufferLimes "+releaseBufferLimes+", sleep "+sleep+" ms, playImpl "+(AL.AL_PLAYING == getSourceState(false))+", processed "+val[0]+", "+this);
+                        System.err.println(getThreadName()+": ALAudioSink: Dequeue.wait["+i+"]: avgBufferDura "+avgBufferDura+", releaseBufferLimes "+releaseBufferLimes+", sleep "+sleep+" ms, playImpl "+(ALConstants.AL_PLAYING == getSourceState(false))+", processed "+val[0]+", "+this);
                     }
                     unlockContext();
                     try {
                         Thread.sleep( sleep - 1 );
-                    } catch (InterruptedException e) {
+                    } catch (final InterruptedException e) {
                     } finally {
                         lockContext();
                     }
@@ -559,7 +597,7 @@ public class ALAudioSink implements AudioSink {
             final int[] buffers = new int[releaseBufferCount];
             al.alSourceUnqueueBuffers(alSource[0], releaseBufferCount, buffers, 0);
             alErr = al.alGetError();
-            if( AL.AL_NO_ERROR != alErr ) {
+            if( ALConstants.AL_NO_ERROR != alErr ) {
                 throw new RuntimeException(getThreadName()+": ALError "+toHexString(alErr)+" while dequeueing "+releaseBufferCount+" buffers. "+this);
             }
             for ( int i=0; i<releaseBufferCount; i++ ) {
@@ -579,13 +617,13 @@ public class ALAudioSink implements AudioSink {
                             throw new InternalError("Buffer name mismatch: dequeued: "+buffers[i]+", released "+releasedBuffer+", "+this);
                         }
                     }
-                }
-                alBufferBytesQueued -= releasedBuffer.getByteSize();
-                if( !alFramesAvail.put(releasedBuffer) ) {
-                    throw new InternalError("Internal Error: "+this);
-                }
-                if(DEBUG_TRACE) {
-                    System.err.println("<< [al "+buffers[i]+", q "+releasedBuffer.alBuffer+"] <- "+shortString()+" @ "+getThreadName());
+                    alBufferBytesQueued -= releasedBuffer.getByteSize();
+                    if( !alFramesAvail.put(releasedBuffer) ) {
+                        throw new InternalError("Internal Error: "+this);
+                    }
+                    if(DEBUG_TRACE) {
+                        System.err.println("<< [al "+buffers[i]+", q "+releasedBuffer.alBuffer+"] <- "+shortString()+" @ "+getThreadName());
+                    }
                 }
             }
         }
@@ -596,9 +634,9 @@ public class ALAudioSink implements AudioSink {
             System.err.println("<   _FLUSH_  <- "+shortString()+" @ "+getThreadName());
         }
         final int[] val=new int[1];
-        al.alSourcei(alSource[0], AL.AL_BUFFER, 0); // explicit force zero buffer!
+        al.alSourcei(alSource[0], ALConstants.AL_BUFFER, 0); // explicit force zero buffer!
         if(DEBUG_TRACE) {
-            al.alGetSourcei(alSource[0], AL.AL_BUFFERS_PROCESSED, val, 0);
+            al.alGetSourcei(alSource[0], ALConstants.AL_BUFFERS_PROCESSED, val, 0);
         }
         final int alErr = al.alGetError();
         while ( !alFramesPlaying.isEmpty() ) {
@@ -618,7 +656,7 @@ public class ALAudioSink implements AudioSink {
         }
     }
 
-    private final int dequeueBuffer(boolean wait, int inPTS, int inDuration) {
+    private final int dequeueBuffer(final boolean wait, final int inPTS, final int inDuration) {
         final int dequeuedBufferCount = dequeueBuffer( wait, false /* ignoreBufferInconsistency */ );
         final ALAudioFrame currentBuffer = alFramesPlaying.peek();
         if( null != currentBuffer ) {
@@ -635,12 +673,7 @@ public class ALAudioSink implements AudioSink {
     }
 
     @Override
-    public final AudioFrame enqueueData(AudioDataFrame audioDataFrame) {
-        return enqueueData(audioDataFrame.getPTS(), audioDataFrame.getData(), audioDataFrame.getByteSize());
-    }
-
-    @Override
-    public final AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount) {
+    public final AudioFrame enqueueData(final int pts, final ByteBuffer bytes, final int byteCount) {
         if( !initialized || null == chosenFormat ) {
             return null;
         }
@@ -695,11 +728,11 @@ public class ALAudioSink implements AudioSink {
 
             al.alSourceQueueBuffers(alSource[0], 1, alBufferNames, 0);
             final int alErr = al.alGetError();
-            if( AL.AL_NO_ERROR != alErr ) {
+            if( ALConstants.AL_NO_ERROR != alErr ) {
                 throw new RuntimeException(getThreadName()+": ALError "+toHexString(alErr)+" while queueing buffer "+toHexString(alBufferNames[0])+". "+this);
             }
             alBufferBytesQueued += byteCount;
-            enqueuedFrameCount++;
+            enqueuedFrameCount++; // safe: only written-to while locked!
 
             if(DEBUG_TRACE) {
                 System.err.println(">> "+alFrame.alBuffer+" -> "+shortString()+" @ "+getThreadName());
@@ -730,16 +763,16 @@ public class ALAudioSink implements AudioSink {
     }
     private final boolean isPlayingImpl0() {
         if( playRequested ) {
-            return AL.AL_PLAYING == getSourceState(false);
+            return ALConstants.AL_PLAYING == getSourceState(false);
         } else {
             return false;
         }
     }
-    private final int getSourceState(boolean ignoreError) {
+    private final int getSourceState(final boolean ignoreError) {
         final int[] val = new int[1];
-        al.alGetSourcei(alSource[0], AL.AL_SOURCE_STATE, val, 0);
+        al.alGetSourcei(alSource[0], ALConstants.AL_SOURCE_STATE, val, 0);
         final int alErr = al.alGetError();
-        if( AL.AL_NO_ERROR != alErr ) {
+        if( ALConstants.AL_NO_ERROR != alErr ) {
             final String msg = getThreadName()+": ALError "+toHexString(alErr)+" while querying SOURCE_STATE. "+this;
             if( ignoreError ) {
                 if( DEBUG ) {
@@ -762,17 +795,17 @@ public class ALAudioSink implements AudioSink {
         try {
             playImpl();
             if( DEBUG ) {
-                System.err.println(getThreadName()+": ALAudioSink: PLAY playImpl "+(AL.AL_PLAYING == getSourceState(false))+", "+this);
+                System.err.println(getThreadName()+": ALAudioSink: PLAY playImpl "+(ALConstants.AL_PLAYING == getSourceState(false))+", "+this);
             }
         } finally {
             unlockContext();
         }
     }
     private final void playImpl() {
-        if( playRequested && AL.AL_PLAYING != getSourceState(false) ) {
+        if( playRequested && ALConstants.AL_PLAYING != getSourceState(false) ) {
             al.alSourcePlay(alSource[0]);
             final int alErr = al.alGetError();
-            if( AL.AL_NO_ERROR != alErr ) {
+            if( ALConstants.AL_NO_ERROR != alErr ) {
                 throw new RuntimeException(getThreadName()+": ALError "+toHexString(alErr)+" while start playing. "+this);
             }
         }
@@ -788,7 +821,7 @@ public class ALAudioSink implements AudioSink {
             try {
                 pauseImpl();
                 if( DEBUG ) {
-                    System.err.println(getThreadName()+": ALAudioSink: PAUSE playImpl "+(AL.AL_PLAYING == getSourceState(false))+", "+this);
+                    System.err.println(getThreadName()+": ALAudioSink: PAUSE playImpl "+(ALConstants.AL_PLAYING == getSourceState(false))+", "+this);
                 }
             } finally {
                 unlockContext();
@@ -800,17 +833,17 @@ public class ALAudioSink implements AudioSink {
             playRequested = false;
             al.alSourcePause(alSource[0]);
             final int alErr = al.alGetError();
-            if( AL.AL_NO_ERROR != alErr ) {
+            if( ALConstants.AL_NO_ERROR != alErr ) {
                 throw new RuntimeException(getThreadName()+": ALError "+toHexString(alErr)+" while pausing. "+this);
             }
         }
     }
-    private final void stopImpl(boolean ignoreError) {
-        if( AL.AL_STOPPED != getSourceState(ignoreError) ) {
+    private final void stopImpl(final boolean ignoreError) {
+        if( ALConstants.AL_STOPPED != getSourceState(ignoreError) ) {
             playRequested = false;
             al.alSourceStop(alSource[0]);
             final int alErr = al.alGetError();
-            if( AL.AL_NO_ERROR != alErr ) {
+            if( ALConstants.AL_NO_ERROR != alErr ) {
                 final String msg = "ALError "+toHexString(alErr)+" while stopping. "+this;
                 if( ignoreError ) {
                     if( DEBUG ) {
@@ -838,7 +871,7 @@ public class ALAudioSink implements AudioSink {
             }
             if( 0.5f <= rate && rate <= 2.0f ) { // OpenAL limits
                 playSpeed = rate;
-                al.alSourcef(alSource[0], AL.AL_PITCH, playSpeed);
+                al.alSourcef(alSource[0], ALConstants.AL_PITCH, playSpeed);
                 return true;
             }
         } finally {
@@ -866,7 +899,7 @@ public class ALAudioSink implements AudioSink {
             }
             if( 0.0f <= v && v <= 1.0f ) { // OpenAL limits
                 volume = v;
-                al.alSourcef(alSource[0], AL.AL_GAIN, v);
+                al.alSourcef(alSource[0], ALConstants.AL_GAIN, v);
                 return true;
             }
         } finally {
@@ -890,7 +923,7 @@ public class ALAudioSink implements AudioSink {
                 throw new InternalError("XXX: "+this);
             }
             if( DEBUG ) {
-                System.err.println(getThreadName()+": ALAudioSink: FLUSH playImpl "+(AL.AL_PLAYING == getSourceState(false))+", "+this);
+                System.err.println(getThreadName()+": ALAudioSink: FLUSH playImpl "+(ALConstants.AL_PLAYING == getSourceState(false))+", "+this);
             }
         } finally {
             unlockContext();
@@ -942,6 +975,6 @@ public class ALAudioSink implements AudioSink {
     @Override
     public final int getPTS() { return playingPTS; }
 
-    private static final String toHexString(int v) { return "0x"+Integer.toHexString(v); }
+    private static final String toHexString(final int v) { return "0x"+Integer.toHexString(v); }
     private static final String getThreadName() { return Thread.currentThread().getName(); }
 }
diff --git a/src/jogl/classes/jogamp/opengl/openal/av/ALDummyUsage.java b/src/jogl/classes/jogamp/opengl/openal/av/ALDummyUsage.java
index 2c1dfa2..4f58593 100644
--- a/src/jogl/classes/jogamp/opengl/openal/av/ALDummyUsage.java
+++ b/src/jogl/classes/jogamp/opengl/openal/av/ALDummyUsage.java
@@ -3,13 +3,13 @@ package jogamp.opengl.openal.av;
 import com.jogamp.openal.AL;
 import com.jogamp.openal.JoalVersion;
 
-/** 
+/**
  * Demo JOAL usage w/ av dependency, i.e. FFMPEGMediaPlayer ..
  */
 public class ALDummyUsage {
     static AL al;
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         System.err.println("JOGL> Hello JOAL");
         System.err.println("JOAL: "+JoalVersion.getInstance().toString());
     }
diff --git a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
index 89e01ed..3119b96 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLArrayHandlerInterleaved.java
@@ -42,30 +42,30 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
 public class GLArrayHandlerInterleaved extends GLVBOArrayHandler {
   private final List<GLArrayHandlerFlat> subArrays = new ArrayList<GLArrayHandlerFlat>();
 
-  public GLArrayHandlerInterleaved(GLArrayDataEditable ad) {
+  public GLArrayHandlerInterleaved(final GLArrayDataEditable ad) {
     super(ad);
   }
 
   @Override
-  public final void setSubArrayVBOName(int vboName) {
+  public final void setSubArrayVBOName(final int vboName) {
       for(int i=0; i<subArrays.size(); i++) {
           subArrays.get(i).getData().setVBOName(vboName);
       }
   }
 
   @Override
-  public final void addSubHandler(GLArrayHandlerFlat handler) {
+  public final void addSubHandler(final GLArrayHandlerFlat handler) {
       subArrays.add(handler);
   }
 
-  private final void syncSubData(GL gl, Object ext) {
+  private final void syncSubData(final GL gl, final Object ext) {
       for(int i=0; i<subArrays.size(); i++) {
           subArrays.get(i).syncData(gl, ext);
       }
   }
 
   @Override
-  public final void enableState(GL gl, boolean enable, Object ext) {
+  public final void enableState(final GL gl, final boolean enable, final Object ext) {
     if(enable) {
         final boolean vboBound = bindBuffer(gl, true);
         syncSubData(gl, ext);
diff --git a/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java
index 8a58798..66be982 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLDataArrayHandler.java
@@ -40,22 +40,22 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
  */
 public class GLDataArrayHandler extends GLVBOArrayHandler {
 
-  public GLDataArrayHandler(GLArrayDataEditable ad) {
+  public GLDataArrayHandler(final GLArrayDataEditable ad) {
     super(ad);
   }
 
   @Override
-  public final void setSubArrayVBOName(int vboName) {
+  public final void setSubArrayVBOName(final int vboName) {
       throw new UnsupportedOperationException();
   }
 
   @Override
-  public final void addSubHandler(GLArrayHandlerFlat handler) {
+  public final void addSubHandler(final GLArrayHandlerFlat handler) {
       throw new UnsupportedOperationException();
   }
 
   @Override
-  public final void enableState(GL gl, boolean enable, Object ext) {
+  public final void enableState(final GL gl, final boolean enable, final Object ext) {
     if(enable) {
         if(!ad.isVBO()) {
             // makes no sense otherwise
diff --git a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
index 7f7a99a..f5869c6 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandler.java
@@ -39,22 +39,22 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
  * represents this array only.
  */
 public class GLFixedArrayHandler extends GLVBOArrayHandler {
-  public GLFixedArrayHandler(GLArrayDataEditable ad) {
+  public GLFixedArrayHandler(final GLArrayDataEditable ad) {
     super(ad);
   }
 
   @Override
-  public final void setSubArrayVBOName(int vboName) {
+  public final void setSubArrayVBOName(final int vboName) {
       throw new UnsupportedOperationException();
   }
 
   @Override
-  public final void addSubHandler(GLArrayHandlerFlat handler) {
+  public final void addSubHandler(final GLArrayHandlerFlat handler) {
       throw new UnsupportedOperationException();
   }
 
   @Override
-  public final void enableState(GL gl, boolean enable, Object ext) {
+  public final void enableState(final GL gl, final boolean enable, final Object ext) {
     final GLPointerFunc glp = gl.getGL2ES1();
     if(enable) {
         final boolean vboBound = bindBuffer(gl, true);
diff --git a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
index acec051..b5fa2f0 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLFixedArrayHandlerFlat.java
@@ -39,9 +39,9 @@ import com.jogamp.opengl.util.GLArrayDataWrapper;
  * separately and interleaves many arrays.
  */
 public class GLFixedArrayHandlerFlat implements GLArrayHandlerFlat {
-  private GLArrayDataWrapper ad;
+  private final GLArrayDataWrapper ad;
 
-  public GLFixedArrayHandlerFlat(GLArrayDataWrapper ad) {
+  public GLFixedArrayHandlerFlat(final GLArrayDataWrapper ad) {
     this.ad = ad;
   }
 
@@ -51,7 +51,7 @@ public class GLFixedArrayHandlerFlat implements GLArrayHandlerFlat {
   }
 
   @Override
-  public final void syncData(GL gl, Object ext) {
+  public final void syncData(final GL gl, final Object ext) {
     final GLPointerFunc glp = gl.getGL2ES1();
     switch(ad.getIndex()) {
         case GLPointerFunc.GL_VERTEX_ARRAY:
@@ -72,7 +72,7 @@ public class GLFixedArrayHandlerFlat implements GLArrayHandlerFlat {
   }
 
   @Override
-  public final void enableState(GL gl, boolean enable, Object ext) {
+  public final void enableState(final GL gl, final boolean enable, final Object ext) {
     final GLPointerFunc glp = gl.getGL2ES1();
     if(enable) {
         glp.glEnableClientState(ad.getIndex());
diff --git a/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java
index 5198cac..7bc1ef1 100644
--- a/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/GLVBOArrayHandler.java
@@ -41,12 +41,12 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
 public abstract class GLVBOArrayHandler implements GLArrayHandler {
   protected GLArrayDataEditable ad;
 
-  public GLVBOArrayHandler(GLArrayDataEditable ad) {
+  public GLVBOArrayHandler(final GLArrayDataEditable ad) {
     this.ad = ad;
   }
 
   @Override
-  public final boolean bindBuffer(GL gl, boolean bind) {
+  public final boolean bindBuffer(final GL gl, final boolean bind) {
     if( !ad.isVBO() ) {
         return false;
     }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/AudioSampleFormat.java b/src/jogl/classes/jogamp/opengl/util/av/AudioSampleFormat.java
new file mode 100644
index 0000000..4c48b90
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/av/AudioSampleFormat.java
@@ -0,0 +1,64 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl.util.av;
+
+/** FFMPEG/libAV compatible audio sample formats */
+public enum AudioSampleFormat {
+    // NONE = -1,
+    U8,          ///< unsigned 8 bits
+    S16,         ///< signed 16 bits
+    S32,         ///< signed 32 bits
+    FLT,         ///< float
+    DBL,         ///< double
+
+    U8P,         ///< unsigned 8 bits, planar
+    S16P,        ///< signed 16 bits, planar
+    S32P,        ///< signed 32 bits, planar
+    FLTP,        ///< float, planar
+    DBLP,        ///< double, planar
+
+    COUNT;       ///< Number of sample formats.
+
+    /**
+     * Returns the matching SampleFormat value corresponding to the given SampleFormat's integer ordinal.
+     * <pre>
+     *   given:
+     *     ordinal = enumValue.ordinal()
+     *   reverse:
+     *     enumValue = EnumClass.values()[ordinal]
+     * </pre>
+     * @throws IllegalArgumentException if the given ordinal is out of range, i.e. not within [ 0 .. SampleFormat.values().length-1 ]
+     */
+    public static AudioSampleFormat valueOf(final int ordinal) throws IllegalArgumentException {
+        final AudioSampleFormat[] all = AudioSampleFormat.values();
+        if( 0 <= ordinal && ordinal < all.length ) {
+            return all[ordinal];
+        }
+        throw new IllegalArgumentException("Ordinal "+ordinal+" out of range of SampleFormat.values()[0.."+(all.length-1)+"]");
+    }
+}
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
index c39b78b..f9df915 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/EGLMediaPlayerImpl.java
@@ -50,14 +50,14 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
 
         public final int id;
 
-        TextureType(int id){
+        TextureType(final int id){
             this.id = id;
         }
     }
 
     public static class EGLTextureFrame extends TextureSequence.TextureFrame {
 
-        public EGLTextureFrame(Buffer clientBuffer, Texture t, long khrImage, long khrSync) {
+        public EGLTextureFrame(final Buffer clientBuffer, final Texture t, final long khrImage, final long khrSync) {
             super(t);
             this.clientBuffer = clientBuffer;
             this.image = khrImage;
@@ -78,15 +78,15 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
     }
 
 
-    protected EGLMediaPlayerImpl(TextureType texType, boolean useKHRSync) {
+    protected EGLMediaPlayerImpl(final TextureType texType, final boolean useKHRSync) {
         super();
         this.texType = texType;
         this.useKHRSync = useKHRSync;
     }
 
     @Override
-    protected TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
-        final Texture texture = super.createTexImageImpl(gl, texName, width, height);
+    protected TextureSequence.TextureFrame createTexImage(final GL gl, final int texName) {
+        final Texture texture = super.createTexImageImpl(gl, texName, getWidth(), getHeight());
         final Buffer clientBuffer;
         final long image;
         final long sync;
@@ -106,7 +106,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
         }
 
         if(TextureType.KHRImage == texType) {
-            IntBuffer nioTmp = Buffers.newDirectIntBuffer(1);
+            final IntBuffer nioTmp = Buffers.newDirectIntBuffer(1);
             // create EGLImage from texture
             clientBuffer = null; // FIXME
             nioTmp.put(0, EGL.EGL_NONE);
@@ -122,7 +122,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
         }
 
         if(useKHRSync) {
-            IntBuffer tmp = Buffers.newDirectIntBuffer(1);
+            final IntBuffer tmp = Buffers.newDirectIntBuffer(1);
             // Create sync object so that we can be sure that gl has finished
             // rendering the EGLImage texture before we tell OpenMAX to fill
             // it with a new frame.
@@ -138,7 +138,7 @@ public abstract class EGLMediaPlayerImpl extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected void destroyTexFrame(GL gl, TextureSequence.TextureFrame frame) {
+    protected void destroyTexFrame(final GL gl, final TextureSequence.TextureFrame frame) {
         final boolean eglUsage = TextureType.KHRImage == texType || useKHRSync ;
         final EGLContext eglCtx;
         final EGLExt eglExt;
diff --git a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
index 6a0e006..05e192b 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/GLMediaPlayerImpl.java
@@ -36,7 +36,7 @@ import java.util.Map;
 
 import javax.media.nativewindow.AbstractGraphicsDevice;
 import javax.media.opengl.GL;
-import javax.media.opengl.GL2;
+import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLContext;
 import javax.media.opengl.GLDrawable;
 import javax.media.opengl.GLDrawableFactory;
@@ -74,24 +74,26 @@ import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     private static final int STREAM_WORKER_DELAY = Debug.getIntProperty("jogl.debug.GLMediaPlayer.StreamWorker.delay", false, 0);
 
-    protected static final String unknown = "unknown";
+    private static final String unknown = "unknown";
 
-    protected volatile State state;
+    private volatile State state;
     private final Object stateLock = new Object();
 
-    protected int textureCount;
-    protected int textureTarget;
-    protected int textureFormat;
-    protected int textureInternalFormat;
-    protected int textureType;
-    protected int texUnit;
+    private int textureCount;
+    private int textureTarget;
+    private int textureFormat;
+    private int textureInternalFormat;
+    private int textureType;
+    private int texUnit;
 
+    private int textureFragmentShaderHashCode;
 
-    protected int[] texMinMagFilter = { GL.GL_NEAREST, GL.GL_NEAREST };
-    protected int[] texWrapST = { GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE };
+    private final int[] texMinMagFilter = { GL.GL_NEAREST, GL.GL_NEAREST };
+    private final int[] texWrapST = { GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE };
 
     /** User requested URI stream location. */
-    protected URI streamLoc = null;
+    private URI streamLoc = null;
+
     /**
      * In case {@link #streamLoc} is a {@link GLMediaPlayer#CameraInputScheme},
      * {@link #cameraPath} holds the URI's path portion
@@ -102,42 +104,42 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     /** Optional camera properties, see {@link #cameraPath}. */
     protected Map<String, String> cameraProps = null;
 
-    protected volatile float playSpeed = 1.0f;
-    protected float audioVolume = 1.0f;
+    private volatile float playSpeed = 1.0f;
+    private float audioVolume = 1.0f;
 
     /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
-    protected int vid = GLMediaPlayer.STREAM_ID_AUTO;
+    private int vid = GLMediaPlayer.STREAM_ID_AUTO;
     /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
-    protected int aid = GLMediaPlayer.STREAM_ID_AUTO;
+    private int aid = GLMediaPlayer.STREAM_ID_AUTO;
     /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
-    protected int width = 0;
+    private int width = 0;
     /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
-    protected int height = 0;
+    private int height = 0;
     /** Video avg. fps. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
-    protected float fps = 0;
+    private float fps = 0;
     /** Video avg. frame duration in ms. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
-    protected float frame_duration = 0f;
+    private float frame_duration = 0f;
     /** Stream bps. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
-    protected int bps_stream = 0;
+    private int bps_stream = 0;
     /** Video bps. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
-    protected int bps_video = 0;
+    private int bps_video = 0;
     /** Audio bps. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
-    protected int bps_audio = 0;
+    private int bps_audio = 0;
     /** In frames. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
-    protected int videoFrames = 0;
+    private int videoFrames = 0;
     /** In frames. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
-    protected int audioFrames = 0;
+    private int audioFrames = 0;
     /** In ms. Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
-    protected int duration = 0;
+    private int duration = 0;
     /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
-    protected String acodec = unknown;
+    private String acodec = unknown;
     /** Shall be set by the {@link #initStreamImpl(int, int)} method implementation. */
-    protected String vcodec = unknown;
+    private String vcodec = unknown;
 
-    protected volatile int decodedFrameCount = 0;
-    protected int presentedFrameCount = 0;
-    protected int displayedFrameCount = 0;
-    protected volatile int video_pts_last = 0;
+    private volatile int decodedFrameCount = 0;
+    private int presentedFrameCount = 0;
+    private int displayedFrameCount = 0;
+    private volatile int video_pts_last = 0;
 
     /**
      * Help detect EOS, limit is {@link #MAX_FRAMELESS_MS_UNTIL_EOS}.
@@ -176,14 +178,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     /** Trigger video PTS reset with given cause as bitfield. */
     private boolean videoSCR_reset = false;
 
-    protected TextureFrame[] videoFramesOrig = null;
-    protected Ringbuffer<TextureFrame> videoFramesFree =  null;
-    protected Ringbuffer<TextureFrame> videoFramesDecoded =  null;
-    protected volatile TextureFrame lastFrame = null;
+    private TextureFrame[] videoFramesOrig = null;
+    private Ringbuffer<TextureFrame> videoFramesFree =  null;
+    private Ringbuffer<TextureFrame> videoFramesDecoded =  null;
+    private volatile TextureFrame lastFrame = null;
     /**
      * @see #isGLOriented()
      */
-    protected boolean isInGLOrientation = false;
+    private boolean isInGLOrientation = false;
 
     private final ArrayList<GLMediaEventListener> eventListeners = new ArrayList<GLMediaEventListener>();
 
@@ -194,11 +196,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         this.textureInternalFormat = GL.GL_RGBA;
         this.textureType = GL.GL_UNSIGNED_BYTE;
         this.texUnit = 0;
+        this.textureFragmentShaderHashCode = 0;
         this.state = State.Uninitialized;
     }
 
     @Override
-    public final void setTextureUnit(int u) { texUnit = u; }
+    public final void setTextureUnit(final int u) { texUnit = u; }
 
     @Override
     public final int getTextureUnit() { return texUnit; }
@@ -206,23 +209,27 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     @Override
     public final int getTextureTarget() { return textureTarget; }
 
+    protected final int getTextureFormat() { return textureFormat; }
+
+    protected final int getTextureType() { return textureType; }
+
     @Override
     public final int getTextureCount() { return textureCount; }
 
-    protected final void setTextureTarget(int target) { textureTarget=target; }
-    protected final void setTextureFormat(int internalFormat, int format) {
+    protected final void setTextureTarget(final int target) { textureTarget=target; }
+    protected final void setTextureFormat(final int internalFormat, final int format) {
         textureInternalFormat=internalFormat;
         textureFormat=format;
     }
-    protected final void setTextureType(int t) { textureType=t; }
+    protected final void setTextureType(final int t) { textureType=t; }
 
     @Override
-    public final void setTextureMinMagFilter(int[] minMagFilter) { texMinMagFilter[0] = minMagFilter[0]; texMinMagFilter[1] = minMagFilter[1];}
+    public final void setTextureMinMagFilter(final int[] minMagFilter) { texMinMagFilter[0] = minMagFilter[0]; texMinMagFilter[1] = minMagFilter[1];}
     @Override
     public final int[] getTextureMinMagFilter() { return texMinMagFilter; }
 
     @Override
-    public final void setTextureWrapST(int[] wrapST) { texWrapST[0] = wrapST[0]; texWrapST[1] = wrapST[1];}
+    public final void setTextureWrapST(final int[] wrapST) { texWrapST[0] = wrapST[0]; texWrapST[1] = wrapST[1];}
     @Override
     public final int[] getTextureWrapST() { return texWrapST; }
 
@@ -246,7 +253,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         checkGLInit();
         switch(textureTarget) {
             case GL.GL_TEXTURE_2D:
-            case GL2.GL_TEXTURE_RECTANGLE:
+            case GL2GL3.GL_TEXTURE_RECTANGLE:
                 return TextureSequence.sampler2D;
             case GLES2.GL_TEXTURE_EXTERNAL_OES:
                 return TextureSequence.samplerExternalOES;
@@ -262,7 +269,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      * if not overridden by specialization.
      */
     @Override
-    public String getTextureLookupFunctionName(String desiredFuncName) throws IllegalStateException {
+    public String getTextureLookupFunctionName(final String desiredFuncName) throws IllegalStateException {
         checkGLInit();
         return "texture2D";
     }
@@ -281,6 +288,19 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
 
     @Override
+    public final int getTextureFragmentShaderHashCode() {
+        if( !isTextureAvailable() ) {
+            textureFragmentShaderHashCode = 0;
+            return 0;
+        } else if( 0 == textureFragmentShaderHashCode ) {
+            int hash = 31 + getTextureLookupFragmentShaderImpl().hashCode();
+            hash = ((hash << 5) - hash) + getTextureSampler2DType().hashCode();
+            textureFragmentShaderHashCode = hash;
+        }
+        return textureFragmentShaderHashCode;
+    }
+
+    @Override
     public final int getDecodedFrameCount() { return decodedFrameCount; }
 
     @Override
@@ -308,6 +328,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     @Override
     public final State getState() { return state; }
 
+    protected final void setState(final State s) { state=s; }
+
     @Override
     public final State play() {
         synchronized( stateLock ) {
@@ -333,15 +355,15 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected abstract boolean playImpl();
 
     @Override
-    public final State pause(boolean flush) {
+    public final State pause(final boolean flush) {
         return pauseImpl(flush, 0);
     }
-    private final State pauseImpl(boolean flush, int event_mask) {
+    private final State pauseImpl(final boolean flush, int event_mask) {
         synchronized( stateLock ) {
             final State preState = state;
             if( State.Playing == state ) {
                 event_mask = addStateEventMask(event_mask, GLMediaPlayer.State.Paused);
-                state = State.Paused;
+                setState( State.Paused );
                 if( null != streamWorker ) {
                     streamWorker.doPause();
                 }
@@ -362,10 +384,10 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected abstract boolean pauseImpl();
 
     @Override
-    public final State destroy(GL gl) {
+    public final State destroy(final GL gl) {
         return destroyImpl(gl, 0);
     }
-    private final State destroyImpl(GL gl, int event_mask) {
+    private final State destroyImpl(final GL gl, final int event_mask) {
         synchronized( stateLock ) {
             if( null != streamWorker ) {
                 streamWorker.doStop();
@@ -390,7 +412,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                 case Playing:
                 case Paused:
                     final State _state = state;
-                    state = State.Paused;
+                    setState( State.Paused );
                     if( null != streamWorker ) {
                         streamWorker.doPause();
                     }
@@ -411,7 +433,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     if( null != streamWorker ) {
                         streamWorker.doResume();
                     }
-                    state = _state;
+                    setState( _state );
                     break;
                 default:
                     pts1 = 0;
@@ -423,9 +445,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     protected abstract int seekImpl(int msec);
 
     @Override
-    public final float getPlaySpeed() {
-        return playSpeed;
-    }
+    public final float getPlaySpeed() { return playSpeed; }
 
     @Override
     public final boolean setPlaySpeed(float rate) {
@@ -455,7 +475,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      * at {@link AudioSink#enqueueData(com.jogamp.opengl.util.av.AudioSink.AudioFrame)}.
      * </p>
      */
-    protected boolean setPlaySpeedImpl(float rate) {
+    protected boolean setPlaySpeedImpl(final float rate) {
         if( null != audioSink ) {
             audioSinkPlaySpeedSet = audioSink.setPlaySpeed(rate);
         }
@@ -501,7 +521,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     /**
      * Override if not using AudioSink, or AudioSink's {@link AudioSink#setVolume(float)} is not sufficient!
      */
-    protected boolean setAudioVolumeImpl(float v) {
+    protected boolean setAudioVolumeImpl(final float v) {
         if( null != audioSink ) {
             return audioSink.setVolume(v);
         }
@@ -510,7 +530,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
 
     @Override
-    public final void initStream(URI streamLoc, final int vid, final int aid, int reqTextureCount) throws IllegalStateException, IllegalArgumentException {
+    public final void initStream(final URI streamLoc, final int vid, final int aid, final int reqTextureCount) throws IllegalStateException, IllegalArgumentException {
         synchronized( stateLock ) {
             if(State.Uninitialized != state) {
                 throw new IllegalStateException("Instance not in state unintialized: "+this);
@@ -551,19 +571,17 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
 
             this.vid = vid;
             this.aid = aid;
-            if ( this.streamLoc != null ) {
-                new Thread() {
-                    public void run() {
-                        try {
-                            // StreamWorker may be used, see API-doc of StreamWorker
-                            initStreamImpl(vid, aid);
-                        } catch (Throwable t) {
-                            streamErr = new StreamException(t.getClass().getSimpleName()+" while initializing: "+GLMediaPlayerImpl.this.toString(), t);
-                            changeState(GLMediaEventListener.EVENT_CHANGE_ERR, GLMediaPlayer.State.Uninitialized);
-                        } // also initializes width, height, .. etc
-                    }
-                }.start();
-            }
+            new Thread() {
+                public void run() {
+                    try {
+                        // StreamWorker may be used, see API-doc of StreamWorker
+                        initStreamImpl(vid, aid);
+                    } catch (final Throwable t) {
+                        streamErr = new StreamException(t.getClass().getSimpleName()+" while initializing: "+GLMediaPlayerImpl.this.toString(), t);
+                        changeState(GLMediaEventListener.EVENT_CHANGE_ERR, GLMediaPlayer.State.Uninitialized);
+                    } // also initializes width, height, .. etc
+                }
+            }.start();
         }
     }
     /**
@@ -592,7 +610,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
 
     @Override
-    public final void initGL(GL gl) throws IllegalStateException, StreamException, GLException {
+    public final void initGL(final GL gl) throws IllegalStateException, StreamException, GLException {
         synchronized( stateLock ) {
             if(State.Initialized != state ) {
                 throw new IllegalStateException("Stream not in state initialized: "+this);
@@ -636,7 +654,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     lastFrame = null;
                 }
                 changeState(0, State.Paused);
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 destroyImpl(gl, GLMediaEventListener.EVENT_CHANGE_ERR); // -> GLMediaPlayer.State.Uninitialized
                 throw new GLException("Error initializing GL resources", t);
             }
@@ -663,11 +681,11 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      * Implementation must at least return a texture count of {@link #TEXTURE_COUNT_MIN}, <i>two</i>, the last texture and the decoding texture.
      * </p>
      */
-    protected int validateTextureCount(int desiredTextureCount) {
+    protected int validateTextureCount(final int desiredTextureCount) {
         return desiredTextureCount < TEXTURE_COUNT_MIN ? TEXTURE_COUNT_MIN : desiredTextureCount;
     }
 
-    protected TextureFrame[] createTexFrames(GL gl, final int count) {
+    protected TextureFrame[] createTexFrames(final GL gl, final int count) {
         final int[] texNames = new int[count];
         gl.glGenTextures(count, texNames, 0);
         final int err = gl.glGetError();
@@ -682,7 +700,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
     protected abstract TextureFrame createTexImage(GL gl, int texName);
 
-    protected final Texture createTexImageImpl(GL gl, int texName, int tWidth, int tHeight) {
+    protected final Texture createTexImageImpl(final GL gl, final int texName, final int tWidth, final int tHeight) {
         if( 0 > texName ) {
             throw new RuntimeException("TextureName "+toHexString(texName)+" invalid.");
         }
@@ -725,18 +743,20 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_S, texWrapST[0]);
         gl.glTexParameteri(textureTarget, GL.GL_TEXTURE_WRAP_T, texWrapST[1]);
 
-        return com.jogamp.opengl.util.texture.TextureIO.newTexture(
-                     texName, textureTarget,
-                     tWidth, tHeight,
-                     width,  height,
-                     !isInGLOrientation);
+        return new Texture(texName, textureTarget,
+                           tWidth, tHeight, width,  height, !isInGLOrientation);
     }
 
-    protected void destroyTexFrame(GL gl, TextureFrame frame) {
+    protected void destroyTexFrame(final GL gl, final TextureFrame frame) {
         frame.getTexture().destroy(gl);
     }
 
     @Override
+    public final boolean isTextureAvailable() {
+        return State.Paused == state || State.Playing == state;
+    }
+
+    @Override
     public final TextureFrame getLastTexture() throws IllegalStateException {
         if( State.Paused != state && State.Playing != state ) {
             throw new IllegalStateException("Instance not paused or playing: "+this);
@@ -744,7 +764,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         return lastFrame;
     }
 
-    private final void removeAllTextureFrames(GL gl) {
+    private final void removeAllTextureFrames(final GL gl) {
         final TextureFrame[] texFrames = videoFramesOrig;
         videoFramesOrig = null;
         videoFramesFree = null;
@@ -766,13 +786,13 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         }
     }
 
-    protected TextureFrame cachedFrame = null;
-    protected long lastTimeMillis = 0;
+    private TextureFrame cachedFrame = null;
+    private long lastTimeMillis = 0;
 
     private final boolean[] stGotVFrame = { false };
 
     @Override
-    public final TextureFrame getNextTexture(GL gl) throws IllegalStateException {
+    public final TextureFrame getNextTexture(final GL gl) throws IllegalStateException {
         synchronized( stateLock ) {
             if( State.Paused != state && State.Playing != state ) {
                 throw new IllegalStateException("Instance not paused or playing: "+this);
@@ -918,7 +938,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         }
                         lastTimeMillis = currentTimeMillis;
                     } while( dropFrame );
-                } catch (InterruptedException e) {
+                } catch (final InterruptedException e) {
                     e.printStackTrace();
                 }
             }
@@ -926,8 +946,8 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             return lastFrame;
         }
     }
-    protected void preNextTextureImpl(GL gl) {}
-    protected void postNextTextureImpl(GL gl) {}
+    protected void preNextTextureImpl(final GL gl) {}
+    protected void postNextTextureImpl(final GL gl) {}
     /**
      * Process stream until the next video frame, i.e. {@link TextureFrame}, has been reached.
      * Audio frames, i.e. {@link AudioSink.AudioFrame}, shall be handled in the process.
@@ -951,7 +971,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      */
     protected abstract int getNextTextureImpl(GL gl, TextureFrame nextFrame);
 
-    protected final int getNextSingleThreaded(final GL gl, final TextureFrame nextFrame, boolean[] gotVFrame) throws InterruptedException {
+    protected final int getNextSingleThreaded(final GL gl, final TextureFrame nextFrame, final boolean[] gotVFrame) throws InterruptedException {
         final int pts;
         if( STREAM_ID_NONE != vid ) {
             preNextTextureImpl(gl);
@@ -991,7 +1011,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
      * w/ current pts value in milliseconds.
      * @param audio_scr_t0
      */
-    protected void setFirstAudioPTS2SCR(int pts) {
+    protected void setFirstAudioPTS2SCR(final int pts) {
         if( audioSCR_reset ) {
             audio_scr_t0 = Platform.currentTimeMillis() - pts;
             audioSCR_reset = false;
@@ -1027,13 +1047,13 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         return (int) ( video_dpts_cum * (1.0f - VIDEO_DPTS_COEFF) + 0.5f );
     }
 
-    private final void newFrameAvailable(TextureFrame frame, long currentTimeMillis) {
-        decodedFrameCount++;
+    private final void newFrameAvailable(final TextureFrame frame, final long currentTimeMillis) {
+        decodedFrameCount++; // safe: only written-to either from stream-worker or user thread
         if( 0 == frame.getDuration() ) { // patch frame duration if not set already
             frame.setDuration( (int) frame_duration );
         }
         synchronized(eventListenersLock) {
-            for(Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) {
+            for(final Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) {
                 i.next().newFrameAvailable(this, frame, currentTimeMillis);
             }
         }
@@ -1070,14 +1090,14 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     this.notifyAll();  // wake-up startup-block
                     try {
                         this.wait();  // wait until started
-                    } catch (InterruptedException e) {
+                    } catch (final InterruptedException e) {
                         e.printStackTrace();
                     }
                 }
             }
         }
 
-        private void makeCurrent(GLContext ctx) {
+        private void makeCurrent(final GLContext ctx) {
             if( GLContext.CONTEXT_NOT_CURRENT >= ctx.makeCurrent() ) {
                 throw new GLException("Couldn't make ctx current: "+ctx);
             }
@@ -1090,7 +1110,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     // so we can continue with the destruction.
                     try {
                         sharedGLCtx.destroy();
-                    } catch (GLException gle) {
+                    } catch (final GLException gle) {
                         gle.printStackTrace();
                     }
                 }
@@ -1104,7 +1124,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
             }
         }
 
-        public final synchronized void initGL(GL gl) {
+        public final synchronized void initGL(final GL gl) {
             final GLContext glCtx = gl.getContext();
             final boolean glCtxCurrent = glCtx.isCurrent();
             final GLProfile glp = gl.getGLProfile();
@@ -1130,7 +1150,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                     while( isActive && isRunning ) {
                         try {
                             this.wait(); // wait until paused
-                        } catch (InterruptedException e) {
+                        } catch (final InterruptedException e) {
                             e.printStackTrace();
                         }
                     }
@@ -1145,7 +1165,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         this.notifyAll();  // wake-up pause-block
                         try {
                             this.wait(); // wait until resumed
-                        } catch (InterruptedException e) {
+                        } catch (final InterruptedException e) {
                             e.printStackTrace();
                         }
                     }
@@ -1163,7 +1183,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                         this.notifyAll();  // wake-up pause-block (opt)
                         try {
                             this.wait();  // wait until stopped
-                        } catch (InterruptedException e) {
+                        } catch (final InterruptedException e) {
                             e.printStackTrace();
                         }
                     }
@@ -1195,7 +1215,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                             this.notifyAll();   // wake-up doPause()
                             try {
                                 this.wait(); // wait until resumed
-                            } catch (InterruptedException e) {
+                            } catch (final InterruptedException e) {
                                 if( !shallPause ) {
                                     e.printStackTrace();
                                 }
@@ -1274,12 +1294,12 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
                             }
                             pauseImpl(true, GLMediaEventListener.EVENT_CHANGE_EOS);
                         }
-                    } catch (InterruptedException e) {
+                    } catch (final InterruptedException e) {
                         isBlocked = false;
                         if( !shallStop && !shallPause ) {
                             streamErr = new StreamException("InterruptedException while decoding: "+GLMediaPlayerImpl.this.toString(), e);
                         }
-                    } catch (Throwable t) {
+                    } catch (final Throwable t) {
                         streamErr = new StreamException(t.getClass().getSimpleName()+" while decoding: "+GLMediaPlayerImpl.this.toString(), t);
                     } finally {
                         if( null != nextFrame ) { // put back
@@ -1317,7 +1337,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     private volatile StreamWorker streamWorker = null;
     private volatile StreamException streamErr = null;
 
-    protected final int addStateEventMask(int event_mask, State newState) {
+    protected final int addStateEventMask(int event_mask, final State newState) {
         if( state != newState ) {
             switch( newState ) {
                 case Uninitialized:
@@ -1337,34 +1357,37 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         return event_mask;
     }
 
-    protected final void attributesUpdated(int event_mask) {
+    protected final void attributesUpdated(final int event_mask) {
         if( 0 != event_mask ) {
             final long now = Platform.currentTimeMillis();
             synchronized(eventListenersLock) {
-                for(Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) {
+                for(final Iterator<GLMediaEventListener> i = eventListeners.iterator(); i.hasNext(); ) {
                     i.next().attributesChanged(this, event_mask, now);
                 }
             }
         }
     }
 
-    protected final void changeState(int event_mask, State newState) {
+    protected final void changeState(int event_mask, final State newState) {
         event_mask = addStateEventMask(event_mask, newState);
         if( 0 != event_mask ) {
-            state = newState;
+            setState( newState );
+            if( !isTextureAvailable() ) {
+                textureFragmentShaderHashCode = 0;
+            }
             attributesUpdated( event_mask );
         }
     }
 
-    protected final void updateAttributes(int vid, int aid, int width, int height, int bps_stream,
-                                          int bps_video, int bps_audio, float fps,
-                                          int videoFrames, int audioFrames, int duration, String vcodec, String acodec) {
+    protected final void updateAttributes(int vid, final int aid, final int width, final int height, final int bps_stream,
+                                          final int bps_video, final int bps_audio, final float fps,
+                                          final int videoFrames, final int audioFrames, final int duration, final String vcodec, final String acodec) {
         int event_mask = 0;
         final boolean wasUninitialized = state == State.Uninitialized;
 
         if( wasUninitialized ) {
             event_mask |= GLMediaEventListener.EVENT_CHANGE_INIT;
-            state = State.Initialized;
+            setState( State.Initialized );
         }
         if( STREAM_ID_AUTO == vid ) {
             vid = STREAM_ID_NONE;
@@ -1433,23 +1456,23 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
         attributesUpdated(event_mask);
     }
 
-    protected void setIsGLOriented(boolean isGLOriented) {
+    protected void setIsGLOriented(final boolean isGLOriented) {
         if( isInGLOrientation != isGLOriented ) {
             if( DEBUG ) {
                 System.err.println("XXX gl-orient "+isInGLOrientation+" -> "+isGLOriented);
             }
             isInGLOrientation = isGLOriented;
-            for(int i=0; i<videoFramesOrig.length; i++) {
-                videoFramesOrig[i].getTexture().setMustFlipVertically(!isGLOriented);
+            if( null != videoFramesOrig ) {
+                for(int i=0; i<videoFramesOrig.length; i++) {
+                    videoFramesOrig[i].getTexture().setMustFlipVertically(!isGLOriented);
+                }
+                attributesUpdated(GLMediaEventListener.EVENT_CHANGE_SIZE);
             }
-            attributesUpdated(GLMediaEventListener.EVENT_CHANGE_SIZE);
         }
     }
 
     @Override
-    public final URI getURI() {
-        return streamLoc;
-    }
+    public final URI getURI() { return streamLoc; }
 
     @Override
     public final int getVID() { return vid; }
@@ -1458,64 +1481,40 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     public final int getAID() { return aid; }
 
     @Override
-    public final String getVideoCodec() {
-        return vcodec;
-    }
+    public final String getVideoCodec() { return vcodec; }
 
     @Override
-    public final String getAudioCodec() {
-        return acodec;
-    }
+    public final String getAudioCodec() { return acodec; }
 
     @Override
-    public final int getVideoFrames() {
-        return videoFrames;
-    }
+    public final int getVideoFrames() { return videoFrames; }
 
     @Override
-    public final int getAudioFrames() {
-        return audioFrames;
-    }
+    public final int getAudioFrames() { return audioFrames; }
 
     @Override
-    public final int getDuration() {
-        return duration;
-    }
+    public final int getDuration() { return duration; }
 
     @Override
-    public final long getStreamBitrate() {
-        return bps_stream;
-    }
+    public final long getStreamBitrate() { return bps_stream; }
 
     @Override
-    public final int getVideoBitrate() {
-        return bps_video;
-    }
+    public final int getVideoBitrate() { return bps_video; }
 
     @Override
-    public final int getAudioBitrate() {
-        return bps_audio;
-    }
+    public final int getAudioBitrate() { return bps_audio; }
 
     @Override
-    public final float getFramerate() {
-        return fps;
-    }
+    public final float getFramerate() { return fps; }
 
     @Override
-    public final boolean isGLOriented() {
-        return isInGLOrientation;
-    }
+    public final boolean isGLOriented() { return isInGLOrientation; }
 
     @Override
-    public final int getWidth() {
-        return width;
-    }
+    public final int getWidth() { return width; }
 
     @Override
-    public final int getHeight() {
-        return height;
-    }
+    public final int getHeight() { return height; }
 
     @Override
     public final String toString() {
@@ -1568,7 +1567,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
 
     @Override
-    public final void addEventListener(GLMediaEventListener l) {
+    public final void addEventListener(final GLMediaEventListener l) {
         if(l == null) {
             return;
         }
@@ -1578,7 +1577,7 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     }
 
     @Override
-    public final void removeEventListener(GLMediaEventListener l) {
+    public final void removeEventListener(final GLMediaEventListener l) {
         if (l == null) {
             return;
         }
@@ -1597,33 +1596,33 @@ public abstract class GLMediaPlayerImpl implements GLMediaPlayer {
     private final Object eventListenersLock = new Object();
 
     @Override
-    public final Object getAttachedObject(String name) {
+    public final Object getAttachedObject(final String name) {
         return attachedObjects.get(name);
     }
 
     @Override
-    public final Object attachObject(String name, Object obj) {
+    public final Object attachObject(final String name, final Object obj) {
         return attachedObjects.put(name, obj);
     }
 
     @Override
-    public final Object detachObject(String name) {
+    public final Object detachObject(final String name) {
         return attachedObjects.remove(name);
     }
 
     private final HashMap<String, Object> attachedObjects = new HashMap<String, Object>();
 
-    protected static final String toHexString(long v) {
+    protected static final String toHexString(final long v) {
         return "0x"+Long.toHexString(v);
     }
-    protected static final String toHexString(int v) {
+    protected static final String toHexString(final int v) {
         return "0x"+Integer.toHexString(v);
     }
-    protected static final int getPropIntVal(Map<String, String> props, String key) {
+    protected static final int getPropIntVal(final Map<String, String> props, final String key) {
         final String val = props.get(key);
         try {
-            return Integer.valueOf(val).intValue();
-        } catch (NumberFormatException nfe) {
+            return Integer.parseInt(val);
+        } catch (final NumberFormatException nfe) {
             if(DEBUG) {
                 System.err.println("Not a valid integer for <"+key+">: <"+val+">");
             }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
index 6e006d9..117be54 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/JavaSoundAudioSink.java
@@ -31,7 +31,7 @@ public class JavaSoundAudioSink implements AudioSink {
     private DataLine.Info info;
     private SourceDataLine auline;
     private int bufferCount;
-    private byte [] sampleData = new byte[BUFFER_SIZE];
+    private final byte [] sampleData = new byte[BUFFER_SIZE];
     private boolean initialized = false;
     private AudioSink.AudioFormat chosenFormat = null;
 
@@ -43,7 +43,7 @@ public class JavaSoundAudioSink implements AudioSink {
         try {
             AudioSystem.getAudioFileTypes();
             ok = true;
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
 
         }
         staticAvailable=ok;
@@ -59,7 +59,7 @@ public class JavaSoundAudioSink implements AudioSink {
     public final float getPlaySpeed() { return 1.0f; } // FIXME
 
     @Override
-    public final boolean setPlaySpeed(float rate) {
+    public final boolean setPlaySpeed(final float rate) {
         return false; // FIXME
     }
 
@@ -70,7 +70,7 @@ public class JavaSoundAudioSink implements AudioSink {
     }
 
     @Override
-    public final boolean setVolume(float v) {
+    public final boolean setVolume(final float v) {
         // FIXME
         volume = v;
         return true;
@@ -87,12 +87,12 @@ public class JavaSoundAudioSink implements AudioSink {
     }
 
     @Override
-    public final boolean isSupported(AudioSink.AudioFormat format) {
+    public final boolean isSupported(final AudioSink.AudioFormat format) {
         return true;
     }
 
     @Override
-    public boolean init(AudioSink.AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) {
+    public boolean init(final AudioSink.AudioFormat requestedFormat, final float frameDuration, final int initialQueueSize, final int queueGrowAmount, final int queueLimit) {
         if( !staticAvailable ) {
             return false;
         }
@@ -112,13 +112,18 @@ public class JavaSoundAudioSink implements AudioSink {
             System.out.println("JavaSound audio sink");
             initialized=true;
             chosenFormat = requestedFormat;
-        } catch (Exception e) {
+        } catch (final Exception e) {
             initialized=false;
         }
         return true;
     }
 
     @Override
+    public final AudioFormat getChosenFormat() {
+        return chosenFormat;
+    }
+
+    @Override
     public boolean isPlaying() {
         return playRequested && auline.isRunning();
     }
@@ -181,28 +186,22 @@ public class JavaSoundAudioSink implements AudioSink {
     }
 
     @Override
-    public AudioFrame enqueueData(AudioDataFrame audioDataFrame) {
-        int byteSize = audioDataFrame.getByteSize();
-        final ByteBuffer byteBuffer = audioDataFrame.getData();
-        final byte[] bytes = new byte[byteSize];
+    public AudioFrame enqueueData(final int pts, final ByteBuffer byteBuffer, final int byteCount) {
+        final byte[] bytes = new byte[byteCount];
         final int p = byteBuffer.position();
-        byteBuffer.get(bytes, 0, byteSize);
+        byteBuffer.get(bytes, 0, byteCount);
         byteBuffer.position(p);
 
         int written = 0;
         int len;
-        while (byteSize > 0) {
-            len = auline.write(bytes, written, byteSize);
-            byteSize -= len;
+        int bytesLeft = byteCount;
+        while (bytesLeft > 0) {
+            len = auline.write(bytes, written, byteCount);
+            bytesLeft -= len;
             written += len;
         }
         playImpl();
-        return audioDataFrame;
-    }
-
-    @Override
-    public AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount) {
-        return enqueueData(new AudioDataFrame(pts, chosenFormat.getBytesDuration(byteCount), bytes, byteCount));
+        return new AudioDataFrame(pts, chosenFormat.getBytesDuration(byteCount), byteBuffer, byteCount);
     }
 
     @Override
@@ -219,7 +218,7 @@ public class JavaSoundAudioSink implements AudioSink {
     public int getQueuedTime() {
         return getQueuedTimeImpl( getQueuedByteCount() );
     }
-    private final int getQueuedTimeImpl(int byteCount) {
+    private final int getQueuedTimeImpl(final int byteCount) {
         final int bytesPerSample = chosenFormat.sampleSize >>> 3; // /8
         return byteCount / ( chosenFormat.channelCount * bytesPerSample * ( chosenFormat.sampleRate / 1000 ) );
     }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
index 8d3dbdf..7e27f17 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullAudioSink.java
@@ -1,21 +1,56 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
 package jogamp.opengl.util.av;
 
-
 import java.nio.ByteBuffer;
 
 import com.jogamp.opengl.util.av.AudioSink;
 
 public class NullAudioSink implements AudioSink {
 
-    @Override
-    public boolean isInitialized() {
-        return true;
-    }
-
     private volatile float playSpeed = 1.0f;
     private volatile boolean playRequested = false;
+    private volatile int playingPTS = AudioFrame.INVALID_PTS;
     private float volume = 1.0f;
 
+    private AudioFormat chosenFormat;
+    private boolean initialized;
+
+    public NullAudioSink() {
+        initialized = true;
+        chosenFormat = null;
+    }
+
+    @Override
+    public boolean isInitialized() {
+        return initialized;
+    }
+
     @Override
     public final float getPlaySpeed() { return playSpeed; }
 
@@ -35,7 +70,7 @@ public class NullAudioSink implements AudioSink {
     }
 
     @Override
-    public final boolean setVolume(float v) {
+    public final boolean setVolume(final float v) {
         // FIXME
         volume = v;
         return true;
@@ -52,16 +87,32 @@ public class NullAudioSink implements AudioSink {
     }
 
     @Override
-    public final boolean isSupported(AudioFormat format) {
+    public final boolean isSupported(final AudioFormat format) {
+        /**
+         * If we like to emulate constraints ..
+         *
+        if( format.planar || !format.littleEndian ) {
+            return false;
+        }
+        if( format.sampleRate != DefaultFormat.sampleRate )  {
+            return false;
+        }
+        */
         return true;
     }
 
     @Override
-    public boolean init(AudioFormat requestedFormat, float frameDuration, int initialQueueSize, int queueGrowAmount, int queueLimit) {
+    public boolean init(final AudioFormat requestedFormat, final float frameDuration, final int initialQueueSize, final int queueGrowAmount, final int queueLimit) {
+        chosenFormat = requestedFormat;
         return true;
     }
 
     @Override
+    public final AudioFormat getChosenFormat() {
+        return chosenFormat;
+    }
+
+    @Override
     public boolean isPlaying() {
         return playRequested;
     }
@@ -82,6 +133,8 @@ public class NullAudioSink implements AudioSink {
 
     @Override
     public void destroy() {
+        initialized = false;
+        chosenFormat = null;
     }
 
     @Override
@@ -110,7 +163,7 @@ public class NullAudioSink implements AudioSink {
     }
 
     @Override
-    public final int getPTS() { return 0; }
+    public final int getPTS() { return playingPTS; }
 
     @Override
     public int getFreeFrameCount() {
@@ -118,12 +171,11 @@ public class NullAudioSink implements AudioSink {
     }
 
     @Override
-    public AudioFrame enqueueData(AudioDataFrame audioDataFrame) {
-        return null;
-    }
-
-    @Override
-    public AudioFrame enqueueData(int pts, ByteBuffer bytes, int byteCount) {
+    public AudioFrame enqueueData(final int pts, final ByteBuffer bytes, final int byteCount) {
+        if( !initialized || null == chosenFormat ) {
+            return null;
+        }
+        playingPTS = pts;
         return null;
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
index 79129e5..4a15c74 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/NullGLMediaPlayer.java
@@ -61,7 +61,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected final boolean setPlaySpeedImpl(float rate) {
+    protected final boolean setPlaySpeedImpl(final float rate) {
         return false;
     }
 
@@ -77,14 +77,14 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected final int seekImpl(int msec) {
+    protected final int seekImpl(final int msec) {
         pos_ms = msec;
         validatePos();
         return pos_ms;
     }
 
     @Override
-    protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
+    protected final int getNextTextureImpl(final GL gl, final TextureFrame nextFrame) {
         final int pts = getAudioPTSImpl();
         nextFrame.setPTS( pts );
         return pts;
@@ -98,7 +98,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected final void destroyImpl(GL gl) {
+    protected final void destroyImpl(final GL gl) {
         if(null != texData) {
             texData.destroy();
             texData = null;
@@ -108,17 +108,17 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     public final static TextureData createTestTextureData() {
         TextureData res = null;
         try {
-            URLConnection urlConn = IOUtil.getResource("jogl/util/data/av/test-ntsc01-57x32.png", NullGLMediaPlayer.class.getClassLoader());
+            final URLConnection urlConn = IOUtil.getResource("jogl/util/data/av/test-ntsc01-28x16.png", NullGLMediaPlayer.class.getClassLoader());
             if(null != urlConn) {
                 res = TextureIO.newTextureData(GLProfile.getGL2ES2(), urlConn.getInputStream(), false, TextureIO.PNG);
             }
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
         }
         if(null == res) {
             final int w = 160;
             final int h =  90;
-            ByteBuffer buffer = Buffers.newDirectByteBuffer(w*h*4);
+            final ByteBuffer buffer = Buffers.newDirectByteBuffer(w*h*4);
             while(buffer.hasRemaining()) {
                 buffer.put((byte) 0xEA); buffer.put((byte) 0xEA); buffer.put((byte) 0xEA); buffer.put((byte) 0xEA);
             }
@@ -132,7 +132,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected final void initStreamImpl(int vid, int aid) throws IOException {
+    protected final void initStreamImpl(final int vid, final int aid) throws IOException {
         texData = createTestTextureData();
         final float _fps = 24f;
         final int _duration = 10*60*1000; // msec
@@ -143,8 +143,8 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
                          _totalFrames, 0, _duration, "png-static", null);
     }
     @Override
-    protected final void initGLImpl(GL gl) throws IOException, GLException {
-        isInGLOrientation = true;
+    protected final void initGLImpl(final GL gl) throws IOException, GLException {
+        setIsGLOriented(true);
     }
 
     /**
@@ -154,13 +154,13 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
      * </p>
      */
     @Override
-    protected int validateTextureCount(int desiredTextureCount) {
+    protected int validateTextureCount(final int desiredTextureCount) {
         return TEXTURE_COUNT_MIN;
     }
 
     @Override
-    protected final TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
-        final Texture texture = super.createTexImageImpl(gl, texName, width, height);
+    protected final TextureSequence.TextureFrame createTexImage(final GL gl, final int texName) {
+        final Texture texture = super.createTexImageImpl(gl, texName, getWidth(), getHeight());
         if(null != texData) {
             texture.updateImage(gl, texData);
         }
@@ -168,7 +168,7 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected final void destroyTexFrame(GL gl, TextureSequence.TextureFrame frame) {
+    protected final void destroyTexFrame(final GL gl, final TextureSequence.TextureFrame frame) {
         super.destroyTexFrame(gl, frame);
     }
 
@@ -181,8 +181,8 @@ public class NullGLMediaPlayer extends GLMediaPlayerImpl {
             pos_ms = getDuration();
             considerPausing = true;
         }
-        if(considerPausing && state == State.Playing) {
-            state = State.Paused;
+        if( considerPausing && State.Playing == getState() ) {
+            setState(State.Paused);
         }
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/VideoPixelFormat.java b/src/jogl/classes/jogamp/opengl/util/av/VideoPixelFormat.java
new file mode 100644
index 0000000..44d83e7
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/av/VideoPixelFormat.java
@@ -0,0 +1,191 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl.util.av;
+
+/** FFMPEG/libAV compatible video pixel format */
+public enum VideoPixelFormat {
+    // NONE= -1,
+    /** planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) */
+    YUV420P,
+    /** packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr ( sharing Cb and Cr w/ 2 pixels )*/
+    YUYV422,
+    /** packed RGB 8:8:8, 24bpp, RGBRGB... */
+    RGB24,
+    /** packed RGB 8:8:8, 24bpp, BGRBGR... */
+    BGR24,
+    /** planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) */
+    YUV422P,
+    /** planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) */
+    YUV444P,
+    /** planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples) */
+    YUV410P,
+    /** planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) */
+    YUV411P,
+    /** Y, 8bpp */
+    GRAY8,
+    /** Y,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb */
+    MONOWHITE,
+    /** Y,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb */
+    MONOBLACK,
+    /** 8 bit with RGB32 palette */
+    PAL8,
+    /** planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of YUV420P and setting color_range */
+    YUVJ420P,
+    /** planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of YUV422P and setting color_range */
+    YUVJ422P,
+    /** planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of YUV444P and setting color_range */
+    YUVJ444P,
+    /** XVideo Motion Acceleration via common packet passing */
+    XVMC_MPEG2_MC,
+    /** */
+    XVMC_MPEG2_IDCT,
+    /** packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 */
+    UYVY422,
+    /** packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 */
+    UYYVYY411,
+    /** packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb) */
+    BGR8,
+    /** packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits */
+    BGR4,
+    /** packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb) */
+    BGR4_BYTE,
+    /** packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb) */
+    RGB8,
+    /** packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits */
+    RGB4,
+    /** packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb) */
+    RGB4_BYTE,
+    /** planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) */
+    NV12,
+    /** as above, but U and V bytes are swapped */
+    NV21,
+
+    /** packed ARGB 8:8:8:8, 32bpp, ARGBARGB... */
+    ARGB,
+    /** packed RGBA 8:8:8:8, 32bpp, RGBARGBA... */
+    RGBA,
+    /** packed ABGR 8:8:8:8, 32bpp, ABGRABGR... */
+    ABGR,
+    /** packed BGRA 8:8:8:8, 32bpp, BGRABGRA... */
+    BGRA,
+
+    /** Y, 16bpp, big-endian */
+    GRAY16BE,
+    /** Y        , 16bpp, little-endian */
+    GRAY16LE,
+    /** planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) */
+    YUV440P,
+    /** planar YUV 4:4:0 full scale (JPEG), deprecated in favor of YUV440P and setting color_range */
+    YUVJ440P,
+    /** planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) */
+    YUVA420P,
+    /** H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
+    VDPAU_H264,
+    /** MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
+    VDPAU_MPEG1,
+    /** MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
+    VDPAU_MPEG2,
+    /** WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
+    VDPAU_WMV3,
+    /** VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
+    VDPAU_VC1,
+    /** packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian */
+    RGB48BE,
+    /** packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian */
+    RGB48LE,
+
+    RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
+    RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
+    RGB555BE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
+    RGB555LE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
+
+    BGR565BE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
+    BGR565LE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
+    BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
+    BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
+
+    VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
+    VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
+    VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+
+    YUV420P16LE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    YUV420P16BE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    YUV422P16LE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    YUV422P16BE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    YUV444P16LE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    YUV444P16BE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    VDPAU_MPEG4,  ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
+    DXVA2_VLD,    ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
+
+    RGB444LE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
+    RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
+    BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
+    BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
+    Y400A,     ///< 8bit gray, 8bit alpha
+    BGR48BE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
+    BGR48LE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
+    YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
+    YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
+    YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
+    YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
+    YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
+    YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
+    VDA_VLD,    ///< hardware decoding through VDA
+    GBRP,      ///< planar GBR 4:4:4 24bpp
+    GBRP9BE,   ///< planar GBR 4:4:4 27bpp, big endian
+    GBRP9LE,   ///< planar GBR 4:4:4 27bpp, little endian
+    GBRP10BE,  ///< planar GBR 4:4:4 30bpp, big endian
+    GBRP10LE,  ///< planar GBR 4:4:4 30bpp, little endian
+    GBRP16BE,  ///< planar GBR 4:4:4 48bpp, big endian
+    GBRP16LE,  ///< planar GBR 4:4:4 48bpp, little endian
+    COUNT      ///< number of pixel formats in this list
+    ;
+    /**
+     * Returns the matching PixelFormat value corresponding to the given PixelFormat's integer ordinal.
+     * <pre>
+     *   given:
+     *     ordinal = enumValue.ordinal()
+     *   reverse:
+     *     enumValue = EnumClass.values()[ordinal]
+     * </pre>
+     * @throws IllegalArgumentException if the given ordinal is out of range, i.e. not within [ 0 .. PixelFormat.values().length-1 ]
+     */
+    public static VideoPixelFormat valueOf(final int ordinal) throws IllegalArgumentException {
+        final VideoPixelFormat[] all = VideoPixelFormat.values();
+        if( 0 <= ordinal && ordinal < all.length ) {
+            return all[ordinal];
+        }
+        throw new IllegalArgumentException("Ordinal "+ordinal+" out of range of PixelFormat.values()[0.."+(all.length-1)+"]");
+    }
+}
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
index a6a6fba..42a908f 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGDynamicLibraryBundleInfo.java
@@ -188,12 +188,12 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
         GLProfile.initSingleton();
         boolean _ready = false;
         /** util, format, codec, device, avresample, swresample */
-        boolean[] _loaded= new boolean[6];
+        final boolean[] _loaded= new boolean[6];
         /** util, format, codec, avresample, swresample */
-        VersionNumber[] _versions = new VersionNumber[5];
+        final VersionNumber[] _versions = new VersionNumber[5];
         try {
             _ready = initSymbols(_loaded, _versions);
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
         }
         libsUFCLoaded = _loaded[LIB_IDX_UTI] && _loaded[LIB_IDX_FMT] && _loaded[LIB_IDX_COD];
@@ -214,14 +214,17 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
             natives = null;
             ready = false;
         } else {
-            if( avCodecVersion.getMajor() == 53 && avFormatVersion.getMajor() == 53 && avUtilVersion.getMajor() == 51 ) {
+            final int avCodecMajor = avCodecVersion.getMajor();
+            final int avFormatMajor = avFormatVersion.getMajor();
+            final int avUtilMajor = avUtilVersion.getMajor();
+            if(        avCodecMajor == 53 && avFormatMajor == 53 && avUtilMajor == 51 ) {
                 // lavc53.lavf53.lavu51
                 natives = new FFMPEGv08Natives();
-            } else if( avCodecVersion.getMajor() == 54 && avFormatVersion.getMajor() == 54 && avUtilVersion.getMajor() == 52 ) {
+            } else if( avCodecMajor == 54 && avFormatMajor == 54 && avUtilMajor == 52 ) {
                 // lavc54.lavf54.lavu52.lavr01
                 natives = new FFMPEGv09Natives();
-            } else if( avCodecVersion.getMajor() == 55 && avFormatVersion.getMajor() == 55 && avUtilVersion.getMajor() == 52 ) {
-                // lavc55.lavf55.lavu52.lavr01
+            } else if( avCodecMajor == 55 && avFormatMajor == 55 && ( avUtilMajor == 52 || avUtilMajor == 53 ) ) {
+                // lavc55.lavf55.lavu52.lavr01 (ffmpeg) or lavc55.lavf55.lavu53.lavr01 (libav)
                 natives = new FFMPEGv10Natives();
             } else {
                 System.err.println("LIB_AV No Version/Native-Impl Match");
@@ -247,7 +250,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
      * @param versions 5: util, format, codec, avresample, swresample
      * @return
      */
-    private static final boolean initSymbols(boolean[] loaded, VersionNumber[] versions) {
+    private static final boolean initSymbols(final boolean[] loaded, final VersionNumber[] versions) {
         for(int i=0; i<6; i++) {
             loaded[i] = false;
         }
@@ -328,7 +331,7 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
 
     @Override
     public final List<List<String>> getToolLibNames() {
-        List<List<String>> libsList = new ArrayList<List<String>>();
+        final List<List<String>> libsList = new ArrayList<List<String>>();
 
         // 6: util, format, codec, device, avresample, swresample
 
@@ -421,12 +424,12 @@ class FFMPEGDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
     }
 
     @Override
-    public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+    public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
         return 0;
     }
 
     @Override
-    public final boolean useToolGetProcAdressFirst(String funcName) {
+    public final boolean useToolGetProcAdressFirst(final String funcName) {
         return false;
     }
 
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
index 344ba48..8ac1232 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGMediaPlayer.java
@@ -49,10 +49,11 @@ import com.jogamp.opengl.util.av.AudioSinkFactory;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
 import com.jogamp.opengl.util.texture.Texture;
 
+import jogamp.common.os.PlatformPropsImpl;
 import jogamp.opengl.GLContextImpl;
+import jogamp.opengl.util.av.AudioSampleFormat;
 import jogamp.opengl.util.av.GLMediaPlayerImpl;
-import jogamp.opengl.util.av.impl.FFMPEGNatives.PixelFormat;
-import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
+import jogamp.opengl.util.av.VideoPixelFormat;
 
 /***
  * Implementation utilizes <a href="http://libav.org/">Libav</a>
@@ -79,12 +80,12 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
  * Implements pixel format conversion to <i>RGB</i> via
  * fragment shader texture-lookup functions:
  * <ul>
- *   <li>{@link PixelFormat#YUV420P}</li>
- *   <li>{@link PixelFormat#YUVJ420P}</li>
- *   <li>{@link PixelFormat#YUV422P}</li>
- *   <li>{@link PixelFormat#YUVJ422P}</li>
- *   <li>{@link PixelFormat#YUYV422}</li>
- *   <li>{@link PixelFormat#BGR24}</li>
+ *   <li>{@link VideoPixelFormat#YUV420P}</li>
+ *   <li>{@link VideoPixelFormat#YUVJ420P}</li>
+ *   <li>{@link VideoPixelFormat#YUV422P}</li>
+ *   <li>{@link VideoPixelFormat#YUVJ422P}</li>
+ *   <li>{@link VideoPixelFormat#YUYV422}</li>
+ *   <li>{@link VideoPixelFormat#BGR24}</li>
  * </ul>
  * </p>
  * <p>
@@ -107,9 +108,9 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
  * Currently we are binary compatible w/:
  * <table border="1">
  * <tr><th>libav / ffmpeg</th><th>lavc</th><th>lavf</th><th>lavu</th><th>lavr</th>    <th>FFMPEG* class</th></tr>
- * <tr><td>0.8</td>           <td>53</td>  <td>53</td>  <td>51</td>  <td></td>        <td>FFMPEGv08</td></tr>
- * <tr><td>9.0 / 1.2</td>     <td>54</td>  <td>54</td>  <td>52</td>  <td>01/00</td>   <td>FFMPEGv09</td></tr>
- * <tr><td>10 / 2</td>        <td>55</td>  <td>55</td>  <td>52</td>  <td>01/00</td>   <td>FFMPEGv10</td></tr>
+ * <tr><td>0.8</td>           <td>53</td>  <td>53</td>  <td>51</td>     <td></td>        <td>FFMPEGv08</td></tr>
+ * <tr><td>9.0 / 1.2</td>     <td>54</td>  <td>54</td>  <td>52</td>     <td>01/00</td>   <td>FFMPEGv09</td></tr>
+ * <tr><td>10 / 2</td>        <td>55</td>  <td>55</td>  <td>53/52</td>  <td>01/00</td>   <td>FFMPEGv10</td></tr>
  * </table>
  * </p>
  * <p>
@@ -138,7 +139,11 @@ import jogamp.opengl.util.av.impl.FFMPEGNatives.SampleFormat;
  *     <li>http://ffmpeg.zeranoe.com/builds/ (ffmpeg) <i>recommended, works w/ dshow</i></li>
  *     <li>http://win32.libav.org/releases/  (libav)</li>
  *   </ul></li>
- *   <li>MacOSX: http://ffmpegmac.net/</li>
+ *   <li>MacOSX using Homebrew
+ *   <ul>
+ *   <li>https://github.com/Homebrew/homebrew/wiki/Installation</li>
+ *   <li>https://trac.ffmpeg.org/wiki/CompilationGuide/MacOSX</li>
+ *   </ul></li>
  *   <li>OpenIndiana/Solaris:<pre>
  *       pkg set-publisher -p http://pkg.openindiana.org/sfe-encumbered.
  *       pkt install pkg:/video/ffmpeg
@@ -194,9 +199,14 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                 System.err.println("LIB_AV Device  : [loaded "+FFMPEGDynamicLibraryBundleInfo.avDeviceLoaded()+"]");
                 System.err.println("LIB_AV Class   : "+(null!= natives ? natives.getClass().getSimpleName() : "n/a"));
             }
-            libAVVersionGood = avCodecMajorVersionCC  == avCodecVersion.getMajor() &&
-                               avFormatMajorVersionCC == avFormatVersion.getMajor() &&
-                               avUtilMajorVersionCC   == avUtilVersion.getMajor() &&
+            final int avCodecMajor = avCodecVersion.getMajor();
+            final int avFormatMajor = avFormatVersion.getMajor();
+            final int avUtilMajor = avUtilVersion.getMajor();
+            libAVVersionGood = avCodecMajorVersionCC  == avCodecMajor &&
+                               avFormatMajorVersionCC == avFormatMajor &&
+                               ( avUtilMajorVersionCC == avUtilMajor ||
+                                 55 == avCodecMajorVersionCC && 53 == avUtilMajorVersionCC && 52 == avUtilMajor /* ffmpeg 2.x */
+                               ) &&
                                ( !avResampleLoaded || avResampleMajorVersionCC < 0 || avResampleMajorVersionCC  == avResampleVersion.getMajor() ) &&
                                ( !swResampleLoaded || swResampleMajorVersionCC < 0 || swResampleMajorVersionCC  == swResampleVersion.getMajor() ) ;
             if( !libAVVersionGood ) {
@@ -228,7 +238,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
 
     private String texLookupFuncName = "ffmpegTexture2D";
     private boolean usesTexLookupShader = false;
-    private PixelFormat vPixelFmt = null;
+    private VideoPixelFormat vPixelFmt = null;
     private int vPlanes = 0;
     private int vBitsPerPixel = 0;
     private int vBytesPerPixelPerPlane = 0;
@@ -256,7 +266,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected final void destroyImpl(GL gl) {
+    protected final void destroyImpl(final GL gl) {
         if (moviePtr != 0) {
             natives.destroyInstance0(moviePtr);
             moviePtr = 0;
@@ -274,7 +284,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     public static final String dev_video_linux = "/dev/video";
 
     @Override
-    protected final void initStreamImpl(int vid, int aid) throws IOException {
+    protected final void initStreamImpl(final int vid, final int aid) throws IOException {
         if(0==moviePtr) {
             throw new GLException("FFMPEG native instance null");
         }
@@ -282,7 +292,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             System.err.println("initStream: p1 "+this);
         }
 
-        final String streamLocS = IOUtil.decodeURIIfFilePath(streamLoc);
+        final String streamLocS = IOUtil.decodeURIIfFilePath(getURI());
         destroyAudioSink();
         if( GLMediaPlayer.STREAM_ID_NONE == aid ) {
             audioSink = AudioSinkFactory.createNull();
@@ -300,7 +310,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         int rw=-1, rh=-1, rr=-1;
         String sizes = null;
         if( isCameraInput ) {
-            switch(Platform.OS_TYPE) {
+            switch(PlatformPropsImpl.OS_TYPE) {
                 case ANDROID:
                     // ??
                 case FREEBSD:
@@ -335,14 +345,14 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
          // setStream(..) issues updateAttributes*(..), and defines avChosenAudioFormat, vid, aid, .. etc
         if(DEBUG) {
             System.err.println("initStream: p3 cameraPath "+cameraPath+", isCameraInput "+isCameraInput);
-            System.err.println("initStream: p3 stream "+streamLoc+" -> "+streamLocS+" -> "+resStreamLocS);
+            System.err.println("initStream: p3 stream "+getURI()+" -> "+streamLocS+" -> "+resStreamLocS);
             System.err.println("initStream: p3 vid "+vid+", sizes "+sizes+", reqVideo "+rw+"x"+rh+"@"+rr+", aid "+aid+", aMaxChannelCount "+aMaxChannelCount+", aPrefSampleRate "+aPrefSampleRate);
         }
         natives.setStream0(moviePtr, resStreamLocS, isCameraInput, vid, sizes, rw, rh, rr, aid, aMaxChannelCount, aPrefSampleRate);
     }
 
     @Override
-    protected final void initGLImpl(GL gl) throws IOException, GLException {
+    protected final void initGLImpl(final GL gl) throws IOException, GLException {
         if(0==moviePtr) {
             throw new GLException("FFMPEG native instance null");
         }
@@ -350,7 +360,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             throw new GLException("AudioSink null");
         }
         final int audioQueueLimit;
-        if( null != gl && STREAM_ID_NONE != vid ) {
+        if( null != gl && STREAM_ID_NONE != getVID() ) {
             final GLContextImpl ctx = (GLContextImpl)gl.getContext();
             AccessController.doPrivileged(new PrivilegedAction<Object>() {
                 @Override
@@ -371,7 +381,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             System.err.println("initGL: p3 avChosen "+avChosenAudioFormat);
         }
 
-        if( STREAM_ID_NONE == aid ) {
+        if( STREAM_ID_NONE == getAID() ) {
             audioSink.destroy();
             audioSink = AudioSinkFactory.createNull();
             audioSink.init(AudioSink.DefaultFormat, 0, AudioSink.DefaultInitialQueueSize, AudioSink.DefaultQueueGrowAmount, audioQueueLimit);
@@ -395,9 +405,9 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
             System.err.println("initGL: p4 chosen "+audioSink);
         }
 
-        if( null != gl && STREAM_ID_NONE != vid ) {
+        if( null != gl && STREAM_ID_NONE != getVID() ) {
             int tf, tif=GL.GL_RGBA; // texture format and internal format
-            int tt = GL.GL_UNSIGNED_BYTE;
+            final int tt = GL.GL_UNSIGNED_BYTE;
             switch(vBytesPerPixelPerPlane) {
                 case 1:
                     if( gl.isGL3ES3() ) {
@@ -405,22 +415,22 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
                         tf = GL2ES2.GL_RED;   tif=GL2ES2.GL_RED; singleTexComp = "r";
                     } else {
                         // ALPHA is supported on ES2 and GL2, i.e. <= GL3 [core] or compatibility
-                        tf = GL2ES2.GL_ALPHA; tif=GL2ES2.GL_ALPHA; singleTexComp = "a";
+                        tf = GL.GL_ALPHA; tif=GL.GL_ALPHA; singleTexComp = "a";
                     }
                     break;
 
-                case 2: if( vPixelFmt == PixelFormat.YUYV422 ) {
+                case 2: if( vPixelFmt == VideoPixelFormat.YUYV422 ) {
                             // YUYV422: // < packed YUV 4:2:2, 2x 16bpp, Y0 Cb Y1 Cr
                             // Stuffed into RGBA half width texture
-                            tf = GL2ES2.GL_RGBA; tif=GL2ES2.GL_RGBA; break;
+                            tf = GL.GL_RGBA; tif=GL.GL_RGBA; break;
                         } else {
                             tf = GL2ES2.GL_RG;   tif=GL2ES2.GL_RG; break;
                         }
-                case 3: tf = GL2ES2.GL_RGB;   tif=GL.GL_RGB;   break;
-                case 4: if( vPixelFmt == PixelFormat.BGRA ) {
-                            tf = GL2ES2.GL_BGRA;  tif=GL.GL_RGBA;  break;
+                case 3: tf = GL.GL_RGB;   tif=GL.GL_RGB;   break;
+                case 4: if( vPixelFmt == VideoPixelFormat.BGRA ) {
+                            tf = GL.GL_BGRA;  tif=GL.GL_RGBA;  break;
                         } else {
-                            tf = GL2ES2.GL_RGBA;  tif=GL.GL_RGBA;  break;
+                            tf = GL.GL_RGBA;  tif=GL.GL_RGBA;  break;
                         }
                 default: throw new RuntimeException("Unsupported bytes-per-pixel / plane "+vBytesPerPixelPerPlane);
             }
@@ -433,7 +443,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         }
     }
     @Override
-    protected final TextureFrame createTexImage(GL gl, int texName) {
+    protected final TextureFrame createTexImage(final GL gl, final int texName) {
         return new TextureFrame( createTexImageImpl(gl, texName, texWidth, texHeight) );
     }
 
@@ -451,12 +461,12 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     /**
      * Native callback
      * Converts the given libav/ffmpeg values to {@link AudioFormat} and returns {@link AudioSink#isSupported(AudioFormat)}.
-     * @param audioSampleFmt ffmpeg/libav audio-sample-format, see {@link SampleFormat}.
+     * @param audioSampleFmt ffmpeg/libav audio-sample-format, see {@link AudioSampleFormat}.
      * @param audioSampleRate sample rate in Hz (1/s)
      * @param audioChannels number of channels
      */
-    final boolean isAudioFormatSupported(int audioSampleFmt, int audioSampleRate, int audioChannels) {
-        final SampleFormat avFmt = SampleFormat.valueOf(audioSampleFmt);
+    final boolean isAudioFormatSupported(final int audioSampleFmt, final int audioSampleRate, final int audioChannels) {
+        final AudioSampleFormat avFmt = AudioSampleFormat.valueOf(audioSampleFmt);
         final AudioFormat audioFormat = avAudioFormat2Local(avFmt, audioSampleRate, audioChannels);
         final boolean res = audioSink.isSupported(audioFormat);
         if( DEBUG ) {
@@ -467,11 +477,11 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
 
     /**
      * Returns {@link AudioFormat} as converted from the given libav/ffmpeg values.
-     * @param audioSampleFmt ffmpeg/libav audio-sample-format, see {@link SampleFormat}.
+     * @param audioSampleFmt ffmpeg/libav audio-sample-format, see {@link AudioSampleFormat}.
      * @param audioSampleRate sample rate in Hz (1/s)
      * @param audioChannels number of channels
      */
-    private final AudioFormat avAudioFormat2Local(SampleFormat audioSampleFmt, int audioSampleRate, int audioChannels) {
+    private final AudioFormat avAudioFormat2Local(final AudioSampleFormat audioSampleFmt, final int audioSampleRate, final int audioChannels) {
         final int sampleSize;
         boolean planar = true;
         boolean fixedP = true;
@@ -531,10 +541,10 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
      * @param audioChannels
      * @param audioSamplesPerFrameAndChannel in audio samples per frame and channel
      */
-    void setupFFAttributes(int vid, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
-                          int tWd0, int tWd1, int tWd2, int vW, int vH,
-                          int aid, int audioSampleFmt, int audioSampleRate,
-                          int audioChannels, int audioSamplesPerFrameAndChannel) {
+    void setupFFAttributes(final int vid, final int pixFmt, final int planes, final int bitsPerPixel, final int bytesPerPixelPerPlane,
+                          final int tWd0, final int tWd1, final int tWd2, final int vW, final int vH,
+                          final int aid, final int audioSampleFmt, final int audioSampleRate,
+                          final int audioChannels, final int audioSamplesPerFrameAndChannel) {
         // defaults ..
         vPixelFmt = null;
         vPlanes = 0;
@@ -546,7 +556,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         final int[] vTexWidth = { 0, 0, 0 }; // per plane
 
         if( STREAM_ID_NONE != vid ) {
-            vPixelFmt = PixelFormat.valueOf(pixFmt);
+            vPixelFmt = VideoPixelFormat.valueOf(pixFmt);
             vPlanes = planes;
             vBitsPerPixel = bitsPerPixel;
             vBytesPerPixelPerPlane = bytesPerPixelPerPlane;
@@ -598,12 +608,12 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         }
 
         // defaults ..
-        final SampleFormat aSampleFmt;
+        final AudioSampleFormat aSampleFmt;
         avChosenAudioFormat = null;;
         this.audioSamplesPerFrameAndChannel = 0;
 
         if( STREAM_ID_NONE != aid ) {
-            aSampleFmt = SampleFormat.valueOf(audioSampleFmt);
+            aSampleFmt = AudioSampleFormat.valueOf(audioSampleFmt);
             avChosenAudioFormat = avAudioFormat2Local(aSampleFmt, audioSampleRate, audioChannels);
             this.audioSamplesPerFrameAndChannel = audioSamplesPerFrameAndChannel;
         } else {
@@ -632,8 +642,8 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
      * @param tWd1
      * @param tWd2
      */
-    void updateVidAttributes(boolean isInGLOrientation, int pixFmt, int planes, int bitsPerPixel, int bytesPerPixelPerPlane,
-                             int tWd0, int tWd1, int tWd2, int vW, int vH) {
+    void updateVidAttributes(final boolean isInGLOrientation, final int pixFmt, final int planes, final int bitsPerPixel, final int bytesPerPixelPerPlane,
+                             final int tWd0, final int tWd1, final int tWd2, final int vW, final int vH) {
     }
 
     /**
@@ -644,8 +654,8 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
      * Otherwise the call is delegated to it's super class.
      */
     @Override
-    public final String getTextureLookupFunctionName(String desiredFuncName) throws IllegalStateException {
-        if(State.Uninitialized == state) {
+    public final String getTextureLookupFunctionName(final String desiredFuncName) throws IllegalStateException {
+        if( State.Uninitialized == getState() ) {
             throw new IllegalStateException("Instance not initialized: "+this);
         }
         if( usesTexLookupShader ) {
@@ -665,7 +675,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
      */
     @Override
     public final String getTextureLookupFragmentShaderImpl() throws IllegalStateException {
-      if(State.Uninitialized == state) {
+      if( State.Uninitialized == getState() ) {
           throw new IllegalStateException("Instance not initialized: "+this);
       }
       if( !usesTexLookupShader ) {
@@ -677,8 +687,8 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         case YUV420P: // < planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples)
           return
               "vec4 "+texLookupFuncName+"(in "+getTextureSampler2DType()+" image, in vec2 texCoord) {\n"+
-              "  vec2 u_off = vec2("+tc_w_1+", 0.0);\n"+
-              "  vec2 v_off = vec2("+tc_w_1+", 0.5);\n"+
+              "  const vec2 u_off = vec2("+tc_w_1+", 0.0);\n"+
+              "  const vec2 v_off = vec2("+tc_w_1+", 0.5);\n"+
               "  vec2 tc_half = texCoord*0.5;\n"+
               "  float y,u,v,r,g,b;\n"+
               "  y = texture2D(image, texCoord)."+singleTexComp+";\n"+
@@ -698,8 +708,8 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         case YUV422P: ///< planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples)
           return
               "vec4 "+texLookupFuncName+"(in "+getTextureSampler2DType()+" image, in vec2 texCoord) {\n"+
-              "  vec2 u_off = vec2("+tc_w_1+"      , 0.0);\n"+
-              "  vec2 v_off = vec2("+tc_w_1+" * 1.5, 0.0);\n"+
+              "  const vec2 u_off = vec2("+tc_w_1+"      , 0.0);\n"+
+              "  const vec2 v_off = vec2("+tc_w_1+" * 1.5, 0.0);\n"+
               "  vec2 tc_halfw = vec2(texCoord.x*0.5, texCoord.y);\n"+
               "  float y,u,v,r,g,b;\n"+
               "  y = texture2D(image, texCoord)."+singleTexComp+";\n"+
@@ -776,7 +786,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected final synchronized int seekImpl(int msec) {
+    protected final synchronized int seekImpl(final int msec) {
         if(0==moviePtr) {
             throw new GLException("FFMPEG native instance null");
         }
@@ -784,18 +794,18 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
     }
 
     @Override
-    protected void preNextTextureImpl(GL gl) {
+    protected void preNextTextureImpl(final GL gl) {
         psm.setUnpackAlignment(gl, 1); // RGBA ? 4 : 1
         gl.glActiveTexture(GL.GL_TEXTURE0+getTextureUnit());
     }
 
     @Override
-    protected void postNextTextureImpl(GL gl) {
+    protected void postNextTextureImpl(final GL gl) {
         psm.restore(gl);
     }
 
     @Override
-    protected final int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
+    protected final int getNextTextureImpl(final GL gl, final TextureFrame nextFrame) {
         if(0==moviePtr) {
             throw new GLException("FFMPEG native instance null");
         }
@@ -808,7 +818,7 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
 
         /** Try decode up to 10 packets to find one containing video. */
         for(int i=0; TimeFrameI.INVALID_PTS == vPTS && 10 > i; i++) {
-           vPTS = natives.readNextPacket0(moviePtr, textureTarget, textureFormat, textureType);
+           vPTS = natives.readNextPacket0(moviePtr, getTextureTarget(), getTextureFormat(), getTextureType());
         }
         if( null != nextFrame ) {
             nextFrame.setPTS(vPTS);
@@ -816,9 +826,9 @@ public class FFMPEGMediaPlayer extends GLMediaPlayerImpl {
         return vPTS;
     }
 
-    final void pushSound(ByteBuffer sampleData, int data_size, int audio_pts) {
+    final void pushSound(final ByteBuffer sampleData, final int data_size, final int audio_pts) {
         setFirstAudioPTS2SCR( audio_pts );
-        if( 1.0f == playSpeed || audioSinkPlaySpeedSet ) {
+        if( 1.0f == getPlaySpeed() || audioSinkPlaySpeedSet ) {
             audioSink.enqueueData( audio_pts, sampleData, data_size);
         }
     }
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
index b4b887b..8fd4390 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGNatives.java
@@ -33,7 +33,7 @@ import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
     private static final Object mutex_avcodec_openclose_jni = new Object();
 
-    final boolean initSymbols0(long[] symbols, int count) {
+    final boolean initSymbols0(final long[] symbols, final int count) {
         return initSymbols0(mutex_avcodec_openclose_jni, symbols, count);
     }
     abstract boolean initSymbols0(Object mutex_avcodec_openclose, long[] symbols, int count);
@@ -79,203 +79,4 @@ import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
     abstract int play0(long moviePtr);
     abstract int pause0(long moviePtr);
     abstract int seek0(long moviePtr, int position);
-
-    /** FFMPEG/libAV Audio Sample Format */
-    public static enum SampleFormat {
-        // NONE = -1,
-        U8,          ///< unsigned 8 bits
-        S16,         ///< signed 16 bits
-        S32,         ///< signed 32 bits
-        FLT,         ///< float
-        DBL,         ///< double
-
-        U8P,         ///< unsigned 8 bits, planar
-        S16P,        ///< signed 16 bits, planar
-        S32P,        ///< signed 32 bits, planar
-        FLTP,        ///< float, planar
-        DBLP,        ///< double, planar
-
-        COUNT;       ///< Number of sample formats.
-
-        /**
-         * Returns the matching SampleFormat value corresponding to the given SampleFormat's integer ordinal.
-         * <pre>
-         *   given:
-         *     ordinal = enumValue.ordinal()
-         *   reverse:
-         *     enumValue = EnumClass.values()[ordinal]
-         * </pre>
-         * @throws IllegalArgumentException if the given ordinal is out of range, i.e. not within [ 0 .. SampleFormat.values().length-1 ]
-         */
-        public static SampleFormat valueOf(int ordinal) throws IllegalArgumentException {
-            final SampleFormat[] all = SampleFormat.values();
-            if( 0 <= ordinal && ordinal < all.length ) {
-                return all[ordinal];
-            }
-            throw new IllegalArgumentException("Ordinal "+ordinal+" out of range of SampleFormat.values()[0.."+(all.length-1)+"]");
-        }
-    };
-
-    /** FFMPEG/libAV Pixel Format */
-    public static enum PixelFormat {
-        // NONE= -1,
-        /** planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) */
-        YUV420P,
-        /** packed YUV 4:2:2, 16bpp, Y0 Cb Y1 Cr ( sharing Cb and Cr w/ 2 pixels )*/
-        YUYV422,
-        /** packed RGB 8:8:8, 24bpp, RGBRGB... */
-        RGB24,
-        /** packed RGB 8:8:8, 24bpp, BGRBGR... */
-        BGR24,
-        /** planar YUV 4:2:2, 16bpp, (1 Cr & Cb sample per 2x1 Y samples) */
-        YUV422P,
-        /** planar YUV 4:4:4, 24bpp, (1 Cr & Cb sample per 1x1 Y samples) */
-        YUV444P,
-        /** planar YUV 4:1:0,  9bpp, (1 Cr & Cb sample per 4x4 Y samples) */
-        YUV410P,
-        /** planar YUV 4:1:1, 12bpp, (1 Cr & Cb sample per 4x1 Y samples) */
-        YUV411P,
-        /** Y, 8bpp */
-        GRAY8,
-        /** Y,  1bpp, 0 is white, 1 is black, in each byte pixels are ordered from the msb to the lsb */
-        MONOWHITE,
-        /** Y,  1bpp, 0 is black, 1 is white, in each byte pixels are ordered from the msb to the lsb */
-        MONOBLACK,
-        /** 8 bit with RGB32 palette */
-        PAL8,
-        /** planar YUV 4:2:0, 12bpp, full scale (JPEG), deprecated in favor of YUV420P and setting color_range */
-        YUVJ420P,
-        /** planar YUV 4:2:2, 16bpp, full scale (JPEG), deprecated in favor of YUV422P and setting color_range */
-        YUVJ422P,
-        /** planar YUV 4:4:4, 24bpp, full scale (JPEG), deprecated in favor of YUV444P and setting color_range */
-        YUVJ444P,
-        /** XVideo Motion Acceleration via common packet passing */
-        XVMC_MPEG2_MC,
-        /** */
-        XVMC_MPEG2_IDCT,
-        /** packed YUV 4:2:2, 16bpp, Cb Y0 Cr Y1 */
-        UYVY422,
-        /** packed YUV 4:1:1, 12bpp, Cb Y0 Y1 Cr Y2 Y3 */
-        UYYVYY411,
-        /** packed RGB 3:3:2,  8bpp, (msb)2B 3G 3R(lsb) */
-        BGR8,
-        /** packed RGB 1:2:1 bitstream,  4bpp, (msb)1B 2G 1R(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits */
-        BGR4,
-        /** packed RGB 1:2:1,  8bpp, (msb)1B 2G 1R(lsb) */
-        BGR4_BYTE,
-        /** packed RGB 3:3:2,  8bpp, (msb)2R 3G 3B(lsb) */
-        RGB8,
-        /** packed RGB 1:2:1 bitstream,  4bpp, (msb)1R 2G 1B(lsb), a byte contains two pixels, the first pixel in the byte is the one composed by the 4 msb bits */
-        RGB4,
-        /** packed RGB 1:2:1,  8bpp, (msb)1R 2G 1B(lsb) */
-        RGB4_BYTE,
-        /** planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (first byte U and the following byte V) */
-        NV12,
-        /** as above, but U and V bytes are swapped */
-        NV21,
-
-        /** packed ARGB 8:8:8:8, 32bpp, ARGBARGB... */
-        ARGB,
-        /** packed RGBA 8:8:8:8, 32bpp, RGBARGBA... */
-        RGBA,
-        /** packed ABGR 8:8:8:8, 32bpp, ABGRABGR... */
-        ABGR,
-        /** packed BGRA 8:8:8:8, 32bpp, BGRABGRA... */
-        BGRA,
-
-        /** Y, 16bpp, big-endian */
-        GRAY16BE,
-        /** Y        , 16bpp, little-endian */
-        GRAY16LE,
-        /** planar YUV 4:4:0 (1 Cr & Cb sample per 1x2 Y samples) */
-        YUV440P,
-        /** planar YUV 4:4:0 full scale (JPEG), deprecated in favor of YUV440P and setting color_range */
-        YUVJ440P,
-        /** planar YUV 4:2:0, 20bpp, (1 Cr & Cb sample per 2x2 Y & A samples) */
-        YUVA420P,
-        /** H.264 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
-        VDPAU_H264,
-        /** MPEG-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
-        VDPAU_MPEG1,
-        /** MPEG-2 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
-        VDPAU_MPEG2,
-        /** WMV3 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
-        VDPAU_WMV3,
-        /** VC-1 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers */
-        VDPAU_VC1,
-        /** packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as big-endian */
-        RGB48BE,
-        /** packed RGB 16:16:16, 48bpp, 16R, 16G, 16B, the 2-byte value for each R/G/B component is stored as little-endian */
-        RGB48LE,
-
-        RGB565BE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), big-endian
-        RGB565LE,  ///< packed RGB 5:6:5, 16bpp, (msb)   5R 6G 5B(lsb), little-endian
-        RGB555BE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), big-endian, most significant bit to 0
-        RGB555LE,  ///< packed RGB 5:5:5, 16bpp, (msb)1A 5R 5G 5B(lsb), little-endian, most significant bit to 0
-
-        BGR565BE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), big-endian
-        BGR565LE,  ///< packed BGR 5:6:5, 16bpp, (msb)   5B 6G 5R(lsb), little-endian
-        BGR555BE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), big-endian, most significant bit to 1
-        BGR555LE,  ///< packed BGR 5:5:5, 16bpp, (msb)1A 5B 5G 5R(lsb), little-endian, most significant bit to 1
-
-        VAAPI_MOCO, ///< HW acceleration through VA API at motion compensation entry-point, Picture.data[3] contains a vaapi_render_state struct which contains macroblocks as well as various fields extracted from headers
-        VAAPI_IDCT, ///< HW acceleration through VA API at IDCT entry-point, Picture.data[3] contains a vaapi_render_state struct which contains fields extracted from headers
-        VAAPI_VLD,  ///< HW decoding through VA API, Picture.data[3] contains a vaapi_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-
-        YUV420P16LE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-        YUV420P16BE,  ///< planar YUV 4:2:0, 24bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-        YUV422P16LE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-        YUV422P16BE,  ///< planar YUV 4:2:2, 32bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-        YUV444P16LE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-        YUV444P16BE,  ///< planar YUV 4:4:4, 48bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-        VDPAU_MPEG4,  ///< MPEG4 HW decoding with VDPAU, data[0] contains a vdpau_render_state struct which contains the bitstream of the slices as well as various fields extracted from headers
-        DXVA2_VLD,    ///< HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer
-
-        RGB444LE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), little-endian, most significant bits to 0
-        RGB444BE,  ///< packed RGB 4:4:4, 16bpp, (msb)4A 4R 4G 4B(lsb), big-endian, most significant bits to 0
-        BGR444LE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), little-endian, most significant bits to 1
-        BGR444BE,  ///< packed BGR 4:4:4, 16bpp, (msb)4A 4B 4G 4R(lsb), big-endian, most significant bits to 1
-        Y400A,     ///< 8bit gray, 8bit alpha
-        BGR48BE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as big-endian
-        BGR48LE,   ///< packed RGB 16:16:16, 48bpp, 16B, 16G, 16R, the 2-byte value for each R/G/B component is stored as little-endian
-        YUV420P9BE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-        YUV420P9LE, ///< planar YUV 4:2:0, 13.5bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-        YUV420P10BE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), big-endian
-        YUV420P10LE,///< planar YUV 4:2:0, 15bpp, (1 Cr & Cb sample per 2x2 Y samples), little-endian
-        YUV422P10BE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-        YUV422P10LE,///< planar YUV 4:2:2, 20bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-        YUV444P9BE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-        YUV444P9LE, ///< planar YUV 4:4:4, 27bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-        YUV444P10BE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), big-endian
-        YUV444P10LE,///< planar YUV 4:4:4, 30bpp, (1 Cr & Cb sample per 1x1 Y samples), little-endian
-        YUV422P9BE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), big-endian
-        YUV422P9LE, ///< planar YUV 4:2:2, 18bpp, (1 Cr & Cb sample per 2x1 Y samples), little-endian
-        VDA_VLD,    ///< hardware decoding through VDA
-        GBRP,      ///< planar GBR 4:4:4 24bpp
-        GBRP9BE,   ///< planar GBR 4:4:4 27bpp, big endian
-        GBRP9LE,   ///< planar GBR 4:4:4 27bpp, little endian
-        GBRP10BE,  ///< planar GBR 4:4:4 30bpp, big endian
-        GBRP10LE,  ///< planar GBR 4:4:4 30bpp, little endian
-        GBRP16BE,  ///< planar GBR 4:4:4 48bpp, big endian
-        GBRP16LE,  ///< planar GBR 4:4:4 48bpp, little endian
-        COUNT      ///< number of pixel formats in this list
-        ;
-        /**
-         * Returns the matching PixelFormat value corresponding to the given PixelFormat's integer ordinal.
-         * <pre>
-         *   given:
-         *     ordinal = enumValue.ordinal()
-         *   reverse:
-         *     enumValue = EnumClass.values()[ordinal]
-         * </pre>
-         * @throws IllegalArgumentException if the given ordinal is out of range, i.e. not within [ 0 .. PixelFormat.values().length-1 ]
-         */
-        public static PixelFormat valueOf(int ordinal) throws IllegalArgumentException {
-            final PixelFormat[] all = PixelFormat.values();
-            if( 0 <= ordinal && ordinal < all.length ) {
-                return all[ordinal];
-            }
-            throw new IllegalArgumentException("Ordinal "+ordinal+" out of range of PixelFormat.values()[0.."+(all.length-1)+"]");
-        }
-    }
 }
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
index 22a0458..65a7e36 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/FFMPEGStaticNatives.java
@@ -30,7 +30,7 @@ package jogamp.opengl.util.av.impl;
 import com.jogamp.common.util.VersionNumber;
 
 class FFMPEGStaticNatives {
-    static VersionNumber getAVVersion(int vers) {
+    static VersionNumber getAVVersion(final int vers) {
         return new VersionNumber( ( vers >> 16 ) & 0xFF,
                                   ( vers >>  8 ) & 0xFF,
                                   ( vers >>  0 ) & 0xFF );
diff --git a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
index 05a94de..0eeb54b 100644
--- a/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
+++ b/src/jogl/classes/jogamp/opengl/util/av/impl/OMXGLMediaPlayer.java
@@ -74,19 +74,19 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     }
 
     @Override
-    protected TextureSequence.TextureFrame createTexImage(GL gl, int texName) {
+    protected TextureSequence.TextureFrame createTexImage(final GL gl, final int texName) {
         final EGLTextureFrame eglTex = (EGLTextureFrame) super.createTexImage(gl, texName);
         _setStreamEGLImageTexture2D(moviePtr, texName, eglTex.getImage(), eglTex.getSync());
         return eglTex;
     }
 
     @Override
-    protected void destroyTexFrame(GL gl, TextureSequence.TextureFrame imgTex) {
+    protected void destroyTexFrame(final GL gl, final TextureSequence.TextureFrame imgTex) {
         super.destroyTexFrame(gl, imgTex);
     }
 
     @Override
-    protected void destroyImpl(GL gl) {
+    protected void destroyImpl(final GL gl) {
         if (moviePtr != 0) {
             _stop(moviePtr);
             _detachVideoRenderer(moviePtr);
@@ -96,14 +96,14 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     }
 
     @Override
-    protected void initStreamImpl(int vid, int aid) throws IOException {
+    protected void initStreamImpl(final int vid, final int aid) throws IOException {
         if(0==moviePtr) {
             throw new GLException("OMX native instance null");
         }
-        if(!streamLoc.getScheme().equals("file")) {
-            throw new IOException("Only file schemes are allowed: "+streamLoc);
+        if(!getURI().getScheme().equals("file")) {
+            throw new IOException("Only file schemes are allowed: "+getURI());
         }
-        final String path=streamLoc.getPath();
+        final String path=getURI().getPath();
         if(DEBUG) {
             System.out.println("initGLStream: clean path "+path);
         }
@@ -111,15 +111,15 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
         if(DEBUG) {
             System.out.println("initGLStream: p1 "+this);
         }
-        _setStream(moviePtr, textureCount, path);
+        _setStream(moviePtr, getTextureCount(), path);
         if(DEBUG) {
             System.out.println("initGLStream: p2 "+this);
         }
     }
     @Override
-    protected final void initGLImpl(GL gl) throws IOException, GLException {
+    protected final void initGLImpl(final GL gl) throws IOException, GLException {
         // NOP
-        isInGLOrientation = true;
+        setIsGLOriented(true);
     }
 
     @Override
@@ -128,7 +128,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     }
 
     @Override
-    protected boolean setPlaySpeedImpl(float rate) {
+    protected boolean setPlaySpeedImpl(final float rate) {
         if(0==moviePtr) {
             throw new GLException("OMX native instance null");
         }
@@ -157,7 +157,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
 
     /** @return time position after issuing the command */
     @Override
-    protected int seekImpl(int msec) {
+    protected int seekImpl(final int msec) {
         if(0==moviePtr) {
             throw new GLException("OMX native instance null");
         }
@@ -165,7 +165,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
     }
 
     @Override
-    protected int getNextTextureImpl(GL gl, TextureFrame nextFrame) {
+    protected int getNextTextureImpl(final GL gl, final TextureFrame nextFrame) {
         if(0==moviePtr) {
             throw new GLException("OMX native instance null");
         }
@@ -182,8 +182,8 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
         return 0; // FIXME: return pts
     }
 
-    private String replaceAll(String orig, String search, String repl) {
-        StringBuilder dest = new StringBuilder();
+    private String replaceAll(final String orig, final String search, final String repl) {
+        final StringBuilder dest = new StringBuilder();
         // In case replaceAll / java.util.regex.* is not supported (-> CVM)
         int i=0,j;
         while((j=orig.indexOf(search, i))>=0) {
@@ -194,7 +194,7 @@ public class OMXGLMediaPlayer extends EGLMediaPlayerImpl {
         return dest.append(orig.substring(i, orig.length())).toString();
     }
 
-    private void errorCheckEGL(String s) {
+    private void errorCheckEGL(final String s) {
         int e;
         if( (e=EGL.eglGetError()) != EGL.EGL_SUCCESS ) {
             System.out.println("EGL Error: ("+s+"): 0x"+Integer.toHexString(e));
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
index 1f402f4..5a78f51 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandler.java
@@ -45,22 +45,22 @@ import com.jogamp.opengl.util.glsl.ShaderState;
  */
 public class GLSLArrayHandler extends GLVBOArrayHandler {
 
-  public GLSLArrayHandler(GLArrayDataEditable ad) {
+  public GLSLArrayHandler(final GLArrayDataEditable ad) {
     super(ad);
   }
 
   @Override
-  public final void setSubArrayVBOName(int vboName) {
+  public final void setSubArrayVBOName(final int vboName) {
       throw new UnsupportedOperationException();
   }
 
   @Override
-  public final void addSubHandler(GLArrayHandlerFlat handler) {
+  public final void addSubHandler(final GLArrayHandlerFlat handler) {
       throw new UnsupportedOperationException();
   }
 
   @Override
-  public final void enableState(GL gl, boolean enable, Object ext) {
+  public final void enableState(final GL gl, final boolean enable, final Object ext) {
     final GL2ES2 glsl = gl.getGL2ES2();
     if( null != ext ) {
         enableShaderState(glsl, enable, (ShaderState)ext);
@@ -69,7 +69,9 @@ public class GLSLArrayHandler extends GLVBOArrayHandler {
     }
   }
 
-  private final void enableShaderState(GL2ES2 glsl, boolean enable, ShaderState st) {
+  private final int[] tempI = new int[1];
+
+  private final void enableShaderState(final GL2ES2 glsl, final boolean enable, final ShaderState st) {
     if(enable) {
         /*
          * This would be the non optimized code path:
@@ -99,9 +101,8 @@ public class GLSLArrayHandler extends GLVBOArrayHandler {
             } else if(st.getAttribLocation(glsl, ad) >= 0) {
                 // didn't experience a performance hit on this query ..
                 // (using ShaderState's location query above to validate the location)
-                final int[] qi = new int[1];
-                glsl.glGetVertexAttribiv(ad.getLocation(), GL2ES2.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, qi, 0);
-                if(ad.getVBOName() != qi[0]) {
+                glsl.glGetVertexAttribiv(ad.getLocation(), GL2ES2.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, tempI, 0);
+                if(ad.getVBOName() != tempI[0]) {
                     glsl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName());
                     st.vertexAttribPointer(glsl, ad);
                     glsl.glBindBuffer(ad.getVBOTarget(), 0);
@@ -117,7 +118,7 @@ public class GLSLArrayHandler extends GLVBOArrayHandler {
     }
   }
 
-  private final void enableSimple(GL2ES2 glsl, boolean enable) {
+  private final void enableSimple(final GL2ES2 glsl, final boolean enable) {
     final int location = ad.getLocation();
     if( 0 > location ) {
         return;
@@ -151,9 +152,8 @@ public class GLSLArrayHandler extends GLVBOArrayHandler {
             } else {
                 // didn't experience a performance hit on this query ..
                 // (using ShaderState's location query above to validate the location)
-                final int[] qi = new int[1];
-                glsl.glGetVertexAttribiv(location, GL2ES2.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, qi, 0);
-                if(ad.getVBOName() != qi[0]) {
+                glsl.glGetVertexAttribiv(location, GL2ES2.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, tempI, 0);
+                if(ad.getVBOName() != tempI[0]) {
                     glsl.glBindBuffer(ad.getVBOTarget(), ad.getVBOName());
                     glsl.glVertexAttribPointer(ad);
                     glsl.glBindBuffer(ad.getVBOTarget(), 0);
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
index 34a381d..85fcabd 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerFlat.java
@@ -41,9 +41,9 @@ import com.jogamp.opengl.util.glsl.ShaderState;
  * separately and interleaves many arrays.
  */
 public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
-  private GLArrayDataWrapper ad;
+  private final GLArrayDataWrapper ad;
 
-  public GLSLArrayHandlerFlat(GLArrayDataWrapper ad) {
+  public GLSLArrayHandlerFlat(final GLArrayDataWrapper ad) {
     this.ad = ad;
   }
 
@@ -53,7 +53,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
   }
 
   @Override
-  public final void syncData(GL gl, Object ext) {
+  public final void syncData(final GL gl, final Object ext) {
     final GL2ES2 glsl = gl.getGL2ES2();
     if( null != ext ) {
         ((ShaderState)ext).vertexAttribPointer(glsl, ad);
@@ -80,7 +80,7 @@ public class GLSLArrayHandlerFlat implements GLArrayHandlerFlat {
   }
 
   @Override
-  public final void enableState(GL gl, boolean enable, Object ext) {
+  public final void enableState(final GL gl, final boolean enable, final Object ext) {
     final GL2ES2 glsl = gl.getGL2ES2();
     if( null != ext ) {
         final ShaderState st = (ShaderState)ext;
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
index e153082..0169b07 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLArrayHandlerInterleaved.java
@@ -45,30 +45,30 @@ import com.jogamp.opengl.util.GLArrayDataEditable;
 public class GLSLArrayHandlerInterleaved extends GLVBOArrayHandler {
   private final List<GLArrayHandlerFlat> subArrays = new ArrayList<GLArrayHandlerFlat>();
 
-  public GLSLArrayHandlerInterleaved(GLArrayDataEditable ad) {
+  public GLSLArrayHandlerInterleaved(final GLArrayDataEditable ad) {
     super(ad);
   }
 
   @Override
-  public final void setSubArrayVBOName(int vboName) {
+  public final void setSubArrayVBOName(final int vboName) {
       for(int i=0; i<subArrays.size(); i++) {
           subArrays.get(i).getData().setVBOName(vboName);
       }
   }
 
   @Override
-  public final void addSubHandler(GLArrayHandlerFlat handler) {
+  public final void addSubHandler(final GLArrayHandlerFlat handler) {
       subArrays.add(handler);
   }
 
-  private final void syncSubData(GL gl, Object ext) {
+  private final void syncSubData(final GL gl, final Object ext) {
       for(int i=0; i<subArrays.size(); i++) {
           subArrays.get(i).syncData(gl, ext);
       }
   }
 
   @Override
-  public final void enableState(GL gl, boolean enable, Object ext) {
+  public final void enableState(final GL gl, final boolean enable, final Object ext) {
     if(enable) {
         if(!ad.isVBO()) {
             throw new InternalError("Interleaved handle is not VBO: "+ad);
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java
index dba4085..d5d0020 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/GLSLTextureRaster.java
@@ -52,7 +52,7 @@ public class GLSLTextureRaster  {
     private GLUniformData activeTexUniform;
     private GLArrayDataServer interleavedVBO;
 
-    public GLSLTextureRaster(int textureUnit, boolean textureVertFlipped) {
+    public GLSLTextureRaster(final int textureUnit, final boolean textureVertFlipped) {
         this.textureVertFlipped = textureVertFlipped;
         this.textureUnit = textureUnit;
     }
@@ -63,7 +63,7 @@ public class GLSLTextureRaster  {
     static final String shaderSrcPath = "../../shader";
     static final String shaderBinPath = "../../shader/bin";
 
-    public void init(GL2ES2 gl) {
+    public void init(final GL2ES2 gl) {
         // Create & Compile the shader objects
         final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
                                                   shaderSrcPath, shaderBinPath, shaderBasename, true);
@@ -83,9 +83,9 @@ public class GLSLTextureRaster  {
 
         // setup mgl_PMVMatrix
         pmvMatrix = new PMVMatrix();
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
         pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
         if( pmvMatrixUniform.setLocation(gl, sp.program()) < 0 ) {
@@ -128,7 +128,7 @@ public class GLSLTextureRaster  {
         sp.useProgram(gl, false);
     }
 
-    public void reshape(GL2ES2 gl, int x, int y, int width, int height) {
+    public void reshape(final GL2ES2 gl, final int x, final int y, final int width, final int height) {
         if(null != sp) {
             pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
             pmvMatrix.glLoadIdentity();
@@ -143,14 +143,11 @@ public class GLSLTextureRaster  {
         }
     }
 
-    public void dispose(GL2ES2 gl) {
+    public void dispose(final GL2ES2 gl) {
         if(null != pmvMatrixUniform) {
             pmvMatrixUniform = null;
         }
-        if(null != pmvMatrix) {
-            pmvMatrix.destroy();
-            pmvMatrix=null;
-        }
+        pmvMatrix=null;
         if(null != interleavedVBO) {
             interleavedVBO.destroy(gl);
             interleavedVBO=null;
@@ -161,7 +158,7 @@ public class GLSLTextureRaster  {
         }
     }
 
-    public void display(GL2ES2 gl) {
+    public void display(final GL2ES2 gl) {
         if(null != sp) {
             sp.useProgram(gl, true);
             interleavedVBO.enableBuffer(gl, true);
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
index 458a9c9..2dde27b 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncHook.java
@@ -36,6 +36,7 @@ import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLArrayData;
 import javax.media.opengl.GLException;
+import javax.media.opengl.GLProfile;
 import javax.media.opengl.fixedfunc.GLLightingFunc;
 import javax.media.opengl.fixedfunc.GLMatrixFunc;
 import javax.media.opengl.fixedfunc.GLPointerFunc;
@@ -50,6 +51,7 @@ import com.jogamp.opengl.util.glsl.fixedfunc.ShaderSelectionMode;
 public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFunc {
     public static final int MAX_TEXTURE_UNITS = 8;
 
+    protected final GLProfile gl2es1GLProfile;
     protected FixedFuncPipeline fixedFunction;
     protected PMVMatrix pmvMatrix;
     protected boolean ownsPMVMatrix;
@@ -60,7 +62,8 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
      * @param mode TODO
      * @param pmvMatrix optional pass through PMVMatrix for the {@link FixedFuncHook} and {@link FixedFuncPipeline}
      */
-    public FixedFuncHook (GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) {
+    public FixedFuncHook (final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix) {
+        this.gl2es1GLProfile = GLProfile.createCustomGLProfile(GLProfile.GL2ES1, gl.getGLProfile().getImpl());
         this.gl = gl;
         if(null != pmvMatrix) {
             this.ownsPMVMatrix = false;
@@ -77,10 +80,11 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
      * @param mode TODO
      * @param pmvMatrix optional pass through PMVMatrix for the {@link FixedFuncHook} and {@link FixedFuncPipeline}
      */
-    public FixedFuncHook(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix,
-                         Class<?> shaderRootClass, String shaderSrcRoot, String shaderBinRoot,
-                         String vertexColorFile, String vertexColorLightFile,
-                         String fragmentColorFile, String fragmentColorTextureFile) {
+    public FixedFuncHook(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix,
+                         final Class<?> shaderRootClass, final String shaderSrcRoot, final String shaderBinRoot,
+                         final String vertexColorFile, final String vertexColorLightFile,
+                         final String fragmentColorFile, final String fragmentColorTextureFile) {
+        this.gl2es1GLProfile = GLProfile.createCustomGLProfile(GLProfile.GL2ES1, gl.getGLProfile().getImpl());
         this.gl = gl;
         if(null != pmvMatrix) {
             this.ownsPMVMatrix = false;
@@ -96,14 +100,11 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
 
     public boolean verbose() { return fixedFunction.verbose(); }
 
-    public void setVerbose(boolean v) { fixedFunction.setVerbose(v); }
+    public void setVerbose(final boolean v) { fixedFunction.setVerbose(v); }
 
     public void destroy() {
         fixedFunction.destroy(gl);
         fixedFunction = null;
-        if(ownsPMVMatrix) {
-            pmvMatrix.destroy();
-        }
         pmvMatrix=null;
         gl=null;
     }
@@ -113,32 +114,50 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     //
     // FixedFuncHookIf - hooks
     //
-    public void glDrawArrays(int mode, int first, int count) {
+    public final boolean isGL4core() {
+        return false;
+    }
+    public final boolean isGL3core() {
+        return false;
+    }
+    public final boolean isGLcore() {
+        return false;
+    }
+    public final boolean isGLES2Compatible() {
+        return false;
+    }
+    public final boolean isGLES3Compatible() {
+        return false;
+    }
+    public final GLProfile getGLProfile() {
+        return gl2es1GLProfile;
+    }
+    public void glDrawArrays(final int mode, final int first, final int count) {
         fixedFunction.glDrawArrays(gl, mode, first, count);
     }
-    public void glDrawElements(int mode, int count, int type, java.nio.Buffer indices) {
+    public void glDrawElements(final int mode, final int count, final int type, final java.nio.Buffer indices) {
         fixedFunction.glDrawElements(gl, mode, count, type, indices);
     }
-    public void glDrawElements(int mode, int count, int type, long indices_buffer_offset) {
+    public void glDrawElements(final int mode, final int count, final int type, final long indices_buffer_offset) {
         fixedFunction.glDrawElements(gl, mode, count, type, indices_buffer_offset);
     }
 
-    public void glActiveTexture(int texture) {
+    public void glActiveTexture(final int texture) {
         fixedFunction.glActiveTexture(texture);
         gl.glActiveTexture(texture);
     }
-    public void glEnable(int cap) {
+    public void glEnable(final int cap) {
         if(fixedFunction.glEnable(cap, true)) {
             gl.glEnable(cap);
         }
     }
-    public void glDisable(int cap) {
+    public void glDisable(final int cap) {
         if(fixedFunction.glEnable(cap, false)) {
             gl.glDisable(cap);
         }
     }
     @Override
-    public void glGetFloatv(int pname, java.nio.FloatBuffer params) {
+    public void glGetFloatv(final int pname, final java.nio.FloatBuffer params) {
         if(PMVMatrix.isMatrixGetName(pname)) {
             pmvMatrix.glGetFloatv(pname, params);
             return;
@@ -146,7 +165,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         gl.glGetFloatv(pname, params);
     }
     @Override
-    public void glGetFloatv(int pname, float[] params, int params_offset) {
+    public void glGetFloatv(final int pname, final float[] params, final int params_offset) {
         if(PMVMatrix.isMatrixGetName(pname)) {
             pmvMatrix.glGetFloatv(pname, params, params_offset);
             return;
@@ -154,7 +173,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         gl.glGetFloatv(pname, params, params_offset);
     }
     @Override
-    public void glGetIntegerv(int pname, IntBuffer params) {
+    public void glGetIntegerv(final int pname, final IntBuffer params) {
         if(PMVMatrix.isMatrixGetName(pname)) {
             pmvMatrix.glGetIntegerv(pname, params);
             return;
@@ -162,7 +181,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         gl.glGetIntegerv(pname, params);
     }
     @Override
-    public void glGetIntegerv(int pname, int[] params, int params_offset) {
+    public void glGetIntegerv(final int pname, final int[] params, final int params_offset) {
         if(PMVMatrix.isMatrixGetName(pname)) {
             pmvMatrix.glGetIntegerv(pname, params, params_offset);
             return;
@@ -170,21 +189,21 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         gl.glGetIntegerv(pname, params, params_offset);
     }
 
-    public void glTexEnvi(int target, int pname, int value) {
+    public void glTexEnvi(final int target, final int pname, final int value) {
         fixedFunction.glTexEnvi(target, pname, value);
     }
-    public void glGetTexEnviv(int target, int pname,  IntBuffer params) {
+    public void glGetTexEnviv(final int target, final int pname,  final IntBuffer params) {
         fixedFunction.glGetTexEnviv(target, pname, params);
     }
-    public void glGetTexEnviv(int target, int pname,  int[] params, int params_offset) {
+    public void glGetTexEnviv(final int target, final int pname,  final int[] params, final int params_offset) {
         fixedFunction.glGetTexEnviv(target, pname, params, params_offset);
     }
-    public void glBindTexture(int target, int texture) {
+    public void glBindTexture(final int target, final int texture) {
         fixedFunction.glBindTexture(target, texture);
         gl.glBindTexture(target, texture);
     }
-    public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border,
-                             int format, int type,  Buffer pixels) {
+    public void glTexImage2D(final int target, final int level, int internalformat, final int width, final int height, final int border,
+                             final int format, final int type,  final Buffer pixels) {
         // align internalformat w/ format, an ES2 requirement
         switch(internalformat) {
             case 3: internalformat= ( GL.GL_RGBA == format ) ? GL.GL_RGBA : GL.GL_RGB; break;
@@ -193,8 +212,8 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         fixedFunction.glTexImage2D(target, /* level, */ internalformat, /*width, height, border, */ format /*, type, pixels*/);
         gl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
     }
-    public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border,
-                             int format, int type,  long pixels_buffer_offset) {
+    public void glTexImage2D(final int target, final int level, int internalformat, final int width, final int height, final int border,
+                             final int format, final int type,  final long pixels_buffer_offset) {
         // align internalformat w/ format, an ES2 requirement
         switch(internalformat) {
             case 3: internalformat= ( GL.GL_RGBA == format ) ? GL.GL_RGBA : GL.GL_RGB; break;
@@ -204,16 +223,16 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         gl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels_buffer_offset);
     }
 
-    public void glPointSize(float size) {
+    public void glPointSize(final float size) {
         fixedFunction.glPointSize(size);
     }
-    public  void glPointParameterf(int pname, float param) {
+    public  void glPointParameterf(final int pname, final float param) {
         fixedFunction.glPointParameterf(pname, param);
     }
-    public  void glPointParameterfv(int pname, float[] params, int params_offset) {
+    public  void glPointParameterfv(final int pname, final float[] params, final int params_offset) {
         fixedFunction.glPointParameterfv(pname, params, params_offset);
     }
-    public  void glPointParameterfv(int pname, java.nio.FloatBuffer params) {
+    public  void glPointParameterfv(final int pname, final java.nio.FloatBuffer params) {
         fixedFunction.glPointParameterfv(pname, params);
     }
 
@@ -224,16 +243,16 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         return pmvMatrix.glGetMatrixMode();
     }
     @Override
-    public void glMatrixMode(int mode) {
+    public void glMatrixMode(final int mode) {
         pmvMatrix.glMatrixMode(mode);
     }
     @Override
-    public void glLoadMatrixf(java.nio.FloatBuffer m) {
+    public void glLoadMatrixf(final java.nio.FloatBuffer m) {
         pmvMatrix.glLoadMatrixf(m);
     }
     @Override
-    public void glLoadMatrixf(float[] m, int m_offset) {
-        glLoadMatrixf(GLBuffers.newDirectFloatBuffer(m, m_offset));
+    public void glLoadMatrixf(final float[] m, final int m_offset) {
+        glLoadMatrixf(Buffers.newDirectFloatBuffer(m, m_offset));
     }
     @Override
     public void glPopMatrix() {
@@ -248,37 +267,37 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
         pmvMatrix.glLoadIdentity();
     }
     @Override
-    public void glMultMatrixf(java.nio.FloatBuffer m) {
+    public void glMultMatrixf(final java.nio.FloatBuffer m) {
         pmvMatrix.glMultMatrixf(m);
     }
     @Override
-    public void glMultMatrixf(float[] m, int m_offset) {
-        glMultMatrixf(GLBuffers.newDirectFloatBuffer(m, m_offset));
+    public void glMultMatrixf(final float[] m, final int m_offset) {
+        glMultMatrixf(Buffers.newDirectFloatBuffer(m, m_offset));
     }
     @Override
-    public void glTranslatef(float x, float y, float z) {
+    public void glTranslatef(final float x, final float y, final float z) {
         pmvMatrix.glTranslatef(x, y, z);
     }
     @Override
-    public void glRotatef(float angdeg, float x, float y, float z) {
+    public void glRotatef(final float angdeg, final float x, final float y, final float z) {
         pmvMatrix.glRotatef(angdeg, x, y, z);
     }
     @Override
-    public void glScalef(float x, float y, float z) {
+    public void glScalef(final float x, final float y, final float z) {
         pmvMatrix.glScalef(x, y, z);
     }
-    public void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val) {
+    public void glOrtho(final double left, final double right, final double bottom, final double top, final double near_val, final double far_val) {
         glOrthof((float) left, (float) right, (float) bottom, (float) top, (float) near_val, (float) far_val);
     }
     @Override
-    public void glOrthof(float left, float right, float bottom, float top, float zNear, float zFar) {
+    public void glOrthof(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) {
         pmvMatrix.glOrthof(left, right, bottom, top, zNear, zFar);
     }
-    public void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar) {
+    public void glFrustum(final double left, final double right, final double bottom, final double top, final double zNear, final double zFar) {
         glFrustumf((float) left, (float) right, (float) bottom, (float) top, (float) zNear, (float) zFar);
     }
     @Override
-    public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) {
+    public void glFrustumf(final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) {
         pmvMatrix.glFrustumf(left, right, bottom, top, zNear, zFar);
     }
 
@@ -286,45 +305,45 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     // LightingIf
     //
     @Override
-    public void glColor4f(float red, float green, float blue, float alpha) {
+    public void glColor4f(final float red, final float green, final float blue, final float alpha) {
       fixedFunction.glColor4f(gl, red, green, blue, alpha);
     }
 
-    public  void glColor4ub(byte red, byte green, byte blue, byte alpha) {
+    public  void glColor4ub(final byte red, final byte green, final byte blue, final byte alpha) {
       glColor4f(ValueConv.byte_to_float(red, false),
                 ValueConv.byte_to_float(green, false),
                 ValueConv.byte_to_float(blue, false),
                 ValueConv.byte_to_float(alpha, false) );
     }
     @Override
-    public void glLightfv(int light, int pname, java.nio.FloatBuffer params) {
+    public void glLightfv(final int light, final int pname, final java.nio.FloatBuffer params) {
       fixedFunction.glLightfv(gl, light, pname, params);
     }
     @Override
-    public void glLightfv(int light, int pname, float[] params, int params_offset) {
-        glLightfv(light, pname, GLBuffers.newDirectFloatBuffer(params, params_offset));
+    public void glLightfv(final int light, final int pname, final float[] params, final int params_offset) {
+        glLightfv(light, pname, Buffers.newDirectFloatBuffer(params, params_offset));
     }
     @Override
-    public void glMaterialfv(int face, int pname, java.nio.FloatBuffer params) {
+    public void glMaterialfv(final int face, final int pname, final java.nio.FloatBuffer params) {
       fixedFunction.glMaterialfv(gl, face, pname, params);
     }
     @Override
-    public void glMaterialfv(int face, int pname, float[] params, int params_offset) {
-        glMaterialfv(face, pname, GLBuffers.newDirectFloatBuffer(params, params_offset));
+    public void glMaterialfv(final int face, final int pname, final float[] params, final int params_offset) {
+        glMaterialfv(face, pname, Buffers.newDirectFloatBuffer(params, params_offset));
     }
     @Override
-    public void glMaterialf(int face, int pname, float param) {
-        glMaterialfv(face, pname, GLBuffers.newDirectFloatBuffer(new float[] { param }));
+    public void glMaterialf(final int face, final int pname, final float param) {
+        glMaterialfv(face, pname, Buffers.newDirectFloatBuffer(new float[] { param }));
     }
 
     //
     // Misc Simple States
     //
     @Override
-    public void glShadeModel(int mode) {
+    public void glShadeModel(final int mode) {
       fixedFunction.glShadeModel(gl, mode);
     }
-    public  void glAlphaFunc(int func, float ref) {
+    public  void glAlphaFunc(final int func, final float ref) {
         fixedFunction.glAlphaFunc(func, ref);
     }
 
@@ -337,20 +356,20 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     //
     // PointerIf
     //
-    public void glClientActiveTexture(int textureUnit) {
+    public void glClientActiveTexture(final int textureUnit) {
       fixedFunction.glClientActiveTexture(textureUnit);
     }
     @Override
-    public void glEnableClientState(int glArrayIndex) {
+    public void glEnableClientState(final int glArrayIndex) {
       fixedFunction.glEnableClientState(gl, glArrayIndex);
     }
     @Override
-    public void glDisableClientState(int glArrayIndex) {
+    public void glDisableClientState(final int glArrayIndex) {
       fixedFunction.glDisableClientState(gl, glArrayIndex);
     }
 
     @Override
-    public void glVertexPointer(GLArrayData array) {
+    public void glVertexPointer(final GLArrayData array) {
       if(array.isVBO()) {
           if(!gl.isVBOArrayBound()) {
             throw new GLException("VBO array is not enabled: "+array);
@@ -367,13 +386,13 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     }
 
     @Override
-    public void glVertexPointer(int size, int type, int stride, java.nio.Buffer pointer) {
+    public void glVertexPointer(final int size, final int type, final int stride, final java.nio.Buffer pointer) {
       glVertexPointer(GLArrayDataWrapper.createFixed(GL_VERTEX_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                                      pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
     }
     @Override
-    public void glVertexPointer(int size, int type, int stride, long pointer_buffer_offset) {
-      int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
+    public void glVertexPointer(final int size, final int type, final int stride, final long pointer_buffer_offset) {
+      final int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
       if(vboName==0) {
         throw new GLException("no GL_ARRAY_BUFFER VBO bound");
       }
@@ -382,7 +401,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     }
 
     @Override
-    public void glColorPointer(GLArrayData array) {
+    public void glColorPointer(final GLArrayData array) {
       if(array.isVBO()) {
           if(!gl.isVBOArrayBound()) {
             throw new GLException("VBO array is not enabled: "+array);
@@ -398,13 +417,13 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
       fixedFunction.glColorPointer(gl, array);
     }
     @Override
-    public void glColorPointer(int size, int type, int stride, java.nio.Buffer pointer) {
+    public void glColorPointer(final int size, final int type, final int stride, final java.nio.Buffer pointer) {
       glColorPointer(GLArrayDataWrapper.createFixed(GL_COLOR_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                                     pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
     }
     @Override
-    public void glColorPointer(int size, int type, int stride, long pointer_buffer_offset) {
-      int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
+    public void glColorPointer(final int size, final int type, final int stride, final long pointer_buffer_offset) {
+      final int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
       if(vboName==0) {
         throw new GLException("no GL_ARRAY_BUFFER VBO bound");
       }
@@ -413,7 +432,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     }
 
     @Override
-    public void glNormalPointer(GLArrayData array) {
+    public void glNormalPointer(final GLArrayData array) {
       if(array.getComponentCount()!=3) {
         throw new GLException("Only 3 components per normal allowed");
       }
@@ -432,13 +451,13 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
       fixedFunction.glNormalPointer(gl, array);
     }
     @Override
-    public void glNormalPointer(int type, int stride, java.nio.Buffer pointer) {
+    public void glNormalPointer(final int type, final int stride, final java.nio.Buffer pointer) {
       glNormalPointer(GLArrayDataWrapper.createFixed(GL_NORMAL_ARRAY, 3, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                                      pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
     }
     @Override
-    public void glNormalPointer(int type, int stride, long pointer_buffer_offset) {
-      int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
+    public void glNormalPointer(final int type, final int stride, final long pointer_buffer_offset) {
+      final int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
       if(vboName==0) {
         throw new GLException("no GL_ARRAY_BUFFER VBO bound");
       }
@@ -447,7 +466,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
     }
 
     @Override
-    public void glTexCoordPointer(GLArrayData array) {
+    public void glTexCoordPointer(final GLArrayData array) {
       if(array.isVBO()) {
           if(!gl.isVBOArrayBound()) {
             throw new GLException("VBO array is not enabled: "+array);
@@ -463,14 +482,14 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
       fixedFunction.glTexCoordPointer(gl, array);
     }
     @Override
-    public void glTexCoordPointer(int size, int type, int stride, java.nio.Buffer pointer) {
+    public void glTexCoordPointer(final int size, final int type, final int stride, final java.nio.Buffer pointer) {
       glTexCoordPointer(
         GLArrayDataWrapper.createFixed(GL_TEXTURE_COORD_ARRAY, size, type, GLBuffers.isGLTypeFixedPoint(type), stride,
                                        pointer, 0, 0, 0, GL.GL_ARRAY_BUFFER));
     }
     @Override
-    public void glTexCoordPointer(int size, int type, int stride, long pointer_buffer_offset) {
-      int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
+    public void glTexCoordPointer(final int size, final int type, final int stride, final long pointer_buffer_offset) {
+      final int vboName = gl.getBoundBuffer(GL.GL_ARRAY_BUFFER);
       if(vboName==0) {
         throw new GLException("no GL_ARRAY_BUFFER VBO bound");
       }
@@ -481,7 +500,7 @@ public class FixedFuncHook implements GLLightingFunc, GLMatrixFunc, GLPointerFun
 
     @Override
     public final String toString() {
-          StringBuilder buf = new StringBuilder();
+          final StringBuilder buf = new StringBuilder();
           buf.append(getClass().getName()+" (");
           if(null!=pmvMatrix) {
               buf.append(", matrixDirty: "+ (0 != pmvMatrix.getModifiedBits(false)));
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
index 4226958..7371b0f 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
@@ -52,6 +52,7 @@ import jogamp.opengl.Debug;
 
 import com.jogamp.common.nio.Buffers;
 import com.jogamp.common.util.IntIntHashMap;
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.opengl.util.PMVMatrix;
 import com.jogamp.opengl.util.glsl.ShaderCode;
 import com.jogamp.opengl.util.glsl.ShaderProgram;
@@ -71,14 +72,14 @@ public class FixedFuncPipeline {
 
     static {
         Debug.initSingleton();
-        DEBUG = Debug.isPropertyDefined("jogl.debug.FixedFuncPipeline", true);
+        DEBUG = PropertyAccess.isPropertyDefined("jogl.debug.FixedFuncPipeline", true);
     }
 
     /** The maximum texture units which could be used, depending on {@link ShaderSelectionMode}. */
     public static final int MAX_TEXTURE_UNITS = 8;
     public static final int MAX_LIGHTS        = 8;
 
-    public FixedFuncPipeline(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) {
+    public FixedFuncPipeline(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix) {
         shaderRootClass = FixedFuncPipeline.class;
         shaderSrcRoot = shaderSrcRootDef;
         shaderBinRoot = shaderBinRootDef;
@@ -88,11 +89,11 @@ public class FixedFuncPipeline {
         fragmentColorTextureFile = fragmentColorTextureFileDef;
         init(gl, mode, pmvMatrix);
     }
-    public FixedFuncPipeline(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix,
-                             Class<?> shaderRootClass, String shaderSrcRoot,
-                             String shaderBinRoot,
-                             String vertexColorFile, String vertexColorLightFile,
-                             String fragmentColorFile, String fragmentColorTextureFile) {
+    public FixedFuncPipeline(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix,
+                             final Class<?> shaderRootClass, final String shaderSrcRoot,
+                             final String shaderBinRoot,
+                             final String vertexColorFile, final String vertexColorLightFile,
+                             final String fragmentColorFile, final String fragmentColorTextureFile) {
         this.shaderRootClass = shaderRootClass;
         this.shaderSrcRoot = shaderSrcRoot;
         this.shaderBinRoot = shaderBinRoot;
@@ -104,12 +105,12 @@ public class FixedFuncPipeline {
     }
 
     public ShaderSelectionMode getShaderSelectionMode() { return requestedShaderSelectionMode; }
-    public void setShaderSelectionMode(ShaderSelectionMode mode) { requestedShaderSelectionMode=mode; }
+    public void setShaderSelectionMode(final ShaderSelectionMode mode) { requestedShaderSelectionMode=mode; }
     public ShaderSelectionMode getCurrentShaderSelectionMode() { return currentShaderSelectionMode; }
 
     public boolean verbose() { return verbose; }
 
-    public void setVerbose(boolean v) { verbose = DEBUG || v; }
+    public void setVerbose(final boolean v) { verbose = DEBUG || v; }
 
     public boolean isValid() {
         return shaderState.linked();
@@ -123,7 +124,7 @@ public class FixedFuncPipeline {
         return activeTextureUnit;
     }
 
-    public void destroy(GL2ES2 gl) {
+    public void destroy(final GL2ES2 gl) {
         if(null != shaderProgramColor) {
             shaderProgramColor.release(gl, true);
         }
@@ -148,7 +149,7 @@ public class FixedFuncPipeline {
     //
     // Simple Globals
     //
-    public void glColor4f(GL2ES2 gl, float red, float green, float blue, float alpha) {
+    public void glColor4f(final GL2ES2 gl, final float red, final float green, final float blue, final float alpha) {
         colorStatic.put(0, red);
         colorStatic.put(1, green);
         colorStatic.put(2, blue);
@@ -168,15 +169,15 @@ public class FixedFuncPipeline {
     // Arrays / States
     //
 
-    public void glEnableClientState(GL2ES2 gl, int glArrayIndex) {
+    public void glEnableClientState(final GL2ES2 gl, final int glArrayIndex) {
         glToggleClientState(gl, glArrayIndex, true);
     }
 
-    public void glDisableClientState(GL2ES2 gl, int glArrayIndex) {
+    public void glDisableClientState(final GL2ES2 gl, final int glArrayIndex) {
         glToggleClientState(gl, glArrayIndex, false);
     }
 
-    private void glToggleClientState(GL2ES2 gl, int glArrayIndex, boolean enable) {
+    private void glToggleClientState(final GL2ES2 gl, final int glArrayIndex, final boolean enable) {
         final String arrayName = GLPointerFuncUtil.getPredefinedArrayIndexName(glArrayIndex, clientActiveTextureUnit);
         if(null == arrayName) {
             throw new GLException("arrayIndex "+toHexString(glArrayIndex)+" unknown");
@@ -203,17 +204,17 @@ public class FixedFuncPipeline {
         }
     }
 
-    public void glVertexPointer(GL2ES2 gl, GLArrayData data) {
+    public void glVertexPointer(final GL2ES2 gl, final GLArrayData data) {
         shaderState.useProgram(gl, true);
         shaderState.vertexAttribPointer(gl, data);
     }
 
-    public void glColorPointer(GL2ES2 gl, GLArrayData data) {
+    public void glColorPointer(final GL2ES2 gl, final GLArrayData data) {
         shaderState.useProgram(gl, true);
         shaderState.vertexAttribPointer(gl, data);
     }
 
-    public void glNormalPointer(GL2ES2 gl, GLArrayData data) {
+    public void glNormalPointer(final GL2ES2 gl, final GLArrayData data) {
         shaderState.useProgram(gl, true);
         shaderState.vertexAttribPointer(gl, data);
     }
@@ -223,7 +224,7 @@ public class FixedFuncPipeline {
     //
 
     /** Enables/Disables the named texture unit (if changed), returns previous state */
-    private boolean glEnableTexture(boolean enable, int unit) {
+    private boolean glEnableTexture(final boolean enable, final int unit) {
         final boolean isEnabled = 0 != ( textureEnabledBits & ( 1 << activeTextureUnit ) );
         if( isEnabled != enable ) {
             if(enable) {
@@ -256,7 +257,7 @@ public class FixedFuncPipeline {
         }
     }
 
-    public void glTexCoordPointer(GL2ES2 gl, GLArrayData data) {
+    public void glTexCoordPointer(final GL2ES2 gl, final GLArrayData data) {
         if( GLPointerFunc.GL_TEXTURE_COORD_ARRAY != data.getIndex() ) {
             throw new GLException("Invalid GLArrayData Index "+toHexString(data.getIndex())+", "+data);
         }
@@ -265,7 +266,7 @@ public class FixedFuncPipeline {
         shaderState.vertexAttribPointer(gl, data);
     }
 
-    public void glBindTexture(int target, int texture) {
+    public void glBindTexture(final int target, final int texture) {
         if(GL.GL_TEXTURE_2D == target) {
             if( texture != boundTextureObject[activeTextureUnit] ) {
                 boundTextureObject[activeTextureUnit] = texture;
@@ -276,8 +277,8 @@ public class FixedFuncPipeline {
         }
     }
 
-    public void glTexImage2D(int target, /* int level, */ int internalformat, /*, int width, int height, int border, */
-                             int format /*, int type,  Buffer pixels */) {
+    public void glTexImage2D(final int target, /* int level, */ final int internalformat, /*, int width, int height, int border, */
+                             final int format /*, int type,  Buffer pixels */) {
         final int ifmt;
         if(GL.GL_TEXTURE_2D == target) {
             switch(internalformat) {
@@ -316,7 +317,7 @@ public class FixedFuncPipeline {
         textureFormatDirty = true;
     }*/
 
-    public void glTexEnvi(int target, int pname, int value) {
+    public void glTexEnvi(final int target, final int pname, final int value) {
         if(GL2ES1.GL_TEXTURE_ENV == target && GL2ES1.GL_TEXTURE_ENV_MODE == pname) {
             final int mode;
             switch( value ) {
@@ -329,10 +330,10 @@ public class FixedFuncPipeline {
                 case GL2ES1.GL_DECAL:
                     mode = 3;
                     break;
-                case GL2ES1.GL_BLEND:
+                case GL.GL_BLEND:
                     mode = 4;
                     break;
-                case GL2ES1.GL_REPLACE:
+                case GL.GL_REPLACE:
                     mode = 5;
                     break;
                 case GL2ES1.GL_COMBINE:
@@ -347,27 +348,27 @@ public class FixedFuncPipeline {
             System.err.println("FixedFuncPipeline: Unimplemented TexEnv: target "+toHexString(target)+", pname "+toHexString(pname)+", mode: "+toHexString(value));
         }
     }
-    private void setTextureEnvMode(int value) {
+    private void setTextureEnvMode(final int value) {
         if( value != textureEnvMode.get(activeTextureUnit) ) {
             textureEnvMode.put(activeTextureUnit, value);
             textureEnvModeDirty = true;
         }
     }
-    public void glGetTexEnviv(int target, int pname,  IntBuffer params) { // FIXME
+    public void glGetTexEnviv(final int target, final int pname,  final IntBuffer params) { // FIXME
         System.err.println("FixedFuncPipeline: Unimplemented glGetTexEnviv: target "+toHexString(target)+", pname "+toHexString(pname));
     }
-    public void glGetTexEnviv(int target, int pname,  int[] params, int params_offset) { // FIXME
+    public void glGetTexEnviv(final int target, final int pname,  final int[] params, final int params_offset) { // FIXME
         System.err.println("FixedFuncPipeline: Unimplemented glGetTexEnviv: target "+toHexString(target)+", pname "+toHexString(pname));
     }
 
     //
     // Point Sprites
     //
-    public void glPointSize(float size) {
+    public void glPointSize(final float size) {
         pointParams.put(0, size);
         pointParamsDirty = true;
     }
-    public  void glPointParameterf(int pname, float param) {
+    public  void glPointParameterf(final int pname, final float param) {
         switch(pname) {
             case GL2ES1.GL_POINT_SIZE_MIN:
                 pointParams.put(2, param);
@@ -375,13 +376,13 @@ public class FixedFuncPipeline {
             case GL2ES1.GL_POINT_SIZE_MAX:
                 pointParams.put(3, param);
                 break;
-            case GL2ES2.GL_POINT_FADE_THRESHOLD_SIZE:
+            case GL.GL_POINT_FADE_THRESHOLD_SIZE:
                 pointParams.put(4+3, param);
                 break;
         }
         pointParamsDirty = true;
     }
-    public  void glPointParameterfv(int pname, float[] params, int params_offset) {
+    public  void glPointParameterfv(final int pname, final float[] params, final int params_offset) {
         switch(pname) {
             case GL2ES1.GL_POINT_DISTANCE_ATTENUATION:
                 pointParams.put(4+0, params[params_offset + 0]);
@@ -391,7 +392,7 @@ public class FixedFuncPipeline {
         }
         pointParamsDirty = true;
     }
-    public  void glPointParameterfv(int pname, java.nio.FloatBuffer params) {
+    public  void glPointParameterfv(final int pname, final java.nio.FloatBuffer params) {
         final int o = params.position();
         switch(pname) {
             case GL2ES1.GL_POINT_DISTANCE_ATTENUATION:
@@ -405,7 +406,7 @@ public class FixedFuncPipeline {
 
     // private int[] pointTexObj = new int[] { 0 };
 
-    private void glDrawPoints(GL2ES2 gl, GLRunnable2<Object,Object> glDrawAction, Object args) {
+    private void glDrawPoints(final GL2ES2 gl, final GLRunnable2<Object,Object> glDrawAction, final Object args) {
         if(gl.isGL2GL3()) {
             gl.glEnable(GL2GL3.GL_VERTEX_PROGRAM_POINT_SIZE);
         }
@@ -428,13 +429,13 @@ public class FixedFuncPipeline {
     }
     private static final GLRunnable2<Object, Object> glDrawArraysAction = new GLRunnable2<Object,Object>() {
         @Override
-        public Object run(GL gl, Object args) {
-            int[] _args = (int[])args;
+        public Object run(final GL gl, final Object args) {
+            final int[] _args = (int[])args;
             gl.glDrawArrays(GL.GL_POINTS, _args[0], _args[1]);
             return null;
         }
     };
-    private final void glDrawPointArrays(GL2ES2 gl, int first, int count) {
+    private final void glDrawPointArrays(final GL2ES2 gl, final int first, final int count) {
         glDrawPoints(gl, glDrawArraysAction, new int[] { first, count });
     }
 
@@ -442,7 +443,7 @@ public class FixedFuncPipeline {
     // Lighting
     //
 
-    public void glLightfv(GL2ES2 gl, int light, int pname, java.nio.FloatBuffer params) {
+    public void glLightfv(final GL2ES2 gl, int light, final int pname, final java.nio.FloatBuffer params) {
         shaderState.useProgram(gl, true);
         light -=GLLightingFunc.GL_LIGHT0;
         if(0 <= light && light < MAX_LIGHTS) {
@@ -490,7 +491,7 @@ public class FixedFuncPipeline {
         }
     }
 
-    public void glMaterialfv(GL2ES2 gl, int face, int pname, java.nio.FloatBuffer params) {
+    public void glMaterialfv(final GL2ES2 gl, final int face, final int pname, final java.nio.FloatBuffer params) {
         shaderState.useProgram(gl, true);
 
         switch (face) {
@@ -544,9 +545,9 @@ public class FixedFuncPipeline {
     // Misc States
     //
 
-    public void glShadeModel(GL2ES2 gl, int mode) {
+    public void glShadeModel(final GL2ES2 gl, final int mode) {
         shaderState.useProgram(gl, true);
-        GLUniformData ud = shaderState.getUniform(mgl_ShadeModel);
+        final GLUniformData ud = shaderState.getUniform(mgl_ShadeModel);
         if(null!=ud) {
             ud.setData(mode);
             shaderState.uniform(gl, ud);
@@ -580,7 +581,7 @@ public class FixedFuncPipeline {
         }
     } */
 
-    public  void glAlphaFunc(int func, float ref) {
+    public  void glAlphaFunc(final int func, final float ref) {
         int _func;
         switch(func) {
             case GL.GL_NEVER:
@@ -627,7 +628,7 @@ public class FixedFuncPipeline {
      *         eg this call must not be passed to an underlying ES2 implementation.
      *         true if this call shall be passed to an underlying GL2ES2/ES2 implementation as well.
      */
-    public boolean glEnable(int cap, boolean enable) {
+    public boolean glEnable(final int cap, final boolean enable) {
         switch(cap) {
             case GL.GL_BLEND:
             case GL.GL_DEPTH_TEST:
@@ -684,7 +685,7 @@ public class FixedFuncPipeline {
                 return false;
         }
 
-        int light = cap - GLLightingFunc.GL_LIGHT0;
+        final int light = cap - GLLightingFunc.GL_LIGHT0;
         if(0 <= light && light < MAX_LIGHTS) {
             if ( (lightsEnabled.get(light)==1) != enable ) {
                 lightsEnabled.put(light, enable?1:0);
@@ -700,7 +701,7 @@ public class FixedFuncPipeline {
     // Draw
     //
 
-    public void glDrawArrays(GL2ES2 gl, int mode, int first, int count) {
+    public void glDrawArrays(final GL2ES2 gl, int mode, final int first, final int count) {
         switch(mode) {
             case GL2.GL_QUAD_STRIP:
                 mode=GL.GL_TRIANGLE_STRIP;
@@ -708,12 +709,12 @@ public class FixedFuncPipeline {
             case GL2.GL_POLYGON:
                 mode=GL.GL_TRIANGLE_FAN;
                 break;
-            case GL2ES1.GL_POINTS:
+            case GL.GL_POINTS:
                 glDrawPointArrays(gl, first, count);
                 return;
         }
         validate(gl, true);
-        if ( GL2.GL_QUADS == mode && !gl.isGL2() ) {
+        if ( GL2GL3.GL_QUADS == mode && !gl.isGL2() ) {
             for (int j = first; j < count - 3; j += 4) {
                 gl.glDrawArrays(GL.GL_TRIANGLE_FAN, j, 4);
             }
@@ -721,25 +722,25 @@ public class FixedFuncPipeline {
             gl.glDrawArrays(mode, first, count);
         }
     }
-    public void glDrawElements(GL2ES2 gl, int mode, int count, int type, java.nio.Buffer indices) {
+    public void glDrawElements(final GL2ES2 gl, final int mode, final int count, final int type, final java.nio.Buffer indices) {
         validate(gl, true);
-        if ( GL2.GL_QUADS == mode && !gl.isGL2() ) {
+        if ( GL2GL3.GL_QUADS == mode && !gl.isGL2() ) {
             final int idx0 = indices.position();
 
             if( GL.GL_UNSIGNED_BYTE == type ) {
                 final ByteBuffer b = (ByteBuffer) indices;
                 for (int j = 0; j < count; j++) {
-                    gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x000000ff & b.get(idx0+j)), 4);
+                    gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0x000000ff & b.get(idx0+j), 4);
                 }
             } else if( GL.GL_UNSIGNED_SHORT == type ){
                 final ShortBuffer b = (ShortBuffer) indices;
                 for (int j = 0; j < count; j++) {
-                    gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0x0000ffff & b.get(idx0+j)), 4);
+                    gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0x0000ffff & b.get(idx0+j), 4);
                 }
             } else {
                 final IntBuffer b = (IntBuffer) indices;
                 for (int j = 0; j < count; j++) {
-                    gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0xffffffff & b.get(idx0+j)), 4);
+                    gl.glDrawArrays(GL.GL_TRIANGLE_FAN, 0xffffffff & b.get(idx0+j), 4);
                 }
             }
         } else {
@@ -747,24 +748,24 @@ public class FixedFuncPipeline {
             if( !gl.getContext().isCPUDataSourcingAvail() ) {
                 throw new GLException("CPU data sourcing n/a w/ "+gl.getContext());
             }
-            if( GL2ES1.GL_POINTS != mode ) {
+            // if( GL.GL_POINTS != mode ) {
                 ((GLES2)gl).glDrawElements(mode, count, type, indices);
-            } else {
+            /* } else {
                 // FIXME GL_POINTS !
                 ((GLES2)gl).glDrawElements(mode, count, type, indices);
-            }
+            } */
         }
     }
-    public void glDrawElements(GL2ES2 gl, int mode, int count, int type, long indices_buffer_offset) {
+    public void glDrawElements(final GL2ES2 gl, final int mode, final int count, final int type, final long indices_buffer_offset) {
         validate(gl, true);
-        if ( GL2.GL_QUADS == mode && !gl.isGL2() ) {
+        if ( GL2GL3.GL_QUADS == mode && !gl.isGL2() ) {
             throw new GLException("Cannot handle indexed QUADS on !GL2 w/ VBO due to lack of CPU index access");
-        } else if( GL2ES1.GL_POINTS != mode ) {
-            // FIXME GL_POINTS !
+        } else /* if( GL.GL_POINTS != mode ) */ {
             gl.glDrawElements(mode, count, type, indices_buffer_offset);
-        } else {
+        } /* else {
+            // FIXME GL_POINTS !
             gl.glDrawElements(mode, count, type, indices_buffer_offset);
-        }
+        } */
     }
 
     private final int textureEnabledCount() {
@@ -777,7 +778,7 @@ public class FixedFuncPipeline {
         return n;
     }
 
-    public void validate(GL2ES2 gl, boolean selectShader) {
+    public void validate(final GL2ES2 gl, final boolean selectShader) {
         if( selectShader ) {
             if( ShaderSelectionMode.AUTO == requestedShaderSelectionMode) {
                 final ShaderSelectionMode newMode;
@@ -832,7 +833,7 @@ public class FixedFuncPipeline {
         if(colorVAEnabledDirty) {
             ud = shaderState.getUniform(mgl_ColorEnabled);
             if(null!=ud) {
-                int ca = true == shaderState.isVertexAttribArrayEnabled(GLPointerFuncUtil.mgl_Color) ? 1 : 0 ;
+                final int ca = true == shaderState.isVertexAttribArrayEnabled(GLPointerFuncUtil.mgl_Color) ? 1 : 0 ;
                 if(ca!=ud.intValue()) {
                     ud.setData(ca);
                     shaderState.uniform(gl, ud);
@@ -926,7 +927,7 @@ public class FixedFuncPipeline {
         }
     }
 
-    public StringBuilder toString(StringBuilder sb, boolean alsoUnlocated) {
+    public StringBuilder toString(StringBuilder sb, final boolean alsoUnlocated) {
         if(null == sb) {
             sb = new StringBuilder();
         }
@@ -956,14 +957,14 @@ public class FixedFuncPipeline {
     private static final String constMaxTextures4 = "#define MAX_TEXTURE_UNITS 4\n";
     private static final String constMaxTextures8 = "#define MAX_TEXTURE_UNITS 8\n";
 
-    private final void customizeShader(GL2ES2 gl, ShaderCode vp, ShaderCode fp, String maxTextureDefine) {
-        int rsVpPos = vp.defaultShaderCustomization(gl, true, true);
-        int rsFpPos = fp.defaultShaderCustomization(gl, true, true);
+    private final void customizeShader(final GL2ES2 gl, final ShaderCode vp, final ShaderCode fp, final String maxTextureDefine) {
+        final int rsVpPos = vp.defaultShaderCustomization(gl, true, true);
+        final int rsFpPos = fp.defaultShaderCustomization(gl, true, true);
         vp.insertShaderSource(0, rsVpPos, maxTextureDefine);
         fp.insertShaderSource(0, rsFpPos, maxTextureDefine);
     }
 
-    private final void loadShaderPoints(GL2ES2 gl) {
+    private final void loadShaderPoints(final GL2ES2 gl) {
         if( null != shaderProgramPoints ) {
             return;
         }
@@ -981,7 +982,7 @@ public class FixedFuncPipeline {
         }
     }
 
-    private final void loadShader(GL2ES2 gl, ShaderSelectionMode mode) {
+    private final void loadShader(final GL2ES2 gl, final ShaderSelectionMode mode) {
         final boolean loadColor = ShaderSelectionMode.COLOR == mode;
         final boolean loadColorTexture2 = ShaderSelectionMode.COLOR_TEXTURE2 == mode;
         final boolean loadColorTexture4 = ShaderSelectionMode.COLOR_TEXTURE4 == mode;
@@ -1068,7 +1069,7 @@ public class FixedFuncPipeline {
         }
     }
 
-    private ShaderProgram selectShaderProgram(GL2ES2 gl, ShaderSelectionMode newMode) {
+    private ShaderProgram selectShaderProgram(final GL2ES2 gl, ShaderSelectionMode newMode) {
         if(ShaderSelectionMode.AUTO == newMode) {
             newMode = ShaderSelectionMode.COLOR;
         }
@@ -1098,7 +1099,7 @@ public class FixedFuncPipeline {
         return sp;
     }
 
-    private void init(GL2ES2 gl, ShaderSelectionMode mode, PMVMatrix pmvMatrix) {
+    private void init(final GL2ES2 gl, final ShaderSelectionMode mode, final PMVMatrix pmvMatrix) {
         if(null==pmvMatrix) {
             throw new GLException("PMVMatrix is null");
         }
@@ -1157,7 +1158,7 @@ public class FixedFuncPipeline {
         }
     }
 
-    private String toHexString(int i) {
+    private String toHexString(final int i) {
         return "0x"+Integer.toHexString(i);
     }
 
diff --git a/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java b/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java
index 45087ea..e3e43b3 100644
--- a/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java
+++ b/src/jogl/classes/jogamp/opengl/util/jpeg/JPEGDecoder.java
@@ -117,8 +117,8 @@ public class JPEGDecoder {
         private JFIF(final byte data[]) {
             version = new VersionNumber(data[5], data[6], 0);
             densityUnits = data[7];
-            xDensity = (data[8] << 8) | data[9];
-            yDensity = (data[10] << 8) | data[11];
+            xDensity = ((data[ 8] << 8) & 0xff00) | (data[ 9] & 0xff);
+            yDensity = ((data[10] << 8) & 0xff00) | (data[11] & 0xff);
             thumbWidth = data[12];
             thumbHeight = data[13];
             if( 0 < thumbWidth && 0 < thumbHeight ) {
@@ -155,8 +155,8 @@ public class JPEGDecoder {
 
         private Adobe(final byte[] data) {
             version = data[6];
-            flags0 = (short) ( (data[7] << 8) | data[8]  ) ;
-            flags1 = (short) ( (data[9] << 8) | data[10] ) ;
+            flags0 = (short)(((data[7] << 8) & 0xff00) | (data[ 8] & 0xff));
+            flags1 = (short)(((data[9] << 8) & 0xff00) | (data[10] & 0xff));
             colorCode = data[11];
             switch( colorCode ) {
                 case 2: colorSpace = ColorSpace.YCCK; break;
@@ -200,14 +200,14 @@ public class JPEGDecoder {
 
     @SuppressWarnings("serial")
     public static class CodecException extends RuntimeException {
-        CodecException(String message) {
+        CodecException(final String message) {
             super(message);
         }
     }
     @SuppressWarnings("serial")
     public static class MarkerException extends CodecException {
         final int marker;
-        MarkerException(int marker, String message) {
+        MarkerException(final int marker, final String message) {
             super(message+" - Marker "+toHexString(marker));
             this.marker = marker;
         }
@@ -312,7 +312,7 @@ public class JPEGDecoder {
         int mcusPerLine;
         int mcusPerColumn;
 
-        Frame(boolean progressive, int precision, int scanLines, int samplesPerLine, int componentsCount, int[][] qtt) {
+        Frame(final boolean progressive, final int precision, final int scanLines, final int samplesPerLine, final int componentsCount, final int[][] qtt) {
             this.progressive = progressive;
             this.precision = precision;
             this.scanLines = scanLines;
@@ -323,7 +323,7 @@ public class JPEGDecoder {
             this.qtt = qtt;
         }
 
-        private final void checkBounds(int idx) {
+        private final void checkBounds(final int idx) {
             if( 0 > idx || idx >= compCount ) {
                 throw new CodecException("Idx out of bounds "+idx+", "+this);
             }
@@ -343,7 +343,7 @@ public class JPEGDecoder {
         public final int getCompCount() { return compCount; }
         public final int getMaxCompID() { return maxCompID; }
 
-        public final void putOrdered(int compID, ComponentIn component) {
+        public final void putOrdered(final int compID, final ComponentIn component) {
             if( maxCompID < compID ) {
                 maxCompID = compID;
             }
@@ -352,17 +352,17 @@ public class JPEGDecoder {
             compIDs.add(compID);
             comps[idx] = component;
         }
-        public final ComponentIn getCompByIndex(int i) {
+        public final ComponentIn getCompByIndex(final int i) {
             checkBounds(i);
             return comps[i];
         }
-        public final ComponentIn getCompByID(int componentID) {
+        public final ComponentIn getCompByID(final int componentID) {
             return getCompByIndex( compIDs.indexOf(componentID) );
         }
-        public final int getCompID(int idx) {
+        public final int getCompID(final int idx) {
             return compIDs.get(idx);
         }
-        public final boolean hasCompID(int componentID) {
+        public final boolean hasCompID(final int componentID) {
             return compIDs.contains(componentID);
         }
         @Override
@@ -373,7 +373,7 @@ public class JPEGDecoder {
     }
 
     /** The JPEG encoded components */
-    class ComponentIn {
+    static class ComponentIn {
         final int h, v;
         /** index to frame.qtt[] */
         final int qttIdx;
@@ -387,20 +387,20 @@ public class JPEGDecoder {
         BinObj huffmanTableAC;
         BinObj huffmanTableDC;
 
-        ComponentIn(int h, int v, int qttIdx) {
+        ComponentIn(final int h, final int v, final int qttIdx) {
             this.h = h;
             this.v = v;
             this.qttIdx = qttIdx;
         }
 
-        public final void allocateBlocks(int blocksPerColumn, int blocksPerColumnForMcu, int blocksPerLine, int blocksPerLineForMcu) {
+        public final void allocateBlocks(final int blocksPerColumn, final int blocksPerColumnForMcu, final int blocksPerLine, final int blocksPerLineForMcu) {
             this.blocksPerColumn = blocksPerColumn;
             this.blocksPerColumnForMcu = blocksPerColumnForMcu;
             this.blocksPerLine = blocksPerLine;
             this.blocksPerLineForMcu = blocksPerLineForMcu;
             this.blocks = new int[blocksPerColumnForMcu][blocksPerLineForMcu][64];
         }
-        public final int[] getBlock(int row, int col) {
+        public final int[] getBlock(final int row, final int col) {
             if( row >= blocksPerColumnForMcu || col >= blocksPerLineForMcu ) {
                 throw new CodecException("Out of bounds given ["+row+"]["+col+"] - "+this);
             }
@@ -414,19 +414,19 @@ public class JPEGDecoder {
     }
 
     /** The decoded components */
-    class ComponentOut {
+    static class ComponentOut {
         private final ArrayList<byte[]> lines;
         final float scaleX;
         final float scaleY;
 
-        ComponentOut(ArrayList<byte[]> lines, float scaleX, float scaleY) {
+        ComponentOut(final ArrayList<byte[]> lines, final float scaleX, final float scaleY) {
             this.lines = lines;
             this.scaleX = scaleX;
             this.scaleY = scaleY;
         }
 
         /** Safely returning a line, if index exceeds number of lines, last line is returned. */
-        public final byte[] getLine(int i) {
+        public final byte[] getLine(final int i) {
             final int sz = lines.size();
             return lines.get( i < sz ? i : sz - 1);
         }
@@ -461,10 +461,10 @@ public class JPEGDecoder {
     public final int getWidth() { return width; }
     public final int getHeight() { return height; }
 
-    private final void setStream(InputStream is) {
+    private final void setStream(final InputStream is) {
         try {
             bstream.setStream(is, false /* outputMode */);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new RuntimeException(e); // should not happen, no flush()
         }
     }
@@ -488,14 +488,14 @@ public class JPEGDecoder {
     private final byte[] readDataBlock() throws IOException {
         int count=0, i=0;
         final int len=readUInt16();   count+=2;
-        byte[] data = new byte[len-2];
+        final byte[] data = new byte[len-2];
         while(count<len){
             data[i++] = (byte)readUInt8(); count++;
         }
         if(DEBUG_IN) { System.err.println("JPEG.readDataBlock: net-len "+(len-2)+", "+this); dumpData(data, 0, len-2); }
         return data;
     }
-    static final void dumpData(byte[] data, int offset, int len) {
+    static final void dumpData(final byte[] data, final int offset, final int len) {
         for(int i=0; i<len; ) {
             System.err.print(i%8+": ");
             for(int j=0; j<8 && i<len; j++, i++) {
@@ -505,7 +505,7 @@ public class JPEGDecoder {
         }
     }
 
-    public synchronized void clear(InputStream inputStream) {
+    public synchronized void clear(final InputStream inputStream) {
         setStream(inputStream);
         width = 0;
         height = 0;
@@ -673,7 +673,7 @@ public class JPEGDecoder {
                 int count = 0;
                 final int sosLen = readUInt16(); count+=2;
                 final int selectorsCount = readUInt8(); count++;
-                ArrayList<ComponentIn> components = new ArrayList<ComponentIn>();
+                final ArrayList<ComponentIn> components = new ArrayList<ComponentIn>();
                 if(DEBUG) { System.err.println("JPG.parse.SOS: selectorCount [0.."+(selectorsCount-1)+"]: "+frame); }
                 for (int i = 0; i < selectorsCount; i++) {
                     final int compID = readUInt8(); count++;
@@ -734,7 +734,7 @@ public class JPEGDecoder {
         return this;
     }
 
-    private void prepareComponents(Frame frame) {
+    private void prepareComponents(final Frame frame) {
         int maxH = 0, maxV = 0;
         // for (componentId in frame.components) {
         final int compCount = frame.getCompCount();
@@ -743,8 +743,8 @@ public class JPEGDecoder {
             if (maxH < component.h) maxH = component.h;
             if (maxV < component.v) maxV = component.v;
         }
-        int mcusPerLine = (int) Math.ceil(frame.samplesPerLine / 8f / maxH);
-        int mcusPerColumn = (int) Math.ceil(frame.scanLines / 8f / maxV);
+        final int mcusPerLine = (int) Math.ceil(frame.samplesPerLine / 8f / maxH);
+        final int mcusPerColumn = (int) Math.ceil(frame.scanLines / 8f / maxV);
         // for (componentId in frame.components) {
         for (int i=0; i<compCount; i++) {
             final ComponentIn component = frame.getCompByIndex(i);
@@ -760,7 +760,7 @@ public class JPEGDecoder {
         frame.mcusPerColumn = mcusPerColumn;
     }
 
-    private static class BinObjIdxed {
+    static class BinObjIdxed {
         final BinObj children;
         byte index;
         BinObjIdxed() {
@@ -768,12 +768,12 @@ public class JPEGDecoder {
             this.index = 0;
         }
     }
-    private static class BinObj {
+    static class BinObj {
         final boolean isValue;
         final BinObj[] tree;
         final byte b;
 
-        BinObj(byte b) {
+        BinObj(final byte b) {
             this.isValue= true;
             this.b = b;
             this.tree = null;
@@ -784,12 +784,12 @@ public class JPEGDecoder {
             this.tree = new BinObj[2];
         }
         final byte getValue() { return b; }
-        final BinObj get(int i) { return tree[i]; }
-        final void set(byte i, byte v) { tree[i] = new BinObj(v); }
-        final void set(byte i, BinObj v) { tree[i] = v; }
+        final BinObj get(final int i) { return tree[i]; }
+        final void set(final byte i, final byte v) { tree[i] = new BinObj(v); }
+        final void set(final byte i, final BinObj v) { tree[i] = v; }
     }
 
-    private BinObj buildHuffmanTable(int[] codeLengths, byte[] values) {
+    private BinObj buildHuffmanTable(final int[] codeLengths, final byte[] values) {
         int k = 0;
         int length = 16;
         final ArrayList<BinObjIdxed> code = new ArrayList<BinObjIdxed>();
@@ -827,13 +827,13 @@ public class JPEGDecoder {
     }
 
     private final Output output = new Output();
-    private static class Output {
+    static class Output {
         private int blocksPerLine;
         private int blocksPerColumn;
         private int samplesPerLine;
 
-        private ArrayList<byte[]> buildComponentData(Frame frame, ComponentIn component) {
-            ArrayList<byte[]> lines = new ArrayList<byte[]>();
+        private ArrayList<byte[]> buildComponentData(final Frame frame, final ComponentIn component) {
+            final ArrayList<byte[]> lines = new ArrayList<byte[]>();
             blocksPerLine = component.blocksPerLine;
             blocksPerColumn = component.blocksPerColumn;
             samplesPerLine = blocksPerLine << 3;
@@ -867,9 +867,9 @@ public class JPEGDecoder {
         //   "Practical Fast 1-D DCT Algorithms with 11 Multiplications",
         //   IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989,
         //   988-991.
-        private void quantizeAndInverse(int[] zz, byte[] dataOut, int[] dataIn, int[] qt) {
+        private void quantizeAndInverse(final int[] zz, final byte[] dataOut, final int[] dataIn, final int[] qt) {
             int v0, v1, v2, v3, v4, v5, v6, v7, t;
-            int[] p = dataIn;
+            final int[] p = dataIn;
             int i;
 
             // dequant
@@ -879,7 +879,7 @@ public class JPEGDecoder {
 
             // inverse DCT on rows
             for (i = 0; i < 8; ++i) {
-                int row = 8 * i;
+                final int row = 8 * i;
 
                 // check for all-zero AC coefficients
                 if (p[1 + row] == 0 && p[2 + row] == 0 && p[3 + row] == 0 &&
@@ -948,7 +948,7 @@ public class JPEGDecoder {
 
             // inverse DCT on columns
             for (i = 0; i < 8; ++i) {
-                int col = i;
+                final int col = i;
 
                 // check for all-zero AC coefficients
                 if (p[1*8 + col] == 0 && p[2*8 + col] == 0 && p[3*8 + col] == 0 &&
@@ -1017,17 +1017,17 @@ public class JPEGDecoder {
 
             // convert to 8-bit integers
             for (i = 0; i < 64; ++i) {
-                int sample = 128 + ((p[i] + 8) >> 4);
+                final int sample = 128 + ((p[i] + 8) >> 4);
                 dataOut[i] = (byte) ( sample < 0 ? 0 : sample > 0xFF ? 0xFF : sample );
             }
         }
     }
 
-    private static interface DecoderFunction {
+    static interface DecoderFunction {
         void decode(ComponentIn component, int[] zz) throws IOException;
     }
 
-    private class Decoder {
+    class Decoder {
         // private int precision;
         // private int samplesPerLine;
         // private int scanLines;
@@ -1039,8 +1039,8 @@ public class JPEGDecoder {
         private int eobrun;
         private int successiveACState, successiveACNextValue;
 
-        private int decodeScan(Frame frame, ArrayList<ComponentIn> components, int resetInterval,
-                int spectralStart, int spectralEnd, int successivePrev, int successive) throws IOException {
+        private int decodeScan(final Frame frame, final ArrayList<ComponentIn> components, int resetInterval,
+                final int spectralStart, final int spectralEnd, final int successivePrev, final int successive) throws IOException {
             // this.precision = frame.precision;
             // this.samplesPerLine = frame.samplesPerLine;
             // this.scanLines = frame.scanLines;
@@ -1110,10 +1110,10 @@ public class JPEGDecoder {
                             mcu++;
                         }
                     }
-                } catch (MarkerException markerException) {
+                } catch (final MarkerException markerException) {
                     if(DEBUG) { System.err.println("JPEG.decodeScan: Marker exception: "+markerException.getMessage()); markerException.printStackTrace(); }
                     return markerException.getMarker();
-                } catch (CodecException codecException) {
+                } catch (final CodecException codecException) {
                     if(DEBUG) { System.err.println("JPEG.decodeScan: Codec exception: "+codecException.getMessage()); codecException.printStackTrace(); }
                     bstream.skip( bstream.getBitCount() ); // align to next byte
                     return M_EOI; // force end !
@@ -1159,7 +1159,7 @@ public class JPEGDecoder {
             return bit;
         }
 
-        private int decodeHuffman(BinObj tree) throws IOException {
+        private int decodeHuffman(final BinObj tree) throws IOException {
             BinObj node = tree;
             int bit;
             while ( ( bit = readBit() ) != -1 ) {
@@ -1182,7 +1182,7 @@ public class JPEGDecoder {
             }
             return n;
         }
-        private int receiveAndExtend(int length) throws IOException {
+        private int receiveAndExtend(final int length) throws IOException {
             final int n = receive(length);
             if (n >= 1 << (length - 1)) {
                 return n;
@@ -1198,7 +1198,7 @@ public class JPEGDecoder {
 
         class BaselineDecoder implements DecoderFunction {
             @Override
-            public void decode(ComponentIn component, int[] zz) throws IOException {
+            public void decode(final ComponentIn component, final int[] zz) throws IOException {
                 final int t = decodeHuffman(component.huffmanTableDC);
                 final int diff = ( t == 0 ) ? 0 : receiveAndExtend(t);
                 zz[0] = ( component.pred += diff );
@@ -1222,7 +1222,7 @@ public class JPEGDecoder {
         }
         class DCFirstDecoder implements DecoderFunction {
             @Override
-            public void decode(ComponentIn component, int[] zz) throws IOException {
+            public void decode(final ComponentIn component, final int[] zz) throws IOException {
                 final int t = decodeHuffman(component.huffmanTableDC);
                 final int diff = ( t == 0 ) ? 0 : (receiveAndExtend(t) << successive);
                 zz[0] = ( component.pred += diff );
@@ -1230,19 +1230,20 @@ public class JPEGDecoder {
         }
         class DCSuccessiveDecoder implements DecoderFunction {
             @Override
-            public void decode(ComponentIn component, int[] zz) throws IOException {
+            public void decode(final ComponentIn component, final int[] zz) throws IOException {
                 zz[0] |= readBit() << successive;
             }
         }
 
         class ACFirstDecoder implements DecoderFunction {
             @Override
-            public void decode(ComponentIn component, int[] zz) throws IOException {
+            public void decode(final ComponentIn component, final int[] zz) throws IOException {
                 if (eobrun > 0) {
                     eobrun--;
                     return;
                 }
-                int k = spectralStart, e = spectralEnd;
+                int k = spectralStart;
+                final int e = spectralEnd;
                 while (k <= e) {
                     final int rs = decodeHuffman(component.huffmanTableAC);
                     final int s = rs & 15, r = rs >> 4;
@@ -1263,8 +1264,10 @@ public class JPEGDecoder {
         }
         class ACSuccessiveDecoder implements DecoderFunction {
             @Override
-            public void decode(ComponentIn component, int[] zz) throws IOException {
-                int k = spectralStart, e = spectralEnd, r = 0;
+            public void decode(final ComponentIn component, final int[] zz) throws IOException {
+                int k = spectralStart;
+                final int e = spectralEnd;
+                int r = 0;
                 while (k <= e) {
                     final int z = dctZigZag[k];
                     switch (successiveACState) {
@@ -1324,14 +1327,14 @@ public class JPEGDecoder {
                     }
             }
         }
-        void decodeMcu(ComponentIn component, DecoderFunction decoder, int mcu, int row, int col) throws IOException {
+        void decodeMcu(final ComponentIn component, final DecoderFunction decoder, final int mcu, final int row, final int col) throws IOException {
             final int mcuRow = (mcu / mcusPerLine) | 0;
             final int mcuCol = mcu % mcusPerLine;
             final int blockRow = mcuRow * component.v + row;
             final int blockCol = mcuCol * component.h + col;
             decoder.decode(component, component.getBlock(blockRow, blockCol));
         }
-        void decodeBlock(ComponentIn component, DecoderFunction decoder, int mcu) throws IOException {
+        void decodeBlock(final ComponentIn component, final DecoderFunction decoder, final int mcu) throws IOException {
             final int blockRow = (mcu / component.blocksPerLine) | 0;
             final int blockCol = mcu % component.blocksPerLine;
             decoder.decode(component, component.getBlock(blockRow, blockCol));
@@ -1359,7 +1362,7 @@ public class JPEGDecoder {
         pixelStorage.storeRGB(x, y, (byte)R, (byte)G, (byte)B);
     } */
 
-    public synchronized void getPixel(JPEGDecoder.ColorSink pixelStorage, int width, int height) {
+    public synchronized void getPixel(final JPEGDecoder.ColorSink pixelStorage, final int width, final int height) {
         final int scaleX = this.width / width, scaleY = this.height / height;
 
         final int componentCount = this.components.length;
@@ -1507,11 +1510,11 @@ public class JPEGDecoder {
         }
     }
 
-    private static byte clampTo8bit(float a) {
+    private static byte clampTo8bit(final float a) {
         return (byte) ( a < 0f ? 0 : a > 255f ? 255 : a );
     }
 
-    private static String toHexString(int v) {
+    private static String toHexString(final int v) {
         return "0x"+Integer.toHexString(v);
     }
 }
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/FilterType.java b/src/jogl/classes/jogamp/opengl/util/pngj/FilterType.java
index 5e177b8..c577c4f 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/FilterType.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/FilterType.java
@@ -53,7 +53,7 @@ public enum FilterType {
 	FILTER_UNKNOWN(-100), ;
 	public final int val;
 
-	private FilterType(int val) {
+	private FilterType(final int val) {
 		this.val = val;
 	}
 
@@ -61,12 +61,12 @@ public enum FilterType {
 
 	static {
 		byVal = new HashMap<Integer, FilterType>();
-		for (FilterType ft : values()) {
+		for (final FilterType ft : values()) {
 			byVal.put(ft.val, ft);
 		}
 	}
 
-	public static FilterType getByVal(int i) {
+	public static FilterType getByVal(final int i) {
 		return byVal.get(i);
 	}
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/FilterWriteStrategy.java b/src/jogl/classes/jogamp/opengl/util/pngj/FilterWriteStrategy.java
index 79eed8f..63f4563 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/FilterWriteStrategy.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/FilterWriteStrategy.java
@@ -11,15 +11,15 @@ class FilterWriteStrategy {
 	private FilterType currentType; // 0-4
 	private int lastRowTested = -1000000;
 	// performance of each filter (less is better) (can be negative)
-	private double[] lastSums = new double[5];
+	private final double[] lastSums = new double[5];
 	// performance of each filter (less is better) (can be negative)
-	private double[] lastEntropies = new double[5];
+	private final double[] lastEntropies = new double[5];
 	// a priori preference (NONE SUB UP AVERAGE PAETH)
 	private double[] preference = new double[] { 1.1, 1.1, 1.1, 1.1, 1.2 };
 	private int discoverEachLines = -1;
-	private double[] histogram1 = new double[256];
+	private final double[] histogram1 = new double[256];
 
-	FilterWriteStrategy(ImageInfo imgInfo, FilterType configuredType) {
+	FilterWriteStrategy(final ImageInfo imgInfo, final FilterType configuredType) {
 		this.imgInfo = imgInfo;
 		this.configuredType = configuredType;
 		if (configuredType.val < 0) { // first guess
@@ -36,7 +36,7 @@ class FilterWriteStrategy {
 			discoverEachLines = 1;
 	}
 
-	boolean shouldTestAll(int rown) {
+	boolean shouldTestAll(final int rown) {
 		if (discoverEachLines > 0 && lastRowTested + discoverEachLines <= rown) {
 			currentType = null;
 			return true;
@@ -44,7 +44,7 @@ class FilterWriteStrategy {
 			return false;
 	}
 
-	public void setPreference(double none, double sub, double up, double ave, double paeth) {
+	public void setPreference(final double none, final double sub, final double up, final double ave, final double paeth) {
 		preference = new double[] { none, sub, up, ave, paeth };
 	}
 
@@ -52,7 +52,7 @@ class FilterWriteStrategy {
 		return (discoverEachLines > 0);
 	}
 
-	void fillResultsForFilter(int rown, FilterType type, double sum, int[] histo, boolean tentative) {
+	void fillResultsForFilter(final int rown, final FilterType type, final double sum, final int[] histo, final boolean tentative) {
 		lastRowTested = rown;
 		lastSums[type.val] = sum;
 		if (histo != null) {
@@ -72,7 +72,7 @@ class FilterWriteStrategy {
 		}
 	}
 
-	FilterType gimmeFilterType(int rown, boolean useEntropy) {
+	FilterType gimmeFilterType(final int rown, final boolean useEntropy) {
 		if (currentType == null) { // get better
 			if (rown == 0)
 				currentType = FilterType.FILTER_SUB;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageInfo.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageInfo.java
index ac7b858..cdd17a2 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageInfo.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageInfo.java
@@ -92,7 +92,7 @@ public class ImageInfo {
 	/**
 	 * Short constructor: assumes truecolor (RGB/RGBA)
 	 */
-	public ImageInfo(int cols, int rows, int bitdepth, boolean alpha) {
+	public ImageInfo(final int cols, final int rows, final int bitdepth, final boolean alpha) {
 		this(cols, rows, bitdepth, alpha, false, false);
 	}
 
@@ -113,7 +113,7 @@ public class ImageInfo {
 	 * @param indexed
 	 *            Flag: has palette
 	 */
-	public ImageInfo(int cols, int rows, int bitdepth, boolean alpha, boolean grayscale, boolean indexed) {
+	public ImageInfo(final int cols, final int rows, final int bitdepth, final boolean alpha, final boolean grayscale, final boolean indexed) {
 		this.cols = cols;
 		this.rows = rows;
 		this.alpha = alpha;
@@ -176,14 +176,14 @@ public class ImageInfo {
 	}
 
 	@Override
-	public boolean equals(Object obj) {
+	public boolean equals(final Object obj) {
 		if (this == obj)
 			return true;
 		if (obj == null)
 			return false;
 		if (getClass() != obj.getClass())
 			return false;
-		ImageInfo other = (ImageInfo) obj;
+		final ImageInfo other = (ImageInfo) obj;
 		if (alpha != other.alpha)
 			return false;
 		if (bitDepth != other.bitDepth)
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java
index e6afd86..5ad2e44 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLine.java
@@ -69,7 +69,7 @@ public class ImageLine {
 	/**
 	 * default mode: INT packed
 	 */
-	public ImageLine(ImageInfo imgInfo) {
+	public ImageLine(final ImageInfo imgInfo) {
 		this(imgInfo, SampleType.INT, false);
 	}
 
@@ -86,14 +86,14 @@ public class ImageLine {
 	 *            images
 	 *
 	 */
-	public ImageLine(ImageInfo imgInfo, SampleType stype, boolean unpackedMode) {
+	public ImageLine(final ImageInfo imgInfo, final SampleType stype, final boolean unpackedMode) {
 		this(imgInfo, stype, unpackedMode, null, null);
 	}
 
 	/**
 	 * If a preallocated array is passed, the copy is shallow
 	 */
-	ImageLine(ImageInfo imgInfo, SampleType stype, boolean unpackedMode, int[] sci, byte[] scb) {
+	ImageLine(final ImageInfo imgInfo, final SampleType stype, final boolean unpackedMode, final int[] sci, final byte[] scb) {
 		this.imgInfo = imgInfo;
 		channels = imgInfo.channels;
 		bitDepth = imgInfo.bitDepth;
@@ -118,7 +118,7 @@ public class ImageLine {
 	}
 
 	/** Sets row number (0 : Rows-1) */
-	public void setRown(int n) {
+	public void setRown(final int n) {
 		this.rown = n;
 	}
 
@@ -274,7 +274,7 @@ public class ImageLine {
 	 * The caller must be sure that the original was really packed
 	 */
 	public ImageLine unpackToNewImageLine() {
-		ImageLine newline = new ImageLine(imgInfo, sampleType, true);
+		final ImageLine newline = new ImageLine(imgInfo, sampleType, true);
 		if (sampleType == SampleType.INT)
 			unpackInplaceInt(imgInfo, scanline, newline.scanline, false);
 		else
@@ -288,7 +288,7 @@ public class ImageLine {
 	 * The caller must be sure that the original was really unpacked
 	 */
 	public ImageLine packToNewImageLine() {
-		ImageLine newline = new ImageLine(imgInfo, sampleType, false);
+		final ImageLine newline = new ImageLine(imgInfo, sampleType, false);
 		if (sampleType == SampleType.INT)
 			packInplaceInt(imgInfo, scanline, newline.scanline, false);
 		else
@@ -300,7 +300,7 @@ public class ImageLine {
 		return filterUsed;
 	}
 
-	public void setFilterUsed(FilterType ft) {
+	public void setFilterUsed(final FilterType ft) {
 		filterUsed = ft;
 	}
 
@@ -323,9 +323,9 @@ public class ImageLine {
 	/**
 	 * Prints some statistics - just for debugging
 	 */
-	public static void showLineInfo(ImageLine line) {
+	public static void showLineInfo(final ImageLine line) {
 		System.out.println(line);
-		ImageLineStats stats = new ImageLineHelper.ImageLineStats(line);
+		final ImageLineStats stats = new ImageLineHelper.ImageLineStats(line);
 		System.out.println(stats);
 		System.out.println(ImageLineHelper.infoFirstLastPixels(line));
 	}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java
index 4636c39..616ccd5 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLineHelper.java
@@ -33,28 +33,28 @@ public class ImageLineHelper {
 	 * @return R G B (A), one sample 0-255 per array element. Ready for
 	 *         pngw.writeRowInt()
 	 */
-	public static int[] palette2rgb(ImageLine line, PngChunkPLTE pal, PngChunkTRNS trns, int[] buf) {
-		boolean isalpha = trns != null;
-		int channels = isalpha ? 4 : 3;
-		int nsamples = line.imgInfo.cols * channels;
+	public static int[] palette2rgb(ImageLine line, final PngChunkPLTE pal, final PngChunkTRNS trns, int[] buf) {
+		final boolean isalpha = trns != null;
+		final int channels = isalpha ? 4 : 3;
+		final int nsamples = line.imgInfo.cols * channels;
 		if (buf == null || buf.length < nsamples)
 			buf = new int[nsamples];
 		if (!line.samplesUnpacked)
 			line = line.unpackToNewImageLine();
-		boolean isbyte = line.sampleType == SampleType.BYTE;
-		int nindexesWithAlpha = trns != null ? trns.getPalletteAlpha().length : 0;
+		final boolean isbyte = line.sampleType == SampleType.BYTE;
+		final int nindexesWithAlpha = trns != null ? trns.getPalletteAlpha().length : 0;
 		for (int c = 0; c < line.imgInfo.cols; c++) {
-			int index = isbyte ? (line.scanlineb[c] & 0xFF) : line.scanline[c];
+			final int index = isbyte ? (line.scanlineb[c] & 0xFF) : line.scanline[c];
 			pal.getEntryRgb(index, buf, c * channels);
 			if (isalpha) {
-				int alpha = index < nindexesWithAlpha ? trns.getPalletteAlpha()[index] : 255;
+				final int alpha = index < nindexesWithAlpha ? trns.getPalletteAlpha()[index] : 255;
 				buf[c * channels + 3] = alpha;
 			}
 		}
 		return buf;
 	}
 
-	public static int[] palette2rgb(ImageLine line, PngChunkPLTE pal, int[] buf) {
+	public static int[] palette2rgb(final ImageLine line, final PngChunkPLTE pal, final int[] buf) {
 		return palette2rgb(line, pal, null, buf);
 	}
 
@@ -65,7 +65,7 @@ public class ImageLineHelper {
 	 * Just for basic info or debugging. Shows values for first and last pixel.
 	 * Does not include alpha
 	 */
-	public static String infoFirstLastPixels(ImageLine line) {
+	public static String infoFirstLastPixels(final ImageLine line) {
 		return line.imgInfo.channels == 1 ? String.format("first=(%d) last=(%d)", line.scanline[0],
 				line.scanline[line.scanline.length - 1]) : String.format("first=(%d %d %d) last=(%d %d %d)",
 				line.scanline[0], line.scanline[1], line.scanline[2], line.scanline[line.scanline.length
@@ -73,8 +73,8 @@ public class ImageLineHelper {
 				line.scanline[line.scanline.length - line.imgInfo.channels + 2]);
 	}
 
-	public static String infoFull(ImageLine line) {
-		ImageLineStats stats = new ImageLineStats(line);
+	public static String infoFull(final ImageLine line) {
+		final ImageLineStats stats = new ImageLineStats(line);
 		return "row=" + line.getRown() + " " + stats.toString() + "\n  " + infoFirstLastPixels(line);
 	}
 
@@ -104,7 +104,7 @@ public class ImageLineHelper {
 					+ String.format(" maxdif=(%.1f %.1f %.1f %.1f)", maxdif[0], maxdif[1], maxdif[2], maxdif[3]);
 		}
 
-		public ImageLineStats(ImageLine line) {
+		public ImageLineStats(final ImageLine line) {
 			this.channels = line.channels;
 			if (line.channels < 3)
 				throw new PngjException("ImageLineStats only works for RGB - RGBA");
@@ -146,18 +146,18 @@ public class ImageLineHelper {
 	 * integer packed R G B only for bitdepth=8! (does not check!)
 	 *
 	 **/
-	public static int getPixelRGB8(ImageLine line, int column) {
-		int offset = column * line.channels;
+	public static int getPixelRGB8(final ImageLine line, final int column) {
+		final int offset = column * line.channels;
 		return (line.scanline[offset] << 16) + (line.scanline[offset + 1] << 8) + (line.scanline[offset + 2]);
 	}
 
-	public static int getPixelARGB8(ImageLine line, int column) {
-		int offset = column * line.channels;
+	public static int getPixelARGB8(final ImageLine line, final int column) {
+		final int offset = column * line.channels;
 		return (line.scanline[offset + 3] << 24) + (line.scanline[offset] << 16) + (line.scanline[offset + 1] << 8)
 				+ (line.scanline[offset + 2]);
 	}
 
-	public static void setPixelsRGB8(ImageLine line, int[] rgb) {
+	public static void setPixelsRGB8(final ImageLine line, final int[] rgb) {
 		for (int i = 0, j = 0; i < line.imgInfo.cols; i++) {
 			line.scanline[j++] = ((rgb[i] >> 16) & 0xFF);
 			line.scanline[j++] = ((rgb[i] >> 8) & 0xFF);
@@ -165,18 +165,18 @@ public class ImageLineHelper {
 		}
 	}
 
-	public static void setPixelRGB8(ImageLine line, int col, int r, int g, int b) {
+	public static void setPixelRGB8(final ImageLine line, int col, final int r, final int g, final int b) {
 		col *= line.channels;
 		line.scanline[col++] = r;
 		line.scanline[col++] = g;
 		line.scanline[col] = b;
 	}
 
-	public static void setPixelRGB8(ImageLine line, int col, int rgb) {
+	public static void setPixelRGB8(final ImageLine line, final int col, final int rgb) {
 		setPixelRGB8(line, col, (rgb >> 16) & 0xFF, (rgb >> 8) & 0xFF, rgb & 0xFF);
 	}
 
-	public static void setPixelsRGBA8(ImageLine line, int[] rgb) {
+	public static void setPixelsRGBA8(final ImageLine line, final int[] rgb) {
 		for (int i = 0, j = 0; i < line.imgInfo.cols; i++) {
 			line.scanline[j++] = ((rgb[i] >> 16) & 0xFF);
 			line.scanline[j++] = ((rgb[i] >> 8) & 0xFF);
@@ -185,7 +185,7 @@ public class ImageLineHelper {
 		}
 	}
 
-	public static void setPixelRGBA8(ImageLine line, int col, int r, int g, int b, int a) {
+	public static void setPixelRGBA8(final ImageLine line, int col, final int r, final int g, final int b, final int a) {
 		col *= line.channels;
 		line.scanline[col++] = r;
 		line.scanline[col++] = g;
@@ -193,53 +193,53 @@ public class ImageLineHelper {
 		line.scanline[col] = a;
 	}
 
-	public static void setPixelRGBA8(ImageLine line, int col, int rgb) {
+	public static void setPixelRGBA8(final ImageLine line, final int col, final int rgb) {
 		setPixelRGBA8(line, col, (rgb >> 16) & 0xFF, (rgb >> 8) & 0xFF, rgb & 0xFF, (rgb >> 24) & 0xFF);
 	}
 
-	public static void setValD(ImageLine line, int i, double d) {
+	public static void setValD(final ImageLine line, final int i, final double d) {
 		line.scanline[i] = double2int(line, d);
 	}
 
-	public static int interpol(int a, int b, int c, int d, double dx, double dy) {
+	public static int interpol(final int a, final int b, final int c, final int d, final double dx, final double dy) {
 		// a b -> x (0-1)
 		// c d
 		//
-		double e = a * (1.0 - dx) + b * dx;
-		double f = c * (1.0 - dx) + d * dx;
+		final double e = a * (1.0 - dx) + b * dx;
+		final double f = c * (1.0 - dx) + d * dx;
 		return (int) (e * (1 - dy) + f * dy + 0.5);
 	}
 
-	public static double int2double(ImageLine line, int p) {
+	public static double int2double(final ImageLine line, final int p) {
 		return line.bitDepth == 16 ? p / 65535.0 : p / 255.0;
 		// TODO: replace my multiplication? check for other bitdepths
 	}
 
-	public static double int2doubleClamped(ImageLine line, int p) {
+	public static double int2doubleClamped(final ImageLine line, final int p) {
 		// TODO: replace my multiplication?
-		double d = line.bitDepth == 16 ? p / 65535.0 : p / 255.0;
+		final double d = line.bitDepth == 16 ? p / 65535.0 : p / 255.0;
 		return d <= 0.0 ? 0 : (d >= 1.0 ? 1.0 : d);
 	}
 
-	public static int double2int(ImageLine line, double d) {
+	public static int double2int(final ImageLine line, double d) {
 		d = d <= 0.0 ? 0 : (d >= 1.0 ? 1.0 : d);
 		return line.bitDepth == 16 ? (int) (d * 65535.0 + 0.5) : (int) (d * 255.0 + 0.5); //
 	}
 
-	public static int double2intClamped(ImageLine line, double d) {
+	public static int double2intClamped(final ImageLine line, double d) {
 		d = d <= 0.0 ? 0 : (d >= 1.0 ? 1.0 : d);
 		return line.bitDepth == 16 ? (int) (d * 65535.0 + 0.5) : (int) (d * 255.0 + 0.5); //
 	}
 
-	public static int clampTo_0_255(int i) {
+	public static int clampTo_0_255(final int i) {
 		return i > 255 ? 255 : (i < 0 ? 0 : i);
 	}
 
-	public static int clampTo_0_65535(int i) {
+	public static int clampTo_0_65535(final int i) {
 		return i > 65535 ? 65535 : (i < 0 ? 0 : i);
 	}
 
-	public static int clampTo_128_127(int x) {
+	public static int clampTo_128_127(final int x) {
 		return x > 127 ? 127 : (x < -128 ? -128 : x);
 	}
 
@@ -255,9 +255,9 @@ public class ImageLineHelper {
 	 * You probably should use {@link ImageLine#unpackToNewImageLine()}
 	 *
 	 */
-	public static int[] unpack(ImageInfo imgInfo, int[] src, int[] dst, boolean scale) {
-		int len1 = imgInfo.samplesPerRow;
-		int len0 = imgInfo.samplesPerRowPacked;
+	public static int[] unpack(final ImageInfo imgInfo, final int[] src, int[] dst, final boolean scale) {
+		final int len1 = imgInfo.samplesPerRow;
+		final int len0 = imgInfo.samplesPerRowPacked;
 		if (dst == null || dst.length < len1)
 			dst = new int[len1];
 		if (imgInfo.packed)
@@ -267,9 +267,9 @@ public class ImageLineHelper {
 		return dst;
 	}
 
-	public static byte[] unpack(ImageInfo imgInfo, byte[] src, byte[] dst, boolean scale) {
-		int len1 = imgInfo.samplesPerRow;
-		int len0 = imgInfo.samplesPerRowPacked;
+	public static byte[] unpack(final ImageInfo imgInfo, final byte[] src, byte[] dst, final boolean scale) {
+		final int len1 = imgInfo.samplesPerRow;
+		final int len0 = imgInfo.samplesPerRowPacked;
 		if (dst == null || dst.length < len1)
 			dst = new byte[len1];
 		if (imgInfo.packed)
@@ -286,8 +286,8 @@ public class ImageLineHelper {
 	 *
 	 * You probably should use {@link ImageLine#packToNewImageLine()}
 	 */
-	public static int[] pack(ImageInfo imgInfo, int[] src, int[] dst, boolean scale) {
-		int len0 = imgInfo.samplesPerRowPacked;
+	public static int[] pack(final ImageInfo imgInfo, final int[] src, int[] dst, final boolean scale) {
+		final int len0 = imgInfo.samplesPerRowPacked;
 		if (dst == null || dst.length < len0)
 			dst = new int[len0];
 		if (imgInfo.packed)
@@ -297,8 +297,8 @@ public class ImageLineHelper {
 		return dst;
 	}
 
-	public static byte[] pack(ImageInfo imgInfo, byte[] src, byte[] dst, boolean scale) {
-		int len0 = imgInfo.samplesPerRowPacked;
+	public static byte[] pack(final ImageInfo imgInfo, final byte[] src, byte[] dst, final boolean scale) {
+		final int len0 = imgInfo.samplesPerRowPacked;
 		if (dst == null || dst.length < len0)
 			dst = new byte[len0];
 		if (imgInfo.packed)
@@ -308,7 +308,7 @@ public class ImageLineHelper {
 		return dst;
 	}
 
-	static int getMaskForPackedFormats(int bitDepth) { // Utility function for pack/unpack
+	static int getMaskForPackedFormats(final int bitDepth) { // Utility function for pack/unpack
 		if (bitDepth == 4)
 			return 0xf0;
 		else if (bitDepth == 2)
@@ -317,7 +317,7 @@ public class ImageLineHelper {
 			return 0x80; // bitDepth == 1
 	}
 
-	static int getMaskForPackedFormatsLs(int bitDepth) { // Utility function for pack/unpack
+	static int getMaskForPackedFormatsLs(final int bitDepth) { // Utility function for pack/unpack
 		if (bitDepth == 4)
 			return 0x0f;
 		else if (bitDepth == 2)
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLines.java b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLines.java
index fb2cf59..8f6216a 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ImageLines.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ImageLines.java
@@ -36,7 +36,7 @@ public class ImageLines {
 	 * @param nRows
 	 * @param rowStep
 	 */
-	public ImageLines(ImageInfo imgInfo, SampleType stype, boolean unpackedMode, int rowOffset, int nRows, int rowStep) {
+	public ImageLines(final ImageInfo imgInfo, final SampleType stype, final boolean unpackedMode, final int rowOffset, final int nRows, final int rowStep) {
 		this.imgInfo = imgInfo;
 		channels = imgInfo.channels;
 		bitDepth = imgInfo.bitDepth;
@@ -61,8 +61,8 @@ public class ImageLines {
 	 * and rounding down) Eg: rowOffset=4,rowStep=2 imageRowToMatrixRow(17)
 	 * returns 6 , imageRowToMatrixRow(1) returns 0
 	 */
-	public int imageRowToMatrixRow(int imrow) {
-		int r = (imrow - rowOffset) / rowStep;
+	public int imageRowToMatrixRow(final int imrow) {
+		final int r = (imrow - rowOffset) / rowStep;
 		return r < 0 ? 0 : (r < nRows ? r : nRows - 1);
 	}
 
@@ -71,7 +71,7 @@ public class ImageLines {
 	 */
 	public int imageRowToMatrixRowStrict(int imrow) {
 		imrow -= rowOffset;
-		int mrow = imrow >= 0 && imrow % rowStep == 0 ? imrow / rowStep : -1;
+		final int mrow = imrow >= 0 && imrow % rowStep == 0 ? imrow / rowStep : -1;
 		return mrow < nRows ? mrow : -1;
 	}
 
@@ -82,7 +82,7 @@ public class ImageLines {
 	 *            Matrix row number
 	 * @return Image row number. Invalid only if mrow is invalid
 	 */
-	public int matrixRowToImageRow(int mrow) {
+	public int matrixRowToImageRow(final int mrow) {
 		return mrow * rowStep + rowOffset;
 	}
 
@@ -96,10 +96,10 @@ public class ImageLines {
 	 * @return A new ImageLine, backed by the matrix, with the correct ('real')
 	 *         rownumber
 	 */
-	public ImageLine getImageLineAtMatrixRow(int mrow) {
+	public ImageLine getImageLineAtMatrixRow(final int mrow) {
 		if (mrow < 0 || mrow > nRows)
 			throw new PngjException("Bad row " + mrow + ". Should be positive and less than " + nRows);
-		ImageLine imline = sampleType == SampleType.INT ? new ImageLine(imgInfo, sampleType, samplesUnpacked,
+		final ImageLine imline = sampleType == SampleType.INT ? new ImageLine(imgInfo, sampleType, samplesUnpacked,
 				scanlines[mrow], null) : new ImageLine(imgInfo, sampleType, samplesUnpacked, null, scanlinesb[mrow]);
 		imline.setRown(matrixRowToImageRow(mrow));
 		return imline;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngDeinterlacer.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngDeinterlacer.java
index e099c4f..436821c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngDeinterlacer.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngDeinterlacer.java
@@ -20,7 +20,7 @@ class PngDeinterlacer {
 	private short[][] imageShort;
 	private byte[][] imageByte;
 
-	PngDeinterlacer(ImageInfo iminfo) {
+	PngDeinterlacer(final ImageInfo iminfo) {
 		this.imi = iminfo;
 		pass = 0;
 		if (imi.packed) {
@@ -40,14 +40,14 @@ class PngDeinterlacer {
 	}
 
 	/** this refers to the row currRowSubimg */
-	void setRow(int n) {
+	void setRow(final int n) {
 		currRowSubimg = n;
 		currRowReal = n * dY + oY;
 		if (currRowReal < 0 || currRowReal >= imi.rows)
 			throw new PngjExceptionInternal("bad row - this should not happen");
 	}
 
-	void setPass(int p) {
+	void setPass(final int p) {
 		if (this.pass == p)
 			return;
 		pass = p;
@@ -105,7 +105,7 @@ class PngDeinterlacer {
 	}
 
 	// notice that this is a "partial" deinterlace, it will be called several times for the same row!
-	void deinterlaceInt(int[] src, int[] dst, boolean readInPackedFormat) {
+	void deinterlaceInt(final int[] src, final int[] dst, final boolean readInPackedFormat) {
 		if (!(imi.packed && readInPackedFormat))
 			for (int i = 0, j = oXsamples; i < cols * imi.channels; i += imi.channels, j += dXsamples)
 				for (int k = 0; k < imi.channels; k++)
@@ -115,7 +115,7 @@ class PngDeinterlacer {
 	}
 
 	// interlaced+packed = monster; this is very clumsy!
-	private void deinterlaceIntPacked(int[] src, int[] dst) {
+	private void deinterlaceIntPacked(final int[] src, final int[] dst) {
 		int spos, smod, smask; // source byte position, bits to shift to left (01,2,3,4
 		int tpos, tmod, p, d;
 		spos = 0;
@@ -143,7 +143,7 @@ class PngDeinterlacer {
 	}
 
 	// yes, duplication of code is evil, normally
-	void deinterlaceByte(byte[] src, byte[] dst, boolean readInPackedFormat) {
+	void deinterlaceByte(final byte[] src, final byte[] dst, final boolean readInPackedFormat) {
 		if (!(imi.packed && readInPackedFormat))
 			for (int i = 0, j = oXsamples; i < cols * imi.channels; i += imi.channels, j += dXsamples)
 				for (int k = 0; k < imi.channels; k++)
@@ -152,7 +152,7 @@ class PngDeinterlacer {
 			deinterlacePackedByte(src, dst);
 	}
 
-	private void deinterlacePackedByte(byte[] src, byte[] dst) {
+	private void deinterlacePackedByte(final byte[] src, final byte[] dst) {
 		int spos, smod, smask; // source byte position, bits to shift to left (01,2,3,4
 		int tpos, tmod, p, d;
 		// what the heck are you reading here? I told you would not enjoy this. Try Dostoyevsky or Simone Weil instead
@@ -230,7 +230,7 @@ class PngDeinterlacer {
 		return imageInt;
 	}
 
-	void setImageInt(int[][] imageInt) {
+	void setImageInt(final int[][] imageInt) {
 		this.imageInt = imageInt;
 	}
 
@@ -238,7 +238,7 @@ class PngDeinterlacer {
 		return imageShort;
 	}
 
-	void setImageShort(short[][] imageShort) {
+	void setImageShort(final short[][] imageShort) {
 		this.imageShort = imageShort;
 	}
 
@@ -246,20 +246,20 @@ class PngDeinterlacer {
 		return imageByte;
 	}
 
-	void setImageByte(byte[][] imageByte) {
+	void setImageByte(final byte[][] imageByte) {
 		this.imageByte = imageByte;
 	}
 
 	static void test() {
-		Random rand = new Random();
-		PngDeinterlacer ih = new PngDeinterlacer(new ImageInfo(rand.nextInt(35) + 1, rand.nextInt(52) + 1, 8, true));
+		final Random rand = new Random();
+		final PngDeinterlacer ih = new PngDeinterlacer(new ImageInfo(rand.nextInt(35) + 1, rand.nextInt(52) + 1, 8, true));
 		int np = ih.imi.cols * ih.imi.rows;
 		System.out.println(ih.imi);
 		for (int p = 1; p <= 7; p++) {
 			ih.setPass(p);
 			for (int row = 0; row < ih.getRows(); row++) {
 				ih.setRow(row);
-				int b = ih.getCols();
+				final int b = ih.getCols();
 				np -= b;
 				System.out.printf("Read %d pixels. Pass:%d Realline:%d cols=%d dX=%d oX=%d last:%b\n", b, ih.pass,
 						ih.currRowReal, ih.cols, ih.dX, ih.oX, ih.isAtLastRow());
@@ -270,7 +270,7 @@ class PngDeinterlacer {
 			throw new PngjExceptionInternal("wtf??" + ih.imi);
 	}
 
-	public static void main(String[] args) {
+	public static void main(final String[] args) {
 		test();
 	}
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java
index 9e64c3e..48e5e85 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngHelperInternal.java
@@ -16,13 +16,13 @@ public class PngHelperInternal {
 	/**
 	 * Default charset, used internally by PNG for several things
 	 */
-	public static Charset charsetLatin1 = Charset.forName("ISO-8859-1");
+	public static final Charset charsetLatin1 = Charset.forName("ISO-8859-1");
 	/**
 	 * UTF-8 is only used for some chunks
 	 */
-	public static Charset charsetUTF8 = Charset.forName("UTF-8");
+	public static final Charset charsetUTF8 = Charset.forName("UTF-8");
 
-	static boolean DEBUG = false;
+	static final boolean DEBUG = false;
 
 	/**
 	 * PNG magic bytes
@@ -31,18 +31,18 @@ public class PngHelperInternal {
 		return new byte[] { -119, 80, 78, 71, 13, 10, 26, 10 };
 	}
 
-	public static int doubleToInt100000(double d) {
+	public static int doubleToInt100000(final double d) {
 		return (int) (d * 100000.0 + 0.5);
 	}
 
-	public static double intToDouble100000(int i) {
+	public static double intToDouble100000(final int i) {
 		return i / 100000.0;
 	}
 
-	public static int readByte(InputStream is) {
+	public static int readByte(final InputStream is) {
 		try {
 			return is.read();
-		} catch (IOException e) {
+		} catch (final IOException e) {
 			throw new PngjInputException("error reading byte", e);
 		}
 	}
@@ -52,14 +52,14 @@ public class PngHelperInternal {
 	 *
 	 * PNG uses "network byte order"
 	 */
-	public static int readInt2(InputStream is) {
+	public static int readInt2(final InputStream is) {
 		try {
-			int b1 = is.read();
-			int b2 = is.read();
+			final int b1 = is.read();
+			final int b2 = is.read();
 			if (b1 == -1 || b2 == -1)
 				return -1;
 			return (b1 << 8) + b2;
-		} catch (IOException e) {
+		} catch (final IOException e) {
 			throw new PngjInputException("error reading readInt2", e);
 		}
 	}
@@ -67,58 +67,58 @@ public class PngHelperInternal {
 	/**
 	 * -1 if eof
 	 */
-	public static int readInt4(InputStream is) {
+	public static int readInt4(final InputStream is) {
 		try {
-			int b1 = is.read();
-			int b2 = is.read();
-			int b3 = is.read();
-			int b4 = is.read();
+			final int b1 = is.read();
+			final int b2 = is.read();
+			final int b3 = is.read();
+			final int b4 = is.read();
 			if (b1 == -1 || b2 == -1 || b3 == -1 || b4 == -1)
 				return -1;
 			return (b1 << 24) + (b2 << 16) + (b3 << 8) + b4;
-		} catch (IOException e) {
+		} catch (final IOException e) {
 			throw new PngjInputException("error reading readInt4", e);
 		}
 	}
 
-	public static int readInt1fromByte(byte[] b, int offset) {
+	public static int readInt1fromByte(final byte[] b, final int offset) {
 		return (b[offset] & 0xff);
 	}
 
-	public static int readInt2fromBytes(byte[] b, int offset) {
+	public static int readInt2fromBytes(final byte[] b, final int offset) {
 		return ((b[offset] & 0xff) << 16) | ((b[offset + 1] & 0xff));
 	}
 
-	public static int readInt4fromBytes(byte[] b, int offset) {
+	public static int readInt4fromBytes(final byte[] b, final int offset) {
 		return ((b[offset] & 0xff) << 24) | ((b[offset + 1] & 0xff) << 16) | ((b[offset + 2] & 0xff) << 8)
 				| (b[offset + 3] & 0xff);
 	}
 
-	public static void writeByte(OutputStream os, byte b) {
+	public static void writeByte(final OutputStream os, final byte b) {
 		try {
 			os.write(b);
-		} catch (IOException e) {
+		} catch (final IOException e) {
 			throw new PngjOutputException(e);
 		}
 	}
 
-	public static void writeInt2(OutputStream os, int n) {
-		byte[] temp = { (byte) ((n >> 8) & 0xff), (byte) (n & 0xff) };
+	public static void writeInt2(final OutputStream os, final int n) {
+		final byte[] temp = { (byte) ((n >> 8) & 0xff), (byte) (n & 0xff) };
 		writeBytes(os, temp);
 	}
 
-	public static void writeInt4(OutputStream os, int n) {
-		byte[] temp = new byte[4];
+	public static void writeInt4(final OutputStream os, final int n) {
+		final byte[] temp = new byte[4];
 		writeInt4tobytes(n, temp, 0);
 		writeBytes(os, temp);
 	}
 
-	public static void writeInt2tobytes(int n, byte[] b, int offset) {
+	public static void writeInt2tobytes(final int n, final byte[] b, final int offset) {
 		b[offset] = (byte) ((n >> 8) & 0xff);
 		b[offset + 1] = (byte) (n & 0xff);
 	}
 
-	public static void writeInt4tobytes(int n, byte[] b, int offset) {
+	public static void writeInt4tobytes(final int n, final byte[] b, final int offset) {
 		b[offset] = (byte) ((n >> 24) & 0xff);
 		b[offset + 1] = (byte) ((n >> 16) & 0xff);
 		b[offset + 2] = (byte) ((n >> 8) & 0xff);
@@ -128,26 +128,26 @@ public class PngHelperInternal {
 	/**
 	 * guaranteed to read exactly len bytes. throws error if it can't
 	 */
-	public static void readBytes(InputStream is, byte[] b, int offset, int len) {
+	public static void readBytes(final InputStream is, final byte[] b, final int offset, final int len) {
 		if (len == 0)
 			return;
 		try {
 			int read = 0;
 			while (read < len) {
-				int n = is.read(b, offset + read, len - read);
+				final int n = is.read(b, offset + read, len - read);
 				if (n < 1)
 					throw new PngjInputException("error reading bytes, " + n + " !=" + len);
 				read += n;
 			}
-		} catch (IOException e) {
+		} catch (final IOException e) {
 			throw new PngjInputException("error reading", e);
 		}
 	}
 
-	public static void skipBytes(InputStream is, long len) {
+	public static void skipBytes(final InputStream is, long len) {
 		try {
 			while (len > 0) {
-				long n1 = is.skip(len);
+				final long n1 = is.skip(len);
 				if (n1 > 0) {
 					len -= n1;
 				} else if (n1 == 0) { // should we retry? lets read one byte
@@ -159,28 +159,28 @@ public class PngHelperInternal {
 					// negative? this should never happen but...
 					throw new IOException("skip() returned a negative value ???");
 			}
-		} catch (IOException e) {
+		} catch (final IOException e) {
 			throw new PngjInputException(e);
 		}
 	}
 
-	public static void writeBytes(OutputStream os, byte[] b) {
+	public static void writeBytes(final OutputStream os, final byte[] b) {
 		try {
 			os.write(b);
-		} catch (IOException e) {
+		} catch (final IOException e) {
 			throw new PngjOutputException(e);
 		}
 	}
 
-	public static void writeBytes(OutputStream os, byte[] b, int offset, int n) {
+	public static void writeBytes(final OutputStream os, final byte[] b, final int offset, final int n) {
 		try {
 			os.write(b, offset, n);
-		} catch (IOException e) {
+		} catch (final IOException e) {
 			throw new PngjOutputException(e);
 		}
 	}
 
-	public static void logdebug(String msg) {
+	public static void logdebug(final String msg) {
 		if (DEBUG)
 			System.out.println(msg);
 	}
@@ -198,43 +198,43 @@ public class PngHelperInternal {
 	}
 
 	// / filters
-	public static int filterRowNone(int r) {
-		return (int) (r & 0xFF);
+	public static int filterRowNone(final int r) {
+		return r & 0xFF;
 	}
 
-	public static int filterRowSub(int r, int left) {
-		return ((int) (r - left) & 0xFF);
+	public static int filterRowSub(final int r, final int left) {
+		return (r - left & 0xFF);
 	}
 
-	public static int filterRowUp(int r, int up) {
-		return ((int) (r - up) & 0xFF);
+	public static int filterRowUp(final int r, final int up) {
+		return (r - up & 0xFF);
 	}
 
-	public static int filterRowAverage(int r, int left, int up) {
+	public static int filterRowAverage(final int r, final int left, final int up) {
 		return (r - (left + up) / 2) & 0xFF;
 	}
 
-	public static int filterRowPaeth(int r, int left, int up, int upleft) { // a = left, b = above, c = upper left
+	public static int filterRowPaeth(final int r, final int left, final int up, final int upleft) { // a = left, b = above, c = upper left
 		return (r - filterPaethPredictor(left, up, upleft)) & 0xFF;
 	}
 
-	public static int unfilterRowNone(int r) {
-		return (int) (r & 0xFF);
+	public static int unfilterRowNone(final int r) {
+		return r & 0xFF;
 	}
 
-	public static int unfilterRowSub(int r, int left) {
-		return ((int) (r + left) & 0xFF);
+	public static int unfilterRowSub(final int r, final int left) {
+		return (r + left & 0xFF);
 	}
 
-	public static int unfilterRowUp(int r, int up) {
-		return ((int) (r + up) & 0xFF);
+	public static int unfilterRowUp(final int r, final int up) {
+		return (r + up & 0xFF);
 	}
 
-	public static int unfilterRowAverage(int r, int left, int up) {
+	public static int unfilterRowAverage(final int r, final int left, final int up) {
 		return (r + (left + up) / 2) & 0xFF;
 	}
 
-	public static int unfilterRowPaeth(int r, int left, int up, int upleft) { // a = left, b = above, c = upper left
+	public static int unfilterRowPaeth(final int r, final int left, final int up, final int upleft) { // a = left, b = above, c = upper left
 		return (r + filterPaethPredictor(left, up, upleft)) & 0xFF;
 	}
 
@@ -259,11 +259,11 @@ public class PngHelperInternal {
 	/*
 	 * we put this methods here so as to not pollute the public interface of PngReader
 	 */
-	public final static void initCrcForTests(PngReader pngr) {
+	public final static void initCrcForTests(final PngReader pngr) {
 		pngr.initCrctest();
 	}
 
-	public final static long getCrctestVal(PngReader pngr) {
+	public final static long getCrctestVal(final PngReader pngr) {
 		return pngr.getCrctestVal();
 	}
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkInputStream.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkInputStream.java
index cdad098..cde4b51 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkInputStream.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkInputStream.java
@@ -18,7 +18,7 @@ class PngIDatChunkInputStream extends InputStream {
 	private final CRC32 crcEngine;
 	private boolean checkCrc = true;
 	private int lenLastChunk;
-	private byte[] idLastChunk = new byte[4];
+	private final byte[] idLastChunk = new byte[4];
 	private int toReadThisChunk = 0;
 	private boolean ended = false;
 	private long offset; // offset inside whole inputstream (counting bytes before IDAT)
@@ -28,7 +28,7 @@ class PngIDatChunkInputStream extends InputStream {
 		public final int len;
 		public final long offset;
 
-		private IdatChunkInfo(int len, long offset) {
+		private IdatChunkInfo(final int len, final long offset) {
 			this.len = len;
 			this.offset = offset;
 		}
@@ -40,7 +40,7 @@ class PngIDatChunkInputStream extends InputStream {
 	 * Constructor must be called just after reading length and id of first IDAT
 	 * chunk
 	 **/
-	PngIDatChunkInputStream(InputStream iStream, int lenFirstChunk, long offset) {
+	PngIDatChunkInputStream(final InputStream iStream, final int lenFirstChunk, final long offset) {
 		this.offset = offset;
 		inputStream = iStream;
 		this.lenLastChunk = lenFirstChunk;
@@ -70,10 +70,10 @@ class PngIDatChunkInputStream extends InputStream {
 		// Those values are left in idLastChunk / lenLastChunk
 		// Skips empty IDATS
 		do {
-			int crc = PngHelperInternal.readInt4(inputStream); //
+			final int crc = PngHelperInternal.readInt4(inputStream); //
 			offset += 4;
 			if (checkCrc) {
-				int crccalc = (int) crcEngine.getValue();
+				final int crccalc = (int) crcEngine.getValue();
 				if (lenLastChunk > 0 && crc != crccalc)
 					throw new PngjBadCrcException("error reading idat; offset: " + offset);
 				crcEngine.reset();
@@ -101,7 +101,7 @@ class PngIDatChunkInputStream extends InputStream {
 	 */
 	void forceChunkEnd() {
 		if (!ended) {
-			byte[] dummy = new byte[toReadThisChunk];
+			final byte[] dummy = new byte[toReadThisChunk];
 			PngHelperInternal.readBytes(inputStream, dummy, 0, toReadThisChunk);
 			if (checkCrc)
 				crcEngine.update(dummy, 0, toReadThisChunk);
@@ -114,12 +114,12 @@ class PngIDatChunkInputStream extends InputStream {
 	 * ended prematurely. That is our error.
 	 */
 	@Override
-	public int read(byte[] b, int off, int len) throws IOException {
+	public int read(final byte[] b, final int off, final int len) throws IOException {
 		if (ended)
 			return -1; // can happen only when raw reading, see Pngreader.readAndSkipsAllRows()
 		if (toReadThisChunk == 0)
 			throw new PngjExceptionInternal("this should not happen");
-		int n = inputStream.read(b, off, len >= toReadThisChunk ? toReadThisChunk : len);
+		final int n = inputStream.read(b, off, len >= toReadThisChunk ? toReadThisChunk : len);
 		if (n > 0) {
 			if (checkCrc)
 				crcEngine.update(b, off, n);
@@ -133,7 +133,7 @@ class PngIDatChunkInputStream extends InputStream {
 	}
 
 	@Override
-	public int read(byte[] b) throws IOException {
+	public int read(final byte[] b) throws IOException {
 		return this.read(b, 0, b.length);
 	}
 
@@ -141,8 +141,8 @@ class PngIDatChunkInputStream extends InputStream {
 	public int read() throws IOException {
 		// PngHelper.logdebug("read() should go here");
 		// inneficient - but this should be used rarely
-		byte[] b1 = new byte[1];
-		int r = this.read(b1, 0, 1);
+		final byte[] b1 = new byte[1];
+		final int r = this.read(b1, 0, 1);
 		return r < 0 ? -1 : (int) b1[0];
 	}
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkOutputStream.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkOutputStream.java
index 411d188..38b500c 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkOutputStream.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngIDatChunkOutputStream.java
@@ -13,18 +13,18 @@ class PngIDatChunkOutputStream extends ProgressiveOutputStream {
 	private static final int SIZE_DEFAULT = 32768; // 32k
 	private final OutputStream outputStream;
 
-	PngIDatChunkOutputStream(OutputStream outputStream) {
+	PngIDatChunkOutputStream(final OutputStream outputStream) {
 		this(outputStream, 0);
 	}
 
-	PngIDatChunkOutputStream(OutputStream outputStream, int size) {
+	PngIDatChunkOutputStream(final OutputStream outputStream, final int size) {
 		super(size > 0 ? size : SIZE_DEFAULT);
 		this.outputStream = outputStream;
 	}
 
 	@Override
-	protected final void flushBuffer(byte[] b, int len) {
-		ChunkRaw c = new ChunkRaw(len, ChunkHelper.b_IDAT, false);
+	protected final void flushBuffer(final byte[] b, final int len) {
+		final ChunkRaw c = new ChunkRaw(len, ChunkHelper.b_IDAT, false);
 		c.data = b;
 		c.writeChunk(outputStream);
 	}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java
index 0412beb..f77d4f4 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngReader.java
@@ -100,32 +100,32 @@ public class PngReader {
 	 *            error/debug messages
 	 *
 	 */
-	public PngReader(InputStream inputStream, String filenameOrDescription) {
+	public PngReader(final InputStream inputStream, final String filenameOrDescription) {
 		this.filename = filenameOrDescription == null ? "" : filenameOrDescription;
 		this.inputStream = inputStream;
 		this.chunksList = new ChunksList(null);
 		this.metadata = new PngMetadata(chunksList);
 		// starts reading: signature
-		byte[] pngid = new byte[8];
+		final byte[] pngid = new byte[8];
 		PngHelperInternal.readBytes(inputStream, pngid, 0, pngid.length);
 		offset += pngid.length;
 		if (!Arrays.equals(pngid, PngHelperInternal.getPngIdSignature()))
 			throw new PngjInputException("Bad PNG signature");
 		// reads first chunk
 		currentChunkGroup = ChunksList.CHUNK_GROUP_0_IDHR;
-		int clen = PngHelperInternal.readInt4(inputStream);
+		final int clen = PngHelperInternal.readInt4(inputStream);
 		offset += 4;
 		if (clen != 13)
 			throw new PngjInputException("IDHR chunk len != 13 ?? " + clen);
-		byte[] chunkid = new byte[4];
+		final byte[] chunkid = new byte[4];
 		PngHelperInternal.readBytes(inputStream, chunkid, 0, 4);
 		if (!Arrays.equals(chunkid, ChunkHelper.b_IHDR))
 			throw new PngjInputException("IHDR not found as first chunk??? [" + ChunkHelper.toString(chunkid) + "]");
 		offset += 4;
-		PngChunkIHDR ihdr = (PngChunkIHDR) readChunk(chunkid, clen, false);
-		boolean alpha = (ihdr.getColormodel() & 0x04) != 0;
-		boolean palette = (ihdr.getColormodel() & 0x01) != 0;
-		boolean grayscale = (ihdr.getColormodel() == 0 || ihdr.getColormodel() == 4);
+		final PngChunkIHDR ihdr = (PngChunkIHDR) readChunk(chunkid, clen, false);
+		final boolean alpha = (ihdr.getColormodel() & 0x04) != 0;
+		final boolean palette = (ihdr.getColormodel() & 0x01) != 0;
+		final boolean grayscale = (ihdr.getColormodel() == 0 || ihdr.getColormodel() == 4);
 		// creates ImgInfo and imgLine, and allocates buffers
 		imgInfo = new ImageInfo(ihdr.getCols(), ihdr.getRows(), ihdr.getBitspc(), alpha, grayscale, palette);
 		interlaced = ihdr.getInterlaced() == 1;
@@ -163,7 +163,7 @@ public class PngReader {
 		if (currentChunkGroup < ChunksList.CHUNK_GROUP_5_AFTERIDAT) {
 			try {
 				idatIstream.close();
-			} catch (Exception e) {
+			} catch (final Exception e) {
 			}
 			readLastChunks();
 		}
@@ -174,23 +174,23 @@ public class PngReader {
 		if (currentChunkGroup < ChunksList.CHUNK_GROUP_6_END) { // this could only happen if forced close
 			try {
 				idatIstream.close();
-			} catch (Exception e) {
+			} catch (final Exception e) {
 			}
 			currentChunkGroup = ChunksList.CHUNK_GROUP_6_END;
 		}
 		if (shouldCloseStream) {
 			try {
 				inputStream.close();
-			} catch (Exception e) {
+			} catch (final Exception e) {
 				throw new PngjInputException("error closing input stream!", e);
 			}
 		}
 	}
 
 	// nbytes: NOT including the filter byte. leaves result in rowb
-	private void unfilterRow(int nbytes) {
-		int ftn = rowbfilter[0];
-		FilterType ft = FilterType.getByVal(ftn);
+	private void unfilterRow(final int nbytes) {
+		final int ftn = rowbfilter[0];
+		final FilterType ft = FilterType.getByVal(ftn);
 		if (ft == null)
 			throw new PngjInputException("Filter type " + ftn + " invalid");
 		switch (ft) {
@@ -226,7 +226,7 @@ public class PngReader {
 
 	private void unfilterRowNone(final int nbytes) {
 		for (int i = 1; i <= nbytes; i++) {
-			rowb[i] = (byte) (rowbfilter[i]);
+			rowb[i] = (rowbfilter[i]);
 		}
 	}
 
@@ -242,7 +242,7 @@ public class PngReader {
 	private void unfilterRowSub(final int nbytes) {
 		int i, j;
 		for (i = 1; i <= imgInfo.bytesPixel; i++) {
-			rowb[i] = (byte) (rowbfilter[i]);
+			rowb[i] = (rowbfilter[i]);
 		}
 		for (j = 1, i = imgInfo.bytesPixel + 1; i <= nbytes; i++, j++) {
 			rowb[i] = (byte) (rowbfilter[i] + rowb[j]);
@@ -276,7 +276,7 @@ public class PngReader {
 			return;
 		int clen = 0;
 		boolean found = false;
-		byte[] chunkid = new byte[4]; // it's important to reallocate in each iteration
+		final byte[] chunkid = new byte[4]; // it's important to reallocate in each iteration
 		currentChunkGroup = ChunksList.CHUNK_GROUP_1_AFTERIDHR;
 		while (!found) {
 			clen = PngHelperInternal.readInt4(inputStream);
@@ -300,7 +300,7 @@ public class PngReader {
 			if (Arrays.equals(chunkid, ChunkHelper.b_PLTE))
 				currentChunkGroup = ChunksList.CHUNK_GROUP_3_AFTERPLTE;
 		}
-		int idatLen = found ? clen : -1;
+		final int idatLen = found ? clen : -1;
 		if (idatLen < 0)
 			throw new PngjInputException("first idat chunk not found!");
 		iIdatCstream = new PngIDatChunkInputStream(inputStream, idatLen, offset);
@@ -323,7 +323,7 @@ public class PngReader {
 		if (!iIdatCstream.isEnded())
 			iIdatCstream.forceChunkEnd();
 		int clen = iIdatCstream.getLenLastChunk();
-		byte[] chunkid = iIdatCstream.getIdLastChunk();
+		final byte[] chunkid = iIdatCstream.getIdLastChunk();
 		boolean endfound = false;
 		boolean first = true;
 		boolean skip = false;
@@ -355,14 +355,14 @@ public class PngReader {
 	 * Reads chunkd from input stream, adds to ChunksList, and returns it. If
 	 * it's skipped, a PngChunkSkipped object is created
 	 */
-	private PngChunk readChunk(byte[] chunkid, int clen, boolean skipforced) {
+	private PngChunk readChunk(final byte[] chunkid, final int clen, final boolean skipforced) {
 		if (clen < 0)
 			throw new PngjInputException("invalid chunk lenght: " + clen);
 		// skipChunksByIdSet is created lazyly, if fist IHDR has already been read
 		if (skipChunkIdsSet == null && currentChunkGroup > ChunksList.CHUNK_GROUP_0_IDHR)
 			skipChunkIdsSet = new HashSet<String>(Arrays.asList(skipChunkIds));
-		String chunkidstr = ChunkHelper.toString(chunkid);
-		boolean critical = ChunkHelper.isCritical(chunkidstr);
+		final String chunkidstr = ChunkHelper.toString(chunkid);
+		final boolean critical = ChunkHelper.isCritical(chunkidstr);
 		PngChunk pngChunk = null;
 		boolean skip = skipforced;
 		if (maxTotalBytesRead > 0 && clen + offset > maxTotalBytesRead)
@@ -379,7 +379,7 @@ public class PngReader {
 			// clen + 4) for risk of overflow
 			pngChunk = new PngChunkSkipped(chunkidstr, imgInfo, clen);
 		} else {
-			ChunkRaw chunk = new ChunkRaw(clen, chunkid, true);
+			final ChunkRaw chunk = new ChunkRaw(clen, chunkid, true);
 			chunk.readChunkData(inputStream, crcEnabled || critical);
 			pngChunk = PngChunk.factory(chunk, imgInfo);
 			if (!pngChunk.crit)
@@ -398,7 +398,7 @@ public class PngReader {
 	 * <p>
 	 * This happens rarely - most errors are fatal.
 	 */
-	protected void logWarn(String warn) {
+	protected void logWarn(final String warn) {
 		System.err.println(warn);
 	}
 
@@ -415,7 +415,7 @@ public class PngReader {
 	 * @param chunkLoadBehaviour
 	 *            {@link ChunkLoadBehaviour}
 	 */
-	public void setChunkLoadBehaviour(ChunkLoadBehaviour chunkLoadBehaviour) {
+	public void setChunkLoadBehaviour(final ChunkLoadBehaviour chunkLoadBehaviour) {
 		this.chunkLoadBehaviour = chunkLoadBehaviour;
 	}
 
@@ -459,7 +459,7 @@ public class PngReader {
 	 *
 	 * @see #readRowInt(int) {@link #readRowByte(int)}
 	 */
-	public ImageLine readRow(int nrow) {
+	public ImageLine readRow(final int nrow) {
 		if (imgLine == null)
 			imgLine = new ImageLine(imgInfo, SampleType.INT, unpackedMode);
 		return imgLine.sampleType != SampleType.BYTE ? readRowInt(nrow) : readRowByte(nrow);
@@ -476,7 +476,7 @@ public class PngReader {
 	 * @return ImageLine object, also available as field. Data is in
 	 *         {@link ImageLine#scanline} (int) field.
 	 */
-	public ImageLine readRowInt(int nrow) {
+	public ImageLine readRowInt(final int nrow) {
 		if (imgLine == null)
 			imgLine = new ImageLine(imgInfo, SampleType.INT, unpackedMode);
 		if (imgLine.getRown() == nrow) // already read
@@ -499,7 +499,7 @@ public class PngReader {
 	 * @return ImageLine object, also available as field. Data is in
 	 *         {@link ImageLine#scanlineb} (byte) field.
 	 */
-	public ImageLine readRowByte(int nrow) {
+	public ImageLine readRowByte(final int nrow) {
 		if (imgLine == null)
 			imgLine = new ImageLine(imgInfo, SampleType.BYTE, unpackedMode);
 		if (imgLine.getRown() == nrow) // already read
@@ -513,7 +513,7 @@ public class PngReader {
 	/**
 	 * @see #readRowInt(int[], int)
 	 */
-	public final int[] readRow(int[] buffer, final int nrow) {
+	public final int[] readRow(final int[] buffer, final int nrow) {
 		return readRowInt(buffer, nrow);
 	}
 
@@ -596,11 +596,11 @@ public class PngReader {
 	 * @deprecated Now {@link #readRow(int)} implements the same funcion. This
 	 *             method will be removed in future releases
 	 */
-	public ImageLine getRow(int nrow) {
+	public ImageLine getRow(final int nrow) {
 		return readRow(nrow);
 	}
 
-	private void decodeLastReadRowToInt(int[] buffer, int bytesRead) {
+	private void decodeLastReadRowToInt(final int[] buffer, final int bytesRead) {
 		if (imgInfo.bitDepth <= 8)
 			for (int i = 0, j = 1; i < bytesRead; i++)
 				buffer[i] = (rowb[j++] & 0xFF); // http://www.libpng.org/pub/png/spec/1.2/PNG-DataRep.html
@@ -611,7 +611,7 @@ public class PngReader {
 			ImageLine.unpackInplaceInt(imgInfo, buffer, buffer, false);
 	}
 
-	private void decodeLastReadRowToByte(byte[] buffer, int bytesRead) {
+	private void decodeLastReadRowToByte(final byte[] buffer, final int bytesRead) {
 		if (imgInfo.bitDepth <= 8)
 			System.arraycopy(rowb, 1, buffer, 0, bytesRead);
 		else
@@ -644,27 +644,27 @@ public class PngReader {
 	 *            even/odd lines, etc
 	 * @return Set of lines as a ImageLines, which wraps a matrix
 	 */
-	public ImageLines readRowsInt(int rowOffset, int nRows, int rowStep) {
+	public ImageLines readRowsInt(final int rowOffset, int nRows, final int rowStep) {
 		if (nRows < 0)
 			nRows = (imgInfo.rows - rowOffset) / rowStep;
 		if (rowStep < 1 || rowOffset < 0 || nRows * rowStep + rowOffset > imgInfo.rows)
 			throw new PngjInputException("bad args");
-		ImageLines imlines = new ImageLines(imgInfo, SampleType.INT, unpackedMode, rowOffset, nRows, rowStep);
+		final ImageLines imlines = new ImageLines(imgInfo, SampleType.INT, unpackedMode, rowOffset, nRows, rowStep);
 		if (!interlaced) {
 			for (int j = 0; j < imgInfo.rows; j++) {
-				int bytesread = readRowRaw(j); // read and perhaps discards
-				int mrow = imlines.imageRowToMatrixRowStrict(j);
+				final int bytesread = readRowRaw(j); // read and perhaps discards
+				final int mrow = imlines.imageRowToMatrixRowStrict(j);
 				if (mrow >= 0)
 					decodeLastReadRowToInt(imlines.scanlines[mrow], bytesread);
 			}
 		} else { // and now, for something completely different (interlaced)
-			int[] buf = new int[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
+			final int[] buf = new int[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
 			for (int p = 1; p <= 7; p++) {
 				deinterlacer.setPass(p);
 				for (int i = 0; i < deinterlacer.getRows(); i++) {
-					int bytesread = readRowRaw(i);
-					int j = deinterlacer.getCurrRowReal();
-					int mrow = imlines.imageRowToMatrixRowStrict(j);
+					final int bytesread = readRowRaw(i);
+					final int j = deinterlacer.getCurrRowReal();
+					final int mrow = imlines.imageRowToMatrixRowStrict(j);
 					if (mrow >= 0) {
 						decodeLastReadRowToInt(buf, bytesread);
 						deinterlacer.deinterlaceInt(buf, imlines.scanlines[mrow], !unpackedMode);
@@ -709,27 +709,27 @@ public class PngReader {
 	 *            even/odd lines, etc
 	 * @return Set of lines as a matrix
 	 */
-	public ImageLines readRowsByte(int rowOffset, int nRows, int rowStep) {
+	public ImageLines readRowsByte(final int rowOffset, int nRows, final int rowStep) {
 		if (nRows < 0)
 			nRows = (imgInfo.rows - rowOffset) / rowStep;
 		if (rowStep < 1 || rowOffset < 0 || nRows * rowStep + rowOffset > imgInfo.rows)
 			throw new PngjInputException("bad args");
-		ImageLines imlines = new ImageLines(imgInfo, SampleType.BYTE, unpackedMode, rowOffset, nRows, rowStep);
+		final ImageLines imlines = new ImageLines(imgInfo, SampleType.BYTE, unpackedMode, rowOffset, nRows, rowStep);
 		if (!interlaced) {
 			for (int j = 0; j < imgInfo.rows; j++) {
-				int bytesread = readRowRaw(j); // read and perhaps discards
-				int mrow = imlines.imageRowToMatrixRowStrict(j);
+				final int bytesread = readRowRaw(j); // read and perhaps discards
+				final int mrow = imlines.imageRowToMatrixRowStrict(j);
 				if (mrow >= 0)
 					decodeLastReadRowToByte(imlines.scanlinesb[mrow], bytesread);
 			}
 		} else { // and now, for something completely different (interlaced)
-			byte[] buf = new byte[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
+			final byte[] buf = new byte[unpackedMode ? imgInfo.samplesPerRow : imgInfo.samplesPerRowPacked];
 			for (int p = 1; p <= 7; p++) {
 				deinterlacer.setPass(p);
 				for (int i = 0; i < deinterlacer.getRows(); i++) {
-					int bytesread = readRowRaw(i);
-					int j = deinterlacer.getCurrRowReal();
-					int mrow = imlines.imageRowToMatrixRowStrict(j);
+					final int bytesread = readRowRaw(i);
+					final int j = deinterlacer.getCurrRowReal();
+					final int mrow = imlines.imageRowToMatrixRowStrict(j);
 					if (mrow >= 0) {
 						decodeLastReadRowToByte(buf, bytesread);
 						deinterlacer.deinterlaceByte(buf, imlines.scanlinesb[mrow], !unpackedMode);
@@ -784,7 +784,7 @@ public class PngReader {
 		}
 		rowNum = nrow;
 		// swap buffers
-		byte[] tmp = rowb;
+		final byte[] tmp = rowb;
 		rowb = rowbprev;
 		rowbprev = tmp;
 		// loads in rowbfilter "raw" bytes, with filter
@@ -821,7 +821,7 @@ public class PngReader {
 			do {
 				r = iIdatCstream.read(rowbfilter, 0, buffersLen);
 			} while (r >= 0);
-		} catch (IOException e) {
+		} catch (final IOException e) {
 			throw new PngjInputException("error in raw read of IDAT", e);
 		}
 		offset = iIdatCstream.getOffset();
@@ -838,7 +838,7 @@ public class PngReader {
 	 * These are the bytes read (not loaded) in the input stream. If exceeded,
 	 * an exception will be thrown.
 	 */
-	public void setMaxTotalBytesRead(long maxTotalBytesToRead) {
+	public void setMaxTotalBytesRead(final long maxTotalBytesToRead) {
 		this.maxTotalBytesRead = maxTotalBytesToRead;
 	}
 
@@ -854,7 +854,7 @@ public class PngReader {
 	 * default: 5Mb).<br>
 	 * If exceeded, some chunks will be skipped
 	 */
-	public void setMaxBytesMetadata(int maxBytesChunksToLoad) {
+	public void setMaxBytesMetadata(final int maxBytesChunksToLoad) {
 		this.maxBytesMetadata = maxBytesChunksToLoad;
 	}
 
@@ -872,7 +872,7 @@ public class PngReader {
 	 * checked) and the chunk will be saved as a PngChunkSkipped object. See
 	 * also setSkipChunkIds
 	 */
-	public void setSkipChunkMaxSize(int skipChunksBySize) {
+	public void setSkipChunkMaxSize(final int skipChunksBySize) {
 		this.skipChunkMaxSize = skipChunksBySize;
 	}
 
@@ -888,7 +888,7 @@ public class PngReader {
 	 * These chunks will be skipped (the CRC will not be checked) and the chunk
 	 * will be saved as a PngChunkSkipped object. See also setSkipChunkMaxSize
 	 */
-	public void setSkipChunkIds(String[] skipChunksById) {
+	public void setSkipChunkIds(final String[] skipChunksById) {
 		this.skipChunkIds = skipChunksById == null ? new String[] {} : skipChunksById;
 	}
 
@@ -904,7 +904,7 @@ public class PngReader {
 	 * <p>
 	 * default=true
 	 */
-	public void setShouldCloseStream(boolean shouldCloseStream) {
+	public void setShouldCloseStream(final boolean shouldCloseStream) {
 		this.shouldCloseStream = shouldCloseStream;
 	}
 
@@ -936,7 +936,7 @@ public class PngReader {
 	 *
 	 * @param unPackedMode
 	 */
-	public void setUnpackedMode(boolean unPackedMode) {
+	public void setUnpackedMode(final boolean unPackedMode) {
 		this.unpackedMode = unPackedMode;
 	}
 
@@ -954,7 +954,7 @@ public class PngReader {
 	 *
 	 * @param other A PngReader that has already finished reading pixels. Can be null.
 	 */
-	public void reuseBuffersFrom(PngReader other) {
+	public void reuseBuffersFrom(final PngReader other) {
 		if(other==null) return;
 		if (other.currentChunkGroup < ChunksList.CHUNK_GROUP_5_AFTERIDAT)
 			throw new PngjInputException("PngReader to be reused have not yet ended reading pixels");
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java
index 2f475aa..ed5dd7d 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngWriter.java
@@ -64,7 +64,7 @@ public class PngWriter {
 	 */
 	private int deflaterStrategy = Deflater.FILTERED;
 
-	private int[] histox = new int[256]; // auxiliar buffer, only used by reportResultsForFilter
+	private final int[] histox = new int[256]; // auxiliar buffer, only used by reportResultsForFilter
 
 	private int idatMaxSize = 0; // 0=use default (PngIDatChunkOutputStream 32768)
 
@@ -78,7 +78,7 @@ public class PngWriter {
 	// this only influences the 1-2-4 bitdepth format - and if we pass a ImageLine to writeRow, this is ignored
 	private boolean unpackedMode = false;
 
-	public PngWriter(OutputStream outputStream, ImageInfo imgInfo) {
+	public PngWriter(final OutputStream outputStream, final ImageInfo imgInfo) {
 		this(outputStream, imgInfo, "[NO FILENAME AVAILABLE]");
 	}
 
@@ -96,7 +96,7 @@ public class PngWriter {
 	 * @param filenameOrDescription
 	 *            Optional, just for error/debug messages
 	 */
-	public PngWriter(OutputStream outputStream, ImageInfo imgInfo, String filenameOrDescription) {
+	public PngWriter(final OutputStream outputStream, final ImageInfo imgInfo, final String filenameOrDescription) {
 		this.filename = filenameOrDescription == null ? "" : filenameOrDescription;
 		this.os = outputStream;
 		this.imgInfo = imgInfo;
@@ -111,29 +111,29 @@ public class PngWriter {
 
 	private void init() {
 		datStream = new PngIDatChunkOutputStream(this.os, idatMaxSize);
-		Deflater def = new Deflater(compLevel);
+		final Deflater def = new Deflater(compLevel);
 		def.setStrategy(deflaterStrategy);
 		datStreamDeflated = new DeflaterOutputStream(datStream, def);
 		writeSignatureAndIHDR();
 		writeFirstChunks();
 	}
 
-	private void reportResultsForFilter(int rown, FilterType type, boolean tentative) {
+	private void reportResultsForFilter(final int rown, final FilterType type, final boolean tentative) {
 		Arrays.fill(histox, 0);
 		int s = 0, v;
 		for (int i = 1; i <= imgInfo.bytesPerRow; i++) {
 			v = rowbfilter[i];
 			if (v < 0)
-				s -= (int) v;
+				s -= v;
 			else
-				s += (int) v;
+				s += v;
 			histox[v & 0xFF]++;
 		}
 		filterStrat.fillResultsForFilter(rown, type, s, histox, tentative);
 	}
 
 	private void writeEndChunk() {
-		PngChunkIEND c = new PngChunkIEND(imgInfo);
+		final PngChunkIEND c = new PngChunkIEND(imgInfo);
 		c.createRawChunk().writeChunk(os);
 	}
 
@@ -156,7 +156,7 @@ public class PngWriter {
 		currentChunkGroup = ChunksList.CHUNK_GROUP_5_AFTERIDAT;
 		chunksList.writeChunks(os, currentChunkGroup);
 		// should not be unwriten chunks
-		List<PngChunk> pending = chunksList.getQueuedChunks();
+		final List<PngChunk> pending = chunksList.getQueuedChunks();
 		if (!pending.isEmpty())
 			throw new PngjOutputException(pending.size() + " chunks were not written! Eg: " + pending.get(0).toString());
 		currentChunkGroup = ChunksList.CHUNK_GROUP_6_END;
@@ -169,7 +169,7 @@ public class PngWriter {
 		currentChunkGroup = ChunksList.CHUNK_GROUP_0_IDHR;
 
 		PngHelperInternal.writeBytes(os, PngHelperInternal.getPngIdSignature()); // signature
-		PngChunkIHDR ihdr = new PngChunkIHDR(imgInfo);
+		final PngChunkIHDR ihdr = new PngChunkIHDR(imgInfo);
 		// http://www.libpng.org/pub/png/spec/1.2/PNG-Chunks.html
 		ihdr.setCols(imgInfo.cols);
 		ihdr.setRows(imgInfo.rows);
@@ -189,16 +189,16 @@ public class PngWriter {
 
 	}
 
-	protected void encodeRowFromByte(byte[] row) {
+	protected void encodeRowFromByte(final byte[] row) {
 		if (row.length == imgInfo.samplesPerRowPacked) {
 			// some duplication of code - because this case is typical and it works faster this way
 			int j = 1;
 			if (imgInfo.bitDepth <= 8) {
-				for (byte x : row) { // optimized
+				for (final byte x : row) { // optimized
 					rowb[j++] = x;
 				}
 			} else { // 16 bitspc
-				for (byte x : row) { // optimized
+				for (final byte x : row) { // optimized
 					rowb[j] = x;
 					j += 2;
 				}
@@ -221,17 +221,17 @@ public class PngWriter {
 		}
 	}
 
-	protected void encodeRowFromInt(int[] row) {
+	protected void encodeRowFromInt(final int[] row) {
 		// http://www.libpng.org/pub/png/spec/1.2/PNG-DataRep.html
 		if (row.length == imgInfo.samplesPerRowPacked) {
 			// some duplication of code - because this case is typical and it works faster this way
 			int j = 1;
 			if (imgInfo.bitDepth <= 8) {
-				for (int x : row) { // optimized
+				for (final int x : row) { // optimized
 					rowb[j++] = (byte) x;
 				}
 			} else { // 16 bitspc
-				for (int x : row) { // optimized
+				for (final int x : row) { // optimized
 					rowb[j++] = (byte) (x >> 8);
 					rowb[j++] = (byte) (x);
 				}
@@ -253,7 +253,7 @@ public class PngWriter {
 		}
 	}
 
-	private void filterRow(int rown) {
+	private void filterRow(final int rown) {
 		// warning: filters operation rely on: "previos row" (rowbprev) is
 		// initialized to 0 the first time
 		if (filterStrat.shouldTestAll(rown)) {
@@ -268,7 +268,7 @@ public class PngWriter {
 			filterRowPaeth();
 			reportResultsForFilter(rown, FilterType.FILTER_PAETH, true);
 		}
-		FilterType filterType = filterStrat.gimmeFilterType(rown, true);
+		final FilterType filterType = filterStrat.gimmeFilterType(rown, true);
 		rowbfilter[0] = (byte) filterType.val;
 		switch (filterType) {
 		case FILTER_NONE:
@@ -292,23 +292,23 @@ public class PngWriter {
 		reportResultsForFilter(rown, filterType, false);
 	}
 
-	private void prepareEncodeRow(int rown) {
+	private void prepareEncodeRow(final int rown) {
 		if (datStream == null)
 			init();
 		rowNum++;
 		if (rown >= 0 && rowNum != rown)
 			throw new PngjOutputException("rows must be written in order: expected:" + rowNum + " passed:" + rown);
 		// swap
-		byte[] tmp = rowb;
+		final byte[] tmp = rowb;
 		rowb = rowbprev;
 		rowbprev = tmp;
 	}
 
-	private void filterAndSend(int rown) {
+	private void filterAndSend(final int rown) {
 		filterRow(rown);
 		try {
 			datStreamDeflated.write(rowbfilter, 0, imgInfo.bytesPerRow + 1);
-		} catch (IOException e) {
+		} catch (final IOException e) {
 			throw new PngjOutputException(e);
 		}
 	}
@@ -323,7 +323,7 @@ public class PngWriter {
 
 	protected void filterRowNone() {
 		for (int i = 1; i <= imgInfo.bytesPerRow; i++) {
-			rowbfilter[i] = (byte) rowb[i];
+			rowbfilter[i] = rowb[i];
 		}
 	}
 
@@ -341,7 +341,7 @@ public class PngWriter {
 	protected void filterRowSub() {
 		int i, j;
 		for (i = 1; i <= imgInfo.bytesPixel; i++)
-			rowbfilter[i] = (byte) rowb[i];
+			rowbfilter[i] = rowb[i];
 		for (j = 1, i = imgInfo.bytesPixel + 1; i <= imgInfo.bytesPerRow; i++, j++) {
 			// !!! rowbfilter[i] = (byte) (rowb[i] - rowb[j]);
 			rowbfilter[i] = (byte) PngHelperInternal.filterRowSub(rowb[i], rowb[j]);
@@ -359,9 +359,9 @@ public class PngWriter {
 		int s = 0;
 		for (int i = 1; i <= imgInfo.bytesPerRow; i++)
 			if (rowbfilter[i] < 0)
-				s -= (int) rowbfilter[i];
+				s -= rowbfilter[i];
 			else
-				s += (int) rowbfilter[i];
+				s += rowbfilter[i];
 		return s;
 	}
 
@@ -372,12 +372,12 @@ public class PngWriter {
 	 * <p>
 	 * TODO: this should be more customizable
 	 */
-	private void copyChunks(PngReader reader, int copy_mask, boolean onlyAfterIdat) {
-		boolean idatDone = currentChunkGroup >= ChunksList.CHUNK_GROUP_4_IDAT;
+	private void copyChunks(final PngReader reader, final int copy_mask, final boolean onlyAfterIdat) {
+		final boolean idatDone = currentChunkGroup >= ChunksList.CHUNK_GROUP_4_IDAT;
 		if (onlyAfterIdat && reader.getCurrentChunkGroup() < ChunksList.CHUNK_GROUP_6_END)
 			throw new PngjExceptionInternal("tried to copy last chunks but reader has not ended");
-		for (PngChunk chunk : reader.getChunksList().getChunks()) {
-			int group = chunk.getChunkGroup();
+		for (final PngChunk chunk : reader.getChunksList().getChunks()) {
+			final int group = chunk.getChunkGroup();
 			if (group < ChunksList.CHUNK_GROUP_4_IDAT && idatDone)
 				continue;
 			boolean copy = false;
@@ -389,8 +389,8 @@ public class PngWriter {
 						copy = true;
 				}
 			} else { // ancillary
-				boolean text = (chunk instanceof PngChunkTextVar);
-				boolean safe = chunk.safe;
+				final boolean text = (chunk instanceof PngChunkTextVar);
+				final boolean safe = chunk.safe;
 				// notice that these if are not exclusive
 				if (ChunkHelper.maskMatch(copy_mask, ChunkCopyBehaviour.COPY_ALL))
 					copy = true;
@@ -429,7 +429,7 @@ public class PngWriter {
 	 *            : Mask bit (OR), see <code>ChunksToWrite.COPY_XXX</code>
 	 *            constants
 	 */
-	public void copyChunksFirst(PngReader reader, int copy_mask) {
+	public void copyChunksFirst(final PngReader reader, final int copy_mask) {
 		copyChunks(reader, copy_mask, false);
 	}
 
@@ -446,7 +446,7 @@ public class PngWriter {
 	 *            : Mask bit (OR), see <code>ChunksToWrite.COPY_XXX</code>
 	 *            constants
 	 */
-	public void copyChunksLast(PngReader reader, int copy_mask) {
+	public void copyChunksLast(final PngReader reader, final int copy_mask) {
 		copyChunks(reader, copy_mask, true);
 	}
 
@@ -461,8 +461,8 @@ public class PngWriter {
 	public double computeCompressionRatio() {
 		if (currentChunkGroup < ChunksList.CHUNK_GROUP_6_END)
 			throw new PngjOutputException("must be called after end()");
-		double compressed = (double) datStream.getCountFlushed();
-		double raw = (imgInfo.bytesPerRow + 1) * imgInfo.rows;
+		final double compressed = datStream.getCountFlushed();
+		final double raw = (imgInfo.bytesPerRow + 1) * imgInfo.rows;
 		return compressed / raw;
 	}
 
@@ -480,7 +480,7 @@ public class PngWriter {
 			writeEndChunk();
 			if (shouldCloseStream)
 				os.close();
-		} catch (IOException e) {
+		} catch (final IOException e) {
 			throw new PngjOutputException(e);
 		}
 	}
@@ -516,7 +516,7 @@ public class PngWriter {
 	 * @param compLevel
 	 *            between 0 and 9 (default:6 , recommended: 6 or more)
 	 */
-	public void setCompLevel(int compLevel) {
+	public void setCompLevel(final int compLevel) {
 		if (compLevel < 0 || compLevel > 9)
 			throw new PngjOutputException("Compression level invalid (" + compLevel + ") Must be 0..9");
 		this.compLevel = compLevel;
@@ -534,7 +534,7 @@ public class PngWriter {
 	 *            <code>PngFilterType</code>) Recommended values: DEFAULT
 	 *            (default) or AGGRESIVE
 	 */
-	public void setFilterType(FilterType filterType) {
+	public void setFilterType(final FilterType filterType) {
 		filterStrat = new FilterWriteStrategy(imgInfo, filterType);
 	}
 
@@ -546,7 +546,7 @@ public class PngWriter {
 	 * @param idatMaxSize
 	 *            default=0 : use defaultSize (32K)
 	 */
-	public void setIdatMaxSize(int idatMaxSize) {
+	public void setIdatMaxSize(final int idatMaxSize) {
 		this.idatMaxSize = idatMaxSize;
 	}
 
@@ -555,7 +555,7 @@ public class PngWriter {
 	 * <p>
 	 * default=true
 	 */
-	public void setShouldCloseStream(boolean shouldCloseStream) {
+	public void setShouldCloseStream(final boolean shouldCloseStream) {
 		this.shouldCloseStream = shouldCloseStream;
 	}
 
@@ -565,7 +565,7 @@ public class PngWriter {
 	 * <p>
 	 * Default: Deflater.FILTERED . This should be changed very rarely.
 	 */
-	public void setDeflaterStrategy(int deflaterStrategy) {
+	public void setDeflaterStrategy(final int deflaterStrategy) {
 		this.deflaterStrategy = deflaterStrategy;
 	}
 
@@ -575,7 +575,7 @@ public class PngWriter {
 	 *
 	 * @deprecated Better use writeRow(ImageLine imgline, int rownumber)
 	 */
-	public void writeRow(ImageLine imgline) {
+	public void writeRow(final ImageLine imgline) {
 		writeRow(imgline.scanline, imgline.getRown());
 	}
 
@@ -586,7 +586,7 @@ public class PngWriter {
 	 *
 	 * @see #writeRowInt(int[], int)
 	 */
-	public void writeRow(ImageLine imgline, int rownumber) {
+	public void writeRow(final ImageLine imgline, final int rownumber) {
 		unpackedMode = imgline.samplesUnpacked;
 		if (imgline.sampleType == SampleType.INT)
 			writeRowInt(imgline.scanline, rownumber);
@@ -599,7 +599,7 @@ public class PngWriter {
 	 *
 	 * @param newrow
 	 */
-	public void writeRow(int[] newrow) {
+	public void writeRow(final int[] newrow) {
 		writeRow(newrow, -1);
 	}
 
@@ -608,7 +608,7 @@ public class PngWriter {
 	 *
 	 * @see #writeRowInt(int[], int)
 	 */
-	public void writeRow(int[] newrow, int rown) {
+	public void writeRow(final int[] newrow, final int rown) {
 		writeRowInt(newrow, rown);
 	}
 
@@ -632,7 +632,7 @@ public class PngWriter {
 	 *            Row number, from 0 (top) to rows-1 (bottom). This is just used
 	 *            as a check. Pass -1 if you want to autocompute it
 	 */
-	public void writeRowInt(int[] newrow, int rown) {
+	public void writeRowInt(final int[] newrow, final int rown) {
 		prepareEncodeRow(rown);
 		encodeRowFromInt(newrow);
 		filterAndSend(rown);
@@ -645,7 +645,7 @@ public class PngWriter {
 	 *
 	 * @see PngWriter#writeRowInt(int[], int)
 	 */
-	public void writeRowByte(byte[] newrow, int rown) {
+	public void writeRowByte(final byte[] newrow, final int rown) {
 		prepareEncodeRow(rown);
 		encodeRowFromByte(newrow);
 		filterAndSend(rown);
@@ -654,7 +654,7 @@ public class PngWriter {
 	/**
 	 * Writes all the pixels, calling writeRowInt() for each image row
 	 */
-	public void writeRowsInt(int[][] image) {
+	public void writeRowsInt(final int[][] image) {
 		for (int i = 0; i < imgInfo.rows; i++)
 			writeRowInt(image[i], i);
 	}
@@ -662,7 +662,7 @@ public class PngWriter {
 	/**
 	 * Writes all the pixels, calling writeRowByte() for each image row
 	 */
-	public void writeRowsByte(byte[][] image) {
+	public void writeRowsByte(final byte[][] image) {
 		for (int i = 0; i < imgInfo.rows; i++)
 			writeRowByte(image[i], i);
 	}
@@ -682,7 +682,7 @@ public class PngWriter {
 	 * <tt>packed</tt> flag of the ImageLine object overrides (and overwrites!)
 	 * this field.
 	 */
-	public void setUseUnPackedMode(boolean useUnpackedMode) {
+	public void setUseUnPackedMode(final boolean useUnpackedMode) {
 		this.unpackedMode = useUnpackedMode;
 	}
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java
index 3b74f86..032b2ed 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjBadCrcException.java
@@ -6,15 +6,15 @@ package jogamp.opengl.util.pngj;
 public class PngjBadCrcException extends PngjInputException {
 	private static final long serialVersionUID = 1L;
 
-	public PngjBadCrcException(String message, Throwable cause) {
+	public PngjBadCrcException(final String message, final Throwable cause) {
 		super(message, cause);
 	}
 
-	public PngjBadCrcException(String message) {
+	public PngjBadCrcException(final String message) {
 		super(message);
 	}
 
-	public PngjBadCrcException(Throwable cause) {
+	public PngjBadCrcException(final Throwable cause) {
 		super(cause);
 	}
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java
index 97e24fc..3d05589 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjException.java
@@ -9,15 +9,15 @@ package jogamp.opengl.util.pngj;
 public class PngjException extends RuntimeException {
 	private static final long serialVersionUID = 1L;
 
-	public PngjException(String message, Throwable cause) {
+	public PngjException(final String message, final Throwable cause) {
 		super(message, cause);
 	}
 
-	public PngjException(String message) {
+	public PngjException(final String message) {
 		super(message);
 	}
 
-	public PngjException(Throwable cause) {
+	public PngjException(final Throwable cause) {
 		super(cause);
 	}
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java
index 5da70de..9484abf 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjExceptionInternal.java
@@ -10,15 +10,15 @@ package jogamp.opengl.util.pngj;
 public class PngjExceptionInternal extends RuntimeException {
 	private static final long serialVersionUID = 1L;
 
-	public PngjExceptionInternal(String message, Throwable cause) {
+	public PngjExceptionInternal(final String message, final Throwable cause) {
 		super(message, cause);
 	}
 
-	public PngjExceptionInternal(String message) {
+	public PngjExceptionInternal(final String message) {
 		super(message);
 	}
 
-	public PngjExceptionInternal(Throwable cause) {
+	public PngjExceptionInternal(final Throwable cause) {
 		super(cause);
 	}
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java
index 5cc36b9..c92d80b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjInputException.java
@@ -6,15 +6,15 @@ package jogamp.opengl.util.pngj;
 public class PngjInputException extends PngjException {
 	private static final long serialVersionUID = 1L;
 
-	public PngjInputException(String message, Throwable cause) {
+	public PngjInputException(final String message, final Throwable cause) {
 		super(message, cause);
 	}
 
-	public PngjInputException(String message) {
+	public PngjInputException(final String message) {
 		super(message);
 	}
 
-	public PngjInputException(Throwable cause) {
+	public PngjInputException(final Throwable cause) {
 		super(cause);
 	}
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java
index c8cd36a..4e9cdc9 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjOutputException.java
@@ -6,15 +6,15 @@ package jogamp.opengl.util.pngj;
 public class PngjOutputException extends PngjException {
 	private static final long serialVersionUID = 1L;
 
-	public PngjOutputException(String message, Throwable cause) {
+	public PngjOutputException(final String message, final Throwable cause) {
 		super(message, cause);
 	}
 
-	public PngjOutputException(String message) {
+	public PngjOutputException(final String message) {
 		super(message);
 	}
 
-	public PngjOutputException(Throwable cause) {
+	public PngjOutputException(final Throwable cause) {
 		super(cause);
 	}
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java b/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java
index f68458d..e68b153 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/PngjUnsupportedException.java
@@ -11,15 +11,15 @@ public class PngjUnsupportedException extends RuntimeException {
 		super();
 	}
 
-	public PngjUnsupportedException(String message, Throwable cause) {
+	public PngjUnsupportedException(final String message, final Throwable cause) {
 		super(message, cause);
 	}
 
-	public PngjUnsupportedException(String message) {
+	public PngjUnsupportedException(final String message) {
 		super(message);
 	}
 
-	public PngjUnsupportedException(Throwable cause) {
+	public PngjUnsupportedException(final Throwable cause) {
 		super(cause);
 	}
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java b/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java
index 4516a08..2484722 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/ProgressiveOutputStream.java
@@ -11,7 +11,7 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
 	private final int size;
 	private long countFlushed = 0;
 
-	public ProgressiveOutputStream(int size) {
+	public ProgressiveOutputStream(final int size) {
 		this.size = size;
 	}
 
@@ -28,19 +28,19 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
 	}
 
 	@Override
-	public final void write(byte[] b, int off, int len) {
+	public final void write(final byte[] b, final int off, final int len) {
 		super.write(b, off, len);
 		checkFlushBuffer(false);
 	}
 
 	@Override
-	public final void write(byte[] b) throws IOException {
+	public final void write(final byte[] b) throws IOException {
 		super.write(b);
 		checkFlushBuffer(false);
 	}
 
 	@Override
-	public final void write(int arg0) {
+	public final void write(final int arg0) {
 		super.write(arg0);
 		checkFlushBuffer(false);
 	}
@@ -54,7 +54,7 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
 	 * if it's time to flush data (or if forced==true) calls abstract method
 	 * flushBuffer() and cleans those bytes from own buffer
 	 */
-	private final void checkFlushBuffer(boolean forced) {
+	private final void checkFlushBuffer(final boolean forced) {
 		while (forced || count >= size) {
 			int nb = size;
 			if (nb > count)
@@ -63,7 +63,7 @@ abstract class ProgressiveOutputStream extends ByteArrayOutputStream {
 				return;
 			flushBuffer(buf, nb);
 			countFlushed += nb;
-			int bytesleft = count - nb;
+			final int bytesleft = count - nb;
 			count = bytesleft;
 			if (bytesleft > 0)
 				System.arraycopy(buf, nb, buf, 0, bytesleft);
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
index 4e8bf56..b8cfd86 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkHelper.java
@@ -68,63 +68,63 @@ public class ChunkHelper {
 	/**
 	 * Converts to bytes using Latin1 (ISO-8859-1)
 	 */
-	public static byte[] toBytes(String x) {
+	public static byte[] toBytes(final String x) {
 		return x.getBytes(PngHelperInternal.charsetLatin1);
 	}
 
 	/**
 	 * Converts to String using Latin1 (ISO-8859-1)
 	 */
-	public static String toString(byte[] x) {
+	public static String toString(final byte[] x) {
 		return new String(x, PngHelperInternal.charsetLatin1);
 	}
 
 	/**
 	 * Converts to String using Latin1 (ISO-8859-1)
 	 */
-	public static String toString(byte[] x, int offset, int len) {
+	public static String toString(final byte[] x, final int offset, final int len) {
 		return new String(x, offset, len, PngHelperInternal.charsetLatin1);
 	}
 
 	/**
 	 * Converts to bytes using UTF-8
 	 */
-	public static byte[] toBytesUTF8(String x) {
+	public static byte[] toBytesUTF8(final String x) {
 		return x.getBytes(PngHelperInternal.charsetUTF8);
 	}
 
 	/**
 	 * Converts to string using UTF-8
 	 */
-	public static String toStringUTF8(byte[] x) {
+	public static String toStringUTF8(final byte[] x) {
 		return new String(x, PngHelperInternal.charsetUTF8);
 	}
 
 	/**
 	 * Converts to string using UTF-8
 	 */
-	public static String toStringUTF8(byte[] x, int offset, int len) {
+	public static String toStringUTF8(final byte[] x, final int offset, final int len) {
 		return new String(x, offset, len, PngHelperInternal.charsetUTF8);
 	}
 
 	/**
 	 * critical chunk : first letter is uppercase
 	 */
-	public static boolean isCritical(String id) {
+	public static boolean isCritical(final String id) {
 		return (Character.isUpperCase(id.charAt(0)));
 	}
 
 	/**
 	 * public chunk: second letter is uppercase
 	 */
-	public static boolean isPublic(String id) { //
+	public static boolean isPublic(final String id) { //
 		return (Character.isUpperCase(id.charAt(1)));
 	}
 
 	/**
 	 * Safe to copy chunk: fourth letter is lower case
 	 */
-	public static boolean isSafeToCopy(String id) {
+	public static boolean isSafeToCopy(final String id) {
 		return (!Character.isUpperCase(id.charAt(3)));
 	}
 
@@ -132,7 +132,7 @@ public class ChunkHelper {
 	 * "Unknown" just means that our chunk factory (even when it has been
 	 * augmented by client code) did not recognize its id
 	 */
-	public static boolean isUnknown(PngChunk c) {
+	public static boolean isUnknown(final PngChunk c) {
 		return c instanceof PngChunkUNKNOWN;
 	}
 
@@ -142,7 +142,7 @@ public class ChunkHelper {
 	 * @param b
 	 * @return -1 if not found
 	 */
-	public static int posNullByte(byte[] b) {
+	public static int posNullByte(final byte[] b) {
 		for (int i = 0; i < b.length; i++)
 			if (b[i] == 0)
 				return i;
@@ -156,10 +156,10 @@ public class ChunkHelper {
 	 * @param behav
 	 * @return true/false
 	 */
-	public static boolean shouldLoad(String id, ChunkLoadBehaviour behav) {
+	public static boolean shouldLoad(final String id, final ChunkLoadBehaviour behav) {
 		if (isCritical(id))
 			return true;
-		boolean kwown = PngChunk.isKnown(id);
+		final boolean kwown = PngChunk.isKnown(id);
 		switch (behav) {
 		case LOAD_CHUNK_ALWAYS:
 			return true;
@@ -173,21 +173,21 @@ public class ChunkHelper {
 		return false; // should not reach here
 	}
 
-	public final static byte[] compressBytes(byte[] ori, boolean compress) {
+	public final static byte[] compressBytes(final byte[] ori, final boolean compress) {
 		return compressBytes(ori, 0, ori.length, compress);
 	}
 
-	public static byte[] compressBytes(byte[] ori, int offset, int len, boolean compress) {
+	public static byte[] compressBytes(final byte[] ori, final int offset, final int len, final boolean compress) {
 		try {
-			ByteArrayInputStream inb = new ByteArrayInputStream(ori, offset, len);
-			InputStream in = compress ? inb : new InflaterInputStream(inb, getInflater());
-			ByteArrayOutputStream outb = new ByteArrayOutputStream();
-			OutputStream out = compress ? new DeflaterOutputStream(outb) : outb;
+			final ByteArrayInputStream inb = new ByteArrayInputStream(ori, offset, len);
+			final InputStream in = compress ? inb : new InflaterInputStream(inb, getInflater());
+			final ByteArrayOutputStream outb = new ByteArrayOutputStream();
+			final OutputStream out = compress ? new DeflaterOutputStream(outb) : outb;
 			shovelInToOut(in, out);
 			in.close();
 			out.close();
 			return outb.toByteArray();
-		} catch (Exception e) {
+		} catch (final Exception e) {
 			throw new PngjException(e);
 		}
 	}
@@ -195,7 +195,7 @@ public class ChunkHelper {
 	/**
 	 * Shovels all data from an input stream to an output stream.
 	 */
-	private static void shovelInToOut(InputStream in, OutputStream out) throws IOException {
+	private static void shovelInToOut(final InputStream in, final OutputStream out) throws IOException {
 		synchronized (tmpbuffer) {
 			int len;
 			while ((len = in.read(tmpbuffer)) > 0) {
@@ -204,7 +204,7 @@ public class ChunkHelper {
 		}
 	}
 
-	public static boolean maskMatch(int v, int mask) {
+	public static boolean maskMatch(final int v, final int mask) {
 		return (v & mask) != 0;
 	}
 
@@ -213,9 +213,9 @@ public class ChunkHelper {
 	 *
 	 * See also trimList()
 	 */
-	public static List<PngChunk> filterList(List<PngChunk> target, ChunkPredicate predicateKeep) {
-		List<PngChunk> result = new ArrayList<PngChunk>();
-		for (PngChunk element : target) {
+	public static List<PngChunk> filterList(final List<PngChunk> target, final ChunkPredicate predicateKeep) {
+		final List<PngChunk> result = new ArrayList<PngChunk>();
+		for (final PngChunk element : target) {
 			if (predicateKeep.match(element)) {
 				result.add(element);
 			}
@@ -228,11 +228,11 @@ public class ChunkHelper {
 	 *
 	 * See also filterList
 	 */
-	public static int trimList(List<PngChunk> target, ChunkPredicate predicateRemove) {
-		Iterator<PngChunk> it = target.iterator();
+	public static int trimList(final List<PngChunk> target, final ChunkPredicate predicateRemove) {
+		final Iterator<PngChunk> it = target.iterator();
 		int cont = 0;
 		while (it.hasNext()) {
-			PngChunk c = it.next();
+			final PngChunk c = it.next();
 			if (predicateRemove.match(c)) {
 				it.remove();
 				cont++;
@@ -252,7 +252,7 @@ public class ChunkHelper {
 	 *
 	 * @return true if "equivalent"
 	 */
-	public static final boolean equivalent(PngChunk c1, PngChunk c2) {
+	public static final boolean equivalent(final PngChunk c1, final PngChunk c2) {
 		if (c1 == c2)
 			return true;
 		if (c1 == null || c2 == null || !c1.id.equals(c2.id))
@@ -272,7 +272,7 @@ public class ChunkHelper {
 		return false;
 	}
 
-	public static boolean isText(PngChunk c) {
+	public static boolean isText(final PngChunk c) {
 		return c instanceof PngChunkTextVar;
 	}
 
@@ -281,7 +281,7 @@ public class ChunkHelper {
 	 * individual chunks compression
 	 */
 	public static Inflater getInflater() {
-		Inflater inflater = inflaterProvider.get();
+		final Inflater inflater = inflaterProvider.get();
 		inflater.reset();
 		return inflater;
 	}
@@ -291,7 +291,7 @@ public class ChunkHelper {
 	 * individual chunks decompression
 	 */
 	public static Deflater getDeflater() {
-		Deflater deflater = deflaterProvider.get();
+		final Deflater deflater = deflaterProvider.get();
 		deflater.reset();
 		return deflater;
 	}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
index dcb1958..0ac2dc6 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunkRaw.java
@@ -50,7 +50,7 @@ public class ChunkRaw {
 	 * @param alloc
 	 *            : it true, the data array will be allocced
 	 */
-	public ChunkRaw(int len, byte[] idbytes, boolean alloc) {
+	public ChunkRaw(final int len, final byte[] idbytes, final boolean alloc) {
 		this.len = len;
 		System.arraycopy(idbytes, 0, this.idbytes, 0, 4);
 		if (alloc)
@@ -66,7 +66,7 @@ public class ChunkRaw {
 	 * this is called after setting data, before writing to os
 	 */
 	private int computeCrc() {
-		CRC32 crcengine = PngHelperInternal.getCRC();
+		final CRC32 crcengine = PngHelperInternal.getCRC();
 		crcengine.reset();
 		crcengine.update(idbytes, 0, 4);
 		if (len > 0)
@@ -78,7 +78,7 @@ public class ChunkRaw {
 	 * Computes the CRC and writes to the stream. If error, a
 	 * PngjOutputException is thrown
 	 */
-	public void writeChunk(OutputStream os) {
+	public void writeChunk(final OutputStream os) {
 		if (idbytes.length != 4)
 			throw new PngjOutputException("bad chunkid [" + ChunkHelper.toString(idbytes) + "]");
 		crcval = computeCrc();
@@ -93,11 +93,11 @@ public class ChunkRaw {
 	 * position before: just after chunk id. positon after: after crc Data
 	 * should be already allocated. Checks CRC Return number of byte read.
 	 */
-	public int readChunkData(InputStream is, boolean checkCrc) {
+	public int readChunkData(final InputStream is, final boolean checkCrc) {
 		PngHelperInternal.readBytes(is, data, 0, len);
 		crcval = PngHelperInternal.readInt4(is);
 		if (checkCrc) {
-			int crc = computeCrc();
+			final int crc = computeCrc();
 			if (crc != crcval)
 				throw new PngjBadCrcException("chunk: " + this + " crc calc=" + crc + " read=" + crcval);
 		}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
index 75107d7..f5a920e 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksList.java
@@ -31,7 +31,7 @@ public class ChunksList {
 
 	final ImageInfo imageInfo; // only required for writing
 
-	public ChunksList(ImageInfo imfinfo) {
+	public ChunksList(final ImageInfo imfinfo) {
 		this.imageInfo = imfinfo;
 	}
 
@@ -41,8 +41,8 @@ public class ChunksList {
 	 * @return key:chunk id, val: number of occurrences
 	 */
 	public HashMap<String, Integer> getChunksKeys() {
-		HashMap<String, Integer> ck = new HashMap<String, Integer>();
-		for (PngChunk c : chunks) {
+		final HashMap<String, Integer> ck = new HashMap<String, Integer>();
+		for (final PngChunk c : chunks) {
 			ck.put(c.id, ck.containsKey(c.id) ? ck.get(c.id) + 1 : 1);
 		}
 		return ck;
@@ -60,14 +60,14 @@ public class ChunksList {
 		if (innerid == null)
 			return ChunkHelper.filterList(list, new ChunkPredicate() {
 				@Override
-				public boolean match(PngChunk c) {
+				public boolean match(final PngChunk c) {
 					return c.id.equals(id);
 				}
 			});
 		else
 			return ChunkHelper.filterList(list, new ChunkPredicate() {
 				@Override
-				public boolean match(PngChunk c) {
+				public boolean match(final PngChunk c) {
 					if (!c.id.equals(id))
 						return false;
 					if (c instanceof PngChunkTextVar && !((PngChunkTextVar) c).getKey().equals(innerid))
@@ -82,7 +82,7 @@ public class ChunksList {
 	/**
 	 * Adds chunk in next position. This is used onyl by the pngReader
 	 */
-	public void appendReadChunk(PngChunk chunk, int chunkGroup) {
+	public void appendReadChunk(final PngChunk chunk, final int chunkGroup) {
 		chunk.setChunkGroup(chunkGroup);
 		chunks.add(chunk);
 	}
@@ -138,7 +138,7 @@ public class ChunksList {
 	 * one is returned (failifMultiple=false)
 	 **/
 	public PngChunk getById1(final String id, final String innerid, final boolean failIfMultiple) {
-		List<? extends PngChunk> list = getById(id, innerid);
+		final List<? extends PngChunk> list = getById(id, innerid);
 		if (list.isEmpty())
 			return null;
 		if (list.size() > 1 && (failIfMultiple || !list.get(0).allowsMultiple()))
@@ -155,7 +155,7 @@ public class ChunksList {
 	public List<PngChunk> getEquivalent(final PngChunk c2) {
 		return ChunkHelper.filterList(chunks, new ChunkPredicate() {
 			@Override
-			public boolean match(PngChunk c) {
+			public boolean match(final PngChunk c) {
 				return ChunkHelper.equivalent(c, c2);
 			}
 		});
@@ -170,9 +170,9 @@ public class ChunksList {
 	 * for debugging
 	 */
 	public String toStringFull() {
-		StringBuilder sb = new StringBuilder(toString());
+		final StringBuilder sb = new StringBuilder(toString());
 		sb.append("\n Read:\n");
-		for (PngChunk chunk : chunks) {
+		for (final PngChunk chunk : chunks) {
 			sb.append(chunk).append(" G=" + chunk.getChunkGroup() + "\n");
 		}
 		return sb.toString();
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
index c502e90..6ad61f8 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/ChunksListForWrite.java
@@ -19,9 +19,9 @@ public class ChunksListForWrite extends ChunksList {
 	private final List<PngChunk> queuedChunks = new ArrayList<PngChunk>();
 
 	// redundant, just for eficciency
-	private HashMap<String, Integer> alreadyWrittenKeys = new HashMap<String, Integer>();
+	private final HashMap<String, Integer> alreadyWrittenKeys = new HashMap<String, Integer>();
 
-	public ChunksListForWrite(ImageInfo imfinfo) {
+	public ChunksListForWrite(final ImageInfo imfinfo) {
 		super(imfinfo);
 	}
 
@@ -43,7 +43,7 @@ public class ChunksListForWrite extends ChunksList {
 	 * Same as getById1(), but looking in the queued chunks
 	 **/
 	public PngChunk getQueuedById1(final String id, final String innerid, final boolean failIfMultiple) {
-		List<? extends PngChunk> list = getQueuedById(id, innerid);
+		final List<? extends PngChunk> list = getQueuedById(id, innerid);
 		if (list.isEmpty())
 			return null;
 		if (list.size() > 1 && (failIfMultiple || !list.get(0).allowsMultiple()))
@@ -72,7 +72,7 @@ public class ChunksListForWrite extends ChunksList {
 	 * straightforward for SingleChunks. For MultipleChunks, it will normally
 	 * check for reference equality!
 	 */
-	public boolean removeChunk(PngChunk c) {
+	public boolean removeChunk(final PngChunk c) {
 		return queuedChunks.remove(c);
 	}
 
@@ -83,7 +83,7 @@ public class ChunksListForWrite extends ChunksList {
 	 *
 	 * @param c
 	 */
-	public boolean queue(PngChunk c) {
+	public boolean queue(final PngChunk c) {
 		queuedChunks.add(c);
 		return true;
 	}
@@ -92,7 +92,7 @@ public class ChunksListForWrite extends ChunksList {
 	 * this should be called only for ancillary chunks and PLTE (groups 1 - 3 -
 	 * 5)
 	 **/
-	private static boolean shouldWrite(PngChunk c, int currentGroup) {
+	private static boolean shouldWrite(final PngChunk c, final int currentGroup) {
 		if (currentGroup == CHUNK_GROUP_2_PLTE)
 			return c.id.equals(ChunkHelper.PLTE);
 		if (currentGroup % 2 == 0)
@@ -121,11 +121,11 @@ public class ChunksListForWrite extends ChunksList {
 		return false;
 	}
 
-	public int writeChunks(OutputStream os, int currentGroup) {
+	public int writeChunks(final OutputStream os, final int currentGroup) {
 		int cont = 0;
-		Iterator<PngChunk> it = queuedChunks.iterator();
+		final Iterator<PngChunk> it = queuedChunks.iterator();
 		while (it.hasNext()) {
-			PngChunk c = it.next();
+			final PngChunk c = it.next();
 			if (!shouldWrite(c, currentGroup))
 				continue;
 			if (ChunkHelper.isCritical(c.id) && !c.id.equals(ChunkHelper.PLTE))
@@ -159,14 +159,14 @@ public class ChunksListForWrite extends ChunksList {
 	 */
 	@Override
 	public String toStringFull() {
-		StringBuilder sb = new StringBuilder(toString());
+		final StringBuilder sb = new StringBuilder(toString());
 		sb.append("\n Written:\n");
-		for (PngChunk chunk : chunks) {
+		for (final PngChunk chunk : chunks) {
 			sb.append(chunk).append(" G=" + chunk.getChunkGroup() + "\n");
 		}
 		if (!queuedChunks.isEmpty()) {
 			sb.append(" Queued:\n");
-			for (PngChunk chunk : queuedChunks) {
+			for (final PngChunk chunk : queuedChunks) {
 				sb.append(chunk).append("\n");
 			}
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java
index 6cd86eb..eba218f 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunk.java
@@ -122,7 +122,7 @@ public abstract class PngChunk {
 	 * (not implmemented in this library) to the factory, so that the PngReader
 	 * knows about it.
 	 */
-	public static void factoryRegister(String chunkId, Class<? extends PngChunk> chunkClass) {
+	public static void factoryRegister(final String chunkId, final Class<? extends PngChunk> chunkClass) {
 		factoryMap.put(chunkId, chunkClass);
 	}
 
@@ -137,11 +137,11 @@ public abstract class PngChunk {
 	 * <p>
 	 * Unknown chunks will be parsed as instances of {@link PngChunkUNKNOWN}
 	 */
-	public static boolean isKnown(String id) {
+	public static boolean isKnown(final String id) {
 		return factoryMap.containsKey(id);
 	}
 
-	protected PngChunk(String id, ImageInfo imgInfo) {
+	protected PngChunk(final String id, final ImageInfo imgInfo) {
 		this.id = id;
 		this.imgInfo = imgInfo;
 		this.crit = ChunkHelper.isCritical(id);
@@ -153,8 +153,8 @@ public abstract class PngChunk {
 	 * This factory creates the corresponding chunk and parses the raw chunk.
 	 * This is used when reading.
 	 */
-	public static PngChunk factory(ChunkRaw chunk, ImageInfo info) {
-		PngChunk c = factoryFromId(ChunkHelper.toString(chunk.idbytes), info);
+	public static PngChunk factory(final ChunkRaw chunk, final ImageInfo info) {
+		final PngChunk c = factoryFromId(ChunkHelper.toString(chunk.idbytes), info);
 		c.length = chunk.len;
 		c.parseFromRaw(chunk);
 		return c;
@@ -164,15 +164,15 @@ public abstract class PngChunk {
 	 * Creates one new blank chunk of the corresponding type, according to
 	 * factoryMap (PngChunkUNKNOWN if not known)
 	 */
-	public static PngChunk factoryFromId(String cid, ImageInfo info) {
+	public static PngChunk factoryFromId(final String cid, final ImageInfo info) {
 		PngChunk chunk = null;
 		try {
-			Class<? extends PngChunk> cla = factoryMap.get(cid);
+			final Class<? extends PngChunk> cla = factoryMap.get(cid);
 			if (cla != null) {
-				Constructor<? extends PngChunk> constr = cla.getConstructor(ImageInfo.class);
+				final Constructor<? extends PngChunk> constr = cla.getConstructor(ImageInfo.class);
 				chunk = constr.newInstance(info);
 			}
-		} catch (Exception e) {
+		} catch (final Exception e) {
 			// this can happen for unkown chunks
 		}
 		if (chunk == null)
@@ -180,8 +180,8 @@ public abstract class PngChunk {
 		return chunk;
 	}
 
-	protected final ChunkRaw createEmptyChunk(int len, boolean alloc) {
-		ChunkRaw c = new ChunkRaw(len, ChunkHelper.toBytes(id), alloc);
+	protected final ChunkRaw createEmptyChunk(final int len, final boolean alloc) {
+		final ChunkRaw c = new ChunkRaw(len, ChunkHelper.toBytes(id), alloc);
 		return c;
 	}
 
@@ -189,8 +189,8 @@ public abstract class PngChunk {
 	 * Makes a clone (deep copy) calling {@link #cloneDataFromRead(PngChunk)}
 	 */
 	@SuppressWarnings("unchecked")
-	public static <T extends PngChunk> T cloneChunk(T chunk, ImageInfo info) {
-		PngChunk cn = factoryFromId(chunk.id, info);
+	public static <T extends PngChunk> T cloneChunk(final T chunk, final ImageInfo info) {
+		final PngChunk cn = factoryFromId(chunk.id, info);
 		if (cn.getClass() != chunk.getClass())
 			throw new PngjExceptionInternal("bad class cloning chunk: " + cn.getClass() + " " + chunk.getClass());
 		cn.cloneDataFromRead(chunk);
@@ -210,7 +210,7 @@ public abstract class PngChunk {
 	/**
 	 * @see #getChunkGroup()
 	 */
-	final public void setChunkGroup(int chunkGroup) {
+	final public void setChunkGroup(final int chunkGroup) {
 		this.chunkGroup = chunkGroup;
 	}
 
@@ -218,12 +218,12 @@ public abstract class PngChunk {
 		return priority;
 	}
 
-	public void setPriority(boolean priority) {
+	public void setPriority(final boolean priority) {
 		this.priority = priority;
 	}
 
-	final void write(OutputStream os) {
-		ChunkRaw c = createRawChunk();
+	final void write(final OutputStream os) {
+		final ChunkRaw c = createRawChunk();
 		if (c == null)
 			throw new PngjExceptionInternal("null chunk ! creation failed for " + this);
 		c.writeChunk(os);
@@ -241,7 +241,7 @@ public abstract class PngChunk {
 		return offset;
 	}
 
-	public void setOffset(long offset) {
+	public void setOffset(final long offset) {
 		this.offset = offset;
 	}
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java
index ea62354..191278d 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkBKGD.java
@@ -18,7 +18,7 @@ public class PngChunkBKGD extends PngChunkSingle {
 	private int red, green, blue;
 	private int paletteIndex;
 
-	public PngChunkBKGD(ImageInfo info) {
+	public PngChunkBKGD(final ImageInfo info) {
 		super(ChunkHelper.bKGD, info);
 	}
 
@@ -46,11 +46,11 @@ public class PngChunkBKGD extends PngChunkSingle {
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw c) {
+	public void parseFromRaw(final ChunkRaw c) {
 		if (imgInfo.greyscale) {
 			gray = PngHelperInternal.readInt2fromBytes(c.data, 0);
 		} else if (imgInfo.indexed) {
-			paletteIndex = (int) (c.data[0] & 0xff);
+			paletteIndex = c.data[0] & 0xff;
 		} else {
 			red = PngHelperInternal.readInt2fromBytes(c.data, 0);
 			green = PngHelperInternal.readInt2fromBytes(c.data, 2);
@@ -59,8 +59,8 @@ public class PngChunkBKGD extends PngChunkSingle {
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkBKGD otherx = (PngChunkBKGD) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkBKGD otherx = (PngChunkBKGD) other;
 		gray = otherx.gray;
 		red = otherx.red;
 		green = otherx.red;
@@ -73,7 +73,7 @@ public class PngChunkBKGD extends PngChunkSingle {
 	 *
 	 * @param gray
 	 */
-	public void setGray(int gray) {
+	public void setGray(final int gray) {
 		if (!imgInfo.greyscale)
 			throw new PngjException("only gray images support this");
 		this.gray = gray;
@@ -89,7 +89,7 @@ public class PngChunkBKGD extends PngChunkSingle {
 	 * Set pallette index
 	 *
 	 */
-	public void setPaletteIndex(int i) {
+	public void setPaletteIndex(final int i) {
 		if (!imgInfo.indexed)
 			throw new PngjException("only indexed (pallete) images support this");
 		this.paletteIndex = i;
@@ -105,7 +105,7 @@ public class PngChunkBKGD extends PngChunkSingle {
 	 * Set rgb values
 	 *
 	 */
-	public void setRGB(int r, int g, int b) {
+	public void setRGB(final int r, final int g, final int b) {
 		if (imgInfo.greyscale || imgInfo.indexed)
 			throw new PngjException("only rgb or rgba images support this");
 		red = r;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java
index 25a4bf2..8bdd7b4 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkCHRM.java
@@ -18,7 +18,7 @@ public class PngChunkCHRM extends PngChunkSingle {
 	private double greenx, greeny;
 	private double bluex, bluey;
 
-	public PngChunkCHRM(ImageInfo info) {
+	public PngChunkCHRM(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -43,7 +43,7 @@ public class PngChunkCHRM extends PngChunkSingle {
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw c) {
+	public void parseFromRaw(final ChunkRaw c) {
 		if (c.len != 32)
 			throw new PngjException("bad chunk " + c);
 		whitex = PngHelperInternal.intToDouble100000(PngHelperInternal.readInt4fromBytes(c.data, 0));
@@ -57,8 +57,8 @@ public class PngChunkCHRM extends PngChunkSingle {
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkCHRM otherx = (PngChunkCHRM) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkCHRM otherx = (PngChunkCHRM) other;
 		whitex = otherx.whitex;
 		whitey = otherx.whitex;
 		redx = otherx.redx;
@@ -69,8 +69,8 @@ public class PngChunkCHRM extends PngChunkSingle {
 		bluey = otherx.bluey;
 	}
 
-	public void setChromaticities(double whitex, double whitey, double redx, double redy, double greenx, double greeny,
-			double bluex, double bluey) {
+	public void setChromaticities(final double whitex, final double whitey, final double redx, final double redy, final double greenx, final double greeny,
+			final double bluex, final double bluey) {
 		this.whitex = whitex;
 		this.redx = redx;
 		this.greenx = greenx;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java
index 7464074..6b62732 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkGAMA.java
@@ -15,7 +15,7 @@ public class PngChunkGAMA extends PngChunkSingle {
 	// http://www.w3.org/TR/PNG/#11gAMA
 	private double gamma;
 
-	public PngChunkGAMA(ImageInfo info) {
+	public PngChunkGAMA(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -26,22 +26,22 @@ public class PngChunkGAMA extends PngChunkSingle {
 
 	@Override
 	public ChunkRaw createRawChunk() {
-		ChunkRaw c = createEmptyChunk(4, true);
-		int g = (int) (gamma * 100000 + 0.5);
+		final ChunkRaw c = createEmptyChunk(4, true);
+		final int g = (int) (gamma * 100000 + 0.5);
 		PngHelperInternal.writeInt4tobytes(g, c.data, 0);
 		return c;
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw chunk) {
+	public void parseFromRaw(final ChunkRaw chunk) {
 		if (chunk.len != 4)
 			throw new PngjException("bad chunk " + chunk);
-		int g = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
-		gamma = ((double) g) / 100000.0;
+		final int g = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
+		gamma = (g) / 100000.0;
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
+	public void cloneDataFromRead(final PngChunk other) {
 		gamma = ((PngChunkGAMA) other).gamma;
 	}
 
@@ -49,7 +49,7 @@ public class PngChunkGAMA extends PngChunkSingle {
 		return gamma;
 	}
 
-	public void setGamma(double gamma) {
+	public void setGamma(final double gamma) {
 		this.gamma = gamma;
 	}
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java
index 6dc3fd9..4a4832d 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkHIST.java
@@ -15,7 +15,7 @@ public class PngChunkHIST extends PngChunkSingle {
 
 	private int[] hist = new int[0]; // should have same lenght as palette
 
-	public PngChunkHIST(ImageInfo info) {
+	public PngChunkHIST(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -25,10 +25,10 @@ public class PngChunkHIST extends PngChunkSingle {
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw c) {
+	public void parseFromRaw(final ChunkRaw c) {
 		if (!imgInfo.indexed)
 			throw new PngjException("only indexed images accept a HIST chunk");
-		int nentries = c.data.length / 2;
+		final int nentries = c.data.length / 2;
 		hist = new int[nentries];
 		for (int i = 0; i < hist.length; i++) {
 			hist[i] = PngHelperInternal.readInt2fromBytes(c.data, i * 2);
@@ -48,8 +48,8 @@ public class PngChunkHIST extends PngChunkSingle {
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkHIST otherx = (PngChunkHIST) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkHIST otherx = (PngChunkHIST) other;
 		hist = new int[otherx.hist.length];
 		System.arraycopy(otherx.hist, 0, hist, 0, otherx.hist.length);
 	}
@@ -58,7 +58,7 @@ public class PngChunkHIST extends PngChunkSingle {
 		return hist;
 	}
 
-	public void setHist(int[] hist) {
+	public void setHist(final int[] hist) {
 		this.hist = hist;
 	}
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java
index 399577d..17f6986 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkICCP.java
@@ -16,7 +16,7 @@ public class PngChunkICCP extends PngChunkSingle {
 	private String profileName;
 	private byte[] compressedProfile; // copmression/decopmresion is done in getter/setter
 
-	public PngChunkICCP(ImageInfo info) {
+	public PngChunkICCP(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -27,7 +27,7 @@ public class PngChunkICCP extends PngChunkSingle {
 
 	@Override
 	public ChunkRaw createRawChunk() {
-		ChunkRaw c = createEmptyChunk(profileName.length() + compressedProfile.length + 2, true);
+		final ChunkRaw c = createEmptyChunk(profileName.length() + compressedProfile.length + 2, true);
 		System.arraycopy(ChunkHelper.toBytes(profileName), 0, c.data, 0, profileName.length());
 		c.data[profileName.length()] = 0;
 		c.data[profileName.length() + 1] = 0;
@@ -36,20 +36,20 @@ public class PngChunkICCP extends PngChunkSingle {
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw chunk) {
-		int pos0 = ChunkHelper.posNullByte(chunk.data);
+	public void parseFromRaw(final ChunkRaw chunk) {
+		final int pos0 = ChunkHelper.posNullByte(chunk.data);
 		profileName = new String(chunk.data, 0, pos0, PngHelperInternal.charsetLatin1);
-		int comp = (chunk.data[pos0 + 1] & 0xff);
+		final int comp = (chunk.data[pos0 + 1] & 0xff);
 		if (comp != 0)
 			throw new PngjException("bad compression for ChunkTypeICCP");
-		int compdatasize = chunk.data.length - (pos0 + 2);
+		final int compdatasize = chunk.data.length - (pos0 + 2);
 		compressedProfile = new byte[compdatasize];
 		System.arraycopy(chunk.data, pos0 + 2, compressedProfile, 0, compdatasize);
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkICCP otherx = (PngChunkICCP) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkICCP otherx = (PngChunkICCP) other;
 		profileName = otherx.profileName;
 		compressedProfile = new byte[otherx.compressedProfile.length];
 		System.arraycopy(otherx.compressedProfile, 0, compressedProfile, 0, otherx.compressedProfile.length); // deep
@@ -59,12 +59,12 @@ public class PngChunkICCP extends PngChunkSingle {
 	/**
 	 * The profile should be uncompressed bytes
 	 */
-	public void setProfileNameAndContent(String name, byte[] profile) {
+	public void setProfileNameAndContent(final String name, final byte[] profile) {
 		profileName = name;
 		compressedProfile = ChunkHelper.compressBytes(profile, true);
 	}
 
-	public void setProfileNameAndContent(String name, String profile) {
+	public void setProfileNameAndContent(final String name, final String profile) {
 		setProfileNameAndContent(name, profile.getBytes(PngHelperInternal.charsetLatin1));
 	}
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java
index 911513c..f7bee4b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIDAT.java
@@ -14,7 +14,7 @@ public class PngChunkIDAT extends PngChunkMultiple {
 	public final static String ID = ChunkHelper.IDAT;
 
 	// http://www.w3.org/TR/PNG/#11IDAT
-	public PngChunkIDAT(ImageInfo i, int len, long offset) {
+	public PngChunkIDAT(final ImageInfo i, final int len, final long offset) {
 		super(ID, i);
 		this.length = len;
 		this.offset = offset;
@@ -31,10 +31,10 @@ public class PngChunkIDAT extends PngChunkMultiple {
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw c) { // does nothing
+	public void parseFromRaw(final ChunkRaw c) { // does nothing
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
+	public void cloneDataFromRead(final PngChunk other) {
 	}
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java
index fbec564..3f6e47b 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIEND.java
@@ -12,7 +12,7 @@ public class PngChunkIEND extends PngChunkSingle {
 
 	// http://www.w3.org/TR/PNG/#11IEND
 	// this is a dummy placeholder
-	public PngChunkIEND(ImageInfo info) {
+	public PngChunkIEND(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -23,16 +23,16 @@ public class PngChunkIEND extends PngChunkSingle {
 
 	@Override
 	public ChunkRaw createRawChunk() {
-		ChunkRaw c = new ChunkRaw(0, ChunkHelper.b_IEND, false);
+		final ChunkRaw c = new ChunkRaw(0, ChunkHelper.b_IEND, false);
 		return c;
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw c) {
+	public void parseFromRaw(final ChunkRaw c) {
 		// this is not used
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
+	public void cloneDataFromRead(final PngChunk other) {
 	}
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java
index 94bfedd..71e0ec9 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkIHDR.java
@@ -27,7 +27,7 @@ public class PngChunkIHDR extends PngChunkSingle {
 
 	// http://www.w3.org/TR/PNG/#11IHDR
 	//
-	public PngChunkIHDR(ImageInfo info) {
+	public PngChunkIHDR(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -38,7 +38,7 @@ public class PngChunkIHDR extends PngChunkSingle {
 
 	@Override
 	public ChunkRaw createRawChunk() {
-		ChunkRaw c = new ChunkRaw(13, ChunkHelper.b_IHDR, true);
+		final ChunkRaw c = new ChunkRaw(13, ChunkHelper.b_IHDR, true);
 		int offset = 0;
 		PngHelperInternal.writeInt4tobytes(cols, c.data, offset);
 		offset += 4;
@@ -53,10 +53,10 @@ public class PngChunkIHDR extends PngChunkSingle {
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw c) {
+	public void parseFromRaw(final ChunkRaw c) {
 		if (c.len != 13)
 			throw new PngjException("Bad IDHR len " + c.len);
-		ByteArrayInputStream st = c.getAsByteStream();
+		final ByteArrayInputStream st = c.getAsByteStream();
 		cols = PngHelperInternal.readInt4(st);
 		rows = PngHelperInternal.readInt4(st);
 		// bit depth: number of bits per channel
@@ -68,8 +68,8 @@ public class PngChunkIHDR extends PngChunkSingle {
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkIHDR otherx = (PngChunkIHDR) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkIHDR otherx = (PngChunkIHDR) other;
 		cols = otherx.cols;
 		rows = otherx.rows;
 		bitspc = otherx.bitspc;
@@ -83,7 +83,7 @@ public class PngChunkIHDR extends PngChunkSingle {
 		return cols;
 	}
 
-	public void setCols(int cols) {
+	public void setCols(final int cols) {
 		this.cols = cols;
 	}
 
@@ -91,7 +91,7 @@ public class PngChunkIHDR extends PngChunkSingle {
 		return rows;
 	}
 
-	public void setRows(int rows) {
+	public void setRows(final int rows) {
 		this.rows = rows;
 	}
 
@@ -99,7 +99,7 @@ public class PngChunkIHDR extends PngChunkSingle {
 		return bitspc;
 	}
 
-	public void setBitspc(int bitspc) {
+	public void setBitspc(final int bitspc) {
 		this.bitspc = bitspc;
 	}
 
@@ -107,7 +107,7 @@ public class PngChunkIHDR extends PngChunkSingle {
 		return colormodel;
 	}
 
-	public void setColormodel(int colormodel) {
+	public void setColormodel(final int colormodel) {
 		this.colormodel = colormodel;
 	}
 
@@ -115,7 +115,7 @@ public class PngChunkIHDR extends PngChunkSingle {
 		return compmeth;
 	}
 
-	public void setCompmeth(int compmeth) {
+	public void setCompmeth(final int compmeth) {
 		this.compmeth = compmeth;
 	}
 
@@ -123,7 +123,7 @@ public class PngChunkIHDR extends PngChunkSingle {
 		return filmeth;
 	}
 
-	public void setFilmeth(int filmeth) {
+	public void setFilmeth(final int filmeth) {
 		this.filmeth = filmeth;
 	}
 
@@ -131,7 +131,7 @@ public class PngChunkIHDR extends PngChunkSingle {
 		return interlaced;
 	}
 
-	public void setInterlaced(int interlaced) {
+	public void setInterlaced(final int interlaced) {
 		this.interlaced = interlaced;
 	}
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java
index ab52d7c..738f924 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkITXT.java
@@ -21,7 +21,7 @@ public class PngChunkITXT extends PngChunkTextVar {
 	private String translatedTag = "";
 
 	// http://www.w3.org/TR/PNG/#11iTXt
-	public PngChunkITXT(ImageInfo info) {
+	public PngChunkITXT(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -30,7 +30,7 @@ public class PngChunkITXT extends PngChunkTextVar {
 		if (key.isEmpty())
 			throw new PngjException("Text chunk key must be non empty");
 		try {
-			ByteArrayOutputStream ba = new ByteArrayOutputStream();
+			final ByteArrayOutputStream ba = new ByteArrayOutputStream();
 			ba.write(ChunkHelper.toBytes(key));
 			ba.write(0); // separator
 			ba.write(compressed ? 1 : 0);
@@ -44,19 +44,19 @@ public class PngChunkITXT extends PngChunkTextVar {
 				textbytes = ChunkHelper.compressBytes(textbytes, true);
 			}
 			ba.write(textbytes);
-			byte[] b = ba.toByteArray();
-			ChunkRaw chunk = createEmptyChunk(b.length, false);
+			final byte[] b = ba.toByteArray();
+			final ChunkRaw chunk = createEmptyChunk(b.length, false);
 			chunk.data = b;
 			return chunk;
-		} catch (IOException e) {
+		} catch (final IOException e) {
 			throw new PngjException(e);
 		}
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw c) {
+	public void parseFromRaw(final ChunkRaw c) {
 		int nullsFound = 0;
-		int[] nullsIdx = new int[3];
+		final int[] nullsIdx = new int[3];
 		for (int i = 0; i < c.data.length; i++) {
 			if (c.data[i] != 0)
 				continue;
@@ -80,7 +80,7 @@ public class PngChunkITXT extends PngChunkTextVar {
 				PngHelperInternal.charsetUTF8);
 		i = nullsIdx[2] + 1;
 		if (compressed) {
-			byte[] bytes = ChunkHelper.compressBytes(c.data, i, c.data.length - i, false);
+			final byte[] bytes = ChunkHelper.compressBytes(c.data, i, c.data.length - i, false);
 			val = ChunkHelper.toStringUTF8(bytes);
 		} else {
 			val = ChunkHelper.toStringUTF8(c.data, i, c.data.length - i);
@@ -88,8 +88,8 @@ public class PngChunkITXT extends PngChunkTextVar {
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkITXT otherx = (PngChunkITXT) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkITXT otherx = (PngChunkITXT) other;
 		key = otherx.key;
 		val = otherx.val;
 		compressed = otherx.compressed;
@@ -101,7 +101,7 @@ public class PngChunkITXT extends PngChunkTextVar {
 		return compressed;
 	}
 
-	public void setCompressed(boolean compressed) {
+	public void setCompressed(final boolean compressed) {
 		this.compressed = compressed;
 	}
 
@@ -109,7 +109,7 @@ public class PngChunkITXT extends PngChunkTextVar {
 		return langTag;
 	}
 
-	public void setLangtag(String langtag) {
+	public void setLangtag(final String langtag) {
 		this.langTag = langtag;
 	}
 
@@ -117,7 +117,7 @@ public class PngChunkITXT extends PngChunkTextVar {
 		return translatedTag;
 	}
 
-	public void setTranslatedTag(String translatedTag) {
+	public void setTranslatedTag(final String translatedTag) {
 		this.translatedTag = translatedTag;
 	}
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java
index 057f6c2..5a7bee9 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkMultiple.java
@@ -7,7 +7,7 @@ import jogamp.opengl.util.pngj.ImageInfo;
  */
 public abstract class PngChunkMultiple extends PngChunk {
 
-	protected PngChunkMultiple(String id, ImageInfo imgInfo) {
+	protected PngChunkMultiple(final String id, final ImageInfo imgInfo) {
 		super(id, imgInfo);
 	}
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java
index a3bab49..2217a59 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkOFFS.java
@@ -17,7 +17,7 @@ public class PngChunkOFFS extends PngChunkSingle {
 	private long posY;
 	private int units; // 0: pixel 1:micrometer
 
-	public PngChunkOFFS(ImageInfo info) {
+	public PngChunkOFFS(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -28,7 +28,7 @@ public class PngChunkOFFS extends PngChunkSingle {
 
 	@Override
 	public ChunkRaw createRawChunk() {
-		ChunkRaw c = createEmptyChunk(9, true);
+		final ChunkRaw c = createEmptyChunk(9, true);
 		PngHelperInternal.writeInt4tobytes((int) posX, c.data, 0);
 		PngHelperInternal.writeInt4tobytes((int) posY, c.data, 4);
 		c.data[8] = (byte) units;
@@ -36,7 +36,7 @@ public class PngChunkOFFS extends PngChunkSingle {
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw chunk) {
+	public void parseFromRaw(final ChunkRaw chunk) {
 		if (chunk.len != 9)
 			throw new PngjException("bad chunk length " + chunk);
 		posX = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
@@ -49,8 +49,8 @@ public class PngChunkOFFS extends PngChunkSingle {
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkOFFS otherx = (PngChunkOFFS) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkOFFS otherx = (PngChunkOFFS) other;
 		this.posX = otherx.posX;
 		this.posY = otherx.posY;
 		this.units = otherx.units;
@@ -66,7 +66,7 @@ public class PngChunkOFFS extends PngChunkSingle {
 	/**
 	 * 0: pixel, 1:micrometer
 	 */
-	public void setUnits(int units) {
+	public void setUnits(final int units) {
 		this.units = units;
 	}
 
@@ -74,7 +74,7 @@ public class PngChunkOFFS extends PngChunkSingle {
 		return posX;
 	}
 
-	public void setPosX(long posX) {
+	public void setPosX(final long posX) {
 		this.posX = posX;
 	}
 
@@ -82,7 +82,7 @@ public class PngChunkOFFS extends PngChunkSingle {
 		return posY;
 	}
 
-	public void setPosY(long posY) {
+	public void setPosY(final long posY) {
 		this.posY = posY;
 	}
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java
index b0a1bb8..fc64727 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPHYS.java
@@ -16,7 +16,7 @@ public class PngChunkPHYS extends PngChunkSingle {
 	private long pixelsxUnitY;
 	private int units; // 0: unknown 1:metre
 
-	public PngChunkPHYS(ImageInfo info) {
+	public PngChunkPHYS(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -27,7 +27,7 @@ public class PngChunkPHYS extends PngChunkSingle {
 
 	@Override
 	public ChunkRaw createRawChunk() {
-		ChunkRaw c = createEmptyChunk(9, true);
+		final ChunkRaw c = createEmptyChunk(9, true);
 		PngHelperInternal.writeInt4tobytes((int) pixelsxUnitX, c.data, 0);
 		PngHelperInternal.writeInt4tobytes((int) pixelsxUnitY, c.data, 4);
 		c.data[8] = (byte) units;
@@ -35,7 +35,7 @@ public class PngChunkPHYS extends PngChunkSingle {
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw chunk) {
+	public void parseFromRaw(final ChunkRaw chunk) {
 		if (chunk.len != 9)
 			throw new PngjException("bad chunk length " + chunk);
 		pixelsxUnitX = PngHelperInternal.readInt4fromBytes(chunk.data, 0);
@@ -48,8 +48,8 @@ public class PngChunkPHYS extends PngChunkSingle {
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkPHYS otherx = (PngChunkPHYS) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkPHYS otherx = (PngChunkPHYS) other;
 		this.pixelsxUnitX = otherx.pixelsxUnitX;
 		this.pixelsxUnitY = otherx.pixelsxUnitY;
 		this.units = otherx.units;
@@ -59,7 +59,7 @@ public class PngChunkPHYS extends PngChunkSingle {
 		return pixelsxUnitX;
 	}
 
-	public void setPixelsxUnitX(long pixelsxUnitX) {
+	public void setPixelsxUnitX(final long pixelsxUnitX) {
 		this.pixelsxUnitX = pixelsxUnitX;
 	}
 
@@ -67,7 +67,7 @@ public class PngChunkPHYS extends PngChunkSingle {
 		return pixelsxUnitY;
 	}
 
-	public void setPixelsxUnitY(long pixelsxUnitY) {
+	public void setPixelsxUnitY(final long pixelsxUnitY) {
 		this.pixelsxUnitY = pixelsxUnitY;
 	}
 
@@ -75,7 +75,7 @@ public class PngChunkPHYS extends PngChunkSingle {
 		return units;
 	}
 
-	public void setUnits(int units) {
+	public void setUnits(final int units) {
 		this.units = units;
 	}
 
@@ -87,7 +87,7 @@ public class PngChunkPHYS extends PngChunkSingle {
 	public double getAsDpi() {
 		if (units != 1 || pixelsxUnitX != pixelsxUnitY)
 			return -1;
-		return ((double) pixelsxUnitX) * 0.0254;
+		return (pixelsxUnitX) * 0.0254;
 	}
 
 	/**
@@ -96,16 +96,16 @@ public class PngChunkPHYS extends PngChunkSingle {
 	public double[] getAsDpi2() {
 		if (units != 1)
 			return new double[] { -1, -1 };
-		return new double[] { ((double) pixelsxUnitX) * 0.0254, ((double) pixelsxUnitY) * 0.0254 };
+		return new double[] { (pixelsxUnitX) * 0.0254, (pixelsxUnitY) * 0.0254 };
 	}
 
-	public void setAsDpi(double dpi) {
+	public void setAsDpi(final double dpi) {
 		units = 1;
 		pixelsxUnitX = (long) (dpi / 0.0254 + 0.5);
 		pixelsxUnitY = pixelsxUnitX;
 	}
 
-	public void setAsDpi2(double dpix, double dpiy) {
+	public void setAsDpi2(final double dpix, final double dpiy) {
 		units = 1;
 		pixelsxUnitX = (long) (dpix / 0.0254 + 0.5);
 		pixelsxUnitY = (long) (dpiy / 0.0254 + 0.5);
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java
index dbf5e53..0f135d1 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkPLTE.java
@@ -20,7 +20,7 @@ public class PngChunkPLTE extends PngChunkSingle {
 	 */
 	private int[] entries;
 
-	public PngChunkPLTE(ImageInfo info) {
+	public PngChunkPLTE(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -31,9 +31,9 @@ public class PngChunkPLTE extends PngChunkSingle {
 
 	@Override
 	public ChunkRaw createRawChunk() {
-		int len = 3 * nentries;
-		int[] rgb = new int[3];
-		ChunkRaw c = createEmptyChunk(len, true);
+		final int len = 3 * nentries;
+		final int[] rgb = new int[3];
+		final ChunkRaw c = createEmptyChunk(len, true);
 		for (int n = 0, i = 0; n < nentries; n++) {
 			getEntryRgb(n, rgb);
 			c.data[i++] = (byte) rgb[0];
@@ -44,21 +44,21 @@ public class PngChunkPLTE extends PngChunkSingle {
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw chunk) {
+	public void parseFromRaw(final ChunkRaw chunk) {
 		setNentries(chunk.len / 3);
 		for (int n = 0, i = 0; n < nentries; n++) {
-			setEntry(n, (int) (chunk.data[i++] & 0xff), (int) (chunk.data[i++] & 0xff), (int) (chunk.data[i++] & 0xff));
+			setEntry(n, chunk.data[i++] & 0xff, chunk.data[i++] & 0xff, chunk.data[i++] & 0xff);
 		}
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkPLTE otherx = (PngChunkPLTE) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkPLTE otherx = (PngChunkPLTE) other;
 		this.setNentries(otherx.getNentries());
 		System.arraycopy(otherx.entries, 0, entries, 0, nentries);
 	}
 
-	public void setNentries(int n) {
+	public void setNentries(final int n) {
 		nentries = n;
 		if (nentries < 1 || nentries > 256)
 			throw new PngjException("invalid pallette - nentries=" + nentries);
@@ -71,20 +71,20 @@ public class PngChunkPLTE extends PngChunkSingle {
 		return nentries;
 	}
 
-	public void setEntry(int n, int r, int g, int b) {
+	public void setEntry(final int n, final int r, final int g, final int b) {
 		entries[n] = ((r << 16) | (g << 8) | b);
 	}
 
-	public int getEntry(int n) {
+	public int getEntry(final int n) {
 		return entries[n];
 	}
 
-	public void getEntryRgb(int n, int[] rgb) {
+	public void getEntryRgb(final int n, final int[] rgb) {
 		getEntryRgb(n, rgb, 0);
 	}
 
-	public void getEntryRgb(int n, int[] rgb, int offset) {
-		int v = entries[n];
+	public void getEntryRgb(final int n, final int[] rgb, final int offset) {
+		final int v = entries[n];
 		rgb[offset + 0] = ((v & 0xff0000) >> 16);
 		rgb[offset + 1] = ((v & 0xff00) >> 8);
 		rgb[offset + 2] = (v & 0xff);
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java
index 3a49065..53858da 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSBIT.java
@@ -19,7 +19,7 @@ public class PngChunkSBIT extends PngChunkSingle {
 	private int graysb, alphasb;
 	private int redsb, greensb, bluesb;
 
-	public PngChunkSBIT(ImageInfo info) {
+	public PngChunkSBIT(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -36,7 +36,7 @@ public class PngChunkSBIT extends PngChunkSingle {
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw c) {
+	public void parseFromRaw(final ChunkRaw c) {
 		if (c.len != getLen())
 			throw new PngjException("bad chunk length " + c);
 		if (imgInfo.greyscale) {
@@ -71,8 +71,8 @@ public class PngChunkSBIT extends PngChunkSingle {
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkSBIT otherx = (PngChunkSBIT) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkSBIT otherx = (PngChunkSBIT) other;
 		graysb = otherx.graysb;
 		redsb = otherx.redsb;
 		greensb = otherx.greensb;
@@ -80,7 +80,7 @@ public class PngChunkSBIT extends PngChunkSingle {
 		alphasb = otherx.alphasb;
 	}
 
-	public void setGraysb(int gray) {
+	public void setGraysb(final int gray) {
 		if (!imgInfo.greyscale)
 			throw new PngjException("only greyscale images support this");
 		graysb = gray;
@@ -92,7 +92,7 @@ public class PngChunkSBIT extends PngChunkSingle {
 		return graysb;
 	}
 
-	public void setAlphasb(int a) {
+	public void setAlphasb(final int a) {
 		if (!imgInfo.alpha)
 			throw new PngjException("only images with alpha support this");
 		alphasb = a;
@@ -108,7 +108,7 @@ public class PngChunkSBIT extends PngChunkSingle {
 	 * Set rgb values
 	 *
 	 */
-	public void setRGB(int r, int g, int b) {
+	public void setRGB(final int r, final int g, final int b) {
 		if (imgInfo.greyscale || imgInfo.indexed)
 			throw new PngjException("only rgb or rgba images support this");
 		redsb = r;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java
index 2ff6583..44ff249 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSPLT.java
@@ -21,7 +21,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
 	private int sampledepth; // 8/16
 	private int[] palette; // 5 elements per entry
 
-	public PngChunkSPLT(ImageInfo info) {
+	public PngChunkSPLT(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -33,11 +33,11 @@ public class PngChunkSPLT extends PngChunkMultiple {
 	@Override
 	public ChunkRaw createRawChunk() {
 		try {
-			ByteArrayOutputStream ba = new ByteArrayOutputStream();
+			final ByteArrayOutputStream ba = new ByteArrayOutputStream();
 			ba.write(palName.getBytes(PngHelperInternal.charsetLatin1));
 			ba.write(0); // separator
 			ba.write((byte) sampledepth);
-			int nentries = getNentries();
+			final int nentries = getNentries();
 			for (int n = 0; n < nentries; n++) {
 				for (int i = 0; i < 4; i++) {
 					if (sampledepth == 8)
@@ -47,17 +47,17 @@ public class PngChunkSPLT extends PngChunkMultiple {
 				}
 				PngHelperInternal.writeInt2(ba, palette[n * 5 + 4]);
 			}
-			byte[] b = ba.toByteArray();
-			ChunkRaw chunk = createEmptyChunk(b.length, false);
+			final byte[] b = ba.toByteArray();
+			final ChunkRaw chunk = createEmptyChunk(b.length, false);
 			chunk.data = b;
 			return chunk;
-		} catch (IOException e) {
+		} catch (final IOException e) {
 			throw new PngjException(e);
 		}
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw c) {
+	public void parseFromRaw(final ChunkRaw c) {
 		int t = -1;
 		for (int i = 0; i < c.data.length; i++) { // look for first zero
 			if (c.data[i] == 0) {
@@ -70,7 +70,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
 		palName = new String(c.data, 0, t, PngHelperInternal.charsetLatin1);
 		sampledepth = PngHelperInternal.readInt1fromByte(c.data, t + 1);
 		t += 2;
-		int nentries = (c.data.length - t) / (sampledepth == 8 ? 6 : 10);
+		final int nentries = (c.data.length - t) / (sampledepth == 8 ? 6 : 10);
 		palette = new int[nentries * 5];
 		int r, g, b, a, f, ne;
 		ne = 0;
@@ -101,8 +101,8 @@ public class PngChunkSPLT extends PngChunkMultiple {
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkSPLT otherx = (PngChunkSPLT) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkSPLT otherx = (PngChunkSPLT) other;
 		palName = otherx.palName;
 		sampledepth = otherx.sampledepth;
 		palette = new int[otherx.palette.length];
@@ -117,7 +117,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
 		return palName;
 	}
 
-	public void setPalName(String palName) {
+	public void setPalName(final String palName) {
 		this.palName = palName;
 	}
 
@@ -125,7 +125,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
 		return sampledepth;
 	}
 
-	public void setSampledepth(int sampledepth) {
+	public void setSampledepth(final int sampledepth) {
 		this.sampledepth = sampledepth;
 	}
 
@@ -133,7 +133,7 @@ public class PngChunkSPLT extends PngChunkMultiple {
 		return palette;
 	}
 
-	public void setPalette(int[] palette) {
+	public void setPalette(final int[] palette) {
 		this.palette = palette;
 	}
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java
index e4d77d4..19504b9 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSRGB.java
@@ -21,7 +21,7 @@ public class PngChunkSRGB extends PngChunkSingle {
 
 	private int intent;
 
-	public PngChunkSRGB(ImageInfo info) {
+	public PngChunkSRGB(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -31,7 +31,7 @@ public class PngChunkSRGB extends PngChunkSingle {
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw c) {
+	public void parseFromRaw(final ChunkRaw c) {
 		if (c.len != 1)
 			throw new PngjException("bad chunk length " + c);
 		intent = PngHelperInternal.readInt1fromByte(c.data, 0);
@@ -46,8 +46,8 @@ public class PngChunkSRGB extends PngChunkSingle {
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkSRGB otherx = (PngChunkSRGB) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkSRGB otherx = (PngChunkSRGB) other;
 		intent = otherx.intent;
 	}
 
@@ -55,7 +55,7 @@ public class PngChunkSRGB extends PngChunkSingle {
 		return intent;
 	}
 
-	public void setIntent(int intent) {
+	public void setIntent(final int intent) {
 		this.intent = intent;
 	}
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java
index 4dc5ede..52037b3 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSTER.java
@@ -14,7 +14,7 @@ public class PngChunkSTER extends PngChunkSingle {
 	// http://www.libpng.org/pub/png/spec/register/pngext-1.3.0-pdg.html#C.sTER
 	private byte mode; // 0: cross-fuse layout 1: diverging-fuse layout
 
-	public PngChunkSTER(ImageInfo info) {
+	public PngChunkSTER(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -25,21 +25,21 @@ public class PngChunkSTER extends PngChunkSingle {
 
 	@Override
 	public ChunkRaw createRawChunk() {
-		ChunkRaw c = createEmptyChunk(1, true);
-		c.data[0] = (byte) mode;
+		final ChunkRaw c = createEmptyChunk(1, true);
+		c.data[0] = mode;
 		return c;
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw chunk) {
+	public void parseFromRaw(final ChunkRaw chunk) {
 		if (chunk.len != 1)
 			throw new PngjException("bad chunk length " + chunk);
 		mode = chunk.data[0];
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkSTER otherx = (PngChunkSTER) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkSTER otherx = (PngChunkSTER) other;
 		this.mode = otherx.mode;
 	}
 
@@ -53,7 +53,7 @@ public class PngChunkSTER extends PngChunkSingle {
 	/**
 	 * 0: cross-fuse layout 1: diverging-fuse layout
 	 */
-	public void setMode(byte mode) {
+	public void setMode(final byte mode) {
 		this.mode = mode;
 	}
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
index 7df5ba0..c5e9407 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSingle.java
@@ -8,7 +8,7 @@ import jogamp.opengl.util.pngj.ImageInfo;
  */
 public abstract class PngChunkSingle extends PngChunk {
 
-	protected PngChunkSingle(String id, ImageInfo imgInfo) {
+	protected PngChunkSingle(final String id, final ImageInfo imgInfo) {
 		super(id, imgInfo);
 	}
 
@@ -26,14 +26,14 @@ public abstract class PngChunkSingle extends PngChunk {
 	}
 
 	@Override
-	public boolean equals(Object obj) {
+	public boolean equals(final Object obj) {
 		if (this == obj)
 			return true;
 		if (obj == null)
 			return false;
 		if (getClass() != obj.getClass())
 			return false;
-		PngChunkSingle other = (PngChunkSingle) obj;
+		final PngChunkSingle other = (PngChunkSingle) obj;
 		if (id == null) {
 			if (other.id != null)
 				return false;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java
index f4c77b4..02a1881 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkSkipped.java
@@ -8,7 +8,7 @@ import jogamp.opengl.util.pngj.PngjException;
  */
 public class PngChunkSkipped extends PngChunk {
 
-	public PngChunkSkipped(String id, ImageInfo info, int clen) {
+	public PngChunkSkipped(final String id, final ImageInfo info, final int clen) {
 		super(id, info);
 		this.length = clen;
 	}
@@ -24,12 +24,12 @@ public class PngChunkSkipped extends PngChunk {
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw c) {
+	public void parseFromRaw(final ChunkRaw c) {
 		throw new PngjException("Non supported for a skipped chunk");
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
+	public void cloneDataFromRead(final PngChunk other) {
 		throw new PngjException("Non supported for a skipped chunk");
 	}
 
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java
index d97cd63..634d0cd 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTEXT.java
@@ -12,7 +12,7 @@ import jogamp.opengl.util.pngj.PngjException;
 public class PngChunkTEXT extends PngChunkTextVar {
 	public final static String ID = ChunkHelper.tEXt;
 
-	public PngChunkTEXT(ImageInfo info) {
+	public PngChunkTEXT(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -20,14 +20,14 @@ public class PngChunkTEXT extends PngChunkTextVar {
 	public ChunkRaw createRawChunk() {
 		if (key.isEmpty())
 			throw new PngjException("Text chunk key must be non empty");
-		byte[] b = (key + "\0" + val).getBytes(PngHelperInternal.charsetLatin1);
-		ChunkRaw chunk = createEmptyChunk(b.length, false);
+		final byte[] b = (key + "\0" + val).getBytes(PngHelperInternal.charsetLatin1);
+		final ChunkRaw chunk = createEmptyChunk(b.length, false);
 		chunk.data = b;
 		return chunk;
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw c) {
+	public void parseFromRaw(final ChunkRaw c) {
 		int i;
 		for (i = 0; i < c.data.length; i++)
 			if (c.data[i] == 0)
@@ -38,8 +38,8 @@ public class PngChunkTEXT extends PngChunkTextVar {
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkTEXT otherx = (PngChunkTEXT) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkTEXT otherx = (PngChunkTEXT) other;
 		key = otherx.key;
 		val = otherx.val;
 	}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java
index 8f34c78..850fb64 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTIME.java
@@ -17,7 +17,7 @@ public class PngChunkTIME extends PngChunkSingle {
 	// http://www.w3.org/TR/PNG/#11tIME
 	private int year, mon, day, hour, min, sec;
 
-	public PngChunkTIME(ImageInfo info) {
+	public PngChunkTIME(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -28,7 +28,7 @@ public class PngChunkTIME extends PngChunkSingle {
 
 	@Override
 	public ChunkRaw createRawChunk() {
-		ChunkRaw c = createEmptyChunk(7, true);
+		final ChunkRaw c = createEmptyChunk(7, true);
 		PngHelperInternal.writeInt2tobytes(year, c.data, 0);
 		c.data[2] = (byte) mon;
 		c.data[3] = (byte) day;
@@ -39,7 +39,7 @@ public class PngChunkTIME extends PngChunkSingle {
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw chunk) {
+	public void parseFromRaw(final ChunkRaw chunk) {
 		if (chunk.len != 7)
 			throw new PngjException("bad chunk " + chunk);
 		year = PngHelperInternal.readInt2fromBytes(chunk.data, 0);
@@ -51,8 +51,8 @@ public class PngChunkTIME extends PngChunkSingle {
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkTIME x = (PngChunkTIME) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkTIME x = (PngChunkTIME) other;
 		year = x.year;
 		mon = x.mon;
 		day = x.day;
@@ -61,8 +61,8 @@ public class PngChunkTIME extends PngChunkSingle {
 		sec = x.sec;
 	}
 
-	public void setNow(int secsAgo) {
-		Calendar d = Calendar.getInstance();
+	public void setNow(final int secsAgo) {
+		final Calendar d = Calendar.getInstance();
 		d.setTimeInMillis(System.currentTimeMillis() - 1000 * (long) secsAgo);
 		year = d.get(Calendar.YEAR);
 		mon = d.get(Calendar.MONTH) + 1;
@@ -72,7 +72,7 @@ public class PngChunkTIME extends PngChunkSingle {
 		sec = d.get(Calendar.SECOND);
 	}
 
-	public void setYMDHMS(int yearx, int monx, int dayx, int hourx, int minx, int secx) {
+	public void setYMDHMS(final int yearx, final int monx, final int dayx, final int hourx, final int minx, final int secx) {
 		year = yearx;
 		mon = monx;
 		day = dayx;
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java
index 867e348..5e10c04 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTRNS.java
@@ -21,7 +21,7 @@ public class PngChunkTRNS extends PngChunkSingle {
 	private int red, green, blue;
 	private int[] paletteAlpha = new int[] {};
 
-	public PngChunkTRNS(ImageInfo info) {
+	public PngChunkTRNS(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -51,14 +51,14 @@ public class PngChunkTRNS extends PngChunkSingle {
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw c) {
+	public void parseFromRaw(final ChunkRaw c) {
 		if (imgInfo.greyscale) {
 			gray = PngHelperInternal.readInt2fromBytes(c.data, 0);
 		} else if (imgInfo.indexed) {
-			int nentries = c.data.length;
+			final int nentries = c.data.length;
 			paletteAlpha = new int[nentries];
 			for (int n = 0; n < nentries; n++) {
-				paletteAlpha[n] = (int) (c.data[n] & 0xff);
+				paletteAlpha[n] = c.data[n] & 0xff;
 			}
 		} else {
 			red = PngHelperInternal.readInt2fromBytes(c.data, 0);
@@ -68,8 +68,8 @@ public class PngChunkTRNS extends PngChunkSingle {
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkTRNS otherx = (PngChunkTRNS) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkTRNS otherx = (PngChunkTRNS) other;
 		gray = otherx.gray;
 		red = otherx.red;
 		green = otherx.green;
@@ -84,7 +84,7 @@ public class PngChunkTRNS extends PngChunkSingle {
 	 * Set rgb values
 	 *
 	 */
-	public void setRGB(int r, int g, int b) {
+	public void setRGB(final int r, final int g, final int b) {
 		if (imgInfo.greyscale || imgInfo.indexed)
 			throw new PngjException("only rgb or rgba images support this");
 		red = r;
@@ -98,7 +98,7 @@ public class PngChunkTRNS extends PngChunkSingle {
 		return new int[] { red, green, blue };
 	}
 
-	public void setGray(int g) {
+	public void setGray(final int g) {
 		if (!imgInfo.greyscale)
 			throw new PngjException("only grayscale images support this");
 		gray = g;
@@ -113,7 +113,7 @@ public class PngChunkTRNS extends PngChunkSingle {
 	/**
 	 * WARNING: non deep copy
 	 */
-	public void setPalletteAlpha(int[] palAlpha) {
+	public void setPalletteAlpha(final int[] palAlpha) {
 		if (!imgInfo.indexed)
 			throw new PngjException("only indexed images support this");
 		paletteAlpha = palAlpha;
@@ -122,7 +122,7 @@ public class PngChunkTRNS extends PngChunkSingle {
 	/**
 	 * to use when only one pallete index is set as totally transparent
 	 */
-	public void setIndexEntryAsTransparent(int palAlphaIndex) {
+	public void setIndexEntryAsTransparent(final int palAlphaIndex) {
 		if (!imgInfo.indexed)
 			throw new PngjException("only indexed images support this");
 		paletteAlpha = new int[] { palAlphaIndex + 1 };
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java
index ba3ffc3..d00c299 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkTextVar.java
@@ -21,7 +21,7 @@ public abstract class PngChunkTextVar extends PngChunkMultiple {
 	public final static String KEY_Source = "Source"; // Device used to create the image
 	public final static String KEY_Comment = "Comment"; // Miscellaneous comment
 
-	protected PngChunkTextVar(String id, ImageInfo info) {
+	protected PngChunkTextVar(final String id, final ImageInfo info) {
 		super(id, info);
 	}
 
@@ -51,7 +51,7 @@ public abstract class PngChunkTextVar extends PngChunkMultiple {
 		return val;
 	}
 
-	public void setKeyVal(String key, String val) {
+	public void setKeyVal(final String key, final String val) {
 		this.key = key;
 		this.val = val;
 	}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java
index 3803428..693729e 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkUNKNOWN.java
@@ -11,11 +11,11 @@ public class PngChunkUNKNOWN extends PngChunkMultiple { // unkown, custom or not
 
 	private byte[] data;
 
-	public PngChunkUNKNOWN(String id, ImageInfo info) {
+	public PngChunkUNKNOWN(final String id, final ImageInfo info) {
 		super(id, info);
 	}
 
-	private PngChunkUNKNOWN(PngChunkUNKNOWN c, ImageInfo info) {
+	private PngChunkUNKNOWN(final PngChunkUNKNOWN c, final ImageInfo info) {
 		super(c.id, info);
 		System.arraycopy(c.data, 0, data, 0, c.data.length);
 	}
@@ -27,13 +27,13 @@ public class PngChunkUNKNOWN extends PngChunkMultiple { // unkown, custom or not
 
 	@Override
 	public ChunkRaw createRawChunk() {
-		ChunkRaw p = createEmptyChunk(data.length, false);
+		final ChunkRaw p = createEmptyChunk(data.length, false);
 		p.data = this.data;
 		return p;
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw c) {
+	public void parseFromRaw(final ChunkRaw c) {
 		data = c.data;
 	}
 
@@ -43,14 +43,14 @@ public class PngChunkUNKNOWN extends PngChunkMultiple { // unkown, custom or not
 	}
 
 	/* does not copy! */
-	public void setData(byte[] data) {
+	public void setData(final byte[] data) {
 		this.data = data;
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
+	public void cloneDataFromRead(final PngChunk other) {
 		// THIS SHOULD NOT BE CALLED IF ALREADY CLONED WITH COPY CONSTRUCTOR
-		PngChunkUNKNOWN c = (PngChunkUNKNOWN) other;
+		final PngChunkUNKNOWN c = (PngChunkUNKNOWN) other;
 		data = c.data; // not deep copy
 	}
 }
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java
index 64593ea..c1dfdeb 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngChunkZTXT.java
@@ -16,7 +16,7 @@ public class PngChunkZTXT extends PngChunkTextVar {
 	public final static String ID = ChunkHelper.zTXt;
 
 	// http://www.w3.org/TR/PNG/#11zTXt
-	public PngChunkZTXT(ImageInfo info) {
+	public PngChunkZTXT(final ImageInfo info) {
 		super(ID, info);
 	}
 
@@ -25,23 +25,23 @@ public class PngChunkZTXT extends PngChunkTextVar {
 		if (key.isEmpty())
 			throw new PngjException("Text chunk key must be non empty");
 		try {
-			ByteArrayOutputStream ba = new ByteArrayOutputStream();
+			final ByteArrayOutputStream ba = new ByteArrayOutputStream();
 			ba.write(key.getBytes(PngHelperInternal.charsetLatin1));
 			ba.write(0); // separator
 			ba.write(0); // compression method: 0
-			byte[] textbytes = ChunkHelper.compressBytes(val.getBytes(PngHelperInternal.charsetLatin1), true);
+			final byte[] textbytes = ChunkHelper.compressBytes(val.getBytes(PngHelperInternal.charsetLatin1), true);
 			ba.write(textbytes);
-			byte[] b = ba.toByteArray();
-			ChunkRaw chunk = createEmptyChunk(b.length, false);
+			final byte[] b = ba.toByteArray();
+			final ChunkRaw chunk = createEmptyChunk(b.length, false);
 			chunk.data = b;
 			return chunk;
-		} catch (IOException e) {
+		} catch (final IOException e) {
 			throw new PngjException(e);
 		}
 	}
 
 	@Override
-	public void parseFromRaw(ChunkRaw c) {
+	public void parseFromRaw(final ChunkRaw c) {
 		int nullsep = -1;
 		for (int i = 0; i < c.data.length; i++) { // look for first zero
 			if (c.data[i] != 0)
@@ -52,16 +52,16 @@ public class PngChunkZTXT extends PngChunkTextVar {
 		if (nullsep < 0 || nullsep > c.data.length - 2)
 			throw new PngjException("bad zTXt chunk: no separator found");
 		key = new String(c.data, 0, nullsep, PngHelperInternal.charsetLatin1);
-		int compmet = (int) c.data[nullsep + 1];
+		final int compmet = c.data[nullsep + 1];
 		if (compmet != 0)
 			throw new PngjException("bad zTXt chunk: unknown compression method");
-		byte[] uncomp = ChunkHelper.compressBytes(c.data, nullsep + 2, c.data.length - nullsep - 2, false); // uncompress
+		final byte[] uncomp = ChunkHelper.compressBytes(c.data, nullsep + 2, c.data.length - nullsep - 2, false); // uncompress
 		val = new String(uncomp, PngHelperInternal.charsetLatin1);
 	}
 
 	@Override
-	public void cloneDataFromRead(PngChunk other) {
-		PngChunkZTXT otherx = (PngChunkZTXT) other;
+	public void cloneDataFromRead(final PngChunk other) {
+		final PngChunkZTXT otherx = (PngChunkZTXT) other;
 		key = otherx.key;
 		val = otherx.val;
 	}
diff --git a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
index 1396034..bba2b3e 100644
--- a/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
+++ b/src/jogl/classes/jogamp/opengl/util/pngj/chunks/PngMetadata.java
@@ -19,7 +19,7 @@ public class PngMetadata {
 	private final ChunksList chunkList;
 	private final boolean readonly;
 
-	public PngMetadata(ChunksList chunks) {
+	public PngMetadata(final ChunksList chunks) {
 		this.chunkList = chunks;
 		if (chunks instanceof ChunksListForWrite) {
 			this.readonly = false;
@@ -35,14 +35,14 @@ public class PngMetadata {
 	 * and if so, overwrites it. However if that not check for already written
 	 * chunks.
 	 */
-	public void queueChunk(final PngChunk c, boolean lazyOverwrite) {
-		ChunksListForWrite cl = getChunkListW();
+	public void queueChunk(final PngChunk c, final boolean lazyOverwrite) {
+		final ChunksListForWrite cl = getChunkListW();
 		if (readonly)
 			throw new PngjException("cannot set chunk : readonly metadata");
 		if (lazyOverwrite) {
 			ChunkHelper.trimList(cl.getQueuedChunks(), new ChunkPredicate() {
 				@Override
-				public boolean match(PngChunk c2) {
+				public boolean match(final PngChunk c2) {
 					return ChunkHelper.equivalent(c, c2);
 				}
 			});
@@ -66,19 +66,19 @@ public class PngMetadata {
 	 * returns -1 if not found or dimension unknown
 	 */
 	public double[] getDpi() {
-		PngChunk c = chunkList.getById1(ChunkHelper.pHYs, true);
+		final PngChunk c = chunkList.getById1(ChunkHelper.pHYs, true);
 		if (c == null)
 			return new double[] { -1, -1 };
 		else
 			return ((PngChunkPHYS) c).getAsDpi2();
 	}
 
-	public void setDpi(double x) {
+	public void setDpi(final double x) {
 		setDpi(x, x);
 	}
 
-	public void setDpi(double x, double y) {
-		PngChunkPHYS c = new PngChunkPHYS(chunkList.imageInfo);
+	public void setDpi(final double x, final double y) {
+		final PngChunkPHYS c = new PngChunkPHYS(chunkList.imageInfo);
 		c.setAsDpi2(x, y);
 		queueChunk(c);
 	}
@@ -92,8 +92,8 @@ public class PngMetadata {
 	 * @return Returns the created-queued chunk, just in case you want to
 	 *         examine or modify it
 	 */
-	public PngChunkTIME setTimeNow(int secsAgo) {
-		PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
+	public PngChunkTIME setTimeNow(final int secsAgo) {
+		final PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
 		c.setNow(secsAgo);
 		queueChunk(c);
 		return c;
@@ -110,8 +110,8 @@ public class PngMetadata {
 	 * @return Returns the created-queued chunk, just in case you want to
 	 *         examine or modify it
 	 */
-	public PngChunkTIME setTimeYMDHMS(int yearx, int monx, int dayx, int hourx, int minx, int secx) {
-		PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
+	public PngChunkTIME setTimeYMDHMS(final int yearx, final int monx, final int dayx, final int hourx, final int minx, final int secx) {
+		final PngChunkTIME c = new PngChunkTIME(chunkList.imageInfo);
 		c.setYMDHMS(yearx, monx, dayx, hourx, minx, secx);
 		queueChunk(c, true);
 		return c;
@@ -125,7 +125,7 @@ public class PngMetadata {
 	}
 
 	public String getTimeAsString() {
-		PngChunkTIME c = getTime();
+		final PngChunkTIME c = getTime();
 		return c == null ? "" : c.getAsString();
 	}
 
@@ -144,7 +144,7 @@ public class PngMetadata {
 	 * @return Returns the created-queued chunks, just in case you want to
 	 *         examine, touch it
 	 */
-	public PngChunkTextVar setText(String k, String val, boolean useLatin1, boolean compress) {
+	public PngChunkTextVar setText(final String k, final String val, final boolean useLatin1, final boolean compress) {
 		if (compress && !useLatin1)
 			throw new PngjException("cannot compress non latin text");
 		PngChunkTextVar c;
@@ -163,7 +163,7 @@ public class PngMetadata {
 		return c;
 	}
 
-	public PngChunkTextVar setText(String k, String val) {
+	public PngChunkTextVar setText(final String k, final String val) {
 		return setText(k, val, false, false);
 	}
 
@@ -175,8 +175,9 @@ public class PngMetadata {
 	 * Warning: this does not check the "lang" key of iTxt
 	 */
 	@SuppressWarnings("unchecked")
-	public List<? extends PngChunkTextVar> getTxtsForKey(String k) {
+	public List<? extends PngChunkTextVar> getTxtsForKey(final String k) {
 		@SuppressWarnings("rawtypes")
+        final
 		List c = new ArrayList();
 		c.addAll(chunkList.getById(ChunkHelper.tEXt, k));
 		c.addAll(chunkList.getById(ChunkHelper.zTXt, k));
@@ -190,12 +191,12 @@ public class PngMetadata {
 	 * <p>
 	 * Use getTxtsForKey() if you don't want this behaviour
 	 */
-	public String getTxtForKey(String k) {
-		List<? extends PngChunkTextVar> li = getTxtsForKey(k);
+	public String getTxtForKey(final String k) {
+		final List<? extends PngChunkTextVar> li = getTxtsForKey(k);
 		if (li.isEmpty())
 			return "";
-		StringBuilder t = new StringBuilder();
-		for (PngChunkTextVar c : li)
+		final StringBuilder t = new StringBuilder();
+		for (final PngChunkTextVar c : li)
 			t.append(c.getVal()).append("\n");
 		return t.toString().trim();
 	}
@@ -214,7 +215,7 @@ public class PngMetadata {
 	 * the caller, who should fill its entries
 	 */
 	public PngChunkPLTE createPLTEChunk() {
-		PngChunkPLTE plte = new PngChunkPLTE(chunkList.imageInfo);
+		final PngChunkPLTE plte = new PngChunkPLTE(chunkList.imageInfo);
 		queueChunk(plte);
 		return plte;
 	}
@@ -233,7 +234,7 @@ public class PngMetadata {
 	 * caller, who should fill its entries
 	 */
 	public PngChunkTRNS createTRNSChunk() {
-		PngChunkTRNS trns = new PngChunkTRNS(chunkList.imageInfo);
+		final PngChunkTRNS trns = new PngChunkTRNS(chunkList.imageInfo);
 		queueChunk(trns);
 		return trns;
 	}
diff --git a/src/jogl/classes/jogamp/opengl/util/stereo/DistortionMesh.java b/src/jogl/classes/jogamp/opengl/util/stereo/DistortionMesh.java
new file mode 100644
index 0000000..7a24831
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/stereo/DistortionMesh.java
@@ -0,0 +1,95 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl.util.stereo;
+
+import com.jogamp.opengl.util.stereo.EyeParameter;
+
+public class DistortionMesh {
+    public static interface Producer {
+        /** Initialize */
+        void init(final GenericStereoDevice.Config deviceConfig, final float[] eyeReliefInMeters);
+
+        /** Distortion Mesh Producer */
+        DistortionMesh create(final EyeParameter eyeParam, final int distortionBits);
+    }
+    public static class DistortionVertex {
+        /** {@value} */
+        public static final int def_pos_size = 2;
+        /** {@value} */
+        public static final int def_vignetteFactor_size = 1;
+        /** {@value} */
+        public static final int def_timewarpFactor_size = 1;
+        /** {@value} */
+        public static final int def_texR_size = 2;
+        /** {@value} */
+        public static final int def_texG_size = 2;
+        /** {@value} */
+        public static final int def_texB_size = 2;
+
+        /** {@value} */
+        public static final int def_total_size = def_pos_size + def_vignetteFactor_size + def_timewarpFactor_size +
+                                                 def_texR_size + def_texG_size + def_texB_size;
+
+        public DistortionVertex(final float[] data, final int pos_size,
+                                final int vignetteFactor_size, final int timewarpFactor_size, final int texR_size,
+                                final int texG_size, final int texB_size) {
+            this.data = data;
+            this.pos_size = pos_size;
+            this.vignetteFactor_size = vignetteFactor_size;
+            this.timewarpFactor_size = timewarpFactor_size;
+            this.texR_size = texR_size;
+            this.texG_size = texG_size;
+            this.texB_size = texB_size;
+        }
+        final float[] data;
+
+        /** Usually {@link #def_pos_size} */
+        final int pos_size;
+        /** Usually {@link #def_vignetteFactor_size} */
+        final int vignetteFactor_size;
+        /** Usually {@link #def_timewarpFactor_size} */
+        final int timewarpFactor_size;
+        /** Usually {@link #def_texR_size} */
+        final int texR_size;
+        /** Usually {@link #def_texG_size} */
+        final int texG_size;
+        /** Usually {@link #def_texB_size} */
+        final int texB_size;
+    }
+    public DistortionMesh(final DistortionMesh.DistortionVertex[] vertices, final int vertexCount,
+                          final short[] indices, final int indexCount) {
+        this.vertices = vertices;
+        this.vertexCount = vertexCount;
+        this.indices = indices;
+        this.indexCount = indexCount;
+    }
+    final DistortionMesh.DistortionVertex[] vertices;
+    final int vertexCount;
+    final short[] indices;
+    final int indexCount;
+}
diff --git a/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDevice.java b/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDevice.java
new file mode 100644
index 0000000..36e8bc5
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDevice.java
@@ -0,0 +1,468 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl.util.stereo;
+
+import java.util.Arrays;
+
+import javax.media.nativewindow.util.Dimension;
+import javax.media.nativewindow.util.DimensionImmutable;
+import javax.media.nativewindow.util.Point;
+import javax.media.nativewindow.util.PointImmutable;
+import javax.media.nativewindow.util.Rectangle;
+import javax.media.nativewindow.util.RectangleImmutable;
+
+import com.jogamp.common.util.ReflectionUtil;
+import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.math.FovHVHalves;
+import com.jogamp.opengl.util.stereo.EyeParameter;
+import com.jogamp.opengl.util.stereo.StereoDevice;
+import com.jogamp.opengl.util.stereo.StereoDeviceFactory;
+import com.jogamp.opengl.util.stereo.StereoDeviceRenderer;
+import com.jogamp.opengl.util.stereo.StereoUtil;
+
+public class GenericStereoDevice implements StereoDevice {
+    public static enum ShutterType {
+        Global, RollingLeftToRight, RollingRightToLeft, RollingTopToBottom
+    }
+    public static class Config extends StereoDevice.Config {
+        public Config(final String name,
+                      final ShutterType shutterType,
+                      final DimensionImmutable surfaceSizeInPixels,
+                      final float[] screenSizeInMeters,
+                      final DimensionImmutable eyeTextureSize,
+                      final float pupilCenterFromScreenTopInMeters,
+                      final float interpupillaryDistanceInMeters,
+                      final int[] eyeRenderOrder,
+                      final EyeParameter[] defaultEyeParam,
+                      final DistortionMesh.Producer distortionMeshProducer,
+                      final int supportedDistortionBits,
+                      final int recommendedDistortionBits,
+                      final int minimumDistortionBits
+                      ) {
+            this.name = name;
+            this.shutterType = shutterType;
+            this.surfaceSizeInPixels = surfaceSizeInPixels;
+            this.screenSizeInMeters = screenSizeInMeters;
+            this.eyeTextureSize = eyeTextureSize;
+            this.pupilCenterFromScreenTopInMeters = pupilCenterFromScreenTopInMeters;
+            this.interpupillaryDistanceInMeters = interpupillaryDistanceInMeters;
+            this.eyeRenderOrder = eyeRenderOrder;
+            this.defaultEyeParam = defaultEyeParam;
+            this.distortionMeshProducer = distortionMeshProducer;
+            this.supportedDistortionBits = supportedDistortionBits;
+            this.recommendedDistortionBits = recommendedDistortionBits;
+            this.minimumDistortionBits = minimumDistortionBits;
+            this.pupilCenterFromTopLeft = new float[2][2];
+            calcPupilCenterFromTopLeft();
+        }
+        /** A variation w/ different surface/screen specs */
+        public Config(final Config source,
+                      final DimensionImmutable surfaceSizeInPixels,
+                      final float[] screenSizeInMeters,
+                      final DimensionImmutable eyeTextureSize) {
+            this.name = source.name;
+            this.shutterType = source.shutterType;
+            this.surfaceSizeInPixels = surfaceSizeInPixels;
+            this.screenSizeInMeters = screenSizeInMeters;
+            this.eyeTextureSize = eyeTextureSize;
+            this.pupilCenterFromScreenTopInMeters = source.pupilCenterFromScreenTopInMeters;
+            this.interpupillaryDistanceInMeters = source.interpupillaryDistanceInMeters;
+            this.eyeRenderOrder = source.eyeRenderOrder;
+            this.defaultEyeParam = source.defaultEyeParam;
+            this.distortionMeshProducer = source.distortionMeshProducer;
+            this.supportedDistortionBits = source.supportedDistortionBits;
+            this.recommendedDistortionBits = source.recommendedDistortionBits;
+            this.minimumDistortionBits = source.minimumDistortionBits;
+            this.pupilCenterFromTopLeft = new float[2][2];
+            calcPupilCenterFromTopLeft();
+        }
+        private void calcPupilCenterFromTopLeft() {
+            final float visibleWidthOfOneEye = 0.5f * screenSizeInMeters[0];
+            final float leftPupilCenterFromLeftInMeters = ( screenSizeInMeters[0] - interpupillaryDistanceInMeters ) * 0.5f;
+            final float rightPupilCenterFromMiddleInMeters = leftPupilCenterFromLeftInMeters + interpupillaryDistanceInMeters - visibleWidthOfOneEye;
+            pupilCenterFromTopLeft[0][0] = leftPupilCenterFromLeftInMeters / visibleWidthOfOneEye;
+            pupilCenterFromTopLeft[0][1] = pupilCenterFromScreenTopInMeters     / screenSizeInMeters[1];
+            pupilCenterFromTopLeft[1][0] = rightPupilCenterFromMiddleInMeters / visibleWidthOfOneEye;
+            pupilCenterFromTopLeft[1][1] =  pupilCenterFromTopLeft[0][1];
+        }
+
+        /**
+         * Return the vertical pupil center from the screen top in the range [0..1].
+         * @param screenHeightInMeters
+         * @param pupilCenterFromScreenTopInMeters
+         */
+        public static float getVertPupilCenterFromTop(final float screenHeightInMeters, final float pupilCenterFromScreenTopInMeters) {
+            return pupilCenterFromScreenTopInMeters / screenHeightInMeters;
+        }
+
+        /**
+         * Return the horizontal pupil center from the left side for both eyes in the range [0..1].
+         * <pre>
+            <-------------left eye------------->|                       |<-----------right eye-------------->
+            <------------------------------------screenSizeInMeters.Width----------------------------------->
+                                       <------interpupillaryDistanceInMeters------>
+            <--centerFromLeftInMeters->
+                                       ^
+                                 center of pupil
+         * </pre>
+         *
+         * @param screenWidthInMeters
+         * @param interpupillaryDistanceInMeters
+         */
+        public static float[] getHorizPupilCenterFromLeft(final float screenWidthInMeters, final float interpupillaryDistanceInMeters) {
+            final float visibleWidthOfOneEye = 0.5f * screenWidthInMeters;
+            final float leftPupilCenterFromLeftInMeters = ( screenWidthInMeters - interpupillaryDistanceInMeters ) * 0.5f;
+            final float rightPupilCenterFromMiddleInMeters = leftPupilCenterFromLeftInMeters + interpupillaryDistanceInMeters - visibleWidthOfOneEye;
+            return new float[] { leftPupilCenterFromLeftInMeters    / visibleWidthOfOneEye,
+                                 rightPupilCenterFromMiddleInMeters / visibleWidthOfOneEye };
+        }
+
+        void init() {
+            final float[] eyeReliefInMeters = new float[defaultEyeParam.length];
+            if( 0 < defaultEyeParam.length ) {
+                eyeReliefInMeters[0] = defaultEyeParam[0].eyeReliefZ;
+            }
+            if( 1 < defaultEyeParam.length ) {
+                eyeReliefInMeters[1] = defaultEyeParam[1].eyeReliefZ;
+            }
+            if( null != distortionMeshProducer ) {
+                distortionMeshProducer.init(this, eyeReliefInMeters);
+            }
+        }
+
+        @Override
+        public String toString() { return "StereoConfig["+name+", shutter "+shutterType+", surfaceSize "+surfaceSizeInPixels+
+                                   ", screenSize "+screenSizeInMeters[0]+" x "+screenSizeInMeters[0]+
+                                   " [m], eyeTexSize "+eyeTextureSize+", IPD "+interpupillaryDistanceInMeters+
+                                   " [m], eyeParam "+Arrays.toString(defaultEyeParam)+
+                                   ", distortionBits[supported ["+StereoUtil.distortionBitsToString(supportedDistortionBits)+
+                                                  "], recommended ["+StereoUtil.distortionBitsToString(recommendedDistortionBits)+
+                                                  "], minimum ["+StereoUtil.distortionBitsToString(minimumDistortionBits)+"]]]";
+        }
+
+        /** Configuration Name */
+        public final String name;
+        public final ShutterType shutterType;
+
+        public final DimensionImmutable surfaceSizeInPixels;
+        public final float[] screenSizeInMeters;
+        /** Texture size per eye */
+        public final DimensionImmutable eyeTextureSize;
+
+        /** Vertical distance from pupil to screen-top in meters */
+        public final float pupilCenterFromScreenTopInMeters;
+        /** Horizontal interpupillary distance (IPD) in meters */
+        public final float interpupillaryDistanceInMeters;
+        /**
+         * Pupil center from top left per eye, ranging from [0..1], maybe used to produce FovHVHalves,
+         * see {@link #getHorizPupilCenterFromLeft(float, float)} and {@link #getVertPupilCenterFromTop(float, float)}.
+         */
+        public final float[/*per-eye*/][/*xy*/] pupilCenterFromTopLeft;
+        public final int[] eyeRenderOrder;
+        public final EyeParameter[] defaultEyeParam;
+        public final DistortionMesh.Producer distortionMeshProducer;
+
+        public final int supportedDistortionBits;
+        public final int recommendedDistortionBits;
+        public final int minimumDistortionBits;
+    }
+
+    /** A mono view configuration, only one eye is supported */
+    public static final Config config01Mono01;
+
+    /** A default stereo SBS view configuration */
+    public static final Config config02StereoSBS01;
+
+    /** A default stereo SBS lense view configuration, utilizing similar settings as OculusVR DK1 */
+    public static final Config config03StereoSBSLense01;
+
+    private static final Config[] configs;
+
+    static {
+        final float[] DEFAULT_EYE_POSITION_OFFSET_STEREO_LENSES = { 0.0f, 1.6f, -5.0f };  // 1.6 up, 5 forward
+        final float[] DEFAULT_EYE_POSITION_OFFSET_STEREO        = { 0.0f, 0.3f,  3.0f };  // 0.3 up, 3 back
+        final float[] DEFAULT_EYE_POSITION_OFFSET_MONO          = { 0.0f, 0.0f,  3.0f };  //         3 back
+
+        final DimensionImmutable surfaceSizeInPixel = new Dimension(1280, 800);
+        final float[] screenSizeInMeters = new float[] { 0.1498f, 0.0936f };
+        final float interpupillaryDistanceInMeters = 0.0635f;
+        final float pupilCenterFromScreenTopInMeters = screenSizeInMeters[1] / 2f;
+        final float d2r = FloatUtil.PI / 180.0f;
+        {
+            config01Mono01 = new Config(
+                            "Def01Mono01",
+                            ShutterType.RollingTopToBottom,
+                            surfaceSizeInPixel,                // resolution
+                            screenSizeInMeters,                // screenSize [m]
+                            surfaceSizeInPixel,                // eye textureSize
+                            pupilCenterFromScreenTopInMeters,  // pupilCenterFromScreenTop [m]
+                            interpupillaryDistanceInMeters,    // IPD [m]
+                            new int[] { 0 },                   // eye order
+                            new EyeParameter[] {
+                                new EyeParameter(0, DEFAULT_EYE_POSITION_OFFSET_MONO,
+                                                 // degrees: 45/2 l, 45/2 r, 45/2 * aspect t, 45/2 * aspect b
+                                                 FovHVHalves.byFovyRadianAndAspect(45f*d2r, 1280f / 800f),
+                                                 0f /* distNoseToPupil */, 0f /* verticalDelta */, 0f /* eyeReliefInMeters */) },
+                            null, // mash producer distortion bits
+                            0,    // supported distortion bits
+                            0,    // recommended distortion bits
+                            0     // minimum distortion bits
+                            );
+        }
+
+        {
+            final DimensionImmutable eyeTextureSize = new Dimension(surfaceSizeInPixel.getWidth()/2, surfaceSizeInPixel.getHeight());
+            final float[] horizPupilCenterFromLeft = Config.getHorizPupilCenterFromLeft(screenSizeInMeters[0], interpupillaryDistanceInMeters);
+            final float vertPupilCenterFromTop = Config.getVertPupilCenterFromTop(screenSizeInMeters[1], pupilCenterFromScreenTopInMeters);
+            final float fovy = 45f;
+            final float aspect = (float)eyeTextureSize.getWidth() / (float)eyeTextureSize.getHeight();
+            final FovHVHalves defaultSBSEyeFovLeft = FovHVHalves.byFovyRadianAndAspect(fovy * d2r, vertPupilCenterFromTop, aspect, horizPupilCenterFromLeft[0]);
+            final FovHVHalves defaultSBSEyeFovRight = FovHVHalves.byFovyRadianAndAspect(fovy * d2r, vertPupilCenterFromTop, aspect, horizPupilCenterFromLeft[1]);
+
+            config02StereoSBS01 = new Config(
+                            "Def02StereoSBS01",
+                            ShutterType.RollingTopToBottom,
+                            surfaceSizeInPixel,                // resolution
+                            screenSizeInMeters,                // screenSize [m]
+                            eyeTextureSize,                    // eye textureSize
+                            pupilCenterFromScreenTopInMeters,  // pupilCenterFromScreenTop [m]
+                            interpupillaryDistanceInMeters,    // IPD [m]
+                            new int[] { 0, 1 },                // eye order
+                            new EyeParameter[] {
+                                new EyeParameter(0, DEFAULT_EYE_POSITION_OFFSET_STEREO, defaultSBSEyeFovLeft,
+                                              0.032f /* distNoseToPupil */, 0f /* verticalDelta */, 0.010f /* eyeReliefInMeters */),
+                                new EyeParameter(1, DEFAULT_EYE_POSITION_OFFSET_STEREO, defaultSBSEyeFovRight,
+                                             -0.032f /* distNoseToPupil */, 0f /* verticalDelta */, 0.010f /* eyeReliefInMeters */) },
+                            null,   // mash producer distortion bits
+                            0,      // supported distortion bits
+                            0,      // recommended distortion bits
+                            0       // minimum distortion bits
+                            );
+        }
+
+        {
+            DistortionMesh.Producer lenseDistMeshProduce = null;
+            try {
+                lenseDistMeshProduce =
+                    (DistortionMesh.Producer)
+                    ReflectionUtil.createInstance("jogamp.opengl.oculusvr.stereo.lense.DistortionMeshProducer", GenericStereoDevice.class.getClassLoader());
+            } catch (final Throwable t) {
+                if(StereoDevice.DEBUG) { System.err.println("Caught: "+t.getMessage()); t.printStackTrace(); }
+            }
+
+            final DimensionImmutable eyeTextureSize = new Dimension(1122, 1553);
+            final float[] horizPupilCenterFromLeft = Config.getHorizPupilCenterFromLeft(screenSizeInMeters[0], interpupillaryDistanceInMeters);
+            final float vertPupilCenterFromTop = Config.getVertPupilCenterFromTop(screenSizeInMeters[1], pupilCenterFromScreenTopInMeters);
+            final float fovy = 129f;
+            final float aspect = (float)eyeTextureSize.getWidth() / (float)eyeTextureSize.getHeight();
+            final FovHVHalves defaultSBSEyeFovLenseLeft = FovHVHalves.byFovyRadianAndAspect(fovy * d2r, vertPupilCenterFromTop, aspect, horizPupilCenterFromLeft[0]);
+            final FovHVHalves defaultSBSEyeFovLenseRight = FovHVHalves.byFovyRadianAndAspect(fovy * d2r, vertPupilCenterFromTop, aspect, horizPupilCenterFromLeft[1]);
+
+            config03StereoSBSLense01 = null == lenseDistMeshProduce ? null :
+                           new Config(
+                            "Def03StereoSBSLense01",
+                            ShutterType.RollingTopToBottom,
+                            surfaceSizeInPixel,                // resolution
+                            screenSizeInMeters,                // screenSize [m]
+                            eyeTextureSize,                    // eye textureSize
+                            pupilCenterFromScreenTopInMeters,  // pupilCenterFromScreenTop [m]
+                            interpupillaryDistanceInMeters,    // IPD [m]
+                            new int[] { 0, 1 },                // eye order
+                            new EyeParameter[] {
+                                new EyeParameter(0, DEFAULT_EYE_POSITION_OFFSET_STEREO_LENSES, defaultSBSEyeFovLenseLeft,
+                                              0.032f /* distNoseToPupil */, 0f /* verticalDelta */, 0.010f /* eyeReliefInMeters */),
+                                new EyeParameter(1, DEFAULT_EYE_POSITION_OFFSET_STEREO_LENSES, defaultSBSEyeFovLenseRight,
+                                             -0.032f /* distNoseToPupil */, 0f /* verticalDelta */, 0.010f /* eyeReliefInMeters */) },
+                            lenseDistMeshProduce,
+                            // supported distortion bits
+                            StereoDeviceRenderer.DISTORTION_BARREL | StereoDeviceRenderer.DISTORTION_CHROMATIC | StereoDeviceRenderer.DISTORTION_VIGNETTE,
+                            // recommended distortion bits
+                            StereoDeviceRenderer.DISTORTION_BARREL | StereoDeviceRenderer.DISTORTION_CHROMATIC | StereoDeviceRenderer.DISTORTION_VIGNETTE,
+                            // minimum distortion bits
+                            StereoDeviceRenderer.DISTORTION_BARREL
+                            );
+        }
+        configs = new Config[] { config01Mono01, config02StereoSBS01, config03StereoSBSLense01 };
+    }
+
+    private final StereoDeviceFactory factory;
+    public final int deviceIndex;
+    public final Config config;
+
+    public final Point surfacePos;
+    private final FovHVHalves[] defaultEyeFov;
+
+    private boolean sensorsStarted = false;
+
+    public GenericStereoDevice(final StereoDeviceFactory factory, final int deviceIndex, final StereoDevice.Config customConfig) {
+        this.factory = factory;
+        this.deviceIndex = deviceIndex;
+
+        if( customConfig instanceof GenericStereoDevice.Config) {
+            this.config = (GenericStereoDevice.Config) customConfig;
+        } else {
+            final int cfgIdx = Math.min(deviceIndex % 10, configs.length-1);
+            this.config = null != configs[cfgIdx] ? configs[cfgIdx] : config02StereoSBS01;
+        }
+        config.init();
+
+        this.surfacePos = new Point(0, 0);
+
+        defaultEyeFov = new FovHVHalves[config.defaultEyeParam.length];
+        for(int i=0; i<defaultEyeFov.length; i++) {
+            defaultEyeFov[i] = config.defaultEyeParam[i].fovhv;
+        }
+    }
+
+    @Override
+    public final StereoDeviceFactory getFactory() { return factory; }
+
+    @Override
+    public String toString() {
+        return "GenericStereoDevice["+config+", surfacePos "+surfacePos+"]";
+    }
+
+    public void setSurfacePosition(final int x, final int y) {
+        surfacePos.set(x, y);
+    }
+
+    @Override
+    public final void dispose() {
+        // NOP
+    }
+
+    @Override
+    public final PointImmutable getPosition() {
+        return surfacePos;
+    }
+
+    @Override
+    public final DimensionImmutable getSurfaceSize() {
+        return config.surfaceSizeInPixels;
+    }
+
+    @Override
+    public float[] getDefaultEyePositionOffset() {
+        return config.defaultEyeParam[0].positionOffset;
+    }
+
+    @Override
+    public final FovHVHalves[] getDefaultFOV() {
+        return defaultEyeFov;
+    }
+
+    @Override
+    public final boolean startSensors(final boolean start) {
+        if( start && !sensorsStarted ) {
+            if( startSensorsImpl(true) ) {
+                sensorsStarted = true;
+                return true;
+            } else {
+                sensorsStarted = false;
+                return false;
+            }
+        } else if( sensorsStarted ) {
+            if( startSensorsImpl(false) ) {
+                sensorsStarted = false;
+                return true;
+            } else {
+                sensorsStarted = true;
+                return false;
+            }
+        } else {
+            // No state change -> Success
+            return true;
+        }
+    }
+    private boolean startSensorsImpl(final boolean start) { return start; }
+
+    @Override
+    public boolean getSensorsStarted() { return sensorsStarted; }
+
+    @Override
+    public int[] getEyeRenderOrder() { return config.eyeRenderOrder; }
+
+    @Override
+    public int getSupportedDistortionBits() {
+        return config.supportedDistortionBits;
+    };
+
+    @Override
+    public int getRecommendedDistortionBits() {
+        return config.recommendedDistortionBits;
+    }
+
+    @Override
+    public int getMinimumDistortionBits() {
+        return config.minimumDistortionBits;
+    }
+
+    @Override
+    public final StereoDeviceRenderer createRenderer(final int distortionBits,
+                                                     final int textureCount, final float[] eyePositionOffset,
+                                                     final FovHVHalves[] eyeFov, final float pixelsPerDisplayPixel, final int textureUnit) {
+       final EyeParameter[] eyeParam = new EyeParameter[eyeFov.length];
+       for(int i=0; i<eyeParam.length; i++) {
+           final EyeParameter defaultEyeParam = config.defaultEyeParam[i];
+           eyeParam[i] = new EyeParameter(i, eyePositionOffset, eyeFov[i],
+                                          defaultEyeParam.distNoseToPupilX, defaultEyeParam.distMiddleToPupilY, defaultEyeParam.eyeReliefZ);
+       }
+
+       final boolean usePP = null != config.distortionMeshProducer && 0 != distortionBits; // use post-processing
+
+       final RectangleImmutable[] eyeViewports = new RectangleImmutable[eyeParam.length];
+       final DimensionImmutable eyeTextureSize = config.eyeTextureSize;
+       final DimensionImmutable totalTextureSize;
+       if( 1 < eyeParam.length ) {
+           // Stereo SBS
+           totalTextureSize = new Dimension(eyeTextureSize.getWidth()*2, eyeTextureSize.getHeight());
+
+           if( 1 == textureCount ) { // validated in ctor below!
+               eyeViewports[0] = new Rectangle(0, 0,
+                                               eyeTextureSize.getWidth(), eyeTextureSize.getHeight());
+
+               eyeViewports[1] = new Rectangle(eyeTextureSize.getWidth(), 0,
+                                               eyeTextureSize.getWidth(), eyeTextureSize.getHeight());
+           } else {
+               eyeViewports[0] = new Rectangle(0, 0, eyeTextureSize.getWidth(), eyeTextureSize.getHeight());
+               if( usePP ) {
+                   eyeViewports[1] = eyeViewports[0];
+               } else {
+                   eyeViewports[1] = new Rectangle(eyeTextureSize.getWidth(), 0,
+                                                   eyeTextureSize.getWidth(), eyeTextureSize.getHeight());
+               }
+           }
+       } else {
+           // Mono
+           totalTextureSize = eyeTextureSize;
+           eyeViewports[0] = new Rectangle(0, 0, eyeTextureSize.getWidth(), eyeTextureSize.getHeight());
+       }
+       return new GenericStereoDeviceRenderer(this, distortionBits, textureCount, eyePositionOffset, eyeParam, pixelsPerDisplayPixel, textureUnit,
+                                              eyeTextureSize, totalTextureSize, eyeViewports);
+    }
+}
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDeviceFactory.java b/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDeviceFactory.java
new file mode 100644
index 0000000..f2fa747
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDeviceFactory.java
@@ -0,0 +1,43 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl.util.stereo;
+
+import com.jogamp.opengl.util.stereo.StereoDevice;
+import com.jogamp.opengl.util.stereo.StereoDeviceFactory;
+
+public class GenericStereoDeviceFactory extends StereoDeviceFactory {
+
+    public static boolean isAvailable() {
+        return true;
+    }
+
+    @Override
+    public final StereoDevice createDevice(final int deviceIndex, final StereoDevice.Config config, final boolean verbose) {
+        return new GenericStereoDevice(this, deviceIndex, config);
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDeviceRenderer.java b/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDeviceRenderer.java
new file mode 100644
index 0000000..d957bd4
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/stereo/GenericStereoDeviceRenderer.java
@@ -0,0 +1,605 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl.util.stereo;
+
+import java.nio.FloatBuffer;
+import java.nio.ShortBuffer;
+
+import javax.media.nativewindow.util.Dimension;
+import javax.media.nativewindow.util.DimensionImmutable;
+import javax.media.nativewindow.util.RectangleImmutable;
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GLArrayData;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLUniformData;
+
+import jogamp.common.os.PlatformPropsImpl;
+
+import com.jogamp.common.nio.Buffers;
+import com.jogamp.common.os.Platform;
+import com.jogamp.opengl.JoglVersion;
+import com.jogamp.opengl.util.GLArrayDataServer;
+import com.jogamp.opengl.util.glsl.ShaderCode;
+import com.jogamp.opengl.util.glsl.ShaderProgram;
+import com.jogamp.opengl.util.stereo.EyeParameter;
+import com.jogamp.opengl.util.stereo.EyePose;
+import com.jogamp.opengl.util.stereo.StereoDevice;
+import com.jogamp.opengl.util.stereo.StereoDeviceRenderer;
+import com.jogamp.opengl.util.stereo.StereoUtil;
+
+/**
+ * Generic Stereo Device Distortion and OpenGL Renderer Utility
+ */
+public class GenericStereoDeviceRenderer implements StereoDeviceRenderer {
+    private static final String shaderPrefix01 = "dist01";
+    private static final String shaderTimewarpSuffix = "_timewarp";
+    private static final String shaderChromaSuffix = "_chroma";
+    private static final String shaderPlainSuffix = "_plain";
+
+    public static class GenericEye implements StereoDeviceRenderer.Eye {
+        private final int eyeName;
+        private final int distortionBits;
+        private final int vertexCount;
+        private final int indexCount;
+        private final RectangleImmutable viewport;
+
+        private final GLUniformData eyeToSourceUVScale;
+        private final GLUniformData eyeToSourceUVOffset;
+        private final GLUniformData eyeRotationStart;
+        private final GLUniformData eyeRotationEnd;
+
+        /** 2+2+2+2+2: { vec2 position, vec2 color, vec2 texCoordR, vec2 texCoordG, vec2 texCoordB } */
+        private final GLArrayDataServer iVBO;
+        private final GLArrayData vboPos, vboParams, vboTexCoordsR, vboTexCoordsG, vboTexCoordsB;
+        private final GLArrayDataServer indices;
+
+        private final EyeParameter eyeParameter;
+
+        private final EyePose eyePose;
+
+        @Override
+        public final RectangleImmutable getViewport() { return viewport; }
+
+        @Override
+        public final EyeParameter getEyeParameter() { return eyeParameter; }
+
+        @Override
+        public final EyePose getLastEyePose() { return eyePose; }
+
+        private GenericEye(final GenericStereoDevice device, final int distortionBits,
+                         final float[] eyePositionOffset, final EyeParameter eyeParam,
+                         final DimensionImmutable textureSize, final RectangleImmutable eyeViewport) {
+            this.eyeName = eyeParam.number;
+            this.distortionBits = distortionBits;
+            this.viewport = eyeViewport;
+
+            final boolean usePP = null != device.config.distortionMeshProducer && 0 != distortionBits;
+
+            final boolean usesTimewarp = usePP && StereoUtil.usesTimewarpDistortion(distortionBits);
+            final FloatBuffer fstash = Buffers.newDirectFloatBuffer( 2 + 2 + ( usesTimewarp ? 16 + 16 : 0 ) ) ;
+
+            if( usePP ) {
+                eyeToSourceUVScale = new GLUniformData("svr_EyeToSourceUVScale", 2, Buffers.slice2Float(fstash, 0, 2));
+                eyeToSourceUVOffset = new GLUniformData("svr_EyeToSourceUVOffset", 2, Buffers.slice2Float(fstash, 2, 2));
+            } else {
+                eyeToSourceUVScale = null;
+                eyeToSourceUVOffset = null;
+            }
+
+            if( usesTimewarp ) {
+                eyeRotationStart = new GLUniformData("svr_EyeRotationStart", 4, 4, Buffers.slice2Float(fstash, 4, 16));
+                eyeRotationEnd = new GLUniformData("svr_EyeRotationEnd", 4, 4, Buffers.slice2Float(fstash, 20, 16));
+            } else {
+                eyeRotationStart = null;
+                eyeRotationEnd = null;
+            }
+
+            this.eyeParameter = eyeParam;
+
+            this.eyePose = new EyePose(eyeName);
+
+            updateEyePose(device); // 1st init
+
+            // Setup: eyeToSourceUVScale, eyeToSourceUVOffset
+            if( usePP ) {
+                final ScaleAndOffset2D textureScaleAndOffset = new ScaleAndOffset2D(eyeParam.fovhv, textureSize, eyeViewport);
+                if( StereoDevice.DEBUG ) {
+                    System.err.println("XXX."+eyeName+": eyeParam      "+eyeParam);
+                    System.err.println("XXX."+eyeName+": uvScaleOffset "+textureScaleAndOffset);
+                    System.err.println("XXX."+eyeName+": textureSize   "+textureSize);
+                    System.err.println("XXX."+eyeName+": viewport      "+eyeViewport);
+                }
+                final FloatBuffer eyeToSourceUVScaleFB = eyeToSourceUVScale.floatBufferValue();
+                eyeToSourceUVScaleFB.put(0, textureScaleAndOffset.scale[0]);
+                eyeToSourceUVScaleFB.put(1, textureScaleAndOffset.scale[1]);
+                final FloatBuffer eyeToSourceUVOffsetFB = eyeToSourceUVOffset.floatBufferValue();
+                eyeToSourceUVOffsetFB.put(0, textureScaleAndOffset.offset[0]);
+                eyeToSourceUVOffsetFB.put(1, textureScaleAndOffset.offset[1]);
+            } else {
+                vertexCount = 0;
+                indexCount = 0;
+                iVBO = null;
+                vboPos = null;
+                vboParams = null;
+                vboTexCoordsR = null;
+                vboTexCoordsG = null;
+                vboTexCoordsB = null;
+                indices = null;
+                if( StereoDevice.DEBUG ) {
+                    System.err.println("XXX."+eyeName+": "+this);
+                }
+                return;
+            }
+            final DistortionMesh meshData = device.config.distortionMeshProducer.create(eyeParam, distortionBits);
+            if( null == meshData ) {
+                throw new GLException("Failed to create meshData for eye "+eyeParam+", and "+StereoUtil.distortionBitsToString(distortionBits));
+            }
+
+            vertexCount = meshData.vertexCount;
+            indexCount = meshData.indexCount;
+
+            /** 2+2+2+2+2: { vec2 position, vec2 color, vec2 texCoordR, vec2 texCoordG, vec2 texCoordB } */
+            final boolean useChromatic = StereoUtil.usesChromaticDistortion(distortionBits);
+            final boolean useVignette = StereoUtil.usesVignetteDistortion(distortionBits);
+
+            final int compsPerElement = 2+2+2+( useChromatic ? 2+2 /* texCoordG + texCoordB */: 0 );
+            iVBO = GLArrayDataServer.createGLSLInterleaved(compsPerElement, GL.GL_FLOAT, false, vertexCount, GL.GL_STATIC_DRAW);
+            vboPos = iVBO.addGLSLSubArray("svr_Position", 2, GL.GL_ARRAY_BUFFER);
+            vboParams = iVBO.addGLSLSubArray("svr_Params", 2, GL.GL_ARRAY_BUFFER);
+            vboTexCoordsR = iVBO.addGLSLSubArray("svr_TexCoordR", 2, GL.GL_ARRAY_BUFFER);
+            if( useChromatic ) {
+                vboTexCoordsG = iVBO.addGLSLSubArray("svr_TexCoordG", 2, GL.GL_ARRAY_BUFFER);
+                vboTexCoordsB = iVBO.addGLSLSubArray("svr_TexCoordB", 2, GL.GL_ARRAY_BUFFER);
+            } else {
+                vboTexCoordsG = null;
+                vboTexCoordsB = null;
+            }
+            indices = GLArrayDataServer.createData(1, GL.GL_SHORT, indexCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+
+            /** 2+2+2+2+2: { vec2 position, vec2 color, vec2 texCoordR, vec2 texCoordG, vec2 texCoordB } */
+            final FloatBuffer iVBOFB = (FloatBuffer)iVBO.getBuffer();
+
+            for ( int vertNum = 0; vertNum < vertexCount; vertNum++ ) {
+                final DistortionMesh.DistortionVertex v = meshData.vertices[vertNum];
+                int dataIdx = 0;
+
+                if( StereoDevice.DUMP_DATA ) {
+                    System.err.println("XXX."+eyeName+": START VERTEX "+vertNum+" / "+vertexCount);
+                }
+                // pos
+                if( v.pos_size >= 2 ) {
+                    if( StereoDevice.DUMP_DATA ) {
+                        System.err.println("XXX."+eyeName+": pos ["+v.data[dataIdx]+", "+v.data[dataIdx+1]+"]");
+                    }
+                    iVBOFB.put(v.data[dataIdx]);
+                    iVBOFB.put(v.data[dataIdx+1]);
+                } else {
+                    iVBOFB.put(0f);
+                    iVBOFB.put(0f);
+                }
+                dataIdx += v.pos_size;
+
+                // params
+                if( v.vignetteFactor_size >= 1 && useVignette ) {
+                    if( StereoDevice.DUMP_DATA ) {
+                        System.err.println("XXX."+eyeName+": vignette "+v.data[dataIdx]);
+                    }
+                    iVBOFB.put(v.data[dataIdx]);
+                } else {
+                    iVBOFB.put(1.0f);
+                }
+                dataIdx += v.vignetteFactor_size;
+
+                if( v.timewarpFactor_size >= 1 ) {
+                    if( StereoDevice.DUMP_DATA ) {
+                        System.err.println("XXX."+eyeName+": timewarp "+v.data[dataIdx]);
+                    }
+                    iVBOFB.put(v.data[dataIdx]);
+                } else {
+                    iVBOFB.put(1.0f);
+                }
+                dataIdx += v.timewarpFactor_size;
+
+                // texCoordR
+                if( v.texR_size >= 2 ) {
+                    if( StereoDevice.DUMP_DATA ) {
+                        System.err.println("XXX."+eyeName+": texR ["+v.data[dataIdx]+", "+v.data[dataIdx+1]+"]");
+                    }
+                    iVBOFB.put(v.data[dataIdx]);
+                    iVBOFB.put(v.data[dataIdx+1]);
+                } else {
+                    iVBOFB.put(1f);
+                    iVBOFB.put(1f);
+                }
+                dataIdx += v.texR_size;
+
+                if( useChromatic ) {
+                    // texCoordG
+                    if( v.texG_size >= 2 ) {
+                        if( StereoDevice.DUMP_DATA ) {
+                            System.err.println("XXX."+eyeName+": texG ["+v.data[dataIdx]+", "+v.data[dataIdx+1]+"]");
+                        }
+                        iVBOFB.put(v.data[dataIdx]);
+                        iVBOFB.put(v.data[dataIdx+1]);
+                    } else {
+                        iVBOFB.put(1f);
+                        iVBOFB.put(1f);
+                    }
+                    dataIdx += v.texG_size;
+
+                    // texCoordB
+                    if( v.texB_size >= 2 ) {
+                        if( StereoDevice.DUMP_DATA ) {
+                            System.err.println("XXX."+eyeName+": texB ["+v.data[dataIdx]+", "+v.data[dataIdx+1]+"]");
+                        }
+                        iVBOFB.put(v.data[dataIdx]);
+                        iVBOFB.put(v.data[dataIdx+1]);
+                    } else {
+                        iVBOFB.put(1f);
+                        iVBOFB.put(1f);
+                    }
+                    dataIdx += v.texB_size;
+                } else {
+                    dataIdx += v.texG_size;
+                    dataIdx += v.texB_size;
+                }
+            }
+            if( StereoDevice.DUMP_DATA ) {
+                System.err.println("XXX."+eyeName+": iVBO "+iVBO);
+            }
+            {
+                if( StereoDevice.DUMP_DATA ) {
+                    System.err.println("XXX."+eyeName+": idx "+indices+", count "+indexCount);
+                    for(int i=0; i< indexCount; i++) {
+                        if( 0 == i % 16 ) {
+                            System.err.printf("%n%5d: ", i);
+                        }
+                        System.err.printf("%5d, ", (int)meshData.indices[i]);
+                    }
+                    System.err.println();
+                }
+                final ShortBuffer out = (ShortBuffer) indices.getBuffer();
+                out.put(meshData.indices, 0, meshData.indexCount);
+            }
+            if( StereoDevice.DEBUG ) {
+                System.err.println("XXX."+eyeName+": "+this);
+            }
+        }
+
+        private void linkData(final GL2ES2 gl, final ShaderProgram sp) {
+            if( null == iVBO ) return;
+
+            if( 0 > vboPos.setLocation(gl, sp.program()) ) {
+                throw new GLException("Couldn't locate "+vboPos);
+            }
+            if( 0 > vboParams.setLocation(gl, sp.program()) ) {
+                throw new GLException("Couldn't locate "+vboParams);
+            }
+            if( 0 > vboTexCoordsR.setLocation(gl, sp.program()) ) {
+                throw new GLException("Couldn't locate "+vboTexCoordsR);
+            }
+            if( StereoUtil.usesChromaticDistortion(distortionBits) ) {
+                if( 0 > vboTexCoordsG.setLocation(gl, sp.program()) ) {
+                    throw new GLException("Couldn't locate "+vboTexCoordsG);
+                }
+                if( 0 > vboTexCoordsB.setLocation(gl, sp.program()) ) {
+                    throw new GLException("Couldn't locate "+vboTexCoordsB);
+                }
+            }
+            if( 0 > eyeToSourceUVScale.setLocation(gl, sp.program()) ) {
+                throw new GLException("Couldn't locate "+eyeToSourceUVScale);
+            }
+            if( 0 > eyeToSourceUVOffset.setLocation(gl, sp.program()) ) {
+                throw new GLException("Couldn't locate "+eyeToSourceUVOffset);
+            }
+            if( StereoUtil.usesTimewarpDistortion(distortionBits) ) {
+                if( 0 > eyeRotationStart.setLocation(gl, sp.program()) ) {
+                    throw new GLException("Couldn't locate "+eyeRotationStart);
+                }
+                if( 0 > eyeRotationEnd.setLocation(gl, sp.program()) ) {
+                    throw new GLException("Couldn't locate "+eyeRotationEnd);
+                }
+            }
+            iVBO.seal(gl, true);
+            iVBO.enableBuffer(gl, false);
+            indices.seal(gl, true);
+            indices.enableBuffer(gl, false);
+        }
+
+        private void dispose(final GL2ES2 gl) {
+            if( null == iVBO ) return;
+            iVBO.destroy(gl);
+            indices.destroy(gl);
+        }
+        private void enableVBO(final GL2ES2 gl, final boolean enable) {
+            if( null == iVBO ) return;
+            iVBO.enableBuffer(gl, enable);
+            indices.bindBuffer(gl, enable); // keeps VBO binding if enable:=true
+        }
+
+        private void updateUniform(final GL2ES2 gl, final ShaderProgram sp) {
+            if( null == iVBO ) return;
+            gl.glUniform(eyeToSourceUVScale);
+            gl.glUniform(eyeToSourceUVOffset);
+            if( StereoUtil.usesTimewarpDistortion(distortionBits) ) {
+                gl.glUniform(eyeRotationStart);
+                gl.glUniform(eyeRotationEnd);
+            }
+        }
+
+        /**
+         * Updates {@link #ovrEyePose} and it's extracted
+         * {@link #eyeRenderPoseOrientation} and {@link #eyeRenderPosePosition}.
+         * @param hmdCtx used get the {@link #ovrEyePose} via {@link OVR#ovrHmd_GetEyePose(OvrHmdContext, int)}
+         */
+        private EyePose updateEyePose(final GenericStereoDevice hmdCtx) {
+            return eyePose;
+        }
+
+        @Override
+        public String toString() {
+            final String ppTxt = null == iVBO ? ", no post-processing" :
+                        ", uvScale["+eyeToSourceUVScale.floatBufferValue().get(0)+", "+eyeToSourceUVScale.floatBufferValue().get(1)+
+                        "], uvOffset["+eyeToSourceUVOffset.floatBufferValue().get(0)+", "+eyeToSourceUVOffset.floatBufferValue().get(1)+"]";
+
+            return "Eye["+eyeName+", viewport "+viewport+
+                        ", "+eyeParameter+
+                        ", vertices "+vertexCount+", indices "+indexCount+
+                        ppTxt+
+                        ", desc"+eyeParameter+", "+eyePose+"]";
+        }
+    }
+
+    private final GenericStereoDevice device;
+    private final GenericEye[] eyes;
+    private final int distortionBits;
+    private final int textureCount;
+    private final DimensionImmutable singleTextureSize;
+    private final DimensionImmutable totalTextureSize;
+    /** if texUnit0 is null: no post-processing */
+    private final GLUniformData texUnit0;
+
+    private ShaderProgram sp;
+    private long frameStart = 0;
+
+    @Override
+    public String toString() {
+        return "GenericStereo[distortion["+StereoUtil.distortionBitsToString(distortionBits)+
+                             "], singleSize "+singleTextureSize+
+                             ", sbsSize "+totalTextureSize+
+                             ", texCount "+textureCount+", texUnit "+(null != texUnit0 ? texUnit0.intValue() : "n/a")+
+                             ", "+PlatformPropsImpl.NEWLINE+"  "+(0 < eyes.length ? eyes[0] : "none")+
+                             ", "+PlatformPropsImpl.NEWLINE+"  "+(1 < eyes.length ? eyes[1] : "none")+"]";
+    }
+
+
+    private static final DimensionImmutable zeroSize = new Dimension(0, 0);
+
+    /* pp */ GenericStereoDeviceRenderer(final GenericStereoDevice context, final int distortionBits,
+                                       final int textureCount, final float[] eyePositionOffset,
+                                       final EyeParameter[] eyeParam, final float pixelsPerDisplayPixel, final int textureUnit,
+                                       final DimensionImmutable singleTextureSize, final DimensionImmutable totalTextureSize,
+                                       final RectangleImmutable[] eyeViewports) {
+        this.device = context;
+        this.eyes = new GenericEye[eyeParam.length];
+        this.distortionBits = ( distortionBits | context.getMinimumDistortionBits() ) & context.getSupportedDistortionBits();
+        final boolean usePP = null != device.config.distortionMeshProducer && 0 != this.distortionBits;
+        final DimensionImmutable textureSize;
+
+        if( usePP ) {
+            if( 1 > textureCount || 2 < textureCount ) {
+                this.textureCount = 2;
+            } else {
+                this.textureCount = textureCount;
+            }
+            this.singleTextureSize = singleTextureSize;
+            this.totalTextureSize = totalTextureSize;
+            textureSize = 1 == textureCount ? totalTextureSize : singleTextureSize;
+            texUnit0 = new GLUniformData("svr_Texture0", textureUnit);
+        } else {
+            this.textureCount = 0;
+            this.singleTextureSize = zeroSize;
+            this.totalTextureSize = zeroSize;
+            textureSize = zeroSize;
+            texUnit0 = null;
+        }
+        for(int i=0; i<eyeParam.length; i++) {
+            eyes[i] = new GenericEye(context, this.distortionBits, eyePositionOffset, eyeParam[i], textureSize, eyeViewports[i]);
+        }
+        sp = null;
+    }
+
+    @Override
+    public StereoDevice getDevice() {  return device; }
+
+    @Override
+    public final int getDistortionBits() { return distortionBits; }
+
+    @Override
+    public final boolean usesSideBySideStereo() { return true; }
+
+    @Override
+    public final DimensionImmutable getSingleSurfaceSize() { return singleTextureSize; }
+
+    @Override
+    public final DimensionImmutable getTotalSurfaceSize() { return totalTextureSize; }
+
+    @Override
+    public final int getTextureCount() { return textureCount; }
+
+    @Override
+    public final int getTextureUnit() { return ppAvailable() ? texUnit0.intValue() : 0; }
+
+    @Override
+    public final boolean ppAvailable() { return null != texUnit0; }
+
+    @Override
+    public final void init(final GL gl) {
+        if( StereoDevice.DEBUG ) {
+            System.err.println(JoglVersion.getGLInfo(gl, null).toString());
+        }
+        if( null != sp ) {
+            throw new IllegalStateException("Already initialized");
+        }
+        if( !ppAvailable() ) {
+            return;
+        }
+        final GL2ES2 gl2es2 = gl.getGL2ES2();
+
+        final String vertexShaderBasename;
+        final String fragmentShaderBasename;
+        {
+            final boolean usesTimewarp = StereoUtil.usesTimewarpDistortion(distortionBits);
+            final boolean usesChromatic = StereoUtil.usesChromaticDistortion(distortionBits);
+
+            final StringBuilder sb = new StringBuilder();
+            sb.append(shaderPrefix01);
+            if( !usesChromatic && !usesTimewarp ) {
+                sb.append(shaderPlainSuffix);
+            } else if( usesChromatic && !usesTimewarp ) {
+                sb.append(shaderChromaSuffix);
+            } else if( usesTimewarp ) {
+                sb.append(shaderTimewarpSuffix);
+                if( usesChromatic ) {
+                    sb.append(shaderChromaSuffix);
+                }
+            }
+            vertexShaderBasename = sb.toString();
+            sb.setLength(0);
+            sb.append(shaderPrefix01);
+            if( usesChromatic ) {
+                sb.append(shaderChromaSuffix);
+            } else {
+                sb.append(shaderPlainSuffix);
+            }
+            fragmentShaderBasename = sb.toString();
+        }
+        final ShaderCode vp0 = ShaderCode.create(gl2es2, GL2ES2.GL_VERTEX_SHADER, GenericStereoDeviceRenderer.class, "shader",
+                "shader/bin", vertexShaderBasename, true);
+        final ShaderCode fp0 = ShaderCode.create(gl2es2, GL2ES2.GL_FRAGMENT_SHADER, GenericStereoDeviceRenderer.class, "shader",
+                "shader/bin", fragmentShaderBasename, true);
+        vp0.defaultShaderCustomization(gl2es2, true, true);
+        fp0.defaultShaderCustomization(gl2es2, true, true);
+
+        sp = new ShaderProgram();
+        sp.add(gl2es2, vp0, System.err);
+        sp.add(gl2es2, fp0, System.err);
+        if(!sp.link(gl2es2, System.err)) {
+            throw new GLException("could not link program: "+sp);
+        }
+        sp.useProgram(gl2es2, true);
+        if( 0 > texUnit0.setLocation(gl2es2, sp.program()) ) {
+            throw new GLException("Couldn't locate "+texUnit0);
+        }
+        for(int i=0; i<eyes.length; i++) {
+            eyes[i].linkData(gl2es2, sp);
+        }
+        sp.useProgram(gl2es2, false);
+    }
+
+    @Override
+    public final void dispose(final GL gl) {
+        final GL2ES2 gl2es2 = gl.getGL2ES2();
+        if( null != sp ) {
+            sp.useProgram(gl2es2, false);
+        }
+        for(int i=0; i<eyes.length; i++) {
+            eyes[i].dispose(gl2es2);
+        }
+        if( null != sp ) {
+            sp.destroy(gl2es2);
+        }
+    }
+
+    @Override
+    public final Eye getEye(final int eyeNum) {
+        return eyes[eyeNum];
+    }
+
+    @Override
+    public final EyePose updateEyePose(final int eyeNum) {
+        return eyes[eyeNum].updateEyePose(device);
+    }
+
+    @Override
+    public final void beginFrame(final GL gl) {
+        frameStart = Platform.currentTimeMillis();
+    }
+
+    @Override
+    public final void endFrame(final GL gl) {
+        if( 0 == frameStart ) {
+            throw new IllegalStateException("beginFrame not called");
+        }
+        frameStart = 0;
+    }
+
+    @Override
+    public final void ppBegin(final GL gl) {
+        if( null == sp ) {
+            throw new IllegalStateException("Not initialized");
+        }
+        if( 0 == frameStart ) {
+            throw new IllegalStateException("beginFrame not called");
+        }
+        final GL2ES2 gl2es2 = gl.getGL2ES2();
+
+        gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+        gl.glClear(GL.GL_COLOR_BUFFER_BIT);
+        gl.glActiveTexture(GL.GL_TEXTURE0 + getTextureUnit());
+
+        gl2es2.glDisable(GL.GL_CULL_FACE);
+        gl2es2.glDisable(GL.GL_DEPTH_TEST);
+        gl2es2.glDisable(GL.GL_BLEND);
+
+        if( !gl2es2.isGLcore() ) {
+            gl2es2.glEnable(GL.GL_TEXTURE_2D);
+        }
+
+        sp.useProgram(gl2es2, true);
+
+        gl2es2.glUniform(texUnit0);
+    }
+
+    @Override
+    public final void ppOneEye(final GL gl, final int eyeNum) {
+        final GenericEye eye = eyes[eyeNum];
+        final GL2ES2 gl2es2 = gl.getGL2ES2();
+
+        eye.updateUniform(gl2es2, sp);
+        eye.enableVBO(gl2es2, true);
+        gl2es2.glDrawElements(GL.GL_TRIANGLES, eye.indexCount, GL.GL_UNSIGNED_SHORT, 0);
+        eyes[eyeNum].enableVBO(gl2es2, false);
+    }
+
+    @Override
+    public final void ppEnd(final GL gl) {
+        sp.useProgram(gl.getGL2ES2(), false);
+    }
+}
diff --git a/src/jogl/classes/jogamp/opengl/util/stereo/ScaleAndOffset2D.java b/src/jogl/classes/jogamp/opengl/util/stereo/ScaleAndOffset2D.java
new file mode 100644
index 0000000..ce154e0
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/stereo/ScaleAndOffset2D.java
@@ -0,0 +1,107 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl.util.stereo;
+
+import javax.media.nativewindow.util.DimensionImmutable;
+import javax.media.nativewindow.util.RectangleImmutable;
+
+import com.jogamp.opengl.math.FovHVHalves;
+import com.jogamp.opengl.math.VectorUtil;
+
+/**
+ * 2D scale and offset NDC class,
+ * providing conversion from {@link FovHVHalves} in tangent to NDC space.
+ * <p>
+ * See <a href="https://www.opengl.org/wiki/Compute_eye_space_from_window_space">OpenGL.org: Compute eye space from window space</a>
+ * </p>
+ */
+public final class ScaleAndOffset2D {
+    /** Scale for x- and y-component. */
+    final float[] scale;
+    /** Offset for x- and y-component. */
+    final float[] offset;
+
+    private static final float[] vec2Half = new float[] { 0.5f, 0.5f };
+
+    public String toString() {
+        return "[offset "+offset[0]+" / "+offset[1]+", scale "+scale[0]+" x "+scale[1]+"]";
+    }
+
+    public ScaleAndOffset2D(final float[] scale, final float[] offset) {
+        this.scale = scale;
+        this.offset = offset;
+    }
+
+    /**
+     * Create the <i>Normalized Device Coordinate Space</i> (NDC) [-1,+1] instance
+     * from the given <code>fovHVHalves</code>.
+     */
+    public ScaleAndOffset2D(final FovHVHalves fovHVHalves) {
+        final FovHVHalves tanFovHVHalves = fovHVHalves.toTangents();
+        final float projXScale = 2.0f / ( tanFovHVHalves.left+ tanFovHVHalves.right);
+        final float projYScale = 2.0f / ( tanFovHVHalves.top + tanFovHVHalves.bottom );
+        final float projXOffset = ( tanFovHVHalves.left - tanFovHVHalves.right ) * projXScale * 0.5f;
+        final float projYOffset = ( tanFovHVHalves.top - tanFovHVHalves.bottom ) * projYScale * 0.5f;
+
+        this.scale = new float[] { projXScale, projYScale };
+        this.offset = new float[] { projXOffset, projYOffset };
+    }
+
+    /**
+     * Create the <i>Normalized Device Coordinate Space</i> (NDC) [-1,+1] instance
+     * from the given <code>fovHVHalves</code>, for the subsection of the <code>render-viewport</code> within the <code>rendertarget-size</code>.
+     */
+    public ScaleAndOffset2D(final FovHVHalves fovHVHalves, final DimensionImmutable rendertargetSize, final RectangleImmutable renderViewport) {
+        final ScaleAndOffset2D eyeToSourceNDC = new ScaleAndOffset2D(fovHVHalves);
+        final float[] vec2Tmp1 = new float[2];
+        final float[] vec2Tmp2 = new float[2];
+        final float[] scale  = VectorUtil.scaleVec2(vec2Tmp1, eyeToSourceNDC.scale, 0.5f);
+        final float[] offset = VectorUtil.addVec2(vec2Tmp2, VectorUtil.scaleVec2(vec2Tmp2, eyeToSourceNDC.offset, 0.5f), vec2Half);
+
+        final float[] scale2 = new float[] { (float)renderViewport.getWidth() / (float)rendertargetSize.getWidth(),
+                                             (float)renderViewport.getHeight() / (float)rendertargetSize.getHeight() };
+
+        final float[] offset2 = new float[] { (float)renderViewport.getX() / (float)rendertargetSize.getWidth(),
+                                              (float)renderViewport.getY() / (float)rendertargetSize.getHeight() };
+
+        VectorUtil.scaleVec2(scale, scale, scale2);
+        VectorUtil.addVec2(offset, VectorUtil.scaleVec2(offset, offset, scale2), offset2);
+
+        this.scale = scale;
+        this.offset = offset;
+    }
+
+    /**
+     * Return the <i>tangent FOV space</i> of this <i>eye to source NDC</i> instance.
+     */
+    public final float[] convertToTanFovSpace(final float[] rendertargetNDC) {
+        final float[] vec2Tmp1 = new float[2];
+        return VectorUtil.divVec2(vec2Tmp1, VectorUtil.subVec2(vec2Tmp1, rendertargetNDC, this.offset), this.scale);
+    }
+
+}
\ No newline at end of file
diff --git a/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_chroma.fp b/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_chroma.fp
new file mode 100644
index 0000000..4ac4047
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_chroma.fp
@@ -0,0 +1,26 @@
+//Copyright 2014 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+  #define varying in
+  out vec4 svr_FragColor;
+  #define texture2D texture
+#else
+  #define svr_FragColor gl_FragColor
+#endif
+
+uniform sampler2D  svr_Texture0;
+
+varying vec3    svv_Fade;
+varying vec2    svv_TexCoordR;
+varying vec2    svv_TexCoordG;
+varying vec2    svv_TexCoordB;
+
+void main (void)
+{
+  // 3 samples for fixing chromatic aberrations
+  vec3 color = vec3(texture2D(svr_Texture0, svv_TexCoordR).r,
+                    texture2D(svr_Texture0, svv_TexCoordG).g,
+                    texture2D(svr_Texture0, svv_TexCoordB).b);
+  svr_FragColor = vec4(svv_Fade * color, 1.0);  // include vignetteFade
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_chroma.vp b/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_chroma.vp
new file mode 100644
index 0000000..d4ab585
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_chroma.vp
@@ -0,0 +1,33 @@
+//Copyright 2014 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+  #define attribute in
+  #define varying out
+#endif
+
+uniform vec2    svr_EyeToSourceUVScale;
+uniform vec2    svr_EyeToSourceUVOffset;
+
+attribute vec2  svr_Position;
+attribute vec2  svr_Params;
+attribute vec2  svr_TexCoordR;
+attribute vec2  svr_TexCoordG;
+attribute vec2  svr_TexCoordB;
+
+varying vec3    svv_Fade;
+varying vec2    svv_TexCoordR;
+varying vec2    svv_TexCoordG;
+varying vec2    svv_TexCoordB;
+
+void main(void)
+{
+    gl_Position = vec4(svr_Position.xy, 0.5, 1.0);
+    svv_Fade = vec3(svr_Params.r); // vignetteFade
+    
+    svv_TexCoordR = svr_TexCoordR * svr_EyeToSourceUVScale + svr_EyeToSourceUVOffset;
+    svv_TexCoordR.y = 1.0-svv_TexCoordR.y;
+    svv_TexCoordG = svr_TexCoordG * svr_EyeToSourceUVScale + svr_EyeToSourceUVOffset;
+    svv_TexCoordG.y = 1.0-svv_TexCoordG.y;
+    svv_TexCoordB = svr_TexCoordB * svr_EyeToSourceUVScale + svr_EyeToSourceUVOffset;
+    svv_TexCoordB.y = 1.0-svv_TexCoordB.y;
+}
diff --git a/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_plain.fp b/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_plain.fp
new file mode 100644
index 0000000..2df8906
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_plain.fp
@@ -0,0 +1,22 @@
+//Copyright 2014 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+  #define varying in
+  out vec4 svr_FragColor;
+  #define texture2D texture
+#else
+  #define svr_FragColor gl_FragColor
+#endif
+
+uniform sampler2D  svr_Texture0;
+
+varying vec3    svv_Fade;
+varying vec2    svv_TexCoordR;
+
+void main (void)
+{
+  // 3 samples for fixing chromatic aberrations
+  vec3 color = texture2D(svr_Texture0, svv_TexCoordR).rgb;
+  svr_FragColor = vec4(svv_Fade * color, 1.0);  // include vignetteFade
+}
+
diff --git a/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_plain.vp b/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_plain.vp
new file mode 100644
index 0000000..335d3f0
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_plain.vp
@@ -0,0 +1,27 @@
+//Copyright 2014 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+  #define attribute in
+  #define varying out
+#endif
+
+uniform vec2    svr_EyeToSourceUVScale;
+uniform vec2    svr_EyeToSourceUVOffset;
+
+attribute vec2  svr_Position;
+attribute vec2  svr_Params;
+attribute vec2  svr_TexCoordR;
+
+varying vec3    svv_Fade;
+varying vec2    svv_TexCoordR;
+
+void main(void)
+{
+    gl_Position = vec4(svr_Position.xy, 0.5, 1.0);
+    svv_Fade = vec3(svr_Params.r); // vignetteFade
+    
+    // Vertex inputs are in TanEyeAngle space for the R,G,B channels (i.e. after chromatic aberration and distortion).
+    // Scale them into the correct [0-1],[0-1] UV lookup space (depending on eye)    
+    svv_TexCoordR = svr_TexCoordR * svr_EyeToSourceUVScale + svr_EyeToSourceUVOffset;
+    svv_TexCoordR.y = 1.0-svv_TexCoordR.y;
+}
diff --git a/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_timewarp.vp b/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_timewarp.vp
new file mode 100644
index 0000000..c4461ec
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_timewarp.vp
@@ -0,0 +1,44 @@
+//Copyright 2014 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+  #define attribute in
+  #define varying out
+#endif
+
+uniform vec2    svr_EyeToSourceUVScale;
+uniform vec2    svr_EyeToSourceUVOffset;
+uniform mat4    svr_EyeRotationStart;
+uniform mat4    svr_EyeRotationEnd;
+
+attribute vec2  svr_Position;
+attribute vec2  svr_Params;
+attribute vec2  svr_TexCoordR;
+
+varying vec3    svv_Fade;
+varying vec2    svv_TexCoordR;
+
+void main(void)
+{
+    gl_Position = vec4(svr_Position.xy, 0.0, 1.0);
+    svv_Fade = vec3(svr_Params.r); // vignetteFade
+    
+    // Vertex inputs are in TanEyeAngle space for the R,G,B channels (i.e. after chromatic aberration and distortion).
+    // These are now "real world" vectors in direction (x,y,1) relative to the eye of the HMD.
+    vec3 TanEyeAngle = vec3 ( svr_TexCoordR, 1.0 );
+    
+    // Accurate time warp lerp vs. faster
+    // Apply the two 3x3 timewarp rotations to these vectors.
+	vec3 TransformedStart = (svr_EyeRotationStart * vec4(TanEyeAngle, 0)).xyz;
+	vec3 TransformedEnd   = (svr_EyeRotationEnd * vec4(TanEyeAngle, 0)).xyz;
+    // And blend between them.
+    vec3 Transformed = mix ( TransformedStart, TransformedEnd, svr_Params.g /* timewarpLerpFactor */ );
+    
+    // Project them back onto the Z=1 plane of the rendered images.
+    float RecipZ = 1.0 / Transformed.z;
+    vec2 Flattened = vec2 ( Transformed.x * RecipZ, Transformed.y * RecipZ );
+    
+    // These are now still in TanEyeAngle space.
+    // Scale them into the correct [0-1],[0-1] UV lookup space (depending on eye)
+    svv_TexCoordR = Flattened * svr_EyeToSourceUVScale + svr_EyeToSourceUVOffset;
+    svv_TexCoordR.y = 1.0-svv_TexCoordR.y;
+}
diff --git a/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_timewarp_chroma.vp b/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_timewarp_chroma.vp
new file mode 100644
index 0000000..c08ed31
--- /dev/null
+++ b/src/jogl/classes/jogamp/opengl/util/stereo/shader/dist01_timewarp_chroma.vp
@@ -0,0 +1,65 @@
+//Copyright 2014 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+  #define attribute in
+  #define varying out
+#endif
+
+uniform vec2    svr_EyeToSourceUVScale;
+uniform vec2    svr_EyeToSourceUVOffset;
+uniform mat4    svr_EyeRotationStart;
+uniform mat4    svr_EyeRotationEnd;
+
+attribute vec2  svr_Position;
+attribute vec2  svr_Params;
+attribute vec2  svr_TexCoordR;
+attribute vec2  svr_TexCoordG;
+attribute vec2  svr_TexCoordB;
+
+varying vec3    svv_Fade;
+varying vec2    svv_TexCoordR;
+varying vec2    svv_TexCoordG;
+varying vec2    svv_TexCoordB;
+
+void main(void)
+{
+    gl_Position = vec4(svr_Position.xy, 0.0, 1.0);
+    svv_Fade = vec3(svr_Params.r); // vignetteFade
+    
+    // Vertex inputs are in TanEyeAngle space for the R,G,B channels (i.e. after chromatic aberration and distortion).
+    // These are now "real world" vectors in direction (x,y,1) relative to the eye of the HMD.
+    vec3 TanEyeAngleR = vec3 ( svr_TexCoordR, 1.0 );
+    vec3 TanEyeAngleG = vec3 ( svr_TexCoordG, 1.0 );
+    vec3 TanEyeAngleB = vec3 ( svr_TexCoordB, 1.0 );
+    
+    // Accurate time warp lerp vs. faster
+    // Apply the two 3x3 timewarp rotations to these vectors.
+	vec3 TransformedRStart = (svr_EyeRotationStart * vec4(TanEyeAngleR, 0)).xyz;
+	vec3 TransformedGStart = (svr_EyeRotationStart * vec4(TanEyeAngleG, 0)).xyz;
+	vec3 TransformedBStart = (svr_EyeRotationStart * vec4(TanEyeAngleB, 0)).xyz;
+	vec3 TransformedREnd   = (svr_EyeRotationEnd * vec4(TanEyeAngleR, 0)).xyz;
+	vec3 TransformedGEnd   = (svr_EyeRotationEnd * vec4(TanEyeAngleG, 0)).xyz;
+	vec3 TransformedBEnd   = (svr_EyeRotationEnd * vec4(TanEyeAngleB, 0)).xyz;
+
+    // And blend between them.
+    vec3 TransformedR = mix ( TransformedRStart, TransformedREnd, svr_Params.g /* timewarpLerpFactor */ );
+    vec3 TransformedG = mix ( TransformedGStart, TransformedGEnd, svr_Params.g /* timewarpLerpFactor */ );
+    vec3 TransformedB = mix ( TransformedBStart, TransformedBEnd, svr_Params.g /* timewarpLerpFactor */ );
+    
+    // Project them back onto the Z=1 plane of the rendered images.
+    float RecipZR = 1.0 / TransformedR.z;
+    float RecipZG = 1.0 / TransformedG.z;
+    float RecipZB = 1.0 / TransformedB.z;
+    vec2 FlattenedR = vec2 ( TransformedR.x * RecipZR, TransformedR.y * RecipZR );
+    vec2 FlattenedG = vec2 ( TransformedG.x * RecipZG, TransformedG.y * RecipZG );
+    vec2 FlattenedB = vec2 ( TransformedB.x * RecipZB, TransformedB.y * RecipZB );
+    
+    // These are now still in TanEyeAngle space.
+    // Scale them into the correct [0-1],[0-1] UV lookup space (depending on eye)
+    svv_TexCoordR = FlattenedR * svr_EyeToSourceUVScale + svr_EyeToSourceUVOffset;
+    svv_TexCoordR.y = 1.0-svv_TexCoordR.y;
+    svv_TexCoordG = FlattenedG * svr_EyeToSourceUVScale + svr_EyeToSourceUVOffset;
+    svv_TexCoordG.y = 1.0-svv_TexCoordG.y;
+    svv_TexCoordB = FlattenedB * svr_EyeToSourceUVScale + svr_EyeToSourceUVOffset;
+    svv_TexCoordB.y = 1.0-svv_TexCoordB.y;
+}
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
index feacdb9..25b73a2 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLGLCapabilities.java
@@ -44,7 +44,7 @@ public class WGLGLCapabilities extends GLCapabilities {
   final private int pfdID;
   private int arb_pixelformat; // -1 PFD, 0 NOP, 1 ARB
 
-  public WGLGLCapabilities(PIXELFORMATDESCRIPTOR pfd, int pfdID, GLProfile glp) {
+  public WGLGLCapabilities(final PIXELFORMATDESCRIPTOR pfd, final int pfdID, final GLProfile glp) {
       super(glp);
       this.pfd = pfd;
       this.pfdID = pfdID;
@@ -78,9 +78,9 @@ public class WGLGLCapabilities extends GLCapabilities {
       return true;
   }
 
-  public static final String PFD2String(PIXELFORMATDESCRIPTOR pfd, int pfdID) {
+  public static final String PFD2String(final PIXELFORMATDESCRIPTOR pfd, final int pfdID) {
       final int dwFlags = pfd.getDwFlags();
-      StringBuilder sb = new StringBuilder();
+      final StringBuilder sb = new StringBuilder();
       boolean sep = false;
 
       if( 0 != (GDI.PFD_DRAW_TO_WINDOW & dwFlags ) ) {
@@ -224,7 +224,7 @@ public class WGLGLCapabilities extends GLCapabilities {
   public Object clone() {
     try {
       return super.clone();
-    } catch (RuntimeException e) {
+    } catch (final RuntimeException e) {
       throw new GLException(e);
     }
   }
@@ -237,7 +237,7 @@ public class WGLGLCapabilities extends GLCapabilities {
   final public boolean isSet()      { return 0 != arb_pixelformat; }
 
   @Override
-  final public int getVisualID(VIDType type) throws NativeWindowException {
+  final public int getVisualID(final VIDType type) throws NativeWindowException {
       switch(type) {
           case INTRINSIC:
           case NATIVE:
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java
index 6454a34..08ff0e0 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WGLUtil.java
@@ -27,6 +27,8 @@
  */
 package jogamp.opengl.windows.wgl;
 
+import com.jogamp.common.util.PropertyAccess;
+
 import jogamp.nativewindow.windows.GDI;
 import jogamp.nativewindow.windows.PIXELFORMATDESCRIPTOR;
 import jogamp.opengl.Debug;
@@ -52,41 +54,41 @@ public class WGLUtil {
 
     static {
         Debug.initSingleton();
-        USE_WGLVersion_Of_5WGLGDIFuncSet = Debug.isPropertyDefined("jogl.windows.useWGLVersionOf5WGLGDIFuncSet", true);
+        USE_WGLVersion_Of_5WGLGDIFuncSet = PropertyAccess.isPropertyDefined("jogl.windows.useWGLVersionOf5WGLGDIFuncSet", true);
         if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
             System.err.println("Use WGL version of 5 WGL/GDI functions.");
         }
     }
 
-    public static int ChoosePixelFormat(long hdc, PIXELFORMATDESCRIPTOR pfd)  {
+    public static int ChoosePixelFormat(final long hdc, final PIXELFORMATDESCRIPTOR pfd)  {
         if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
             return WGL.wglChoosePixelFormat(hdc, pfd);
         } else {
             return GDI.ChoosePixelFormat(hdc, pfd);
         }
     }
-    public static int DescribePixelFormat(long hdc, int pfdid, int pfdSize, PIXELFORMATDESCRIPTOR pfd)  {
+    public static int DescribePixelFormat(final long hdc, final int pfdid, final int pfdSize, final PIXELFORMATDESCRIPTOR pfd)  {
         if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
             return WGL.wglDescribePixelFormat(hdc, pfdid, pfdSize, pfd);
         } else {
             return GDI.DescribePixelFormat(hdc, pfdid, pfdSize, pfd);
         }
     }
-    public static int GetPixelFormat(long hdc)  {
+    public static int GetPixelFormat(final long hdc)  {
         if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
             return WGL.wglGetPixelFormat(hdc);
         } else {
             return GDI.GetPixelFormat(hdc);
         }
     }
-    public static boolean SetPixelFormat(long hdc, int pfdid, PIXELFORMATDESCRIPTOR pfd)  {
+    public static boolean SetPixelFormat(final long hdc, final int pfdid, final PIXELFORMATDESCRIPTOR pfd)  {
         if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
             return WGL.wglSetPixelFormat(hdc, pfdid, pfd);
         } else {
             return GDI.SetPixelFormat(hdc, pfdid, pfd);
         }
     }
-    public static boolean SwapBuffers(long hdc)  {
+    public static boolean SwapBuffers(final long hdc)  {
         if(USE_WGLVersion_Of_5WGLGDIFuncSet) {
             return WGL.wglSwapBuffers(hdc);
         } else {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java
index f658a35..0878f18 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsBitmapWGLDrawable.java
@@ -60,11 +60,11 @@ public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
   private long origbitmap;
   private long hbitmap;
 
-  private WindowsBitmapWGLDrawable(GLDrawableFactory factory, NativeSurface comp) {
+  private WindowsBitmapWGLDrawable(final GLDrawableFactory factory, final NativeSurface comp) {
     super(factory, comp, false);
   }
 
-  protected static WindowsBitmapWGLDrawable create(GLDrawableFactory factory, NativeSurface comp) {
+  protected static WindowsBitmapWGLDrawable create(final GLDrawableFactory factory, final NativeSurface comp) {
     final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)comp.getGraphicsConfiguration();
     final AbstractGraphicsDevice aDevice = config.getScreen().getDevice();
     if( !GLProfile.isAvailable(aDevice, GLProfile.GL2) ) {
@@ -94,7 +94,7 @@ public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
   }
 
   @Override
-  public GLContext createContext(GLContext shareWith) {
+  public GLContext createContext(final GLContext shareWith) {
     return new WindowsWGLContext(this, shareWith);
   }
 
@@ -111,8 +111,8 @@ public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
     }
     final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration();
     final GLCapabilitiesImmutable capsChosen = (GLCapabilitiesImmutable)config.getChosenCapabilities();
-    final int width = getWidth();
-    final int height = getHeight();
+    final int width = getSurfaceWidth();
+    final int height = getSurfaceHeight();
 
     //
     // 1. Create DIB Section
@@ -146,7 +146,7 @@ public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
     hbitmap = GDI.CreateDIBSection(0, info, GDI.DIB_RGB_COLORS, pb, 0, 0);
     werr = GDI.GetLastError();
     if(DEBUG) {
-        long p = ( pb.capacity() > 0 ) ? pb.get(0) : 0;
+        final long p = ( pb.capacity() > 0 ) ? pb.get(0) : 0;
         System.err.println("WindowsBitmapWGLDrawable: pb sz/ptr "+pb.capacity() + ", "+toHexString(p));
         System.err.println("WindowsBitmapWGLDrawable: " + width+"x"+height +
                             ", bpp " + bitsPerPixelIn + " -> " + bitsPerPixel +
@@ -187,7 +187,7 @@ public class WindowsBitmapWGLDrawable extends WindowsWGLDrawable {
   }
 
   protected void destroyBitmap() {
-    NativeSurface ns = getNativeSurface();
+    final NativeSurface ns = getNativeSurface();
     if (ns.getSurfaceHandle() != 0) {
       // Must destroy bitmap and device context
       GDI.SelectObject(ns.getSurfaceHandle(), origbitmap);
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java
index c46b3c9..4cebc63 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLContext.java
@@ -56,7 +56,7 @@ import jogamp.opengl.GLContextShareSet;
 
 public class WindowsExternalWGLContext extends WindowsWGLContext {
 
-  private WindowsExternalWGLContext(Drawable drawable, long ctx, WindowsWGLGraphicsConfiguration cfg) {
+  private WindowsExternalWGLContext(final Drawable drawable, final long ctx, final WindowsWGLGraphicsConfiguration cfg) {
     super(drawable, null);
     this.contextHandle = ctx;
     if (DEBUG) {
@@ -69,7 +69,7 @@ public class WindowsExternalWGLContext extends WindowsWGLContext {
     getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
   }
 
-  protected static WindowsExternalWGLContext create(GLDrawableFactory factory, GLProfile glp) {
+  protected static WindowsExternalWGLContext create(final GLDrawableFactory factory, final GLProfile glp) {
     if(DEBUG) {
         System.err.println("WindowsExternalWGLContext 0: werr: " + GDI.GetLastError());
     }
@@ -83,7 +83,7 @@ public class WindowsExternalWGLContext extends WindowsWGLContext {
     if (0 == hdc) {
       throw new GLException("Error: attempted to make an external GLDrawable without a drawable current, werr " + GDI.GetLastError());
     }
-    AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
+    final AbstractGraphicsScreen aScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
     WindowsWGLGraphicsConfiguration cfg;
     final int pfdID = WGLUtil.GetPixelFormat(hdc);
     if (0 == pfdID) {
@@ -119,26 +119,26 @@ public class WindowsExternalWGLContext extends WindowsWGLContext {
 
   // Need to provide the display connection to extension querying APIs
   static class Drawable extends WindowsWGLDrawable {
-    Drawable(GLDrawableFactory factory, NativeSurface comp) {
+    Drawable(final GLDrawableFactory factory, final NativeSurface comp) {
       super(factory, comp, true);
     }
 
     @Override
-    public GLContext createContext(GLContext shareWith) {
+    public GLContext createContext(final GLContext shareWith) {
       throw new GLException("Should not call this");
     }
 
     @Override
-    public int getWidth() {
+    public int getSurfaceWidth() {
       throw new GLException("Should not call this");
     }
 
     @Override
-    public int getHeight() {
+    public int getSurfaceHeight() {
       throw new GLException("Should not call this");
     }
 
-    public void setSize(int width, int height) {
+    public void setSize(final int width, final int height) {
       throw new GLException("Should not call this");
     }
   }
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java
index f8c237c..1378bcf 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsExternalWGLDrawable.java
@@ -51,21 +51,20 @@ import javax.media.opengl.GLProfile;
 
 import jogamp.nativewindow.WrappedSurface;
 import jogamp.nativewindow.windows.GDI;
-import jogamp.nativewindow.windows.GDIUtil;
 
 
 public class WindowsExternalWGLDrawable extends WindowsWGLDrawable {
 
-  private WindowsExternalWGLDrawable(GLDrawableFactory factory, NativeSurface component) {
+  private WindowsExternalWGLDrawable(final GLDrawableFactory factory, final NativeSurface component) {
     super(factory, component, true);
   }
 
-  protected static WindowsExternalWGLDrawable create(GLDrawableFactory factory, GLProfile glp) {
-    long hdc = WGL.wglGetCurrentDC();
+  protected static WindowsExternalWGLDrawable create(final GLDrawableFactory factory, final GLProfile glp) {
+    final long hdc = WGL.wglGetCurrentDC();
     if (0==hdc) {
       throw new GLException("Error: attempted to make an external GLDrawable without a drawable current, werr " + GDI.GetLastError());
     }
-    int pfdID = WGLUtil.GetPixelFormat(hdc);
+    final int pfdID = WGLUtil.GetPixelFormat(hdc);
     if (pfdID == 0) {
       throw new GLException("Error: attempted to make an external GLContext without a valid pixelformat, werr " + GDI.GetLastError());
     }
@@ -77,21 +76,21 @@ public class WindowsExternalWGLDrawable extends WindowsWGLDrawable {
 
 
   @Override
-  public GLContext createContext(GLContext shareWith) {
+  public GLContext createContext(final GLContext shareWith) {
     return new WindowsWGLContext(this, shareWith);
   }
 
-  public void setSize(int newWidth, int newHeight) {
+  public void setSize(final int newWidth, final int newHeight) {
     throw new GLException("Should not call this");
   }
 
   @Override
-  public int getWidth() {
+  public int getSurfaceWidth() {
     throw new GLException("Should not call this");
   }
 
   @Override
-  public int getHeight() {
+  public int getSurfaceHeight() {
     throw new GLException("Should not call this");
   }
 }
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java
index 61fb787..0d0681d 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsOnscreenWGLDrawable.java
@@ -45,12 +45,12 @@ import javax.media.opengl.GLContext;
 import javax.media.opengl.GLDrawableFactory;
 
 public class WindowsOnscreenWGLDrawable extends WindowsWGLDrawable {
-  protected WindowsOnscreenWGLDrawable(GLDrawableFactory factory, NativeSurface component) {
+  protected WindowsOnscreenWGLDrawable(final GLDrawableFactory factory, final NativeSurface component) {
     super(factory, component, false);
   }
 
   @Override
-  public GLContext createContext(GLContext shareWith) {
+  public GLContext createContext(final GLContext shareWith) {
     return new WindowsWGLContext(this, shareWith);
   }
 
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
index 2e60c68..597f511 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsPbufferWGLDrawable.java
@@ -65,7 +65,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
                                // needed to destroy pbuffer
   private long buffer; // pbuffer handle
 
-  protected WindowsPbufferWGLDrawable(GLDrawableFactory factory, NativeSurface target) {
+  protected WindowsPbufferWGLDrawable(final GLDrawableFactory factory, final NativeSurface target) {
     super(factory, target, false);
   }
 
@@ -79,14 +79,14 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
   }
 
   @Override
-  public GLContext createContext(GLContext shareWith) {
+  public GLContext createContext(final GLContext shareWith) {
     return new WindowsWGLContext(this, shareWith);
   }
 
   protected void destroyPbuffer() {
-    NativeSurface ns = getNativeSurface();
+    final NativeSurface ns = getNativeSurface();
     if(0!=buffer) {
-        WGLExt wglExt = cachedWGLExt;
+        final WGLExt wglExt = cachedWGLExt;
         if (ns.getSurfaceHandle() != 0) {
           // Must release DC and pbuffer
           // NOTE that since the context is not current, glGetError() can
@@ -112,15 +112,15 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
   }
 
   private void createPbuffer() {
-    WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) getNativeSurface().getGraphicsConfiguration();
-    SharedResource sharedResource = ((WindowsWGLDrawableFactory)factory).getOrCreateSharedResourceImpl(config.getScreen().getDevice());
-    NativeSurface sharedSurface = sharedResource.getDrawable().getNativeSurface();
+    final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) getNativeSurface().getGraphicsConfiguration();
+    final SharedResource sharedResource = ((WindowsWGLDrawableFactory)factory).getOrCreateSharedResourceImpl(config.getScreen().getDevice());
+    final NativeSurface sharedSurface = sharedResource.getDrawable().getNativeSurface();
     if (NativeSurface.LOCK_SURFACE_NOT_READY >= sharedSurface.lockSurface()) {
       throw new NativeWindowException("Could not lock (sharedSurface): "+this);
     }
     try {
-        long sharedHdc = sharedSurface.getSurfaceHandle();
-        WGLExt wglExt = ((WindowsWGLContext)sharedResource.getContext()).getWGLExt();
+        final long sharedHdc = sharedSurface.getSurfaceHandle();
+        final WGLExt wglExt = ((WindowsWGLContext)sharedResource.getContext()).getWGLExt();
 
         if (DEBUG) {
             System.out.println(getThreadName()+": Pbuffer config: " + config);
@@ -130,7 +130,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
 
         final IntBuffer iattributes = Buffers.newDirectIntBuffer(2*WindowsWGLGraphicsConfiguration.MAX_ATTRIBS);
         final FloatBuffer fattributes = Buffers.newDirectFloatBuffer(1);
-        int[]   floatModeTmp = new int[1];
+        final int[]   floatModeTmp = new int[1];
         int     niattribs   = 0;
 
         final GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable)config.getChosenCapabilities();
@@ -162,7 +162,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
         if (DEBUG) {
           System.err.println("" + nformats + " suitable pixel formats found");
           for (int i = 0; i < nformats; i++) {
-            WGLGLCapabilities dbgCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
+            final WGLGLCapabilities dbgCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
                                           sharedHdc, pformats.get(i), winattrPbuffer);
             System.err.println("pixel format " + pformats.get(i) + " (index " + i + "): " + dbgCaps);
           }
@@ -174,14 +174,14 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
             int whichFormat;
             // Loop is a workaround for bugs in NVidia's recent drivers
             for (whichFormat = 0; whichFormat < nformats; whichFormat++) {
-              int format = pformats.get(whichFormat);
+              final int format = pformats.get(whichFormat);
 
               // Create the p-buffer.
               niattribs = 0;
 
               iattributes.put(niattribs++, 0);
 
-              tmpBuffer = wglExt.wglCreatePbufferARB(sharedHdc, format, getWidth(), getHeight(), iattributes);
+              tmpBuffer = wglExt.wglCreatePbufferARB(sharedHdc, format, getSurfaceWidth(), getSurfaceHeight(), iattributes);
               if (tmpBuffer != 0) {
                 // Done
                 break;
@@ -196,12 +196,12 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
         }
 
         // Get the device context.
-        long tmpHdc = wglExt.wglGetPbufferDCARB(tmpBuffer);
+        final long tmpHdc = wglExt.wglGetPbufferDCARB(tmpBuffer);
         if (tmpHdc == 0) {
           throw new GLException("pbuffer creation error: wglGetPbufferDC() failed");
         }
 
-        NativeSurface ns = getNativeSurface();
+        final NativeSurface ns = getNativeSurface();
         // Set up instance variables
         buffer = tmpBuffer;
         ((MutableSurface)ns).setSurfaceHandle(tmpHdc);
@@ -209,7 +209,7 @@ public class WindowsPbufferWGLDrawable extends WindowsWGLDrawable {
 
         // Re-query chosen pixel format
         {
-          WGLGLCapabilities newCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
+          final WGLGLCapabilities newCaps = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(sharedResource, device, glProfile,
                                           sharedHdc, pfdid, winattrPbuffer);
           if(null == newCaps) {
             throw new GLException("pbuffer creation error: unable to re-query chosen PFD ID: " + pfdid + ", hdc " + GLDrawableImpl.toHexString(tmpHdc));
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
index b214252..33980d6 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLContext.java
@@ -51,6 +51,7 @@ import javax.media.nativewindow.NativeSurface;
 import javax.media.opengl.GLContext;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLProfile;
 
 import com.jogamp.common.nio.Buffers;
 import com.jogamp.gluegen.runtime.ProcAddressTable;
@@ -87,13 +88,13 @@ public class WindowsWGLContext extends GLContextImpl {
   }
 
   // FIXME: figure out how to hook back in the Java 2D / JOGL bridge
-  WindowsWGLContext(GLDrawableImpl drawable,
-                    GLContext shareWith) {
+  WindowsWGLContext(final GLDrawableImpl drawable,
+                    final GLContext shareWith) {
     super(drawable, shareWith);
   }
 
   @Override
-  protected void resetStates(boolean isInit) {
+  protected void resetStates(final boolean isInit) {
     wglGetExtensionsStringEXTInitialized=false;
     wglGetExtensionsStringEXTAvailable=false;
     wglGLReadDrawableAvailableSet=false;
@@ -123,9 +124,9 @@ public class WindowsWGLContext extends GLContextImpl {
   @Override
   public final boolean isGLReadDrawableAvailable() {
     if(!wglGLReadDrawableAvailableSet && null != getWGLExtProcAddressTable()) {
-        WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory)drawable.getFactoryImpl();
-        AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration();
-        AbstractGraphicsDevice device = config.getScreen().getDevice();
+        final WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory)drawable.getFactoryImpl();
+        final AbstractGraphicsConfiguration config = drawable.getNativeSurface().getGraphicsConfiguration();
+        final AbstractGraphicsDevice device = config.getScreen().getDevice();
         switch( factory.isReadDrawableAvailable(device) ) {
             case  1:
                 wglGLReadDrawableAvailable = true;
@@ -140,7 +141,7 @@ public class WindowsWGLContext extends GLContextImpl {
     return wglGLReadDrawableAvailable;
   }
 
-  private final boolean wglMakeContextCurrent(long hDrawDC, long hReadDC, long ctx) {
+  private final boolean wglMakeContextCurrent(final long hDrawDC, final long hReadDC, final long ctx) {
     boolean ok = false;
     if(wglGLReadDrawableAvailable) {
         // needs initilized WGL ProcAddress table
@@ -151,9 +152,9 @@ public class WindowsWGLContext extends GLContextImpl {
         // should not happen due to 'isGLReadDrawableAvailable()' query in GLContextImpl
         throw new InternalError("Given readDrawable but no driver support");
     }
-    int werr = ( !ok ) ? GDI.GetLastError() : GDI.ERROR_SUCCESS;
+    final int werr = ( !ok ) ? GDI.GetLastError() : GDI.ERROR_SUCCESS;
     if(DEBUG && !ok) {
-        Throwable t = new Throwable ("Info: wglMakeContextCurrent draw "+
+        final Throwable t = new Throwable ("Info: wglMakeContextCurrent draw "+
                 GLContext.toHexString(hDrawDC) + ", read " + GLContext.toHexString(hReadDC) +
                 ", ctx " + GLContext.toHexString(ctx) + ", werr " + werr);
         t.printStackTrace();
@@ -182,26 +183,26 @@ public class WindowsWGLContext extends GLContextImpl {
   protected Map<String, String> getExtensionNameMap() { return extensionNameMap; }
 
   @Override
-  protected void destroyContextARBImpl(long context) {
+  protected void destroyContextARBImpl(final long context) {
     WGL.wglMakeCurrent(0, 0);
     WGL.wglDeleteContext(context);
   }
 
   @Override
-  protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
+  protected long createContextARBImpl(final long share, final boolean direct, final int ctp, final int major, final int minor) {
     if( null == getWGLExtProcAddressTable()) {
         updateGLXProcAddressTable();
     }
-    WGLExt _wglExt = getWGLExt();
+    final WGLExt _wglExt = getWGLExt();
     if(DEBUG) {
       System.err.println(getThreadName()+" - WindowWGLContext.createContextARBImpl: "+getGLVersion(major, minor, ctp, "@creation") +
                          ", handle "+toHexString(drawable.getHandle()) + ", share "+toHexString(share)+", direct "+direct+
                          ", wglCreateContextAttribsARB: "+toHexString(wglExtProcAddressTable._addressof_wglCreateContextAttribsARB));
     }
 
-    boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
-    boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
-    boolean ctDebug     = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
+    final boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
+    final boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
+    final boolean ctDebug     = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
 
     long ctx=0;
 
@@ -210,7 +211,7 @@ public class WindowsWGLContext extends GLContextImpl {
 
     /*  WGLExt.WGL_CONTEXT_LAYER_PLANE_ARB,   WGLExt.WGL_CONTEXT_LAYER_PLANE_ARB, */
 
-    int attribs[] = {
+    final int attribs[] = {
         /*  0 */ WGLExt.WGL_CONTEXT_MAJOR_VERSION_ARB, major,
         /*  2 */ WGLExt.WGL_CONTEXT_MINOR_VERSION_ARB, minor,
         /*  4 */ WGLExt.WGL_CONTEXT_FLAGS_ARB,         0,
@@ -239,9 +240,9 @@ public class WindowsWGLContext extends GLContextImpl {
     try {
         final IntBuffer attribsNIO = Buffers.newDirectIntBuffer(attribs);
         ctx = _wglExt.wglCreateContextAttribsARB(drawable.getHandle(), share, attribsNIO);
-    } catch (RuntimeException re) {
+    } catch (final RuntimeException re) {
         if(DEBUG) {
-          Throwable t = new Throwable("Info: WindowWGLContext.createContextARBImpl wglCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
+          final Throwable t = new Throwable("Info: WindowWGLContext.createContextARBImpl wglCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
           t.printStackTrace();
         }
     }
@@ -314,7 +315,7 @@ public class WindowsWGLContext extends GLContextImpl {
         if ( !WGL.wglMakeCurrent(drawable.getHandle(), temp_ctx) ) {
             throw new GLException("Error making temp context current: 0x" + toHexString(temp_ctx) + ", werr: "+GDI.GetLastError());
         }
-        if( !setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT, false /* strictMatch */, false /* withinGLVersionsMapping */) ) { // use GL_VERSION
+        if( !setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT, false /* strictMatch */, null == sharedContext /* withinGLVersionsMapping */) ) { // use GL_VERSION
             throw new InternalError("setGLFunctionAvailability !strictMatch failed");
         }
         WGL.wglMakeCurrent(0, 0); // release temp context
@@ -330,7 +331,7 @@ public class WindowsWGLContext extends GLContextImpl {
                 isProcCreateContextAttribsARBAvailable = false;
                 isExtARBCreateContextAvailable = false;
             }
-            if ( isProcCreateContextAttribsARBAvailable && isExtARBCreateContextAvailable ) {
+            if ( isProcCreateContextAttribsARBAvailable && isExtARBCreateContextAvailable && !GLProfile.disableOpenGLARBContext ) {
                 // initial ARB context creation
                 contextHandle = createContextARB(shareWithHandle, true);
                 createContextARBTried=true;
@@ -343,7 +344,9 @@ public class WindowsWGLContext extends GLContextImpl {
                 }
             } else if (DEBUG) {
                 System.err.println(getThreadName() + ": createContextImpl: NOT OK (ARB, initial) - extension not available - share "+toHexString(shareWithHandle)+
-                                   ", isProcCreateContextAttribsARBAvailable "+isProcCreateContextAttribsARBAvailable+", isExtGLXARBCreateContextAvailable "+isExtARBCreateContextAvailable);
+                                   ", isProcCreateContextAttribsARBAvailable "+isProcCreateContextAttribsARBAvailable+
+                                   ", isExtGLXARBCreateContextAvailable "+isExtARBCreateContextAvailable+
+                                   ", disableOpenGLARBContext "+GLProfile.disableOpenGLARBContext);
             }
         }
     } else {
@@ -360,16 +363,18 @@ public class WindowsWGLContext extends GLContextImpl {
             }
         }
     } else {
-        if( glCaps.getGLProfile().isGL3() ) {
-          WGL.wglMakeCurrent(0, 0);
-          WGL.wglDeleteContext(temp_ctx);
-          throw new GLException(getThreadName()+": WindowsWGLContex.createContextImpl ctx !ARB, profile > GL2 requested (OpenGL >= 3.0.1). Requested: "+glCaps.getGLProfile()+", current: "+getGLVersion());
+        if( glCaps.getGLProfile().isGL3() && createContextARBTried ) {
+            // We shall not allow context creation >= GL3 w/ non ARB methods if ARB is used,
+            // otherwise context of similar profile but different creation method may not be share-able.
+            WGL.wglMakeCurrent(0, 0);
+            WGL.wglDeleteContext(temp_ctx);
+            throw new GLException(getThreadName()+": WindowsWGLContex.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.0.1). Requested: "+glCaps.getGLProfile()+", current: "+getGLVersion());
         }
         if(DEBUG) {
-          System.err.println("WindowsWGLContext.createContext failed, fall back to !ARB context "+getGLVersion());
+            System.err.println("WindowsWGLContext.createContext ARB not used, fall back to !ARB context "+getGLVersion());
         }
 
-        // continue with temp context for GL < 3.0
+        // continue with temp context
         contextHandle = temp_ctx;
         if ( !wglMakeContextCurrent(drawable.getHandle(), drawableRead.getHandle(), contextHandle) ) {
             WGL.wglMakeCurrent(0, 0);
@@ -422,7 +427,7 @@ public class WindowsWGLContext extends GLContextImpl {
   }
 
   @Override
-  protected void copyImpl(GLContext source, int mask) throws GLException {
+  protected void copyImpl(final GLContext source, final int mask) throws GLException {
     if (!WGL.wglCopyContext(source.getHandle(), getHandle(), mask)) {
       throw new GLException("wglCopyContext failed");
     }
@@ -464,7 +469,7 @@ public class WindowsWGLContext extends GLContextImpl {
 
   @Override
   protected final StringBuilder getPlatformExtensionsStringImpl() {
-    StringBuilder sb = new StringBuilder();
+    final StringBuilder sb = new StringBuilder();
 
     if (!wglGetExtensionsStringEXTInitialized) {
       wglGetExtensionsStringEXTAvailable = (WGL.wglGetProcAddress("wglGetExtensionsStringEXT") != 0);
@@ -477,26 +482,26 @@ public class WindowsWGLContext extends GLContextImpl {
   }
 
   @Override
-  protected boolean setSwapIntervalImpl(int interval) {
-    WGLExt wglExt = getWGLExt();
+  protected boolean setSwapIntervalImpl(final int interval) {
+    final WGLExt wglExt = getWGLExt();
     if(0==hasSwapIntervalSGI) {
         try {
             hasSwapIntervalSGI = wglExt.isExtensionAvailable("WGL_EXT_swap_control")?1:-1;
-        } catch (Throwable t) { hasSwapIntervalSGI=1; }
+        } catch (final Throwable t) { hasSwapIntervalSGI=1; }
     }
     if (hasSwapIntervalSGI>0) {
         try {
             return wglExt.wglSwapIntervalEXT(interval);
-        } catch (Throwable t) { hasSwapIntervalSGI=-1; }
+        } catch (final Throwable t) { hasSwapIntervalSGI=-1; }
     }
     return false;
   }
 
-  private final int initSwapGroupImpl(WGLExt wglExt) {
+  private final int initSwapGroupImpl(final WGLExt wglExt) {
       if(0==hasSwapGroupNV) {
         try {
             hasSwapGroupNV = wglExt.isExtensionAvailable("WGL_NV_swap_group")?1:-1;
-        } catch (Throwable t) { hasSwapGroupNV=1; }
+        } catch (final Throwable t) { hasSwapGroupNV=1; }
         if(DEBUG) {
             System.err.println("initSwapGroupImpl: hasSwapGroupNV: "+hasSwapGroupNV);
         }
@@ -505,10 +510,10 @@ public class WindowsWGLContext extends GLContextImpl {
   }
 
   @Override
-  protected final boolean queryMaxSwapGroupsImpl(int[] maxGroups, int maxGroups_offset,
-                                                 int[] maxBarriers, int maxBarriers_offset) {
+  protected final boolean queryMaxSwapGroupsImpl(final int[] maxGroups, final int maxGroups_offset,
+                                                 final int[] maxBarriers, final int maxBarriers_offset) {
       boolean res = false;
-      WGLExt wglExt = getWGLExt();
+      final WGLExt wglExt = getWGLExt();
       if (initSwapGroupImpl(wglExt)>0) {
         final NativeSurface ns = drawable.getNativeSurface();
         try {
@@ -520,47 +525,47 @@ public class WindowsWGLContext extends GLContextImpl {
                 maxBarriersNIO.get(maxGroups, maxGroups_offset, maxBarriersNIO.remaining());
                 res = true;
             }
-        } catch (Throwable t) { hasSwapGroupNV=-1; }
+        } catch (final Throwable t) { hasSwapGroupNV=-1; }
       }
       return res;
   }
 
   @Override
-  protected final boolean joinSwapGroupImpl(int group) {
+  protected final boolean joinSwapGroupImpl(final int group) {
       boolean res = false;
-      WGLExt wglExt = getWGLExt();
+      final WGLExt wglExt = getWGLExt();
       if (initSwapGroupImpl(wglExt)>0) {
         try {
             if( wglExt.wglJoinSwapGroupNV(drawable.getHandle(), group) ) {
                 currentSwapGroup = group;
                 res = true;
             }
-        } catch (Throwable t) { hasSwapGroupNV=-1; }
+        } catch (final Throwable t) { hasSwapGroupNV=-1; }
       }
       return res;
   }
 
   @Override
-  protected final boolean bindSwapBarrierImpl(int group, int barrier) {
+  protected final boolean bindSwapBarrierImpl(final int group, final int barrier) {
       boolean res = false;
-      WGLExt wglExt = getWGLExt();
+      final WGLExt wglExt = getWGLExt();
       if (initSwapGroupImpl(wglExt)>0) {
         try {
             if( wglExt.wglBindSwapBarrierNV(group, barrier) ) {
                 res = true;
             }
-        } catch (Throwable t) { hasSwapGroupNV=-1; }
+        } catch (final Throwable t) { hasSwapGroupNV=-1; }
       }
       return res;
   }
 
   @Override
-  public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {
+  public final ByteBuffer glAllocateMemoryNV(final int size, final float readFrequency, final float writeFrequency, final float priority) {
     return getWGLExt().wglAllocateMemoryNV(size, readFrequency, writeFrequency, priority);
   }
 
   @Override
-  public final void glFreeMemoryNV(ByteBuffer pointer) {
+  public final void glFreeMemoryNV(final ByteBuffer pointer) {
     getWGLExt().wglFreeMemoryNV(pointer);
   }
 
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java
index 66071cb..00b048e 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawable.java
@@ -44,6 +44,8 @@ import javax.media.nativewindow.NativeSurface;
 import javax.media.opengl.GLDrawableFactory;
 import javax.media.opengl.GLException;
 
+import com.jogamp.common.util.PropertyAccess;
+
 import jogamp.nativewindow.windows.GDI;
 import jogamp.opengl.Debug;
 import jogamp.opengl.GLDrawableImpl;
@@ -55,22 +57,22 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
 
   static {
       Debug.initSingleton();
-      PROFILING = Debug.isPropertyDefined("jogl.debug.GLDrawable.profiling", true);
+      PROFILING = PropertyAccess.isPropertyDefined("jogl.debug.GLDrawable.profiling", true);
   }
 
   private static final int PROFILING_TICKS = 200;
   private int  profilingSwapBuffersTicks;
   private long profilingSwapBuffersTime;
 
-  public WindowsWGLDrawable(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
+  public WindowsWGLDrawable(final GLDrawableFactory factory, final NativeSurface comp, final boolean realized) {
     super(factory, comp, realized);
   }
 
   @Override
   protected void setRealizedImpl() {
     if(realized) {
-        NativeSurface ns = getNativeSurface();
-        WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration();
+        final NativeSurface ns = getNativeSurface();
+        final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration)ns.getGraphicsConfiguration();
         config.updateGraphicsConfiguration(getFactory(), ns, null);
         if (DEBUG) {
           System.err.println(getThreadName()+": WindowsWGLDrawable.setRealized(true): "+config);
@@ -79,7 +81,7 @@ public abstract class WindowsWGLDrawable extends GLDrawableImpl {
   }
 
   @Override
-  protected final void swapBuffersImpl(boolean doubleBuffered) {
+  protected final void swapBuffersImpl(final boolean doubleBuffered) {
     if(doubleBuffered) {
         final long t0;
         if (PROFILING) {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
index 7fa8775..fa052d7 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
@@ -68,6 +68,7 @@ import jogamp.nativewindow.windows.GDI;
 import jogamp.nativewindow.windows.GDIDummyUpstreamSurfaceHook;
 import jogamp.nativewindow.windows.GDISurface;
 import jogamp.nativewindow.windows.RegisteredClassFactory;
+import jogamp.opengl.Debug;
 import jogamp.opengl.DesktopGLDynamicLookupHelper;
 import jogamp.opengl.GLContextImpl;
 import jogamp.opengl.GLDrawableFactoryImpl;
@@ -77,17 +78,80 @@ import jogamp.opengl.GLGraphicsConfigurationUtil;
 import jogamp.opengl.SharedResourceRunner;
 
 import com.jogamp.common.nio.PointerBuffer;
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.common.util.ReflectionUtil;
 import com.jogamp.nativewindow.windows.WindowsGraphicsDevice;
 import com.jogamp.opengl.GLExtensions;
 import com.jogamp.opengl.GLRendererQuirks;
 
 public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
+  /**
+   * Bug 1036: NVidia Windows Driver 'Threaded optimization' workaround.
+   * <p>
+   * https://jogamp.org/bugzilla/show_bug.cgi?id=1036
+   * </p>
+   * <p>
+   * Since NV driver 260.99 from 2010-12-11 a 'Threaded optimization' feature has been introduced.
+   * The driver spawns off a dedicated thread to off-load certain OpenGL tasks from the calling thread
+   * to perform them async and off-thread.
+   * </p>
+   * <p>
+   * If 'Threaded optimization' is manually enabled 'on', the driver may crash with JOGL's consistent
+   * multi-threaded usage - this is a driver bug.
+   * </p>
+   * <p>
+   * If 'Threaded optimization' is manually disabled 'off', the driver always works correctly.
+   * </p>
+   * <p>
+   * 'Threaded optimization' default setting is 'auto' and the driver may crash without this workaround.
+   * </p>
+   * <p>
+   * If setting the process affinity to '1' (1st CPU) while initialization and launching
+   * the  {@link SharedResourceRunner}, the driver does not crash anymore in 'auto' mode.
+   * This might be either because the driver does not enable 'Threaded optimization'
+   * or because the driver's worker thread is bound to the same CPU.
+   * </p>
+   * <p>
+   * Property integer value <code>jogl.windows.cpu_affinity_mode</code>:
+   * <ul>
+   *   <li>0 - none (no affinity, may cause driver crash with 'Threaded optimization' = ['auto', 'on'])</li>
+   *   <li>1 - process affinity (default, workaround for driver crash for 'Threaded optimization' = 'auto', still crashes if set to 'on')</li>
+   * </ul>
+   * </p>
+   * <p>
+   * Test case reproducing the crash reliable is: com.jogamp.opengl.test.junit.jogl.caps.TestTranslucencyNEWT<br>
+   * (don't ask why ..)
+   * </p>
+   */
+  private static final int CPU_AFFINITY_MODE;
+
+  static {
+      Debug.initSingleton();
+      CPU_AFFINITY_MODE = PropertyAccess.getIntProperty("jogl.windows.cpu_affinity_mode", true, 1);
+  }
+
   private static DesktopGLDynamicLookupHelper windowsWGLDynamicLookupHelper = null;
 
+  private final CPUAffinity cpuAffinity;
+
   public WindowsWGLDrawableFactory() {
     super();
 
+    switch( CPU_AFFINITY_MODE ) {
+        case 0:
+            cpuAffinity = new NopCPUAffinity();
+            break;
+        /**
+         * Doesn't work !
+        case 2:
+            cpuAffinity = new WindowsThreadAffinity();
+            break;
+         */
+        default:
+            cpuAffinity = new WindowsProcessAffinity();
+            break;
+    }
+
     synchronized(WindowsWGLDrawableFactory.class) {
         if( null == windowsWGLDynamicLookupHelper ) {
             windowsWGLDynamicLookupHelper = AccessController.doPrivileged(new PrivilegedAction<DesktopGLDynamicLookupHelper>() {
@@ -99,7 +163,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
                         if(null!=tmp && tmp.isLibComplete()) {
                             WGL.getWGLProcAddressTable().reset(tmp);
                         }
-                    } catch (Exception ex) {
+                    } catch (final Exception ex) {
                         tmp = null;
                         if(DEBUG) {
                             ex.printStackTrace();
@@ -121,7 +185,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
             try {
               ReflectionUtil.callStaticMethod("jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory",
                                               "registerFactory", null, null, getClass().getClassLoader());
-            } catch (Exception jre) { /* n/a .. */ }
+            } catch (final Exception jre) { /* n/a .. */ }
         }
 
         sharedMap = new HashMap<String, SharedResourceRunner.Resource>();
@@ -164,49 +228,27 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  public GLDynamicLookupHelper getGLDynamicLookupHelper(int profile) {
+  public GLDynamicLookupHelper getGLDynamicLookupHelper(final int profile) {
       return windowsWGLDynamicLookupHelper;
   }
 
+  /* pp */ static String toHexString(final long l) { return "0x"+Long.toHexString(l); }
+
   private WindowsGraphicsDevice defaultDevice;
   private SharedResourceRunner sharedResourceRunner;
   private HashMap<String /*connection*/, SharedResourceRunner.Resource> sharedMap;
 
-  private long processAffinityChanges = 0;
-  private final PointerBuffer procMask = PointerBuffer.allocateDirect(1);
-  private final PointerBuffer sysMask = PointerBuffer.allocateDirect(1);
-
   @Override
   protected void enterThreadCriticalZone() {
-    synchronized (sysMask) {
-        if( 0 == processAffinityChanges) {
-            long pid = GDI.GetCurrentProcess();
-            if ( GDI.GetProcessAffinityMask(pid, procMask, sysMask) ) {
-                if(DEBUG) {
-                    System.err.println("WindowsWGLDrawableFactory.enterThreadCriticalZone() - 0x" + Long.toHexString(pid) + " - " + getThreadName());
-                    // Thread.dumpStack();
-                }
-                processAffinityChanges = pid;
-                GDI.SetProcessAffinityMask(pid, 1);
-            }
-        }
+    synchronized (cpuAffinity) {
+        cpuAffinity.set(1);
     }
   }
 
   @Override
   protected void leaveThreadCriticalZone() {
-    synchronized (sysMask) {
-        if( 0 != processAffinityChanges) {
-            long pid = GDI.GetCurrentProcess();
-            if( pid != processAffinityChanges) {
-                throw new GLException("PID doesn't match: set PID 0x" + Long.toHexString(processAffinityChanges) +
-                                                       " this PID 0x" + Long.toHexString(pid) );
-            }
-            if(DEBUG) {
-                System.err.println("WindowsWGLDrawableFactory.leaveThreadCriticalZone() - 0x" + Long.toHexString(pid) + " - " + getThreadName());
-            }
-            GDI.SetProcessAffinityMask(pid, sysMask.get(0));
-        }
+    synchronized (cpuAffinity) {
+        cpuAffinity.reset();
     }
   }
 
@@ -220,8 +262,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
       private GLDrawableImpl drawable;
       private GLContextImpl context;
 
-      SharedResource(WindowsGraphicsDevice dev, AbstractGraphicsScreen scrn, GLDrawableImpl draw, GLContextImpl ctx,
-                     boolean arbPixelFormat, boolean arbMultisample, boolean arbPBuffer, boolean arbReadDrawable) {
+      SharedResource(final WindowsGraphicsDevice dev, final AbstractGraphicsScreen scrn, final GLDrawableImpl draw, final GLContextImpl ctx,
+                     final boolean arbPixelFormat, final boolean arbMultisample, final boolean arbPBuffer, final boolean arbReadDrawable) {
           device = dev;
           screen = scrn;
           drawable = draw;
@@ -261,11 +303,11 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
             sharedMap.clear();
         }
         @Override
-        public SharedResourceRunner.Resource mapPut(String connection, SharedResourceRunner.Resource resource) {
+        public SharedResourceRunner.Resource mapPut(final String connection, final SharedResourceRunner.Resource resource) {
             return sharedMap.put(connection, resource);
         }
         @Override
-        public SharedResourceRunner.Resource mapGet(String connection) {
+        public SharedResourceRunner.Resource mapGet(final String connection) {
             return sharedMap.get(connection);
         }
         @Override
@@ -276,12 +318,12 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
         }
 
         @Override
-        public boolean isDeviceSupported(String connection) {
+        public boolean isDeviceSupported(final String connection) {
             return true;
         }
 
         @Override
-        public SharedResourceRunner.Resource createSharedResource(String connection) {
+        public SharedResourceRunner.Resource createSharedResource(final String connection) {
             final WindowsGraphicsDevice sharedDevice = new WindowsGraphicsDevice(connection, AbstractGraphicsDevice.DEFAULT_UNIT);
             sharedDevice.lock();
             try {
@@ -324,7 +366,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
                 return new SharedResource(sharedDevice, absScreen, sharedDrawable, sharedContext,
                                           hasARBPixelFormat, hasARBMultisample,
                                           hasARBPBuffer, hasARBReadDrawableAvailable);
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 throw new GLException("WindowsWGLDrawableFactory - Could not initialize shared resources for "+connection, t);
             } finally {
                 sharedDevice.unlock();
@@ -332,8 +374,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
         }
 
         @Override
-        public void releaseSharedResource(SharedResourceRunner.Resource shared) {
-            SharedResource sr = (SharedResource) shared;
+        public void releaseSharedResource(final SharedResourceRunner.Resource shared) {
+            final SharedResource sr = (SharedResource) shared;
             if (DEBUG) {
               System.err.println("Shutdown Shared:");
               System.err.println("Device  : " + sr.device);
@@ -344,6 +386,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
 
             if (null != sr.context) {
                 // may cause JVM SIGSEGV: sharedContext.destroy();
+                sr.context.destroy(); // will also pull the dummy MutableSurface
                 sr.context = null;
             }
 
@@ -369,7 +412,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
+  public final boolean getIsDeviceCompatible(final AbstractGraphicsDevice device) {
       if(null!=windowsWGLDynamicLookupHelper && device instanceof WindowsGraphicsDevice) {
           return true;
       }
@@ -389,12 +432,12 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  protected final SharedResource getOrCreateSharedResourceImpl(AbstractGraphicsDevice device) {
+  protected final SharedResource getOrCreateSharedResourceImpl(final AbstractGraphicsDevice device) {
     return (SharedResource) sharedResourceRunner.getOrCreateShared(device);
   }
 
-  protected final WindowsWGLDrawable getOrCreateSharedDrawable(AbstractGraphicsDevice device) {
-    SharedResourceRunner.Resource sr = getOrCreateSharedResourceImpl(device);
+  protected final WindowsWGLDrawable getOrCreateSharedDrawable(final AbstractGraphicsDevice device) {
+    final SharedResourceRunner.Resource sr = getOrCreateSharedResourceImpl(device);
     if(null!=sr) {
         return (WindowsWGLDrawable) sr.getDrawable();
     }
@@ -402,12 +445,12 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(AbstractGraphicsDevice device) {
+  protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(final AbstractGraphicsDevice device) {
     return WindowsWGLGraphicsConfigurationFactory.getAvailableCapabilities(this, device);
   }
 
   @Override
-  protected final GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
+  protected final GLDrawableImpl createOnscreenDrawableImpl(final NativeSurface target) {
     if (target == null) {
       throw new IllegalArgumentException("Null target");
     }
@@ -419,8 +462,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
     if (target == null) {
       throw new IllegalArgumentException("Null target");
     }
-    AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
-    GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+    final AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
+    final GLCapabilitiesImmutable chosenCaps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
     if(!chosenCaps.isPBuffer()) {
         return WindowsBitmapWGLDrawable.create(this, target);
     }
@@ -435,7 +478,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
      */
     final SharedResource sr = getOrCreateSharedResourceImpl(device);
     if(null!=sr) {
-        GLContext lastContext = GLContext.getCurrent();
+        final GLContext lastContext = GLContext.getCurrent();
         if (lastContext != null) {
             lastContext.release();
         }
@@ -458,8 +501,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
    * @return 1 if read drawable extension is available, 0 if not
    *           and -1 if undefined yet, ie no shared device exist at this point.
    */
-  public final int isReadDrawableAvailable(AbstractGraphicsDevice device) {
-    SharedResource sr = getOrCreateSharedResourceImpl( ( null != device ) ? device : defaultDevice );
+  public final int isReadDrawableAvailable(final AbstractGraphicsDevice device) {
+    final SharedResource sr = getOrCreateSharedResourceImpl( ( null != device ) ? device : defaultDevice );
     if(null!=sr) {
         return sr.hasReadDrawable() ? 1 : 0 ;
     }
@@ -467,8 +510,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp) {
-    SharedResource sr = getOrCreateSharedResourceImpl( ( null != device ) ? device : defaultDevice );
+  public final boolean canCreateGLPbuffer(final AbstractGraphicsDevice device, final GLProfile glp) {
+    final SharedResource sr = getOrCreateSharedResourceImpl( ( null != device ) ? device : defaultDevice );
     if(null!=sr) {
         return sr.hasARBPBuffer();
     }
@@ -476,9 +519,9 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  protected final ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
-                                                        GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
-                                                        GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
+  protected final ProxySurface createMutableSurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+                                                        final GLCapabilitiesImmutable capsChosen, final GLCapabilitiesImmutable capsRequested,
+                                                        final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstreamHook) {
     final WindowsGraphicsDevice device;
     if(createNewDevice || !(deviceReq instanceof WindowsGraphicsDevice)) {
         device = new WindowsGraphicsDevice(deviceReq.getConnection(), deviceReq.getUnitID());
@@ -494,8 +537,8 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
-                                                   GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
+  public final ProxySurface createDummySurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+                                                   GLCapabilitiesImmutable chosenCaps, final GLCapabilitiesImmutable requestedCaps, final GLCapabilitiesChooser chooser, final int width, final int height) {
     final WindowsGraphicsDevice device;
     if( createNewDevice || !(deviceReq instanceof WindowsGraphicsDevice) ) {
         device = new WindowsGraphicsDevice(deviceReq.getConnection(), deviceReq.getUnitID());
@@ -512,7 +555,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  protected final ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
+  protected final ProxySurface createProxySurfaceImpl(final AbstractGraphicsDevice deviceReq, final int screenIdx, final long windowHandle, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstream) {
     final WindowsGraphicsDevice device = new WindowsGraphicsDevice(deviceReq.getConnection(), deviceReq.getUnitID());
     final AbstractGraphicsScreen screen = new DefaultGraphicsScreen(device, screenIdx);
     final WindowsWGLGraphicsConfiguration cfg = WindowsWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsRequested, capsRequested, chooser, screen);
@@ -525,7 +568,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  public final boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
+  public final boolean canCreateExternalGLDrawable(final AbstractGraphicsDevice device) {
     return true;
   }
 
@@ -535,7 +578,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   static String wglGetLastError() {
-    long err = GDI.GetLastError();
+    final long err = GDI.GetLastError();
     String detail = null;
     switch ((int) err) {
       case GDI.ERROR_SUCCESS:              detail = "ERROR_SUCCESS";                    break;
@@ -556,32 +599,40 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
   private static final int GAMMA_RAMP_LENGTH = 256;
 
   @Override
-  protected final int getGammaRampLength() {
+  protected final int getGammaRampLength(final NativeSurface surface) {
     return GAMMA_RAMP_LENGTH;
   }
 
   @Override
-  protected final boolean setGammaRamp(float[] ramp) {
-    short[] rampData = new short[3 * GAMMA_RAMP_LENGTH];
+  protected final boolean setGammaRamp(final NativeSurface surface, final float[] ramp) {
+    final short[] rampData = new short[3 * GAMMA_RAMP_LENGTH];
     for (int i = 0; i < GAMMA_RAMP_LENGTH; i++) {
-      short scaledValue = (short) (ramp[i] * 65535);
+      final short scaledValue = (short) (ramp[i] * 65535);
       rampData[i] = scaledValue;
       rampData[i +     GAMMA_RAMP_LENGTH] = scaledValue;
       rampData[i + 2 * GAMMA_RAMP_LENGTH] = scaledValue;
     }
 
-    long screenDC = GDI.GetDC(0);
-    boolean res = GDI.SetDeviceGammaRamp(screenDC, ShortBuffer.wrap(rampData));
-    GDI.ReleaseDC(0, screenDC);
+    final long hDC = surface.getSurfaceHandle();
+    if( 0 == hDC ) {
+        return false;
+    }
+    // final long screenDC = GDI.GetDC(0);
+    final boolean res = GDI.SetDeviceGammaRamp(hDC, ShortBuffer.wrap(rampData));
+    // GDI.ReleaseDC(0, screenDC);
     return res;
   }
 
   @Override
-  protected final Buffer getGammaRamp() {
-    ShortBuffer rampData = ShortBuffer.wrap(new short[3 * GAMMA_RAMP_LENGTH]);
-    long screenDC = GDI.GetDC(0);
-    boolean res = GDI.GetDeviceGammaRamp(screenDC, rampData);
-    GDI.ReleaseDC(0, screenDC);
+  protected final Buffer getGammaRamp(final NativeSurface surface) {
+    final ShortBuffer rampData = ShortBuffer.wrap(new short[3 * GAMMA_RAMP_LENGTH]);
+    final long hDC = surface.getSurfaceHandle();
+    if( 0 == hDC ) {
+        return null;
+    }
+    // final long screenDC = GDI.GetDC(0);
+    final boolean res = GDI.GetDeviceGammaRamp(hDC, rampData);
+    // GDI.ReleaseDC(0, screenDC);
     if (!res) {
       return null;
     }
@@ -589,13 +640,167 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  protected final void resetGammaRamp(Buffer originalGammaRamp) {
+  protected final void resetGammaRamp(final NativeSurface surface, final Buffer originalGammaRamp) {
+    if (originalGammaRamp == null) {
+      // getGammaRamp failed earlier
+      return;
+    }
+    final long hDC = surface.getSurfaceHandle();
+    if( 0 == hDC ) {
+        return;
+    }
+    // final long screenDC = GDI.GetDC(0);
+    GDI.SetDeviceGammaRamp(hDC, originalGammaRamp);
+    // GDI.ReleaseDC(0, hDC);
+  }
+
+  @Override
+  protected final void resetGammaRamp(final DeviceScreenID deviceScreenID, final Buffer originalGammaRamp) {
     if (originalGammaRamp == null) {
       // getGammaRamp failed earlier
       return;
     }
-    long screenDC = GDI.GetDC(0);
+    final long screenDC = GDI.GetDC(0);
     GDI.SetDeviceGammaRamp(screenDC, originalGammaRamp);
     GDI.ReleaseDC(0, screenDC);
   }
+
+
+  static interface CPUAffinity {
+      boolean set(final int newAffinity);
+      boolean reset();
+  }
+  static final class WindowsThreadAffinity implements CPUAffinity {
+      private long threadHandle;
+      private long threadOrigAffinity;
+      private long threadNewAffinity;
+      public WindowsThreadAffinity() {
+          threadHandle = 0;
+          threadOrigAffinity = 0;
+          threadNewAffinity = 0;
+      }
+      @Override
+      public boolean set(final int newAffinity) {
+          final long tid = GDI.GetCurrentThread();
+          if( 0 != threadHandle ) {
+              throw new IllegalStateException("Affinity already set");
+          }
+          final long threadLastAffinity = GDI.SetThreadAffinityMask(tid, newAffinity);
+          final int werr = GDI.GetLastError();
+          final boolean res;
+          if( 0 != threadLastAffinity ) {
+              res = true;
+              this.threadHandle = tid;
+              this.threadNewAffinity = newAffinity;
+              this.threadOrigAffinity = threadLastAffinity;
+          } else {
+              res = false;
+          }
+          if(DEBUG) {
+              System.err.println("WindowsThreadAffinity.set() - tid " + toHexString(tid) + " - " + getThreadName() +
+                      ": OK "+res+" (werr "+werr+"), Affinity: "+toHexString(threadOrigAffinity) + " -> " + toHexString(newAffinity));
+          }
+          return res;
+      }
+      @Override
+      public boolean reset() {
+          if( 0 == threadHandle ) {
+              return true;
+          }
+          final long tid = GDI.GetCurrentThread();
+          if( tid != threadHandle) {
+              throw new IllegalStateException("TID doesn't match: set TID " + toHexString(threadHandle) +
+                                                               " this TID " + toHexString(tid) );
+          }
+          final long preThreadAffinity = GDI.SetThreadAffinityMask(threadHandle, threadOrigAffinity);
+          final boolean res = 0 != preThreadAffinity;
+          if(DEBUG) {
+              System.err.println("WindowsThreadAffinity.reset() - tid " + toHexString(threadHandle) + " - " + getThreadName() +
+                      ": OK "+res+" (werr "+GDI.GetLastError()+"), Affinity: "+toHexString(threadNewAffinity)+" -> orig "+ toHexString(threadOrigAffinity));
+          }
+          this.threadHandle = 0;
+          this.threadNewAffinity = this.threadOrigAffinity;
+          return res;
+      }
+  }
+  static final class WindowsProcessAffinity implements CPUAffinity {
+      private long processHandle;
+      private long newAffinity;
+      private final PointerBuffer procMask;
+      private final PointerBuffer sysMask;
+
+      public WindowsProcessAffinity() {
+          processHandle = 0;
+          newAffinity = 0;
+          procMask = PointerBuffer.allocateDirect(1);
+          sysMask = PointerBuffer.allocateDirect(1);
+      }
+      @Override
+      public boolean set(final int newAffinity) {
+          if( 0 != processHandle ) {
+              throw new IllegalStateException("Affinity already set");
+          }
+          final long pid = GDI.GetCurrentProcess();
+          final boolean res;
+          if ( GDI.GetProcessAffinityMask(pid, procMask, sysMask) ) {
+              if( GDI.SetProcessAffinityMask(pid, newAffinity) ) {
+                  this.processHandle = pid;
+                  this.newAffinity = newAffinity;
+                  res = true;
+              } else {
+                  res = false;
+              }
+              if(DEBUG) {
+                  System.err.println("WindowsProcessAffinity.set() - pid " + toHexString(pid) + " - " + getThreadName() +
+                          ": OK "+res+" (werr "+GDI.GetLastError()+"), Affinity: procMask "+ toHexString(procMask.get(0)) + ", sysMask "+ toHexString(sysMask.get(0)) +
+                          " -> "+toHexString(newAffinity));
+              }
+          } else {
+              if(DEBUG) {
+                  System.err.println("WindowsProcessAffinity.set() - pid " + toHexString(pid) + " - " + getThreadName() +
+                          ": Error, could not GetProcessAffinityMask, werr "+GDI.GetLastError());
+              }
+              res = false;
+          }
+          return res;
+      }
+      @Override
+      public boolean reset() {
+          if( 0 == processHandle ) {
+              return true;
+          }
+          final long pid = GDI.GetCurrentProcess();
+          if( pid != processHandle) {
+              throw new IllegalStateException("PID doesn't match: set PID " + toHexString(processHandle) +
+                                                               " this PID " + toHexString(pid) );
+          }
+          final long origProcAffinity = procMask.get(0);
+          final boolean res = GDI.SetProcessAffinityMask(processHandle, origProcAffinity);
+          if(DEBUG) {
+              final int werr = GDI.GetLastError();
+              System.err.println("WindowsProcessAffinity.reset() - pid " + toHexString(processHandle) + " - " + getThreadName() +
+                      ": OK "+res+" (werr "+werr+"), Affinity: "+toHexString(newAffinity)+" -> procMask "+ toHexString(origProcAffinity));
+          }
+          this.processHandle = 0;
+          this.newAffinity = origProcAffinity;
+          return res;
+      }
+  }
+  static final class NopCPUAffinity implements CPUAffinity {
+      public NopCPUAffinity() { }
+      @Override
+      public boolean set(final int newAffinity) {
+          if(DEBUG) {
+              System.err.println("NopCPUAffinity.set() - " + getThreadName());
+          }
+          return false;
+      }
+      @Override
+      public boolean reset() {
+          if(DEBUG) {
+              System.err.println("NopCPUAffinity.reset() - " + getThreadName());
+          }
+          return false;
+      }
+  }
 }
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
index 6098cde..2285ae9 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDynamicLibraryBundleInfo.java
@@ -47,13 +47,13 @@ public final class WindowsWGLDynamicLibraryBundleInfo extends DesktopGLDynamicLi
 
     @Override
     public final List<String> getToolGetProcAddressFuncNameList() {
-        List<String> res = new ArrayList<String>();
+        final List<String> res = new ArrayList<String>();
         res.add("wglGetProcAddress");
         return res;
     }
 
     @Override
-    public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+    public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
         return WGL.wglGetProcAddress(toolGetProcAddressHandle, funcName);
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
index 5dd9f88..465b5f5 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfiguration.java
@@ -66,24 +66,24 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
     private boolean isDetermined = false;
     private boolean isExternal = false;
 
-    WindowsWGLGraphicsConfiguration(AbstractGraphicsScreen screen,
-                                    GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested,
-                                    GLCapabilitiesChooser chooser) {
+    WindowsWGLGraphicsConfiguration(final AbstractGraphicsScreen screen,
+                                    final GLCapabilitiesImmutable capsChosen, final GLCapabilitiesImmutable capsRequested,
+                                    final GLCapabilitiesChooser chooser) {
         super(screen, capsChosen, capsRequested);
         this.chooser=chooser;
         this.isDetermined = false;
     }
 
-    WindowsWGLGraphicsConfiguration(AbstractGraphicsScreen screen,
-                                    WGLGLCapabilities capsChosen, GLCapabilitiesImmutable capsRequested) {
+    WindowsWGLGraphicsConfiguration(final AbstractGraphicsScreen screen,
+                                    final WGLGLCapabilities capsChosen, final GLCapabilitiesImmutable capsRequested) {
         super(screen, capsChosen, capsRequested);
         setCapsPFD(capsChosen);
         this.chooser=null;
     }
 
 
-    static WindowsWGLGraphicsConfiguration createFromExternal(GLDrawableFactory _factory, long hdc, int pfdID,
-                                                             GLProfile glp, AbstractGraphicsScreen screen, boolean onscreen)
+    static WindowsWGLGraphicsConfiguration createFromExternal(final GLDrawableFactory _factory, final long hdc, final int pfdID,
+                                                             GLProfile glp, final AbstractGraphicsScreen screen, final boolean onscreen)
     {
         if(_factory==null) {
             throw new GLException("Null factory");
@@ -97,10 +97,10 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         if(null==glp) {
           glp = GLProfile.getDefault(screen.getDevice());
         }
-        WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory;
-        AbstractGraphicsDevice device = screen.getDevice();
-        WindowsWGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
-        boolean hasARB = null != sharedResource && sharedResource.hasARBPixelFormat();
+        final WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory;
+        final AbstractGraphicsDevice device = screen.getDevice();
+        final WindowsWGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
+        final boolean hasARB = null != sharedResource && sharedResource.hasARBPixelFormat();
 
         WGLGLCapabilities caps = null;
 
@@ -114,7 +114,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
                                   ", pfdID "+pfdID+", onscreen "+onscreen+", hasARB "+hasARB);
         }
 
-        WindowsWGLGraphicsConfiguration cfg = new WindowsWGLGraphicsConfiguration(screen, caps, caps);
+        final WindowsWGLGraphicsConfiguration cfg = new WindowsWGLGraphicsConfiguration(screen, caps, caps);
         cfg.markExternal();
         return cfg;
     }
@@ -136,7 +136,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
      * @see #isDetermined()
      * @see #isExternal()
      */
-    public final void updateGraphicsConfiguration(GLDrawableFactory factory, NativeSurface ns, int[] pfIDs) {
+    public final void updateGraphicsConfiguration(final GLDrawableFactory factory, final NativeSurface ns, final int[] pfIDs) {
         WindowsWGLGraphicsConfigurationFactory.updateGraphicsConfiguration(chooser, factory, ns, pfIDs);
     }
 
@@ -150,15 +150,15 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
      *
      * @see #isDetermined()
      */
-    public final void preselectGraphicsConfiguration(GLDrawableFactory factory, int[] pfdIDs) {
-        AbstractGraphicsDevice device = getScreen().getDevice();
+    public final void preselectGraphicsConfiguration(final GLDrawableFactory factory, final int[] pfdIDs) {
+        final AbstractGraphicsDevice device = getScreen().getDevice();
         WindowsWGLGraphicsConfigurationFactory.preselectGraphicsConfiguration(chooser, factory, device, this, pfdIDs);
     }
 
     /**
      * Sets the hdc's PixelFormat, this configuration's capabilities and marks it as determined.
      */
-    final void setPixelFormat(long hdc, WGLGLCapabilities caps) {
+    final void setPixelFormat(final long hdc, final WGLGLCapabilities caps) {
         if (0 == hdc) {
             throw new GLException("Error: HDC is null");
         }
@@ -170,12 +170,12 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         }
         if( !caps.isBackgroundOpaque() ) {
             final long hwnd = GDI.WindowFromDC(hdc);
-            DWM_BLURBEHIND bb = DWM_BLURBEHIND.create();
+            final DWM_BLURBEHIND bb = DWM_BLURBEHIND.create();
             bb.setDwFlags(GDI.DWM_BB_ENABLE| GDI.DWM_BB_TRANSITIONONMAXIMIZED);
             bb.setFEnable( 1 );
             boolean ok = GDI.DwmEnableBlurBehindWindow(hwnd, bb);
             if( ok ) {
-                MARGINS m = MARGINS.create();
+                final MARGINS m = MARGINS.create();
                 m.setCxLeftWidth(-1);
                 m.setCxRightWidth(-1);
                 m.setCyBottomHeight(-1);
@@ -198,7 +198,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
      * Only sets this configuration's capabilities and marks it as determined,
      * the actual pixelformat is not set.
      */
-    final void setCapsPFD(WGLGLCapabilities caps) {
+    final void setCapsPFD(final WGLGLCapabilities caps) {
         setChosenCapabilities(caps);
         this.isDetermined = true;
         if (DEBUG) {
@@ -228,7 +228,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
     public final int getPixelFormatID() { return isDetermined ? ((WGLGLCapabilities)capabilitiesChosen).getPFDID() : 0; }
     public final boolean isChoosenByARB() { return isDetermined ? ((WGLGLCapabilities)capabilitiesChosen).isSetByARB() : false; }
 
-    static int fillAttribsForGeneralWGLARBQuery(WindowsWGLDrawableFactory.SharedResource sharedResource, IntBuffer iattributes) {
+    static int fillAttribsForGeneralWGLARBQuery(final WindowsWGLDrawableFactory.SharedResource sharedResource, final IntBuffer iattributes) {
         int niattribs = 0;
         iattributes.put(niattribs++, WGLExt.WGL_DRAW_TO_WINDOW_ARB);
         if(sharedResource.hasARBPBuffer()) {
@@ -257,7 +257,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         return niattribs;
     }
 
-    static boolean wglARBPFIDValid(WindowsWGLContext sharedCtx, long hdc, int pfdID) {
+    static boolean wglARBPFIDValid(final WindowsWGLContext sharedCtx, final long hdc, final int pfdID) {
         final IntBuffer out = Buffers.newDirectIntBuffer(1);
         final IntBuffer in = Buffers.newDirectIntBuffer(1);
         in.put(0, WGLExt.WGL_COLOR_BITS_ARB);
@@ -268,12 +268,12 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         return true;
     }
 
-    static int wglARBPFDIDCount(WindowsWGLContext sharedCtx, long hdc) {
+    static int wglARBPFDIDCount(final WindowsWGLContext sharedCtx, final long hdc) {
         final IntBuffer iresults = Buffers.newDirectIntBuffer(1);
         final IntBuffer iattributes = Buffers.newDirectIntBuffer(1);
         iattributes.put(0, WGLExt.WGL_NUMBER_PIXEL_FORMATS_ARB);
 
-        WGLExt wglExt = sharedCtx.getWGLExt();
+        final WGLExt wglExt = sharedCtx.getWGLExt();
         // pfdID shall be ignored here (spec), however, pass a valid pdf index '1' below (possible driver bug)
         if (!wglExt.wglGetPixelFormatAttribivARB(hdc, 1 /* pfdID */, 0, 1, iattributes, iresults)) {
             if(DEBUG) {
@@ -295,17 +295,17 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         return pfdIDCount;
     }
 
-    static int[] wglAllARBPFDIDs(int pfdIDCount) {
-        int[] pfdIDs = new int[pfdIDCount];
+    static int[] wglAllARBPFDIDs(final int pfdIDCount) {
+        final int[] pfdIDs = new int[pfdIDCount];
         for (int i = 0; i < pfdIDCount; i++) {
             pfdIDs[i] = 1 + i;
         }
         return pfdIDs;
     }
 
-    static WGLGLCapabilities wglARBPFID2GLCapabilities(WindowsWGLDrawableFactory.SharedResource sharedResource,
-                                                       AbstractGraphicsDevice device, GLProfile glp,
-                                                       long hdc, int pfdID, int winattrbits) {
+    static WGLGLCapabilities wglARBPFID2GLCapabilities(final WindowsWGLDrawableFactory.SharedResource sharedResource,
+                                                       final AbstractGraphicsDevice device, final GLProfile glp,
+                                                       final long hdc, final int pfdID, final int winattrbits) {
         if (!sharedResource.hasARBPixelFormat()) {
             return null;
         }
@@ -321,9 +321,9 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         return AttribList2GLCapabilities(device, glp, hdc, pfdID, iattributes, niattribs, iresults, winattrbits);
     }
 
-    static int[] wglChoosePixelFormatARB(WindowsWGLDrawableFactory.SharedResource sharedResource, AbstractGraphicsDevice device,
-                                         GLCapabilitiesImmutable capabilities,
-                                         long hdc, IntBuffer iattributes, int accelerationMode, FloatBuffer fattributes)
+    static int[] wglChoosePixelFormatARB(final WindowsWGLDrawableFactory.SharedResource sharedResource, final AbstractGraphicsDevice device,
+                                         final GLCapabilitiesImmutable capabilities,
+                                         final long hdc, final IntBuffer iattributes, final int accelerationMode, final FloatBuffer fattributes)
     {
 
         if ( !WindowsWGLGraphicsConfiguration.GLCapabilities2AttribList(capabilities,
@@ -361,7 +361,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
             System.err.println("wglChoosePixelFormatARB: NumFormats (wglChoosePixelFormatARB) accelMode 0x"
                     + Integer.toHexString(accelerationMode) + ": " + numFormats);
             for (int i = 0; i < numFormats; i++) {
-                WGLGLCapabilities dbgCaps0 = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(
+                final WGLGLCapabilities dbgCaps0 = WindowsWGLGraphicsConfiguration.wglARBPFID2GLCapabilities(
                                                 sharedResource, device, capabilities.getGLProfile(), hdc, pformats[i], GLGraphicsConfigurationUtil.ALL_BITS);
                 System.err.println("pixel format " + pformats[i] + " (index " + i + "): " + dbgCaps0);
             }
@@ -369,8 +369,8 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         return pformats;
     }
 
-    static List <GLCapabilitiesImmutable> wglARBPFIDs2GLCapabilities(WindowsWGLDrawableFactory.SharedResource sharedResource,
-                                                                     AbstractGraphicsDevice device, GLProfile glp, long hdc, int[] pfdIDs, int winattrbits, boolean onlyFirstValid) {
+    static List <GLCapabilitiesImmutable> wglARBPFIDs2GLCapabilities(final WindowsWGLDrawableFactory.SharedResource sharedResource,
+                                                                     final AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int[] pfdIDs, final int winattrbits, final boolean onlyFirstValid) {
         if (!sharedResource.hasARBPixelFormat()) {
             return null;
         }
@@ -380,7 +380,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         final IntBuffer iresults = Buffers.newDirectIntBuffer(2*MAX_ATTRIBS);
         final int niattribs = fillAttribsForGeneralWGLARBQuery(sharedResource, iattributes);
 
-        ArrayList<GLCapabilitiesImmutable> bucket = new ArrayList<GLCapabilitiesImmutable>();
+        final ArrayList<GLCapabilitiesImmutable> bucket = new ArrayList<GLCapabilitiesImmutable>();
 
         for(int i = 0; i<numFormats; i++) {
             if ( pfdIDs[i] >= 1 &&
@@ -396,7 +396,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
                         break;
                     }
                 } else if(DEBUG) {
-                    GLCapabilitiesImmutable skipped = AttribList2GLCapabilities(device, glp, hdc, pfdIDs[i], iattributes, niattribs, iresults, GLGraphicsConfigurationUtil.ALL_BITS);
+                    final GLCapabilitiesImmutable skipped = AttribList2GLCapabilities(device, glp, hdc, pfdIDs[i], iattributes, niattribs, iresults, GLGraphicsConfigurationUtil.ALL_BITS);
                     System.err.println("wglARBPFIDs2GLCapabilities: bucket["+i+" -> skip]: pfdID "+pfdIDs[i]+", "+skipped+", winattr "+GLGraphicsConfigurationUtil.winAttributeBits2String(null, winattrbits).toString());
                 }
             } else if (DEBUG) {
@@ -411,11 +411,11 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         return bucket;
     }
 
-    static boolean GLCapabilities2AttribList(GLCapabilitiesImmutable caps,
-                                             IntBuffer iattributes,
-                                             WindowsWGLDrawableFactory.SharedResource sharedResource,
-                                             int accelerationValue,
-                                             int[] floatMode) throws GLException {
+    static boolean GLCapabilities2AttribList(final GLCapabilitiesImmutable caps,
+                                             final IntBuffer iattributes,
+                                             final WindowsWGLDrawableFactory.SharedResource sharedResource,
+                                             final int accelerationValue,
+                                             final int[] floatMode) throws GLException {
         if (!sharedResource.hasARBPixelFormat()) {
           return false;
         }
@@ -539,14 +539,14 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
 
     static WGLGLCapabilities AttribList2GLCapabilities(final AbstractGraphicsDevice device,
                                                        final GLProfile glp, final long hdc, final int pfdID,
-                                                       final IntBuffer iattribs, final int niattribs, IntBuffer iresults, final int winattrmask) {
+                                                       final IntBuffer iattribs, final int niattribs, final IntBuffer iresults, final int winattrmask) {
         final int allDrawableTypeBits = AttribList2DrawableTypeBits(iattribs, niattribs, iresults);
         int drawableTypeBits = winattrmask & allDrawableTypeBits;
 
         if( 0 == drawableTypeBits ) {
             return null;
         }
-        PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor();
+        final PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor();
 
         if (WGLUtil.DescribePixelFormat(hdc, pfdID, PIXELFORMATDESCRIPTOR.size(), pfd) == 0) {
             // remove displayable bits, since pfdID is non displayable
@@ -565,23 +565,23 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
     // GDI PIXELFORMAT
     //
 
-    static int[] wglAllGDIPFIDs(long hdc) {
-        int numFormats = WGLUtil.DescribePixelFormat(hdc, 1, 0, null);
+    static int[] wglAllGDIPFIDs(final long hdc) {
+        final int numFormats = WGLUtil.DescribePixelFormat(hdc, 1, 0, null);
         if (numFormats == 0) {
             throw new GLException("DescribePixelFormat: No formats - HDC 0x" + Long.toHexString(hdc) +
                                   ", LastError: " + GDI.GetLastError());
         }
-        int[] pfdIDs = new int[numFormats];
+        final int[] pfdIDs = new int[numFormats];
         for (int i = 0; i < numFormats; i++) {
             pfdIDs[i] = 1 + i;
         }
         return pfdIDs;
     }
 
-    static int PFD2DrawableTypeBits(PIXELFORMATDESCRIPTOR pfd) {
+    static int PFD2DrawableTypeBits(final PIXELFORMATDESCRIPTOR pfd) {
         int val = 0;
 
-        int dwFlags = pfd.getDwFlags();
+        final int dwFlags = pfd.getDwFlags();
 
         if( 0 != (GDI.PFD_DRAW_TO_WINDOW & dwFlags ) ) {
             val |= GLGraphicsConfigurationUtil.WINDOW_BIT |
@@ -593,8 +593,8 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         return val;
     }
 
-    static WGLGLCapabilities PFD2GLCapabilities(AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID, final int winattrmask) {
-        PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor(hdc, pfdID);
+    static WGLGLCapabilities PFD2GLCapabilities(final AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID, final int winattrmask) {
+        final PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor(hdc, pfdID);
         if(null == pfd) {
             return null;
         }
@@ -626,12 +626,12 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         return (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res);
    }
 
-    static WGLGLCapabilities PFD2GLCapabilitiesNoCheck(AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID) {
-        PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor(hdc, pfdID);
+    static WGLGLCapabilities PFD2GLCapabilitiesNoCheck(final AbstractGraphicsDevice device, final GLProfile glp, final long hdc, final int pfdID) {
+        final PIXELFORMATDESCRIPTOR pfd = createPixelFormatDescriptor(hdc, pfdID);
         return PFD2GLCapabilitiesNoCheck(device, glp, pfd, pfdID);
    }
 
-   static WGLGLCapabilities PFD2GLCapabilitiesNoCheck(AbstractGraphicsDevice device, GLProfile glp, PIXELFORMATDESCRIPTOR pfd, int pfdID) {
+   static WGLGLCapabilities PFD2GLCapabilitiesNoCheck(final AbstractGraphicsDevice device, final GLProfile glp, final PIXELFORMATDESCRIPTOR pfd, final int pfdID) {
         if(null == pfd) {
             return null;
         }
@@ -641,8 +641,8 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
         return (WGLGLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, PFD2DrawableTypeBits(pfd), res);
    }
 
-   static PIXELFORMATDESCRIPTOR GLCapabilities2PFD(GLCapabilitiesImmutable caps, PIXELFORMATDESCRIPTOR pfd) {
-       int colorDepth = (caps.getRedBits() +
+   static PIXELFORMATDESCRIPTOR GLCapabilities2PFD(final GLCapabilitiesImmutable caps, final PIXELFORMATDESCRIPTOR pfd) {
+       final int colorDepth = (caps.getRedBits() +
                caps.getGreenBits() +
                caps.getBlueBits());
        if (colorDepth < 15) {
@@ -680,7 +680,7 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
        pfd.setCGreenBits((byte) caps.getGreenBits());
        pfd.setCBlueBits ((byte) caps.getBlueBits());
        pfd.setCAlphaBits((byte) caps.getAlphaBits());
-       int accumDepth = (caps.getAccumRedBits() +
+       final int accumDepth = (caps.getAccumRedBits() +
                caps.getAccumGreenBits() +
                caps.getAccumBlueBits());
        pfd.setCAccumBits     ((byte) accumDepth);
@@ -699,8 +699,8 @@ public class WindowsWGLGraphicsConfiguration extends MutableGraphicsConfiguratio
        return pfd;
    }
 
-   static PIXELFORMATDESCRIPTOR createPixelFormatDescriptor(long hdc, int pfdID) {
-       PIXELFORMATDESCRIPTOR pfd = PIXELFORMATDESCRIPTOR.create();
+   static PIXELFORMATDESCRIPTOR createPixelFormatDescriptor(final long hdc, final int pfdID) {
+       final PIXELFORMATDESCRIPTOR pfd = PIXELFORMATDESCRIPTOR.create();
        pfd.setNSize((short) PIXELFORMATDESCRIPTOR.size());
        pfd.setNVersion((short) 1);
        if(0 != hdc && 1 <= pfdID) {
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
index 969e45e..ea92b38 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLGraphicsConfigurationFactory.java
@@ -81,7 +81,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
 
     @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+            final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested, final CapabilitiesChooser chooser, final AbstractGraphicsScreen absScreen, final int nativeVisualID) {
 
         if (! (capsChosen instanceof GLCapabilitiesImmutable) ) {
             throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilities objects - chosen");
@@ -98,14 +98,14 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
         return chooseGraphicsConfigurationStatic((GLCapabilitiesImmutable)capsChosen, (GLCapabilitiesImmutable)capsRequested, (GLCapabilitiesChooser)chooser, absScreen);
     }
 
-    static WindowsWGLGraphicsConfiguration createDefaultGraphicsConfiguration(GLCapabilitiesImmutable caps,
-                                                                              AbstractGraphicsScreen absScreen) {
+    static WindowsWGLGraphicsConfiguration createDefaultGraphicsConfiguration(final GLCapabilitiesImmutable caps,
+                                                                              final AbstractGraphicsScreen absScreen) {
         return chooseGraphicsConfigurationStatic(caps, caps, null, absScreen);
     }
 
     static WindowsWGLGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
-                                                                             GLCapabilitiesImmutable capsReq,
-                                                                             GLCapabilitiesChooser chooser,
+                                                                             final GLCapabilitiesImmutable capsReq,
+                                                                             final GLCapabilitiesChooser chooser,
                                                                              AbstractGraphicsScreen absScreen) {
         if(null==absScreen) {
             absScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_WINDOWS);
@@ -115,7 +115,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
         return new WindowsWGLGraphicsConfiguration( absScreen, capsChosen, capsReq, chooser );
     }
 
-    protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(WindowsWGLDrawableFactory factory, AbstractGraphicsDevice device) {
+    protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(final WindowsWGLDrawableFactory factory, final AbstractGraphicsDevice device) {
         final WindowsWGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
         if(null == sharedResource) {
             throw new GLException("Shared resource for device n/a: "+device);
@@ -136,7 +136,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
             sharedDrawable.lockSurface();
         }
         try {
-            long hdc = sharedDrawable.getHandle();
+            final long hdc = sharedDrawable.getHandle();
             if (0 == hdc) {
                 throw new GLException("Error: HDC is null");
             }
@@ -164,17 +164,17 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
         return availableCaps;
     }
 
-    private static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesARB(WindowsWGLDrawableFactory.SharedResource sharedResource, AbstractGraphicsDevice device, GLProfile glProfile, long hdc) {
+    private static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesARB(final WindowsWGLDrawableFactory.SharedResource sharedResource, final AbstractGraphicsDevice device, final GLProfile glProfile, final long hdc) {
         final int pfdIDCount = WindowsWGLGraphicsConfiguration.wglARBPFDIDCount((WindowsWGLContext)sharedResource.getContext(), hdc);
         final int[] pformats = WindowsWGLGraphicsConfiguration.wglAllARBPFDIDs(pfdIDCount);
         return WindowsWGLGraphicsConfiguration.wglARBPFIDs2GLCapabilities(sharedResource, device, glProfile, hdc, pformats,
                 GLGraphicsConfigurationUtil.ALL_BITS & ~GLGraphicsConfigurationUtil.BITMAP_BIT, false); // w/o BITMAP
     }
 
-    private static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesGDI(AbstractGraphicsDevice device, GLProfile glProfile, long hdc, boolean bitmapOnly) {
-        int[] pformats = WindowsWGLGraphicsConfiguration.wglAllGDIPFIDs(hdc);
-        int numFormats = pformats.length;
-        List<GLCapabilitiesImmutable> bucket = new ArrayList<GLCapabilitiesImmutable>(numFormats);
+    private static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesGDI(final AbstractGraphicsDevice device, final GLProfile glProfile, final long hdc, final boolean bitmapOnly) {
+        final int[] pformats = WindowsWGLGraphicsConfiguration.wglAllGDIPFIDs(hdc);
+        final int numFormats = pformats.length;
+        final List<GLCapabilitiesImmutable> bucket = new ArrayList<GLCapabilitiesImmutable>(numFormats);
         for (int i = 0; i < numFormats; i++) {
             final GLCapabilitiesImmutable caps = WindowsWGLGraphicsConfiguration.PFD2GLCapabilities(device, glProfile, hdc, pformats[i],
                  bitmapOnly ? GLGraphicsConfigurationUtil.BITMAP_BIT : GLGraphicsConfigurationUtil.ALL_BITS );
@@ -192,8 +192,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
      * @param ns
      * @param pfIDs optional pool of preselected PixelFormat IDs, maybe null for unrestricted selection
      */
-    static void updateGraphicsConfiguration(CapabilitiesChooser chooser,
-                                            GLDrawableFactory factory, NativeSurface ns, int[] pfdIDs) {
+    static void updateGraphicsConfiguration(final CapabilitiesChooser chooser,
+                                            final GLDrawableFactory factory, final NativeSurface ns, final int[] pfdIDs) {
         if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
             throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
         }
@@ -208,11 +208,11 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
             throw new GLException("Surface not ready (lockSurface)");
         }
         try {
-            long hdc = ns.getSurfaceHandle();
+            final long hdc = ns.getSurfaceHandle();
             if (0 == hdc) {
                 throw new GLException("Error: HDC is null");
             }
-            WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) ns.getGraphicsConfiguration();
+            final WindowsWGLGraphicsConfiguration config = (WindowsWGLGraphicsConfiguration) ns.getGraphicsConfiguration();
 
             if( !config.isExternal() ) {
                 if( !config.isDetermined() ) {
@@ -239,9 +239,9 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
         }
     }
 
-    static void preselectGraphicsConfiguration(CapabilitiesChooser chooser,
-                                               GLDrawableFactory _factory, AbstractGraphicsDevice device,
-                                               WindowsWGLGraphicsConfiguration config, int[] pfdIDs) {
+    static void preselectGraphicsConfiguration(final CapabilitiesChooser chooser,
+                                               final GLDrawableFactory _factory, final AbstractGraphicsDevice device,
+                                               final WindowsWGLGraphicsConfiguration config, final int[] pfdIDs) {
         if (chooser != null && !(chooser instanceof GLCapabilitiesChooser)) {
             throw new IllegalArgumentException("This NativeWindowFactory accepts only GLCapabilitiesChooser objects");
         }
@@ -254,8 +254,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
         if ( !(_factory instanceof WindowsWGLDrawableFactory) ) {
             throw new GLException("GLDrawableFactory is not a WindowsWGLDrawableFactory, but: "+_factory.getClass().getSimpleName());
         }
-        WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory;
-        WindowsWGLDrawable sharedDrawable = factory.getOrCreateSharedDrawable(device);
+        final WindowsWGLDrawableFactory factory = (WindowsWGLDrawableFactory) _factory;
+        final WindowsWGLDrawable sharedDrawable = factory.getOrCreateSharedDrawable(device);
         if(null == sharedDrawable) {
             throw new IllegalArgumentException("Shared Drawable is null");
         }
@@ -264,7 +264,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
             throw new GLException("Shared Surface not ready (lockSurface): "+device+" -> "+sharedDrawable);
         }
         try {
-            long hdc = sharedDrawable.getHandle();
+            final long hdc = sharedDrawable.getHandle();
             if (0 == hdc) {
                 throw new GLException("Error: HDC is null");
             }
@@ -274,8 +274,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
         }
     }
 
-    private static void updateGraphicsConfiguration(WindowsWGLGraphicsConfiguration config, CapabilitiesChooser chooser,
-                                                    GLDrawableFactory factory, long hdc, boolean extHDC, int[] pfdIDs) {
+    private static void updateGraphicsConfiguration(final WindowsWGLGraphicsConfiguration config, final CapabilitiesChooser chooser,
+                                                    final GLDrawableFactory factory, final long hdc, final boolean extHDC, final int[] pfdIDs) {
         if (DEBUG) {
             if(extHDC) {
                 System.err.println("updateGraphicsConfiguration(using shared): hdc "+toHexString(hdc));
@@ -284,8 +284,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
             }
             System.err.println("user chosen caps " + config.getChosenCapabilities());
         }
-        AbstractGraphicsDevice device = config.getScreen().getDevice();
-        WindowsWGLDrawableFactory.SharedResource sharedResource = ((WindowsWGLDrawableFactory)factory).getOrCreateSharedResourceImpl(device);
+        final AbstractGraphicsDevice device = config.getScreen().getDevice();
+        final WindowsWGLDrawableFactory.SharedResource sharedResource = ((WindowsWGLDrawableFactory)factory).getOrCreateSharedResourceImpl(device);
         final GLContext sharedContext;
         if ( factory.hasRendererQuirk(device, GLRendererQuirks.NeedCurrCtx4ARBPixFmtQueries) ) {
             sharedContext = sharedResource.getContext();
@@ -311,8 +311,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
         }
     }
 
-    private static boolean updateGraphicsConfigurationARB(WindowsWGLDrawableFactory factory, WindowsWGLGraphicsConfiguration config, CapabilitiesChooser chooser,
-                                                          long hdc, boolean extHDC, int[] pformats) {
+    private static boolean updateGraphicsConfigurationARB(final WindowsWGLDrawableFactory factory, final WindowsWGLGraphicsConfiguration config, final CapabilitiesChooser chooser,
+                                                          final long hdc, final boolean extHDC, int[] pformats) {
         final AbstractGraphicsDevice device = config.getScreen().getDevice();
         final WindowsWGLDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
 
@@ -462,8 +462,8 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
         return true;
     }
 
-    private static boolean updateGraphicsConfigurationGDI(WindowsWGLGraphicsConfiguration config, CapabilitiesChooser chooser, long hdc,
-                                                          boolean extHDC, int[] pformats) {
+    private static boolean updateGraphicsConfigurationGDI(final WindowsWGLGraphicsConfiguration config, final CapabilitiesChooser chooser, final long hdc,
+                                                          final boolean extHDC, int[] pformats) {
         final GLCapabilitiesImmutable capsChosen = (GLCapabilitiesImmutable) config.getChosenCapabilities();
         if( !capsChosen.isOnscreen() && capsChosen.isPBuffer() ) {
             if (DEBUG) {
@@ -557,7 +557,7 @@ public class WindowsWGLGraphicsConfigurationFactory extends GLGraphicsConfigurat
                             System.err.println("updateGraphicsConfigurationGDI: availableCaps["+i+" -> "+j+"]: "+caps);
                         }
                     } else if(DEBUG) {
-                        GLCapabilitiesImmutable skipped = WindowsWGLGraphicsConfiguration.PFD2GLCapabilitiesNoCheck(device, glProfile, hdc, pformats[i]);
+                        final GLCapabilitiesImmutable skipped = WindowsWGLGraphicsConfiguration.PFD2GLCapabilitiesNoCheck(device, glProfile, hdc, pformats[i]);
                         System.err.println("updateGraphicsConfigurationGDI: availableCaps["+i+" -> skip]: pfdID "+pformats[i]+", "+skipped);
                     }
                 }
diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
index 96bd0bd..9e784ad 100644
--- a/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/windows/wgl/awt/WindowsAWTWGLGraphicsConfigurationFactory.java
@@ -70,8 +70,8 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
 
     @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+            final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+            final CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, final int nativeVisualID) {
         GraphicsDevice device = null;
         if (absScreen != null &&
             !(absScreen instanceof AWTGraphicsScreen)) {
@@ -84,7 +84,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
                 System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: creating default device: "+absScreen);
             }
         }
-        AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
+        final AWTGraphicsScreen awtScreen = (AWTGraphicsScreen) absScreen;
         device = ((AWTGraphicsDevice)awtScreen.getDevice()).getGraphicsDevice();
 
         if ( !(capsChosen instanceof GLCapabilitiesImmutable) ) {
@@ -104,10 +104,10 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
             System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: got "+absScreen);
         }
 
-        WindowsGraphicsDevice winDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
-        DefaultGraphicsScreen winScreen = new DefaultGraphicsScreen(winDevice, awtScreen.getIndex());
-        GraphicsConfigurationFactory configFactory = GraphicsConfigurationFactory.getFactory(winDevice, capsChosen);
-        WindowsWGLGraphicsConfiguration winConfig = (WindowsWGLGraphicsConfiguration)
+        final WindowsGraphicsDevice winDevice = new WindowsGraphicsDevice(AbstractGraphicsDevice.DEFAULT_UNIT);
+        final DefaultGraphicsScreen winScreen = new DefaultGraphicsScreen(winDevice, awtScreen.getIndex());
+        final GraphicsConfigurationFactory configFactory = GraphicsConfigurationFactory.getFactory(winDevice, capsChosen);
+        final WindowsWGLGraphicsConfiguration winConfig = (WindowsWGLGraphicsConfiguration)
                                                        configFactory.chooseGraphicsConfiguration(capsChosen,
                                                                                                  capsRequested,
                                                                                                  chooser, winScreen, nativeVisualID);
@@ -115,7 +115,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
             throw new GLException("Unable to choose a GraphicsConfiguration: "+capsChosen+",\n\t"+chooser+"\n\t"+winScreen);
         }
 
-        GLDrawableFactory drawableFactory = GLDrawableFactory.getFactory(((GLCapabilitiesImmutable)capsChosen).getGLProfile());
+        final GLDrawableFactory drawableFactory = GLDrawableFactory.getFactory(((GLCapabilitiesImmutable)capsChosen).getGLProfile());
         GraphicsConfiguration chosenGC = null;
 
         if ( drawableFactory instanceof WindowsWGLDrawableFactory ) {
@@ -133,7 +133,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
                         System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: Found new AWT PFD ID "+winConfig.getPixelFormatID()+" -> "+winConfig);
                     }
                 }
-            } catch (GLException gle0) {
+            } catch (final GLException gle0) {
                 if(DEBUG) {
                     gle0.printStackTrace();
                 }
@@ -150,13 +150,13 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
                 //
 
                 // collect all available PFD IDs
-                GraphicsConfiguration[] configs = device.getConfigurations();
-                int[] pfdIDs = new int[configs.length];
-                ArrayHashSet<Integer> pfdIDOSet = new ArrayHashSet<Integer>();
+                final GraphicsConfiguration[] configs = device.getConfigurations();
+                final int[] pfdIDs = new int[configs.length];
+                final ArrayHashSet<Integer> pfdIDOSet = new ArrayHashSet<Integer>();
                 for (int i = 0; i < configs.length; i++) {
-                    GraphicsConfiguration gc = configs[i];
+                    final GraphicsConfiguration gc = configs[i];
                     pfdIDs[i] = Win32SunJDKReflection.graphicsConfigurationGetPixelFormatID(gc);
-                    pfdIDOSet.add(new Integer(pfdIDs[i]));
+                    pfdIDOSet.add( Integer.valueOf(pfdIDs[i]) );
                     if(DEBUG) {
                         System.err.println("AWT pfd["+i+"] "+pfdIDs[i]);
                     }
@@ -165,7 +165,7 @@ public class WindowsAWTWGLGraphicsConfigurationFactory extends GLGraphicsConfigu
                     System.err.println("WindowsAWTWGLGraphicsConfigurationFactory: PFD IDs: "+pfdIDs.length+", unique: "+pfdIDOSet.size());
                 }
                 winConfig.preselectGraphicsConfiguration(drawableFactory, pfdIDs);
-                int gcIdx = pfdIDOSet.indexOf(new Integer(winConfig.getPixelFormatID()));
+                final int gcIdx = pfdIDOSet.indexOf(Integer.valueOf(winConfig.getPixelFormatID()));
                 if( 0 > gcIdx ) {
                     chosenGC = configs[gcIdx];
                     if(DEBUG) {
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java b/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java
index 12e3db3..1950961 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/GLXUtil.java
@@ -46,7 +46,7 @@ import com.jogamp.nativewindow.x11.X11GraphicsDevice;
 public class GLXUtil {
     public static final boolean DEBUG = Debug.debug("GLXUtil");
 
-    public static synchronized boolean isGLXAvailableOnServer(X11GraphicsDevice x11Device) {
+    public static synchronized boolean isGLXAvailableOnServer(final X11GraphicsDevice x11Device) {
         if(null == x11Device) {
             throw new IllegalArgumentException("null X11GraphicsDevice");
         }
@@ -57,14 +57,14 @@ public class GLXUtil {
         x11Device.lock();
         try {
             glXAvailable = GLX.glXQueryExtension(x11Device.getHandle(), null, null);
-        } catch (Throwable t) { /* n/a */
+        } catch (final Throwable t) { /* n/a */
         } finally {
             x11Device.unlock();
         }
         return glXAvailable;
     }
 
-    public static String getGLXClientString(X11GraphicsDevice x11Device, int name) {
+    public static String getGLXClientString(final X11GraphicsDevice x11Device, final int name) {
         x11Device.lock();
         try {
             return GLX.glXGetClientString(x11Device.getHandle(), name);
@@ -72,7 +72,7 @@ public class GLXUtil {
             x11Device.unlock();
         }
     }
-    public static String queryGLXServerString(X11GraphicsDevice x11Device, int screen_idx, int name) {
+    public static String queryGLXServerString(final X11GraphicsDevice x11Device, final int screen_idx, final int name) {
         x11Device.lock();
         try {
             return GLX.glXQueryServerString(x11Device.getHandle(), screen_idx, name);
@@ -80,7 +80,7 @@ public class GLXUtil {
             x11Device.unlock();
         }
     }
-    public static String queryGLXExtensionsString(X11GraphicsDevice x11Device, int screen_idx) {
+    public static String queryGLXExtensionsString(final X11GraphicsDevice x11Device, final int screen_idx) {
         x11Device.lock();
         try {
             return GLX.glXQueryExtensionsString(x11Device.getHandle(), screen_idx);
@@ -89,7 +89,7 @@ public class GLXUtil {
         }
     }
 
-    public static VersionNumber getGLXServerVersionNumber(X11GraphicsDevice x11Device) {
+    public static VersionNumber getGLXServerVersionNumber(final X11GraphicsDevice x11Device) {
         final IntBuffer major = Buffers.newDirectIntBuffer(1);
         final IntBuffer minor = Buffers.newDirectIntBuffer(1);
 
@@ -102,12 +102,12 @@ public class GLXUtil {
             // Work around bugs in ATI's Linux drivers where they report they
             // only implement GLX version 1.2 on the server side
             if (major.get(0) == 1 && minor.get(0) == 2) {
-              String str = GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_VERSION);
+              final String str = GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_VERSION);
               try {
                   // e.g. "1.3"
-                  major.put(0, Integer.valueOf(str.substring(0, 1)).intValue());
-                  minor.put(0, Integer.valueOf(str.substring(2, 3)).intValue());
-              } catch (Exception e) {
+                  major.put(0, Integer.parseInt(str.substring(0, 1)));
+                  minor.put(0, Integer.parseInt(str.substring(2, 3)));
+              } catch (final Exception e) {
                   major.put(0, 1);
                   minor.put(0, 2);
               }
@@ -118,18 +118,18 @@ public class GLXUtil {
         return new VersionNumber(major.get(0), minor.get(0), 0);
     }
 
-    public static boolean isMultisampleAvailable(String extensions) {
+    public static boolean isMultisampleAvailable(final String extensions) {
         if (extensions != null) {
             return (extensions.indexOf("GLX_ARB_multisample") >= 0);
         }
         return false;
     }
 
-    public static boolean isVendorNVIDIA(String vendor) {
+    public static boolean isVendorNVIDIA(final String vendor) {
         return vendor != null && vendor.startsWith("NVIDIA") ;
     }
 
-    public static boolean isVendorATI(String vendor) {
+    public static boolean isVendorATI(final String vendor) {
         return vendor != null && vendor.startsWith("ATI") ;
     }
 
@@ -143,7 +143,7 @@ public class GLXUtil {
         return clientVersionNumber;
     }
 
-    public static synchronized void initGLXClientDataSingleton(X11GraphicsDevice x11Device) {
+    public static synchronized void initGLXClientDataSingleton(final X11GraphicsDevice x11Device) {
         if(null != clientVendorName) {
             return; // already initialized
         }
@@ -156,14 +156,14 @@ public class GLXUtil {
         clientMultisampleAvailable = isMultisampleAvailable(GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_EXTENSIONS));
         clientVendorName = GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_VENDOR);
 
-        int[] major = new int[1];
-        int[] minor = new int[1];
+        final int[] major = new int[1];
+        final int[] minor = new int[1];
         final String str = GLX.glXGetClientString(x11Device.getHandle(), GLX.GLX_VERSION);
         try {
               // e.g. "1.3"
-              major[0] = Integer.valueOf(str.substring(0, 1)).intValue();
-              minor[0] = Integer.valueOf(str.substring(2, 3)).intValue();
-        } catch (Exception e) {
+              major[0] = Integer.parseInt(str.substring(0, 1));
+              minor[0] = Integer.parseInt(str.substring(2, 3));
+        } catch (final Exception e) {
               major[0] = 1;
               minor[0] = 2;
         }
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
index ff9363c..7040621 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXContext.java
@@ -58,7 +58,7 @@ import com.jogamp.nativewindow.x11.X11GraphicsScreen;
 
 public class X11ExternalGLXContext extends X11GLXContext {
 
-  private X11ExternalGLXContext(Drawable drawable, long ctx) {
+  private X11ExternalGLXContext(final Drawable drawable, final long ctx) {
     super(drawable, null);
     this.contextHandle = ctx;
     GLContextShareSet.contextCreated(this);
@@ -68,20 +68,20 @@ public class X11ExternalGLXContext extends X11GLXContext {
     getGLStateTracker().setEnabled(false); // external context usage can't track state in Java
   }
 
-  protected static X11ExternalGLXContext create(GLDrawableFactory factory, GLProfile glp) {
-    long ctx = GLX.glXGetCurrentContext();
+  protected static X11ExternalGLXContext create(final GLDrawableFactory factory, final GLProfile glp) {
+    final long ctx = GLX.glXGetCurrentContext();
     if (ctx == 0) {
       throw new GLException("Error: current context null");
     }
-    long display = GLX.glXGetCurrentDisplay();
+    final long display = GLX.glXGetCurrentDisplay();
     if (display == 0) {
       throw new GLException("Error: current display null");
     }
-    long drawable = GLX.glXGetCurrentDrawable();
+    final long drawable = GLX.glXGetCurrentDrawable();
     if (drawable == 0) {
       throw new GLException("Error: attempted to make an external GLDrawable without a drawable/context current");
     }
-    IntBuffer val = Buffers.newDirectIntBuffer(1);
+    final IntBuffer val = Buffers.newDirectIntBuffer(1);
 
     int w, h;
     GLX.glXQueryDrawable(display, drawable, GLX.GLX_WIDTH, val);
@@ -90,7 +90,7 @@ public class X11ExternalGLXContext extends X11GLXContext {
     h=val.get(0);
 
     GLX.glXQueryContext(display, ctx, GLX.GLX_SCREEN, val);
-    X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val.get(0), false);
+    final X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val.get(0), false);
 
     GLX.glXQueryContext(display, ctx, GLX.GLX_FBCONFIG_ID, val);
     X11GLXGraphicsConfiguration cfg = null;
@@ -99,7 +99,7 @@ public class X11ExternalGLXContext extends X11GLXContext {
     // create and use a default config (this has been observed when running on CentOS 5.5 inside
     // of VMWare Server 2.0 with the Mesa 6.5.1 drivers)
     if( VisualIDHolder.VID_UNDEFINED == val.get(0) || !X11GLXGraphicsConfiguration.GLXFBConfigIDValid(display, x11Screen.getIndex(), val.get(0)) ) {
-        GLCapabilities glcapsDefault = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities glcapsDefault = new GLCapabilities(GLProfile.getDefault());
         cfg = X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(glcapsDefault, glcapsDefault, null, x11Screen, VisualIDHolder.VID_UNDEFINED);
         if(DEBUG) {
             System.err.println("X11ExternalGLXContext invalid FBCONFIG_ID "+val.get(0)+", using default cfg: " + cfg);
@@ -131,26 +131,26 @@ public class X11ExternalGLXContext extends X11GLXContext {
 
   // Need to provide the display connection to extension querying APIs
   static class Drawable extends X11GLXDrawable {
-    Drawable(GLDrawableFactory factory, NativeSurface comp) {
+    Drawable(final GLDrawableFactory factory, final NativeSurface comp) {
       super(factory, comp, true);
     }
 
     @Override
-    public GLContext createContext(GLContext shareWith) {
+    public GLContext createContext(final GLContext shareWith) {
       throw new GLException("Should not call this");
     }
 
     @Override
-    public int getWidth() {
+    public int getSurfaceWidth() {
       throw new GLException("Should not call this");
     }
 
     @Override
-    public int getHeight() {
+    public int getSurfaceHeight() {
       throw new GLException("Should not call this");
     }
 
-    public void setSize(int width, int height) {
+    public void setSize(final int width, final int height) {
       throw new GLException("Should not call this");
     }
   }
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java
index 650fd31..d2f967a 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11ExternalGLXDrawable.java
@@ -55,30 +55,30 @@ import com.jogamp.nativewindow.x11.X11GraphicsScreen;
 
 public class X11ExternalGLXDrawable extends X11GLXDrawable {
 
-  private X11ExternalGLXDrawable(GLDrawableFactory factory, NativeSurface surface) {
+  private X11ExternalGLXDrawable(final GLDrawableFactory factory, final NativeSurface surface) {
     super(factory, surface, true);
   }
 
-  protected static X11ExternalGLXDrawable create(GLDrawableFactory factory, GLProfile glp) {
-    long context = GLX.glXGetCurrentContext();
+  protected static X11ExternalGLXDrawable create(final GLDrawableFactory factory, final GLProfile glp) {
+    final long context = GLX.glXGetCurrentContext();
     if (context == 0) {
       throw new GLException("Error: current context null");
     }
-    long display = GLX.glXGetCurrentDisplay();
+    final long display = GLX.glXGetCurrentDisplay();
     if (display == 0) {
       throw new GLException("Error: current display null");
     }
-    long drawable = GLX.glXGetCurrentDrawable();
+    final long drawable = GLX.glXGetCurrentDrawable();
     if (drawable == 0) {
       throw new GLException("Error: attempted to make an external GLDrawable without a drawable current");
     }
-    IntBuffer val = Buffers.newDirectIntBuffer(1);
+    final IntBuffer val = Buffers.newDirectIntBuffer(1);
 
     GLX.glXQueryContext(display, context, GLX.GLX_SCREEN, val);
-    X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val.get(0), false);
+    final X11GraphicsScreen x11Screen = (X11GraphicsScreen) X11GraphicsScreen.createScreenDevice(display, val.get(0), false);
 
     GLX.glXQueryContext(display, context, GLX.GLX_FBCONFIG_ID, val);
-    X11GLXGraphicsConfiguration cfg = X11GLXGraphicsConfiguration.create(glp, x11Screen, val.get(0));
+    final X11GLXGraphicsConfiguration cfg = X11GLXGraphicsConfiguration.create(glp, x11Screen, val.get(0));
 
     int w, h;
     GLX.glXQueryDrawable(display, drawable, GLX.GLX_WIDTH, val);
@@ -96,16 +96,16 @@ public class X11ExternalGLXDrawable extends X11GLXDrawable {
   }
 
   @Override
-  public GLContext createContext(GLContext shareWith) {
+  public GLContext createContext(final GLContext shareWith) {
     return new Context(this, shareWith);
   }
 
-  public void setSize(int newWidth, int newHeight) {
+  public void setSize(final int newWidth, final int newHeight) {
     throw new GLException("Should not call this");
   }
 
-  class Context extends X11GLXContext {
-    Context(X11GLXDrawable drawable, GLContext shareWith) {
+  static class Context extends X11GLXContext {
+    Context(final X11GLXDrawable drawable, final GLContext shareWith) {
       super(drawable, shareWith);
     }
   }
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java
index e0b69ff..36e7916 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLCapabilities.java
@@ -41,14 +41,14 @@ public class X11GLCapabilities extends GLCapabilities {
   final private long fbcfg;
   final private int  fbcfgid;
 
-  public X11GLCapabilities(XVisualInfo xVisualInfo, long fbcfg, int fbcfgid, GLProfile glp) {
+  public X11GLCapabilities(final XVisualInfo xVisualInfo, final long fbcfg, final int fbcfgid, final GLProfile glp) {
       super(glp);
       this.xVisualInfo = xVisualInfo;
       this.fbcfg = fbcfg;
       this.fbcfgid = fbcfgid;
   }
 
-  public X11GLCapabilities(XVisualInfo xVisualInfo, GLProfile glp) {
+  public X11GLCapabilities(final XVisualInfo xVisualInfo, final GLProfile glp) {
       super(glp);
       this.xVisualInfo = xVisualInfo;
       this.fbcfg = 0;
@@ -64,7 +64,7 @@ public class X11GLCapabilities extends GLCapabilities {
   public Object clone() {
     try {
       return super.clone();
-    } catch (RuntimeException e) {
+    } catch (final RuntimeException e) {
       throw new GLException(e);
     }
   }
@@ -78,7 +78,7 @@ public class X11GLCapabilities extends GLCapabilities {
   final public boolean hasFBConfig() { return 0!=fbcfg && fbcfgid!=VisualIDHolder.VID_UNDEFINED; }
 
   @Override
-  final public int getVisualID(VIDType type) throws NativeWindowException {
+  final public int getVisualID(final VIDType type) throws NativeWindowException {
       switch(type) {
           case INTRINSIC:
           case NATIVE:
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
index 94620c4..9631dbb 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXContext.java
@@ -94,13 +94,13 @@ public class X11GLXContext extends GLContextImpl {
     extensionNameMap.put(GLExtensions.ARB_pixel_format, X11GLXDrawableFactory.GLX_SGIX_pbuffer); // good enough
   }
 
-  X11GLXContext(GLDrawableImpl drawable,
-                GLContext shareWith) {
+  X11GLXContext(final GLDrawableImpl drawable,
+                final GLContext shareWith) {
     super(drawable, shareWith);
   }
 
   @Override
-  protected void resetStates(boolean isInit) {
+  protected void resetStates(final boolean isInit) {
     // no inner state _glXExt=null;
     glXExtProcAddressTable = null;
     hasSwapInterval = 0;
@@ -159,7 +159,7 @@ public class X11GLXContext extends GLContextImpl {
     return isGLXVersionGreaterEqualOneThree();
   }
 
-  private final boolean glXMakeContextCurrent(long dpy, long writeDrawable, long readDrawable, long ctx) {
+  private final boolean glXMakeContextCurrent(final long dpy, final long writeDrawable, final long readDrawable, final long ctx) {
     boolean res = false;
 
     try {
@@ -173,7 +173,7 @@ public class X11GLXContext extends GLContextImpl {
             // should not happen due to 'isGLReadDrawableAvailable()' query in GLContextImpl
             throw new InternalError("Given readDrawable but no driver support");
         }
-    } catch (RuntimeException re) {
+    } catch (final RuntimeException re) {
         if( DEBUG_TRACE_SWITCH ) {
           System.err.println(getThreadName()+": Warning: X11GLXContext.glXMakeContextCurrent failed: "+re+", with "+
             "dpy "+toHexString(dpy)+
@@ -187,7 +187,7 @@ public class X11GLXContext extends GLContextImpl {
   }
 
   @Override
-  protected void destroyContextARBImpl(long ctx) {
+  protected void destroyContextARBImpl(final long ctx) {
     final long display = drawable.getNativeSurface().getDisplayHandle();
 
     glXMakeContextCurrent(display, 0, 0, 0);
@@ -207,22 +207,22 @@ public class X11GLXContext extends GLContextImpl {
     };
 
   @Override
-  protected long createContextARBImpl(long share, boolean direct, int ctp, int major, int minor) {
+  protected long createContextARBImpl(final long share, final boolean direct, final int ctp, final int major, final int minor) {
     updateGLXProcAddressTable();
-    GLXExt _glXExt = getGLXExt();
+    final GLXExt _glXExt = getGLXExt();
     if(DEBUG) {
       System.err.println(getThreadName()+": X11GLXContext.createContextARBImpl: "+getGLVersion(major, minor, ctp, "@creation") +
                          ", handle "+toHexString(drawable.getHandle()) + ", share "+toHexString(share)+", direct "+direct+
                          ", glXCreateContextAttribsARB: "+toHexString(glXExtProcAddressTable._addressof_glXCreateContextAttribsARB));
     }
 
-    boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
-    boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
-    boolean ctDebug     = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
+    final boolean ctBwdCompat = 0 != ( CTX_PROFILE_COMPAT & ctp ) ;
+    final boolean ctFwdCompat = 0 != ( CTX_OPTION_FORWARD & ctp ) ;
+    final boolean ctDebug     = 0 != ( CTX_OPTION_DEBUG & ctp ) ;
 
     long ctx=0;
 
-    IntBuffer attribs = Buffers.newDirectIntBuffer(ctx_arb_attribs_rom);
+    final IntBuffer attribs = Buffers.newDirectIntBuffer(ctx_arb_attribs_rom);
     attribs.put(ctx_arb_attribs_idx_major + 1, major);
     attribs.put(ctx_arb_attribs_idx_minor + 1, minor);
 
@@ -246,8 +246,8 @@ public class X11GLXContext extends GLContextImpl {
         attribs.put(ctx_arb_attribs_idx_flags + 1, flags);
     }
 
-    X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration();
-    AbstractGraphicsDevice device = config.getScreen().getDevice();
+    final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration();
+    final AbstractGraphicsDevice device = config.getScreen().getDevice();
     final long display = device.getHandle();
 
     try {
@@ -256,9 +256,9 @@ public class X11GLXContext extends GLContextImpl {
         X11Util.setX11ErrorHandler(true, DEBUG ? false : true); // make sure X11 error handler is set
         X11Lib.XSync(display, false);
         ctx = _glXExt.glXCreateContextAttribsARB(display, config.getFBConfig(), share, direct, attribs);
-    } catch (RuntimeException re) {
+    } catch (final RuntimeException re) {
         if(DEBUG) {
-          Throwable t = new Throwable(getThreadName()+": Info: X11GLXContext.createContextARBImpl glXCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
+          final Throwable t = new Throwable(getThreadName()+": Info: X11GLXContext.createContextARBImpl glXCreateContextAttribsARB failed with "+getGLVersion(major, minor, ctp, "@creation"), re);
           t.printStackTrace();
         }
     }
@@ -291,7 +291,7 @@ public class X11GLXContext extends GLContextImpl {
     final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)drawable.getNativeSurface().getGraphicsConfiguration();
     final AbstractGraphicsDevice device = config.getScreen().getDevice();
     final X11GLXContext sharedContext = (X11GLXContext) factory.getOrCreateSharedContext(device);
-    long display = device.getHandle();
+    final long display = device.getHandle();
 
     if ( 0 != shareWithHandle ) {
         direct = GLX.glXIsDirect(display, shareWithHandle);
@@ -303,8 +303,8 @@ public class X11GLXContext extends GLContextImpl {
     if( !config.hasFBConfig() ) {
         // not able to use FBConfig -> GLX 1.1
         forceGLXVersionOneOne();
-        if(glp.isGL3()) {
-          throw new GLException(getThreadName()+": Unable to create OpenGL >= 3.1 context");
+        if( glp.isGL3() ) {
+          throw new GLException(getThreadName()+": Unable to create OpenGL >= 3.1 context w/o FBConfig");
         }
         contextHandle = GLX.glXCreateContext(display, config.getXVisualInfo(), shareWithHandle, direct);
         if ( 0 == contextHandle ) {
@@ -313,7 +313,7 @@ public class X11GLXContext extends GLContextImpl {
         if ( !glXMakeContextCurrent(display, drawable.getHandle(), drawableRead.getHandle(), contextHandle) ) {
           throw new GLException(getThreadName()+": Error making temp context(0) current: display "+toHexString(display)+", context "+toHexString(contextHandle)+", drawable "+drawable);
         }
-        if( !setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT, false /* strictMatch */, false /* withinGLVersionsMapping */) ) { // use GL_VERSION
+        if( !setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT, false /* strictMatch */, null == sharedContext /* withinGLVersionsMapping */) ) { // use GL_VERSION
             throw new InternalError("setGLFunctionAvailability !strictMatch failed");
         }
         isDirect = GLX.glXIsDirect(display, contextHandle);
@@ -343,15 +343,15 @@ public class X11GLXContext extends GLContextImpl {
             throw new GLException(getThreadName()+": Unable to create temp OpenGL context(1)");
         }
         if ( !glXMakeContextCurrent(display, drawable.getHandle(), drawableRead.getHandle(), temp_ctx) ) {
-          throw new GLException(getThreadName()+": Error making temp context(1) current: display "+toHexString(display)+", context "+toHexString(temp_ctx)+", drawable "+drawable);
+            throw new GLException(getThreadName()+": Error making temp context(1) current: display "+toHexString(display)+", context "+toHexString(temp_ctx)+", drawable "+drawable);
         }
-        setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT, false /* strictMatch */, false /* withinGLVersionsMapping */); // use GL_VERSION
+        setGLFunctionAvailability(true, 0, 0, CTX_PROFILE_COMPAT, false /* strictMatch */, null == sharedContext /* withinGLVersionsMapping */); // use GL_VERSION
         glXMakeContextCurrent(display, 0, 0, 0); // release temp context
         if( !createContextARBTried ) {
             // is*Available calls are valid since setGLFunctionAvailability(..) was called
             final boolean isProcCreateContextAttribsARBAvailable = isFunctionAvailable("glXCreateContextAttribsARB");
             final boolean isExtARBCreateContextAvailable = isExtensionAvailable("GLX_ARB_create_context");
-            if ( isProcCreateContextAttribsARBAvailable && isExtARBCreateContextAvailable ) {
+            if ( isProcCreateContextAttribsARBAvailable && isExtARBCreateContextAvailable && !GLProfile.disableOpenGLARBContext ) {
                 // initial ARB context creation
                 contextHandle = createContextARB(shareWithHandle, direct);
                 createContextARBTried=true;
@@ -362,9 +362,11 @@ public class X11GLXContext extends GLContextImpl {
                         System.err.println(getThreadName() + ": createContextImpl: NOT OK (ARB, initial) - creation failed - share "+toHexString(shareWithHandle));
                     }
                 }
-            } else if (DEBUG) {
+            } else if( DEBUG ) {
                 System.err.println(getThreadName() + ": createContextImpl: NOT OK (ARB, initial) - extension not available - share "+toHexString(shareWithHandle)+
-                                   ", isProcCreateContextAttribsARBAvailable "+isProcCreateContextAttribsARBAvailable+", isExtGLXARBCreateContextAvailable "+isExtARBCreateContextAvailable);
+                                   ", isProcCreateContextAttribsARBAvailable "+isProcCreateContextAttribsARBAvailable+
+                                   ", isExtGLXARBCreateContextAvailable "+isExtARBCreateContextAvailable+
+                                   ", disableOpenGLARBContext "+GLProfile.disableOpenGLARBContext);
             }
         }
     } else {
@@ -380,21 +382,24 @@ public class X11GLXContext extends GLContextImpl {
             }
         }
     } else {
-        if( glp.isGL3() ) {
-          glXMakeContextCurrent(display, 0, 0, 0);
-          GLX.glXDestroyContext(display, temp_ctx);
-          throw new GLException(getThreadName()+": X11GLXContext.createContextImpl ctx !ARB, profile > GL2 requested (OpenGL >= 3.0.1). Requested: "+glp+", current: "+getGLVersion());
+        if( glp.isGL3() && createContextARBTried ) {
+            // We shall not allow context creation >= GL3 w/ non ARB methods if ARB is used,
+            // otherwise context of similar profile but different creation method may not be share-able.
+            glXMakeContextCurrent(display, 0, 0, 0);
+            GLX.glXDestroyContext(display, temp_ctx);
+            throw new GLException(getThreadName()+": X11GLXContext.createContextImpl ctx !ARB but ARB is used, profile > GL2 requested (OpenGL >= 3.0.1). Requested: "+glp+", current: "+getGLVersion());
         }
+
         if(DEBUG) {
-          System.err.println(getThreadName()+": X11GLXContext.createContextImpl failed, fall back to !ARB context "+getGLVersion());
+            System.err.println(getThreadName()+": X11GLXContext.createContextImpl ARB not used, fall back to !ARB context "+getGLVersion());
         }
 
-        // continue with temp context for GL <= 3.0
+        // continue with temp context
         contextHandle = temp_ctx;
         if ( !glXMakeContextCurrent(display, drawable.getHandle(), drawableRead.getHandle(), contextHandle) ) {
-          glXMakeContextCurrent(display, 0, 0, 0);
-          GLX.glXDestroyContext(display, temp_ctx);
-          throw new GLException(getThreadName()+": Error making context(1) current: display "+toHexString(display)+", context "+toHexString(contextHandle)+", drawable "+drawable);
+            glXMakeContextCurrent(display, 0, 0, 0);
+            GLX.glXDestroyContext(display, temp_ctx);
+            throw new GLException(getThreadName()+": Error making context(1) current: display "+toHexString(display)+", context "+toHexString(contextHandle)+", drawable "+drawable);
         }
         if (DEBUG) {
             System.err.println(getThreadName() + ": createContextImpl: OK (old-2) share "+toHexString(shareWithHandle));
@@ -410,7 +415,7 @@ public class X11GLXContext extends GLContextImpl {
 
   @Override
   protected void makeCurrentImpl() throws GLException {
-    long dpy = drawable.getNativeSurface().getDisplayHandle();
+    final long dpy = drawable.getNativeSurface().getDisplayHandle();
 
     if (GLX.glXGetCurrentContext() != contextHandle) {
         if (!glXMakeContextCurrent(dpy, drawable.getHandle(), drawableRead.getHandle(), contextHandle)) {
@@ -426,7 +431,7 @@ public class X11GLXContext extends GLContextImpl {
 
   @Override
   protected void releaseImpl() throws GLException {
-    long display = drawable.getNativeSurface().getDisplayHandle();
+    final long display = drawable.getNativeSurface().getDisplayHandle();
     if (!glXMakeContextCurrent(display, 0, 0, 0)) {
         throw new GLException(getThreadName()+": Error freeing OpenGL context");
     }
@@ -438,10 +443,10 @@ public class X11GLXContext extends GLContextImpl {
   }
 
   @Override
-  protected void copyImpl(GLContext source, int mask) throws GLException {
-    long dst = getHandle();
-    long src = source.getHandle();
-    long display = drawable.getNativeSurface().getDisplayHandle();
+  protected void copyImpl(final GLContext source, final int mask) throws GLException {
+    final long dst = getHandle();
+    final long src = source.getHandle();
+    final long display = drawable.getNativeSurface().getDisplayHandle();
     if (0 == display) {
       throw new GLException(getThreadName()+": Connection to X display not yet set up");
     }
@@ -482,7 +487,7 @@ public class X11GLXContext extends GLContextImpl {
   protected final StringBuilder getPlatformExtensionsStringImpl() {
     final NativeSurface ns = drawable.getNativeSurface();
     final X11GraphicsDevice x11Device = (X11GraphicsDevice) ns.getGraphicsConfiguration().getScreen().getDevice();
-    StringBuilder sb = new StringBuilder();
+    final StringBuilder sb = new StringBuilder();
     x11Device.lock();
     try{
         if (DEBUG) {
@@ -519,7 +524,7 @@ public class X11GLXContext extends GLContextImpl {
   }
 
   @Override
-  protected boolean setSwapIntervalImpl(int interval) {
+  protected boolean setSwapIntervalImpl(final int interval) {
     if( !drawable.getChosenGLCapabilities().isOnscreen() ) { return false; }
 
     final GLXExt glXExt = getGLXExt();
@@ -536,7 +541,7 @@ public class X11GLXContext extends GLContextImpl {
             } else {
                 hasSwapInterval = -1;
             }
-        } catch (Throwable t) { hasSwapInterval=-1; }
+        } catch (final Throwable t) { hasSwapInterval=-1; }
     }
     /* try {
         switch( hasSwapInterval ) {
@@ -549,16 +554,16 @@ public class X11GLXContext extends GLContextImpl {
     if (2 == hasSwapInterval) {
         try {
             return 0 == glXExt.glXSwapIntervalSGI(interval);
-        } catch (Throwable t) { hasSwapInterval=-1; }
+        } catch (final Throwable t) { hasSwapInterval=-1; }
     }
     return false;
   }
 
-  private final int initSwapGroupImpl(GLXExt glXExt) {
+  private final int initSwapGroupImpl(final GLXExt glXExt) {
       if(0==hasSwapGroupNV) {
         try {
             hasSwapGroupNV = glXExt.isExtensionAvailable(GLXExtensions.GLX_NV_swap_group)?1:-1;
-        } catch (Throwable t) { hasSwapGroupNV=1; }
+        } catch (final Throwable t) { hasSwapGroupNV=1; }
         if(DEBUG) {
             System.err.println("initSwapGroupImpl: "+GLXExtensions.GLX_NV_swap_group+": "+hasSwapGroupNV);
         }
@@ -567,10 +572,10 @@ public class X11GLXContext extends GLContextImpl {
   }
 
   @Override
-  protected final boolean queryMaxSwapGroupsImpl(int[] maxGroups, int maxGroups_offset,
-                                                 int[] maxBarriers, int maxBarriers_offset) {
+  protected final boolean queryMaxSwapGroupsImpl(final int[] maxGroups, final int maxGroups_offset,
+                                                 final int[] maxBarriers, final int maxBarriers_offset) {
       boolean res = false;
-      GLXExt glXExt = getGLXExt();
+      final GLXExt glXExt = getGLXExt();
       if (initSwapGroupImpl(glXExt)>0) {
         final NativeSurface ns = drawable.getNativeSurface();
         try {
@@ -583,53 +588,53 @@ public class X11GLXContext extends GLContextImpl {
                 maxBarriersNIO.get(maxGroups, maxGroups_offset, maxBarriersNIO.remaining());
                 res = true;
             }
-        } catch (Throwable t) { hasSwapGroupNV=-1; }
+        } catch (final Throwable t) { hasSwapGroupNV=-1; }
       }
       return res;
   }
 
   @Override
-  protected final boolean joinSwapGroupImpl(int group) {
+  protected final boolean joinSwapGroupImpl(final int group) {
       boolean res = false;
-      GLXExt glXExt = getGLXExt();
+      final GLXExt glXExt = getGLXExt();
       if (initSwapGroupImpl(glXExt)>0) {
         try {
             if( glXExt.glXJoinSwapGroupNV(drawable.getNativeSurface().getDisplayHandle(), drawable.getHandle(), group) ) {
                 currentSwapGroup = group;
                 res = true;
             }
-        } catch (Throwable t) { hasSwapGroupNV=-1; }
+        } catch (final Throwable t) { hasSwapGroupNV=-1; }
       }
       return res;
   }
 
   @Override
-  protected final boolean bindSwapBarrierImpl(int group, int barrier) {
+  protected final boolean bindSwapBarrierImpl(final int group, final int barrier) {
       boolean res = false;
-      GLXExt glXExt = getGLXExt();
+      final GLXExt glXExt = getGLXExt();
       if (initSwapGroupImpl(glXExt)>0) {
         try {
             if( glXExt.glXBindSwapBarrierNV(drawable.getNativeSurface().getDisplayHandle(), group, barrier) ) {
                 res = true;
             }
-        } catch (Throwable t) { hasSwapGroupNV=-1; }
+        } catch (final Throwable t) { hasSwapGroupNV=-1; }
       }
       return res;
   }
 
   @Override
-  public final ByteBuffer glAllocateMemoryNV(int size, float readFrequency, float writeFrequency, float priority) {
+  public final ByteBuffer glAllocateMemoryNV(final int size, final float readFrequency, final float writeFrequency, final float priority) {
     return getGLXExt().glXAllocateMemoryNV(size, readFrequency, writeFrequency, priority);
   }
 
   @Override
-  public final void glFreeMemoryNV(ByteBuffer pointer) {
+  public final void glFreeMemoryNV(final ByteBuffer pointer) {
     getGLXExt().glXFreeMemoryNV(pointer);
   }
 
   @Override
   public String toString() {
-    StringBuilder sb = new StringBuilder();
+    final StringBuilder sb = new StringBuilder();
     sb.append(getClass().getSimpleName());
     sb.append(" [");
     super.append(sb);
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java
index 155c00c..c29bc3b 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawable.java
@@ -47,7 +47,7 @@ import jogamp.opengl.GLDrawableImpl;
 import jogamp.opengl.GLDynamicLookupHelper;
 
 public abstract class X11GLXDrawable extends GLDrawableImpl {
-  protected X11GLXDrawable(GLDrawableFactory factory, NativeSurface comp, boolean realized) {
+  protected X11GLXDrawable(final GLDrawableFactory factory, final NativeSurface comp, final boolean realized) {
     super(factory, comp, realized);
   }
 
@@ -59,7 +59,7 @@ public abstract class X11GLXDrawable extends GLDrawableImpl {
   @Override
   protected void setRealizedImpl() {
     if(realized) {
-        X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration();
+        final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration();
         config.updateGraphicsConfiguration();
 
         if (DEBUG) {
@@ -69,7 +69,7 @@ public abstract class X11GLXDrawable extends GLDrawableImpl {
   }
 
   @Override
-  protected final void swapBuffersImpl(boolean doubleBuffered) {
+  protected final void swapBuffersImpl(final boolean doubleBuffered) {
     if(doubleBuffered) {
         GLX.glXSwapBuffers(getNativeSurface().getDisplayHandle(), getHandle());
     }
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
index f7938f4..60e4438 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java
@@ -72,6 +72,7 @@ import jogamp.opengl.GLDynamicLookupHelper;
 import jogamp.opengl.GLGraphicsConfigurationUtil;
 import jogamp.opengl.SharedResourceRunner;
 
+import com.jogamp.common.nio.Buffers;
 import com.jogamp.common.util.VersionNumber;
 import com.jogamp.nativewindow.x11.X11GraphicsDevice;
 import com.jogamp.nativewindow.x11.X11GraphicsScreen;
@@ -103,7 +104,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
                         if(null!=tmp && tmp.isLibComplete()) {
                             GLX.getGLXProcAddressTable().reset(tmp);
                         }
-                    } catch (Exception ex) {
+                    } catch (final Exception ex) {
                         tmp = null;
                         if(DEBUG) {
                             ex.printStackTrace();
@@ -159,7 +160,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  public final GLDynamicLookupHelper getGLDynamicLookupHelper(int profile) {
+  public final GLDynamicLookupHelper getGLDynamicLookupHelper(final int profile) {
       return x11GLXDynamicLookupHelper;
   }
 
@@ -180,9 +181,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
       GLDrawableImpl drawable;
       GLContextImpl context;
 
-      SharedResource(X11GraphicsDevice dev, X11GraphicsScreen scrn,
-                     GLDrawableImpl draw, GLContextImpl ctx,
-                     VersionNumber glXServerVer, String glXServerVendor, boolean glXServerMultisampleAvail) {
+      SharedResource(final X11GraphicsDevice dev, final X11GraphicsScreen scrn,
+                     final GLDrawableImpl draw, final GLContextImpl ctx,
+                     final VersionNumber glXServerVer, final String glXServerVendor, final boolean glXServerMultisampleAvail) {
           device = dev;
           screen = scrn;
           drawable = draw;
@@ -227,11 +228,11 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
             sharedMap.clear();
         }
         @Override
-        public SharedResourceRunner.Resource mapPut(String connection, SharedResourceRunner.Resource resource) {
+        public SharedResourceRunner.Resource mapPut(final String connection, final SharedResourceRunner.Resource resource) {
             return sharedMap.put(connection, resource);
         }
         @Override
-        public SharedResourceRunner.Resource mapGet(String connection) {
+        public SharedResourceRunner.Resource mapGet(final String connection) {
             return sharedMap.get(connection);
         }
         @Override
@@ -240,7 +241,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
         }
 
         @Override
-        public boolean isDeviceSupported(String connection) {
+        public boolean isDeviceSupported(final String connection) {
             final boolean res;
             final X11GraphicsDevice x11Device = new X11GraphicsDevice(X11Util.openDisplay(connection), AbstractGraphicsDevice.DEFAULT_UNIT, true /* owner */);
             x11Device.lock();
@@ -257,7 +258,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
         }
 
         @Override
-        public SharedResourceRunner.Resource createSharedResource(String connection) {
+        public SharedResourceRunner.Resource createSharedResource(final String connection) {
             final X11GraphicsDevice sharedDevice = new X11GraphicsDevice(X11Util.openDisplay(connection), AbstractGraphicsDevice.DEFAULT_UNIT, true /* owner */);
             sharedDevice.lock();
             try {
@@ -312,7 +313,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
                 return new SharedResource(sharedDevice, sharedScreen, sharedDrawable, sharedContext,
                                           glXServerVersion, glXServerVendorName,
                                           glXServerMultisampleAvailable && GLXUtil.isClientMultisampleAvailable());
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 throw new GLException("X11GLXDrawableFactory - Could not initialize shared resources for "+connection, t);
             } finally {
                 sharedDevice.unlock();
@@ -320,8 +321,8 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
         }
 
         @Override
-        public void releaseSharedResource(SharedResourceRunner.Resource shared) {
-            SharedResource sr = (SharedResource) shared;
+        public void releaseSharedResource(final SharedResourceRunner.Resource shared) {
+            final SharedResource sr = (SharedResource) shared;
             if (DEBUG) {
                 System.err.println("Shutdown Shared:");
                 System.err.println("Device  : " + sr.device);
@@ -361,7 +362,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  public final boolean getIsDeviceCompatible(AbstractGraphicsDevice device) {
+  public final boolean getIsDeviceCompatible(final AbstractGraphicsDevice device) {
       if(null != x11GLXDynamicLookupHelper && device instanceof X11GraphicsDevice) {
           return true;
       }
@@ -374,11 +375,11 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  protected final SharedResource getOrCreateSharedResourceImpl(AbstractGraphicsDevice device) {
+  protected final SharedResource getOrCreateSharedResourceImpl(final AbstractGraphicsDevice device) {
     return (SharedResource) sharedResourceRunner.getOrCreateShared(device);
   }
 
-  protected final long getOrCreateSharedDpy(AbstractGraphicsDevice device) {
+  protected final long getOrCreateSharedDpy(final AbstractGraphicsDevice device) {
     final SharedResourceRunner.Resource sr = getOrCreateSharedResource( device );
     if(null!=sr) {
         return sr.getDevice().getHandle();
@@ -387,12 +388,12 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(AbstractGraphicsDevice device) {
+  protected List<GLCapabilitiesImmutable> getAvailableCapabilitiesImpl(final AbstractGraphicsDevice device) {
     return X11GLXGraphicsConfigurationFactory.getAvailableCapabilities(this, device);
   }
 
   @Override
-  protected final GLDrawableImpl createOnscreenDrawableImpl(NativeSurface target) {
+  protected final GLDrawableImpl createOnscreenDrawableImpl(final NativeSurface target) {
     if (target == null) {
       throw new IllegalArgumentException("Null target");
     }
@@ -400,19 +401,19 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  protected final GLDrawableImpl createOffscreenDrawableImpl(NativeSurface target) {
+  protected final GLDrawableImpl createOffscreenDrawableImpl(final NativeSurface target) {
     if (target == null) {
       throw new IllegalArgumentException("Null target");
     }
-    AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
-    GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
+    final AbstractGraphicsConfiguration config = target.getGraphicsConfiguration();
+    final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) config.getChosenCapabilities();
     if(!caps.isPBuffer()) {
         return new X11PixmapGLXDrawable(this, target);
     }
 
     // PBuffer GLDrawable Creation
     GLDrawableImpl pbufferDrawable;
-    AbstractGraphicsDevice device = config.getScreen().getDevice();
+    final AbstractGraphicsDevice device = config.getScreen().getDevice();
 
     /**
      * Due to the ATI Bug https://bugzilla.mozilla.org/show_bug.cgi?id=486277,
@@ -420,7 +421,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
      * The dummy context shall also use the same Display,
      * since switching Display in this regard is another ATI bug.
      */
-    SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+    final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
     if( null!=sr && sr.isGLXVendorATI() && null == GLContext.getCurrent() ) {
         sr.getContext().makeCurrent();
         try {
@@ -434,9 +435,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
     return pbufferDrawable;
   }
 
-  public final boolean isGLXMultisampleAvailable(AbstractGraphicsDevice device) {
+  public final boolean isGLXMultisampleAvailable(final AbstractGraphicsDevice device) {
     if(null != device) {
-        SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+        final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
         if(null!=sr) {
           return sr.isGLXMultisampleAvailable();
         }
@@ -444,9 +445,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
     return false;
   }
 
-  public final VersionNumber getGLXVersionNumber(AbstractGraphicsDevice device) {
+  public final VersionNumber getGLXVersionNumber(final AbstractGraphicsDevice device) {
     if(null != device) {
-        SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+        final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
         if(null!=sr) {
           return sr.getGLXVersion();
         }
@@ -457,9 +458,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
     return null;
   }
 
-  public final boolean isGLXVersionGreaterEqualOneOne(AbstractGraphicsDevice device) {
+  public final boolean isGLXVersionGreaterEqualOneOne(final AbstractGraphicsDevice device) {
     if(null != device) {
-        SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+        final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
         if(null!=sr) {
           return sr.isGLXVersionGreaterEqualOneOne();
         }
@@ -471,9 +472,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
     return false;
   }
 
-  public final boolean isGLXVersionGreaterEqualOneThree(AbstractGraphicsDevice device) {
+  public final boolean isGLXVersionGreaterEqualOneThree(final AbstractGraphicsDevice device) {
     if(null != device) {
-        SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
+        final SharedResource sr = (SharedResource) sharedResourceRunner.getOrCreateShared(device);
         if(null!=sr) {
           return sr.isGLXVersionGreaterEqualOneThree();
         }
@@ -486,9 +487,9 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device, GLProfile glp) {
+  public final boolean canCreateGLPbuffer(AbstractGraphicsDevice device, final GLProfile glp) {
       if(null == device) {
-        SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(defaultDevice);
+        final SharedResourceRunner.Resource sr = sharedResourceRunner.getOrCreateShared(defaultDevice);
         if(null!=sr) {
             device = sr.getDevice();
         }
@@ -497,10 +498,10 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  protected final ProxySurface createMutableSurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
-                                                        GLCapabilitiesImmutable capsChosen,
-                                                        GLCapabilitiesImmutable capsRequested,
-                                                        GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstreamHook) {
+  protected final ProxySurface createMutableSurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+                                                        final GLCapabilitiesImmutable capsChosen,
+                                                        final GLCapabilitiesImmutable capsRequested,
+                                                        final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstreamHook) {
     final X11GraphicsDevice device;
     if( createNewDevice || !(deviceReq instanceof X11GraphicsDevice) ) {
         device = new X11GraphicsDevice(X11Util.openDisplay(deviceReq.getConnection()), deviceReq.getUnitID(), true /* owner */);
@@ -516,14 +517,14 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  public final ProxySurface createDummySurfaceImpl(AbstractGraphicsDevice deviceReq, boolean createNewDevice,
-                                                   GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser chooser, int width, int height) {
+  public final ProxySurface createDummySurfaceImpl(final AbstractGraphicsDevice deviceReq, final boolean createNewDevice,
+                                                   GLCapabilitiesImmutable chosenCaps, final GLCapabilitiesImmutable requestedCaps, final GLCapabilitiesChooser chooser, final int width, final int height) {
     chosenCaps = GLGraphicsConfigurationUtil.fixOnscreenGLCapabilities(chosenCaps);
     return createMutableSurfaceImpl(deviceReq, createNewDevice, chosenCaps, requestedCaps, chooser, new X11DummyUpstreamSurfaceHook(width, height));
   }
 
   @Override
-  protected final ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook upstream) {
+  protected final ProxySurface createProxySurfaceImpl(final AbstractGraphicsDevice deviceReq, final int screenIdx, final long windowHandle, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser, final UpstreamSurfaceHook upstream) {
     final X11GraphicsDevice device = new X11GraphicsDevice(X11Util.openDisplay(deviceReq.getConnection()), deviceReq.getUnitID(), true /* owner */);
     final X11GraphicsScreen screen = new X11GraphicsScreen(device, screenIdx);
     final int xvisualID = X11Lib.GetVisualIDFromWindow(device.getHandle(), windowHandle);
@@ -546,7 +547,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
   }
 
   @Override
-  public final boolean canCreateExternalGLDrawable(AbstractGraphicsDevice device) {
+  public final boolean canCreateExternalGLDrawable(final AbstractGraphicsDevice device) {
     return canCreateGLPbuffer(device, null /* GLProfile not used for query on X11 */);
   }
 
@@ -562,71 +563,87 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
   private boolean gotGammaRampLength;
   private int gammaRampLength;
   @Override
-  protected final synchronized int getGammaRampLength() {
+  protected final synchronized int getGammaRampLength(final NativeSurface surface) {
     if (gotGammaRampLength) {
       return gammaRampLength;
     }
-
-    long display = getOrCreateSharedDpy(defaultDevice);
+    final long display = surface.getDisplayHandle();
     if(0 == display) {
         return 0;
     }
+    final int screenIdx = surface.getScreenIndex();
 
-    int[] size = new int[1];
-    boolean res = X11Lib.XF86VidModeGetGammaRampSize(display,
-                                                      X11Lib.DefaultScreen(display),
-                                                      size, 0);
+    final int[] size = new int[1];
+    final boolean res = X11Lib.XF86VidModeGetGammaRampSize(display, screenIdx, size, 0);
     if (!res) {
       return 0;
     }
     gotGammaRampLength = true;
     gammaRampLength = size[0];
+    System.err.println("XXX: Gamma ramp size: "+gammaRampLength);
     return gammaRampLength;
   }
 
   @Override
-  protected final boolean setGammaRamp(float[] ramp) {
-    long display = getOrCreateSharedDpy(defaultDevice);
+  protected final boolean setGammaRamp(final NativeSurface surface, final float[] ramp) {
+    final long display = surface.getDisplayHandle();
     if(0 == display) {
         return false;
     }
+    final int screenIdx = surface.getScreenIndex();
 
-    int len = ramp.length;
-    short[] rampData = new short[len];
+    final int len = ramp.length;
+    final short[] rampData = new short[len];
     for (int i = 0; i < len; i++) {
       rampData[i] = (short) (ramp[i] * 65535);
     }
 
-    boolean res = X11Lib.XF86VidModeSetGammaRamp(display,
-                                              X11Lib.DefaultScreen(display),
+    final boolean res = X11Lib.XF86VidModeSetGammaRamp(display, screenIdx,
                                               rampData.length,
                                               rampData, 0,
                                               rampData, 0,
                                               rampData, 0);
+    if( DEBUG ) {
+        dumpRamp("SET__", rampData.length, rampData, rampData, rampData);
+    }
     return res;
   }
 
+  private static void dumpRamp(final String prefix, final int size, final ShortBuffer r, final ShortBuffer g, final ShortBuffer b) {
+      for(int i=0; i<size; i++) {
+          if( 0 == i % 4 ) {
+              System.err.printf("%n%4d/%4d %s: ", i, size, prefix);
+          }
+          System.err.printf(" [%04X %04X %04X], ",  r.get(i), g.get(i), b.get(i));
+      }
+      System.err.println();
+  }
+  private static void dumpRamp(final String prefix, final int size, final short[] r, final short[] g, final short[] b) {
+      for(int i=0; i<size; i++) {
+          if( 0 == i % 4 ) {
+              System.err.printf("%n%4d/%4d %s: ", i, size, prefix);
+          }
+          System.err.printf(" [%04X %04X %04X], ",  r[i], g[i], b[i]);
+      }
+      System.err.println();
+  }
+
   @Override
-  protected final Buffer getGammaRamp() {
-    long display = getOrCreateSharedDpy(defaultDevice);
+  protected final Buffer getGammaRamp(final NativeSurface surface) {
+    final long display = surface.getDisplayHandle();
     if(0 == display) {
         return null;
     }
+    final int screenIdx = surface.getScreenIndex();
+
+    final int size = getGammaRampLength(surface);
 
-    int size = getGammaRampLength();
-    ShortBuffer rampData = ShortBuffer.wrap(new short[3 * size]);
-    rampData.position(0);
-    rampData.limit(size);
-    ShortBuffer redRampData = rampData.slice();
-    rampData.position(size);
-    rampData.limit(2 * size);
-    ShortBuffer greenRampData = rampData.slice();
-    rampData.position(2 * size);
-    rampData.limit(3 * size);
-    ShortBuffer blueRampData = rampData.slice();
-
-    boolean res = X11Lib.XF86VidModeGetGammaRamp(display,
-                                              X11Lib.DefaultScreen(display),
+    final ShortBuffer rampData = Buffers.newDirectShortBuffer(3 * size);
+    final ShortBuffer redRampData   = Buffers.slice(rampData, 0 * size, size);
+    final ShortBuffer greenRampData = Buffers.slice(rampData, 1 * size, size);
+    final ShortBuffer blueRampData  = Buffers.slice(rampData, 2 * size, size);
+
+    final boolean res = X11Lib.XF86VidModeGetGammaRamp(display, screenIdx,
                                               size,
                                               redRampData,
                                               greenRampData,
@@ -634,40 +651,62 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl {
     if (!res) {
       return null;
     }
+    if( DEBUG ) {
+        dumpRamp("GET__", size, redRampData, greenRampData, blueRampData);
+    }
     return rampData;
   }
 
   @Override
-  protected final void resetGammaRamp(Buffer originalGammaRamp) {
+  protected final void resetGammaRamp(final NativeSurface surface, final Buffer originalGammaRamp) {
     if (originalGammaRamp == null) {
         return; // getGammaRamp failed originally
     }
-    long display = getOrCreateSharedDpy(defaultDevice);
+    final long display = surface.getDisplayHandle();
     if(0 == display) {
         return;
     }
+    final int screenIdx = surface.getScreenIndex();
+
+    resetGammaRamp(display, screenIdx, originalGammaRamp);
+  }
+
+  @Override
+  protected final void resetGammaRamp(final DeviceScreenID deviceScreenID, final Buffer originalGammaRamp) {
+    if (originalGammaRamp == null) {
+        return; // getGammaRamp failed originally
+    }
+    final long display = X11Util.openDisplay(deviceScreenID.deviceConnection);
+    if( 0 == display ) {
+        return;
+    }
+    try {
+        resetGammaRamp(display, deviceScreenID.screenIdx, originalGammaRamp);
+    } finally {
+        X11Util.closeDisplay(display);
+    }
+  }
 
-    ShortBuffer rampData = (ShortBuffer) originalGammaRamp;
-    int capacity = rampData.capacity();
+  private static final void resetGammaRamp(final long display, final int screenIdx, final Buffer originalGammaRamp) {
+    final ShortBuffer rampData = (ShortBuffer) originalGammaRamp;
+    final int capacity = rampData.capacity();
     if ((capacity % 3) != 0) {
       throw new IllegalArgumentException("Must not be the original gamma ramp");
     }
-    int size = capacity / 3;
-    rampData.position(0);
-    rampData.limit(size);
-    ShortBuffer redRampData = rampData.slice();
-    rampData.position(size);
-    rampData.limit(2 * size);
-    ShortBuffer greenRampData = rampData.slice();
-    rampData.position(2 * size);
-    rampData.limit(3 * size);
-    ShortBuffer blueRampData = rampData.slice();
-
-    X11Lib.XF86VidModeSetGammaRamp(display,
-                                X11Lib.DefaultScreen(display),
-                                size,
-                                redRampData,
-                                greenRampData,
-                                blueRampData);
+    final int size = capacity / 3;
+
+    final ShortBuffer redRampData   = Buffers.slice(rampData, 0 * size, size);
+    final ShortBuffer greenRampData = Buffers.slice(rampData, 1 * size, size);
+    final ShortBuffer blueRampData  = Buffers.slice(rampData, 2 * size, size);
+    if( DEBUG ) {
+        dumpRamp("RESET", size, redRampData, greenRampData, blueRampData);
+    }
+
+    X11Lib.XF86VidModeSetGammaRamp(display, screenIdx,
+                                   size,
+                                   redRampData,
+                                   greenRampData,
+                                   blueRampData);
   }
+
 }
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
index 951174f..0e91a6a 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDynamicLibraryBundleInfo.java
@@ -62,14 +62,14 @@ public final class X11GLXDynamicLibraryBundleInfo extends DesktopGLDynamicLibrar
 
     @Override
     public final List<String> getToolGetProcAddressFuncNameList() {
-        List<String> res = new ArrayList<String>();
+        final List<String> res = new ArrayList<String>();
         res.add("glXGetProcAddressARB");
         res.add("glXGetProcAddress");
         return res;
     }
 
     @Override
-    public final long toolGetProcAddress(long toolGetProcAddressHandle, String funcName) {
+    public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
         return GLX.glXGetProcAddress(toolGetProcAddressHandle, funcName);
     }
 }
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
index c0a3b46..5f6a6b3 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfiguration.java
@@ -65,8 +65,8 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
     public static final int MAX_ATTRIBS = 128;
     private final GLCapabilitiesChooser chooser;
 
-    X11GLXGraphicsConfiguration(X11GraphicsScreen screen,
-                                X11GLCapabilities capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {
+    X11GLXGraphicsConfiguration(final X11GraphicsScreen screen,
+                                final X11GLCapabilities capsChosen, final GLCapabilitiesImmutable capsRequested, final GLCapabilitiesChooser chooser) {
         super(screen, capsChosen, capsRequested, capsChosen.getXVisualInfo());
         this.chooser=chooser;
     }
@@ -109,7 +109,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
         }
     }
 
-    static X11GLXGraphicsConfiguration create(GLProfile glp, X11GraphicsScreen x11Screen, int fbcfgID) {
+    static X11GLXGraphicsConfiguration create(GLProfile glp, final X11GraphicsScreen x11Screen, final int fbcfgID) {
       final X11GraphicsDevice device = (X11GraphicsDevice) x11Screen.getDevice();
       final long display = device.getHandle();
       if(0==display) {
@@ -131,11 +131,11 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
       return new X11GLXGraphicsConfiguration(x11Screen, caps, caps, new DefaultGLCapabilitiesChooser());
     }
 
-    static IntBuffer GLCapabilities2AttribList(GLCapabilitiesImmutable caps,
-                                               boolean forFBAttr, boolean isMultisampleAvailable,
-                                               long display, int screen)
+    static IntBuffer GLCapabilities2AttribList(final GLCapabilitiesImmutable caps,
+                                               final boolean forFBAttr, final boolean isMultisampleAvailable,
+                                               final long display, final int screen)
     {
-        int colorDepth = (caps.getRedBits() +
+        final int colorDepth = (caps.getRedBits() +
                           caps.getGreenBits() +
                           caps.getBlueBits());
         if (colorDepth < 15) {
@@ -237,12 +237,12 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
 
   // FBConfig
 
-  static boolean GLXFBConfigIDValid(long display, int screen, int fbcfgid) {
-    long fbcfg = X11GLXGraphicsConfiguration.glXFBConfigID2FBConfig(display, screen, fbcfgid);
+  static boolean GLXFBConfigIDValid(final long display, final int screen, final int fbcfgid) {
+    final long fbcfg = X11GLXGraphicsConfiguration.glXFBConfigID2FBConfig(display, screen, fbcfgid);
     return (0 != fbcfg) ? X11GLXGraphicsConfiguration.GLXFBConfigValid( display, fbcfg ) : false ;
   }
 
-  static boolean GLXFBConfigValid(long display, long fbcfg) {
+  static boolean GLXFBConfigValid(final long display, final long fbcfg) {
     final IntBuffer tmp = Buffers.newDirectIntBuffer(1);
     if(GLX.GLX_BAD_ATTRIBUTE == GLX.glXGetFBConfigAttrib(display, fbcfg, GLX.GLX_RENDER_TYPE, tmp)) {
       return false;
@@ -275,14 +275,14 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
     return val;
   }
 
-  static XRenderDirectFormat XVisual2XRenderMask(long dpy, long visual) {
-    XRenderPictFormat renderPictFmt = X11Lib.XRenderFindVisualFormat(dpy, visual);
+  static XRenderDirectFormat XVisual2XRenderMask(final long dpy, final long visual) {
+    final XRenderPictFormat renderPictFmt = X11Lib.XRenderFindVisualFormat(dpy, visual);
     if(null == renderPictFmt) {
         return null;
     }
     return renderPictFmt.getDirect();
   }
-  static XRenderDirectFormat XVisual2XRenderMask(long dpy, long visual, XRenderPictFormat dest) {
+  static XRenderDirectFormat XVisual2XRenderMask(final long dpy, final long visual, final XRenderPictFormat dest) {
     if( !X11Lib.XRenderFindVisualFormat(dpy, visual, dest) ) {
         return null;
     } else {
@@ -298,7 +298,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
   }
 
   static List<GLCapabilitiesImmutable> GLXFBConfig2GLCapabilities(final X11GraphicsDevice device, final GLProfile glp, final PointerBuffer fbcfgsL,
-                                                                  final int winattrmask, final boolean isMultisampleAvailable, boolean onlyFirstValid) {
+                                                                  final int winattrmask, final boolean isMultisampleAvailable, final boolean onlyFirstValid) {
     final IntBuffer tmp = Buffers.newDirectIntBuffer(1);
     final XRenderPictFormat xRenderPictFormat= XRenderPictFormat.create();
     final List<GLCapabilitiesImmutable> result = new ArrayList<GLCapabilitiesImmutable>();
@@ -424,7 +424,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
     return (X11GLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, caps);
   }
 
-  private static String glXGetFBConfigErrorCode(int err) {
+  private static String glXGetFBConfigErrorCode(final int err) {
     switch (err) {
       case GLX.GLX_NO_EXTENSION:  return "GLX_NO_EXTENSION";
       case GLX.GLX_BAD_ATTRIBUTE: return "GLX_BAD_ATTRIBUTE";
@@ -432,7 +432,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
     }
   }
 
-  static boolean glXGetFBConfig(long display, long cfg, int attrib, IntBuffer tmp) {
+  static boolean glXGetFBConfig(final long display, final long cfg, final int attrib, final IntBuffer tmp) {
     if (display == 0) {
       throw new GLException("No display connection");
     }
@@ -445,7 +445,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
     return res;
   }
 
-  static int glXFBConfig2FBConfigID(long display, long cfg) {
+  static int glXFBConfig2FBConfigID(final long display, final long cfg) {
       final IntBuffer tmpID = Buffers.newDirectIntBuffer(1);
       if( glXGetFBConfig(display, cfg, GLX.GLX_FBCONFIG_ID, tmpID) ) {
           return tmpID.get(0);
@@ -454,11 +454,11 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
       }
   }
 
-  static long glXFBConfigID2FBConfig(long display, int screen, int id) {
+  static long glXFBConfigID2FBConfig(final long display, final int screen, final int id) {
       final IntBuffer attribs = Buffers.newDirectIntBuffer(new int[] { GLX.GLX_FBCONFIG_ID, id, 0 });
       final IntBuffer count = Buffers.newDirectIntBuffer(1);
       count.put(0, -1);
-      PointerBuffer fbcfgsL = GLX.glXChooseFBConfig(display, screen, attribs, count);
+      final PointerBuffer fbcfgsL = GLX.glXChooseFBConfig(display, screen, attribs, count);
       if (fbcfgsL == null || fbcfgsL.limit()<1) {
           return 0;
       }
@@ -467,15 +467,15 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
 
   // Visual Info
 
-  static XVisualInfo XVisualID2XVisualInfo(long display, long visualID) {
-      int[] count = new int[1];
-      XVisualInfo template = XVisualInfo.create();
+  static XVisualInfo XVisualID2XVisualInfo(final long display, final long visualID) {
+      final int[] count = new int[1];
+      final XVisualInfo template = XVisualInfo.create();
       template.setVisualid(visualID);
-      XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualIDMask, template, count, 0);
+      final XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualIDMask, template, count, 0);
       if (infos == null || infos.length == 0) {
             return null;
       }
-      XVisualInfo res = XVisualInfo.create(infos[0]);
+      final XVisualInfo res = XVisualInfo.create(infos[0]);
       if (DEBUG) {
         System.err.println("Fetched XVisualInfo for visual ID " + toHexString(visualID));
         System.err.println("Resulting XVisualInfo: visualid = " + toHexString(res.getVisualid()));
@@ -483,8 +483,8 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
       return res;
   }
 
-  static X11GLCapabilities XVisualInfo2GLCapabilities(final X11GraphicsDevice device, GLProfile glp, XVisualInfo info,
-                                                      final int winattrmask, boolean isMultisampleEnabled) {
+  static X11GLCapabilities XVisualInfo2GLCapabilities(final X11GraphicsDevice device, final GLProfile glp, final XVisualInfo info,
+                                                      final int winattrmask, final boolean isMultisampleEnabled) {
     final int allDrawableTypeBits = GLGraphicsConfigurationUtil.WINDOW_BIT |
                                     GLGraphicsConfigurationUtil.BITMAP_BIT |
                                     GLGraphicsConfigurationUtil.FBO_BIT ;
@@ -512,7 +512,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
       return null;
     }
 
-    GLCapabilities res = new X11GLCapabilities(info, glp);
+    final GLCapabilities res = new X11GLCapabilities(info, glp);
 
     res.setDoubleBuffered(glXGetConfig(display, info, GLX.GLX_DOUBLEBUFFER,     tmp) != 0);
     res.setStereo        (glXGetConfig(display, info, GLX.GLX_STEREO,           tmp) != 0);
@@ -551,7 +551,7 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
     return (X11GLCapabilities) GLGraphicsConfigurationUtil.fixWinAttribBitsAndHwAccel(device, drawableTypeBits, res);
   }
 
-  private static String glXGetConfigErrorCode(int err) {
+  private static String glXGetConfigErrorCode(final int err) {
     switch (err) {
       case GLX.GLX_NO_EXTENSION:  return "GLX_NO_EXTENSION";
       case GLX.GLX_BAD_SCREEN:    return "GLX_BAD_SCREEN";
@@ -561,11 +561,11 @@ public class X11GLXGraphicsConfiguration extends X11GraphicsConfiguration implem
     }
   }
 
-  static int glXGetConfig(long display, XVisualInfo info, int attrib, IntBuffer tmp) {
+  static int glXGetConfig(final long display, final XVisualInfo info, final int attrib, final IntBuffer tmp) {
     if (display == 0) {
       throw new GLException("No display connection");
     }
-    int res = GLX.glXGetConfig(display, info, attrib, tmp);
+    final int res = GLX.glXGetConfig(display, info, attrib, tmp);
     if (res != 0) {
       throw new GLException("glXGetConfig("+toHexString(attrib)+") failed: error code " + glXGetConfigErrorCode(res));
     }
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
index 75771f8..44479ac 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXGraphicsConfigurationFactory.java
@@ -94,7 +94,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
 
     @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+            final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested, final CapabilitiesChooser chooser, final AbstractGraphicsScreen absScreen, final int nativeVisualID) {
         if (!(absScreen instanceof X11GraphicsScreen)) {
             throw new IllegalArgumentException("Only X11GraphicsScreen are allowed here");
         }
@@ -124,8 +124,8 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
                                                  (GLCapabilitiesChooser)chooser, (X11GraphicsScreen)absScreen, nativeVisualID);
     }
 
-    protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(X11GLXDrawableFactory factory, AbstractGraphicsDevice device) {
-        X11GLXDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
+    protected static List<GLCapabilitiesImmutable> getAvailableCapabilities(final X11GLXDrawableFactory factory, final AbstractGraphicsDevice device) {
+        final X11GLXDrawableFactory.SharedResource sharedResource = factory.getOrCreateSharedResourceImpl(device);
         if(null == sharedResource) {
             throw new GLException("Shared resource for device n/a: "+device);
         }
@@ -153,7 +153,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
         return availableCaps;
     }
 
-    static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesFBConfig(X11GraphicsScreen x11Screen, GLProfile glProfile, boolean isMultisampleAvailable) {
+    static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesFBConfig(final X11GraphicsScreen x11Screen, final GLProfile glProfile, final boolean isMultisampleAvailable) {
         PointerBuffer fbcfgsL = null;
 
         // Utilizing FBConfig
@@ -184,20 +184,20 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
         return availableCaps;
     }
 
-    static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesXVisual(X11GraphicsScreen x11Screen, GLProfile glProfile, boolean isMultisampleAvailable) {
+    static List<GLCapabilitiesImmutable> getAvailableGLCapabilitiesXVisual(final X11GraphicsScreen x11Screen, final GLProfile glProfile, final boolean isMultisampleAvailable) {
         final X11GraphicsDevice absDevice = (X11GraphicsDevice) x11Screen.getDevice();
         final long display = absDevice.getHandle();
 
-        int screen = x11Screen.getIndex();
+        final int screen = x11Screen.getIndex();
 
-        int[] count = new int[1];
-        XVisualInfo template = XVisualInfo.create();
+        final int[] count = new int[1];
+        final XVisualInfo template = XVisualInfo.create();
         template.setScreen(screen);
-        XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
+        final XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
         if (infos == null || infos.length<1) {
             throw new GLException("Error while enumerating available XVisualInfos");
         }
-        ArrayList<GLCapabilitiesImmutable> availableCaps = new ArrayList<GLCapabilitiesImmutable>();
+        final ArrayList<GLCapabilitiesImmutable> availableCaps = new ArrayList<GLCapabilitiesImmutable>();
         for (int i = 0; i < infos.length; i++) {
             final GLCapabilitiesImmutable caps = X11GLXGraphicsConfiguration.XVisualInfo2GLCapabilities(absDevice, glProfile, infos[i], GLGraphicsConfigurationUtil.ALL_BITS, isMultisampleAvailable);
             if(null != caps) {
@@ -211,17 +211,17 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
 
 
     static X11GLXGraphicsConfiguration chooseGraphicsConfigurationStatic(GLCapabilitiesImmutable capsChosen,
-                                                                         GLCapabilitiesImmutable capsReq,
-                                                                         GLCapabilitiesChooser chooser,
-                                                                         X11GraphicsScreen x11Screen, int xvisualID) {
+                                                                         final GLCapabilitiesImmutable capsReq,
+                                                                         final GLCapabilitiesChooser chooser,
+                                                                         final X11GraphicsScreen x11Screen, final int xvisualID) {
         if (x11Screen == null) {
             throw new IllegalArgumentException("AbstractGraphicsScreen is null");
         }
         if (capsChosen == null) {
             capsChosen = new GLCapabilities(null);
         }
-        X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
-        X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
+        final X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
+        final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
 
         capsChosen = GLGraphicsConfigurationUtil.fixGLCapabilities( capsChosen, factory, x11Device);
         final boolean usePBuffer = !capsChosen.isOnscreen() && capsChosen.isPBuffer();
@@ -250,7 +250,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
         return res;
     }
 
-    static X11GLXGraphicsConfiguration fetchGraphicsConfigurationFBConfig(X11GraphicsScreen x11Screen, int fbID, GLProfile glp) {
+    static X11GLXGraphicsConfiguration fetchGraphicsConfigurationFBConfig(final X11GraphicsScreen x11Screen, final int fbID, final GLProfile glp) {
         final X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
         final long display = x11Device.getHandle();
         final int screen = x11Screen.getIndex();
@@ -274,19 +274,19 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
         return new X11GLXGraphicsConfiguration(x11Screen, caps, caps, new DefaultGLCapabilitiesChooser());
     }
 
-    private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationFBConfig(GLCapabilitiesImmutable capsChosen,
-                                                                                   GLCapabilitiesImmutable capsReq,
-                                                                                   GLCapabilitiesChooser chooser,
-                                                                                   X11GraphicsScreen x11Screen, int xvisualID) {
+    private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationFBConfig(final GLCapabilitiesImmutable capsChosen,
+                                                                                   final GLCapabilitiesImmutable capsReq,
+                                                                                   final GLCapabilitiesChooser chooser,
+                                                                                   final X11GraphicsScreen x11Screen, final int xvisualID) {
         int recommendedIndex = -1;
         PointerBuffer fbcfgsL = null;
-        GLProfile glProfile = capsChosen.getGLProfile();
+        final GLProfile glProfile = capsChosen.getGLProfile();
 
         // Utilizing FBConfig
         //
-        X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
-        long display = x11Device.getHandle();
-        int screen = x11Screen.getIndex();
+        final X11GraphicsDevice x11Device = (X11GraphicsDevice) x11Screen.getDevice();
+        final long display = x11Device.getHandle();
+        final int screen = x11Screen.getIndex();
 
         final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
         final boolean isMultisampleAvailable = factory.isGLXMultisampleAvailable(x11Device);
@@ -379,27 +379,27 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
             }
             return null;
         }
-        X11GLCapabilities chosenCaps = (X11GLCapabilities) availableCaps.get(chosenIndex);
+        final X11GLCapabilities chosenCaps = (X11GLCapabilities) availableCaps.get(chosenIndex);
 
         return new X11GLXGraphicsConfiguration(x11Screen, chosenCaps, capsReq, chooser);
     }
 
-    private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationXVisual(GLCapabilitiesImmutable capsChosen,
-                                                                                  GLCapabilitiesImmutable capsReq,
+    private static X11GLXGraphicsConfiguration chooseGraphicsConfigurationXVisual(final GLCapabilitiesImmutable capsChosen,
+                                                                                  final GLCapabilitiesImmutable capsReq,
                                                                                   GLCapabilitiesChooser chooser,
-                                                                                  X11GraphicsScreen x11Screen, int xvisualID) {
+                                                                                  final X11GraphicsScreen x11Screen, final int xvisualID) {
         if (chooser == null) {
             chooser = new DefaultGLCapabilitiesChooser();
         }
 
-        GLProfile glProfile = capsChosen.getGLProfile();
+        final GLProfile glProfile = capsChosen.getGLProfile();
         final int winattrmask = GLGraphicsConfigurationUtil.getExclusiveWinAttributeBits(capsChosen.isOnscreen(), capsChosen.isFBO(), false /* pbuffer */, capsChosen.isBitmap());
-        List<GLCapabilitiesImmutable> availableCaps = new ArrayList<GLCapabilitiesImmutable>();
+        final List<GLCapabilitiesImmutable> availableCaps = new ArrayList<GLCapabilitiesImmutable>();
         int recommendedIndex = -1;
 
-        X11GraphicsDevice absDevice = (X11GraphicsDevice) x11Screen.getDevice();
-        long display = absDevice.getHandle();
-        int screen = x11Screen.getIndex();
+        final X11GraphicsDevice absDevice = (X11GraphicsDevice) x11Screen.getDevice();
+        final long display = absDevice.getHandle();
+        final int screen = x11Screen.getIndex();
 
         final X11GLXDrawableFactory factory = (X11GLXDrawableFactory) GLDrawableFactory.getDesktopFactory();
         final boolean isMultisampleAvailable = factory.isGLXMultisampleAvailable(absDevice);
@@ -421,10 +421,10 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
         }
 
         // 2nd choice: get all GLCapabilities available, preferred recommendedIndex might be available if 1st choice was successful
-        int[] count = new int[1];
-        XVisualInfo template = XVisualInfo.create();
+        final int[] count = new int[1];
+        final XVisualInfo template = XVisualInfo.create();
         template.setScreen(screen);
-        XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
+        final XVisualInfo[] infos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, template, count, 0);
         if (infos == null || infos.length<1) {
             throw new GLException("Error while enumerating available XVisualInfos");
         }
@@ -451,7 +451,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
 
         if( VisualIDHolder.VID_UNDEFINED != xvisualID ) {
             for(int i=0; i<availableCaps.size(); ) {
-                VisualIDHolder vidh = availableCaps.get(i);
+                final VisualIDHolder vidh = availableCaps.get(i);
                 if(vidh.getVisualID(VIDType.X11_XVISUAL) != xvisualID ) {
                     availableCaps.remove(i);
                 } else {
@@ -468,7 +468,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
             }
         }
 
-        int chosenIndex = chooseCapabilities(chooser, capsChosen, availableCaps, recommendedIndex);
+        final int chosenIndex = chooseCapabilities(chooser, capsChosen, availableCaps, recommendedIndex);
         if ( 0 > chosenIndex ) {
             if (DEBUG) {
                 System.err.println("X11GLXGraphicsConfiguration.chooseGraphicsConfigurationXVisual: failed, return null");
@@ -476,7 +476,7 @@ public class X11GLXGraphicsConfigurationFactory extends GLGraphicsConfigurationF
             }
             return null;
         }
-        X11GLCapabilities chosenCaps = (X11GLCapabilities) availableCaps.get(chosenIndex);
+        final X11GLCapabilities chosenCaps = (X11GLCapabilities) availableCaps.get(chosenIndex);
 
         return new X11GLXGraphicsConfiguration(x11Screen, chosenCaps, capsReq, chooser);
     }
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java
index 9da1892..8666629 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11OnscreenGLXDrawable.java
@@ -51,7 +51,7 @@ public class X11OnscreenGLXDrawable extends X11GLXDrawable {
   long glXWindow; // GLXWindow, a GLXDrawable representation
   boolean useGLXWindow;
 
-  protected X11OnscreenGLXDrawable(GLDrawableFactory factory, NativeSurface component, boolean realized) {
+  protected X11OnscreenGLXDrawable(final GLDrawableFactory factory, final NativeSurface component, final boolean realized) {
     super(factory, component, realized);
     glXWindow=0;
     useGLXWindow=false;
@@ -84,10 +84,10 @@ public class X11OnscreenGLXDrawable extends X11GLXDrawable {
   @Override
   protected final void createHandle() {
     if(USE_GLXWINDOW) {
-        X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration();
+        final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration)getNativeSurface().getGraphicsConfiguration();
         if(config.getFBConfig()>=0) {
             useGLXWindow=true;
-            long dpy = getNativeSurface().getDisplayHandle();
+            final long dpy = getNativeSurface().getDisplayHandle();
             if(0!=glXWindow) {
                 GLX.glXDestroyWindow(dpy, glXWindow);
             }
@@ -103,7 +103,7 @@ public class X11OnscreenGLXDrawable extends X11GLXDrawable {
   }
 
   @Override
-  public GLContext createContext(GLContext shareWith) {
+  public GLContext createContext(final GLContext shareWith) {
     return new X11GLXContext(this, shareWith);
   }
 }
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java
index 0e771fd..21ad060 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11PbufferGLXDrawable.java
@@ -53,7 +53,7 @@ import javax.media.opengl.GLException;
 import com.jogamp.common.nio.Buffers;
 
 public class X11PbufferGLXDrawable extends X11GLXDrawable {
-  protected X11PbufferGLXDrawable(GLDrawableFactory factory, NativeSurface target) {
+  protected X11PbufferGLXDrawable(final GLDrawableFactory factory, final NativeSurface target) {
                                   /* GLCapabilities caps,
                                   GLCapabilitiesChooser chooser,
                                   int width, int height */
@@ -70,12 +70,12 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
   }
 
   @Override
-  public GLContext createContext(GLContext shareWith) {
+  public GLContext createContext(final GLContext shareWith) {
     return new X11GLXContext(this, shareWith);
   }
 
   protected void destroyPbuffer() {
-    NativeSurface ns = getNativeSurface();
+    final NativeSurface ns = getNativeSurface();
     if (ns.getSurfaceHandle() != 0) {
       GLX.glXDestroyPbuffer(ns.getDisplayHandle(), ns.getSurfaceHandle());
     }
@@ -102,17 +102,17 @@ public class X11PbufferGLXDrawable extends X11GLXDrawable {
 
       // Create the p-buffer.
       int niattribs = 0;
-      IntBuffer iattributes = Buffers.newDirectIntBuffer(7);
+      final IntBuffer iattributes = Buffers.newDirectIntBuffer(7);
 
       iattributes.put(niattribs++, GLX.GLX_PBUFFER_WIDTH);
-      iattributes.put(niattribs++, ms.getWidth());
+      iattributes.put(niattribs++, ms.getSurfaceWidth());
       iattributes.put(niattribs++, GLX.GLX_PBUFFER_HEIGHT);
-      iattributes.put(niattribs++, ms.getHeight());
+      iattributes.put(niattribs++, ms.getSurfaceHeight());
       iattributes.put(niattribs++, GLX.GLX_LARGEST_PBUFFER); // exact
       iattributes.put(niattribs++, 0);
       iattributes.put(niattribs++, 0);
 
-      long pbuffer = GLX.glXCreatePbuffer(display, config.getFBConfig(), iattributes);
+      final long pbuffer = GLX.glXCreatePbuffer(display, config.getFBConfig(), iattributes);
       if (pbuffer == 0) {
         // FIXME: query X error code for detail error message
         throw new GLException("pbuffer creation error: glXCreatePbuffer() failed");
diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java
index c1388db..e217e1c 100644
--- a/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java
+++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11PixmapGLXDrawable.java
@@ -54,7 +54,7 @@ import jogamp.nativewindow.x11.XVisualInfo;
 public class X11PixmapGLXDrawable extends X11GLXDrawable {
   private long pixmap;
 
-  protected X11PixmapGLXDrawable(GLDrawableFactory factory, NativeSurface target) {
+  protected X11PixmapGLXDrawable(final GLDrawableFactory factory, final NativeSurface target) {
     super(factory, target, false);
   }
 
@@ -68,26 +68,26 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable {
   }
 
   @Override
-  public GLContext createContext(GLContext shareWith) {
+  public GLContext createContext(final GLContext shareWith) {
     return new X11GLXContext(this, shareWith);
   }
 
   private void createPixmap() {
-    NativeSurface ns = getNativeSurface();
-    X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) ns.getGraphicsConfiguration();
-    XVisualInfo vis = config.getXVisualInfo();
-    int bitsPerPixel = vis.getDepth();
-    AbstractGraphicsScreen aScreen = config.getScreen();
-    AbstractGraphicsDevice aDevice = aScreen.getDevice();
-    long dpy = aDevice.getHandle();
-    int screen = aScreen.getIndex();
+    final NativeSurface ns = getNativeSurface();
+    final X11GLXGraphicsConfiguration config = (X11GLXGraphicsConfiguration) ns.getGraphicsConfiguration();
+    final XVisualInfo vis = config.getXVisualInfo();
+    final int bitsPerPixel = vis.getDepth();
+    final AbstractGraphicsScreen aScreen = config.getScreen();
+    final AbstractGraphicsDevice aDevice = aScreen.getDevice();
+    final long dpy = aDevice.getHandle();
+    final int screen = aScreen.getIndex();
 
     pixmap = X11Lib.XCreatePixmap(dpy, X11Lib.RootWindow(dpy, screen),
-                                  surface.getWidth(), surface.getHeight(), bitsPerPixel);
+                                  surface.getSurfaceWidth(), surface.getSurfaceHeight(), bitsPerPixel);
     if (pixmap == 0) {
         throw new GLException("XCreatePixmap failed");
     }
-    long drawable = GLX.glXCreateGLXPixmap(dpy, vis, pixmap);
+    final long drawable = GLX.glXCreateGLXPixmap(dpy, vis, pixmap);
     if (drawable == 0) {
         X11Lib.XFreePixmap(dpy, pixmap);
         pixmap = 0;
@@ -104,7 +104,7 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable {
   protected void destroyPixmap() {
     if (pixmap == 0) return;
 
-    NativeSurface ns = getNativeSurface();
+    final NativeSurface ns = getNativeSurface();
     long display = ns.getDisplayHandle();
 
     long drawable = ns.getSurfaceHandle();
@@ -117,7 +117,7 @@ public class X11PixmapGLXDrawable extends X11GLXDrawable {
     // Must destroy pixmap and GLXPixmap
 
     if (DEBUG) {
-        long cur = GLX.glXGetCurrentContext();
+        final long cur = GLX.glXGetCurrentContext();
         if (cur != 0) {
           System.err.println("WARNING: found context " + toHexString(cur) + " current during pixmap destruction");
         }
diff --git a/src/jogl/native/libav/ffmpeg_impl_template.c b/src/jogl/native/libav/ffmpeg_impl_template.c
index a7e9f48..3077070 100644
--- a/src/jogl/native/libav/ffmpeg_impl_template.c
+++ b/src/jogl/native/libav/ffmpeg_impl_template.c
@@ -572,7 +572,7 @@ JNIEXPORT jlong JNICALL FF_FUNC(createInstance0)
     pAV->aid=AV_STREAM_ID_AUTO;
 
     if(pAV->verbose) {
-        fprintf(stderr, "Info: Use avresample %d, swresample %d, device %d, refCount %d\n", 
+        fprintf(stderr, "Info: Has avresample %d, swresample %d, device %d, refCount %d\n", 
             AV_HAS_API_AVRESAMPLE(pAV), AV_HAS_API_SWRESAMPLE(pAV), HAS_FUNC(sp_avdevice_register_all), pAV->useRefCountedFrames);
     }
     return (jlong) (intptr_t) pAV;
@@ -991,6 +991,10 @@ JNIEXPORT void JNICALL FF_FUNC(setStream0)
                 }
             }
         }
+        if(pAV->verbose) {
+            fprintf(stderr, "Info: Need resample %d, Use avresample %d, swresample %d\n", 
+                pAV->aSinkSupport, NULL!=pAV->avResampleCtx, NULL!=pAV->swResampleCtx);
+        }
 
         // Allocate audio frames
         // FIXME: Libav Binary compatibility! JAU01
diff --git a/src/jogl/native/libav/ffmpeg_lavc55_lavf55_lavu52_lavr01.c b/src/jogl/native/libav/ffmpeg_lavc55_lavf55_lavu53_lavr01.c
similarity index 100%
rename from src/jogl/native/libav/ffmpeg_lavc55_lavf55_lavu52_lavr01.c
rename to src/jogl/native/libav/ffmpeg_lavc55_lavf55_lavu53_lavr01.c
diff --git a/src/jogl/native/macosx/MacOSXWindowSystemInterface-calayer.m b/src/jogl/native/macosx/MacOSXWindowSystemInterface-calayer.m
index 7ce8c58..d83ddbc 100644
--- a/src/jogl/native/macosx/MacOSXWindowSystemInterface-calayer.m
+++ b/src/jogl/native/macosx/MacOSXWindowSystemInterface-calayer.m
@@ -112,39 +112,14 @@ extern GLboolean glIsVertexArray (GLuint array);
 
 #endif
 
-#ifdef VERBOSE_ON
-    #define CGLRETAINCOUNT(c) (NULL!=c?(int)CGLGetContextRetainCount(c):-1)
-#else
-    #define CGLRETAINCOUNT(c)
-#endif
-
 - (void)dealloc
 {
-    /**
-     * The explicit CGLContext destruction below
-     * ensures that it is not left behind.
-     * Tests show that w/o these gymnastics, the CGLContext is not freed immediately after calling dealloc.
-     * The retain, release and dealloc ensures [super dealloc] won't message 'invalid context'.
-     */
-    CGLContextObj cglCtx = [self CGLContextObj];
-
-    DBG_PRINT("MyNSOpenGLContext::dealloc.0 %p (refcnt %d) - CGL-Ctx %p\n", self, (int)[self retainCount], cglCtx, CGLRETAINCOUNT(cglCtx));
+    DBG_PRINT("MyNSOpenGLContext::dealloc.0 %p (refcnt %d)\n", self, (int)[self retainCount]);
     // NSLog(@"MyNSOpenGLContext::dealloc: %@",[NSThread callStackSymbols]);
 
     [self clearDrawable];
-    DBG_PRINT("MyNSOpenGLContext::dealloc.1 %d\n", CGLRETAINCOUNT(cglCtx));
-    if( NULL != cglCtx ) {
-        CGLRetainContext( cglCtx );
-        DBG_PRINT("MyNSOpenGLContext::dealloc.2 %d\n", CGLRETAINCOUNT(cglCtx));
-    }
+
     [super dealloc];
-    DBG_PRINT("MyNSOpenGLContext::dealloc.3 %d\n", CGLRETAINCOUNT(cglCtx));
-    if( NULL != cglCtx ) {
-        CGLReleaseContext( cglCtx );
-        DBG_PRINT("MyNSOpenGLContext::dealloc.4 %d\n", CGLRETAINCOUNT(cglCtx));
-        CGLDestroyContext( cglCtx );
-        DBG_PRINT("MyNSOpenGLContext::dealloc.5 %d\n", CGLRETAINCOUNT(cglCtx));
-    }
     DBG_PRINT("MyNSOpenGLContext::dealloc.X\n");
 }
 
@@ -194,7 +169,9 @@ extern GLboolean glIsVertexArray (GLuint array);
        texIDArg: (GLuint) texID
        opaque: (Bool) opaque
        texWidth: (int) texWidth 
-       texHeight: (int) texHeight;
+       texHeight: (int) texHeight
+       winWidth: (int)winWidth 
+       winHeight: (int)winHeight;
 
 - (void)releaseLayer;
 - (void)deallocPBuffer;
@@ -206,7 +183,7 @@ extern GLboolean glIsVertexArray (GLuint array);
 - (Bool)isGLSourceValid;
 
 - (void) setGLEnabled: (Bool) enable;
-- (Bool) validateTexSize: (CGRect) lRect;
+- (Bool) validateTexSize: (int)newTexWidth height:(int)newTexHeight;
 - (void) setTextureID: (int) _texID;
 
 - (Bool) isSamePBuffer: (NSOpenGLPixelBuffer*) p;
@@ -274,7 +251,9 @@ static const GLfloat gl_verts[] = {
        texIDArg: (GLuint) texID
        opaque: (Bool) opaque
        texWidth: (int) _texWidth 
-       texHeight: (int) _texHeight;
+       texHeight: (int) _texHeight
+       winWidth: (int) _winWidth 
+       winHeight: (int) _winHeight
 {
     pthread_mutexattr_t renderLockAttr;
     pthread_mutexattr_init(&renderLockAttr);
@@ -288,6 +267,17 @@ static const GLfloat gl_verts[] = {
             gl_texCoords[i] = 0.0f;
         }
     }
+    /** 
+     * Set via 
+     *   - OSXUtil_SetCALayerPixelScale0
+     *   - OSXUtil_AddCASublayer0 
+NS_DURING
+    // Available >= 10.7
+    [self setContentsScale: (CGFloat)_texWidth/(CGFloat)_winWidth];
+NS_HANDLER
+NS_ENDHANDLER
+    */
+
     parentPixelFmt = [_parentPixelFmt retain]; // until destruction
     glContext = [[MyNSOpenGLContext alloc] initWithFormat:parentPixelFmt shareContext:parentCtx];
     gl3ShaderProgramName = _gl3ShaderProgramName;
@@ -301,8 +291,8 @@ static const GLfloat gl_verts[] = {
     shallDraw = NO;
     isGLEnabled = YES;
     dedicatedFrameSet = NO;
-    dedicatedFrame = CGRectMake(0, 0, _texWidth, _texHeight);
-    [self validateTexSize: dedicatedFrame];
+    dedicatedFrame = CGRectMake(0, 0, _winWidth, _winHeight);
+    [self validateTexSize: _texWidth height:_texHeight];
     [self setTextureID: texID];
 
     newPBuffer = NULL;
@@ -383,15 +373,17 @@ static const GLfloat gl_verts[] = {
     isGLEnabled = enable;
 }
 
-- (Bool) validateTexSize: (CGRect) lRect
+- (Bool) validateTexSize: (int)newTexWidth height:(int)newTexHeight
 {
-    const int lRectW = (int) (lRect.size.width + 0.5f);
-    const int lRectH = (int) (lRect.size.height + 0.5f);
     Bool changed;
 
-    if( lRectH != texHeight || lRectW != texWidth ) {
-        texWidth = lRectW;
-        texHeight = lRectH;
+    if( newTexHeight != texHeight || newTexWidth != texWidth ) {
+        #ifdef VERBOSE_ON
+        const int oldTexWidth = texWidth;
+        const int oldTexHeight = texHeight;
+        #endif
+        texWidth = newTexWidth;
+        texHeight = newTexHeight;
         changed = YES;
 
         GLfloat texCoordWidth, texCoordHeight;
@@ -415,10 +407,14 @@ static const GLfloat gl_verts[] = {
         gl_texCoords[4] = texCoordWidth;
         gl_texCoords[6] = texCoordWidth;
         #ifdef VERBOSE_ON
-        DBG_PRINT("MyNSOpenGLLayer::validateTexSize %p -> tex %dx%d, bounds: %lf/%lf %lfx%lf (%dx%d), dedicatedFrame set:%d %lf/%lf %lfx%lf\n", 
-            self, texWidth, texHeight,
-            lRect.origin.x, lRect.origin.y, lRect.size.width, lRect.size.height, lRectW, lRectH, 
-            dedicatedFrameSet, dedicatedFrame.origin.x, dedicatedFrame.origin.y, dedicatedFrame.size.width, dedicatedFrame.size.height);
+NS_DURING
+        // Available >= 10.7
+        DBG_PRINT("MyNSOpenGLLayer::validateTexSize %p: tex %dx%d -> %dx%d, dedicatedFrame set:%d %lf/%lf %lfx%lf scale %lf\n", 
+            self, oldTexWidth, oldTexHeight, newTexWidth, newTexHeight, 
+            dedicatedFrameSet, dedicatedFrame.origin.x, dedicatedFrame.origin.y, dedicatedFrame.size.width, dedicatedFrame.size.height, 
+            [self contentsScale]);
+NS_HANDLER
+NS_ENDHANDLER
         #endif
     } else {
         changed = NO;
@@ -638,7 +634,15 @@ static const GLfloat gl_verts[] = {
 
         GLenum textureTarget;
 
-        Bool texSizeChanged = [self validateTexSize: ( dedicatedFrameSet ? dedicatedFrame : [self bounds] ) ];
+        CGRect texDim = dedicatedFrameSet ? dedicatedFrame : [self bounds];
+        CGFloat _contentsScale = 1;
+NS_DURING
+        // Available >= 10.7
+        _contentsScale = [self contentsScale];
+NS_HANDLER
+NS_ENDHANDLER
+        Bool texSizeChanged = [self validateTexSize: (int)(texDim.size.width  * _contentsScale  + 0.5f) 
+                                              height:(int)(texDim.size.height * _contentsScale  + 0.5f)];
         if( texSizeChanged ) {
             [context update];
         }
@@ -873,9 +877,10 @@ static const GLfloat gl_verts[] = {
 
 @end
 
-NSOpenGLLayer* createNSOpenGLLayer(NSOpenGLContext* ctx, int gl3ShaderProgramName, NSOpenGLPixelFormat* fmt, NSOpenGLPixelBuffer* p, uint32_t texID, Bool opaque, int texWidth, int texHeight) {
+NSOpenGLLayer* createNSOpenGLLayer(NSOpenGLContext* ctx, int gl3ShaderProgramName, NSOpenGLPixelFormat* fmt, NSOpenGLPixelBuffer* p, uint32_t texID, Bool opaque, int texWidth, int texHeight, int winWidth, int winHeight) {
   return [[[MyNSOpenGLLayer alloc] init] setupWithContext:ctx gl3ShaderProgramName: (GLuint)gl3ShaderProgramName pixelFormat: fmt pbuffer: p texIDArg: (GLuint)texID
-                                                              opaque: opaque texWidth: texWidth texHeight: texHeight];
+                                                              opaque: opaque texWidth: texWidth texHeight: texHeight
+                                                              winWidth: winWidth winHeight: winHeight];
 }
  
 void setNSOpenGLLayerEnabled(NSOpenGLLayer* layer, Bool enable) {
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookMutableSize.java b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookMutableSize.java
index c98bf54..e785af7 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookMutableSize.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookMutableSize.java
@@ -11,20 +11,20 @@ public class DelegatedUpstreamSurfaceHookMutableSize extends UpstreamSurfaceHook
      * @param width initial width
      * @param height initial height
      */
-    public DelegatedUpstreamSurfaceHookMutableSize(UpstreamSurfaceHook upstream, int width, int height) {
+    public DelegatedUpstreamSurfaceHookMutableSize(final UpstreamSurfaceHook upstream, final int width, final int height) {
         super(width, height);
         this.upstream = upstream;
     }
 
     @Override
-    public final void create(ProxySurface s) {
+    public final void create(final ProxySurface s) {
         if(null != upstream) {
             upstream.create(s);
         }
     }
 
     @Override
-    public final void destroy(ProxySurface s) {
+    public final void destroy(final ProxySurface s) {
         if(null != upstream) {
             upstream.destroy(s);
         }
@@ -32,7 +32,7 @@ public class DelegatedUpstreamSurfaceHookMutableSize extends UpstreamSurfaceHook
 
     @Override
     public String toString() {
-        return getClass().getSimpleName()+"[ "+ width + "x" + height + ", " + upstream + "]";
+        return getClass().getSimpleName()+"[ "+ pixWidth + "x" + pixHeight + ", " + upstream + "]";
     }
 
 }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java
index 1557f4e..abcc166 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/DelegatedUpstreamSurfaceHookWithSurfaceSize.java
@@ -10,9 +10,9 @@ public class DelegatedUpstreamSurfaceHookWithSurfaceSize implements UpstreamSurf
 
     /**
      * @param upstream optional upstream UpstreamSurfaceHook used for {@link #create(ProxySurface)} and {@link #destroy(ProxySurface)}.
-     * @param surface mandatory {@link NativeSurface} used for {@link #getWidth(ProxySurface)} and {@link #getHeight(ProxySurface)}
+     * @param surface mandatory {@link NativeSurface} used for {@link #getSurfaceWidth(ProxySurface)} and {@link #getSurfaceHeight(ProxySurface)}, not used for {@link #getUpstreamSurface()}.
      */
-    public DelegatedUpstreamSurfaceHookWithSurfaceSize(UpstreamSurfaceHook upstream, NativeSurface surface) {
+    public DelegatedUpstreamSurfaceHookWithSurfaceSize(final UpstreamSurfaceHook upstream, final NativeSurface surface) {
         this.upstream = upstream;
         this.surface = surface;
         if(null == surface) {
@@ -20,33 +20,44 @@ public class DelegatedUpstreamSurfaceHookWithSurfaceSize implements UpstreamSurf
         }
     }
 
+    /**
+     * {@inheritDoc}
+     * <p>
+     * Returns <code>null</code>.
+     * </p>
+     */
+    @Override
+    public final NativeSurface getUpstreamSurface() {
+        return null;
+    }
+
     @Override
-    public final void create(ProxySurface s) {
+    public final void create(final ProxySurface s) {
         if(null != upstream) {
             upstream.create(s);
         }
     }
 
     @Override
-    public final void destroy(ProxySurface s) {
+    public final void destroy(final ProxySurface s) {
         if(null != upstream) {
             upstream.destroy(s);
         }
     }
 
     @Override
-    public final int getWidth(ProxySurface s) {
-        return surface.getWidth();
+    public final int getSurfaceWidth(final ProxySurface s) {
+        return surface.getSurfaceWidth();
     }
 
     @Override
-    public final int getHeight(ProxySurface s) {
-        return surface.getHeight();
+    public final int getSurfaceHeight(final ProxySurface s) {
+        return surface.getSurfaceHeight();
     }
 
     @Override
     public String toString() {
-        final String us_s = null != surface ? ( surface.getClass().getName() + ": 0x" + Long.toHexString(surface.getSurfaceHandle()) + " " +surface.getWidth() + "x" + surface.getHeight() ) : "nil";
+        final String us_s = null != surface ? ( surface.getClass().getName() + ": 0x" + Long.toHexString(surface.getSurfaceHandle()) + " " +surface.getSurfaceWidth() + "x" + surface.getSurfaceHeight() ) : "nil";
         return getClass().getSimpleName()+"["+upstream+", "+us_s+"]";
     }
 
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/MutableGraphicsConfiguration.java b/src/nativewindow/classes/com/jogamp/nativewindow/MutableGraphicsConfiguration.java
index 8b8ccb1..a137d46 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/MutableGraphicsConfiguration.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/MutableGraphicsConfiguration.java
@@ -32,18 +32,18 @@ import javax.media.nativewindow.CapabilitiesImmutable;
 import javax.media.nativewindow.DefaultGraphicsConfiguration;
 
 public class MutableGraphicsConfiguration extends DefaultGraphicsConfiguration {
-    public MutableGraphicsConfiguration(AbstractGraphicsScreen screen,
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested) {
+    public MutableGraphicsConfiguration(final AbstractGraphicsScreen screen,
+            final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested) {
         super(screen, capsChosen, capsRequested);
     }
 
     @Override
-    public void setChosenCapabilities(CapabilitiesImmutable caps) {
+    public void setChosenCapabilities(final CapabilitiesImmutable caps) {
         super.setChosenCapabilities(caps);
     }
 
     @Override
-    public void setScreen(AbstractGraphicsScreen screen) {
+    public void setScreen(final AbstractGraphicsScreen screen) {
         super.setScreen(screen);
     }
 
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java
index a8dd916..7c1a88e 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/NativeWindowVersion.java
@@ -38,7 +38,7 @@ public class NativeWindowVersion extends JogampVersion {
 
     protected static volatile NativeWindowVersion jogampCommonVersionInfo;
 
-    protected NativeWindowVersion(String packageName, Manifest mf) {
+    protected NativeWindowVersion(final String packageName, final Manifest mf) {
         super(packageName, mf);
     }
 
@@ -56,7 +56,7 @@ public class NativeWindowVersion extends JogampVersion {
         return jogampCommonVersionInfo;
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         System.err.println(VersionUtil.getPlatformInfo());
         System.err.println(GlueGenVersion.getInstance());
         System.err.println(NativeWindowVersion.getInstance());
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java
index 5838c7a..45d12be 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSize.java
@@ -1,44 +1,56 @@
 package com.jogamp.nativewindow;
 
+import javax.media.nativewindow.NativeSurface;
 import javax.media.nativewindow.ProxySurface;
 import javax.media.nativewindow.UpstreamSurfaceHook;
 
 public class UpstreamSurfaceHookMutableSize implements UpstreamSurfaceHook.MutableSize {
-    int width, height;
+    int pixWidth, pixHeight;
 
     /**
      * @param width initial width
      * @param height initial height
      */
-    public UpstreamSurfaceHookMutableSize(int width, int height) {
-        this.width = width;
-        this.height = height;
+    public UpstreamSurfaceHookMutableSize(final int width, final int height) {
+        this.pixWidth = width;
+        this.pixHeight = height;
     }
 
     @Override
-    public final void setSize(int width, int height) {
-        this.width = width;
-        this.height = height;
+    public final void setSurfaceSize(final int width, final int height) {
+        this.pixWidth = width;
+        this.pixHeight = height;
     }
 
     @Override
-    public final int getWidth(ProxySurface s) {
-        return width;
+    public final int getSurfaceWidth(final ProxySurface s) {
+        return pixWidth;
     }
 
     @Override
-    public final int getHeight(ProxySurface s) {
-        return height;
+    public final int getSurfaceHeight(final ProxySurface s) {
+        return pixHeight;
     }
     @Override
-    public void create(ProxySurface s) { /* nop */ }
+    public void create(final ProxySurface s) { /* nop */ }
 
     @Override
-    public void destroy(ProxySurface s) { /* nop */ }
+    public void destroy(final ProxySurface s) { /* nop */ }
 
     @Override
     public String toString() {
-        return getClass().getSimpleName()+"[ "+ width + "x" + height + "]";
+        return getClass().getSimpleName()+"[pixel "+ pixWidth + "x" + pixHeight + "]";
+    }
+
+    /**
+     * {@inheritDoc}
+     * <p>
+     * Returns <code>null</code>.
+     * </p>
+     */
+    @Override
+    public final NativeSurface getUpstreamSurface() {
+        return null;
     }
 
 }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSizePos.java b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSizePos.java
deleted file mode 100644
index e6fcc04..0000000
--- a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamSurfaceHookMutableSizePos.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package com.jogamp.nativewindow;
-
-public class UpstreamSurfaceHookMutableSizePos extends UpstreamSurfaceHookMutableSize {
-    int x, y;
-
-    /**
-     * @param width initial width
-     * @param height initial height
-     */
-    public UpstreamSurfaceHookMutableSizePos(int x, int y, int width, int height) {
-        super(width, height);
-        this.x= x;
-        this.y= y;
-    }
-
-    // @Override
-    public final void setPos(int x, int y) {
-        this.x= x;
-        this.y= y;
-    }
-
-    public final int getX() {
-        return x;
-    }
-
-    public final int getY() {
-        return y;
-    }
-
-    @Override
-    public String toString() {
-        return getClass().getSimpleName()+"[ "+ x + "/" + y + " " + width + "x" + height + "]";
-    }
-
-}
-
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java
new file mode 100644
index 0000000..b509f11
--- /dev/null
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/UpstreamWindowHookMutableSizePos.java
@@ -0,0 +1,56 @@
+package com.jogamp.nativewindow;
+
+public class UpstreamWindowHookMutableSizePos extends UpstreamSurfaceHookMutableSize {
+    int winX, winY, winWidth, winHeight;
+
+    /**
+     * @param winX initial window x-pos
+     * @param winY initial window y-pos
+     * @param winWidth initial window width
+     * @param winHeight initial window height
+     * @param pixWidth initial surface pixel width, FIXME: pixel-dim == window-dim 'for now' ?
+     * @param pixHeight initial surface pixel height, FIXME: pixel-dim == window-dim 'for now' ?
+     */
+    public UpstreamWindowHookMutableSizePos(final int winX, final int winY, final int winWidth, final int winHeight, final int pixWidth, final int pixHeight) {
+        super(pixWidth, pixHeight);
+        this.winX= winX;
+        this.winY= winY;
+        this.winWidth = winWidth;
+        this.winHeight = winHeight;
+    }
+
+    // @Override
+    public final void setWinPos(final int winX, final int winY) {
+        this.winX= winX;
+        this.winY= winY;
+    }
+    // @Override
+    public final void setWinSize(final int winWidth, final int winHeight) {
+        this.winWidth= winWidth;
+        this.winHeight= winHeight;
+        // FIXME HiDPI: Use pixelScale ?!
+        // FIXME HiDPI: Consider setting winWidth/winHeight by setSurfaceSize(..) (back-propagation)
+        this.setSurfaceSize(winWidth, winHeight);
+    }
+
+    public final int getX() {
+        return winX;
+    }
+
+    public final int getY() {
+        return winY;
+    }
+    public final int getWidth() {
+        return winWidth;
+    }
+    public final int getHeight() {
+        return winHeight;
+    }
+
+    @Override
+    public String toString() {
+        return getClass().getSimpleName()+"[window "+ winX + "/" + winY + " " + winWidth + "x" + winHeight + ", pixel " + pixWidth + "x" + pixHeight + "]";
+    }
+
+}
+
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
index aa9b876..3a62825 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsConfiguration.java
@@ -54,19 +54,19 @@ import jogamp.nativewindow.Debug;
     handled in a toolkit-independent manner. */
 
 public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration implements Cloneable {
-  private GraphicsConfiguration config;
+  private final GraphicsConfiguration config;
   AbstractGraphicsConfiguration encapsulated;
 
-  public AWTGraphicsConfiguration(AWTGraphicsScreen screen,
-                                  CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-                                  GraphicsConfiguration config, AbstractGraphicsConfiguration encapsulated) {
+  public AWTGraphicsConfiguration(final AWTGraphicsScreen screen,
+                                  final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+                                  final GraphicsConfiguration config, final AbstractGraphicsConfiguration encapsulated) {
     super(screen, capsChosen, capsRequested);
     this.config = config;
     this.encapsulated=encapsulated;
   }
 
-  private AWTGraphicsConfiguration(AWTGraphicsScreen screen, CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-                                   GraphicsConfiguration config) {
+  private AWTGraphicsConfiguration(final AWTGraphicsScreen screen, final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+                                   final GraphicsConfiguration config) {
     super(screen, capsChosen, capsRequested);
     this.config = config;
     this.encapsulated=null;
@@ -78,7 +78,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
    *        Otherwise the <code>capsChosen</code> is used.
    * @param capsRequested if null, default {@link Capabilities} are used, otherwise the given values.
    */
-  public static AWTGraphicsConfiguration create(Component awtComp, CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested) {
+  public static AWTGraphicsConfiguration create(final Component awtComp, CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested) {
       final GraphicsConfiguration awtGfxConfig = awtComp.getGraphicsConfiguration();
       if(null==awtGfxConfig) {
           throw new NativeWindowException("AWTGraphicsConfiguration.create: Null AWT GraphicsConfiguration @ "+awtComp);
@@ -96,7 +96,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
           capsRequested = new Capabilities();
       }
       if(null==capsChosen) {
-          GraphicsConfiguration gc = awtGraphicsDevice.getDefaultConfiguration();
+          final GraphicsConfiguration gc = awtGraphicsDevice.getDefaultConfiguration();
           capsChosen = AWTGraphicsConfiguration.setupCapabilitiesRGBABits(capsRequested, gc);
       }
       final GraphicsConfigurationFactory factory = GraphicsConfigurationFactory.getFactory(awtDevice, capsChosen);
@@ -110,7 +110,7 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
 
   // open access to superclass method
   @Override
-  public void setChosenCapabilities(CapabilitiesImmutable capsChosen) {
+  public void setChosenCapabilities(final CapabilitiesImmutable capsChosen) {
       super.setChosenCapabilities(capsChosen);
   }
 
@@ -136,16 +136,16 @@ public class AWTGraphicsConfiguration extends DefaultGraphicsConfiguration imple
    * @param gc the GraphicsConfiguration from which to derive the RGBA bit depths
    * @return the passed Capabilities
    */
-  public static CapabilitiesImmutable setupCapabilitiesRGBABits(CapabilitiesImmutable capabilitiesIn, GraphicsConfiguration gc) {
-    Capabilities capabilities = (Capabilities) capabilitiesIn.cloneMutable();
+  public static CapabilitiesImmutable setupCapabilitiesRGBABits(final CapabilitiesImmutable capabilitiesIn, final GraphicsConfiguration gc) {
+    final Capabilities capabilities = (Capabilities) capabilitiesIn.cloneMutable();
 
-    ColorModel cm = gc.getColorModel();
+    final ColorModel cm = gc.getColorModel();
     if(null==cm) {
         throw new NativeWindowException("Could not determine AWT ColorModel");
     }
-    int cmBitsPerPixel = cm.getPixelSize();
+    final int cmBitsPerPixel = cm.getPixelSize();
     int bitsPerPixel = 0;
-    int[] bitesPerComponent = cm.getComponentSize();
+    final int[] bitesPerComponent = cm.getComponentSize();
     if(bitesPerComponent.length>=3) {
         capabilities.setRedBits(bitesPerComponent[0]);
         bitsPerPixel += bitesPerComponent[0];
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsDevice.java
index a7fa535..219f4bb 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsDevice.java
@@ -48,15 +48,15 @@ import javax.media.nativewindow.AbstractGraphicsDevice;
 /** A wrapper for an AWT GraphicsDevice allowing it to be
     handled in a toolkit-independent manner. */
 public class AWTGraphicsDevice extends DefaultGraphicsDevice implements Cloneable {
-  private GraphicsDevice device;
+  private final GraphicsDevice device;
 
-  public AWTGraphicsDevice(GraphicsDevice device, int unitID) {
+  public AWTGraphicsDevice(final GraphicsDevice device, final int unitID) {
     super(NativeWindowFactory.TYPE_AWT, device.getIDstring(), unitID);
     this.device = device;
   }
 
   public static AWTGraphicsDevice createDefault() {
-    GraphicsDevice awtDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
+    final GraphicsDevice awtDevice = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
     return new AWTGraphicsDevice(awtDevice, AbstractGraphicsDevice.DEFAULT_UNIT);
   }
 
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java
index 83d6efa..6fc35f7 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTGraphicsScreen.java
@@ -51,35 +51,35 @@ import javax.media.nativewindow.*;
 
 public class AWTGraphicsScreen extends DefaultGraphicsScreen implements Cloneable {
 
-  public AWTGraphicsScreen(AWTGraphicsDevice device) {
+  public AWTGraphicsScreen(final AWTGraphicsDevice device) {
     super(device, findScreenIndex(device.getGraphicsDevice()));
   }
 
-  public static GraphicsDevice getScreenDevice(int index) {
+  public static GraphicsDevice getScreenDevice(final int index) {
     if(index<0) return null;
-    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
-    GraphicsDevice[] gs = ge.getScreenDevices();
+    final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+    final GraphicsDevice[] gs = ge.getScreenDevices();
     if(index<gs.length) {
         return gs[index];
     }
     return null;
   }
 
-  public static int findScreenIndex(GraphicsDevice awtDevice) {
+  public static int findScreenIndex(final GraphicsDevice awtDevice) {
     if(null==awtDevice) return -1;
-    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
-    GraphicsDevice[] gs = ge.getScreenDevices();
+    final GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
+    final GraphicsDevice[] gs = ge.getScreenDevices();
     for (int j = 0; j < gs.length; j++) {
         if(gs[j] == awtDevice) return j;
     }
     return -1;
   }
 
-  public static AbstractGraphicsScreen createScreenDevice(GraphicsDevice awtDevice, int unitID) {
+  public static AbstractGraphicsScreen createScreenDevice(final GraphicsDevice awtDevice, final int unitID) {
     return new AWTGraphicsScreen(new AWTGraphicsDevice(awtDevice, unitID));
   }
 
-  public static AbstractGraphicsScreen createScreenDevice(int index, int unitID) {
+  public static AbstractGraphicsScreen createScreenDevice(final int index, final int unitID) {
     return createScreenDevice(getScreenDevice(index), unitID);
   }
 
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java
index 44163fc..b0a7fbc 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTPrintLifecycle.java
@@ -120,7 +120,7 @@ public interface AWTPrintLifecycle {
          * @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
          * @return the context
          */
-        public static Context setupPrint(Container c, double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
+        public static Context setupPrint(final Container c, final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight) {
             final Context t = new Context(c, scaleMatX, scaleMatY, numSamples, tileWidth, tileHeight);
             t.setupPrint(c);
             return t;
@@ -150,16 +150,16 @@ public interface AWTPrintLifecycle {
 
         private final AWTMisc.ComponentAction setupAction = new AWTMisc.ComponentAction() {
             @Override
-            public void run(Component c) {
+            public void run(final Component c) {
                 ((AWTPrintLifecycle)c).setupPrint(scaleMatX, scaleMatY, numSamples, tileWidth, tileHeight);
             } };
         private final AWTMisc.ComponentAction releaseAction = new AWTMisc.ComponentAction() {
             @Override
-            public void run(Component c) {
+            public void run(final Component c) {
                 ((AWTPrintLifecycle)c).releasePrint();
             } };
 
-        private Context(Container c, double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
+        private Context(final Container c, final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight) {
             this.cont = c;
             this.scaleMatX = scaleMatX;
             this.scaleMatY = scaleMatY;
@@ -168,7 +168,7 @@ public interface AWTPrintLifecycle {
             this.tileHeight = tileHeight;
             this.count = 0;
         }
-        private void setupPrint(Container c) {
+        private void setupPrint(final Container c) {
             count = AWTMisc.performAction(c, AWTPrintLifecycle.class, setupAction);
         }
     }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java
index aadecb4..496e6e0 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AWTWindowClosingProtocol.java
@@ -53,7 +53,7 @@ public class AWTWindowClosingProtocol implements WindowClosingProtocol {
    * @param closingOperationClose mandatory closing operation, triggered if windowClosing and {@link WindowClosingMode#DISPOSE_ON_CLOSE}
    * @param closingOperationNOP optional closing operation, triggered if windowClosing and {@link WindowClosingMode#DO_NOTHING_ON_CLOSE}
    */
-  public AWTWindowClosingProtocol(Component comp, Runnable closingOperationClose, Runnable closingOperationNOP) {
+  public AWTWindowClosingProtocol(final Component comp, final Runnable closingOperationClose, final Runnable closingOperationNOP) {
       this.comp = comp;
       this.listenTo = null;
       this.closingOperationClose = closingOperationClose;
@@ -62,7 +62,7 @@ public class AWTWindowClosingProtocol implements WindowClosingProtocol {
 
   class WindowClosingAdapter extends WindowAdapter {
     @Override
-    public void windowClosing(WindowEvent e) {
+    public void windowClosing(final WindowEvent e) {
       final WindowClosingMode op = AWTWindowClosingProtocol.this.getDefaultCloseOperation();
 
       if( WindowClosingMode.DISPOSE_ON_CLOSE == op ) {
@@ -128,7 +128,7 @@ public class AWTWindowClosingProtocol implements WindowClosingProtocol {
   }
 
   @Override
-  public final WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+  public final WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
       synchronized(closingListenerLock) {
           final WindowClosingMode _op = defaultCloseOperation;
           defaultCloseOperation = op;
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java
new file mode 100644
index 0000000..2026ada
--- /dev/null
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/AppContextInfo.java
@@ -0,0 +1,199 @@
+package com.jogamp.nativewindow.awt;
+
+import java.lang.ref.WeakReference;
+import java.lang.reflect.Method;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+
+import com.jogamp.common.util.RunnableTask;
+
+import jogamp.nativewindow.jawt.JAWTUtil;
+
+/**
+ * Instance of this class holds information about a {@link ThreadGroup} associated {@link sun.awt.AppContext}.
+ * <p>
+ * Non intrusive workaround for Bug 983 and Bug 1004, see {@link #getCachedThreadGroup()}.
+ * </p>
+ */
+public class AppContextInfo {
+  private static final boolean DEBUG;
+
+  private static final Method getAppContextMethod;
+  private static final Object mainThreadAppContextLock = new Object();
+  private volatile WeakReference<Object> mainThreadAppContextWR = null;
+  private volatile WeakReference<ThreadGroup> mainThreadGroupWR = null;
+
+  static {
+      DEBUG = JAWTUtil.DEBUG;
+      final Method[] _getAppContextMethod = { null };
+      AccessController.doPrivileged(new PrivilegedAction<Object>() {
+          @Override
+          public Object run() {
+              try {
+                  final Class<?> appContextClass = Class.forName("sun.awt.AppContext");
+                  _getAppContextMethod[0] = appContextClass.getMethod("getAppContext");
+              } catch(final Throwable ex) {
+                  System.err.println("Bug 1004: Caught @ static: "+ex.getMessage());
+                  ex.printStackTrace();
+              }
+              return null;
+          } } );
+      getAppContextMethod = _getAppContextMethod[0];
+  }
+
+  public AppContextInfo(final String info) {
+      update(info);
+  }
+
+  /**
+   * Returns <code>true</code> if this instance has valid {@link sun.awt.AppContext} information,
+   * i.e. {@link #getCachedThreadGroup()} returns not <code>null</code>.
+   */
+  public final boolean isValid() {
+      return null != getCachedThreadGroup();
+  }
+
+  /**
+   * Returns the {@link ThreadGroup} belonging to the
+   * last known {@link sun.awt.AppContext} as queried via {@link #update(String)}.
+   * <p>
+   * Returns <code>null</code> if no {@link sun.awt.AppContext} has been queried.
+   * </p>
+   * <p>
+   * The returned {@link ThreadGroup} allows users to create a custom thread
+   * belonging to it and hence mitigating Bug 983 and Bug 1004.
+   * </p>
+   * <p>
+   * {@link #update(String)} should be called from a thread belonging to the
+   * desired {@link sun.awt.AppContext}, i.e. early from within the special threaded application.
+   * </p>
+   * <p>
+   * E.g. {@link JAWTWindow} issues {@link #update(String)} in it's constructor.
+   * </p>
+   */
+  public final ThreadGroup getCachedThreadGroup() {
+      final WeakReference<ThreadGroup> tgRef = mainThreadGroupWR;
+      return null != tgRef ? tgRef.get() : null;
+  }
+
+  /**
+   * Invokes <code>runnable</code> on a {@link Thread} belonging to the {@link sun.awt.AppContext} {@link ThreadGroup},
+   * see {@link #getCachedThreadGroup()}.
+   * <p>
+   * {@link #update(String)} is issued first, which returns <code>true</code>
+   * if the current thread belongs to an AppContext {@link ThreadGroup}.
+   * In this case the <code>runnable</code> is invoked on the current thread,
+   * otherwise a new {@link Thread} will be started.
+   * </p>
+   * <p>
+   * If a new {@link Thread} is required, the AppContext {@link ThreadGroup} is being used
+   * if {@link #isValid() available}, otherwise the default system {@link ThreadGroup}.
+   * </p>
+   *
+   * @param waitUntilDone if <code>true</code>, waits until <code>runnable</code> execution is completed, otherwise returns immediately.
+   * @param runnable the {@link Runnable} to be executed. If <code>waitUntilDone</code> is <code>true</code>,
+   *                 the runnable <b>must exist</b>, i.e. not loop forever.
+   * @param threadBaseName the base name for the new thread if required.
+   *        The resulting thread name will have either '-OnAppContextTG' or '-OnSystemTG' appended
+   * @return the {@link Thread} used to invoke the <code>runnable</code>, which may be the current {@link Thread} or a newly created one, see above.
+   */
+  public Thread invokeOnAppContextThread(final boolean waitUntilDone, final Runnable runnable, final String threadBaseName) {
+      final Thread t;
+      if( update("invoke") ) {
+          t = Thread.currentThread();
+          if( DEBUG ) {
+              System.err.println("Bug 1004: Invoke.0 on current AppContext thread: "+t+" "+toHexString(t.hashCode()));
+          }
+          runnable.run();
+      } else {
+          final ThreadGroup tg = getCachedThreadGroup();
+          final String tName = threadBaseName + ( null != tg ? "-OnAppContextTG" : "-OnSystemTG" );
+          t = RunnableTask.invokeOnNewThread(tg, waitUntilDone, runnable, tName);
+          if( DEBUG ) {
+              final int tgHash = null != tg ? tg.hashCode() : 0;
+              System.err.println("Bug 1004: Invoke.1 on new AppContext thread: "+t+" "+toHexString(t.hashCode())+", tg "+tg+" "+toHexString(tgHash));
+          }
+      }
+      return t;
+  }
+
+  /**
+   * Update {@link sun.awt.AppContext} information for the current ThreadGroup if uninitialized or {@link sun.awt.AppContext} changed.
+   * <p>
+   * See {@link #getCachedThreadGroup()} for usage.
+   * </p>
+   * @param info informal string for logging purposes
+   * @return <code>true</code> if the current ThreadGroup is mapped to an {@link sun.awt.AppContext} and the information is good, otherwise false.
+   */
+  public final boolean update(final String info) {
+      if ( null != getAppContextMethod ) {
+          // Test whether the current thread's ThreadGroup is mapped to an AppContext.
+          final Object thisThreadAppContext = fetchAppContext();
+          final boolean tgMapped = null != thisThreadAppContext;
+
+          final Thread thread = Thread.currentThread();
+          final ThreadGroup threadGroup = thread.getThreadGroup();
+          final Object mainThreadAppContext;
+          {
+              final WeakReference<Object> _mainThreadAppContextWR = mainThreadAppContextWR;
+              mainThreadAppContext = null != _mainThreadAppContextWR ? _mainThreadAppContextWR.get() : null;
+          }
+
+          if( tgMapped ) { // null != thisThreadAppContext
+              // Update info is possible
+              if( null == mainThreadAppContext ||
+                  mainThreadAppContext != thisThreadAppContext ) {
+                  // GC'ed or 1st fetch !
+                  final int mainThreadAppContextHash = null != mainThreadAppContext ? mainThreadAppContext.hashCode() : 0;
+                  final int thisThreadAppContextHash;
+                  synchronized(mainThreadAppContextLock) {
+                      mainThreadGroupWR = new WeakReference<ThreadGroup>(threadGroup);
+                      mainThreadAppContextWR = new WeakReference<Object>(thisThreadAppContext);
+                      thisThreadAppContextHash = thisThreadAppContext.hashCode();
+                  }
+                  if( DEBUG ) {
+                      System.err.println("Bug 1004[TGMapped "+tgMapped+"]: Init AppContext @ "+info+" on thread "+thread.getName()+" "+toHexString(thread.hashCode())+
+                                         ": tg "+threadGroup.getName()+" "+toHexString(threadGroup.hashCode())+
+                                         " -> appCtx [ main "+mainThreadAppContext+" "+toHexString(mainThreadAppContextHash)+
+                                         " -> this "+thisThreadAppContext+" "+toHexString(thisThreadAppContextHash) + " ] ");
+                  }
+              } else {
+                  // old info is OK
+                  if( DEBUG ) {
+                      final int mainThreadAppContextHash = mainThreadAppContext.hashCode();
+                      final int thisThreadAppContextHash = thisThreadAppContext.hashCode();
+                      System.err.println("Bug 1004[TGMapped "+tgMapped+"]: OK AppContext @ "+info+" on thread "+thread.getName()+" "+toHexString(thread.hashCode())+
+                                         ": tg "+threadGroup.getName()+" "+toHexString(threadGroup.hashCode())+
+                                         "  : appCtx [ this "+thisThreadAppContext+" "+toHexString(thisThreadAppContextHash)+
+                                         "  , main "+mainThreadAppContext+" "+toHexString(mainThreadAppContextHash) + " ] ");
+                  }
+              }
+              return true;
+          } else {
+              if( DEBUG ) {
+                  final int mainThreadAppContextHash = null != mainThreadAppContext ? mainThreadAppContext.hashCode() : 0;
+                  final int thisThreadAppContextHash = null != thisThreadAppContext ? thisThreadAppContext.hashCode() : 0;
+                  System.err.println("Bug 1004[TGMapped "+tgMapped+"]: No AppContext @ "+info+" on thread "+thread.getName()+" "+toHexString(thread.hashCode())+
+                                     ": tg "+threadGroup.getName()+" "+toHexString(threadGroup.hashCode())+
+                                     " -> appCtx [ this "+thisThreadAppContext+" "+toHexString(thisThreadAppContextHash)+
+                                     " -> main "+mainThreadAppContext+" "+toHexString(mainThreadAppContextHash) + " ] ");
+              }
+          }
+      }
+      return false;
+  }
+  private static Object fetchAppContext() {
+      try {
+          return getAppContextMethod.invoke(null);
+      } catch(final Exception ex) {
+          System.err.println("Bug 1004: Caught: "+ex.getMessage());
+          ex.printStackTrace();
+          return null;
+      }
+  }
+
+  private static String toHexString(final int i) {
+      return "0x"+Integer.toHexString(i);
+  }
+
+}
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java
index eeec663..c705509 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/DirectDataBufferInt.java
@@ -47,14 +47,14 @@ import com.jogamp.common.nio.Buffers;
 public final class DirectDataBufferInt extends DataBuffer {
 
     public static class DirectWritableRaster extends WritableRaster {
-        protected DirectWritableRaster(SampleModel sampleModel, DirectDataBufferInt dataBuffer, Point origin) {
+        protected DirectWritableRaster(final SampleModel sampleModel, final DirectDataBufferInt dataBuffer, final Point origin) {
             super(sampleModel, dataBuffer, origin);
         }
     }
 
     public static class BufferedImageInt extends BufferedImage {
         final int customImageType;
-        public BufferedImageInt (int customImageType, ColorModel cm, WritableRaster raster, Hashtable<?,?> properties) {
+        public BufferedImageInt (final int customImageType, final ColorModel cm, final WritableRaster raster, final Hashtable<?,?> properties) {
             super(cm, raster, false /* isRasterPremultiplied */, properties);
             this.customImageType = customImageType;
         }
@@ -97,7 +97,7 @@ public final class DirectDataBufferInt extends DataBuffer {
      *                  <code>String</code>/<code>Object</code> pairs. Used for {@link BufferedImage#getProperty(String)} etc.
      * @return
      */
-    public static BufferedImageInt createBufferedImage(int width, int height, int imageType, Point location, Hashtable<?,?> properties) {
+    public static BufferedImageInt createBufferedImage(final int width, final int height, final int imageType, Point location, final Hashtable<?,?> properties) {
         final ColorSpace colorSpace = ColorSpace.getInstance(ColorSpace.CS_sRGB);
         final int transferType = DataBuffer.TYPE_INT;
         final int bpp, rmask, gmask, bmask, amask;
@@ -167,10 +167,10 @@ public final class DirectDataBufferInt extends DataBuffer {
     }
 
     /** Default data bank. */
-    private IntBuffer data;
+    private final IntBuffer data;
 
     /** All data banks */
-    private IntBuffer bankdata[];
+    private final IntBuffer bankdata[];
 
     /**
      * Constructs an nio integer-based {@link DataBuffer} with a single bank
@@ -178,7 +178,7 @@ public final class DirectDataBufferInt extends DataBuffer {
      *
      * @param size The size of the {@link DataBuffer}.
      */
-    public DirectDataBufferInt(int size) {
+    public DirectDataBufferInt(final int size) {
         super(TYPE_INT, size);
         data = Buffers.newDirectIntBuffer(size);
         bankdata = new IntBuffer[1];
@@ -192,7 +192,7 @@ public final class DirectDataBufferInt extends DataBuffer {
      * @param size The size of the banks in the {@link DataBuffer}.
      * @param numBanks The number of banks in the a{@link DataBuffer}.
      */
-    public DirectDataBufferInt(int size, int numBanks) {
+    public DirectDataBufferInt(final int size, final int numBanks) {
         super(TYPE_INT,size,numBanks);
         bankdata = new IntBuffer[numBanks];
         for (int i= 0; i < numBanks; i++) {
@@ -213,7 +213,7 @@ public final class DirectDataBufferInt extends DataBuffer {
      * @param dataArray The integer array for the {@link DataBuffer}.
      * @param size The size of the {@link DataBuffer} bank.
      */
-    public DirectDataBufferInt(IntBuffer dataArray, int size) {
+    public DirectDataBufferInt(final IntBuffer dataArray, final int size) {
         super(TYPE_INT,size);
         data = dataArray;
         bankdata = new IntBuffer[1];
@@ -235,7 +235,7 @@ public final class DirectDataBufferInt extends DataBuffer {
      * @param bank The bank whose data array you want to get.
      * @return The data array for the specified bank.
      */
-    public IntBuffer getData(int bank) {
+    public IntBuffer getData(final int bank) {
         return bankdata[bank];
     }
 
@@ -248,7 +248,7 @@ public final class DirectDataBufferInt extends DataBuffer {
      * @see #setElem(int, int, int)
      */
     @Override
-    public int getElem(int i) {
+    public int getElem(final int i) {
         return data.get(i+offset);
     }
 
@@ -262,7 +262,7 @@ public final class DirectDataBufferInt extends DataBuffer {
      * @see #setElem(int, int, int)
      */
     @Override
-    public int getElem(int bank, int i) {
+    public int getElem(final int bank, final int i) {
         return bankdata[bank].get(i+offsets[bank]);
     }
 
@@ -276,7 +276,7 @@ public final class DirectDataBufferInt extends DataBuffer {
      * @see #getElem(int, int)
      */
     @Override
-    public void setElem(int i, int val) {
+    public void setElem(final int i, final int val) {
         data.put(i+offset, val);
     }
 
@@ -290,7 +290,7 @@ public final class DirectDataBufferInt extends DataBuffer {
      * @see #getElem(int, int)
      */
     @Override
-    public void setElem(int bank, int i, int val) {
+    public void setElem(final int bank, final int i, final int val) {
         bankdata[bank].put(i+offsets[bank], val);
     }
 }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
index bb7b447..6498ebd 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/awt/JAWTWindow.java
@@ -61,6 +61,7 @@ import javax.media.nativewindow.NativeWindow;
 import javax.media.nativewindow.NativeWindowException;
 import javax.media.nativewindow.OffscreenLayerOption;
 import javax.media.nativewindow.OffscreenLayerSurface;
+import javax.media.nativewindow.ScalableSurface;
 import javax.media.nativewindow.SurfaceUpdatedListener;
 import javax.media.nativewindow.util.Insets;
 import javax.media.nativewindow.util.InsetsImmutable;
@@ -70,13 +71,15 @@ import javax.media.nativewindow.util.PointImmutable;
 import javax.media.nativewindow.util.Rectangle;
 import javax.media.nativewindow.util.RectangleImmutable;
 
+import jogamp.common.os.PlatformPropsImpl;
+import jogamp.nativewindow.SurfaceScaleUtils;
 import jogamp.nativewindow.SurfaceUpdatedHelper;
 import jogamp.nativewindow.awt.AWTMisc;
 import jogamp.nativewindow.jawt.JAWT;
 import jogamp.nativewindow.jawt.JAWTUtil;
 import jogamp.nativewindow.jawt.JAWT_Rectangle;
 
-public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, OffscreenLayerOption {
+public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface, OffscreenLayerOption, ScalableSurface {
   protected static final boolean DEBUG = JAWTUtil.DEBUG;
 
   // user properties
@@ -84,6 +87,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
 
   // lifetime: forever
   protected final Component component;
+  private final AppContextInfo appContextInfo;
   private final AWTGraphicsConfiguration config; // control access due to delegation
   private final SurfaceUpdatedHelper surfaceUpdatedHelper = new SurfaceUpdatedHelper();
   private final RecursiveLock surfaceLock = LockFactory.createRecursiveLock();
@@ -98,6 +102,10 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
   protected Insets insets;
   private volatile long offscreenSurfaceLayer;
 
+  private final int[] nativePixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+  private final int[] hasPixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+  protected final int[] reqPixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
+
   private long drawable_old;
 
   /**
@@ -107,13 +115,14 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
    * @param comp
    * @param config
    */
-  protected JAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+  protected JAWTWindow(final Object comp, final AbstractGraphicsConfiguration config) {
     if (config == null) {
         throw new NativeWindowException("Error: AbstractGraphicsConfiguration is null");
     }
     if(! ( config instanceof AWTGraphicsConfiguration ) ) {
         throw new NativeWindowException("Error: AbstractGraphicsConfiguration is not an AWTGraphicsConfiguration: "+config);
     }
+    appContextInfo = new AppContextInfo("<init>");
     this.component = (Component)comp;
     this.config = (AWTGraphicsConfiguration) config;
     this.jawtComponentListener = new JAWTComponentListener();
@@ -121,7 +130,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
     this.isApplet = false;
     this.offscreenSurfaceLayer = 0;
   }
-  private static String id(Object obj) { return "0x" + ( null!=obj ? Integer.toHexString(obj.hashCode()) : "nil" ); }
+  private static String id(final Object obj) { return ( null!=obj ? toHexString(obj.hashCode()) : "nil" ); }
   private String jawtStr() { return "JAWTWindow["+id(JAWTWindow.this)+"]"; }
 
   private class JAWTComponentListener implements ComponentListener, HierarchyListener {
@@ -187,7 +196,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
         }
 
         @Override
-        public final void componentResized(ComponentEvent e) {
+        public final void componentResized(final ComponentEvent e) {
             if(DEBUG) {
                 System.err.println(jawtStr()+".componentResized: "+s(e));
             }
@@ -195,7 +204,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
         }
 
         @Override
-        public final void componentMoved(ComponentEvent e) {
+        public final void componentMoved(final ComponentEvent e) {
             if(DEBUG) {
                 System.err.println(jawtStr()+".componentMoved: "+s(e));
             }
@@ -203,7 +212,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
         }
 
         @Override
-        public final void componentShown(ComponentEvent e) {
+        public final void componentShown(final ComponentEvent e) {
             if(DEBUG) {
                 System.err.println(jawtStr()+".componentShown: "+s(e));
             }
@@ -211,7 +220,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
         }
 
         @Override
-        public final void componentHidden(ComponentEvent e) {
+        public final void componentHidden(final ComponentEvent e) {
             if(DEBUG) {
                 System.err.println(jawtStr()+".componentHidden: "+s(e));
             }
@@ -219,7 +228,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
         }
 
         @Override
-        public final void hierarchyChanged(HierarchyEvent e) {
+        public final void hierarchyChanged(final HierarchyEvent e) {
             final boolean wasShowing = isShowing;
             isShowing = component.isShowing();
             int action = 0;
@@ -257,17 +266,54 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
     drawable_old = 0;
     bounds = new Rectangle();
     insets = new Insets();
+    hasPixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+    hasPixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
+    nativePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+    nativePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
   }
   protected abstract void invalidateNative();
 
-  protected final boolean updateBounds(JAWT_Rectangle jawtBounds) {
+  /**
+   * {@inheritDoc}
+   * <p>
+   * Per default impl. only works for not yet {@link #isRealized() realized} instances,
+   * current exception OSX.
+   * </p>
+   */
+  @Override
+  public void setSurfaceScale(final int[] pixelScale) {
+      SurfaceScaleUtils.validateReqPixelScale(reqPixelScale, pixelScale, DEBUG ? getClass().getSimpleName() : null);
+  }
+
+  @Override
+  public final int[] getRequestedSurfaceScale(final int[] result) {
+      System.arraycopy(reqPixelScale, 0, result, 0, 2);
+      return result;
+  }
+
+  @Override
+  public final int[] getCurrentSurfaceScale(final int[] result) {
+      System.arraycopy(hasPixelScale, 0, result, 0, 2);
+      return result;
+  }
+
+  @Override
+  public final int[] getNativeSurfaceScale(final int[] result) {
+      System.arraycopy(nativePixelScale, 0, result, 0, 2);
+      return result;
+  }
+
+  /**
+   * Updates bounds and pixelScale
+   * @return true if bounds or pixelScale has changed, otherwise false
+   */
+  protected final boolean updateLockedData(final JAWT_Rectangle jawtBounds) {
     final Rectangle jb = new Rectangle(jawtBounds.getX(), jawtBounds.getY(), jawtBounds.getWidth(), jawtBounds.getHeight());
-    final boolean changed = !bounds.equals(jb);
+    final boolean changedBounds = !bounds.equals(jb);
 
-    if(changed) {
-        if(DEBUG) {
+    if( changedBounds ) {
+        if( DEBUG ) {
             System.err.println("JAWTWindow.updateBounds: "+bounds+" -> "+jb);
-            // Thread.dumpStack();
         }
         bounds.set(jawtBounds.getX(), jawtBounds.getY(), jawtBounds.getWidth(), jawtBounds.getHeight());
 
@@ -276,12 +322,32 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
             insets.set(contInsets.left, contInsets.right, contInsets.top, contInsets.bottom);
         }
     }
-    return changed;
+    {
+        final int ps = JAWTUtil.getPixelScale(config.getAWTGraphicsConfiguration());
+        nativePixelScale[0] = ps;
+        nativePixelScale[1] = ps;
+    }
+
+    return updatePixelScale() || changedBounds;
+  }
+
+  /**
+   * Update pixelScale
+   * @return true if pixelScale has changed, otherwise false
+   */
+  protected final boolean updatePixelScale() {
+    return SurfaceScaleUtils.computePixelScale(hasPixelScale, hasPixelScale, reqPixelScale, nativePixelScale, DEBUG ? getClass().getSimpleName() : null);
   }
 
   /** @return the JAWT_DrawingSurfaceInfo's (JAWT_Rectangle) bounds, updated with lock */
   public final RectangleImmutable getBounds() { return bounds; }
 
+  /** @return the safe pixelScale value for x-direction, i.e. never negative or zero. Updated with lock. */
+  protected final int getPixelScaleX() { return hasPixelScale[0]; }
+
+  /** @return the safe pixelScale value for y-direction, i.e. never negative or zero. Updated with lock. */
+  protected final int getPixelScaleY() { return hasPixelScale[1]; }
+
   @Override
   public final InsetsImmutable getInsets() { return insets; }
 
@@ -307,7 +373,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
   //
 
   @Override
-  public void setShallUseOffscreenLayer(boolean v) {
+  public void setShallUseOffscreenLayer(final boolean v) {
       shallUseOffscreenLayer = v;
   }
 
@@ -332,8 +398,20 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
       }
       attachSurfaceLayerImpl(layerHandle);
       offscreenSurfaceLayer = layerHandle;
-      component.repaint();
+      appContextInfo.invokeOnAppContextThread(false /* waitUntilDone */, repaintTask, "Repaint");
   }
+  private final Runnable repaintTask = new Runnable() {
+          @Override
+          public void run() {
+              final Component c = component;
+              if( DEBUG ) {
+                  System.err.println("Bug 1004: RepaintTask on "+Thread.currentThread()+": Has Comp "+(null != c));
+              }
+              if( null != c ) {
+                  c.repaint();
+              }
+          } };
+
   protected void attachSurfaceLayerImpl(final long layerHandle) {
       throw new UnsupportedOperationException("offscreen layer not supported");
   }
@@ -351,9 +429,9 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
    * @see #isOffscreenLayerSurfaceEnabled()
    * @throws NativeWindowException if {@link #isOffscreenLayerSurfaceEnabled()} == false
    */
-  protected void layoutSurfaceLayerImpl(long layerHandle, boolean visible) {}
+  protected void layoutSurfaceLayerImpl(final long layerHandle, final boolean visible) {}
 
-  private final void layoutSurfaceLayerIfEnabled(boolean visible) throws NativeWindowException {
+  private final void layoutSurfaceLayerIfEnabled(final boolean visible) throws NativeWindowException {
       if( isOffscreenLayerSurfaceEnabled() && 0 != offscreenSurfaceLayer ) {
           layoutSurfaceLayerImpl(offscreenSurfaceLayer, visible);
       }
@@ -396,7 +474,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
   }
 
   @Override
-  public final void setChosenCapabilities(CapabilitiesImmutable caps) {
+  public final void setChosenCapabilities(final CapabilitiesImmutable caps) {
       ((MutableGraphicsConfiguration)getGraphicsConfiguration()).setChosenCapabilities(caps);
       config.setChosenCapabilities(caps);
   }
@@ -417,7 +495,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
                   final java.awt.Point awtHotspot = new java.awt.Point(hotSpot.getX(), hotSpot.getY());
                   try {
                       c = AWTMisc.getCursor(pixelrect, awtHotspot);
-                  } catch (Exception e) {
+                  } catch (final Exception e) {
                       e.printStackTrace();
                   }
               }
@@ -551,22 +629,22 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
   }
 
   @Override
-  public void addSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+  public void addSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
       surfaceUpdatedHelper.addSurfaceUpdatedListener(l);
   }
 
   @Override
-  public void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
+  public void addSurfaceUpdatedListener(final int index, final SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
       surfaceUpdatedHelper.addSurfaceUpdatedListener(index, l);
   }
 
   @Override
-  public void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+  public void removeSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
       surfaceUpdatedHelper.removeSurfaceUpdatedListener(l);
   }
 
   @Override
-  public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+  public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
       surfaceUpdatedHelper.surfaceUpdated(updater, ns, when);
   }
 
@@ -591,20 +669,47 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
   }
 
   @Override
-  public final int getWidth() {
-    return component.getWidth();
+  public final int getSurfaceWidth() {
+    return getWidth() * getPixelScaleX();
   }
 
   @Override
-  public final int getHeight() {
-    return component.getHeight();
+  public final int getSurfaceHeight() {
+    return getHeight() * getPixelScaleY();
   }
 
+  @Override
+  public final int[] convertToWindowUnits(final int[] pixelUnitsAndResult) {
+      pixelUnitsAndResult[0] /= getPixelScaleX();
+      pixelUnitsAndResult[1] /= getPixelScaleY();
+      return pixelUnitsAndResult;
+  }
+
+  @Override
+  public final int[] convertToPixelUnits(final int[] windowUnitsAndResult) {
+      windowUnitsAndResult[0] *= getPixelScaleX();
+      windowUnitsAndResult[1] *= getPixelScaleY();
+      return windowUnitsAndResult;
+  }
+
+  @Override
+  public final NativeSurface getNativeSurface() { return this; }
+
   //
   // NativeWindow
   //
 
   @Override
+  public final int getWidth() {
+      return component.getWidth();
+  }
+
+  @Override
+  public final int getHeight() {
+      return component.getHeight();
+  }
+
+  @Override
   public void destroy() {
     surfaceLock.lock();
     try {
@@ -668,7 +773,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
               getLocationOnScreenNonBlocking(storage, component);
               return storage;
           }
-          java.awt.Point awtLOS = component.getLocationOnScreen();
+          final java.awt.Point awtLOS = component.getLocationOnScreen();
           if(null!=storage) {
               los = storage.translate(awtLOS.x, awtLOS.y);
           } else {
@@ -678,8 +783,8 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
       return los;
   }
 
-  protected Point getLocationOnScreenNative(Point storage) {
-      int lockRes = lockSurface();
+  protected Point getLocationOnScreenNative(final Point storage) {
+      final int lockRes = lockSurface();
       if(LOCK_SURFACE_NOT_READY == lockRes) {
           if(DEBUG) {
               System.err.println("Warning: JAWT Lock couldn't be acquired: "+this);
@@ -688,7 +793,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
           return null;
       }
       try {
-          Point d = getLocationOnScreenNativeImpl(0, 0);
+          final Point d = getLocationOnScreenNativeImpl(0, 0);
           if(null!=d) {
             if(null!=storage) {
                 storage.translate(d.getX(),d.getY());
@@ -702,7 +807,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
   }
   protected abstract Point getLocationOnScreenNativeImpl(int x, int y);
 
-  protected static Component getLocationOnScreenNonBlocking(Point storage, Component comp) {
+  protected static Component getLocationOnScreenNonBlocking(final Point storage, Component comp) {
       final java.awt.Insets insets = new java.awt.Insets(0, 0, 0, 0); // DEBUG
       Component last = null;
       while(null != comp) {
@@ -740,13 +845,15 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
       if( null == sb ) {
           sb = new StringBuilder();
       }
-      sb.append("JVM version: ").append(Platform.JAVA_VERSION).append(" (").
-      append(Platform.JAVA_VERSION_NUMBER).
-      append(" update ").append(Platform.JAVA_VERSION_UPDATE).append(")").append(Platform.getNewline());
+      sb.append("JVM version: ").append(PlatformPropsImpl.JAVA_VERSION).append(" (").
+      append(PlatformPropsImpl.JAVA_VERSION_NUMBER).
+      append(" update ").append(PlatformPropsImpl.JAVA_VERSION_UPDATE).append(")").append(Platform.getNewline());
       if(null != jawt) {
-          sb.append("JAWT version: 0x").append(Integer.toHexString(jawt.getCachedVersion())).
+          sb.append("JAWT version: ").append(toHexString(jawt.getCachedVersion())).
           append(", CA_LAYER: ").append(JAWTUtil.isJAWTUsingOffscreenLayer(jawt)).
-          append(", isLayeredSurface ").append(isOffscreenLayerSurfaceEnabled()).append(", bounds ").append(bounds).append(", insets ").append(insets);
+          append(", isLayeredSurface ").append(isOffscreenLayerSurfaceEnabled()).
+          append(", bounds ").append(bounds).append(", insets ").append(insets).
+          append(", pixelScale ").append(getPixelScaleX()).append("x").append(getPixelScaleY());
       } else {
           sb.append("JAWT n/a, bounds ").append(bounds).append(", insets ").append(insets);
       }
@@ -755,7 +862,7 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
 
   @Override
   public String toString() {
-    StringBuilder sb = new StringBuilder();
+    final StringBuilder sb = new StringBuilder();
 
     sb.append(jawtStr()+"[");
     jawt2String(sb);
@@ -765,7 +872,8 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
                 ", surfaceHandle "+toHexString(getSurfaceHandle())+
                 ", bounds "+bounds+", insets "+insets
                 );
-    sb.append(", pos "+getX()+"/"+getY()+", size "+getWidth()+"x"+getHeight()+
+    sb.append(", window ["+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+
+             "], pixels[s "+getPixelScaleX()+"x"+getPixelScaleY()+" -> "+getSurfaceWidth()+"x"+getSurfaceHeight()+"]"+
               ", visible "+component.isVisible());
     sb.append(", lockedExt "+isSurfaceLockedByOtherThread()+
               ",\n\tconfig "+config+
@@ -775,7 +883,11 @@ public abstract class JAWTWindow implements NativeWindow, OffscreenLayerSurface,
     return sb.toString();
   }
 
-  protected final String toHexString(long l) {
+  protected static final String toHexString(final long l) {
       return "0x"+Long.toHexString(l);
   }
+  protected static final String toHexString(final int i) {
+      return "0x"+Integer.toHexString(i);
+  }
+
 }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java
index 6dc52a7..d21994e 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/egl/EGLGraphicsDevice.java
@@ -73,7 +73,7 @@ public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
         this.eglLifecycleCallback = null;
     }
 
-    public EGLGraphicsDevice(long nativeDisplayID, long eglDisplay, String connection, int unitID, EGLDisplayLifecycleCallback eglLifecycleCallback) {
+    public EGLGraphicsDevice(final long nativeDisplayID, final long eglDisplay, final String connection, final int unitID, final EGLDisplayLifecycleCallback eglLifecycleCallback) {
         super(NativeWindowFactory.TYPE_EGL, connection, unitID, eglDisplay);
         this.nativeDisplayID[0] = nativeDisplayID;
         this.eglLifecycleCallback = eglLifecycleCallback;
@@ -137,7 +137,7 @@ public class EGLGraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
         return eglLifecycleCallback;
     }
     @Override
-    protected Object setHandleOwnership(Object newOwnership) {
+    protected Object setHandleOwnership(final Object newOwnership) {
         final EGLDisplayLifecycleCallback oldOwnership = eglLifecycleCallback;
         eglLifecycleCallback = (EGLDisplayLifecycleCallback) newOwnership;
         return oldOwnership;
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java
index 99ca006..ff14944 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/macosx/MacOSXGraphicsDevice.java
@@ -39,7 +39,7 @@ import javax.media.nativewindow.*;
 
 public class MacOSXGraphicsDevice extends DefaultGraphicsDevice implements Cloneable {
     /** Constructs a new MacOSXGraphicsDevice */
-    public MacOSXGraphicsDevice(int unitID) {
+    public MacOSXGraphicsDevice(final int unitID) {
         super(NativeWindowFactory.TYPE_MACOSX, AbstractGraphicsDevice.DEFAULT_CONNECTION, unitID);
     }
 
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
index 36bf646..d29e2ab 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/swt/SWTAccessor.java
@@ -112,7 +112,7 @@ public class SWTAccessor {
     private static final VersionNumber GTK_VERSION_2_24_0 = new VersionNumber(2, 24, 0);
     private static final VersionNumber GTK_VERSION_3_0_0  = new VersionNumber(3,  0, 0);
 
-    private static VersionNumber GTK_VERSION(int version) {
+    private static VersionNumber GTK_VERSION(final int version) {
         // return (major << 16) + (minor << 8) + micro;
         final int micro = ( version       ) & 0x0f;
         final int minor = ( version >>  8 ) & 0x0f;
@@ -137,7 +137,7 @@ public class SWTAccessor {
         if( !isOSX ) {
             try {
                 f = Control.class.getField(str_handle);
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 throw new NativeWindowException(ex);
             }
         }
@@ -156,7 +156,7 @@ public class SWTAccessor {
         Method m=null;
         try {
             m = ReflectionUtil.getMethod(Control.class, str_internal_new_GC, new Class[] { GCData.class });
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             throw new NativeWindowException(ex);
         }
         swt_control_internal_new_GC = m;
@@ -167,7 +167,7 @@ public class SWTAccessor {
             } else {
                 m = Control.class.getDeclaredMethod(str_internal_dispose_GC, new Class[] { int.class, GCData.class });
             }
-        } catch (NoSuchMethodException ex) {
+        } catch (final NoSuchMethodException ex) {
             throw new NativeWindowException(ex);
         }
         swt_control_internal_dispose_GC = m;
@@ -180,7 +180,7 @@ public class SWTAccessor {
             // mandatory
             try {
                 c = ReflectionUtil.getClass(str_OS_gtk_class, false, SWTAccessor.class.getClassLoader());
-                Field field_OS_gtk_version = c.getField(str_OS_gtk_version);
+                final Field field_OS_gtk_version = c.getField(str_OS_gtk_version);
                 _gtk_version = GTK_VERSION(field_OS_gtk_version.getInt(null));
                 m1 = c.getDeclaredMethod(str_gtk_widget_realize, handleType);
                 if (_gtk_version.compareTo(GTK_VERSION_2_14_0) >= 0) {
@@ -200,11 +200,11 @@ public class SWTAccessor {
                     m8 = c.getDeclaredMethod(str_gdk_x11_drawable_get_xid, handleType);
                 }
                 ma = c.getDeclaredMethod(str_gdk_window_set_back_pixmap, handleType, handleType, boolean.class);
-            } catch (Exception ex) { throw new NativeWindowException(ex); }
+            } catch (final Exception ex) { throw new NativeWindowException(ex); }
             // optional
             try {
                 m2 = c.getDeclaredMethod(str_gtk_widget_unrealize, handleType);
-            } catch (Exception ex) { }
+            } catch (final Exception ex) { }
         }
         OS_gtk_class = c;
         OS_gtk_version = _gtk_version;
@@ -226,23 +226,23 @@ public class SWTAccessor {
         }
     }
 
-    private static Number getIntOrLong(long arg) {
+    private static Number getIntOrLong(final long arg) {
         if(swt_uses_long_handles) {
-            return new Long(arg);
+            return Long.valueOf(arg);
         }
-        return new Integer((int) arg);
+        return Integer.valueOf((int) arg);
     }
 
-    private static void callStaticMethodL2V(Method m, long arg) {
+    private static void callStaticMethodL2V(final Method m, final long arg) {
         ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg) });
     }
 
-    private static void callStaticMethodLLZ2V(Method m, long arg0, long arg1, boolean arg3) {
+    private static void callStaticMethodLLZ2V(final Method m, final long arg0, final long arg1, final boolean arg3) {
         ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg0), getIntOrLong(arg1), Boolean.valueOf(arg3) });
     }
 
-    private static long callStaticMethodL2L(Method m, long arg) {
-        Object o = ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg) });
+    private static long callStaticMethodL2L(final Method m, final long arg) {
+        final Object o = ReflectionUtil.callMethod(null, m, new Object[] { getIntOrLong(arg) });
         if(o instanceof Number) {
             return ((Number)o).longValue();
         } else {
@@ -265,7 +265,7 @@ public class SWTAccessor {
     // Common GTK
     //
 
-    public static long gdk_widget_get_window(long handle) {
+    public static long gdk_widget_get_window(final long handle) {
         final long window;
         if (OS_gtk_version.compareTo(GTK_VERSION_2_14_0) >= 0) {
             window = callStaticMethodL2L(OS_gtk_widget_get_window, handle);
@@ -278,7 +278,7 @@ public class SWTAccessor {
         return window;
     }
 
-    public static long gdk_window_get_xdisplay(long window) {
+    public static long gdk_window_get_xdisplay(final long window) {
         final long xdisplay;
         if (OS_gtk_version.compareTo(GTK_VERSION_2_24_0) >= 0) {
             final long display = callStaticMethodL2L(OS_gdk_window_get_display, window);
@@ -295,7 +295,7 @@ public class SWTAccessor {
         return xdisplay;
     }
 
-    public static long gdk_window_get_xwindow(long window) {
+    public static long gdk_window_get_xwindow(final long window) {
         final long xWindow;
         if (OS_gtk_version.compareTo(GTK_VERSION_3_0_0) >= 0) {
             xWindow = callStaticMethodL2L(OS_gdk_x11_window_get_xid, window);
@@ -308,7 +308,7 @@ public class SWTAccessor {
         return xWindow;
     }
 
-    public static void gdk_window_set_back_pixmap(long window, long pixmap, boolean parent_relative) {
+    public static void gdk_window_set_back_pixmap(final long window, final long pixmap, final boolean parent_relative) {
         callStaticMethodLLZ2V(OS_gdk_window_set_back_pixmap, window, pixmap, parent_relative);
     }
 
@@ -321,27 +321,27 @@ public class SWTAccessor {
      * @return the native widget-handle
      * @throws NativeWindowException if the widget handle is null
      */
-    public static long getHandle(Control swtControl) throws NativeWindowException {
+    public static long getHandle(final Control swtControl) throws NativeWindowException {
         long h = 0;
         if( isOSX ) {
             synchronized(swt_osx_init) {
                 try {
                     if(null == swt_osx_view_id) {
                         swt_osx_control_view = Control.class.getField(str_osx_view);
-                        Object view = swt_osx_control_view.get(swtControl);
+                        final Object view = swt_osx_control_view.get(swtControl);
                         swt_osx_view_id = view.getClass().getField(str_osx_id);
                         h = swt_osx_view_id.getLong(view);
                     } else {
                         h = swt_osx_view_id.getLong( swt_osx_control_view.get(swtControl) );
                     }
-                } catch (Exception ex) {
+                } catch (final Exception ex) {
                     throw new NativeWindowException(ex);
                 }
             }
         } else {
             try {
                 h = swt_control_handle.getLong(swtControl);
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 throw new NativeWindowException(ex);
             }
         }
@@ -379,7 +379,7 @@ public class SWTAccessor {
      * @throws NativeWindowException if the widget handle is null
      * @throws UnsupportedOperationException if the windowing system is not supported
      */
-    public static AbstractGraphicsDevice getDevice(Control swtControl) throws NativeWindowException, UnsupportedOperationException {
+    public static AbstractGraphicsDevice getDevice(final Control swtControl) throws NativeWindowException, UnsupportedOperationException {
         final long handle = getHandle(swtControl);
         if( isX11GTK ) {
             final long xdisplay0 = gdk_window_get_xdisplay( gdk_widget_get_window( handle ) );
@@ -399,11 +399,11 @@ public class SWTAccessor {
      * @param screen -1 is default screen of the given device, e.g. maybe 0 or determined by native API. >= 0 is specific screen
      * @return
      */
-    public static AbstractGraphicsScreen getScreen(AbstractGraphicsDevice device, int screen) {
+    public static AbstractGraphicsScreen getScreen(final AbstractGraphicsDevice device, final int screen) {
         return NativeWindowFactory.createScreen(device, screen);
     }
 
-    public static int getNativeVisualID(AbstractGraphicsDevice device, long windowHandle) {
+    public static int getNativeVisualID(final AbstractGraphicsDevice device, final long windowHandle) {
         if( isX11 ) {
             return X11Lib.GetVisualIDFromWindow(device.getHandle(), windowHandle);
         }
@@ -419,7 +419,7 @@ public class SWTAccessor {
      * @throws NativeWindowException if the widget handle is null
      * @throws UnsupportedOperationException if the windowing system is not supported
      */
-    public static long getWindowHandle(Control swtControl) throws NativeWindowException, UnsupportedOperationException {
+    public static long getWindowHandle(final Control swtControl) throws NativeWindowException, UnsupportedOperationException {
         final long handle = getHandle(swtControl);
         if(0 == handle) {
             throw new NativeWindowException("Null SWT handle of SWT control "+swtControl);
@@ -453,9 +453,9 @@ public class SWTAccessor {
             @Override
             public void run() {
                 if(swt_uses_long_handles) {
-                    ReflectionUtil.callMethod(swtControl, swt_control_internal_dispose_GC, new Object[] { new Long(gc), gcData });
+                    ReflectionUtil.callMethod(swtControl, swt_control_internal_dispose_GC, new Object[] { Long.valueOf(gc), gcData });
                 }  else {
-                    ReflectionUtil.callMethod(swtControl, swt_control_internal_dispose_GC, new Object[] { new Integer((int)gc), gcData });
+                    ReflectionUtil.callMethod(swtControl, swt_control_internal_dispose_GC, new Object[] { Integer.valueOf((int)gc), gcData });
                 }
             }
         });
@@ -477,10 +477,10 @@ public class SWTAccessor {
     * @see Platform#AWT_AVAILABLE
     * @see Platform#getOSType()
     */
-    public static void invoke(boolean wait, Runnable runnable) {
+    public static void invoke(final boolean wait, final Runnable runnable) {
         if( isOSX ) {
             // Use SWT main thread! Only reliable config w/ -XStartOnMainThread !?
-            OSXUtil.RunOnMainThread(wait, runnable);
+            OSXUtil.RunOnMainThread(wait, false, runnable);
         } else {
             runnable.run();
         }
@@ -493,7 +493,7 @@ public class SWTAccessor {
     * {@link #invoke(boolean, Runnable)} is being used.
     * @see #invoke(boolean, Runnable)
     */
-    public static void invoke(org.eclipse.swt.widgets.Display display, boolean wait, Runnable runnable) {
+    public static void invoke(final org.eclipse.swt.widgets.Display display, final boolean wait, final Runnable runnable) {
         if( display.isDisposed() || Thread.currentThread() == display.getThread() ) {
             invoke(wait, runnable);
         } else if( wait ) {
@@ -507,7 +507,7 @@ public class SWTAccessor {
     // Specific X11 GTK ChildWindow - Using plain X11 native parenting (works well)
     //
 
-    public static long createCompatibleX11ChildWindow(AbstractGraphicsScreen screen, Control swtControl, int visualID, int width, int height) {
+    public static long createCompatibleX11ChildWindow(final AbstractGraphicsScreen screen, final Control swtControl, final int visualID, final int width, final int height) {
         final long handle = getHandle(swtControl);
         final long parentWindow = gdk_widget_get_window( handle );
         gdk_window_set_back_pixmap (parentWindow, 0, false);
@@ -518,10 +518,10 @@ public class SWTAccessor {
         return x11WindowHandle;
     }
 
-    public static void resizeX11Window(AbstractGraphicsDevice device, Rectangle clientArea, long x11Window) {
+    public static void resizeX11Window(final AbstractGraphicsDevice device, final Rectangle clientArea, final long x11Window) {
         X11Lib.SetWindowPosSize(device.getHandle(), x11Window, clientArea.x, clientArea.y, clientArea.width, clientArea.height);
     }
-    public static void destroyX11Window(AbstractGraphicsDevice device, long x11Window) {
+    public static void destroyX11Window(final AbstractGraphicsDevice device, final long x11Window) {
         X11Lib.DestroyWindow(device.getHandle(), x11Window);
     }
 
@@ -534,7 +534,7 @@ public class SWTAccessor {
     // public static final int GDK_WA_TYPE_HINT = 1 << 9;
     // public static final int GDK_WA_VISUAL = 1 << 6;
 
-    public static long createCompatibleGDKChildWindow(Control swtControl, int visualID, int width, int height) {
+    public static long createCompatibleGDKChildWindow(final Control swtControl, final int visualID, final int width, final int height) {
         return 0;
         /**
         final long handle = SWTAccessor.getHandle(swtControl);
@@ -564,24 +564,24 @@ public class SWTAccessor {
         return childWindow; */
     }
 
-    public static void showGDKWindow(long gdkWindow) {
+    public static void showGDKWindow(final long gdkWindow) {
         /* OS.gdk_window_show (gdkWindow);
         OS.gdk_flush(); */
     }
-    public static void focusGDKWindow(long gdkWindow) {
+    public static void focusGDKWindow(final long gdkWindow) {
         /*
         OS.gdk_window_show (gdkWindow);
         OS.gdk_window_focus(gdkWindow, 0);
         OS.gdk_flush(); */
     }
-    public static void resizeGDKWindow(Rectangle clientArea, long gdkWindow) {
+    public static void resizeGDKWindow(final Rectangle clientArea, final long gdkWindow) {
         /**
         OS.gdk_window_move (gdkWindow, clientArea.x, clientArea.y);
         OS.gdk_window_resize (gdkWindow, clientArea.width, clientArea.height);
         OS.gdk_flush(); */
     }
 
-    public static void destroyGDKWindow(long gdkWindow) {
+    public static void destroyGDKWindow(final long gdkWindow) {
         // OS.gdk_window_destroy (gdkWindow);
     }
 }
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java
index 6439827..ef0cbdd 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/windows/WindowsGraphicsDevice.java
@@ -39,11 +39,11 @@ import javax.media.nativewindow.*;
  */
 public class WindowsGraphicsDevice extends DefaultGraphicsDevice implements Cloneable {
     /** Constructs a new WindowsGraphicsDevice */
-    public WindowsGraphicsDevice(int unitID) {
+    public WindowsGraphicsDevice(final int unitID) {
         this(AbstractGraphicsDevice.DEFAULT_CONNECTION, unitID);
     }
 
-    public WindowsGraphicsDevice(String connection, int unitID) {
+    public WindowsGraphicsDevice(final String connection, final int unitID) {
         super(NativeWindowFactory.TYPE_WINDOWS, connection, unitID);
     }
 
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsConfiguration.java b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsConfiguration.java
index 120c865..223cb51 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsConfiguration.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsConfiguration.java
@@ -48,9 +48,9 @@ import jogamp.nativewindow.x11.XVisualInfo;
 public class X11GraphicsConfiguration extends MutableGraphicsConfiguration implements Cloneable {
     private XVisualInfo info;
 
-    public X11GraphicsConfiguration(X11GraphicsScreen screen,
-                                    CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-                                    XVisualInfo info) {
+    public X11GraphicsConfiguration(final X11GraphicsScreen screen,
+                                    final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+                                    final XVisualInfo info) {
         super(screen, capsChosen, capsRequested);
         this.info = info;
     }
@@ -64,7 +64,7 @@ public class X11GraphicsConfiguration extends MutableGraphicsConfiguration imple
         return info;
     }
 
-    final protected void setXVisualInfo(XVisualInfo info) {
+    final protected void setXVisualInfo(final XVisualInfo info) {
         this.info = info;
     }
 
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java
index 863e53b..fea4e70 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsDevice.java
@@ -54,7 +54,7 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
      *  This constructor exist to setup a default device connection.
      *  @see DefaultGraphicsDevice#DefaultGraphicsDevice(String, String, int)
      */
-    public X11GraphicsDevice(String connection, int unitID) {
+    public X11GraphicsDevice(final String connection, final int unitID) {
         super(NativeWindowFactory.TYPE_X11, connection, unitID);
         handleOwner = false;
         isXineramaEnabled = false;
@@ -64,7 +64,7 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
      *  {@link javax.media.nativewindow.ToolkitLock} via {@link NativeWindowFactory#getDefaultToolkitLock(String, long)}.
      *  @see DefaultGraphicsDevice#DefaultGraphicsDevice(String, String, int, long)
      */
-    public X11GraphicsDevice(long display, int unitID, boolean owner) {
+    public X11GraphicsDevice(final long display, final int unitID, final boolean owner) {
         this(display, unitID, NativeWindowFactory.getDefaultToolkitLock(NativeWindowFactory.TYPE_X11, display), owner);
     }
 
@@ -73,7 +73,7 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
      * @param locker custom {@link javax.media.nativewindow.ToolkitLock}, eg to force null locking w/ private connection
      * @see DefaultGraphicsDevice#DefaultGraphicsDevice(String, String, int, long, ToolkitLock)
      */
-    public X11GraphicsDevice(long display, int unitID, ToolkitLock locker, boolean owner) {
+    public X11GraphicsDevice(final long display, final int unitID, final ToolkitLock locker, final boolean owner) {
         super(NativeWindowFactory.TYPE_X11, X11Lib.XDisplayString(display), unitID, display, locker);
         if(0==display) {
             throw new NativeWindowException("null display");
@@ -91,14 +91,14 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
      * @param locker custom {@link javax.media.nativewindow.ToolkitLock}, eg to force null locking w/ private connection
      * @see DefaultGraphicsDevice#DefaultGraphicsDevice(String, String, int, long, ToolkitLock)
      */
-    public X11GraphicsDevice(String displayConnection, int unitID, ToolkitLock locker) {
+    public X11GraphicsDevice(final String displayConnection, final int unitID, final ToolkitLock locker) {
         super(NativeWindowFactory.TYPE_X11, displayConnection, unitID, 0, locker);
         handleOwner = true;
         open();
         isXineramaEnabled = X11Util.XineramaIsEnabled(this);
     }
 
-    private static int getDefaultScreenImpl(long dpy) {
+    private static int getDefaultScreenImpl(final long dpy) {
         return X11Lib.DefaultScreen(dpy);
     }
 
@@ -176,7 +176,7 @@ public class X11GraphicsDevice extends DefaultGraphicsDevice implements Cloneabl
         return Boolean.valueOf(handleOwner);
     }
     @Override
-    protected Object setHandleOwnership(Object newOwnership) {
+    protected Object setHandleOwnership(final Object newOwnership) {
         final Boolean oldOwnership = Boolean.valueOf(handleOwner);
         handleOwner = ((Boolean) newOwnership).booleanValue();
         return oldOwnership;
diff --git a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
index 7009378..8ebf3c3 100644
--- a/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
+++ b/src/nativewindow/classes/com/jogamp/nativewindow/x11/X11GraphicsScreen.java
@@ -49,11 +49,11 @@ import jogamp.nativewindow.x11.X11Lib;
 public class X11GraphicsScreen extends DefaultGraphicsScreen implements Cloneable {
 
     /** Constructs a new X11GraphicsScreen corresponding to the given native screen index. */
-    public X11GraphicsScreen(X11GraphicsDevice device, int screen) {
+    public X11GraphicsScreen(final X11GraphicsDevice device, final int screen) {
         super(device, device.isXineramaEnabled() ? 0 : screen);
     }
 
-    public static AbstractGraphicsScreen createScreenDevice(long display, int screenIdx, boolean owner) {
+    public static AbstractGraphicsScreen createScreenDevice(final long display, final int screenIdx, final boolean owner) {
         if(0==display) throw new NativeWindowException("display is null");
         return new X11GraphicsScreen(new X11GraphicsDevice(display, AbstractGraphicsDevice.DEFAULT_UNIT, owner), screenIdx);
     }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
index 9eed887..bf89525 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/Capabilities.java
@@ -79,7 +79,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
   public Object clone() {
     try {
       return super.clone();
-    } catch (CloneNotSupportedException e) {
+    } catch (final CloneNotSupportedException e) {
       throw new NativeWindowException(e);
     }
   }
@@ -89,7 +89,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
    * from <code>source</code> into this instance.
    * @return this instance
    */
-  public Capabilities copyFrom(CapabilitiesImmutable other) {
+  public Capabilities copyFrom(final CapabilitiesImmutable other) {
     redBits = other.getRedBits();
     greenBits = other.getGreenBits();
     blueBits = other.getBlueBits();
@@ -122,12 +122,12 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
   }
 
   @Override
-  public boolean equals(Object obj) {
+  public boolean equals(final Object obj) {
     if(this == obj)  { return true; }
     if(!(obj instanceof CapabilitiesImmutable)) {
         return false;
     }
-    CapabilitiesImmutable other = (CapabilitiesImmutable)obj;
+    final CapabilitiesImmutable other = (CapabilitiesImmutable)obj;
     boolean res = other.getRedBits()==redBits &&
                   other.getGreenBits()==greenBits &&
                   other.getBlueBits()==blueBits &&
@@ -171,7 +171,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
   }
 
   @Override
-  public int getVisualID(VIDType type) throws NativeWindowException {
+  public int getVisualID(final VIDType type) throws NativeWindowException {
       switch(type) {
           case INTRINSIC:
           case NATIVE:
@@ -189,7 +189,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
   /** Sets the number of bits requested for the color buffer's red
       component. On some systems only the color depth, which is the
       sum of the red, green, and blue bits, is considered. */
-  public void setRedBits(int redBits) {
+  public void setRedBits(final int redBits) {
     this.redBits = redBits;
   }
 
@@ -201,7 +201,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
   /** Sets the number of bits requested for the color buffer's green
       component. On some systems only the color depth, which is the
       sum of the red, green, and blue bits, is considered. */
-  public void setGreenBits(int greenBits) {
+  public void setGreenBits(final int greenBits) {
     this.greenBits = greenBits;
   }
 
@@ -213,7 +213,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
   /** Sets the number of bits requested for the color buffer's blue
       component. On some systems only the color depth, which is the
       sum of the red, green, and blue bits, is considered. */
-  public void setBlueBits(int blueBits) {
+  public void setBlueBits(final int blueBits) {
     this.blueBits = blueBits;
   }
 
@@ -234,7 +234,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
    * not to <i>reflect</i> a current state. Nevertheless if this is the case - call it at last.
    * </p>
    */
-  public void setAlphaBits(int alphaBits) {
+  public void setAlphaBits(final int alphaBits) {
     this.alphaBits = alphaBits;
   }
 
@@ -253,7 +253,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
    * due to the composite work required by the window manager.
    * </p>
    */
-  public void setBackgroundOpaque(boolean opaque) {
+  public void setBackgroundOpaque(final boolean opaque) {
       backgroundOpaque = opaque;
       if(!opaque && getAlphaBits()==0) {
           setAlphaBits(1);
@@ -277,7 +277,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
    * </p>
    * @param onscreen
    */
-  public void setOnscreen(boolean onscreen) {
+  public void setOnscreen(final boolean onscreen) {
     this.onscreen=onscreen;
   }
 
@@ -298,7 +298,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
    * Requesting offscreen bitmap mode disables the offscreen auto selection.
    * </p>
    */
-  public void setBitmap(boolean enable) {
+  public void setBitmap(final boolean enable) {
     if(enable) {
       setOnscreen(false);
     }
@@ -327,31 +327,31 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
       This value is ignored if {@link #isBackgroundOpaque()} equals true.<br>
       It defaults to half of the frambuffer value for red. <br>
       A value of -1 is interpreted as any value. */
-  public void setTransparentRedValue(int transValueRed) { transparentValueRed=transValueRed; }
+  public void setTransparentRedValue(final int transValueRed) { transparentValueRed=transValueRed; }
 
   /** Sets the transparent green value for the frame buffer configuration,
       ranging from 0 to the maximum frame buffer value for green.
       This value is ignored if {@link #isBackgroundOpaque()} equals true.<br>
       It defaults to half of the frambuffer value for green.<br>
       A value of -1 is interpreted as any value. */
-  public void setTransparentGreenValue(int transValueGreen) { transparentValueGreen=transValueGreen; }
+  public void setTransparentGreenValue(final int transValueGreen) { transparentValueGreen=transValueGreen; }
 
   /** Sets the transparent blue value for the frame buffer configuration,
       ranging from 0 to the maximum frame buffer value for blue.
       This value is ignored if {@link #isBackgroundOpaque()} equals true.<br>
       It defaults to half of the frambuffer value for blue.<br>
       A value of -1 is interpreted as any value. */
-  public void setTransparentBlueValue(int transValueBlue) { transparentValueBlue=transValueBlue; }
+  public void setTransparentBlueValue(final int transValueBlue) { transparentValueBlue=transValueBlue; }
 
   /** Sets the transparent alpha value for the frame buffer configuration,
       ranging from 0 to the maximum frame buffer value for alpha.
       This value is ignored if {@link #isBackgroundOpaque()} equals true.<br>
       It defaults to half of the frambuffer value for alpha.<br>
       A value of -1 is interpreted as any value. */
-  public void setTransparentAlphaValue(int transValueAlpha) { transparentValueAlpha=transValueAlpha; }
+  public void setTransparentAlphaValue(final int transValueAlpha) { transparentValueAlpha=transValueAlpha; }
 
   @Override
-  public StringBuilder toString(StringBuilder sink) {
+  public StringBuilder toString(final StringBuilder sink) {
       return toString(sink, true);
   }
 
@@ -359,7 +359,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
       object. */
   @Override
   public String toString() {
-    StringBuilder msg = new StringBuilder();
+    final StringBuilder msg = new StringBuilder();
     msg.append("Caps[");
     toString(msg);
     msg.append("]");
@@ -393,7 +393,7 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
   /** Component separator */
   protected static final String CSEP = ", ";
 
-  protected StringBuilder toString(StringBuilder sink, boolean withOnOffScreen) {
+  protected StringBuilder toString(StringBuilder sink, final boolean withOnOffScreen) {
     if(null == sink) {
         sink = new StringBuilder();
     }
@@ -410,5 +410,5 @@ public class Capabilities implements CapabilitiesImmutable, Cloneable {
     return sink;
   }
 
-  protected final String toHexString(int val) { return Integer.toHexString(val); }
+  protected final String toHexString(final int val) { return Integer.toHexString(val); }
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
index 77cbe29..d0c1a9b 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultCapabilitiesChooser.java
@@ -42,6 +42,8 @@ package javax.media.nativewindow;
 
 import java.util.List;
 
+import com.jogamp.common.util.PropertyAccess;
+
 import jogamp.nativewindow.Debug;
 
 /** <P> The default implementation of the {@link
@@ -70,7 +72,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
 
   static {
       Debug.initSingleton();
-      DEBUG = Debug.isPropertyDefined("nativewindow.debug.CapabilitiesChooser", true);
+      DEBUG = PropertyAccess.isPropertyDefined("nativewindow.debug.CapabilitiesChooser", true);
   }
 
   private final static int NO_SCORE = -9999999;
@@ -100,7 +102,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
     }
 
     // Create score array
-    int[] scores = new int[availnum];
+    final int[] scores = new int[availnum];
     for (int i = 0; i < availnum; i++) {
       scores[i] = NO_SCORE;
     }
@@ -137,7 +139,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
     int scoreClosestToZero = NO_SCORE;
     int chosenIndex = -1;
     for (int i = 0; i < availnum; i++) {
-      int score = scores[i];
+      final int score = scores[i];
       if (score == NO_SCORE) {
         continue;
       }
@@ -161,7 +163,7 @@ public class DefaultCapabilitiesChooser implements CapabilitiesChooser {
     return chosenIndex;
   }
 
-  private static int sign(int score) {
+  private static int sign(final int score) {
     if (score < 0) {
       return -1;
     }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
index 42d7f3a..cae37c3 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsConfiguration.java
@@ -41,8 +41,8 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
     protected CapabilitiesImmutable capabilitiesChosen;
     protected CapabilitiesImmutable capabilitiesRequested;
 
-    public DefaultGraphicsConfiguration(AbstractGraphicsScreen screen,
-                                        CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested) {
+    public DefaultGraphicsConfiguration(final AbstractGraphicsScreen screen,
+                                        final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested) {
         if(null == screen) {
             throw new IllegalArgumentException("Null screen");
         }
@@ -52,9 +52,6 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
         if(null == capsRequested) {
             throw new IllegalArgumentException("Null requested caps");
         }
-        if( ! ( capsChosen instanceof VisualIDHolder ) ) {
-            throw new IllegalArgumentException("Chosen caps is not implementing NativeVisualID");
-        }
         this.screen = screen;
         this.capabilitiesChosen = capsChosen;
         this.capabilitiesRequested = capsRequested;
@@ -64,7 +61,7 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
     public Object clone() {
         try {
           return super.clone();
-        } catch (CloneNotSupportedException e) {
+        } catch (final CloneNotSupportedException e) {
           throw new NativeWindowException(e);
         }
     }
@@ -90,7 +87,7 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
     }
 
     @Override
-    final public int getVisualID(VIDType type) throws NativeWindowException {
+    final public int getVisualID(final VIDType type) throws NativeWindowException {
         return capabilitiesChosen.getVisualID(type);
     }
 
@@ -103,7 +100,7 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
      * </p>
      * @see javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
      */
-    protected void setChosenCapabilities(CapabilitiesImmutable capsChosen) {
+    protected void setChosenCapabilities(final CapabilitiesImmutable capsChosen) {
         this.capabilitiesChosen = capsChosen;
     }
 
@@ -115,7 +112,7 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
      * a change of the graphics device in a multi-screen environment.
      * </p>
      */
-    protected void setScreen(AbstractGraphicsScreen screen) {
+    protected void setScreen(final AbstractGraphicsScreen screen) {
         this.screen = screen;
     }
 
@@ -127,11 +124,11 @@ public class DefaultGraphicsConfiguration implements Cloneable, AbstractGraphics
                                        "]";
     }
 
-    public static String toHexString(int val) {
+    public static String toHexString(final int val) {
         return "0x"+Integer.toHexString(val);
     }
 
-    public static String toHexString(long val) {
+    public static String toHexString(final long val) {
         return "0x"+Long.toHexString(val);
     }
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
index 15ff2b1..ab9286b 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsDevice.java
@@ -49,7 +49,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
      * gathered via {@link NativeWindowFactory#getDefaultToolkitLock(String)}.
      * @param type
      */
-    public DefaultGraphicsDevice(String type, String connection, int unitID) {
+    public DefaultGraphicsDevice(final String type, final String connection, final int unitID) {
         this(type, connection, unitID, 0, NativeWindowFactory.getDefaultToolkitLock(type));
     }
 
@@ -59,7 +59,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
      * @param type
      * @param handle
      */
-    public DefaultGraphicsDevice(String type, String connection, int unitID, long handle) {
+    public DefaultGraphicsDevice(final String type, final String connection, final int unitID, final long handle) {
         this(type, connection, unitID, handle, NativeWindowFactory.getDefaultToolkitLock(type, handle));
     }
 
@@ -69,7 +69,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
      * @param handle
      * @param locker if null, a non blocking <i>null</i> lock is used.
      */
-    public DefaultGraphicsDevice(String type, String connection, int unitID, long handle, ToolkitLock locker) {
+    public DefaultGraphicsDevice(final String type, final String connection, final int unitID, final long handle, final ToolkitLock locker) {
         this.type = type;
         this.connection = connection;
         this.unitID = unitID;
@@ -82,7 +82,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
     public Object clone() {
         try {
           return super.clone();
-        } catch (CloneNotSupportedException e) {
+        } catch (final CloneNotSupportedException e) {
           throw new NativeWindowException(e);
         }
     }
@@ -178,7 +178,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
      * Set the native handle of the underlying native device
      * and return the previous one.
      */
-    protected final long setHandle(long newHandle) {
+    protected final long setHandle(final long newHandle) {
         final long oldHandle = handle;
         handle = newHandle;
         return oldHandle;
@@ -187,7 +187,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
     protected Object getHandleOwnership() {
         return null;
     }
-    protected Object setHandleOwnership(Object newOwnership) {
+    protected Object setHandleOwnership(final Object newOwnership) {
         return null;
     }
 
@@ -222,7 +222,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
      * @param locker the ToolkitLock, if null, {@link jogamp.nativewindow.NullToolkitLock} is being used
      * @return the previous ToolkitLock instance
      */
-    protected ToolkitLock setToolkitLock(ToolkitLock locker) {
+    protected ToolkitLock setToolkitLock(final ToolkitLock locker) {
         final ToolkitLock _toolkitLock = toolkitLock;
         _toolkitLock.lock();
         try {
@@ -247,8 +247,7 @@ public class DefaultGraphicsDevice implements Cloneable, AbstractGraphicsDevice
     * Returns a unique String object using {@link String#intern()} for the given arguments,
     * which object reference itself can be used as a key.
     */
-    private static String getUniqueID(String type, String connection, int unitID) {
-      final String r = (type + separator + connection + separator + unitID).intern();
-      return r.intern();
+    private static String getUniqueID(final String type, final String connection, final int unitID) {
+      return (type + separator + connection + separator + unitID).intern();
     }
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
index 4bd5489..3ee7759 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/DefaultGraphicsScreen.java
@@ -36,12 +36,12 @@ public class DefaultGraphicsScreen implements Cloneable, AbstractGraphicsScreen
     private final AbstractGraphicsDevice device;
     private final int idx;
 
-    public DefaultGraphicsScreen(AbstractGraphicsDevice device, int idx) {
+    public DefaultGraphicsScreen(final AbstractGraphicsDevice device, final int idx) {
         this.device = device;
         this.idx = idx;
     }
 
-    public static AbstractGraphicsScreen createDefault(String type) {
+    public static AbstractGraphicsScreen createDefault(final String type) {
         return new DefaultGraphicsScreen(new DefaultGraphicsDevice(type, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT), 0);
     }
 
@@ -49,7 +49,7 @@ public class DefaultGraphicsScreen implements Cloneable, AbstractGraphicsScreen
     public Object clone() {
         try {
           return super.clone();
-        } catch (CloneNotSupportedException e) {
+        } catch (final CloneNotSupportedException e) {
           throw new NativeWindowException(e);
         }
     }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
index c09e6ea..3f8113b 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/GraphicsConfigurationFactory.java
@@ -70,7 +70,7 @@ public abstract class GraphicsConfigurationFactory {
         public final Class<?> capsType;
         private final int hash32;
 
-        public DeviceCapsType(Class<?> deviceType, Class<?> capsType) {
+        public DeviceCapsType(final Class<?> deviceType, final Class<?> capsType) {
             this.deviceType = deviceType;
             this.capsType = capsType;
 
@@ -86,10 +86,10 @@ public abstract class GraphicsConfigurationFactory {
         }
 
         @Override
-        public final boolean equals(Object obj) {
+        public final boolean equals(final Object obj) {
             if(this == obj)  { return true; }
             if (obj instanceof DeviceCapsType) {
-                DeviceCapsType dct = (DeviceCapsType)obj;
+                final DeviceCapsType dct = (DeviceCapsType)obj;
                 return deviceType == dct.deviceType && capsType == dct.capsType;
             }
             return false;
@@ -135,14 +135,14 @@ public abstract class GraphicsConfigurationFactory {
                 try {
                     ReflectionUtil.callStaticMethod("jogamp.nativewindow.x11.X11GraphicsConfigurationFactory",
                                                     "registerFactory", null, null, GraphicsConfigurationFactory.class.getClassLoader());
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     throw new RuntimeException(e);
                 }
                 if(NativeWindowFactory.isAWTAvailable()) {
                     try {
                         ReflectionUtil.callStaticMethod("jogamp.nativewindow.x11.awt.X11AWTGraphicsConfigurationFactory",
                                                         "registerFactory", null, null, GraphicsConfigurationFactory.class.getClassLoader());
-                    } catch (Exception e) { /* n/a */ }
+                    } catch (final Exception e) { /* n/a */ }
                 }
             }
         }
@@ -162,11 +162,11 @@ public abstract class GraphicsConfigurationFactory {
         return Thread.currentThread().getName();
     }
 
-    protected static String toHexString(int val) {
+    protected static String toHexString(final int val) {
         return "0x" + Integer.toHexString(val);
     }
 
-    protected static String toHexString(long val) {
+    protected static String toHexString(final long val) {
         return "0x" + Long.toHexString(val);
     }
 
@@ -181,7 +181,7 @@ public abstract class GraphicsConfigurationFactory {
      *
      * @see #getFactory(Class, Class)
      */
-    public static GraphicsConfigurationFactory getFactory(AbstractGraphicsDevice device, CapabilitiesImmutable caps) {
+    public static GraphicsConfigurationFactory getFactory(final AbstractGraphicsDevice device, final CapabilitiesImmutable caps) {
         if (device == null) {
             throw new IllegalArgumentException("null device");
         }
@@ -216,7 +216,7 @@ public abstract class GraphicsConfigurationFactory {
      * @throws IllegalArgumentException if the deviceType does not implement {@link AbstractGraphicsDevice} or
      *                                  capabilitiesType does not implement {@link CapabilitiesImmutable}
      */
-    public static GraphicsConfigurationFactory getFactory(Class<?> deviceType, Class<?> capabilitiesType)
+    public static GraphicsConfigurationFactory getFactory(final Class<?> deviceType, final Class<?> capabilitiesType)
         throws IllegalArgumentException, NativeWindowException
     {
         if (!(defaultDeviceCapsType.deviceType.isAssignableFrom(deviceType))) {
@@ -242,7 +242,7 @@ public abstract class GraphicsConfigurationFactory {
         for(int j=0; j<deviceTypes.size(); j++) {
             final Class<?> interfaceDevice = deviceTypes.get(j);
             for(int i=0; i<capabilitiesTypes.size(); i++) {
-                Class<?> interfaceCaps = capabilitiesTypes.get(i);
+                final Class<?> interfaceCaps = capabilitiesTypes.get(i);
                 final DeviceCapsType dct = new DeviceCapsType(interfaceDevice, interfaceCaps);
                 final GraphicsConfigurationFactory factory = registeredFactories.get(dct);
                 if (factory != null) {
@@ -260,7 +260,7 @@ public abstract class GraphicsConfigurationFactory {
         }
         return factory;
     }
-    private static ArrayList<Class<?>> getAllAssignableClassesFrom(Class<?> superClassOrInterface, Class<?> fromClass, boolean interfacesOnly) {
+    private static ArrayList<Class<?>> getAllAssignableClassesFrom(final Class<?> superClassOrInterface, final Class<?> fromClass, final boolean interfacesOnly) {
         // Using a todo list avoiding a recursive loop!
         final ArrayList<Class<?>> inspectClasses  = new ArrayList<Class<?>>();
         final ArrayList<Class<?>> resolvedInterfaces = new ArrayList<Class<?>>();
@@ -271,7 +271,7 @@ public abstract class GraphicsConfigurationFactory {
         }
         return resolvedInterfaces;
     }
-    private static void getAllAssignableClassesFrom(Class<?> superClassOrInterface, Class<?> fromClass, boolean interfacesOnly, List<Class<?>> resolvedInterfaces, List<Class<?>> inspectClasses) {
+    private static void getAllAssignableClassesFrom(final Class<?> superClassOrInterface, final Class<?> fromClass, final boolean interfacesOnly, final List<Class<?>> resolvedInterfaces, final List<Class<?>> inspectClasses) {
         final ArrayList<Class<?>> types = new ArrayList<Class<?>>();
         if( superClassOrInterface.isAssignableFrom(fromClass) && !resolvedInterfaces.contains(fromClass)) {
             if( !interfacesOnly || fromClass.isInterface() ) {
@@ -295,10 +295,10 @@ public abstract class GraphicsConfigurationFactory {
         }
     }
     private static void dumpFactories() {
-        Set<DeviceCapsType> dcts = registeredFactories.keySet();
+        final Set<DeviceCapsType> dcts = registeredFactories.keySet();
         int i=0;
-        for(Iterator<DeviceCapsType> iter = dcts.iterator(); iter.hasNext(); ) {
-            DeviceCapsType dct = iter.next();
+        for(final Iterator<DeviceCapsType> iter = dcts.iterator(); iter.hasNext(); ) {
+            final DeviceCapsType dct = iter.next();
             System.err.println("Factory #"+i+": "+dct+" -> "+registeredFactories.get(dct));
             i++;
         }
@@ -323,7 +323,7 @@ public abstract class GraphicsConfigurationFactory {
      * @return the previous registered factory, or null if none
      * @throws IllegalArgumentException if the given class does not implement AbstractGraphicsDevice
      */
-    protected static GraphicsConfigurationFactory registerFactory(Class<?> abstractGraphicsDeviceImplementor, Class<?> capabilitiesType, GraphicsConfigurationFactory factory)
+    protected static GraphicsConfigurationFactory registerFactory(final Class<?> abstractGraphicsDeviceImplementor, final Class<?> capabilitiesType, final GraphicsConfigurationFactory factory)
         throws IllegalArgumentException
     {
         if (!(defaultDeviceCapsType.deviceType.isAssignableFrom(abstractGraphicsDeviceImplementor))) {
@@ -400,9 +400,9 @@ public abstract class GraphicsConfigurationFactory {
      * @see javax.media.nativewindow.DefaultGraphicsConfiguration#setChosenCapabilities(Capabilities caps)
      */
     public final AbstractGraphicsConfiguration
-        chooseGraphicsConfiguration(CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-                                    CapabilitiesChooser chooser,
-                                    AbstractGraphicsScreen screen, int nativeVisualID)
+        chooseGraphicsConfiguration(final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+                                    final CapabilitiesChooser chooser,
+                                    final AbstractGraphicsScreen screen, final int nativeVisualID)
         throws IllegalArgumentException, NativeWindowException {
         if(null==capsChosen) {
             throw new NativeWindowException("Chosen Capabilities are null");
@@ -413,7 +413,7 @@ public abstract class GraphicsConfigurationFactory {
         if(null==screen) {
             throw new NativeWindowException("Screen is null");
         }
-        AbstractGraphicsDevice device =  screen.getDevice();
+        final AbstractGraphicsDevice device =  screen.getDevice();
         if(null==device) {
             throw new NativeWindowException("Screen's Device is null");
         }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java b/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java
index a755b18..4d764dc 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeSurface.java
@@ -28,25 +28,31 @@
 
 package javax.media.nativewindow;
 
-/** Provides low-level information required for
-    hardware-accelerated rendering using a surface in a platform-independent manner.<P>
-
-    A NativeSurface created for a particular on- or offscreen component is
-    expected to have the same lifetime as that component. As long as
-    the component is alive and realized/visible, NativeSurface must be able
-    provide information such as the surface handle while it is locked.<P>
-*/
+/**
+ * Provides low-level information required for
+ * hardware-accelerated rendering using a surface in a platform-independent manner.
+ * <p>
+ * All values of this interface are represented in pixel units, if not stated otherwise.
+ * See {@link NativeWindow}.
+ * </p>
+ * <p>
+ * A NativeSurface created for a particular on- or offscreen component is
+ * expected to have the same lifetime as that component. As long as
+ * the component is alive and realized/visible, NativeSurface must be able
+ * provide information such as the surface handle while it is locked.
+ * </p>
+ */
 public interface NativeSurface extends SurfaceUpdatedListener {
-  /** Unlocked state */
+  /** Unlocked state, {@value}. */
   public static final int LOCK_SURFACE_UNLOCKED = 0;
 
-  /** Returned by {@link #lockSurface()} if the surface is not ready to be locked. */
+  /** Returned by {@link #lockSurface()} if the surface is not ready to be locked, {@value}. */
   public static final int LOCK_SURFACE_NOT_READY = 1;
 
-  /** Returned by {@link #lockSurface()} if the surface is locked, but has changed. */
+  /** Returned by {@link #lockSurface()} if the surface is locked, but has changed, {@value}. */
   public static final int LOCK_SURFACE_CHANGED = 2;
 
-  /** Returned by {@link #lockSurface()} if the surface is locked, and is unchanged. */
+  /** Returned by {@link #lockSurface()} if the surface is locked, and is unchanged, {@value}. */
   public static final int LOCK_SUCCESS = 3;
 
   /**
@@ -172,16 +178,36 @@ public interface NativeSurface extends SurfaceUpdatedListener {
   public long getSurfaceHandle();
 
   /**
-   * Returns the width of the client area excluding insets (window decorations).
-   * @return width of the client area
+   * Returns the width of the client area excluding insets (window decorations) in pixel units.
+   * @return width of the client area in pixel units
+   * @see NativeWindow#getWidth()
+   * @see #convertToWindowUnits(int[])
+   */
+  public int getSurfaceWidth();
+
+  /**
+   * Returns the height of the client area excluding insets (window decorations) in pixel units.
+   * @return height of the client area in pixel units
+   * @see NativeWindow#getHeight()
+   * @see #convertToWindowUnits(int[])
+   */
+  public int getSurfaceHeight();
+
+  /**
+   * Converts the given pixel units into window units <i>in place</i>.
+   * @param pixelUnitsAndResult int[2] storage holding the pixel units for the x- and y-coord to convert
+   *                             and the resulting values.
+   * @return result int[2] storage pixelUnitsAndResult for chaining holding the converted values
    */
-  public int getWidth();
+  public int[] convertToWindowUnits(final int[] pixelUnitsAndResult);
 
   /**
-   * Returns the height of the client area excluding insets (window decorations).
-   * @return height of the client area
+   * Converts the given window units into pixel units <i>in place</i>.
+   * @param windowUnitsAndResult int[2] storage holding the window units for the x- and y-coord to convert
+   *                             and the resulting values.
+   * @return result int[2] storage windowUnitsAndResult for chaining holding the converted values
    */
-  public int getHeight();
+  public int[] convertToPixelUnits(final int[] windowUnitsAndResult);
 
   /**
    * Returns the graphics configuration corresponding to this window.
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeSurfaceHolder.java b/src/nativewindow/classes/javax/media/nativewindow/NativeSurfaceHolder.java
new file mode 100644
index 0000000..b459ab7
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeSurfaceHolder.java
@@ -0,0 +1,41 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package javax.media.nativewindow;
+
+/**
+ * Accessor interface for implementing classes with ownership of a {@link NativeSurface}
+ * via an <i>is-a</i> or <i>has-a</i> relation.
+ */
+public interface NativeSurfaceHolder {
+  /**
+   * Returns the associated {@link NativeSurface} of this {@link NativeSurfaceHolder}.
+   */
+  public NativeSurface getNativeSurface();
+}
+
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java
index a740ebb..7f71bc3 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindow.java
@@ -43,15 +43,41 @@ package javax.media.nativewindow;
 import javax.media.nativewindow.util.InsetsImmutable;
 import javax.media.nativewindow.util.Point;
 
-/** Extend the {@link NativeSurface} interface with windowing
-    information such as window handle and position.<P>
+/**
+ * Extend the {@link NativeSurface} interface with windowing
+ * information such as {@link #getWindowHandle() window-handle},
+ * {@link #getWidth() window-size} and {@link #getX() window-position}.
+ * <p>
+ * All values of this interface are represented in window units, if not stated otherwise.
+ * See {@link NativeSurface}.
+ * </p>
+ *
+ * <a name="coordinateSystem"><h5>Coordinate System</h5></a>
+ * <p>
+ *  <ul>
+ *      <li>Abstract screen space has it's origin in the top-left corner, and may not be at 0/0.</li>
+ *      <li>Window origin is in it's top-left corner, see {@link #getX()} and {@link #getY()}. </li>
+ *      <li>Window client-area excludes {@link #getInsets() insets}, i.e. window decoration.</li>
+ *      <li>Window origin is relative to it's parent window if exist, or the screen position (top-level).</li>
+ *  </ul>
+ * </p>
+ * <p>
+ * A window toolkit such as the AWT may either implement this interface
+ * directly with one of its components, or provide and register an
+ * implementation of {@link NativeWindowFactory NativeWindowFactory}
+ * which can create NativeWindow objects for its components.
+ * </p>
+ */
+public interface NativeWindow extends NativeSurface, NativeSurfaceHolder {
 
-    A window toolkit such as the AWT may either implement this interface
-    directly with one of its components, or provide and register an
-    implementation of {@link NativeWindowFactory NativeWindowFactory}
-    which can create NativeWindow objects for its components. <P>
-*/
-public interface NativeWindow extends NativeSurface {
+  /**
+   * {@inheritDoc}
+   * <p>
+   * Returns this instance, which <i>is-a</i> {@link NativeSurface}.
+   * </p>
+   */
+  @Override
+  public NativeSurface getNativeSurface();
 
   /**
    * Destroys this window incl. releasing all related resources.
@@ -76,8 +102,10 @@ public interface NativeWindow extends NativeSurface {
 
   /**
    * Returns the insets defined as the width and height of the window decoration
-   * on the left, right, top and bottom.<br>
+   * on the left, right, top and bottom in window units.
+   * <p>
    * Insets are zero if the window is undecorated, including child windows.
+   * </p>
    *
    * <p>
    * Insets are available only after the native window has been created,
@@ -85,14 +113,14 @@ public interface NativeWindow extends NativeSurface {
    *
    * The top-level window area's top-left corner is located at
    * <pre>
-   *   getX() - getInsets().{@link InsetsImmutable#getLeftWidth() getLeftWidth()}
-   *   getY() - getInsets().{@link InsetsImmutable#getTopHeight() getTopHeight()}
+   *   {@link #getX()} - getInsets().{@link InsetsImmutable#getLeftWidth() getLeftWidth()}
+   *   {@link #getY()} - getInsets().{@link InsetsImmutable#getTopHeight() getTopHeight()}
    * </pre>
    *
    * The top-level window size is
    * <pre>
-   *   getWidth()  + getInsets().{@link InsetsImmutable#getTotalWidth() getTotalWidth()}
-   *   getHeight() + getInsets().{@link InsetsImmutable#getTotalHeight() getTotalHeight()}
+   *   {@link #getWidth()}  + getInsets().{@link InsetsImmutable#getTotalWidth() getTotalWidth()}
+   *   {@link #getHeight()} + getInsets().{@link InsetsImmutable#getTotalHeight() getTotalHeight()}
    * </pre>
    *
    * @return insets
@@ -102,32 +130,71 @@ public interface NativeWindow extends NativeSurface {
   /** Returns the current x position of this window, relative to it's parent. */
 
   /**
-   * @return the current x position of the top-left corner
-   *         of the client area relative to it's parent.
-   *         Since the position reflects the client area, it does not include the insets.
+   * Returns the x position of the top-left corner
+   * of the client area relative to it's parent in window units.
+   * <p>
+   * If no parent exist (top-level window), this coordinate equals the screen coordinate.
+   * </p>
+   * <p>
+   * Since the position reflects the client area, it does not include the insets.
+   * </p>
+   * <p>
+   * See <a href="#coordinateSystem"> Coordinate System</a>.
+   * </p>
    * @see #getInsets()
+   * @see #getLocationOnScreen(Point)
    */
   public int getX();
 
   /**
-   * @return the current y position of the top-left corner
-   *         of the client area relative to it's parent.
-   *         Since the position reflects the client area, it does not include the insets.
+   * Returns the current y position of the top-left corner
+   * of the client area relative to it's parent in window units.
+   * <p>
+   * If no parent exist (top-level window), this coordinate equals the screen coordinate.
+   * </p>
+   * <p>
+   * Since the position reflects the client area, it does not include the insets.
+   * </p>
+   * <p>
+   * See <a href="#coordinateSystem"> Coordinate System</a>.
+   * </p>
    * @see #getInsets()
+   * @see #getLocationOnScreen(Point)
    */
   public int getY();
 
   /**
-   * Returns the current position of the top-left corner
-   * of the client area in screen coordinates.
+   * Returns the width of the client area excluding insets (window decorations) in window units.
+   * @return width of the client area in window units
+   * @see NativeSurface#getSurfaceWidth()
+   */
+  public int getWidth();
+
+  /**
+   * Returns the height of the client area excluding insets (window decorations) in window units.
+   * @return height of the client area in window units
+   * @see NativeSurface#getSurfaceHeight()
+   */
+  public int getHeight();
+
+  /**
+   * Returns the window's top-left client-area position in the screen.
+   * <p>
+   * If {@link Point} is not <code>null</code>, it is translated about the resulting screen position
+   * and returned.
+   * </p>
+   * <p>
+   * See <a href="#coordinateSystem"> Coordinate System</a>.
+   * </p>
    * <p>
    * Since the position reflects the client area, it does not include the insets.
    * </p>
-   * @param point if not null,
-   *        {@link javax.media.nativewindow.util.Point#translate(javax.media.nativewindow.util.Point)}
-   *        the passed {@link javax.media.nativewindow.util.Point} by this location on the screen and return it.
-   * @return either the passed non null translated point by the screen location of this NativeWindow,
-   *         or a new instance with the screen location of this NativeWindow.
+   * @param point Optional {@link Point} storage.
+   *              If not null, <code>null</code>, it is translated about the resulting screen position
+   *              and returned.
+   * @see #getX()
+   * @see #getY()
+   * @see #getInsets()
    */
   public Point getLocationOnScreen(Point point);
 
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java
index 0943c8c..1635503 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowException.java
@@ -50,19 +50,19 @@ public class NativeWindowException extends RuntimeException {
 
   /** Constructs a NativeWindowException object with the specified detail
       message. */
-  public NativeWindowException(String message) {
+  public NativeWindowException(final String message) {
     super(message);
   }
 
   /** Constructs a NativeWindowException object with the specified detail
       message and root cause. */
-  public NativeWindowException(String message, Throwable cause) {
+  public NativeWindowException(final String message, final Throwable cause) {
     super(message, cause);
   }
 
   /** Constructs a NativeWindowException object with the specified root
       cause. */
-  public NativeWindowException(Throwable cause) {
+  public NativeWindowException(final Throwable cause) {
     super(cause);
   }
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
index 034bf24..58542f0 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
@@ -45,6 +45,7 @@ import java.util.Map;
 
 import javax.media.nativewindow.util.PointImmutable;
 
+import jogamp.common.os.PlatformPropsImpl;
 import jogamp.nativewindow.Debug;
 import jogamp.nativewindow.NativeWindowFactoryImpl;
 import jogamp.nativewindow.ToolkitProperties;
@@ -55,8 +56,9 @@ import jogamp.nativewindow.windows.GDIUtil;
 import jogamp.nativewindow.x11.X11Lib;
 
 import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.common.util.ReflectionUtil;
-import com.jogamp.nativewindow.UpstreamSurfaceHookMutableSizePos;
+import com.jogamp.nativewindow.UpstreamWindowHookMutableSizePos;
 import com.jogamp.nativewindow.awt.AWTGraphicsDevice;
 import com.jogamp.nativewindow.awt.AWTGraphicsScreen;
 import com.jogamp.nativewindow.macosx.MacOSXGraphicsDevice;
@@ -143,7 +145,7 @@ public abstract class NativeWindowFactory {
     }
 
     private static String _getNativeWindowingType() {
-        switch(Platform.OS_TYPE) {
+        switch(PlatformPropsImpl.OS_TYPE) {
             case ANDROID:
               return TYPE_ANDROID;
             case MACOS:
@@ -174,7 +176,7 @@ public abstract class NativeWindowFactory {
             public Object run() {
                 Platform.initSingleton(); // last resort ..
                 _DEBUG[0] = Debug.debug("NativeWindow");
-                _tmp[0] = Debug.getProperty("nativewindow.ws.name", true);
+                _tmp[0] = PropertyAccess.getProperty("nativewindow.ws.name", true);
                 Runtime.getRuntime().addShutdownHook(
                     new Thread(new Runnable() {
                                 @Override
@@ -234,7 +236,7 @@ public abstract class NativeWindowFactory {
      * @param head if true add runnable at the start, otherwise at the end
      * @param runnable runnable to be added.
      */
-    public static void addCustomShutdownHook(boolean head, Runnable runnable) {
+    public static void addCustomShutdownHook(final boolean head, final Runnable runnable) {
         synchronized( customShutdownHooks ) {
             if( !customShutdownHooks.contains( runnable ) ) {
                 if( head ) {
@@ -249,7 +251,7 @@ public abstract class NativeWindowFactory {
     /**
      * Cleanup resources at JVM shutdown
      */
-    public static synchronized void shutdown(boolean _isJVMShuttingDown) {
+    public static synchronized void shutdown(final boolean _isJVMShuttingDown) {
         isJVMShuttingDown = _isJVMShuttingDown;
         if(DEBUG) {
             System.err.println("NativeWindowFactory.shutdown() START: JVM Shutdown "+isJVMShuttingDown+", on thread "+Thread.currentThread().getName());
@@ -262,8 +264,8 @@ public abstract class NativeWindowFactory {
                         System.err.println("NativeWindowFactory.shutdown - customShutdownHook #"+(i+1)+"/"+cshCount);
                     }
                     customShutdownHooks.get(i).run();
-                } catch(Throwable t) {
-                    System.err.println("NativeWindowFactory.shutdown: Catched "+t.getClass().getName()+" during customShutdownHook #"+(i+1)+"/"+cshCount);
+                } catch(final Throwable t) {
+                    System.err.println("NativeWindowFactory.shutdown: Caught "+t.getClass().getName()+" during customShutdownHook #"+(i+1)+"/"+cshCount);
                     if( DEBUG ) {
                         t.printStackTrace();
                     }
@@ -329,19 +331,19 @@ public abstract class NativeWindowFactory {
             if( Platform.AWT_AVAILABLE &&
                 ReflectionUtil.isClassAvailable("com.jogamp.nativewindow.awt.AWTGraphicsDevice", cl) ) {
 
-                Method[] jawtUtilMethods = AccessController.doPrivileged(new PrivilegedAction<Method[]>() {
+                final Method[] jawtUtilMethods = AccessController.doPrivileged(new PrivilegedAction<Method[]>() {
                     @Override
                     public Method[] run() {
                         try {
-                            Class<?> _jawtUtilClass = Class.forName(JAWTUtilClassName, true, NativeWindowFactory.class.getClassLoader());
-                            Method jawtUtilIsHeadlessMethod = _jawtUtilClass.getDeclaredMethod("isHeadlessMode", (Class[])null);
+                            final Class<?> _jawtUtilClass = Class.forName(JAWTUtilClassName, true, NativeWindowFactory.class.getClassLoader());
+                            final Method jawtUtilIsHeadlessMethod = _jawtUtilClass.getDeclaredMethod("isHeadlessMode", (Class[])null);
                             jawtUtilIsHeadlessMethod.setAccessible(true);
-                            Method jawtUtilInitMethod = _jawtUtilClass.getDeclaredMethod("initSingleton", (Class[])null);
+                            final Method jawtUtilInitMethod = _jawtUtilClass.getDeclaredMethod("initSingleton", (Class[])null);
                             jawtUtilInitMethod.setAccessible(true);
-                            Method jawtUtilGetJAWTToolkitLockMethod = _jawtUtilClass.getDeclaredMethod("getJAWTToolkitLock", new Class[]{});
+                            final Method jawtUtilGetJAWTToolkitLockMethod = _jawtUtilClass.getDeclaredMethod("getJAWTToolkitLock", new Class[]{});
                             jawtUtilGetJAWTToolkitLockMethod.setAccessible(true);
                             return new Method[] { jawtUtilInitMethod, jawtUtilIsHeadlessMethod, jawtUtilGetJAWTToolkitLockMethod };
-                        } catch (Exception e) {
+                        } catch (final Exception e) {
                             if(DEBUG) {
                                 e.printStackTrace();
                             }
@@ -382,7 +384,7 @@ public abstract class NativeWindowFactory {
             registeredFactories = Collections.synchronizedMap(new HashMap<Class<?>, NativeWindowFactory>());
 
             // register our default factory -> NativeWindow
-            NativeWindowFactory factory = new NativeWindowFactoryImpl();
+            final NativeWindowFactory factory = new NativeWindowFactoryImpl();
             nativeWindowClass = javax.media.nativewindow.NativeWindow.class;
             registerFactory(nativeWindowClass, factory);
             defaultFactory = factory;
@@ -414,7 +416,7 @@ public abstract class NativeWindowFactory {
      * @return the native window type, e.g. {@link #TYPE_X11}, which is canonical via {@link String#intern()}.
      *        Hence {@link String#equals(Object)} and <code>==</code> produce the same result.
      */
-    public static String getNativeWindowType(boolean useCustom) {
+    public static String getNativeWindowType(final boolean useCustom) {
         return useCustom?nativeWindowingTypeCustom:nativeWindowingTypePure;
     }
 
@@ -431,7 +433,7 @@ public abstract class NativeWindowFactory {
     } */
 
     /** Sets the default NativeWindowFactory. */
-    public static void setDefaultFactory(NativeWindowFactory factory) {
+    public static void setDefaultFactory(final NativeWindowFactory factory) {
         defaultFactory = factory;
     }
 
@@ -472,9 +474,9 @@ public abstract class NativeWindowFactory {
      *   <li> {@link jogamp.nativewindow.NullToolkitLock} </li>
      * </ul>
      */
-    public static ToolkitLock getDefaultToolkitLock(String type) {
+    public static ToolkitLock getDefaultToolkitLock(final String type) {
         if( requiresToolkitLock ) {
-            if( TYPE_AWT == type && isAWTAvailable() ) {
+            if( TYPE_AWT == type && isAWTAvailable() ) { // uses .intern()!
                 return getAWTToolkitLock();
             }
             return ResourceToolkitLock.create();
@@ -490,9 +492,9 @@ public abstract class NativeWindowFactory {
      *   <li> {@link jogamp.nativewindow.NullToolkitLock} </li>
      * </ul>
      */
-    public static ToolkitLock getDefaultToolkitLock(String type, long deviceHandle) {
+    public static ToolkitLock getDefaultToolkitLock(final String type, final long deviceHandle) {
         if( requiresToolkitLock ) {
-            if( TYPE_AWT == type && isAWTAvailable() ) {
+            if( TYPE_AWT == type && isAWTAvailable() ) { // uses .intern()!
                 return getAWTToolkitLock();
             }
             return ResourceToolkitLock.create();
@@ -505,7 +507,7 @@ public abstract class NativeWindowFactory {
      * @param screen -1 is default screen of the given device, e.g. maybe 0 or determined by native API. >= 0 is specific screen
      * @return newly created AbstractGraphicsScreen matching device's native type
      */
-    public static AbstractGraphicsScreen createScreen(AbstractGraphicsDevice device, int screen) {
+    public static AbstractGraphicsScreen createScreen(final AbstractGraphicsDevice device, int screen) {
         final String type = device.getType();
         if( TYPE_X11 == type ) {
             final X11GraphicsDevice x11Device = (X11GraphicsDevice)device;
@@ -530,13 +532,13 @@ public abstract class NativeWindowFactory {
         already assumed the responsibility of creating a compatible
         NativeWindow implementation, or it might be that of a toolkit
         class like {@link java.awt.Component Component}. */
-    public static NativeWindowFactory getFactory(Class<?> windowClass) throws IllegalArgumentException {
+    public static NativeWindowFactory getFactory(final Class<?> windowClass) throws IllegalArgumentException {
         if (nativeWindowClass.isAssignableFrom(windowClass)) {
             return registeredFactories.get(nativeWindowClass);
         }
         Class<?> clazz = windowClass;
         while (clazz != null) {
-            NativeWindowFactory factory = registeredFactories.get(clazz);
+            final NativeWindowFactory factory = registeredFactories.get(clazz);
             if (factory != null) {
                 return factory;
             }
@@ -548,7 +550,7 @@ public abstract class NativeWindowFactory {
     /** Registers a NativeWindowFactory handling window objects of the
         given class. This does not need to be called by end users,
         only implementors of new NativeWindowFactory subclasses. */
-    protected static void registerFactory(Class<?> windowClass, NativeWindowFactory factory) {
+    protected static void registerFactory(final Class<?> windowClass, final NativeWindowFactory factory) {
         if(DEBUG) {
             System.err.println("NativeWindowFactory.registerFactory() "+windowClass+" -> "+factory);
         }
@@ -574,7 +576,7 @@ public abstract class NativeWindowFactory {
 
         @see javax.media.nativewindow.GraphicsConfigurationFactory#chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
     */
-    public static NativeWindow getNativeWindow(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException, NativeWindowException {
+    public static NativeWindow getNativeWindow(final Object winObj, final AbstractGraphicsConfiguration config) throws IllegalArgumentException, NativeWindowException {
         if (winObj == null) {
             throw new IllegalArgumentException("Null window object");
         }
@@ -600,7 +602,7 @@ public abstract class NativeWindowFactory {
      * @param ifEnabled If true, only return the enabled {@link OffscreenLayerSurface}, see {@link OffscreenLayerOption#isOffscreenLayerSurfaceEnabled()}.
      * @return
      */
-    public static OffscreenLayerSurface getOffscreenLayerSurface(NativeSurface surface, boolean ifEnabled) {
+    public static OffscreenLayerSurface getOffscreenLayerSurface(final NativeSurface surface, final boolean ifEnabled) {
         if(surface instanceof OffscreenLayerSurface &&
            ( !ifEnabled || surface instanceof OffscreenLayerOption ) ) {
             final OffscreenLayerSurface ols = (OffscreenLayerSurface) surface;
@@ -631,7 +633,7 @@ public abstract class NativeWindowFactory {
      * at creation time (see above), it is not valid for further processing.
      * </p>
      */
-    public static boolean isNativeVisualIDValidForProcessing(int visualID) {
+    public static boolean isNativeVisualIDValidForProcessing(final int visualID) {
         return NativeWindowFactory.TYPE_X11 != NativeWindowFactory.getNativeWindowType(false) ||
                VisualIDHolder.VID_UNDEFINED != visualID ;
     }
@@ -642,7 +644,7 @@ public abstract class NativeWindowFactory {
      * The device will be opened if <code>own</code> is true, otherwise no native handle will ever be acquired.
      * </p>
      */
-    public static AbstractGraphicsDevice createDevice(String displayConnection, boolean own) {
+    public static AbstractGraphicsDevice createDevice(final String displayConnection, final boolean own) {
         final String nwt = NativeWindowFactory.getNativeWindowType(true);
         if( NativeWindowFactory.TYPE_X11 == nwt ) {
             if( own ) {
@@ -669,7 +671,7 @@ public abstract class NativeWindowFactory {
     /**
      * Creates a wrapped {@link NativeWindow} with given native handles and {@link AbstractGraphicsScreen}.
      * <p>
-     * The given {@link UpstreamSurfaceHookMutableSizePos} maybe used to reflect resizes and repositioning of the native window.
+     * The given {@link UpstreamWindowHookMutableSizePos} maybe used to reflect resizes and repositioning of the native window.
      * </p>
      * <p>
      * The {@link AbstractGraphicsScreen} may be created via {@link #createScreen(AbstractGraphicsDevice, int)}.
@@ -679,21 +681,25 @@ public abstract class NativeWindowFactory {
      * or a simple <i>dummy</i> instance, see {@link #createDevice(String, boolean)}.
      * </p>
      */
-    public static NativeWindow createWrappedWindow(AbstractGraphicsScreen aScreen, long surfaceHandle, long windowHandle,
-                                                   UpstreamSurfaceHookMutableSizePos hook) {
+    public static NativeWindow createWrappedWindow(final AbstractGraphicsScreen aScreen, final long surfaceHandle, final long windowHandle,
+                                                   final UpstreamWindowHookMutableSizePos hook) {
         final CapabilitiesImmutable caps = new Capabilities();
         final AbstractGraphicsConfiguration config = new DefaultGraphicsConfiguration(aScreen, caps, caps);
         return new WrappedWindow(config, surfaceHandle, hook, true, windowHandle);
     }
 
-    public static PointImmutable getLocationOnScreen(NativeWindow nw) {
+    /**
+     * @param nw
+     * @return top-left client-area position in window units
+     */
+    public static PointImmutable getLocationOnScreen(final NativeWindow nw) {
         final String nwt = NativeWindowFactory.getNativeWindowType(true);
         if( NativeWindowFactory.TYPE_X11 == nwt ) {
             return X11Lib.GetRelativeLocation(nw.getDisplayHandle(), nw.getScreenIndex(), nw.getWindowHandle(), 0, 0, 0);
         } else if( NativeWindowFactory.TYPE_WINDOWS == nwt ) {
             return GDIUtil.GetRelativeLocation(nw.getWindowHandle(), 0, 0, 0);
         } else if( NativeWindowFactory.TYPE_MACOSX == nwt ) {
-            return OSXUtil.GetLocationOnScreen(nw.getWindowHandle(), null == nw.getParent(), 0, 0);
+            return OSXUtil.GetLocationOnScreen(nw.getWindowHandle(), 0, 0);
         /**
          * FIXME: Needs service provider interface (SPI) for TK dependent implementation
         } else if( NativeWindowFactory.TYPE_BCM_VC_IV == nwt ) {
diff --git a/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
index 0af2bda..7a69b9a 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/ProxySurface.java
@@ -69,10 +69,10 @@ public interface ProxySurface extends MutableSurface {
     public void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg);
 
     /**
-     * Return the upstream {@link NativeSurface} if used, otherwise <code>null</code>.
+     * Returns the optional upstream {@link NativeSurface} if used by implementation, otherwise <code>null</code>.
      * <p>
-     * An upstream {@link NativeSurface} may backup this {@link ProxySurface} instance's representation,
-     * e.g. via a {@link #setUpstreamSurfaceHook(UpstreamSurfaceHook) set} {@link UpstreamSurfaceHook}.
+     * The upstream {@link NativeSurface} is retrieved via {@link #getUpstreamSurfaceHook() the UpstreamSurfaceHook},
+     * i.e.  {@link UpstreamSurfaceHook#getUpstreamSurface()}.
      * </p>
      * <p>
      * One example is the JOGL EGLWrappedSurface, which might be backed up by a
@@ -85,7 +85,7 @@ public interface ProxySurface extends MutableSurface {
     public UpstreamSurfaceHook getUpstreamSurfaceHook();
 
     /**
-     * Sets the {@link UpstreamSurfaceHook} and returns the previous value.
+     * Overrides the {@link UpstreamSurfaceHook}.
      */
     public void setUpstreamSurfaceHook(UpstreamSurfaceHook hook);
 
diff --git a/src/nativewindow/classes/javax/media/nativewindow/ScalableSurface.java b/src/nativewindow/classes/javax/media/nativewindow/ScalableSurface.java
new file mode 100644
index 0000000..ffd5c22
--- /dev/null
+++ b/src/nativewindow/classes/javax/media/nativewindow/ScalableSurface.java
@@ -0,0 +1,97 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package javax.media.nativewindow;
+
+/**
+ * Adding mutable surface pixel scale property to implementing class, usually to a {@link NativeSurface} implementation,
+ * see {@link #setSurfaceScale(int[])}.
+ */
+public interface ScalableSurface {
+  /** Setting surface-pixel-scale of {@value}, results in same pixel- and window-units. */
+  public static final int IDENTITY_PIXELSCALE = 1;
+  /** Setting surface-pixel-scale of {@value}, results in maximum platform dependent pixel-scale, i.e. pixel-units >> window-units where available. */
+  public static final int AUTOMAX_PIXELSCALE = 0;
+
+  /**
+   * Request a pixel scale in x- and y-direction for the associated {@link NativeSurface}.
+   * <p>
+   * Default pixel scale request for both directions is {@link #AUTOMAX_PIXELSCALE}.
+   * </p>
+   * <p>
+   * In case platform only supports uniform pixel scale, i.e. one scale for both directions,
+   * either {@link #AUTOMAX_PIXELSCALE} or the maximum requested pixel scale component is used.
+   * </p>
+   * <p>
+   * The <i>requested</i> pixel scale will be validated against platform limits before native scale-setup,
+   * i.e. clipped to {@link #IDENTITY_PIXELSCALE} if not supported or clipped to the platform maximum.
+   * It can be queried via {@link #getRequestedSurfaceScale(int[])}.
+   * </p>
+   * <p>
+   * The actual <i>realized</i> pixel scale values of the {@link NativeSurface}
+   * can be queried via {@link #getCurrentSurfaceScale(int[])} or
+   * computed via <code>surface.{@link NativeSurface#convertToPixelUnits(int[]) convertToPixelUnits}(new int[] { 1, 1 })</code>
+   * </p>
+ * @param pixelScale <i>requested</i> surface pixel scale int[2] values for x- and y-direction.
+   */
+  public void setSurfaceScale(final int[] pixelScale);
+
+  /**
+   * Returns the requested pixel scale of the associated {@link NativeSurface}.
+   *
+   * @param result int[2] storage for the result
+   * @return the passed storage containing the requested pixelScale for chaining
+   */
+  int[] getRequestedSurfaceScale(final int[] result);
+
+  /**
+   * Returns the current pixel scale of the associated {@link NativeSurface}.
+   *
+   * @param result int[2] storage for the result
+   * @return the passed storage containing the current pixelScale for chaining
+   */
+  public int[] getCurrentSurfaceScale(final int[] result);
+
+  /**
+   * Returns the native pixel scale of the associated {@link NativeSurface}
+   * reflecting it's currently bound <i>monitor surface resolution in pixels</i>.
+   * <p>
+   * The native pixel scale maybe used to determine the proper <i>dpi</i>
+   * value of this {@link NativeSurface}:
+   * <pre>
+   *    surfacePpMM = monitorPpMM * currentSurfaceScale / nativeSurfaceScale,
+   *    with PpMM == pixel per millimeter
+   * </pre>
+   * </p>
+   *
+   * @param result int[2] storage for the result
+   * @return the passed storage containing the native pixelScale for chaining
+   */
+  public int[] getNativeSurfaceScale(final int[] result);
+}
+
diff --git a/src/nativewindow/classes/javax/media/nativewindow/UpstreamSurfaceHook.java b/src/nativewindow/classes/javax/media/nativewindow/UpstreamSurfaceHook.java
index f08a6c9..5726498 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/UpstreamSurfaceHook.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/UpstreamSurfaceHook.java
@@ -38,15 +38,29 @@ public interface UpstreamSurfaceHook {
     /** called within {@link ProxySurface#destroyNotify()} within lock, before clearing fields. */
     public void destroy(ProxySurface s);
 
-    /** Returns the width of the upstream surface, used if {@link ProxySurface#UPSTREAM_PROVIDES_SIZE} is set. */
-    public int getWidth(ProxySurface s);
-    /** Returns the height of the upstream surface, used if {@link ProxySurface#UPSTREAM_PROVIDES_SIZE} is set. */
-    public int getHeight(ProxySurface s);
+    /**
+     * Returns the optional upstream {@link NativeSurface} if used by implementation, otherwise <code>null</code>.
+     * <p>
+     * One example is the JOGL EGLWrappedSurface, which might be backed up by a
+     * native platform NativeSurface (X11, WGL, CGL, ..).
+     * </p>
+     */
+    public NativeSurface getUpstreamSurface();
+
+    /** Returns the width of the upstream surface in pixels, used if {@link ProxySurface#UPSTREAM_PROVIDES_SIZE} is set. */
+    public int getSurfaceWidth(ProxySurface s);
+    /** Returns the height of the upstream surface in pixels, used if {@link ProxySurface#UPSTREAM_PROVIDES_SIZE} is set. */
+    public int getSurfaceHeight(ProxySurface s);
 
     /**
      * {@link UpstreamSurfaceHook} w/ mutable size, allowing it's {@link ProxySurface} user to resize.
      */
     public interface MutableSize extends UpstreamSurfaceHook {
-        public void setSize(int width, int height);
+        /**
+         * Resizes the upstream surface.
+         * @param width new width in pixel units
+         * @param height new height in pixel units
+         */
+        public void setSurfaceSize(int width, int height);
     }
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java b/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
index 4ed79b1..e337166 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/VisualIDHolder.java
@@ -51,7 +51,7 @@ public interface VisualIDHolder {
 
         public final int id;
 
-        VIDType(int id){
+        VIDType(final int id){
             this.id = id;
         }
     }
@@ -114,14 +114,14 @@ public interface VisualIDHolder {
 
     /** Comparing {@link VIDType#NATIVE} */
     public static class VIDComparator implements Comparator<VisualIDHolder> {
-        private VIDType type;
+        private final VIDType type;
 
-        public VIDComparator(VIDType type) {
+        public VIDComparator(final VIDType type) {
             this.type = type;
         }
 
         @Override
-        public int compare(VisualIDHolder vid1, VisualIDHolder vid2) {
+        public int compare(final VisualIDHolder vid1, final VisualIDHolder vid2) {
             final int id1 = vid1.getVisualID(type);
             final int id2 = vid2.getVisualID(type);
 
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
index 24ccc83..4c9672c 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Dimension.java
@@ -37,7 +37,11 @@ public class Dimension implements Cloneable, DimensionImmutable {
         this(0, 0);
     }
 
-    public Dimension(int width, int height) {
+    public Dimension(final int[] size) {
+        this(size[0], size[1]);
+    }
+
+    public Dimension(final int width, final int height) {
         if(width<0 || height<0) {
             throw new IllegalArgumentException("width and height must be within: ["+0+".."+Integer.MAX_VALUE+"]");
         }
@@ -54,7 +58,7 @@ public class Dimension implements Cloneable, DimensionImmutable {
     public Object clone() {
         try {
             return super.clone();
-        } catch (CloneNotSupportedException ex) {
+        } catch (final CloneNotSupportedException ex) {
             throw new InternalError();
         }
     }
@@ -64,22 +68,22 @@ public class Dimension implements Cloneable, DimensionImmutable {
     @Override
     public final int getHeight() { return height; }
 
-    public final void set(int width, int height) {
+    public final void set(final int width, final int height) {
         this.width = width;
         this.height = height;
     }
-    public final void setWidth(int width) {
+    public final void setWidth(final int width) {
         this.width = width;
     }
-    public final void setHeight(int height) {
+    public final void setHeight(final int height) {
         this.height = height;
     }
-    public final Dimension scale(int s) {
+    public final Dimension scale(final int s) {
         width *= s;
         height *= s;
         return this;
     }
-    public final Dimension add(Dimension pd) {
+    public final Dimension add(final Dimension pd) {
         width += pd.width ;
         height += pd.height ;
         return this;
@@ -104,10 +108,10 @@ public class Dimension implements Cloneable, DimensionImmutable {
     }
 
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if(this == obj)  { return true; }
         if (obj instanceof Dimension) {
-            Dimension p = (Dimension)obj;
+            final Dimension p = (Dimension)obj;
             return height == p.height &&
                    width == p.width ;
         }
@@ -117,7 +121,7 @@ public class Dimension implements Cloneable, DimensionImmutable {
     @Override
     public int hashCode() {
         // 31 * x == (x << 5) - x
-        int hash = 31 + width;
+        final int hash = 31 + width;
         return ((hash << 5) - hash) + height;
     }
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java b/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java
index 3644916..5ec4c75 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Insets.java
@@ -28,17 +28,21 @@
 
 package javax.media.nativewindow.util;
 
+/**
+ * Mutable insets representing rectangular window decoration insets on all four edges
+ * in window units.
+ */
 public class Insets implements Cloneable, InsetsImmutable {
     static final InsetsImmutable zeroInsets = new Insets();
     public static final InsetsImmutable getZero() { return zeroInsets; }
 
-    int l, r, t, b;
+    private int l, r, t, b;
 
     public Insets() {
         this(0, 0, 0, 0);
     }
 
-    public Insets(int left, int right, int top, int bottom) {
+    public Insets(final int left, final int right, final int top, final int bottom) {
         this.l=left;
         this.r=right;
         this.t=top;
@@ -54,7 +58,7 @@ public class Insets implements Cloneable, InsetsImmutable {
     protected Object clone() {
         try {
             return super.clone();
-        } catch (CloneNotSupportedException ex) {
+        } catch (final CloneNotSupportedException ex) {
             throw new InternalError();
         }
     }
@@ -72,19 +76,42 @@ public class Insets implements Cloneable, InsetsImmutable {
     @Override
     public final int getTotalHeight() { return t + b; }
 
-    public final void set(int left, int right, int top, int bottom) {
+    /**
+     * Set the inset values of this instance in window units.
+     * @param left left inset width in window units.
+     * @param right right inset width in window units.
+     * @param top top inset width in window units.
+     * @param bottom bottom inset width in window units.
+     */
+    public final void set(final int left, final int right, final int top, final int bottom) {
         l = left; r = right; t = top; b = bottom;
     }
-    public final void setLeftWidth(int left) { l = left; }
-    public final void setRightWidth(int right) { r = right; }
-    public final void setTopHeight(int top) { t = top; }
-    public final void setBottomHeight(int bottom) { b = bottom; }
+    /**
+     * Set the left inset value of this instance in window units.
+     * @param left left inset width in window units.
+     */
+    public final void setLeftWidth(final int left) { l = left; }
+    /**
+     * Set the right inset value of this instance in window units.
+     * @param right right inset width in window units.
+     */
+    public final void setRightWidth(final int right) { r = right; }
+    /**
+     * Set the top inset value of this instance in window units.
+     * @param top top inset width in window units.
+     */
+    public final void setTopHeight(final int top) { t = top; }
+    /**
+     * Set the bottom inset value of this instance in window units.
+     * @param bottom bottom inset width in window units.
+     */
+    public final void setBottomHeight(final int bottom) { b = bottom; }
 
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if(this == obj)  { return true; }
         if (obj instanceof Insets) {
-            Insets insets = (Insets)obj;
+            final Insets insets = (Insets)obj;
             return (r == insets.r) && (l == insets.l) &&
                    (b == insets.b) && (t == insets.t);
         }
@@ -93,11 +120,11 @@ public class Insets implements Cloneable, InsetsImmutable {
 
     @Override
     public int hashCode() {
-        int sum1 = l + b;
-        int sum2 = t + r;
-        int val1 = sum1 * (sum1 + 1)/2 + l;
-        int val2 = sum2 * (sum2 + 1)/2 + r;
-        int sum3 = val1 + val2;
+        final int sum1 = l + b;
+        final int sum2 = t + r;
+        final int val1 = sum1 * (sum1 + 1)/2 + l;
+        final int val2 = sum2 * (sum2 + 1)/2 + r;
+        final int sum3 = val1 + val2;
         return sum3 * (sum3 + 1)/2 + val2;
     }
 
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java b/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java
index 8256068..0f8ba01 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/InsetsImmutable.java
@@ -30,25 +30,28 @@ package javax.media.nativewindow.util;
 
 import com.jogamp.common.type.WriteCloneable;
 
-/** Immutable Rectangle interface */
+/**
+ * Immutable insets representing rectangular window decoration insets on all four edges
+ * in window units.
+ */
 public interface InsetsImmutable extends WriteCloneable {
 
-    /** @return left inset width */
+    /** @return left inset width in window units. */
     int getLeftWidth();
 
-    /** @return right inset width */
+    /** @return right inset width in window units. */
     int getRightWidth();
 
-    /** @return total width, ie. <code>left_width + right_width</code> */
+    /** @return total width in window units, ie. <code>left_width + right_width</code> */
     int getTotalWidth();
 
-    /** @return top inset height */
+    /** @return top inset height in window units. */
     int getTopHeight();
 
-    /** @return bottom inset height */
+    /** @return bottom inset height in window units. */
     int getBottomHeight();
 
-    /** @return total height, ie. <code>top_height + bottom_height</code> */
+    /** @return total height in window units, ie. <code>top_height + bottom_height</code> */
     int getTotalHeight();
 
     /**
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormat.java b/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormat.java
index 823496a..fd3c31f 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormat.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormat.java
@@ -189,7 +189,7 @@ public enum PixelFormat {
     /** Number of bytes per pixel, e.g. 4 for RGBA. */
     public final int bytesPerPixel() { return (7+bitsPerPixel)/8; }
 
-    private PixelFormat(int componentCount, int bpp) {
+    private PixelFormat(final int componentCount, final int bpp) {
         this.componentCount = componentCount;
         this.bitsPerPixel = bpp;
     }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormatUtil.java b/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormatUtil.java
index 87a9ca4..21bfa8a 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormatUtil.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/PixelFormatUtil.java
@@ -85,7 +85,7 @@ public class PixelFormatUtil {
      * Returns the {@link PixelFormat} with reversed components of <code>fmt</code>.
      * If no reversed  {@link PixelFormat} is available, returns <code>fmt</code>.
      */
-    public static PixelFormat getReversed(PixelFormat fmt) {
+    public static PixelFormat getReversed(final PixelFormat fmt) {
         switch(fmt) {
             case LUMINANCE:
                 return PixelFormat.LUMINANCE;
@@ -106,7 +106,7 @@ public class PixelFormatUtil {
         }
     }
 
-    public static int getValue32(PixelFormat src_fmt, ByteBuffer src, int srcOff) {
+    public static int getValue32(final PixelFormat src_fmt, final ByteBuffer src, int srcOff) {
         switch(src_fmt) {
             case LUMINANCE: {
                     final byte c1 = src.get(srcOff++);
@@ -134,7 +134,7 @@ public class PixelFormatUtil {
         }
     }
 
-    public static int convertToInt32(PixelFormat dest_fmt, final byte r, final byte g, final byte b, final byte a) {
+    public static int convertToInt32(final PixelFormat dest_fmt, final byte r, final byte g, final byte b, final byte a) {
         switch(dest_fmt) {
             case LUMINANCE: {
                 final byte l = ( byte) ( ( ( ( 0xff & r ) + ( 0xff & g ) + ( 0xff & b ) ) / 3 ) );
@@ -157,7 +157,7 @@ public class PixelFormatUtil {
         }
     }
 
-    public static int convertToInt32(PixelFormat dest_fmt, PixelFormat src_fmt, ByteBuffer src, int srcOff) {
+    public static int convertToInt32(final PixelFormat dest_fmt, final PixelFormat src_fmt, final ByteBuffer src, int srcOff) {
         final byte r, g, b, a;
         switch(src_fmt) {
             case LUMINANCE:
@@ -208,7 +208,7 @@ public class PixelFormatUtil {
         return convertToInt32(dest_fmt, r, g, b, a);
     }
 
-    public static int convertToInt32(PixelFormat dest_fmt, PixelFormat src_fmt, final int src_pixel) {
+    public static int convertToInt32(final PixelFormat dest_fmt, final PixelFormat src_fmt, final int src_pixel) {
         final byte r, g, b, a;
         switch(src_fmt) {
             case LUMINANCE:
@@ -260,7 +260,7 @@ public class PixelFormatUtil {
     }
 
     public static PixelRectangle convert32(final PixelRectangle src,
-                                           final PixelFormat destFmt, int ddestStride, final boolean isGLOriented,
+                                           final PixelFormat destFmt, final int ddestStride, final boolean isGLOriented,
                                            final boolean destIsDirect) {
         final int width = src.getSize().getWidth();
         final int height = src.getSize().getHeight();
@@ -281,7 +281,7 @@ public class PixelFormatUtil {
         // System.err.println("XXX: DEST fmt "+destFmt+", stride "+destStride+" ("+ddestStride+"), isGL "+isGLOriented+", "+width+"x"+height+", capacity "+capacity+", "+bb);
 
         final PixelFormatUtil.PixelSink32 imgSink = new PixelFormatUtil.PixelSink32() {
-            public void store(int x, int y, int pixel) {
+            public void store(final int x, final int y, final int pixel) {
                 int o = destStride*y+x*bpp;
                 bb.put(o++, (byte) ( pixel        )); // 1
                 if( 3 <= bpp ) {
@@ -309,7 +309,7 @@ public class PixelFormatUtil {
         return new PixelRectangle.GenericPixelRect(destFmt, src.getSize(), destStride, isGLOriented, bb);
     }
 
-    public static void convert32(PixelSink32 destInt32, final PixelRectangle src) {
+    public static void convert32(final PixelSink32 destInt32, final PixelRectangle src) {
         convert32(destInt32,
                   src.getPixels(), src.getPixelformat(),
                   src.isGLOriented(),
@@ -333,7 +333,7 @@ public class PixelFormatUtil {
      *                     Must be >= {@link PixelFormat#bytesPerPixel() src_fmt.bytesPerPixel()} * width.
      * @throws IllegalArgumentException if <code>strideInBytes</code> is invalid
      */
-    public static void convert32(PixelSink32 dest32,
+    public static void convert32(final PixelSink32 dest32,
                                  final ByteBuffer src_bb, final PixelFormat src_fmt, final boolean src_glOriented, final int width, final int height, int stride_bytes) {
         final int src_bpp = src_fmt.bytesPerPixel();
         if( 0 != stride_bytes ) {
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
index 331c138..3576a7d 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Point.java
@@ -33,7 +33,7 @@ public class Point implements Cloneable, PointImmutable {
     int x;
     int y;
 
-    public Point(int x, int y) {
+    public Point(final int x, final int y) {
         this.x=x;
         this.y=y;
     }
@@ -51,7 +51,7 @@ public class Point implements Cloneable, PointImmutable {
     public Object clone() {
         try {
             return super.clone();
-        } catch (CloneNotSupportedException ex) {
+        } catch (final CloneNotSupportedException ex) {
             throw new InternalError();
         }
     }
@@ -70,10 +70,10 @@ public class Point implements Cloneable, PointImmutable {
     }
 
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if(this == obj)  { return true; }
         if (obj instanceof Point) {
-            Point p = (Point)obj;
+            final Point p = (Point)obj;
             return y == p.y && x == p.x;
         }
         return false;
@@ -102,26 +102,58 @@ public class Point implements Cloneable, PointImmutable {
         return x + " / " + y;
     }
 
-    public final void set(int x, int y) { this.x = x; this.y = y; }
-    public final void setX(int x) { this.x = x; }
-    public final void setY(int y) { this.y = y; }
-
-    public final Point translate(Point pd) {
+    public final void set(final int x, final int y) { this.x = x; this.y = y; }
+    public final void setX(final int x) { this.x = x; }
+    public final void setY(final int y) { this.y = y; }
+
+    /**
+     * Translate this instance's x- and y-components,
+     * i.e. add the values of the given delta point to them.
+     * @param pd delta point
+     * @return this instance for scaling
+     */
+    public final Point translate(final Point pd) {
         x += pd.x ;
         y += pd.y ;
         return this;
     }
 
-    public final Point translate(int dx, int dy) {
+    /**
+     * Translate this instance's x- and y-components,
+     * i.e. add the given deltas to them.
+     * @param dx delta for x
+     * @param dy delta for y
+     * @return this instance for scaling
+     */
+    public final Point translate(final int dx, final int dy) {
         x += dx ;
         y += dy ;
         return this;
     }
 
-    public final Point scale(int sx, int sy) {
+    /**
+     * Scale this instance's x- and y-components,
+     * i.e. multiply them by the given scale factors.
+     * @param sx scale factor for x
+     * @param sy scale factor for y
+     * @return this instance for scaling
+     */
+    public final Point scale(final int sx, final int sy) {
         x *= sx ;
         y *= sy ;
         return this;
     }
 
+    /**
+     * Inverse scale this instance's x- and y-components,
+     * i.e. divide them by the given scale factors.
+     * @param sx inverse scale factor for x
+     * @param sy inverse scale factor for y
+     * @return this instance for scaling
+     */
+    public final Point scaleInv(final int sx, final int sy) {
+        x /= sx ;
+        y /= sy ;
+        return this;
+    }
 }
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
index d0d8bfb..acc7b72 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/Rectangle.java
@@ -40,7 +40,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
         this(0, 0, 0, 0);
     }
 
-    public Rectangle(int x, int y, int width, int height) {
+    public Rectangle(final int x, final int y, final int width, final int height) {
         this.x=x;
         this.y=y;
         this.width=width;
@@ -56,7 +56,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
     protected Object clone() {
         try {
             return super.clone();
-        } catch (CloneNotSupportedException ex) {
+        } catch (final CloneNotSupportedException ex) {
             throw new InternalError();
         }
     }
@@ -70,16 +70,16 @@ public class Rectangle implements Cloneable, RectangleImmutable {
     @Override
     public final int getHeight() { return height; }
 
-    public final void set(int x, int y, int width, int height) {
+    public final void set(final int x, final int y, final int width, final int height) {
         this.x = x;
         this.y = y;
         this.width = width;
         this.height = height;
     }
-    public final void setX(int x) { this.x = x; }
-    public final void setY(int y) { this.y = y; }
-    public final void setWidth(int width) { this.width = width; }
-    public final void setHeight(int height) { this.height = height; }
+    public final void setX(final int x) { this.x = x; }
+    public final void setY(final int y) { this.y = y; }
+    public final void setWidth(final int width) { this.width = width; }
+    public final void setHeight(final int height) { this.height = height; }
 
     @Override
     public final RectangleImmutable union(final RectangleImmutable r) {
@@ -113,7 +113,7 @@ public class Rectangle implements Cloneable, RectangleImmutable {
     }
 
     @Override
-    public final RectangleImmutable intersection(RectangleImmutable r) {
+    public final RectangleImmutable intersection(final RectangleImmutable r) {
         return intersection(r.getX(), r.getY(), r.getX() + r.getWidth(), r.getY() + r.getHeight());
     }
     @Override
@@ -140,13 +140,43 @@ public class Rectangle implements Cloneable, RectangleImmutable {
         return new Rectangle (ix, iy, iwidth, iheight);
     }
     @Override
-    public final float coverage(RectangleImmutable r) {
+    public final float coverage(final RectangleImmutable r) {
         final RectangleImmutable isect = intersection(r);
-        final float sqI = (float) ( isect.getWidth()*isect.getHeight() );
-        final float sqT = (float) ( width*height );
+        final float sqI = isect.getWidth()*isect.getHeight();
+        final float sqT = width*height;
         return sqI / sqT;
     }
 
+    /**
+     * Scale this instance's components,
+     * i.e. multiply them by the given scale factors.
+     * @param sx scale factor for x
+     * @param sy scale factor for y
+     * @return this instance for scaling
+     */
+    public final Rectangle scale(final int sx, final int sy) {
+        x *= sx ;
+        y *= sy ;
+        width *= sx ;
+        height *= sy ;
+        return this;
+    }
+
+    /**
+     * Inverse scale this instance's components,
+     * i.e. divide them by the given scale factors.
+     * @param sx inverse scale factor for x
+     * @param sy inverse scale factor for y
+     * @return this instance for scaling
+     */
+    public final Rectangle scaleInv(final int sx, final int sy) {
+        x /= sx ;
+        y /= sy ;
+        width /= sx ;
+        height /= sy ;
+        return this;
+    }
+
     @Override
     public int compareTo(final RectangleImmutable d) {
         {
@@ -173,10 +203,10 @@ public class Rectangle implements Cloneable, RectangleImmutable {
     }
 
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if(this == obj)  { return true; }
         if (obj instanceof Rectangle) {
-            Rectangle rect = (Rectangle)obj;
+            final Rectangle rect = (Rectangle)obj;
             return (y == rect.y) && (x == rect.x) &&
                    (height == rect.height) && (width == rect.width);
         }
@@ -185,11 +215,11 @@ public class Rectangle implements Cloneable, RectangleImmutable {
 
     @Override
     public int hashCode() {
-        int sum1 = x + height;
-        int sum2 = width + y;
-        int val1 = sum1 * (sum1 + 1)/2 + x;
-        int val2 = sum2 * (sum2 + 1)/2 + y;
-        int sum3 = val1 + val2;
+        final int sum1 = x + height;
+        final int sum2 = width + y;
+        final int val1 = sum1 * (sum1 + 1)/2 + x;
+        final int val2 = sum2 * (sum2 + 1)/2 + y;
+        final int sum3 = val1 + val2;
         return sum3 * (sum3 + 1)/2 + val2;
     }
 
diff --git a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
index 7761973..601e6dd 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/util/SurfaceSize.java
@@ -32,7 +32,7 @@ package javax.media.nativewindow.util;
 /**
  * Immutable SurfaceSize Class, consisting of it's read only components:<br>
  * <ul>
- *  <li>{@link javax.media.nativewindow.util.DimensionImmutable} size in pixels</li>
+ *  <li>{@link javax.media.nativewindow.util.DimensionImmutable size in pixels}</li>
  *  <li><code>bits per pixel</code></li>
  * </ul>
  */
@@ -40,7 +40,7 @@ public class SurfaceSize implements Comparable<SurfaceSize> {
     final DimensionImmutable resolution;
     final int bitsPerPixel;
 
-    public SurfaceSize(DimensionImmutable resolution, int bitsPerPixel) {
+    public SurfaceSize(final DimensionImmutable resolution, final int bitsPerPixel) {
         if(null==resolution || bitsPerPixel<=0) {
             throw new IllegalArgumentException("resolution must be set and bitsPerPixel greater 0");
         }
@@ -48,6 +48,7 @@ public class SurfaceSize implements Comparable<SurfaceSize> {
         this.bitsPerPixel=bitsPerPixel;
     }
 
+    /** Returns the resolution in pixel units */
     public final DimensionImmutable getResolution() {
         return resolution;
     }
@@ -58,7 +59,7 @@ public class SurfaceSize implements Comparable<SurfaceSize> {
 
     @Override
     public final String toString() {
-        return "[ "+resolution+" x "+bitsPerPixel+" bpp ]";
+        return "[ "+resolution+" pixels x "+bitsPerPixel+" bpp ]";
     }
 
     /**
@@ -91,10 +92,10 @@ public class SurfaceSize implements Comparable<SurfaceSize> {
      *          otherwise <code>false</code>.
      */
     @Override
-    public final boolean equals(Object obj) {
+    public final boolean equals(final Object obj) {
         if(this == obj)  { return true; }
         if (obj instanceof SurfaceSize) {
-            SurfaceSize p = (SurfaceSize)obj;
+            final SurfaceSize p = (SurfaceSize)obj;
             return getResolution().equals(p.getResolution()) &&
                    getBitsPerPixel() == p.getBitsPerPixel();
         }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/Debug.java b/src/nativewindow/classes/jogamp/nativewindow/Debug.java
index b7197db..f2a4537 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/Debug.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/Debug.java
@@ -1,41 +1,29 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
  *
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
  *
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
  *
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- *
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
  */
 
 package jogamp.nativewindow;
@@ -63,7 +51,7 @@ public class Debug extends PropertyAccess {
     verbose = isPropertyDefined("nativewindow.verbose", true);
     debugAll = isPropertyDefined("nativewindow.debug", true);
     if (verbose) {
-       Package p = Package.getPackage("javax.media.nativewindow");
+       final Package p = Package.getPackage("javax.media.nativewindow");
        System.err.println("NativeWindow specification version " + p.getSpecificationVersion());
        System.err.println("NativeWindow implementation version " + p.getImplementationVersion());
        System.err.println("NativeWindow implementation vendor " + p.getImplementationVendor());
@@ -81,7 +69,7 @@ public class Debug extends PropertyAccess {
     return debugAll;
   }
 
-  public static final boolean debug(String subcomponent) {
+  public static final boolean debug(final String subcomponent) {
     return debugAll() || isPropertyDefined("nativewindow.debug." + subcomponent, true);
   }
 }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
index 8fb8192..6061c4e 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/DefaultGraphicsConfigurationFactoryImpl.java
@@ -38,7 +38,7 @@ import javax.media.nativewindow.*;
 public class DefaultGraphicsConfigurationFactoryImpl extends GraphicsConfigurationFactory {
     @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen screen, int nativeVisualID) {
+            final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested, final CapabilitiesChooser chooser, final AbstractGraphicsScreen screen, final int nativeVisualID) {
         return new DefaultGraphicsConfiguration(screen, capsChosen, capsRequested);
     }
 }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
index e7eb137..8d0d041 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NWJNILibLoader.java
@@ -44,7 +44,7 @@ public class NWJNILibLoader extends JNILibLoaderBase {
                 Platform.initSingleton();
                 final String libName = "nativewindow_"+ossuffix ;
                 if(TempJarCache.isInitialized() && null == TempJarCache.findLibrary(libName)) {
-                    JNILibLoaderBase.addNativeJarLibsJoglCfg(new Class<?>[] { NWJNILibLoader.class });
+                    JNILibLoaderBase.addNativeJarLibsJoglCfg(new Class<?>[] { jogamp.nativewindow.Debug.class });
                 }
                 return Boolean.valueOf(loadLibrary(libName, false, NWJNILibLoader.class.getClassLoader()));
             }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
index 22ac3bd..40fca0f 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/NativeWindowFactoryImpl.java
@@ -52,7 +52,7 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
     // This subclass of NativeWindowFactory handles the case of
     // NativeWindows being passed in
     @Override
-    protected NativeWindow getNativeWindowImpl(Object winObj, AbstractGraphicsConfiguration config) throws IllegalArgumentException {
+    protected NativeWindow getNativeWindowImpl(final Object winObj, final AbstractGraphicsConfiguration config) throws IllegalArgumentException {
         if (winObj instanceof NativeWindow) {
             // Use the NativeWindow directly
             return (NativeWindow) winObj;
@@ -73,7 +73,7 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
 
     private Constructor<?> nativeWindowConstructor = null;
 
-    private NativeWindow getAWTNativeWindow(Object winObj, AbstractGraphicsConfiguration config) {
+    private NativeWindow getAWTNativeWindow(final Object winObj, final AbstractGraphicsConfiguration config) {
         if (nativeWindowConstructor == null) {
             try {
                 final String windowingType = getNativeWindowType(true);
@@ -95,15 +95,15 @@ public class NativeWindowFactoryImpl extends NativeWindowFactory {
 
                 nativeWindowConstructor = ReflectionUtil.getConstructor(
                                             windowClassName, new Class[] { Object.class, AbstractGraphicsConfiguration.class },
-                                            getClass().getClassLoader());
-            } catch (Exception e) {
+                                            true, getClass().getClassLoader());
+            } catch (final Exception e) {
                 throw new IllegalArgumentException(e);
             }
         }
 
         try {
             return (NativeWindow) nativeWindowConstructor.newInstance(new Object[] { winObj, config });
-        } catch (Exception ie) {
+        } catch (final Exception ie) {
             throw new IllegalArgumentException(ie);
         }
     }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
index fbff712..deb685b 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/ProxySurfaceImpl.java
@@ -36,7 +36,6 @@ import javax.media.nativewindow.ProxySurface;
 import javax.media.nativewindow.SurfaceUpdatedListener;
 import javax.media.nativewindow.UpstreamSurfaceHook;
 
-
 import com.jogamp.common.util.locks.LockFactory;
 import com.jogamp.common.util.locks.RecursiveLock;
 
@@ -56,7 +55,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
      *                  owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
      *                  otherwise <code>false</code>. Owning the device implies closing it at {@link #destroyNotify()}.
      */
-    protected ProxySurfaceImpl(AbstractGraphicsConfiguration cfg, UpstreamSurfaceHook upstream, boolean ownsDevice) {
+    protected ProxySurfaceImpl(final AbstractGraphicsConfiguration cfg, final UpstreamSurfaceHook upstream, final boolean ownsDevice) {
         if(null == cfg) {
             throw new IllegalArgumentException("null AbstractGraphicsConfiguration");
         }
@@ -74,13 +73,15 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
     }
 
     @Override
-    public NativeSurface getUpstreamSurface() { return null; }
+    public final NativeSurface getUpstreamSurface() {
+        return upstream.getUpstreamSurface();
+    }
 
     @Override
     public final UpstreamSurfaceHook getUpstreamSurfaceHook() { return upstream; }
 
     @Override
-    public void setUpstreamSurfaceHook(UpstreamSurfaceHook hook) {
+    public void setUpstreamSurfaceHook(final UpstreamSurfaceHook hook) {
         if(null == hook) {
             throw new IllegalArgumentException("null UpstreamSurfaceHook");
         }
@@ -88,7 +89,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
     }
 
     @Override
-    public final void enableUpstreamSurfaceHookLifecycle(boolean enable) {
+    public final void enableUpstreamSurfaceHookLifecycle(final boolean enable) {
         upstreamSurfaceHookLifecycleEnabled = enable;
     }
 
@@ -133,7 +134,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
     }
 
     @Override
-    public final void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg) {
+    public final void setGraphicsConfiguration(final AbstractGraphicsConfiguration cfg) {
         config = cfg;
     }
 
@@ -149,13 +150,13 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
     public abstract void setSurfaceHandle(long surfaceHandle);
 
     @Override
-    public final int getWidth() {
-        return upstream.getWidth(this);
+    public final int getSurfaceWidth() {
+        return upstream.getSurfaceWidth(this);
     }
 
     @Override
-    public final int getHeight() {
-        return upstream.getHeight(this);
+    public final int getSurfaceHeight() {
+        return upstream.getSurfaceHeight(this);
     }
 
     @Override
@@ -164,22 +165,22 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
     }
 
     @Override
-    public void addSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+    public void addSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
         surfaceUpdatedHelper.addSurfaceUpdatedListener(l);
     }
 
     @Override
-    public void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
+    public void addSurfaceUpdatedListener(final int index, final SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
         surfaceUpdatedHelper.addSurfaceUpdatedListener(index, l);
     }
 
     @Override
-    public void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+    public void removeSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
         surfaceUpdatedHelper.removeSurfaceUpdatedListener(l);
     }
 
     @Override
-    public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+    public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
         surfaceUpdatedHelper.surfaceUpdated(updater, ns, when);
     }
 
@@ -286,15 +287,15 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
     public final int getUpstreamOptionBits() { return implBitfield; }
 
     @Override
-    public final boolean containsUpstreamOptionBits(int v) {
+    public final boolean containsUpstreamOptionBits(final int v) {
         return v == ( implBitfield & v ) ;
     }
 
     @Override
-    public final void addUpstreamOptionBits(int v) { implBitfield |= v; }
+    public final void addUpstreamOptionBits(final int v) { implBitfield |= v; }
 
     @Override
-    public final void clearUpstreamOptionBits(int v) { implBitfield &= ~v; }
+    public final void clearUpstreamOptionBits(final int v) { implBitfield &= ~v; }
 
     @Override
     public StringBuilder toString(StringBuilder sink) {
@@ -303,7 +304,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
         }
         sink.append("displayHandle 0x" + Long.toHexString(getDisplayHandle())).
         append("\n, surfaceHandle 0x" + Long.toHexString(getSurfaceHandle())).
-        append("\n, size " + getWidth() + "x" + getHeight()).append("\n, ");
+        append("\n, size " + getSurfaceWidth() + "x" + getSurfaceHeight()).append("\n, ");
         getUpstreamOptionBits(sink);
         sink.append("\n, "+config).
         append("\n, surfaceLock "+surfaceLock+"\n, ").
@@ -315,7 +316,7 @@ public abstract class ProxySurfaceImpl implements ProxySurface {
 
     @Override
     public String toString() {
-        StringBuilder msg = new StringBuilder();
+        final StringBuilder msg = new StringBuilder();
         msg.append(getClass().getSimpleName()).append("[ ");
         toString(msg);
         msg.append(" ]");
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java b/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
index 7b74e1f..5dac743 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/SharedResourceToolkitLock.java
@@ -29,6 +29,7 @@
 package jogamp.nativewindow;
 
 import java.util.Iterator;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.media.nativewindow.ToolkitLock;
 
@@ -58,7 +59,7 @@ public class SharedResourceToolkitLock implements ToolkitLock {
     /**
      * @return number of unclosed EGL Displays.<br>
      */
-    public static int shutdown(boolean verbose) {
+    public static int shutdown(final boolean verbose) {
         if(DEBUG || verbose || handle2Lock.size() > 0 ) {
             System.err.println("SharedResourceToolkitLock: Shutdown (open: "+handle2Lock.size()+")");
             if(DEBUG) {
@@ -74,23 +75,23 @@ public class SharedResourceToolkitLock implements ToolkitLock {
     public static void dumpOpenDisplayConnections() {
         System.err.println("SharedResourceToolkitLock: Open ResourceToolkitLock's: "+handle2Lock.size());
         int i=0;
-        for(Iterator<LongObjectHashMap.Entry> iter = handle2Lock.iterator(); iter.hasNext(); i++) {
+        for(final Iterator<LongObjectHashMap.Entry> iter = handle2Lock.iterator(); iter.hasNext(); i++) {
             final LongObjectHashMap.Entry e = iter.next();
             System.err.println("SharedResourceToolkitLock: Open["+i+"]: "+e.value);
         }
     }
 
-    public static final SharedResourceToolkitLock get(long handle) {
+    public static final SharedResourceToolkitLock get(final long handle) {
         SharedResourceToolkitLock res;
         synchronized(handle2Lock) {
             res = (SharedResourceToolkitLock) handle2Lock.get(handle);
             if( null == res ) {
                 res = new SharedResourceToolkitLock(handle);
-                res.refCount++;
+                res.refCount.incrementAndGet();
                 handle2Lock.put(handle, res);
                 if(DEBUG || TRACE_LOCK) { System.err.println("SharedResourceToolkitLock.get() * NEW   *: "+res); }
             } else {
-                res.refCount++;
+                res.refCount.incrementAndGet();
                 if(DEBUG || TRACE_LOCK) { System.err.println("SharedResourceToolkitLock.get() * EXIST *: "+res); }
             }
         }
@@ -99,12 +100,12 @@ public class SharedResourceToolkitLock implements ToolkitLock {
 
     private final RecursiveLock lock;
     private final long handle;
-    private volatile int refCount;
+    private final AtomicInteger refCount;
 
-    private SharedResourceToolkitLock(long handle) {
+    private SharedResourceToolkitLock(final long handle) {
         this.lock = LockFactory.createRecursiveLock();
         this.handle = handle;
-        this.refCount = 0;
+        this.refCount = new AtomicInteger(0);
     }
 
 
@@ -127,10 +128,9 @@ public class SharedResourceToolkitLock implements ToolkitLock {
 
     @Override
     public final void dispose() {
-        if(0 < refCount) { // volatile OK
+        if(0 < refCount.get()) { // volatile OK
             synchronized(handle2Lock) {
-                refCount--;
-                if(0 == refCount) {
+                if( 0 == refCount.decrementAndGet() ) {
                     if(DEBUG || TRACE_LOCK) { System.err.println("SharedResourceToolkitLock.dispose() * REMOV *: "+this); }
                     handle2Lock.remove(handle);
                 } else {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java b/src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java
new file mode 100644
index 0000000..73413cf
--- /dev/null
+++ b/src/nativewindow/classes/jogamp/nativewindow/SurfaceScaleUtils.java
@@ -0,0 +1,172 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.nativewindow;
+
+import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.nativewindow.ScalableSurface;
+
+/**
+ * Basic {@link ScalableSurface} utility to validate and compute pixel-scale values.
+ */
+public class SurfaceScaleUtils {
+
+    private static final int[] PlatformMaxPixelScale;
+    private static final boolean PlatformUniformPixelScale;
+    private static final boolean PlatformPixelScaleSupported;
+
+    static {
+      if( NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(true) ) {
+          PlatformMaxPixelScale = new int[] { jogamp.nativewindow.macosx.OSXUtil.MAX_PIXELSCALE, jogamp.nativewindow.macosx.OSXUtil.MAX_PIXELSCALE };
+          PlatformUniformPixelScale = true;
+          PlatformPixelScaleSupported = true;
+      } else {
+          PlatformMaxPixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+          PlatformUniformPixelScale = false;
+          PlatformPixelScaleSupported = false;
+      }
+    }
+
+    /**
+     * Compute a new valid pixelScale to be used by {@link NativeSurface} implementations,
+     * based on the given request and surface's pixelScale
+     *
+     * @param result int[2] storage for result, maybe same as <code>prePixelScale</code> for in-place
+     * @param prePixelScale previous pixelScale
+     * @param reqPixelScale requested pixelScale, validated via {@link #validateReqPixelScale(int[], int, String)}.
+     * @param newPixelScaleRaw new raw surface pixelScale
+     * @param DEBUG_PREFIX if set, dumps debug info on stderr using this prefix
+     * @return true if pixelScale has changed, otherwise false
+     */
+    public static boolean computePixelScale(final int[] result, final int[] prePixelScale, final int[] reqPixelScale, final int[] newPixelScaleRaw, final String DEBUG_PREFIX) {
+        final int newPixelScaleSafeX = 0 < newPixelScaleRaw[0] ? newPixelScaleRaw[0] : ScalableSurface.IDENTITY_PIXELSCALE;
+        final int newPixelScaleSafeY = 0 < newPixelScaleRaw[1] ? newPixelScaleRaw[1] : ScalableSurface.IDENTITY_PIXELSCALE;
+        final boolean useHiDPI = ScalableSurface.IDENTITY_PIXELSCALE != reqPixelScale[0] || ScalableSurface.IDENTITY_PIXELSCALE != reqPixelScale[1];
+        final int prePixelScaleX = prePixelScale[0];
+        final int prePixelScaleY = prePixelScale[1];
+
+        if( useHiDPI ) {
+            result[0] = newPixelScaleSafeX;
+            result[1] = newPixelScaleSafeY;
+        } else {
+            result[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+            result[1] = ScalableSurface.IDENTITY_PIXELSCALE;
+        }
+
+        final boolean changed = result[0] != prePixelScaleX || result[1] != prePixelScaleY;
+        if( null != DEBUG_PREFIX ) {
+            System.err.println(DEBUG_PREFIX+".computePixelScale: useHiDPI "+useHiDPI+", ["+prePixelScaleX+"x"+prePixelScaleY+" (pre), "+
+                    reqPixelScale[0]+"x"+reqPixelScale[1]+" (req)] -> "+
+                    newPixelScaleRaw[0]+"x"+newPixelScaleRaw[1]+" (raw) -> "+
+                    newPixelScaleSafeX+"x"+newPixelScaleSafeY+" (safe) -> "+
+                    result[0]+"x"+result[1]+" (use), changed "+changed);
+        }
+        return changed;
+    }
+
+    /**
+     * Validate the given requested pixelScale value pair, i.e. clip it to the
+     * limits of {@link ScalableSurface#AUTOMAX_PIXELSCALE} and {@link #getPlatformMaxPixelScale(int[])}
+     * <p>
+     * To be used by {@link ScalableSurface#setSurfaceScale(int[])} implementations.
+     * </p>
+     *
+     * @param result int[2] storage for result
+     * @param reqPixelScale requested pixelScale
+     * @param DEBUG_PREFIX if set, dumps debug info on stderr using this prefix
+     */
+    public static void validateReqPixelScale(final int[] result, final int[] reqPixelScale, final String DEBUG_PREFIX) {
+        final int minPS = Math.min(reqPixelScale[0], reqPixelScale[1]);
+        if( ScalableSurface.AUTOMAX_PIXELSCALE >= minPS ) {
+            result[0] = ScalableSurface.AUTOMAX_PIXELSCALE;
+            result[1] = ScalableSurface.AUTOMAX_PIXELSCALE;
+        } else if( PlatformUniformPixelScale ) {
+            final int maxPS = Math.max(reqPixelScale[0], reqPixelScale[1]);
+            if( maxPS >= PlatformMaxPixelScale[0] ) {
+                result[0] = PlatformMaxPixelScale[0];
+                result[1] = PlatformMaxPixelScale[1];
+            } else {
+                result[0] = maxPS;
+                result[1] = maxPS;
+            }
+        } else {
+            if( reqPixelScale[0] >= PlatformMaxPixelScale[0] ) {
+                result[0] = PlatformMaxPixelScale[0];
+            } else {
+                result[0] = reqPixelScale[0];
+            }
+            if( reqPixelScale[1] >= PlatformMaxPixelScale[1] ) {
+                result[1] = PlatformMaxPixelScale[1];
+            } else {
+                result[1] = reqPixelScale[1];
+            }
+        }
+        if( null != DEBUG_PREFIX ) {
+            System.err.println(DEBUG_PREFIX+".validateReqPixelScale: ["+reqPixelScale[0]+"x"+reqPixelScale[1]+" (req), "+
+                    PlatformMaxPixelScale[0]+"x"+PlatformMaxPixelScale[1]+" (max)] -> "+
+                    result[0]+"x"+result[1]+" (valid)");
+        }
+    }
+
+    /**
+     * Replaces {@link ScalableSurface#AUTOMAX_PIXELSCALE} with {@link #getPlatformMaxPixelScale(int[])},
+     * for each component.
+     *
+     * @param pixelScale int[2] value array to be tested and replaced
+     */
+    public static void replaceAutoMaxWithPlatformMax(final int[] pixelScale) {
+        if( ScalableSurface.AUTOMAX_PIXELSCALE == pixelScale[0] ) {
+            pixelScale[0] = PlatformMaxPixelScale[0];
+        }
+        if( ScalableSurface.AUTOMAX_PIXELSCALE == pixelScale[1] ) {
+            pixelScale[1] = PlatformMaxPixelScale[1];
+        }
+    }
+
+    /**
+     * Returns the maximum platform pixelScale
+     */
+    public static int[] getPlatformMaxPixelScale(final int[] result) {
+        System.arraycopy(PlatformMaxPixelScale, 0, result, 0, 2);
+        return result;
+    }
+
+    /**
+     * Returns true if platform pixelScale is uniform, i.e. same scale factor for x- and y-direction, otherwise false.
+     */
+    public static boolean isPlatformPixelScaleUniform() {
+        return PlatformUniformPixelScale;
+    }
+
+    /**
+     * Returns whether the platform supports pixelScale
+     */
+    public static boolean isPlatformPixelScaleSupported() {
+        return PlatformPixelScaleSupported;
+    }
+
+}
diff --git a/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java b/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
index 0b03395..a7e136f 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/SurfaceUpdatedHelper.java
@@ -42,17 +42,17 @@ public class SurfaceUpdatedHelper implements SurfaceUpdatedListener {
     // Management Utils
     //
     public final int size() { return surfaceUpdatedListeners.size(); }
-    public final SurfaceUpdatedListener get(int i) { return surfaceUpdatedListeners.get(i); }
+    public final SurfaceUpdatedListener get(final int i) { return surfaceUpdatedListeners.get(i); }
 
     //
     // Implementation of NativeSurface SurfaceUpdatedListener methods
     //
 
-    public final void addSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+    public final void addSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
         addSurfaceUpdatedListener(-1, l);
     }
 
-    public final void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l)
+    public final void addSurfaceUpdatedListener(int index, final SurfaceUpdatedListener l)
         throws IndexOutOfBoundsException
     {
         if(l == null) {
@@ -67,7 +67,7 @@ public class SurfaceUpdatedHelper implements SurfaceUpdatedListener {
         }
     }
 
-    public final boolean removeSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+    public final boolean removeSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
         if (l == null) {
             return false;
         }
@@ -79,7 +79,7 @@ public class SurfaceUpdatedHelper implements SurfaceUpdatedListener {
     }
 
     @Override
-    public final void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+    public final void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
         if( isEmpty ) {
             return;
         }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
index f622db8..d3439b5 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/WrappedSurface.java
@@ -31,6 +31,7 @@ package jogamp.nativewindow;
 import javax.media.nativewindow.AbstractGraphicsConfiguration;
 import javax.media.nativewindow.AbstractGraphicsDevice;
 import javax.media.nativewindow.ProxySurface;
+import javax.media.nativewindow.ScalableSurface;
 import javax.media.nativewindow.UpstreamSurfaceHook;
 
 import com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize;
@@ -40,8 +41,9 @@ import com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize;
  *
  * @see ProxySurface
  */
-public class WrappedSurface extends ProxySurfaceImpl {
-  protected long surfaceHandle;
+public class WrappedSurface extends ProxySurfaceImpl implements ScalableSurface {
+  private final int[] hasPixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+  private long surfaceHandle;
 
   /**
    * Utilizes a {@link UpstreamSurfaceHook.MutableSize} to hold the size information,
@@ -55,7 +57,7 @@ public class WrappedSurface extends ProxySurfaceImpl {
    *                  owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
    *                  otherwise <code>false</code>. Owning the device implies closing it at {@link #destroyNotify()}.
    */
-  public WrappedSurface(AbstractGraphicsConfiguration cfg, long handle, int initialWidth, int initialHeight, boolean ownsDevice) {
+  public WrappedSurface(final AbstractGraphicsConfiguration cfg, final long handle, final int initialWidth, final int initialHeight, final boolean ownsDevice) {
       super(cfg, new UpstreamSurfaceHookMutableSize(initialWidth, initialHeight), ownsDevice);
       surfaceHandle=handle;
   }
@@ -68,7 +70,7 @@ public class WrappedSurface extends ProxySurfaceImpl {
    *                  owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
    *                  otherwise <code>false</code>.
    */
-  public WrappedSurface(AbstractGraphicsConfiguration cfg, long handle, UpstreamSurfaceHook upstream, boolean ownsDevice) {
+  public WrappedSurface(final AbstractGraphicsConfiguration cfg, final long handle, final UpstreamSurfaceHook upstream, final boolean ownsDevice) {
       super(cfg, upstream, ownsDevice);
       surfaceHandle=handle;
   }
@@ -76,6 +78,8 @@ public class WrappedSurface extends ProxySurfaceImpl {
   @Override
   protected void invalidateImpl() {
     surfaceHandle = 0;
+    hasPixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+    hasPixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
   }
 
   @Override
@@ -84,7 +88,7 @@ public class WrappedSurface extends ProxySurfaceImpl {
   }
 
   @Override
-  public final void setSurfaceHandle(long surfaceHandle) {
+  public final void setSurfaceHandle(final long surfaceHandle) {
     this.surfaceHandle=surfaceHandle;
   }
 
@@ -97,4 +101,73 @@ public class WrappedSurface extends ProxySurfaceImpl {
   protected final void unlockSurfaceImpl() {
   }
 
-}
+  /**
+   * {@inheritDoc}
+   * <p>
+   * {@link WrappedSurface}'s implementation uses the {@link #setSurfaceScale(int[]) given pixelScale} directly.
+   * </p>
+   */
+  @Override
+  public final int[] convertToWindowUnits(final int[] pixelUnitsAndResult) {
+      pixelUnitsAndResult[0] /= hasPixelScale[0];
+      pixelUnitsAndResult[1] /= hasPixelScale[1];
+      return pixelUnitsAndResult;
+  }
+
+  /**
+   * {@inheritDoc}
+   * <p>
+   * {@link WrappedSurface}'s implementation uses the {@link #setSurfaceScale(int[]) given pixelScale} directly.
+   * </p>
+   */
+  @Override
+  public final int[] convertToPixelUnits(final int[] windowUnitsAndResult) {
+      windowUnitsAndResult[0] *= hasPixelScale[0];
+      windowUnitsAndResult[1] *= hasPixelScale[1];
+      return windowUnitsAndResult;
+  }
+
+  /**
+   * {@inheritDoc}
+   * <p>
+   * {@link WrappedSurface}'s implementation is to simply pass the given pixelScale
+   * from the caller <i>down</i> to this instance without validation to be applied in the {@link #convertToPixelUnits(int[]) conversion} {@link #convertToWindowUnits(int[]) methods} <b>only</b>.<br/>
+   * This allows the caller to pass down knowledge about window- and pixel-unit conversion and utilize mentioned conversion methods.
+   * </p>
+   * <p>
+   * The given pixelScale will not impact the actual {@link #getSurfaceWidth()} and {@link #getSurfaceHeight()},
+   * which is determinated by this instances {@link #getUpstreamSurface() upstream surface}.
+   * </p>
+   * <p>
+   * Implementation uses the default pixelScale {@link ScalableSurface#IDENTITY_PIXELSCALE}
+   * and resets to default values on {@link #invalidateImpl()}, i.e. {@link #destroyNotify()}.
+   * </p>
+   * <p>
+   * Implementation returns the given pixelScale array.
+   * </p>
+   */
+  @Override
+  public final void setSurfaceScale(final int[] pixelScale) {
+      hasPixelScale[0] = pixelScale[0];
+      hasPixelScale[1] = pixelScale[1];
+  }
+
+  @Override
+  public final int[] getRequestedSurfaceScale(final int[] result) {
+      System.arraycopy(hasPixelScale, 0, result, 0, 2);
+      return result;
+  }
+
+  @Override
+  public final int[] getCurrentSurfaceScale(final int[] result) {
+      System.arraycopy(hasPixelScale, 0, result, 0, 2);
+      return result;
+  }
+
+  @Override
+  public final int[] getNativeSurfaceScale(final int[] result) {
+      System.arraycopy(hasPixelScale, 0, result, 0, 2);
+      return result;
+  }
+
+}
\ No newline at end of file
diff --git a/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java b/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java
index edb65eb..fd39a3b 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/WrappedWindow.java
@@ -2,6 +2,7 @@ package jogamp.nativewindow;
 
 import javax.media.nativewindow.AbstractGraphicsConfiguration;
 import javax.media.nativewindow.AbstractGraphicsDevice;
+import javax.media.nativewindow.NativeSurface;
 import javax.media.nativewindow.NativeWindow;
 import javax.media.nativewindow.ProxySurface;
 import javax.media.nativewindow.UpstreamSurfaceHook;
@@ -9,28 +10,36 @@ import javax.media.nativewindow.util.Insets;
 import javax.media.nativewindow.util.InsetsImmutable;
 import javax.media.nativewindow.util.Point;
 
-import com.jogamp.nativewindow.UpstreamSurfaceHookMutableSizePos;
+import com.jogamp.nativewindow.UpstreamWindowHookMutableSizePos;
 
 public class WrappedWindow extends WrappedSurface implements NativeWindow {
     private final InsetsImmutable insets = new Insets(0, 0, 0, 0);
     private long windowHandle;
 
     /**
-     * Utilizes a {@link UpstreamSurfaceHookMutableSizePos} to hold the size and postion information,
+     * Utilizes a {@link UpstreamWindowHookMutableSizePos} to hold the size and position information,
      * which is being passed to the {@link ProxySurface} instance.
      *
      * @param cfg the {@link AbstractGraphicsConfiguration} to be used
      * @param surfaceHandle the wrapped pre-existing native surface handle, maybe 0 if not yet determined
-     * @param initialX
-     * @param initialY
-     * @param initialWidth
-     * @param initialHeight
+     * @param initialWinX
+     * @param initialWinY
+     * @param initialWinWidth
+     * @param initialWinHeight
+     * @param initialPixelWidth FIXME: pixel-dim == window-dim 'for now' ?
+     * @param initialPixelHeight FIXME: pixel-dim == window-dim 'for now' ?
      * @param ownsDevice <code>true</code> if this {@link ProxySurface} instance
      *                  owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
      *                  otherwise <code>false</code>. Owning the device implies closing it at {@link #destroyNotify()}.
      */
-    public WrappedWindow(AbstractGraphicsConfiguration cfg, long surfaceHandle, int initialX, int initialY, int initialWidth, int initialHeight, boolean ownsDevice, long windowHandle) {
-        this(cfg, surfaceHandle, new UpstreamSurfaceHookMutableSizePos(initialX, initialY, initialWidth, initialHeight), ownsDevice, windowHandle);
+    public WrappedWindow(final AbstractGraphicsConfiguration cfg, final long surfaceHandle,
+                         final int initialWinX, final int initialWinY, final int initialWinWidth, final int initialWinHeight,
+                         final int initialPixelWidth, final int initialPixelHeight,
+                         final boolean ownsDevice, final long windowHandle) {
+        this(cfg, surfaceHandle,
+             new UpstreamWindowHookMutableSizePos(initialWinX, initialWinY, initialWinWidth, initialWinHeight,
+                                                  initialPixelWidth, initialPixelHeight),
+             ownsDevice, windowHandle);
     }
 
     /**
@@ -41,7 +50,7 @@ public class WrappedWindow extends WrappedSurface implements NativeWindow {
      *                  owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
      *                  otherwise <code>false</code>.
      */
-    public WrappedWindow(AbstractGraphicsConfiguration cfg, long surfaceHandle, UpstreamSurfaceHookMutableSizePos upstream, boolean ownsDevice, long windowHandle) {
+    public WrappedWindow(final AbstractGraphicsConfiguration cfg, final long surfaceHandle, final UpstreamWindowHookMutableSizePos upstream, final boolean ownsDevice, final long windowHandle) {
         super(cfg, surfaceHandle, upstream, ownsDevice);
         this.windowHandle = windowHandle;
     }
@@ -58,6 +67,9 @@ public class WrappedWindow extends WrappedSurface implements NativeWindow {
     }
 
     @Override
+    public final NativeSurface getNativeSurface() { return this; }
+
+    @Override
     public NativeWindow getParent() {
         return null;
     }
@@ -74,16 +86,26 @@ public class WrappedWindow extends WrappedSurface implements NativeWindow {
 
     @Override
     public int getX() {
-        return ((UpstreamSurfaceHookMutableSizePos)getUpstreamSurfaceHook()).getX();
+        return ((UpstreamWindowHookMutableSizePos)getUpstreamSurfaceHook()).getX();
     }
 
     @Override
     public int getY() {
-        return ((UpstreamSurfaceHookMutableSizePos)getUpstreamSurfaceHook()).getY();
+        return ((UpstreamWindowHookMutableSizePos)getUpstreamSurfaceHook()).getY();
+    }
+
+    @Override
+    public int getWidth() {
+        return ((UpstreamWindowHookMutableSizePos)getUpstreamSurfaceHook()).getWidth();
+    }
+
+    @Override
+    public int getHeight() {
+        return ((UpstreamWindowHookMutableSizePos)getUpstreamSurfaceHook()).getHeight();
     }
 
     @Override
-    public Point getLocationOnScreen(Point point) {
+    public Point getLocationOnScreen(final Point point) {
         if(null!=point) {
           return point;
         } else {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java b/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
index 7389360..b0eda63 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/awt/AWTMisc.java
@@ -95,7 +95,7 @@ public class AWTMisc {
      * @param topLevelOnly if true only returns insets of top-level components, i.e. Window and JRootPanel,
      * otherwise for JComponent as well.
      */
-    public static Insets getInsets(Component c, boolean topLevelOnly) {
+    public static Insets getInsets(final Component c, final boolean topLevelOnly) {
         if( c instanceof Window ) {
             return ((Window)c).getInsets();
         }
@@ -119,7 +119,7 @@ public class AWTMisc {
         public void run(Component c);
     }
 
-    public static int performAction(Container c, Class<?> cType, ComponentAction action) {
+    public static int performAction(final Container c, final Class<?> cType, final ComponentAction action) {
         int count = 0;
         final int cc = c.getComponentCount();
         for(int i=0; i<cc; i++) {
@@ -147,7 +147,7 @@ public class AWTMisc {
      * @param forward if true, returns the next focus component, otherwise the previous one.
      * @return
      */
-    public static Component getNextFocus(Component comp, boolean forward) {
+    public static Component getNextFocus(Component comp, final boolean forward) {
         Container focusContainer = comp.getFocusCycleRootAncestor();
         while ( focusContainer != null &&
                 ( !focusContainer.isShowing() || !focusContainer.isFocusable() || !focusContainer.isEnabled() ) )
@@ -182,9 +182,9 @@ public class AWTMisc {
                 final Toolkit toolkit = Toolkit.getDefaultToolkit();
                 final BufferedImage img = new BufferedImage(1, 1, BufferedImage.TYPE_4BYTE_ABGR);
                 _nulCursor = toolkit.createCustomCursor(img, new Point(0,0), "nullCursor");
-            } catch (Exception he) {
+            } catch (final Exception he) {
                 if( JAWTUtil.DEBUG ) {
-                    System.err.println("Catched exception: "+he.getMessage());
+                    System.err.println("Caught exception: "+he.getMessage());
                     he.printStackTrace();
                 }
             }
@@ -194,7 +194,7 @@ public class AWTMisc {
 
     public static synchronized Cursor getNullCursor() { return nulCursor; }
 
-    public static synchronized Cursor getCursor(PixelRectangle pixelrect, Point hotSpot) {
+    public static synchronized Cursor getCursor(final PixelRectangle pixelrect, final Point hotSpot) {
         // 31 * x == (x << 5) - x
         int hash = 31 + pixelrect.hashCode();
         hash = ((hash << 5) - hash) + hotSpot.hashCode();
@@ -207,12 +207,12 @@ public class AWTMisc {
         }
         return cursor;
     }
-    private static synchronized Cursor createCursor(PixelRectangle pixelrect, Point hotSpot) {
+    private static synchronized Cursor createCursor(final PixelRectangle pixelrect, final Point hotSpot) {
         final int width = pixelrect.getSize().getWidth();
         final int height = pixelrect.getSize().getHeight();
         final BufferedImage img = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); // PixelFormat.BGRA8888
         final PixelFormatUtil.PixelSink32 imgSink = new PixelFormatUtil.PixelSink32() {
-            public void store(int x, int y, int pixel) {
+            public void store(final int x, final int y, final int pixel) {
                 img.setRGB(x, y, pixel);
             }
             @Override
@@ -233,7 +233,7 @@ public class AWTMisc {
         return toolkit.createCustomCursor(img, hotSpot, pixelrect.toString());
     }
 
-    public static WindowClosingProtocol.WindowClosingMode AWT2NWClosingOperation(int awtClosingOperation) {
+    public static WindowClosingProtocol.WindowClosingMode AWT2NWClosingOperation(final int awtClosingOperation) {
         switch (awtClosingOperation) {
             case WindowConstants.DISPOSE_ON_CLOSE:
             case WindowConstants.EXIT_ON_CLOSE:
@@ -246,7 +246,7 @@ public class AWTMisc {
         }
     }
 
-    public static WindowClosingProtocol.WindowClosingMode getNWClosingOperation(Component c) {
+    public static WindowClosingProtocol.WindowClosingMode getNWClosingOperation(final Component c) {
         final JFrame jf = getJFrame(c);
         final int op = (null != jf) ? jf.getDefaultCloseOperation() : WindowConstants.DO_NOTHING_ON_CLOSE ;
         return AWT2NWClosingOperation(op);
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
index a5da414..8aaffbd 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTJNILibLoader.java
@@ -64,7 +64,7 @@ public class JAWTJNILibLoader extends NWJNILibLoader {
         if ( NativeWindowFactory.TYPE_MACOSX != NativeWindowFactory.getNativeWindowType(false) ) {
             try {
                 loadLibrary("jawt", null, true, JAWTJNILibLoader.class.getClassLoader());
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 // It might be ok .. if it's already loaded
                 if(DEBUG) {
                     t.printStackTrace();
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
index d4edf2b..231a89c 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/JAWTUtil.java
@@ -38,6 +38,8 @@
 package jogamp.nativewindow.jawt;
 
 import java.awt.EventQueue;
+import java.awt.GraphicsConfiguration;
+import java.awt.GraphicsDevice;
 import java.awt.GraphicsEnvironment;
 import java.awt.Toolkit;
 import java.lang.reflect.InvocationTargetException;
@@ -51,9 +53,12 @@ import javax.media.nativewindow.NativeWindowException;
 import javax.media.nativewindow.NativeWindowFactory;
 import javax.media.nativewindow.ToolkitLock;
 
+import jogamp.common.os.PlatformPropsImpl;
 import jogamp.nativewindow.Debug;
+import jogamp.nativewindow.NWJNILibLoader;
 
 import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.common.util.VersionNumber;
 import com.jogamp.common.util.locks.LockFactory;
 import com.jogamp.common.util.locks.RecursiveLock;
@@ -61,6 +66,8 @@ import com.jogamp.common.util.locks.RecursiveLock;
 public class JAWTUtil {
   public static final boolean DEBUG = Debug.debug("JAWT");
 
+  private static final boolean SKIP_AWT_HIDPI;
+
   /** OSX JAWT version option to use CALayer */
   public static final int JAWT_MACOSX_USE_CALAYER = 0x80000000;
 
@@ -85,12 +92,15 @@ public class JAWTUtil {
   private static final RecursiveLock jawtLock;
   private static final ToolkitLock jawtToolkitLock;
 
+  private static final Method getScaleFactorMethod;
+
   private static class PrivilegedDataBlob1 {
     PrivilegedDataBlob1() {
         ok = false;
     }
-    Method  sunToolkitAWTLockMethod;
-    Method  sunToolkitAWTUnlockMethod;
+    Method sunToolkitAWTLockMethod;
+    Method sunToolkitAWTUnlockMethod;
+    Method getScaleFactorMethod;
     boolean ok;
   }
 
@@ -98,16 +108,16 @@ public class JAWTUtil {
    * Returns true if this platform's JAWT implementation supports offscreen layer.
    */
   public static boolean isOffscreenLayerSupported() {
-    return Platform.OS_TYPE == Platform.OSType.MACOS &&
-           Platform.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0;
+    return PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS &&
+           PlatformPropsImpl.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0;
   }
 
   /**
    * Returns true if this platform's JAWT implementation requires using offscreen layer.
    */
   public static boolean isOffscreenLayerRequired() {
-    return Platform.OS_TYPE == Platform.OSType.MACOS &&
-           Platform.JAVA_VERSION_NUMBER.compareTo(JAWT_MacOSXCALayerRequiredForJavaVersion)>=0;
+    return PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS &&
+           PlatformPropsImpl.JAVA_VERSION_NUMBER.compareTo(JAWT_MacOSXCALayerRequiredForJavaVersion)>=0;
   }
 
   /**
@@ -211,14 +221,14 @@ public class JAWTUtil {
    */
   public static int getOSXCALayerQuirks() {
     int res = 0;
-    if( Platform.OS_TYPE == Platform.OSType.MACOS &&
-        Platform.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0 ) {
+    if( PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS &&
+        PlatformPropsImpl.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0 ) {
 
         /** Knowing impl. all expose the SIZE bug */
         res |= JAWT_OSX_CALAYER_QUIRK_SIZE;
 
-        final int c = Platform.JAVA_VERSION_NUMBER.compareTo(Platform.Version17);
-        if( c < 0 || c == 0 && Platform.JAVA_VERSION_UPDATE < 40 ) {
+        final int c = PlatformPropsImpl.JAVA_VERSION_NUMBER.compareTo(PlatformPropsImpl.Version17);
+        if( c < 0 || c == 0 && PlatformPropsImpl.JAVA_VERSION_UPDATE < 40 ) {
             res |= JAWT_OSX_CALAYER_QUIRK_POSITION;
         } else {
             res |= JAWT_OSX_CALAYER_QUIRK_LAYOUT;
@@ -231,9 +241,9 @@ public class JAWTUtil {
    * @param useOffscreenLayerIfAvailable
    * @return
    */
-  public static JAWT getJAWT(boolean useOffscreenLayerIfAvailable) {
+  public static JAWT getJAWT(final boolean useOffscreenLayerIfAvailable) {
     final int jawt_version_flags = JAWTFactory.JAWT_VERSION_1_4;
-    JAWT jawt = JAWT.create();
+    final JAWT jawt = JAWT.create();
 
     // default queries
     boolean tryOffscreenLayer;
@@ -241,24 +251,24 @@ public class JAWTUtil {
     int jawt_version_flags_offscreen = jawt_version_flags;
 
     if(isOffscreenLayerRequired()) {
-        if(Platform.OS_TYPE == Platform.OSType.MACOS) {
-            if(Platform.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0) {
+        if(PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS) {
+            if(PlatformPropsImpl.OS_VERSION_NUMBER.compareTo(JAWTUtil.JAWT_MacOSXCALayerMinVersion) >= 0) {
                 jawt_version_flags_offscreen |= JAWTUtil.JAWT_MACOSX_USE_CALAYER;
                 tryOffscreenLayer = true;
                 tryOnscreen = false;
             } else {
-                throw new RuntimeException("OSX: Invalid version of Java ("+Platform.JAVA_VERSION_NUMBER+") / OS X ("+Platform.OS_VERSION_NUMBER+")");
+                throw new RuntimeException("OSX: Invalid version of Java ("+PlatformPropsImpl.JAVA_VERSION_NUMBER+") / OS X ("+PlatformPropsImpl.OS_VERSION_NUMBER+")");
             }
         } else {
-            throw new InternalError("offscreen required, but n/a for: "+Platform.OS_TYPE);
+            throw new InternalError("offscreen required, but n/a for: "+PlatformPropsImpl.OS_TYPE);
         }
     } else if(useOffscreenLayerIfAvailable && isOffscreenLayerSupported()) {
-        if(Platform.OS_TYPE == Platform.OSType.MACOS) {
+        if(PlatformPropsImpl.OS_TYPE == Platform.OSType.MACOS) {
             jawt_version_flags_offscreen |= JAWTUtil.JAWT_MACOSX_USE_CALAYER;
             tryOffscreenLayer = true;
             tryOnscreen = true;
         } else {
-            throw new InternalError("offscreen requested and supported, but n/a for: "+Platform.OS_TYPE);
+            throw new InternalError("offscreen requested and supported, but n/a for: "+PlatformPropsImpl.OS_TYPE);
         }
     } else {
         tryOffscreenLayer = false;
@@ -268,7 +278,7 @@ public class JAWTUtil {
         System.err.println("JAWTUtil.getJAWT(tryOffscreenLayer "+tryOffscreenLayer+", tryOnscreen "+tryOnscreen+")");
     }
 
-    StringBuilder errsb = new StringBuilder();
+    final StringBuilder errsb = new StringBuilder();
     if(tryOffscreenLayer) {
         errsb.append("Offscreen 0x").append(Integer.toHexString(jawt_version_flags_offscreen));
         if( JAWT.getJAWT(jawt, jawt_version_flags_offscreen) ) {
@@ -287,13 +297,15 @@ public class JAWTUtil {
     throw new RuntimeException("Unable to initialize JAWT, trials: "+errsb.toString());
   }
 
-  public static boolean isJAWTUsingOffscreenLayer(JAWT jawt) {
+  public static boolean isJAWTUsingOffscreenLayer(final JAWT jawt) {
       return 0 != ( jawt.getCachedVersion() & JAWTUtil.JAWT_MACOSX_USE_CALAYER );
   }
 
   static {
+    SKIP_AWT_HIDPI = PropertyAccess.isPropertyDefined("nativewindow.awt.nohidpi", true);
+
     if(DEBUG) {
-        System.err.println("JAWTUtil initialization (JAWT/JNI/...");
+        System.err.println("JAWTUtil initialization (JAWT/JNI/...); SKIP_AWT_HIDPI "+SKIP_AWT_HIDPI);
         // Thread.dumpStack();
     }
 
@@ -308,10 +320,11 @@ public class JAWTUtil {
         sunToolkitAWTUnlockMethod = null;
         hasSunToolkitAWTLock = false;
         // hasSunToolkitAWTLock = false;
+        getScaleFactorMethod = null;
     } else {
         // Non-headless case
         JAWTJNILibLoader.initSingleton(); // load libjawt.so
-        if(!JAWTJNILibLoader.loadNativeWindow("awt")) { // load libnativewindow_awt.so
+        if(!NWJNILibLoader.loadNativeWindow("awt")) { // load libnativewindow_awt.so
             throw new NativeWindowException("NativeWindow AWT native library load error.");
         }
         jawtLockObject = getJAWT(false); // don't care for offscreen layer here
@@ -323,15 +336,15 @@ public class JAWTUtil {
             java2DClass = Class.forName("jogamp.opengl.awt.Java2D");
             isQueueFlusherThreadTmp = java2DClass.getMethod("isQueueFlusherThread", (Class[])null);
             j2dExistTmp = true;
-        } catch (Exception e) {
+        } catch (final Exception e) {
         }
         isQueueFlusherThread = isQueueFlusherThreadTmp;
         j2dExist = j2dExistTmp;
 
-        PrivilegedDataBlob1 pdb1 = (PrivilegedDataBlob1) AccessController.doPrivileged(new PrivilegedAction<Object>() {
+        final PrivilegedDataBlob1 pdb1 = (PrivilegedDataBlob1) AccessController.doPrivileged(new PrivilegedAction<Object>() {
             @Override
             public Object run() {
-                PrivilegedDataBlob1 d = new PrivilegedDataBlob1();
+                final PrivilegedDataBlob1 d = new PrivilegedDataBlob1();
                 try {
                     final Class<?> sunToolkitClass = Class.forName("sun.awt.SunToolkit");
                     d.sunToolkitAWTLockMethod = sunToolkitClass.getDeclaredMethod("awtLock", new Class[]{});
@@ -339,14 +352,20 @@ public class JAWTUtil {
                     d.sunToolkitAWTUnlockMethod = sunToolkitClass.getDeclaredMethod("awtUnlock", new Class[]{});
                     d.sunToolkitAWTUnlockMethod.setAccessible(true);
                     d.ok=true;
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     // Either not a Sun JDK or the interfaces have changed since 1.4.2 / 1.5
                 }
+                try {
+                    final GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
+                    d.getScaleFactorMethod = gd.getClass().getDeclaredMethod("getScaleFactor");
+                    d.getScaleFactorMethod.setAccessible(true);
+                } catch (final Throwable t) {}
                 return d;
             }
         });
         sunToolkitAWTLockMethod = pdb1.sunToolkitAWTLockMethod;
         sunToolkitAWTUnlockMethod = pdb1.sunToolkitAWTUnlockMethod;
+        getScaleFactorMethod = pdb1.getScaleFactorMethod;
 
         boolean _hasSunToolkitAWTLock = false;
         if ( pdb1.ok ) {
@@ -354,7 +373,7 @@ public class JAWTUtil {
                 sunToolkitAWTLockMethod.invoke(null, (Object[])null);
                 sunToolkitAWTUnlockMethod.invoke(null, (Object[])null);
                 _hasSunToolkitAWTLock = true;
-            } catch (Exception e) {
+            } catch (final Exception e) {
             }
         }
         hasSunToolkitAWTLock = _hasSunToolkitAWTLock;
@@ -396,7 +415,7 @@ public class JAWTUtil {
             EventQueue.invokeAndWait(new Runnable() {
                 @Override
                 public void run() {
-                    Map<?,?> _desktophints = (Map<?,?>)(Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints"));
+                    final Map<?,?> _desktophints = (Map<?,?>)(Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints"));
                     if(null!=_desktophints) {
                         desktophintsBucket.add(_desktophints);
                     }
@@ -404,9 +423,9 @@ public class JAWTUtil {
             });
             desktophints = ( desktophintsBucket.size() > 0 ) ? desktophintsBucket.get(0) : null ;
         }
-    } catch (InterruptedException ex) {
+    } catch (final InterruptedException ex) {
         ex.printStackTrace();
-    } catch (InvocationTargetException ex) {
+    } catch (final InvocationTargetException ex) {
         ex.printStackTrace();
     }
 
@@ -414,7 +433,7 @@ public class JAWTUtil {
         System.err.println("JAWTUtil: Has sun.awt.SunToolkit.awtLock/awtUnlock " + hasSunToolkitAWTLock);
         System.err.println("JAWTUtil: Has Java2D " + j2dExist);
         System.err.println("JAWTUtil: Is headless " + headlessMode);
-        int hints = ( null != desktophints ) ? desktophints.size() : 0 ;
+        final int hints = ( null != desktophints ) ? desktophints.size() : 0 ;
         System.err.println("JAWTUtil: AWT Desktop hints " + hints);
         System.err.println("JAWTUtil: OffscreenLayer Supported: "+isOffscreenLayerSupported()+" - Required "+isOffscreenLayerRequired());
     }
@@ -442,7 +461,7 @@ public class JAWTUtil {
     if(j2dExist) {
         try {
             b = ((Boolean)isQueueFlusherThread.invoke(null, (Object[])null)).booleanValue();
-        } catch (Exception e) {}
+        } catch (final Exception e) {}
     }
     return b;
   }
@@ -468,7 +487,7 @@ public class JAWTUtil {
             if(hasSunToolkitAWTLock) {
                 try {
                     sunToolkitAWTLockMethod.invoke(null, (Object[])null);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                   throw new NativeWindowException("SunToolkit.awtLock failed", e);
                 }
             } else {
@@ -497,7 +516,7 @@ public class JAWTUtil {
             if(hasSunToolkitAWTLock) {
                 try {
                     sunToolkitAWTUnlockMethod.invoke(null, (Object[])null);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                   throw new NativeWindowException("SunToolkit.awtUnlock failed", e);
                 }
             } else {
@@ -516,5 +535,59 @@ public class JAWTUtil {
     return jawtToolkitLock;
   }
 
+  /**
+   * Returns the pixel scale factor of the given {@link GraphicsDevice}, if supported.
+   * <p>
+   * If the component does not support pixel scaling the default
+   * <code>one</code> is returned.
+   * </p>
+   * <p>
+   * Note: Currently only supported on OSX since 1.7.0_40 for HiDPI retina displays
+   * </p>
+   * @param device the {@link GraphicsDevice} instance used to query the pixel scale
+   * @return the pixel scale factor
+   */
+  public static final int getPixelScale(final GraphicsDevice device) {
+      if( !SKIP_AWT_HIDPI ) {
+          if( null != getScaleFactorMethod ) {
+              try {
+                  final Object res = getScaleFactorMethod.invoke(device);
+                  if (res instanceof Integer) {
+                      return ((Integer)res).intValue();
+                  }
+              } catch (final Throwable t) {}
+          }
+      }
+      return 1;
+  }
+
+  /**
+   * Returns the pixel scale factor of the given {@link GraphicsConfiguration}'s {@link GraphicsDevice}, if supported.
+   * <p>
+   * If the {@link GraphicsDevice} is <code>null</code>, <code>zero</code> is returned.
+   * </p>
+   * <p>
+   * If the component does not support pixel scaling the default
+   * <code>one</code> is returned.
+   * </p>
+   * <p>
+   * Note: Currently only supported on OSX since 1.7.0_40 for HiDPI retina displays
+   * </p>
+   * @param gc the {@link GraphicsConfiguration} instance used to query the pixel scale
+   * @return the pixel scale factor
+   */
+  public static final int getPixelScale(final GraphicsConfiguration gc) {
+      final GraphicsDevice device = null != gc ? gc.getDevice() : null;
+      final int ps;
+      if( null == device ) {
+          ps = 0;
+      } else {
+          ps = JAWTUtil.getPixelScale(device);
+      }
+      if( DEBUG ) {
+          System.err.println("JAWTUtil.updatePixelScale: Fetched "+ps);
+      }
+      return ps;
+  }
 }
 
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
index 8d46d80..fae8db5 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/macosx/MacOSXJAWTWindow.java
@@ -47,11 +47,13 @@ import java.security.PrivilegedAction;
 
 import javax.media.nativewindow.AbstractGraphicsConfiguration;
 import javax.media.nativewindow.Capabilities;
+import javax.media.nativewindow.NativeSurface;
 import javax.media.nativewindow.NativeWindow;
 import javax.media.nativewindow.NativeWindowException;
 import javax.media.nativewindow.MutableSurface;
 import javax.media.nativewindow.util.Point;
 
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.nativewindow.awt.JAWTWindow;
 
 import jogamp.nativewindow.Debug;
@@ -70,10 +72,10 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
 
   static {
       Debug.initSingleton();
-      DEBUG_CALAYER_POS_CRITICAL = Debug.isPropertyDefined("nativewindow.debug.JAWT.OSXCALayerPos", true /* jnlpAlias */);
+      DEBUG_CALAYER_POS_CRITICAL = PropertyAccess.isPropertyDefined("nativewindow.debug.JAWT.OSXCALayerPos", true /* jnlpAlias */);
   }
 
-  public MacOSXJAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+  public MacOSXJAWTWindow(final Object comp, final AbstractGraphicsConfiguration config) {
     super(comp, config);
     if(DEBUG) {
         dumpInfo();
@@ -96,7 +98,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
           if(0 != windowHandle) {
               OSXUtil.DestroyNSWindow(windowHandle);
           }
-          OSXUtil.RunOnMainThread(false, new Runnable() {
+          OSXUtil.RunOnMainThread(false, true /* kickNSApp */, new Runnable() {
               @Override
               public void run() {
                   if( 0 != rootSurfaceLayer ) {
@@ -114,41 +116,63 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
   }
 
   @Override
-  protected void attachSurfaceLayerImpl(final long layerHandle) {
-      OSXUtil.RunOnMainThread(false, new Runnable() {
-          @Override
-          public void run() {
-              // AWT position is top-left w/ insets, where CALayer position is bottom/left from root CALayer w/o insets.
-              // Determine p0: components location on screen w/o insets.
-              // CALayer position will be determined in native code.
-              // See detailed description in {@link JAWTUtil#JAWT_OSX_CALAYER_QUIRK_LAYOUT}
-              final Point p0 = new Point();
-              final Component outterComp = getLocationOnScreenNonBlocking(p0, component);
-              final java.awt.Insets outterInsets = AWTMisc.getInsets(outterComp, true);
-              final Point p1 = (Point)p0.cloneMutable();
-              p1.translate(-outterComp.getX(), -outterComp.getY());
-              if( null != outterInsets ) {
-                  p1.translate(-outterInsets.left, -outterInsets.top);
-              }
+  public void setSurfaceScale(final int[] pixelScale) {
+      super.setSurfaceScale(pixelScale);
+      if( 0 != getWindowHandle() ) { // locked at least once !
+          final int hadPixelScaleX = getPixelScaleX();
+          updatePixelScale();
+
+          if( hadPixelScaleX != getPixelScaleX() && 0 != getAttachedSurfaceLayer() ) {
+              OSXUtil.RunOnMainThread(false, false, new Runnable() {
+                  @Override
+                  public void run() {
+                      final long osl = getAttachedSurfaceLayer();
+                      if( 0 != osl ) {
+                          OSXUtil.SetCALayerPixelScale(rootSurfaceLayer, osl, getPixelScaleX());
+                      }
+                  }
+              });
+          }
+      }
+  }
 
-              if( DEBUG_CALAYER_POS_CRITICAL ) {
-                  final java.awt.Point pA0 = component.getLocationOnScreen();
-                  final Point pA1 = new Point(pA0.x, pA0.y);
-                  pA1.translate(-outterComp.getX(), -outterComp.getY());
+  @Override
+  protected void attachSurfaceLayerImpl(final long layerHandle) {
+      OSXUtil.RunOnMainThread(false, false /* kickNSApp */, new Runnable() {
+              @Override
+              public void run() {
+                  // AWT position is top-left w/ insets, where CALayer position is bottom/left from root CALayer w/o insets.
+                  // Determine p0: components location on screen w/o insets.
+                  // CALayer position will be determined in native code.
+                  // See detailed description in {@link JAWTUtil#JAWT_OSX_CALAYER_QUIRK_LAYOUT}
+                  final Point p0 = new Point();
+                  final Component outterComp = getLocationOnScreenNonBlocking(p0, component);
+                  final java.awt.Insets outterInsets = AWTMisc.getInsets(outterComp, true);
+                  final Point p1 = (Point)p0.cloneMutable();
+                  p1.translate(-outterComp.getX(), -outterComp.getY());
                   if( null != outterInsets ) {
-                      pA1.translate(-outterInsets.left, -outterInsets.top);
+                      p1.translate(-outterInsets.left, -outterInsets.top);
                   }
-                  System.err.println("JAWTWindow.attachSurfaceLayerImpl: "+toHexString(layerHandle) + ", [ins "+outterInsets+"], pA "+pA0+" -> "+pA1+
-                          ", p0 "+p0+" -> "+p1+", bounds "+bounds);
-              } else if( DEBUG ) {
-                  System.err.println("JAWTWindow.attachSurfaceLayerImpl: "+toHexString(layerHandle) + ", [ins "+outterInsets+"], p0 "+p0+" -> "+p1+", bounds "+bounds);
-              }
-              OSXUtil.AddCASublayer(rootSurfaceLayer, layerHandle, p1.getX(), p1.getY(), getWidth(), getHeight(), JAWTUtil.getOSXCALayerQuirks());
-          } } );
+
+                  if( DEBUG_CALAYER_POS_CRITICAL ) {
+                      final java.awt.Point pA0 = component.getLocationOnScreen();
+                      final Point pA1 = new Point(pA0.x, pA0.y);
+                      pA1.translate(-outterComp.getX(), -outterComp.getY());
+                      if( null != outterInsets ) {
+                          pA1.translate(-outterInsets.left, -outterInsets.top);
+                      }
+                      System.err.println("JAWTWindow.attachSurfaceLayerImpl: "+toHexString(layerHandle) + ", [ins "+outterInsets+"], pA "+pA0+" -> "+pA1+
+                              ", p0 "+p0+" -> "+p1+", bounds "+bounds);
+                  } else if( DEBUG ) {
+                      System.err.println("JAWTWindow.attachSurfaceLayerImpl: "+toHexString(layerHandle) + ", [ins "+outterInsets+"], p0 "+p0+" -> "+p1+", bounds "+bounds);
+                  }
+                  // HiDPI: uniform pixel scale
+                  OSXUtil.AddCASublayer(rootSurfaceLayer, layerHandle, p1.getX(), p1.getY(), getWidth(), getHeight(), getPixelScaleX(), JAWTUtil.getOSXCALayerQuirks());
+              } } );
   }
 
   @Override
-  protected void layoutSurfaceLayerImpl(long layerHandle, boolean visible) {
+  protected void layoutSurfaceLayerImpl(final long layerHandle, final boolean visible) {
       final int caLayerQuirks = JAWTUtil.getOSXCALayerQuirks();
       // AWT position is top-left w/ insets, where CALayer position is bottom/left from root CALayer w/o insets.
       // Determine p0: components location on screen w/o insets.
@@ -182,12 +206,12 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
 
   @Override
   protected void detachSurfaceLayerImpl(final long layerHandle, final Runnable detachNotify) {
-      OSXUtil.RunOnMainThread(false, new Runnable() {
-          @Override
-          public void run() {
-              detachNotify.run();
-              OSXUtil.RemoveCASublayer(rootSurfaceLayer, layerHandle);
-          } } );
+      OSXUtil.RunOnMainThread(false, true /* kickNSApp */, new Runnable() {
+              @Override
+              public void run() {
+                  detachNotify.run();
+                  OSXUtil.RemoveCASublayer(rootSurfaceLayer, layerHandle);
+              } });
   }
 
   @Override
@@ -201,7 +225,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
   }
 
   @Override
-  public void setSurfaceHandle(long surfaceHandle) {
+  public void setSurfaceHandle(final long surfaceHandle) {
       if( !isOffscreenLayerSurfaceEnabled() ) {
           throw new java.lang.UnsupportedOperationException("Not using CALAYER");
       }
@@ -220,14 +244,14 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
 
   @Override
   protected int lockSurfaceImpl() throws NativeWindowException {
-    int ret = NativeWindow.LOCK_SURFACE_NOT_READY;
+    int ret = NativeSurface.LOCK_SURFACE_NOT_READY;
     ds = getJAWT().GetDrawingSurface(component);
     if (ds == null) {
       // Widget not yet realized
       unlockSurfaceImpl();
-      return NativeWindow.LOCK_SURFACE_NOT_READY;
+      return NativeSurface.LOCK_SURFACE_NOT_READY;
     }
-    int res = ds.Lock();
+    final int res = ds.Lock();
     dsLocked = ( 0 == ( res & JAWTFactory.JAWT_LOCK_ERROR ) ) ;
     if (!dsLocked) {
       unlockSurfaceImpl();
@@ -239,7 +263,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
     // conditions can cause this code to be triggered -- should test
     // more)
     if ((res & JAWTFactory.JAWT_LOCK_SURFACE_CHANGED) != 0) {
-      ret = NativeWindow.LOCK_SURFACE_CHANGED;
+      ret = NativeSurface.LOCK_SURFACE_CHANGED;
     }
     if (firstLock) {
       AccessController.doPrivileged(new PrivilegedAction<Object>() {
@@ -254,9 +278,9 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
     }
     if (dsi == null) {
       unlockSurfaceImpl();
-      return NativeWindow.LOCK_SURFACE_NOT_READY;
+      return NativeSurface.LOCK_SURFACE_NOT_READY;
     }
-    updateBounds(dsi.getBounds());
+    updateLockedData(dsi.getBounds());
     if (DEBUG && firstLock ) {
       dumpInfo();
     }
@@ -265,16 +289,16 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
         macosxdsi = (JAWT_MacOSXDrawingSurfaceInfo) dsi.platformInfo(getJAWT());
         if (macosxdsi == null) {
           unlockSurfaceImpl();
-          return NativeWindow.LOCK_SURFACE_NOT_READY;
+          return NativeSurface.LOCK_SURFACE_NOT_READY;
         }
         drawable = macosxdsi.getCocoaViewRef();
 
         if (drawable == 0) {
           unlockSurfaceImpl();
-          return NativeWindow.LOCK_SURFACE_NOT_READY;
+          return NativeSurface.LOCK_SURFACE_NOT_READY;
         } else {
           windowHandle = OSXUtil.GetNSWindow(drawable);
-          ret = NativeWindow.LOCK_SUCCESS;
+          ret = NativeSurface.LOCK_SUCCESS;
         }
     } else {
         /**
@@ -304,30 +328,30 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
         }
         if(null == errMsg) {
             jawtSurfaceLayersHandle = GetJAWTSurfaceLayersHandle0(dsi.getBuffer());
-            OSXUtil.RunOnMainThread(false, new Runnable() {
-                @Override
-                public void run() {
-                    String errMsg = null;
-                    if(0 == rootSurfaceLayer && 0 != jawtSurfaceLayersHandle) {
-                        rootSurfaceLayer = OSXUtil.CreateCALayer(bounds.getWidth(), bounds.getHeight());
-                        if(0 == rootSurfaceLayer) {
-                          errMsg = "Could not create root CALayer";
-                        } else {
-                            try {
-                                SetJAWTRootSurfaceLayer0(jawtSurfaceLayersHandle, rootSurfaceLayer);
-                            } catch(Exception e) {
-                                errMsg = "Could not set JAWT rootSurfaceLayerHandle "+toHexString(rootSurfaceLayer)+", cause: "+e.getMessage();
+            OSXUtil.RunOnMainThread(false, false, new Runnable() {
+                    @Override
+                    public void run() {
+                        String errMsg = null;
+                        if(0 == rootSurfaceLayer && 0 != jawtSurfaceLayersHandle) {
+                            rootSurfaceLayer = OSXUtil.CreateCALayer(bounds.getWidth(), bounds.getHeight(), getPixelScaleX()); // HiDPI: uniform pixel scale
+                            if(0 == rootSurfaceLayer) {
+                              errMsg = "Could not create root CALayer";
+                            } else {
+                                try {
+                                    SetJAWTRootSurfaceLayer0(jawtSurfaceLayersHandle, rootSurfaceLayer);
+                                } catch(final Exception e) {
+                                    errMsg = "Could not set JAWT rootSurfaceLayerHandle "+toHexString(rootSurfaceLayer)+", cause: "+e.getMessage();
+                                }
                             }
-                        }
-                        if(null != errMsg) {
-                            if(0 != rootSurfaceLayer) {
-                              OSXUtil.DestroyCALayer(rootSurfaceLayer);
-                              rootSurfaceLayer = 0;
+                            if(null != errMsg) {
+                                if(0 != rootSurfaceLayer) {
+                                  OSXUtil.DestroyCALayer(rootSurfaceLayer);
+                                  rootSurfaceLayer = 0;
+                                }
+                                throw new NativeWindowException(errMsg+": "+MacOSXJAWTWindow.this);
                             }
-                            throw new NativeWindowException(errMsg+": "+MacOSXJAWTWindow.this);
                         }
-                    }
-                } } );
+                    } } );
         }
         if(null != errMsg) {
             if(0 != windowHandle) {
@@ -338,7 +362,7 @@ public class MacOSXJAWTWindow extends JAWTWindow implements MutableSurface {
             unlockSurfaceImpl();
             throw new NativeWindowException(errMsg+": "+this);
         }
-        ret = NativeWindow.LOCK_SUCCESS;
+        ret = NativeSurface.LOCK_SUCCESS;
     }
 
     return ret;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java
index 8b9dfab..5d191f7 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/Win32SunJDKReflection.java
@@ -75,7 +75,7 @@ public class Win32SunJDKReflection {
             win32GraphicsConfigGetVisualMethod = win32GraphicsConfigClass.getDeclaredMethod("getVisual", new Class[] {});
             win32GraphicsConfigGetVisualMethod.setAccessible(true);
             initted = true;
-          } catch (Exception e) {
+          } catch (final Exception e) {
             // Either not a Sun JDK or the interfaces have changed since 1.4.2 / 1.5
           }
           return null;
@@ -83,37 +83,37 @@ public class Win32SunJDKReflection {
       });
   }
 
-  public static GraphicsConfiguration graphicsConfigurationGet(GraphicsDevice device, int pfdID) {
+  public static GraphicsConfiguration graphicsConfigurationGet(final GraphicsDevice device, final int pfdID) {
     if (!initted) {
       return null;
     }
 
     try {
-      return (GraphicsConfiguration) win32GraphicsConfigGetConfigMethod.invoke(null, new Object[] { device, new Integer(pfdID) });
-    } catch (Exception e) {
+      return (GraphicsConfiguration) win32GraphicsConfigGetConfigMethod.invoke(null, new Object[] { device, Integer.valueOf(pfdID) });
+    } catch (final Exception e) {
       return null;
     }
   }
 
-  public static int graphicsConfigurationGetPixelFormatID(AbstractGraphicsConfiguration config) {
+  public static int graphicsConfigurationGetPixelFormatID(final AbstractGraphicsConfiguration config) {
       try {
           if (config instanceof AWTGraphicsConfiguration) {
               return graphicsConfigurationGetPixelFormatID(((AWTGraphicsConfiguration) config).getAWTGraphicsConfiguration());
           }
           return 0;
-      } catch (Exception e) {
+      } catch (final Exception e) {
           return 0;
       }
   }
 
-  public static int graphicsConfigurationGetPixelFormatID(GraphicsConfiguration config) {
+  public static int graphicsConfigurationGetPixelFormatID(final GraphicsConfiguration config) {
     if (!initted) {
       return 0;
     }
 
     try {
       return ((Integer) win32GraphicsConfigGetVisualMethod.invoke(config, (Object[])null)).intValue();
-    } catch (Exception e) {
+    } catch (final Exception e) {
       return 0;
     }
   }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
index 54bdb34..7ad914e 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/windows/WindowsJAWTWindow.java
@@ -41,6 +41,7 @@
 package jogamp.nativewindow.jawt.windows;
 
 import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.NativeSurface;
 import javax.media.nativewindow.NativeWindow;
 import javax.media.nativewindow.NativeWindowException;
 import javax.media.nativewindow.util.Point;
@@ -56,7 +57,7 @@ import jogamp.nativewindow.windows.GDIUtil;
 
 public class WindowsJAWTWindow extends JAWTWindow {
 
-  public WindowsJAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+  public WindowsJAWTWindow(final Object comp, final AbstractGraphicsConfiguration config) {
     super(comp, config);
   }
 
@@ -72,14 +73,14 @@ public class WindowsJAWTWindow extends JAWTWindow {
 
   @Override
   protected int lockSurfaceImpl() throws NativeWindowException {
-    int ret = NativeWindow.LOCK_SUCCESS;
+    int ret = NativeSurface.LOCK_SUCCESS;
     ds = getJAWT().GetDrawingSurface(component);
     if (ds == null) {
       // Widget not yet realized
       unlockSurfaceImpl();
       return LOCK_SURFACE_NOT_READY;
     }
-    int res = ds.Lock();
+    final int res = ds.Lock();
     dsLocked = ( 0 == ( res & JAWTFactory.JAWT_LOCK_ERROR ) ) ;
     if (!dsLocked) {
       unlockSurfaceImpl();
@@ -98,7 +99,7 @@ public class WindowsJAWTWindow extends JAWTWindow {
       unlockSurfaceImpl();
       return LOCK_SURFACE_NOT_READY;
     }
-    updateBounds(dsi.getBounds());
+    updateLockedData(dsi.getBounds());
     win32dsi = (JAWT_Win32DrawingSurfaceInfo) dsi.platformInfo(getJAWT());
     if (win32dsi == null) {
       unlockSurfaceImpl();
@@ -136,7 +137,7 @@ public class WindowsJAWTWindow extends JAWTWindow {
   }
 
   @Override
-  protected Point getLocationOnScreenNativeImpl(int x, int y) {
+  protected Point getLocationOnScreenNativeImpl(final int x, final int y) {
     return GDIUtil.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y);
   }
 
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
index 4599b90..9abaed7 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11JAWTWindow.java
@@ -38,6 +38,7 @@
 package jogamp.nativewindow.jawt.x11;
 
 import javax.media.nativewindow.AbstractGraphicsConfiguration;
+import javax.media.nativewindow.NativeSurface;
 import javax.media.nativewindow.NativeWindow;
 import javax.media.nativewindow.NativeWindowException;
 import javax.media.nativewindow.util.Point;
@@ -53,7 +54,7 @@ import jogamp.nativewindow.x11.X11Lib;
 
 public class X11JAWTWindow extends JAWTWindow {
 
-  public X11JAWTWindow(Object comp, AbstractGraphicsConfiguration config) {
+  public X11JAWTWindow(final Object comp, final AbstractGraphicsConfiguration config) {
     super(comp, config);
   }
 
@@ -67,14 +68,14 @@ public class X11JAWTWindow extends JAWTWindow {
 
   @Override
   protected int lockSurfaceImpl() throws NativeWindowException {
-    int ret = NativeWindow.LOCK_SUCCESS;
+    int ret = NativeSurface.LOCK_SUCCESS;
     ds = getJAWT().GetDrawingSurface(component);
     if (ds == null) {
       // Widget not yet realized
       unlockSurfaceImpl();
       return LOCK_SURFACE_NOT_READY;
     }
-    int res = ds.Lock();
+    final int res = ds.Lock();
     dsLocked = ( 0 == ( res & JAWTFactory.JAWT_LOCK_ERROR ) ) ;
     if (!dsLocked) {
       unlockSurfaceImpl();
@@ -93,7 +94,7 @@ public class X11JAWTWindow extends JAWTWindow {
       unlockSurfaceImpl();
       return LOCK_SURFACE_NOT_READY;
     }
-    updateBounds(dsi.getBounds());
+    updateLockedData(dsi.getBounds());
     x11dsi = (JAWT_X11DrawingSurfaceInfo) dsi.platformInfo(getJAWT());
     if (x11dsi == null) {
       unlockSurfaceImpl();
@@ -124,7 +125,7 @@ public class X11JAWTWindow extends JAWTWindow {
   }
 
   @Override
-  protected Point getLocationOnScreenNativeImpl(int x, int y) {
+  protected Point getLocationOnScreenNativeImpl(final int x, final int y) {
     // surface is locked and hence the device
     return X11Lib.GetRelativeLocation(getDisplayHandle(), getScreenIndex(), getWindowHandle(), 0 /*root win*/, x, y);
   }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java
index b2c3a93..fea1be1 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/jawt/x11/X11SunJDKReflection.java
@@ -76,7 +76,7 @@ public class X11SunJDKReflection {
             x11GraphicsConfigGetVisualMethod = x11GraphicsConfigClass.getDeclaredMethod("getVisual", new Class[] {});
             x11GraphicsConfigGetVisualMethod.setAccessible(true);
             initialized = true;
-          } catch (Exception e) {
+          } catch (final Exception e) {
             // Either not a Sun JDK or the interfaces have changed since 1.4.2 / 1.5
           }
           return null;
@@ -84,37 +84,37 @@ public class X11SunJDKReflection {
       });
   }
 
-  public static long graphicsDeviceGetDisplay(GraphicsDevice device) {
+  public static long graphicsDeviceGetDisplay(final GraphicsDevice device) {
     if (!initialized) {
       return 0;
     }
 
     try {
       return ((Long) x11GraphicsDeviceGetDisplayMethod.invoke(device, (Object[])null)).longValue();
-    } catch (Exception e) {
+    } catch (final Exception e) {
       return 0;
     }
   }
 
-  public static int graphicsConfigurationGetVisualID(AbstractGraphicsConfiguration config) {
+  public static int graphicsConfigurationGetVisualID(final AbstractGraphicsConfiguration config) {
       try {
           if (config instanceof AWTGraphicsConfiguration) {
               return graphicsConfigurationGetVisualID(((AWTGraphicsConfiguration) config).getAWTGraphicsConfiguration());
           }
           return 0;
-      } catch (Exception e) {
+      } catch (final Exception e) {
           return 0;
       }
   }
 
-  public static int graphicsConfigurationGetVisualID(GraphicsConfiguration config) {
+  public static int graphicsConfigurationGetVisualID(final GraphicsConfiguration config) {
     if (!initialized) {
       return 0;
     }
 
     try {
       return ((Integer) x11GraphicsConfigGetVisualMethod.invoke(config, (Object[])null)).intValue();
-    } catch (Exception e) {
+    } catch (final Exception e) {
       return 0;
     }
   }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java
index b71af10..6b54c32 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXDummyUpstreamSurfaceHook.java
@@ -11,26 +11,26 @@ public class OSXDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
     long nsWindow;
 
     /**
-     * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)},
+     * @param width the initial width as returned by {@link NativeSurface#getSurfaceWidth()} via {@link UpstreamSurfaceHook#getSurfaceWidth(ProxySurface)},
      *        not the actual dummy surface width.
      *        The latter is platform specific and small
-     * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)},
+     * @param height the initial height as returned by {@link NativeSurface#getSurfaceHeight()} via {@link UpstreamSurfaceHook#getSurfaceHeight(ProxySurface)},
      *        not the actual dummy surface height,
      *        The latter is platform specific and small
      */
-    public OSXDummyUpstreamSurfaceHook(int width, int height) {
+    public OSXDummyUpstreamSurfaceHook(final int width, final int height) {
         super(width, height);
         nsWindow = 0;
     }
 
     @Override
-    public final void create(ProxySurface s) {
+    public final void create(final ProxySurface s) {
         if(0 == nsWindow && 0 == s.getSurfaceHandle()) {
             nsWindow = OSXUtil.CreateNSWindow(0, 0, 64, 64);
             if(0 == nsWindow) {
                 throw new NativeWindowException("Error NS window 0");
             }
-            long nsView = OSXUtil.GetNSView(nsWindow);
+            final long nsView = OSXUtil.GetNSView(nsWindow);
             if(0 == nsView) {
                 throw new NativeWindowException("Error NS view 0");
             }
@@ -41,7 +41,7 @@ public class OSXDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
     }
 
     @Override
-    public final void destroy(ProxySurface s) {
+    public final void destroy(final ProxySurface s) {
         if( s.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
             if( 0 == nsWindow || 0 == s.getSurfaceHandle() ) {
                 throw new InternalError("Owns upstream surface, but no OSX view/window: "+s+", nsWindow 0x"+Long.toHexString(nsWindow));
diff --git a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
index bac07b8..cf163bd 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/macosx/OSXUtil.java
@@ -44,6 +44,9 @@ public class OSXUtil implements ToolkitProperties {
     private static boolean isInit = false;
     private static final boolean DEBUG = Debug.debug("OSXUtil");
 
+    /** FIXME HiDPI: OSX unique and maximum value {@value} */
+    public static final int MAX_PIXELSCALE = 2;
+
     /**
      * Called by {@link NativeWindowFactory#initSingleton()}
      * @see ToolkitProperties
@@ -82,66 +85,60 @@ public class OSXUtil implements ToolkitProperties {
      */
     public static final boolean hasThreadingIssues() { return false; }
 
-    public static boolean isNSView(long object) {
+    public static boolean isNSView(final long object) {
         return 0 != object ? isNSView0(object) : false;
     }
 
-    public static boolean isNSWindow(long object) {
+    public static boolean isNSWindow(final long object) {
         return 0 != object ? isNSWindow0(object) : false;
     }
 
     /**
-     * In case the <code>windowOrView</code> is top-level,
-     * you shall set <code>topLevel</code> to true where
-     * insets gets into account to compute the client position as follows:
-     * <pre>
-      if(topLevel) {
-          // top-level position -> client window position
-          final Insets insets = GetInsets(windowOrView);
-          los.setX(los.getX() + insets.getLeftWidth());
-          los.setY(los.getY() + insets.getTopHeight());
-      }
-     * </pre>
      * @param windowOrView
-     * @param topLevel
      * @param src_x
      * @param src_y
-     * @return the client position
+     * @return top-left client-area position in window units
      */
-    public static Point GetLocationOnScreen(long windowOrView, boolean topLevel, int src_x, int src_y) {
-      final Point los = (Point) GetLocationOnScreen0(windowOrView, src_x, src_y);
-      if(topLevel) {
-          // top-level position -> client window position
-          final Insets insets = GetInsets(windowOrView);
-          los.set(los.getX() + insets.getLeftWidth(), los.getY() + insets.getTopHeight());
-      }
-      return los;
+    public static Point GetLocationOnScreen(final long windowOrView, final int src_x, final int src_y) {
+      return (Point) GetLocationOnScreen0(windowOrView, src_x, src_y);
     }
 
-    public static Insets GetInsets(long windowOrView) {
+    public static Insets GetInsets(final long windowOrView) {
       return (Insets) GetInsets0(windowOrView);
     }
 
-    public static long CreateNSWindow(int x, int y, int width, int height) {
+    public static double GetPixelScale(final int screenIndex) {
+      return GetPixelScale0(screenIndex);
+    }
+
+    public static double GetPixelScale(final long windowOrView) {
+      return GetPixelScale1(windowOrView);
+    }
+
+    public static long CreateNSWindow(final int x, final int y, final int width, final int height) {
       return CreateNSWindow0(x, y, width, height);
     }
-    public static void DestroyNSWindow(long nsWindow) {
+    public static void DestroyNSWindow(final long nsWindow) {
         DestroyNSWindow0(nsWindow);
     }
-    public static long GetNSView(long nsWindow) {
+    public static long GetNSView(final long nsWindow) {
       return GetNSView0(nsWindow);
     }
-    public static long GetNSWindow(long nsView) {
+    public static long GetNSWindow(final long nsView) {
       return GetNSWindow0(nsView);
     }
 
     /**
      * Create a CALayer suitable to act as a root CALayer.
+     * @param width width of the CALayer in window units (points)
+     * @param height height of the CALayer in window units (points)
+     * @param contentsScale scale for HiDPI support: pixel-dim = window-dim x scale
+     * @return the new CALayer object
      * @see #DestroyCALayer(long)
      * @see #AddCASublayer(long, long)
      */
-    public static long CreateCALayer(final int width, final int height) {
-      final long l = CreateCALayer0(width, height);
+    public static long CreateCALayer(final int width, final int height, final float contentsScale) {
+      final long l = CreateCALayer0(width, height, contentsScale);
       if(DEBUG) {
           System.err.println("OSXUtil.CreateCALayer: 0x"+Long.toHexString(l)+" - "+Thread.currentThread().getName());
       }
@@ -158,18 +155,27 @@ public class OSXUtil implements ToolkitProperties {
      * Hence it is important that related resources are not locked <i>if</i>
      * they will be used for creation.
      * </p>
-     * @param caLayerQuirks TODO
-     * @see #CreateCALayer(int, int)
+     * @param rootCALayer
+     * @param subCALayer
+     * @param x x-coord of the sub-CALayer in window units (points)
+     * @param y y-coord of the sub-CALayer in window units (points)
+     * @param width width of the sub-CALayer in window units (points)
+     * @param height height of the sub-CALayer in window units (points)
+     * @param contentsScale scale for HiDPI support: pixel-dim = window-dim x scale
+     * @param caLayerQuirks
+     * @see #CreateCALayer(int, int, float)
      * @see #RemoveCASublayer(long, long, boolean)
      */
-    public static void AddCASublayer(final long rootCALayer, final long subCALayer, final int x, final int y, final int width, final int height, final int caLayerQuirks) {
+    public static void AddCASublayer(final long rootCALayer, final long subCALayer,
+                                     final int x, final int y, final int width, final int height,
+                                     final float contentsScale, final int caLayerQuirks) {
         if(0==rootCALayer || 0==subCALayer) {
             throw new IllegalArgumentException("rootCALayer 0x"+Long.toHexString(rootCALayer)+", subCALayer 0x"+Long.toHexString(subCALayer));
         }
         if(DEBUG) {
             System.err.println("OSXUtil.AttachCALayer: caLayerQuirks "+caLayerQuirks+", 0x"+Long.toHexString(subCALayer)+" - "+Thread.currentThread().getName());
         }
-        AddCASublayer0(rootCALayer, subCALayer, x, y, width, height, caLayerQuirks);
+        AddCASublayer0(rootCALayer, subCALayer, x, y, width, height, contentsScale, caLayerQuirks);
     }
 
     /**
@@ -186,8 +192,8 @@ public class OSXUtil implements ToolkitProperties {
      * @param rootCALayer the root surface layer, maybe null.
      * @param subCALayer the client surface layer, maybe null.
      * @param visible TODO
-     * @param width the expected width
-     * @param height the expected height
+     * @param width the expected width in window units (points)
+     * @param height the expected height in window units (points)
      * @param caLayerQuirks TODO
      */
     public static void FixCALayerLayout(final long rootCALayer, final long subCALayer, final boolean visible, final int x, final int y, final int width, final int height, final int caLayerQuirks) {
@@ -198,6 +204,20 @@ public class OSXUtil implements ToolkitProperties {
     }
 
     /**
+     * Set root and sub CALayer pixelScale / contentScale for HiDPI
+     *
+     * @param rootCALayer the root surface layer, maybe null.
+     * @param subCALayer the client surface layer, maybe null.
+     * @param contentsScale scale for HiDPI support: pixel-dim = window-dim x scale
+     */
+    public static void SetCALayerPixelScale(final long rootCALayer, final long subCALayer, final float contentsScale) {
+        if( 0==rootCALayer && 0==subCALayer ) {
+            return;
+        }
+        SetCALayerPixelScale0(rootCALayer, subCALayer, contentsScale);
+    }
+
+    /**
      * Detach a sub CALayer from the root CALayer.
      */
     public static void RemoveCASublayer(final long rootCALayer, final long subCALayer) {
@@ -212,7 +232,7 @@ public class OSXUtil implements ToolkitProperties {
 
     /**
      * Destroy a CALayer.
-     * @see #CreateCALayer(int, int)
+     * @see #CreateCALayer(int, int, float)
      */
     public static void DestroyCALayer(final long caLayer) {
         if(0==caLayer) {
@@ -231,9 +251,10 @@ public class OSXUtil implements ToolkitProperties {
      * </p>
      *
      * @param waitUntilDone
+     * @param kickNSApp if <code>true</code> issues {@link #KickNSApp()}
      * @param runnable
      */
-    public static void RunOnMainThread(boolean waitUntilDone, Runnable runnable) {
+    public static void RunOnMainThread(final boolean waitUntilDone, final boolean kickNSApp, final Runnable runnable) {
         if( IsMainThread0() ) {
             runnable.run(); // don't leave the JVM
         } else {
@@ -243,11 +264,11 @@ public class OSXUtil implements ToolkitProperties {
             final Object sync = new Object();
             final RunnableTask rt = new RunnableTask( runnable, waitUntilDone ? sync : null, true, waitUntilDone ? null : System.err );
             synchronized(sync) {
-                RunOnMainThread0(rt);
+                RunOnMainThread0(kickNSApp, rt);
                 if( waitUntilDone ) {
                     try {
                         sync.wait();
-                    } catch (InterruptedException ie) {
+                    } catch (final InterruptedException ie) {
                         throwable = ie;
                     }
                     if(null==throwable) {
@@ -267,15 +288,34 @@ public class OSXUtil implements ToolkitProperties {
      * @param runnable
      * @param delay delay to run the runnable in milliseconds
      */
-    public static void RunLater(boolean onMain, Runnable runnable, int delay) {
-        RunLater0(onMain, new RunnableTask( runnable, null, true, System.err ), delay);
+    public static void RunLater(final boolean onMain, final Runnable runnable, final int delay) {
+        RunLater0(onMain, false /* kickNSApp */, new RunnableTask( runnable, null, true, System.err ), delay);
+    }
+
+    /**
+     * Wakes up NSApp thread by sending an empty NSEvent ..
+     * <p>
+     * This is deemed important <i>sometimes</i> where resources shall get freed ASAP, e.g. GL context etc.
+     * </p>
+     * <p>
+     * The following scenarios requiring this <i>wake-up</i> are currently known:
+     * <ul>
+     *   <li>Destruction of an OpenGL context</li>
+     *   <li>Destruction of Windows .. ?</li>
+     *   <li>Stopping the NSApp</li>
+     * </ul>
+     * </p>
+     * FIXME: Complete list of scenarios and reason it.
+     */
+    public static void KickNSApp() {
+        KickNSApp0();
     }
 
     private static Runnable _nop = new Runnable() { @Override public void run() {}; };
 
-    /** Issues a {@link #RunOnMainThread(boolean, Runnable)} w/ an <i>NOP</i> runnable, while waiting until done. */
+    /** Issues a {@link #RunOnMainThread(boolean, boolean, Runnable)} w/ an <i>NOP</i> runnable, while waiting until done and issuing {@link #KickNSApp()}. */
     public static void WaitUntilFinish() {
-        RunOnMainThread(true, _nop);
+        RunOnMainThread(true, true /* kickNSApp */, _nop);
     }
 
     /**
@@ -285,9 +325,10 @@ public class OSXUtil implements ToolkitProperties {
      * </p>
      *
      * @param waitUntilDone
+     * @param kickNSApp if <code>true</code> issues {@link #KickNSApp()}
      * @param func
      */
-    public static <R,A> R RunOnMainThread(boolean waitUntilDone, Function<R,A> func, A... args) {
+    public static <R,A> R RunOnMainThread(final boolean waitUntilDone, final boolean kickNSApp, final Function<R,A> func, final A... args) {
         if( IsMainThread0() ) {
             return func.eval(args); // don't leave the JVM
         } else {
@@ -298,11 +339,11 @@ public class OSXUtil implements ToolkitProperties {
             final FunctionTask<R,A> rt = new FunctionTask<R,A>( func, waitUntilDone ? sync : null, true, waitUntilDone ? null : System.err );
             synchronized(sync) {
                 rt.setArgs(args);
-                RunOnMainThread0(rt);
+                RunOnMainThread0(kickNSApp, rt);
                 if( waitUntilDone ) {
                     try {
                         sync.wait();
-                    } catch (InterruptedException ie) {
+                    } catch (final InterruptedException ie) {
                         throwable = ie;
                     }
                     if(null==throwable) {
@@ -322,7 +363,7 @@ public class OSXUtil implements ToolkitProperties {
     }
 
     /** Returns the screen refresh rate in Hz. If unavailable, returns 60Hz. */
-    public static int GetScreenRefreshRate(int scrn_idx) {
+    public static int GetScreenRefreshRate(final int scrn_idx) {
         return GetScreenRefreshRate0(scrn_idx);
     }
 
@@ -352,17 +393,21 @@ public class OSXUtil implements ToolkitProperties {
     private static native boolean isNSWindow0(long object);
     private static native Object GetLocationOnScreen0(long windowOrView, int src_x, int src_y);
     private static native Object GetInsets0(long windowOrView);
+    private static native double GetPixelScale0(int screenIndex);
+    private static native double GetPixelScale1(long windowOrView);
     private static native long CreateNSWindow0(int x, int y, int width, int height);
     private static native void DestroyNSWindow0(long nsWindow);
     private static native long GetNSView0(long nsWindow);
     private static native long GetNSWindow0(long nsView);
-    private static native long CreateCALayer0(int width, int height);
-    private static native void AddCASublayer0(long rootCALayer, long subCALayer, int x, int y, int width, int height, int caLayerQuirks);
+    private static native long CreateCALayer0(int width, int height, float contentsScale);
+    private static native void AddCASublayer0(long rootCALayer, long subCALayer, int x, int y, int width, int height, float contentsScale, int caLayerQuirks);
     private static native void FixCALayerLayout0(long rootCALayer, long subCALayer, boolean visible, int x, int y, int width, int height, int caLayerQuirks);
+    private static native void SetCALayerPixelScale0(long rootCALayer, long subCALayer, float contentsScale);
     private static native void RemoveCASublayer0(long rootCALayer, long subCALayer);
     private static native void DestroyCALayer0(long caLayer);
-    private static native void RunOnMainThread0(Runnable runnable);
-    private static native void RunLater0(boolean onMain, Runnable runnable, int delay);
+    private static native void RunOnMainThread0(boolean kickNSApp, Runnable runnable);
+    private static native void RunLater0(boolean onMain, boolean kickNSApp, Runnable runnable, int delay);
+    private static native void KickNSApp0();
     private static native boolean IsMainThread0();
     private static native int GetScreenRefreshRate0(int scrn_idx);
 }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java
index e5de43c..a08cf9b 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIDummyUpstreamSurfaceHook.java
@@ -9,19 +9,19 @@ import com.jogamp.nativewindow.UpstreamSurfaceHookMutableSize;
 
 public class GDIDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize {
     /**
-     * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)},
+     * @param width the initial width as returned by {@link NativeSurface#getSurfaceWidth()} via {@link UpstreamSurfaceHook#getSurfaceWidth(ProxySurface)},
      *        not the actual dummy surface width.
      *        The latter is platform specific and small
-     * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)},
+     * @param height the initial height as returned by {@link NativeSurface#getSurfaceHeight()} via {@link UpstreamSurfaceHook#getSurfaceHeight(ProxySurface)},
      *        not the actual dummy surface height,
      *        The latter is platform specific and small
      */
-    public GDIDummyUpstreamSurfaceHook(int width, int height) {
+    public GDIDummyUpstreamSurfaceHook(final int width, final int height) {
         super(width, height);
     }
 
     @Override
-    public final void create(ProxySurface s) {
+    public final void create(final ProxySurface s) {
         final GDISurface ms = (GDISurface)s;
         if(0 == ms.getWindowHandle()) {
             final long windowHandle = GDIUtil.CreateDummyWindow(0, 0, 64, 64);
@@ -35,7 +35,7 @@ public class GDIDummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
     }
 
     @Override
-    public final void destroy(ProxySurface s) {
+    public final void destroy(final ProxySurface s) {
         final GDISurface ms = (GDISurface)s;
         if( ms.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
             if( 0 == ms.getWindowHandle() ) {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
index 3e07b2a..2f335c4 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDISurface.java
@@ -47,8 +47,8 @@ import jogamp.nativewindow.windows.GDI;
  * @see ProxySurface
  */
 public class GDISurface extends ProxySurfaceImpl {
-  protected long windowHandle;
-  protected long surfaceHandle;
+  private long windowHandle;
+  private long surfaceHandle;
 
   /**
    * @param cfg the {@link AbstractGraphicsConfiguration} to be used
@@ -58,7 +58,7 @@ public class GDISurface extends ProxySurfaceImpl {
    *                  owns the {@link AbstractGraphicsConfiguration}'s {@link AbstractGraphicsDevice},
    *                  otherwise <code>false</code>. Owning the device implies closing it at {@link #destroyNotify()}.
    */
-  public GDISurface(AbstractGraphicsConfiguration cfg, long windowHandle, UpstreamSurfaceHook upstream, boolean ownsDevice) {
+  public GDISurface(final AbstractGraphicsConfiguration cfg, final long windowHandle, final UpstreamSurfaceHook upstream, final boolean ownsDevice) {
     super(cfg, upstream, ownsDevice);
     this.windowHandle=windowHandle;
     this.surfaceHandle=0;
@@ -81,14 +81,14 @@ public class GDISurface extends ProxySurfaceImpl {
    * </p>
    */
   @Override
-  public final void setSurfaceHandle(long surfaceHandle) {
+  public final void setSurfaceHandle(final long surfaceHandle) {
       this.windowHandle = surfaceHandle;
   }
 
   /**
    * Sets the window handle (HWND).
    */
-  public final void setWindowHandle(long windowHandle) {
+  public final void setWindowHandle(final long windowHandle) {
       this.windowHandle = windowHandle;
   }
 
@@ -128,4 +128,15 @@ public class GDISurface extends ProxySurfaceImpl {
   final public long getSurfaceHandle() {
     return surfaceHandle;
   }
+
+  @Override
+  public final int[] convertToWindowUnits(final int[] pixelUnitsAndResult) {
+      return pixelUnitsAndResult; // no pixelScale factor
+  }
+
+  @Override
+  public final int[] convertToPixelUnits(final int[] windowUnitsAndResult) {
+      return windowUnitsAndResult; // no pixelScale factor
+  }
+
 }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java
index 720ff9b..c409b6a 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/GDIUtil.java
@@ -40,7 +40,7 @@ public class GDIUtil implements ToolkitProperties {
 
     private static final String dummyWindowClassNameBase = "_dummyWindow_clazz" ;
     private static RegisteredClassFactory dummyWindowClassFactory;
-    private static boolean isInit = false;
+    private static volatile boolean isInit = false;
 
     /**
      * Called by {@link NativeWindowFactory#initSingleton()}
@@ -93,7 +93,7 @@ public class GDIUtil implements ToolkitProperties {
     private static RegisteredClass dummyWindowClass = null;
     private static Object dummyWindowSync = new Object();
 
-    public static long CreateDummyWindow(int x, int y, int width, int height) {
+    public static long CreateDummyWindow(final int x, final int y, final int width, final int height) {
         synchronized(dummyWindowSync) {
             dummyWindowClass = dummyWindowClassFactory.getSharedClass();
             if(DEBUG) {
@@ -104,7 +104,7 @@ public class GDIUtil implements ToolkitProperties {
         }
     }
 
-    public static boolean DestroyDummyWindow(long hwnd) {
+    public static boolean DestroyDummyWindow(final long hwnd) {
         boolean res;
         synchronized(dummyWindowSync) {
             if( null == dummyWindowClass ) {
@@ -116,18 +116,22 @@ public class GDIUtil implements ToolkitProperties {
         return res;
     }
 
-    public static Point GetRelativeLocation(long src_win, long dest_win, int src_x, int src_y) {
+    public static Point GetRelativeLocation(final long src_win, final long dest_win, final int src_x, final int src_y) {
         return (Point) GetRelativeLocation0(src_win, dest_win, src_x, src_y);
     }
 
-    public static boolean IsUndecorated(long win) {
+    public static boolean IsUndecorated(final long win) {
         return IsUndecorated0(win);
     }
 
-    public static boolean IsChild(long win) {
+    public static boolean IsChild(final long win) {
         return IsChild0(win);
     }
 
+    public static void SetProcessThreadsAffinityMask(final long affinityMask, final boolean verbose) {
+        SetProcessThreadsAffinityMask0(affinityMask, verbose);
+    }
+
     private static final void dumpStack() { Thread.dumpStack(); } // Callback for JNI
 
     /** Creates WNDCLASSEX instance */
@@ -142,6 +146,8 @@ public class GDIUtil implements ToolkitProperties {
     private static native boolean IsChild0(long win);
     private static native boolean IsUndecorated0(long win);
 
+    private static native void SetProcessThreadsAffinityMask0(long affinityMask, boolean verbose);
+
     private static native long CreateDummyWindow0(long hInstance, String className, long dispThreadCtx, String windowName, int x, int y, int width, int height);
     private static native boolean DestroyWindow0(long dispThreadCtx, long win);
 }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
index 1f6cb7c..3c7b1ad 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClass.java
@@ -33,7 +33,7 @@ public class RegisteredClass {
     private final String className;
     private final long hDDTCtx;
 
-    RegisteredClass(long hInst, String name, long hDispatchThreadCtx) {
+    RegisteredClass(final long hInst, final String name, final long hDispatchThreadCtx) {
         this.hInstance = hInst;
         this.className = name;
         this.hDDTCtx = hDispatchThreadCtx;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
index c4b4d14..e3ea493 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/windows/RegisteredClassFactory.java
@@ -57,7 +57,7 @@ public class RegisteredClassFactory {
     private int sharedRefCount = 0;
     private final Object sync = new Object();
 
-    private String toHexString(long l) { return "0x"+Long.toHexString(l); }
+    private String toHexString(final long l) { return "0x"+Long.toHexString(l); }
 
     @Override
     public final String toString() { return "RegisteredClassFactory[moduleHandle "+toHexString(hInstance)+", "+classBaseName+
@@ -93,7 +93,7 @@ public class RegisteredClassFactory {
     /** Application handle. */
     public static long getHInstance() { return hInstance; }
 
-    public RegisteredClassFactory(String classBaseName, long wndProc, boolean useDummyDispatchThread, long iconSmallHandle, long iconBigHandle) {
+    public RegisteredClassFactory(final String classBaseName, final long wndProc, final boolean useDummyDispatchThread, final long iconSmallHandle, final long iconBigHandle) {
         this.classBaseName = classBaseName;
         this.wndProc = wndProc;
         this.useDummyDispatchThread = useDummyDispatchThread;
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java
index 4f8cff8..0ac3d4a 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Capabilities.java
@@ -35,7 +35,7 @@ import javax.media.nativewindow.VisualIDHolder;
 public class X11Capabilities extends Capabilities {
   final private XVisualInfo xVisualInfo; // maybe null if !onscreen
 
-  public X11Capabilities(XVisualInfo xVisualInfo) {
+  public X11Capabilities(final XVisualInfo xVisualInfo) {
       super();
       this.xVisualInfo = xVisualInfo;
   }
@@ -49,7 +49,7 @@ public class X11Capabilities extends Capabilities {
   public Object clone() {
     try {
       return super.clone();
-    } catch (RuntimeException e) {
+    } catch (final RuntimeException e) {
       throw new NativeWindowException(e);
     }
   }
@@ -59,7 +59,7 @@ public class X11Capabilities extends Capabilities {
   final public boolean hasXVisualInfo() { return null!=xVisualInfo; }
 
   @Override
-  final public int getVisualID(VIDType type) throws NativeWindowException {
+  final public int getVisualID(final VIDType type) throws NativeWindowException {
       switch(type) {
           case INTRINSIC:
           case NATIVE:
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java
index 2c8ef64..7e61ba6 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11DummyUpstreamSurfaceHook.java
@@ -14,19 +14,19 @@ import com.jogamp.nativewindow.x11.X11GraphicsScreen;
 
 public class X11DummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize {
     /**
-     * @param width the initial width as returned by {@link NativeSurface#getWidth()} via {@link UpstreamSurfaceHook#getWidth(ProxySurface)},
+     * @param width the initial width as returned by {@link NativeSurface#getSurfaceWidth()} via {@link UpstreamSurfaceHook#getSurfaceWidth(ProxySurface)},
      *        not the actual dummy surface width.
      *        The latter is platform specific and small
-     * @param height the initial height as returned by {@link NativeSurface#getHeight()} via {@link UpstreamSurfaceHook#getHeight(ProxySurface)},
+     * @param height the initial height as returned by {@link NativeSurface#getSurfaceHeight()} via {@link UpstreamSurfaceHook#getSurfaceHeight(ProxySurface)},
      *        not the actual dummy surface height,
      *        The latter is platform specific and small
      */
-    public X11DummyUpstreamSurfaceHook(int width, int height) {
+    public X11DummyUpstreamSurfaceHook(final int width, final int height) {
         super(width, height);
     }
 
     @Override
-    public final void create(ProxySurface s) {
+    public final void create(final ProxySurface s) {
         final X11GraphicsConfiguration cfg = (X11GraphicsConfiguration) s.getGraphicsConfiguration();
         final X11GraphicsScreen screen = (X11GraphicsScreen) cfg.getScreen();
         final X11GraphicsDevice device = (X11GraphicsDevice) screen.getDevice();
@@ -51,7 +51,7 @@ public class X11DummyUpstreamSurfaceHook extends UpstreamSurfaceHookMutableSize
     }
 
     @Override
-    public final void destroy(ProxySurface s) {
+    public final void destroy(final ProxySurface s) {
         if( s.containsUpstreamOptionBits( ProxySurface.OPT_PROXY_OWNS_UPSTREAM_SURFACE ) ) {
             final X11GraphicsDevice device = (X11GraphicsDevice) s.getGraphicsConfiguration().getScreen().getDevice();
             if( 0 == s.getSurfaceHandle() ) {
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
index 6258632..e12c3fd 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11GraphicsConfigurationFactory.java
@@ -53,7 +53,7 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor
 
     @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-        CapabilitiesImmutable  capsChosen, CapabilitiesImmutable capsRequested, CapabilitiesChooser chooser, AbstractGraphicsScreen screen, int nativeVisualID)
+        final CapabilitiesImmutable  capsChosen, final CapabilitiesImmutable capsRequested, final CapabilitiesChooser chooser, final AbstractGraphicsScreen screen, final int nativeVisualID)
         throws IllegalArgumentException, NativeWindowException {
 
         if(!(screen instanceof X11GraphicsScreen)) {
@@ -72,15 +72,15 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor
         return res;
     }
 
-    public static XVisualInfo getXVisualInfo(AbstractGraphicsScreen screen, int visualID)
+    public static XVisualInfo getXVisualInfo(final AbstractGraphicsScreen screen, final int visualID)
     {
-        XVisualInfo xvi_temp = XVisualInfo.create();
+        final XVisualInfo xvi_temp = XVisualInfo.create();
         xvi_temp.setVisualid(visualID);
         xvi_temp.setScreen(screen.getIndex());
-        int num[] = { -1 };
-        long display = screen.getDevice().getHandle();
+        final int num[] = { -1 };
+        final long display = screen.getDevice().getHandle();
 
-        XVisualInfo[] xvis = X11Lib.XGetVisualInfo(display, X11Lib.VisualIDMask|X11Lib.VisualScreenMask, xvi_temp, num, 0);
+        final XVisualInfo[] xvis = X11Lib.XGetVisualInfo(display, X11Lib.VisualIDMask|X11Lib.VisualScreenMask, xvi_temp, num, 0);
 
         if(xvis==null || num[0]<1) {
             return null;
@@ -89,26 +89,26 @@ public class X11GraphicsConfigurationFactory extends GraphicsConfigurationFactor
         return XVisualInfo.create(xvis[0]);
     }
 
-    public static XVisualInfo getXVisualInfo(AbstractGraphicsScreen screen, CapabilitiesImmutable capabilities)
+    public static XVisualInfo getXVisualInfo(final AbstractGraphicsScreen screen, final CapabilitiesImmutable capabilities)
     {
-        XVisualInfo xv = getXVisualInfoImpl(screen, capabilities, 4 /* TrueColor */);
+        final XVisualInfo xv = getXVisualInfoImpl(screen, capabilities, 4 /* TrueColor */);
         if(null!=xv) return xv;
         return getXVisualInfoImpl(screen, capabilities, 5 /* DirectColor */);
     }
 
-    private static XVisualInfo getXVisualInfoImpl(AbstractGraphicsScreen screen, CapabilitiesImmutable capabilities, int c_class)
+    private static XVisualInfo getXVisualInfoImpl(final AbstractGraphicsScreen screen, final CapabilitiesImmutable capabilities, final int c_class)
     {
         XVisualInfo ret = null;
-        int[] num = { -1 };
+        final int[] num = { -1 };
 
-        XVisualInfo vinfo_template = XVisualInfo.create();
+        final XVisualInfo vinfo_template = XVisualInfo.create();
         vinfo_template.setScreen(screen.getIndex());
         vinfo_template.setC_class(c_class);
-        long display = screen.getDevice().getHandle();
+        final long display = screen.getDevice().getHandle();
 
-        XVisualInfo[] vinfos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, vinfo_template, num, 0);
+        final XVisualInfo[] vinfos = X11Lib.XGetVisualInfo(display, X11Lib.VisualScreenMask, vinfo_template, num, 0);
         XVisualInfo best=null;
-        int rdepth = capabilities.getRedBits() + capabilities.getGreenBits() + capabilities.getBlueBits() + capabilities.getAlphaBits();
+        final int rdepth = capabilities.getRedBits() + capabilities.getGreenBits() + capabilities.getBlueBits() + capabilities.getAlphaBits();
         for (int i = 0; vinfos!=null && i < num[0]; i++) {
             if ( best == null ||
                  best.getDepth() < vinfos[i].getDepth() )
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
index 02e4379..2414248 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/X11Util.java
@@ -243,7 +243,7 @@ public class X11Util implements ToolkitProperties {
         return hasThreadingIssues; // JOGL impl. may utilize special locking "somewhere"
     }
 
-    public static void setX11ErrorHandler(boolean onoff, boolean quiet) {
+    public static void setX11ErrorHandler(final boolean onoff, final boolean quiet) {
         synchronized(setX11ErrorHandlerLock) {
             setX11ErrorHandler0(onoff, quiet);
         }
@@ -282,7 +282,7 @@ public class X11Util implements ToolkitProperties {
         boolean unCloseable;
         Throwable creationStack;
 
-        protected NamedDisplay(String name, long handle) {
+        protected NamedDisplay(final String name, final long handle) {
             this.name=name;
             this.handle=handle;
             this.refCount=0;
@@ -306,7 +306,7 @@ public class X11Util implements ToolkitProperties {
         }
 
         @Override
-        public final boolean equals(Object obj) {
+        public final boolean equals(final Object obj) {
             if(this == obj) { return true; }
             if(obj instanceof NamedDisplay) {
                 return handle == ((NamedDisplay) obj).handle;
@@ -321,7 +321,7 @@ public class X11Util implements ToolkitProperties {
         public final long   getHandle() { return handle; }
         public final int    getRefCount() { return refCount; }
 
-        public final void setUncloseable(boolean v) { unCloseable = v; }
+        public final void setUncloseable(final boolean v) { unCloseable = v; }
         public final boolean isUncloseable() { return unCloseable; }
         public final Throwable getCreationStack() { return creationStack; }
 
@@ -341,7 +341,7 @@ public class X11Util implements ToolkitProperties {
         synchronized(globalLock) {
             if( getMarkAllDisplaysUnclosable() ) {
                 for(int i=0; i<pendingDisplayList.size(); i++) {
-                    final NamedDisplay ndpy = (NamedDisplay) pendingDisplayList.get(i);
+                    final NamedDisplay ndpy = pendingDisplayList.get(i);
                     if(DEBUG) {
                         final boolean closeAttempted = !openDisplayMap.containsKey(ndpy.getHandle());
                         System.err.println("X11Util.closePendingDisplayConnections(): Closing ["+i+"]: "+ndpy+" - closeAttempted "+closeAttempted);
@@ -367,10 +367,10 @@ public class X11Util implements ToolkitProperties {
         synchronized(globalLock) {
             System.err.println("X11Util: Open X11 Display Connections: "+openDisplayList.size());
             for(int i=0; i<openDisplayList.size(); i++) {
-                NamedDisplay ndpy = openDisplayList.get(i);
+                final NamedDisplay ndpy = openDisplayList.get(i);
                 System.err.println("X11Util: Open["+i+"]: "+ndpy);
                 if(null!=ndpy) {
-                    Throwable t = ndpy.getCreationStack();
+                    final Throwable t = ndpy.getCreationStack();
                     if(null!=t) {
                         t.printStackTrace();
                     }
@@ -395,10 +395,10 @@ public class X11Util implements ToolkitProperties {
         synchronized(globalLock) {
             System.err.println("X11Util: Reusable X11 Display Connections: "+reusableDisplayList.size());
             for(int i=0; i<reusableDisplayList.size(); i++) {
-                NamedDisplay ndpy = (NamedDisplay) reusableDisplayList.get(i);
+                final NamedDisplay ndpy = reusableDisplayList.get(i);
                 System.err.println("X11Util: Reusable["+i+"]: "+ndpy);
                 if(null!=ndpy) {
-                    Throwable t = ndpy.getCreationStack();
+                    final Throwable t = ndpy.getCreationStack();
                     if(null!=t) {
                         t.printStackTrace();
                     }
@@ -406,10 +406,10 @@ public class X11Util implements ToolkitProperties {
             }
             System.err.println("X11Util: Pending X11 Display Connections (creation order): "+pendingDisplayList.size());
             for(int i=0; i<pendingDisplayList.size(); i++) {
-                NamedDisplay ndpy = (NamedDisplay) pendingDisplayList.get(i);
+                final NamedDisplay ndpy = pendingDisplayList.get(i);
                 System.err.println("X11Util: Pending["+i+"]: "+ndpy);
                 if(null!=ndpy) {
-                    Throwable t = ndpy.getCreationStack();
+                    final Throwable t = ndpy.getCreationStack();
                     if(null!=t) {
                         t.printStackTrace();
                     }
@@ -418,7 +418,7 @@ public class X11Util implements ToolkitProperties {
         }
     }
 
-    public static boolean markDisplayUncloseable(long handle) {
+    public static boolean markDisplayUncloseable(final long handle) {
         NamedDisplay ndpy;
         synchronized(globalLock) {
             ndpy = (NamedDisplay) openDisplayMap.get(handle);
@@ -470,7 +470,7 @@ public class X11Util implements ToolkitProperties {
         return namedDpy.getHandle();
     }
 
-    public static void closeDisplay(long handle) {
+    public static void closeDisplay(final long handle) {
         synchronized(globalLock) {
             final NamedDisplay namedDpy = (NamedDisplay) openDisplayMap.remove(handle);
             if(null==namedDpy) {
@@ -504,7 +504,7 @@ public class X11Util implements ToolkitProperties {
         }
     }
 
-    public static NamedDisplay getNamedDisplay(long handle) {
+    public static NamedDisplay getNamedDisplay(final long handle) {
         synchronized(globalLock) {
             return (NamedDisplay) openDisplayMap.get(handle);
         }
@@ -513,11 +513,11 @@ public class X11Util implements ToolkitProperties {
     /**
      * @return If name is null, it returns the previous queried NULL display name,
      * otherwise the name. */
-    public static String validateDisplayName(String name) {
+    public static String validateDisplayName(final String name) {
         return ( null == name || AbstractGraphicsDevice.DEFAULT_CONNECTION.equals(name) ) ? getNullDisplayName() : name ;
     }
 
-    public static String validateDisplayName(String name, long handle) {
+    public static String validateDisplayName(String name, final long handle) {
         if( ( null==name || AbstractGraphicsDevice.DEFAULT_CONNECTION.equals(name) ) && 0!=handle) {
             name = X11Lib.XDisplayString(handle);
         }
@@ -530,8 +530,8 @@ public class X11Util implements ToolkitProperties {
      **
      *******************************/
 
-    public static long XOpenDisplay(String arg0) {
-        long handle = X11Lib.XOpenDisplay(arg0);
+    public static long XOpenDisplay(final String arg0) {
+        final long handle = X11Lib.XOpenDisplay(arg0);
         if(XSYNC_ENABLED && 0 != handle) {
             X11Lib.XSynchronize(handle, true);
         }
@@ -542,7 +542,7 @@ public class X11Util implements ToolkitProperties {
         return handle;
     }
 
-    public static int XCloseDisplay(long display) {
+    public static int XCloseDisplay(final long display) {
         if(TRACE_DISPLAY_LIFECYCLE) {
             System.err.println(Thread.currentThread()+" - X11Util.XCloseDisplay() 0x"+Long.toHexString(display));
             // Thread.dumpStack();
@@ -550,8 +550,8 @@ public class X11Util implements ToolkitProperties {
         int res = -1;
         try {
             res = X11Lib.XCloseDisplay(display);
-        } catch (Exception ex) {
-            System.err.println("X11Util: Catched Exception:");
+        } catch (final Exception ex) {
+            System.err.println("X11Util: Caught exception:");
             ex.printStackTrace();
         }
         return res;
@@ -561,7 +561,7 @@ public class X11Util implements ToolkitProperties {
     static long XineramaLibHandle = 0;
     static long XineramaQueryFunc = 0;
 
-    public static boolean XineramaIsEnabled(X11GraphicsDevice device) {
+    public static boolean XineramaIsEnabled(final X11GraphicsDevice device) {
         if(null == device) {
             throw new IllegalArgumentException("X11 Display device is NULL");
         }
@@ -573,7 +573,7 @@ public class X11Util implements ToolkitProperties {
         }
     }
 
-    public static boolean XineramaIsEnabled(long displayHandle) {
+    public static boolean XineramaIsEnabled(final long displayHandle) {
         if( 0 == displayHandle ) {
             throw new IllegalArgumentException("X11 Display handle is NULL");
         }
diff --git a/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java b/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java
index 0620402..6b606df 100644
--- a/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java
+++ b/src/nativewindow/classes/jogamp/nativewindow/x11/awt/X11AWTGraphicsConfigurationFactory.java
@@ -68,8 +68,8 @@ public class X11AWTGraphicsConfigurationFactory extends GraphicsConfigurationFac
 
     @Override
     protected AbstractGraphicsConfiguration chooseGraphicsConfigurationImpl(
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-            CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, int nativeVisualID) {
+            final CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+            final CapabilitiesChooser chooser, AbstractGraphicsScreen absScreen, final int nativeVisualID) {
         if (absScreen != null &&
             !(absScreen instanceof AWTGraphicsScreen)) {
             throw new IllegalArgumentException("This GraphicsConfigurationFactory accepts only AWTGraphicsScreen objects");
@@ -82,8 +82,8 @@ public class X11AWTGraphicsConfigurationFactory extends GraphicsConfigurationFac
     }
 
     public static AWTGraphicsConfiguration chooseGraphicsConfigurationStatic(
-            CapabilitiesImmutable capsChosen, CapabilitiesImmutable capsRequested,
-            CapabilitiesChooser chooser, AWTGraphicsScreen awtScreen, int nativeVisualID) {
+            CapabilitiesImmutable capsChosen, final CapabilitiesImmutable capsRequested,
+            final CapabilitiesChooser chooser, final AWTGraphicsScreen awtScreen, final int nativeVisualID) {
         if(DEBUG) {
             System.err.println("X11AWTGraphicsConfigurationFactory: got "+awtScreen);
         }
@@ -143,7 +143,7 @@ public class X11AWTGraphicsConfigurationFactory extends GraphicsConfigurationFac
         int visualID = aConfig.getVisualID(VIDType.NATIVE);
         if(VisualIDHolder.VID_UNDEFINED != visualID) {
             for (int i = 0; i < configs.length; i++) {
-                GraphicsConfiguration gc = configs[i];
+                final GraphicsConfiguration gc = configs[i];
                 if (gc != null) {
                     if (X11SunJDKReflection.graphicsConfigurationGetVisualID(gc) == visualID) {
                         if(DEBUG) {
diff --git a/src/nativewindow/native/macosx/OSXmisc.m b/src/nativewindow/native/macosx/OSXmisc.m
index d95d1cd..bf01f19 100644
--- a/src/nativewindow/native/macosx/OSXmisc.m
+++ b/src/nativewindow/native/macosx/OSXmisc.m
@@ -137,6 +137,14 @@ Java_jogamp_nativewindow_macosx_OSXUtil_isNSWindow0(JNIEnv *env, jclass _unused,
     return u;
 }
 
+static CGDirectDisplayID OSXUtil_getCGDirectDisplayIDByNSScreen(NSScreen *screen) {
+    // Mind: typedef uint32_t CGDirectDisplayID; - however, we assume it's 64bit on 64bit ?!
+    NSDictionary * dict = [screen deviceDescription];
+    NSNumber * val = (NSNumber *) [dict objectForKey: @"NSScreenNumber"];
+    // [NSNumber integerValue] returns NSInteger which is 32 or 64 bit native size
+    return (CGDirectDisplayID) [val integerValue];
+}
+
 /*
  * Class:     Java_jogamp_nativewindow_macosx_OSXUtil
  * Method:    getLocationOnScreen0
@@ -151,10 +159,6 @@ JNIEXPORT jobject JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_GetLocationOnS
      * return location in 0/0 top-left space,
      * OSX is 0/0 bottom-left space naturally
      */
-    NSRect r;
-    int dest_x=-1;
-    int dest_y=-1;
-
     NSObject *nsObj = (NSObject*) (intptr_t) winOrView;
     NSWindow* win = NULL;
     NSView* view = NULL;
@@ -166,27 +170,36 @@ JNIEXPORT jobject JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_GetLocationOnS
         view = (NSView*) nsObj;
         win = [view window];
     } else {
-        NativewindowCommon_throwNewRuntimeException(env, "neither win not view %p\n", nsObj);
+        NativewindowCommon_throwNewRuntimeException(env, "neither win nor view %p\n", nsObj);
     }
-    NSScreen* screen = [win screen];
-    NSRect screenRect = [screen frame];
-    NSRect winFrame = [win frame];
+    NSRect viewFrame = [view frame];
 
+    NSRect r;
     r.origin.x = src_x;
-    r.origin.y = winFrame.size.height - src_y; // y-flip for 0/0 top-left
+    r.origin.y = viewFrame.size.height - src_y; // y-flip for 0/0 top-left
     r.size.width = 0;
     r.size.height = 0;
     // NSRect rS = [win convertRectToScreen: r]; // 10.7
-    NSPoint oS = [win convertBaseToScreen: r.origin];
-    /**
-    NSLog(@"LOS.1: (bottom-left) %d/%d, screen-y[0: %d, h: %d], (top-left) %d/%d\n", 
-        (int)oS.x, (int)oS.y, (int)screenRect.origin.y, (int) screenRect.size.height,
-        (int)oS.x, (int)(screenRect.origin.y + screenRect.size.height - oS.y)); */
+    NSPoint oS = [win convertBaseToScreen: r.origin]; // BL-screen
+
+    NSScreen* screen = [win screen];
+    CGDirectDisplayID display = OSXUtil_getCGDirectDisplayIDByNSScreen(screen);
+    CGRect frameTL = CGDisplayBounds (display); // origin top-left
+    NSRect frameBL = [screen frame]; // origin bottom-left
+    oS.y = frameTL.origin.y + frameTL.size.height - ( oS.y - frameBL.origin.y ); // y-flip from BL-screen -> TL-screen
 
-    dest_x = (int) oS.x;
-    dest_y = (int) screenRect.origin.y + screenRect.size.height - oS.y;
+#ifdef VERBOSE
+    NSRect winFrame = [win frame];
+    DBG_PRINT( "GetLocationOnScreen0(window: %p):: point-in[%d/%d], winFrame[%d/%d %dx%d], viewFrame[%d/%d %dx%d], screen tl[%d/%d %dx%d] bl[%d/%d %dx%d] -> %d/%d\n",
+        win, (int)src_x, (int)src_y,
+        (int)winFrame.origin.x, (int)winFrame.origin.y, (int)winFrame.size.width, (int)winFrame.size.height,
+        (int)viewFrame.origin.x, (int)viewFrame.origin.y, (int)viewFrame.size.width, (int)viewFrame.size.height,
+        (int)frameTL.origin.x, (int)frameTL.origin.y, (int)frameTL.size.width, (int)frameTL.size.height,
+        (int)frameBL.origin.x, (int)frameBL.origin.y, (int)frameBL.size.width, (int)frameBL.size.height,
+        (int)oS.x, (int)oS.y);
+#endif
 
-    jobject res = (*env)->NewObject(env, pointClz, pointCstr, (jint)dest_x, (jint)dest_y);
+    jobject res = (*env)->NewObject(env, pointClz, pointCstr, (jint)oS.x, (jint)oS.y);
 
     [pool release];
 
@@ -215,7 +228,7 @@ JNIEXPORT jobject JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_GetInsets0
         view = (NSView*) nsObj;
         win = [view window];
     } else {
-        NativewindowCommon_throwNewRuntimeException(env, "neither win not view %p\n", nsObj);
+        NativewindowCommon_throwNewRuntimeException(env, "neither win nor view %p\n", nsObj);
     }
 
     NSRect frameRect = [win frame];
@@ -238,6 +251,75 @@ JNIEXPORT jobject JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_GetInsets0
 
 /*
  * Class:     Java_jogamp_nativewindow_macosx_OSXUtil
+ * Method:    GetPixelScale0
+ * Signature: (I)D
+ */
+JNIEXPORT jdouble JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_GetPixelScale0
+  (JNIEnv *env, jclass unused, jint screen_idx)
+{
+    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+    CGFloat pixelScale;
+    NSScreen *screen;
+    NSArray *screens = [NSScreen screens];
+    if( screen_idx<0 || screen_idx>=[screens count] ) {
+        screen = NULL;
+        pixelScale = 0.0;
+    } else {
+        screen = (NSScreen *) [screens objectAtIndex: screen_idx];
+        pixelScale = 1.0; // default
+NS_DURING
+        // Available >= 10.7
+        pixelScale = [screen backingScaleFactor]; // HiDPI scaling
+NS_HANDLER
+NS_ENDHANDLER
+    }
+    [pool release];
+
+    return (jdouble)pixelScale;
+}
+
+/*
+ * Class:     Java_jogamp_nativewindow_macosx_OSXUtil
+ * Method:    GetPixelScale1
+ * Signature: (J)D
+ */
+JNIEXPORT jdouble JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_GetPixelScale1
+  (JNIEnv *env, jclass unused, jlong winOrView)
+{
+    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+
+    NSObject *nsObj = (NSObject*) (intptr_t) winOrView;
+    NSWindow* win = NULL;
+    NSView* view = NULL;
+    NSScreen *screen = NULL;
+
+    if( [nsObj isKindOfClass:[NSWindow class]] ) {
+        win = (NSWindow*) nsObj;
+        view = [win contentView];
+        screen = [win screen];
+    } else if( nsObj != NULL && [nsObj isKindOfClass:[NSView class]] ) {
+        view = (NSView*) nsObj;
+        win = [view window];
+        screen = [win screen];
+    } else {
+        NativewindowCommon_throwNewRuntimeException(env, "neither win nor view %p\n", nsObj);
+    }
+
+    CGFloat pixelScale = 1.0; // default
+NS_DURING
+    // Available >= 10.7
+    pixelScale = [screen backingScaleFactor]; // HiDPI scaling
+NS_HANDLER
+NS_ENDHANDLER
+
+    [pool release];
+
+    return (jdouble)pixelScale;
+}
+
+/*
+ * Class:     Java_jogamp_nativewindow_macosx_OSXUtil
  * Method:    CreateNSWindow0
  * Signature: (IIIIZ)J
  */
@@ -544,19 +626,25 @@ JNIEXPORT jlong JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_GetNSWindow0
 /*
  * Class:     Java_jogamp_nativewindow_macosx_OSXUtil
  * Method:    CreateCALayer0
- * Signature: (II)J
+ * Signature: (IIF)J
  */
 JNIEXPORT jlong JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_CreateCALayer0
-  (JNIEnv *env, jclass unused, jint width, jint height)
+  (JNIEnv *env, jclass unused, jint width, jint height, jfloat contentsScale)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
 
     MyCALayer* layer = [[MyCALayer alloc] init];
-    DBG_PRINT("CALayer::CreateCALayer.0: root %p 0/0 %dx%d (refcnt %d)\n", layer, (int)width, (int)height, (int)[layer retainCount]);
+    DBG_PRINT("CALayer::CreateCALayer.0: root %p 0/0 %dx%d @ scale %lf (refcnt %d)\n", layer, (int)width, (int)height, (double)contentsScale, (int)[layer retainCount]);
     // avoid zero size
     if(0 == width) { width = 32; }
     if(0 == height) { height = 32; }
 
+NS_DURING
+    // Available >= 10.7
+    [layer setContentsScale: (CGFloat)contentsScale];
+NS_HANDLER
+NS_ENDHANDLER
+
     // initial dummy size !
     CGRect lFrame = [layer frame];
     lFrame.origin.x = 0;
@@ -580,10 +668,10 @@ JNIEXPORT jlong JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_CreateCALayer0
 /*
  * Class:     Java_jogamp_nativewindow_macosx_OSXUtil
  * Method:    AddCASublayer0
- * Signature: (JJIIIII)V
+ * Signature: (JJIIIIIF)V
  */
 JNIEXPORT void JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_AddCASublayer0
-  (JNIEnv *env, jclass unused, jlong rootCALayer, jlong subCALayer, jint x, jint y, jint width, jint height, jint caLayerQuirks)
+  (JNIEnv *env, jclass unused, jlong rootCALayer, jlong subCALayer, jint x, jint y, jint width, jint height, jfloat contentsScale, jint caLayerQuirks)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
     MyCALayer* rootLayer = (MyCALayer*) ((intptr_t) rootCALayer);
@@ -596,9 +684,16 @@ JNIEXPORT void JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_AddCASublayer0
     [subLayer retain]; // Pairs w/ RemoveCASublayer
 
     CGRect lRectRoot = [rootLayer frame];
-    DBG_PRINT("CALayer::AddCASublayer0.0: Quirks %d, Root %p (refcnt %d), Sub %p (refcnt %d), frame0: %lf/%lf %lfx%lf\n",
+
+    // Available >= 10.7
+    DBG_PRINT("CALayer::AddCASublayer0.0: Quirks %d, Root %p (refcnt %d), Sub %p (refcnt %d), frame0: %lf/%lf %lfx%lf scale %lf\n",
         caLayerQuirks, rootLayer, (int)[rootLayer retainCount], subLayer, (int)[subLayer retainCount],
-        lRectRoot.origin.x, lRectRoot.origin.y, lRectRoot.size.width, lRectRoot.size.height);
+        lRectRoot.origin.x, lRectRoot.origin.y, lRectRoot.size.width, lRectRoot.size.height, (float)contentsScale);
+
+NS_DURING
+    [subLayer setContentsScale: (CGFloat)contentsScale];
+NS_HANDLER
+NS_ENDHANDLER
 
     [subLayer setFrame:lRectRoot];
     [rootLayer addSublayer:subLayer];
@@ -654,6 +749,37 @@ JNIEXPORT void JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_FixCALayerLayout0
 
 /*
  * Class:     Java_jogamp_nativewindow_macosx_OSXUtil
+ * Method:    SetCALayerPixelScale0
+ * Signature: (JJF)V
+ */
+JNIEXPORT void JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_SetCALayerPixelScale0
+  (JNIEnv *env, jclass unused, jlong rootCALayer, jlong subCALayer, jfloat contentsScale)
+{
+    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+    MyCALayer* rootLayer = (MyCALayer*) ((intptr_t) rootCALayer);
+    if( NULL == rootLayer ) {
+        NativewindowCommon_throwNewRuntimeException(env, "Argument \"rootLayer\" is null");
+    }
+    CALayer* subLayer = (CALayer*) ((intptr_t) subCALayer);
+
+    [CATransaction begin];
+    [CATransaction setValue:(id)kCFBooleanTrue forKey:kCATransactionDisableActions];
+
+NS_DURING
+    [rootLayer setContentsScale: (CGFloat)contentsScale];
+    if( NULL != subLayer ) {
+        [subLayer setContentsScale: (CGFloat)contentsScale];
+    }
+NS_HANDLER
+NS_ENDHANDLER
+
+    [CATransaction commit];
+
+    [pool release];
+}
+
+/*
+ * Class:     Java_jogamp_nativewindow_macosx_OSXUtil
  * Method:    RemoveCASublayer0
  * Signature: (JJ)V
  */
@@ -880,29 +1006,61 @@ static void RunOnThread (JNIEnv *env, jobject runnable, BOOL onMain, jint delayI
     DBG_PRINT2( "RunOnThread.X\n");
 }
 
-/*
+static void OSXUtil_KickNSApp() {
+    NSEvent* event = [NSEvent otherEventWithType: NSApplicationDefined
+                                        location: NSMakePoint(0,0)
+                                   modifierFlags: 0
+                                       timestamp: 0.0
+                                    windowNumber: 0
+                                         context: nil
+                                         subtype: 0
+                                           data1: 0
+                                           data2: 0];
+    [NSApp postEvent: event atStart: true];
+}
+
+/**
  * Class:     Java_jogamp_nativewindow_macosx_OSXUtil
  * Method:    RunOnMainThread0
  * Signature: (ZLjava/lang/Runnable;)V
  */
 JNIEXPORT void JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_RunOnMainThread0
-  (JNIEnv *env, jclass unused, jobject runnable)
+  (JNIEnv *env, jclass unused, jboolean kickNSApp, jobject runnable)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
     RunOnThread (env, runnable, YES, 0);
+    if( kickNSApp ) {
+        OSXUtil_KickNSApp();
+    }
     [pool release];
 }
 
 /*
  * Class:     Java_jogamp_nativewindow_macosx_OSXUtil
  * Method:    RunLater0
- * Signature: (ZLjava/lang/Runnable;I)V
+ * Signature: (ZZLjava/lang/Runnable;I)V
  */
 JNIEXPORT void JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_RunLater0
-  (JNIEnv *env, jclass unused, jboolean onMain, jobject runnable, jint delay)
+  (JNIEnv *env, jclass unused, jboolean onMain, jboolean kickNSApp, jobject runnable, jint delay)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
     RunOnThread (env, runnable, onMain ? YES : NO, delay);
+    if( kickNSApp ) {
+        OSXUtil_KickNSApp();
+    }
+    [pool release];
+}
+
+/**
+ * Class:     Java_jogamp_nativewindow_macosx_OSXUtil
+ * Method:    KickNSApp0
+ * Signature: (V)V
+ */
+JNIEXPORT void JNICALL Java_jogamp_nativewindow_macosx_OSXUtil_KickNSApp0
+  (JNIEnv *env, jclass unused)
+{
+    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+    OSXUtil_KickNSApp();
     [pool release];
 }
 
diff --git a/src/nativewindow/native/win32/GDImisc.c b/src/nativewindow/native/win32/GDImisc.c
index bec1d49..76143c4 100644
--- a/src/nativewindow/native/win32/GDImisc.c
+++ b/src/nativewindow/native/win32/GDImisc.c
@@ -572,3 +572,107 @@ JNIEXPORT jboolean JNICALL Java_jogamp_nativewindow_windows_GDIUtil_IsUndecorate
     return bIsUndecorated ? JNI_TRUE : JNI_FALSE;
 }
 
+#if 0
+
+#include <tlhelp32.h>
+#include <tchar.h>
+
+static void printError( TCHAR* msg )
+{
+  DWORD eNum;
+  TCHAR sysMsg[256];
+  TCHAR* p;
+
+  eNum = GetLastError( );
+  FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+         NULL, eNum,
+         MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+         sysMsg, 256, NULL );
+
+  // Trim the end of the line and terminate it with a null
+  p = sysMsg;
+  while( ( *p > 31 ) || ( *p == 9 ) )
+    ++p;
+  do { *p-- = 0; } while( ( p >= sysMsg ) &&
+                          ( ( *p == '.' ) || ( *p < 33 ) ) );
+
+  // Display the message
+  _ftprintf(stderr, TEXT("\n  WARNING: %s failed with error %d (%s)"), msg, eNum, sysMsg );
+}
+
+static BOOL SetProcessThreadsAffinityMask( DWORD dwOwnerPID, DWORD_PTR newTAffinity, BOOL verbose ) 
+{ 
+  HANDLE hThreadSnap = INVALID_HANDLE_VALUE; 
+  THREADENTRY32 te32; 
+  DWORD_PTR preTAffinity;
+  HANDLE threadHandle;
+ 
+  // Take a snapshot of all running threads  
+  hThreadSnap = CreateToolhelp32Snapshot( TH32CS_SNAPTHREAD, 0 ); 
+  if( hThreadSnap == INVALID_HANDLE_VALUE ) 
+    return( FALSE ); 
+ 
+  // Fill in the size of the structure before using it. 
+  te32.dwSize = sizeof(THREADENTRY32 ); 
+ 
+  // Retrieve information about the first thread,
+  // and exit if unsuccessful
+  if( !Thread32First( hThreadSnap, &te32 ) ) 
+  {
+    if( verbose ) {
+        printError( TEXT("Thread32First") );  // Show cause of failure
+    }
+    CloseHandle( hThreadSnap );     // Must clean up the snapshot object!
+    return( FALSE );
+  }
+
+  // Now walk the thread list of the system,
+  // and display information about each thread
+  // associated with the specified process
+  do 
+  { 
+    if( te32.th32OwnerProcessID == dwOwnerPID )
+    {
+      if( verbose ) {
+          _ftprintf(stderr, TEXT("\n     THREAD ID      = 0x%08X, %d"), te32.th32ThreadID, te32.th32ThreadID); 
+          _ftprintf(stderr, TEXT("\n     base priority  = %d"), te32.tpBasePri ); 
+          _ftprintf(stderr, TEXT("\n     delta priority = %d"), te32.tpDeltaPri ); 
+      }
+      threadHandle = OpenThread(THREAD_ALL_ACCESS, FALSE, te32.th32ThreadID);
+      if( NULL != threadHandle ) {
+          preTAffinity = SetThreadAffinityMask(threadHandle, newTAffinity);
+          CloseHandle(threadHandle);
+          if( verbose ) {
+              _ftprintf(stderr, TEXT("\n     affinity %p -> %p"), preTAffinity, newTAffinity);
+          }
+      } else {
+          if( verbose ) {
+              _ftprintf(stderr, TEXT("\n     OpenThread failed %d"), (int)GetLastError());
+          }
+      }
+    }
+  } while( Thread32Next(hThreadSnap, &te32 ) );
+
+  if( verbose ) {
+      _ftprintf(stderr, TEXT("\n"));
+  }
+
+//  Don't forget to clean up the snapshot object.
+  CloseHandle( hThreadSnap );
+  return( TRUE );
+}
+
+JNIEXPORT void JNICALL Java_jogamp_nativewindow_windows_GDIUtil_SetProcessThreadsAffinityMask0
+  (JNIEnv *env, jclass unused, jlong affinityMask, jboolean verbose)
+{
+    SetProcessThreadsAffinityMask( GetCurrentProcessId(), (DWORD_PTR)(intptr_t)affinityMask, (BOOL)verbose );
+}
+
+#else
+
+JNIEXPORT void JNICALL Java_jogamp_nativewindow_windows_GDIUtil_SetProcessThreadsAffinityMask0
+  (JNIEnv *env, jclass unused, jlong affinityMask, jboolean verbose)
+{
+}
+
+#endif
diff --git a/src/newt/classes/com/jogamp/newt/Display.java b/src/newt/classes/com/jogamp/newt/Display.java
index 4b38fcc..7091060 100644
--- a/src/newt/classes/com/jogamp/newt/Display.java
+++ b/src/newt/classes/com/jogamp/newt/Display.java
@@ -55,10 +55,10 @@ public abstract class Display {
 
     /** return true if obj is of type Display and both FQN {@link #getFQName()} equals */
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if (this == obj) { return true; }
         if (obj instanceof Display) {
-            Display d = (Display)obj;
+            final Display d = (Display)obj;
             return d.getFQName().equals(getFQName());
         }
         return false;
@@ -164,7 +164,7 @@ public abstract class Display {
     }
 
     /**
-     * Returns the native platform's {@link PointerIcon.PixelFormat} for pointer-icon pixel data.
+     * Returns the native platform's {@link PixelFormat} for pointer-icon pixel data.
      * <p>
      * Using this value will avoid conversion within {@link #createPointerIcon(PixelRectangle, int, int)}.
      * </p>
@@ -353,7 +353,7 @@ public abstract class Display {
     protected static final ArrayList<WeakReference<Display>> displayList = new ArrayList<WeakReference<Display>>();
     protected static int displaysActive = 0;
 
-    public static void dumpDisplayList(String prefix) {
+    public static void dumpDisplayList(final String prefix) {
         synchronized(displayList) {
             System.err.println(prefix+" DisplayList[] entries: "+displayList.size()+" - "+getThreadName());
             final Iterator<WeakReference<Display>> ri = displayList.iterator();
@@ -372,7 +372,7 @@ public abstract class Display {
      * @paran shared if true, only shared instances are found, otherwise also exclusive
      * @return
      */
-    public static Display getFirstDisplayOf(String type, String name, int fromIndex, boolean shared) {
+    public static Display getFirstDisplayOf(final String type, final String name, final int fromIndex, final boolean shared) {
         return getDisplayOfImpl(type, name, fromIndex, 1, shared);
     }
 
@@ -384,11 +384,11 @@ public abstract class Display {
      * @paran shared if true, only shared instances are found, otherwise also exclusive
      * @return
      */
-    public static Display getLastDisplayOf(String type, String name, int fromIndex, boolean shared) {
+    public static Display getLastDisplayOf(final String type, final String name, final int fromIndex, final boolean shared) {
         return getDisplayOfImpl(type, name, fromIndex, -1, shared);
     }
 
-    private static Display getDisplayOfImpl(String type, String name, final int fromIndex, final int incr, boolean shared) {
+    private static Display getDisplayOfImpl(final String type, final String name, final int fromIndex, final int incr, final boolean shared) {
         synchronized(displayList) {
             int i = fromIndex >= 0 ? fromIndex : displayList.size() - 1 ;
             while( ( incr > 0 ) ? i < displayList.size() : i >= 0 ) {
@@ -414,7 +414,7 @@ public abstract class Display {
         return null;
     }
 
-    protected static void addDisplay2List(Display display) {
+    protected static void addDisplay2List(final Display display) {
         synchronized(displayList) {
             // GC before add
             int i=0;
@@ -458,15 +458,15 @@ public abstract class Display {
         return Thread.currentThread().getName();
     }
 
-    public static String toHexString(int hex) {
+    public static String toHexString(final int hex) {
         return "0x" + Integer.toHexString(hex);
     }
 
-    public static String toHexString(long hex) {
+    public static String toHexString(final long hex) {
         return "0x" + Long.toHexString(hex);
     }
 
-    public static int hashCodeNullSafe(Object o) {
+    public static int hashCodeNullSafe(final Object o) {
         return ( null != o ) ? o.hashCode() : 0;
     }
 }
diff --git a/src/newt/classes/com/jogamp/newt/MonitorDevice.java b/src/newt/classes/com/jogamp/newt/MonitorDevice.java
index 28d9f53..1261620 100644
--- a/src/newt/classes/com/jogamp/newt/MonitorDevice.java
+++ b/src/newt/classes/com/jogamp/newt/MonitorDevice.java
@@ -33,6 +33,7 @@ import java.util.List;
 import javax.media.nativewindow.util.DimensionImmutable;
 import javax.media.nativewindow.util.Rectangle;
 import javax.media.nativewindow.util.RectangleImmutable;
+import javax.media.nativewindow.util.SurfaceSize;
 
 import com.jogamp.common.util.ArrayHashSet;
 
@@ -52,6 +53,9 @@ import com.jogamp.common.util.ArrayHashSet;
  *     <li>{@link RectangleImmutable} viewport (rotated)</li>
  *   </ul></li>
  * </ul>
+ * <p>
+ * All values of this interface are represented in pixel units, if not stated otherwise.
+ * </p>
  */
 public abstract class MonitorDevice {
     protected final Screen screen; // backref
@@ -61,16 +65,18 @@ public abstract class MonitorDevice {
     protected final ArrayHashSet<MonitorMode> supportedModes; // FIXME: May need to support mutable mode, i.e. adding modes on the fly!
     protected MonitorMode currentMode;
     protected boolean modeChanged;
-    protected Rectangle viewport;
+    protected Rectangle viewportPU; // in pixel units
+    protected Rectangle viewportWU; // in window units
 
-    protected MonitorDevice(Screen screen, int nativeId, DimensionImmutable sizeMM, Rectangle viewport, MonitorMode currentMode, ArrayHashSet<MonitorMode> supportedModes) {
+    protected MonitorDevice(final Screen screen, final int nativeId, final DimensionImmutable sizeMM, final Rectangle viewportPU, final Rectangle viewportWU, final MonitorMode currentMode, final ArrayHashSet<MonitorMode> supportedModes) {
         this.screen = screen;
         this.nativeId = nativeId;
         this.sizeMM = sizeMM;
         this.originalMode = currentMode;
         this.supportedModes = supportedModes;
         this.currentMode = currentMode;
-        this.viewport = viewport;
+        this.viewportPU = viewportPU;
+        this.viewportWU = viewportWU;
         this.modeChanged = false;
     }
 
@@ -88,10 +94,10 @@ public abstract class MonitorDevice {
      * <br>
      */
     @Override
-    public final boolean equals(Object obj) {
+    public final boolean equals(final Object obj) {
         if (this == obj) { return true; }
         if (obj instanceof MonitorDevice) {
-            MonitorDevice md = (MonitorDevice)obj;
+            final MonitorDevice md = (MonitorDevice)obj;
             return md.nativeId == nativeId;
         }
         return false;
@@ -119,6 +125,37 @@ public abstract class MonitorDevice {
     }
 
     /**
+     * Returns the <i>pixels per millimeter</i> value according to the <i>current</i> {@link MonitorMode mode}'s
+     * {@link SurfaceSize#getResolution() surface resolution}.
+     * <p>
+     * To convert the result to <i>dpi</i>, i.e. dots-per-inch, multiply both components with <code>25.4f</code>.
+     * </p>
+     * @param ppmmStore float[2] storage for the ppmm result
+     * @return the passed storage containing the ppmm for chaining
+     */
+    public final float[] getPixelsPerMM(final float[] ppmmStore) {
+        return getPixelsPerMM(getCurrentMode(), ppmmStore);
+    }
+
+    /**
+     * Returns the <i>pixels per millimeter</i> value according to the given {@link MonitorMode mode}'s
+     * {@link SurfaceSize#getResolution() surface resolution}.
+     * <p>
+     * To convert the result to <i>dpi</i>, i.e. dots-per-inch, multiply both components with <code>25.4f</code>.
+     * </p>
+     * @param mode
+     * @param ppmmStore float[2] storage for the ppmm result
+     * @return the passed storage containing the ppmm for chaining
+     */
+    public final float[] getPixelsPerMM(final MonitorMode mode, final float[] ppmmStore) {
+        final DimensionImmutable sdim = getSizeMM();
+        final DimensionImmutable spix = mode.getSurfaceSize().getResolution();
+        ppmmStore[0] = (float)spix.getWidth() / (float)sdim.getWidth();
+        ppmmStore[1] = (float)spix.getHeight() / (float)sdim.getHeight();
+        return ppmmStore;
+    }
+
+    /**
      * Returns the immutable original {@link com.jogamp.newt.MonitorMode}, as used at NEWT initialization.
      * <p>
      * The returned {@link MonitorMode} is element of the lists {@link #getSupportedModes()} and {@link Screen#getMonitorModes()}.
@@ -142,51 +179,72 @@ public abstract class MonitorDevice {
         return supportedModes.getData();
     }
 
-    /** Returns the {@link RectangleImmutable rectangular} portion of the rotated virtual {@link Screen} size represented by this monitor. */
+    /**
+     * Returns the {@link RectangleImmutable rectangular} portion
+     * of the <b>rotated</b> virtual {@link Screen} size in pixel units
+     * represented by this monitor, i.e. top-left origin and size.
+     * @see Screen
+     */
     public final RectangleImmutable getViewport() {
-        return viewport;
+        return viewportPU;
     }
 
-    /** Returns <code>true</code> if given coordinates are contained by this {@link #getViewport() viewport}, otherwise <code>false</code>. */
-    public final boolean contains(int x, int y) {
-        return x >= viewport.getX() &&
-               x <  viewport.getX() + viewport.getWidth() &&
-               y >= viewport.getY() &&
-               y <  viewport.getY() + viewport.getHeight() ;
+    /**
+     * Returns the {@link RectangleImmutable rectangular} portion
+     * of the <b>rotated</b> virtual {@link Screen} size in window units
+     * represented by this monitor, i.e. top-left origin and size.
+     * @see Screen
+     */
+    public final RectangleImmutable getViewportInWindowUnits() {
+        return viewportWU;
     }
 
     /**
-     * Returns the coverage of given rectangle w/ this this {@link #getViewport() viewport}, i.e. between <code>0.0</code> and <code>1.0</code>.
-     * <p>
-     * Coverage is computed by:
-     * <pre>
-     *    isect = viewport.intersection(r);
-     *    coverage = area( isect ) / area( viewport ) ;
-     * </pre>
-     * </p>
+     * Returns <code>true</code> if given screen coordinates in pixel units
+     * are contained by this {@link #getViewport() viewport}, otherwise <code>false</code>.
+     * @param x x-coord in pixel units
+     * @param y y-coord in pixel units
      */
-    public final float coverage(RectangleImmutable r) {
-        return viewport.coverage(r);
+    public final boolean contains(final int x, final int y) {
+        return x >= viewportPU.getX() &&
+               x <  viewportPU.getX() + viewportPU.getWidth() &&
+               y >= viewportPU.getY() &&
+               y <  viewportPU.getY() + viewportPU.getHeight() ;
     }
 
     /**
-     * Returns the union of the given monitor's {@link #getViewport() viewport}.
-     * @param result storage for result, will be returned
+     * Calculates the union of the given monitor's {@link #getViewport() viewport} in pixel- and window units.
+     * @param viewport storage for result in pixel units, maybe null
+     * @param viewportInWindowUnits storage for result in window units, maybe null
      * @param monitors given list of monitors
-     * @return viewport representing the union of given monitor's viewport.
      */
-    public static Rectangle unionOfViewports(final Rectangle result, final List<MonitorDevice> monitors) {
-        int x1=Integer.MAX_VALUE, y1=Integer.MAX_VALUE;
-        int x2=Integer.MIN_VALUE, y2=Integer.MIN_VALUE;
+    public static void unionOfViewports(final Rectangle viewport, final Rectangle viewportInWindowUnits, final List<MonitorDevice> monitors) {
+        int x1PU=Integer.MAX_VALUE, y1PU=Integer.MAX_VALUE;
+        int x2PU=Integer.MIN_VALUE, y2PU=Integer.MIN_VALUE;
+        int x1WU=Integer.MAX_VALUE, y1WU=Integer.MAX_VALUE;
+        int x2WU=Integer.MIN_VALUE, y2WU=Integer.MIN_VALUE;
         for(int i=monitors.size()-1; i>=0; i--) {
-            final RectangleImmutable vp = monitors.get(i).getViewport();
-            x1 = Math.min(x1, vp.getX());
-            x2 = Math.max(x2, vp.getX() + vp.getWidth());
-            y1 = Math.min(y1, vp.getY());
-            y2 = Math.max(y2, vp.getY() + vp.getHeight());
+            if( null != viewport ) {
+                final RectangleImmutable viewPU = monitors.get(i).getViewport();
+                x1PU = Math.min(x1PU, viewPU.getX());
+                x2PU = Math.max(x2PU, viewPU.getX() + viewPU.getWidth());
+                y1PU = Math.min(y1PU, viewPU.getY());
+                y2PU = Math.max(y2PU, viewPU.getY() + viewPU.getHeight());
+            }
+            if( null != viewportInWindowUnits ) {
+                final RectangleImmutable viewWU = monitors.get(i).getViewportInWindowUnits();
+                x1WU = Math.min(x1WU, viewWU.getX());
+                x2WU = Math.max(x2WU, viewWU.getX() + viewWU.getWidth());
+                y1WU = Math.min(y1WU, viewWU.getY());
+                y2WU = Math.max(y2WU, viewWU.getY() + viewWU.getHeight());
+            }
+        }
+        if( null != viewport ) {
+            viewport.set(x1PU, y1PU, x2PU - x1PU, y2PU - y1PU);
+        }
+        if( null != viewportInWindowUnits ) {
+            viewportInWindowUnits.set(x1WU, y1WU, x2WU - x1WU, y2WU - y1WU);
         }
-        result.set(x1, y1, x2 - x1, y2 - y1);
-        return result;
     }
 
     public final boolean isOriginalMode() {
@@ -210,6 +268,7 @@ public abstract class MonitorDevice {
      * <p>
      * The returned {@link MonitorMode} is element of the lists {@link #getSupportedModes()} and {@link Screen#getMonitorModes()}.
      * </p>
+     * @see #queryCurrentMode()
      */
     public final MonitorMode getCurrentMode() {
         return currentMode;
@@ -220,6 +279,7 @@ public abstract class MonitorDevice {
      * <p>
      * The returned {@link MonitorMode} is element of the lists {@link #getSupportedModes()} and {@link Screen#getMonitorModes()}.
      * </p>
+     * @see #getCurrentMode()
      */
     public abstract MonitorMode queryCurrentMode();
 
@@ -232,7 +292,7 @@ public abstract class MonitorDevice {
 
     @Override
     public String toString() {
-        return "Monitor[Id "+Display.toHexString(nativeId)+", "+sizeMM+" mm, viewport "+viewport+ ", orig "+originalMode+", curr "+currentMode+
+        return "Monitor[Id "+Display.toHexString(nativeId)+", "+sizeMM+" mm, viewport "+viewportPU+ " [pixels], "+viewportWU+" [window], orig "+originalMode+", curr "+currentMode+
                ", modeChanged "+modeChanged+", modeCount "+supportedModes.size()+"]";
     }
 }
diff --git a/src/newt/classes/com/jogamp/newt/MonitorMode.java b/src/newt/classes/com/jogamp/newt/MonitorMode.java
index 9690f18..09bc06e 100644
--- a/src/newt/classes/com/jogamp/newt/MonitorMode.java
+++ b/src/newt/classes/com/jogamp/newt/MonitorMode.java
@@ -51,7 +51,7 @@ import com.jogamp.newt.util.MonitorModeUtil;
  *  <ul>
  *    <li>A List of all {@link MonitorDevice}s is accessible via {@link Screen#getMonitorDevices()}.</li>
  *    <li>The main monitor used by a windows is accessible via {@link Window#getMainMonitor()}.</li>
- *    <li>The main monitor covering an arbitrary rectnagle is accessible via {@link Screen#getMainMonitor(RectangleImmutable)}.</li>
+ *    <li>The main monitor covering an arbitrary rectangle is accessible via {@link Screen#getMainMonitor(RectangleImmutable)}.</li>
  *  </ul></li>
  *  <li>The current MonitorMode can be obtained via {@link MonitorDevice#getCurrentMode()}.</li>
  *  <li>The original MonitorMode can be obtained via {@link MonitorDevice#getOriginalMode()}.</li>
@@ -88,8 +88,8 @@ import com.jogamp.newt.util.MonitorModeUtil;
         MonitorMode mmCurrent = monitor.queryCurrentMode();
         MonitorMode mmOrig = monitor.getOriginalMode();
 
-        // Target resolution
-        Dimension res = new Dimension(800, 600);
+        // Target resolution in pixel units
+        DimensionImmutable res = new Dimension(800, 600);
 
         // Target refresh rate shall be similar to current one ..
         float freq = mmCurrent.getRefreshRate();
@@ -115,14 +115,14 @@ public class MonitorMode implements Comparable<MonitorMode> {
     /** Comparator for 2 {@link MonitorMode}s, following comparison order as described in {@link MonitorMode#compareTo(MonitorMode)}, returning the ascending order. */
     public static final Comparator<MonitorMode> monitorModeComparator = new Comparator<MonitorMode>() {
         @Override
-        public int compare(MonitorMode mm1, MonitorMode mm2) {
+        public int compare(final MonitorMode mm1, final MonitorMode mm2) {
             return mm1.compareTo(mm2);
         } };
 
     /** Comparator for 2 {@link MonitorMode}s, following comparison order as described in {@link MonitorMode#compareTo(MonitorMode)}, returning the descending order. */
     public static final Comparator<MonitorMode> monitorModeComparatorInv = new Comparator<MonitorMode>() {
         @Override
-        public int compare(MonitorMode mm1, MonitorMode mm2) {
+        public int compare(final MonitorMode mm1, final MonitorMode mm2) {
             return mm2.compareTo(mm1);
         } };
 
@@ -136,7 +136,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
      * </ul>
      */
     public static class SizeAndRRate implements Comparable<SizeAndRRate> {
-        /** Non rotated surface size */
+        /** Non rotated surface size in pixel units */
         public final SurfaceSize surfaceSize;
         /** Mode bitfield flags, i.e. {@link #FLAG_DOUBLESCAN}, {@link #FLAG_INTERLACE}, .. */
         public final int flags;
@@ -144,7 +144,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
         public final float refreshRate;
         public final int hashCode;
 
-        public SizeAndRRate(SurfaceSize surfaceSize, float refreshRate, int flags) {
+        public SizeAndRRate(final SurfaceSize surfaceSize, final float refreshRate, final int flags) {
             if(null==surfaceSize) {
                 throw new IllegalArgumentException("surfaceSize must be set ("+surfaceSize+")");
             }
@@ -158,7 +158,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
         private final static String STR_DOUBLESCAN = "DoubleScan";
         private final static String STR_SEP = ", ";
 
-        public static final StringBuilder flags2String(int flags) {
+        public static final StringBuilder flags2String(final int flags) {
             final StringBuilder sb = new StringBuilder();
             boolean sp = false;
             if( 0 != ( flags & FLAG_INTERLACE ) ) {
@@ -232,7 +232,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
          * </ul>
          */
         @Override
-        public final boolean equals(Object obj) {
+        public final boolean equals(final Object obj) {
             if (this == obj) { return true; }
             if (obj instanceof SizeAndRRate) {
                 final SizeAndRRate p = (SizeAndRRate)obj;
@@ -288,7 +288,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
     private final int rotation;
     private final int hashCode;
 
-    public static boolean isRotationValid(int rotation) {
+    public static boolean isRotationValid(final int rotation) {
         return rotation == MonitorMode.ROTATE_0 || rotation == MonitorMode.ROTATE_90 ||
                rotation == MonitorMode.ROTATE_180 || rotation == MonitorMode.ROTATE_270 ;
     }
@@ -297,7 +297,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
      * @param sizeAndRRate the surface size and refresh rate mode
      * @param rotation the screen rotation, measured counter clockwise (CCW)
      */
-    public MonitorMode(int nativeId, SizeAndRRate sizeAndRRate, int rotation) {
+    public MonitorMode(final int nativeId, final SizeAndRRate sizeAndRRate, final int rotation) {
         if ( !isRotationValid(rotation) ) {
             throw new RuntimeException("invalid rotation: "+rotation);
         }
@@ -317,7 +317,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
      * @param flags
      * @param rotation
      */
-    public MonitorMode(SurfaceSize surfaceSize, float refreshRate, int flags, int rotation) {
+    public MonitorMode(final SurfaceSize surfaceSize, final float refreshRate, final int flags, final int rotation) {
         this(0, new SizeAndRRate(surfaceSize, refreshRate, flags), rotation);
     }
 
@@ -349,7 +349,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
         return rotation;
     }
 
-    /** Returns the rotated screen width,
+    /** Returns the rotated screen width in pixel units,
      *  derived from <code>getMonitorMode().getSurfaceSize().getResolution()</code>
      *  and <code>getRotation()</code>
      */
@@ -357,7 +357,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
         return getRotatedWH(true);
     }
 
-    /** Returns the rotated screen height,
+    /** Returns the rotated screen height in pixel units,
      *  derived from <code>getMonitorMode().getSurfaceSize().getResolution()</code>
      *  and <code>getRotation()</code>
      */
@@ -416,10 +416,10 @@ public class MonitorMode implements Comparable<MonitorMode> {
      * </ul>
      */
     @Override
-    public final boolean equals(Object obj) {
+    public final boolean equals(final Object obj) {
         if (this == obj) { return true; }
         if (obj instanceof MonitorMode) {
-            MonitorMode sm = (MonitorMode)obj;
+            final MonitorMode sm = (MonitorMode)obj;
             return sm.nativeId == this.nativeId &&
                    sm.sizeAndRRate.equals(sizeAndRRate) &&
                    sm.rotation == this.rotation ;
@@ -447,7 +447,7 @@ public class MonitorMode implements Comparable<MonitorMode> {
         return hash;
     }
 
-    private final int getRotatedWH(boolean width) {
+    private final int getRotatedWH(final boolean width) {
         final DimensionImmutable d = sizeAndRRate.surfaceSize.getResolution();
         final boolean swap = MonitorMode.ROTATE_90 == rotation || MonitorMode.ROTATE_270 == rotation ;
         if ( (  width &&  swap ) || ( !width && !swap ) ) {
diff --git a/src/newt/classes/com/jogamp/newt/NewtFactory.java b/src/newt/classes/com/jogamp/newt/NewtFactory.java
index 9685200..9606fae 100644
--- a/src/newt/classes/com/jogamp/newt/NewtFactory.java
+++ b/src/newt/classes/com/jogamp/newt/NewtFactory.java
@@ -46,6 +46,7 @@ import javax.media.nativewindow.NativeWindow;
 import javax.media.nativewindow.NativeWindowFactory;
 
 import com.jogamp.common.util.IOUtil;
+import com.jogamp.common.util.PropertyAccess;
 
 import jogamp.newt.Debug;
 import jogamp.newt.DisplayImpl;
@@ -66,7 +67,7 @@ public class NewtFactory {
                 NativeWindowFactory.initSingleton(); // last resort ..
                 {
                     /** See API Doc in {@link Window} ! */
-                    final String[] paths = Debug.getProperty("newt.window.icons", true, "newt/data/jogamp-16x16.png newt/data/jogamp-32x32.png").split("\\s");
+                    final String[] paths = PropertyAccess.getProperty("newt.window.icons", true, "newt/data/jogamp-16x16.png newt/data/jogamp-32x32.png").split("\\s");
                     if( paths.length < 2 ) {
                         throw new IllegalArgumentException("Property 'newt.window.icons' did not specify at least two PNG icons, but "+Arrays.toString(paths));
                     }
@@ -95,9 +96,9 @@ public class NewtFactory {
      * Shall reference at least two PNG icons, from lower (16x16) to higher (>= 32x32) resolution.
      * </p>
      */
-    public static void setWindowIcons(IOUtil.ClassResources cres) { defaultWindowIcons = cres; }
+    public static void setWindowIcons(final IOUtil.ClassResources cres) { defaultWindowIcons = cres; }
 
-    public static Class<?> getCustomClass(String packageName, String classBaseName) {
+    public static Class<?> getCustomClass(final String packageName, final String classBaseName) {
         Class<?> clazz = null;
         if(packageName!=null && classBaseName!=null) {
             final String clazzName;
@@ -108,7 +109,7 @@ public class NewtFactory {
             }
             try {
                 clazz = Class.forName(clazzName);
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 if(DEBUG_IMPLEMENTATION) {
                     System.err.println("Warning: Failed to find class <"+clazzName+">: "+t.getMessage());
                     t.printStackTrace();
@@ -125,7 +126,7 @@ public class NewtFactory {
      * The default is enabled.<br>
      * The EventDispatchThread is thread local to the Display instance.<br>
      */
-    public static synchronized void setUseEDT(boolean onoff) {
+    public static synchronized void setUseEDT(final boolean onoff) {
         useEDT = onoff;
     }
 
@@ -144,7 +145,7 @@ public class NewtFactory {
      *        see {@link AbstractGraphicsDevice#getConnection()}. Use <code>null</code> for default.
      * @return the new or reused Display instance
      */
-    public static Display createDisplay(String name) {
+    public static Display createDisplay(final String name) {
         return createDisplay(name, true);
     }
 
@@ -162,7 +163,7 @@ public class NewtFactory {
      * @param reuse attempt to reuse an existing Display with same <code>name</code> if set true, otherwise create a new instance.
      * @return the new or reused Display instance
      */
-    public static Display createDisplay(String name, boolean reuse) {
+    public static Display createDisplay(final String name, final boolean reuse) {
       return DisplayImpl.create(NativeWindowFactory.getNativeWindowType(true), name, 0, reuse);
     }
 
@@ -179,7 +180,7 @@ public class NewtFactory {
      *        see {@link AbstractGraphicsDevice#getConnection()}. Use <code>null</code> for default.
      * @return the new or reused Display instance
      */
-    public static Display createDisplay(String type, String name) {
+    public static Display createDisplay(final String type, final String name) {
         return createDisplay(type, name, true);
     }
 
@@ -198,7 +199,7 @@ public class NewtFactory {
      * @param reuse attempt to reuse an existing Display with same <code>name</code> if set true, otherwise create a new instance.
      * @return the new or reused Display instance
      */
-    public static Display createDisplay(String type, String name, boolean reuse) {
+    public static Display createDisplay(final String type, final String name, final boolean reuse) {
       return DisplayImpl.create(type, name, 0, reuse);
     }
 
@@ -212,7 +213,7 @@ public class NewtFactory {
      * and {@link Display#removeReference()}.
      * </p>
      */
-    public static Screen createScreen(Display display, int index) {
+    public static Screen createScreen(final Display display, final int index) {
       return ScreenImpl.create(display, index);
     }
 
@@ -229,7 +230,7 @@ public class NewtFactory {
      * and {@link Screen#removeReference()}.
      * </p>
      */
-    public static Window createWindow(CapabilitiesImmutable caps) {
+    public static Window createWindow(final CapabilitiesImmutable caps) {
         return createWindowImpl(NativeWindowFactory.getNativeWindowType(true), caps);
     }
 
@@ -243,7 +244,7 @@ public class NewtFactory {
      * and {@link Screen#removeReference()}.
      * </p>
      */
-    public static Window createWindow(Screen screen, CapabilitiesImmutable caps) {
+    public static Window createWindow(final Screen screen, final CapabilitiesImmutable caps) {
         return WindowImpl.create(null, 0, screen, caps);
     }
 
@@ -269,7 +270,7 @@ public class NewtFactory {
      *
      * @param parentWindowObject either a NativeWindow instance
      */
-    public static Window createWindow(NativeWindow parentWindow, CapabilitiesImmutable caps) {
+    public static Window createWindow(final NativeWindow parentWindow, final CapabilitiesImmutable caps) {
         final String type = NativeWindowFactory.getNativeWindowType(true);
         if( null == parentWindow ) {
             return createWindowImpl(type, caps);
@@ -283,14 +284,14 @@ public class NewtFactory {
             screen = newtParentWindow.getScreen();
         } else {
             // create a Display/Screen compatible to the NativeWindow
-            AbstractGraphicsConfiguration parentConfig = parentWindow.getGraphicsConfiguration();
+            final AbstractGraphicsConfiguration parentConfig = parentWindow.getGraphicsConfiguration();
             if(null!=parentConfig) {
-                AbstractGraphicsScreen parentScreen = parentConfig.getScreen();
-                AbstractGraphicsDevice parentDevice = parentScreen.getDevice();
-                Display display = NewtFactory.createDisplay(type, parentDevice.getHandle(), true);
+                final AbstractGraphicsScreen parentScreen = parentConfig.getScreen();
+                final AbstractGraphicsDevice parentDevice = parentScreen.getDevice();
+                final Display display = NewtFactory.createDisplay(type, parentDevice.getHandle(), true);
                 screen  = NewtFactory.createScreen(display, parentScreen.getIndex());
             } else {
-                Display display = NewtFactory.createDisplay(type, null, true); // local display
+                final Display display = NewtFactory.createDisplay(type, null, true); // local display
                 screen  = NewtFactory.createScreen(display, 0); // screen 0
             }
         }
@@ -304,9 +305,9 @@ public class NewtFactory {
         return win;
     }
 
-    private static Window createWindowImpl(String type, CapabilitiesImmutable caps) {
-        Display display = NewtFactory.createDisplay(type, null, true); // local display
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+    private static Window createWindowImpl(final String type, final CapabilitiesImmutable caps) {
+        final Display display = NewtFactory.createDisplay(type, null, true); // local display
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         return WindowImpl.create(null, 0, screen, caps);
     }
 
@@ -319,10 +320,10 @@ public class NewtFactory {
      * @param caps the desired capabilities
      * @return
      */
-    public static Window createWindow(String displayConnection, int screenIdx, long parentWindowHandle, CapabilitiesImmutable caps) {
+    public static Window createWindow(final String displayConnection, final int screenIdx, final long parentWindowHandle, final CapabilitiesImmutable caps) {
         final String type = NativeWindowFactory.getNativeWindowType(true);
-        Display display = NewtFactory.createDisplay(type, displayConnection, true);
-        Screen screen  = NewtFactory.createScreen(display, screenIdx);
+        final Display display = NewtFactory.createDisplay(type, displayConnection, true);
+        final Screen screen  = NewtFactory.createScreen(display, screenIdx);
         return WindowImpl.create(null, parentWindowHandle, screen, caps);
     }
 
@@ -333,26 +334,26 @@ public class NewtFactory {
      *
      * @param undecorated only impacts if the window is in top-level state, while attached to a parent window it's rendered undecorated always
      */
-    public static Window createWindow(Object[] cstrArguments, Screen screen, CapabilitiesImmutable caps) {
+    public static Window createWindow(final Object[] cstrArguments, final Screen screen, final CapabilitiesImmutable caps) {
         return WindowImpl.create(cstrArguments, screen, caps);
     }
 
     /**
      * Instantiate a Display entity using the native handle.
      */
-    public static Display createDisplay(String type, long handle, boolean reuse) {
+    public static Display createDisplay(final String type, final long handle, final boolean reuse) {
       return DisplayImpl.create(type, null, handle, reuse);
     }
 
-    public static boolean isScreenCompatible(NativeWindow parent, Screen childScreen) {
+    public static boolean isScreenCompatible(final NativeWindow parent, final Screen childScreen) {
       // Get parent's NativeWindow details
-      AbstractGraphicsConfiguration parentConfig = parent.getGraphicsConfiguration();
-      AbstractGraphicsScreen parentScreen = parentConfig.getScreen();
-      AbstractGraphicsDevice parentDevice = parentScreen.getDevice();
+      final AbstractGraphicsConfiguration parentConfig = parent.getGraphicsConfiguration();
+      final AbstractGraphicsScreen parentScreen = parentConfig.getScreen();
+      final AbstractGraphicsDevice parentDevice = parentScreen.getDevice();
 
-      DisplayImpl childDisplay = (DisplayImpl) childScreen.getDisplay();
-      String parentDisplayName = childDisplay.validateDisplayName(null, parentDevice.getHandle());
-      String childDisplayName = childDisplay.getName();
+      final DisplayImpl childDisplay = (DisplayImpl) childScreen.getDisplay();
+      final String parentDisplayName = childDisplay.validateDisplayName(null, parentDevice.getHandle());
+      final String childDisplayName = childDisplay.getName();
       if( ! parentDisplayName.equals( childDisplayName ) ) {
         return false;
       }
@@ -363,23 +364,23 @@ public class NewtFactory {
       return true;
     }
 
-    public static Screen createCompatibleScreen(NativeWindow parent) {
+    public static Screen createCompatibleScreen(final NativeWindow parent) {
       return createCompatibleScreen(parent, null);
     }
 
-    public static Screen createCompatibleScreen(NativeWindow parent, Screen childScreen) {
+    public static Screen createCompatibleScreen(final NativeWindow parent, final Screen childScreen) {
       // Get parent's NativeWindow details
-      AbstractGraphicsConfiguration parentConfig = parent.getGraphicsConfiguration();
-      AbstractGraphicsScreen parentScreen = parentConfig.getScreen();
-      AbstractGraphicsDevice parentDevice = parentScreen.getDevice();
+      final AbstractGraphicsConfiguration parentConfig = parent.getGraphicsConfiguration();
+      final AbstractGraphicsScreen parentScreen = parentConfig.getScreen();
+      final AbstractGraphicsDevice parentDevice = parentScreen.getDevice();
 
       if(null != childScreen) {
         // check if child Display/Screen is compatible already
-        DisplayImpl childDisplay = (DisplayImpl) childScreen.getDisplay();
-        String parentDisplayName = childDisplay.validateDisplayName(null, parentDevice.getHandle());
-        String childDisplayName = childDisplay.getName();
-        boolean displayEqual = parentDisplayName.equals( childDisplayName );
-        boolean screenEqual = parentScreen.getIndex() == childScreen.getIndex();
+        final DisplayImpl childDisplay = (DisplayImpl) childScreen.getDisplay();
+        final String parentDisplayName = childDisplay.validateDisplayName(null, parentDevice.getHandle());
+        final String childDisplayName = childDisplay.getName();
+        final boolean displayEqual = parentDisplayName.equals( childDisplayName );
+        final boolean screenEqual = parentScreen.getIndex() == childScreen.getIndex();
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("NewtFactory.createCompatibleScreen: Display: "+
                 parentDisplayName+" =? "+childDisplayName+" : "+displayEqual+"; Screen: "+
@@ -393,7 +394,7 @@ public class NewtFactory {
 
       // Prep NEWT's Display and Screen according to the parent
       final String type = NativeWindowFactory.getNativeWindowType(true);
-      Display display = NewtFactory.createDisplay(type, parentDevice.getHandle(), true);
+      final Display display = NewtFactory.createDisplay(type, parentDevice.getHandle(), true);
       return NewtFactory.createScreen(display, parentScreen.getIndex());
     }
 }
diff --git a/src/newt/classes/com/jogamp/newt/NewtVersion.java b/src/newt/classes/com/jogamp/newt/NewtVersion.java
index e70d63f..f4cdee4 100644
--- a/src/newt/classes/com/jogamp/newt/NewtVersion.java
+++ b/src/newt/classes/com/jogamp/newt/NewtVersion.java
@@ -38,7 +38,7 @@ public class NewtVersion extends JogampVersion {
 
     protected static volatile NewtVersion jogampCommonVersionInfo;
 
-    protected NewtVersion(String packageName, Manifest mf) {
+    protected NewtVersion(final String packageName, final Manifest mf) {
         super(packageName, mf);
     }
 
@@ -56,7 +56,7 @@ public class NewtVersion extends JogampVersion {
         return jogampCommonVersionInfo;
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         System.err.println(VersionUtil.getPlatformInfo());
         System.err.println(GlueGenVersion.getInstance());
         System.err.println(NativeWindowVersion.getInstance());
diff --git a/src/newt/classes/com/jogamp/newt/Screen.java b/src/newt/classes/com/jogamp/newt/Screen.java
index ef62ec9..0ba5579 100644
--- a/src/newt/classes/com/jogamp/newt/Screen.java
+++ b/src/newt/classes/com/jogamp/newt/Screen.java
@@ -28,12 +28,14 @@
 package com.jogamp.newt;
 
 import com.jogamp.newt.event.MonitorModeListener;
+
 import jogamp.newt.Debug;
 
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.List;
+
 import javax.media.nativewindow.AbstractGraphicsScreen;
 import javax.media.nativewindow.NativeWindowException;
 import javax.media.nativewindow.util.Rectangle;
@@ -41,7 +43,18 @@ import javax.media.nativewindow.util.RectangleImmutable;
 
 /**
  * A screen may span multiple {@link MonitorDevice}s representing their combined virtual size.
- */
+ * <p>
+ * All values of this interface are represented in pixel units, if not stated otherwise.
+ * </p>
+ *
+ * <a name="coordinateSystem"><h5>Coordinate System</h5></a>
+ * <p>
+ *  <ul>
+ *      <li>Screen space has it's origin in the top-left corner, and may not be at 0/0.</li>
+ *      <li>{@link #getViewport() Virtual viewport} covers all {@link MonitorDevice}s {@link MonitorDevice#getViewport() viewports} and has it's origin in the top-left corner, and may not be at 0/0.</li>
+ *  </ul>
+ * </p>
+*/
 public abstract class Screen {
 
     /**
@@ -58,10 +71,10 @@ public abstract class Screen {
 
     /** return true if obj is of type Display and both FQN {@link #getFQName()} equals */
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if (this == obj) { return true; }
         if (obj instanceof Screen) {
-            Screen s = (Screen)obj;
+            final Screen s = (Screen)obj;
             return s.getFQName().equals(getFQName());
         }
         return false;
@@ -131,31 +144,46 @@ public abstract class Screen {
     public abstract int getIndex();
 
     /**
-     * @return the x position of the virtual viewport's top-left origin.
+     * See <a href="#coordinateSystem"> Coordinate System</a>.
+     *
+     * @return the x position of the virtual viewport's top-left origin in pixel units.
      */
     public abstract int getX();
 
     /**
-     * @return the y position of the virtual viewport's top-left origin.
+     * See <a href="#coordinateSystem"> Coordinate System</a>.
+     *
+     * @return the y position of the virtual viewport's top-left origin in pixel units.
      */
     public abstract int getY();
 
     /**
-     * @return the <b>rotated</b> virtual viewport's width.
+     * @return the <b>rotated</b> virtual viewport's width in pixel units.
      */
     public abstract int getWidth();
 
     /**
-     * @return the <b>rotated</b> virtual viewport's height.
+     * @return the <b>rotated</b> virtual viewport's height in pixel units.
      */
     public abstract int getHeight();
 
     /**
-     * @return the <b>rotated</b> virtual viewport, i.e. origin and size.
+     * See <a href="#coordinateSystem"> Coordinate System</a>.
+     *
+     * @return the <b>rotated</b> virtual viewport, i.e. top-left origin and size, in pixel units.
+     * @see #getViewportInWindowUnits()
      */
     public abstract RectangleImmutable getViewport();
 
     /**
+     * See <a href="#coordinateSystem"> Coordinate System</a>.
+     *
+     * @return the <b>rotated</b> virtual viewport, i.e. top-left origin and size, in window units.
+     * @see #getViewport()
+     */
+    public abstract RectangleImmutable getViewportInWindowUnits();
+
+    /**
      * @return the associated Display
      */
     public abstract Display getDisplay();
@@ -181,19 +209,20 @@ public abstract class Screen {
     public abstract List<MonitorDevice> getMonitorDevices();
 
     /**
-     * Returns the {@link MonitorDevice} which {@link MonitorDevice#getViewport() viewport}
-     * {@link MonitorDevice#coverage(RectangleImmutable) covers} the given rectangle the most.
+     * Returns the {@link MonitorDevice} with the highest {@link MonitorDevice#getViewportInWindowUnits() viewport}
+     * {@link RectangleImmutable#coverage(RectangleImmutable) coverage} of the given rectangle in window units.
      * <p>
      * If no coverage is detected the first {@link MonitorDevice} is returned.
      * </p>
+     * @param r arbitrary rectangle in window units
      */
-    public final MonitorDevice getMainMonitor(RectangleImmutable r) {
+    public final MonitorDevice getMainMonitor(final RectangleImmutable r) {
         MonitorDevice res = null;
         float maxCoverage = Float.MIN_VALUE;
         final List<MonitorDevice> monitors = getMonitorDevices();
         for(int i=monitors.size()-1; i>=0; i--) {
             final MonitorDevice monitor = monitors.get(i);
-            final float coverage = monitor.coverage(r);
+            final float coverage = monitor.getViewportInWindowUnits().coverage(r);
             if( coverage > maxCoverage ) {
                 maxCoverage = coverage;
                 res = monitor;
@@ -206,15 +235,16 @@ public abstract class Screen {
     }
 
     /**
-     * Returns the union of all monitor's {@link MonitorDevice#getViewport() viewport}.
+     * Calculates the union of all monitor's {@link MonitorDevice#getViewport() viewport} in pixel- and window units.
      * <p>
      * Should be equal to {@link #getX()}, {@link #getY()}, {@link #getWidth()} and {@link #getHeight()},
      * however, some native toolkits may choose a different virtual screen area.
      * </p>
-     * @param result storage for result, will be returned
+     * @param viewport storage for result in pixel units, maybe null
+     * @param viewportInWindowUnits storage for result in window units, maybe null
      */
-    public final Rectangle unionOfMonitorViewportSize(final Rectangle result) {
-        return MonitorDevice.unionOfViewports(result, getMonitorDevices());
+    public final void unionOfMonitorViewports(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
+        MonitorDevice.unionOfViewports(viewport, viewportInWindowUnits, getMonitorDevices());
     }
 
     /**
@@ -238,7 +268,7 @@ public abstract class Screen {
      * @param fromIndex start index, then increasing until found or end of list     *
      * @return
      */
-    public static Screen getFirstScreenOf(Display display, int idx, int fromIndex) {
+    public static Screen getFirstScreenOf(final Display display, final int idx, final int fromIndex) {
         return getScreenOfImpl(display, idx, fromIndex, 1);
     }
 
@@ -249,15 +279,15 @@ public abstract class Screen {
      * @param fromIndex start index, then decreasing until found or end of list. -1 is interpreted as size - 1.
      * @return
      */
-    public static Screen getLastScreenOf(Display display, int idx, int fromIndex) {
+    public static Screen getLastScreenOf(final Display display, final int idx, final int fromIndex) {
         return getScreenOfImpl(display, idx, fromIndex, -1);
     }
 
-    private static Screen getScreenOfImpl(Display display, int idx, int fromIndex, int incr) {
+    private static Screen getScreenOfImpl(final Display display, final int idx, final int fromIndex, final int incr) {
         synchronized(screenList) {
             int i = fromIndex >= 0 ? fromIndex : screenList.size() - 1 ;
             while( ( incr > 0 ) ? i < screenList.size() : i >= 0 ) {
-                final Screen screen = (Screen) screenList.get(i).get();
+                final Screen screen = screenList.get(i).get();
                 if( null == screen ) {
                     // Clear GC'ed dead reference entry!
                     screenList.remove(i);
@@ -277,7 +307,7 @@ public abstract class Screen {
         return null;
     }
 
-    protected static void addScreen2List(Screen screen) {
+    protected static void addScreen2List(final Screen screen) {
         synchronized(screenList) {
             // GC before add
             int i=0;
diff --git a/src/newt/classes/com/jogamp/newt/Window.java b/src/newt/classes/com/jogamp/newt/Window.java
index 4816e62..ec6d767 100644
--- a/src/newt/classes/com/jogamp/newt/Window.java
+++ b/src/newt/classes/com/jogamp/newt/Window.java
@@ -45,8 +45,11 @@ import jogamp.newt.WindowImpl;
 import javax.media.nativewindow.CapabilitiesChooser;
 import javax.media.nativewindow.CapabilitiesImmutable;
 import javax.media.nativewindow.NativeWindow;
+import javax.media.nativewindow.ScalableSurface;
 import javax.media.nativewindow.WindowClosingProtocol;
+import javax.media.nativewindow.util.Rectangle;
 import javax.media.nativewindow.util.RectangleImmutable;
+import javax.media.nativewindow.util.SurfaceSize;
 
 /**
  * Specifying NEWT's Window functionality:
@@ -63,6 +66,20 @@ import javax.media.nativewindow.util.RectangleImmutable;
  * window operation to an instance of this interface while providing OpenGL
  * functionality.
  * </p>
+ * <p>
+ * All values of this interface are represented in window units, if not stated otherwise.
+ * </p>
+ *
+ * <a name="coordinateSystem"><h5>Coordinate System</h5></a>
+ * <p>
+ *  <ul>
+ *      <li>Screen space has it's origin in the top-left corner, and may not be at 0/0.</li>
+ *      <li>Window origin is in it's top-left corner, see {@link #getX()} and {@link #getY()}. </li>
+ *      <li>Window client-area excludes {@link #getInsets() insets}, i.e. window decoration.</li>
+ *      <li>Window origin is relative to it's parent window if exist, or the screen position (top-level).</li>
+ *  </ul>
+ *  See {@link NativeWindow} and {@link Screen}.
+ * </p>
  * <a name="customwindowicons"><h5>Custom Window Icons</h5></a>
  * <p>
  * Custom window icons can be defined via system property <code>newt.window.icons</code>,
@@ -79,7 +96,7 @@ import javax.media.nativewindow.util.RectangleImmutable;
  * </pre>
  * </p>
  */
-public interface Window extends NativeWindow, WindowClosingProtocol {
+public interface Window extends NativeWindow, WindowClosingProtocol, ScalableSurface {
     public static final boolean DEBUG_MOUSE_EVENT = Debug.debug("Window.MouseEvent");
     public static final boolean DEBUG_KEY_EVENT = Debug.debug("Window.KeyEvent");
     public static final boolean DEBUG_IMPLEMENTATION = Debug.debug("Window");
@@ -106,8 +123,8 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
     Screen getScreen();
 
     /**
-     * Returns the {@link MonitorDevice} which {@link MonitorDevice#getViewport() viewport}
-     * {@link MonitorDevice#coverage(RectangleImmutable) covers} this window the most.
+     * Returns the {@link MonitorDevice} with the highest {@link MonitorDevice#getViewportInWindowUnits() viewport}
+     * {@link RectangleImmutable#coverage(RectangleImmutable) coverage} of this window.
      * <p>
      * If no coverage is detected the first {@link MonitorDevice} is returned.
      * </p>
@@ -232,7 +249,33 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
     //
 
     /**
-     * Sets the size of the window's client area, excluding decorations.
+     * Returns a newly created {@link Rectangle} containing window origin, {@link #getX()} & {@link #getY()},
+     * and size, {@link #getWidth()} & {@link #getHeight()}, in window units.
+     */
+    Rectangle getBounds();
+
+    /**
+     * Returns the <i>pixels per millimeter</i> of this window's {@link NativeSurface}
+     * according to the {@link #getMainMonitor() main monitor}'s <i>current</i> {@link MonitorMode mode}'s
+     * {@link SurfaceSize#getResolution() surface resolution}.
+     * <p>
+     * Method takes the {@link #getCurrentSurfaceScale(int[]) current surface-scale} and {@link #getNativeSurfaceScale(int[]) native surface-scale}
+     * into account, i.e.:
+     * <pre>
+     *    surfacePpMM = monitorPpMM * currentSurfaceScale / nativeSurfaceScale,
+     *    with PpMM == pixel per millimeter
+     * </pre>
+     * </p>
+     * <p>
+     * To convert the result to <i>dpi</i>, i.e. dots-per-inch, multiply both components with <code>25.4f</code>.
+     * </p>
+     * @param ppmmStore float[2] storage for the ppmm result
+     * @return the passed storage containing the ppmm for chaining
+     */
+    float[] getPixelsPerMM(final float[] ppmmStore);
+
+    /**
+     * Sets the size of the window's client area in window units, excluding decorations.
      *
      * <p>
      * Zero size semantics are respected, see {@link #setVisible(boolean)}:<br>
@@ -248,22 +291,54 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
      * <p>
      * This call is ignored if in fullscreen mode.<br></p>
      *
-     * @param width of the window's client area
-     * @param height of the window's client area
+     * @param width of the window's client area in window units
+     * @param height of the window's client area in window units
      *
+     * @see #setSurfaceSize(int, int)
+     * @see #setTopLevelSize(int, int)
      * @see #getInsets()
      */
     void setSize(int width, int height);
 
     /**
-     * Sets the size of the top-level window including insets (window decorations).
+     * Sets the size of the window's surface in pixel units which claims the window's client area excluding decorations.
+     *
+     * <p>
+     * In multiple monitor mode, setting the window's surface size in pixel units
+     * might not be possible due to unknown <i>scale</i> values of the target display.
+     * Hence re-setting the pixel unit size after window creation is recommended.
+     * </p>
+     * <p>
+     * Zero size semantics are respected, see {@link #setVisible(boolean)}:<br>
+     * <pre>
+     * if ( visible && 0 != windowHandle && ( 0 ≥ width || 0 ≥ height ) ) {
+     *   setVisible(false);
+     * } else if ( visible && 0 == windowHandle && 0 < width && 0 < height ) {
+     *   setVisible(true);
+     * } else {
+     *   // as expected ..
+     * }
+     * </pre></p>
+     * <p>
+     * This call is ignored if in fullscreen mode.<br></p>
+     *
+     * @param pixelWidth of the window's client area in pixel units
+     * @param pixelHeight of the window's client area in pixel units
+     *
+     * @see #setSize(int, int)
+     * @see #getInsets()
+     */
+    void setSurfaceSize(int pixelWidth, int pixelHeight);
+
+    /**
+     * Sets the size of the top-level window including insets (window decorations) in window units.
      *
      * <p>
      * Note: Insets (if supported) are available only after the window is set visible and hence has been created.
      * </p>
      *
-     * @param width of the top-level window area
-     * @param height of the top-level window area
+     * @param width of the top-level window area in window units
+     * @param height of the top-level window area in window units
      *
      * @see #setSize(int, int)
      * @see #getInsets()
@@ -271,19 +346,19 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
     void setTopLevelSize(int width, int height);
 
     /**
-     * Sets the location of the window's client area, excluding insets (window decorations).<br>
+     * Sets the location of the window's client area excluding insets (window decorations) in window units.<br>
      *
      * This call is ignored if in fullscreen mode.<br>
      *
-     * @param x coord of the client-area's top left corner
-     * @param y coord of the client-area's top left corner
+     * @param x coord of the client-area's top left corner in window units
+     * @param y coord of the client-area's top left corner in window units
      *
      * @see #getInsets()
      */
     void setPosition(int x, int y);
 
     /**
-     * Sets the location of the top-level window inclusive insets (window decorations).<br>
+     * Sets the location of the top-level window inclusive insets (window decorations) in window units.<br>
      *
      * <p>
      * Note: Insets (if supported) are available only after the window is set visible and hence has been created.
@@ -291,8 +366,8 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
      *
      * This call is ignored if in fullscreen mode.<br>
      *
-     * @param x coord of the top-level left corner
-     * @param y coord of the top-level left corner
+     * @param x coord of the top-level left corner in window units
+     * @param y coord of the top-level left corner in window units
      *
      * @see #setPosition(int, int)
      * @see #getInsets()
@@ -356,10 +431,10 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
     void confinePointer(boolean confine);
 
     /**
-     * Moves the pointer to x/y relative to this window's origin.
+     * Moves the pointer to x/y relative to this window's origin in pixel units.
      *
-     * @param x relative pointer x position within this window
-     * @param y relative pointer y position within this window
+     * @param x relative pointer x position within this window in pixel units
+     * @param y relative pointer y position within this window in pixel units
      *
      * @see #confinePointer(boolean)
      */
@@ -397,42 +472,8 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
      * this window is added to it's list of children.<br></P>
      *
      * @param newParent The new parent NativeWindow. If null, this Window becomes a top level window.
-     *
-     * @return The issued reparent action type (strategy) as defined in Window.ReparentAction
-     * @see #reparentWindow(NativeWindow, int, int, boolean)
-     * @deprecated Use {@link #reparentWindow(NativeWindow, int, int, int)}
-     */
-    ReparentOperation reparentWindow(NativeWindow newParent);
-
-    /**
-     * Change this window's parent window.<br>
-     * <P>
-     * In case the old parent is not null and a Window,
-     * this window is removed from it's list of children.<br>
-     * In case the new parent is not null and a Window,
-     * this window is added to it's list of children.<br></P>
-     *
-     * @param newParent The new parent NativeWindow. If null, this Window becomes a top level window.
-     * @param x new top-level position, use -1 for default position.
-     * @param y new top-level position, use -1 for default position.
-     * @param forceDestroyCreate if true, uses re-creation strategy for reparenting, default is <code>false</code>.
-     *
-     * @return The issued reparent action type (strategy) as defined in Window.ReparentAction
-     * @deprecated Use {@link #reparentWindow(NativeWindow, int, int, int)}
-     */
-    ReparentOperation reparentWindow(NativeWindow newParent, int x, int y, boolean forceDestroyCreate);
-
-    /**
-     * Change this window's parent window.<br>
-     * <P>
-     * In case the old parent is not null and a Window,
-     * this window is removed from it's list of children.<br>
-     * In case the new parent is not null and a Window,
-     * this window is added to it's list of children.<br></P>
-     *
-     * @param newParent The new parent NativeWindow. If null, this Window becomes a top level window.
-     * @param x new top-level position, use -1 for default position.
-     * @param y new top-level position, use -1 for default position.
+     * @param x new top-level position in window units, use -1 for default position.
+     * @param y new top-level position in window units, use -1 for default position.
      * @param hints May contain hints (bitfield values) like {@link #REPARENT_HINT_FORCE_RECREATION} or {@link #REPARENT_HINT_BECOMES_VISIBLE}.
      *
      * @return The issued reparent action type (strategy) as defined in Window.ReparentAction
@@ -520,8 +561,20 @@ public interface Window extends NativeWindow, WindowClosingProtocol {
      */
     void requestFocus(boolean wait);
 
+    /**
+     * Trigger window repaint while passing the dirty region in pixel units.
+     * @param x dirty-region y-pos in pixel units
+     * @param y dirty-region x-pos in pixel units
+     * @param width dirty-region width in pixel units
+     * @param height dirty-region height in pixel units
+     */
     void windowRepaint(int x, int y, int width, int height);
 
+    /**
+     * Enqueues a {@link com.jogamp.newt.event.NEWTEvent NEWT event}.
+     * @param wait Passing <code>true</code> will block until the event has been processed, otherwise method returns immediately.
+     * @param event The {@link com.jogamp.newt.event.NEWTEvent event} to enqueue.
+     */
     void enqueueEvent(boolean wait, com.jogamp.newt.event.NEWTEvent event);
 
     void runOnEDTIfAvail(boolean wait, final Runnable task);
diff --git a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
index f0cc689..397c810 100644
--- a/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
+++ b/src/newt/classes/com/jogamp/newt/awt/NewtCanvasAWT.java
@@ -53,6 +53,7 @@ import javax.media.nativewindow.WindowClosingProtocol;
 import javax.media.opengl.GLAnimatorControl;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLCapabilitiesImmutable;
 import javax.media.opengl.GLDrawable;
 import javax.media.opengl.GLDrawableFactory;
 import javax.swing.MenuSelectionManager;
@@ -104,7 +105,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
     private boolean newtChildAttached = false;
     private boolean isOnscreen = true;
     private WindowClosingMode newtChildCloseOp;
-    private final AWTParentWindowAdapter awtAdapter;
+    private final AWTParentWindowAdapter awtWinAdapter;
     private final AWTAdapter awtMouseAdapter;
     private final AWTAdapter awtKeyAdapter;
 
@@ -140,47 +141,47 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
         super();
         awtMouseAdapter = new AWTMouseAdapter().addTo(this);
         awtKeyAdapter = new AWTKeyAdapter().addTo(this);
-        awtAdapter = (AWTParentWindowAdapter) new AWTParentWindowAdapter().addTo(this);
-        awtAdapter.removeWindowClosingFrom(this); // we utilize AWTWindowClosingProtocol triggered destruction!
+        awtWinAdapter = (AWTParentWindowAdapter) new AWTParentWindowAdapter().addTo(this);
+        awtWinAdapter.removeWindowClosingFrom(this); // we utilize AWTWindowClosingProtocol triggered destruction!
     }
 
     /**
      * Instantiates a NewtCanvas without a NEWT child.<br>
      */
-    public NewtCanvasAWT(GraphicsConfiguration gc) {
+    public NewtCanvasAWT(final GraphicsConfiguration gc) {
         super(gc);
         awtMouseAdapter = new AWTMouseAdapter().addTo(this);
         awtKeyAdapter = new AWTKeyAdapter().addTo(this);
-        awtAdapter = (AWTParentWindowAdapter) new AWTParentWindowAdapter().addTo(this);
-        awtAdapter.removeWindowClosingFrom(this); // we utilize AWTWindowClosingProtocol triggered destruction!
+        awtWinAdapter = (AWTParentWindowAdapter) new AWTParentWindowAdapter().addTo(this);
+        awtWinAdapter.removeWindowClosingFrom(this); // we utilize AWTWindowClosingProtocol triggered destruction!
     }
 
     /**
      * Instantiates a NewtCanvas with a NEWT child.
      */
-    public NewtCanvasAWT(Window child) {
+    public NewtCanvasAWT(final Window child) {
         super();
         awtMouseAdapter = new AWTMouseAdapter().addTo(this);
         awtKeyAdapter = new AWTKeyAdapter().addTo(this);
-        awtAdapter = (AWTParentWindowAdapter) new AWTParentWindowAdapter().addTo(this);
-        awtAdapter.removeWindowClosingFrom(this); // we utilize AWTWindowClosingProtocol triggered destruction!
+        awtWinAdapter = (AWTParentWindowAdapter) new AWTParentWindowAdapter().addTo(this);
+        awtWinAdapter.removeWindowClosingFrom(this); // we utilize AWTWindowClosingProtocol triggered destruction!
         setNEWTChild(child);
     }
 
     /**
      * Instantiates a NewtCanvas with a NEWT child.
      */
-    public NewtCanvasAWT(GraphicsConfiguration gc, Window child) {
+    public NewtCanvasAWT(final GraphicsConfiguration gc, final Window child) {
         super(gc);
         awtMouseAdapter = new AWTMouseAdapter().addTo(this);
         awtKeyAdapter = new AWTKeyAdapter().addTo(this);
-        awtAdapter = (AWTParentWindowAdapter) new AWTParentWindowAdapter().addTo(this);
-        awtAdapter.removeWindowClosingFrom(this); // we utilize AWTWindowClosingProtocol triggered destruction!
+        awtWinAdapter = (AWTParentWindowAdapter) new AWTParentWindowAdapter().addTo(this);
+        awtWinAdapter.removeWindowClosingFrom(this); // we utilize AWTWindowClosingProtocol triggered destruction!
         setNEWTChild(child);
     }
 
     @Override
-    public void setShallUseOffscreenLayer(boolean v) {
+    public void setShallUseOffscreenLayer(final boolean v) {
         shallUseOffscreenLayer = v;
     }
 
@@ -253,11 +254,11 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
     };
     private final WindowListener clearAWTMenusOnNewtFocus = new WindowAdapter() {
           @Override
-          public void windowResized(WindowEvent e) {
+          public void windowResized(final WindowEvent e) {
               updateLayoutSize();
           }
           @Override
-          public void windowGainedFocus(WindowEvent arg0) {
+          public void windowGainedFocus(final WindowEvent arg0) {
               if( isParent() && !isFullscreen() ) {
                   AWTEDTExecutor.singleton.invoke(false, awtClearSelectedMenuPath);
               }
@@ -266,19 +267,19 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
 
     class FocusTraversalKeyListener implements KeyListener {
          @Override
-         public void keyPressed(KeyEvent e) {
+         public void keyPressed(final KeyEvent e) {
              if( isParent() && !isFullscreen() ) {
                  handleKey(e, false);
              }
          }
          @Override
-         public void keyReleased(KeyEvent e) {
+         public void keyReleased(final KeyEvent e) {
              if( isParent() && !isFullscreen() ) {
                  handleKey(e, true);
              }
          }
 
-         void handleKey(KeyEvent evt, boolean onRelease) {
+         void handleKey(final KeyEvent evt, final boolean onRelease) {
              if(null == keyboardFocusManager) {
                  throw new InternalError("XXX");
              }
@@ -317,7 +318,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
 
     class FocusPropertyChangeListener implements PropertyChangeListener {
         @Override
-        public void propertyChange(PropertyChangeEvent evt) {
+        public void propertyChange(final PropertyChangeEvent evt) {
             final Object oldF = evt.getOldValue();
             final Object newF = evt.getNewValue();
             final boolean isParent = isParent();
@@ -374,7 +375,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
      * </p>
      * @return the previous attached newt child.
      */
-    public Window setNEWTChild(Window newChild) {
+    public Window setNEWTChild(final Window newChild) {
         synchronized(sync) {
             final Window prevChild = newtChild;
             if(DEBUG) {
@@ -400,7 +401,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
         final Window w = newtChild;
         if( null != w ) {
             // use NEWT child's size for min/pref size!
-            java.awt.Dimension minSize = new java.awt.Dimension(w.getWidth(), w.getHeight());
+            final java.awt.Dimension minSize = new java.awt.Dimension(w.getWidth(), w.getHeight());
             setMinimumSize(minSize);
             setPreferredSize(minSize);
         }
@@ -421,7 +422,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
     }
 
     @Override
-    public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+    public WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
         return awtWindowClosingProtocol.setDefaultCloseOperation(op);
     }
 
@@ -435,7 +436,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
      * which finally will perform the pending JAWT destruction.
      * </p>
      */
-    public final void setSkipJAWTDestroy(boolean v) { skipJAWTDestroy = v; }
+    public final void setSkipJAWTDestroy(final boolean v) { skipJAWTDestroy = v; }
     /** See {@link #setSkipJAWTDestroy(boolean)}. */
     public final boolean getSkipJAWTDestroy() { return skipJAWTDestroy; }
 
@@ -524,7 +525,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
             } } );
     }
 
-    private final void destroyImpl(boolean removeNotify, boolean windowClosing) {
+    private final void destroyImpl(final boolean removeNotify, final boolean windowClosing) {
         synchronized(sync) {
             final java.awt.Container cont = AWTMisc.getContainer(this);
             if(DEBUG) {
@@ -562,7 +563,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
     }
 
     @Override
-    public void paint(Graphics g) {
+    public void paint(final Graphics g) {
         synchronized(sync) {
             if( validateComponent(true) && !printActive ) {
                 newtChild.windowRepaint(0, 0, getWidth(), getHeight());
@@ -570,13 +571,13 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
         }
     }
     @Override
-    public void update(Graphics g) {
+    public void update(final Graphics g) {
         paint(g);
     }
 
     @SuppressWarnings("deprecation")
     @Override
-    public void reshape(int x, int y, int width, int height) {
+    public void reshape(final int x, final int y, final int width, final int height) {
         synchronized (getTreeLock()) { // super.reshape(..) claims tree lock, so we do extend it's lock over reshape
             synchronized(sync) {
                 super.reshape(x, y, width, height);
@@ -603,7 +604,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
     }
 
     @Override
-    public void setupPrint(double scaleMatX, double scaleMatY, int numSamples, int tileWidth, int tileHeight) {
+    public void setupPrint(final double scaleMatX, final double scaleMatY, final int numSamples, final int tileWidth, final int tileHeight) {
         printActive = true;
         final int componentCount = isOpaque() ? 3 : 4;
         final TileRenderer printRenderer = new TileRenderer();
@@ -641,46 +642,48 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
                     printAnimator.remove(glad);
                 }
                 printGLAD = glad; // _not_ default, shall be replaced by offscreen GLAD
-                final GLCapabilities caps = (GLCapabilities)glad.getChosenGLCapabilities().cloneMutable();
-                final int printNumSamples = printAWTTiles.getNumSamples(caps);
+                final GLCapabilitiesImmutable gladCaps = glad.getChosenGLCapabilities();
+                final int printNumSamples = printAWTTiles.getNumSamples(gladCaps);
                 GLDrawable printDrawable = printGLAD.getDelegatedDrawable();
-                final boolean reqNewGLADSamples = printNumSamples != caps.getNumSamples();
-                final boolean reqNewGLADSize = printAWTTiles.customTileWidth != -1 && printAWTTiles.customTileWidth != printDrawable.getWidth() ||
-                                               printAWTTiles.customTileHeight != -1 && printAWTTiles.customTileHeight != printDrawable.getHeight();
-                final boolean reqNewGLADOnscrn = caps.isOnscreen();
-
-                // It is desired to use a new offscreen GLAD, however Bug 830 forbids this for AA onscreen context.
-                // Bug 830: swapGLContextAndAllGLEventListener and onscreen MSAA w/ NV/GLX
-                final boolean reqNewGLAD = !caps.getSampleBuffers() && ( reqNewGLADOnscrn || reqNewGLADSamples || reqNewGLADSize );
+                final boolean reqNewGLADSamples = printNumSamples != gladCaps.getNumSamples();
+                final boolean reqNewGLADSize = printAWTTiles.customTileWidth != -1 && printAWTTiles.customTileWidth != printDrawable.getSurfaceWidth() ||
+                                               printAWTTiles.customTileHeight != -1 && printAWTTiles.customTileHeight != printDrawable.getSurfaceHeight();
+                final boolean reqNewGLADOnscrn = gladCaps.isOnscreen();
+
+                final GLCapabilities newGLADCaps = (GLCapabilities)gladCaps.cloneMutable();
+                newGLADCaps.setDoubleBuffered(false);
+                newGLADCaps.setOnscreen(false);
+                if( printNumSamples != newGLADCaps.getNumSamples() ) {
+                    newGLADCaps.setSampleBuffers(0 < printNumSamples);
+                    newGLADCaps.setNumSamples(printNumSamples);
+                }
+                final boolean reqNewGLADSafe = GLDrawableUtil.isSwapGLContextSafe(glad.getRequestedGLCapabilities(), gladCaps, newGLADCaps);
+
+                final boolean reqNewGLAD = ( reqNewGLADOnscrn || reqNewGLADSamples || reqNewGLADSize ) && reqNewGLADSafe;
+
                 if( DEBUG ) {
-                    System.err.println("AWT print.setup: reqNewGLAD "+reqNewGLAD+"[ onscreen "+reqNewGLADOnscrn+", samples "+reqNewGLADSamples+", size "+reqNewGLADSize+"], "+
-                            ", drawableSize "+printDrawable.getWidth()+"x"+printDrawable.getHeight()+
+                    System.err.println("AWT print.setup: reqNewGLAD "+reqNewGLAD+"[ onscreen "+reqNewGLADOnscrn+", samples "+reqNewGLADSamples+", size "+reqNewGLADSize+", safe "+reqNewGLADSafe+"], "+
+                            ", drawableSize "+printDrawable.getSurfaceWidth()+"x"+printDrawable.getSurfaceHeight()+
                             ", customTileSize "+printAWTTiles.customTileWidth+"x"+printAWTTiles.customTileHeight+
                             ", scaleMat "+printAWTTiles.scaleMatX+" x "+printAWTTiles.scaleMatY+
                             ", numSamples "+printAWTTiles.customNumSamples+" -> "+printNumSamples+", printAnimator "+printAnimator);
                 }
                 if( reqNewGLAD ) {
-                    caps.setDoubleBuffered(false);
-                    caps.setOnscreen(false);
-                    if( printNumSamples != caps.getNumSamples() ) {
-                        caps.setSampleBuffers(0 < printNumSamples);
-                        caps.setNumSamples(printNumSamples);
-                    }
-                    final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
-                    printGLAD = factory.createOffscreenAutoDrawable(null, caps, null,
+                    final GLDrawableFactory factory = GLDrawableFactory.getFactory(newGLADCaps.getGLProfile());
+                    printGLAD = factory.createOffscreenAutoDrawable(null, newGLADCaps, null,
                             printAWTTiles.customTileWidth != -1 ? printAWTTiles.customTileWidth : DEFAULT_PRINT_TILE_SIZE,
                             printAWTTiles.customTileHeight != -1 ? printAWTTiles.customTileHeight : DEFAULT_PRINT_TILE_SIZE);
                     GLDrawableUtil.swapGLContextAndAllGLEventListener(glad, printGLAD);
                     printDrawable = printGLAD.getDelegatedDrawable();
                 }
                 printAWTTiles.setGLOrientation(printGLAD.isGLOriented(), printGLAD.isGLOriented());
-                printAWTTiles.renderer.setTileSize(printDrawable.getWidth(), printDrawable.getHeight(), 0);
+                printAWTTiles.renderer.setTileSize(printDrawable.getSurfaceWidth(), printDrawable.getSurfaceHeight(), 0);
                 printAWTTiles.renderer.attachAutoDrawable(printGLAD);
                 if( DEBUG ) {
                     System.err.println("AWT print.setup "+printAWTTiles);
-                    System.err.println("AWT print.setup AA "+printNumSamples+", "+caps);
-                    System.err.println("AWT print.setup printGLAD: "+printGLAD.getWidth()+"x"+printGLAD.getHeight()+", "+printGLAD);
-                    System.err.println("AWT print.setup printDraw: "+printDrawable.getWidth()+"x"+printDrawable.getHeight()+", "+printDrawable);
+                    System.err.println("AWT print.setup AA "+printNumSamples+", "+newGLADCaps);
+                    System.err.println("AWT print.setup printGLAD: "+printGLAD.getSurfaceWidth()+"x"+printGLAD.getSurfaceHeight()+", "+printGLAD);
+                    System.err.println("AWT print.setup printDraw: "+printDrawable.getSurfaceWidth()+"x"+printDrawable.getSurfaceHeight()+", "+printDrawable);
                 }
             }
         }
@@ -720,7 +723,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
     };
 
     @Override
-    public void print(Graphics graphics) {
+    public void print(final Graphics graphics) {
         synchronized(sync) {
             if( !printActive || null == printGLAD ) {
                 throw new IllegalStateException("setupPrint() not called");
@@ -750,8 +753,8 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
                         printAWTTiles.resetGraphics2D();
                     }
                 }
-            } catch (NoninvertibleTransformException nte) {
-                System.err.println("Catched: Inversion failed of: "+g2d.getTransform());
+            } catch (final NoninvertibleTransformException nte) {
+                System.err.println("Caught: Inversion failed of: "+g2d.getTransform());
                 nte.printStackTrace();
             }
             if( DEBUG ) {
@@ -760,7 +763,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
         }
     }
 
-    private final boolean validateComponent(boolean attachNewtChild) {
+    private final boolean validateComponent(final boolean attachNewtChild) {
         if( Beans.isDesignTime() || !isDisplayable() ) {
             return false;
         }
@@ -778,12 +781,10 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
         return true;
     }
 
-    private final void configureNewtChild(boolean attach) {
-        awtAdapter.clear();
-        awtMouseAdapter.clear();
-        awtKeyAdapter.setConsumeAWTEvent(false);
+    private final void configureNewtChild(final boolean attach) {
+        awtWinAdapter.clear();
+        awtKeyAdapter.clear();
         awtMouseAdapter.clear();
-        awtKeyAdapter.setConsumeAWTEvent(false);
 
         if(null != keyboardFocusManager) {
             keyboardFocusManager.removePropertyChangeListener("focusOwner", focusPropertyChangeListener);
@@ -797,7 +798,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
                     throw new InternalError("XXX");
                 }
                 isOnscreen = jawtWindow.getGraphicsConfiguration().getChosenCapabilities().isOnscreen();
-                awtAdapter.setDownstream(jawtWindow, newtChild);
+                awtWinAdapter.setDownstream(jawtWindow, newtChild);
                 newtChild.addWindowListener(clearAWTMenusOnNewtFocus);
                 newtChild.setFocusAction(focusAction); // enable AWT focus traversal
                 newtChildCloseOp = newtChild.setDefaultCloseOperation(WindowClosingMode.DO_NOTHING_ON_CLOSE);
@@ -862,11 +863,19 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
       }
       final int w = getWidth();
       final int h = getHeight();
+      final boolean isNValid = newtChild.isNativeValid();
       if(DEBUG) {
-          System.err.println("NewtCanvasAWT.attachNewtChild.2: size "+w+"x"+h);
+          System.err.println("NewtCanvasAWT.attachNewtChild.2: size "+w+"x"+h+", isNValid "+isNValid);
       }
       newtChild.setVisible(false);
       newtChild.setSize(w, h);
+      final int[] reqSurfaceScale = new int[2];
+      if( isNValid ) {
+          newtChild.getCurrentSurfaceScale(reqSurfaceScale);
+      } else {
+          newtChild.getRequestedSurfaceScale(reqSurfaceScale);
+      }
+      jawtWindow.setSurfaceScale(reqSurfaceScale);
       newtChild.reparentWindow(jawtWindow, -1, -1, Window.REPARENT_HINT_BECOMES_VISIBLE);
       newtChild.addSurfaceUpdatedListener(jawtWindow);
       if( jawtWindow.isOffscreenLayerSurfaceEnabled() &&
@@ -898,7 +907,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
             }
         }  };
 
-    private final void detachNewtChild(java.awt.Container cont) {
+    private final void detachNewtChild(final java.awt.Container cont) {
       if( null == newtChild || null == jawtWindow || !newtChildAttached ) {
           return; // nop
       }
@@ -945,16 +954,16 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
                       clazz.getDeclaredMethod("disableBackgroundErase",
                                               new Class[] { Canvas.class });
                     disableBackgroundEraseMethod.setAccessible(true);
-                  } catch (Exception e) {
+                  } catch (final Exception e) {
                     clazz = clazz.getSuperclass();
                   }
                 }
-              } catch (Exception e) {
+              } catch (final Exception e) {
               }
               return null;
             }
           });
-      } catch (Exception e) {
+      } catch (final Exception e) {
       }
       disableBackgroundEraseInitialized = true;
       if(DEBUG) {
@@ -966,7 +975,7 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
       Throwable t=null;
       try {
         disableBackgroundEraseMethod.invoke(getToolkit(), new Object[] { this });
-      } catch (Exception e) {
+      } catch (final Exception e) {
         t = e;
       }
       if(DEBUG) {
@@ -977,10 +986,10 @@ public class NewtCanvasAWT extends java.awt.Canvas implements WindowClosingProto
 
   protected static String currentThreadName() { return "["+Thread.currentThread().getName()+", isAWT-EDT "+EventQueue.isDispatchThread()+"]"; }
 
-  static String newtWinHandleToHexString(Window w) {
+  static String newtWinHandleToHexString(final Window w) {
       return null != w ? toHexString(w.getWindowHandle()) : "nil";
   }
-  static String toHexString(long l) {
+  static String toHexString(final long l) {
       return "0x"+Long.toHexString(l);
   }
 }
diff --git a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java
index 9cecca9..72b3e43 100644
--- a/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java
+++ b/src/newt/classes/com/jogamp/newt/awt/applet/JOGLNewtApplet1Run.java
@@ -36,6 +36,7 @@ import java.awt.EventQueue;
 import java.awt.event.KeyListener;
 import java.awt.event.MouseListener;
 import java.awt.event.MouseMotionListener;
+import java.util.Arrays;
 
 import javax.media.nativewindow.WindowClosingProtocol.WindowClosingMode;
 import javax.media.opengl.FPSCounter;
@@ -110,9 +111,6 @@ public class JOGLNewtApplet1Run extends Applet {
         if(DEBUG) {
             System.err.println("JOGLNewtApplet1Run.init() START - "+currentThreadName());
         }
-        if(!(this instanceof Container)) {
-            throw new RuntimeException("This Applet is not a AWT Container");
-        }
         final Container container = this;
 
         String glEventListenerClazzName=null;
@@ -146,7 +144,7 @@ public class JOGLNewtApplet1Run extends Applet {
             glHeight = JOGLNewtAppletBase.str2Int(getParameter("gl_height"), glHeight);
             glNoDefaultKeyListener = JOGLNewtAppletBase.str2Bool(getParameter("gl_nodefaultkeyListener"), glNoDefaultKeyListener);
             appletDebugTestBorder = JOGLNewtAppletBase.str2Bool(getParameter("appletDebugTestBorder"), appletDebugTestBorder);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
         }
         if(null==glEventListenerClazzName) {
@@ -181,7 +179,7 @@ public class JOGLNewtApplet1Run extends Applet {
                                       glTrace);
 
         try {
-            GLCapabilities caps = new GLCapabilities(GLProfile.get(glProfileName));
+            final GLCapabilities caps = new GLCapabilities(GLProfile.get(glProfileName));
             caps.setAlphaBits(glAlphaBits);
             if(0<glNumMultisampleBuffer) {
                 caps.setSampleBuffers(true);
@@ -205,7 +203,7 @@ public class JOGLNewtApplet1Run extends Applet {
             }
             base.init(glWindow);
             if(base.isValid()) {
-                GLEventListener glEventListener = base.getGLEventListener();
+                final GLEventListener glEventListener = base.getGLEventListener();
 
                 if(glEventListener instanceof MouseListener) {
                     addMouseListener((MouseListener)glEventListener);
@@ -226,7 +224,7 @@ public class JOGLNewtApplet1Run extends Applet {
                         container.validate();
                     } } );
             }
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             throw new RuntimeException(t);
         }
         if(DEBUG) {
@@ -264,7 +262,7 @@ public class JOGLNewtApplet1Run extends Applet {
             }
             System.err.println("JOGLNewtApplet1Run start:");
             System.err.println("TopComponent: "+topC.getLocation()+" rel, "+topC.getLocationOnScreen()+" screen, visible "+topC.isVisible()+", "+topC);
-            System.err.println("Applet Pos: "+this.getLocation()+" rel, "+p0+" screen, visible "+this.isVisible()+", "+this);
+            System.err.println("Applet Pos: "+this.getLocation()+" rel, "+Arrays.toString(p0)+" screen, visible "+this.isVisible()+", "+this);
             if(null != newtCanvasAWT) {
                 System.err.println("NewtCanvasAWT Pos: "+newtCanvasAWT.getLocation()+" rel, "+newtCanvasAWT.getLocationOnScreen()+" screen, visible "+newtCanvasAWT.isVisible()+", "+newtCanvasAWT);
             }
diff --git a/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java b/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java
index edb2429..7fec292 100644
--- a/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java
+++ b/src/newt/classes/com/jogamp/newt/event/DoubleTapScrollGesture.java
@@ -27,6 +27,8 @@
  */
 package com.jogamp.newt.event;
 
+import com.jogamp.common.util.PropertyAccess;
+
 import jogamp.newt.Debug;
 
 /**
@@ -83,10 +85,10 @@ public class DoubleTapScrollGesture implements GestureHandler {
     static {
         Debug.initSingleton();
 
-        SCROLL_SLOP_PIXEL = Debug.getIntProperty("newt.event.scroll_slop_pixel", true, 16);
-        DOUBLE_TAP_SLOP_PIXEL = Debug.getIntProperty("newt.event.double_tap_slop_pixel", true, 104);
-        SCROLL_SLOP_MM = Debug.getIntProperty("newt.event.scroll_slop_mm", true, 3);
-        DOUBLE_TAP_SLOP_MM = Debug.getIntProperty("newt.event.double_tap_slop_mm", true, 20);
+        SCROLL_SLOP_PIXEL = PropertyAccess.getIntProperty("newt.event.scroll_slop_pixel", true, 16);
+        DOUBLE_TAP_SLOP_PIXEL = PropertyAccess.getIntProperty("newt.event.double_tap_slop_pixel", true, 104);
+        SCROLL_SLOP_MM = PropertyAccess.getIntProperty("newt.event.scroll_slop_mm", true, 3);
+        DOUBLE_TAP_SLOP_MM = PropertyAccess.getIntProperty("newt.event.double_tap_slop_mm", true, 20);
     }
 
     private static final int ST_NONE = 0;
@@ -97,7 +99,7 @@ public class DoubleTapScrollGesture implements GestureHandler {
 
     private final int scrollSlop, scrollSlopSquare, doubleTapSlop, doubleTapSlopSquare;
     private final float[] scrollDistance = new float[] { 0f, 0f };
-    private int[] pIds = new int[] { -1, -1 };
+    private final int[] pIds = new int[] { -1, -1 };
     /** See class docu */
     private int gestureState;
     private int sqStartDist;
@@ -105,7 +107,7 @@ public class DoubleTapScrollGesture implements GestureHandler {
     private int pointerDownCount;
     private MouseEvent hitGestureEvent;
 
-    private static final int getSquareDistance(float x1, float y1, float x2, float y2) {
+    private static final int getSquareDistance(final float x1, final float y1, final float x2, final float y2) {
         final int deltaX = (int) x1 - (int) x2;
         final int deltaY = (int) y1 - (int) y2;
         return deltaX * deltaX + deltaY * deltaY;
@@ -129,7 +131,7 @@ public class DoubleTapScrollGesture implements GestureHandler {
      * @param scaledScrollSlop Distance a pointer can wander before we think the user is scrolling in <i>pixels</i>.
      * @param scaledDoubleTapSlop Distance in <i>pixels</i> between the first touch and second touch to still be considered a double tap.
      */
-    public DoubleTapScrollGesture(int scaledScrollSlop, int scaledDoubleTapSlop) {
+    public DoubleTapScrollGesture(final int scaledScrollSlop, final int scaledDoubleTapSlop) {
         scrollSlop = scaledScrollSlop;
         scrollSlopSquare = scaledScrollSlop * scaledScrollSlop;
         doubleTapSlop = scaledDoubleTapSlop;
@@ -148,7 +150,7 @@ public class DoubleTapScrollGesture implements GestureHandler {
     }
 
     @Override
-    public void clear(boolean clearStarted) {
+    public void clear(final boolean clearStarted) {
         scrollDistance[0] = 0f;
         scrollDistance[1] = 0f;
         hitGestureEvent = null;
diff --git a/src/newt/classes/com/jogamp/newt/event/GestureHandler.java b/src/newt/classes/com/jogamp/newt/event/GestureHandler.java
index 2e98a8a..ea0f76f 100644
--- a/src/newt/classes/com/jogamp/newt/event/GestureHandler.java
+++ b/src/newt/classes/com/jogamp/newt/event/GestureHandler.java
@@ -52,6 +52,7 @@ public interface GestureHandler {
         public static final short EVENT_GESTURE_DETECTED = 400;
 
         private final GestureHandler handler;
+        private final InputEvent ie;
 
         /**
          * Creates a gesture event with default type {@link #EVENT_GESTURE_DETECTED}.
@@ -60,10 +61,12 @@ public interface GestureHandler {
          * @param when
          * @param modifiers
          * @param handler
+         * @param trigger TODO
          */
-        public GestureEvent(Object source, long when, int modifiers, GestureHandler handler) {
+        public GestureEvent(final Object source, final long when, final int modifiers, final GestureHandler handler, final InputEvent trigger) {
             super(EVENT_GESTURE_DETECTED, source, when, modifiers);
             this.handler = handler;
+            this.ie = trigger;
         }
 
         /**
@@ -73,14 +76,23 @@ public interface GestureHandler {
          * @param when
          * @param modifiers
          * @param handler
+         * @param trigger TODO
          */
-        public GestureEvent(short event_type, Object source, long when, int modifiers, GestureHandler handler) {
+        public GestureEvent(final short event_type, final Object source, final long when, final int modifiers, final GestureHandler handler, final InputEvent trigger) {
             super(event_type, source, when, modifiers);
             this.handler = handler;
+            this.ie = trigger;
         }
 
         /** Return the {@link GestureHandler}, which produced the event. */
         public final GestureHandler getHandler() { return handler; }
+
+        /** Triggering {@link InputEvent} */
+        public final InputEvent getTrigger() { return ie; }
+
+        public String toString() {
+            return "GestureEvent[handler "+handler+"]";
+        }
     }
 
     /**
diff --git a/src/newt/classes/com/jogamp/newt/event/InputEvent.java b/src/newt/classes/com/jogamp/newt/event/InputEvent.java
index f29b632..fbda79d 100644
--- a/src/newt/classes/com/jogamp/newt/event/InputEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/InputEvent.java
@@ -84,56 +84,56 @@ public abstract class InputEvent extends NEWTEvent
   * null is returned.
   * </p>
   */
- public static final int getButtonMask(int button)  {
+ public static final int getButtonMask(final int button)  {
      if( 0 < button && button <= MouseEvent.BUTTON_COUNT ) {
          return 1 << ( 4 + button ) ;
      }
      return 0;
  }
 
- protected InputEvent(short eventType, Object source, long when, int modifiers) {
+ protected InputEvent(final short eventType, final Object source, final long when, final int modifiers) {
     super(eventType, source, when);
     this.modifiers=modifiers;
  }
 
  /** Return the modifier bits of this event, e.g. see {@link #SHIFT_MASK} .. etc. */
- public int getModifiers() {
+ public final int getModifiers() {
     return modifiers;
  }
  /** {@link #getModifiers()} contains {@link #ALT_MASK}. */
- public boolean isAltDown() {
+ public final boolean isAltDown() {
     return (modifiers&ALT_MASK)!=0;
  }
  /** {@link #getModifiers()} contains {@link #ALT_GRAPH_MASK}. */
- public boolean isAltGraphDown() {
+ public final boolean isAltGraphDown() {
     return (modifiers&ALT_GRAPH_MASK)!=0;
  }
  /** {@link #getModifiers()} contains {@link #CTRL_MASK}. */
- public boolean isControlDown() {
+ public final boolean isControlDown() {
     return (modifiers&CTRL_MASK)!=0;
  }
  /** {@link #getModifiers()} contains {@link #META_MASK}. */
- public boolean isMetaDown() {
+ public final boolean isMetaDown() {
     return (modifiers&META_MASK)!=0;
  }
  /** {@link #getModifiers()} contains {@link #SHIFT_MASK}. */
- public boolean isShiftDown()  {
+ public final boolean isShiftDown()  {
     return (modifiers&SHIFT_MASK)!=0;
  }
  /** {@link #getModifiers()} contains {@link #AUTOREPEAT_MASK}. */
- public boolean isAutoRepeat()  {
+ public final boolean isAutoRepeat()  {
     return (modifiers&AUTOREPEAT_MASK)!=0;
  }
  /** {@link #getModifiers()} contains {@link #CONFINED_MASK}. Pointer is confined, see {@link Window#confinePointer(boolean)}. */
- public boolean isConfined()  {
+ public final boolean isConfined()  {
     return (modifiers&CONFINED_MASK)!=0;
  }
  /** {@link #getModifiers()} contains {@link #INVISIBLE_MASK}. Pointer is invisible, see {@link Window#setPointerVisible(boolean)}. */
- public boolean isInvisible()  {
+ public final boolean isInvisible()  {
     return (modifiers&INVISIBLE_MASK)!=0;
  }
 
- public StringBuilder getModifiersString(StringBuilder sb) {
+ public final StringBuilder getModifiersString(StringBuilder sb) {
     if(null == sb) {
         sb = new StringBuilder();
     }
@@ -176,7 +176,7 @@ public abstract class InputEvent extends NEWTEvent
   * @param button the button to test
   * @return true if the given button is down
   */
- public final boolean isButtonDown(int button)  {
+ public final boolean isButtonDown(final int button)  {
     return ( modifiers & getButtonMask(button) ) != 0;
  }
 
diff --git a/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java
index 5cef734..0f147a7 100644
--- a/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/KeyAdapter.java
@@ -32,10 +32,10 @@ package com.jogamp.newt.event;
 public abstract class KeyAdapter implements KeyListener
 {
  @Override
- public void keyPressed(KeyEvent e) {
+ public void keyPressed(final KeyEvent e) {
  }
  @Override
- public void keyReleased(KeyEvent e) {
+ public void keyReleased(final KeyEvent e) {
  }
 }
 
diff --git a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
index 49aa4e0..f29e9eb 100644
--- a/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/KeyEvent.java
@@ -118,7 +118,7 @@ import com.jogamp.common.util.IntBitfield;
 @SuppressWarnings("serial")
 public class KeyEvent extends InputEvent
 {
-    private KeyEvent(short eventType, Object source, long when, int modifiers, short keyCode, short keySym, int keySymModMask, char keyChar) {
+    private KeyEvent(final short eventType, final Object source, final long when, final int modifiers, final short keyCode, final short keySym, final int keySymModMask, final char keyChar) {
         super(eventType, source, when, modifiers | keySymModMask);
         this.keyCode=keyCode;
         this.keySym=keySym;
@@ -148,7 +148,7 @@ public class KeyEvent extends InputEvent
         }
     }
 
-    public static KeyEvent create(short eventType, Object source, long when, int modifiers, short keyCode, short keySym, char keyChar) {
+    public static KeyEvent create(final short eventType, final Object source, final long when, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
         return new KeyEvent(eventType, source, when, modifiers, keyCode, keySym, getModifierMask(keySym), keyChar);
     }
 
@@ -211,7 +211,7 @@ public class KeyEvent extends InputEvent
         return super.toString(sb).append("]");
     }
 
-    public static String getEventTypeString(short type) {
+    public static String getEventTypeString(final short type) {
         switch(type) {
         case EVENT_KEY_PRESSED: return "EVENT_KEY_PRESSED";
         case EVENT_KEY_RELEASED: return "EVENT_KEY_RELEASED";
@@ -224,7 +224,7 @@ public class KeyEvent extends InputEvent
      *        however, lower case a-z is mapped to {@link KeyEvent#VK_A} - {@link KeyEvent#VK_Z}.
      * @return {@link KeyEvent} virtual key (VK) value.
      */
-    public static short utf16ToVKey(char keyChar) {
+    public static short utf16ToVKey(final char keyChar) {
         if( 'a' <= keyChar && keyChar <= 'z' ) {
             return (short) ( ( keyChar - 'a' ) + KeyEvent.VK_A );
         }
@@ -237,7 +237,7 @@ public class KeyEvent extends InputEvent
      * A modifier key is one of {@link #VK_SHIFT}, {@link #VK_CONTROL}, {@link #VK_ALT}, {@link #VK_ALT_GRAPH}, {@link #VK_META}.
      * </p>
      */
-    public static boolean isModifierKey(short vKey) {
+    public static boolean isModifierKey(final short vKey) {
         switch (vKey) {
             case VK_SHIFT:
             case VK_CONTROL:
@@ -254,7 +254,7 @@ public class KeyEvent extends InputEvent
      * If <code>vKey</code> is a {@link #isModifierKey() modifier key}, method returns the corresponding modifier mask,
      * otherwise 0.
      */
-    public static int getModifierMask(short vKey) {
+    public static int getModifierMask(final short vKey) {
         switch (vKey) {
             case VK_SHIFT:
                 return InputEvent.SHIFT_MASK;
@@ -377,7 +377,7 @@ public class KeyEvent extends InputEvent
         public short max;
         /** true if valid for keyChar values as well, otherwise only valid for keyCode and keySym due to collision. */
         public final boolean inclKeyChar;
-        private NonPrintableRange(short min, short max, boolean inclKeyChar) {
+        private NonPrintableRange(final short min, final short max, final boolean inclKeyChar) {
             this.min = min;
             this.max = max;
             this.inclKeyChar = inclKeyChar;
diff --git a/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java b/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java
index 03242e1..2e42f33 100644
--- a/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/MonitorEvent.java
@@ -38,7 +38,7 @@ public class MonitorEvent extends OutputEvent {
 
     private final MonitorMode mode;
 
-    public MonitorEvent (short eventType, MonitorDevice source, long when, MonitorMode mode) {
+    public MonitorEvent (final short eventType, final MonitorDevice source, final long when, final MonitorMode mode) {
         super(eventType, source, when);
         this.mode = mode;
     }
@@ -48,7 +48,7 @@ public class MonitorEvent extends OutputEvent {
 
     public final MonitorMode getMode() { return mode; }
 
-    public static String getEventTypeString(short type) {
+    public static String getEventTypeString(final short type) {
         switch(type) {
         case EVENT_MONITOR_MODE_CHANGE_NOTIFY: return "EVENT_MONITOR_MODE_CHANGE_NOTIFY";
         case EVENT_MONITOR_MODE_CHANGED: return "EVENT_MONITOR_MODE_CHANGED";
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java
index 98252fe..679155d 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseAdapter.java
@@ -31,28 +31,28 @@ package com.jogamp.newt.event;
 public abstract class MouseAdapter implements MouseListener
 {
  @Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
  }
  @Override
- public void mouseEntered(MouseEvent e) {
+ public void mouseEntered(final MouseEvent e) {
  }
  @Override
- public void mouseExited(MouseEvent e) {
+ public void mouseExited(final MouseEvent e) {
  }
  @Override
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(final MouseEvent e) {
  }
  @Override
- public void mouseReleased(MouseEvent e) {
+ public void mouseReleased(final MouseEvent e) {
  }
  @Override
- public void mouseMoved(MouseEvent e) {
+ public void mouseMoved(final MouseEvent e) {
  }
  @Override
- public void mouseDragged(MouseEvent e) {
+ public void mouseDragged(final MouseEvent e) {
  }
  @Override
- public void mouseWheelMoved(MouseEvent e) {
+ public void mouseWheelMoved(final MouseEvent e) {
  }
 }
 
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
index 272e4be..2d68c57 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseEvent.java
@@ -34,6 +34,8 @@
 
 package com.jogamp.newt.event;
 
+import java.util.Arrays;
+
 /**
  * Pointer event of type {@link PointerType}.
  * <p>
@@ -42,6 +44,11 @@ package com.jogamp.newt.event;
  * <p>
  * http://www.w3.org/Submission/pointer-events/#pointerevent-interface
  * </p>
+ * <a name="coordUnit"><h5>Unit of Coordinates</h5></a>
+ * <p>
+ * All pointer coordinates of this interface are represented in pixel units,
+ * see {@link NativeSurface} and {@link NativeWindow}.
+ * </p>
  * <a name="multiPtrEvent"><h5>Multiple-Pointer Events</h5></a>
  * <p>
  * In case an instance represents a multiple-pointer event, i.e. {@link #getPointerCount()} is > 1,
@@ -49,23 +56,17 @@ package com.jogamp.newt.event;
  * For example {@link #getX(int) e.getX(0)} at {@link #EVENT_MOUSE_PRESSED} returns the data of the pressed pointer, etc.
  * </p>
  * <p>
- * A {@link #getButton() button value} of <code>0</code> denotes no button activity, i.e. {@link PointerType#Mouse} move.
- * </p>
- * <p>
- * A {@link #getPointerId(int) pointer-ID} of -1 denotes no pointer/button activity, i.e. {@link PointerType#Mouse} move.
+ * Multiple-pointer event's {@link #getButton() button number} is mapped to the <i>first {@link #getPointerId(int) pointer ID}</i>
+ * triggering the event and the {@link InputEvent#BUTTON1_MASK button mask bits} in the {@link #getModifiers() modifiers}
+ * field  represent the pressed pointer IDs.
  * </p>
  * <p>
- * {@link #getButton() Button values} are mapped from and to {@link #getPointerId(int) pointer-IDs} as follows:
- *    <code>
- *       getPointerId(0) == getButton() - 1
- *    </code>.
+ * Users can query the pressed button and pointer count via {@link InputEvent#getButtonDownCount()}
+ * or use the simple query {@link InputEvent#isAnyButtonDown()}.
  * </p>
  * <p>
- * If representing a multiple-pointer event, the {@link #getButton() button number} is mapped to the <i>first {@link #getPointerId(int) pointer ID}</i>
- * triggering the event and the {@link InputEvent#BUTTON1_MASK button mask bits} in the {@link #getModifiers() modifiers}
- * field  represent the pressed pointer IDs.<br>
- * Hence users can query the pressed button count as well as the pressed pointer count via {@link InputEvent#getButtonDownCount()}
- * or use the simple query {@link InputEvent#isAnyButtonDown()}.
+ * If representing a single-pointer {@link PointerType#Mouse} event, {@link #getPointerId(int) pointer-ID} is <code>0</code>
+ * and a {@link #getButton() button value} of <code>0</code> denotes no button activity, i.e. {@link PointerType#Mouse} move.
  * </p>
  */
 @SuppressWarnings("serial")
@@ -101,7 +102,7 @@ public class MouseEvent extends InputEvent
          * </pre>
          * @throws IllegalArgumentException if the given ordinal is out of range, i.e. not within [ 0 .. PointerType.values().length-1 ]
          */
-        public static PointerType valueOf(int ordinal) throws IllegalArgumentException {
+        public static PointerType valueOf(final int ordinal) throws IllegalArgumentException {
             final PointerType[] all = PointerType.values();
             if( 0 <= ordinal && ordinal < all.length ) {
                 return all[ordinal];
@@ -116,7 +117,7 @@ public class MouseEvent extends InputEvent
          * </p>
          * @throws IllegalArgumentException if one of the given ordinal values is out of range, i.e. not within [ 0 .. PointerType.values().length-1 ]
          */
-        public static PointerType[] valuesOf(int[] ordinals) throws IllegalArgumentException {
+        public static PointerType[] valuesOf(final int[] ordinals) throws IllegalArgumentException {
             final int count = ordinals.length;
             final PointerType[] types = new PointerType[count];
             for(int i=count-1; i>=0; i--) {
@@ -125,7 +126,7 @@ public class MouseEvent extends InputEvent
             return types;
         }
 
-        private PointerType(PointerClass pc) {
+        private PointerType(final PointerClass pc) {
             this.pc = pc;
         }
         PointerClass pc;
@@ -153,12 +154,6 @@ public class MouseEvent extends InputEvent
     /** Maximum number of buttons, value <code>16</code> */
     public static final short BUTTON_COUNT =  16;
 
-    /**
-     * Maximum number of buttons, value <code>16</code>.
-     * @deprecated Use {@link #BUTTON_COUNT} .. semantics.
-     */
-    public static final short BUTTON_NUMBER =  16;
-
     /** Returns the 3-axis XYZ rotation array by given rotation on Y axis or X axis (if SHIFT_MASK is given in mods). */
     public static final float[] getRotationXYZ(final float rotationXorY, final int mods) {
         final float[] rotationXYZ = new float[] { 0f, 0f, 0f };
@@ -189,9 +184,9 @@ public class MouseEvent extends InputEvent
      * @param rotationXYZ Rotation of all axis
      * @param rotationScale Rotation scale
      */
-    public MouseEvent(short eventType, Object source, long when,
-            int modifiers, int x, int y, short clickCount, short button,
-            float[] rotationXYZ, float rotationScale)
+    public MouseEvent(final short eventType, final Object source, final long when,
+            final int modifiers, final int x, final int y, final short clickCount, final short button,
+            final float[] rotationXYZ, final float rotationScale)
     {
         super(eventType, source, when, modifiers);
         this.x = new int[]{x};
@@ -206,7 +201,7 @@ public class MouseEvent extends InputEvent
                 this.pressure = constMousePressure0;
         }
         this.maxPressure= 1.0f;
-        this.pointerID = new short[] { (short)(button - 1) };
+        this.pointerID = new short[] { (short)0 };
         this.clickCount=clickCount;
         this.button=button;
         this.rotationXYZ = rotationXYZ;
@@ -239,10 +234,10 @@ public class MouseEvent extends InputEvent
      * @param rotationXYZ Rotation of all axis
      * @param rotationScale Rotation scale
      */
-    public MouseEvent(short eventType, Object source, long when, int modifiers,
-                      PointerType pointerType[], short[] pointerID,
-                      int[] x, int[] y, float[] pressure, float maxPressure,
-                      short button, short clickCount, float[] rotationXYZ, float rotationScale)
+    public MouseEvent(final short eventType, final Object source, final long when, final int modifiers,
+                      final PointerType pointerType[], final short[] pointerID,
+                      final int[] x, final int[] y, final float[] pressure, final float maxPressure,
+                      final short button, final short clickCount, final float[] rotationXYZ, final float rotationScale)
     {
         super(eventType, source, when, modifiers);
         this.x = x;
@@ -267,7 +262,7 @@ public class MouseEvent extends InputEvent
         this.pointerType = pointerType;
     }
 
-    public MouseEvent createVariant(short newEventType) {
+    public final MouseEvent createVariant(final short newEventType) {
         return new MouseEvent(newEventType, source, getWhen(), getModifiers(), pointerType, pointerID,
                               x, y, pressure, maxPressure, button, clickCount, rotationXYZ, rotationScale);
     }
@@ -284,7 +279,7 @@ public class MouseEvent extends InputEvent
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * @return the {@link PointerType} for the data at index or null if index not available.
      */
-    public final PointerType getPointerType(int index) {
+    public final PointerType getPointerType(final int index) {
         if(0 > index || index >= pointerType.length) {
             return null;
         }
@@ -305,13 +300,10 @@ public class MouseEvent extends InputEvent
      * IDs start w/ 0 and are consecutive numbers.
      * </p>
      * <p>
-     * A pointer-ID of -1 may also denote no pointer/button activity, i.e. {@link PointerType#Mouse} move.
-     * </p>
-     * <p>
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * </p>
      */
-    public final short getPointerId(int index) {
+    public final short getPointerId(final int index) {
         if(0 > index || index >= pointerID.length) {
             return -1;
         }
@@ -322,7 +314,7 @@ public class MouseEvent extends InputEvent
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * @return the pointer index for the given pointer id or -1 if id not available.
      */
-    public final int getPointerIdx(short id) {
+    public final int getPointerIdx(final short id) {
         if( id >= 0 ) {
             for(int i=pointerID.length-1; i>=0; i--) {
                 if( pointerID[i] == id ) {
@@ -358,10 +350,18 @@ public class MouseEvent extends InputEvent
         return clickCount;
     }
 
+    /**
+     * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
+     * @return X-Coord of the triggering pointer-index zero in pixel units.
+     */
     public final int getX() {
         return x[0];
     }
 
+    /**
+     * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
+     * @return Y-Coord of the triggering pointer-index zero in pixel units.
+     */
     public final int getY() {
         return y[0];
     }
@@ -369,26 +369,26 @@ public class MouseEvent extends InputEvent
     /**
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * @param index pointer-index within [0 .. {@link #getPointerCount()}-1]
-     * @return X-Coord associated with the pointer-index.
+     * @return X-Coord associated with the pointer-index in pixel units.
      * @see getPointerId(index)
      */
-    public final int getX(int index) {
+    public final int getX(final int index) {
         return x[index];
     }
 
     /**
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
      * @param index pointer-index within [0 .. {@link #getPointerCount()}-1]
-     * @return Y-Coord associated with the pointer-index.
+     * @return Y-Coord associated with the pointer-index in pixel units.
      * @see getPointerId(index)
      */
-    public final int getY(int index) {
+    public final int getY(final int index) {
         return y[index];
     }
 
     /**
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
-     * @return array of all X-Coords for all pointers
+     * @return array of all X-Coords for all pointers in pixel units.
      */
     public final int[] getAllX() {
         return x;
@@ -396,7 +396,7 @@ public class MouseEvent extends InputEvent
 
     /**
      * See details for <a href="#multiPtrEvent">multiple-pointer events</a>.
-     * @return array of all Y-Coords for all pointers
+     * @return array of all Y-Coords for all pointers in pixel units.
      */
     public final int[] getAllY() {
         return y;
@@ -408,7 +408,7 @@ public class MouseEvent extends InputEvent
      *         The value of zero is return if not available.
      * @see #getMaxPressure()
      */
-    public final float getPressure(boolean normalized){
+    public final float getPressure(final boolean normalized){
         return normalized ? pressure[0] / maxPressure : pressure[0];
     }
 
@@ -420,7 +420,7 @@ public class MouseEvent extends InputEvent
      *         The value of zero is return if not available.
      * @see #getMaxPressure()
      */
-    public final float getPressure(int index, boolean normalized){
+    public final float getPressure(final int index, final boolean normalized){
         return normalized ? pressure[index] / maxPressure : pressure[index];
     }
 
@@ -521,7 +521,7 @@ public class MouseEvent extends InputEvent
             sb = new StringBuilder();
         }
         sb.append("MouseEvent[").append(getEventTypeString(getEventType()))
-        .append(", ").append(x).append("/").append(y)
+        .append(", ").append(Arrays.toString(x)).append("/").append(Arrays.toString(y))
         .append(", button ").append(button).append(", count ")
         .append(clickCount).append(", rotation [").append(rotationXYZ[0]).append(", ").append(rotationXYZ[1]).append(", ").append(rotationXYZ[2]).append("] * ").append(rotationScale);
         if(pointerID.length>0) {
@@ -540,7 +540,7 @@ public class MouseEvent extends InputEvent
         return super.toString(sb).append("]");
     }
 
-    public static String getEventTypeString(short type) {
+    public static String getEventTypeString(final short type) {
         switch(type) {
             case EVENT_MOUSE_CLICKED: return "EVENT_MOUSE_CLICKED";
             case EVENT_MOUSE_ENTERED: return "EVENT_MOUSE_ENTERED";
@@ -556,12 +556,7 @@ public class MouseEvent extends InputEvent
 
     /** PointerType for each pointer (multiple pointer) */
     private final PointerType pointerType[];
-    /**
-     * Pointer-ID for each pointer (multiple pointer). IDs start w/ 0 and are consecutive numbers.
-     * <p>
-     * A pointer-ID of -1 may also denote no pointer/button activity, i.e. {@link PointerType#Mouse} move.
-     * </p>
-     */
+    /** Pointer-ID for each pointer (multiple pointer). IDs start w/ 0 and are consecutive numbers. */
     private final short pointerID[];
     /** X-axis for each pointer (multiple pointer) */
     private final int x[];
diff --git a/src/newt/classes/com/jogamp/newt/event/MouseListener.java b/src/newt/classes/com/jogamp/newt/event/MouseListener.java
index 6e51420..5e62306 100644
--- a/src/newt/classes/com/jogamp/newt/event/MouseListener.java
+++ b/src/newt/classes/com/jogamp/newt/event/MouseListener.java
@@ -43,23 +43,23 @@ import com.jogamp.newt.event.MouseEvent.PointerType;
  */
 public interface MouseListener extends NEWTEventListener
 {
- public void mouseClicked(MouseEvent e);
- /** Only generated for {@link PointerType#Mouse} */
- public void mouseEntered(MouseEvent e);
- /** Only generated for {@link PointerType#Mouse} */
- public void mouseExited(MouseEvent e);
- public void mousePressed(MouseEvent e);
- public void mouseReleased(MouseEvent e);
- public void mouseMoved(MouseEvent e);
- public void mouseDragged(MouseEvent e);
+    public void mouseClicked(MouseEvent e);
+    /** Only generated for {@link PointerType#Mouse} */
+    public void mouseEntered(MouseEvent e);
+    /** Only generated for {@link PointerType#Mouse} */
+    public void mouseExited(MouseEvent e);
+    public void mousePressed(MouseEvent e);
+    public void mouseReleased(MouseEvent e);
+    public void mouseMoved(MouseEvent e);
+    public void mouseDragged(MouseEvent e);
 
- /**
-  * Traditional event name originally produced by a {@link PointerType#Mouse mouse} pointer type.
-  * <p>
-  * Triggered for any rotational pointer events, see
-  * {@link MouseEvent#getRotation()} and {@link MouseEvent#getRotationScale()}.
-  * </p>
-  */
- public void mouseWheelMoved(MouseEvent e);
+    /**
+     * Traditional event name originally produced by a {@link PointerType#Mouse mouse} pointer type.
+     * <p>
+     * Triggered for any rotational pointer events, see
+     * {@link MouseEvent#getRotation()} and {@link MouseEvent#getRotationScale()}.
+     * </p>
+     */
+    public void mouseWheelMoved(MouseEvent e);
 }
 
diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
index af800e6..a9d9d8b 100644
--- a/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/NEWTEvent.java
@@ -61,7 +61,7 @@ public class NEWTEvent extends java.util.EventObject {
 
     static final boolean DEBUG = false;
 
-    protected NEWTEvent(short eventType, Object source, long when) {
+    protected NEWTEvent(final short eventType, final Object source, final long when) {
         super(source);
         this.eventType = eventType;
         this.when = when;
@@ -86,7 +86,7 @@ public class NEWTEvent extends java.util.EventObject {
      * communication.
      * @param attachment User application specific object
      */
-    public final void setAttachment(Object attachment) {
+    public final void setAttachment(final Object attachment) {
         this.attachment = attachment;
     }
 
@@ -123,7 +123,7 @@ public class NEWTEvent extends java.util.EventObject {
      * </ul>
      * </p>
      */
-    public final void setConsumed(boolean consumed) {
+    public final void setConsumed(final boolean consumed) {
         if( consumed ) {
             setAttachment( consumedTag );
         } else if( consumedTag == attachment ) {
@@ -143,7 +143,7 @@ public class NEWTEvent extends java.util.EventObject {
         return sb.append("NEWTEvent[source:").append(getSource().getClass().getName()).append(", consumed ").append(isConsumed()).append(", when:").append(getWhen()).append(" d ").append((System.currentTimeMillis()-getWhen())).append("ms]");
     }
 
-    public static String toHexString(short hex) {
-        return "0x" + Integer.toHexString( (int)hex & 0x0000FFFF );
+    public static String toHexString(final short hex) {
+        return "0x" + Integer.toHexString( hex & 0x0000FFFF );
     }
 }
diff --git a/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java b/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java
index 7dd56ad..dd63953 100644
--- a/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java
+++ b/src/newt/classes/com/jogamp/newt/event/NEWTEventFiFo.java
@@ -32,10 +32,10 @@ import java.util.LinkedList;
 
 public class NEWTEventFiFo
 {
-    private LinkedList/*<NEWTEvent>*/ events = new LinkedList/*<NEWTEvent>*/();
+    private final LinkedList/*<NEWTEvent>*/ events = new LinkedList/*<NEWTEvent>*/();
 
     /** Add NEWTEvent to tail */
-    public synchronized void put(NEWTEvent event) {
+    public synchronized void put(final NEWTEvent event) {
         events.addLast(event);
         notifyAll();
     }
diff --git a/src/newt/classes/com/jogamp/newt/event/OutputEvent.java b/src/newt/classes/com/jogamp/newt/event/OutputEvent.java
index 80c7780..bd3a11a 100644
--- a/src/newt/classes/com/jogamp/newt/event/OutputEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/OutputEvent.java
@@ -31,7 +31,7 @@ package com.jogamp.newt.event;
 @SuppressWarnings("serial")
 public abstract class OutputEvent extends NEWTEvent
 {
- protected OutputEvent(short eventType, Object source, long when) {
+ protected OutputEvent(final short eventType, final Object source, final long when) {
     super(eventType, source, when);
  }
 
diff --git a/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java b/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
index 42f006f..9c7a4bc 100644
--- a/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
+++ b/src/newt/classes/com/jogamp/newt/event/PinchToZoomGesture.java
@@ -29,6 +29,8 @@ package com.jogamp.newt.event;
 
 import javax.media.nativewindow.NativeSurface;
 
+import com.jogamp.newt.event.MouseEvent.PointerClass;
+
 import jogamp.newt.Debug;
 
 /**
@@ -48,17 +50,39 @@ public class PinchToZoomGesture implements GestureHandler {
     /** A {@link GestureHandler.GestureEvent} denominating zoom. */
     @SuppressWarnings("serial")
     public static class ZoomEvent extends GestureEvent {
-        private final MouseEvent pe;
         private final float zoom;
-        public ZoomEvent(Object source, long when, int modifiers, GestureHandler handler, MouseEvent pe, float zoom) {
-            super(source, when, modifiers, handler);
-            this.pe = pe;
+        private final float delta;
+        private final float scale;
+        public ZoomEvent(final Object source, final long when, final int modifiers, final GestureHandler handler, final MouseEvent pe,
+                         final float zoom, final float delta, final float scale) {
+            super(source, when, modifiers, handler, pe);
             this.zoom = zoom;
+            this.delta = delta;
+            this.scale = scale;
         }
-        /** Triggering {@link MouseEvent} */
-        public final MouseEvent getTrigger() { return pe; }
         /** Zoom value lies within [0..2], with 1 as <i>1:1</i>. */
         public final float getZoom() { return zoom; }
+        /** Delta to last zoom value lies within [-1..1]. */
+        public final float getDelta() { return delta; }
+        /**
+         * Returns the scale used to determine the {@link #getZoom() zoom}
+         * and hence it's {@link #getDelta() delta} value,
+         * which semantics depends on the {@link #getPointerType() pointer type's} {@link PointerClass}.
+         * <p>
+         * For {@link PointerClass#Offscreen}, the scale is usually <code>1.0f</code> and denominates
+         * an abstract value without association to a physical value.
+         * </p>
+         * <p>
+         * For {@link PointerClass#Onscreen}, the scale varies and denominates
+         * the divisor of the distance the finger[s] have moved on the screen.
+         * Hence <code>scale * delta</code> reproduces the screen distance in pixels the finger[s] have moved.
+         * </p>
+         */
+        public final float getScale() { return scale; }
+
+        public final String toString() {
+            return "ZoomEvent[zoom "+zoom+", delta "+delta+", scale "+scale+", trigger "+getTrigger()+", handler "+getHandler()+"]";
+        }
     }
 
     private final NativeSurface surface;
@@ -74,7 +98,7 @@ public class PinchToZoomGesture implements GestureHandler {
      * @param surface the {@link NativeSurface}, which size is used to compute the relative zoom factor
      * @param allowMorePointer if false, allow only 2 pressed pointers (safe and recommended), otherwise accept other pointer to be pressed.
      */
-    public PinchToZoomGesture(NativeSurface surface, boolean allowMorePointer) {
+    public PinchToZoomGesture(final NativeSurface surface, final boolean allowMorePointer) {
         clear(true);
         this.surface = surface;
         this.allowMorePointer = allowMorePointer;
@@ -100,7 +124,7 @@ public class PinchToZoomGesture implements GestureHandler {
     }
 
     @Override
-    public void clear(boolean clearStarted) {
+    public void clear(final boolean clearStarted) {
         zoomEvent = null;
         if( clearStarted ) {
             zoomLastEdgeDist = 0;
@@ -131,7 +155,7 @@ public class PinchToZoomGesture implements GestureHandler {
         return zoom;
     }
     /** Set zoom value within [0..2], with 1 as <i>1:1</i>. */
-    public final void setZoom(float zoom) {
+    public final void setZoom(final float zoom) {
         this.zoom=zoom;
     }
 
@@ -149,7 +173,7 @@ public class PinchToZoomGesture implements GestureHandler {
         }
 
         final int eventType = pe.getEventType();
-        final boolean useY = surface.getWidth() >= surface.getHeight(); // use smallest dimension
+        final boolean useY = surface.getSurfaceWidth() >= surface.getSurfaceHeight(); // use smallest dimension
         switch ( eventType ) {
             case MouseEvent.EVENT_MOUSE_PRESSED: {
                 if( 1 == pointerDownCount ) {
@@ -197,13 +221,13 @@ public class PinchToZoomGesture implements GestureHandler {
                             } else if( zoomMode ) {
                                 final int d = Math.abs(edge0-edge1);
                                 final int dd = d - zoomLastEdgeDist;
-                                final float screenEdge = useY ? surface.getHeight() : surface.getWidth();
-                                final float incr = dd / screenEdge; // [-1..1]
+                                final float screenEdge = useY ? surface.getSurfaceHeight() : surface.getSurfaceWidth();
+                                final float delta = dd / screenEdge; // [-1..1]
                                 if(DEBUG) {
                                     System.err.println("XXX2: id0 "+pIds[0]+" -> idx0 "+p0Idx+", id1 "+pIds[1]+" -> idx1 "+p1Idx);
-                                    System.err.println("XXX3: d "+d+", ld "+zoomLastEdgeDist+", dd "+dd+", screen "+screenEdge+" -> incr "+incr+", zoom "+zoom+" -> "+(zoom+incr));
+                                    System.err.println("XXX3: d "+d+", ld "+zoomLastEdgeDist+", dd "+dd+", screen "+screenEdge+" -> incr "+delta+", zoom "+zoom+" -> "+(zoom+delta));
                                 }
-                                zoom += incr;
+                                zoom += delta;
                                 // clip value
                                 if( 2f < zoom ) {
                                     zoom = 2f;
@@ -211,7 +235,7 @@ public class PinchToZoomGesture implements GestureHandler {
                                     zoom = 0;
                                 }
                                 zoomLastEdgeDist = d;
-                                zoomEvent = new ZoomEvent(pe.getSource(), pe.getWhen(), pe.getModifiers(), this, pe, zoom);
+                                zoomEvent = new ZoomEvent(pe.getSource(), pe.getWhen(), pe.getModifiers(), this, pe, zoom, delta, screenEdge);
                             }
                         }
                     }
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java
index bbc1709..50eae96 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceKeyAdapter.java
@@ -36,17 +36,17 @@ public class TraceKeyAdapter implements KeyListener {
         this.downstream = null;
     }
 
-    public TraceKeyAdapter(KeyListener downstream) {
+    public TraceKeyAdapter(final KeyListener downstream) {
         this.downstream = downstream;
     }
 
     @Override
-    public void keyPressed(KeyEvent e) {
+    public void keyPressed(final KeyEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.keyPressed(e); }
     }
     @Override
-    public void keyReleased(KeyEvent e) {
+    public void keyReleased(final KeyEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.keyReleased(e); }
     }
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java
index db83760..e54c373 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceMouseAdapter.java
@@ -36,47 +36,47 @@ public class TraceMouseAdapter implements MouseListener {
     this.downstream = null;
  }
 
- public TraceMouseAdapter(MouseListener downstream) {
+ public TraceMouseAdapter(final MouseListener downstream) {
     this.downstream = downstream;
  }
 
  @Override
- public void mouseClicked(MouseEvent e) {
+ public void mouseClicked(final MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mouseClicked(e); }
  }
  @Override
- public void mouseEntered(MouseEvent e) {
+ public void mouseEntered(final MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mouseEntered(e); }
  }
  @Override
- public void mouseExited(MouseEvent e) {
+ public void mouseExited(final MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mouseExited(e); }
  }
  @Override
- public void mousePressed(MouseEvent e) {
+ public void mousePressed(final MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mousePressed(e); }
  }
  @Override
- public void mouseReleased(MouseEvent e) {
+ public void mouseReleased(final MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mouseReleased(e); }
  }
  @Override
- public void mouseMoved(MouseEvent e) {
+ public void mouseMoved(final MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mouseMoved(e); }
  }
  @Override
- public void mouseDragged(MouseEvent e) {
+ public void mouseDragged(final MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mouseDragged(e); }
  }
  @Override
- public void mouseWheelMoved(MouseEvent e) {
+ public void mouseWheelMoved(final MouseEvent e) {
     System.err.println(e);
     if(null!=downstream) { downstream.mouseWheelMoved(e); }
  }
diff --git a/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
index 7b844f0..299a6ff 100644
--- a/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/TraceWindowAdapter.java
@@ -36,42 +36,42 @@ public class TraceWindowAdapter implements WindowListener {
         this.downstream = null;
     }
 
-    public TraceWindowAdapter(WindowListener downstream) {
+    public TraceWindowAdapter(final WindowListener downstream) {
         this.downstream = downstream;
     }
 
     @Override
-    public void windowResized(WindowEvent e) {
+    public void windowResized(final WindowEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.windowResized(e); }
     }
     @Override
-    public void windowMoved(WindowEvent e) {
+    public void windowMoved(final WindowEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.windowMoved(e); }
     }
     @Override
-    public void windowDestroyNotify(WindowEvent e) {
+    public void windowDestroyNotify(final WindowEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.windowDestroyNotify(e); }
     }
     @Override
-    public void windowDestroyed(WindowEvent e) {
+    public void windowDestroyed(final WindowEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.windowDestroyed(e); }
     }
     @Override
-    public void windowGainedFocus(WindowEvent e) {
+    public void windowGainedFocus(final WindowEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.windowGainedFocus(e); }
     }
     @Override
-    public void windowLostFocus(WindowEvent e) {
+    public void windowLostFocus(final WindowEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.windowLostFocus(e); }
     }
     @Override
-    public void windowRepaint(WindowUpdateEvent e) {
+    public void windowRepaint(final WindowUpdateEvent e) {
         System.err.println(e);
         if(null!=downstream) { downstream.windowRepaint(e); }
     }
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
index ccc6274..c1bae40 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowAdapter.java
@@ -31,24 +31,24 @@ package com.jogamp.newt.event;
 public abstract class WindowAdapter implements WindowListener
 {
     @Override
-    public void windowResized(WindowEvent e) {
+    public void windowResized(final WindowEvent e) {
     }
     @Override
-    public void windowMoved(WindowEvent e) {
+    public void windowMoved(final WindowEvent e) {
     }
     @Override
-    public void windowDestroyNotify(WindowEvent e) {
+    public void windowDestroyNotify(final WindowEvent e) {
     }
     @Override
-    public void windowDestroyed(WindowEvent e) {
+    public void windowDestroyed(final WindowEvent e) {
     }
     @Override
-    public void windowGainedFocus(WindowEvent e) {
+    public void windowGainedFocus(final WindowEvent e) {
     }
     @Override
-    public void windowLostFocus(WindowEvent e) {
+    public void windowLostFocus(final WindowEvent e) {
     }
     @Override
-    public void windowRepaint(WindowUpdateEvent e) {
+    public void windowRepaint(final WindowUpdateEvent e) {
     }
 }
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowEvent.java b/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
index 2841fd0..021bd6c 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowEvent.java
@@ -49,11 +49,11 @@ public class WindowEvent extends NEWTEvent {
     public static final short EVENT_WINDOW_REPAINT = 105;
     public static final short EVENT_WINDOW_DESTROYED = 106;
 
-    public WindowEvent(short eventType, Object source, long when) {
+    public WindowEvent(final short eventType, final Object source, final long when) {
         super(eventType, source, when);
     }
 
-    public static String getEventTypeString(short type) {
+    public static String getEventTypeString(final short type) {
         switch(type) {
             case EVENT_WINDOW_RESIZED: return "WINDOW_RESIZED";
             case EVENT_WINDOW_MOVED: return "WINDOW_MOVED";
diff --git a/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java b/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java
index 9044517..4a5fecd 100644
--- a/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java
+++ b/src/newt/classes/com/jogamp/newt/event/WindowUpdateEvent.java
@@ -34,7 +34,7 @@ import javax.media.nativewindow.util.Rectangle;
 public class WindowUpdateEvent extends WindowEvent {
     final Rectangle bounds;
 
-    public WindowUpdateEvent(short eventType, Object source, long when, Rectangle bounds)
+    public WindowUpdateEvent(final short eventType, final Object source, final long when, final Rectangle bounds)
     {
         super(eventType, source, when);
         this.bounds = bounds;
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java
index 864db1f..a49c10a 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTAdapter.java
@@ -28,6 +28,8 @@
 
 package com.jogamp.newt.event.awt;
 
+import javax.media.nativewindow.NativeSurfaceHolder;
+
 import jogamp.newt.Debug;
 
 /**
@@ -117,37 +119,44 @@ public abstract class AWTAdapter implements java.util.EventListener
 
     com.jogamp.newt.event.NEWTEventListener newtListener;
     com.jogamp.newt.Window newtWindow;
+    NativeSurfaceHolder nsHolder;
     boolean consumeAWTEvent;
     protected boolean isSetup;
 
     /**
-     * Simply wrap aroung a NEWT EventListener, exposed as an AWT EventListener.<br>
+     * Create a proxy adapter, wrapping around an NEWT EventListener, exposed as an AWT EventListener,<br>
+     * where the given {@link NativeSurfaceHolder} impersonates the event's source.
      * The NEWT EventListener will be called when an event happens.<br>
      */
-    protected AWTAdapter(com.jogamp.newt.event.NEWTEventListener newtListener) {
+    protected AWTAdapter(final com.jogamp.newt.event.NEWTEventListener newtListener, final NativeSurfaceHolder nsProxy) {
         if(null==newtListener) {
-            throw new RuntimeException("Argument newtListener is null");
+            throw new IllegalArgumentException("Argument newtListener is null");
+        }
+        if(null==nsProxy) {
+            throw new IllegalArgumentException("Argument nwProxy is null");
         }
         this.newtListener = newtListener;
         this.newtWindow = null;
+        this.nsHolder = nsProxy;
         this.consumeAWTEvent = false;
         this.isSetup = true;
     }
 
     /**
-     * Wrap aroung a NEWT EventListener, exposed as an AWT EventListener,<br>
-     * where the given NEWT Window impersonates as the event's source.
+     * Create a proxy adapter, wrapping around an NEWT EventListener, exposed as an AWT EventListener,<br>
+     * where the given {@link com.jogamp.newt.Window NEWT Window}, a  {@link NativeSurfaceHolder}, impersonates the event's source.
      * The NEWT EventListener will be called when an event happens.<br>
      */
-    protected AWTAdapter(com.jogamp.newt.event.NEWTEventListener newtListener, com.jogamp.newt.Window newtProxy) {
+    protected AWTAdapter(final com.jogamp.newt.event.NEWTEventListener newtListener, final com.jogamp.newt.Window newtProxy) {
         if(null==newtListener) {
-            throw new RuntimeException("Argument newtListener is null");
+            throw new IllegalArgumentException("Argument newtListener is null");
         }
         if(null==newtProxy) {
-            throw new RuntimeException("Argument newtProxy is null");
+            throw new IllegalArgumentException("Argument newtProxy is null");
         }
         this.newtListener = newtListener;
         this.newtWindow = newtProxy;
+        this.nsHolder = newtProxy;
         this.consumeAWTEvent = false;
         this.isSetup = true;
     }
@@ -156,8 +165,9 @@ public abstract class AWTAdapter implements java.util.EventListener
      * Create a pipeline adapter, AWT EventListener.<br>
      * Once attached to an AWT component, it sends the converted AWT events to the NEWT downstream window.<br>
      * This is only supported with EDT enabled!
+     * @throws IllegalStateException if EDT is not enabled
      */
-    protected AWTAdapter(com.jogamp.newt.Window downstream) {
+    protected AWTAdapter(final com.jogamp.newt.Window downstream) throws IllegalStateException {
         this();
         setDownstream(downstream);
     }
@@ -171,37 +181,71 @@ public abstract class AWTAdapter implements java.util.EventListener
      * Setup a pipeline adapter, AWT EventListener.<br>
      * Once attached to an AWT component, it sends the converted AWT events to the NEWT downstream window.<br>
      * This is only supported with EDT enabled!
+     * @throws IllegalStateException if EDT is not enabled
      */
-    public synchronized AWTAdapter setDownstream(com.jogamp.newt.Window downstream) {
+    public synchronized AWTAdapter setDownstream(final com.jogamp.newt.Window downstream) throws IllegalStateException {
         if(null==downstream) {
             throw new RuntimeException("Argument downstream is null");
         }
         this.newtListener = null;
         this.newtWindow = downstream;
-        this.consumeAWTEvent = false;
+        this.nsHolder = downstream;
         if( null == newtWindow.getScreen().getDisplay().getEDTUtil() ) {
-            throw new RuntimeException("EDT not enabled");
+            throw new IllegalStateException("EDT not enabled");
         }
         this.isSetup = true;
         return this;
     }
 
-    /** Removes all references, downstream and NEWT-EventListener. */
+    /**
+     * Removes all references, downstream and NEWT-EventListener.
+     * <p>
+     * Also sets the internal <code>setup</code> flag and {@link #setConsumeAWTEvent(boolean)} to <code>false</code>.
+     * </p>
+     */
     public synchronized AWTAdapter clear() {
         this.newtListener = null;
         this.newtWindow = null;
+        this.nsHolder = null;
         this.isSetup = false;
+        this.consumeAWTEvent = false;
         return this;
     }
 
-    public final synchronized void setConsumeAWTEvent(boolean v) {
+    public final synchronized void setConsumeAWTEvent(final boolean v) {
         this.consumeAWTEvent = v;
     }
 
+    /**
+     * Returns the {@link NativeSurfaceHolder} acting {@link #AWTAdapter(com.jogamp.newt.Window) as downstream},
+     * {@link #AWTAdapter(com.jogamp.newt.event.NEWTEventListener, com.jogamp.newt.Window) NEWT window proxy}
+     * or as an {@link #AWTAdapter(com.jogamp.newt.event.NEWTEventListener, NativeSurfaceHolder) NativeSurfaceHolder proxy}.
+     * <p>
+     * Returned value is never null.
+     * </p>
+     */
+    public final synchronized NativeSurfaceHolder getNativeSurfaceHolder() {
+        return nsHolder;
+    }
+
+    /**
+     * Returns the {@link com.jogamp.newt.Window NEWT Window} acting {@link #AWTAdapter(com.jogamp.newt.Window) as downstream}
+     * or as a {@link #AWTAdapter(com.jogamp.newt.event.NEWTEventListener, com.jogamp.newt.Window) NEWT window proxy}.
+     * <p>
+     * Returned value maybe null if instance is used to be a
+     * {@link #AWTAdapter(com.jogamp.newt.event.NEWTEventListener, NativeSurfaceHolder) NativeSurfaceHolder proxy}.
+     * </p>
+     */
     public final synchronized com.jogamp.newt.Window getNewtWindow() {
         return newtWindow;
     }
 
+    /**
+     * Returns the {@link com.jogamp.newt.event.NEWTEventListener NEWT event-listener} if instance
+     * is used as an {@link #AWTAdapter(com.jogamp.newt.event.NEWTEventListener, NativeSurfaceHolder) NativeSurfaceHolder proxy}
+     * or {@link #AWTAdapter(com.jogamp.newt.event.NEWTEventListener, com.jogamp.newt.Window) NEWT window proxy},
+     * otherwise method returns <code>null</code>.
+     */
     public final synchronized com.jogamp.newt.event.NEWTEventListener getNewtEventListener() {
         return newtListener;
     }
@@ -218,12 +262,45 @@ public abstract class AWTAdapter implements java.util.EventListener
     public abstract AWTAdapter removeFrom(java.awt.Component awtComponent);
 
     /**
-     * Enqueues the event to the {@link #getNewtWindow()} is not null.
+     * Return value for {@link AWTAdapter#processEvent(boolean, com.jogamp.newt.event.NEWTEvent) event processing}.
      */
-    void enqueueEvent(boolean wait, com.jogamp.newt.event.NEWTEvent event) {
+    static enum EventProcRes {
+        /** Event shall be dispatched appropriately */
+        DISPATCH,
+        /** Event has been enqueued */
+        ENQUEUED,
+        /** No known processing method applies */
+        NOP
+    }
+
+    /**
+     * Process the event.
+     * <p>
+     * If {@link #getNewtEventListener()} is not <code>null</code>,
+     * {@link EventProcRes#DISPATCH DISPATCH} is returned and caller shall dispatch the event appropriately.
+     * </p>
+     * <p>
+     * If {@link #getNewtWindow()} is not <code>null</code>,
+     * {@link EventProcRes#ENQUEUED ENQUEUED} is returned and the event has been {@link com.jogamp.newt.Window#enqueueEvent(boolean, com.jogamp.newt.event.NEWTEvent) enqueued already}.
+     * </p>
+     * <p>
+     * If none of the above matches, {@link EventProcRes#NOP NOP} is returned and none of the above processing method applies.
+     * </p>
+     *
+     * @param wait In case the event will be {@link EventProcRes#ENQUEUED ENQUEUED},
+     *             passing <code>true</code> will block until the event has been processed, otherwise method returns immediately.
+     * @param event The {@link com.jogamp.newt.event.NEWTEvent event} to enqueue.
+     * @return One of the {@link EventProcRes} values, see above.
+     */
+    EventProcRes processEvent(final boolean wait, final com.jogamp.newt.event.NEWTEvent event) {
+        if(null != newtListener) {
+            return EventProcRes.DISPATCH;
+        }
         if( null != newtWindow ) {
             newtWindow.enqueueEvent(wait, event);
+            return EventProcRes.ENQUEUED;
         }
+        return EventProcRes.NOP;
     }
 }
 
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java
index d4226f5..4f11e87 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTKeyAdapter.java
@@ -28,6 +28,8 @@
 
 package com.jogamp.newt.event.awt;
 
+import javax.media.nativewindow.NativeSurfaceHolder;
+
 import jogamp.newt.awt.event.AWTNewtEventFactory;
 
 /**
@@ -37,15 +39,15 @@ import jogamp.newt.awt.event.AWTNewtEventFactory;
  */
 public class AWTKeyAdapter extends AWTAdapter implements java.awt.event.KeyListener
 {
-    public AWTKeyAdapter(com.jogamp.newt.event.KeyListener newtListener) {
-        super(newtListener);
+    public AWTKeyAdapter(final com.jogamp.newt.event.KeyListener newtListener, final NativeSurfaceHolder nsProxy) {
+        super(newtListener, nsProxy);
     }
 
-    public AWTKeyAdapter(com.jogamp.newt.event.KeyListener newtListener, com.jogamp.newt.Window newtProxy) {
+    public AWTKeyAdapter(final com.jogamp.newt.event.KeyListener newtListener, final com.jogamp.newt.Window newtProxy) {
         super(newtListener, newtProxy);
     }
 
-    public AWTKeyAdapter(com.jogamp.newt.Window downstream) {
+    public AWTKeyAdapter(final com.jogamp.newt.Window downstream) {
         super(downstream);
     }
 
@@ -54,47 +56,43 @@ public class AWTKeyAdapter extends AWTAdapter implements java.awt.event.KeyListe
     }
 
     @Override
-    public synchronized AWTAdapter addTo(java.awt.Component awtComponent) {
+    public synchronized AWTAdapter addTo(final java.awt.Component awtComponent) {
         awtComponent.addKeyListener(this);
         return this;
     }
 
     @Override
-    public synchronized AWTAdapter removeFrom(java.awt.Component awtComponent) {
+    public synchronized AWTAdapter removeFrom(final java.awt.Component awtComponent) {
         awtComponent.removeKeyListener(this);
         return this;
     }
 
     @Override
-    public synchronized void keyPressed(java.awt.event.KeyEvent e) {
+    public synchronized void keyPressed(final java.awt.event.KeyEvent e) {
         if( !isSetup ) { return; }
-        final com.jogamp.newt.event.KeyEvent event = AWTNewtEventFactory.createKeyEvent(com.jogamp.newt.event.KeyEvent.EVENT_KEY_PRESSED, e, newtWindow);
+        final com.jogamp.newt.event.KeyEvent event = AWTNewtEventFactory.createKeyEvent(com.jogamp.newt.event.KeyEvent.EVENT_KEY_PRESSED, e, nsHolder);
         if( consumeAWTEvent ) {
             e.consume();
         }
-        if(null!=newtListener) {
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.KeyListener)newtListener).keyPressed(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 
     @Override
-    public synchronized void keyReleased(java.awt.event.KeyEvent e) {
+    public synchronized void keyReleased(final java.awt.event.KeyEvent e) {
         if( !isSetup ) { return; }
-        final com.jogamp.newt.event.KeyEvent event = AWTNewtEventFactory.createKeyEvent(com.jogamp.newt.event.KeyEvent.EVENT_KEY_RELEASED, e, newtWindow);
+        final com.jogamp.newt.event.KeyEvent event = AWTNewtEventFactory.createKeyEvent(com.jogamp.newt.event.KeyEvent.EVENT_KEY_RELEASED, e, nsHolder);
         if( consumeAWTEvent ) {
             e.consume();
         }
-        if(null!=newtListener) {
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.KeyListener)newtListener).keyReleased(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 
     @Override
-    public synchronized void keyTyped(java.awt.event.KeyEvent e) {
+    public synchronized void keyTyped(final java.awt.event.KeyEvent e) {
         if( !isSetup ) { return; }
         if( consumeAWTEvent ) {
             e.consume();
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
index 8ad1fa6..d9531cd 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTMouseAdapter.java
@@ -28,21 +28,23 @@
 
 package com.jogamp.newt.event.awt;
 
+import javax.media.nativewindow.NativeSurfaceHolder;
+
 import jogamp.newt.awt.event.AWTNewtEventFactory;
 
 public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseListener,
                                                            java.awt.event.MouseMotionListener,
                                                            java.awt.event.MouseWheelListener
 {
-    public AWTMouseAdapter(com.jogamp.newt.event.MouseListener newtListener) {
-        super(newtListener);
+    public AWTMouseAdapter(final com.jogamp.newt.event.MouseListener newtListener, final NativeSurfaceHolder nsProxy) {
+        super(newtListener, nsProxy);
     }
 
-    public AWTMouseAdapter(com.jogamp.newt.event.MouseListener newtListener, com.jogamp.newt.Window newtProxy) {
+    public AWTMouseAdapter(final com.jogamp.newt.event.MouseListener newtListener, final com.jogamp.newt.Window newtProxy) {
         super(newtListener, newtProxy);
     }
 
-    public AWTMouseAdapter(com.jogamp.newt.Window downstream) {
+    public AWTMouseAdapter(final com.jogamp.newt.Window downstream) {
         super(downstream);
     }
 
@@ -51,7 +53,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
     }
 
     @Override
-    public synchronized AWTAdapter addTo(java.awt.Component awtComponent) {
+    public synchronized AWTAdapter addTo(final java.awt.Component awtComponent) {
         awtComponent.addMouseListener(this);
         awtComponent.addMouseMotionListener(this);
         awtComponent.addMouseWheelListener(this);
@@ -59,7 +61,7 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
     }
 
     @Override
-    public synchronized AWTAdapter removeFrom(java.awt.Component awtComponent) {
+    public synchronized AWTAdapter removeFrom(final java.awt.Component awtComponent) {
         awtComponent.removeMouseListener(this);
         awtComponent.removeMouseMotionListener(this);
         awtComponent.removeMouseWheelListener(this);
@@ -67,114 +69,98 @@ public class AWTMouseAdapter extends AWTAdapter implements java.awt.event.MouseL
     }
 
     @Override
-    public synchronized void mouseClicked(java.awt.event.MouseEvent e) {
+    public synchronized void mouseClicked(final java.awt.event.MouseEvent e) {
         if( !isSetup ) { return; }
-        com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
+        final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
         if( consumeAWTEvent ) {
             e.consume();
         }
-        if(null!=newtListener) {
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.MouseListener)newtListener).mouseClicked(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 
     @Override
-    public synchronized void mouseEntered(java.awt.event.MouseEvent e) {
+    public synchronized void mouseEntered(final java.awt.event.MouseEvent e) {
         if( !isSetup ) { return; }
-        com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
+        final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
         if( consumeAWTEvent ) {
             e.consume();
         }
-        if(null!=newtListener) {
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.MouseListener)newtListener).mouseEntered(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 
     @Override
-    public synchronized void mouseExited(java.awt.event.MouseEvent e) {
+    public synchronized void mouseExited(final java.awt.event.MouseEvent e) {
         if( !isSetup ) { return; }
-        com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
+        final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
         if( consumeAWTEvent ) {
             e.consume();
         }
-        if(null!=newtListener) {
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.MouseListener)newtListener).mouseExited(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 
     @Override
-    public synchronized void mousePressed(java.awt.event.MouseEvent e) {
+    public synchronized void mousePressed(final java.awt.event.MouseEvent e) {
         if( !isSetup ) { return; }
-        com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
+        final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
         if( consumeAWTEvent ) {
             e.consume();
         }
-        if(null!=newtListener) {
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.MouseListener)newtListener).mousePressed(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 
     @Override
-    public synchronized void mouseReleased(java.awt.event.MouseEvent e) {
+    public synchronized void mouseReleased(final java.awt.event.MouseEvent e) {
         if( !isSetup ) { return; }
-        com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
+        final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
         if( consumeAWTEvent ) {
             e.consume();
         }
-        if(null!=newtListener) {
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.MouseListener)newtListener).mouseReleased(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 
     @Override
-    public synchronized void mouseDragged(java.awt.event.MouseEvent e) {
+    public synchronized void mouseDragged(final java.awt.event.MouseEvent e) {
         if( !isSetup ) { return; }
-        com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
+        final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
         if( consumeAWTEvent ) {
             e.consume();
         }
-        if(null!=newtListener) {
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.MouseListener)newtListener).mouseDragged(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 
     @Override
-    public synchronized void mouseMoved(java.awt.event.MouseEvent e) {
+    public synchronized void mouseMoved(final java.awt.event.MouseEvent e) {
         if( !isSetup ) { return; }
-        com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
+        final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
         if( consumeAWTEvent ) {
             e.consume();
         }
-        if(null!=newtListener) {
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.MouseListener)newtListener).mouseMoved(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 
     @Override
-    public synchronized void mouseWheelMoved(java.awt.event.MouseWheelEvent e) {
+    public synchronized void mouseWheelMoved(final java.awt.event.MouseWheelEvent e) {
         if( !isSetup ) { return; }
-        com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, newtWindow);
+        final com.jogamp.newt.event.MouseEvent event = AWTNewtEventFactory.createMouseEvent(e, nsHolder);
         if( consumeAWTEvent ) {
             e.consume();
         }
-        if(null!=newtListener) {
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.MouseListener)newtListener).mouseWheelMoved(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 }
diff --git a/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java b/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java
index 2e5527e..a810540 100644
--- a/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java
+++ b/src/newt/classes/com/jogamp/newt/event/awt/AWTWindowAdapter.java
@@ -30,6 +30,8 @@ package com.jogamp.newt.event.awt;
 
 import java.awt.Dimension;
 
+import javax.media.nativewindow.NativeSurfaceHolder;
+
 import jogamp.newt.awt.event.AWTNewtEventFactory;
 
 public class AWTWindowAdapter
@@ -38,24 +40,25 @@ public class AWTWindowAdapter
 {
     WindowClosingListener windowClosingListener;
 
-    public AWTWindowAdapter(com.jogamp.newt.event.WindowListener newtListener) {
-        super(newtListener);
+    public AWTWindowAdapter(final com.jogamp.newt.event.WindowListener newtListener, final NativeSurfaceHolder nsProxy) {
+        super(newtListener, nsProxy);
     }
 
-    public AWTWindowAdapter(com.jogamp.newt.event.WindowListener newtListener, com.jogamp.newt.Window newtProxy) {
+    public AWTWindowAdapter(final com.jogamp.newt.event.WindowListener newtListener, final com.jogamp.newt.Window newtProxy) {
         super(newtListener, newtProxy);
     }
 
-    public AWTWindowAdapter(com.jogamp.newt.Window downstream) {
+    public AWTWindowAdapter(final com.jogamp.newt.Window downstream) {
         super(downstream);
     }
+
     public AWTWindowAdapter() {
         super();
     }
 
     @Override
-    public synchronized AWTAdapter addTo(java.awt.Component awtComponent) {
-        java.awt.Window win = getWindow(awtComponent);
+    public synchronized AWTAdapter addTo(final java.awt.Component awtComponent) {
+        final java.awt.Window win = getWindow(awtComponent);
         awtComponent.addComponentListener(this);
         awtComponent.addFocusListener(this);
         if( null != win && null == windowClosingListener ) {
@@ -68,8 +71,8 @@ public class AWTWindowAdapter
         return this;
     }
 
-    public synchronized AWTAdapter removeWindowClosingFrom(java.awt.Component awtComponent) {
-        java.awt.Window win = getWindow(awtComponent);
+    public synchronized AWTAdapter removeWindowClosingFrom(final java.awt.Component awtComponent) {
+        final java.awt.Window win = getWindow(awtComponent);
         if( null != win && null != windowClosingListener ) {
             win.removeWindowListener(windowClosingListener);
         }
@@ -77,7 +80,7 @@ public class AWTWindowAdapter
     }
 
     @Override
-    public synchronized AWTAdapter removeFrom(java.awt.Component awtComponent) {
+    public synchronized AWTAdapter removeFrom(final java.awt.Component awtComponent) {
         awtComponent.removeFocusListener(this);
         awtComponent.removeComponentListener(this);
         removeWindowClosingFrom(awtComponent);
@@ -91,44 +94,37 @@ public class AWTWindowAdapter
         while( null != comp && !(comp instanceof java.awt.Window) ) {
             comp = comp.getParent();
         }
-        if(comp instanceof java.awt.Window) {
-            return (java.awt.Window) comp;
-        }
-        return null;
+        return (java.awt.Window) comp; // either null or a 'java.awt.Window'
     }
 
     @Override
-    public synchronized void focusGained(java.awt.event.FocusEvent e) {
+    public synchronized void focusGained(final java.awt.event.FocusEvent e) {
         if( !isSetup ) { return; }
-        com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
+        final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("AWT: focusGained: "+e+" -> "+event);
         }
-        if(null!=newtListener) {
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.WindowListener)newtListener).windowGainedFocus(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 
     @Override
-    public synchronized void focusLost(java.awt.event.FocusEvent e) {
+    public synchronized void focusLost(final java.awt.event.FocusEvent e) {
         if( !isSetup ) { return; }
-        com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
+        final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("AWT: focusLost: "+e+" -> "+event);
         }
-        if(null!=newtListener) {
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.WindowListener)newtListener).windowLostFocus(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 
     @Override
-    public synchronized void componentResized(java.awt.event.ComponentEvent e) {
+    public synchronized void componentResized(final java.awt.event.ComponentEvent e) {
         if( !isSetup ) { return; }
-        com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
+        final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
         if(DEBUG_IMPLEMENTATION) {
             final java.awt.Component c = e.getComponent();
             final java.awt.Dimension sz = c.getSize();
@@ -144,29 +140,25 @@ public class AWTWindowAdapter
             }
             System.err.println("AWT: componentResized: "+sz+" ( "+insets+", "+sz2+" ), "+e+" -> "+event);
         }
-        if(null!=newtListener) {
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.WindowListener)newtListener).windowResized(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 
     @Override
-    public synchronized void componentMoved(java.awt.event.ComponentEvent e) {
+    public synchronized void componentMoved(final java.awt.event.ComponentEvent e) {
         if( !isSetup ) { return; }
-        com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
+        final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("AWT: componentMoved: "+e+" -> "+event);
         }
-        if(null!=newtListener) {
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.WindowListener)newtListener).windowMoved(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 
     @Override
-    public synchronized void componentShown(java.awt.event.ComponentEvent e) {
+    public synchronized void componentShown(final java.awt.event.ComponentEvent e) {
         if( !isSetup ) { return; }
         final java.awt.Component comp = e.getComponent();
         if(DEBUG_IMPLEMENTATION) {
@@ -185,7 +177,7 @@ public class AWTWindowAdapter
     }
 
     @Override
-    public synchronized void componentHidden(java.awt.event.ComponentEvent e) {
+    public synchronized void componentHidden(final java.awt.event.ComponentEvent e) {
         if( !isSetup ) { return; }
         final java.awt.Component comp = e.getComponent();
         if(DEBUG_IMPLEMENTATION) {
@@ -204,78 +196,70 @@ public class AWTWindowAdapter
     }
 
     @Override
-    public synchronized void windowActivated(java.awt.event.WindowEvent e) {
+    public synchronized void windowActivated(final java.awt.event.WindowEvent e) {
         if( !isSetup ) { return; }
-        com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
-        if(null!=newtListener) {
+        final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.WindowListener)newtListener).windowGainedFocus(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 
     @Override
-    public synchronized void windowClosed(java.awt.event.WindowEvent e) { }
+    public synchronized void windowClosed(final java.awt.event.WindowEvent e) { }
 
     @Override
-    public synchronized void windowClosing(java.awt.event.WindowEvent e) { }
+    public synchronized void windowClosing(final java.awt.event.WindowEvent e) { }
 
     @Override
-    public synchronized void windowDeactivated(java.awt.event.WindowEvent e) {
+    public synchronized void windowDeactivated(final java.awt.event.WindowEvent e) {
         if( !isSetup ) { return; }
-        com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
-        if(null!=newtListener) {
+        final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
+        if( EventProcRes.DISPATCH == processEvent(false, event) ) {
             ((com.jogamp.newt.event.WindowListener)newtListener).windowLostFocus(event);
-        } else {
-            enqueueEvent(false, event);
         }
     }
 
     @Override
-    public synchronized void windowDeiconified(java.awt.event.WindowEvent e) { }
+    public synchronized void windowDeiconified(final java.awt.event.WindowEvent e) { }
 
     @Override
-    public synchronized void windowIconified(java.awt.event.WindowEvent e) { }
+    public synchronized void windowIconified(final java.awt.event.WindowEvent e) { }
 
     @Override
-    public synchronized void windowOpened(java.awt.event.WindowEvent e) { }
+    public synchronized void windowOpened(final java.awt.event.WindowEvent e) { }
 
     class WindowClosingListener implements java.awt.event.WindowListener {
         @Override
-        public void windowClosing(java.awt.event.WindowEvent e) {
+        public void windowClosing(final java.awt.event.WindowEvent e) {
             synchronized( AWTWindowAdapter.this ) {
                 if( !isSetup ) { return; }
-                com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
-                if(null!=newtListener) {
+                final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
+                if( EventProcRes.DISPATCH == processEvent(true, event) ) {
                     ((com.jogamp.newt.event.WindowListener)newtListener).windowDestroyNotify(event);
-                } else {
-                    enqueueEvent(true, event);
                 }
             }
         }
         @Override
-        public void windowClosed(java.awt.event.WindowEvent e) {
+        public void windowClosed(final java.awt.event.WindowEvent e) {
             synchronized( AWTWindowAdapter.this ) {
                 if( !isSetup ) { return; }
-                com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, newtWindow);
-                if(null!=newtListener) {
+                final com.jogamp.newt.event.WindowEvent event = AWTNewtEventFactory.createWindowEvent(e, nsHolder);
+                if( EventProcRes.DISPATCH == processEvent(true, event) ) {
                     ((com.jogamp.newt.event.WindowListener)newtListener).windowDestroyed(event);
-                } else {
-                    enqueueEvent(true, event);
                 }
             }
         }
 
         @Override
-        public void windowActivated(java.awt.event.WindowEvent e) { }
+        public void windowActivated(final java.awt.event.WindowEvent e) { }
         @Override
-        public void windowDeactivated(java.awt.event.WindowEvent e) { }
+        public void windowDeactivated(final java.awt.event.WindowEvent e) { }
         @Override
-        public void windowDeiconified(java.awt.event.WindowEvent e) { }
+        public void windowDeiconified(final java.awt.event.WindowEvent e) { }
         @Override
-        public void windowIconified(java.awt.event.WindowEvent e) { }
+        public void windowIconified(final java.awt.event.WindowEvent e) { }
         @Override
-        public void windowOpened(java.awt.event.WindowEvent e) { }
+        public void windowOpened(final java.awt.event.WindowEvent e) { }
     }
 }
 
diff --git a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
index 4b74092..24a203b 100644
--- a/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/jogamp/newt/opengl/GLWindow.java
@@ -47,6 +47,7 @@ import javax.media.nativewindow.NativeWindowException;
 import javax.media.nativewindow.SurfaceUpdatedListener;
 import javax.media.nativewindow.util.InsetsImmutable;
 import javax.media.nativewindow.util.Point;
+import javax.media.nativewindow.util.Rectangle;
 import javax.media.opengl.FPSCounter;
 import javax.media.opengl.GL;
 import javax.media.opengl.GL3;
@@ -114,7 +115,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     /**
      * Constructor. Do not call this directly -- use {@link #create()} instead.
      */
-    protected GLWindow(Window window) {
+    protected GLWindow(final Window window) {
         super(null, null, false /* always handle device lifecycle ourselves */);
         this.window = (WindowImpl) window;
         this.window.setWindowDestroyNotifyAction( new Runnable() {
@@ -124,13 +125,13 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
             } } );
         window.addWindowListener(new WindowAdapter() {
                 @Override
-                public void windowRepaint(WindowUpdateEvent e) {
+                public void windowRepaint(final WindowUpdateEvent e) {
                     defaultWindowRepaintOp();
                 }
 
                 @Override
-                public void windowResized(WindowEvent e) {
-                    defaultWindowResizedOp(getWidth(), getHeight());
+                public void windowResized(final WindowEvent e) {
+                    defaultWindowResizedOp(getSurfaceWidth(), getSurfaceHeight());
                 }
 
             });
@@ -142,6 +143,11 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
         return window;
     }
 
+    @Override
+    public final RecursiveLock getUpstreamLock() {
+        return window.getLock();
+    }
+
     /**
      * Creates a new GLWindow attaching a new Window referencing a
      * new default Screen and default Display with the given GLCapabilities.
@@ -151,7 +157,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
      * </p>
      * The default Display will be reused if already instantiated.
      */
-    public static GLWindow create(GLCapabilitiesImmutable caps) {
+    public static GLWindow create(final GLCapabilitiesImmutable caps) {
         return new GLWindow(NewtFactory.createWindow(caps));
     }
 
@@ -163,7 +169,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
      * and {@link Screen#removeReference()}.
      * </p>
      */
-    public static GLWindow create(Screen screen, GLCapabilitiesImmutable caps) {
+    public static GLWindow create(final Screen screen, final GLCapabilitiesImmutable caps) {
         return new GLWindow(NewtFactory.createWindow(screen, caps));
     }
 
@@ -174,7 +180,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
      * and {@link Screen#removeReference()}.
      * </p>
      */
-    public static GLWindow create(Window window) {
+    public static GLWindow create(final Window window) {
         return new GLWindow(window);
     }
 
@@ -191,7 +197,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
      * and {@link Screen#removeReference()}.
      * </p>
      */
-    public static GLWindow create(NativeWindow parentNativeWindow, GLCapabilitiesImmutable caps) {
+    public static GLWindow create(final NativeWindow parentNativeWindow, final GLCapabilitiesImmutable caps) {
         return new GLWindow(NewtFactory.createWindow(parentNativeWindow, caps));
     }
 
@@ -204,7 +210,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+    public WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
         return window.setDefaultCloseOperation(op);
     }
 
@@ -213,7 +219,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     //
 
     @Override
-    public CapabilitiesChooser setCapabilitiesChooser(CapabilitiesChooser chooser) {
+    public CapabilitiesChooser setCapabilitiesChooser(final CapabilitiesChooser chooser) {
         return window.setCapabilitiesChooser(chooser);
     }
 
@@ -249,7 +255,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public final void setTitle(String title) {
+    public final void setTitle(final String title) {
         window.setTitle(title);
     }
 
@@ -264,7 +270,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public final void setPointerVisible(boolean mouseVisible) {
+    public final void setPointerVisible(final boolean mouseVisible) {
         window.setPointerVisible(mouseVisible);
     }
 
@@ -284,17 +290,17 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public final void confinePointer(boolean grab) {
+    public final void confinePointer(final boolean grab) {
         window.confinePointer(grab);
     }
 
     @Override
-    public final void setUndecorated(boolean value) {
+    public final void setUndecorated(final boolean value) {
         window.setUndecorated(value);
     }
 
     @Override
-    public final void warpPointer(int x, int y) {
+    public final void warpPointer(final int x, final int y) {
         window.warpPointer(x, y);
     }
     @Override
@@ -303,7 +309,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public final void setAlwaysOnTop(boolean value) {
+    public final void setAlwaysOnTop(final boolean value) {
         window.setAlwaysOnTop(value);
     }
 
@@ -313,12 +319,12 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public final void setFocusAction(FocusRunnable focusAction) {
+    public final void setFocusAction(final FocusRunnable focusAction) {
         window.setFocusAction(focusAction);
     }
 
     @Override
-    public void setKeyboardFocusHandler(KeyListener l) {
+    public void setKeyboardFocusHandler(final KeyListener l) {
         window.setKeyboardFocusHandler(l);
     }
 
@@ -328,7 +334,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public final void requestFocus(boolean wait) {
+    public final void requestFocus(final boolean wait) {
         window.requestFocus(wait);
     }
 
@@ -363,21 +369,71 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public final void setPosition(int x, int y) {
+    public final Rectangle getBounds() {
+        return window.getBounds();
+    }
+
+    @Override
+    public final int getSurfaceWidth() {
+        return window.getSurfaceWidth();
+    }
+
+    @Override
+    public final int getSurfaceHeight() {
+        return window.getSurfaceHeight();
+    }
+
+    @Override
+    public final int[] convertToWindowUnits(final int[] pixelUnitsAndResult) {
+        return window.convertToWindowUnits(pixelUnitsAndResult);
+    }
+
+    @Override
+    public final int[] convertToPixelUnits(final int[] windowUnitsAndResult) {
+        return window.convertToPixelUnits(windowUnitsAndResult);
+    }
+
+    @Override
+    public final void setSurfaceScale(final int[] pixelScale) {
+        window.setSurfaceScale(pixelScale);
+    }
+
+    @Override
+    public final int[] getRequestedSurfaceScale(final int[] result) {
+        return window.getRequestedSurfaceScale(result);
+    }
+
+    @Override
+    public final int[] getCurrentSurfaceScale(final int[] result) {
+        return window.getCurrentSurfaceScale(result);
+    }
+
+    @Override
+    public final int[] getNativeSurfaceScale(final int[] result) {
+        return window.getNativeSurfaceScale(result);
+    }
+
+    @Override
+    public final float[] getPixelsPerMM(final float[] ppmmStore) {
+        return window.getPixelsPerMM(ppmmStore);
+    }
+
+    @Override
+    public final void setPosition(final int x, final int y) {
         window.setPosition(x, y);
     }
     @Override
-    public void setTopLevelPosition(int x, int y) {
+    public void setTopLevelPosition(final int x, final int y) {
         window.setTopLevelPosition(x, y);
     }
 
     @Override
-    public final boolean setFullscreen(boolean fullscreen) {
+    public final boolean setFullscreen(final boolean fullscreen) {
         return window.setFullscreen(fullscreen);
     }
 
     @Override
-    public boolean setFullscreen(List<MonitorDevice> monitors) {
+    public boolean setFullscreen(final List<MonitorDevice> monitors) {
         return window.setFullscreen(monitors);
     }
 
@@ -398,27 +454,17 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public final ReparentOperation reparentWindow(NativeWindow newParent) {
-        return window.reparentWindow(newParent);
-    }
-
-    @Override
-    public final ReparentOperation reparentWindow(NativeWindow newParent, int x, int y, boolean forceDestroyCreate) {
-        return window.reparentWindow(newParent, x, y, forceDestroyCreate);
-    }
-
-    @Override
-    public final ReparentOperation reparentWindow(NativeWindow newParent, int x, int y, int hints) {
+    public final ReparentOperation reparentWindow(final NativeWindow newParent, final int x, final int y, final int hints) {
         return window.reparentWindow(newParent, x, y, hints);
     }
 
     @Override
-    public final boolean removeChild(NativeWindow win) {
+    public final boolean removeChild(final NativeWindow win) {
         return window.removeChild(win);
     }
 
     @Override
-    public final boolean addChild(NativeWindow win) {
+    public final boolean addChild(final NativeWindow win) {
         return window.addChild(win);
     }
 
@@ -432,26 +478,30 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public void setWindowDestroyNotifyAction(Runnable r) {
+    public void setWindowDestroyNotifyAction(final Runnable r) {
         window.setWindowDestroyNotifyAction(r);
     }
 
     @Override
-    public final void setVisible(boolean visible) {
+    public final void setVisible(final boolean visible) {
         window.setVisible(visible);
     }
 
     @Override
-    public void setVisible(boolean wait, boolean visible) {
+    public void setVisible(final boolean wait, final boolean visible) {
         window.setVisible(wait, visible);
     }
 
     @Override
-    public final void setSize(int width, int height) {
+    public final void setSize(final int width, final int height) {
         window.setSize(width, height);
     }
     @Override
-    public void setTopLevelSize(int width, int height) {
+    public final void setSurfaceSize(final int pixelWidth, final int pixelHeight) {
+        window.setSurfaceSize(pixelWidth, pixelHeight);
+    }
+    @Override
+    public void setTopLevelSize(final int width, final int height) {
         window.setTopLevelSize(width, height);
     }
 
@@ -461,7 +511,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public Point getLocationOnScreen(Point storage) {
+    public Point getLocationOnScreen(final Point storage) {
         return window.getLocationOnScreen(storage);
     }
 
@@ -469,7 +519,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     protected class GLLifecycleHook implements WindowImpl.LifecycleHook {
 
         @Override
-        public void preserveGLStateAtDestroy(boolean value) {
+        public void preserveGLStateAtDestroy(final boolean value) {
             GLWindow.this.preserveGLStateAtDestroy(value);
         }
 
@@ -481,7 +531,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
         @Override
         public synchronized void destroyActionInLock() {
             if(Window.DEBUG_IMPLEMENTATION) {
-                String msg = "GLWindow.destroy() "+WindowImpl.getThreadName()+", start";
+                final String msg = "GLWindow.destroy() "+WindowImpl.getThreadName()+", start";
                 System.err.println(msg);
                 //Exception e1 = new Exception(msg);
                 //e1.printStackTrace();
@@ -507,7 +557,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
         }
 
         @Override
-        public synchronized void setVisibleActionPost(boolean visible, boolean nativeWindowCreated) {
+        public synchronized void setVisibleActionPost(final boolean visible, final boolean nativeWindowCreated) {
             long t0;
             if(Window.DEBUG_IMPLEMENTATION) {
                 t0 = System.nanoTime();
@@ -516,7 +566,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
                 t0 = 0;
             }
 
-            if (null == drawable && visible && 0 != window.getWindowHandle() && 0<getWidth()*getHeight()) {
+            if (null == drawable && visible && 0 != window.getWindowHandle() && 0<getSurfaceWidth()*getSurfaceHeight()) {
                 if( ( null != context ) ) {
                     throw new InternalError("GLWindow.LifecycleHook.setVisiblePost: "+WindowImpl.getThreadName()+" - Null drawable, but valid context - "+GLWindow.this);
                 }
@@ -579,9 +629,9 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
                             if( anim.isAnimating() && null != animThread ) {
                                 try {
                                     animThread.stop();
-                                } catch(Throwable t) {
+                                } catch(final Throwable t) {
                                     if( DEBUG ) {
-                                        System.err.println("Catched "+t.getClass().getName()+": "+t.getMessage());
+                                        System.err.println("Caught "+t.getClass().getName()+": "+t.getMessage());
                                         t.printStackTrace();
                                     }
                                 }
@@ -598,11 +648,6 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     //
 
     @Override
-    protected final RecursiveLock getLock() {
-        return window.getLock();
-    }
-
-    @Override
     public void display() {
         if( !isNativeValid() || !isVisible() ) { return; }
 
@@ -626,7 +671,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
         } finally {
             lock.unlock();
         }
-        if( !done && ( 0 < getWidth() && 0 < getHeight() ) ) {
+        if( !done && ( 0 < getSurfaceWidth() && 0 < getSurfaceHeight() ) ) {
             // retry drawable and context creation, will itself issue resize -> display
             setVisible(true);
         }
@@ -660,7 +705,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     // NEWTEventConsumer
     //
     @Override
-    public boolean consumeEvent(NEWTEvent event) {
+    public boolean consumeEvent(final NEWTEvent event) {
         return window.consumeEvent(event);
     }
 
@@ -668,27 +713,27 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     // Window completion
     //
     @Override
-    public final void windowRepaint(int x, int y, int width, int height) {
+    public final void windowRepaint(final int x, final int y, final int width, final int height) {
         window.windowRepaint(x, y, width, height);
     }
 
     @Override
-    public final void enqueueEvent(boolean wait, com.jogamp.newt.event.NEWTEvent event) {
+    public final void enqueueEvent(final boolean wait, final com.jogamp.newt.event.NEWTEvent event) {
         window.enqueueEvent(wait, event);
     }
 
     @Override
-    public final void runOnEDTIfAvail(boolean wait, final Runnable task) {
+    public final void runOnEDTIfAvail(final boolean wait, final Runnable task) {
         window.runOnEDTIfAvail(wait, task);
     }
 
     @Override
-    public void sendWindowEvent(int eventType) {
+    public void sendWindowEvent(final int eventType) {
         window.sendWindowEvent(eventType);
     }
 
     @Override
-    public final WindowListener getWindowListener(int index) {
+    public final WindowListener getWindowListener(final int index) {
         return window.getWindowListener(index);
     }
 
@@ -698,22 +743,22 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public final void removeWindowListener(WindowListener l) {
+    public final void removeWindowListener(final WindowListener l) {
         window.removeWindowListener(l);
     }
 
     @Override
-    public final void addWindowListener(WindowListener l) {
+    public final void addWindowListener(final WindowListener l) {
         window.addWindowListener(l);
     }
 
     @Override
-    public final void addWindowListener(int index, WindowListener l) throws IndexOutOfBoundsException {
+    public final void addWindowListener(final int index, final WindowListener l) throws IndexOutOfBoundsException {
         window.addWindowListener(index, l);
     }
 
     @Override
-    public final void setKeyboardVisible(boolean visible) {
+    public final void setKeyboardVisible(final boolean visible) {
         window.setKeyboardVisible(visible);
     }
 
@@ -723,22 +768,22 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public final void addKeyListener(KeyListener l) {
+    public final void addKeyListener(final KeyListener l) {
         window.addKeyListener(l);
     }
 
     @Override
-    public final void addKeyListener(int index, KeyListener l) {
+    public final void addKeyListener(final int index, final KeyListener l) {
         window.addKeyListener(index, l);
     }
 
     @Override
-    public final void removeKeyListener(KeyListener l) {
+    public final void removeKeyListener(final KeyListener l) {
         window.removeKeyListener(l);
     }
 
     @Override
-    public final KeyListener getKeyListener(int index) {
+    public final KeyListener getKeyListener(final int index) {
         return window.getKeyListener(index);
     }
 
@@ -748,22 +793,22 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public final void addMouseListener(MouseListener l) {
+    public final void addMouseListener(final MouseListener l) {
         window.addMouseListener(l);
     }
 
     @Override
-    public final void addMouseListener(int index, MouseListener l) {
+    public final void addMouseListener(final int index, final MouseListener l) {
         window.addMouseListener(index, l);
     }
 
     @Override
-    public final void removeMouseListener(MouseListener l) {
+    public final void removeMouseListener(final MouseListener l) {
         window.removeMouseListener(l);
     }
 
     @Override
-    public final MouseListener getMouseListener(int index) {
+    public final MouseListener getMouseListener(final int index) {
         return window.getMouseListener(index);
     }
 
@@ -773,7 +818,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public void setDefaultGesturesEnabled(boolean enable) {
+    public void setDefaultGesturesEnabled(final boolean enable) {
         window.setDefaultGesturesEnabled(enable);
     }
     @Override
@@ -781,27 +826,27 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
         return window.areDefaultGesturesEnabled();
     }
     @Override
-    public final void addGestureHandler(GestureHandler gh) {
+    public final void addGestureHandler(final GestureHandler gh) {
         window.addGestureHandler(gh);
     }
     @Override
-    public final void addGestureHandler(int index, GestureHandler gh) {
+    public final void addGestureHandler(final int index, final GestureHandler gh) {
         window.addGestureHandler(index, gh);
     }
     @Override
-    public final void removeGestureHandler(GestureHandler gh) {
+    public final void removeGestureHandler(final GestureHandler gh) {
         window.removeGestureHandler(gh);
     }
     @Override
-    public final void addGestureListener(GestureHandler.GestureListener gl) {
+    public final void addGestureListener(final GestureHandler.GestureListener gl) {
         window.addGestureListener(-1, gl);
     }
     @Override
-    public final void addGestureListener(int index, GestureHandler.GestureListener gl) {
+    public final void addGestureListener(final int index, final GestureHandler.GestureListener gl) {
         window.addGestureListener(index, gl);
     }
     @Override
-    public final void removeGestureListener(GestureHandler.GestureListener gl) {
+    public final void removeGestureListener(final GestureHandler.GestureListener gl) {
         window.removeGestureListener(gl);
     }
 
@@ -836,22 +881,22 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     }
 
     @Override
-    public final void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+    public final void removeSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
         window.removeSurfaceUpdatedListener(l);
     }
 
     @Override
-    public final void addSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+    public final void addSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
         window.addSurfaceUpdatedListener(l);
     }
 
     @Override
-    public final void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
+    public final void addSurfaceUpdatedListener(final int index, final SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
         window.addSurfaceUpdatedListener(index, l);
     }
 
     @Override
-    public final void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+    public final void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
         window.surfaceUpdated(updater, ns, when);
     }
 
@@ -885,7 +930,7 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
     /**
      * A most simple JOGL AWT test entry
      */
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         final boolean forceES2;
         final boolean forceES3;
         final boolean forceGL3;
@@ -939,45 +984,45 @@ public class GLWindow extends GLAutoDrawableBase implements GLAutoDrawable, Wind
         final GLCapabilitiesImmutable caps = new GLCapabilities( glp );
         System.err.println("Requesting: "+caps);
 
-        GLWindow glWindow = GLWindow.create(caps);
+        final GLWindow glWindow = GLWindow.create(caps);
         glWindow.setSize(128, 128);
 
         glWindow.addGLEventListener(new GLEventListener() {
             @Override
-            public void init(GLAutoDrawable drawable) {
-                GL gl = drawable.getGL();
+            public void init(final GLAutoDrawable drawable) {
+                final GL gl = drawable.getGL();
                 System.err.println(JoglVersion.getGLInfo(gl, null));
                 System.err.println("Requested: "+drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities());
                 System.err.println("Chosen   : "+drawable.getChosenGLCapabilities());
                 System.err.println("GL impl. class "+gl.getClass().getName());
                 if( gl.isGL4ES3() ) {
-                    GL4ES3 _gl = gl.getGL4ES3();
+                    final GL4ES3 _gl = gl.getGL4ES3();
                     System.err.println("GL4ES3 retrieved, impl. class "+_gl.getClass().getName());
                 }
                 if( gl.isGL3() ) {
-                    GL3 _gl = gl.getGL3();
+                    final GL3 _gl = gl.getGL3();
                     System.err.println("GL3 retrieved, impl. class "+_gl.getClass().getName());
                 }
                 if( gl.isGLES3() ) {
-                    GLES3 _gl = gl.getGLES3();
+                    final GLES3 _gl = gl.getGLES3();
                     System.err.println("GLES3 retrieved, impl. class "+_gl.getClass().getName());
                 }
                 if( gl.isGLES2() ) {
-                    GLES2 _gl = gl.getGLES2();
+                    final GLES2 _gl = gl.getGLES2();
                     System.err.println("GLES2 retrieved, impl. class "+_gl.getClass().getName());
                 }
             }
 
             @Override
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
             }
 
             @Override
-            public void display(GLAutoDrawable drawable) {
+            public void display(final GLAutoDrawable drawable) {
             }
 
             @Override
-            public void dispose(GLAutoDrawable drawable) {
+            public void dispose(final GLAutoDrawable drawable) {
             }
         });
 
diff --git a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
index 6f4be75..76af2d0 100644
--- a/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
+++ b/src/newt/classes/com/jogamp/newt/swt/NewtCanvasSWT.java
@@ -82,6 +82,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
     private volatile Window newtChild = null;
     private volatile boolean newtChildReady = false; // ready if SWTEDTUtil is set and newtChild parented
     private volatile boolean postSetSize = false; // pending resize
+    private volatile boolean postSetPos = false; // pending pos
 
     /**
      * Creates an instance using {@link #NewtCanvasSWT(Composite, int, Window)}
@@ -120,7 +121,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
      * @param style additional styles to SWT#NO_BACKGROUND
      * @param child optional preassigned {@link #Window}, maybe null
      */
-    public NewtCanvasSWT(final Composite parent, final int style, Window child) {
+    public NewtCanvasSWT(final Composite parent, final int style, final Window child) {
         super(parent, style | SWT.NO_BACKGROUND);
 
         SWTAccessor.setRealized(this, true);
@@ -137,44 +138,69 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
 
         final Listener listener = new Listener () {
             @Override
-            public void handleEvent (Event event) {
+            public void handleEvent (final Event event) {
                 switch (event.type) {
                 case SWT.Paint:
+                    if( DEBUG ) {
+                        System.err.println("NewtCanvasSWT.Event.PAINT, "+event);
+                    }
                     if( null != nativeWindow || validateNative() ) {
                         if( newtChildReady ) {
                             if( postSetSize ) {
                                 newtChild.setSize(clientArea.width, clientArea.height);
                                 postSetSize = false;
                             }
+                            if( postSetPos ) {
+                                newtChild.setPosition(clientArea.x, clientArea.y);
+                                postSetPos = false;
+                            }
                             newtChild.windowRepaint(0, 0, clientArea.width, clientArea.height);
                         }
                     }
                     break;
+                case SWT.Move:
+                    if( DEBUG ) {
+                        System.err.println("NewtCanvasSWT.Event.MOVE, "+event);
+                    }
+                    // updatePosSizeCheck();
+                    break;
                 case SWT.Resize:
+                    if( DEBUG ) {
+                        System.err.println("NewtCanvasSWT.Event.RESIZE, "+event);
+                    }
                     updateSizeCheck();
                     break;
                 case SWT.Dispose:
+                    if( DEBUG ) {
+                        System.err.println("NewtCanvasSWT.Event.DISPOSE, "+event);
+                    }
                     NewtCanvasSWT.this.dispose();
                     break;
+                default:
+                    if( DEBUG ) {
+                        System.err.println("NewtCanvasSWT.Event.misc: "+event.type+", "+event);
+                    }
                 }
             }
         };
+        // addListener (SWT.Move, listener);
         addListener (SWT.Resize, listener);
         addListener (SWT.Paint, listener);
         addListener (SWT.Dispose, listener);
     }
+
     @Override
-    public void setBounds(int x, int y, int w, int h) {
-    	// propagate the setBounds method coming from parent elements to this element
-    	// and force newtChild to update its position in OSX
-    	super.setBounds(x,y,w,h);
-    	if(SWTAccessor.isOSX) {
-    	    newtChild.setPosition(x, y);
-    		clientArea.width = w;
-    		clientArea.height = h;
-    		updateSizeCheck();
+    public void setBounds(final int x, final int y, final int width, final int height) {
+    	super.setBounds(x, y, width, height);
+    	if( DEBUG ) {
+    	    System.err.println("NewtCanvasSWT.setBounds: "+x+"/"+y+" "+width+"x"+height);
+    	}
+    	if( SWTAccessor.isOSX ) {
+            // Force newtChild to update its size and position (OSX only)
+    	    updatePosSizeCheck(x, y, width, height, true /* updatePos */);
     	}
     }
+
     /** assumes nativeWindow == null ! */
     protected final boolean validateNative() {
         updateSizeCheck();
@@ -207,7 +233,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
 
             nativeWindow = new SWTNativeWindow(config, nativeWindowHandle);
             reparentWindow( true );
-        	if(SWTAccessor.isOSX) {
+        	if( SWTAccessor.isOSX && newtChildReady ) {
         	    // initial positioning for OSX, called when the window is created
         	    newtChild.setPosition(getLocation().x, getLocation().y);
         	}
@@ -217,22 +243,49 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
     }
 
     protected final void updateSizeCheck() {
-        final Rectangle oClientArea = clientArea;
         final Rectangle nClientArea = getClientArea();
-        if ( nClientArea != null &&
-             ( nClientArea.width != oClientArea.width || nClientArea.height != oClientArea.height )
-           ) {
-            clientArea = nClientArea; // write back new value
-            if(DEBUG) {
-                final long nsh = newtChildReady ? newtChild.getSurfaceHandle() : 0;
-                System.err.println("NewtCanvasSWT.sizeChanged: ("+Thread.currentThread().getName()+"): newtChildReady "+newtChildReady+", "+nClientArea.x+"/"+nClientArea.y+" "+nClientArea.width+"x"+nClientArea.height+" - surfaceHandle 0x"+Long.toHexString(nsh));
+        if( null != nClientArea ) {
+            updatePosSizeCheck(nClientArea.x, nClientArea.y, nClientArea.width, nClientArea.height, false /* updatePos */);
+        }
+    }
+    protected final void updatePosSizeCheck() {
+        final Rectangle nClientArea = getClientArea();
+        if( null != nClientArea ) {
+            updatePosSizeCheck(nClientArea.x, nClientArea.y, nClientArea.width, nClientArea.height, true /* updatePos */);
+        }
+    }
+    protected final void updatePosSizeCheck(final int newX, final int newY, final int newWidth, final int newHeight, final boolean updatePos) {
+        final boolean sizeChanged, posChanged;
+        final Rectangle nClientArea;
+        {
+            final Rectangle oClientArea = clientArea;
+            sizeChanged = newWidth != oClientArea.width || newHeight != oClientArea.height;
+            posChanged = newX != oClientArea.x || newY != oClientArea.y;
+            if( sizeChanged || posChanged ) {
+                nClientArea = new Rectangle(updatePos ? newX : oClientArea.x, updatePos ? newY : oClientArea.y, newWidth, newHeight);
+                clientArea = nClientArea;
+            } else {
+                nClientArea = clientArea;
             }
+        }
+        if(DEBUG) {
+            final long nsh = newtChildReady ? newtChild.getSurfaceHandle() : 0;
+            System.err.println("NewtCanvasSWT.updatePosSizeCheck: sizeChanged "+sizeChanged+", posChanged "+posChanged+", updatePos "+updatePos+", ("+Thread.currentThread().getName()+"): newtChildReady "+newtChildReady+", "+nClientArea.x+"/"+nClientArea.y+" "+nClientArea.width+"x"+nClientArea.height+" - surfaceHandle 0x"+Long.toHexString(nsh));
+        }
+        if( sizeChanged ) {
             if( newtChildReady ) {
-                newtChild.setSize(clientArea.width, clientArea.height);
+                newtChild.setSize(nClientArea.width, nClientArea.height);
             } else {
                 postSetSize = true;
             }
         }
+        if( updatePos && posChanged ) {
+            if( newtChildReady ) {
+                newtChild.setPosition(nClientArea.x, nClientArea.y);
+            } else {
+                postSetPos = true;
+            }
+        }
     }
 
     @Override
@@ -269,9 +322,14 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
     }
 
     private Point getParentLocationOnScreen() {
-    	org.eclipse.swt.graphics.Point parentLoc = getParent().toDisplay(0,0);
-        return new Point(parentLoc.x,parentLoc.y);
+        final org.eclipse.swt.graphics.Point[] parentLoc = new org.eclipse.swt.graphics.Point[] { null };
+        SWTAccessor.invoke(true, new Runnable() {
+            public void run() {
+                parentLoc[0] = getParent().toDisplay(0,0);
+            } } );
+        return new Point(parentLoc[0].x, parentLoc[0].y);
     }
+
     /** @return this SWT Canvas NativeWindow representation, may be null in case it has not been realized. */
     public NativeWindow getNativeWindow() { return nativeWindow; }
 
@@ -281,7 +339,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
     }
 
     @Override
-    public WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+    public WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
         return newtChildCloseOp = op; // TODO: implement ?!
     }
 
@@ -334,11 +392,11 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
     }
 
     @Override
-    public boolean setParent(Composite parent) {
+    public boolean setParent(final Composite parent) {
         return super.setParent(parent);
     }
 
-    /* package */ void configureNewtChild(boolean attach) {
+    /* package */ void configureNewtChild(final boolean attach) {
         newtChildReady = attach;
         if( null != newtChild ) {
             newtChild.setKeyboardFocusHandler(null);
@@ -351,7 +409,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         }
     }
 
-    void reparentWindow(boolean add) {
+    void reparentWindow(final boolean add) {
         if( null == newtChild ) {
             return; // nop
         }
@@ -411,7 +469,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         private final long nativeWindowHandle;
         private final InsetsImmutable insets; // only required to allow proper client position calculation on OSX
 
-        public SWTNativeWindow(AbstractGraphicsConfiguration config, long nativeWindowHandle) {
+        public SWTNativeWindow(final AbstractGraphicsConfiguration config, final long nativeWindowHandle) {
             this.config = config;
             this.nativeWindowHandle = nativeWindowHandle;
             if( SWTAccessor.isOSX ) {
@@ -445,14 +503,14 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         }
 
         @Override
-        public void addSurfaceUpdatedListener(SurfaceUpdatedListener l) { }
+        public void addSurfaceUpdatedListener(final SurfaceUpdatedListener l) { }
 
         @Override
-        public void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
+        public void addSurfaceUpdatedListener(final int index, final SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
         }
 
         @Override
-        public void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) { }
+        public void removeSurfaceUpdatedListener(final SurfaceUpdatedListener l) { }
 
         @Override
         public long getSurfaceHandle() {
@@ -461,15 +519,38 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
 
         @Override
         public int getWidth() {
-            return clientArea.width;
+            return getSurfaceWidth(); // FIXME: Use 'scale' or an actual window-width
         }
 
         @Override
         public int getHeight() {
+            return getSurfaceHeight(); // FIXME: Use 'scale' or an actual window-width
+        }
+
+        @Override
+        public final int[] convertToWindowUnits(final int[] pixelUnitsAndResult) {
+            return pixelUnitsAndResult; // FIXME HiDPI: use 'pixelScale'
+        }
+
+        @Override
+        public final int[] convertToPixelUnits(final int[] windowUnitsAndResult) {
+            return windowUnitsAndResult; // FIXME HiDPI: use 'pixelScale'
+        }
+
+        @Override
+        public int getSurfaceWidth() {
+            return clientArea.width;
+        }
+
+        @Override
+        public int getSurfaceHeight() {
             return clientArea.height;
         }
 
         @Override
+        public final NativeSurface getNativeSurface() { return this; }
+
+        @Override
         public AbstractGraphicsConfiguration getGraphicsConfiguration() {
             return config;
         }
@@ -485,7 +566,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         }
 
         @Override
-        public void surfaceUpdated(Object updater, NativeSurface ns, long when) { }
+        public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) { }
 
         @Override
         public void destroy() { }
@@ -516,7 +597,7 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         }
 
         @Override
-        public Point getLocationOnScreen(Point point) {
+        public Point getLocationOnScreen(final Point point) {
             final Point los; // client window location on screen
             if( SWTAccessor.isOSX ) {
             	// let getLOS provide the point where the child window may be placed
@@ -544,10 +625,10 @@ public class NewtCanvasSWT extends Canvas implements WindowClosingProtocol {
         }
     };
 
-    static String newtWinHandleToHexString(Window w) {
+    static String newtWinHandleToHexString(final Window w) {
         return null != w ? toHexString(w.getWindowHandle()) : "nil";
     }
-    static String toHexString(long l) {
+    static String toHexString(final long l) {
         return "0x"+Long.toHexString(l);
     }
 }
diff --git a/src/newt/classes/com/jogamp/newt/util/EDTUtil.java b/src/newt/classes/com/jogamp/newt/util/EDTUtil.java
index 582dc3e..58aa671 100644
--- a/src/newt/classes/com/jogamp/newt/util/EDTUtil.java
+++ b/src/newt/classes/com/jogamp/newt/util/EDTUtil.java
@@ -71,13 +71,13 @@ public interface EDTUtil {
      * and the caller should wait {@link #waitUntilStopped() until it's stopped}.
      * </p>
      *
-     * @return true if EDT has been successfully restarted, otherwise false
      * @throws IllegalStateException if EDT is running and not subject to be stopped, i.e. {@link #isRunning()} returns true
+     * @throws RuntimeException if EDT could not be started
      *
      * @see #invokeStop(boolean, java.lang.Runnable)
      * @see #waitUntilStopped()
      */
-    public boolean start() throws IllegalStateException;
+    public void start() throws IllegalStateException;
 
     /**
      * Returns true if the current thread is the event dispatch thread (EDT).
diff --git a/src/newt/classes/com/jogamp/newt/util/MainThread.java b/src/newt/classes/com/jogamp/newt/util/MainThread.java
index 049320b..80da1ce 100644
--- a/src/newt/classes/com/jogamp/newt/util/MainThread.java
+++ b/src/newt/classes/com/jogamp/newt/util/MainThread.java
@@ -45,6 +45,7 @@ import java.util.List;
 import javax.media.nativewindow.NativeWindowFactory;
 
 import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.common.util.ReflectionUtil;
 
 import jogamp.newt.Debug;
@@ -104,7 +105,7 @@ public class MainThread {
         NativeWindowFactory.initSingleton();
         NEWTJNILibLoader.loadNEWT();
         HINT_USE_MAIN_THREAD = !NativeWindowFactory.isAWTAvailable() ||
-                                Debug.getBooleanProperty("newt.MainThread.force", true);
+                                PropertyAccess.getBooleanProperty("newt.MainThread.force", true);
         osType = Platform.getOSType();
         isMacOSX = osType == Platform.OSType.MACOS;
         rootThreadGroup = getRootThreadGroup();
@@ -125,7 +126,7 @@ public class MainThread {
         return rootGroup;
     }
 
-    private static final Thread[] getAllThreads(int[] count) {
+    private static final Thread[] getAllThreads(final int[] count) {
         int tn;
         Thread[] threads = new Thread[ rootThreadGroup.activeCount() ];
         while ( ( tn = rootThreadGroup.enumerate( threads, true ) ) == threads.length ) {
@@ -135,9 +136,9 @@ public class MainThread {
         return threads;
     }
     private static final List<Thread> getNonDaemonThreads() {
-        List<Thread> res = new ArrayList<Thread>();
-        int[] tn = { 0 };
-        Thread[] threads = getAllThreads(tn);
+        final List<Thread> res = new ArrayList<Thread>();
+        final int[] tn = { 0 };
+        final Thread[] threads = getAllThreads(tn);
         for(int i = tn[0] - 1; i >= 0; i--) {
             final Thread thread = threads[i];
             try {
@@ -145,16 +146,16 @@ public class MainThread {
                     res.add(thread);
                     if(DEBUG) System.err.println("XXX0: "+thread.getName()+", "+thread);
                 }
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 t.printStackTrace();
             }
         }
         return res;
     }
-    private static final int getNonDaemonThreadCount(List<Thread> ignoreThreads) {
+    private static final int getNonDaemonThreadCount(final List<Thread> ignoreThreads) {
         int res = 0;
-        int[] tn = { 0 };
-        Thread[] threads = getAllThreads(tn);
+        final int[] tn = { 0 };
+        final Thread[] threads = getAllThreads(tn);
 
         for(int i = tn[0] - 1; i >= 0; i--) {
             final Thread thread = threads[i];
@@ -163,7 +164,7 @@ public class MainThread {
                     res++;
                     if(DEBUG) System.err.println("MainAction.run(): non daemon thread: "+thread);
                 }
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 t.printStackTrace();
             }
         }
@@ -177,7 +178,7 @@ public class MainThread {
         private final Method mainClassMain;
         private List<Thread> nonDaemonThreadsAtStart;
 
-        public UserApp(String mainClassName, String[] mainClassArgs) throws SecurityException, NoSuchMethodException, ClassNotFoundException {
+        public UserApp(final String mainClassName, final String[] mainClassArgs) throws SecurityException, NoSuchMethodException, ClassNotFoundException {
             super();
             this.mainClassName=mainClassName;
             this.mainClassArgs=mainClassArgs;
@@ -204,10 +205,10 @@ public class MainThread {
             try {
                 if(DEBUG) System.err.println("MainAction.run(): "+Thread.currentThread().getName()+" invoke "+mainClassName);
                 mainClassMain.invoke(null, new Object[] { mainClassArgs } );
-            } catch (InvocationTargetException ite) {
+            } catch (final InvocationTargetException ite) {
                 ite.getTargetException().printStackTrace();
                 return;
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 t.printStackTrace();
                 return;
             }
@@ -219,7 +220,7 @@ public class MainThread {
                     if(DEBUG) System.err.println("MainAction.run(): post user app, non daemon threads alive: "+ndtr);
                     try {
                         Thread.sleep(1000);
-                    } catch (InterruptedException e) {
+                    } catch (final InterruptedException e) {
                         e.printStackTrace();
                     }
                 }
@@ -237,7 +238,7 @@ public class MainThread {
                         if(DEBUG) {
                             System.err.println("MainAction.main(): "+Thread.currentThread()+" MainAction fin - stopNSApp.X");
                         }
-                    } catch (Exception e) {
+                    } catch (final Exception e) {
                         e.printStackTrace();
                     }
                 } else {
@@ -253,7 +254,7 @@ public class MainThread {
      * @throws ClassNotFoundException
      * @throws NoSuchMethodException
      * @throws SecurityException */
-    public static void main(String[] args) throws SecurityException, NoSuchMethodException, ClassNotFoundException {
+    public static void main(final String[] args) throws SecurityException, NoSuchMethodException, ClassNotFoundException {
         final Thread cur = Thread.currentThread();
 
         useMainThread = HINT_USE_MAIN_THREAD;
@@ -273,8 +274,8 @@ public class MainThread {
             return;
         }
 
-        String mainClassName=args[0];
-        String[] mainClassArgs=new String[args.length-1];
+        final String mainClassName=args[0];
+        final String[] mainClassArgs=new String[args.length-1];
         if(args.length>1) {
             System.arraycopy(args, 1, mainClassArgs, 0, args.length-1);
         }
@@ -289,7 +290,7 @@ public class MainThread {
         if ( useMainThread ) {
             try {
                 cur.setName(cur.getName()+"-MainThread");
-            } catch (Exception e) {}
+            } catch (final Exception e) {}
 
             // dispatch user's main thread ..
             mainAction.start();
@@ -301,7 +302,7 @@ public class MainThread {
                     }
                     ReflectionUtil.callStaticMethod(MACOSXDisplayClassName, "runNSApplication",
                         null, null, MainThread.class.getClassLoader());
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     e.printStackTrace();
                 }
             }
diff --git a/src/newt/classes/com/jogamp/newt/util/MonitorModeUtil.java b/src/newt/classes/com/jogamp/newt/util/MonitorModeUtil.java
index fdd7985..e5f8ff1 100644
--- a/src/newt/classes/com/jogamp/newt/util/MonitorModeUtil.java
+++ b/src/newt/classes/com/jogamp/newt/util/MonitorModeUtil.java
@@ -43,11 +43,11 @@ import javax.media.nativewindow.util.SurfaceSize;
  */
 public class MonitorModeUtil {
 
-    public static int getIndex(List<MonitorMode> monitorModes, MonitorMode search) {
+    public static int getIndex(final List<MonitorMode> monitorModes, final MonitorMode search) {
         return monitorModes.indexOf(search);
     }
 
-    public static int getIndexByHashCode(List<MonitorMode> monitorModes, MonitorMode search) {
+    public static int getIndexByHashCode(final List<MonitorMode> monitorModes, final MonitorMode search) {
         if( null!=monitorModes && monitorModes.size()>0 ) {
             for (int i=0; i<monitorModes.size(); i++) {
                 if ( search.hashCode() == monitorModes.get(i).hashCode() ) {
@@ -58,7 +58,7 @@ public class MonitorModeUtil {
         return -1;
     }
 
-    public static MonitorMode getByNativeSizeRateIdAndRotation(List<MonitorMode> monitorModes, MonitorMode.SizeAndRRate sizeAndRate, int modeId, int rotation) {
+    public static MonitorMode getByNativeSizeRateIdAndRotation(final List<MonitorMode> monitorModes, final MonitorMode.SizeAndRRate sizeAndRate, final int modeId, final int rotation) {
         if( null!=monitorModes && monitorModes.size()>0 ) {
             for (int i=0; i<monitorModes.size(); i++) {
                 final MonitorMode mode = monitorModes.get(i);
@@ -71,7 +71,7 @@ public class MonitorModeUtil {
     }
 
     /** Sort the given {@link MonitorMode} collection w/ {@link MonitorMode#compareTo(MonitorMode)} function. */
-    public static void sort(List<MonitorMode> monitorModes, boolean ascendingOrder) {
+    public static void sort(final List<MonitorMode> monitorModes, final boolean ascendingOrder) {
         if( ascendingOrder ) {
             Collections.sort(monitorModes);
         } else {
@@ -85,7 +85,7 @@ public class MonitorModeUtil {
      * @param surfaceSize
      * @return modes with exact {@link SurfaceSize}. May return zero sized list for non.
      */
-    public static List<MonitorMode> filterBySurfaceSize(List<MonitorMode> monitorModes, SurfaceSize surfaceSize) {
+    public static List<MonitorMode> filterBySurfaceSize(final List<MonitorMode> monitorModes, final SurfaceSize surfaceSize) {
         final List<MonitorMode> out = new ArrayList<MonitorMode>();
         if( null!=monitorModes && monitorModes.size()>0 ) {
             for (int i=0; null!=monitorModes && i<monitorModes.size(); i++) {
@@ -104,7 +104,7 @@ public class MonitorModeUtil {
      * @param rotation
      * @return modes with exact rotation. May return zero sized list for non.
      */
-    public static List<MonitorMode> filterByRotation(List<MonitorMode> monitorModes, int rotation) {
+    public static List<MonitorMode> filterByRotation(final List<MonitorMode> monitorModes, final int rotation) {
         final List<MonitorMode> out = new ArrayList<MonitorMode>();
         if( null!=monitorModes && monitorModes.size()>0 ) {
             for (int i=0; null!=monitorModes && i<monitorModes.size(); i++) {
@@ -123,7 +123,7 @@ public class MonitorModeUtil {
      * @param bitsPerPixel
      * @return modes with exact bpp. May return zero sized list for non.
      */
-    public static List<MonitorMode> filterByBpp(List<MonitorMode> monitorModes, int bitsPerPixel) {
+    public static List<MonitorMode> filterByBpp(final List<MonitorMode> monitorModes, final int bitsPerPixel) {
         final List<MonitorMode> out = new ArrayList<MonitorMode>();
         if( null!=monitorModes && monitorModes.size()>0 ) {
             for (int i=0; null!=monitorModes && i<monitorModes.size(); i++) {
@@ -142,7 +142,7 @@ public class MonitorModeUtil {
      * @param flags
      * @return modes with exact flags. May return zero sized list for non.
      */
-    public static List<MonitorMode> filterByFlags(List<MonitorMode> monitorModes, int flags) {
+    public static List<MonitorMode> filterByFlags(final List<MonitorMode> monitorModes, final int flags) {
         final List<MonitorMode> out = new ArrayList<MonitorMode>();
         if( null!=monitorModes && monitorModes.size()>0 ) {
             for (int i=0; null!=monitorModes && i<monitorModes.size(); i++) {
@@ -157,10 +157,10 @@ public class MonitorModeUtil {
 
     /**
      * @param monitorModes
-     * @param resolution
+     * @param resolution in pixel units
      * @return modes with nearest resolution, or matching ones. May return zero sized list for non.
      */
-    public static List<MonitorMode> filterByResolution(List<MonitorMode> monitorModes, DimensionImmutable resolution) {
+    public static List<MonitorMode> filterByResolution(final List<MonitorMode> monitorModes, final DimensionImmutable resolution) {
         final List<MonitorMode> out = new ArrayList<MonitorMode>();
         if( null!=monitorModes && monitorModes.size()>0 ) {
             final int resolution_sq = resolution.getHeight()*resolution.getWidth();
@@ -192,14 +192,14 @@ public class MonitorModeUtil {
      * @param refreshRate
      * @return modes with nearest refreshRate, or matching ones. May return zero sized list for non.
      */
-    public static List<MonitorMode> filterByRate(List<MonitorMode> monitorModes, float refreshRate) {
+    public static List<MonitorMode> filterByRate(final List<MonitorMode> monitorModes, final float refreshRate) {
         final List<MonitorMode> out = new ArrayList<MonitorMode>();
         if( null!=monitorModes && monitorModes.size()>0 ) {
             float mode_dr = Float.MAX_VALUE;
             int mode_dr_idx = -1;
             for (int i=0; null!=monitorModes && i<monitorModes.size(); i++) {
                 final MonitorMode mode = monitorModes.get(i);
-                float dr = Math.abs(refreshRate - mode.getRefreshRate());
+                final float dr = Math.abs(refreshRate - mode.getRefreshRate());
                 if(dr<mode_dr) {
                     mode_dr = dr;
                     mode_dr_idx = i;
@@ -220,7 +220,7 @@ public class MonitorModeUtil {
      * @param monitorModes
      * @return modes with highest available bpp (color depth). May return zero sized list for non.
      */
-    public static List<MonitorMode> getHighestAvailableBpp(List<MonitorMode> monitorModes) {
+    public static List<MonitorMode> getHighestAvailableBpp(final List<MonitorMode> monitorModes) {
         if( null!=monitorModes && monitorModes.size()>0 ) {
             int highest = -1;
             for (int i=0; null!=monitorModes && i < monitorModes.size(); i++) {
@@ -240,7 +240,7 @@ public class MonitorModeUtil {
      * @param monitorModes
      * @return modes with highest available refresh rate. May return zero sized list for non.
      */
-    public static List<MonitorMode> getHighestAvailableRate(List<MonitorMode> monitorModes) {
+    public static List<MonitorMode> getHighestAvailableRate(final List<MonitorMode> monitorModes) {
         if( null!=monitorModes && monitorModes.size()>0 ) {
             float highest = -1;
             for (int i=0; null!=monitorModes && i < monitorModes.size(); i++) {
diff --git a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java b/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java
index 8123126..9a3e79a 100644
--- a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java
+++ b/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtApplet3Run.java
@@ -44,7 +44,7 @@ import javax.media.opengl.FPSCounter;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLProfile;
 
-import com.jogamp.nativewindow.UpstreamSurfaceHookMutableSizePos;
+import com.jogamp.nativewindow.UpstreamWindowHookMutableSizePos;
 import com.jogamp.newt.NewtFactory;
 import com.jogamp.newt.Window;
 import com.jogamp.newt.opengl.GLWindow;
@@ -103,11 +103,11 @@ public class JOGLNewtApplet3Run implements Applet3 {
     int glXd=Integer.MAX_VALUE, glYd=Integer.MAX_VALUE, glWidth=Integer.MAX_VALUE, glHeight=Integer.MAX_VALUE;
     Applet3Context ctx;
     boolean glStandalone = false;
-    UpstreamSurfaceHookMutableSizePos upstreamSizePosHook;
+    UpstreamWindowHookMutableSizePos upstreamSizePosHook;
     PointImmutable upstreamLocOnScreen;
     NativeWindow browserWin;
 
-    final String getParameter(String name) {
+    final String getParameter(final String name) {
         return ctx.getParameter(name);
     }
 
@@ -132,7 +132,7 @@ public class JOGLNewtApplet3Run implements Applet3 {
             glHeight = JOGLNewtAppletBase.str2Int(getParameter("gl_height"), glHeight);
             glUndecorated = JOGLNewtAppletBase.str2Bool(getParameter("gl_undecorated"), glUndecorated);
             glAlwaysOnTop = JOGLNewtAppletBase.str2Bool(getParameter("gl_alwaysontop"), glAlwaysOnTop);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
         }
         glStandalone = Integer.MAX_VALUE>glXd && Integer.MAX_VALUE>glYd && Integer.MAX_VALUE>glWidth && Integer.MAX_VALUE>glHeight;
@@ -147,8 +147,9 @@ public class JOGLNewtApplet3Run implements Applet3 {
         final AbstractGraphicsDevice aDevice = NativeWindowFactory.createDevice(upstreamWin.getDisplayConnection(),
                                                                                 true /* own */); // open and own! (for upstreamLocOnScreen)
         final AbstractGraphicsScreen aScreen = NativeWindowFactory.createScreen(aDevice, upstreamWin.getScreenIndex());
-        upstreamSizePosHook = new UpstreamSurfaceHookMutableSizePos(upstreamWin.getX(), upstreamWin.getY(),
-                                                                    upstreamWin.getWidth(), upstreamWin.getHeight());
+        upstreamSizePosHook = new UpstreamWindowHookMutableSizePos(upstreamWin.getX(), upstreamWin.getY(),
+                                                                   upstreamWin.getWidth(), upstreamWin.getHeight(),
+                                                                   upstreamWin.getWidth(), upstreamWin.getHeight()); // FIXME: pixel-dim == window-dim 'for now' ?
         browserWin = NativeWindowFactory.createWrappedWindow(aScreen, 0 /* surfaceHandle */, upstreamWin.getWindowHandle(),
                                                             upstreamSizePosHook);
         upstreamLocOnScreen = NativeWindowFactory.getLocationOnScreen(browserWin);
@@ -175,15 +176,15 @@ public class JOGLNewtApplet3Run implements Applet3 {
 
         return new NativeWindowDownstream() {
             @Override
-            public void setVisible(boolean v) {
+            public void setVisible(final boolean v) {
                 if( null != glWindow ) {
                     glWindow.setVisible(v);
                 }
             }
 
             @Override
-            public void setSize(int width, int height) {
-                upstreamSizePosHook.setSize(width, height);
+            public void setSize(final int width, final int height) {
+                upstreamSizePosHook.setWinSize(width, height);
                 if( null != glWindow ) {
                     glWindow.setSize(width, height);
                 }
@@ -225,8 +226,8 @@ public class JOGLNewtApplet3Run implements Applet3 {
             }
 
             @Override
-            public void notifyPositionChanged(NativeWindowUpstream nw) {
-                upstreamSizePosHook.setPos(nw.getX(), nw.getY());
+            public void notifyPositionChanged(final NativeWindowUpstream nw) {
+                upstreamSizePosHook.setWinPos(nw.getX(), nw.getY());
                 if( null != glWindow ) {
                     glWindow.setPosition(nw.getX(), nw.getY());
                 }
@@ -235,7 +236,7 @@ public class JOGLNewtApplet3Run implements Applet3 {
     }
 
     @Override
-    public void init(Applet3Context ctx) {
+    public void init(final Applet3Context ctx) {
         if(DEBUG) {
             System.err.println("JOGLNewtApplet1Run.init() START - "+currentThreadName());
         }
@@ -254,7 +255,7 @@ public class JOGLNewtApplet3Run implements Applet3 {
             glTrace = JOGLNewtAppletBase.str2Bool(getParameter("gl_trace"), glTrace);
             glNoDefaultKeyListener = JOGLNewtAppletBase.str2Bool(getParameter("gl_nodefaultkeyListener"), glNoDefaultKeyListener);
             glCloseable = JOGLNewtAppletBase.str2Bool(getParameter("gl_closeable"), glCloseable);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
         }
         if(null==glEventListenerClazzName) {
@@ -281,7 +282,7 @@ public class JOGLNewtApplet3Run implements Applet3 {
             glWindow.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);
             glWindow.setDefaultCloseOperation(glCloseable ? WindowClosingMode.DISPOSE_ON_CLOSE : WindowClosingMode.DO_NOTHING_ON_CLOSE);
             base.init(glWindow);
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             throw new RuntimeException(t);
         }
         if(DEBUG) {
diff --git a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java b/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java
index bbe6b85..d40e09d 100644
--- a/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java
+++ b/src/newt/classes/com/jogamp/newt/util/applet/JOGLNewtAppletBase.java
@@ -54,6 +54,7 @@ import com.jogamp.newt.event.WindowEvent;
 import com.jogamp.newt.event.WindowListener;
 import com.jogamp.newt.opengl.GLWindow;
 import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
 
 
 /** Shows how to deploy an applet using JOGL. This demo must be
@@ -76,12 +77,12 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
     boolean isValid = false;
     NativeWindow parentWin;
 
-    public JOGLNewtAppletBase(String glEventListenerClazzName,
-                              int glSwapInterval,
-                              boolean noDefaultKeyListener,
-                              boolean glClosable,
-                              boolean glDebug,
-                              boolean glTrace) {
+    public JOGLNewtAppletBase(final String glEventListenerClazzName,
+                              final int glSwapInterval,
+                              final boolean noDefaultKeyListener,
+                              final boolean glClosable,
+                              final boolean glDebug,
+                              final boolean glTrace) {
 
         this.glEventListenerClazzName=glEventListenerClazzName;
         this.glSwapInterval=glSwapInterval;
@@ -96,19 +97,19 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
     public Animator getGLAnimator() { return glAnimator; }
     public boolean isValid() { return isValid; }
 
-    public static boolean str2Bool(String str, boolean def) {
+    public static boolean str2Bool(final String str, final boolean def) {
         if(null==str) return def;
         try {
             return Boolean.valueOf(str).booleanValue();
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return def;
     }
 
-    public static int str2Int(String str, int def) {
+    public static int str2Int(final String str, final int def) {
         if(null==str) return def;
         try {
             return Integer.parseInt(str);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return def;
     }
 
@@ -123,14 +124,14 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
                     Class<?> clazz = null;
                     try {
                         clazz = Class.forName(clazzName, false, cl);
-                    } catch (Throwable t) {
+                    } catch (final Throwable t) {
                         t.printStackTrace();
                     }
                     return clazz;
                 }
             });
             instance = clazz.newInstance();
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             throw new RuntimeException("Error while instantiating demo: "+clazzName);
         }
@@ -143,28 +144,28 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
         return (GLEventListener) instance;
     }
 
-    public static boolean setField(Object instance, String fieldName, Object value) {
+    public static boolean setField(final Object instance, final String fieldName, final Object value) {
         try {
-            Field f = instance.getClass().getField(fieldName);
+            final Field f = instance.getClass().getField(fieldName);
             if(f.getType().isInstance(value)) {
                 f.set(instance, value);
                 return true;
             } else {
                 System.out.println(instance.getClass()+" '"+fieldName+"' field not assignable with "+value.getClass()+", it's a: "+f.getType());
             }
-        } catch (NoSuchFieldException nsfe) {
+        } catch (final NoSuchFieldException nsfe) {
             System.out.println(instance.getClass()+" has no '"+fieldName+"' field");
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
         }
         return false;
     }
 
-    public void init(GLWindow glWindow) {
+    public void init(final GLWindow glWindow) {
         init(Thread.currentThread().getThreadGroup(), glWindow);
     }
 
-    public void init(ThreadGroup tg, final GLWindow glWindow) {
+    public void init(final ThreadGroup tg, final GLWindow glWindow) {
         isValid = false;
         this.glWindow = glWindow;
         glEventListener = createInstance(glEventListenerClazzName);
@@ -200,12 +201,12 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
 
             // glAnimator = new FPSAnimator(canvas, 60);
             glAnimator = new Animator();
-            glAnimator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD); // No AWT thread involved!
+            glAnimator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD); // No AWT thread involved!
             glAnimator.setThreadGroup(tg);
             glAnimator.add(glWindow);
             glAnimator.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, null);
 
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             throw new RuntimeException(t);
         }
         isValid = true;
@@ -214,7 +215,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
     private final WindowListener reparentHomeListener = new WindowAdapter() {
         // Closing action: back to parent!
         @Override
-        public void windowDestroyNotify(WindowEvent e) {
+        public void windowDestroyNotify(final WindowEvent e) {
             if( isValid() && WindowClosingMode.DO_NOTHING_ON_CLOSE == glWindow.getDefaultCloseOperation() &&
                 null == glWindow.getParent() && null != parentWin && 0 != parentWin.getWindowHandle() )
             {
@@ -239,7 +240,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
                 final Display disp = glWindow.getScreen().getDisplay();
                 try {
                     pointerIconTest = disp.createPointerIcon(res, 8, 8);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     e.printStackTrace();
                 }
             }
@@ -275,20 +276,20 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
     // ***********************************************************************************
 
     @Override
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         GL _gl = drawable.getGL();
 
         if(glDebug) {
             try {
                 _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", null, _gl, null) );
-            } catch (Exception e) {e.printStackTrace();}
+            } catch (final Exception e) {e.printStackTrace();}
         }
 
         if(glTrace) {
             try {
                 // Trace ..
                 _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", null, _gl, new Object[] { System.err } ) );
-            } catch (Exception e) {e.printStackTrace();}
+            } catch (final Exception e) {e.printStackTrace();}
         }
 
         if(glSwapInterval>=0) {
@@ -296,13 +297,13 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
         }
     }
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
     }
     @Override
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
     }
     @Override
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
     }
 
     // ***********************************************************************************
@@ -310,7 +311,7 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
     // ***********************************************************************************
 
     @Override
-    public void keyPressed(KeyEvent e) {
+    public void keyPressed(final KeyEvent e) {
        if( !e.isPrintableKey() || e.isAutoRepeat() ) {
            return;
        }
@@ -377,14 +378,14 @@ public class JOGLNewtAppletBase implements KeyListener, GLEventListener {
            new Thread() {
                public void run() {
                    System.err.println("[set mouse pos pre]");
-                   glWindow.warpPointer(glWindow.getWidth()/2, glWindow.getHeight()/2);
+                   glWindow.warpPointer(glWindow.getSurfaceWidth()/2, glWindow.getSurfaceHeight()/2);
                    System.err.println("[set mouse pos post]");
                } }.start();
        }
     }
 
     @Override
-    public void keyReleased(KeyEvent e) {
+    public void keyReleased(final KeyEvent e) {
     }
 }
 
diff --git a/src/newt/classes/com/jogamp/newt/util/applet/VersionApplet3.java b/src/newt/classes/com/jogamp/newt/util/applet/VersionApplet3.java
index db0e8fc..7ec790e 100644
--- a/src/newt/classes/com/jogamp/newt/util/applet/VersionApplet3.java
+++ b/src/newt/classes/com/jogamp/newt/util/applet/VersionApplet3.java
@@ -25,8 +25,8 @@ import com.jogamp.opengl.JoglVersion;
 
 public class VersionApplet3 implements Applet3 {
 
-    public static void main(String[] args) {
-        VersionApplet3 va = new VersionApplet3();
+    public static void main(final String[] args) {
+        final VersionApplet3 va = new VersionApplet3();
 
         final NativeWindowDownstream nwc = va.createNativeWindow(null, new NativeWindowUpstream() {
             @Override
@@ -50,7 +50,7 @@ public class VersionApplet3 implements Applet3 {
                 return 0; // default
             }
             @Override
-            public void notifySurfaceUpdated(NativeWindowDownstream swappedWin) {
+            public void notifySurfaceUpdated(final NativeWindowDownstream swappedWin) {
                 // NOP
             }
             @Override
@@ -80,14 +80,14 @@ public class VersionApplet3 implements Applet3 {
 
         return new NativeWindowDownstream() {
             @Override
-            public void setVisible(boolean v) {
+            public void setVisible(final boolean v) {
                 if( null != canvas ) {
                     canvas.setVisible(v);
                 }
             }
 
             @Override
-            public void setSize(int width, int height) {
+            public void setSize(final int width, final int height) {
                 if( null != canvas ) {
                     canvas.setSize(width, height);
                 }
@@ -129,7 +129,7 @@ public class VersionApplet3 implements Applet3 {
             }
 
             @Override
-            public void notifyPositionChanged(NativeWindowUpstream nw) {
+            public void notifyPositionChanged(final NativeWindowUpstream nw) {
                 if( null != canvas ) {
                     canvas.setPosition(nw.getX(), nw.getY());
                 }
@@ -138,7 +138,7 @@ public class VersionApplet3 implements Applet3 {
     }
 
     @Override
-    public void init(Applet3Context ctx) {
+    public void init(final Applet3Context ctx) {
         System.err.println("VersionApplet: init() - begin");
         canvas.addGLEventListener(new GLInfo());
         System.err.println("VersionApplet: init() - end");
@@ -164,8 +164,8 @@ public class VersionApplet3 implements Applet3 {
         s = JoglVersion.getInstance().toString();
         System.err.println(s);
 
-        GLDrawableFactory factory = GLDrawableFactory.getFactory(canvas.getGLProfile());
-        List<GLCapabilitiesImmutable> availCaps = factory.getAvailableCapabilities(null);
+        final GLDrawableFactory factory = GLDrawableFactory.getFactory(canvas.getGLProfile());
+        final List<GLCapabilitiesImmutable> availCaps = factory.getAvailableCapabilities(null);
         for(int i=0; i<availCaps.size(); i++) {
             s = availCaps.get(i).toString();
             System.err.println(s);
@@ -206,21 +206,21 @@ public class VersionApplet3 implements Applet3 {
         return null;
     }
 
-    class GLInfo implements GLEventListener {
+    static class GLInfo implements GLEventListener {
         @Override
-        public void init(GLAutoDrawable drawable) {
-            GL gl = drawable.getGL();
-            String s = JoglVersion.getGLInfo(gl, null).toString();
+        public void init(final GLAutoDrawable drawable) {
+            final GL gl = drawable.getGL();
+            final String s = JoglVersion.getGLInfo(gl, null).toString();
             System.err.println(s);
         }
         @Override
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
         }
         @Override
-        public void display(GLAutoDrawable drawable) {
+        public void display(final GLAutoDrawable drawable) {
         }
         @Override
-        public void dispose(GLAutoDrawable drawable) {
+        public void dispose(final GLAutoDrawable drawable) {
         }
     }
 }
diff --git a/src/newt/classes/jogamp/newt/Debug.java b/src/newt/classes/jogamp/newt/Debug.java
index 7ef2d7f..a255cb7 100644
--- a/src/newt/classes/jogamp/newt/Debug.java
+++ b/src/newt/classes/jogamp/newt/Debug.java
@@ -1,41 +1,29 @@
-/*
- * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
- * Copyright (c) 2010 JogAmp Community. All rights reserved.
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
  *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
  *
- * - Redistribution of source code must retain the above copyright
- *   notice, this list of conditions and the following disclaimer.
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
  *
- * - Redistribution in binary form must reproduce the above copyright
- *   notice, this list of conditions and the following disclaimer in the
- *   documentation and/or other materials provided with the distribution.
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
  *
- * Neither the name of Sun Microsystems, Inc. or the names of
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * This software is provided "AS IS," without a warranty of any kind. ALL
- * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
- * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
- * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
- * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
- * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
- * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
- * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
- * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
- * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
- * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
- * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- *
- * You acknowledge that this software is not designed or intended for use
- * in the design, construction, operation or maintenance of any nuclear
- * facility.
- *
- * Sun gratefully acknowledges that this software was originally authored
- * and developed by Kenneth Bradley Russell and Christopher John Kline.
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
  */
 
 package jogamp.newt;
@@ -63,7 +51,7 @@ public class Debug extends PropertyAccess {
     verbose = isPropertyDefined("newt.verbose", true);
     debugAll = isPropertyDefined("newt.debug", true);
     if (verbose) {
-       Package p = Package.getPackage("com.jogamp.newt");
+       final Package p = Package.getPackage("com.jogamp.newt");
        System.err.println("NEWT specification version " + p.getSpecificationVersion());
        System.err.println("NEWT implementation version " + p.getImplementationVersion());
        System.err.println("NEWT implementation vendor " + p.getImplementationVendor());
@@ -81,7 +69,7 @@ public class Debug extends PropertyAccess {
     return debugAll;
   }
 
-  public static final boolean debug(String subcomponent) {
+  public static final boolean debug(final String subcomponent) {
     return debugAll() || isPropertyDefined("newt.debug." + subcomponent, true);
   }
 }
diff --git a/src/newt/classes/jogamp/newt/DefaultEDTUtil.java b/src/newt/classes/jogamp/newt/DefaultEDTUtil.java
index d481ce8..ef8ea66 100644
--- a/src/newt/classes/jogamp/newt/DefaultEDTUtil.java
+++ b/src/newt/classes/jogamp/newt/DefaultEDTUtil.java
@@ -63,7 +63,7 @@ public class DefaultEDTUtil implements EDTUtil {
     private int start_iter=0;
     private static long pollPeriod = EDTUtil.defaultEDTPollPeriod;
 
-    public DefaultEDTUtil(ThreadGroup tg, String name, Runnable dispatchMessages) {
+    public DefaultEDTUtil(final ThreadGroup tg, final String name, final Runnable dispatchMessages) {
         this.threadGroup = tg;
         this.name=Thread.currentThread().getName()+"-"+name+"-EDT-";
         this.dispatchMessages=dispatchMessages;
@@ -77,12 +77,12 @@ public class DefaultEDTUtil implements EDTUtil {
     }
 
     @Override
-    final public void setPollPeriod(long ms) {
-        pollPeriod = ms;
+    final public void setPollPeriod(final long ms) {
+        pollPeriod = ms; // writing to static field is intended
     }
 
     @Override
-    public final boolean start() throws IllegalStateException {
+    public final void start() throws IllegalStateException {
         synchronized(edtLock) {
             if( edt.isRunning() ) {
                 throw new IllegalStateException("EDT still running and not subject to stop. Curr "+Thread.currentThread().getName()+", EDT "+edt.getName()+", isRunning "+edt.isRunning+", shouldStop "+edt.shouldStop);
@@ -103,7 +103,9 @@ public class DefaultEDTUtil implements EDTUtil {
             }
             startImpl();
         }
-        return invoke(true, nullTask);
+        if( !edt.isRunning() ) {
+            throw new RuntimeException("EDT could not be started: "+edt);
+        }
     }
 
     private final void startImpl() {
@@ -139,7 +141,7 @@ public class DefaultEDTUtil implements EDTUtil {
     }
 
     @Override
-    public final boolean invokeStop(boolean wait, Runnable task) {
+    public final boolean invokeStop(final boolean wait, final Runnable task) {
         if(DEBUG) {
             System.err.println(Thread.currentThread()+": Default-EDT.invokeStop wait "+wait);
             Thread.dumpStack();
@@ -147,7 +149,7 @@ public class DefaultEDTUtil implements EDTUtil {
         return invokeImpl(wait, task, true /* stop */, false /* provokeError */);
     }
 
-    public final boolean invokeAndWaitError(Runnable task) {
+    public final boolean invokeAndWaitError(final Runnable task) {
         if(DEBUG) {
             System.err.println(Thread.currentThread()+": Default-EDT.invokeAndWaitError");
             Thread.dumpStack();
@@ -156,7 +158,7 @@ public class DefaultEDTUtil implements EDTUtil {
     }
 
     @Override
-    public final boolean invoke(boolean wait, Runnable task) {
+    public final boolean invoke(final boolean wait, final Runnable task) {
         return invokeImpl(wait, task, false /* stop */, false /* provokeError */);
     }
 
@@ -165,7 +167,7 @@ public class DefaultEDTUtil implements EDTUtil {
         public void run() { }
     };
 
-    private final boolean invokeImpl(boolean wait, Runnable task, boolean stop, boolean provokeError) {
+    private final boolean invokeImpl(boolean wait, Runnable task, final boolean stop, final boolean provokeError) {
         Throwable throwable = null;
         RunnableTask rTask = null;
         final Object rTaskLock = new Object();
@@ -233,7 +235,7 @@ public class DefaultEDTUtil implements EDTUtil {
             if( wait ) {
                 try {
                     rTaskLock.wait(); // free lock, allow execution of rTask
-                } catch (InterruptedException ie) {
+                } catch (final InterruptedException ie) {
                     throwable = ie;
                 }
                 if(null==throwable) {
@@ -269,7 +271,7 @@ public class DefaultEDTUtil implements EDTUtil {
                 try {
                     _edt.tasks.notifyAll();
                     _edt.tasks.wait();
-                } catch (InterruptedException e) {
+                } catch (final InterruptedException e) {
                     e.printStackTrace();
                 }
             }
@@ -284,7 +286,7 @@ public class DefaultEDTUtil implements EDTUtil {
                 while( edt.isRunning ) {
                     try {
                         edtLock.wait();
-                    } catch (InterruptedException e) {
+                    } catch (final InterruptedException e) {
                         e.printStackTrace();
                     }
                 }
@@ -300,7 +302,7 @@ public class DefaultEDTUtil implements EDTUtil {
         volatile boolean isRunning = false;
         final ArrayList<RunnableTask> tasks = new ArrayList<RunnableTask>(); // one shot tasks
 
-        public NEDT(ThreadGroup tg, String name) {
+        public NEDT(final ThreadGroup tg, final String name) {
             super(tg, name);
         }
 
@@ -347,7 +349,7 @@ public class DefaultEDTUtil implements EDTUtil {
                         if(!shouldStop && tasks.size()==0) {
                             try {
                                 tasks.wait(pollPeriod);
-                            } catch (InterruptedException e) {
+                            } catch (final InterruptedException e) {
                                 e.printStackTrace();
                             }
                         }
@@ -372,12 +374,12 @@ public class DefaultEDTUtil implements EDTUtil {
                         }
                         if(!task.hasWaiter() && null != task.getThrowable()) {
                             // at least dump stack-trace in case nobody waits for result
-                            System.err.println("DefaultEDT.run(): Catched exception occured on thread "+Thread.currentThread().getName()+": "+task.toString());
+                            System.err.println("DefaultEDT.run(): Caught exception occured on thread "+Thread.currentThread().getName()+": "+task.toString());
                             task.getThrowable().printStackTrace();
                         }
                     }
                 } while(!shouldStop) ;
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 // handle errors ..
                 shouldStop = true;
                 if(t instanceof RuntimeException) {
diff --git a/src/newt/classes/jogamp/newt/DisplayImpl.java b/src/newt/classes/jogamp/newt/DisplayImpl.java
index 952e611..84ce452 100644
--- a/src/newt/classes/jogamp/newt/DisplayImpl.java
+++ b/src/newt/classes/jogamp/newt/DisplayImpl.java
@@ -142,7 +142,7 @@ public abstract class DisplayImpl extends Display {
                             System.err.println("createPointerIconPNG.0: "+res[0]);
                         }
                     }
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     e.printStackTrace();
                 }
             } } );
@@ -199,7 +199,7 @@ public abstract class DisplayImpl extends Display {
                             res[0] = new PointerIconImpl(DisplayImpl.this, fpixelrect, new Point(hotX, hotY), handle);
                         }
                     }
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     e.printStackTrace();
                 }
             } } );
@@ -222,7 +222,7 @@ public abstract class DisplayImpl extends Display {
      * @param hotY the PointerIcon's hot-spot x-coord
      * @return if successful a valid handle (not null), otherwise null.
      */
-    protected final long createPointerIconImplChecked(PixelFormat pixelformat, int width, int height, final ByteBuffer pixels, final int hotX, final int hotY) {
+    protected final long createPointerIconImplChecked(final PixelFormat pixelformat, final int width, final int height, final ByteBuffer pixels, final int hotX, final int hotY) {
         if( getNativePointerIconPixelFormat() != pixelformat ) {
             throw new IllegalArgumentException("Pixelformat no "+getNativePointerIconPixelFormat()+", but "+pixelformat);
         }
@@ -243,17 +243,17 @@ public abstract class DisplayImpl extends Display {
      * @param hotY the PointerIcon's hot-spot x-coord
      * @return if successful a valid handle (not null), otherwise null.
      */
-    protected long createPointerIconImpl(PixelFormat pixelformat, int width, int height, final ByteBuffer pixels, final int hotX, final int hotY) {
+    protected long createPointerIconImpl(final PixelFormat pixelformat, final int width, final int height, final ByteBuffer pixels, final int hotX, final int hotY) {
         return 0;
     }
 
     /** Executed from EDT! */
-    protected void destroyPointerIconImpl(final long displayHandle, long piHandle) { }
+    protected void destroyPointerIconImpl(final long displayHandle, final long piHandle) { }
 
     /** Ensure static init has been run. */
     /* pp */static void initSingleton() { }
 
-    private static Class<?> getDisplayClass(String type)
+    private static Class<?> getDisplayClass(final String type)
         throws ClassNotFoundException
     {
         final Class<?> displayClass = NewtFactory.getCustomClass(type, "DisplayDriver");
@@ -264,7 +264,7 @@ public abstract class DisplayImpl extends Display {
     }
 
     /** Make sure to reuse a Display with the same name */
-    public static Display create(String type, String name, final long handle, boolean reuse) {
+    public static Display create(final String type, String name, final long handle, final boolean reuse) {
         try {
             final Class<?> displayClass = getDisplayClass(type);
             final DisplayImpl display = (DisplayImpl) displayClass.newInstance();
@@ -294,13 +294,13 @@ public abstract class DisplayImpl extends Display {
                 System.err.println("Display.create() NEW: "+display+" "+getThreadName());
             }
             return display;
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new RuntimeException(e);
         }
     }
 
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if (obj == null) {
             return false;
         }
@@ -340,7 +340,7 @@ public abstract class DisplayImpl extends Display {
                     public void run() {
                         f_dpy.createNativeImpl();
                     }});
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 throw new NativeWindowException(t);
             }
             if( null == aDevice ) {
@@ -409,7 +409,7 @@ public abstract class DisplayImpl extends Display {
         }
     }
 
-    public void runOnEDTIfAvail(boolean wait, final Runnable task) {
+    public void runOnEDTIfAvail(final boolean wait, final Runnable task) {
         final EDTUtil _edtUtil = edtUtil;
         if( !_edtUtil.isRunning() ) { // start EDT if not running yet
             synchronized( this ) {
@@ -516,7 +516,7 @@ public abstract class DisplayImpl extends Display {
                     }
                     try {
                         Thread.sleep( coopSleep < 50 ? coopSleep : 50 );
-                    } catch (InterruptedException e) { }
+                    } catch (final InterruptedException e) { }
                 } else {
                     closeNativeTask.run();
                 }
@@ -527,7 +527,7 @@ public abstract class DisplayImpl extends Display {
     @Override
     public synchronized final int addReference() {
         if(DEBUG) {
-            System.err.println("Display.addReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount+1));
+            System.err.println("Display.addReference() ("+Display.getThreadName()+"): "+refCount+" -> "+(refCount+1));
         }
         if ( 0 == refCount ) {
             createNative();
@@ -542,7 +542,7 @@ public abstract class DisplayImpl extends Display {
     @Override
     public synchronized final int removeReference() {
         if(DEBUG) {
-            System.err.println("Display.removeReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount-1));
+            System.err.println("Display.removeReference() ("+Display.getThreadName()+"): "+refCount+" -> "+(refCount-1));
         }
         refCount--; // could become < 0, in case of manual destruction without actual creation/addReference
         if(0>=refCount) {
@@ -587,17 +587,17 @@ public abstract class DisplayImpl extends Display {
 
     public static final String nilString = "nil" ;
 
-    public String validateDisplayName(String name, long handle) {
+    public String validateDisplayName(String name, final long handle) {
         if(null==name && 0!=handle) {
             name="wrapping-"+toHexString(handle);
         }
         return ( null == name ) ? nilString : name ;
     }
 
-    private static String getFQName(String type, String name, int id) {
+    private static String getFQName(String type, String name, final int id) {
         if(null==type) type=nilString;
         if(null==name) name=nilString;
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
         sb.append(type);
         sb.append("_");
         sb.append(name);
@@ -668,7 +668,7 @@ public abstract class DisplayImpl extends Display {
             } else {
                 throw new RuntimeException("Event source not NEWT: "+source.getClass().getName()+", "+source);
             }
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             final RuntimeException re;
             if(t instanceof RuntimeException) {
                 re = (RuntimeException) t;
@@ -689,7 +689,7 @@ public abstract class DisplayImpl extends Display {
                 return;
             }
             dispatchMessage(event);
-        } catch (RuntimeException re) {
+        } catch (final RuntimeException re) {
             if( eventTask.isCallerWaiting() ) {
                 // propagate exception to caller
                 eventTask.setException(re);
@@ -733,7 +733,7 @@ public abstract class DisplayImpl extends Display {
         dispatchMessagesNative();
     }
 
-    public void enqueueEvent(boolean wait, NEWTEvent e) {
+    public void enqueueEvent(final boolean wait, final NEWTEvent e) {
         final EDTUtil _edtUtil = edtUtil;
         if( !_edtUtil.isRunning() ) {
             // oops .. we are already dead
@@ -761,7 +761,7 @@ public abstract class DisplayImpl extends Display {
             if( wait ) {
                 try {
                     lock.wait();
-                } catch (InterruptedException ie) {
+                } catch (final InterruptedException ie) {
                     throw new RuntimeException(ie);
                 }
                 if( null != eTask.getException() ) {
@@ -774,7 +774,7 @@ public abstract class DisplayImpl extends Display {
     public interface DisplayRunnable<T> {
         T run(long dpy);
     }
-    public static final <T> T runWithLockedDevice(AbstractGraphicsDevice device, DisplayRunnable<T> action) {
+    public static final <T> T runWithLockedDevice(final AbstractGraphicsDevice device, final DisplayRunnable<T> action) {
         T res;
         device.lock();
         try {
@@ -784,7 +784,7 @@ public abstract class DisplayImpl extends Display {
         }
         return res;
     }
-    public final <T> T runWithLockedDisplayDevice(DisplayRunnable<T> action) {
+    public final <T> T runWithLockedDisplayDevice(final DisplayRunnable<T> action) {
         final AbstractGraphicsDevice device = getGraphicsDevice();
         if(null == device) {
             throw new RuntimeException("null device - not initialized: "+this);
diff --git a/src/newt/classes/jogamp/newt/MonitorDeviceImpl.java b/src/newt/classes/jogamp/newt/MonitorDeviceImpl.java
index 9e10879..7230074 100644
--- a/src/newt/classes/jogamp/newt/MonitorDeviceImpl.java
+++ b/src/newt/classes/jogamp/newt/MonitorDeviceImpl.java
@@ -38,8 +38,8 @@ import com.jogamp.newt.Screen;
 
 public class MonitorDeviceImpl extends MonitorDevice {
 
-    public MonitorDeviceImpl(ScreenImpl screen, int nativeId, DimensionImmutable sizeMM, Rectangle viewport, MonitorMode currentMode, ArrayHashSet<MonitorMode> supportedModes) {
-        super(screen, nativeId, sizeMM, viewport, currentMode, supportedModes);
+    public MonitorDeviceImpl(final ScreenImpl screen, final int nativeId, final DimensionImmutable sizeMM, final Rectangle viewportPU, final Rectangle viewportWU, final MonitorMode currentMode, final ArrayHashSet<MonitorMode> supportedModes) {
+        super(screen, nativeId, sizeMM, viewportPU, viewportWU, currentMode, supportedModes);
     }
 
     @Override
@@ -73,7 +73,7 @@ public class MonitorDeviceImpl extends MonitorDevice {
     }
 
     @Override
-    public final boolean setCurrentMode(MonitorMode mode) {
+    public final boolean setCurrentMode(final MonitorMode mode) {
         if(Screen.DEBUG) {
             System.err.println("Screen.setCurrentMode.0: "+this+" -> "+mode);
         }
@@ -132,15 +132,14 @@ public class MonitorDeviceImpl extends MonitorDevice {
         }
     }
 
-    private final void setCurrentModeValue(MonitorMode currentMode) {
+    private final void setCurrentModeValue(final MonitorMode currentMode) {
         this.currentMode = currentMode;
     }
 
-    /* pp */ final void setViewportValue(Rectangle viewport) {
-        this.viewport = viewport;
-    }
+    /* pp */ final Rectangle getMutuableViewportPU() { return viewportPU; }
+    /* pp */ final Rectangle getMutuableViewportWU() { return viewportWU; }
 
-    /* pp */ ArrayHashSet<MonitorMode> getSupportedModesImpl() {
+    /* pp */ final ArrayHashSet<MonitorMode> getSupportedModesImpl() {
         return supportedModes;
     }
 
diff --git a/src/newt/classes/jogamp/newt/MonitorModeProps.java b/src/newt/classes/jogamp/newt/MonitorModeProps.java
index 9d8f491..6e376ce 100644
--- a/src/newt/classes/jogamp/newt/MonitorModeProps.java
+++ b/src/newt/classes/jogamp/newt/MonitorModeProps.java
@@ -45,34 +45,76 @@ import jogamp.newt.ScreenImpl;
  * Encodes and decodes {@link MonitorMode} and {@link MonitorDevice} properties.
  */
 public class MonitorModeProps {
-    /** WARNING: must be synchronized with ScreenMode.h, native implementation
-     * 2: width, height
+    /**
+     * {@value} Elements: width, height
+     * <p>
+     * WARNING: must be synchronized with ScreenMode.h, native implementation
+     * </p>
      */
     public static final int NUM_RESOLUTION_PROPERTIES   = 2;
 
-    /** WARNING: must be synchronized with ScreenMode.h, native implementation
-     * 1: bpp
+    /**
+     * {@value} Element: bpp
+     * <p>
+     * WARNING: must be synchronized with ScreenMode.h, native implementation
+     * </p>
      */
     public static final int NUM_SURFACE_SIZE_PROPERTIES = 1;
 
-    /** WARNING: must be synchronized with ScreenMode.h, native implementation
-     * 2: refresh-rate (Hz*100), flags
+    /**
+     * {@value} Elements: refresh-rate (Hz*100), flags
+     * <p>
+     * WARNING: must be synchronized with ScreenMode.h, native implementation
+     * </p>
      */
     public static final int NUM_SIZEANDRATE_PROPERTIES = 2;
 
-    /** WARNING: must be synchronized with ScreenMode.h, native implementation
-     * 2: id, rotation
+    /**
+     * {@value} Elements: id, rotation
+     * <p>
+     * WARNING: must be synchronized with ScreenMode.h, native implementation
+     * </p>
      */
     public static final int NUM_MONITOR_MODE_PROPERTIES  = 2;
 
-    /** WARNING: must be synchronized with ScreenMode.h, native implementation
-     * count + all the above
+    /**
+     * {@value} Elements:
+     * <ul>
+     *  <li>count</li>
+     *  <li>{@link #NUM_RESOLUTION_PROPERTIES}</li>
+     *  <li>{@link #NUM_SURFACE_SIZE_PROPERTIES}</li>
+     *  <li>{@link #NUM_SIZEANDRATE_PROPERTIES}</li>
+     *  <li>{@link #NUM_MONITOR_MODE_PROPERTIES}</li>
+     *  <li>mode-id</li>
+     * </ul>
+     * <p>
+     * WARNING: must be synchronized with ScreenMode.h, native implementation
+     * </p>
      */
     public static final int NUM_MONITOR_MODE_PROPERTIES_ALL = 8;
 
+    /**
+     * {@value} Elements: count + {@link #NUM_RESOLUTION_PROPERTIES}
+     * <p>
+     * WARNING: must be synchronized with ScreenMode.h, native implementation
+     * </p>
+     */
     public static final int IDX_MONITOR_MODE_BPP =   1 // count
                                                    + MonitorModeProps.NUM_RESOLUTION_PROPERTIES
                                                    ;
+    /**
+     * {@value} Elements:
+     * <ul>
+     *  <li>count</li>
+     *  <li>{@link #NUM_RESOLUTION_PROPERTIES}</li>
+     *  <li>{@link #NUM_SURFACE_SIZE_PROPERTIES}</li>
+     *  <li>{@link #NUM_SIZEANDRATE_PROPERTIES}</li>
+     *  <li>mode-id</li>
+     * </ul>
+     * <p>
+     * WARNING: must be synchronized with ScreenMode.h, native implementation
+     * </p>
+     */
     public static final int IDX_MONITOR_MODE_ROT =   1 // count
                                                    + MonitorModeProps.NUM_RESOLUTION_PROPERTIES
                                                    + MonitorModeProps.NUM_SURFACE_SIZE_PROPERTIES
@@ -80,10 +122,26 @@ public class MonitorModeProps {
                                                    + 1 // id of MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES
                                                    ;
 
-    /** WARNING: must be synchronized with ScreenMode.h, native implementation
-     * 10: count + id, ScreenSizeMM[width, height], rotated Viewport[x, y, width, height], currentMonitorModeId, rotation, supportedModeId+
+    /**
+     * {@value} Elements:
+     * <ul>
+     *   <li>count</li>
+     *   <li>id</li>
+     *   <li>ScreenSizeMM[width, height] (2 elements)</li>
+     *   <li>Rotated Viewport pixel-units (4 elements)</li>
+     *   <li>Rotated Viewport window-units  (4 elements)</li>
+     *   <li>CurrentMonitorModeId</li>
+     *   <li>Rotation</li>
+     *   <li>SupportedModeId+</li>
+     * </ul>
+     * <p>
+     * Viewport := [x, y, width, height] (4 elements)
+     * </p>
+     * <p>
+     * WARNING: must be synchronized with ScreenMode.h, native implementation
+     * </p>
      */
-    public static final int MIN_MONITOR_DEVICE_PROPERTIES = 11;
+    public static final int MIN_MONITOR_DEVICE_PROPERTIES = 15;
 
     public static final int IDX_MONITOR_DEVICE_VIEWPORT =   1 // count
                                                           + 1 // native mode
@@ -99,26 +157,25 @@ public class MonitorModeProps {
     }
 
     /** WARNING: must be synchronized with ScreenMode.h, native implementation */
-    private static DimensionImmutable streamInResolution(int[] resolutionProperties, int offset) {
-        Dimension resolution = new Dimension(resolutionProperties[offset++], resolutionProperties[offset++]);
+    private static DimensionImmutable streamInResolution(final int[] resolutionProperties, int offset) {
+        final Dimension resolution = new Dimension(resolutionProperties[offset++], resolutionProperties[offset++]);
         return resolution;
     }
 
     /** WARNING: must be synchronized with ScreenMode.h, native implementation */
-    private static SurfaceSize streamInSurfaceSize(DimensionImmutable resolution, int[] sizeProperties, int offset) {
-        SurfaceSize surfaceSize = new SurfaceSize(resolution, sizeProperties[offset++]);
-        return surfaceSize;
+    private static SurfaceSize streamInSurfaceSize(final DimensionImmutable resolution, final int[] sizeProperties, final int offset) {
+        return new SurfaceSize(resolution, sizeProperties[offset]);
     }
 
     /** WARNING: must be synchronized with ScreenMode.h, native implementation */
-    private static MonitorMode.SizeAndRRate streamInSizeAndRRate(SurfaceSize surfaceSize, int[] sizeAndRRateProperties, int offset) {
+    private static MonitorMode.SizeAndRRate streamInSizeAndRRate(final SurfaceSize surfaceSize, final int[] sizeAndRRateProperties, int offset) {
         final float refreshRate = sizeAndRRateProperties[offset++]/100.0f;
         final int flags = sizeAndRRateProperties[offset++];
         return new MonitorMode.SizeAndRRate(surfaceSize, refreshRate, flags);
     }
 
     /** WARNING: must be synchronized with ScreenMode.h, native implementation */
-    private static MonitorMode streamInMonitorMode0(MonitorMode.SizeAndRRate sizeAndRate, int[] modeProperties, int offset) {
+    private static MonitorMode streamInMonitorMode0(final MonitorMode.SizeAndRRate sizeAndRate, final int[] modeProperties, int offset) {
         final int id = modeProperties[offset++];
         final int rotation = modeProperties[offset++];
         return new MonitorMode(id, sizeAndRate, rotation);
@@ -134,8 +191,8 @@ public class MonitorModeProps {
      * @return {@link MonitorMode} of the identical (old or new) element in {@link Cache#monitorModes},
      *         matching the input <code>modeProperties</code>, or null if input could not be processed.
      */
-    public static MonitorMode streamInMonitorMode(int[] mode_idx, Cache cache,
-                                                  int[] modeProperties, int offset) {
+    public static MonitorMode streamInMonitorMode(final int[] mode_idx, final Cache cache,
+                                                  final int[] modeProperties, int offset) {
         final int count = modeProperties[offset];
         if(NUM_MONITOR_MODE_PROPERTIES_ALL != count) {
             throw new RuntimeException("property count should be "+NUM_MONITOR_MODE_PROPERTIES_ALL+", but is "+count+", len "+(modeProperties.length-offset));
@@ -167,7 +224,7 @@ public class MonitorModeProps {
             monitorMode = cache.monitorModes.getOrAdd(monitorMode);
         }
         if( null != mode_idx && null!=cache) {
-            int _modeIdx  = cache.monitorModes.indexOf(monitorMode);
+            final int _modeIdx  = cache.monitorModes.indexOf(monitorMode);
             if( 0 > _modeIdx ) {
                 throw new InternalError("Invalid index of current unified mode "+monitorMode);
             }
@@ -177,8 +234,8 @@ public class MonitorModeProps {
     }
 
     /** WARNING: must be synchronized with ScreenMode.h, native implementation */
-    public static int[] streamOutMonitorMode (MonitorMode monitorMode) {
-        int[] data = new int[NUM_MONITOR_MODE_PROPERTIES_ALL];
+    public static int[] streamOutMonitorMode (final MonitorMode monitorMode) {
+        final int[] data = new int[NUM_MONITOR_MODE_PROPERTIES_ALL];
         int idx=0;
         data[idx++] = NUM_MONITOR_MODE_PROPERTIES_ALL;
         data[idx++] = monitorMode.getSurfaceSize().getResolution().getWidth();
@@ -206,7 +263,7 @@ public class MonitorModeProps {
      * @return {@link MonitorDevice} of the identical (old or new) element in {@link Cache#monitorDevices},
      *         matching the input <code>modeProperties</code>, or null if input could not be processed.
      */
-    public static MonitorDevice streamInMonitorDevice(int[] monitor_idx, Cache cache, ScreenImpl screen, int[] monitorProperties, int offset) {
+    public static MonitorDevice streamInMonitorDevice(final int[] monitor_idx, final Cache cache, final ScreenImpl screen, final int[] monitorProperties, int offset) {
         // min 11: count, id, ScreenSizeMM[width, height], Viewport[x, y, width, height], currentMonitorModeId, rotation, supportedModeId+
         final int count = monitorProperties[offset];
         if(MIN_MONITOR_DEVICE_PROPERTIES > count) {
@@ -223,7 +280,8 @@ public class MonitorModeProps {
         final List<MonitorMode> allMonitorModes = cache.monitorModes.getData();
         final int id = monitorProperties[offset++];
         final DimensionImmutable sizeMM = streamInResolution(monitorProperties, offset); offset+=NUM_RESOLUTION_PROPERTIES;
-        final Rectangle viewport = new Rectangle(monitorProperties[offset++], monitorProperties[offset++], monitorProperties[offset++], monitorProperties[offset++]);
+        final Rectangle viewportPU = new Rectangle(monitorProperties[offset++], monitorProperties[offset++], monitorProperties[offset++], monitorProperties[offset++]);
+        final Rectangle viewportWU = new Rectangle(monitorProperties[offset++], monitorProperties[offset++], monitorProperties[offset++], monitorProperties[offset++]);
         final MonitorMode currentMode;
         {
             final int modeId = monitorProperties[offset++];
@@ -240,12 +298,12 @@ public class MonitorModeProps {
                 }
             }
         }
-        MonitorDevice monitorDevice = new MonitorDeviceImpl(screen, id, sizeMM, viewport, currentMode, supportedModes);
+        MonitorDevice monitorDevice = new MonitorDeviceImpl(screen, id, sizeMM, viewportPU, viewportWU, currentMode, supportedModes);
         if(null!=cache) {
             monitorDevice = cache.monitorDevices.getOrAdd(monitorDevice);
         }
         if( null != monitor_idx ) {
-            int _monitorIdx  = cache.monitorDevices.indexOf(monitorDevice);
+            final int _monitorIdx  = cache.monitorDevices.indexOf(monitorDevice);
             if( 0 > _monitorIdx ) {
                 throw new InternalError("Invalid index of current unified mode "+monitorDevice);
             }
@@ -253,7 +311,7 @@ public class MonitorModeProps {
         }
         return monitorDevice;
     }
-    private static MonitorMode getByNativeIdAndRotation(List<MonitorMode> monitorModes, int modeId, int rotation) {
+    private static MonitorMode getByNativeIdAndRotation(final List<MonitorMode> monitorModes, final int modeId, final int rotation) {
         if( null!=monitorModes && monitorModes.size()>0 ) {
             for (int i=0; i<monitorModes.size(); i++) {
                 final MonitorMode mode = monitorModes.get(i);
@@ -281,7 +339,7 @@ public class MonitorModeProps {
      * @return {@link MonitorDevice} of the identical (old or new) element in {@link Cache#monitorDevices},
      *         matching the input <code>modeProperties</code>, or null if input could not be processed.
      */
-    public static MonitorDevice streamInMonitorDevice(int[] monitor_idx, Cache cache, ScreenImpl screen, ArrayHashSet<MonitorMode> supportedModes, MonitorMode currentMode, int[] monitorProperties, int offset) {
+    public static MonitorDevice streamInMonitorDevice(final int[] monitor_idx, final Cache cache, final ScreenImpl screen, final ArrayHashSet<MonitorMode> supportedModes, final MonitorMode currentMode, final int[] monitorProperties, int offset) {
         // min 11: count, id, ScreenSizeMM[width, height], Viewport[x, y, width, height], currentMonitorModeId, rotation, supportedModeId+
         final int count = monitorProperties[offset];
         if(MIN_MONITOR_DEVICE_PROPERTIES - 1 - NUM_MONITOR_MODE_PROPERTIES != count) {
@@ -296,13 +354,14 @@ public class MonitorModeProps {
         offset++;
         final int id = monitorProperties[offset++];
         final DimensionImmutable sizeMM = streamInResolution(monitorProperties, offset); offset+=NUM_RESOLUTION_PROPERTIES;
-        final Rectangle viewport = new Rectangle(monitorProperties[offset++], monitorProperties[offset++], monitorProperties[offset++], monitorProperties[offset++]);
-        MonitorDevice monitorDevice = new MonitorDeviceImpl(screen, id, sizeMM, viewport, currentMode, supportedModes);
+        final Rectangle viewportPU = new Rectangle(monitorProperties[offset++], monitorProperties[offset++], monitorProperties[offset++], monitorProperties[offset++]);
+        final Rectangle viewportWU = new Rectangle(monitorProperties[offset++], monitorProperties[offset++], monitorProperties[offset++], monitorProperties[offset++]);
+        MonitorDevice monitorDevice = new MonitorDeviceImpl(screen, id, sizeMM, viewportPU, viewportWU, currentMode, supportedModes);
         if(null!=cache) {
             monitorDevice = cache.monitorDevices.getOrAdd(monitorDevice);
         }
         if( null != monitor_idx ) {
-            int _monitorIdx  = cache.monitorDevices.indexOf(monitorDevice);
+            final int _monitorIdx  = cache.monitorDevices.indexOf(monitorDevice);
             if( 0 > _monitorIdx ) {
                 throw new InternalError("Invalid index of current unified mode "+monitorDevice);
             }
@@ -312,13 +371,13 @@ public class MonitorModeProps {
     }
 
     /** WARNING: must be synchronized with ScreenMode.h, native implementation */
-    public static int[] streamOutMonitorDevice (MonitorDevice monitorDevice) {
+    public static int[] streamOutMonitorDevice (final MonitorDevice monitorDevice) {
         // min 11: count, id, ScreenSizeMM[width, height], Viewport[x, y, width, height], currentMonitorModeId, rotation, supportedModeId+
-        int supportedModeCount = monitorDevice.getSupportedModes().size();
+        final int supportedModeCount = monitorDevice.getSupportedModes().size();
         if( 0 == supportedModeCount ) {
             throw new RuntimeException("no supported modes: "+monitorDevice);
         }
-        int[] data = new int[MIN_MONITOR_DEVICE_PROPERTIES + supportedModeCount - 1];
+        final int[] data = new int[MIN_MONITOR_DEVICE_PROPERTIES + supportedModeCount - 1];
         int idx=0;
         data[idx++] = data.length;
         data[idx++] = monitorDevice.getId();
@@ -328,6 +387,10 @@ public class MonitorModeProps {
         data[idx++] = monitorDevice.getViewport().getY();
         data[idx++] = monitorDevice.getViewport().getWidth();
         data[idx++] = monitorDevice.getViewport().getHeight();
+        data[idx++] = monitorDevice.getViewportInWindowUnits().getX();
+        data[idx++] = monitorDevice.getViewportInWindowUnits().getY();
+        data[idx++] = monitorDevice.getViewportInWindowUnits().getWidth();
+        data[idx++] = monitorDevice.getViewportInWindowUnits().getHeight();
         data[idx++] = monitorDevice.getCurrentMode().getId();
         data[idx++] = monitorDevice.getCurrentMode().getRotation();
         final List<MonitorMode> supportedModes = monitorDevice.getSupportedModes();
@@ -340,7 +403,7 @@ public class MonitorModeProps {
         return data;
     }
 
-    public final void swapRotatePair(int rotation, int[] pairs, int offset, int numPairs) {
+    public final void swapRotatePair(final int rotation, final int[] pairs, int offset, final int numPairs) {
         if( MonitorMode.ROTATE_0 == rotation || MonitorMode.ROTATE_180 == rotation ) {
             // nop
             return;
diff --git a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
index 9364ada..793fbf9 100644
--- a/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
+++ b/src/newt/classes/jogamp/newt/NEWTJNILibLoader.java
@@ -42,8 +42,6 @@ package jogamp.newt;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 
-import jogamp.nativewindow.NWJNILibLoader;
-
 import com.jogamp.common.jvm.JNILibLoaderBase;
 import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.cache.TempJarCache;
@@ -56,7 +54,7 @@ public class NEWTJNILibLoader extends JNILibLoaderBase {
                 Platform.initSingleton();
                 final String libName = "newt";
                 if(TempJarCache.isInitialized() && null == TempJarCache.findLibrary(libName)) {
-                    JNILibLoaderBase.addNativeJarLibsJoglCfg(new Class<?>[] { NWJNILibLoader.class, NEWTJNILibLoader.class });
+                    JNILibLoaderBase.addNativeJarLibsJoglCfg(new Class<?>[] { jogamp.nativewindow.Debug.class, jogamp.newt.Debug.class });
                 }
                 return Boolean.valueOf(loadLibrary(libName, false, NEWTJNILibLoader.class.getClassLoader()));
             }
diff --git a/src/newt/classes/jogamp/newt/OffscreenWindow.java b/src/newt/classes/jogamp/newt/OffscreenWindow.java
index 2478b1e..749391f 100644
--- a/src/newt/classes/jogamp/newt/OffscreenWindow.java
+++ b/src/newt/classes/jogamp/newt/OffscreenWindow.java
@@ -88,7 +88,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
     }
 
     @Override
-    public void setSurfaceHandle(long handle) {
+    public void setSurfaceHandle(final long handle) {
         surfaceHandle = handle ;
     }
 
@@ -98,27 +98,27 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
     }
 
     @Override
-    protected void requestFocusImpl(boolean reparented) {
+    protected void requestFocusImpl(final boolean reparented) {
     }
 
     @Override
-    public void setPosition(int x, int y) {
+    public void setPosition(final int x, final int y) {
         // nop
     }
 
     @Override
-    public boolean setFullscreen(boolean fullscreen) {
+    public boolean setFullscreen(final boolean fullscreen) {
         return false; // nop
     }
 
     @Override
-    public boolean setFullscreen(List<MonitorDevice> monitors) {
+    public boolean setFullscreen(final List<MonitorDevice> monitors) {
         return false; // nop
     }
 
 
     @Override
-    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
+    protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, final int flags) {
         sizeChanged(false, width, height, false);
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
             visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
@@ -135,7 +135,7 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
     }
 
     @Override
-    public Point getLocationOnScreen(Point storage) {
+    public Point getLocationOnScreen(final Point storage) {
      if(null!=storage) {
         storage.set(0, 0);
         return storage;
@@ -144,12 +144,12 @@ public class OffscreenWindow extends WindowImpl implements MutableSurface {
     }
 
     @Override
-    protected Point getLocationOnScreenImpl(int x, int y) {
+    protected Point getLocationOnScreenImpl(final int x, final int y) {
         return new Point(x,y);
     }
 
     @Override
-    protected void updateInsetsImpl(Insets insets) {
+    protected void updateInsetsImpl(final Insets insets) {
         // nop ..
     }
 }
diff --git a/src/newt/classes/jogamp/newt/PointerIconImpl.java b/src/newt/classes/jogamp/newt/PointerIconImpl.java
index 840799d..546a463 100644
--- a/src/newt/classes/jogamp/newt/PointerIconImpl.java
+++ b/src/newt/classes/jogamp/newt/PointerIconImpl.java
@@ -95,7 +95,7 @@ public class PointerIconImpl implements PointerIcon {
             try {
                 handle = display.createPointerIconImpl(pixelformat, size.getWidth(), size.getHeight(), pixels, hotspot.getX(), hotspot.getY());
                 return handle;
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
                 return 0;
             }
@@ -121,8 +121,8 @@ public class PointerIconImpl implements PointerIcon {
 
     @Override
     public synchronized void destroy() {
-        if(DisplayImpl.DEBUG) {
-            System.err.println("PointerIcon.destroy: "+this+", "+display+", "+DisplayImpl.getThreadName());
+        if(Display.DEBUG) {
+            System.err.println("PointerIcon.destroy: "+this+", "+display+", "+Display.getThreadName());
         }
         if( 0 != handle ) {
             synchronized(display.pointerIconList) {
@@ -143,7 +143,7 @@ public class PointerIconImpl implements PointerIcon {
         handle = 0;
         try {
             display.destroyPointerIconImpl(dpy, h);
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
         }
     }
diff --git a/src/newt/classes/jogamp/newt/ScreenImpl.java b/src/newt/classes/jogamp/newt/ScreenImpl.java
index d7e6c64..e73e153 100644
--- a/src/newt/classes/jogamp/newt/ScreenImpl.java
+++ b/src/newt/classes/jogamp/newt/ScreenImpl.java
@@ -45,6 +45,7 @@ import javax.media.nativewindow.util.Rectangle;
 import javax.media.nativewindow.util.RectangleImmutable;
 
 import com.jogamp.common.util.ArrayHashSet;
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.newt.Display;
 import com.jogamp.newt.MonitorDevice;
 import com.jogamp.newt.MonitorMode;
@@ -59,7 +60,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
 
     static {
         Debug.initSingleton();
-        DEBUG_TEST_SCREENMODE_DISABLED = Debug.isPropertyDefined("newt.test.Screen.disableScreenMode", true);
+        DEBUG_TEST_SCREENMODE_DISABLED = PropertyAccess.isPropertyDefined("newt.test.Screen.disableScreenMode", true);
     }
 
     public static final int default_sm_bpp = 32;
@@ -81,14 +82,15 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     protected int hashCode;
     protected AbstractGraphicsScreen aScreen;
     protected int refCount; // number of Screen references by Window
-    protected Rectangle vOriginSize = new Rectangle(0, 0, 0, 0); // virtual rotated screen origin and size
+    protected Rectangle virtViewportPU = new Rectangle(0, 0, 0, 0); // virtual rotated viewport in pixel units
+    protected Rectangle virtViewportWU = new Rectangle(0, 0, 0, 0); // virtual rotated viewport in window units
     protected static Dimension usrSize = null; // property values: newt.ws.swidth and newt.ws.sheight
     protected static volatile boolean usrSizeQueried = false;
-    private ArrayList<MonitorModeListener> refMonitorModeListener = new ArrayList<MonitorModeListener>();
+    private final ArrayList<MonitorModeListener> refMonitorModeListener = new ArrayList<MonitorModeListener>();
 
     private long tCreated; // creationTime
 
-    private static Class<?> getScreenClass(String type) throws ClassNotFoundException
+    private static Class<?> getScreenClass(final String type) throws ClassNotFoundException
     {
         final Class<?> screenClass = NewtFactory.getCustomClass(type, "ScreenDriver");
         if(null==screenClass) {
@@ -97,14 +99,14 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
         return screenClass;
     }
 
-    public static Screen create(Display display, int idx) {
+    public static Screen create(final Display display, int idx) {
         try {
             if(!usrSizeQueried) {
                 synchronized (Screen.class) {
                     if(!usrSizeQueried) {
                         usrSizeQueried = true;
-                        final int w = Debug.getIntProperty("newt.ws.swidth", true, 0);
-                        final int h = Debug.getIntProperty("newt.ws.sheight", true, 0);
+                        final int w = PropertyAccess.getIntProperty("newt.ws.swidth", true, 0);
+                        final int h = PropertyAccess.getIntProperty("newt.ws.sheight", true, 0);
                         if(w>0 && h>0) {
                             usrSize = new Dimension(w, h);
                             System.err.println("User screen size "+usrSize);
@@ -113,12 +115,12 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
                 }
             }
             synchronized(screenList) {
-                Class<?> screenClass = getScreenClass(display.getType());
+                final Class<?> screenClass = getScreenClass(display.getType());
                 ScreenImpl screen  = (ScreenImpl) screenClass.newInstance();
                 screen.display = (DisplayImpl) display;
                 idx = screen.validateScreenIndex(idx);
                 {
-                    Screen screen0 = ScreenImpl.getLastScreenOf(display, idx, -1);
+                    final Screen screen0 = Screen.getLastScreenOf(display, idx, -1);
                     if(null != screen0) {
                         if(DEBUG) {
                             System.err.println("Screen.create() REUSE: "+screen0+" "+Display.getThreadName());
@@ -130,19 +132,28 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
                 screen.screen_idx = idx;
                 screen.fqname = display.getFQName()+"-s"+idx;
                 screen.hashCode = screen.fqname.hashCode();
+                screen.instantiationFinished();
                 Screen.addScreen2List(screen);
                 if(DEBUG) {
                     System.err.println("Screen.create() NEW: "+screen+" "+Display.getThreadName());
                 }
                 return screen;
             }
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new RuntimeException(e);
         }
     }
 
+    /**
+     * Notifies the driver impl. that the instantiation is finished,
+     * ie. instance created and all fields set.
+     */
+    protected void instantiationFinished() {
+        // nop
+    }
+
     @Override
-    public boolean equals(Object obj) {
+    public boolean equals(final Object obj) {
         if (obj == null) {
             return false;
         }
@@ -171,7 +182,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
         if(null == aScreen) {
             if(DEBUG) {
                 tCreated = System.nanoTime();
-                System.err.println("Screen.createNative() START ("+DisplayImpl.getThreadName()+", "+this+")");
+                System.err.println("Screen.createNative() START ("+Display.getThreadName()+", "+this+")");
             } else {
                 tCreated = 0;
             }
@@ -186,7 +197,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
             synchronized(screenList) {
                 screensActive++;
                 if(DEBUG) {
-                    System.err.println("Screen.createNative() END ("+DisplayImpl.getThreadName()+", "+this+"), active "+screensActive+", total "+ (System.nanoTime()-tCreated)/1e6 +"ms");
+                    System.err.println("Screen.createNative() END ("+Display.getThreadName()+", "+this+"), active "+screensActive+", total "+ (System.nanoTime()-tCreated)/1e6 +"ms");
                 }
             }
             ScreenMonitorState.getScreenMonitorState(this.getFQName()).addListener(this);
@@ -200,7 +211,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
                 screensActive--;
             }
             if(DEBUG) {
-                System.err.println("Screen.destroy() ("+DisplayImpl.getThreadName()+"): active "+screensActive);
+                System.err.println("Screen.destroy() ("+Display.getThreadName()+"): active "+screensActive);
                 // Thread.dumpStack();
             }
         }
@@ -217,7 +228,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     @Override
     public synchronized final int addReference() throws NativeWindowException {
         if(DEBUG) {
-            System.err.println("Screen.addReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount+1));
+            System.err.println("Screen.addReference() ("+Display.getThreadName()+"): "+refCount+" -> "+(refCount+1));
             // Thread.dumpStack();
         }
         if ( 0 == refCount ) {
@@ -231,7 +242,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     @Override
     public synchronized final int removeReference() {
         if(DEBUG) {
-            System.err.println("Screen.removeReference() ("+DisplayImpl.getThreadName()+"): "+refCount+" -> "+(refCount-1));
+            System.err.println("Screen.removeReference() ("+Display.getThreadName()+"): "+refCount+" -> "+(refCount-1));
             // Thread.dumpStack();
         }
         refCount--; // could become < 0, in case of manual destruction without actual creation/addReference
@@ -260,19 +271,20 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     protected abstract int validateScreenIndex(int idx);
 
     /**
-     * Stores the virtual origin and virtual <b>rotated</b> screen size.
+     * Calculates the virtual rotated viewport in pixel- and window units.
      * <p>
      * This method is called after the MonitorMode has been set or changed,
      * hence you may utilize it.
      * </p>
      * <p>
      * Default implementation uses the union of all monitor's viewport,
-     * calculated via {@link #unionOfMonitorViewportSize()}.
+     * calculated via {@link #unionOfMonitorViewportSize()}, however driver impl. may chose a different methodology.
      * </p>
-     * @param vOriginSize storage for result
+     * @param viewport storage for result in pixel units
+     * @param viewportInWindowUnits storage for result in window units
      */
-    protected void calcVirtualScreenOriginAndSize(final Rectangle vOriginSize) {
-        unionOfMonitorViewportSize(vOriginSize);
+    protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
+        unionOfMonitorViewports(viewport, viewportInWindowUnits);
     }
 
     @Override
@@ -281,18 +293,19 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     }
 
     /**
-     * Updates the <b>rotated</b> virtual ScreenSize using the native impl.
+     * Updates the <b>rotated</b> virtual viewport, may use native impl.
      */
     protected void updateVirtualScreenOriginAndSize() {
         if(null != usrSize ) {
-            vOriginSize.set(0, 0, usrSize.getWidth(), usrSize.getHeight());
+            virtViewportPU.set(0, 0, usrSize.getWidth(), usrSize.getHeight());
+            virtViewportWU.set(0, 0, usrSize.getWidth(), usrSize.getHeight());
             if(DEBUG) {
-                System.err.println("Update user virtual screen viewport @ "+Thread.currentThread().getName()+": "+vOriginSize);
+                System.err.println("Update user virtual screen viewport @ "+Thread.currentThread().getName()+": "+virtViewportPU);
             }
         } else {
-            calcVirtualScreenOriginAndSize(vOriginSize);
+            calcVirtualScreenOriginAndSize(virtViewportPU, virtViewportWU);
             if(DEBUG) {
-                System.err.println("Updated virtual screen viewport @ "+Thread.currentThread().getName()+": "+vOriginSize);
+                System.err.println("Updated virtual screen viewport @ "+Thread.currentThread().getName()+": "+virtViewportPU+" [pixel], "+virtViewportWU+" [window]");
             }
         }
     }
@@ -318,19 +331,21 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     }
 
     @Override
-    public final int getX() { return vOriginSize.getX(); }
+    public final int getX() { return virtViewportPU.getX(); }
     @Override
-    public final int getY() { return vOriginSize.getY(); }
+    public final int getY() { return virtViewportPU.getY(); }
     @Override
-    public final int getWidth() { return vOriginSize.getWidth(); }
+    public final int getWidth() { return virtViewportPU.getWidth(); }
     @Override
-    public final int getHeight() { return vOriginSize.getHeight(); }
+    public final int getHeight() { return virtViewportPU.getHeight(); }
     @Override
-    public final RectangleImmutable getViewport() { return vOriginSize; }
+    public final RectangleImmutable getViewport() { return virtViewportPU; }
+    @Override
+    public final RectangleImmutable getViewportInWindowUnits() { return virtViewportWU; }
 
     @Override
     public String toString() {
-        return "NEWT-Screen["+getFQName()+", idx "+screen_idx+", refCount "+refCount+", vsize "+vOriginSize+", "+aScreen+", "+display+
+        return "NEWT-Screen["+getFQName()+", idx "+screen_idx+", refCount "+refCount+", vsize "+virtViewportPU+" [pixels], "+virtViewportWU+" [window], "+aScreen+", "+display+
                             ", monitors: "+getMonitorDevices()+"]";
     }
 
@@ -357,7 +372,10 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
      */
     protected abstract void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache);
 
-    protected Rectangle getNativeMonitorDeviceViewportImpl(MonitorDevice monitor) { return null; }
+    protected boolean updateNativeMonitorDeviceViewportImpl(final MonitorDevice monitor,
+                                                            final Rectangle viewportPU, final Rectangle viewportWU) {
+        return false;
+    }
 
     /**
      * To be implemented by the native specification.<br>
@@ -387,7 +405,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
         return null != sms ? sms.getMonitorDevices().getData() : null;
     }
 
-    final ScreenMonitorState getScreenMonitorStatus(boolean throwException) {
+    final ScreenMonitorState getScreenMonitorStatus(final boolean throwException) {
         final String key = this.getFQName();
         final ScreenMonitorState res = ScreenMonitorState.getScreenMonitorState(key);
         if(null == res & throwException) {
@@ -397,12 +415,12 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     }
 
     @Override
-    public void monitorModeChangeNotify(MonitorEvent me) {
+    public void monitorModeChangeNotify(final MonitorEvent me) {
         if(DEBUG) {
             System.err.println("monitorModeChangeNotify @ "+Thread.currentThread().getName()+": "+me);
         }
         for(int i=0; i<refMonitorModeListener.size(); i++) {
-            ((MonitorModeListener)refMonitorModeListener.get(i)).monitorModeChangeNotify(me);
+            refMonitorModeListener.get(i).monitorModeChangeNotify(me);
         }
     }
 
@@ -410,18 +428,15 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
         final List<MonitorDevice> monitors = getMonitorDevices();
         for(int i=monitors.size()-1; i>=0; i--) {
             final MonitorDeviceImpl monitor = (MonitorDeviceImpl) monitors.get(i);
-            final Rectangle newViewport = getNativeMonitorDeviceViewportImpl(monitor);
+            final boolean viewportUpdated = updateNativeMonitorDeviceViewportImpl(monitor, monitor.getMutuableViewportPU(), monitor.getMutuableViewportWU());
             if( DEBUG ) {
-                System.err.println("Screen.updateMonitorViewport["+i+"] @  "+Thread.currentThread().getName()+": "+monitor.getViewport()+" -> "+newViewport);
-            }
-            if( null != newViewport ) {
-                monitor.setViewportValue(newViewport);
+                System.err.println("Screen.updateMonitorViewport["+i+"] @  "+Thread.currentThread().getName()+": updated: "+viewportUpdated+", PU "+monitor.getViewport()+", WU "+monitor.getViewportInWindowUnits());
             }
         }
     }
 
     @Override
-    public void monitorModeChanged(MonitorEvent me, boolean success) {
+    public void monitorModeChanged(final MonitorEvent me, final boolean success) {
         if(success) {
             updateNativeMonitorDevicesViewport();
             updateVirtualScreenOriginAndSize();
@@ -430,17 +445,17 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
             System.err.println("monitorModeChangeNotify @ "+Thread.currentThread().getName()+": success "+success+", "+me);
         }
         for(int i=0; i<refMonitorModeListener.size(); i++) {
-            ((MonitorModeListener)refMonitorModeListener.get(i)).monitorModeChanged(me, success);
+            refMonitorModeListener.get(i).monitorModeChanged(me, success);
         }
     }
 
     @Override
-    public synchronized final void addMonitorModeListener(MonitorModeListener sml) {
+    public synchronized final void addMonitorModeListener(final MonitorModeListener sml) {
         refMonitorModeListener.add(sml);
     }
 
     @Override
-    public synchronized final void removeMonitorModeListener(MonitorModeListener sml) {
+    public synchronized final void removeMonitorModeListener(final MonitorModeListener sml) {
         refMonitorModeListener.remove(sml);
     }
 
@@ -450,7 +465,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
      * @param modeId
      * @return
      */
-    private final MonitorMode getVirtualMonitorMode(MonitorModeProps.Cache cache, int modeId) {
+    private final MonitorMode getVirtualMonitorMode(final MonitorModeProps.Cache cache, final int modeId) {
         final int[] props = new int[MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL];
         int i = 0;
         props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
@@ -474,17 +489,21 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
      * @param currentMode
      * @return
      */
-    private final MonitorDevice getVirtualMonitorDevice(MonitorModeProps.Cache cache, int monitorId, MonitorMode currentMode) {
-        int[] props = new int[MonitorModeProps.MIN_MONITOR_DEVICE_PROPERTIES];
+    private final MonitorDevice getVirtualMonitorDevice(final MonitorModeProps.Cache cache, final int monitorId, final MonitorMode currentMode) {
+        final int[] props = new int[MonitorModeProps.MIN_MONITOR_DEVICE_PROPERTIES];
         int i = 0;
         props[i++] = MonitorModeProps.MIN_MONITOR_DEVICE_PROPERTIES;
         props[i++] = monitorId;
         props[i++] = default_sm_widthmm;
         props[i++] = default_sm_heightmm;
-        props[i++] = 0; // rotated viewport x
-        props[i++] = 0; // rotated viewport y
-        props[i++] = currentMode.getRotatedWidth();  // rotated viewport width
-        props[i++] = currentMode.getRotatedHeight(); // rotated viewport height
+        props[i++] = 0; // rotated viewport x pixel-units
+        props[i++] = 0; // rotated viewport y pixel-units
+        props[i++] = currentMode.getRotatedWidth();  // rotated viewport width pixel-units
+        props[i++] = currentMode.getRotatedHeight(); // rotated viewport height pixel-units
+        props[i++] = 0; // rotated viewport x window-units
+        props[i++] = 0; // rotated viewport y window-units
+        props[i++] = currentMode.getRotatedWidth();  // rotated viewport width window-units
+        props[i++] = currentMode.getRotatedHeight(); // rotated viewport height window-units
         props[i++] = currentMode.getId(); // current mode id
         props[i++] = currentMode.getRotation();
         props[i++] = currentMode.getId(); // supported mode id #1
@@ -498,7 +517,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
      * Utilizes {@link #getCurrentMonitorModeImpl()}, if the latter returns null it uses
      * the current screen size and dummy values.
      */
-    protected final MonitorMode queryCurrentMonitorModeIntern(MonitorDevice monitor) {
+    protected final MonitorMode queryCurrentMonitorModeIntern(final MonitorDevice monitor) {
         MonitorMode res;
         if(DEBUG_TEST_SCREENMODE_DISABLED) {
             res = null;
@@ -518,7 +537,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
         long t0;
         if(DEBUG) {
             t0 = System.nanoTime();
-            System.err.println("Screen.initMonitorState() START ("+DisplayImpl.getThreadName()+", "+this+")");
+            System.err.println("Screen.initMonitorState() START ("+Display.getThreadName()+", "+this+")");
         } else {
             t0 = 0;
         }
@@ -540,20 +559,20 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
                 }
                 // Sort MonitorModes (all and per device) in descending order - default!
                 MonitorModeUtil.sort(cache.monitorModes.getData(), false ); // descending order
-                for(Iterator<MonitorDevice> iMonitor=cache.monitorDevices.iterator(); iMonitor.hasNext(); ) {
+                for(final Iterator<MonitorDevice> iMonitor=cache.monitorDevices.iterator(); iMonitor.hasNext(); ) {
                     MonitorModeUtil.sort(iMonitor.next().getSupportedModes(), false ); // descending order
                 }
                 if(DEBUG) {
                     int i=0;
-                    for(Iterator<MonitorMode> iMode=cache.monitorModes.iterator(); iMode.hasNext(); i++) {
+                    for(final Iterator<MonitorMode> iMode=cache.monitorModes.iterator(); iMode.hasNext(); i++) {
                         System.err.println("All["+i+"]: "+iMode.next());
                     }
                     i=0;
-                    for(Iterator<MonitorDevice> iMonitor=cache.monitorDevices.iterator(); iMonitor.hasNext(); i++) {
+                    for(final Iterator<MonitorDevice> iMonitor=cache.monitorDevices.iterator(); iMonitor.hasNext(); i++) {
                         final MonitorDevice crt = iMonitor.next();
                         System.err.println("["+i+"]: "+crt);
                         int j=0;
-                        for(Iterator<MonitorMode> iMode=crt.getSupportedModes().iterator(); iMode.hasNext(); j++) {
+                        for(final Iterator<MonitorMode> iMode=crt.getSupportedModes().iterator(); iMode.hasNext(); j++) {
                             System.err.println("["+i+"]["+j+"]: "+iMode.next());
                         }
                     }
@@ -580,7 +599,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
      * Collects {@link MonitorDevice}s and {@link MonitorMode}s within the given cache.
      * </p>
      */
-    private final int collectNativeMonitorModes(MonitorModeProps.Cache cache) {
+    private final int collectNativeMonitorModes(final MonitorModeProps.Cache cache) {
         if(!DEBUG_TEST_SCREENMODE_DISABLED) {
             collectNativeMonitorModesAndDevicesImpl(cache);
         }
@@ -628,7 +647,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
                                 System.err.println("Screen.destroy(): Reset "+monitor);
                                 try {
                                     monitor.setCurrentMode(monitor.getOriginalMode());
-                                } catch (Throwable t) {
+                                } catch (final Throwable t) {
                                     // be verbose but continue
                                     t.printStackTrace();
                                 }
@@ -646,7 +665,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
     }
 
     private final void shutdown() {
-        ScreenMonitorState sms = ScreenMonitorState.getScreenMonitorStateUnlocked(getFQName());
+        final ScreenMonitorState sms = ScreenMonitorState.getScreenMonitorStateUnlocked(getFQName());
         if(null != sms) {
             final ArrayList<MonitorDevice> monitorDevices = sms.getMonitorDevices().getData();
             for(int i=0; i<monitorDevices.size(); i++) {
@@ -655,7 +674,7 @@ public abstract class ScreenImpl extends Screen implements MonitorModeListener {
                     System.err.println("Screen.shutdown(): Reset "+monitor);
                     try {
                         monitor.setCurrentMode(monitor.getOriginalMode());
-                    } catch (Throwable t) {
+                    } catch (final Throwable t) {
                         // be quiet .. shutdown
                     }
                 }
diff --git a/src/newt/classes/jogamp/newt/ScreenMonitorState.java b/src/newt/classes/jogamp/newt/ScreenMonitorState.java
index 01e6cfe..ae98241 100644
--- a/src/newt/classes/jogamp/newt/ScreenMonitorState.java
+++ b/src/newt/classes/jogamp/newt/ScreenMonitorState.java
@@ -46,15 +46,15 @@ public class ScreenMonitorState {
     private final RecursiveLock lock = LockFactory.createRecursiveLock();
     private final ArrayHashSet<MonitorDevice> allMonitors;
     private final ArrayHashSet<MonitorMode> allMonitorModes;
-    private ArrayList<MonitorModeListener> listener = new ArrayList<MonitorModeListener>();
+    private final ArrayList<MonitorModeListener> listener = new ArrayList<MonitorModeListener>();
 
     private static HashMap<String, ScreenMonitorState> screenFQN2ScreenMonitorState = new HashMap<String, ScreenMonitorState>();
     private static RecursiveLock screen2ScreenMonitorState = LockFactory.createRecursiveLock();
 
-    protected static void mapScreenMonitorState(String screenFQN, ScreenMonitorState sms) {
+    protected static void mapScreenMonitorState(final String screenFQN, final ScreenMonitorState sms) {
         screen2ScreenMonitorState.lock();
         try {
-            ScreenMonitorState _sms = screenFQN2ScreenMonitorState.get(screenFQN);
+            final ScreenMonitorState _sms = screenFQN2ScreenMonitorState.get(screenFQN);
             if( null != _sms ) {
                 throw new RuntimeException("ScreenMonitorState "+_sms+" already mapped to "+screenFQN);
             }
@@ -71,7 +71,7 @@ public class ScreenMonitorState {
      * @param screen the prev user
      * @return true if mapping is empty, ie no more usage of the mapped ScreenMonitorState
      */
-    protected static void unmapScreenMonitorState(String screenFQN) {
+    protected static void unmapScreenMonitorState(final String screenFQN) {
         screen2ScreenMonitorState.lock();
         try {
             unmapScreenMonitorStateUnlocked(screenFQN);
@@ -79,14 +79,14 @@ public class ScreenMonitorState {
             screen2ScreenMonitorState.unlock();
         }
     }
-    protected static void unmapScreenMonitorStateUnlocked(String screenFQN) {
-        ScreenMonitorState sms = screenFQN2ScreenMonitorState.remove(screenFQN);
+    protected static void unmapScreenMonitorStateUnlocked(final String screenFQN) {
+        final ScreenMonitorState sms = screenFQN2ScreenMonitorState.remove(screenFQN);
         if(DEBUG) {
             System.err.println("ScreenMonitorState.unmap "+screenFQN+" -> "+sms);
         }
     }
 
-    protected static ScreenMonitorState getScreenMonitorState(String screenFQN) {
+    protected static ScreenMonitorState getScreenMonitorState(final String screenFQN) {
         screen2ScreenMonitorState.lock();
         try {
             return getScreenMonitorStateUnlocked(screenFQN);
@@ -94,7 +94,7 @@ public class ScreenMonitorState {
             screen2ScreenMonitorState.unlock();
         }
     }
-    protected static ScreenMonitorState getScreenMonitorStateUnlocked(String screenFQN) {
+    protected static ScreenMonitorState getScreenMonitorStateUnlocked(final String screenFQN) {
         return screenFQN2ScreenMonitorState.get(screenFQN);
     }
 
@@ -106,8 +106,8 @@ public class ScreenMonitorState {
         screen2ScreenMonitorState.unlock();
     }
 
-    public ScreenMonitorState(ArrayHashSet<MonitorDevice> allMonitors,
-                              ArrayHashSet<MonitorMode> allMonitorModes) {
+    public ScreenMonitorState(final ArrayHashSet<MonitorDevice> allMonitors,
+                              final ArrayHashSet<MonitorMode> allMonitorModes) {
         this.allMonitors = allMonitors;
         this.allMonitorModes = allMonitorModes;
     }
@@ -120,7 +120,7 @@ public class ScreenMonitorState {
         return allMonitorModes;
     }
 
-    protected final int addListener(MonitorModeListener l) {
+    protected final int addListener(final MonitorModeListener l) {
         lock();
         try {
             listener.add(l);
@@ -133,7 +133,7 @@ public class ScreenMonitorState {
         }
     }
 
-    protected final int removeListener(MonitorModeListener l) {
+    protected final int removeListener(final MonitorModeListener l) {
         lock();
         try {
             if(!listener.remove(l)) {
@@ -148,18 +148,18 @@ public class ScreenMonitorState {
         }
     }
 
-    protected final MonitorDevice getMonitor(MonitorDevice monitor) {
+    protected final MonitorDevice getMonitor(final MonitorDevice monitor) {
         return allMonitors.get(monitor);
     }
 
-    protected final void validateMonitor(MonitorDevice monitor) {
+    protected final void validateMonitor(final MonitorDevice monitor) {
         final MonitorDevice md = allMonitors.get(monitor);
         if( null == md ) {
             throw new InternalError("Monitor unknown: "+monitor);
         }
     }
 
-    protected final void fireMonitorModeChangeNotify(MonitorDevice monitor, MonitorMode desiredMode) {
+    protected final void fireMonitorModeChangeNotify(final MonitorDevice monitor, final MonitorMode desiredMode) {
         lock();
         try {
             validateMonitor(monitor);
@@ -172,7 +172,7 @@ public class ScreenMonitorState {
         }
     }
 
-    protected void fireMonitorModeChanged(MonitorDevice monitor, MonitorMode currentMode, boolean success) {
+    protected void fireMonitorModeChanged(final MonitorDevice monitor, final MonitorMode currentMode, final boolean success) {
         lock();
         try {
             validateMonitor(monitor);
diff --git a/src/newt/classes/jogamp/newt/WindowImpl.java b/src/newt/classes/jogamp/newt/WindowImpl.java
index 9593d4f..b626289 100644
--- a/src/newt/classes/jogamp/newt/WindowImpl.java
+++ b/src/newt/classes/jogamp/newt/WindowImpl.java
@@ -48,6 +48,7 @@ import javax.media.nativewindow.NativeWindow;
 import javax.media.nativewindow.NativeWindowException;
 import javax.media.nativewindow.NativeWindowFactory;
 import javax.media.nativewindow.OffscreenLayerSurface;
+import javax.media.nativewindow.ScalableSurface;
 import javax.media.nativewindow.SurfaceUpdatedListener;
 import javax.media.nativewindow.WindowClosingProtocol;
 import javax.media.nativewindow.util.DimensionImmutable;
@@ -59,10 +60,12 @@ import javax.media.nativewindow.util.PointImmutable;
 import javax.media.nativewindow.util.Rectangle;
 import javax.media.nativewindow.util.RectangleImmutable;
 
+import jogamp.nativewindow.SurfaceScaleUtils;
 import jogamp.nativewindow.SurfaceUpdatedHelper;
 
 import com.jogamp.common.util.ArrayHashSet;
 import com.jogamp.common.util.IntBitfield;
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.common.util.ReflectionUtil;
 import com.jogamp.common.util.locks.LockFactory;
 import com.jogamp.common.util.locks.RecursiveLock;
@@ -94,7 +97,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
 
     static {
         Debug.initSingleton();
-        DEBUG_TEST_REPARENT_INCOMPATIBLE = Debug.isPropertyDefined("newt.test.Window.reparent.incompatible", true);
+        DEBUG_TEST_REPARENT_INCOMPATIBLE = PropertyAccess.isPropertyDefined("newt.test.Window.reparent.incompatible", true);
 
         ScreenImpl.initSingleton();
     }
@@ -118,7 +121,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             }
         }
     }
-    private static void addWindow2List(WindowImpl window) {
+    private static void addWindow2List(final WindowImpl window) {
         synchronized(windowList) {
             // GC before add
             int i=0, gced=0;
@@ -148,8 +151,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     private volatile long windowHandle = 0; // lifecycle critical
     private volatile boolean visible = false; // lifecycle critical
     private volatile boolean hasFocus = false;
-    private volatile int width = 128, height = 128; // client-area size w/o insets, default: may be overwritten by user
-    private volatile int x = 64, y = 64; // client-area pos w/o insets
+    private volatile int pixWidth = 128, pixHeight = 128; // client-area size w/o insets in pixel units, default: may be overwritten by user
+    private volatile int winWidth = 128, winHeight = 128; // client-area size w/o insets in window units, default: may be overwritten by user
+    protected final int[] nativePixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+    protected final int[] hasPixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+    protected final int[] reqPixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
+
+    private volatile int x = 64, y = 64; // client-area pos w/o insets in window units
     private volatile Insets insets = new Insets(); // insets of decoration (if top-level && decorated)
     private boolean blockInsetsChange = false; // block insets change (from same thread)
 
@@ -194,7 +202,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     /** from event passing: {@link WindowImpl#consumePointerEvent(MouseEvent)}. */
     private static class PointerState0 {
         /** Pointer entered window - is inside the window (may be synthetic) */
-        boolean insideWindow = false;
+        boolean insideSurface = false;
         /** Mouse EXIT has been sent (only for MOUSE type enter/exit)*/
         boolean exitSent = false;
 
@@ -207,7 +215,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         void clearButton() {
             lastButtonPressTime = 0;
         }
-        public String toString() { return "PState0[inside "+insideWindow+", exitSent "+exitSent+", lastPress "+lastButtonPressTime+", dragging "+dragging+"]"; }
+        public String toString() { return "PState0[inside "+insideSurface+", exitSent "+exitSent+", lastPress "+lastButtonPressTime+", dragging "+dragging+"]"; }
     }
     private final PointerState0 pState0 = new PointerState0();
 
@@ -235,13 +243,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         final Point[] movePositions = new Point[] {
                 new Point(), new Point(), new Point(), new Point(),
                 new Point(), new Point(), new Point(), new Point() };
-        final Point getMovePosition(int id) {
+        final Point getMovePosition(final int id) {
             if( 0 <= id && id < movePositions.length ) {
                 return movePositions[id];
             }
             return null;
         }
-        public final String toString() { return "PState1[inside "+insideWindow+", exitSent "+exitSent+", lastPress "+lastButtonPressTime+
+        public final String toString() { return "PState1[inside "+insideSurface+", exitSent "+exitSent+", lastPress "+lastButtonPressTime+
                             ", pressed [button "+buttonPressed+", mask "+buttonPressedMask+", dragging "+dragging+", clickCount "+lastButtonClickCount+"]"; }
     }
     private final PointerState1 pState1 = new PointerState1();
@@ -264,7 +272,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     // Construction Methods
     //
 
-    private static Class<?> getWindowClass(String type)
+    private static Class<?> getWindowClass(final String type)
         throws ClassNotFoundException
     {
         final Class<?> windowClass = NewtFactory.getCustomClass(type, "WindowDriver");
@@ -274,7 +282,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return windowClass;
     }
 
-    public static WindowImpl create(NativeWindow parentWindow, long parentWindowHandle, Screen screen, CapabilitiesImmutable caps) {
+    public static WindowImpl create(final NativeWindow parentWindow, final long parentWindowHandle, final Screen screen, final CapabilitiesImmutable caps) {
         try {
             Class<?> windowClass;
             if(caps.isOnscreen()) {
@@ -282,7 +290,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             } else {
                 windowClass = OffscreenWindow.class;
             }
-            WindowImpl window = (WindowImpl) windowClass.newInstance();
+            final WindowImpl window = (WindowImpl) windowClass.newInstance();
             window.parentWindow = parentWindow;
             window.parentWindowHandle = parentWindowHandle;
             window.screen = (ScreenImpl) screen;
@@ -290,30 +298,30 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             window.instantiationFinished();
             addWindow2List(window);
             return window;
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             throw new NativeWindowException(t);
         }
     }
 
-    public static WindowImpl create(Object[] cstrArguments, Screen screen, CapabilitiesImmutable caps) {
+    public static WindowImpl create(final Object[] cstrArguments, final Screen screen, final CapabilitiesImmutable caps) {
         try {
-            Class<?> windowClass = getWindowClass(screen.getDisplay().getType());
-            Class<?>[] cstrArgumentTypes = getCustomConstructorArgumentTypes(windowClass);
+            final Class<?> windowClass = getWindowClass(screen.getDisplay().getType());
+            final Class<?>[] cstrArgumentTypes = getCustomConstructorArgumentTypes(windowClass);
             if(null==cstrArgumentTypes) {
                 throw new NativeWindowException("WindowClass "+windowClass+" doesn't support custom arguments in constructor");
             }
-            int argsChecked = verifyConstructorArgumentTypes(cstrArgumentTypes, cstrArguments);
+            final int argsChecked = verifyConstructorArgumentTypes(cstrArgumentTypes, cstrArguments);
             if ( argsChecked < cstrArguments.length ) {
                 throw new NativeWindowException("WindowClass "+windowClass+" constructor mismatch at argument #"+argsChecked+"; Constructor: "+getTypeStrList(cstrArgumentTypes)+", arguments: "+getArgsStrList(cstrArguments));
             }
-            WindowImpl window = (WindowImpl) ReflectionUtil.createInstance( windowClass, cstrArgumentTypes, cstrArguments ) ;
+            final WindowImpl window = (WindowImpl) ReflectionUtil.createInstance( windowClass, cstrArgumentTypes, cstrArguments ) ;
             window.screen = (ScreenImpl) screen;
             window.capsRequested = (CapabilitiesImmutable) caps.cloneMutable();
             window.instantiationFinished();
             addWindow2List(window);
             return window;
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             throw new NativeWindowException(t);
         }
     }
@@ -332,7 +340,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         parentWindowHandle = 0;
     }
 
-    protected final void setGraphicsConfiguration(AbstractGraphicsConfiguration cfg) {
+    protected final void setGraphicsConfiguration(final AbstractGraphicsConfiguration cfg) {
         config = cfg;
     }
 
@@ -500,7 +508,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return true;
     }
 
-    private static long getNativeWindowHandle(NativeWindow nativeWindow) {
+    private static long getNativeWindowHandle(final NativeWindow nativeWindow) {
         long handle = 0;
         if(null!=nativeWindow) {
             boolean wasLocked = false;
@@ -511,7 +519,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     if(0==handle) {
                         throw new NativeWindowException("Parent native window handle is NULL, after succesful locking: "+nativeWindow);
                     }
-                } catch (NativeWindowException nwe) {
+                } catch (final NativeWindowException nwe) {
                     if(DEBUG_IMPLEMENTATION) {
                         System.err.println("Window.getNativeWindowHandle: not successful yet: "+nwe);
                     }
@@ -549,9 +557,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final WindowClosingMode setDefaultCloseOperation(WindowClosingMode op) {
+    public final WindowClosingMode setDefaultCloseOperation(final WindowClosingMode op) {
         synchronized (closingListenerLock) {
-            WindowClosingMode _op = defaultCloseOperation;
+            final WindowClosingMode _op = defaultCloseOperation;
             defaultCloseOperation = op;
             return _op;
         }
@@ -632,10 +640,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * to insets and positioning a decorated window to 0/0, which would place the frame
      * outside of the screen.</p>
      *
-     * @param x client-area position, or <0 if unchanged
-     * @param y client-area position, or <0 if unchanged
-     * @param width client-area size, or <=0 if unchanged
-     * @param height client-area size, or <=0 if unchanged
+     * @param x client-area position in window units, or <0 if unchanged
+     * @param y client-area position in window units, or <0 if unchanged
+     * @param width client-area size in window units, or <=0 if unchanged
+     * @param height client-area size in window units, or <=0 if unchanged
      * @param flags bitfield of change and status flags
      *
      * @see #sizeChanged(int,int)
@@ -649,18 +657,18 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * Default is all but {@link #FLAG_IS_FULLSCREEN_SPAN}
      * </p>
      */
-    protected boolean isReconfigureFlagSupported(int changeFlags) {
+    protected boolean isReconfigureFlagSupported(final int changeFlags) {
         return 0 == ( changeFlags & FLAG_IS_FULLSCREEN_SPAN );
     }
 
-    protected int getReconfigureFlags(int changeFlags, boolean visible) {
-        return changeFlags |= ( ( 0 != getParentWindowHandle() ) ? FLAG_HAS_PARENT : 0 ) |
-                              ( isUndecorated() ? FLAG_IS_UNDECORATED : 0 ) |
-                              ( isFullscreen() ? FLAG_IS_FULLSCREEN : 0 ) |
-                              ( isAlwaysOnTop() ? FLAG_IS_ALWAYSONTOP : 0 ) |
-                              ( visible ? FLAG_IS_VISIBLE : 0 ) ;
+    protected int getReconfigureFlags(final int changeFlags, final boolean visible) {
+        return changeFlags | ( ( 0 != getParentWindowHandle() ) ? FLAG_HAS_PARENT : 0 ) |
+                             ( isUndecorated() ? FLAG_IS_UNDECORATED : 0 ) |
+                             ( isFullscreen() ? FLAG_IS_FULLSCREEN : 0 ) |
+                             ( isAlwaysOnTop() ? FLAG_IS_ALWAYSONTOP : 0 ) |
+                             ( visible ? FLAG_IS_VISIBLE : 0 ) ;
     }
-    protected static String getReconfigureFlagsAsString(StringBuilder sb, int flags) {
+    protected static String getReconfigureFlagsAsString(StringBuilder sb, final int flags) {
         if(null == sb) { sb = new StringBuilder(); }
         sb.append("[");
 
@@ -704,11 +712,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return sb.toString();
     }
 
-    protected void setTitleImpl(String title) {}
+    protected void setTitleImpl(final String title) {}
 
     /**
      * Translates the given window client-area coordinates with top-left origin
-     * to screen coordinates.
+     * to screen coordinates in window units.
      * <p>
      * Since the position reflects the client area, it does not include the insets.
      * </p>
@@ -721,7 +729,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      */
     protected abstract Point getLocationOnScreenImpl(int x, int y);
 
-    /** Triggered by user via {@link #getInsets()}.<br>
+    /**
+     * Triggered by user via {@link #getInsets()}.<br>
      * Implementations may implement this hook to update the insets.<br>
      * However, they may prefer the event driven path via {@link #insetsChanged(boolean, int, int, int, int)}.
      *
@@ -730,9 +739,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      */
     protected abstract void updateInsetsImpl(Insets insets);
 
-    protected boolean setPointerVisibleImpl(boolean pointerVisible) { return false; }
-    protected boolean confinePointerImpl(boolean confine) { return false; }
-    protected void warpPointerImpl(int x, int y) { }
+    protected boolean setPointerVisibleImpl(final boolean pointerVisible) { return false; }
+    protected boolean confinePointerImpl(final boolean confine) { return false; }
+    protected void warpPointerImpl(final int x, final int y) { }
     protected void setPointerIconImpl(final PointerIconImpl pi) { }
 
     //----------------------------------------------------------------------
@@ -811,22 +820,22 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void addSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+    public final void addSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
         surfaceUpdatedHelper.addSurfaceUpdatedListener(l);
     }
 
     @Override
-    public final void addSurfaceUpdatedListener(int index, SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
+    public final void addSurfaceUpdatedListener(final int index, final SurfaceUpdatedListener l) throws IndexOutOfBoundsException {
         surfaceUpdatedHelper.addSurfaceUpdatedListener(index, l);
     }
 
     @Override
-    public final void removeSurfaceUpdatedListener(SurfaceUpdatedListener l) {
+    public final void removeSurfaceUpdatedListener(final SurfaceUpdatedListener l) {
         surfaceUpdatedHelper.removeSurfaceUpdatedListener(l);
     }
 
     @Override
-    public final void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+    public final void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
         surfaceUpdatedHelper.surfaceUpdated(updater, ns, when);
     }
 
@@ -852,6 +861,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     // public final void destroy() - see below
 
     @Override
+    public final NativeSurface getNativeSurface() { return this; }
+
+    @Override
     public final NativeWindow getParent() {
         return parentWindow;
     }
@@ -908,15 +920,27 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return screen;
     }
 
+    protected void setScreen(final ScreenImpl newScreen) { // never null !
+        removeScreenReference();
+        screen = newScreen;
+    }
+
     @Override
     public final MonitorDevice getMainMonitor() {
-        return screen.getMainMonitor(new Rectangle(getX(), getY(), getWidth(), getHeight()));
+        return screen.getMainMonitor( getBounds() );
     }
 
-    protected final void setVisibleImpl(boolean visible, int x, int y, int width, int height) {
+    /**
+     * @param visible
+     * @param x client-area position in window units, or <0 if unchanged
+     * @param y client-area position in window units, or <0 if unchanged
+     * @param width client-area size in window units, or <=0 if unchanged
+     * @param height client-area size in window units, or <=0 if unchanged
+     */
+    protected final void setVisibleImpl(final boolean visible, final int x, final int y, final int width, final int height) {
         reconfigureWindowImpl(x, y, width, height, getReconfigureFlags(FLAG_CHANGE_VISIBILITY, visible));
     }
-    final void setVisibleActionImpl(boolean visible) {
+    final void setVisibleActionImpl(final boolean visible) {
         boolean nativeWindowCreated = false;
         boolean madeVisible = false;
 
@@ -926,7 +950,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             if(!visible && null!=childWindows && childWindows.size()>0) {
               synchronized(childWindowsLock) {
                 for(int i = 0; i < childWindows.size(); i++ ) {
-                    NativeWindow nw = childWindows.get(i);
+                    final NativeWindow nw = childWindows.get(i);
                     if(nw instanceof WindowImpl) {
                         ((WindowImpl)nw).setVisible(false);
                     }
@@ -957,7 +981,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             if(isNativeValid() && visible && null!=childWindows && childWindows.size()>0) {
               synchronized(childWindowsLock) {
                 for(int i = 0; i < childWindows.size(); i++ ) {
-                    NativeWindow nw = childWindows.get(i);
+                    final NativeWindow nw = childWindows.get(i);
                     if(nw instanceof WindowImpl) {
                         ((WindowImpl)nw).setVisible(true);
                     }
@@ -980,7 +1004,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     private class VisibleAction implements Runnable {
         boolean visible;
 
-        private VisibleAction(boolean visible) {
+        private VisibleAction(final boolean visible) {
             this.visible = visible;
         }
 
@@ -991,7 +1015,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void setVisible(boolean wait, boolean visible) {
+    public final void setVisible(final boolean wait, final boolean visible) {
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("Window setVisible: START ("+getThreadName()+") "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible: "+this.visible+" -> "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+(null!=parentWindow));
         }
@@ -999,18 +1023,18 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void setVisible(boolean visible) {
+    public final void setVisible(final boolean visible) {
         setVisible(true, visible);
     }
 
     private class SetSizeAction implements Runnable {
         int width, height;
-        boolean disregardFS;
+        boolean force;
 
-        private SetSizeAction(int w, int h, boolean disregardFS) {
+        private SetSizeAction(final int w, final int h, final boolean disregardFS) {
             this.width = w;
             this.height = h;
-            this.disregardFS = disregardFS;
+            this.force = disregardFS;
         }
 
         @Override
@@ -1018,9 +1042,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             final RecursiveLock _lock = windowLock;
             _lock.lock();
             try {
-                if ( ( disregardFS || !isFullscreen() ) && ( getWidth() != width || getHeight() != height ) ) {
+                if ( force || ( !isFullscreen() && ( getWidth() != width || getHeight() != height ) ) ) {
                     if(DEBUG_IMPLEMENTATION) {
-                        System.err.println("Window setSize: START "+getWidth()+"x"+getHeight()+" -> "+width+"x"+height+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible "+visible);
+                        System.err.println("Window setSize: START force "+force+", "+getWidth()+"x"+getHeight()+" -> "+width+"x"+height+", fs "+fullscreen+", windowHandle "+toHexString(windowHandle)+", visible "+visible);
                     }
                     int visibleAction; // 0 nop, 1 invisible, 2 visible (create)
                     if ( visible && isNativeValid() && ( 0 >= width || 0 >= height ) ) {
@@ -1053,19 +1077,24 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
     }
 
-    private void setFullscreenSize(int width, int height) {
-        runOnEDTIfAvail(true, new SetSizeAction(width, height, true));
+    private void setSize(final int width, final int height, final boolean force) {
+        runOnEDTIfAvail(true, new SetSizeAction(width, height, force));
     }
     @Override
-    public final void setSize(int width, int height) {
+    public final void setSize(final int width, final int height) {
         runOnEDTIfAvail(true, new SetSizeAction(width, height, false));
     }
     @Override
-    public final void setTopLevelSize(int width, int height) {
+    public final void setSurfaceSize(final int pixelWidth, final int pixelHeight) {
+        // FIXME HiDPI: Shortcut, may need to adjust if we change scaling methodology
+        setSize(pixelWidth / getPixelScaleX(), pixelHeight / getPixelScaleY());
+    }
+    @Override
+    public final void setTopLevelSize(final int width, final int height) {
         setSize(width - getInsets().getTotalWidth(), height - getInsets().getTotalHeight());
     }
 
-    private class DestroyAction implements Runnable {
+    private final Runnable destroyAction = new Runnable() {
         @Override
         public final void run() {
             boolean animatorPaused = false;
@@ -1075,6 +1104,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             if(null!=lifecycleHook) {
                 lifecycleHook.destroyActionPreLock();
             }
+            RuntimeException lifecycleCaughtInLock = null;
             final RecursiveLock _lock = windowLock;
             _lock.lock();
             try {
@@ -1090,9 +1120,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                   if(childWindows.size()>0) {
                     // avoid ConcurrentModificationException: parent -> child -> parent.removeChild(this)
                     @SuppressWarnings("unchecked")
-                    ArrayList<NativeWindow> clonedChildWindows = (ArrayList<NativeWindow>) childWindows.clone();
+                    final ArrayList<NativeWindow> clonedChildWindows = (ArrayList<NativeWindow>) childWindows.clone();
                     while( clonedChildWindows.size() > 0 ) {
-                      NativeWindow nw = clonedChildWindows.remove(0);
+                      final NativeWindow nw = clonedChildWindows.remove(0);
                       if(nw instanceof WindowImpl) {
                           ((WindowImpl)nw).windowDestroyNotify(true);
                       } else {
@@ -1104,7 +1134,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
 
                 if(null!=lifecycleHook) {
                     // send synced destroy notification for proper cleanup, eg GLWindow/OpenGL
-                    lifecycleHook.destroyActionInLock();
+                    try {
+                        lifecycleHook.destroyActionInLock();
+                    } catch (final RuntimeException re) {
+                        lifecycleCaughtInLock = re;
+                    }
                 }
 
                 if( isNativeValid() ) {
@@ -1117,7 +1151,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     setGraphicsConfiguration(null);
                 }
                 removeScreenReference();
-                Display dpy = screen.getDisplay();
+                final Display dpy = screen.getDisplay();
                 if(null != dpy) {
                     dpy.validateEDTStopped();
                 }
@@ -1127,6 +1161,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
 
                 if(DEBUG_IMPLEMENTATION) {
                     System.err.println("Window.destroy() END "+getThreadName()/*+", "+WindowImpl.this*/);
+                    if( null != lifecycleCaughtInLock ) {
+                        System.err.println("Window.destroy() caught: "+lifecycleCaughtInLock.getMessage());
+                        lifecycleCaughtInLock.printStackTrace();
+                    }
+                }
+                if( null != lifecycleCaughtInLock ) {
+                    throw lifecycleCaughtInLock;
                 }
             } finally {
                 // update states before release window lock
@@ -1137,6 +1178,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 fullscreenUseMainMonitor = true;
                 hasFocus = false;
                 parentWindowHandle = 0;
+                hasPixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+                hasPixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
+                nativePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+                nativePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
 
                 _lock.unlock();
             }
@@ -1160,9 +1205,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             windowListeners = null;
             parentWindow = null;
             */
-        }
-    }
-    private final DestroyAction destroyAction = new DestroyAction();
+        } };
 
     @Override
     public void destroy() {
@@ -1170,7 +1213,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         runOnEDTIfAvail(true, destroyAction);
     }
 
-    protected void destroy(boolean preserveResources) {
+    protected void destroy(final boolean preserveResources) {
         if( null != lifecycleHook ) {
             lifecycleHook.preserveGLStateAtDestroy( preserveResources );
         }
@@ -1182,7 +1225,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * @param pWin parent window, may be null
      * @return true if at least one of both window's configurations is offscreen
      */
-    protected static boolean isOffscreenInstance(NativeWindow cWin, NativeWindow pWin) {
+    protected static boolean isOffscreenInstance(final NativeWindow cWin, final NativeWindow pWin) {
         boolean ofs = false;
         final AbstractGraphicsConfiguration cWinCfg = cWin.getGraphicsConfiguration();
         if( null != cWinCfg ) {
@@ -1203,7 +1246,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         final int hints;
         ReparentOperation operation;
 
-        private ReparentAction(NativeWindow newParentWindow, int topLevelX, int topLevelY, int hints) {
+        private ReparentAction(final NativeWindow newParentWindow, final int topLevelX, final int topLevelY, int hints) {
             this.newParentWindow = newParentWindow;
             this.topLevelX = topLevelX;
             this.topLevelY = topLevelY;
@@ -1218,11 +1261,6 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             return operation;
         }
 
-        private void setScreen(ScreenImpl newScreen) { // never null !
-            removeScreenReference();
-            screen = newScreen;
-        }
-
         @Override
         public final void run() {
             if( WindowImpl.this.isFullscreen() ) {
@@ -1427,7 +1465,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                         WindowImpl.this.waitForVisible(false, false);
                         // FIXME: Some composite WM behave slacky .. give 'em chance to change state -> invisible,
                         // even though we do exactly that (KDE+Composite)
-                        try { Thread.sleep(100); } catch (InterruptedException e) { }
+                        try { Thread.sleep(100); } catch (final InterruptedException e) { }
                         display.dispatchMessagesNative(); // status up2date
                     }
 
@@ -1510,7 +1548,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 }
 
                 if(DEBUG_IMPLEMENTATION) {
-                    System.err.println("Window.reparent: END-1 ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight());
+                    System.err.println("Window.reparent: END-1 ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+
+                                       ", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+
+                                       ", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+
+                                       getX()+"/"+getY()+" "+getWidth()+"x"+getHeight());
                 }
             } finally {
                 if(null!=lifecycleHook) {
@@ -1534,12 +1575,15 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 }
             }
             if(DEBUG_IMPLEMENTATION) {
-                System.err.println("Window.reparent: END-X ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight());
+                System.err.println("Window.reparent: END-X ("+getThreadName()+") windowHandle "+toHexString(windowHandle)+
+                                   ", visible: "+visible+", parentWindowHandle "+toHexString(parentWindowHandle)+
+                                   ", parentWindow "+ Display.hashCodeNullSafe(parentWindow)+" "+
+                                   getX()+"/"+getY()+" "+getWidth()+"x"+getHeight());
             }
         }
     }
 
-    private class ReparentActionRecreate implements Runnable {
+    private final Runnable reparentActionRecreate = new Runnable() {
         @Override
         public final void run() {
             final RecursiveLock _lock = windowLock;
@@ -1553,30 +1597,18 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             } finally {
                 _lock.unlock();
             }
-        }
-    }
-    private final ReparentActionRecreate reparentActionRecreate = new ReparentActionRecreate();
-
-    @Override
-    public final ReparentOperation reparentWindow(NativeWindow newParent) {
-        return reparentWindow(newParent, -1, -1, 0);
-    }
-
-    @Override
-    public final ReparentOperation reparentWindow(NativeWindow newParent, int x, int y, boolean forceDestroyCreate) {
-        return reparentWindow(newParent, x, y, forceDestroyCreate ? REPARENT_HINT_FORCE_RECREATION : 0);
-    }
+        } };
 
     @Override
-    public final ReparentOperation reparentWindow(NativeWindow newParent, int x, int y, int hints) {
+    public final ReparentOperation reparentWindow(final NativeWindow newParent, final int x, final int y, final int hints) {
         final ReparentAction reparentAction = new ReparentAction(newParent, x, y, hints);
         runOnEDTIfAvail(true, reparentAction);
         return reparentAction.getOp();
     }
 
     @Override
-    public final CapabilitiesChooser setCapabilitiesChooser(CapabilitiesChooser chooser) {
-        CapabilitiesChooser old = this.capabilitiesChooser;
+    public final CapabilitiesChooser setCapabilitiesChooser(final CapabilitiesChooser chooser) {
+        final CapabilitiesChooser old = this.capabilitiesChooser;
         this.capabilitiesChooser = chooser;
         return old;
     }
@@ -1594,7 +1626,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     private class DecorationAction implements Runnable {
         boolean undecorated;
 
-        private DecorationAction(boolean undecorated) {
+        private DecorationAction(final boolean undecorated) {
             this.undecorated = undecorated;
         }
 
@@ -1614,7 +1646,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                         final int width = getWidth();
                         final int height = getHeight();
 
-                        DisplayImpl display = (DisplayImpl) screen.getDisplay();
+                        final DisplayImpl display = (DisplayImpl) screen.getDisplay();
                         display.dispatchMessagesNative(); // status up2date
                         reconfigureWindowImpl(x, y, width, height, getReconfigureFlags(FLAG_CHANGE_DECORATION, isVisible()));
                         display.dispatchMessagesNative(); // status up2date
@@ -1628,7 +1660,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void setUndecorated(boolean value) {
+    public final void setUndecorated(final boolean value) {
         runOnEDTIfAvail(true, new DecorationAction(value));
     }
 
@@ -1640,7 +1672,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     private class AlwaysOnTopAction implements Runnable {
         boolean alwaysOnTop;
 
-        private AlwaysOnTopAction(boolean alwaysOnTop) {
+        private AlwaysOnTopAction(final boolean alwaysOnTop) {
             this.alwaysOnTop = alwaysOnTop;
         }
 
@@ -1660,7 +1692,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                         final int width = getWidth();
                         final int height = getHeight();
 
-                        DisplayImpl display = (DisplayImpl) screen.getDisplay();
+                        final DisplayImpl display = (DisplayImpl) screen.getDisplay();
                         display.dispatchMessagesNative(); // status up2date
                         reconfigureWindowImpl(x, y, width, height, getReconfigureFlags(FLAG_CHANGE_ALWAYSONTOP, isVisible()));
                         display.dispatchMessagesNative(); // status up2date
@@ -1674,7 +1706,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void setAlwaysOnTop(boolean value) {
+    public final void setAlwaysOnTop(final boolean value) {
         if( isFullscreen() ) {
             nfs_alwaysOnTop = value;
         } else {
@@ -1719,7 +1751,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
     }
     private boolean setPointerVisibleIntern(final boolean pointerVisible) {
-        boolean res = setOffscreenPointerVisible(pointerVisible, pointerIcon);
+        final boolean res = setOffscreenPointerVisible(pointerVisible, pointerIcon);
         return setPointerVisibleImpl(pointerVisible) || res; // accept onscreen or offscreen positive result!
     }
     /**
@@ -1749,7 +1781,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 final OffscreenLayerSurface ols = (OffscreenLayerSurface) parent;
                 try {
                     return ols.hideCursor();
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     e.printStackTrace();
                 }
             }
@@ -1805,7 +1837,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 } else {
                     return ols.setCursor(null, null); // default
                 }
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
             }
         }
@@ -1817,13 +1849,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return pointerConfined;
     }
     @Override
-    public final void confinePointer(boolean confine) {
+    public final void confinePointer(final boolean confine) {
         if(this.pointerConfined != confine) {
             boolean setVal = 0 == getWindowHandle();
             if(!setVal) {
                 if(confine) {
                     requestFocus();
-                    warpPointer(getWidth()/2, getHeight()/2);
+                    warpPointer(getSurfaceWidth()/2, getSurfaceHeight()/2);
                 }
                 setVal = confinePointerImpl(confine);
                 if(confine) {
@@ -1831,7 +1863,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     // this allows user listener to sync previous position value to the new centered position
                     try {
                         Thread.sleep(3 * screen.getDisplay().getEDTUtil().getPollPeriod());
-                    } catch (InterruptedException e) { }
+                    } catch (final InterruptedException e) { }
                 }
             }
             if(setVal) {
@@ -1841,7 +1873,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void warpPointer(int x, int y) {
+    public final void warpPointer(final int x, final int y) {
         if(0 != getWindowHandle()) {
             warpPointerImpl(x, y);
         }
@@ -1857,29 +1889,107 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
+    public final int getX() {
+        return x;
+    }
+
+    @Override
+    public final int getY() {
+        return y;
+    }
+
+    @Override
     public final int getWidth() {
-        return width;
+        return winWidth;
     }
 
     @Override
     public final int getHeight() {
-        return height;
+        return winHeight;
     }
 
     @Override
-    public final int getX() {
-        return x;
+    public final Rectangle getBounds() {
+        return new Rectangle(x, y, winWidth, winHeight);
     }
 
     @Override
-    public final int getY() {
-        return y;
+    public final int getSurfaceWidth() {
+        return pixWidth;
+    }
+
+    @Override
+    public final int getSurfaceHeight() {
+        return pixHeight;
+    }
+
+    @Override
+    public final int[] convertToWindowUnits(final int[] pixelUnitsAndResult) {
+        pixelUnitsAndResult[0] /= getPixelScaleX();
+        pixelUnitsAndResult[1] /= getPixelScaleY();
+        return pixelUnitsAndResult;
+    }
+
+    @Override
+    public final int[] convertToPixelUnits(final int[] windowUnitsAndResult) {
+        windowUnitsAndResult[0] *= getPixelScaleX();
+        windowUnitsAndResult[1] *= getPixelScaleY();
+        return windowUnitsAndResult;
+    }
+
+    protected final Point convertToWindowUnits(final Point pixelUnitsAndResult) {
+        return pixelUnitsAndResult.scaleInv(getPixelScaleX(), getPixelScaleY());
+    }
+
+    protected final Point convertToPixelUnits(final Point windowUnitsAndResult) {
+        return windowUnitsAndResult.scale(getPixelScaleX(), getPixelScaleY());
+    }
+
+    /** HiDPI: We currently base scaling of window units to pixel units on an integer scale factor per component. */
+    protected final int getPixelScaleX() {
+        return hasPixelScale[0];
+    }
+
+    /** HiDPI: We currently base scaling of window units to pixel units on an integer scale factor per component. */
+    protected final int getPixelScaleY() {
+        return hasPixelScale[1];
+    }
+
+    @Override
+    public void setSurfaceScale(final int[] pixelScale) {
+        SurfaceScaleUtils.validateReqPixelScale(reqPixelScale, pixelScale, DEBUG_IMPLEMENTATION ? getClass().getSimpleName() : null);
+    }
+
+    @Override
+    public final int[] getRequestedSurfaceScale(final int[] result) {
+        System.arraycopy(reqPixelScale, 0, result, 0, 2);
+        return result;
+    }
+
+    @Override
+    public final int[] getCurrentSurfaceScale(final int[] result) {
+        System.arraycopy(hasPixelScale, 0, result, 0, 2);
+        return result;
+    }
+
+    @Override
+    public final int[] getNativeSurfaceScale(final int[] result) {
+        System.arraycopy(nativePixelScale, 0, result, 0, 2);
+        return result;
+    }
+
+    @Override
+    public final float[] getPixelsPerMM(final float[] ppmmStore) {
+        getMainMonitor().getPixelsPerMM(ppmmStore);
+        ppmmStore[0] *= (float)hasPixelScale[0] / (float)nativePixelScale[0];
+        ppmmStore[1] *= (float)hasPixelScale[1] / (float)nativePixelScale[1];
+        return ppmmStore;
     }
 
     protected final boolean autoPosition() { return autoPosition; }
 
-    /** Sets the position fields {@link #x} and {@link #y} to the given values and {@link #autoPosition} to false. */
-    protected final void definePosition(int x, int y) {
+    /** Sets the position fields {@link #x} and {@link #y} in window units to the given values and {@link #autoPosition} to false. */
+    protected final void definePosition(final int x, final int y) {
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("definePosition: "+this.x+"/"+this.y+" -> "+x+"/"+y);
             // Thread.dumpStack();
@@ -1888,13 +1998,20 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         this.x = x; this.y = y;
     }
 
-    /** Sets the size fields {@link #width} and {@link #height} to the given values. */
-    protected final void defineSize(int width, int height) {
+    /**
+     * Sets the size fields {@link #winWidth} and {@link #winHeight} in window units to the given values
+     * and {@link #pixWidth} and {@link #pixHeight} in pixel units according to {@link #convertToPixelUnits(int[])}.
+     */
+    protected final void defineSize(final int winWidth, final int winHeight) {
+        final int pixWidth = winWidth * getPixelScaleX();   // FIXME HiDPI: Shortcut, may need to adjust if we change scaling methodology
+        final int pixHeight = winHeight * getPixelScaleY();
         if(DEBUG_IMPLEMENTATION) {
-            System.err.println("defineSize: "+this.width+"x"+this.height+" -> "+width+"x"+height);
+            System.err.println("defineSize: win["+this.winWidth+"x"+this.winHeight+" -> "+winWidth+"x"+winHeight+
+                               "], pixel["+this.pixWidth+"x"+this.pixHeight+" -> "+pixWidth+"x"+pixHeight+"]");
             // Thread.dumpStack();
         }
-        this.width = width; this.height = height;
+        this.winWidth = winWidth; this.winHeight = winHeight;
+        this.pixWidth = pixWidth; this.pixHeight = pixHeight;
     }
 
     @Override
@@ -1932,8 +2049,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return lifecycleHook;
     }
 
-    public final LifecycleHook setLifecycleHook(LifecycleHook hook) {
-        LifecycleHook old = lifecycleHook;
+    public final LifecycleHook setLifecycleHook(final LifecycleHook hook) {
+        final LifecycleHook old = lifecycleHook;
         lifecycleHook = hook;
         return old;
     }
@@ -1947,7 +2064,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void setWindowDestroyNotifyAction(Runnable r) {
+    public final void setWindowDestroyNotifyAction(final Runnable r) {
         windowDestroyNotifyAction = r;
     }
 
@@ -1957,20 +2074,20 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
 
     @Override
     public final String toString() {
-        StringBuilder sb = new StringBuilder();
+        final StringBuilder sb = new StringBuilder();
 
         sb.append(getClass().getName()+"[Config "+config+
-                    "\n, "+screen+
-                    "\n, ParentWindow "+parentWindow+
-                    "\n, ParentWindowHandle "+toHexString(parentWindowHandle)+" ("+(0!=getParentWindowHandle())+")"+
-                    "\n, WindowHandle "+toHexString(getWindowHandle())+
-                    "\n, SurfaceHandle "+toHexString(getSurfaceHandle())+ " (lockedExt window "+windowLock.isLockedByOtherThread()+", surface "+isSurfaceLockedByOtherThread()+")"+
-                    "\n, Pos "+getX()+"/"+getY()+" (auto "+autoPosition()+"), size "+getWidth()+"x"+getHeight()+
-                    "\n, Visible "+isVisible()+", focus "+hasFocus()+
-                    "\n, Undecorated "+undecorated+" ("+isUndecorated()+")"+
-                    "\n, AlwaysOnTop "+alwaysOnTop+", Fullscreen "+fullscreen+
-                    "\n, WrappedSurface "+getWrappedSurface()+
-                    "\n, ChildWindows "+childWindows.size());
+                    ",\n "+screen+
+                    ",\n ParentWindow "+parentWindow+
+                    ",\n ParentWindowHandle "+toHexString(parentWindowHandle)+" ("+(0!=getParentWindowHandle())+")"+
+                    ",\n WindowHandle "+toHexString(getWindowHandle())+
+                    ",\n SurfaceHandle "+toHexString(getSurfaceHandle())+ " (lockedExt window "+windowLock.isLockedByOtherThread()+", surface "+isSurfaceLockedByOtherThread()+")"+
+                    ",\n window["+getX()+"/"+getY()+" (auto "+autoPosition()+") "+getWidth()+"x"+getHeight()+"], pixel["+getSurfaceWidth()+"x"+getSurfaceHeight()+
+                    "],\n Visible "+isVisible()+", focus "+hasFocus()+
+                    ",\n Undecorated "+undecorated+" ("+isUndecorated()+")"+
+                    ",\n AlwaysOnTop "+alwaysOnTop+", Fullscreen "+fullscreen+
+                    ",\n WrappedSurface "+getWrappedSurface()+
+                    ",\n ChildWindows "+childWindows.size());
 
         sb.append(", SurfaceUpdatedListeners num "+surfaceUpdatedHelper.size()+" [");
         for (int i = 0; i < surfaceUpdatedHelper.size(); i++ ) {
@@ -1996,12 +2113,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return sb.toString();
     }
 
-    protected final void setWindowHandle(long handle) {
+    protected final void setWindowHandle(final long handle) {
         windowHandle = handle;
     }
 
     @Override
-    public final void runOnEDTIfAvail(boolean wait, final Runnable task) {
+    public final void runOnEDTIfAvail(final boolean wait, final Runnable task) {
         if( windowLock.isOwner( Thread.currentThread() ) ) {
             task.run();
         } else {
@@ -2039,11 +2156,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void requestFocus(boolean wait) {
+    public final void requestFocus(final boolean wait) {
         requestFocus(wait /* wait */, false /* skipFocusAction */, brokenFocusChange /* force */);
     }
 
-    private void requestFocus(boolean wait, boolean skipFocusAction, boolean force) {
+    private void requestFocus(final boolean wait, final boolean skipFocusAction, final boolean force) {
         if( isNativeValid() &&
             ( force || !hasFocus() ) &&
             ( skipFocusAction || !focusAction() ) ) {
@@ -2052,7 +2169,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     /** Internally forcing request focus on current thread */
-    private void requestFocusInt(boolean skipFocusAction) {
+    private void requestFocusInt(final boolean skipFocusAction) {
         if( skipFocusAction || !focusAction() ) {
             if(DEBUG_IMPLEMENTATION) {
                 System.err.println("Window.RequestFocusInt: forcing - ("+getThreadName()+"): skipFocusAction "+skipFocusAction+", focus "+hasFocus+" -> true - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
@@ -2062,7 +2179,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void setFocusAction(FocusRunnable focusAction) {
+    public final void setFocusAction(final FocusRunnable focusAction) {
         this.focusAction = focusAction;
     }
 
@@ -2082,19 +2199,19 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return res;
     }
 
-    protected final void setBrokenFocusChange(boolean v) {
+    protected final void setBrokenFocusChange(final boolean v) {
         brokenFocusChange = v;
     }
 
     @Override
-    public final void setKeyboardFocusHandler(KeyListener l) {
+    public final void setKeyboardFocusHandler(final KeyListener l) {
         keyboardFocusHandler = l;
     }
 
     private class SetPositionAction implements Runnable {
         int x, y;
 
-        private SetPositionAction(int x, int y) {
+        private SetPositionAction(final int x, final int y) {
             this.x = x;
             this.y = y;
         }
@@ -2127,20 +2244,20 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public void setPosition(int x, int y) {
+    public void setPosition(final int x, final int y) {
         autoPosition = false;
         runOnEDTIfAvail(true, new SetPositionAction(x, y));
     }
 
     @Override
-    public final void setTopLevelPosition(int x, int y) {
+    public final void setTopLevelPosition(final int x, final int y) {
         setPosition(x + getInsets().getLeftWidth(), y + getInsets().getTopHeight());
     }
 
     private class FullScreenAction implements Runnable {
         boolean _fullscreen;
 
-        private boolean init(boolean fullscreen) {
+        private boolean init(final boolean fullscreen) {
             if(isNativeValid()) {
                 this._fullscreen = fullscreen;
                 return isFullscreen() != fullscreen;
@@ -2164,8 +2281,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
 
                 int x,y,w,h;
 
-                final RectangleImmutable sviewport = screen.getViewport();
-                final RectangleImmutable viewport;
+                final RectangleImmutable sviewport = screen.getViewportInWindowUnits(); // window units
+                final RectangleImmutable viewport; // window units
                 final int fs_span_flag;
                 final boolean alwaysOnTopChange;
                 if(_fullscreen) {
@@ -2177,7 +2294,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                             fullscreenMonitors = getScreen().getMonitorDevices();
                         }
                     }
-                    viewport = MonitorDevice.unionOfViewports(new Rectangle(), fullscreenMonitors);
+                    {
+                        final Rectangle viewportInWindowUnits = new Rectangle();
+                        MonitorDevice.unionOfViewports(null, viewportInWindowUnits, fullscreenMonitors);
+                        viewport = viewportInWindowUnits;
+                    }
                     if( isReconfigureFlagSupported(FLAG_IS_FULLSCREEN_SPAN) &&
                         ( fullscreenMonitors.size() > 1 || sviewport.compareTo(viewport) > 0 ) ) {
                         fs_span_flag = FLAG_IS_FULLSCREEN_SPAN;
@@ -2229,7 +2350,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
 
                 if(DEBUG_IMPLEMENTATION) {
                     System.err.println("Window fs: "+_fullscreen+" "+x+"/"+y+" "+w+"x"+h+", "+isUndecorated()+
-                                       ", virtl-screenSize: "+sviewport+", monitorsViewport "+viewport+
+                                       ", virtl-screenSize: "+sviewport+" [wu], monitorsViewport "+viewport+" [wu]"+
                                        ", spanning "+(0!=fs_span_flag)+
                                        ", alwaysOnTop "+alwaysOnTop+(alwaysOnTopChange?"*":"")+
                                        ", wasVisible "+wasVisible+", tempInvisible "+tempInvisible+
@@ -2241,7 +2362,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 if( tempInvisible ) {
                     setVisibleImpl(false, oldX, oldY, oldWidth, oldHeight);
                     WindowImpl.this.waitForVisible(false, false);
-                    try { Thread.sleep(100); } catch (InterruptedException e) { }
+                    try { Thread.sleep(100); } catch (final InterruptedException e) { }
                     display.dispatchMessagesNative(); // status up2date
                 }
 
@@ -2279,7 +2400,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 if(wasVisible) {
                     if( NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(true) ) {
                         // Give sluggy WM's (e.g. Unity) a chance to properly restore window ..
-                        try { Thread.sleep(100); } catch (InterruptedException e) { }
+                        try { Thread.sleep(100); } catch (final InterruptedException e) { }
                         display.dispatchMessagesNative(); // status up2date
                     }
                     setVisibleImpl(true, x, y, w, h);
@@ -2309,16 +2430,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     private final FullScreenAction fullScreenAction = new FullScreenAction();
 
     @Override
-    public boolean setFullscreen(boolean fullscreen) {
+    public boolean setFullscreen(final boolean fullscreen) {
         return setFullscreenImpl(fullscreen, true, null);
     }
 
     @Override
-    public boolean setFullscreen(List<MonitorDevice> monitors) {
+    public boolean setFullscreen(final List<MonitorDevice> monitors) {
         return setFullscreenImpl(true, false, monitors);
     }
 
-    private boolean setFullscreenImpl(boolean fullscreen, boolean useMainMonitor, List<MonitorDevice> monitors) {
+    private boolean setFullscreenImpl(final boolean fullscreen, final boolean useMainMonitor, final List<MonitorDevice> monitors) {
         synchronized(fullScreenAction) {
             fullscreenMonitors = monitors;
             fullscreenUseMainMonitor = useMainMonitor;
@@ -2345,24 +2466,32 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
     }
 
+    /** Notify WindowDriver about the finished monitor mode change. */
+    protected void monitorModeChanged(final MonitorEvent me, final boolean success) {
+    }
+
     private class MonitorModeListenerImpl implements MonitorModeListener {
         boolean animatorPaused = false;
+        boolean hidden = false;
         boolean hadFocus = false;
         boolean fullscreenPaused = false;
         List<MonitorDevice> _fullscreenMonitors = null;
         boolean _fullscreenUseMainMonitor = true;
 
         @Override
-        public void monitorModeChangeNotify(MonitorEvent me) {
+        public void monitorModeChangeNotify(final MonitorEvent me) {
             hadFocus = hasFocus();
+            final boolean isOSX = NativeWindowFactory.TYPE_MACOSX == NativeWindowFactory.getNativeWindowType(true);
+            final boolean quirkFSPause = fullscreen && isReconfigureFlagSupported(FLAG_IS_FULLSCREEN_SPAN);
+            final boolean quirkHide = !quirkFSPause && !fullscreen && isVisible() && isOSX;
             if(DEBUG_IMPLEMENTATION) {
-                System.err.println("Window.monitorModeChangeNotify: hadFocus "+hadFocus+", "+me+" @ "+Thread.currentThread().getName());
+                System.err.println("Window.monitorModeChangeNotify: hadFocus "+hadFocus+", qFSPause "+quirkFSPause+", qHide "+quirkHide+", "+me+" @ "+Thread.currentThread().getName());
             }
 
             if(null!=lifecycleHook) {
                 animatorPaused = lifecycleHook.pauseRenderingAction();
             }
-            if( fullscreen && isReconfigureFlagSupported(FLAG_IS_FULLSCREEN_SPAN) ) {
+            if( quirkFSPause ) {
                 if(DEBUG_IMPLEMENTATION) {
                     System.err.println("Window.monitorModeChangeNotify: FS Pause");
                 }
@@ -2371,64 +2500,81 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 _fullscreenUseMainMonitor = fullscreenUseMainMonitor;
                 setFullscreenImpl(false, true, null);
             }
+            if( quirkHide ) {
+                // hiding & showing the window around mode-change solves issues w/ OSX,
+                // where the content would be black until a resize.
+                hidden = true;
+                WindowImpl.this.setVisible(false);
+            }
         }
 
         @Override
-        public void monitorModeChanged(MonitorEvent me, boolean success) {
+        public void monitorModeChanged(final MonitorEvent me, final boolean success) {
+            if(!animatorPaused && success && null!=lifecycleHook) {
+                // Didn't pass above notify method. probably detected screen change after it happened.
+                animatorPaused = lifecycleHook.pauseRenderingAction();
+            }
             if(DEBUG_IMPLEMENTATION) {
-                System.err.println("Window.monitorModeChanged: hadFocus "+hadFocus+", "+me+", success: "+success+" @ "+Thread.currentThread().getName());
-            }
-
-            if(success) {
-                if(!animatorPaused && null!=lifecycleHook) {
-                    // Didn't pass above notify method. probably detected screen change after it happened.
-                    animatorPaused = lifecycleHook.pauseRenderingAction();
-                }
-                if( !fullscreen && !fullscreenPaused ) {
-                    // Simply move/resize window to fit in virtual screen if required
-                    final RectangleImmutable viewport = screen.getViewport();
-                    if( viewport.getWidth() > 0 && viewport.getHeight() > 0 ) { // failsafe
-                        final RectangleImmutable rect = new Rectangle(getX(), getY(), getWidth(), getHeight());
-                        final RectangleImmutable isect = viewport.intersection(rect);
-                        if ( getHeight() > isect.getHeight()  ||
-                             getWidth() > isect.getWidth() ) {
-                            if(DEBUG_IMPLEMENTATION) {
-                                System.err.println("Window.monitorModeChanged: fit window "+rect+" into screen viewport "+viewport+
-                                                   ", due to minimal intersection "+isect);
-                            }
-                            definePosition(viewport.getX(), viewport.getY()); // set pos for setVisible(..) or createNative(..) - reduce EDT roundtrip
-                            setSize(viewport.getWidth(), viewport.getHeight());
-                        }
-                    }
-                } else if( fullscreenPaused ){
-                    if(DEBUG_IMPLEMENTATION) {
-                        System.err.println("Window.monitorModeChanged: FS Restore");
-                    }
-                    setFullscreenImpl(true, _fullscreenUseMainMonitor, _fullscreenMonitors);
-                    fullscreenPaused = false;
-                    _fullscreenMonitors = null;
-                    _fullscreenUseMainMonitor = true;
-                } else {
-                    // If changed monitor is part of this fullscreen mode, reset size! (Bug 771)
-                    final MonitorDevice md = me.getMonitor();
-                    if( fullscreenMonitors.contains(md) ) {
-                        final RectangleImmutable viewport = MonitorDevice.unionOfViewports(new Rectangle(), fullscreenMonitors);
+                System.err.println("Window.monitorModeChanged.0: success: "+success+", hadFocus "+hadFocus+", animPaused "+animatorPaused+
+                                   ", hidden "+hidden+", FS "+fullscreen+", FS-paused "+fullscreenPaused+
+                                   " @ "+Thread.currentThread().getName());
+                System.err.println("Window.monitorModeChanged.0: "+getScreen());
+                System.err.println("Window.monitorModeChanged.0: "+me);
+            }
+            WindowImpl.this.monitorModeChanged(me, success);
+
+            if( success && !fullscreen && !fullscreenPaused ) {
+                // Simply move/resize window to fit in virtual screen if required
+                final RectangleImmutable viewport = screen.getViewportInWindowUnits();
+                if( viewport.getWidth() > 0 && viewport.getHeight() > 0 ) { // failsafe
+                    final RectangleImmutable rect = new Rectangle(getX(), getY(), getWidth(), getHeight());
+                    final RectangleImmutable isect = viewport.intersection(rect);
+                    if ( getHeight() > isect.getHeight()  ||
+                         getWidth() > isect.getWidth() ) {
                         if(DEBUG_IMPLEMENTATION) {
-                            final RectangleImmutable rect = new Rectangle(getX(), getY(), getWidth(), getHeight());
-                            System.err.println("Window.monitorModeChanged: FS Monitor Match: Fit window "+rect+" into new viewport union "+viewport+", provoked by "+md);
+                            System.err.println("Window.monitorModeChanged.1: Non-FS - Fit window "+rect+" into screen viewport "+viewport+
+                                               ", due to minimal intersection "+isect);
                         }
                         definePosition(viewport.getX(), viewport.getY()); // set pos for setVisible(..) or createNative(..) - reduce EDT roundtrip
-                        setFullscreenSize(viewport.getWidth(), viewport.getHeight());
+                        setSize(viewport.getWidth(), viewport.getHeight(), true /* force */);
                     }
                 }
+            } else if( fullscreenPaused ) {
+                if(DEBUG_IMPLEMENTATION) {
+                    System.err.println("Window.monitorModeChanged.2: FS Restore");
+                }
+                setFullscreenImpl(true, _fullscreenUseMainMonitor, _fullscreenMonitors);
+                fullscreenPaused = false;
+                _fullscreenMonitors = null;
+                _fullscreenUseMainMonitor = true;
+            } else if( success && fullscreen && null != fullscreenMonitors ) {
+                // If changed monitor is part of this fullscreen mode, reset size! (Bug 771)
+                final MonitorDevice md = me.getMonitor();
+                if( fullscreenMonitors.contains(md) ) {
+                    final Rectangle viewportInWindowUnits = new Rectangle();
+                    MonitorDevice.unionOfViewports(null, viewportInWindowUnits, fullscreenMonitors);
+                    if(DEBUG_IMPLEMENTATION) {
+                        final RectangleImmutable winBounds = WindowImpl.this.getBounds();
+                        System.err.println("Window.monitorModeChanged.3: FS Monitor Match: Fit window "+winBounds+" into new viewport union "+viewportInWindowUnits+" [window], provoked by "+md);
+                    }
+                    definePosition(viewportInWindowUnits.getX(), viewportInWindowUnits.getY()); // set pos for setVisible(..) or createNative(..) - reduce EDT roundtrip
+                    setSize(viewportInWindowUnits.getWidth(), viewportInWindowUnits.getHeight(), true /* force */);
+                }
+            }
+            if( hidden ) {
+                WindowImpl.this.setVisible(true);
+                hidden = false;
             }
+            sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener
             if(animatorPaused) {
                 lifecycleHook.resumeRenderingAction();
             }
-            sendWindowEvent(WindowEvent.EVENT_WINDOW_RESIZED); // trigger a resize/relayout and repaint to listener
             if( hadFocus ) {
                 requestFocus(true);
             }
+            if(DEBUG_IMPLEMENTATION) {
+                System.err.println("Window.monitorModeChanged.X: @ "+Thread.currentThread().getName()+", this: "+WindowImpl.this);
+            }
         }
     }
     private final MonitorModeListenerImpl monitorModeListenerImpl = new MonitorModeListenerImpl();
@@ -2439,14 +2585,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     //
 
     @Override
-    public final boolean removeChild(NativeWindow win) {
+    public final boolean removeChild(final NativeWindow win) {
         synchronized(childWindowsLock) {
             return childWindows.remove(win);
         }
     }
 
     @Override
-    public final boolean addChild(NativeWindow win) {
+    public final boolean addChild(final NativeWindow win) {
         if (win == null) {
             return false;
         }
@@ -2458,7 +2604,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     //----------------------------------------------------------------------
     // Generic Event Support
     //
-    private void doEvent(boolean enqueue, boolean wait, com.jogamp.newt.event.NEWTEvent event) {
+    private void doEvent(final boolean enqueue, boolean wait, final com.jogamp.newt.event.NEWTEvent event) {
         boolean done = false;
 
         if(!enqueue) {
@@ -2472,14 +2618,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void enqueueEvent(boolean wait, com.jogamp.newt.event.NEWTEvent event) {
+    public final void enqueueEvent(final boolean wait, final com.jogamp.newt.event.NEWTEvent event) {
         if(isNativeValid()) {
             ((DisplayImpl)screen.getDisplay()).enqueueEvent(wait, event);
         }
     }
 
     @Override
-    public final boolean consumeEvent(NEWTEvent e) {
+    public final boolean consumeEvent(final NEWTEvent e) {
         switch(e.getEventType()) {
             // special repaint treatment
             case WindowEvent.EVENT_WINDOW_REPAINT:
@@ -2535,7 +2681,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     // Native MouseEvents pre-processed to be enqueued or consumed directly
     //
 
-    public void sendMouseEvent(final short eventType, final int modifiers,
+    public final void sendMouseEvent(final short eventType, final int modifiers,
                                final int x, final int y, final short button, final float rotation) {
         doMouseEvent(false, false, eventType, modifiers, x, y, button, MouseEvent.getRotationXYZ(rotation, modifiers), 1f);
     }
@@ -2570,7 +2716,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
             throw new NativeWindowException("Invalid mouse button number" + button);
         }
         doPointerEvent(enqueue, wait, constMousePointerTypes, eventType, modifiers,
-                       0 /*actionIdx*/, new short[] { (short)(button-1) },
+                       0 /*actionIdx*/, new short[] { (short)0 }, button,
                        new int[]{x}, new int[]{y}, new float[]{0f} /*pressure*/,
                        1f /*maxPressure*/, rotationXYZ, rotationScale);
     }
@@ -2587,7 +2733,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * Otherwise a simple <code>int</code> to <code>short</code> type cast is performed.
      * </p>
      * <p>
-     * See {@link #doPointerEvent(boolean, boolean, PointerType[], short, int, int, short[], int[], int[], float[], float, float[], float)}
+     * See {@link #doPointerEvent(boolean, boolean, PointerType[], short, int, int, short[], short, int[], int[], float[], float, float[], float)}
      * for details!
      * </p>
      *
@@ -2611,7 +2757,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                                      final PointerType[] pTypes, final short eventType, final int modifiers,
                                      final int actionIdx, final boolean normalPNames, final int[] pNames,
                                      final int[] pX, final int[] pY, final float[] pPressure,
-                                     float maxPressure, final float[] rotationXYZ, final float rotationScale) {
+                                     final float maxPressure, final float[] rotationXYZ, final float rotationScale) {
         final int pCount = pNames.length;
         final short[] pIDs = new short[pCount];
         for(int i=0; i<pCount; i++) {
@@ -2638,7 +2784,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 pIDs[i] = (short)pNames[i];
             }
         }
-        doPointerEvent(enqueue, wait, pTypes, eventType, modifiers, actionIdx, pIDs,
+        final short button = 0 < pCount ? (short) ( pIDs[0] + 1 ) : (short)0;
+        doPointerEvent(enqueue, wait, pTypes, eventType, modifiers, actionIdx, pIDs, button,
                        pX, pY, pPressure, maxPressure, rotationXYZ, rotationScale);
     }
 
@@ -2675,7 +2822,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * @param modifiers
      * @param pActionIdx index of multiple-pointer arrays representing the pointer which triggered the event
      * @param pID Pointer ID for each pointer (multiple pointer). We assume consecutive pointerIDs starting w/ 0.
-     *            A pointer-ID of -1 may also denote no pointer/button activity, i.e. {@link PointerType#Mouse} move.
+     * @param button Corresponding mouse-button, a button of 0 denotes no activity, i.e. {@link PointerType#Mouse} move.
      * @param pX X-axis for each pointer (multiple pointer)
      * @param pY Y-axis for each pointer (multiple pointer)
      * @param pPressure Pressure for each pointer (multiple pointer)
@@ -2683,8 +2830,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      */
     public final void doPointerEvent(final boolean enqueue, final boolean wait,
                                      final PointerType[] pTypes, final short eventType, int modifiers,
-                                     final int pActionIdx, final short[] pID, final int[] pX, final int[] pY, final float[] pPressure,
-                                     final float maxPressure, final float[] rotationXYZ, final float rotationScale) {
+                                     final int pActionIdx, final short[] pID, final short buttonIn, final int[] pX, final int[] pY,
+                                     final float[] pPressure, final float maxPressure, final float[] rotationXYZ, final float rotationScale) {
         final long when = System.currentTimeMillis();
         final int pCount = pTypes.length;
 
@@ -2717,12 +2864,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 pPressure[0] = aPress;
             }
         }
-        final short id = pID[0];
         final short button;
         {
-            final int b = id + 1;
-            if( 0 <= b && b <= com.jogamp.newt.event.MouseEvent.BUTTON_COUNT ) { // we allow id==-1 -> button==0 for no button, i.e. mouse move
-                button = (short)b;
+            // validate button
+            if( 0 <= buttonIn && buttonIn <= com.jogamp.newt.event.MouseEvent.BUTTON_COUNT ) { // we allow button==0 for no button, i.e. mouse-ptr move
+                button = buttonIn;
             } else {
                 button = com.jogamp.newt.event.MouseEvent.BUTTON1;
             }
@@ -2735,8 +2881,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         //
         int x = pX[0];
         int y = pY[0];
-        final boolean insideWindow = x >= 0 && y >= 0 && x < getWidth() && y < getHeight();
-        final Point movePositionP0 = pState1.getMovePosition(id);
+        final boolean insideSurface = x >= 0 && y >= 0 && x < getSurfaceWidth() && y < getSurfaceHeight();
+        final Point movePositionP0 = pState1.getMovePosition(pID[0]);
         switch( eventType ) {
             case MouseEvent.EVENT_MOUSE_EXITED:
                 if( pState1.dragging ) {
@@ -2759,10 +2905,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
 
             case MouseEvent.EVENT_MOUSE_ENTERED:
                 if( eventType == MouseEvent.EVENT_MOUSE_ENTERED ) {
-                    pState1.insideWindow = true;
+                    pState1.insideSurface = true;
                     pState1.exitSent = false;
                 } else {
-                    pState1.insideWindow = false;
+                    pState1.insideSurface = false;
                     pState1.exitSent = true;
                 }
                 pState1.clearButton();
@@ -2774,8 +2920,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                     return;
                 }
                 // clip coordinates to window dimension
-                x = Math.min(Math.max(x,  0), getWidth()-1);
-                y = Math.min(Math.max(y,  0), getHeight()-1);
+                x = Math.min(Math.max(x,  0), getSurfaceWidth()-1);
+                y = Math.min(Math.max(y,  0), getSurfaceHeight()-1);
                 break;
 
             case MouseEvent.EVENT_MOUSE_MOVED:
@@ -2794,10 +2940,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 // Fall through intended !
 
             default:
-                if( pState1.insideWindow != insideWindow ) {
+                if( pState1.insideSurface != insideSurface ) {
                     // ENTER/EXIT!
-                    pState1.insideWindow = insideWindow;
-                    if( insideWindow ) {
+                    pState1.insideSurface = insideSurface;
+                    if( insideSurface ) {
                         pState1.exitSent = false;
                     }
                     pState1.clearButton();
@@ -2808,10 +2954,10 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         // Drop exterior events if not dragging pointer and not EXIT event
         // Safeguard for non compliant implementations!
         //
-        if( !pState1.dragging && !insideWindow && MouseEvent.EVENT_MOUSE_EXITED != eventType ) {
+        if( !pState1.dragging && !insideSurface && MouseEvent.EVENT_MOUSE_EXITED != eventType ) {
             if(DEBUG_MOUSE_EVENT) {
                 System.err.println("doPointerEvent: drop: "+MouseEvent.getEventTypeString(eventType)+
-                                   ", mod "+modifiers+", pos "+x+"/"+y+", button "+button+", lastMousePosition: "+movePositionP0+", insideWindow "+insideWindow+", "+pState1);
+                                   ", mod "+modifiers+", pos "+x+"/"+y+", button "+button+", lastMousePosition: "+movePositionP0+", insideWindow "+insideSurface+", "+pState1);
             }
             return; // .. invalid ..
         }
@@ -2911,14 +3057,14 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         doEvent(enqueue, wait, e); // actual mouse event
     }
 
-    private static int step(int lower, int edge, int value) {
+    private static int step(final int lower, final int edge, final int value) {
         return value < edge ? lower : value;
     }
 
     /**
      * Consume the {@link MouseEvent}.
      * <p>
-     * Pointer/Mouse Processing Pass 2 (Pass 1 is performed in {@link #doPointerEvent(boolean, boolean, PointerType[], short, int, int, short[], int[], int[], float[], float, float[], float)}).
+     * Pointer/Mouse Processing Pass 2 (Pass 1 is performed in {@link #doPointerEvent(boolean, boolean, PointerType[], short, int, int, short[], short, int[], int[], float[], float, float[], float)}).
      * </p>
      * <p>
      * Invoked before dispatching the dequeued event.
@@ -2934,11 +3080,9 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * </p>
      */
     protected void consumePointerEvent(MouseEvent pe) {
-        int x = pe.getX();
-        int y = pe.getY();
-
         if(DEBUG_MOUSE_EVENT) {
-            System.err.println("consumePointerEvent.in: "+pe+", "+pState0+", pos "+x+"/"+y+" clientSize["+getWidth()+"x"+getHeight()+"]");
+            System.err.println("consumePointerEvent.in: "+pe+", "+pState0+", pos "+pe.getX()+"/"+pe.getY()+", win["+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+
+                               "], pixel["+getSurfaceWidth()+"x"+getSurfaceHeight()+"]");
         }
 
         //
@@ -2948,7 +3092,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         //
         final long when = pe.getWhen();
         final int eventType = pe.getEventType();
-        final boolean insideWindow;
+        final boolean insideSurface;
         boolean eExitAllowed = false;
         MouseEvent eEntered = null, eExited = null;
         switch( eventType ) {
@@ -2962,17 +3106,17 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 // Fall through intended !
             case MouseEvent.EVENT_MOUSE_ENTERED:
                 // clip coordinates to window dimension
-                x = Math.min(Math.max(x,  0), getWidth()-1);
-                y = Math.min(Math.max(y,  0), getHeight()-1);
+                // final int pe_x = Math.min(Math.max(pe.getX(),  0), getSurfaceWidth()-1);
+                // final int pe_y = Math.min(Math.max(pe.getY(),  0), getSurfaceHeight()-1);
                 pState0.clearButton();
                 if( eventType == MouseEvent.EVENT_MOUSE_ENTERED ) {
-                    insideWindow = true;
-                    pState0.insideWindow = true;
+                    insideSurface = true;
+                    pState0.insideSurface = true;
                     pState0.exitSent = false;
                     pState0.dragging = false;
                 } else {
-                    insideWindow = false;
-                    pState0.insideWindow = false;
+                    insideSurface = false;
+                    pState0.insideSurface = false;
                     pState0.exitSent = true;
                 }
                 break;
@@ -2986,35 +3130,37 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 // Fall through intended !
 
             default:
-                insideWindow = x >= 0 && y >= 0 && x < getWidth() && y < getHeight();
+                final int pe_x = pe.getX();
+                final int pe_y = pe.getY();
+                insideSurface = pe_x >= 0 && pe_y >= 0 && pe_x < getSurfaceWidth() && pe_y < getSurfaceHeight();
                 if( pe.getPointerType(0) == PointerType.Mouse ) {
-                    if( !pState0.insideWindow && insideWindow ) {
+                    if( !pState0.insideSurface && insideSurface ) {
                         // ENTER .. use clipped coordinates
                         eEntered = new MouseEvent(MouseEvent.EVENT_MOUSE_ENTERED, pe.getSource(), pe.getWhen(), pe.getModifiers(),
-                                                 Math.min(Math.max(x,  0), getWidth()-1),
-                                                 Math.min(Math.max(y,  0), getHeight()-1),
-                                                 (short)0, (short)0, pe.getRotation(), pe.getRotationScale());
+                                                  Math.min(Math.max(pe_x,  0), getSurfaceWidth()-1),
+                                                  Math.min(Math.max(pe_y,  0), getSurfaceHeight()-1),
+                                                  (short)0, (short)0, pe.getRotation(), pe.getRotationScale());
                         pState0.exitSent = false;
-                    } else if( !insideWindow && eExitAllowed ) {
+                    } else if( !insideSurface && eExitAllowed ) {
                         // EXIT .. use clipped coordinates
                         eExited = new MouseEvent(MouseEvent.EVENT_MOUSE_EXITED, pe.getSource(), pe.getWhen(), pe.getModifiers(),
-                                                 Math.min(Math.max(x,  0), getWidth()-1),
-                                                 Math.min(Math.max(y,  0), getHeight()-1),
+                                                 Math.min(Math.max(pe_x,  0), getSurfaceWidth()-1),
+                                                 Math.min(Math.max(pe_y,  0), getSurfaceHeight()-1),
                                                  (short)0, (short)0, pe.getRotation(), pe.getRotationScale());
                         pState0.exitSent = true;
                     }
                 }
-                if( pState0.insideWindow != insideWindow || null != eEntered || null != eExited) {
+                if( pState0.insideSurface != insideSurface || null != eEntered || null != eExited) {
                     pState0.clearButton();
                 }
-                pState0.insideWindow = insideWindow;
+                pState0.insideSurface = insideSurface;
         }
         if( null != eEntered ) {
             if(DEBUG_MOUSE_EVENT) {
                 System.err.println("consumePointerEvent.send.0: "+eEntered+", "+pState0);
             }
             dispatchMouseEvent(eEntered);
-        } else if( DEBUG_MOUSE_EVENT && !insideWindow ) {
+        } else if( DEBUG_MOUSE_EVENT && !insideSurface ) {
             System.err.println("INFO consumePointerEvent.exterior: "+pState0+", "+pe);
         }
 
@@ -3140,16 +3286,17 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void addMouseListener(MouseListener l) {
+    public final void addMouseListener(final MouseListener l) {
         addMouseListener(-1, l);
     }
 
     @Override
-    public final void addMouseListener(int index, MouseListener l) {
+    public final void addMouseListener(int index, final MouseListener l) {
         if(l == null) {
             return;
         }
         @SuppressWarnings("unchecked")
+        final
         ArrayList<MouseListener> clonedListeners = (ArrayList<MouseListener>) mouseListeners.clone();
         if(0>index) {
             index = clonedListeners.size();
@@ -3159,11 +3306,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void removeMouseListener(MouseListener l) {
+    public final void removeMouseListener(final MouseListener l) {
         if (l == null) {
             return;
         }
         @SuppressWarnings("unchecked")
+        final
         ArrayList<MouseListener> clonedListeners = (ArrayList<MouseListener>) mouseListeners.clone();
         clonedListeners.remove(l);
         mouseListeners = clonedListeners;
@@ -3172,6 +3320,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     @Override
     public final MouseListener getMouseListener(int index) {
         @SuppressWarnings("unchecked")
+        final
         ArrayList<MouseListener> clonedListeners = (ArrayList<MouseListener>) mouseListeners.clone();
         if(0>index) {
             index = clonedListeners.size()-1;
@@ -3185,7 +3334,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void setDefaultGesturesEnabled(boolean enable) {
+    public final void setDefaultGesturesEnabled(final boolean enable) {
         defaultGestureHandlerEnabled = enable;
     }
     @Override
@@ -3194,15 +3343,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void addGestureHandler(GestureHandler gh) {
+    public final void addGestureHandler(final GestureHandler gh) {
         addGestureHandler(-1, gh);
     }
     @Override
-    public final void addGestureHandler(int index, GestureHandler gh) {
+    public final void addGestureHandler(int index, final GestureHandler gh) {
         if(gh == null) {
             return;
         }
         @SuppressWarnings("unchecked")
+        final
         ArrayList<GestureHandler> cloned = (ArrayList<GestureHandler>) pointerGestureHandler.clone();
         if(0>index) {
             index = cloned.size();
@@ -3211,25 +3361,27 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         pointerGestureHandler = cloned;
     }
     @Override
-    public final void removeGestureHandler(GestureHandler gh) {
+    public final void removeGestureHandler(final GestureHandler gh) {
         if (gh == null) {
             return;
         }
         @SuppressWarnings("unchecked")
+        final
         ArrayList<GestureHandler> cloned = (ArrayList<GestureHandler>) pointerGestureHandler.clone();
         cloned.remove(gh);
         pointerGestureHandler = cloned;
     }
     @Override
-    public final void addGestureListener(GestureHandler.GestureListener gl) {
+    public final void addGestureListener(final GestureHandler.GestureListener gl) {
         addGestureListener(-1, gl);
     }
     @Override
-    public final void addGestureListener(int index, GestureHandler.GestureListener gl) {
+    public final void addGestureListener(int index, final GestureHandler.GestureListener gl) {
         if(gl == null) {
             return;
         }
         @SuppressWarnings("unchecked")
+        final
         ArrayList<GestureHandler.GestureListener> cloned = (ArrayList<GestureHandler.GestureListener>) gestureListeners.clone();
         if(0>index) {
             index = cloned.size();
@@ -3238,19 +3390,20 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         gestureListeners = cloned;
     }
     @Override
-    public final void removeGestureListener(GestureHandler.GestureListener gl) {
+    public final void removeGestureListener(final GestureHandler.GestureListener gl) {
         if (gl == null) {
             return;
         }
         @SuppressWarnings("unchecked")
+        final
         ArrayList<GestureHandler.GestureListener> cloned = (ArrayList<GestureHandler.GestureListener>) gestureListeners.clone();
         cloned.remove(gl);
         gestureListeners= cloned;
     }
 
-    private final void dispatchMouseEvent(MouseEvent e) {
+    private final void dispatchMouseEvent(final MouseEvent e) {
         for(int i = 0; !e.isConsumed() && i < mouseListeners.size(); i++ ) {
-            MouseListener l = mouseListeners.get(i);
+            final MouseListener l = mouseListeners.get(i);
             switch(e.getEventType()) {
                 case MouseEvent.EVENT_MOUSE_CLICKED:
                     l.mouseClicked(e);
@@ -3297,7 +3450,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * @param pressed true if pressed, otherwise false
      * @return the previus pressed value
      */
-    protected final boolean setKeyPressed(short keyCode, boolean pressed) {
+    protected final boolean setKeyPressed(final short keyCode, final boolean pressed) {
         final int v = 0xFFFF & keyCode;
         if( v <= keyTrackingRange ) {
             return keyPressedState.put(v, pressed);
@@ -3308,7 +3461,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * @param keyCode the keyCode to test pressed state
      * @return true if pressed, otherwise false
      */
-    protected final boolean isKeyPressed(short keyCode) {
+    protected final boolean isKeyPressed(final short keyCode) {
         final int v = 0xFFFF & keyCode;
         if( v <= keyTrackingRange ) {
             return keyPressedState.get(v);
@@ -3316,18 +3469,18 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return false;
     }
 
-    public void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
+    public void sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
         // Always add currently pressed mouse buttons to modifier mask
         consumeKeyEvent( KeyEvent.create(eventType, this, System.currentTimeMillis(), modifiers | pState1.buttonPressedMask, keyCode, keySym, keyChar) );
     }
 
-    public void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
+    public void enqueueKeyEvent(final boolean wait, final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
         // Always add currently pressed mouse buttons to modifier mask
         enqueueEvent(wait, KeyEvent.create(eventType, this, System.currentTimeMillis(), modifiers | pState1.buttonPressedMask, keyCode, keySym, keyChar) );
     }
 
     @Override
-    public final void setKeyboardVisible(boolean visible) {
+    public final void setKeyboardVisible(final boolean visible) {
         if(isNativeValid()) {
             // We don't skip the impl. if it seems that there is no state change,
             // since we cannot assume the impl. reliably gives us it's current state.
@@ -3351,11 +3504,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * hence even if an invisible operation failed, the keyboard is considered invisible!
      * </p>
      */
-    protected boolean setKeyboardVisibleImpl(boolean visible) {
+    protected boolean setKeyboardVisibleImpl(final boolean visible) {
         return false; // nop
     }
     /** Triggered by implementation's WM events to update the virtual on-screen keyboard's visibility state. */
-    protected void keyboardVisibilityChanged(boolean visible) {
+    protected void keyboardVisibilityChanged(final boolean visible) {
         if(keyboardVisible != visible) {
             if(DEBUG_IMPLEMENTATION || DEBUG_KEY_EVENT) {
                 System.err.println("keyboardVisibilityChanged: "+keyboardVisible+" -> "+visible);
@@ -3366,16 +3519,17 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     protected boolean keyboardVisible = false;
 
     @Override
-    public final void addKeyListener(KeyListener l) {
+    public final void addKeyListener(final KeyListener l) {
         addKeyListener(-1, l);
     }
 
     @Override
-    public final void addKeyListener(int index, KeyListener l) {
+    public final void addKeyListener(int index, final KeyListener l) {
         if(l == null) {
             return;
         }
         @SuppressWarnings("unchecked")
+        final
         ArrayList<KeyListener> clonedListeners = (ArrayList<KeyListener>) keyListeners.clone();
         if(0>index) {
             index = clonedListeners.size();
@@ -3385,11 +3539,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void removeKeyListener(KeyListener l) {
+    public final void removeKeyListener(final KeyListener l) {
         if (l == null) {
             return;
         }
         @SuppressWarnings("unchecked")
+        final
         ArrayList<KeyListener> clonedListeners = (ArrayList<KeyListener>) keyListeners.clone();
         clonedListeners.remove(l);
         keyListeners = clonedListeners;
@@ -3398,6 +3553,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     @Override
     public final KeyListener getKeyListener(int index) {
         @SuppressWarnings("unchecked")
+        final
         ArrayList<KeyListener> clonedListeners = (ArrayList<KeyListener>) keyListeners.clone();
         if(0>index) {
             index = clonedListeners.size()-1;
@@ -3410,7 +3566,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return keyListeners.toArray(new KeyListener[keyListeners.size()]);
     }
 
-    private final boolean propagateKeyEvent(KeyEvent e, KeyListener l) {
+    private final boolean propagateKeyEvent(final KeyEvent e, final KeyListener l) {
         switch(e.getEventType()) {
             case KeyEvent.EVENT_KEY_PRESSED:
                 l.keyPressed(e);
@@ -3424,7 +3580,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return e.isConsumed();
     }
 
-    protected void consumeKeyEvent(KeyEvent e) {
+    protected void consumeKeyEvent(final KeyEvent e) {
         boolean consumedE = false;
         if( null != keyboardFocusHandler && !e.isAutoRepeat() ) {
             consumedE = propagateKeyEvent(e, keyboardFocusHandler);
@@ -3448,27 +3604,28 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     // WindowListener/Event Support
     //
     @Override
-    public final void sendWindowEvent(int eventType) {
+    public final void sendWindowEvent(final int eventType) {
         consumeWindowEvent( new WindowEvent((short)eventType, this, System.currentTimeMillis()) );
     }
 
-    public final void enqueueWindowEvent(boolean wait, int eventType) {
+    public final void enqueueWindowEvent(final boolean wait, final int eventType) {
         enqueueEvent( wait, new WindowEvent((short)eventType, this, System.currentTimeMillis()) );
     }
 
     @Override
-    public final void addWindowListener(WindowListener l) {
+    public final void addWindowListener(final WindowListener l) {
         addWindowListener(-1, l);
     }
 
     @Override
-    public final void addWindowListener(int index, WindowListener l)
+    public final void addWindowListener(int index, final WindowListener l)
         throws IndexOutOfBoundsException
     {
         if(l == null) {
             return;
         }
         @SuppressWarnings("unchecked")
+        final
         ArrayList<WindowListener> clonedListeners = (ArrayList<WindowListener>) windowListeners.clone();
         if(0>index) {
             index = clonedListeners.size();
@@ -3478,11 +3635,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void removeWindowListener(WindowListener l) {
+    public final void removeWindowListener(final WindowListener l) {
         if (l == null) {
             return;
         }
         @SuppressWarnings("unchecked")
+        final
         ArrayList<WindowListener> clonedListeners = (ArrayList<WindowListener>) windowListeners.clone();
         clonedListeners.remove(l);
         windowListeners = clonedListeners;
@@ -3491,6 +3649,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     @Override
     public final WindowListener getWindowListener(int index) {
         @SuppressWarnings("unchecked")
+        final
         ArrayList<WindowListener> clonedListeners = (ArrayList<WindowListener>) windowListeners.clone();
         if(0>index) {
             index = clonedListeners.size()-1;
@@ -3503,12 +3662,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return windowListeners.toArray(new WindowListener[windowListeners.size()]);
     }
 
-    protected void consumeWindowEvent(WindowEvent e) {
+    protected void consumeWindowEvent(final WindowEvent e) {
         if(DEBUG_IMPLEMENTATION) {
-            System.err.println("consumeWindowEvent: "+e+", visible "+isVisible()+" "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight());
+            System.err.println("consumeWindowEvent: "+e+", visible "+isVisible()+" "+getX()+"/"+getY()+", win["+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+
+                               "], pixel["+getSurfaceWidth()+"x"+getSurfaceHeight()+"]");
         }
         for(int i = 0; !e.isConsumed() && i < windowListeners.size(); i++ ) {
-            WindowListener l = windowListeners.get(i);
+            final WindowListener l = windowListeners.get(i);
             switch(e.getEventType()) {
                 case WindowEvent.EVENT_WINDOW_RESIZED:
                     l.windowResized(e);
@@ -3540,7 +3700,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     /** Triggered by implementation's WM events to update the focus state. */
-    protected void focusChanged(boolean defer, boolean focusGained) {
+    protected void focusChanged(final boolean defer, final boolean focusGained) {
         if(brokenFocusChange || hasFocus != focusGained) {
             if(DEBUG_IMPLEMENTATION) {
                 System.err.println("Window.focusChanged: ("+getThreadName()+"): (defer: "+defer+") "+this.hasFocus+" -> "+focusGained+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
@@ -3556,7 +3716,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     /** Triggered by implementation's WM events to update the visibility state. */
-    protected final void visibleChanged(boolean defer, boolean visible) {
+    protected final void visibleChanged(final boolean defer, final boolean visible) {
         if(this.visible != visible) {
             if(DEBUG_IMPLEMENTATION) {
                 System.err.println("Window.visibleChanged ("+getThreadName()+"): (defer: "+defer+") "+this.visible+" -> "+visible+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
@@ -3566,17 +3726,17 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     /** Returns -1 if failed, otherwise remaining time until {@link #TIMEOUT_NATIVEWINDOW}, maybe zero. */
-    private long waitForVisible(boolean visible, boolean failFast) {
+    private long waitForVisible(final boolean visible, final boolean failFast) {
         return waitForVisible(visible, failFast, TIMEOUT_NATIVEWINDOW);
     }
 
     /** Returns -1 if failed, otherwise remaining time until <code>timeOut</code>, maybe zero. */
-    private long waitForVisible(boolean visible, boolean failFast, long timeOut) {
+    private long waitForVisible(final boolean visible, final boolean failFast, final long timeOut) {
         final DisplayImpl display = (DisplayImpl) screen.getDisplay();
         display.dispatchMessagesNative(); // status up2date
         long remaining;
         for(remaining = timeOut; 0<remaining && this.visible != visible; remaining-=10 ) {
-            try { Thread.sleep(10); } catch (InterruptedException ie) {}
+            try { Thread.sleep(10); } catch (final InterruptedException ie) {}
             display.dispatchMessagesNative(); // status up2date
         }
         if(this.visible != visible) {
@@ -3595,11 +3755,13 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
     }
 
-    /** Triggered by implementation's WM events to update the client-area size w/o insets/decorations. */
-    protected void sizeChanged(boolean defer, int newWidth, int newHeight, boolean force) {
+    /** Triggered by implementation's WM events to update the client-area size in window units w/o insets/decorations. */
+    protected void sizeChanged(final boolean defer, final int newWidth, final int newHeight, final boolean force) {
         if(force || getWidth() != newWidth || getHeight() != newHeight) {
             if(DEBUG_IMPLEMENTATION) {
-                System.err.println("Window.sizeChanged: ("+getThreadName()+"): (defer: "+defer+") force "+force+", "+getWidth()+"x"+getHeight()+" -> "+newWidth+"x"+newHeight+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
+                System.err.println("Window.sizeChanged: ("+getThreadName()+"): (defer: "+defer+") force "+force+", "+
+                                   getWidth()+"x"+getHeight()+" -> "+newWidth+"x"+newHeight+
+                                   " - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
             }
             if(0>newWidth || 0>newHeight) {
                 throw new NativeWindowException("Illegal width or height "+newWidth+"x"+newHeight+" (must be >= 0)");
@@ -3615,12 +3777,12 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         }
     }
 
-    private boolean waitForSize(int w, int h, boolean failFast, long timeOut) {
+    private boolean waitForSize(final int w, final int h, final boolean failFast, final long timeOut) {
         final DisplayImpl display = (DisplayImpl) screen.getDisplay();
         display.dispatchMessagesNative(); // status up2date
         long sleep;
         for(sleep = timeOut; 0<sleep && w!=getWidth() && h!=getHeight(); sleep-=10 ) {
-            try { Thread.sleep(10); } catch (InterruptedException ie) {}
+            try { Thread.sleep(10); } catch (final InterruptedException ie) {}
             display.dispatchMessagesNative(); // status up2date
         }
         if(0 >= sleep) {
@@ -3638,7 +3800,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     /** Triggered by implementation's WM events to update the position. */
-    protected final void positionChanged(boolean defer, int newX, int newY) {
+    protected final void positionChanged(final boolean defer, final int newX, final int newY) {
         if ( getX() != newX || getY() != newY ) {
             if(DEBUG_IMPLEMENTATION) {
                 System.err.println("Window.positionChanged: ("+getThreadName()+"): (defer: "+defer+") "+getX()+"/"+getY()+" -> "+newX+"/"+newY+" - windowHandle "+toHexString(windowHandle)+" parentWindowHandle "+toHexString(parentWindowHandle));
@@ -3660,7 +3822,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * Since WM may not obey our positional request exactly, we allow a tolerance of 2 times insets[left/top], or 64 pixels, whatever is greater.
      * </p>
      */
-    private boolean waitForPosition(boolean useCustomPosition, int x, int y, long timeOut) {
+    private boolean waitForPosition(final boolean useCustomPosition, final int x, final int y, final long timeOut) {
         final DisplayImpl display = (DisplayImpl) screen.getDisplay();
         final int maxDX, maxDY;
         {
@@ -3677,7 +3839,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
                 ok = !autoPosition;
             }
             if( !ok ) {
-                try { Thread.sleep(10); } catch (InterruptedException ie) {}
+                try { Thread.sleep(10); } catch (final InterruptedException ie) {}
                 display.dispatchMessagesNative(); // status up2date
                 remaining-=10;
             }
@@ -3701,7 +3863,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      * @see #getInsets()
      * @see #updateInsetsImpl(Insets)
      */
-    protected void insetsChanged(boolean defer, int left, int right, int top, int bottom) {
+    protected void insetsChanged(final boolean defer, final int left, final int right, final int top, final int bottom) {
         if ( left >= 0 && right >= 0 && top >= 0 && bottom >= 0 ) {
             if( blockInsetsChange || isUndecorated() ) {
                 if(DEBUG_IMPLEMENTATION) {
@@ -3725,7 +3887,7 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
      *              and hence force destruction. Otherwise is follows the user settings.
      * @return true if this window is no more valid and hence has been destroyed, otherwise false.
      */
-    public final boolean windowDestroyNotify(boolean force) {
+    public final boolean windowDestroyNotify(final boolean force) {
         final WindowClosingMode defMode = getDefaultCloseOperation();
         final WindowClosingMode mode = force ? WindowClosingMode.DISPOSE_ON_CLOSE : defMode;
         if(DEBUG_IMPLEMENTATION) {
@@ -3769,22 +3931,27 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     }
 
     @Override
-    public final void windowRepaint(int x, int y, int width, int height) {
+    public final void windowRepaint(final int x, final int y, final int width, final int height) {
         windowRepaint(false, x, y, width, height);
     }
 
     /**
      * Triggered by implementation's WM events to update the content
+     * @param defer if true sent event later, otherwise wait until processed.
+     * @param x dirty-region y-pos in pixel units
+     * @param y dirty-region x-pos in pixel units
+     * @param width dirty-region width in pixel units
+     * @param height dirty-region height in pixel units
      */
-    protected final void windowRepaint(boolean defer, int x, int y, int width, int height) {
-        width = ( 0 >= width ) ? getWidth() : width;
-        height = ( 0 >= height ) ? getHeight() : height;
+    protected final void windowRepaint(final boolean defer, final int x, final int y, int width, int height) {
+        width = ( 0 >= width ) ? getSurfaceWidth() : width;
+        height = ( 0 >= height ) ? getSurfaceHeight() : height;
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("Window.windowRepaint "+getThreadName()+" (defer: "+defer+") "+x+"/"+y+" "+width+"x"+height);
         }
 
         if(isNativeValid()) {
-            NEWTEvent e = new WindowUpdateEvent(WindowEvent.EVENT_WINDOW_REPAINT, this, System.currentTimeMillis(),
+            final NEWTEvent e = new WindowUpdateEvent(WindowEvent.EVENT_WINDOW_REPAINT, this, System.currentTimeMillis(),
                                                 new Rectangle(x, y, width, height));
             doEvent(defer, false, e);
         }
@@ -3794,16 +3961,16 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
     // Reflection helper ..
     //
 
-    private static Class<?>[] getCustomConstructorArgumentTypes(Class<?> windowClass) {
+    private static Class<?>[] getCustomConstructorArgumentTypes(final Class<?> windowClass) {
         Class<?>[] argTypes = null;
         try {
-            Method m = windowClass.getDeclaredMethod("getCustomConstructorArgumentTypes");
+            final Method m = windowClass.getDeclaredMethod("getCustomConstructorArgumentTypes");
             argTypes = (Class[]) m.invoke(null, (Object[])null);
-        } catch (Throwable t) {}
+        } catch (final Throwable t) {}
         return argTypes;
     }
 
-    private static int verifyConstructorArgumentTypes(Class<?>[] types, Object[] args) {
+    private static int verifyConstructorArgumentTypes(final Class<?>[] types, final Object[] args) {
         if(types.length != args.length) {
             return -1;
         }
@@ -3815,8 +3982,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return args.length;
     }
 
-    private static String getArgsStrList(Object[] args) {
-        StringBuilder sb = new StringBuilder();
+    private static String getArgsStrList(final Object[] args) {
+        final StringBuilder sb = new StringBuilder();
         for(int i=0; i<args.length; i++) {
             sb.append(args[i].getClass());
             if(i<args.length) {
@@ -3826,8 +3993,8 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return sb.toString();
     }
 
-    private static String getTypeStrList(Class<?>[] types) {
-        StringBuilder sb = new StringBuilder();
+    private static String getTypeStrList(final Class<?>[] types) {
+        final StringBuilder sb = new StringBuilder();
         for(int i=0; i<types.length; i++) {
             sb.append(types[i]);
             if(i<types.length) {
@@ -3841,11 +4008,11 @@ public abstract class WindowImpl implements Window, NEWTEventConsumer
         return Display.getThreadName();
     }
 
-    public static String toHexString(int hex) {
+    public static String toHexString(final int hex) {
         return Display.toHexString(hex);
     }
 
-    public static String toHexString(long hex) {
+    public static String toHexString(final long hex) {
         return Display.toHexString(hex);
     }
 }
diff --git a/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java b/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java
index 2ba5b34..682313e 100644
--- a/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java
+++ b/src/newt/classes/jogamp/newt/awt/NewtFactoryAWT.java
@@ -55,7 +55,7 @@ public class NewtFactoryAWT extends NewtFactory {
    *
    * @param awtCompObject must be of type java.awt.Component
    */
-  public static JAWTWindow getNativeWindow(Object awtCompObject, CapabilitiesImmutable capsRequested) {
+  public static JAWTWindow getNativeWindow(final Object awtCompObject, final CapabilitiesImmutable capsRequested) {
       if(null==awtCompObject) {
         throw new NativeWindowException("Null AWT Component");
       }
@@ -65,9 +65,9 @@ public class NewtFactoryAWT extends NewtFactory {
       return getNativeWindow( (java.awt.Component) awtCompObject, capsRequested );
   }
 
-  public static JAWTWindow getNativeWindow(java.awt.Component awtComp, CapabilitiesImmutable capsRequested) {
-      AWTGraphicsConfiguration config = AWTGraphicsConfiguration.create(awtComp, null, capsRequested);
-      NativeWindow nw = NativeWindowFactory.getNativeWindow(awtComp, config); // a JAWTWindow
+  public static JAWTWindow getNativeWindow(final java.awt.Component awtComp, final CapabilitiesImmutable capsRequested) {
+      final AWTGraphicsConfiguration config = AWTGraphicsConfiguration.create(awtComp, null, capsRequested);
+      final NativeWindow nw = NativeWindowFactory.getNativeWindow(awtComp, config); // a JAWTWindow
       if(! ( nw instanceof JAWTWindow ) ) {
           throw new NativeWindowException("Not an AWT NativeWindow: "+nw);
       }
@@ -77,7 +77,7 @@ public class NewtFactoryAWT extends NewtFactory {
       return (JAWTWindow)nw;
   }
 
-  public static void destroyNativeWindow(JAWTWindow jawtWindow) {
+  public static void destroyNativeWindow(final JAWTWindow jawtWindow) {
       final AbstractGraphicsConfiguration config = jawtWindow.getGraphicsConfiguration();
       jawtWindow.destroy();
       config.getScreen().getDevice().close();
diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
index 0ee3cc0..31ee92c 100644
--- a/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
+++ b/src/newt/classes/jogamp/newt/awt/event/AWTNewtEventFactory.java
@@ -28,6 +28,9 @@
 
 package jogamp.newt.awt.event;
 
+import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.NativeSurfaceHolder;
+
 import com.jogamp.newt.event.MouseEvent;
 
 /**
@@ -98,7 +101,7 @@ public class AWTNewtEventFactory {
         }
     }
 
-    public static final short eventTypeAWT2NEWT(int awtType) {
+    public static final short eventTypeAWT2NEWT(final int awtType) {
         switch( awtType ) {
             // n/a case java.awt.event.WindowEvent.WINDOW_OPENED: return com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_OPENED;
             case java.awt.event.WindowEvent.WINDOW_CLOSING: return com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY;
@@ -133,7 +136,7 @@ public class AWTNewtEventFactory {
         return (short)0;
     }
 
-    private static int getAWTButtonDownMaskImpl(int button) {
+    private static int getAWTButtonDownMaskImpl(final int button) {
         /**
          * java.awt.event.InputEvent.getMaskForButton(button);
          *
@@ -170,7 +173,7 @@ public class AWTNewtEventFactory {
      * @param button
      * @return
      */
-    public static int getAWTButtonDownMask(int button) {
+    public static int getAWTButtonDownMask(final int button) {
         if( 0 < button && button <= awtButtonDownMasks.length ) {
             return awtButtonDownMasks[button-1];
         } else {
@@ -178,7 +181,7 @@ public class AWTNewtEventFactory {
         }
     }
 
-    public static final short awtButton2Newt(int awtButton) {
+    public static final short awtButton2Newt(final int awtButton) {
         if( 0 < awtButton && awtButton <= com.jogamp.newt.event.MouseEvent.BUTTON_COUNT ) {
             return (short)awtButton;
         } else {
@@ -414,7 +417,7 @@ public class AWTNewtEventFactory {
     }
 
     public static int newtKeyCode2AWTKeyCode(final short newtKeyCode) {
-        final int defAwtKeyCode = 0xFFFF & (int)newtKeyCode;
+        final int defAwtKeyCode = 0xFFFF & newtKeyCode;
         switch (newtKeyCode) {
             case com.jogamp.newt.event.KeyEvent.VK_HOME          : return java.awt.event.KeyEvent.VK_HOME;
             case com.jogamp.newt.event.KeyEvent.VK_END           : return java.awt.event.KeyEvent.VK_END;
@@ -590,31 +593,31 @@ public class AWTNewtEventFactory {
         return defAwtKeyCode;
     }
 
-    public static final com.jogamp.newt.event.WindowEvent createWindowEvent(java.awt.event.WindowEvent event, com.jogamp.newt.Window newtSource) {
+    public static final com.jogamp.newt.event.WindowEvent createWindowEvent(final java.awt.event.WindowEvent event, final NativeSurfaceHolder sourceHolder) {
         final short newtType = eventTypeAWT2NEWT(event.getID());
         if( (short)0 != newtType ) {
-            return new com.jogamp.newt.event.WindowEvent(newtType, ((null==newtSource)?(Object)event.getComponent():(Object)newtSource), System.currentTimeMillis());
+            return new com.jogamp.newt.event.WindowEvent(newtType, sourceHolder, System.currentTimeMillis());
         }
         return null; // no mapping ..
     }
 
-    public static final com.jogamp.newt.event.WindowEvent createWindowEvent(java.awt.event.ComponentEvent event, com.jogamp.newt.Window newtSource) {
+    public static final com.jogamp.newt.event.WindowEvent createWindowEvent(final java.awt.event.ComponentEvent event, final NativeSurfaceHolder sourceHolder) {
         final short newtType = eventTypeAWT2NEWT(event.getID());
         if( (short)0 != newtType ) {
-            return new com.jogamp.newt.event.WindowEvent(newtType, (null==newtSource)?(Object)event.getComponent():(Object)newtSource, System.currentTimeMillis());
+            return new com.jogamp.newt.event.WindowEvent(newtType, sourceHolder, System.currentTimeMillis());
         }
         return null; // no mapping ..
     }
 
-    public static final com.jogamp.newt.event.WindowEvent createWindowEvent(java.awt.event.FocusEvent event, com.jogamp.newt.Window newtSource) {
+    public static final com.jogamp.newt.event.WindowEvent createWindowEvent(final java.awt.event.FocusEvent event, final NativeSurfaceHolder sourceHolder) {
         final short newtType = eventTypeAWT2NEWT(event.getID());
         if( (short)0 != newtType ) {
-            return new com.jogamp.newt.event.WindowEvent(newtType, (null==newtSource)?(Object)event.getComponent():(Object)newtSource, System.currentTimeMillis());
+            return new com.jogamp.newt.event.WindowEvent(newtType, sourceHolder, System.currentTimeMillis());
         }
         return null; // no mapping ..
     }
 
-    public static final com.jogamp.newt.event.MouseEvent createMouseEvent(java.awt.event.MouseEvent event, com.jogamp.newt.Window newtSource) {
+    public static final com.jogamp.newt.event.MouseEvent createMouseEvent(final java.awt.event.MouseEvent event, final NativeSurfaceHolder sourceHolder) {
         final short newtType = eventTypeAWT2NEWT(event.getID());
         if( (short)0 != newtType ) {
             float rotation = 0;
@@ -626,31 +629,40 @@ public class AWTNewtEventFactory {
             final short newtButton = awtButton2Newt(event.getButton());
             int mods = awtModifiers2Newt(event.getModifiers(), event.getModifiersEx());
             mods |= com.jogamp.newt.event.InputEvent.getButtonMask(newtButton); // always include NEWT BUTTON_MASK
-            if(null!=newtSource) {
-                if(newtSource.isPointerConfined()) {
-                    mods |= com.jogamp.newt.event.InputEvent.CONFINED_MASK;
-                }
-                if(!newtSource.isPointerVisible()) {
-                    mods |= com.jogamp.newt.event.InputEvent.INVISIBLE_MASK;
+            final NativeSurface source = sourceHolder.getNativeSurface();
+            final int[] pixelPos;
+            if( null != source ) {
+                if( source instanceof com.jogamp.newt.Window ) {
+                    final com.jogamp.newt.Window newtSource = (com.jogamp.newt.Window) source;
+                    if(newtSource.isPointerConfined()) {
+                        mods |= com.jogamp.newt.event.InputEvent.CONFINED_MASK;
+                    }
+                    if(!newtSource.isPointerVisible()) {
+                        mods |= com.jogamp.newt.event.InputEvent.INVISIBLE_MASK;
+                    }
                 }
+                pixelPos = source.convertToPixelUnits(new int[] { event.getX(), event.getY() });
+            } else {
+                pixelPos = new int[] { event.getX(), event.getY() };
             }
+
             return new com.jogamp.newt.event.MouseEvent(
-                           newtType, (null==newtSource)?(Object)event.getComponent():(Object)newtSource, event.getWhen(),
-                           mods, event.getX(), event.getY(), (short)event.getClickCount(),
+                           newtType, sourceHolder, event.getWhen(),
+                           mods, pixelPos[0], pixelPos[1], (short)event.getClickCount(),
                            newtButton, MouseEvent.getRotationXYZ(rotation, mods), 1f);
         }
         return null; // no mapping ..
     }
 
-    public static final com.jogamp.newt.event.KeyEvent createKeyEvent(java.awt.event.KeyEvent event, com.jogamp.newt.Window newtSource) {
-        return createKeyEvent(eventTypeAWT2NEWT(event.getID()), event, newtSource);
+    public static final com.jogamp.newt.event.KeyEvent createKeyEvent(final java.awt.event.KeyEvent event, final NativeSurfaceHolder sourceHolder) {
+        return createKeyEvent(eventTypeAWT2NEWT(event.getID()), event, sourceHolder);
     }
 
-    public static final com.jogamp.newt.event.KeyEvent createKeyEvent(short newtType, java.awt.event.KeyEvent event, com.jogamp.newt.Window newtSource) {
+    public static final com.jogamp.newt.event.KeyEvent createKeyEvent(final short newtType, final java.awt.event.KeyEvent event, final NativeSurfaceHolder sourceHolder) {
         if( (short)0 != newtType ) {
             final short newtKeyCode = awtKeyCode2NewtKeyCode( event.getKeyCode() );
             return com.jogamp.newt.event.KeyEvent.create(
-                           newtType, (null==newtSource)?(Object)event.getComponent():(Object)newtSource, event.getWhen(),
+                           newtType, sourceHolder, event.getWhen(),
                            awtModifiers2Newt(event.getModifiers(), event.getModifiersEx()),
                            newtKeyCode, newtKeyCode, event.getKeyChar());
         }
diff --git a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
index 7705023..93cdd7e 100644
--- a/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
+++ b/src/newt/classes/jogamp/newt/awt/event/AWTParentWindowAdapter.java
@@ -46,14 +46,14 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
 {
     NativeWindow downstreamParent;
 
-    public AWTParentWindowAdapter(NativeWindow downstreamParent, com.jogamp.newt.Window downstream) {
+    public AWTParentWindowAdapter(final NativeWindow downstreamParent, final com.jogamp.newt.Window downstream) {
         super(downstream);
         this.downstreamParent = downstreamParent;
     }
     public AWTParentWindowAdapter() {
         super();
     }
-    public AWTParentWindowAdapter setDownstream(NativeWindow downstreamParent, com.jogamp.newt.Window downstream) {
+    public AWTParentWindowAdapter setDownstream(final NativeWindow downstreamParent, final com.jogamp.newt.Window downstream) {
         setDownstream(downstream);
         this.downstreamParent = downstreamParent;
         return this;
@@ -67,19 +67,19 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
     }
 
     @Override
-    public synchronized AWTAdapter addTo(java.awt.Component awtComponent) {
+    public synchronized AWTAdapter addTo(final java.awt.Component awtComponent) {
         awtComponent.addHierarchyListener(this);
         return super.addTo(awtComponent);
     }
 
     @Override
-    public synchronized AWTAdapter removeFrom(java.awt.Component awtComponent) {
+    public synchronized AWTAdapter removeFrom(final java.awt.Component awtComponent) {
         awtComponent.removeHierarchyListener(this);
         return super.removeFrom(awtComponent);
     }
 
     @Override
-    public synchronized void focusGained(java.awt.event.FocusEvent e) {
+    public synchronized void focusGained(final java.awt.event.FocusEvent e) {
         if( !isSetup ) { return; }
         // forward focus to NEWT child
         final com.jogamp.newt.Window newtChild = getNewtWindow();
@@ -100,7 +100,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
     }
 
     @Override
-    public synchronized void focusLost(java.awt.event.FocusEvent e) {
+    public synchronized void focusLost(final java.awt.event.FocusEvent e) {
         if( !isSetup ) { return; }
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("AWT: focusLost: "+ e);
@@ -108,7 +108,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
     }
 
     @Override
-    public synchronized void componentResized(java.awt.event.ComponentEvent e) {
+    public synchronized void componentResized(final java.awt.event.ComponentEvent e) {
         if( !isSetup ) { return; }
         // Need to resize the NEWT child window
         // the resized event will be send via the native window feedback.
@@ -139,7 +139,7 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
     }
 
     @Override
-    public synchronized void componentMoved(java.awt.event.ComponentEvent e) {
+    public synchronized void componentMoved(final java.awt.event.ComponentEvent e) {
         if( !isSetup ) { return; }
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("AWT: componentMoved: "+e);
@@ -151,17 +151,17 @@ public class AWTParentWindowAdapter extends AWTWindowAdapter implements java.awt
     }
 
     @Override
-    public synchronized void windowActivated(java.awt.event.WindowEvent e) {
+    public synchronized void windowActivated(final java.awt.event.WindowEvent e) {
         // no propagation to NEWT child window
     }
 
     @Override
-    public synchronized void windowDeactivated(java.awt.event.WindowEvent e) {
+    public synchronized void windowDeactivated(final java.awt.event.WindowEvent e) {
         // no propagation to NEWT child window
     }
 
     @Override
-    public synchronized void hierarchyChanged(java.awt.event.HierarchyEvent e) {
+    public synchronized void hierarchyChanged(final java.awt.event.HierarchyEvent e) {
         if( !isSetup ) { return; }
         final Window newtChild = getNewtWindow();
         if( null != newtChild && null == getNewtEventListener() ) {
diff --git a/src/newt/classes/jogamp/newt/driver/PNGIcon.java b/src/newt/classes/jogamp/newt/driver/PNGIcon.java
index 967acd4..43cfa9b 100644
--- a/src/newt/classes/jogamp/newt/driver/PNGIcon.java
+++ b/src/newt/classes/jogamp/newt/driver/PNGIcon.java
@@ -71,7 +71,7 @@ public class PNGIcon {
      * @throws IOException
      * @throws MalformedURLException
      */
-    public static ByteBuffer arrayToX11BGRAImages(IOUtil.ClassResources resources, int[] data_size, int[] elem_bytesize) throws UnsupportedOperationException, InterruptedException, IOException, MalformedURLException {
+    public static ByteBuffer arrayToX11BGRAImages(final IOUtil.ClassResources resources, final int[] data_size, final int[] elem_bytesize) throws UnsupportedOperationException, InterruptedException, IOException, MalformedURLException {
         if( avail ) {
             return jogamp.newt.driver.opengl.JoglUtilPNGIcon.arrayToX11BGRAImages(resources, data_size, elem_bytesize);
         }
diff --git a/src/newt/classes/jogamp/newt/driver/android/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/android/DisplayDriver.java
index 32bd970..a5f4fc7 100644
--- a/src/newt/classes/jogamp/newt/driver/android/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/android/DisplayDriver.java
@@ -56,7 +56,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
         aDevice.open();
     }
 
-    protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+    protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
         aDevice.close();
     }
 
diff --git a/src/newt/classes/jogamp/newt/driver/android/MD.java b/src/newt/classes/jogamp/newt/driver/android/MD.java
index f2f3093..e631600 100644
--- a/src/newt/classes/jogamp/newt/driver/android/MD.java
+++ b/src/newt/classes/jogamp/newt/driver/android/MD.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,13 +20,15 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
 package jogamp.newt.driver.android;
 
+import jogamp.common.os.PlatformPropsImpl;
+
 import com.jogamp.common.GlueGenVersion;
 import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.VersionUtil;
@@ -34,22 +36,22 @@ import com.jogamp.opengl.JoglVersion;
 
 public class MD {
    public static final String TAG = "JogAmp.NEWT";
-   
-   public static String getInfo() {        
-        StringBuilder sb = new StringBuilder();
-        
-        sb.append(VersionUtil.getPlatformInfo()).append(Platform.NEWLINE)
-              .append(GlueGenVersion.getInstance()).append(Platform.NEWLINE)
-              .append(JoglVersion.getInstance()).append(Platform.NEWLINE)
-              .append(Platform.NEWLINE);
-              
+
+   public static String getInfo() {
+        final StringBuilder sb = new StringBuilder();
+
+        sb.append(VersionUtil.getPlatformInfo()).append(PlatformPropsImpl.NEWLINE)
+              .append(GlueGenVersion.getInstance()).append(PlatformPropsImpl.NEWLINE)
+              .append(JoglVersion.getInstance()).append(PlatformPropsImpl.NEWLINE)
+              .append(PlatformPropsImpl.NEWLINE);
+
         JoglVersion.getDefaultOpenGLInfo(null, sb, true);
 
-        return sb.toString();       
+        return sb.toString();
    }
-   
-    public static void main(String args[]) {
-        
+
+    public static void main(final String args[]) {
+
         System.err.println(getInfo());
     }
 }
diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java b/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java
index 76eb890..68d43ac 100644
--- a/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java
+++ b/src/newt/classes/jogamp/newt/driver/android/NewtBaseActivity.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -50,21 +50,21 @@ import android.view.WindowManager;
 public class NewtBaseActivity extends Activity {
    List<Window> newtWindows = new ArrayList<Window>();
    List<GLAutoDrawable> glAutoDrawables = new ArrayList<GLAutoDrawable>();
-   
+
    GLAnimatorControl animator = null;
-    
+
    boolean isDelegatedActivity;
    Activity rootActivity;
    boolean setThemeCalled = false;
-      
-   protected void startAnimation(boolean start) {
+
+   protected void startAnimation(final boolean start) {
      if(null != animator) {
          final boolean res;
          if( start ) {
-             if( animator.isPaused() ) { 
-                 res = animator.resume(); 
-             } else { 
-                 res = animator.start(); 
+             if( animator.isPaused() ) {
+                 res = animator.resume();
+             } else {
+                 res = animator.start();
              }
          } else {
              res = animator.stop();
@@ -76,10 +76,10 @@ public class NewtBaseActivity extends Activity {
          if(null != anim) {
              final boolean res;
              if( start ) {
-                 if( anim.isPaused() ) { 
-                     res = anim.resume(); 
-                 } else { 
-                     res = anim.start(); 
+                 if( anim.isPaused() ) {
+                     res = anim.resume();
+                 } else {
+                     res = anim.start();
                  }
              } else {
                  res = anim.stop();
@@ -88,32 +88,32 @@ public class NewtBaseActivity extends Activity {
          }
      }
    }
-       
+
    public NewtBaseActivity() {
        super();
        isDelegatedActivity = false;
        rootActivity = this;
    }
-   
-   public void setRootActivity(Activity rootActivity) {
+
+   public void setRootActivity(final Activity rootActivity) {
        this.rootActivity = rootActivity;
        this.isDelegatedActivity = this != rootActivity;
    }
-   
+
    public final boolean isDelegatedActivity() {
        return isDelegatedActivity;
    }
-   
+
    public final Activity getActivity() {
        return rootActivity;
-   }     
-   
+   }
+
    /**
     * This is one of the three registration methods (see below).
     * <p>
     * This methods issues {@link android.view.Window#setContentView(android.view.View, android.view.ViewGroup.LayoutParams) androidWindow.setContenView(newtWindow.getAndroidView())}
     * and finally calls {@link #registerNEWTWindow(Window)}.
-    * </p>  
+    * </p>
     * @param androidWindow
     * @param newtWindow
     * @throws IllegalArgumentException if the <code>newtWindow</code>'s {@link Window#getDelegatedWindow() delegate} is not an AndroidDriver.
@@ -128,7 +128,7 @@ public class NewtBaseActivity extends Activity {
            final WindowDriver newtAWindow = (WindowDriver)delegateWindow;
            androidWindow.setContentView(newtAWindow.getAndroidView());
        } else {
-           throw new IllegalArgumentException("Given NEWT Window is not an Android Window: "+newtWindow.getClass().getName()); 
+           throw new IllegalArgumentException("Given NEWT Window is not an Android Window: "+newtWindow.getClass().getName());
        }
        registerNEWTWindow(newtWindow);
    }
@@ -137,7 +137,7 @@ public class NewtBaseActivity extends Activity {
     * <p>
     * This methods issues {@link android.view.Window#addContentView(android.view.View, android.view.ViewGroup.LayoutParams) androidWindow.addContenView(newtWindow.getAndroidView(), params)}
     * and finally calls {@link #registerNEWTWindow(Window)}.
-    * </p>  
+    * </p>
     * @param androidWindow
     * @param newtWindow
     * @param params
@@ -151,8 +151,8 @@ public class NewtBaseActivity extends Activity {
            final WindowDriver newtAWindow = (WindowDriver)delegateWindow;
            androidWindow.addContentView(newtAWindow.getAndroidView(), params);
        } else {
-           throw new IllegalArgumentException("Given NEWT Window's Delegate is not an Android Window: "+delegateWindow.getClass().getName()); 
-       }       
+           throw new IllegalArgumentException("Given NEWT Window's Delegate is not an Android Window: "+delegateWindow.getClass().getName());
+       }
        registerNEWTWindow(newtWindow);
    }
    /**
@@ -161,15 +161,15 @@ public class NewtBaseActivity extends Activity {
     * This methods registers the given NEWT window to ensure it's destruction at {@link #onDestroy()}.
     * </p>
     * <p>
-    * If adding a {@link GLAutoDrawable} implementation, the {@link GLAnimatorControl} retrieved by {@link GLAutoDrawable#getAnimator()} 
+    * If adding a {@link GLAutoDrawable} implementation, the {@link GLAnimatorControl} retrieved by {@link GLAutoDrawable#getAnimator()}
     * will be used for {@link #onPause()} and {@link #onResume()}.
     * </p>
     * <p>
-    * If adding a {@link GLAutoDrawable} implementation, the {@link GLEventListenerState} will preserve it's state 
-    * when {@link #onPause()} is being called while not {@link #isFinishing()}. A later {@link #onResume()} will 
+    * If adding a {@link GLAutoDrawable} implementation, the {@link GLEventListenerState} will preserve it's state
+    * when {@link #onPause()} is being called while not {@link #isFinishing()}. A later {@link #onResume()} will
     * reinstate the {@link GLEventListenerState}.
     * </p>
-    * 
+    *
     * @param newtWindow
     * @throws IllegalArgumentException if the <code>newtWindow</code>'s {@link Window#getDelegatedWindow() delegate} is not an AndroidDriver.
     * @see #setContentView(android.view.Window, Window)
@@ -182,8 +182,8 @@ public class NewtBaseActivity extends Activity {
            final WindowDriver newtAWindow = (WindowDriver)delegateWindow;
            newtAWindow.registerActivity(getActivity());
        } else {
-           throw new IllegalArgumentException("Given NEWT Window's Delegate is not an Android Window: "+delegateWindow.getClass().getName()); 
-       }       
+           throw new IllegalArgumentException("Given NEWT Window's Delegate is not an Android Window: "+delegateWindow.getClass().getName());
+       }
        newtWindows.add(newtWindow);
        if(newtWindow instanceof GLAutoDrawable) {
            glAutoDrawables.add((GLAutoDrawable)newtWindow);
@@ -194,29 +194,29 @@ public class NewtBaseActivity extends Activity {
    }
    private final GLStateKeeper.Listener glStateKeeperListener = new GLStateKeeper.Listener() {
        @Override
-       public void glStatePreserveNotify(GLStateKeeper glsk) {
+       public void glStatePreserveNotify(final GLStateKeeper glsk) {
            Log.d(MD.TAG, "GLStateKeeper Preserving: 0x"+Integer.toHexString(glsk.hashCode()));
        }
        @Override
-       public void glStateRestored(GLStateKeeper glsk) {
+       public void glStateRestored(final GLStateKeeper glsk) {
            Log.d(MD.TAG, "GLStateKeeper Restored: 0x"+Integer.toHexString(glsk.hashCode()));
            startAnimation(true);
        }
    };
-   
+
    /**
-    * Convenient method to set the Android window's flags to fullscreen or size-layout depending on the given NEWT window. 
+    * Convenient method to set the Android window's flags to fullscreen or size-layout depending on the given NEWT window.
     * <p>
     * Must be called before creating the view and adding any content, i.e. setContentView() !
     * </p>
     * @param androidWindow
     * @param newtWindow
     */
-   public void layoutForNEWTWindow(android.view.Window androidWindow, Window newtWindow) {
+   public void layoutForNEWTWindow(final android.view.Window androidWindow, final Window newtWindow) {
         if(null == androidWindow || null == newtWindow) {
             throw new IllegalArgumentException("Android or NEWT Window null");
         }
-        
+
         if( newtWindow.isFullscreen() || newtWindow.isUndecorated() ) {
             androidWindow.requestFeature(android.view.Window.FEATURE_NO_TITLE);
         }
@@ -225,27 +225,27 @@ public class NewtBaseActivity extends Activity {
             androidWindow.clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
         } else {
             androidWindow.addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
-            androidWindow.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);                
+            androidWindow.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
         }
-        
-        if(newtWindow.getWidth()>0 && newtWindow.getHeight()>0 && !newtWindow.isFullscreen()) {            
+
+        if(newtWindow.getWidth()>0 && newtWindow.getHeight()>0 && !newtWindow.isFullscreen()) {
             androidWindow.setLayout(newtWindow.getWidth(), newtWindow.getHeight());
-        }       
+        }
    }
 
    /**
-    * Convenient method to set the Android window's flags to fullscreen or size-layout depending on the given NEWT window. 
+    * Convenient method to set the Android window's flags to fullscreen or size-layout depending on the given NEWT window.
     * <p>
     * Must be called before creating the view and adding any content, i.e. setContentView() !
     * </p>
     * @param androidWindow
     * @param newtWindow
     */
-   public void setFullscreenFeature(android.view.Window androidWindow, boolean fullscreen) {
+   public void setFullscreenFeature(final android.view.Window androidWindow, final boolean fullscreen) {
         if(null == androidWindow) {
             throw new IllegalArgumentException("Android or Window null");
         }
-        
+
         if( fullscreen ) {
             androidWindow.requestFeature(android.view.Window.FEATURE_NO_TITLE);
             androidWindow.addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
@@ -255,19 +255,19 @@ public class NewtBaseActivity extends Activity {
             androidWindow.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
         }
    }
-   
+
    /**
-    * Convenient method to set this context's theme to transparency depending on {@link CapabilitiesImmutable#isBackgroundOpaque()}. 
+    * Convenient method to set this context's theme to transparency depending on {@link CapabilitiesImmutable#isBackgroundOpaque()}.
     * <p>
     * Must be called before creating the view and adding any content, i.e. setContentView() !
     * </p>
     */
-   protected void adaptTheme4Transparency(CapabilitiesImmutable caps) {
+   protected void adaptTheme4Transparency(final CapabilitiesImmutable caps) {
         if(!caps.isBackgroundOpaque()) {
             setTransparencyTheme();
         }
    }
-   
+
    /**
     * Convenient method to set this context's theme to transparency.
     * <p>
@@ -279,12 +279,12 @@ public class NewtBaseActivity extends Activity {
     * </p>
     * <p>
     * Can be called only once.
-    * </p>  
+    * </p>
     */
    public void setTransparencyTheme() {
        if(!setThemeCalled) {
            setThemeCalled = true;
-           final Context ctx = getActivity().getApplicationContext();            
+           final Context ctx = getActivity().getApplicationContext();
            final String frn = ctx.getPackageName()+":style/Theme.Transparent";
            final int resID = ctx.getResources().getIdentifier("Theme.Transparent", "style", ctx.getPackageName());
            if(0 == resID) {
@@ -295,27 +295,27 @@ public class NewtBaseActivity extends Activity {
            }
        }
    }
-   
+
    /**
     * Setting up a global {@Link GLAnimatorControl} for {@link #onPause()} and {@link #onResume()}.
     * <p>
     * Note that if adding a {@link GLAutoDrawable} implementation via {@link #registerNEWTWindow(Window)},
     * {@link #setContentView(android.view.Window, Window)} or {@link #addContentView(android.view.Window, Window, android.view.ViewGroup.LayoutParams)}
     * their {@link GLAnimatorControl} retrieved by {@link GLAutoDrawable#getAnimator()} will be used as well.
-    * In this case, using this global {@Link GLAnimatorControl} is redundant. 
+    * In this case, using this global {@Link GLAnimatorControl} is redundant.
     * </p>
     * @see #registerNEWTWindow(Window)
     * @see #setContentView(android.view.Window, Window)
     * @see #addContentView(android.view.Window, Window, android.view.ViewGroup.LayoutParams)
     */
-   public void setAnimator(GLAnimatorControl animator) {
+   public void setAnimator(final GLAnimatorControl animator) {
        this.animator = animator;
        if(!animator.isStarted()) {
            animator.start();
        }
        animator.pause();
    }
-      
+
    @Override
    public android.view.Window getWindow() {
        if( isDelegatedActivity() ) {
@@ -324,22 +324,22 @@ public class NewtBaseActivity extends Activity {
            return super.getWindow();
        }
    }
-   
+
    @Override
-   public void onCreate(Bundle savedInstanceState) {
+   public void onCreate(final Bundle savedInstanceState) {
        Log.d(MD.TAG, "onCreate.0");
        if(!isDelegatedActivity()) {
            super.onCreate(savedInstanceState);
        }
-       // Extraordinary cleanup, for cases of 'onCreate()' calls w/ valid states, 
+       // Extraordinary cleanup, for cases of 'onCreate()' calls w/ valid states,
        // i.e. w/o having onDestroy() being called.
        // Could happened due to spec when App process is killed for memory exhaustion or other reasons.
        cleanup();
-       
+
        jogamp.common.os.android.StaticContext.init(rootActivity.getApplicationContext());
        Log.d(MD.TAG, "onCreate.X");
    }
-   
+
    @Override
    public void onStart() {
      Log.d(MD.TAG, "onStart.0");
@@ -348,7 +348,7 @@ public class NewtBaseActivity extends Activity {
      }
      Log.d(MD.TAG, "onStart.X");
    }
-     
+
    @Override
    public void onRestart() {
      Log.d(MD.TAG, "onRestart.0");
@@ -407,11 +407,11 @@ public class NewtBaseActivity extends Activity {
          win.setVisible(false);
      }
      if( !isDelegatedActivity() ) {
-         super.onStop();  
+         super.onStop();
      }
      Log.d(MD.TAG, "onStop.X");
    }
-   
+
    /**
     * Performs cleaning up all references,
     * <p>
@@ -450,14 +450,14 @@ public class NewtBaseActivity extends Activity {
      jogamp.common.os.android.StaticContext.clear();
      Log.d(MD.TAG, "cleanup.X");
    }
-   
+
    @Override
    public void onDestroy() {
      Log.d(MD.TAG, "onDestroy.0");
      cleanup(); // normal cleanup
      if(!isDelegatedActivity()) {
-         super.onDestroy(); 
+         super.onDestroy();
      }
      Log.d(MD.TAG, "onDestroy.X");
-   }   
+   }
 }
diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java
index 259acb8..4dd96c9 100644
--- a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java
+++ b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivity.java
@@ -33,6 +33,8 @@ import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLProfile;
 
+import jogamp.common.os.PlatformPropsImpl;
+
 import com.jogamp.common.GlueGenVersion;
 import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.VersionUtil;
@@ -49,7 +51,7 @@ import android.widget.TextView;
 public class NewtVersionActivity extends NewtBaseActivity {
 
    @Override
-   public void onCreate(Bundle savedInstanceState) {
+   public void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
 
        setFullscreenFeature(getWindow(), true);
@@ -62,7 +64,7 @@ public class NewtVersionActivity extends NewtBaseActivity {
        scroller.addView(tv);
        viewGroup.addView(scroller, new android.widget.FrameLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, Gravity.TOP|Gravity.LEFT));
 
-       final String info1 = "JOGL Version Info"+Platform.NEWLINE+VersionUtil.getPlatformInfo()+Platform.NEWLINE+GlueGenVersion.getInstance()+Platform.NEWLINE+JoglVersion.getInstance()+Platform.NEWLINE;
+       final String info1 = "JOGL Version Info"+PlatformPropsImpl.NEWLINE+VersionUtil.getPlatformInfo()+PlatformPropsImpl.NEWLINE+GlueGenVersion.getInstance()+PlatformPropsImpl.NEWLINE+JoglVersion.getInstance()+PlatformPropsImpl.NEWLINE;
        Log.d(MD.TAG, info1);
        tv.setText(info1);
 
@@ -77,24 +79,24 @@ public class NewtVersionActivity extends NewtBaseActivity {
        }
        if( null != glp ) {
            // create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
-           GLCapabilities caps = new GLCapabilities(glp);
-           GLWindow glWindow = GLWindow.create(caps);
+           final GLCapabilities caps = new GLCapabilities(glp);
+           final GLWindow glWindow = GLWindow.create(caps);
            glWindow.setUndecorated(true);
            glWindow.setSize(32, 32);
            glWindow.setPosition(0, 0);
            final android.view.View androidGLView = ((WindowDriver)glWindow.getDelegatedWindow()).getAndroidView();
-           viewGroup.addView(androidGLView, new android.widget.FrameLayout.LayoutParams(glWindow.getWidth(), glWindow.getHeight(), Gravity.BOTTOM|Gravity.RIGHT));
+           viewGroup.addView(androidGLView, new android.widget.FrameLayout.LayoutParams(glWindow.getSurfaceWidth(), glWindow.getSurfaceHeight(), Gravity.BOTTOM|Gravity.RIGHT));
            registerNEWTWindow(glWindow);
 
            glWindow.addGLEventListener(new GLEventListener() {
-                public void init(GLAutoDrawable drawable) {
-                    GL gl = drawable.getGL();
+                public void init(final GLAutoDrawable drawable) {
+                    final GL gl = drawable.getGL();
                     final StringBuilder sb = new StringBuilder();
-                    sb.append(JoglVersion.getGLInfo(gl, null, true)).append(Platform.NEWLINE);
-                    sb.append("Requested: ").append(Platform.NEWLINE);
-                    sb.append(drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities()).append(Platform.NEWLINE).append(Platform.NEWLINE);
-                    sb.append("Chosen: ").append(Platform.NEWLINE);
-                    sb.append(drawable.getChosenGLCapabilities()).append(Platform.NEWLINE).append(Platform.NEWLINE);
+                    sb.append(JoglVersion.getGLInfo(gl, null, true)).append(PlatformPropsImpl.NEWLINE);
+                    sb.append("Requested: ").append(PlatformPropsImpl.NEWLINE);
+                    sb.append(drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities()).append(PlatformPropsImpl.NEWLINE).append(PlatformPropsImpl.NEWLINE);
+                    sb.append("Chosen: ").append(PlatformPropsImpl.NEWLINE);
+                    sb.append(drawable.getChosenGLCapabilities()).append(PlatformPropsImpl.NEWLINE).append(PlatformPropsImpl.NEWLINE);
                     final String info2 = sb.toString();
                     // Log.d(MD.TAG, info2); // too big!
                     System.err.println(info2);
@@ -105,13 +107,13 @@ public class NewtVersionActivity extends NewtBaseActivity {
                         } } );
                 }
 
-                public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+                public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
                 }
 
-                public void display(GLAutoDrawable drawable) {
+                public void display(final GLAutoDrawable drawable) {
                 }
 
-                public void dispose(GLAutoDrawable drawable) {
+                public void dispose(final GLAutoDrawable drawable) {
                 }
             });
            glWindow.setVisible(true);
diff --git a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java
index 553900f..190f55e 100644
--- a/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java
+++ b/src/newt/classes/jogamp/newt/driver/android/NewtVersionActivityLauncher.java
@@ -8,7 +8,7 @@ import android.util.Log;
 
 public class NewtVersionActivityLauncher extends Activity {
        @Override
-       public void onCreate(Bundle savedInstanceState) {
+       public void onCreate(final Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
 
            final Uri uri = Uri.parse("launch://jogamp.org/jogamp.newt.driver.android.NewtVersionActivity?sys=com.jogamp.common&sys=javax.media.opengl&pkg=com.jogamp.opengl.test&jogamp.debug=all&nativewindow.debug=all&jogl.debug=all&newt.debug=all");
diff --git a/src/newt/classes/jogamp/newt/driver/android/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/android/ScreenDriver.java
index 6623720..b28cdcb 100644
--- a/src/newt/classes/jogamp/newt/driver/android/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/android/ScreenDriver.java
@@ -60,11 +60,11 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
     protected void closeNativeImpl() { }
 
     @Override
-    protected int validateScreenIndex(int idx) {
+    protected int validateScreenIndex(final int idx) {
         return 0; // FIXME: only one screen available ?
     }
 
-    private final MonitorMode getModeImpl(final Cache cache, final android.view.Display aDisplay, DisplayMetrics outMetrics, int modeIdx, int screenSizeNRot, int nrot) {
+    private final MonitorMode getModeImpl(final Cache cache, final android.view.Display aDisplay, final DisplayMetrics outMetrics, final int modeIdx, final int screenSizeNRot, final int nrot) {
         final int[] props = new int[MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL];
         int i = 0;
         props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
@@ -78,7 +78,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
     }
 
     @Override
-    protected void collectNativeMonitorModesAndDevicesImpl(Cache cache) {
+    protected void collectNativeMonitorModesAndDevicesImpl(final Cache cache) {
         // FIXME: Multi Monitor Implementation missing [for newer Android version ?]
 
         final Context ctx = jogamp.common.os.android.StaticContext.getContext();
@@ -94,7 +94,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
         MonitorMode currentMode = null;
         for(int r=0; r<4; r++) { // for all rotations
             final int nrot_i = r*MonitorMode.ROTATE_90;
-            MonitorMode mode = getModeImpl(cache, aDisplay, outMetrics, modeIdx, 0, nrot_i);
+            final MonitorMode mode = getModeImpl(cache, aDisplay, outMetrics, modeIdx, 0, nrot_i);
             if( nrot == nrot_i ) {
                 currentMode = mode;
             }
@@ -105,15 +105,19 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
         props[i++] = props.length;
         props[i++] = 0; // crt_idx
         i = getScreenSizeMM(outMetrics, props, i); // sizeMM
-        props[i++] = 0; // rotated viewport x
-        props[i++] = 0; // rotated viewport y
-        props[i++] = outMetrics.widthPixels; // rotated viewport width
-        props[i++] = outMetrics.heightPixels; // rotated viewport height
+        props[i++] = 0; // rotated viewport x pixel-units
+        props[i++] = 0; // rotated viewport y pixel-units
+        props[i++] = outMetrics.widthPixels; // rotated viewport width pixel-units
+        props[i++] = outMetrics.heightPixels; // rotated viewport height pixel-units
+        props[i++] = 0; // rotated viewport x window-units
+        props[i++] = 0; // rotated viewport y window-units
+        props[i++] = outMetrics.widthPixels; // rotated viewport width window-units
+        props[i++] = outMetrics.heightPixels; // rotated viewport height window-units
         MonitorModeProps.streamInMonitorDevice(null, cache, this, cache.monitorModes, currentMode, props, 0);
     }
 
     @Override
-    protected MonitorMode queryCurrentMonitorModeImpl(MonitorDevice monitor) {
+    protected MonitorMode queryCurrentMonitorModeImpl(final MonitorDevice monitor) {
         final Context ctx = jogamp.common.os.android.StaticContext.getContext();
         final WindowManager wmgr = (WindowManager) ctx.getSystemService(Context.WINDOW_SERVICE);
         final DisplayMetrics outMetrics = new DisplayMetrics();
@@ -125,14 +129,14 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
     }
 
     @Override
-    protected boolean setCurrentMonitorModeImpl(MonitorDevice monitor, MonitorMode mode) {
+    protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode) {
         return false;
     }
 
     //----------------------------------------------------------------------
     // Internals only
     //
-    static int androidRotation2NewtRotation(int arot) {
+    static int androidRotation2NewtRotation(final int arot) {
         switch(arot) {
             case Surface.ROTATION_270: return MonitorMode.ROTATE_270;
             case Surface.ROTATION_180: return MonitorMode.ROTATE_180;
@@ -141,7 +145,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
         }
         return MonitorMode.ROTATE_0;
     }
-    static int getScreenSize(DisplayMetrics outMetrics, int nrot, int[] props, int offset) {
+    static int getScreenSize(final DisplayMetrics outMetrics, final int nrot, final int[] props, int offset) {
         // swap width and height, since Android reflects rotated dimension, we don't
         if (MonitorMode.ROTATE_90 == nrot || MonitorMode.ROTATE_270 == nrot) {
             props[offset++] = outMetrics.heightPixels;
@@ -152,7 +156,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
         }
         return offset;
     }
-    static int getBpp(android.view.Display aDisplay, int[] props, int offset) {
+    static int getBpp(final android.view.Display aDisplay, final int[] props, int offset) {
         int bpp;
         switch(aDisplay.getPixelFormat()) {
             case PixelFormat.RGBA_8888: bpp=32; break;
@@ -167,7 +171,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
         props[offset++] = bpp;
         return offset;
     }
-    static int getScreenSizeMM(DisplayMetrics outMetrics, int[] props, int offset) {
+    static int getScreenSizeMM(final DisplayMetrics outMetrics, final int[] props, int offset) {
         final float inW = outMetrics.widthPixels / outMetrics.xdpi;
         final float inH = outMetrics.heightPixels / outMetrics.ydpi;
         final float mmpi = 25.4f;
diff --git a/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java
index 9af4554..786ebb3 100644
--- a/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/android/WindowDriver.java
@@ -41,6 +41,7 @@ import javax.media.nativewindow.NativeWindowException;
 import javax.media.nativewindow.VisualIDHolder;
 import javax.media.nativewindow.util.Insets;
 import javax.media.nativewindow.util.Point;
+import javax.media.nativewindow.util.Rectangle;
 import javax.media.nativewindow.util.RectangleImmutable;
 import javax.media.opengl.GLCapabilitiesChooser;
 import javax.media.opengl.GLCapabilitiesImmutable;
@@ -49,12 +50,12 @@ import javax.media.opengl.GLException;
 import com.jogamp.common.os.AndroidVersion;
 import com.jogamp.nativewindow.egl.EGLGraphicsDevice;
 import com.jogamp.newt.MonitorDevice;
+import com.jogamp.newt.Window;
 
 import jogamp.opengl.egl.EGL;
 import jogamp.opengl.egl.EGLDisplayUtil;
 import jogamp.opengl.egl.EGLGraphicsConfiguration;
 import jogamp.opengl.egl.EGLGraphicsConfigurationFactory;
-
 import android.app.Activity;
 import android.content.Context;
 import android.content.Intent;
@@ -87,7 +88,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
      * @param rCaps requested Capabilities
      * @return An Android PixelFormat number suitable for {@link SurfaceHolder#setFormat(int)}.
      */
-    public static final int getSurfaceHolderFormat(CapabilitiesImmutable rCaps) {
+    public static final int getSurfaceHolderFormat(final CapabilitiesImmutable rCaps) {
         int fmt = PixelFormat.UNKNOWN;
 
         if( !rCaps.isBackgroundOpaque() ) {
@@ -121,7 +122,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
      * @param androidPixelFormat An Android PixelFormat delivered via {@link Callback2#surfaceChanged(SurfaceHolder, int, int, int)} params.
      * @return A native Android PixelFormat number suitable for {@link #setSurfaceVisualID0(long, int)}.
      */
-    public static final int getANativeWindowFormat(int androidPixelFormat) {
+    public static final int getANativeWindowFormat(final int androidPixelFormat) {
         final int nativePixelFormat;
         switch(androidPixelFormat) {
             case PixelFormat.RGBA_8888:
@@ -155,8 +156,8 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
      * @param rCaps requested Capabilities
      * @return The fixed Capabilities
      */
-    public static final CapabilitiesImmutable fixCaps(boolean matchFormatPrecise, int format, CapabilitiesImmutable rCaps) {
-        PixelFormat pf = new PixelFormat();
+    public static final CapabilitiesImmutable fixCaps(final boolean matchFormatPrecise, final int format, final CapabilitiesImmutable rCaps) {
+        final PixelFormat pf = new PixelFormat();
         PixelFormat.getPixelFormatInfo(format, pf);
         final CapabilitiesImmutable res;
         int r, g, b, a;
@@ -178,7 +179,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
                                rCaps.getAlphaBits() > a ;
 
         if(change) {
-            Capabilities nCaps = (Capabilities) rCaps.cloneMutable();
+            final Capabilities nCaps = (Capabilities) rCaps.cloneMutable();
             nCaps.setRedBits(r);
             nCaps.setGreenBits(g);
             nCaps.setBlueBits(b);
@@ -194,7 +195,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
         return res;
     }
 
-    public static final boolean isAndroidFormatTransparent(int aFormat) {
+    public static final boolean isAndroidFormatTransparent(final int aFormat) {
         switch (aFormat) {
             case PixelFormat.TRANSLUCENT:
             case PixelFormat.TRANSPARENT:
@@ -211,7 +212,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
         reset();
     }
 
-    public void registerActivity(Activity activity) {
+    public void registerActivity(final Activity activity) {
         this.activity = activity;
     }
     protected Activity activity = null;
@@ -253,7 +254,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
         }
     }
 
-    private final void setupAndroidView(Context ctx) {
+    private final void setupAndroidView(final Context ctx) {
         androidView = new MSurfaceView(ctx);
 
         final SurfaceHolder sh = androidView.getHolder();
@@ -280,15 +281,15 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
     @Override
     protected final boolean canCreateNativeImpl() {
         Log.d(MD.TAG, "canCreateNativeImpl.0: surfaceHandle ready "+(0!=surfaceHandle)+" - on thread "+Thread.currentThread().getName());
-        if(WindowImpl.DEBUG_IMPLEMENTATION) {
+        if(Window.DEBUG_IMPLEMENTATION) {
             Thread.dumpStack();
         }
 
         if( isFullscreen() ) {
             final MonitorDevice mainMonitor = getMainMonitor();
-            final RectangleImmutable viewport = mainMonitor.getViewport();
-            definePosition(viewport.getX(), viewport.getY());
-            defineSize(viewport.getWidth(), viewport.getHeight());
+            final RectangleImmutable winRect = mainMonitor.getViewportInWindowUnits();
+            definePosition(winRect.getX(), winRect.getY());
+            defineSize(winRect.getWidth(), winRect.getHeight());
         }
 
         final boolean b;
@@ -308,7 +309,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
                         Log.d(MD.TAG, "canCreateNativeImpl: added to static ViewGroup - on thread "+Thread.currentThread().getName());
                     } });
                 for(long sleep = TIMEOUT_NATIVEWINDOW; 0<sleep && 0 == surfaceHandle; sleep-=10 ) {
-                    try { Thread.sleep(10); } catch (InterruptedException ie) {}
+                    try { Thread.sleep(10); } catch (final InterruptedException ie) {}
                 }
                 b = 0 != surfaceHandle;
                 Log.d(MD.TAG, "canCreateNativeImpl: surfaceHandle ready(2) "+b+" - on thread "+Thread.currentThread().getName());
@@ -334,7 +335,9 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
         final DefaultGraphicsScreen eglScreen = new DefaultGraphicsScreen(eglDevice, aScreen.getIndex());
 
         Log.d(MD.TAG, "createNativeImpl 0 - eglDevice 0x"+Integer.toHexString(eglDevice.hashCode())+", "+eglDevice+", surfaceHandle 0x"+Long.toHexString(surfaceHandle)+
-                    ", format [a "+androidFormat+", n "+nativeFormat+"], "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+" - on thread "+Thread.currentThread().getName());
+                    ", format [a "+androidFormat+", n "+nativeFormat+"], win["+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+
+                    "], pixel["+getSurfaceWidth()+"x"+getSurfaceHeight()+
+                    "] - on thread "+Thread.currentThread().getName());
 
         if(0!=getParentWindowHandle()) {
             throw new NativeWindowException("Window parenting not supported (yet)");
@@ -379,8 +382,10 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
 
         Log.d(MD.TAG, "closeNativeImpl 0 - eglDevice 0x"+Integer.toHexString(eglDevice.hashCode())+", "+eglDevice+", surfaceHandle 0x"+Long.toHexString(surfaceHandle)+
                     ", eglSurfaceHandle 0x"+Long.toHexString(eglSurface)+
-                    ", format [a "+androidFormat+", n "+nativeFormat+"], "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+" - on thread "+Thread.currentThread().getName());
-        if(WindowImpl.DEBUG_IMPLEMENTATION) {
+                    ", format [a "+androidFormat+", n "+nativeFormat+"], win["+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+
+                    "], pixel["+getSurfaceWidth()+"x"+getSurfaceHeight()+"],"+
+                    " - on thread "+Thread.currentThread().getName());
+        if(Window.DEBUG_IMPLEMENTATION) {
             Thread.dumpStack();
         }
 
@@ -391,7 +396,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
                 if (!EGL.eglDestroySurface(eglDevice.getHandle(), eglSurface)) {
                     throw new GLException("Error destroying window surface (eglDestroySurface)");
                 }
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 Log.d(MD.TAG, "closeNativeImpl: Catch exception "+t.getMessage());
                 t.printStackTrace();
             } finally {
@@ -433,12 +438,12 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
      * {@inheritDoc}
      */
     @Override
-    public final void focusChanged(boolean defer, boolean focusGained) {
+    public final void focusChanged(final boolean defer, final boolean focusGained) {
         super.focusChanged(defer, focusGained);
     }
 
     @Override
-    protected final void requestFocusImpl(boolean reparented) {
+    protected final void requestFocusImpl(final boolean reparented) {
         if(null != androidView) {
             Log.d(MD.TAG, "requestFocusImpl: reparented "+reparented);
             androidView.post(new Runnable() {
@@ -451,7 +456,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
     }
 
     @Override
-    protected final boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
+    protected final boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, final int flags) {
         boolean res = true;
 
         if( 0 != ( FLAG_CHANGE_FULLSCREEN & flags) ) {
@@ -481,12 +486,12 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
     }
 
     @Override
-    protected final Point getLocationOnScreenImpl(int x, int y) {
+    protected final Point getLocationOnScreenImpl(final int x, final int y) {
         return new Point(x,y);
     }
 
     @Override
-    protected final void updateInsetsImpl(Insets insets) {
+    protected final void updateInsetsImpl(final Insets insets) {
         // nop ..
     }
 
@@ -500,7 +505,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
         }
 
         @Override
-        public void onReceiveResult(int r, Bundle data) {
+        public void onReceiveResult(final int r, final Bundle data) {
             boolean v = false;
 
             switch(r) {
@@ -520,7 +525,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
     private final KeyboardVisibleReceiver keyboardVisibleReceiver = new KeyboardVisibleReceiver();
 
     @Override
-    protected final boolean setKeyboardVisibleImpl(boolean visible) {
+    protected final boolean setKeyboardVisibleImpl(final boolean visible) {
         if(null != androidView) {
             final InputMethodManager imm = (InputMethodManager) getAndroidView().getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
             final IBinder winid = getAndroidView().getWindowToken();
@@ -543,14 +548,15 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
     //
 
     @Override
-    public final void surfaceCreated(SurfaceHolder holder) {
-        Log.d(MD.TAG, "surfaceCreated: "+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+" - on thread "+Thread.currentThread().getName());
+    public final void surfaceCreated(final SurfaceHolder holder) {
+        Log.d(MD.TAG, "surfaceCreated: win["+getX()+"/"+getY()+" "+getWidth()+"x"+getHeight()+
+                      "], pixels["+" "+getSurfaceWidth()+"x"+getSurfaceHeight()+"] - on thread "+Thread.currentThread().getName());
     }
 
     @Override
-    public final void surfaceChanged(SurfaceHolder aHolder, int aFormat, int aWidth, int aHeight) {
+    public final void surfaceChanged(final SurfaceHolder aHolder, final int aFormat, final int aWidth, final int aHeight) {
         Log.d(MD.TAG, "surfaceChanged: f "+nativeFormat+" -> "+aFormat+", "+aWidth+"x"+aHeight+", current surfaceHandle: 0x"+Long.toHexString(surfaceHandle)+" - on thread "+Thread.currentThread().getName());
-        if(WindowImpl.DEBUG_IMPLEMENTATION) {
+        if(Window.DEBUG_IMPLEMENTATION) {
             Thread.dumpStack();
         }
         if(0!=surfaceHandle && androidFormat != aFormat ) {
@@ -582,15 +588,15 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
             nativeFormat = getSurfaceVisualID0(surfaceHandle);
             Log.d(MD.TAG, "surfaceChanged: androidFormat "+androidFormat+" -- (set-native "+aNativeWindowFormat+") --> nativeFormat "+nativeFormat);
 
-            final int nWidth = getWidth0(surfaceHandle);
-            final int nHeight = getHeight0(surfaceHandle);
+            final int[] newSurfSize = { getWidth0(surfaceHandle), getHeight0(surfaceHandle) };
+            final int[] newWinSize = convertToWindowUnits(new int[]{ newSurfSize[0], newSurfSize[1] }); // HiDPI: Not necessary yet ..
             capsByFormat = (GLCapabilitiesImmutable) fixCaps(true /* matchFormatPrecise */, nativeFormat, getRequestedCapabilities());
-            sizeChanged(false, nWidth, nHeight, false);
+            sizeChanged(false, newWinSize[0], newWinSize[1], false);
 
             Log.d(MD.TAG, "surfaceRealized: isValid: "+surface.isValid()+
                           ", new surfaceHandle 0x"+Long.toHexString(surfaceHandle)+
-                          ", format [a "+androidFormat+"/n "+nativeFormat+"], "+
-                          getX()+"/"+getY()+" "+nWidth+"x"+nHeight+", visible: "+isVisible());
+                          ", format [a "+androidFormat+"/n "+nativeFormat+"], win["+
+                          getX()+"/"+getY()+" "+newWinSize[0]+"x"+newWinSize[1]+"], pixel["+newSurfSize[0]+"x"+newSurfSize[1]+"], visible: "+isVisible());
 
             if(isVisible()) {
                setVisible(false, true);
@@ -602,19 +608,19 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
     }
 
     @Override
-    public final void surfaceDestroyed(SurfaceHolder holder) {
+    public final void surfaceDestroyed(final SurfaceHolder holder) {
         Log.d(MD.TAG, "surfaceDestroyed - on thread "+Thread.currentThread().getName());
         windowDestroyNotify(true); // actually too late .. however ..
         Thread.dumpStack();
     }
 
     @Override
-    public final void surfaceRedrawNeeded(SurfaceHolder holder) {
+    public final void surfaceRedrawNeeded(final SurfaceHolder holder) {
         Log.d(MD.TAG, "surfaceRedrawNeeded  - on thread "+Thread.currentThread().getName());
-        windowRepaint(0, 0, getWidth(), getHeight());
+        windowRepaint(0, 0, getSurfaceWidth(), getSurfaceHeight());
     }
 
-    protected boolean handleKeyCodeBack(KeyEvent.DispatcherState state, android.view.KeyEvent event) {
+    protected boolean handleKeyCodeBack(final KeyEvent.DispatcherState state, final android.view.KeyEvent event) {
         if (event.getAction() == KeyEvent.ACTION_DOWN && event.getRepeatCount() == 0) {
             Log.d(MD.TAG, "handleKeyCodeBack.0 : "+event);
             state.startTracking(event, this);
@@ -641,7 +647,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
         }
         return false; // continue w/ further processing
     }
-    private void enqueueAKey2NKeyUpDown(android.view.KeyEvent aEvent, short newtKeyCode) {
+    private void enqueueAKey2NKeyUpDown(final android.view.KeyEvent aEvent, final short newtKeyCode) {
         final com.jogamp.newt.event.KeyEvent eDown = AndroidNewtEventFactory.createKeyEvent(aEvent, newtKeyCode, com.jogamp.newt.event.KeyEvent.EVENT_KEY_PRESSED, this);
         final com.jogamp.newt.event.KeyEvent eUp = AndroidNewtEventFactory.createKeyEvent(aEvent, newtKeyCode, com.jogamp.newt.event.KeyEvent.EVENT_KEY_RELEASED, this);
         enqueueEvent(false, eDown);
@@ -649,7 +655,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
     }
 
     @Override
-    protected void consumeKeyEvent(com.jogamp.newt.event.KeyEvent e) {
+    protected void consumeKeyEvent(final com.jogamp.newt.event.KeyEvent e) {
         super.consumeKeyEvent(e); // consume event, i.e. call all KeyListener
         if( com.jogamp.newt.event.KeyEvent.EVENT_KEY_RELEASED == e.getEventType() && !e.isConsumed() ) {
             if( com.jogamp.newt.event.KeyEvent.VK_ESCAPE == e.getKeyCode() ) {
@@ -662,11 +668,11 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
         }
     }
     private void triggerHome() {
-       Context ctx = StaticContext.getContext();
+       final Context ctx = StaticContext.getContext();
        if(null == ctx) {
            throw new NativeWindowException("No static [Application] Context has been set. Call StaticContext.setContext(Context) first.");
        }
-       Intent showOptions = new Intent(Intent.ACTION_MAIN);
+       final Intent showOptions = new Intent(Intent.ACTION_MAIN);
        showOptions.addCategory(Intent.CATEGORY_HOME);
        ctx.startActivity(showOptions);
     }
@@ -681,14 +687,14 @@ public class WindowDriver extends jogamp.newt.WindowImpl implements Callback2 {
     private long eglSurface;
 
     class MSurfaceView extends SurfaceView {
-        public MSurfaceView (Context ctx) {
+        public MSurfaceView (final Context ctx) {
             super(ctx);
             setBackgroundDrawable(null);
             // setBackgroundColor(Color.TRANSPARENT);
         }
 
         @Override
-        public boolean onKeyPreIme(int keyCode, KeyEvent event) {
+        public boolean onKeyPreIme(final int keyCode, final KeyEvent event) {
             Log.d(MD.TAG, "onKeyPreIme : "+event);
             if ( event.getKeyCode() == KeyEvent.KEYCODE_BACK ) {
                 final KeyEvent.DispatcherState state = getKeyDispatcherState();
diff --git a/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java b/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java
index e5d667f..579edc5 100644
--- a/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java
+++ b/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventFactory.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package jogamp.newt.driver.android.event;
 
 import jogamp.newt.Debug;
@@ -39,11 +39,11 @@ import com.jogamp.newt.event.NEWTEvent;
 public class AndroidNewtEventFactory {
     private static final boolean DEBUG_MOUSE_EVENT = Debug.debug("Android.MouseEvent");
     private static final boolean DEBUG_KEY_EVENT = Debug.debug("Android.KeyEvent");
-    
+
     /** API Level 12: {@link android.view.MotionEvent#ACTION_SCROLL} = {@value} */
     private static final int ACTION_SCROLL = 8;
 
-    private static final com.jogamp.newt.event.MouseEvent.PointerType aToolType2PointerType(int aToolType) {
+    private static final com.jogamp.newt.event.MouseEvent.PointerType aToolType2PointerType(final int aToolType) {
         switch( aToolType ) {
             case MotionEvent.TOOL_TYPE_FINGER:
                 return com.jogamp.newt.event.MouseEvent.PointerType.TouchScreen;
@@ -53,43 +53,43 @@ public class AndroidNewtEventFactory {
             case MotionEvent.TOOL_TYPE_ERASER:
                 return com.jogamp.newt.event.MouseEvent.PointerType.Pen;
             default:
-                return com.jogamp.newt.event.MouseEvent.PointerType.Undefined;       
+                return com.jogamp.newt.event.MouseEvent.PointerType.Undefined;
         }
     }
-    
-    private static final short aMotionEventType2Newt(int aType) {
+
+    private static final short aMotionEventType2Newt(final int aType) {
         switch( aType ) {
-            case android.view.MotionEvent.ACTION_DOWN: 
-            case android.view.MotionEvent.ACTION_POINTER_DOWN: 
-                return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_PRESSED; 
-            case android.view.MotionEvent.ACTION_UP: 
-            case android.view.MotionEvent.ACTION_POINTER_UP: 
-            case android.view.MotionEvent.ACTION_CANCEL: 
-                return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_RELEASED; 
-            case android.view.MotionEvent.ACTION_MOVE: 
-                return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_DRAGGED; 
-            case android.view.MotionEvent.ACTION_OUTSIDE: 
-                return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_MOVED; 
+            case android.view.MotionEvent.ACTION_DOWN:
+            case android.view.MotionEvent.ACTION_POINTER_DOWN:
+                return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_PRESSED;
+            case android.view.MotionEvent.ACTION_UP:
+            case android.view.MotionEvent.ACTION_POINTER_UP:
+            case android.view.MotionEvent.ACTION_CANCEL:
+                return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_RELEASED;
+            case android.view.MotionEvent.ACTION_MOVE:
+                return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_DRAGGED;
+            case android.view.MotionEvent.ACTION_OUTSIDE:
+                return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_MOVED;
             // case ACTION_HOVER_MOVE
             case ACTION_SCROLL:  // API Level 12 !
-                return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_WHEEL_MOVED; 
+                return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_WHEEL_MOVED;
             // case ACTION_HOVER_ENTER
             // case ACTION_HOVER_EXIT
         }
         return (short)0;
     }
-    
-    private static final short aAccessibilityEventType2Newt(int aType) {
+
+    private static final short aAccessibilityEventType2Newt(final int aType) {
         switch( aType ) {
-            case android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED: 
+            case android.view.accessibility.AccessibilityEvent.TYPE_VIEW_FOCUSED:
                 return com.jogamp.newt.event.WindowEvent.EVENT_WINDOW_GAINED_FOCUS;
         }
         return (short)0;
     }
 
-    private static final short aKeyEventType2NewtEventType(int androidKeyAction) {
+    private static final short aKeyEventType2NewtEventType(final int androidKeyAction) {
         switch(androidKeyAction) {
-            case android.view.KeyEvent.ACTION_DOWN: 
+            case android.view.KeyEvent.ACTION_DOWN:
             case android.view.KeyEvent.ACTION_MULTIPLE:
                 return com.jogamp.newt.event.KeyEvent.EVENT_KEY_PRESSED;
             case android.view.KeyEvent.ACTION_UP:
@@ -97,22 +97,22 @@ public class AndroidNewtEventFactory {
         }
         return (short)0;
     }
-    
-    private static final short aKeyCode2NewtKeyCode(int androidKeyCode, boolean inclSysKeys) {
+
+    private static final short aKeyCode2NewtKeyCode(final int androidKeyCode, final boolean inclSysKeys) {
         if(android.view.KeyEvent.KEYCODE_0 <= androidKeyCode && androidKeyCode <= android.view.KeyEvent.KEYCODE_9) {
-            return (short) ( com.jogamp.newt.event.KeyEvent.VK_0 + ( androidKeyCode - android.view.KeyEvent.KEYCODE_0 ) ); 
+            return (short) ( com.jogamp.newt.event.KeyEvent.VK_0 + ( androidKeyCode - android.view.KeyEvent.KEYCODE_0 ) );
         }
         if(android.view.KeyEvent.KEYCODE_A <= androidKeyCode && androidKeyCode <= android.view.KeyEvent.KEYCODE_Z) {
-            return (short) ( com.jogamp.newt.event.KeyEvent.VK_A + ( androidKeyCode - android.view.KeyEvent.KEYCODE_A ) ); 
+            return (short) ( com.jogamp.newt.event.KeyEvent.VK_A + ( androidKeyCode - android.view.KeyEvent.KEYCODE_A ) );
         }
         if(android.view.KeyEvent.KEYCODE_F1 <= androidKeyCode && androidKeyCode <= android.view.KeyEvent.KEYCODE_F12) {
-            return (short) ( com.jogamp.newt.event.KeyEvent.VK_F1 + ( androidKeyCode - android.view.KeyEvent.KEYCODE_F1 ) ); 
+            return (short) ( com.jogamp.newt.event.KeyEvent.VK_F1 + ( androidKeyCode - android.view.KeyEvent.KEYCODE_F1 ) );
         }
         if(android.view.KeyEvent.KEYCODE_NUMPAD_0 <= androidKeyCode && androidKeyCode <= android.view.KeyEvent.KEYCODE_NUMPAD_9) {
-            return (short) ( com.jogamp.newt.event.KeyEvent.VK_NUMPAD0 + ( androidKeyCode - android.view.KeyEvent.KEYCODE_NUMPAD_0 ) ); 
-        }           
+            return (short) ( com.jogamp.newt.event.KeyEvent.VK_NUMPAD0 + ( androidKeyCode - android.view.KeyEvent.KEYCODE_NUMPAD_0 ) );
+        }
         switch(androidKeyCode) {
-            case android.view.KeyEvent.KEYCODE_COMMA: return com.jogamp.newt.event.KeyEvent.VK_COMMA; 
+            case android.view.KeyEvent.KEYCODE_COMMA: return com.jogamp.newt.event.KeyEvent.VK_COMMA;
             case android.view.KeyEvent.KEYCODE_PERIOD: return com.jogamp.newt.event.KeyEvent.VK_PERIOD;
             case android.view.KeyEvent.KEYCODE_ALT_LEFT: return com.jogamp.newt.event.KeyEvent.VK_ALT;
             case android.view.KeyEvent.KEYCODE_ALT_RIGHT: return com.jogamp.newt.event.KeyEvent.VK_ALT_GRAPH;
@@ -137,7 +137,7 @@ public class AndroidNewtEventFactory {
             case android.view.KeyEvent.KEYCODE_ESCAPE: return com.jogamp.newt.event.KeyEvent.VK_ESCAPE;
             case android.view.KeyEvent.KEYCODE_CTRL_LEFT: return com.jogamp.newt.event.KeyEvent.VK_CONTROL;
             case android.view.KeyEvent.KEYCODE_CTRL_RIGHT: return com.jogamp.newt.event.KeyEvent.VK_CONTROL; // ??
-            case android.view.KeyEvent.KEYCODE_BACK: 
+            case android.view.KeyEvent.KEYCODE_BACK:
                 if( inclSysKeys ) {
                     // Note that manual mapping is performed, based on the keyboard state.
                     // I.e. we map to VK_KEYBOARD_INVISIBLE if keyboard was visible and now becomes invisible!
@@ -152,33 +152,33 @@ public class AndroidNewtEventFactory {
                     return com.jogamp.newt.event.KeyEvent.VK_HOME;
                 }
                 break;
-        }        
+        }
         return com.jogamp.newt.event.KeyEvent.VK_UNDEFINED;
     }
-    
-    private static final int aKeyModifiers2Newt(int androidMods) {
+
+    private static final int aKeyModifiers2Newt(final int androidMods) {
         int newtMods = 0;
         if ((androidMods & android.view.KeyEvent.META_SYM_ON)   != 0)   newtMods |= com.jogamp.newt.event.InputEvent.META_MASK;
         if ((androidMods & android.view.KeyEvent.META_SHIFT_ON) != 0)   newtMods |= com.jogamp.newt.event.InputEvent.SHIFT_MASK;
         if ((androidMods & android.view.KeyEvent.META_ALT_ON)   != 0)   newtMods |= com.jogamp.newt.event.InputEvent.ALT_MASK;
-        
+
         return newtMods;
     }
-    
-    public static com.jogamp.newt.event.WindowEvent createWindowEvent(android.view.accessibility.AccessibilityEvent event, com.jogamp.newt.Window newtSource) {
+
+    public static com.jogamp.newt.event.WindowEvent createWindowEvent(final android.view.accessibility.AccessibilityEvent event, final com.jogamp.newt.Window newtSource) {
         final int aType = event.getEventType();
         final short nType = aAccessibilityEventType2Newt(aType);
-        
+
         if( (short)0 != nType) {
             return new com.jogamp.newt.event.WindowEvent(nType, ((null==newtSource)?null:(Object)newtSource), event.getEventTime());
         }
         return null; // no mapping ..
     }
 
-    
-    public static com.jogamp.newt.event.KeyEvent createKeyEvent(android.view.KeyEvent aEvent, com.jogamp.newt.Window newtSource, boolean inclSysKeys) {
+
+    public static com.jogamp.newt.event.KeyEvent createKeyEvent(final android.view.KeyEvent aEvent, final com.jogamp.newt.Window newtSource, final boolean inclSysKeys) {
         final com.jogamp.newt.event.KeyEvent res;
-        final short newtType = aKeyEventType2NewtEventType(aEvent.getAction());        
+        final short newtType = aKeyEventType2NewtEventType(aEvent.getAction());
         if( (short)0 != newtType) {
             final short newtKeyCode = aKeyCode2NewtKeyCode(aEvent.getKeyCode(), inclSysKeys);
             res = createKeyEventImpl(aEvent, newtType, newtKeyCode, newtSource);
@@ -191,7 +191,7 @@ public class AndroidNewtEventFactory {
         return res;
     }
 
-    public static com.jogamp.newt.event.KeyEvent createKeyEvent(android.view.KeyEvent aEvent, short newtType, com.jogamp.newt.Window newtSource, boolean inclSysKeys) {
+    public static com.jogamp.newt.event.KeyEvent createKeyEvent(final android.view.KeyEvent aEvent, final short newtType, final com.jogamp.newt.Window newtSource, final boolean inclSysKeys) {
         final short newtKeyCode = aKeyCode2NewtKeyCode(aEvent.getKeyCode(), inclSysKeys);
         final com.jogamp.newt.event.KeyEvent res = createKeyEventImpl(aEvent, newtType, newtKeyCode, newtSource);
         if(DEBUG_KEY_EVENT) {
@@ -199,29 +199,29 @@ public class AndroidNewtEventFactory {
         }
         return res;
     }
-    
-    public static com.jogamp.newt.event.KeyEvent createKeyEvent(android.view.KeyEvent aEvent, short newtKeyCode, short newtType, com.jogamp.newt.Window newtSource) {
+
+    public static com.jogamp.newt.event.KeyEvent createKeyEvent(final android.view.KeyEvent aEvent, final short newtKeyCode, final short newtType, final com.jogamp.newt.Window newtSource) {
         final com.jogamp.newt.event.KeyEvent res = createKeyEventImpl(aEvent, newtType, newtKeyCode, newtSource);
         if(DEBUG_KEY_EVENT) {
             System.err.println("createKeyEvent2: newtType "+NEWTEvent.toHexString(newtType)+", "+aEvent+" -> "+res);
         }
         return res;
     }
-    
-    private static com.jogamp.newt.event.KeyEvent createKeyEventImpl(android.view.KeyEvent aEvent, short newtType, short newtKeyCode, com.jogamp.newt.Window newtSource) {
+
+    private static com.jogamp.newt.event.KeyEvent createKeyEventImpl(final android.view.KeyEvent aEvent, final short newtType, final short newtKeyCode, final com.jogamp.newt.Window newtSource) {
         if( (short)0 != newtType && com.jogamp.newt.event.KeyEvent.VK_UNDEFINED != newtKeyCode ) {
             final Object src = null==newtSource ? null : newtSource;
             final long unixTime = System.currentTimeMillis() + ( aEvent.getEventTime() - android.os.SystemClock.uptimeMillis() );
             final int newtMods = aKeyModifiers2Newt(aEvent.getMetaState());
-            
+
             return com.jogamp.newt.event.KeyEvent.create(
                                 newtType, src, unixTime, newtMods, newtKeyCode, newtKeyCode, (char) aEvent.getUnicodeChar());
         }
         return null;
     }
-    
+
     private static float maxPressure = 0.7f; // experienced maximum value (Amazon HD = 0.8f)
-    
+
     /**
      * Dynamic calibration of maximum MotionEvent pressure, starting from 0.7f
      * <p>
@@ -235,49 +235,51 @@ public class AndroidNewtEventFactory {
      *   <li>Amazon HD: Pressure always ≤ 0.8f</li>
      * </ul>
      * </p>
-     *   
+     *
      * @return
      */
     public static float getMaxPressure() {
         return maxPressure;
     }
-    
-    private final int touchSlop; 
-    public AndroidNewtEventFactory(android.content.Context context, android.os.Handler handler) {
+
+    private final int touchSlop;
+    public AndroidNewtEventFactory(final android.content.Context context, final android.os.Handler handler) {
         final android.view.ViewConfiguration configuration = android.view.ViewConfiguration.get(context);
         touchSlop = configuration.getScaledTouchSlop();
         final int doubleTapSlop = configuration.getScaledDoubleTapSlop();
         if(DEBUG_MOUSE_EVENT) {
-            System.err.println("AndroidNewtEventFactory    scrollSlop (scaled) "+touchSlop);                               
-            System.err.println("AndroidNewtEventFactory doubleTapSlop (scaled) "+doubleTapSlop);                               
-        }        
+            System.err.println("AndroidNewtEventFactory    scrollSlop (scaled) "+touchSlop);
+            System.err.println("AndroidNewtEventFactory doubleTapSlop (scaled) "+doubleTapSlop);
+        }
     }
-            
-    private static void collectPointerData(MotionEvent e, int idx, final int[] x, final int[] y, final float[] pressure, 
+
+    private static void collectPointerData(final MotionEvent e, final int count, final int[] x, final int[] y, final float[] pressure,
                                            final short[] pointerIds, final MouseEvent.PointerType[] pointerTypes) {
-        x[idx] = (int)e.getX(idx);
-        y[idx] = (int)e.getY(idx);
-        pressure[idx] = e.getPressure(idx);
-        pointerIds[idx] = (short)e.getPointerId(idx);
-        if( pressure[idx] > maxPressure ) {
-            maxPressure = pressure[idx];
-        }
-        pointerTypes[idx] = aToolType2PointerType( e.getToolType(idx) );   
-        if(DEBUG_MOUSE_EVENT) {
-            System.err.println("createMouseEvent: ptr-data["+idx+"] "+x[idx]+"/"+y[idx]+", pressure "+pressure[idx]+", id "+pointerIds[idx]+", type "+pointerTypes[idx]);
+        for(int i=0; i < count; i++) {
+            x[i] = (int)e.getX(i);
+            y[i] = (int)e.getY(i);
+            pressure[i] = e.getPressure(i);
+            pointerIds[i] = (short)e.getPointerId(i);
+            if( pressure[i] > maxPressure ) {
+                maxPressure = pressure[i];
+            }
+            pointerTypes[i] = aToolType2PointerType( e.getToolType(i) );
+            if(DEBUG_MOUSE_EVENT) {
+                System.err.println("createMouseEvent: ptr-data["+i+"] "+x[i]+"/"+y[i]+", pressure "+pressure[i]+", id "+pointerIds[i]+", type "+pointerTypes[i]);
+            }
         }
     }
-    
-    public boolean sendPointerEvent(boolean enqueue, boolean wait, boolean setFocusOnDown, boolean isOnTouchEvent, 
-                                    android.view.MotionEvent event, jogamp.newt.driver.android.WindowDriver newtSource) {
+
+    public boolean sendPointerEvent(final boolean enqueue, final boolean wait, final boolean setFocusOnDown, final boolean isOnTouchEvent,
+                                    final android.view.MotionEvent event, final jogamp.newt.driver.android.WindowDriver newtSource) {
         if(DEBUG_MOUSE_EVENT) {
-            System.err.println("createMouseEvent: isOnTouchEvent "+isOnTouchEvent+", "+event);                               
+            System.err.println("createMouseEvent: isOnTouchEvent "+isOnTouchEvent+", "+event);
         }
 
         if( event.getPressure() > maxPressure ) {
-            maxPressure = event.getPressure();
+            maxPressure = event.getPressure(); // write to static field intended
         }
-        
+
         //
         // Prefilter Android Event (Gesture, ..) and determine final type
         //
@@ -285,10 +287,10 @@ public class AndroidNewtEventFactory {
         final short nType = aMotionEventType2Newt(aType);
         final float rotationScale = touchSlop;
         final float[] rotationXYZ = new float[] { 0f, 0f, 0f };
-        
-        if( (short)0 != nType ) {            
+
+        if( (short)0 != nType ) {
             int modifiers = 0;
-            
+
             //
             // Determine SDK 12 SCROLL, newt-button and whether dedicated pointer is pressed
             //
@@ -306,33 +308,33 @@ public class AndroidNewtEventFactory {
                         }
                     }
                     break;
-                    
+
                 case ACTION_SCROLL:
                     if( AndroidVersion.SDK_INT >= 12 ) { // API Level 12
                         rotationXYZ[0] = event.getAxisValue(android.view.MotionEvent.AXIS_X) / rotationScale;
                         rotationXYZ[1] = event.getAxisValue(android.view.MotionEvent.AXIS_Y) / rotationScale;
-        
+
                         if( rotationXYZ[0]*rotationXYZ[0] > rotationXYZ[1]*rotationXYZ[1] ) {
                             // Horizontal
                             modifiers |= com.jogamp.newt.event.InputEvent.SHIFT_MASK;
                         }
                         if(DEBUG_MOUSE_EVENT) {
                             System.err.println("createMouseEvent: SDK-12 Scroll "+rotationXYZ[0]+"/"+rotationXYZ[1]+", "+rotationScale+", mods "+modifiers);
-                        }      
+                        }
                     }
                     // Fall through intended!
-                    
+
                 default: {
                         pIndex = 0;
                         button = com.jogamp.newt.event.MouseEvent.BUTTON1;
                     }
             }
             final int pCount = event.getPointerCount(); // all
-            
+
             switch( aType ) {
                 case android.view.MotionEvent.ACTION_DOWN:
-                case android.view.MotionEvent.ACTION_POINTER_DOWN:            
-                    modifiers |= InputEvent.getButtonMask(button);
+                case android.view.MotionEvent.ACTION_POINTER_DOWN:
+                    // modifier button-mask will be set on doPointerEvent(..)
                     if( setFocusOnDown ) {
                         newtSource.focusChanged(false, true);
                     }
@@ -350,12 +352,10 @@ public class AndroidNewtEventFactory {
                 if(DEBUG_MOUSE_EVENT) {
                     System.err.println("createMouseEvent: collect ptr-data [0.."+(pCount-1)+", count "+pCount+", action "+pIndex+"], aType "+aType+", button "+button);
                 }
-                for(int i=0; i < pCount; i++) {
-                    collectPointerData(event, i, x, y, pressure, pointerIds, pointerTypes);
-                }
+                collectPointerData(event, pCount, x, y, pressure, pointerIds, pointerTypes);
             }
             newtSource.doPointerEvent(enqueue, wait, pointerTypes, nType, modifiers,
-                                      pIndex, pointerIds, x, y, pressure, maxPressure, rotationXYZ, rotationScale);
+                                      pIndex, pointerIds, button, x, y, pressure, maxPressure, rotationXYZ, rotationScale);
             return true;
         }
         return false; // no mapping ..
diff --git a/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventTranslator.java b/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventTranslator.java
index 5a4743f..8d20ef4 100644
--- a/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventTranslator.java
+++ b/src/newt/classes/jogamp/newt/driver/android/event/AndroidNewtEventTranslator.java
@@ -6,35 +6,35 @@ import android.view.View;
 public class AndroidNewtEventTranslator implements View.OnKeyListener, View.OnTouchListener, View.OnFocusChangeListener, View.OnGenericMotionListener {
         private final WindowDriver newtWindow;
         private final AndroidNewtEventFactory factory;
-        
-        public AndroidNewtEventTranslator(WindowDriver newtWindow, android.content.Context context, android.os.Handler handler) {
+
+        public AndroidNewtEventTranslator(final WindowDriver newtWindow, final android.content.Context context, final android.os.Handler handler) {
             this.newtWindow = newtWindow;
-            this.factory = new AndroidNewtEventFactory(context, handler); 
+            this.factory = new AndroidNewtEventFactory(context, handler);
         }
-        
-        private final boolean processTouchMotionEvents(View v, android.view.MotionEvent event, boolean isOnTouchEvent) {
-            final boolean eventSent = factory.sendPointerEvent(true /*enqueue*/, false /*wait*/, true /*setFocusOnDown*/, 
+
+        private final boolean processTouchMotionEvents(final View v, final android.view.MotionEvent event, final boolean isOnTouchEvent) {
+            final boolean eventSent = factory.sendPointerEvent(true /*enqueue*/, false /*wait*/, true /*setFocusOnDown*/,
                                                                isOnTouchEvent, event, newtWindow);
             if( eventSent ) {
                 try { Thread.sleep((long) (100.0F/3.0F)); } // 33 ms - FIXME ??
-                catch(InterruptedException e) { }
+                catch(final InterruptedException e) { }
                 return true; // consumed/handled, further interest in events
             }
-            return false; // no mapping, no further interest in the event!            
+            return false; // no mapping, no further interest in the event!
         }
-        
+
         @Override
-        public boolean onTouch(View v, android.view.MotionEvent event) {
+        public boolean onTouch(final View v, final android.view.MotionEvent event) {
             return processTouchMotionEvents(v, event, true);
         }
 
         @Override
-        public boolean onGenericMotion(View v, android.view.MotionEvent event) {
+        public boolean onGenericMotion(final View v, final android.view.MotionEvent event) {
             return processTouchMotionEvents(v, event, false);
         }
-        
+
         @Override
-        public boolean onKey(View v, int keyCode, android.view.KeyEvent event) {
+        public boolean onKey(final View v, final int keyCode, final android.view.KeyEvent event) {
             final com.jogamp.newt.event.KeyEvent newtEvent = AndroidNewtEventFactory.createKeyEvent(event, newtWindow, false /* no system keys */);
             if(null != newtEvent) {
                 newtWindow.enqueueEvent(false, newtEvent);
@@ -42,9 +42,9 @@ public class AndroidNewtEventTranslator implements View.OnKeyListener, View.OnTo
             }
             return false;
         }
-        
+
         @Override
-        public void onFocusChange(View v, boolean hasFocus) {
+        public void onFocusChange(final View v, final boolean hasFocus) {
             newtWindow.focusChanged(false, hasFocus);
         }
 }
diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
index f7722c9..eccdd63 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/AWTCanvas.java
@@ -65,11 +65,17 @@ public class AWTCanvas extends Canvas {
   private AWTGraphicsConfiguration awtConfig;
   private volatile JAWTWindow jawtWindow=null; // the JAWTWindow presentation of this AWT Canvas, bound to the 'drawable' lifecycle
   private CapabilitiesChooser chooser=null;
-  private CapabilitiesImmutable capabilities;
+  private final CapabilitiesImmutable capabilities;
+  private final UpstreamScalable upstreamScale;
+
+  public static interface UpstreamScalable {
+      int[] getReqPixelScale();
+      void setHasPixelScale(final int[] pixelScale);
+  }
 
   private boolean displayConfigChanged=false;
 
-  public AWTCanvas(CapabilitiesImmutable capabilities, CapabilitiesChooser chooser) {
+  public AWTCanvas(final CapabilitiesImmutable capabilities, final CapabilitiesChooser chooser, final UpstreamScalable upstreamScale) {
     super();
 
     if(null==capabilities) {
@@ -77,6 +83,7 @@ public class AWTCanvas extends Canvas {
     }
     this.capabilities=capabilities;
     this.chooser=chooser;
+    this.upstreamScale = upstreamScale;
   }
 
   public AWTGraphicsConfiguration getAWTGraphicsConfiguration() {
@@ -88,7 +95,7 @@ public class AWTCanvas extends Canvas {
    * canvas from interfering with the OpenGL rendering.
    */
   @Override
-  public void update(Graphics g) {
+  public void update(final Graphics g) {
     // paint(g);
   }
 
@@ -98,11 +105,11 @@ public class AWTCanvas extends Canvas {
       properly.
    */
   @Override
-  public void paint(Graphics g) {
+  public void paint(final Graphics g) {
   }
 
   public boolean hasDeviceChanged() {
-    boolean res = displayConfigChanged;
+    final boolean res = displayConfigChanged;
     displayConfigChanged=false;
     return res;
   }
@@ -139,11 +146,13 @@ public class AWTCanvas extends Canvas {
     {
         jawtWindow = (JAWTWindow) NativeWindowFactory.getNativeWindow(this, awtConfig);
         // trigger initialization cycle
+        jawtWindow.setSurfaceScale(upstreamScale.getReqPixelScale() );
         jawtWindow.lockSurface();
+        upstreamScale.setHasPixelScale(jawtWindow.getCurrentSurfaceScale(new int[2]));
         jawtWindow.unlockSurface();
     }
 
-    GraphicsConfiguration gc = super.getGraphicsConfiguration();
+    final GraphicsConfiguration gc = super.getGraphicsConfiguration();
     if(null!=gc) {
         device = gc.getDevice();
     }
@@ -179,12 +188,12 @@ public class AWTCanvas extends Canvas {
         jawtWindow=null;
     }
     if(null != awtConfig) {
-        AbstractGraphicsDevice adevice = awtConfig.getNativeGraphicsConfiguration().getScreen().getDevice();
+        final AbstractGraphicsDevice adevice = awtConfig.getNativeGraphicsConfiguration().getScreen().getDevice();
         String adeviceMsg=null;
         if(Window.DEBUG_IMPLEMENTATION) {
             adeviceMsg = adevice.toString();
         }
-        boolean closed = adevice.close();
+        final boolean closed = adevice.close();
         if(Window.DEBUG_IMPLEMENTATION) {
             System.err.println(getThreadName()+": AWTCanvas.dispose(): closed GraphicsDevice: "+adeviceMsg+", result: "+closed);
         }
@@ -246,11 +255,11 @@ public class AWTCanvas extends Canvas {
          * block, both devices should have the same visual list, and the
          * same configuration should be selected here.
          */
-        AWTGraphicsConfiguration config = chooseGraphicsConfiguration(
+        final AWTGraphicsConfiguration config = chooseGraphicsConfiguration(
                 awtConfig.getChosenCapabilities(), awtConfig.getRequestedCapabilities(), chooser, gc.getDevice());
         final GraphicsConfiguration compatible = (null!=config)?config.getAWTGraphicsConfiguration():null;
         if(Window.DEBUG_IMPLEMENTATION) {
-            Exception e = new Exception("Info: Call Stack: "+Thread.currentThread().getName());
+            final Exception e = new Exception("Info: Call Stack: "+Thread.currentThread().getName());
             e.printStackTrace();
             System.err.println("Created Config (n): HAVE    GC "+chosen);
             System.err.println("Created Config (n): THIS    GC "+gc);
@@ -298,14 +307,14 @@ public class AWTCanvas extends Canvas {
     return gc;
   }
 
-  private static AWTGraphicsConfiguration chooseGraphicsConfiguration(CapabilitiesImmutable capsChosen,
-                                                                      CapabilitiesImmutable capsRequested,
-                                                                      CapabilitiesChooser chooser,
-                                                                      GraphicsDevice device) {
+  private static AWTGraphicsConfiguration chooseGraphicsConfiguration(final CapabilitiesImmutable capsChosen,
+                                                                      final CapabilitiesImmutable capsRequested,
+                                                                      final CapabilitiesChooser chooser,
+                                                                      final GraphicsDevice device) {
     final AbstractGraphicsScreen aScreen = null != device ?
             AWTGraphicsScreen.createScreenDevice(device, AbstractGraphicsDevice.DEFAULT_UNIT):
             AWTGraphicsScreen.createDefault();
-    AWTGraphicsConfiguration config = (AWTGraphicsConfiguration)
+    final AWTGraphicsConfiguration config = (AWTGraphicsConfiguration)
       GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class, capsChosen.getClass()).chooseGraphicsConfiguration(capsChosen,
                                                                                                    capsRequested,
                                                                                                    chooser, aScreen, VisualIDHolder.VID_UNDEFINED);
@@ -337,16 +346,16 @@ public class AWTCanvas extends Canvas {
                       clazz.getDeclaredMethod("disableBackgroundErase",
                                               new Class[] { Canvas.class });
                     disableBackgroundEraseMethod.setAccessible(true);
-                  } catch (Exception e) {
+                  } catch (final Exception e) {
                     clazz = clazz.getSuperclass();
                   }
                 }
-              } catch (Exception e) {
+              } catch (final Exception e) {
               }
               return null;
             }
           });
-      } catch (Exception e) {
+      } catch (final Exception e) {
       }
       disableBackgroundEraseInitialized = true;
       if(Window.DEBUG_IMPLEMENTATION) {
@@ -358,7 +367,7 @@ public class AWTCanvas extends Canvas {
       Throwable t=null;
       try {
         disableBackgroundEraseMethod.invoke(getToolkit(), new Object[] { this });
-      } catch (Exception e) {
+      } catch (final Exception e) {
         // FIXME: workaround for 6504460 (incorrect backport of 6333613 in 5.0u10)
         // throw new GLException(e);
         t = e;
diff --git a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
index 4a71933..39e68e4 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/AWTEDTUtil.java
@@ -49,7 +49,7 @@ public class AWTEDTUtil implements EDTUtil {
     private int start_iter=0;
     private static long pollPeriod = EDTUtil.defaultEDTPollPeriod;
 
-    public AWTEDTUtil(ThreadGroup tg, String name, Runnable dispatchMessages) {
+    public AWTEDTUtil(final ThreadGroup tg, final String name, final Runnable dispatchMessages) {
         this.threadGroup = tg;
         this.name=Thread.currentThread().getName()+"-"+name+"-EDT-";
         this.dispatchMessages=dispatchMessages;
@@ -63,12 +63,12 @@ public class AWTEDTUtil implements EDTUtil {
     }
 
     @Override
-    final public void setPollPeriod(long ms) {
-        pollPeriod = ms;
+    final public void setPollPeriod(final long ms) {
+        pollPeriod = ms; // writing to static field is intended
     }
 
     @Override
-    public final boolean start() throws IllegalStateException {
+    public final void start() throws IllegalStateException {
         synchronized(edtLock) {
             if( nedt.isRunning() ) {
                 throw new IllegalStateException("EDT still running and not subject to stop. Curr "+Thread.currentThread().getName()+", NEDT "+nedt.getName()+", isRunning "+nedt.isRunning+", shouldStop "+nedt.shouldStop+", on AWT-EDT "+EventQueue.isDispatchThread());
@@ -82,7 +82,9 @@ public class AWTEDTUtil implements EDTUtil {
             }
             startImpl();
         }
-        return invoke(true, nullTask);
+        if( !nedt.isRunning() ) {
+            throw new RuntimeException("EDT could not be started: "+nedt);
+        }
     }
 
     private final void startImpl() {
@@ -119,21 +121,16 @@ public class AWTEDTUtil implements EDTUtil {
     }
 
     @Override
-    public final boolean invokeStop(boolean wait, Runnable task) {
+    public final boolean invokeStop(final boolean wait, final Runnable task) {
         return invokeImpl(wait, task, true);
     }
 
     @Override
-    public final boolean invoke(boolean wait, Runnable task) {
+    public final boolean invoke(final boolean wait, final Runnable task) {
         return invokeImpl(wait, task, false);
     }
 
-    private static Runnable nullTask = new Runnable() {
-        @Override
-        public void run() { }
-    };
-
-    private final boolean invokeImpl(boolean wait, Runnable task, boolean stop) {
+    private final boolean invokeImpl(boolean wait, final Runnable task, final boolean stop) {
         Throwable throwable = null;
         RunnableTask rTask = null;
         final Object rTaskLock = new Object();
@@ -190,7 +187,7 @@ public class AWTEDTUtil implements EDTUtil {
             if( wait ) {
                 try {
                     rTaskLock.wait(); // free lock, allow execution of rTask
-                } catch (InterruptedException ie) {
+                } catch (final InterruptedException ie) {
                     throwable = ie;
                 }
                 if(null==throwable) {
@@ -221,7 +218,7 @@ public class AWTEDTUtil implements EDTUtil {
                 @Override
                 public void run() { }
             });
-        } catch (Exception e) { }
+        } catch (final Exception e) { }
         return true;
     }
 
@@ -232,7 +229,7 @@ public class AWTEDTUtil implements EDTUtil {
                 while( nedt.isRunning ) {
                     try {
                         edtLock.wait();
-                    } catch (InterruptedException e) {
+                    } catch (final InterruptedException e) {
                         e.printStackTrace();
                     }
                 }
@@ -248,7 +245,7 @@ public class AWTEDTUtil implements EDTUtil {
         volatile boolean isRunning = false;
         Object sync = new Object();
 
-        public NEDT(ThreadGroup tg, String name) {
+        public NEDT(final ThreadGroup tg, final String name) {
             super(tg, name);
         }
 
@@ -287,13 +284,13 @@ public class AWTEDTUtil implements EDTUtil {
                         if(!shouldStop) {
                             try {
                                 sync.wait(pollPeriod);
-                            } catch (InterruptedException e) {
+                            } catch (final InterruptedException e) {
                                 e.printStackTrace();
                             }
                         }
                     }
                 } while(!shouldStop) ;
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 // handle errors ..
                 shouldStop = true;
                 if(t instanceof RuntimeException) {
diff --git a/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
index d9a4a48..23da69d 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/DisplayDriver.java
@@ -51,7 +51,7 @@ public class DisplayDriver extends DisplayImpl {
         aDevice = AWTGraphicsDevice.createDefault();
     }
 
-    protected void setAWTGraphicsDevice(AWTGraphicsDevice d) {
+    protected void setAWTGraphicsDevice(final AWTGraphicsDevice d) {
         aDevice = d;
     }
 
@@ -70,7 +70,7 @@ public class DisplayDriver extends DisplayImpl {
     }
 
     @Override
-    protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+    protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
         aDevice.close();
     }
 
diff --git a/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
index a435670..57948cf 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/ScreenDriver.java
@@ -54,7 +54,7 @@ public class ScreenDriver extends ScreenImpl {
         aScreen = new AWTGraphicsScreen((AWTGraphicsDevice)display.getGraphicsDevice());
     }
 
-    protected void setAWTGraphicsScreen(AWTGraphicsScreen s) {
+    protected void setAWTGraphicsScreen(final AWTGraphicsScreen s) {
         aScreen = s;
     }
 
@@ -70,11 +70,11 @@ public class ScreenDriver extends ScreenImpl {
     protected void closeNativeImpl() { }
 
     @Override
-    protected int validateScreenIndex(int idx) {
+    protected int validateScreenIndex(final int idx) {
         return idx; // pass through ...
     }
 
-    private static MonitorMode getModeProps(Cache cache, DisplayMode mode) {
+    private static MonitorMode getModeProps(final Cache cache, final DisplayMode mode) {
         int rate = mode.getRefreshRate();
         if( DisplayMode.REFRESH_RATE_UNKNOWN == rate ) {
             rate = ScreenImpl.default_sm_rate;
@@ -83,7 +83,7 @@ public class ScreenDriver extends ScreenImpl {
         if( DisplayMode.BIT_DEPTH_MULTI == bpp ) {
             bpp= ScreenImpl.default_sm_bpp;
         }
-        int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
+        final int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
         int i = 0;
         props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
         props[i++] = mode.getWidth();
@@ -97,7 +97,7 @@ public class ScreenDriver extends ScreenImpl {
     }
 
     @Override
-    protected void collectNativeMonitorModesAndDevicesImpl(Cache cache) {
+    protected void collectNativeMonitorModesAndDevicesImpl(final Cache cache) {
         final GraphicsDevice awtGD = ((AWTGraphicsDevice)getDisplay().getGraphicsDevice()).getGraphicsDevice();
         final DisplayMode[] awtModes = awtGD.getDisplayModes();
         for(int i=0; i<awtModes.length; i++) {
@@ -105,26 +105,30 @@ public class ScreenDriver extends ScreenImpl {
         }
         final MonitorMode currentMode = getModeProps(cache, awtGD.getDisplayMode());
 
-        int[] props = new int[MonitorModeProps.MIN_MONITOR_DEVICE_PROPERTIES - 1 - MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES];
+        final int[] props = new int[MonitorModeProps.MIN_MONITOR_DEVICE_PROPERTIES - 1 - MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES];
         int i = 0;
         props[i++] = props.length;
         props[i++] = 0; // crt_idx
         props[i++] = ScreenImpl.default_sm_widthmm; // FIXME
         props[i++] = ScreenImpl.default_sm_heightmm; // FIXME
-        props[i++] = 0; // rotated viewport x
-        props[i++] = 0; // rotated viewport y
-        props[i++] = currentMode.getRotatedWidth(); // rotated viewport width
-        props[i++] = currentMode.getRotatedHeight(); // rotated viewport height
+        props[i++] = 0; // rotated viewport x pixel-units
+        props[i++] = 0; // rotated viewport y pixel-units
+        props[i++] = currentMode.getRotatedWidth(); // rotated viewport width pixel-units
+        props[i++] = currentMode.getRotatedHeight(); // rotated viewport height pixel-units
+        props[i++] = 0; // rotated viewport x window-units
+        props[i++] = 0; // rotated viewport y window-units
+        props[i++] = currentMode.getRotatedWidth(); // rotated viewport width window-units
+        props[i++] = currentMode.getRotatedHeight(); // rotated viewport height window-units
         MonitorModeProps.streamInMonitorDevice(null, cache, this, cache.monitorModes, currentMode, props, 0);
     }
 
     @Override
-    protected MonitorMode queryCurrentMonitorModeImpl(MonitorDevice monitor) {
+    protected MonitorMode queryCurrentMonitorModeImpl(final MonitorDevice monitor) {
         return null;
     }
 
     @Override
-    protected boolean setCurrentMonitorModeImpl(MonitorDevice monitor, MonitorMode mode) {
+    protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode) {
         return false;
     }
 
diff --git a/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
index 9854524..06dcb8f 100644
--- a/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/awt/WindowDriver.java
@@ -72,7 +72,7 @@ public class WindowDriver extends WindowImpl {
         return new Class<?>[] { Container.class } ;
     }
 
-    public WindowDriver(Container container) {
+    public WindowDriver(final Container container) {
         super();
         this.awtContainer = container;
         if(container instanceof Frame) {
@@ -87,7 +87,7 @@ public class WindowDriver extends WindowImpl {
     private AWTCanvas awtCanvas;
 
     @Override
-    protected void requestFocusImpl(boolean reparented) {
+    protected void requestFocusImpl(final boolean reparented) {
         awtContainer.requestFocus();
     }
 
@@ -98,6 +98,18 @@ public class WindowDriver extends WindowImpl {
         }
     }
 
+    private final AWTCanvas.UpstreamScalable upstreamScalable = new AWTCanvas.UpstreamScalable() {
+        @Override
+        public int[] getReqPixelScale() {
+            return WindowDriver.this.reqPixelScale;
+        }
+
+        @Override
+        public void setHasPixelScale(final int[] pixelScale) {
+            System.arraycopy(pixelScale, 0, WindowDriver.this.hasPixelScale, 0, 2);
+        }
+    };
+
     @Override
     protected void createNativeImpl() {
         if(0!=getParentWindowHandle()) {
@@ -119,7 +131,7 @@ public class WindowDriver extends WindowImpl {
         awtContainer.setLayout(new BorderLayout());
 
         if( null == awtCanvas ) {
-            awtCanvas = new AWTCanvas(capsRequested, WindowDriver.this.capabilitiesChooser);
+            awtCanvas = new AWTCanvas(capsRequested, WindowDriver.this.capabilitiesChooser, upstreamScalable);
 
             // canvas.addComponentListener(listener);
             awtContainer.add(awtCanvas, BorderLayout.CENTER);
@@ -162,7 +174,7 @@ public class WindowDriver extends WindowImpl {
 
     @Override
     public boolean hasDeviceChanged() {
-        boolean res = awtCanvas.hasDeviceChanged();
+        final boolean res = awtCanvas.hasDeviceChanged();
         if(res) {
             final AWTGraphicsConfiguration cfg = awtCanvas.getAWTGraphicsConfiguration();
             if (null == cfg) {
@@ -180,12 +192,12 @@ public class WindowDriver extends WindowImpl {
     }
 
     @Override
-    protected void updateInsetsImpl(javax.media.nativewindow.util.Insets insets) {
+    protected void updateInsetsImpl(final javax.media.nativewindow.util.Insets insets) {
         final Insets contInsets = awtContainer.getInsets();
         insets.set(contInsets.left, contInsets.right, contInsets.top, contInsets.bottom);
     }
 
-    private void setCanvasSizeImpl(int width, int height) {
+    private void setCanvasSizeImpl(final int width, final int height) {
         final Dimension szClient = new Dimension(width, height);
         final java.awt.Window awtWindow = AWTMisc.getWindow(awtCanvas);
         final Container c= null != awtWindow ? awtWindow : awtContainer;
@@ -205,7 +217,7 @@ public class WindowDriver extends WindowImpl {
             awtContainer.validate();
         }
     }
-    private void setFrameSizeImpl(int width, int height) {
+    private void setFrameSizeImpl(final int width, final int height) {
         final Insets insets = awtContainer.getInsets();
         final Dimension szContainer = new Dimension(width + insets.left + insets.right,
                                                     height + insets.top + insets.bottom);
@@ -219,7 +231,7 @@ public class WindowDriver extends WindowImpl {
     }
 
     @Override
-    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
+    protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, final int flags) {
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("AWTWindow reconfig: "+x+"/"+y+" "+width+"x"+height+", "+
                                getReconfigureFlagsAsString(null, flags));
@@ -272,8 +284,8 @@ public class WindowDriver extends WindowImpl {
     }
 
     @Override
-    protected Point getLocationOnScreenImpl(int x, int y) {
-        java.awt.Point ap = awtCanvas.getLocationOnScreen();
+    protected Point getLocationOnScreenImpl(final int x, final int y) {
+        final java.awt.Point ap = awtCanvas.getLocationOnScreen();
         ap.translate(x, y);
         return new Point((int)(ap.getX()+0.5),(int)(ap.getY()+0.5));
     }
@@ -285,44 +297,44 @@ public class WindowDriver extends WindowImpl {
 
     class LocalWindowListener implements com.jogamp.newt.event.WindowListener {
         @Override
-        public void windowMoved(com.jogamp.newt.event.WindowEvent e) {
+        public void windowMoved(final com.jogamp.newt.event.WindowEvent e) {
             if(null!=awtContainer) {
                 WindowDriver.this.positionChanged(false, awtContainer.getX(), awtContainer.getY());
             }
         }
         @Override
-        public void windowResized(com.jogamp.newt.event.WindowEvent e) {
+        public void windowResized(final com.jogamp.newt.event.WindowEvent e) {
             if(null!=awtCanvas) {
                 if(DEBUG_IMPLEMENTATION) {
                     System.err.println("Window Resized: "+awtCanvas);
                 }
                 WindowDriver.this.sizeChanged(false, awtCanvas.getWidth(), awtCanvas.getHeight(), true);
-                WindowDriver.this.windowRepaint(false, 0, 0, getWidth(), getHeight());
+                WindowDriver.this.windowRepaint(false, 0, 0, getSurfaceWidth(), getSurfaceHeight());
             }
         }
         @Override
-        public void windowDestroyNotify(WindowEvent e) {
+        public void windowDestroyNotify(final WindowEvent e) {
             WindowDriver.this.windowDestroyNotify(false);
         }
         @Override
-        public void windowDestroyed(WindowEvent e) {
+        public void windowDestroyed(final WindowEvent e) {
             // Not fwd by AWTWindowAdapter, synthesized by NEWT
         }
         @Override
-        public void windowGainedFocus(WindowEvent e) {
+        public void windowGainedFocus(final WindowEvent e) {
             WindowDriver.this.focusChanged(false, true);
         }
         @Override
-        public void windowLostFocus(WindowEvent e) {
+        public void windowLostFocus(final WindowEvent e) {
             WindowDriver.this.focusChanged(false, false);
         }
         @Override
-        public void windowRepaint(WindowUpdateEvent e) {
+        public void windowRepaint(final WindowUpdateEvent e) {
             if(null!=awtCanvas) {
                 if(DEBUG_IMPLEMENTATION) {
                     System.err.println("Window Repaint: "+awtCanvas);
                 }
-                WindowDriver.this.windowRepaint(false, 0, 0, getWidth(), getHeight());
+                WindowDriver.this.windowRepaint(false, 0, 0, getSurfaceWidth(), getSurfaceHeight());
             }
         }
     }
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java
index d1b30f7..ceb3371 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/DisplayDriver.java
@@ -70,7 +70,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
     }
 
     @Override
-    protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+    protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
         if (aDevice.getHandle() != EGL.EGL_NO_DISPLAY) {
             DestroyDisplay(aDevice.getHandle());
         }
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java
index d323155..fab3fe8 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/ScreenDriver.java
@@ -62,12 +62,12 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
     protected void closeNativeImpl() { }
 
     @Override
-    protected int validateScreenIndex(int idx) {
+    protected int validateScreenIndex(final int idx) {
         return 0; // only one screen available
     }
 
     @Override
-    protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
+    protected final void collectNativeMonitorModesAndDevicesImpl(final MonitorModeProps.Cache cache) {
         int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
         int i = 0;
         props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
@@ -86,10 +86,14 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
         props[i++] = 0; // crt_idx
         props[i++] = ScreenImpl.default_sm_widthmm; // FIXME
         props[i++] = ScreenImpl.default_sm_heightmm; // FIXME
-        props[i++] = 0; // rotated viewport x
-        props[i++] = 0; // rotated viewport y
-        props[i++] = fixedWidth; // FIXME rotated viewport width
-        props[i++] = fixedHeight; // FIXME rotated viewport height
+        props[i++] = 0; // rotated viewport x pixel-units
+        props[i++] = 0; // rotated viewport y pixel-units
+        props[i++] = fixedWidth; // FIXME rotated viewport width pixel-units
+        props[i++] = fixedHeight; // FIXME rotated viewport height pixel-units
+        props[i++] = 0; // rotated viewport x window-units
+        props[i++] = 0; // rotated viewport y window-units
+        props[i++] = fixedWidth; // FIXME rotated viewport width window-units
+        props[i++] = fixedHeight; // FIXME rotated viewport height window-units
         MonitorModeProps.streamInMonitorDevice(null, cache, this, cache.monitorModes, currentMode, props, 0);
     }
 
@@ -104,8 +108,8 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
     }
 
     @Override
-    protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
-        vOriginSize.set(0, 0, fixedWidth, fixedHeight); // FIXME
+    protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
+        viewport.set(0, 0, fixedWidth, fixedHeight); // FIXME
     }
 
     //----------------------------------------------------------------------
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java
index 39f168e..aec85f8 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/egl/WindowDriver.java
@@ -65,7 +65,8 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
             throw new NativeWindowException("Error choosing GraphicsConfiguration creating window: "+this);
         }
         setGraphicsConfiguration(cfg);
-        setSizeImpl(getScreen().getWidth(), getScreen().getHeight());
+        final int[] winSize = convertToWindowUnits(new int[] {getScreen().getWidth(), getScreen().getHeight()});
+        setSizeImpl(winSize[0], winSize[1]);
 
         setWindowHandle(realizeWindow(true, getWidth(), getHeight()));
         if (0 == getWindowHandle()) {
@@ -81,9 +82,9 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
     }
 
     @Override
-    protected void requestFocusImpl(boolean reparented) { }
+    protected void requestFocusImpl(final boolean reparented) { }
 
-    protected void setSizeImpl(int width, int height) {
+    protected void setSizeImpl(final int width, final int height) {
         if(0!=getWindowHandle()) {
             // n/a in BroadcomEGL
             System.err.println("BCEGL Window.setSizeImpl n/a in BroadcomEGL with realized window");
@@ -93,7 +94,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
     }
 
     @Override
-    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
+    protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, final int flags) {
         if(0!=getWindowHandle()) {
             if(0 != ( FLAG_CHANGE_FULLSCREEN & flags)) {
                 if( 0 != ( FLAG_IS_FULLSCREEN & flags) ) {
@@ -122,12 +123,12 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
     }
 
     @Override
-    protected Point getLocationOnScreenImpl(int x, int y) {
+    protected Point getLocationOnScreenImpl(final int x, final int y) {
         return new Point(x,y);
     }
 
     @Override
-    protected void updateInsetsImpl(Insets insets) {
+    protected void updateInsetsImpl(final Insets insets) {
         // nop ..
     }
 
@@ -147,11 +148,11 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
     private        native void SwapWindow(long eglDisplayHandle, long eglWindowHandle);
 
 
-    private long realizeWindow(boolean chromaKey, int width, int height) {
+    private long realizeWindow(final boolean chromaKey, final int width, final int height) {
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("BCEGL Window.realizeWindow() with: chroma "+chromaKey+", "+width+"x"+height+", "+getGraphicsConfiguration());
         }
-        long handle = CreateWindow(getDisplayHandle(), chromaKey, width, height);
+        final long handle = CreateWindow(getDisplayHandle(), chromaKey, width, height);
         if (0 == handle) {
             throw new NativeWindowException("Error native Window Handle is null");
         }
@@ -159,9 +160,9 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
         return handle;
     }
 
-    private void windowCreated(int cfgID, int width, int height) {
+    private void windowCreated(final int cfgID, final int width, final int height) {
         defineSize(width, height);
-        GLCapabilitiesImmutable capsReq = (GLCapabilitiesImmutable) getGraphicsConfiguration().getRequestedCapabilities();
+        final GLCapabilitiesImmutable capsReq = (GLCapabilitiesImmutable) getGraphicsConfiguration().getRequestedCapabilities();
         final AbstractGraphicsConfiguration cfg = EGLGraphicsConfiguration.create(capsReq, getScreen().getGraphicsScreen(), cfgID);
         if (null == cfg) {
             throw new NativeWindowException("Error creating EGLGraphicsConfiguration from id: "+cfgID+", "+this);
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
index 178bb70..1b67fa7 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/DisplayDriver.java
@@ -69,7 +69,7 @@ public class DisplayDriver extends DisplayImpl {
             try {
                 final URLConnection urlConn = res.resolve(0);
                 image = PNGPixelRect.read(urlConn.getInputStream(), PixelFormat.BGRA8888, false /* directBuffer */, 0 /* destMinStrideInBytes */, false /* destIsGLOriented */);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
             }
         }
@@ -106,7 +106,7 @@ public class DisplayDriver extends DisplayImpl {
     private PointerIconImpl defaultPointerIcon = null;
 
     @Override
-    protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+    protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
         aDevice.close();
         CloseBCMDisplay0(bcmHandle);
         bcmHandle = 0;
@@ -123,12 +123,12 @@ public class DisplayDriver extends DisplayImpl {
     // public final PixelFormat getNativePointerIconPixelFormat() { return PixelFormat.BGRA8888; }
 
     @Override
-    protected final long createPointerIconImpl(PixelFormat pixelformat, int width, int height, final ByteBuffer pixels, final int hotX, final int hotY) {
+    protected final long createPointerIconImpl(final PixelFormat pixelformat, final int width, final int height, final ByteBuffer pixels, final int hotX, final int hotY) {
         return CreatePointerIcon(bcmHandle, pixels, width, height, hotX, hotY);
     }
 
     @Override
-    protected final void destroyPointerIconImpl(final long displayHandle, long piHandle) {
+    protected final void destroyPointerIconImpl(final long displayHandle, final long piHandle) {
         DestroyPointerIcon0(piHandle);
     }
 
@@ -187,7 +187,7 @@ public class DisplayDriver extends DisplayImpl {
     private static native long OpenBCMDisplay0();
     private static native void CloseBCMDisplay0(long handle);
 
-    private static long CreatePointerIcon(long bcmHandle, Buffer pixels, int width, int height, int hotX, int hotY) {
+    private static long CreatePointerIcon(final long bcmHandle, final Buffer pixels, final int width, final int height, final int hotX, final int hotY) {
         final boolean pixels_is_direct = Buffers.isDirect(pixels);
         return CreatePointerIcon0(pixels_is_direct ? pixels : Buffers.getArray(pixels),
                                   pixels_is_direct ? Buffers.getDirectBufferByteOffset(pixels) : Buffers.getIndirectBufferByteOffset(pixels),
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
index dc2a845..e3e854c 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/ScreenDriver.java
@@ -55,12 +55,12 @@ public class ScreenDriver extends ScreenImpl {
     protected void closeNativeImpl() { }
 
     @Override
-    protected int validateScreenIndex(int idx) {
+    protected int validateScreenIndex(final int idx) {
         return 0; // only one screen available
     }
 
     @Override
-    protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
+    protected final void collectNativeMonitorModesAndDevicesImpl(final MonitorModeProps.Cache cache) {
         int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
         int i = 0;
         props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
@@ -79,10 +79,14 @@ public class ScreenDriver extends ScreenImpl {
         props[i++] = 0; // crt_idx
         props[i++] = ScreenImpl.default_sm_widthmm; // FIXME
         props[i++] = ScreenImpl.default_sm_heightmm; // FIXME
-        props[i++] = 0; // rotated viewport x
-        props[i++] = 0; // rotated viewport y
-        props[i++] = cachedWidth; // rotated viewport width
-        props[i++] = cachedWidth; // rotated viewport height
+        props[i++] = 0; // rotated viewport x pixel-units
+        props[i++] = 0; // rotated viewport y pixel-units
+        props[i++] = cachedWidth; // rotated viewport width pixel-units
+        props[i++] = cachedWidth; // rotated viewport height pixel-units
+        props[i++] = 0; // rotated viewport x window-units
+        props[i++] = 0; // rotated viewport y window-units
+        props[i++] = cachedWidth; // rotated viewport width window-units
+        props[i++] = cachedWidth; // rotated viewport height window-units
         MonitorModeProps.streamInMonitorDevice(null, cache, this, cache.monitorModes, currentMode, props, 0);
     }
 
@@ -97,14 +101,14 @@ public class ScreenDriver extends ScreenImpl {
     }
 
     @Override
-    protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
-        vOriginSize.set(0, 0, cachedWidth, cachedHeight);
+    protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
+        viewport.set(0, 0, cachedWidth, cachedHeight);
     }
 
     /** Called from {@link #initNative()}. */
-    protected void setScreenSize(int width, int height) {
-        cachedWidth = width;
-        cachedHeight = height;
+    protected void setScreenSize(final int width, final int height) {
+        cachedWidth = width;   // write to static field intended
+        cachedHeight = height; // write to static field intended
     }
 
     private static int cachedWidth = 0;
diff --git a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
index c3cb8a8..ad6d0b6 100644
--- a/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/bcm/vc/iv/WindowDriver.java
@@ -149,34 +149,34 @@ public class WindowDriver extends WindowImpl {
     }
 
     @Override
-    protected void requestFocusImpl(boolean reparented) {
+    protected void requestFocusImpl(final boolean reparented) {
         focusChanged(false, true);
     }
 
     @Override
-    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
+    protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, final int flags) {
         reconfigure0(nativeWindowHandle, x, y, width, height, flags);
         return true;
     }
 
     @Override
-    protected Point getLocationOnScreenImpl(int x, int y) {
+    protected Point getLocationOnScreenImpl(final int x, final int y) {
         return new Point(x,y);
     }
 
     @Override
-    protected void updateInsetsImpl(Insets insets) {
+    protected void updateInsetsImpl(final Insets insets) {
         // nop ..
     }
 
     @Override
-    public final void sendMouseEvent(final short eventType, final int modifiers,
-                                     final int x, final int y, final short button, final float rotation) {
+    protected final void doMouseEvent(final boolean enqueue, final boolean wait, final short eventType, final int modifiers,
+                                      final int x, final int y, final short button, final float[] rotationXYZ, final float rotationScale) {
         if( MouseEvent.EVENT_MOUSE_MOVED == eventType ) {
             final DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
             display.moveActivePointerIcon(x, y);
         }
-        super.sendMouseEvent(eventType, modifiers, x, y, button, rotation);
+        super.doMouseEvent(enqueue, wait, eventType, modifiers, x, y, button, rotationXYZ, rotationScale);
     }
 
     @Override
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
index cc43554..1d43017 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/DisplayDriver.java
@@ -74,7 +74,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
     }
 
     @Override
-    protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+    protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
         if(0==displayHandle) {
             throw new NativeWindowException("displayHandle null; initCnt "+initCounter);
         }
@@ -96,7 +96,7 @@ public class DisplayDriver extends jogamp.newt.DisplayImpl {
         }
     }
 
-    protected void setFocus(WindowDriver focus) {
+    protected void setFocus(final WindowDriver focus) {
         focusedWindow = focus;
     }
 
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
index 44802e3..b5400c3 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/ScreenDriver.java
@@ -55,7 +55,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
 
     @Override
     protected void createNativeImpl() {
-        AbstractGraphicsDevice adevice = getDisplay().getGraphicsDevice();
+        final AbstractGraphicsDevice adevice = getDisplay().getGraphicsDevice();
         GetScreenInfo(adevice.getHandle(), screen_idx);
         aScreen = new DefaultGraphicsScreen(adevice, screen_idx);
     }
@@ -64,12 +64,12 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
     protected void closeNativeImpl() { }
 
     @Override
-    protected int validateScreenIndex(int idx) {
+    protected int validateScreenIndex(final int idx) {
         return 0; // only one screen available
     }
 
     @Override
-    protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
+    protected final void collectNativeMonitorModesAndDevicesImpl(final MonitorModeProps.Cache cache) {
         int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
         int i = 0;
         props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
@@ -88,10 +88,14 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
         props[i++] = 0; // crt_idx
         props[i++] = ScreenImpl.default_sm_widthmm; // FIXME
         props[i++] = ScreenImpl.default_sm_heightmm; // FIXME
-        props[i++] = 0; // rotated viewport x
-        props[i++] = 0; // rotated viewport y
-        props[i++] = cachedWidth; // rotated viewport width
-        props[i++] = cachedWidth; // rotated viewport height
+        props[i++] = 0; // rotated viewport x pixel-units
+        props[i++] = 0; // rotated viewport y pixel-units
+        props[i++] = cachedWidth; // rotated viewport width pixel-units
+        props[i++] = cachedWidth; // rotated viewport height pixel-units
+        props[i++] = 0; // rotated viewport x window-units
+        props[i++] = 0; // rotated viewport y window-units
+        props[i++] = cachedWidth; // rotated viewport width window-units
+        props[i++] = cachedWidth; // rotated viewport height window-units
         MonitorModeProps.streamInMonitorDevice(null, cache, this, cache.monitorModes, currentMode, props, 0);
     }
 
@@ -106,8 +110,8 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
     }
 
     @Override
-    protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
-        vOriginSize.set(0, 0, cachedWidth, cachedHeight);
+    protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
+        viewport.set(0, 0, cachedWidth, cachedHeight);
     }
 
     //----------------------------------------------------------------------
@@ -118,7 +122,7 @@ public class ScreenDriver extends jogamp.newt.ScreenImpl {
     private          native void GetScreenInfo(long displayHandle, int screen_idx);
 
     // called by GetScreenInfo() ..
-    private void screenCreated(int width, int height) {
+    private void screenCreated(final int width, final int height) {
         cachedWidth = width;
         cachedHeight = height;
     }
diff --git a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
index 0e96c65..d7bd17e 100644
--- a/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/intel/gdl/WindowDriver.java
@@ -66,7 +66,8 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
         synchronized(WindowDriver.class) {
             setWindowHandle(nextWindowHandle++); // just a marker
 
-            surfaceHandle = CreateSurface(aDevice.getHandle(), getScreen().getWidth(), getScreen().getHeight(), getX(), getY(), getWidth(), getHeight());
+            surfaceHandle = CreateSurface(aDevice.getHandle(), getScreen().getWidth(), getScreen().getHeight(),
+                                          getX(), getY(), getSurfaceWidth(), getSurfaceHeight());
             if (surfaceHandle == 0) {
                 throw new NativeWindowException("Error creating window");
             }
@@ -85,9 +86,10 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
     }
 
     @Override
-    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
-        ScreenDriver  screen = (ScreenDriver) getScreen();
+    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, final int flags) {
+        final ScreenDriver  screen = (ScreenDriver) getScreen();
 
+        // Note for GDL: window units == pixel units
         if(width>screen.getWidth()) {
             width=screen.getWidth();
         }
@@ -116,7 +118,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
     }
 
     @Override
-    protected void requestFocusImpl(boolean reparented) {
+    protected void requestFocusImpl(final boolean reparented) {
         ((DisplayDriver)getScreen().getDisplay()).setFocus(this);
     }
 
@@ -126,12 +128,12 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
     }
 
     @Override
-    protected Point getLocationOnScreenImpl(int x, int y) {
+    protected Point getLocationOnScreenImpl(final int x, final int y) {
         return new Point(x,y);
     }
 
     @Override
-    protected void updateInsetsImpl(Insets insets) {
+    protected void updateInsetsImpl(final Insets insets) {
         // nop ..
     }
 
@@ -144,7 +146,7 @@ public class WindowDriver extends jogamp.newt.WindowImpl {
     private        native void CloseSurface(long displayHandle, long surfaceHandle);
     private        native void SetBounds0(long surfaceHandle, int scrn_width, int scrn_height, int x, int y, int width, int height);
 
-    private void updateBounds(int x, int y, int width, int height) {
+    private void updateBounds(final int x, final int y, final int width, final int height) {
         definePosition(x, y);
         defineSize(width, height);
     }
diff --git a/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
index 6c70614..e72ddbc 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/DisplayDriver.java
@@ -67,7 +67,7 @@ public class DisplayDriver extends DisplayImpl {
     }
 
     @Override
-    protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+    protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
         aDevice.close();
     }
 
diff --git a/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
index 9ebe262..71f8b14 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/ScreenDriver.java
@@ -60,12 +60,12 @@ public class ScreenDriver extends ScreenImpl {
     protected void closeNativeImpl() { }
 
     @Override
-    protected int validateScreenIndex(int idx) {
+    protected int validateScreenIndex(final int idx) {
         return 0; // only one screen available
     }
 
     @Override
-    protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
+    protected final void collectNativeMonitorModesAndDevicesImpl(final MonitorModeProps.Cache cache) {
         int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
         int i = 0;
         props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
@@ -84,10 +84,14 @@ public class ScreenDriver extends ScreenImpl {
         props[i++] = 0; // crt_idx
         props[i++] = ScreenImpl.default_sm_widthmm; // FIXME
         props[i++] = ScreenImpl.default_sm_heightmm; // FIXME
-        props[i++] = 0; // rotated viewport x
-        props[i++] = 0; // rotated viewport y
-        props[i++] = cachedWidth; // rotated viewport width
-        props[i++] = cachedWidth; // rotated viewport height
+        props[i++] = 0; // rotated viewport x pixel-units
+        props[i++] = 0; // rotated viewport y pixel-units
+        props[i++] = cachedWidth; // rotated viewport width pixel-units
+        props[i++] = cachedWidth; // rotated viewport height pixel-units
+        props[i++] = 0; // rotated viewport x window-units
+        props[i++] = 0; // rotated viewport y window-units
+        props[i++] = cachedWidth; // rotated viewport width window-units
+        props[i++] = cachedWidth; // rotated viewport height window-units
         MonitorModeProps.streamInMonitorDevice(null, cache, this, cache.monitorModes, currentMode, props, 0);
     }
 
@@ -102,13 +106,13 @@ public class ScreenDriver extends ScreenImpl {
     }
 
     @Override
-    protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
-        vOriginSize.set(0, 0, cachedWidth, cachedHeight);
+    protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
+        viewport.set(0, 0, cachedWidth, cachedHeight);
     }
 
-    protected void sizeChanged(int w, int h) {
-        cachedWidth = w;
-        cachedHeight = h;
+    protected void sizeChanged(final int w, final int h) {
+        cachedWidth = w;  // write to static field intended
+        cachedHeight = h; // write to static field intended
     }
 
     private static int cachedWidth = 0;
diff --git a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
index 158e6ab..d53ef00 100644
--- a/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/kd/WindowDriver.java
@@ -68,9 +68,9 @@ public class WindowDriver extends WindowImpl {
         }
         setGraphicsConfiguration(cfg);
 
-        GLCapabilitiesImmutable eglCaps = (GLCapabilitiesImmutable) cfg.getChosenCapabilities();
-        int eglConfigID = eglCaps.getVisualID(VIDType.EGL_CONFIG);
-        long eglConfig = EGLGraphicsConfiguration.EGLConfigId2EGLConfig(getDisplayHandle(), eglConfigID);
+        final GLCapabilitiesImmutable eglCaps = (GLCapabilitiesImmutable) cfg.getChosenCapabilities();
+        final int eglConfigID = eglCaps.getVisualID(VIDType.EGL_CONFIG);
+        final long eglConfig = EGLGraphicsConfiguration.EGLConfigId2EGLConfig(getDisplayHandle(), eglConfigID);
 
         eglWindowHandle = CreateWindow(getDisplayHandle(), eglConfig);
         if (eglWindowHandle == 0) {
@@ -93,10 +93,10 @@ public class WindowDriver extends WindowImpl {
     }
 
     @Override
-    protected void requestFocusImpl(boolean reparented) { }
+    protected void requestFocusImpl(final boolean reparented) { }
 
     @Override
-    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
+    protected boolean reconfigureWindowImpl(final int x, final int y, int width, int height, final int flags) {
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) ) {
             setVisible0(eglWindowHandle, 0 != ( FLAG_IS_VISIBLE & flags));
             visibleChanged(false, 0 != ( FLAG_IS_VISIBLE & flags));
@@ -130,12 +130,12 @@ public class WindowDriver extends WindowImpl {
     }
 
     @Override
-    protected Point getLocationOnScreenImpl(int x, int y) {
+    protected Point getLocationOnScreenImpl(final int x, final int y) {
         return new Point(x,y);
     }
 
     @Override
-    protected void updateInsetsImpl(Insets insets) {
+    protected void updateInsetsImpl(final Insets insets) {
         // nop ..
     }
 
@@ -151,12 +151,12 @@ public class WindowDriver extends WindowImpl {
     private        native void setSize0(long eglWindowHandle, int width, int height);
     private        native void setFullScreen0(long eglWindowHandle, boolean fullscreen);
 
-    private void windowCreated(long userData) {
+    private void windowCreated(final long userData) {
         windowUserData=userData;
     }
 
     @Override
-    protected void sizeChanged(boolean defer, int newWidth, int newHeight, boolean force) {
+    protected void sizeChanged(final boolean defer, final int newWidth, final int newHeight, final boolean force) {
         if(isFullscreen()) {
             ((ScreenDriver)getScreen()).sizeChanged(getWidth(), getHeight());
         }
diff --git a/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java b/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java
index b7c86a2..49a815c 100644
--- a/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java
+++ b/src/newt/classes/jogamp/newt/driver/linux/LinuxEventDeviceTracker.java
@@ -72,7 +72,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
     }
 
     private WindowImpl focusedWindow = null;
-    private EventDeviceManager eventDeviceManager = new EventDeviceManager();
+    private final EventDeviceManager eventDeviceManager = new EventDeviceManager();
 
     /*
       The devices are in /dev/input:
@@ -85,56 +85,56 @@ public class LinuxEventDeviceTracker implements WindowListener {
 
       And so on up to event31.
      */
-    private EventDevicePoller[] eventDevicePollers = new EventDevicePoller[32];
+    private final EventDevicePoller[] eventDevicePollers = new EventDevicePoller[32];
 
     @Override
-    public void windowResized(WindowEvent e) { }
+    public void windowResized(final WindowEvent e) { }
 
     @Override
-    public void windowMoved(WindowEvent e) { }
+    public void windowMoved(final WindowEvent e) { }
 
     @Override
-    public void windowDestroyNotify(WindowEvent e) {
-        Object s = e.getSource();
+    public void windowDestroyNotify(final WindowEvent e) {
+        final Object s = e.getSource();
         if(focusedWindow == s) {
             focusedWindow = null;
         }
     }
 
     @Override
-    public void windowDestroyed(WindowEvent e) { }
+    public void windowDestroyed(final WindowEvent e) { }
 
     @Override
-    public void windowGainedFocus(WindowEvent e) {
-        Object s = e.getSource();
+    public void windowGainedFocus(final WindowEvent e) {
+        final Object s = e.getSource();
         if(s instanceof WindowImpl) {
             focusedWindow = (WindowImpl) s;
         }
     }
 
     @Override
-    public void windowLostFocus(WindowEvent e) {
-        Object s = e.getSource();
+    public void windowLostFocus(final WindowEvent e) {
+        final Object s = e.getSource();
         if(focusedWindow == s) {
             focusedWindow = null;
         }
     }
 
-    public static void main(String[] args ){
+    public static void main(final String[] args ){
         System.setProperty("newt.debug.Window.KeyEvent", "true");
         LinuxEventDeviceTracker.getSingleton();
         try {
             while(true) {
                 Thread.sleep(1000);
             }
-        } catch (InterruptedException e) {
+        } catch (final InterruptedException e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
         }
     }
 
     @Override
-    public void windowRepaint(WindowUpdateEvent e) { }
+    public void windowRepaint(final WindowUpdateEvent e) { }
 
     class EventDeviceManager implements Runnable {
 
@@ -142,17 +142,17 @@ public class LinuxEventDeviceTracker implements WindowListener {
 
         @Override
         public void run() {
-            File f = new File("/dev/input/");
+            final File f = new File("/dev/input/");
             int number;
             while(!stop){
-                for(String path:f.list()){
+                for(final String path:f.list()){
                     if(path.startsWith("event")) {
-                        String stringNumber = path.substring(5);
+                        final String stringNumber = path.substring(5);
                         number = Integer.parseInt(stringNumber);
                         if(number<32&&number>=0) {
                             if(eventDevicePollers[number]==null){
                                 eventDevicePollers[number] = new EventDevicePoller(number);
-                                Thread t = new Thread(eventDevicePollers[number], "NEWT-LinuxEventDeviceTracker-event"+number);
+                                final Thread t = new Thread(eventDevicePollers[number], "NEWT-LinuxEventDeviceTracker-event"+number);
                                 t.setDaemon(true);
                                 t.start();
                             } else if(eventDevicePollers[number].stop) {
@@ -163,7 +163,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
                 }
                 try {
                     Thread.sleep(2000);
-                } catch (InterruptedException e) {
+                } catch (final InterruptedException e) {
                     // TODO Auto-generated catch block
                     e.printStackTrace();
                 }
@@ -174,9 +174,9 @@ public class LinuxEventDeviceTracker implements WindowListener {
     class EventDevicePoller implements Runnable {
 
         private volatile boolean stop = false;
-        private String eventDeviceName;
+        private final String eventDeviceName;
 
-        public EventDevicePoller(int eventDeviceNumber){
+        public EventDevicePoller(final int eventDeviceNumber){
             this.eventDeviceName="/dev/input/event"+eventDeviceNumber;
         }
 
@@ -194,14 +194,14 @@ public class LinuxEventDeviceTracker implements WindowListener {
              *	unsigned int value;
              * };
              */
-            ByteBuffer bb = ByteBuffer.wrap(b);
-            StructAccessor s = new StructAccessor(bb);
+            final ByteBuffer bb = ByteBuffer.wrap(b);
+            final StructAccessor s = new StructAccessor(bb);
             final File f = new File(eventDeviceName);
             f.setReadOnly();
             InputStream fis;
             try {
                 fis = new FileInputStream(f);
-            } catch (FileNotFoundException e) {
+            } catch (final FileNotFoundException e) {
                 stop=true;
                 return;
             }
@@ -224,7 +224,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
                         int read = 0;
                         try {
                             read = fis.read(b, 0, remaining);
-                        } catch (IOException e) {
+                        } catch (final IOException e) {
                             stop = true;
                             break loop;
                         }
@@ -369,13 +369,13 @@ public class LinuxEventDeviceTracker implements WindowListener {
             if(null != fis) {
                 try {
                     fis.close();
-                } catch (IOException e) {
+                } catch (final IOException e) {
                 }
             }
             stop=true;
         }
 
-        private char NewtVKey2Unicode(short VK, int modifiers) {
+        private char NewtVKey2Unicode(final short VK, final int modifiers) {
             if( KeyEvent.isPrintableKey(VK, true) ) {
                 if((modifiers & InputEvent.SHIFT_MASK) == InputEvent.SHIFT_MASK) {
                     return (char)VK;
@@ -387,7 +387,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
         }
 
         @SuppressWarnings("unused")
-        private char LinuxEVKey2Unicode(short EVKey) {
+        private char LinuxEVKey2Unicode(final short EVKey) {
             // This is the stuff normally mapped by a system keymap
 
             switch(EVKey) {
@@ -443,7 +443,7 @@ public class LinuxEventDeviceTracker implements WindowListener {
             return 0;
         }
 
-        private short LinuxEVKey2NewtVKey(short EVKey) {
+        private short LinuxEVKey2NewtVKey(final short EVKey) {
 
             switch(EVKey) {
             case 1: // ESC
diff --git a/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java b/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java
index 9d7b893..1d93775 100644
--- a/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java
+++ b/src/newt/classes/jogamp/newt/driver/linux/LinuxMouseTracker.java
@@ -36,6 +36,7 @@ import java.io.InputStream;
 
 import jogamp.newt.WindowImpl;
 
+import com.jogamp.newt.Screen;
 import com.jogamp.newt.Window;
 import com.jogamp.newt.event.MouseEvent;
 import com.jogamp.newt.event.WindowEvent;
@@ -78,40 +79,40 @@ public class LinuxMouseTracker implements WindowListener {
     public final int getLastY() { return lastFocusedY; }
 
     @Override
-    public void windowResized(WindowEvent e) { }
+    public void windowResized(final WindowEvent e) { }
 
     @Override
-    public void windowMoved(WindowEvent e) { }
+    public void windowMoved(final WindowEvent e) { }
 
     @Override
-    public void windowDestroyNotify(WindowEvent e) {
-        Object s = e.getSource();
+    public void windowDestroyNotify(final WindowEvent e) {
+        final Object s = e.getSource();
         if(focusedWindow == s) {
             focusedWindow = null;
         }
     }
 
     @Override
-    public void windowDestroyed(WindowEvent e) { }
+    public void windowDestroyed(final WindowEvent e) { }
 
     @Override
-    public void windowGainedFocus(WindowEvent e) {
-        Object s = e.getSource();
+    public void windowGainedFocus(final WindowEvent e) {
+        final Object s = e.getSource();
         if(s instanceof WindowImpl) {
             focusedWindow = (WindowImpl) s;
         }
     }
 
     @Override
-    public void windowLostFocus(WindowEvent e) {
-        Object s = e.getSource();
+    public void windowLostFocus(final WindowEvent e) {
+        final Object s = e.getSource();
         if(focusedWindow == s) {
             focusedWindow = null;
         }
     }
 
     @Override
-    public void windowRepaint(WindowUpdateEvent e) { }
+    public void windowRepaint(final WindowUpdateEvent e) { }
 
     class MouseDevicePoller implements Runnable {
         @Override
@@ -122,7 +123,7 @@ public class LinuxMouseTracker implements WindowListener {
             InputStream fis;
             try {
                 fis = new FileInputStream(f);
-            } catch (FileNotFoundException e) {
+            } catch (final FileNotFoundException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
                 return;
@@ -136,7 +137,7 @@ public class LinuxMouseTracker implements WindowListener {
                     int read = 0;
                     try {
                         read = fis.read(b, 0, remaining);
-                    } catch (IOException e) {
+                    } catch (final IOException e) {
                         // TODO Auto-generated catch block
                         e.printStackTrace();
                     }
@@ -178,13 +179,20 @@ public class LinuxMouseTracker implements WindowListener {
                 }
 
                 if(null != focusedWindow) {
-                    if( x >= focusedWindow.getScreen().getWidth() ) {
-                        x = focusedWindow.getScreen().getWidth() - 1;
-                    }
-                    if( y >= focusedWindow.getScreen().getHeight() ) {
-                        y = focusedWindow.getScreen().getHeight() - 1;
+                    // Clip to Screen Size
+                    {
+                        final Screen focusedScreen = focusedWindow.getScreen();
+                        final int sw = focusedScreen.getWidth();
+                        final int sh = focusedScreen.getHeight();
+                        if( x >= sw ) {
+                            x = sw - 1;
+                        }
+                        if( y >= sh ) {
+                            y = sh - 1;
+                        }
                     }
-                    final int wx = x - focusedWindow.getX(), wy = y - focusedWindow.getY();
+                    final int[] winScreenPos = focusedWindow.convertToPixelUnits(new int[] { focusedWindow.getX(), focusedWindow.getY() });
+                    final int wx = x - winScreenPos[0], wy = y - winScreenPos[1];
                     if(old_x != x || old_y != y) {
                         // mouse moved
                         lastFocusedX = wx;
@@ -214,7 +222,7 @@ public class LinuxMouseTracker implements WindowListener {
             if(null != fis) {
                 try {
                     fis.close();
-                } catch (IOException e) {
+                } catch (final IOException e) {
                     // TODO Auto-generated catch block
                     e.printStackTrace();
                 }
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
index d850a18..4ecc2fd 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/DisplayDriver.java
@@ -71,7 +71,7 @@ public class DisplayDriver extends DisplayImpl {
                     final IOUtil.ClassResources iconRes = NewtFactory.getWindowIcons();
                     final URLConnection urlConn = iconRes.resolve(iconRes.resourceCount()-1);
                     image = PNGPixelRect.read(urlConn.getInputStream(), PixelFormat.BGRA8888, true /* directBuffer */, 0 /* destMinStrideInBytes */, false /* destIsGLOriented */);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     e.printStackTrace();
                 }
             }
@@ -107,7 +107,7 @@ public class DisplayDriver extends DisplayImpl {
     }
 
     @Override
-    protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+    protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
         aDevice.close();
     }
 
@@ -121,14 +121,14 @@ public class DisplayDriver extends DisplayImpl {
     public final boolean getNativePointerIconForceDirectNIO() { return true; }
 
     @Override
-    protected final long createPointerIconImpl(PixelFormat pixelformat, int width, int height, final ByteBuffer pixels, final int hotX, final int hotY) {
+    protected final long createPointerIconImpl(final PixelFormat pixelformat, final int width, final int height, final ByteBuffer pixels, final int hotX, final int hotY) {
         return createPointerIcon0(
               pixels, Buffers.getDirectBufferByteOffset(pixels), true /* pixels_is_direct */,
               width, height, hotX, hotY);
     }
 
     @Override
-    protected final void destroyPointerIconImpl(final long displayHandle, long piHandle) {
+    protected final void destroyPointerIconImpl(final long displayHandle, final long piHandle) {
         destroyPointerIcon0(piHandle);
     }
 
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java b/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java
index a89150d..d80d43e 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/MacKeyUtil.java
@@ -231,7 +231,7 @@ public class MacKeyUtil {
     private static final char NSModeSwitchFunctionKey     = 0xF747;
     */
 
-    static short validateKeyCode(short keyCode, char keyChar) {
+    static short validateKeyCode(final short keyCode, final char keyChar) {
         // OS X Virtual Keycodes
         switch(keyCode) {
             //
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java
index 4f3cc69..5f458e2 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/ScreenDriver.java
@@ -35,13 +35,16 @@
 package jogamp.newt.driver.macosx;
 
 import javax.media.nativewindow.DefaultGraphicsScreen;
+import javax.media.nativewindow.util.Rectangle;
 
+import jogamp.nativewindow.macosx.OSXUtil;
 import jogamp.newt.MonitorModeProps;
 import jogamp.newt.ScreenImpl;
 
 import com.jogamp.common.util.ArrayHashSet;
 import com.jogamp.newt.MonitorDevice;
 import com.jogamp.newt.MonitorMode;
+import com.jogamp.opengl.math.FloatUtil;
 
 public class ScreenDriver extends ScreenImpl {
 
@@ -60,7 +63,7 @@ public class ScreenDriver extends ScreenImpl {
     @Override
     protected void closeNativeImpl() { }
 
-    private MonitorMode getMonitorModeImpl(MonitorModeProps.Cache cache, int crt_idx, int mode_idx) {
+    private MonitorMode getMonitorModeImpl(final MonitorModeProps.Cache cache, final int crt_idx, final int mode_idx) {
         final int[] modeProps = getMonitorMode0(crt_idx, mode_idx);
         final MonitorMode res;
         if (null == modeProps  || 0 >= modeProps.length) {
@@ -71,56 +74,133 @@ public class ScreenDriver extends ScreenImpl {
         return res;
     }
 
-    @Override
-    protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
-        int crtIdx = 0;
-        int modeIdx = 0;
-        ArrayHashSet<MonitorMode> supportedModes = new ArrayHashSet<MonitorMode>();
-        do {
-            final MonitorMode mode = getMonitorModeImpl(cache, crtIdx, modeIdx);
-            if( null != mode ) {
-                supportedModes.getOrAdd(mode);
-                // next mode on same monitor
-                modeIdx++;
-            } else if( 0 < modeIdx ) {
-                // end of monitor modes - got at least one mode
-                final MonitorMode currentMode = getMonitorModeImpl(cache, crtIdx, -1);
-                if ( null == currentMode ) {
-                    throw new InternalError("Could not gather current mode of device "+crtIdx+", but gathered "+modeIdx+" modes");
+    private class CrtProps {
+        CrtProps() {
+            count = getMonitorCount0();
+            pixelScaleArray = new int[count];
+            propsOrigArray = new int[count][];
+            propsFixedArray = new int[count][];
+
+            //
+            // Gather whole topology of monitors (NSScreens)
+            //
+            for(int crtIdx=0; crtIdx<count; crtIdx++) {
+                final float pixelScaleRaw = (float) OSXUtil.GetPixelScale(crtIdx);
+                pixelScaleArray[crtIdx] = FloatUtil.isZero(pixelScaleRaw, FloatUtil.EPSILON) ? 1 : (int)pixelScaleRaw;
+                propsOrigArray[crtIdx] = getMonitorProps0(crtIdx);
+                if ( null == propsOrigArray[crtIdx] ) {
+                    throw new InternalError("Could not gather device props "+crtIdx+"/"+count);
                 }
-                final int[] monitorProps = getMonitorProps0(crtIdx);
-                if ( null == monitorProps ) {
-                    throw new InternalError("Could not gather device "+crtIdx+", but gathered "+modeIdx+" modes");
+                // copy orig -> fixed
+                final int propsLen = propsOrigArray[crtIdx].length;
+                propsFixedArray[crtIdx] = new int[propsLen];
+                System.arraycopy(propsOrigArray[crtIdx], 0, propsFixedArray[crtIdx], 0, propsLen);
+            }
+
+            //
+            // Fix scaled viewport w/ pixelScale of each monitorProps,
+            // i.e. size by its own pixelScale and x/y offset by querying it's neighbors.
+            //
+            for(int crtIdx=0; crtIdx<count; crtIdx++) {
+                final int[] thisMonitorProps = propsFixedArray[crtIdx];
+                final int x = thisMonitorProps[MonitorModeProps.IDX_MONITOR_DEVICE_VIEWPORT+0];
+                final int y = thisMonitorProps[MonitorModeProps.IDX_MONITOR_DEVICE_VIEWPORT+1];
+                final int thisPixelScale = pixelScaleArray[crtIdx];
+                thisMonitorProps[MonitorModeProps.IDX_MONITOR_DEVICE_VIEWPORT+2] *= thisPixelScale; // fix width
+                thisMonitorProps[MonitorModeProps.IDX_MONITOR_DEVICE_VIEWPORT+3] *= thisPixelScale; // fix height
+                if( 0 != x ) {
+                    // find matching viewport width for x-offset to apply it's pixelSize
+                    for(int i=0; i<count; i++) {
+                        if( i != crtIdx && x == propsOrigArray[i][MonitorModeProps.IDX_MONITOR_DEVICE_VIEWPORT+2] ) {
+                            thisMonitorProps[MonitorModeProps.IDX_MONITOR_DEVICE_VIEWPORT+0] *= pixelScaleArray[i];
+                            break;
+                        }
+                    }
+                }
+                if( 0 != y ) {
+                    // find matching viewport height for y-offset to apply it's pixelSize
+                    for(int i=0; i<count; i++) {
+                        if( i != crtIdx && y == propsOrigArray[i][MonitorModeProps.IDX_MONITOR_DEVICE_VIEWPORT+3] ) {
+                            thisMonitorProps[MonitorModeProps.IDX_MONITOR_DEVICE_VIEWPORT+1] *= pixelScaleArray[i];
+                            break;
+                        }
+                    }
                 }
-                // merge monitor-props + supported modes
-                MonitorModeProps.streamInMonitorDevice(null, cache, this, supportedModes, currentMode, monitorProps, 0);
-
-                // next monitor, 1st mode
-                supportedModes= new ArrayHashSet<MonitorMode>();
-                crtIdx++;
-                modeIdx=0;
-            } else {
-                // end of monitor
-                break;
             }
-        } while ( true );
+        }
+        final int count;
+        final int[] pixelScaleArray;
+        final int[][] propsOrigArray;
+        final int[][] propsFixedArray;
+    }
+
+    @Override
+    protected final void collectNativeMonitorModesAndDevicesImpl(final MonitorModeProps.Cache cache) {
+        final CrtProps crtProps = new CrtProps();
+
+        //
+        // Collect all monitorModes for all monitorDevices
+        //
+        for(int crtIdx=0; crtIdx<crtProps.count; crtIdx++) {
+            final ArrayHashSet<MonitorMode> supportedModes = new ArrayHashSet<MonitorMode>();
+            int modeIdx = 0;
+            {
+                // Get all supported modes for this monitorDevice
+                MonitorMode mode;
+                while( true ) {
+                    mode = getMonitorModeImpl(cache, crtIdx, modeIdx);
+                    if( null != mode ) {
+                        if( mode.getSurfaceSize().getBitsPerPixel() >= 24 ) { // drop otherwise
+                            supportedModes.getOrAdd(mode);
+                        }
+                        modeIdx++; // next mode on same monitor
+                    } else {
+                        break; // done with modes on this monitor
+                    }
+                }
+            }
+            if( 0 >= modeIdx ) {
+                throw new InternalError("Could not gather single mode of device "+crtIdx+"/"+crtProps.count);
+            }
+            final MonitorMode currentMode = getMonitorModeImpl(cache, crtIdx, -1);
+            if ( null == currentMode ) {
+                throw new InternalError("Could not gather current mode of device "+crtIdx+"/"+crtProps.count+", but gathered "+modeIdx+" modes");
+            }
+            // merge monitor-props + supported modes
+            MonitorModeProps.streamInMonitorDevice(null, cache, this, supportedModes, currentMode, crtProps.propsFixedArray[crtIdx], 0);
+        }
+    }
+
+    @Override
+    protected boolean updateNativeMonitorDeviceViewportImpl(final MonitorDevice monitor, final Rectangle viewportPU, final Rectangle viewportWU) {
+        final CrtProps crtProps = new CrtProps();
+        final int crtIdx = monitor.getId();
+        if( 0 > crtIdx || crtIdx >= crtProps.count ) {
+            throw new IndexOutOfBoundsException("monitor id "+crtIdx+" not withon [0.."+(crtProps.count-1)+"]");
+        }
+        final int[] fixedMonitorProps = crtProps.propsFixedArray[crtIdx];
+        int offset = MonitorModeProps.IDX_MONITOR_DEVICE_VIEWPORT;
+        viewportPU.set(fixedMonitorProps[offset++], fixedMonitorProps[offset++], fixedMonitorProps[offset++], fixedMonitorProps[offset++]);
+        viewportWU.set(fixedMonitorProps[offset++], fixedMonitorProps[offset++], fixedMonitorProps[offset++], fixedMonitorProps[offset++]);
+        return true;
     }
 
     @Override
-    protected MonitorMode queryCurrentMonitorModeImpl(MonitorDevice monitor) {
+    protected MonitorMode queryCurrentMonitorModeImpl(final MonitorDevice monitor) {
         return getMonitorModeImpl(null, monitor.getId(), -1);
     }
 
     @Override
-    protected boolean setCurrentMonitorModeImpl(MonitorDevice monitor, MonitorMode mode)  {
+    protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode)  {
         return setMonitorMode0(monitor.getId(), mode.getId(), mode.getRotation());
     }
 
     @Override
-    protected int validateScreenIndex(int idx) {
+    protected int validateScreenIndex(final int idx) {
         return 0; // big-desktop w/ multiple monitor attached, only one screen available
     }
 
+    private native int getMonitorCount0();
     private native int[] getMonitorProps0(int crt_idx);
     private native int[] getMonitorMode0(int crt_index, int mode_idx);
     private native boolean setMonitorMode0(int crt_index, int nativeId, int rot);
diff --git a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
index e2a57de..c0f7d38 100644
--- a/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/macosx/WindowDriver.java
@@ -39,19 +39,24 @@ import javax.media.nativewindow.GraphicsConfigurationFactory;
 import javax.media.nativewindow.NativeWindow;
 import javax.media.nativewindow.NativeWindowException;
 import javax.media.nativewindow.MutableSurface;
+import javax.media.nativewindow.ScalableSurface;
 import javax.media.nativewindow.VisualIDHolder;
 import javax.media.nativewindow.util.Insets;
 import javax.media.nativewindow.util.Point;
 import javax.media.nativewindow.util.PointImmutable;
 
+import jogamp.nativewindow.SurfaceScaleUtils;
 import jogamp.nativewindow.macosx.OSXUtil;
 import jogamp.newt.PointerIconImpl;
+import jogamp.newt.ScreenImpl;
 import jogamp.newt.WindowImpl;
 import jogamp.newt.driver.DriverClearFocus;
 import jogamp.newt.driver.DriverUpdatePosition;
 
 import com.jogamp.newt.event.InputEvent;
 import com.jogamp.newt.event.KeyEvent;
+import com.jogamp.newt.event.MonitorEvent;
+import com.jogamp.opengl.math.FloatUtil;
 
 public class WindowDriver extends WindowImpl implements MutableSurface, DriverClearFocus, DriverUpdatePosition {
 
@@ -62,6 +67,118 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
     public WindowDriver() {
     }
 
+    private boolean updatePixelScale(final boolean sendEvent, final boolean defer, final float newPixelScaleRaw, final float nativePixelScaleRaw) {
+        final int[] newPixelScale = new int[2];
+        {
+            final int _newPixelScale = FloatUtil.isZero(newPixelScaleRaw, FloatUtil.EPSILON) ? ScalableSurface.IDENTITY_PIXELSCALE : (int) newPixelScaleRaw;
+            newPixelScale[0]= _newPixelScale;
+            newPixelScale[1]= _newPixelScale;
+            final int _nativePixelScale = FloatUtil.isZero(nativePixelScaleRaw, FloatUtil.EPSILON) ? ScalableSurface.IDENTITY_PIXELSCALE : (int) nativePixelScaleRaw;
+            nativePixelScale[0]= _nativePixelScale;
+            nativePixelScale[1]= _nativePixelScale;
+        }
+
+        if( SurfaceScaleUtils.computePixelScale(hasPixelScale, hasPixelScale, reqPixelScale, newPixelScale, DEBUG_IMPLEMENTATION ? getClass().getName() : null) ) {
+            if( sendEvent ) {
+                super.sizeChanged(defer, getWidth(), getHeight(), true);
+            } else {
+                defineSize(getWidth(), getHeight());
+            }
+            return true;
+        } else {
+            return false;
+        }
+    }
+
+    private boolean updatePixelScaleByScreenIdx(final boolean sendEvent) {
+        final float nativePixelScaleRaw = (float) OSXUtil.GetPixelScale(getScreen().getIndex());
+        if( DEBUG_IMPLEMENTATION ) {
+            System.err.println("WindowDriver.updatePixelScale.1: "+hasPixelScale[0]+", "+nativePixelScaleRaw+" (native)");
+        }
+        return updatePixelScale(sendEvent, true /* defer */, nativePixelScaleRaw, nativePixelScaleRaw);
+    }
+
+    private boolean updatePixelScaleByWindowHandle(final boolean sendEvent) {
+        final long handle = getWindowHandle();
+        if( 0 != handle ) {
+            final float nativePixelScaleRaw = (float)OSXUtil.GetPixelScale(handle);
+            if( DEBUG_IMPLEMENTATION ) {
+                System.err.println("WindowDriver.updatePixelScale.2: "+hasPixelScale[0]+", "+nativePixelScaleRaw+" (native)");
+            }
+            return updatePixelScale(sendEvent, true /* defer */, nativePixelScaleRaw, nativePixelScaleRaw);
+        } else {
+            return false;
+        }
+    }
+
+    /** Called from native code */
+    protected void updatePixelScale(final boolean defer, final float newPixelScaleRaw, final float nativePixelScaleRaw) {
+        final long handle = getWindowHandle();
+        if( DEBUG_IMPLEMENTATION ) {
+            System.err.println("WindowDriver.updatePixelScale.3: "+hasPixelScale[0]+" (has) -> "+newPixelScaleRaw+" (raw), "+nativePixelScaleRaw+" (native), drop "+(0==handle));
+        }
+        if( 0 != handle ) {
+            updatePixelScale(true /* sendEvent*/, defer, newPixelScaleRaw, nativePixelScaleRaw);
+        }
+    }
+
+    @Override
+    protected final void instantiationFinished() {
+        updatePixelScaleByScreenIdx(false /* sendEvent*/);
+    }
+
+    @Override
+    protected void setScreen(final ScreenImpl newScreen) { // never null !
+        super.setScreen(newScreen);
+        updatePixelScaleByScreenIdx(false /* sendEvent*/);  // caller (reparent, ..) will send reshape event
+    }
+
+    @Override
+    protected void monitorModeChanged(final MonitorEvent me, final boolean success) {
+        updatePixelScaleByWindowHandle(false /* sendEvent*/); // send reshape event itself
+    }
+
+    @Override
+    public final void setSurfaceScale(final int[] pixelScale) {
+        SurfaceScaleUtils.validateReqPixelScale(reqPixelScale, pixelScale, DEBUG_IMPLEMENTATION ? getClass().getName() : null);
+
+        final int[] resPixelScale;
+        if( isNativeValid() ) {
+            if( isOffscreenInstance ) {
+                final NativeWindow pWin = getParent();
+                if( pWin instanceof ScalableSurface ) {
+                    final ScalableSurface sSurf = (ScalableSurface)pWin;
+                    sSurf.setSurfaceScale(reqPixelScale);
+                    final int[] pPixelScale = sSurf.getCurrentSurfaceScale(new int[2]);
+                    sSurf.getNativeSurfaceScale(nativePixelScale);
+                    updatePixelScale(true /* sendEvent */, true /* defer */, pPixelScale[0], nativePixelScale[0]); // HiDPI: uniformPixelScale
+                } else {
+                    // just notify updated pixelScale if offscreen
+                    SurfaceScaleUtils.replaceAutoMaxWithPlatformMax(reqPixelScale);
+                    updatePixelScale(true /* sendEvent */, true /* defer */, reqPixelScale[0], nativePixelScale[0]); // HiDPI: uniformPixelScale
+                }
+            } else {
+                // set pixelScale in native code, will issue an update PixelScale
+                OSXUtil.RunOnMainThread(true, false, new Runnable() {
+                    @Override
+                    public void run() {
+                        setPixelScale0(getWindowHandle(), surfaceHandle, reqPixelScale[0]); // HiDPI: uniformPixelScale
+                    }
+                } );
+            }
+            resPixelScale = hasPixelScale;
+        } else {
+            hasPixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+            hasPixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
+            resPixelScale = reqPixelScale;
+        }
+        if( DEBUG_IMPLEMENTATION ) {
+            System.err.println("WindowDriver.setPixelScale: "+pixelScale[0]+"x"+pixelScale[1]+" (req) -> "+
+                                reqPixelScale[0]+"x"+reqPixelScale[1]+" (validated) -> "+
+                                resPixelScale[0]+"x"+resPixelScale[1]+" (result) - realized "+isNativeValid());
+        }
+    }
+
     @Override
     protected void createNativeImpl() {
         final AbstractGraphicsConfiguration cfg = GraphicsConfigurationFactory.getFactory(getScreen().getDisplay().getGraphicsDevice(), capsRequested).chooseGraphicsConfiguration(
@@ -87,15 +204,15 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             sscSurfaceHandle = 0;
             isOffscreenInstance = false;
             if (0 != handle) {
-                OSXUtil.RunOnMainThread(false, new Runnable() {
+                OSXUtil.RunOnMainThread(false, true /* kickNSApp */, new Runnable() {
                    @Override
                    public void run() {
                        close0( handle );
-                   } } );
+                   } });
             }
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             if(DEBUG_IMPLEMENTATION) {
-                Exception e = new Exception("Warning: closeNative failed - "+Thread.currentThread().getName(), t);
+                final Exception e = new Exception("Warning: closeNative failed - "+Thread.currentThread().getName(), t);
                 e.printStackTrace();
             }
         }
@@ -138,18 +255,18 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
     }
 
     @Override
-    public void setSurfaceHandle(long surfaceHandle) {
+    public void setSurfaceHandle(final long surfaceHandle) {
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("MacWindow.setSurfaceHandle(): 0x"+Long.toHexString(surfaceHandle));
         }
         sscSurfaceHandle = surfaceHandle;
         if (isNativeValid()) {
             if (0 != sscSurfaceHandle) {
-                OSXUtil.RunOnMainThread(false, new Runnable() {
-                    @Override
-                    public void run() {
-                        orderOut0( 0 != getParentWindowHandle() ? getParentWindowHandle() : getWindowHandle() );
-                    } } );
+                OSXUtil.RunOnMainThread(false, false, new Runnable() {
+                        @Override
+                        public void run() {
+                            orderOut0( 0 != getParentWindowHandle() ? getParentWindowHandle() : getWindowHandle() );
+                        } } );
             } /** this is done by recreation!
               else if (isVisible()){
                 OSXUtil.RunOnMainThread(false, new Runnable() {
@@ -162,11 +279,11 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
 
     @Override
     protected void setTitleImpl(final String title) {
-        OSXUtil.RunOnMainThread(false, new Runnable() {
-            @Override
-            public void run() {
-                setTitle0(getWindowHandle(), title);
-            } } );
+        OSXUtil.RunOnMainThread(false, false, new Runnable() {
+                @Override
+                public void run() {
+                    setTitle0(getWindowHandle(), title);
+                } } );
     }
 
     @Override
@@ -177,15 +294,15 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             System.err.println("MacWindow: requestFocusImpl(), isOffscreenInstance "+_isOffscreenInstance+", isFullscreen "+_isFullscreen);
         }
         if(!_isOffscreenInstance) {
-            OSXUtil.RunOnMainThread(false, new Runnable() {
-                @Override
-                public void run() {
-                    requestFocus0(getWindowHandle(), force);
-                    if(_isFullscreen) {
-                        // 'NewtMacWindow::windowDidBecomeKey()' is not always called in fullscreen-mode!
-                        focusChanged(false, true);
-                    }
-                } } );
+            OSXUtil.RunOnMainThread(false, false, new Runnable() {
+                    @Override
+                    public void run() {
+                        requestFocus0(getWindowHandle(), force);
+                        if(_isFullscreen) {
+                            // 'NewtMacWindow::windowDidBecomeKey()' is not always called in fullscreen-mode!
+                            focusChanged(false, true);
+                        }
+                    } } );
         } else {
             focusChanged(false, true);
         }
@@ -197,20 +314,20 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             System.err.println("MacWindow: clearFocus(), isOffscreenInstance "+isOffscreenInstance);
         }
         if(!isOffscreenInstance) {
-            OSXUtil.RunOnMainThread(false, new Runnable() {
-                @Override
-                public void run() {
-                    resignFocus0(getWindowHandle());
-                } } );
+            OSXUtil.RunOnMainThread(false, false, new Runnable() {
+                    @Override
+                    public void run() {
+                        resignFocus0(getWindowHandle());
+                    } } );
         } else {
             focusChanged(false, false);
         }
     }
 
-    private boolean useParent(NativeWindow parent) { return null != parent && 0 != parent.getWindowHandle(); }
+    private boolean useParent(final NativeWindow parent) { return null != parent && 0 != parent.getWindowHandle(); }
 
     @Override
-    public void updatePosition(int x, int y) {
+    public void updatePosition(final int x, final int y) {
         final long handle = getWindowHandle();
         if( 0 != handle && !isOffscreenInstance ) {
             final NativeWindow parent = getParent();
@@ -220,18 +337,18 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             if(DEBUG_IMPLEMENTATION) {
                 System.err.println("MacWindow: updatePosition() parent["+useParent+" "+pX+"/"+pY+"] "+x+"/"+y+" ->  "+x+"/"+y+" rel-client-pos, "+p0S+" screen-client-pos");
             }
-            OSXUtil.RunOnMainThread(false, new Runnable() {
-                @Override
-                public void run() {
-                    setWindowClientTopLeftPoint0(handle, p0S.getX(), p0S.getY(), isVisible());
-                } } );
+            OSXUtil.RunOnMainThread(false, false, new Runnable() {
+                    @Override
+                    public void run() {
+                        setWindowClientTopLeftPoint0(handle, p0S.getX(), p0S.getY(), isVisible());
+                    } } );
             // no native event (fullscreen, some reparenting)
             positionChanged(true, x, y);
         }
     }
 
     @Override
-    protected void sizeChanged(boolean defer, int newWidth, int newHeight, boolean force) {
+    protected void sizeChanged(final boolean defer, final int newWidth, final int newHeight, final boolean force) {
         final long handle = getWindowHandle();
         if( 0 != handle && !isOffscreenInstance ) {
             final NativeWindow parent = getParent();
@@ -242,22 +359,23 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                 if(DEBUG_IMPLEMENTATION) {
                     System.err.println("MacWindow: sizeChanged() parent["+useParent+" "+x+"/"+y+"] "+getX()+"/"+getY()+" "+newWidth+"x"+newHeight+" ->  "+p0S+" screen-client-pos");
                 }
-                OSXUtil.RunOnMainThread(false, new Runnable() {
-                    @Override
-                    public void run() {
-                        setWindowClientTopLeftPoint0(getWindowHandle(), p0S.getX(), p0S.getY(), isVisible());
-                    } } );
+                OSXUtil.RunOnMainThread(false, false, new Runnable() {
+                        @Override
+                        public void run() {
+                            setWindowClientTopLeftPoint0(getWindowHandle(), p0S.getX(), p0S.getY(), isVisible());
+                        } } );
             }
         }
         super.sizeChanged(defer, newWidth, newHeight, force);
     }
 
     @Override
-    protected boolean reconfigureWindowImpl(final int x, final int y, final int width, final int height, int flags) {
+    protected boolean reconfigureWindowImpl(int x, int y, final int width, final int height, final int flags) {
         final boolean _isOffscreenInstance = isOffscreenInstance(this, this.getParent());
         isOffscreenInstance = 0 != sscSurfaceHandle || _isOffscreenInstance;
         final PointImmutable pClientLevelOnSreen;
         if( isOffscreenInstance ) {
+            x = 0; y = 0;
             pClientLevelOnSreen = new Point(0, 0);
         } else  {
             final NativeWindow parent = getParent();
@@ -269,6 +387,9 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
             }
         }
 
+        final boolean setVisible = 0 != ( FLAG_IS_VISIBLE & flags);
+        final boolean hasFocus = hasFocus();
+
         if(DEBUG_IMPLEMENTATION) {
             final AbstractGraphicsConfiguration cWinCfg = this.getGraphicsConfiguration();
             final NativeWindow pWin = getParent();
@@ -280,20 +401,18 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                                ", isOffscreenInstance(sscSurfaceHandle "+toHexString(sscSurfaceHandle)+
                                ", ioi: "+_isOffscreenInstance+
                                ") -> "+isOffscreenInstance+
-                               "\n\t, "+getReconfigureFlagsAsString(null, flags));
+                               "\n\t, "+getReconfigureFlagsAsString(null, flags)+", setVisible "+setVisible+", hasFocus "+hasFocus);
             // Thread.dumpStack();
         }
 
-        final boolean setVisible = 0 != ( FLAG_IS_VISIBLE & flags);
-
         if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) && !setVisible ) {
             if ( !isOffscreenInstance ) {
-                OSXUtil.RunOnMainThread(false, new Runnable() {
-                    @Override
-                    public void run() {
-                        orderOut0(getWindowHandle());
-                        visibleChanged(true, false);
-                    } } );
+                OSXUtil.RunOnMainThread(false, false, new Runnable() {
+                        @Override
+                        public void run() {
+                            orderOut0(getWindowHandle());
+                            visibleChanged(true, false);
+                        } } );
             } else {
                 visibleChanged(true, false);
             }
@@ -308,27 +427,35 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                 createWindow(false, 0 != getWindowHandle(), pClientLevelOnSreen, width, height,
                                     0 != ( FLAG_IS_FULLSCREEN & flags), setVisible, 0 != ( FLAG_IS_ALWAYSONTOP & flags));
             }
+            // no native event (fullscreen, some reparenting)
+            positionChanged(false,  x, y);
+            updatePixelScaleByWindowHandle(false /* sendEvent */);
+            super.sizeChanged(false, width, height, true);
+            visibleChanged(false, setVisible);
+            if( hasFocus ) {
+                requestFocusImpl(true);
+            }
         } else {
             if( width>0 && height>0 ) {
                 if( !isOffscreenInstance ) {
-                    OSXUtil.RunOnMainThread(false, new Runnable() {
-                        @Override
-                        public void run() {
-                            setWindowClientTopLeftPointAndSize0(getWindowHandle(), pClientLevelOnSreen.getX(), pClientLevelOnSreen.getY(), width, height, setVisible);
-                        } } );
+                    OSXUtil.RunOnMainThread(false, false, new Runnable() {
+                            @Override
+                            public void run() {
+                                setWindowClientTopLeftPointAndSize0(getWindowHandle(), pClientLevelOnSreen.getX(), pClientLevelOnSreen.getY(), width, height, setVisible);
+                            } } );
                 } // else offscreen size is realized via recreation
                 // no native event (fullscreen, some reparenting)
                 positionChanged(true,  x, y);
-                sizeChanged(true, width, height, false);
+                super.sizeChanged(true, width, height, false);
             }
             if( 0 != ( FLAG_CHANGE_VISIBILITY & flags) && setVisible ) {
                 if( !isOffscreenInstance ) {
-                    OSXUtil.RunOnMainThread(false, new Runnable() {
-                        @Override
-                        public void run() {
-                            orderFront0(getWindowHandle());
-                            visibleChanged(true, true);
-                        } } );
+                    OSXUtil.RunOnMainThread(false, false, new Runnable() {
+                            @Override
+                            public void run() {
+                                orderFront0(getWindowHandle());
+                                visibleChanged(true, true);
+                            } } );
                 } else {
                     visibleChanged(true, true);
                 }
@@ -344,7 +471,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
     }
 
     @Override
-    protected Point getLocationOnScreenImpl(int x, int y) {
+    protected Point getLocationOnScreenImpl(final int x, final int y) {
         final NativeWindow parent = getParent();
         final boolean useParent = useParent(parent);
         return getLocationOnScreenImpl(x, y, parent, useParent);
@@ -352,7 +479,7 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
 
     private Point getLocationOnScreenImpl(final int x, final int y, final NativeWindow parent, final boolean useParent) {
         if( !useParent && !isOffscreenInstance && 0 != surfaceHandle) {
-            return OSXUtil.GetLocationOnScreen(surfaceHandle, true, x, y);
+            return OSXUtil.GetLocationOnScreen(surfaceHandle, x, y);
         }
 
         final Point p = new Point(x, y);
@@ -363,12 +490,12 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
     }
 
     @Override
-    protected void updateInsetsImpl(Insets insets) {
+    protected void updateInsetsImpl(final Insets insets) {
         // nop - using event driven insetsChange(..)
     }
 
     /** Callback for native screen position change event of the client area. */
-    protected void screenPositionChanged(boolean defer, int newX, int newY) {
+    protected void screenPositionChanged(final boolean defer, final int newX, final int newY) {
         // passed coordinates are in screen position of the client area
         if(getWindowHandle()!=0) {
             final NativeWindow parent = getParent();
@@ -379,8 +506,8 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                 positionChanged(defer, newX, newY);
             } else {
                 // screen position -> rel child window position
-                Point absPos = new Point(newX, newY);
-                Point parentOnScreen = parent.getLocationOnScreen(null);
+                final Point absPos = new Point(newX, newY);
+                final Point parentOnScreen = parent.getLocationOnScreen(null);
                 absPos.translate( parentOnScreen.scale(-1, -1) );
                 if(DEBUG_IMPLEMENTATION) {
                     System.err.println("MacWindow.positionChanged.1 (Screen Pos - CHILD): ("+getThreadName()+"): (defer: "+defer+") "+getX()+"/"+getY()+" -> absPos "+newX+"/"+newY+", parentOnScreen "+parentOnScreen+" -> "+absPos);
@@ -396,22 +523,22 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
     protected void setPointerIconImpl(final PointerIconImpl pi) {
         if( !isOffscreenInstance ) {
             final long piHandle = null != pi ? pi.validatedHandle() : 0;
-            OSXUtil.RunOnMainThread(true, new Runnable() { // waitUntildone due to PointerIconImpl's Lifecycle !
-                @Override
-                public void run() {
-                    setPointerIcon0(getWindowHandle(), piHandle);
-                } } );
+            OSXUtil.RunOnMainThread(true, false, new Runnable() { // waitUntildone due to PointerIconImpl's Lifecycle !
+                    @Override
+                    public void run() {
+                        setPointerIcon0(getWindowHandle(), piHandle);
+                    } } );
         }
     }
 
     @Override
     protected boolean setPointerVisibleImpl(final boolean pointerVisible) {
         if( !isOffscreenInstance ) {
-            OSXUtil.RunOnMainThread(false, new Runnable() {
-                @Override
-                public void run() {
-                    setPointerVisible0(getWindowHandle(), hasFocus(), pointerVisible);
-                } } );
+            OSXUtil.RunOnMainThread(false, false, new Runnable() {
+                    @Override
+                    public void run() {
+                        setPointerVisible0(getWindowHandle(), hasFocus(), pointerVisible);
+                    } } );
             return true;
         }
         return false;
@@ -429,27 +556,33 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
     @Override
     protected void warpPointerImpl(final int x, final int y) {
         if( !isOffscreenInstance ) {
-            warpPointer0(getWindowHandle(), x, y);
+            warpPointer0(getWindowHandle(), x / getPixelScaleX(), y / getPixelScaleY());
         } // else may need offscreen solution ? FIXME
     }
 
     @Override
-    public final void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
+    protected final void doMouseEvent(final boolean enqueue, final boolean wait, final short eventType, final int modifiers,
+                                      final int x, final int y, final short button, final float[] rotationXYZ, final float rotationScale) {
+        super.doMouseEvent(enqueue, wait, eventType, modifiers, x * getPixelScaleX(), y * getPixelScaleY(), button, rotationXYZ, rotationScale);
+    }
+
+    @Override
+    public final void sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
         throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
     }
 
     @Override
-    public final void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short _keyCode, short _keySym, char keyChar) {
+    public final void enqueueKeyEvent(final boolean wait, final short eventType, final int modifiers, final short _keyCode, final short _keySym, final char keyChar) {
         throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
     }
 
-    protected final void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short _keyCode, char keyChar, char keySymChar) {
+    protected final void enqueueKeyEvent(final boolean wait, final short eventType, int modifiers, final short _keyCode, final char keyChar, final char keySymChar) {
         // Note that we send the key char for the key code on this
         // platform -- we do not get any useful key codes out of the system
         final short keyCode = MacKeyUtil.validateKeyCode(_keyCode, keyChar);
         final short keySym;
         {
-            short _keySym = KeyEvent.NULL_CHAR != keySymChar ? KeyEvent.utf16ToVKey(keySymChar) : KeyEvent.VK_UNDEFINED;
+            final short _keySym = KeyEvent.NULL_CHAR != keySymChar ? KeyEvent.utf16ToVKey(keySymChar) : KeyEvent.VK_UNDEFINED;
             keySym = KeyEvent.VK_UNDEFINED != _keySym ? _keySym : keyCode;
         }
         /**
@@ -510,17 +643,17 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
                 if( 0 == surfaceHandle ) {
                     throw new NativeWindowException("Internal Error - create w/ window, but no Newt NSView");
                 }
-                OSXUtil.RunOnMainThread(false, new Runnable() {
-                    @Override
-                    public void run() {
-                        changeContentView0(parentWinHandle, preWinHandle, 0);
-                        close0( preWinHandle );
-                    } } );
+                OSXUtil.RunOnMainThread(false, false /* kickNSApp */, new Runnable() {
+                        @Override
+                        public void run() {
+                            changeContentView0(parentWinHandle, preWinHandle, 0);
+                            close0( preWinHandle );
+                        } });
             } else {
                 if( 0 != surfaceHandle ) {
                     throw new NativeWindowException("Internal Error - create w/o window, but has Newt NSView");
                 }
-                surfaceHandle = createView0(pS.getX(), pS.getY(), width, height, fullscreen);
+                surfaceHandle = createView0(pS.getX(), pS.getY(), width, height);
                 if( 0 == surfaceHandle ) {
                     throw new NativeWindowException("Could not create native view "+Thread.currentThread().getName()+" "+this);
                 }
@@ -537,29 +670,30 @@ public class WindowDriver extends WindowImpl implements MutableSurface, DriverCl
 
             final boolean isOpaque = getGraphicsConfiguration().getChosenCapabilities().isBackgroundOpaque() && !offscreenInstance;
             // Blocking initialization on main-thread!
-            OSXUtil.RunOnMainThread(true, new Runnable() {
-                @Override
-                public void run() {
-                    initWindow0( parentWinHandle, newWin, pS.getX(), pS.getY(), width, height,
-                                 isOpaque, visible && !offscreenInstance, surfaceHandle);
-                    if( offscreenInstance ) {
-                        orderOut0(0!=parentWinHandle ? parentWinHandle : newWin);
-                    } else {
-                        setTitle0(newWin, getTitle());
-                        setAlwaysOnTop0(getWindowHandle(), alwaysOnTop);
-                    }
-                    visibleChanged(true, visible);
-                } } );
-        } catch (Exception ie) {
+            OSXUtil.RunOnMainThread(true, false /* kickNSApp */, new Runnable() {
+                    @Override
+                    public void run() {
+                        initWindow0( parentWinHandle, newWin, pS.getX(), pS.getY(), width, height, reqPixelScale[0] /* HiDPI uniformPixelScale */,
+                                     isOpaque, visible && !offscreenInstance, surfaceHandle);
+                        if( offscreenInstance ) {
+                            orderOut0(0!=parentWinHandle ? parentWinHandle : newWin);
+                        } else {
+                            setTitle0(newWin, getTitle());
+                            setAlwaysOnTop0(getWindowHandle(), alwaysOnTop);
+                        }
+                    } });
+        } catch (final Exception ie) {
             ie.printStackTrace();
         }
     }
 
     protected static native boolean initIDs0();
-    private native long createView0(int x, int y, int w, int h, boolean fullscreen);
+    private native long createView0(int x, int y, int w, int h);
     private native long createWindow0(int x, int y, int w, int h, boolean fullscreen, int windowStyle, int backingStoreType, long view);
     /** Must be called on Main-Thread */
-    private native void initWindow0(long parentWindow, long window, int x, int y, int w, int h, boolean opaque, boolean visible, long view);
+    private native void initWindow0(long parentWindow, long window, int x, int y, int w, int h, float reqPixelScale,
+                                    boolean opaque, boolean visible, long view);
+    private native void setPixelScale0(long window, long view, float reqPixelScale);
     private native boolean lockSurface0(long window, long view);
     private native boolean unlockSurface0(long window, long view);
     /** Must be called on Main-Thread */
diff --git a/src/newt/classes/jogamp/newt/driver/opengl/JoglUtilPNGIcon.java b/src/newt/classes/jogamp/newt/driver/opengl/JoglUtilPNGIcon.java
index 551929b..5e703f6 100644
--- a/src/newt/classes/jogamp/newt/driver/opengl/JoglUtilPNGIcon.java
+++ b/src/newt/classes/jogamp/newt/driver/opengl/JoglUtilPNGIcon.java
@@ -41,7 +41,7 @@ import com.jogamp.opengl.util.PNGPixelRect;
 
 public class JoglUtilPNGIcon {
 
-    public static ByteBuffer arrayToX11BGRAImages(IOUtil.ClassResources resources, int[] data_size, int[] elem_bytesize) throws UnsupportedOperationException, InterruptedException, IOException, MalformedURLException {
+    public static ByteBuffer arrayToX11BGRAImages(final IOUtil.ClassResources resources, final int[] data_size, final int[] elem_bytesize) throws UnsupportedOperationException, InterruptedException, IOException, MalformedURLException {
         final PNGPixelRect[] images = new PNGPixelRect[resources.resourceCount()];
         data_size[0] = 0;
         for(int i=0; i<resources.resourceCount(); i++) {
diff --git a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
index a304317..8973ae7 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/DisplayDriver.java
@@ -62,7 +62,7 @@ public class DisplayDriver extends DisplayImpl {
     static {
         NEWTJNILibLoader.loadNEWT();
         {
-            long[] _defaultIconHandle = { 0, 0 };
+            final long[] _defaultIconHandle = { 0, 0 };
             if( DisplayImpl.isPNGUtilAvailable() ) {
                 try {
                     final IOUtil.ClassResources iconRes = NewtFactory.getWindowIcons();
@@ -76,7 +76,7 @@ public class DisplayDriver extends DisplayImpl {
                         final PNGPixelRect image = PNGPixelRect.read(urlConn.getInputStream(), PixelFormat.BGRA8888, false /* directBuffer */, 0 /* destMinStrideInBytes */, false /* destIsGLOriented */);
                         _defaultIconHandle[1] = DisplayDriver.createBGRA8888Icon0(image.getPixels(), image.getSize().getWidth(), image.getSize().getHeight(), false, 0, 0);
                     }
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     e.printStackTrace();
                 }
             }
@@ -110,7 +110,7 @@ public class DisplayDriver extends DisplayImpl {
     }
 
     @Override
-    protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+    protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
         sharedClassFactory.releaseSharedClass();
         aDevice.close();
     }
@@ -125,12 +125,12 @@ public class DisplayDriver extends DisplayImpl {
     }
 
     @Override
-    protected final long createPointerIconImpl(PixelFormat pixelformat, int width, int height, final ByteBuffer pixels, final int hotX, final int hotY) {
+    protected final long createPointerIconImpl(final PixelFormat pixelformat, final int width, final int height, final ByteBuffer pixels, final int hotX, final int hotY) {
         return createBGRA8888Icon0(pixels, width, height, true, hotX, hotY);
     }
 
     @Override
-    protected final void destroyPointerIconImpl(final long displayHandle, long piHandle) {
+    protected final void destroyPointerIconImpl(final long displayHandle, final long piHandle) {
         destroyIcon0(piHandle);
     }
 
@@ -139,7 +139,7 @@ public class DisplayDriver extends DisplayImpl {
     //
     private static native void DispatchMessages0();
 
-    static long createBGRA8888Icon0(Buffer pixels, int width, int height, boolean isCursor, int hotX, int hotY) {
+    static long createBGRA8888Icon0(final Buffer pixels, final int width, final int height, final boolean isCursor, final int hotX, final int hotY) {
         if( null == pixels ) {
             throw new IllegalArgumentException("data buffer/size");
         }
diff --git a/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java
index e789b99..1cba421 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/ScreenDriver.java
@@ -65,14 +65,14 @@ public class ScreenDriver extends ScreenImpl {
     protected void closeNativeImpl() {
     }
 
-    private final String getAdapterName(int crt_idx) {
+    private final String getAdapterName(final int crt_idx) {
         return getAdapterName0(crt_idx);
     }
-    private final String getActiveMonitorName(String adapterName, int monitor_idx) {
+    private final String getActiveMonitorName(final String adapterName, final int monitor_idx) {
         return getActiveMonitorName0(adapterName, monitor_idx);
     }
 
-    private final MonitorMode getMonitorModeImpl(MonitorModeProps.Cache cache, String adapterName, int crtModeIdx) {
+    private final MonitorMode getMonitorModeImpl(final MonitorModeProps.Cache cache, final String adapterName, final int crtModeIdx) {
         if( null == adapterName ) {
             return null;
         }
@@ -85,7 +85,7 @@ public class ScreenDriver extends ScreenImpl {
     }
 
     @Override
-    protected void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
+    protected void collectNativeMonitorModesAndDevicesImpl(final MonitorModeProps.Cache cache) {
         int crtIdx = 0;
         ArrayHashSet<MonitorMode> supportedModes = new ArrayHashSet<MonitorMode>();
         String adapterName = getAdapterName(crtIdx);
@@ -118,26 +118,28 @@ public class ScreenDriver extends ScreenImpl {
     }
 
     @Override
-    protected Rectangle getNativeMonitorDeviceViewportImpl(MonitorDevice monitor) {
+    protected boolean updateNativeMonitorDeviceViewportImpl(final MonitorDevice monitor, final Rectangle viewportPU, final Rectangle viewportWU) {
         final String adapterName = getAdapterName(monitor.getId());
         if( null != adapterName ) {
             final String activeMonitorName = getActiveMonitorName(adapterName, 0);
             if( null != activeMonitorName ) {
                 final int[] monitorProps = getMonitorDevice0(adapterName, monitor.getId());
                 int offset = MonitorModeProps.IDX_MONITOR_DEVICE_VIEWPORT;
-                return new Rectangle(monitorProps[offset++], monitorProps[offset++], monitorProps[offset++], monitorProps[offset++]);
+                viewportPU.set(monitorProps[offset++], monitorProps[offset++], monitorProps[offset++], monitorProps[offset++]);
+                viewportWU.set(monitorProps[offset++], monitorProps[offset++], monitorProps[offset++], monitorProps[offset++]);
+                return true;
             }
         }
-        return null;
+        return false;
     }
 
     @Override
-    protected MonitorMode queryCurrentMonitorModeImpl(MonitorDevice monitor) {
+    protected MonitorMode queryCurrentMonitorModeImpl(final MonitorDevice monitor) {
         return getMonitorModeImpl(null, getAdapterName(monitor.getId()), -1);
     }
 
     @Override
-    protected boolean setCurrentMonitorModeImpl(MonitorDevice monitor, MonitorMode mode)  {
+    protected boolean setCurrentMonitorModeImpl(final MonitorDevice monitor, final MonitorMode mode)  {
         return setMonitorMode0(monitor.getId(),
                                -1, -1, // no fixed position!
                                mode.getSurfaceSize().getResolution().getWidth(),
@@ -149,13 +151,13 @@ public class ScreenDriver extends ScreenImpl {
     }
 
     @Override
-    protected int validateScreenIndex(int idx) {
+    protected int validateScreenIndex(final int idx) {
         return 0; // big-desktop w/ multiple monitor attached, only one screen available
     }
 
     @Override
-    protected void calcVirtualScreenOriginAndSize(Rectangle vOriginSize) {
-        vOriginSize.set(getVirtualOriginX0(), getVirtualOriginY0(), getVirtualWidthImpl0(), getVirtualHeightImpl0());
+    protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
+        viewport.set(getVirtualOriginX0(), getVirtualOriginY0(), getVirtualWidthImpl0(), getVirtualHeightImpl0());
     }
 
     // Native calls
diff --git a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
index a48fe2f..1c5c344 100644
--- a/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/windows/WindowDriver.java
@@ -116,7 +116,7 @@ public class WindowDriver extends WindowImpl {
     @Override
     public boolean hasDeviceChanged() {
         if(0!=getWindowHandle()) {
-            long _hmon = MonitorFromWindow0(getWindowHandle());
+            final long _hmon = MonitorFromWindow0(getWindowHandle());
             if (hmon != _hmon) {
                 if(DEBUG_IMPLEMENTATION) {
                     System.err.println("Info: Window Device Changed "+Thread.currentThread().getName()+
@@ -145,7 +145,8 @@ public class WindowDriver extends WindowImpl {
                           ( FLAG_IS_ALWAYSONTOP | FLAG_IS_UNDECORATED ) ;
         final long _windowHandle = CreateWindow0(DisplayDriver.getHInstance(), display.getWindowClassName(), display.getWindowClassName(),
                                                  winVer.getMajor(), winVer.getMinor(),
-                                                 getParentWindowHandle(), getX(), getY(), getWidth(), getHeight(), autoPosition(), flags);
+                                                 getParentWindowHandle(),
+                                                 getX(), getY(), getWidth(), getHeight(), autoPosition(), flags);
         if ( 0 == _windowHandle ) {
             throw new NativeWindowException("Error creating window");
         }
@@ -153,7 +154,7 @@ public class WindowDriver extends WindowImpl {
         windowHandleClose = _windowHandle;
 
         if(DEBUG_IMPLEMENTATION) {
-            Exception e = new Exception("Info: Window new window handle "+Thread.currentThread().getName()+
+            final Exception e = new Exception("Info: Window new window handle "+Thread.currentThread().getName()+
                                         " (Parent HWND "+toHexString(getParentWindowHandle())+
                                         ") : HWND "+toHexString(_windowHandle)+", "+Thread.currentThread());
             e.printStackTrace();
@@ -166,18 +167,18 @@ public class WindowDriver extends WindowImpl {
             if ( 0 != hdc ) {
                 try {
                     GDI.ReleaseDC(windowHandleClose, hdc);
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     if(DEBUG_IMPLEMENTATION) {
-                        Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
+                        final Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
                         e.printStackTrace();
                     }
                 }
             }
             try {
                 GDI.DestroyWindow(windowHandleClose);
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 if(DEBUG_IMPLEMENTATION) {
-                    Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
+                    final Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
                     e.printStackTrace();
                 }
             }
@@ -188,7 +189,7 @@ public class WindowDriver extends WindowImpl {
     }
 
     @Override
-    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, int flags) {
+    protected boolean reconfigureWindowImpl(int x, int y, int width, int height, final int flags) {
         if(DEBUG_IMPLEMENTATION) {
             System.err.println("WindowsWindow reconfig: "+x+"/"+y+" "+width+"x"+height+", "+
                                getReconfigureFlagsAsString(null, flags));
@@ -216,7 +217,7 @@ public class WindowDriver extends WindowImpl {
     }
 
     @Override
-    protected void requestFocusImpl(boolean force) {
+    protected void requestFocusImpl(final boolean force) {
         requestFocus0(getWindowHandle(), force);
     }
 
@@ -250,9 +251,10 @@ public class WindowDriver extends WindowImpl {
         this.runOnEDTIfAvail(true, new Runnable() {
             @Override
             public void run() {
-                final Point p0 = getLocationOnScreenImpl(0, 0);
+                final Point p0 = convertToPixelUnits( getLocationOnScreenImpl(0, 0) );
                 res[0] = Boolean.valueOf(confinePointer0(getWindowHandle(), confine,
-                        p0.getX(), p0.getY(), p0.getX()+getWidth(), p0.getY()+getHeight()));
+                                                         p0.getX(), p0.getY(),
+                                                         p0.getX()+getSurfaceWidth(), p0.getY()+getSurfaceHeight()));
             }
         });
         return res[0].booleanValue();
@@ -263,7 +265,7 @@ public class WindowDriver extends WindowImpl {
         this.runOnEDTIfAvail(true, new Runnable() {
             @Override
             public void run() {
-                final Point sPos = getLocationOnScreenImpl(x, y);
+                final Point sPos = convertToPixelUnits( getLocationOnScreenImpl(x, y) );
                 warpPointer0(getWindowHandle(), sPos.getX(), sPos.getY());
             }
         });
@@ -271,12 +273,12 @@ public class WindowDriver extends WindowImpl {
     }
 
     @Override
-    protected Point getLocationOnScreenImpl(int x, int y) {
+    protected Point getLocationOnScreenImpl(final int x, final int y) {
         return GDIUtil.GetRelativeLocation( getWindowHandle(), 0 /*root win*/, x, y);
     }
 
     @Override
-    protected void updateInsetsImpl(Insets insets) {
+    protected void updateInsetsImpl(final Insets insets) {
         // nop - using event driven insetsChange(..)
     }
 
@@ -293,9 +295,9 @@ public class WindowDriver extends WindowImpl {
      * for details.
      * </p>
      */
-    public final void sendTouchScreenEvent(short eventType, int modifiers,
-                                           int pActionIdx, int[] pNames,
-                                           int[] pX, int[] pY, float[] pPressure, float maxPressure) {
+    public final void sendTouchScreenEvent(final short eventType, final int modifiers,
+                                           final int pActionIdx, final int[] pNames,
+                                           final int[] pX, final int[] pY, final float[] pPressure, final float maxPressure) {
         final int pCount = pNames.length;
         final MouseEvent.PointerType[] pTypes = new MouseEvent.PointerType[pCount];
         for(int i=pCount-1; i>=0; i--) { pTypes[i] = PointerType.TouchScreen; }
@@ -309,7 +311,7 @@ public class WindowDriver extends WindowImpl {
     //
     private short repeatedKey = KeyEvent.VK_UNDEFINED;
 
-    private final boolean handlePressTypedAutoRepeat(boolean isModifierKey, int modifiers, short keyCode, short keySym, char keyChar) {
+    private final boolean handlePressTypedAutoRepeat(final boolean isModifierKey, int modifiers, final short keyCode, final short keySym, final char keyChar) {
         if( setKeyPressed(keyCode, true) ) {
             // AR: Key was already pressed: Either [enter | within] AR mode
             final boolean withinAR = repeatedKey == keyCode;
@@ -329,7 +331,7 @@ public class WindowDriver extends WindowImpl {
     }
 
     @Override
-    public final void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
+    public final void sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
         final boolean isModifierKey = KeyEvent.isModifierKey(keySym);
         // System.err.println("*** sendKeyEvent: event "+KeyEvent.getEventTypeString(eventType)+", keyCode "+toHexString(keyCode)+", keyChar <"+keyChar+">, mods "+toHexString(modifiers)+
         //                   ", isKeyCodeTracked "+isKeyCodeTracked(keyCode)+", was: pressed "+isKeyPressed(keyCode)+", printableKey "+KeyEvent.isPrintableKey(keyCode, false)+" [modifierKey "+isModifierKey+"] - "+System.currentTimeMillis());
@@ -357,7 +359,7 @@ public class WindowDriver extends WindowImpl {
     }
 
     @Override
-    public final void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
+    public final void enqueueKeyEvent(final boolean wait, final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
         throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
     }
 
diff --git a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
index 5c2820d..759c274 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/DisplayDriver.java
@@ -69,7 +69,7 @@ public class DisplayDriver extends DisplayImpl {
     }
 
     @Override
-    public String validateDisplayName(String name, long handle) {
+    public String validateDisplayName(final String name, final long handle) {
         return X11Util.validateDisplayName(name, handle);
     }
 
@@ -81,21 +81,21 @@ public class DisplayDriver extends DisplayImpl {
     @Override
     protected void createNativeImpl() {
         X11Util.setX11ErrorHandler(true, DEBUG ? false : true); // make sure X11 error handler is set
-        long handle = X11Util.openDisplay(name);
+        final long handle = X11Util.openDisplay(name);
         if( 0 == handle ) {
             throw new RuntimeException("Error creating display(Win): "+name);
         }
         aDevice = new X11GraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_UNIT, true /* owner */);
         try {
             CompleteDisplay0(aDevice.getHandle());
-        } catch(RuntimeException e) {
+        } catch(final RuntimeException e) {
             closeNativeImpl(aDevice);
             throw e;
         }
     }
 
     @Override
-    protected void closeNativeImpl(AbstractGraphicsDevice aDevice) {
+    protected void closeNativeImpl(final AbstractGraphicsDevice aDevice) {
         DisplayRelease0(aDevice.getHandle(), javaObjectAtom, windowDeleteAtom /*, kbdHandle */); // XKB disabled for now
         javaObjectAtom = 0;
         windowDeleteAtom = 0;
@@ -128,12 +128,12 @@ public class DisplayDriver extends DisplayImpl {
     public final PixelFormat getNativePointerIconPixelFormat() { return PixelFormat.RGBA8888; }
 
     @Override
-    protected final long createPointerIconImpl(PixelFormat pixelformat, int width, int height, final ByteBuffer pixels, final int hotX, final int hotY) {
+    protected final long createPointerIconImpl(final PixelFormat pixelformat, final int width, final int height, final ByteBuffer pixels, final int hotX, final int hotY) {
         return createPointerIcon(getHandle(), pixels, width, height, hotX, hotY);
     }
 
     @Override
-    protected final void destroyPointerIconImpl(final long displayHandle, long piHandle) {
+    protected final void destroyPointerIconImpl(final long displayHandle, final long piHandle) {
         destroyPointerIcon0(displayHandle, piHandle);
     }
 
@@ -145,7 +145,7 @@ public class DisplayDriver extends DisplayImpl {
 
     private native void CompleteDisplay0(long handle);
 
-    private void displayCompleted(long javaObjectAtom, long windowDeleteAtom /*, long kbdHandle */) {
+    private void displayCompleted(final long javaObjectAtom, final long windowDeleteAtom /*, long kbdHandle */) {
         this.javaObjectAtom=javaObjectAtom;
         this.windowDeleteAtom=windowDeleteAtom;
         // this.kbdHandle = kbdHandle; // XKB disabled for now
@@ -154,7 +154,7 @@ public class DisplayDriver extends DisplayImpl {
 
     private native void DispatchMessages0(long display, long javaObjectAtom, long windowDeleteAtom /* , long kbdHandle */); // XKB disabled for now
 
-    private static long createPointerIcon(long display, Buffer pixels, int width, int height, int hotX, int hotY) {
+    private static long createPointerIcon(final long display, final Buffer pixels, final int width, final int height, final int hotX, final int hotY) {
         final boolean pixels_is_direct = Buffers.isDirect(pixels);
         return createPointerIcon0(display,
                                   pixels_is_direct ? pixels : Buffers.getArray(pixels),
diff --git a/src/newt/classes/jogamp/newt/driver/x11/RandR11.java b/src/newt/classes/jogamp/newt/driver/x11/RandR11.java
index 6c22a3f..4803852 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/RandR11.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/RandR11.java
@@ -35,6 +35,7 @@ import jogamp.newt.ScreenImpl;
 import com.jogamp.common.util.VersionNumber;
 import com.jogamp.newt.MonitorDevice;
 import com.jogamp.newt.MonitorMode;
+import com.jogamp.newt.Screen;
 
 class RandR11 implements RandR {
     private static final boolean DEBUG = ScreenDriver.DEBUG;
@@ -59,7 +60,7 @@ class RandR11 implements RandR {
     private int[] idx_rate = null, idx_res = null;
 
     @Override
-    public boolean beginInitialQuery(long dpy, ScreenDriver screen) {
+    public boolean beginInitialQuery(final long dpy, final ScreenDriver screen) {
         // initialize iterators and static data
         final int screen_idx = screen.getIndex();
         resolutionCount = getNumScreenResolutions0(dpy, screen_idx);
@@ -96,7 +97,7 @@ class RandR11 implements RandR {
     }
 
     @Override
-    public void endInitialQuery(long dpy, ScreenDriver screen) {
+    public void endInitialQuery(final long dpy, final ScreenDriver screen) {
         idx_rate=null;
         idx_res=null;
         nrates=null;
@@ -153,7 +154,7 @@ class RandR11 implements RandR {
             }
         }
 
-        int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
+        final int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
         int i = 0;
         props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
         props[i++] = res[0]; // width
@@ -187,10 +188,14 @@ class RandR11 implements RandR {
         props[i++] = crt_idx;
         props[i++] = widthMM;
         props[i++] = heightMM;
-        props[i++] = 0; // rotated viewport x
-        props[i++] = 0; // rotated viewport y
-        props[i++] = currentMode.getRotatedWidth();  // rotated viewport width
-        props[i++] = currentMode.getRotatedHeight(); // rotated viewport height
+        props[i++] = 0; // rotated viewport x pixel-units
+        props[i++] = 0; // rotated viewport y pixel-units
+        props[i++] = currentMode.getRotatedWidth();  // rotated viewport width pixel-units
+        props[i++] = currentMode.getRotatedHeight(); // rotated viewport height pixel-units
+        props[i++] = 0; // rotated viewport x window-units
+        props[i++] = 0; // rotated viewport y window-units
+        props[i++] = currentMode.getRotatedWidth();  // rotated viewport width window-units
+        props[i++] = currentMode.getRotatedHeight(); // rotated viewport height window-units
         props[i++] = currentMode.getId(); // current mode id
         props[i++] = currentMode.getRotation();
         for(int j=0; j<allModesCount; j++) {
@@ -206,14 +211,14 @@ class RandR11 implements RandR {
             return null;
         }
         final int screen_idx = screen.getIndex();
-        long screenConfigHandle = getScreenConfiguration0(dpy, screen_idx);
+        final long screenConfigHandle = getScreenConfiguration0(dpy, screen_idx);
         if(0 == screenConfigHandle) {
             return null;
         }
         int[] res;
         final int nres_idx;
         try {
-            int resNumber = getNumScreenResolutions0(dpy, screen_idx);
+            final int resNumber = getNumScreenResolutions0(dpy, screen_idx);
             if(0==resNumber) {
                 return null;
             }
@@ -235,7 +240,7 @@ class RandR11 implements RandR {
         } finally {
              freeScreenConfiguration0(screenConfigHandle);
         }
-        int[] props = new int[4];
+        final int[] props = new int[4];
         int i = 0;
         props[i++] = 0;
         props[i++] = 0;
@@ -251,7 +256,7 @@ class RandR11 implements RandR {
             return null;
         }
         final int screen_idx = screen.getIndex();
-        long screenConfigHandle = getScreenConfiguration0(dpy, screen_idx);
+        final long screenConfigHandle = getScreenConfiguration0(dpy, screen_idx);
         if(0 == screenConfigHandle) {
             return null;
         }
@@ -259,7 +264,7 @@ class RandR11 implements RandR {
         int rate, rot;
         final int nres_idx;
         try {
-            int resNumber = getNumScreenResolutions0(dpy, screen_idx);
+            final int resNumber = getNumScreenResolutions0(dpy, screen_idx);
             if(0==resNumber) {
                 return null;
             }
@@ -289,7 +294,7 @@ class RandR11 implements RandR {
         } finally {
              freeScreenConfiguration0(screenConfigHandle);
         }
-        int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
+        final int[] props = new int[ MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL ];
         int i = 0;
         props[i++] = MonitorModeProps.NUM_MONITOR_MODE_PROPERTIES_ALL;
         props[i++] = res[0]; // width
@@ -306,11 +311,11 @@ class RandR11 implements RandR {
     }
 
     @Override
-    public boolean setCurrentMonitorMode(final long dpy, final ScreenDriver screen, MonitorDevice monitor, final MonitorMode mode) {
+    public boolean setCurrentMonitorMode(final long dpy, final ScreenDriver screen, final MonitorDevice monitor, final MonitorMode mode) {
         final long t0 = System.currentTimeMillis();
         boolean done = false;
         final int screen_idx = screen.getIndex();
-        long screenConfigHandle = getScreenConfiguration0(dpy, screen_idx);
+        final long screenConfigHandle = getScreenConfiguration0(dpy, screen_idx);
         if(0 == screenConfigHandle) {
             return Boolean.valueOf(done);
         }
@@ -323,10 +328,10 @@ class RandR11 implements RandR {
             final int r = mode.getRotation();
 
             if( setCurrentScreenModeStart0(dpy, screen_idx, screenConfigHandle, resId, f, r) ) {
-                while(!done && System.currentTimeMillis()-t0 < ScreenImpl.SCREEN_MODE_CHANGE_TIMEOUT) {
+                while(!done && System.currentTimeMillis()-t0 < Screen.SCREEN_MODE_CHANGE_TIMEOUT) {
                     done = setCurrentScreenModePollEnd0(dpy, screen_idx, resId, f, r);
                     if(!done) {
-                        try { Thread.sleep(10); } catch (InterruptedException e) { }
+                        try { Thread.sleep(10); } catch (final InterruptedException e) { }
                     }
                 }
             }
@@ -337,7 +342,7 @@ class RandR11 implements RandR {
     }
 
     @Override
-    public final void updateScreenViewport(final long dpy, final ScreenDriver screen, RectangleImmutable viewport) {
+    public final void updateScreenViewport(final long dpy, final ScreenDriver screen, final RectangleImmutable viewport) {
         // nop
     }
 
diff --git a/src/newt/classes/jogamp/newt/driver/x11/RandR13.java b/src/newt/classes/jogamp/newt/driver/x11/RandR13.java
index a08741d..7a409bb 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/RandR13.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/RandR13.java
@@ -58,7 +58,7 @@ class RandR13 implements RandR {
 
     @Override
     public void dumpInfo(final long dpy, final int screen_idx) {
-        long screenResources = getScreenResources0(dpy, screen_idx);
+        final long screenResources = getScreenResources0(dpy, screen_idx);
         if(0 == screenResources) {
             return;
         }
@@ -73,7 +73,7 @@ class RandR13 implements RandR {
     IntLongHashMap crtInfoHandleMap = null;
 
     @Override
-    public boolean beginInitialQuery(long dpy, ScreenDriver screen) {
+    public boolean beginInitialQuery(final long dpy, final ScreenDriver screen) {
         final int screen_idx = screen.getIndex();
         sessionScreenResources = getScreenResources0(dpy, screen_idx);
         if( 0 != sessionScreenResources ) {
@@ -86,9 +86,9 @@ class RandR13 implements RandR {
     }
 
     @Override
-    public void endInitialQuery(long dpy, ScreenDriver screen) {
+    public void endInitialQuery(final long dpy, final ScreenDriver screen) {
         if( null != crtInfoHandleMap ) {
-            for(Iterator<IntLongHashMap.Entry> iter = crtInfoHandleMap.iterator(); iter.hasNext(); ) {
+            for(final Iterator<IntLongHashMap.Entry> iter = crtInfoHandleMap.iterator(); iter.hasNext(); ) {
                 final IntLongHashMap.Entry entry = iter.next();
                 freeMonitorInfoHandle0(entry.value);
             }
@@ -113,7 +113,7 @@ class RandR13 implements RandR {
         }
     }
 
-    private final long getMonitorInfoHandle(final long dpy, final int screen_idx, long screenResources, final int monitor_idx) {
+    private final long getMonitorInfoHandle(final long dpy, final int screen_idx, final long screenResources, final int monitor_idx) {
         if( null != crtInfoHandleMap ) {
             long h = crtInfoHandleMap.get(monitor_idx);
             if( 0 == h ) {
@@ -174,7 +174,7 @@ class RandR13 implements RandR {
     }
 
     @Override
-    public int[] getMonitorDeviceProps(final long dpy, final ScreenDriver screen, MonitorModeProps.Cache cache, final int crt_idx) {
+    public int[] getMonitorDeviceProps(final long dpy, final ScreenDriver screen, final MonitorModeProps.Cache cache, final int crt_idx) {
         final int screen_idx = screen.getIndex();
         final long screenResources = getScreenResourceHandle(dpy, screen_idx);
         try {
@@ -222,7 +222,7 @@ class RandR13 implements RandR {
     }
 
     @Override
-    public boolean setCurrentMonitorMode(final long dpy, final ScreenDriver screen, MonitorDevice monitor, final MonitorMode mode) {
+    public boolean setCurrentMonitorMode(final long dpy, final ScreenDriver screen, final MonitorDevice monitor, final MonitorMode mode) {
         final int screen_idx = screen.getIndex();
         final long screenResources = getScreenResourceHandle(dpy, screen_idx);
         final boolean res;
diff --git a/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
index bef7f60..1d77974 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/ScreenDriver.java
@@ -48,6 +48,7 @@ import jogamp.newt.DisplayImpl.DisplayRunnable;
 import jogamp.newt.ScreenImpl;
 
 import com.jogamp.common.util.ArrayHashSet;
+import com.jogamp.common.util.PropertyAccess;
 import com.jogamp.common.util.VersionNumber;
 import com.jogamp.nativewindow.x11.X11GraphicsDevice;
 import com.jogamp.nativewindow.x11.X11GraphicsScreen;
@@ -59,7 +60,7 @@ public class ScreenDriver extends ScreenImpl {
 
     static {
         Debug.initSingleton();
-        DEBUG_TEST_RANDR13_DISABLED = Debug.isPropertyDefined("newt.test.Screen.disableRandR13", true);
+        DEBUG_TEST_RANDR13_DISABLED = PropertyAccess.isPropertyDefined("newt.test.Screen.disableRandR13", true);
 
         DisplayDriver.initSingleton();
     }
@@ -73,10 +74,10 @@ public class ScreenDriver extends ScreenImpl {
     @Override
     protected void createNativeImpl() {
         // validate screen index
-        Long handle = runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Long>() {
+        final Long handle = runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Long>() {
             @Override
-            public Long run(long dpy) {
-                return new Long(GetScreen0(dpy, screen_idx));
+            public Long run(final long dpy) {
+                return Long.valueOf(GetScreen0(dpy, screen_idx));
             } } );
         if (handle.longValue() == 0) {
             throw new RuntimeException("Error creating screen: " + screen_idx);
@@ -85,7 +86,7 @@ public class ScreenDriver extends ScreenImpl {
         final long dpy = x11dev.getHandle();
         aScreen = new X11GraphicsScreen(x11dev, screen_idx);
         {
-            int v[] = getRandRVersion0(dpy);
+            final int v[] = getRandRVersion0(dpy);
             randrVersion = new VersionNumber(v[0], v[1], 0);
         }
         {
@@ -111,7 +112,7 @@ public class ScreenDriver extends ScreenImpl {
     private RandR rAndR;
 
     @Override
-    protected final void collectNativeMonitorModesAndDevicesImpl(MonitorModeProps.Cache cache) {
+    protected final void collectNativeMonitorModesAndDevicesImpl(final MonitorModeProps.Cache cache) {
         if( null == rAndR ) { return; }
         final AbstractGraphicsDevice device = getDisplay().getGraphicsDevice();
         device.lock();
@@ -165,12 +166,14 @@ public class ScreenDriver extends ScreenImpl {
     }
 
     @Override
-    protected Rectangle getNativeMonitorDeviceViewportImpl(MonitorDevice monitor) {
+    protected boolean updateNativeMonitorDeviceViewportImpl(final MonitorDevice monitor, final Rectangle viewportPU, final Rectangle viewportWU) {
         final AbstractGraphicsDevice device = getDisplay().getGraphicsDevice();
         device.lock();
         try {
-            int[] viewportProps = rAndR.getMonitorDeviceViewport(device.getHandle(), this, monitor.getId());
-            return new Rectangle(viewportProps[0], viewportProps[1], viewportProps[2], viewportProps[3]);
+            final int[] viewportProps = rAndR.getMonitorDeviceViewport(device.getHandle(), this, monitor.getId());
+            viewportPU.set(viewportProps[0], viewportProps[1], viewportProps[2], viewportProps[3]);
+            viewportWU.set(viewportProps[0], viewportProps[1], viewportProps[2], viewportProps[3]); // equal window-units and pixel-units
+            return true;
         } finally {
             device.unlock();
         }
@@ -182,7 +185,7 @@ public class ScreenDriver extends ScreenImpl {
 
         return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<MonitorMode>() {
             @Override
-            public MonitorMode run(long dpy) {
+            public MonitorMode run(final long dpy) {
                 final int[] currentModeProps = rAndR.getCurrentMonitorModeProps(dpy, ScreenDriver.this, monitor.getId());
                 return MonitorModeProps.streamInMonitorMode(null, null, currentModeProps, 0);
             } } );
@@ -193,9 +196,9 @@ public class ScreenDriver extends ScreenImpl {
         if( null == rAndR ) { return false; }
 
         final long t0 = System.currentTimeMillis();
-        boolean done = runWithOptTempDisplayHandle( new DisplayImpl.DisplayRunnable<Boolean>() {
+        final boolean done = runWithOptTempDisplayHandle( new DisplayImpl.DisplayRunnable<Boolean>() {
             @Override
-            public Boolean run(long dpy) {
+            public Boolean run(final long dpy) {
                 return Boolean.valueOf( rAndR.setCurrentMonitorMode(dpy, ScreenDriver.this, monitor, mode) );
             }
         }).booleanValue();
@@ -207,10 +210,10 @@ public class ScreenDriver extends ScreenImpl {
         return done;
     }
 
-    private DisplayImpl.DisplayRunnable<Boolean> xineramaEnabledQueryWithTemp = new DisplayImpl.DisplayRunnable<Boolean>() {
+    private final DisplayImpl.DisplayRunnable<Boolean> xineramaEnabledQueryWithTemp = new DisplayImpl.DisplayRunnable<Boolean>() {
         @Override
-        public Boolean run(long dpy) {
-            return new Boolean(X11Util.XineramaIsEnabled(dpy));
+        public Boolean run(final long dpy) {
+            return Boolean.valueOf(X11Util.XineramaIsEnabled(dpy));
         } };
 
     @Override
@@ -225,8 +228,8 @@ public class ScreenDriver extends ScreenImpl {
     }
 
     @Override
-    protected void calcVirtualScreenOriginAndSize(final Rectangle vOriginSize) {
-        final RectangleImmutable ov = (RectangleImmutable) getViewport().cloneMutable();
+    protected void calcVirtualScreenOriginAndSize(final Rectangle viewport, final Rectangle viewportInWindowUnits) {
+        final RectangleImmutable ov = DEBUG ? (RectangleImmutable) getViewport().cloneMutable() : null;
         /**
         if( null != rAndR && rAndR.getVersion().compareTo(RandR.version130) >= 0 && getMonitorDevices().size()>0 ) {
             super.calcVirtualScreenOriginAndSize(vOriginSize);
@@ -241,12 +244,12 @@ public class ScreenDriver extends ScreenImpl {
         } else */ {
             runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
                 @Override
-                public Object run(long dpy) {
-                    vOriginSize.set(0, 0, getWidth0(dpy, screen_idx), getHeight0(dpy, screen_idx));
+                public Object run(final long dpy) {
+                    viewport.set(0, 0, getWidth0(dpy, screen_idx), getHeight0(dpy, screen_idx));
                     return null;
                 } } );
             if( DEBUG ) {
-                System.err.println("X11Screen.calcVirtualScreenOriginAndSize: Querying X11: "+ov+" -> "+vOriginSize);
+                System.err.println("X11Screen.calcVirtualScreenOriginAndSize: Querying X11: "+ov+" -> "+viewport);
             }
         }
     }
@@ -254,11 +257,11 @@ public class ScreenDriver extends ScreenImpl {
     //----------------------------------------------------------------------
     // Internals only
     //
-    private final <T> T runWithLockedDisplayDevice(DisplayRunnable<T> action) {
+    private final <T> T runWithLockedDisplayDevice(final DisplayRunnable<T> action) {
         return display.runWithLockedDisplayDevice(action);
     }
 
-    private final <T> T runWithTempDisplayHandle(DisplayRunnable<T> action) {
+    private final <T> T runWithTempDisplayHandle(final DisplayRunnable<T> action) {
         final long displayHandle = X11Util.openDisplay(display.getName());
         if(0 == displayHandle) {
             throw new RuntimeException("null device");
@@ -272,7 +275,7 @@ public class ScreenDriver extends ScreenImpl {
         return res;
     }
 
-    private final <T> T runWithOptTempDisplayHandle(DisplayRunnable<T> action) {
+    private final <T> T runWithOptTempDisplayHandle(final DisplayRunnable<T> action) {
         if( null != rAndR && rAndR.getVersion().compareTo(RandR.version130) >= 0 ) {
             return display.runWithLockedDisplayDevice(action);
         } else {
diff --git a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
index 0eda37e..afa9786 100644
--- a/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
+++ b/src/newt/classes/jogamp/newt/driver/x11/WindowDriver.java
@@ -80,7 +80,7 @@ public class WindowDriver extends WindowImpl {
                 _icon_data = PNGIcon.arrayToX11BGRAImages(NewtFactory.getWindowIcons(), data_size, elem_bytesize);
                 _icon_data_size = data_size[0];
                 _icon_elem_bytesize = elem_bytesize[0];
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
             }
         }
@@ -143,15 +143,15 @@ public class WindowDriver extends WindowImpl {
     @Override
     protected void closeNativeImpl() {
         if(0!=windowHandleClose && null!=getScreen() ) {
-            DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
+            final DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
             final AbstractGraphicsDevice edtDevice = display.getGraphicsDevice();
             edtDevice.lock();
             try {
                 CloseWindow0(edtDevice.getHandle(), windowHandleClose,
                              display.getJavaObjectAtom(), display.getWindowDeleteAtom() /* , display.getKbdHandle() */); // XKB disabled for now
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 if(DEBUG_IMPLEMENTATION) {
-                    Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
+                    final Exception e = new Exception("Warning: closeNativeImpl failed - "+Thread.currentThread().getName(), t);
                     e.printStackTrace();
                 }
             } finally {
@@ -172,7 +172,7 @@ public class WindowDriver extends WindowImpl {
      * {@inheritDoc}
      */
     @Override
-    protected boolean isReconfigureFlagSupported(int changeFlags) {
+    protected boolean isReconfigureFlagSupported(final int changeFlags) {
         return true; // all flags!
     }
 
@@ -208,7 +208,7 @@ public class WindowDriver extends WindowImpl {
         final DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
         runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
             @Override
-            public Object run(long dpy) {
+            public Object run(final long dpy) {
                 reconfigureWindow0( dpy, getScreenIndex(),
                                     getParentWindowHandle(), getWindowHandle(), display.getWindowDeleteAtom(),
                                     _x, _y, width, height, fflags);
@@ -226,7 +226,7 @@ public class WindowDriver extends WindowImpl {
      * {@inheritDoc}
      */
     @Override
-    protected void focusChanged(boolean defer, boolean focusGained) {
+    protected void focusChanged(final boolean defer, final boolean focusGained) {
         if( isNativeValid() && isFullscreen() && tempFSAlwaysOnTop && hasFocus() != focusGained ) {
             final int flags = getReconfigureFlags(FLAG_CHANGE_ALWAYSONTOP, isVisible()) | ( focusGained ? FLAG_IS_ALWAYSONTOP : 0 );
             if(DEBUG_IMPLEMENTATION) {
@@ -235,7 +235,7 @@ public class WindowDriver extends WindowImpl {
             final DisplayDriver display = (DisplayDriver) getScreen().getDisplay();
             runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
                 @Override
-                public Object run(long dpy) {
+                public Object run(final long dpy) {
                     reconfigureWindow0( dpy, getScreenIndex(),
                                         getParentWindowHandle(), getWindowHandle(), display.getWindowDeleteAtom(),
                                         getX(), getY(), getWidth(), getHeight(), flags);
@@ -246,7 +246,7 @@ public class WindowDriver extends WindowImpl {
         super.focusChanged(defer, focusGained);
     }
 
-    protected void reparentNotify(long newParentWindowHandle) {
+    protected void reparentNotify(final long newParentWindowHandle) {
         if(DEBUG_IMPLEMENTATION) {
             final long p0 = getParentWindowHandle();
             System.err.println("Window.reparentNotify ("+getThreadName()+"): "+toHexString(p0)+" -> "+toHexString(newParentWindowHandle));
@@ -257,7 +257,7 @@ public class WindowDriver extends WindowImpl {
     protected void requestFocusImpl(final boolean force) {
         runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
             @Override
-            public Object run(long dpy) {
+            public Object run(final long dpy) {
                 requestFocus0(dpy, getWindowHandle(), force);
                 return null;
             }
@@ -268,7 +268,7 @@ public class WindowDriver extends WindowImpl {
     protected void setTitleImpl(final String title) {
         runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
             @Override
-            public Object run(long dpy) {
+            public Object run(final long dpy) {
                 setTitle0(dpy, getWindowHandle(), title);
                 return null;
             }
@@ -279,10 +279,10 @@ public class WindowDriver extends WindowImpl {
     protected void setPointerIconImpl(final PointerIconImpl pi) {
         runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
             @Override
-            public Object run(long dpy) {
+            public Object run(final long dpy) {
                 try {
                     setPointerIcon0(dpy, getWindowHandle(), null != pi ? pi.validatedHandle() : 0);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     e.printStackTrace();
                 }
                 return null;
@@ -294,11 +294,11 @@ public class WindowDriver extends WindowImpl {
     protected boolean setPointerVisibleImpl(final boolean pointerVisible) {
         return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Boolean>() {
             @Override
-            public Boolean run(long dpy) {
+            public Boolean run(final long dpy) {
                 final PointerIconImpl pi = (PointerIconImpl)getPointerIcon();
                 final boolean res;
                 if( pointerVisible && null != pi ) {
-                    setPointerIcon0(dpy, getWindowHandle(), null != pi ? pi.validatedHandle() : 0);
+                    setPointerIcon0(dpy, getWindowHandle(), pi.validatedHandle());
                     res = true;
                 } else {
                     res = setPointerVisible0(dpy, getWindowHandle(), pointerVisible);
@@ -312,7 +312,7 @@ public class WindowDriver extends WindowImpl {
     protected boolean confinePointerImpl(final boolean confine) {
         return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Boolean>() {
             @Override
-            public Boolean run(long dpy) {
+            public Boolean run(final long dpy) {
                 return Boolean.valueOf(confinePointer0(dpy, getWindowHandle(), confine));
             }
         }).booleanValue();
@@ -322,7 +322,7 @@ public class WindowDriver extends WindowImpl {
     protected void warpPointerImpl(final int x, final int y) {
         runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Object>() {
             @Override
-            public Object run(long dpy) {
+            public Object run(final long dpy) {
                 warpPointer0(dpy, getWindowHandle(), x, y);
                 return null;
             }
@@ -333,20 +333,20 @@ public class WindowDriver extends WindowImpl {
     protected Point getLocationOnScreenImpl(final int x, final int y) {
         return runWithLockedDisplayDevice( new DisplayImpl.DisplayRunnable<Point>() {
             @Override
-            public Point run(long dpy) {
+            public Point run(final long dpy) {
                 return X11Lib.GetRelativeLocation(dpy, getScreenIndex(), getWindowHandle(), 0 /*root win*/, x, y);
             }
         } );
     }
 
     @Override
-    protected void updateInsetsImpl(Insets insets) {
+    protected void updateInsetsImpl(final Insets insets) {
         // nop - using event driven insetsChange(..)
     }
 
     @Override
-    protected final void doMouseEvent(boolean enqueue, boolean wait, short eventType, int modifiers,
-                                int x, int y, short button, float[] rotationXYZ, float rotationScale) {
+    protected final void doMouseEvent(final boolean enqueue, final boolean wait, short eventType, int modifiers,
+                                final int x, final int y, short button, final float[] rotationXYZ, final float rotationScale) {
         switch(eventType) {
             case MouseEvent.EVENT_MOUSE_PRESSED:
                 switch(button) {
@@ -390,10 +390,10 @@ public class WindowDriver extends WindowImpl {
     }
 
     /** Called by native TK */
-    protected final void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar0, String keyString) {
+    protected final void sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar0, final String keyString) {
         // handleKeyEvent(true, false, eventType, modifiers, keyCode, keyChar);
         final boolean isModifierKey = KeyEvent.isModifierKey(keyCode);
-        final boolean isAutoRepeat = 0 != ( KeyEvent.AUTOREPEAT_MASK & modifiers );
+        final boolean isAutoRepeat = 0 != ( InputEvent.AUTOREPEAT_MASK & modifiers );
         final char keyChar =  ( null != keyString ) ? keyString.charAt(0) : keyChar0;
         // System.err.println("*** sendKeyEvent: event "+KeyEvent.getEventTypeString(eventType)+", keyCode "+toHexString(keyCode)+", keyChar <"+keyChar0+">/<"+keyChar+">, keyString "+keyString+", mods "+toHexString(modifiers)+
         //                    ", isKeyCodeTracked "+isKeyCodeTracked(keyCode)+", was: pressed "+isKeyPressed(keyCode)+", repeat "+isAutoRepeat+", [modifierKey "+isModifierKey+"] - "+System.currentTimeMillis());
@@ -412,11 +412,11 @@ public class WindowDriver extends WindowImpl {
     }
 
     @Override
-    public final void sendKeyEvent(short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
+    public final void sendKeyEvent(final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
         throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
     }
     @Override
-    public final void enqueueKeyEvent(boolean wait, short eventType, int modifiers, short keyCode, short keySym, char keyChar) {
+    public final void enqueueKeyEvent(final boolean wait, final short eventType, final int modifiers, final short keyCode, final short keySym, final char keyChar) {
         throw new InternalError("XXX: Adapt Java Code to Native Code Changes");
     }
 
@@ -426,16 +426,16 @@ public class WindowDriver extends WindowImpl {
     private static final String getCurrentThreadName() { return Thread.currentThread().getName(); } // Callback for JNI
     private static final void dumpStack() { Thread.dumpStack(); } // Callback for JNI
 
-    private final <T> T runWithLockedDisplayDevice(DisplayRunnable<T> action) {
+    private final <T> T runWithLockedDisplayDevice(final DisplayRunnable<T> action) {
         return ((DisplayDriver) getScreen().getDisplay()).runWithLockedDisplayDevice(action);
     }
 
     protected static native boolean initIDs0();
 
-    private long CreateWindow(long parentWindowHandle, long display, int screen_index,
-                              int visualID, long javaObjectAtom, long windowDeleteAtom,
-                              int x, int y, int width, int height, boolean autoPosition, int flags,
-                              int pixelDataSize, Buffer pixels) {
+    private long CreateWindow(final long parentWindowHandle, final long display, final int screen_index,
+                              final int visualID, final long javaObjectAtom, final long windowDeleteAtom,
+                              final int x, final int y, final int width, final int height, final boolean autoPosition, final int flags,
+                              final int pixelDataSize, final Buffer pixels) {
         // NOTE: MUST BE DIRECT BUFFER, since _NET_WM_ICON Atom uses buffer directly!
         if( !Buffers.isDirect(pixels) ) {
             throw new IllegalArgumentException("data buffer is not direct "+pixels);
diff --git a/src/newt/classes/jogamp/newt/event/NEWTEventTask.java b/src/newt/classes/jogamp/newt/event/NEWTEventTask.java
index 38a4342..2bdab27 100644
--- a/src/newt/classes/jogamp/newt/event/NEWTEventTask.java
+++ b/src/newt/classes/jogamp/newt/event/NEWTEventTask.java
@@ -35,18 +35,18 @@ import com.jogamp.newt.event.NEWTEvent;
  * which notifies after sending the event for the <code>invokeAndWait()</code> semantics.
  */
 public class NEWTEventTask {
-    private NEWTEvent event;
-    private Object notifyObject;
+    private final NEWTEvent event;
+    private final Object notifyObject;
     private RuntimeException exception;
 
-    public NEWTEventTask(NEWTEvent event, Object notifyObject) {
+    public NEWTEventTask(final NEWTEvent event, final Object notifyObject) {
         this.event = event ;
         this.notifyObject = notifyObject ;
         this.exception = null;
     }
 
     public final NEWTEvent get() { return event; }
-    public final void setException(RuntimeException e) { exception = e; }
+    public final void setException(final RuntimeException e) { exception = e; }
     public final RuntimeException getException() { return exception; }
     public final boolean isCallerWaiting() { return null != notifyObject; }
 
diff --git a/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java b/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java
index db89690..794e989 100644
--- a/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java
+++ b/src/newt/classes/jogamp/newt/swt/SWTEDTUtil.java
@@ -50,7 +50,7 @@ public class SWTEDTUtil implements EDTUtil {
     private int start_iter=0;
     private static long pollPeriod = EDTUtil.defaultEDTPollPeriod;
 
-    public SWTEDTUtil(final com.jogamp.newt.Display newtDisplay, org.eclipse.swt.widgets.Display swtDisplay) {
+    public SWTEDTUtil(final com.jogamp.newt.Display newtDisplay, final org.eclipse.swt.widgets.Display swtDisplay) {
         this.threadGroup = Thread.currentThread().getThreadGroup();
         this.name=Thread.currentThread().getName()+"-SWTDisplay-"+newtDisplay.getFQName()+"-EDT-";
         this.dispatchMessages = new Runnable() {
@@ -73,19 +73,28 @@ public class SWTEDTUtil implements EDTUtil {
     }
 
     @Override
-    public void setPollPeriod(long ms) {
-        pollPeriod = ms;
+    public void setPollPeriod(final long ms) {
+        pollPeriod = ms; // writing to static field is intended
     }
 
     @Override
-    public final boolean start() throws IllegalStateException {
+    public final void start() throws IllegalStateException {
         final boolean swtDisposed = swtDisplay.isDisposed();
         synchronized(edtLock) {
             if( nedt.isRunning() ) {
                 final Thread curT = Thread.currentThread();
-                final Thread swtT = !swtDisposed ? swtDisplay.getThread() : null;
+                final String swtTName;
+                final Thread swtT;
+                if( !swtDisposed ) {
+                    swtT = swtDisplay.getThread();
+                    swtTName = swtT.getName();
+                } else {
+                    swtT = null;
+                    swtTName = null;
+                }
                 final boolean onSWTEDT = swtT == curT;
-                throw new IllegalStateException("EDT still running and not subject to stop. Curr "+curT.getName()+", NEDT "+nedt.getName()+", isRunning "+nedt.isRunning+", shouldStop "+nedt.shouldStop+", SWT-EDT "+swtT.getName()+", on SWT-EDT "+onSWTEDT);
+                throw new IllegalStateException("EDT still running and not subject to stop. Curr "+curT.getName()+
+                        ", NEDT "+nedt.getName()+", isRunning "+nedt.isRunning+", shouldStop "+nedt.shouldStop+", SWT-EDT "+swtTName+", on SWT-EDT "+onSWTEDT);
             }
             if(DEBUG) {
                 System.err.println(Thread.currentThread()+": SWT-EDT reset - edt: "+nedt+", swtDisposed (skipping) "+swtDisposed);
@@ -99,9 +108,11 @@ public class SWTEDTUtil implements EDTUtil {
             }
         }
         if( !swtDisposed ) {
-            return invoke(true, nullTask);
+            if( !nedt.isRunning() ) {
+                throw new RuntimeException("EDT could not be started: "+nedt);
+            }
         } else {
-            return false;
+            // FIXME: Throw exception ?
         }
     }
 
@@ -140,21 +151,16 @@ public class SWTEDTUtil implements EDTUtil {
     }
 
     @Override
-    public final boolean invokeStop(boolean wait, Runnable task) {
+    public final boolean invokeStop(final boolean wait, final Runnable task) {
         return invokeImpl(wait, task, true);
     }
 
     @Override
-    public final boolean invoke(boolean wait, Runnable task) {
+    public final boolean invoke(final boolean wait, final Runnable task) {
         return invokeImpl(wait, task, false);
     }
 
-    private static Runnable nullTask = new Runnable() {
-        @Override
-        public void run() { }
-    };
-
-    private final boolean invokeImpl(boolean wait, Runnable task, boolean stop) {
+    private final boolean invokeImpl(boolean wait, final Runnable task, boolean stop) {
         Throwable throwable = null;
         RunnableTask rTask = null;
         final Object rTaskLock = new Object();
@@ -224,7 +230,7 @@ public class SWTEDTUtil implements EDTUtil {
             if( wait ) {
                 try {
                     rTaskLock.wait(); // free lock, allow execution of rTask
-                } catch (InterruptedException ie) {
+                } catch (final InterruptedException ie) {
                     throwable = ie;
                 }
                 if(null==throwable) {
@@ -256,7 +262,7 @@ public class SWTEDTUtil implements EDTUtil {
                 @Override
                 public void run() { }
             });
-        } catch (Exception e) { }
+        } catch (final Exception e) { }
         return true;
     }
 
@@ -270,7 +276,7 @@ public class SWTEDTUtil implements EDTUtil {
                 while( nedt.isRunning ) {
                     try {
                         edtLock.wait();
-                    } catch (InterruptedException e) {
+                    } catch (final InterruptedException e) {
                         e.printStackTrace();
                     }
                 }
@@ -286,7 +292,7 @@ public class SWTEDTUtil implements EDTUtil {
         volatile boolean isRunning = false;
         Object sync = new Object();
 
-        public NEDT(ThreadGroup tg, String name) {
+        public NEDT(final ThreadGroup tg, final String name) {
             super(tg, name);
         }
 
@@ -329,13 +335,13 @@ public class SWTEDTUtil implements EDTUtil {
                         if(!shouldStop) {
                             try {
                                 sync.wait(pollPeriod);
-                            } catch (InterruptedException e) {
+                            } catch (final InterruptedException e) {
                                 e.printStackTrace();
                             }
                         }
                     }
                 } while(!shouldStop) ;
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 // handle errors ..
                 shouldStop = true;
                 if(t instanceof RuntimeException) {
diff --git a/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java b/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java
index b5c45c1..a989345 100644
--- a/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java
+++ b/src/newt/classes/jogamp/newt/swt/event/SWTNewtEventFactory.java
@@ -28,6 +28,9 @@
 
 package jogamp.newt.swt.event;
 
+import javax.media.nativewindow.NativeSurface;
+import javax.media.nativewindow.NativeSurfaceHolder;
+
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.widgets.Event;
 import org.eclipse.swt.widgets.Listener;
@@ -43,7 +46,7 @@ import com.jogamp.newt.event.MouseEvent;
  */
 public class SWTNewtEventFactory {
 
-    public static final short eventTypeSWT2NEWT(int swtType) {
+    public static final short eventTypeSWT2NEWT(final int swtType) {
         switch( swtType ) {
             // case SWT.MouseXXX: return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_CLICKED;
             case SWT.MouseDown: return com.jogamp.newt.event.MouseEvent.EVENT_MOUSE_PRESSED;
@@ -60,7 +63,7 @@ public class SWTNewtEventFactory {
         return (short)0;
     }
 
-    public static final int swtModifiers2Newt(int awtMods, boolean mouseHint) {
+    public static final int swtModifiers2Newt(final int awtMods, final boolean mouseHint) {
         int newtMods = 0;
         if ((awtMods & SWT.SHIFT) != 0)     newtMods |= com.jogamp.newt.event.InputEvent.SHIFT_MASK;
         if ((awtMods & SWT.CTRL) != 0)      newtMods |= com.jogamp.newt.event.InputEvent.CTRL_MASK;
@@ -134,7 +137,7 @@ public class SWTNewtEventFactory {
     }
 
     public static int newtKeyCode2SWTKeyCode(final short newtKeyCode) {
-        final int defSWTKeyCode = 0xFFFF & (int)newtKeyCode;
+        final int defSWTKeyCode = 0xFFFF & newtKeyCode;
         switch (newtKeyCode) {
             case com.jogamp.newt.event.KeyEvent.VK_HOME          : return SWT.HOME;
             case com.jogamp.newt.event.KeyEvent.VK_END           : return SWT.END;
@@ -199,15 +202,15 @@ public class SWTNewtEventFactory {
     }
 
 
-    public static final com.jogamp.newt.event.InputEvent createInputEvent(org.eclipse.swt.widgets.Event event, Object source) {
-        com.jogamp.newt.event.InputEvent res = createMouseEvent(event, source);
+    public static final com.jogamp.newt.event.InputEvent createInputEvent(final org.eclipse.swt.widgets.Event event, final NativeSurfaceHolder sourceHolder) {
+        com.jogamp.newt.event.InputEvent res = createMouseEvent(event, sourceHolder);
         if(null == res) {
-            res = createKeyEvent(event, source);
+            res = createKeyEvent(event, sourceHolder);
         }
         return res;
     }
 
-    public static final com.jogamp.newt.event.MouseEvent createMouseEvent(org.eclipse.swt.widgets.Event event, Object source) {
+    public static final com.jogamp.newt.event.MouseEvent createMouseEvent(final org.eclipse.swt.widgets.Event event, final NativeSurfaceHolder sourceHolder) {
         switch(event.type) {
             case SWT.MouseDown:
             case SWT.MouseUp:
@@ -230,24 +233,31 @@ public class SWTNewtEventFactory {
 
             int mods = swtModifiers2Newt(event.stateMask, true);
 
-            if( source instanceof com.jogamp.newt.Window) {
-                final com.jogamp.newt.Window newtSource = (com.jogamp.newt.Window)source;
-                if(newtSource.isPointerConfined()) {
-                    mods |= InputEvent.CONFINED_MASK;
-                }
-                if(!newtSource.isPointerVisible()) {
-                    mods |= InputEvent.INVISIBLE_MASK;
+            final NativeSurface source = sourceHolder.getNativeSurface();
+            final int[] pixelPos;
+            if( null != source ) {
+                if( source instanceof com.jogamp.newt.Window) {
+                    final com.jogamp.newt.Window newtSource = (com.jogamp.newt.Window)source;
+                    if(newtSource.isPointerConfined()) {
+                        mods |= InputEvent.CONFINED_MASK;
+                    }
+                    if(!newtSource.isPointerVisible()) {
+                        mods |= InputEvent.INVISIBLE_MASK;
+                    }
                 }
+                pixelPos = source.convertToPixelUnits(new int[] { event.x, event.y });
+            } else {
+                pixelPos = new int[] { event.x, event.y };
             }
 
             return new com.jogamp.newt.event.MouseEvent(
-                           type, (null==source)?(Object)event.data:source, (0xFFFFFFFFL & (long)event.time),
-                           mods, event.x, event.y, (short)event.count, (short)event.button, MouseEvent.getRotationXYZ(rotation, mods), 1f);
+                           type, sourceHolder, (0xFFFFFFFFL & event.time),
+                           mods, pixelPos[0], pixelPos[1], (short)event.count, (short)event.button, MouseEvent.getRotationXYZ(rotation, mods), 1f);
         }
         return null; // no mapping ..
     }
 
-    public static final com.jogamp.newt.event.KeyEvent createKeyEvent(org.eclipse.swt.widgets.Event event, Object source) {
+    public static final com.jogamp.newt.event.KeyEvent createKeyEvent(final org.eclipse.swt.widgets.Event event, final NativeSurfaceHolder sourceHolder) {
         switch(event.type) {
             case SWT.KeyDown:
             case SWT.KeyUp:
@@ -259,7 +269,7 @@ public class SWTNewtEventFactory {
         if( (short)0 != type ) {
             final short newtKeyCode = swtKeyCode2NewtKeyCode( event.keyCode );
             return com.jogamp.newt.event.KeyEvent.create(
-                           type, (null==source)?(Object)event.data:source, (0xFFFFFFFFL & (long)event.time),
+                           type, sourceHolder, (0xFFFFFFFFL & event.time),
                            swtModifiers2Newt(event.stateMask, false),
                            newtKeyCode, newtKeyCode, event.character);
         }
@@ -280,8 +290,8 @@ public class SWTNewtEventFactory {
         dragButtonDown = 0;
     }
 
-    public final boolean dispatchMouseEvent(org.eclipse.swt.widgets.Event event, Object source, com.jogamp.newt.event.MouseListener l) {
-        com.jogamp.newt.event.MouseEvent res = createMouseEvent(event, source);
+    public final boolean dispatchMouseEvent(final org.eclipse.swt.widgets.Event event, final NativeSurfaceHolder sourceHolder, final com.jogamp.newt.event.MouseListener l) {
+        final com.jogamp.newt.event.MouseEvent res = createMouseEvent(event, sourceHolder);
         if(null != res) {
             if(null != l) {
                 switch(event.type) {
@@ -331,8 +341,8 @@ public class SWTNewtEventFactory {
         return false;
     }
 
-    public final boolean dispatchKeyEvent(org.eclipse.swt.widgets.Event event, Object source, com.jogamp.newt.event.KeyListener l) {
-        com.jogamp.newt.event.KeyEvent res = createKeyEvent(event, source);
+    public final boolean dispatchKeyEvent(final org.eclipse.swt.widgets.Event event, final NativeSurfaceHolder sourceHolder, final com.jogamp.newt.event.KeyListener l) {
+        final com.jogamp.newt.event.KeyEvent res = createKeyEvent(event, sourceHolder);
         if(null != res) {
             if(null != l) {
                 switch(event.type) {
@@ -349,27 +359,38 @@ public class SWTNewtEventFactory {
         return false;
     }
 
-    public final void attachDispatchListener(final org.eclipse.swt.widgets.Control ctrl, final Object source,
+    public final void attachDispatchListener(final org.eclipse.swt.widgets.Control ctrl, final NativeSurfaceHolder sourceHolder,
                                              final com.jogamp.newt.event.MouseListener ml,
                                              final com.jogamp.newt.event.KeyListener kl) {
-      final Listener listener = new Listener () {
-          @Override
-          public void handleEvent (Event event) {
-              if( dispatchMouseEvent( event, source, ml ) ) {
-                  return;
-              }
-              if( dispatchKeyEvent( event, source, kl ) ) {
-                  return;
-              }
-          } };
-      ctrl.addListener(SWT.MouseDown, listener);
-      ctrl.addListener(SWT.MouseUp, listener);
-      ctrl.addListener(SWT.MouseMove, listener);
-      ctrl.addListener(SWT.MouseEnter, listener);
-      ctrl.addListener(SWT.MouseExit, listener);
-      ctrl.addListener(SWT.MouseVerticalWheel, listener);
-      ctrl.addListener(SWT.KeyDown, listener);
-      ctrl.addListener(SWT.KeyUp, listener);
+      if(null==ctrl) {
+          throw new IllegalArgumentException("Argument ctrl is null");
+      }
+      if(null==sourceHolder) {
+          throw new IllegalArgumentException("Argument source is null");
+      }
+
+      if( null != ml ) {
+          final Listener listener = new Listener () {
+              @Override
+              public void handleEvent (final Event event) {
+                  dispatchMouseEvent( event, sourceHolder, ml );
+              } };
+          ctrl.addListener(SWT.MouseDown, listener);
+          ctrl.addListener(SWT.MouseUp, listener);
+          ctrl.addListener(SWT.MouseMove, listener);
+          ctrl.addListener(SWT.MouseEnter, listener);
+          ctrl.addListener(SWT.MouseExit, listener);
+          ctrl.addListener(SWT.MouseVerticalWheel, listener);
+      }
+      if( null != kl ) {
+          final Listener listener = new Listener () {
+              @Override
+              public void handleEvent (final Event event) {
+                  dispatchKeyEvent( event, sourceHolder, kl );
+              } };
+          ctrl.addListener(SWT.KeyDown, listener);
+          ctrl.addListener(SWT.KeyUp, listener);
+      }
     }
 }
 
diff --git a/src/newt/native/MacWindow.m b/src/newt/native/MacWindow.m
index 25ea47c..2bd11da 100644
--- a/src/newt/native/MacWindow.m
+++ b/src/newt/native/MacWindow.m
@@ -366,7 +366,7 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_macosx_DisplayDriver_destroyPoint
     [pool release];
 }
 
-static NSScreen * NewtScreen_getNSScreenByIndex(int screen_idx, BOOL cap) {
+NSScreen * NewtScreen_getNSScreenByIndex(int screen_idx, BOOL cap) {
     NSArray *screens = [NSScreen screens];
     if( screen_idx<0 || screen_idx>=[screens count] ) {
         if( cap ) {
@@ -378,7 +378,7 @@ static NSScreen * NewtScreen_getNSScreenByIndex(int screen_idx, BOOL cap) {
     return (NSScreen *) [screens objectAtIndex: screen_idx];
 }
 
-static NSScreen * NewtScreen_getNSScreenByCoord(int x, int y) {
+NSScreen * NewtScreen_getNSScreenByCoord(int x, int y) {
     NSArray *screens = [NSScreen screens];
     int i;
     for(i=[screens count]-1; i>=0; i--) {
@@ -394,7 +394,32 @@ static NSScreen * NewtScreen_getNSScreenByCoord(int x, int y) {
     return (NSScreen *) [screens objectAtIndex: 0];
 }
 
-static CGDirectDisplayID NewtScreen_getCGDirectDisplayIDByNSScreen(NSScreen *screen) {
+static void NewtScreen_dump() {
+#ifdef VERBOSE_ON
+    NSArray *screens = [NSScreen screens];
+    int i;
+    for(i=0; i<[screens count]; i++) {
+        NSScreen * screen = (NSScreen *) [screens objectAtIndex: i];
+        NSRect screenFrame = [screen frame];
+        NSRect screenVisibleFrame = [screen visibleFrame];
+        CGFloat pixelScale = 1.0; // default
+NS_DURING
+        // Available >= 10.7
+        pixelScale = [screen backingScaleFactor]; // HiDPI scaling
+NS_HANDLER
+NS_ENDHANDLER
+        NSWindowDepth depth = [screen depth]; // an (int) value!
+        DBG_PRINT( "NSScreen #%d (%p): Frame %lf/%lf %lfx%lf (vis %lf/%lf %lfx%lf), scale %lf, depth %d\n",
+            i, screen,
+            screenFrame.origin.x, screenFrame.origin.y, screenFrame.size.width, screenFrame.size.height,
+            screenVisibleFrame.origin.x, screenVisibleFrame.origin.y, screenVisibleFrame.size.width, screenVisibleFrame.size.height,
+            pixelScale, depth);
+    }
+#endif
+}
+
+
+CGDirectDisplayID NewtScreen_getCGDirectDisplayIDByNSScreen(NSScreen *screen) {
     // Mind: typedef uint32_t CGDirectDisplayID; - however, we assume it's 64bit on 64bit ?!
     NSDictionary * dict = [screen deviceDescription];
     NSNumber * val = (NSNumber *) [dict objectForKey: @"NSScreenNumber"];
@@ -428,6 +453,20 @@ static long GetDictionaryLong(CFDictionaryRef theDict, const void* key)
 
 /*
  * Class:     jogamp_newt_driver_macosx_ScreenDriver
+ * Method:    getMonitorCount0
+ * Signature: ()I
+ */
+JNIEXPORT jint JNICALL Java_jogamp_newt_driver_macosx_ScreenDriver_getMonitorCount0
+  (JNIEnv *env, jobject obj)
+{
+    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+    NSArray *screens = [NSScreen screens];
+    [pool release];
+    return (jint) [screens count];
+}
+
+/*
+ * Class:     jogamp_newt_driver_macosx_ScreenDriver
  * Method:    getMonitorProps0
  * Signature: (I)[I
  */
@@ -463,8 +502,16 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_macosx_ScreenDriver_getMonit
     fprintf(stderr, "MacScreen_getMonitorProps0.3: %ld ms\n", td_ms); fflush(NULL);
 #endif
 
-    CGRect bounds = CGDisplayBounds (display);
-    
+    CGRect dBounds = CGDisplayBounds (display); // origin top-left
+#ifdef VERBOSE_ON
+    BOOL usesGL = CGDisplayUsesOpenGLAcceleration(display);
+    NSRect sFrame = [screen frame]; // origin bottom-left
+    DBG_PRINT( "getMonitorProps0: scrn %d, top-left displayBounds[%d/%d %dx%d], bottom-left screenFrame[%d/%d %dx%d], usesGL %d\n", (int)crt_idx, 
+                 (int)dBounds.origin.x, (int)dBounds.origin.y, (int)dBounds.size.width, (int)dBounds.size.height,
+                 (int)sFrame.origin.x, (int)sFrame.origin.y, (int)sFrame.size.width, (int)sFrame.size.height,
+                 (int)usesGL);
+#endif
+
     jsize propCount = MIN_MONITOR_DEVICE_PROPERTIES - 1 - NUM_MONITOR_MODE_PROPERTIES;
     jint prop[ propCount ];
     int offset = 0;
@@ -472,10 +519,14 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_macosx_ScreenDriver_getMonit
     prop[offset++] = crt_idx;
     prop[offset++] = (jint) sizeMM.width;
     prop[offset++] = (jint) sizeMM.height;
-    prop[offset++] = (jint) bounds.origin.x;    // rotated viewport x
-    prop[offset++] = (jint) bounds.origin.y;    // rotated viewport y
-    prop[offset++] = (jint) bounds.size.width;  // rotated viewport width
-    prop[offset++] = (jint) bounds.size.height; // rotated viewport height
+    prop[offset++] = (jint) dBounds.origin.x;    // rotated viewport x      (pixel units, will be fixed in java code)
+    prop[offset++] = (jint) dBounds.origin.y;    // rotated viewport y      (pixel units, will be fixed in java code)
+    prop[offset++] = (jint) dBounds.size.width;  // rotated viewport width  (pixel units, will be fixed in java code)
+    prop[offset++] = (jint) dBounds.size.height; // rotated viewport height (pixel units, will be fixed in java code)
+    prop[offset++] = (jint) dBounds.origin.x;    // rotated viewport x      (window units, will be fixed in java code)
+    prop[offset++] = (jint) dBounds.origin.y;    // rotated viewport y      (window units, will be fixed in java code)
+    prop[offset++] = (jint) dBounds.size.width;  // rotated viewport width  (window units, will be fixed in java code)
+    prop[offset++] = (jint) dBounds.size.height; // rotated viewport height (window units, will be fixed in java code)
 
     jintArray properties = (*env)->NewIntArray(env, propCount);
     if (properties == NULL) {
@@ -503,6 +554,13 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_macosx_ScreenDriver_getMonit
         [pool release];
         return NULL;
     }
+    CGFloat pixelScale = 1.0; // default
+NS_DURING
+    // Available >= 10.7
+    pixelScale = [screen backingScaleFactor]; // HiDPI scaling
+NS_HANDLER
+NS_ENDHANDLER
+
     CGDirectDisplayID display = NewtScreen_getCGDirectDisplayIDByNSScreen(screen);
 
     CFArrayRef availableModes = CGDisplayAvailableModes(display);
@@ -516,8 +574,8 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_macosx_ScreenDriver_getMonit
 #ifdef VERBOSE_ON
     if(0 >= mode_idx) {
         // only for current mode (-1) and first mode (scanning)
-        DBG_PRINT( "getScreenMode0: scrn %d (%p, %p), mode %d, avail: %d/%d, current rot %d ccw\n",  
-            (int)crt_idx, screen, (void*)(intptr_t)display, (int)mode_idx, (int)numberOfAvailableModes, (int)numberOfAvailableModesRots, currentCCWRot);
+        DBG_PRINT( "getScreenMode0: scrn %d (s %p, d %p, pscale %lf), mode %d, avail: %d/%d, current rot %d ccw\n",  
+            (int)crt_idx, screen, (void*)(intptr_t)display, pixelScale, (int)mode_idx, (int)numberOfAvailableModes, (int)numberOfAvailableModesRots, currentCCWRot);
     }
 #endif
 
@@ -543,6 +601,10 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_macosx_ScreenDriver_getMonit
 
     int mWidth = CGDDGetModeWidth(mode);
     int mHeight = CGDDGetModeHeight(mode);
+    if( -1 == mode_idx ) {
+        mWidth *= (int)pixelScale;   // accomodate HiDPI
+        mHeight *= (int)pixelScale; // accomodate HiDPI
+    }
 
     // swap width and height, since OSX reflects rotated dimension, we don't
     if ( 90 == currentCCWRot || 270 == currentCCWRot ) {
@@ -564,7 +626,7 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_macosx_ScreenDriver_getMonit
     prop[propIndex++] = 0; // flags
     prop[propIndex++] = nativeId;
     prop[propIndex++] = ccwRot;
-
+ 
     DBG_PRINT( "getScreenMode0: Mode %d/%d (%d): %dx%d, %d bpp, %d / %d Hz, nativeId %d, rot %d ccw\n",
         (int)mode_idx, (int)numberOfAvailableModesRots, (int)numberOfAvailableModes, 
         (int)prop[1], (int)prop[2], (int)prop[3],
@@ -653,6 +715,8 @@ JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_macosx_WindowDriver_initIDs0
 
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
 
+    NewtScreen_dump();
+
     jclass c;
     c = (*env)->FindClass(env, ClazzNamePoint);
     if(NULL==c) {
@@ -683,29 +747,15 @@ JNIEXPORT jboolean JNICALL Java_jogamp_newt_driver_macosx_WindowDriver_initIDs0
 /**
  * Class:     jogamp_newt_driver_macosx_WindowDriver
  * Method:    createView0
- * Signature: (IIIIZ)J
+ * Signature: (IIII)J
  */
 JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_macosx_WindowDriver_createView0
-  (JNIEnv *env, jobject jthis, jint x, jint y, jint w, jint h, 
-   jboolean fullscreen)
+  (JNIEnv *env, jobject jthis, jint x, jint y, jint w, jint h)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
 
-    DBG_PRINT( "createView0 - %p (this), %d/%d %dx%d, fs %d (START)\n",
-        (void*)(intptr_t)jthis, (int)x, (int)y, (int)w, (int)h, (int)fullscreen);
-
-    NSScreen *myScreen =  NewtScreen_getNSScreenByCoord(x, y);
-    NSRect rectWin;
-
-    if (fullscreen) {
-        rectWin = [myScreen frame];
-        x = 0;
-        y = 0;
-        w = (jint) (rectWin.size.width);
-        h = (jint) (rectWin.size.height);
-    } else {
-        rectWin = NSMakeRect(x, y, w, h);
-    }
+    DBG_PRINT( "createView0 - %p (this), %d/%d %dx%d (START)\n",
+        (void*)(intptr_t)jthis, (int)x, (int)y, (int)w, (int)h);
 
     NSRect rectView = NSMakeRect(0, 0, w, h);
     NewtView *myView = [[NewtView alloc] initWithFrame: rectView] ;
@@ -724,7 +774,7 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_macosx_WindowDriver_createView0
  * Signature: (IIIIZIIJ)J
  */
 JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_macosx_WindowDriver_createWindow0
-  (JNIEnv *env, jobject jthis, jint x, jint y, jint w, jint h, 
+  (JNIEnv *env, jobject jthis, jint x, jint y, jint w, jint h,
    jboolean fullscreen, jint styleMask, jint bufferingType, jlong jview)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -735,19 +785,10 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_macosx_WindowDriver_createWindow
         (int)styleMask, (int)bufferingType, myView);
     (void)myView;
 
-    NSScreen *myScreen =  NewtScreen_getNSScreenByCoord(x, y);
-
-    NSRect rectWin;
     if (fullscreen) {
         styleMask = NSBorderlessWindowMask;
-        rectWin = [myScreen frame];
-        x = 0;
-        y = 0;
-        w = (jint) (rectWin.size.width);
-        h = (jint) (rectWin.size.height);
-    } else {
-        rectWin = NSMakeRect(x, y, w, h);
     }
+    NSRect rectWin = NSMakeRect(x, y, w, h);
 
     // Allocate the window
     NewtMacWindow* myWindow = [[NewtMacWindow alloc] initWithContentRect: rectWin
@@ -769,10 +810,10 @@ JNIEXPORT jlong JNICALL Java_jogamp_newt_driver_macosx_WindowDriver_createWindow
  *
  * Class:     jogamp_newt_driver_macosx_WindowDriver
  * Method:    initWindow0
- * Signature: (JJIIIIZZZJ)V
+ * Signature: (JJIIIIFZZZJ)V
  */
 JNIEXPORT void JNICALL Java_jogamp_newt_driver_macosx_WindowDriver_initWindow0
-  (JNIEnv *env, jobject jthis, jlong parent, jlong window, jint x, jint y, jint w, jint h, 
+  (JNIEnv *env, jobject jthis, jlong parent, jlong window, jint x, jint y, jint w, jint h, jfloat reqPixelScale,
    jboolean opaque, jboolean visible, jlong jview)
 {
     NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
@@ -780,22 +821,19 @@ JNIEXPORT void JNICALL Java_jogamp_newt_driver_macosx_WindowDriver_initWindow0
     NewtView* myView = (NewtView*) (intptr_t) jview ;
     BOOL fullscreen = myWindow->isFullscreenWindow;
 
-    DBG_PRINT( "initWindow0 - %p (this), %p (parent), %p (window), %d/%d %dx%d, opaque %d, fs %d, visible %d, view %p (START)\n",
-        (void*)(intptr_t)jthis, (void*)(intptr_t)parent, myWindow, (int)x, (int)y, (int)w, (int)h, 
+    DBG_PRINT( "initWindow0 - %p (this), %p (parent), %p (window), %d/%d %dx%d, reqPixScale %f, opaque %d, fs %d, visible %d, view %p (START)\n",
+        (void*)(intptr_t)jthis, (void*)(intptr_t)parent, myWindow, (int)x, (int)y, (int)w, (int)h, (float)reqPixelScale,
         (int) opaque, (int)fullscreen, (int)visible, myView);
 
-    NSScreen *myScreen =  NewtScreen_getNSScreenByCoord(x, y);
-
-    NSRect rectWin;
-    if (fullscreen) {
-        rectWin = [myScreen frame];
-        x = 0;
-        y = 0;
-        w = (jint) (rectWin.size.width);
-        h = (jint) (rectWin.size.height);
+NS_DURING
+    // HiDPI scaling: Setup - Available >= 10.7
+    if( 1.0 == reqPixelScale ) {
+        [myView setWantsBestResolutionOpenGLSurface: NO];
     } else {
-        rectWin = NSMakeRect(x, y, w, h);
+        [myView setWantsBestResolutionOpenGLSurface: YES];
     }
+NS_HANDLER
+NS_ENDHANDLER
 
     [myWindow setReleasedWhenClosed: NO]; // We control NSWindow destruction!
     [myWindow setPreservesContentDuringLiveResize: NO];
@@ -927,6 +965,7 @@ NS_DURING
          * Shall have no penalty on modern GPU and is also recommended, see bottom box @
          * <https://developer.apple.com/library/mac/documentation/graphicsimaging/Conceptual/QuartzDisplayServicesConceptual/Articles/DisplayCapture.html>
          *
+        NSScreen *myScreen =  NewtScreen_getNSScreenByCoord(x, y);
         if ( [myView respondsToSelector:@selector(enterFullScreenMode:withOptions:)] ) {
             // Available >= 10.5 - Makes the menubar disapear
             [myView enterFullScreenMode: myScreen withOptions:NULL];
@@ -952,6 +991,44 @@ NS_ENDHANDLER
  * Method is called on Main-Thread, hence no special invocation required inside method.
  *
  * Class:     jogamp_newt_driver_macosx_WindowDriver
+ * Method:    setPixelScale0
+ * Signature: (JJF)V
+ */
+JNIEXPORT void JNICALL Java_jogamp_newt_driver_macosx_WindowDriver_setPixelScale0
+  (JNIEnv *env, jobject jthis, jlong window, jlong view, jfloat reqPixelScale)
+{
+    NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init];
+    NewtMacWindow* myWindow = (NewtMacWindow*) ((intptr_t) window);
+    NewtView* myView = (NewtView*) (intptr_t) view ;
+#ifdef VERBOSE_ON
+    int dbgIdx = 1;
+#endif
+
+    DBG_PRINT( "setPixelScale0 - %p (this), %p (window), view %p, reqPixScale %f (START)\n",
+        (void*)(intptr_t)jthis, myWindow, myView, (float)reqPixelScale);
+
+NS_DURING
+    // HiDPI scaling: Setup - Available >= 10.7
+    if( 1.0 == reqPixelScale ) {
+        [myView setWantsBestResolutionOpenGLSurface: NO];
+    } else {
+        [myView setWantsBestResolutionOpenGLSurface: YES];
+    }
+NS_HANDLER
+NS_ENDHANDLER
+
+    DBG_PRINT( "setPixelScale0.%d - %p (this), window: %p, view %p\n",
+        dbgIdx++, (void*)(intptr_t)jthis, myWindow, myView);
+
+    [pool release];
+    DBG_PRINT( "setPixelScale0.X - %p (this), window: %p, view %p\n",
+        (void*)(intptr_t)jthis, myWindow, myView);
+}
+
+/**
+ * Method is called on Main-Thread, hence no special invocation required inside method.
+ *
+ * Class:     jogamp_newt_driver_macosx_WindowDriver
  * Method:    close0
  * Signature: (J)V
  */
diff --git a/src/newt/native/NewtMacWindow.h b/src/newt/native/NewtMacWindow.h
index 8f6362a..0f80df2 100644
--- a/src/newt/native/NewtMacWindow.h
+++ b/src/newt/native/NewtMacWindow.h
@@ -49,6 +49,10 @@
 
 // #define DBG_LIFECYCLE 1
 
+NSScreen * NewtScreen_getNSScreenByIndex(int screen_idx, BOOL cap);
+NSScreen * NewtScreen_getNSScreenByCoord(int x, int y);
+CGDirectDisplayID NewtScreen_getCGDirectDisplayIDByNSScreen(NSScreen *screen);
+
 @interface NewtView : NSView
 {
     jobject javaWindowObject;
@@ -129,6 +133,7 @@
 - (void) handleFlagsChanged:(int) keyMask keyIndex: (int) keyIdx keyCode: (int) keyCode modifiers: (NSUInteger) mods;
 - (void) sendKeyEvent: (NSEvent*) event eventType: (jshort) evType;
 - (void) sendKeyEvent: (jshort) keyCode characters: (NSString*) chars modifiers: (NSUInteger)mods eventType: (jshort) evType;
+- (void) viewDidChangeBackingProperties;
 
 @end
 
diff --git a/src/newt/native/NewtMacWindow.m b/src/newt/native/NewtMacWindow.m
index b4133ac..5a19631 100644
--- a/src/newt/native/NewtMacWindow.m
+++ b/src/newt/native/NewtMacWindow.m
@@ -174,6 +174,7 @@ static jmethodID requestFocusID = NULL;
 
 static jmethodID insetsChangedID   = NULL;
 static jmethodID sizeChangedID     = NULL;
+static jmethodID updatePixelScaleID = NULL;
 static jmethodID visibleChangedID = NULL;
 static jmethodID positionChangedID = NULL;
 static jmethodID focusChangedID    = NULL;
@@ -330,8 +331,8 @@ static jmethodID windowRepaintID = NULL;
     NSRect viewFrame = [self frame];
 
     (*env)->CallVoidMethod(env, javaWindowObject, windowRepaintID, JNI_TRUE, // defer ..
-        dirtyRect.origin.x, viewFrame.size.height - dirtyRect.origin.y, 
-        dirtyRect.size.width, dirtyRect.size.height);
+        (int)dirtyRect.origin.x, (int)viewFrame.size.height - (int)dirtyRect.origin.y, 
+        (int)dirtyRect.size.width, (int)dirtyRect.size.height);
 
     // detaching thread not required - daemon
     // NewtCommon_ReleaseJNIEnv(shallBeDetached);
@@ -476,14 +477,26 @@ static jmethodID windowRepaintID = NULL;
     }
 }
 
+/**
+ * p abs screen position w/ bottom-left origin
+ */
 - (void) setMousePosition:(NSPoint)p
 {
     NSWindow* nsWin = [self window];
     if( NULL != nsWin ) {
         NSScreen* screen = [nsWin screen];
-        NSRect screenRect = [screen frame];
 
-        CGPoint pt = { p.x, screenRect.size.height - p.y }; // y-flip (CG is top-left origin)
+        CGDirectDisplayID display = NewtScreen_getCGDirectDisplayIDByNSScreen(screen);
+        CGRect frameTL = CGDisplayBounds (display); // origin top-left
+        NSRect frameBL = [screen frame]; // origin bottom-left
+        CGPoint pt = { p.x, frameTL.origin.y + frameTL.size.height - ( p.y - frameBL.origin.y ) }; // y-flip from BL-screen -> TL-screen
+
+        DBG_PRINT( "setMousePosition: point-in[%d/%d], screen tl[%d/%d %dx%d] bl[%d/%d %dx%d] -> %d/%d\n",
+            (int)p.x, (int)p.y,
+            (int)frameTL.origin.x, (int)frameTL.origin.y, (int)frameTL.size.width, (int)frameTL.size.height,
+            (int)frameBL.origin.x, (int)frameBL.origin.y, (int)frameBL.size.width, (int)frameBL.size.height,
+            (int)pt.x, (int)pt.y);
+
         CGEventRef ev = CGEventCreateMouseEvent (NULL, kCGEventMouseMoved, pt, kCGMouseButtonLeft);
         CGEventPost (kCGHIDEventTap, ev);
     }
@@ -761,6 +774,35 @@ static jmethodID windowRepaintID = NULL;
     // NewtCommon_ReleaseJNIEnv(shallBeDetached);
 }
 
+- (void)viewDidChangeBackingProperties
+{
+    [super viewDidChangeBackingProperties];
+
+    // HiDPI scaling
+    BOOL useHiDPI = [self wantsBestResolutionOpenGLSurface];
+    CGFloat pixelScaleNative = [[self window] backingScaleFactor];
+    CGFloat pixelScaleUse = useHiDPI ? pixelScaleNative : 1.0;
+    DBG_PRINT("viewDidChangeBackingProperties: PixelScale: HiDPI %d, native %f -> use %f\n", useHiDPI, (float)pixelScaleNative, (float)pixelScaleUse);
+    [[self layer] setContentsScale: pixelScaleUse];
+
+    if (javaWindowObject == NULL) {
+        DBG_PRINT("viewDidChangeBackingProperties: null javaWindowObject\n");
+        return;
+    }
+    int shallBeDetached = 0;
+    JNIEnv* env = NewtCommon_GetJNIEnv(1 /* asDaemon */, &shallBeDetached);
+    if(NULL==env) {
+        DBG_PRINT("viewDidChangeBackingProperties: null JNIEnv\n");
+        return;
+    }
+
+    (*env)->CallVoidMethod(env, javaWindowObject, updatePixelScaleID, JNI_TRUE, (jfloat)pixelScaleUse, (jfloat)pixelScaleNative); // defer 
+
+    // detaching thread not required - daemon
+    // NewtCommon_ReleaseJNIEnv(shallBeDetached);
+}
+
+
 @end
 
 @implementation NewtMacWindow
@@ -769,7 +811,8 @@ static jmethodID windowRepaintID = NULL;
 {
     enqueueMouseEventID = (*env)->GetMethodID(env, clazz, "enqueueMouseEvent", "(ZSIIISF)V");
     enqueueKeyEventID = (*env)->GetMethodID(env, clazz, "enqueueKeyEvent", "(ZSISCC)V");
-    sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged",     "(ZIIZ)V");
+    sizeChangedID = (*env)->GetMethodID(env, clazz, "sizeChanged", "(ZIIZ)V");
+    updatePixelScaleID = (*env)->GetMethodID(env, clazz, "updatePixelScale", "(ZFF)V");
     visibleChangedID = (*env)->GetMethodID(env, clazz, "visibleChanged", "(ZZ)V");
     insetsChangedID = (*env)->GetMethodID(env, clazz, "insetsChanged", "(ZIIII)V");
     positionChangedID = (*env)->GetMethodID(env, clazz, "screenPositionChanged", "(ZII)V");
@@ -777,7 +820,7 @@ static jmethodID windowRepaintID = NULL;
     windowDestroyNotifyID = (*env)->GetMethodID(env, clazz, "windowDestroyNotify", "(Z)Z");
     windowRepaintID = (*env)->GetMethodID(env, clazz, "windowRepaint", "(ZIIII)V");
     requestFocusID = (*env)->GetMethodID(env, clazz, "requestFocus", "(Z)V");
-    if (enqueueMouseEventID && enqueueKeyEventID && sizeChangedID && visibleChangedID && insetsChangedID &&
+    if (enqueueMouseEventID && enqueueKeyEventID && sizeChangedID && updatePixelScaleID && visibleChangedID && insetsChangedID &&
         positionChangedID && focusChangedID && windowDestroyNotifyID && requestFocusID && windowRepaintID)
     {
         CKCH_CreateDictionaries();
@@ -824,10 +867,12 @@ static jmethodID windowRepaintID = NULL;
     // Why is this necessary? Without it we don't get any of the
     // delegate methods like resizing and window movement.
     [self setDelegate: self];
+
     cachedInsets[0] = 0; // l
     cachedInsets[1] = 0; // r
     cachedInsets[2] = 0; // t
     cachedInsets[3] = 0; // b
+
     realized = YES;
     DBG_PRINT("NewtWindow::create: %p, realized %d, hasPresentationSwitch %d[defaultOptions 0x%X, fullscreenOptions 0x%X], (refcnt %d)\n", 
         res, realized, (int)hasPresentationSwitch, (int)defaultPresentationOptions, (int)fullscreenPresentationOptions, (int)[res retainCount]);
@@ -927,19 +972,20 @@ static jmethodID windowRepaintID = NULL;
 {
     int totalHeight = nsz.height + cachedInsets[3]; // height + insets.bottom
 
-    DBG_PRINT( "newtAbsClientTLWinPos2AbsBLScreenPos: given %d/%d %dx%d, insets bottom %d -> totalHeight %d\n", 
+    DBG_PRINT( "newtAbsClientTLWinPos2AbsBLScreenPos: point-in[%d/%d], size-in[%dx%d], insets bottom %d -> totalHeight %d\n", 
         (int)p.x, (int)p.y, (int)nsz.width, (int)nsz.height, cachedInsets[3], totalHeight);
 
     NSScreen* screen = [self screen];
-    NSRect screenFrame = [screen frame];
-
-    DBG_PRINT( "newtAbsClientTLWinPos2AbsBLScreenPos: screen %d/%d %dx%d\n", 
-        (int)screenFrame.origin.x, (int)screenFrame.origin.y, (int)screenFrame.size.width, (int)screenFrame.size.height);
 
-    NSPoint r = NSMakePoint(screenFrame.origin.x + p.x,
-                            screenFrame.origin.y + screenFrame.size.height - p.y - totalHeight);
+    CGDirectDisplayID display = NewtScreen_getCGDirectDisplayIDByNSScreen(screen);
+    CGRect frameTL = CGDisplayBounds (display); // origin top-left
+    NSRect frameBL = [screen frame]; // origin bottom-left
+    NSPoint r = NSMakePoint(p.x, frameBL.origin.y + frameBL.size.height - ( p.y - frameTL.origin.y ) - totalHeight); // y-flip from TL-screen -> BL-screen
 
-    DBG_PRINT( "newtAbsClientTLWinPos2AbsBLScreenPos: result %d/%d\n", (int)r.x, (int)r.y); 
+    DBG_PRINT( "newtAbsClientTLWinPos2AbsBLScreenPos: screen tl[%d/%d %dx%d] bl[%d/%d %dx%d ->  %d/%d\n",
+        (int)frameTL.origin.x, (int)frameTL.origin.y, (int)frameTL.size.width, (int)frameTL.size.height,
+        (int)frameBL.origin.x, (int)frameBL.origin.y, (int)frameBL.size.width, (int)frameBL.size.height,
+        (int)r.x, (int)r.y);
 
     return r;
 }
@@ -954,9 +1000,16 @@ static jmethodID windowRepaintID = NULL;
 
     NSView* mView = [self contentView];
     NSRect mViewFrame = [mView frame]; 
+    NSPoint r = NSMakePoint(winFrame.origin.x + p.x,
+                            winFrame.origin.y + ( mViewFrame.size.height - p.y ) ); // y-flip in view
 
-    return NSMakePoint(winFrame.origin.x + p.x,
-                       winFrame.origin.y + ( mViewFrame.size.height - p.y ) ); // y-flip in view
+    DBG_PRINT( "newtRelClientTLWinPos2AbsBLScreenPos: point-in[%d/%d], winFrame[%d/%d %dx%d], viewFrame[%d/%d %dx%d] -> %d/%d\n",
+        (int)p.x, (int)p.y,
+        (int)winFrame.origin.x, (int)winFrame.origin.y, (int)winFrame.size.width, (int)winFrame.size.height,
+        (int)mViewFrame.origin.x, (int)mViewFrame.origin.y, (int)mViewFrame.size.width, (int)mViewFrame.size.height,
+        (int)r.x, (int)r.y);
+
+    return r;
 }
 
 - (NSSize) newtClientSize2TLSize: (NSSize) nsz
@@ -972,20 +1025,33 @@ static jmethodID windowRepaintID = NULL;
  */
 - (NSPoint) getLocationOnScreen: (NSPoint) p
 {
-    NSScreen* screen = [self screen];
-    NSRect screenRect = [screen frame];
-
     NSView* view = [self contentView];
     NSRect viewFrame = [view frame];
-
     NSRect r;
     r.origin.x = p.x;
     r.origin.y = viewFrame.size.height - p.y; // y-flip
     r.size.width = 0;
     r.size.height = 0;
-    // NSRect rS = [win convertRectToScreen: r]; // 10.7
-    NSPoint oS = [self convertBaseToScreen: r.origin];
-    oS.y = screenRect.origin.y + screenRect.size.height - oS.y;
+    // NSRect rS = [self convertRectToScreen: r]; // 10.7
+    NSPoint oS = [self convertBaseToScreen: r.origin]; // BL-screen
+
+    NSScreen* screen = [self screen];
+    CGDirectDisplayID display = NewtScreen_getCGDirectDisplayIDByNSScreen(screen);
+    CGRect frameTL = CGDisplayBounds (display); // origin top-left
+    NSRect frameBL = [screen frame]; // origin bottom-left
+    oS.y = frameTL.origin.y + frameTL.size.height - ( oS.y - frameBL.origin.y ); // y-flip from BL-screen -> TL-screen
+
+#ifdef VERBOSE_ON
+    NSRect winFrame = [self frame];
+    DBG_PRINT( "getLocationOnScreen: point-in[%d/%d], winFrame[%d/%d %dx%d], viewFrame[%d/%d %dx%d], screen tl[%d/%d %dx%d] bl[%d/%d %dx%d] -> %d/%d\n",
+        (int)p.x, (int)p.y,
+        (int)winFrame.origin.x, (int)winFrame.origin.y, (int)winFrame.size.width, (int)winFrame.size.height,
+        (int)viewFrame.origin.x, (int)viewFrame.origin.y, (int)viewFrame.size.width, (int)viewFrame.size.height,
+        (int)frameTL.origin.x, (int)frameTL.origin.y, (int)frameTL.size.width, (int)frameTL.size.height,
+        (int)frameBL.origin.x, (int)frameBL.origin.y, (int)frameBL.size.width, (int)frameBL.size.height,
+        (int)oS.x, (int)oS.y);
+#endif
+
     return oS;
 }
 
@@ -1123,7 +1189,7 @@ static jmethodID windowRepaintID = NULL;
         NSRect frameRect = [self frame];
         NSRect contentRect = [self contentRectForFrameRect: frameRect];
 
-        (*env)->CallVoidMethod(env, javaWindowObject, sizeChangedID, JNI_FALSE,
+        (*env)->CallVoidMethod(env, javaWindowObject, sizeChangedID, JNI_TRUE, // defer 
                                (jint) contentRect.size.width,
                                (jint) contentRect.size.height, JNI_FALSE);
     }
diff --git a/src/newt/native/ScreenMode.h b/src/newt/native/ScreenMode.h
index 110f1c4..56c424b 100644
--- a/src/newt/native/ScreenMode.h
+++ b/src/newt/native/ScreenMode.h
@@ -40,7 +40,8 @@
 
 #define NUM_MONITOR_MODE_PROPERTIES_ALL  8  /* count + the above */
 
-#define MIN_MONITOR_DEVICE_PROPERTIES 11   /* count + id, ScreenSizeMM[width, height], rotated Viewport[x, y, width, height], currentMonitorModeId, rotation, supportedModeId+ */
+#define MIN_MONITOR_DEVICE_PROPERTIES 15   /* count + id, ScreenSizeMM[width, height], rotated Viewport pixel-units, rotated Viewport pixel-units, currentMonitorModeId, rotation, supportedModeId+ */
+                                           /* Viewport := [x, y, width, height] (4 elements) */
 
 #define FLAG_INTERLACE      ( 1 << 0 )
 #define FLAG_DOUBLESCAN     ( 1 << 1 )
diff --git a/src/newt/native/WindowsWindow.c b/src/newt/native/WindowsWindow.c
index c20e156..70d0c6f 100644
--- a/src/newt/native/WindowsWindow.c
+++ b/src/newt/native/WindowsWindow.c
@@ -1859,10 +1859,14 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_windows_ScreenDriver_getMoni
     prop[propIndex++] = monitor_idx;
     prop[propIndex++] = widthmm;
     prop[propIndex++] = heightmm;
-    prop[propIndex++] = dm.dmPosition.x; // rotated viewport
-    prop[propIndex++] = dm.dmPosition.y; // rotated viewport
-    prop[propIndex++] = dm.dmPelsWidth;  // rotated viewport
-    prop[propIndex++] = dm.dmPelsHeight; // rotated viewport
+    prop[propIndex++] = dm.dmPosition.x; // rotated viewport pixel units
+    prop[propIndex++] = dm.dmPosition.y; // rotated viewport pixel units
+    prop[propIndex++] = dm.dmPelsWidth;  // rotated viewport pixel units
+    prop[propIndex++] = dm.dmPelsHeight; // rotated viewport pixel units
+    prop[propIndex++] = dm.dmPosition.x; // rotated viewport window units (same)
+    prop[propIndex++] = dm.dmPosition.y; // rotated viewport window units (same)
+    prop[propIndex++] = dm.dmPelsWidth;  // rotated viewport window units (same)
+    prop[propIndex++] = dm.dmPelsHeight; // rotated viewport window units (same)
 
     jintArray properties = (*env)->NewIntArray(env, propCount);
     if (properties == NULL) {
diff --git a/src/newt/native/X11RandR13.c b/src/newt/native/X11RandR13.c
index 92c20e8..4e92a32 100644
--- a/src/newt/native/X11RandR13.c
+++ b/src/newt/native/X11RandR13.c
@@ -426,10 +426,14 @@ JNIEXPORT jintArray JNICALL Java_jogamp_newt_driver_x11_RandR13_getMonitorDevice
     prop[propIndex++] = crt_idx;
     prop[propIndex++] = xrrOutputInfo->mm_width;
     prop[propIndex++] = xrrOutputInfo->mm_height;
-    prop[propIndex++] = xrrCrtcInfo->x;
-    prop[propIndex++] = xrrCrtcInfo->y;
-    prop[propIndex++] = xrrCrtcInfo->width;
-    prop[propIndex++] = xrrCrtcInfo->height;
+    prop[propIndex++] = xrrCrtcInfo->x;      // rotated viewport pixel units
+    prop[propIndex++] = xrrCrtcInfo->y;      // rotated viewport pixel units
+    prop[propIndex++] = xrrCrtcInfo->width;  // rotated viewport pixel units
+    prop[propIndex++] = xrrCrtcInfo->height; // rotated viewport pixel units
+    prop[propIndex++] = xrrCrtcInfo->x;      // rotated viewport window units (same)
+    prop[propIndex++] = xrrCrtcInfo->y;      // rotated viewport window units (same)
+    prop[propIndex++] = xrrCrtcInfo->width;  // rotated viewport window units (same)
+    prop[propIndex++] = xrrCrtcInfo->height; // rotated viewport window units (same)
     prop[propIndex++] = xrrCrtcInfo->mode; // current mode id
     prop[propIndex++] = NewtScreen_XRotation2Degree(env, xrrCrtcInfo->rotation);
     int i;
diff --git a/src/oculusvr/classes/com/jogamp/oculusvr/OVRDynamicLibraryBundleInfo.java b/src/oculusvr/classes/com/jogamp/oculusvr/OVRDynamicLibraryBundleInfo.java
new file mode 100644
index 0000000..86041b3
--- /dev/null
+++ b/src/oculusvr/classes/com/jogamp/oculusvr/OVRDynamicLibraryBundleInfo.java
@@ -0,0 +1,113 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.oculusvr;
+
+import com.jogamp.common.jvm.JNILibLoaderBase;
+import com.jogamp.common.os.DynamicLibraryBundle;
+import com.jogamp.common.os.DynamicLibraryBundleInfo;
+import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.RunnableExecutor;
+import com.jogamp.common.util.cache.TempJarCache;
+
+import java.security.AccessController;
+import java.security.PrivilegedAction;
+import java.util.*;
+
+/* pp */ final class OVRDynamicLibraryBundleInfo implements DynamicLibraryBundleInfo  {
+    private static final List<String> glueLibNames;
+    static {
+        AccessController.doPrivileged(new PrivilegedAction<Object>() {
+            public Object run() {
+                Platform.initSingleton();
+
+                if(TempJarCache.isInitialized()) {
+                   // only: oculusvr.jar -> oculusvr-natives-<os.and.arch>.jar
+                   JNILibLoaderBase.addNativeJarLibs(new Class<?>[] { com.jogamp.oculusvr.OVRDynamicLibraryBundleInfo.class }, null);
+                }
+                return null;
+            }
+        });
+
+        glueLibNames = new ArrayList<String>();
+        glueLibNames.add("oculusvr");
+    }
+
+    /* pp */ OVRDynamicLibraryBundleInfo() {
+    }
+
+    /**
+     * <p>
+     * Returns <code>true</code>,
+     * since we might load the library and allow symbol access to subsequent libs.
+     * </p>
+     */
+    @Override
+    public final boolean shallLinkGlobal() { return true; }
+
+    /**
+     * {@inheritDoc}
+     * <p>
+     * Returns <code>false</code>.
+     * </p>
+     */
+    @Override
+    public final boolean shallLookupGlobal() { return true; }
+
+    @Override
+    public final List<String> getGlueLibNames() {
+        return glueLibNames;
+    }
+
+    @Override
+    public final List<List<String>> getToolLibNames() {
+        return new ArrayList<List<String>>(); // None
+    }
+
+    @Override
+    public final List<String> getToolGetProcAddressFuncNameList() {
+        return null;
+    }
+
+    @Override
+    public final long toolGetProcAddress(final long toolGetProcAddressHandle, final String funcName) {
+        return 0;
+    }
+
+    @Override
+    public final boolean useToolGetProcAdressFirst(final String funcName) {
+        return false;
+    }
+
+    @Override
+    public final RunnableExecutor getLibLoaderExecutor() {
+        return DynamicLibraryBundle.getDefaultRunnableExecutor();
+    }
+}
+
+
diff --git a/src/oculusvr/classes/com/jogamp/oculusvr/OVRException.java b/src/oculusvr/classes/com/jogamp/oculusvr/OVRException.java
new file mode 100644
index 0000000..f2a254e
--- /dev/null
+++ b/src/oculusvr/classes/com/jogamp/oculusvr/OVRException.java
@@ -0,0 +1,57 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.oculusvr;
+
+/** A generic exception for OculusVR errors used throughout the binding
+    as a substitute for {@link RuntimeException}. */
+ at SuppressWarnings("serial")
+public class OVRException extends RuntimeException {
+  /** Constructs an ALException object. */
+  public OVRException() {
+    super();
+  }
+
+  /** Constructs an ALException object with the specified detail
+      message. */
+  public OVRException(final String message) {
+    super(message);
+  }
+
+  /** Constructs an ALException object with the specified detail
+      message and root cause. */
+  public OVRException(final String message, final Throwable cause) {
+    super(message, cause);
+  }
+
+  /** Constructs an ALException object with the specified root
+      cause. */
+  public OVRException(final Throwable cause) {
+    super(cause);
+  }
+}
diff --git a/src/oculusvr/classes/com/jogamp/oculusvr/OVRVersion.java b/src/oculusvr/classes/com/jogamp/oculusvr/OVRVersion.java
new file mode 100644
index 0000000..cf6eb5d
--- /dev/null
+++ b/src/oculusvr/classes/com/jogamp/oculusvr/OVRVersion.java
@@ -0,0 +1,155 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.oculusvr;
+
+import com.jogamp.common.GlueGenVersion;
+import com.jogamp.common.os.Platform;
+import com.jogamp.common.util.VersionUtil;
+import com.jogamp.common.util.JogampVersion;
+import com.jogamp.oculusvr.OVR;
+import com.jogamp.oculusvr.OvrHmdContext;
+import com.jogamp.oculusvr.ovrHmdDesc;
+import com.jogamp.oculusvr.ovrSensorDesc;
+import com.jogamp.oculusvr.ovrSizei;
+import com.jogamp.oculusvr.ovrVector2i;
+
+import java.util.jar.Manifest;
+
+public class OVRVersion extends JogampVersion {
+
+    protected static volatile OVRVersion jogampCommonVersionInfo;
+
+    protected OVRVersion(final String packageName, final Manifest mf) {
+        super(packageName, mf);
+    }
+
+    public static OVRVersion getInstance() {
+        if(null == jogampCommonVersionInfo) { // volatile: ok
+            synchronized(OVRVersion.class) {
+                if( null == jogampCommonVersionInfo ) {
+                    final String packageName = "com.jogamp.oculusvr";
+                    final Manifest mf = VersionUtil.getManifest(OVRVersion.class.getClassLoader(), packageName);
+                    jogampCommonVersionInfo = new OVRVersion(packageName, mf);
+                }
+            }
+        }
+        return jogampCommonVersionInfo;
+    }
+
+    public static StringBuilder getAvailableCapabilitiesInfo(final int ovrHmdIndex, StringBuilder sb) {
+        if(null==sb) {
+            sb = new StringBuilder();
+        }
+        if( !OVR.ovr_Initialize() ) { // recursive ..
+            sb.append("\tOVR not available").append(Platform.getNewline());
+        } else {
+            final OvrHmdContext ovrHmdCtx = OVR.ovrHmd_Create(ovrHmdIndex);
+            if( null != ovrHmdCtx ) {
+                getAvailableCapabilitiesInfo(ovrHmdCtx, ovrHmdIndex, sb);
+                OVR.ovrHmd_Destroy(ovrHmdCtx);
+            } else {
+                sb.append("\thmd."+ovrHmdIndex+" not available").append(Platform.getNewline());
+            }
+        }
+        // Nope .. ovr.ovr_Shutdown();
+        sb.append(Platform.getNewline());
+        return sb;
+    }
+    /**
+     *
+     * @param ovrHmdCtx
+     * @param ovrHmdIndex only for informal purposes, OVR HMD index of created <code>ovrHmdHandle</code>
+     * @param sb
+     * @return
+     */
+    public static StringBuilder getAvailableCapabilitiesInfo(final OvrHmdContext ovrHmdCtx, final int ovrHmdIndex, StringBuilder sb) {
+        if(null == ovrHmdCtx) {
+            throw new IllegalArgumentException("null ovrHmdHandle");
+        }
+        if(null==sb) {
+            sb = new StringBuilder();
+        }
+        final ovrHmdDesc hmdDesc = ovrHmdDesc.create();
+        OVR.ovrHmd_GetDesc(ovrHmdCtx, hmdDesc);
+        getAvailableCapabilitiesInfo(hmdDesc, ovrHmdIndex, sb);
+
+        final ovrSensorDesc sensorDesc = ovrSensorDesc.create();
+        if( OVR.ovrHmd_GetSensorDesc(ovrHmdCtx, sensorDesc) ) {
+            sb.append("\thmd."+ovrHmdIndex+".sensor.productId:\t0x"+Integer.toHexString(sensorDesc.getProductId())).append(Platform.getNewline());
+            sb.append("\thmd."+ovrHmdIndex+".sensor.vendorId:\t0x"+Integer.toHexString(sensorDesc.getVendorId())).append(Platform.getNewline());
+            sb.append("\thmd."+ovrHmdIndex+".sensor.serial:\t"+sensorDesc.getSerialNumberAsString()).append(Platform.getNewline());
+        } else {
+            sb.append("\thmd."+ovrHmdIndex+".sensor:\tn/a").append(Platform.getNewline());
+        }
+        return sb;
+    }
+    /**
+     *
+     * @param hmdDesc
+     * @param ovrHmdIndex only for informal purposes, OVR HMD index of <code>hmdDesc</code>
+     * @param sb
+     * @return
+     */
+    public static StringBuilder getAvailableCapabilitiesInfo(final ovrHmdDesc hmdDesc, final int ovrHmdIndex, StringBuilder sb) {
+        if(null==sb) {
+            sb = new StringBuilder();
+        }
+        sb.append("\thmd."+ovrHmdIndex+".productName:\t"+hmdDesc.getProductNameAsString()).append(Platform.getNewline());
+        sb.append("\thmd."+ovrHmdIndex+".vendorName:\t"+hmdDesc.getManufacturerAsString()).append(Platform.getNewline());
+        sb.append("\thmd."+ovrHmdIndex+".deviceName:\t"+hmdDesc.getDisplayDeviceNameAsString()).append(Platform.getNewline());
+        sb.append("\thmd."+ovrHmdIndex+".type:\t"+hmdDesc.getType()).append(Platform.getNewline());
+        sb.append("\thmd."+ovrHmdIndex+".hmdCaps:\t"+hmdDesc.getHmdCaps()).append(Platform.getNewline());
+        sb.append("\thmd."+ovrHmdIndex+".distorCaps:\t"+hmdDesc.getDistortionCaps()).append(Platform.getNewline());
+        sb.append("\thmd."+ovrHmdIndex+".sensorCaps:\t"+hmdDesc.getSensorCaps()).append(Platform.getNewline());
+        final ovrSizei resolution = hmdDesc.getResolution();
+        sb.append("\thmd."+ovrHmdIndex+".resolution:\t"+resolution.getW()+"x"+resolution.getH()).append(Platform.getNewline());
+        final ovrVector2i winPos = hmdDesc.getWindowsPos();
+        sb.append("\thmd."+ovrHmdIndex+".winPos:\t"+winPos.getX()+" / "+winPos.getY()).append(Platform.getNewline());
+        return sb;
+    }
+
+    public static StringBuilder getAllAvailableCapabilitiesInfo(StringBuilder sb) {
+        if(null==sb) {
+            sb = new StringBuilder();
+        }
+        sb.append(Platform.getNewline()).append(Platform.getNewline());
+        sb.append("HMD.0 Capabilities: ").append(Platform.getNewline());
+        getAvailableCapabilitiesInfo(0, sb);
+        return sb;
+    }
+
+    public static void main(final String args[]) {
+        System.err.println(VersionUtil.getPlatformInfo());
+        System.err.println(GlueGenVersion.getInstance());
+        // System.err.println(NativeWindowVersion.getInstance());
+        System.err.println(OVRVersion.getInstance());
+        System.err.println(OVRVersion.getAllAvailableCapabilitiesInfo(null).toString());
+    }
+}
+
diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDevice.java b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDevice.java
new file mode 100644
index 0000000..f6dc8bf
--- /dev/null
+++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDevice.java
@@ -0,0 +1,219 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl.oculusvr;
+
+import javax.media.nativewindow.util.Dimension;
+import javax.media.nativewindow.util.DimensionImmutable;
+import javax.media.nativewindow.util.PointImmutable;
+import javax.media.nativewindow.util.Rectangle;
+import javax.media.nativewindow.util.RectangleImmutable;
+
+import com.jogamp.oculusvr.OVR;
+import com.jogamp.oculusvr.OvrHmdContext;
+import com.jogamp.oculusvr.ovrEyeRenderDesc;
+import com.jogamp.oculusvr.ovrFovPort;
+import com.jogamp.oculusvr.ovrHmdDesc;
+import com.jogamp.oculusvr.ovrSizei;
+import com.jogamp.opengl.math.FovHVHalves;
+import com.jogamp.opengl.util.stereo.StereoDevice;
+import com.jogamp.opengl.util.stereo.StereoDeviceFactory;
+import com.jogamp.opengl.util.stereo.StereoDeviceRenderer;
+import com.jogamp.opengl.util.stereo.StereoUtil;
+
+public class OVRStereoDevice implements StereoDevice {
+    /** 1.6 up, 5 forward */
+    private static final float[] DEFAULT_EYE_POSITION_OFFSET = { 0.0f, 1.6f, -5.0f };
+
+    private final StereoDeviceFactory factory;
+    public final OvrHmdContext handle;
+    public final int deviceIndex;
+    public final ovrHmdDesc hmdDesc;
+    private final FovHVHalves[] defaultEyeFov;
+
+    private boolean sensorsStarted = false;
+    private final int[] eyeRenderOrder;
+    private final int supportedDistortionBits, recommendedDistortionBits, minimumDistortionBits;
+
+    public OVRStereoDevice(final StereoDeviceFactory factory, final OvrHmdContext nativeContext, final int deviceIndex) {
+        if( null == nativeContext ) {
+            throw new IllegalArgumentException("Passed null nativeContext");
+        }
+        this.factory = factory;
+        this.handle = nativeContext;
+        this.deviceIndex = deviceIndex;
+        this.hmdDesc = ovrHmdDesc.create();
+        OVR.ovrHmd_GetDesc(handle, hmdDesc);
+        final ovrFovPort[] defaultOVREyeFov = hmdDesc.getDefaultEyeFov(0, new ovrFovPort[hmdDesc.getEyeRenderOrderArrayLength()]);
+        defaultEyeFov = new FovHVHalves[defaultOVREyeFov.length];
+        for(int i=0; i<defaultEyeFov.length; i++) {
+            defaultEyeFov[i] = OVRUtil.getFovHV(defaultOVREyeFov[i]);
+        }
+        eyeRenderOrder = new int[hmdDesc.getEyeRenderOrderArrayLength()];
+        hmdDesc.getEyeRenderOrder(0, eyeRenderOrder);
+        supportedDistortionBits = OVRUtil.ovrDistCaps2DistBits(hmdDesc.getDistortionCaps());
+        recommendedDistortionBits = supportedDistortionBits & ~StereoDeviceRenderer.DISTORTION_TIMEWARP;
+        minimumDistortionBits = StereoDeviceRenderer.DISTORTION_BARREL;
+    }
+
+    @Override
+    public final StereoDeviceFactory getFactory() { return factory; }
+
+    @Override
+    public final String toString() {
+        final StringBuilder sb = new StringBuilder();
+        sb.append("OVRStereoDevice[product "+hmdDesc.getProductNameAsString());
+        sb.append(", vendor "+hmdDesc.getManufacturerAsString());
+        sb.append(", device "+hmdDesc.getDisplayDeviceNameAsString());
+        sb.append(", surfaceSize "+getSurfaceSize());
+        sb.append(", surfacePos "+getPosition());
+        sb.append(", distortionBits[supported ["+StereoUtil.distortionBitsToString(getSupportedDistortionBits())+
+                      "], recommended ["+StereoUtil.distortionBitsToString(getRecommendedDistortionBits())+
+                      "], minimum ["+StereoUtil.distortionBitsToString(getMinimumDistortionBits())+"]]]");
+        return sb.toString();
+    }
+
+    @Override
+    public final void dispose() {
+        // NOP
+    }
+
+    @Override
+    public final PointImmutable getPosition() {
+        return OVRUtil.getVec2iAsPoint(hmdDesc.getWindowsPos());
+    }
+
+    @Override
+    public final DimensionImmutable getSurfaceSize() {
+        return OVRUtil.getOVRSizei(hmdDesc.getResolution());
+    }
+
+    @Override
+    public float[] getDefaultEyePositionOffset() {
+        return DEFAULT_EYE_POSITION_OFFSET;
+    }
+
+    @Override
+    public final FovHVHalves[] getDefaultFOV() {
+        return defaultEyeFov;
+    }
+
+    @Override
+    public final boolean startSensors(final boolean start) {
+        if( start && !sensorsStarted ) {
+            // Start the sensor which provides the Rift’s pose and motion.
+            final int requiredSensorCaps = 0;
+            final int supportedSensorCaps = requiredSensorCaps | OVR.ovrSensorCap_Orientation | OVR.ovrSensorCap_YawCorrection | OVR.ovrSensorCap_Position;
+            if( OVR.ovrHmd_StartSensor(handle, supportedSensorCaps, requiredSensorCaps) ) {
+                sensorsStarted = true;
+                return true;
+            } else {
+                sensorsStarted = false;
+                return false;
+            }
+        } else if( sensorsStarted ) {
+            OVR.ovrHmd_StopSensor(handle);
+            sensorsStarted = false;
+            return true;
+        } else {
+            // No state change -> Success
+            return true;
+        }
+    }
+    @Override
+    public final boolean getSensorsStarted() { return sensorsStarted; }
+
+    @Override
+    public final int[] getEyeRenderOrder() {
+        return eyeRenderOrder;
+    }
+
+    @Override
+    public final int getSupportedDistortionBits() {
+        return supportedDistortionBits;
+    };
+
+    @Override
+    public final int getRecommendedDistortionBits() {
+        return recommendedDistortionBits;
+    }
+
+    @Override
+    public final int getMinimumDistortionBits() {
+        return minimumDistortionBits;
+    }
+
+    @Override
+    public final StereoDeviceRenderer createRenderer(final int distortionBits,
+                                                     final int textureCount, final float[] eyePositionOffset,
+                                                     final FovHVHalves[] eyeFov, final float pixelsPerDisplayPixel, final int textureUnit) {
+        final ovrFovPort ovrEyeFov0 = OVRUtil.getOVRFovPort(eyeFov[0]);
+        final ovrFovPort ovrEyeFov1 = OVRUtil.getOVRFovPort(eyeFov[1]);
+
+        final ovrEyeRenderDesc[] eyeRenderDesc = new ovrEyeRenderDesc[2];
+        eyeRenderDesc[0] = OVR.ovrHmd_GetRenderDesc(handle, OVR.ovrEye_Left, ovrEyeFov0);
+        eyeRenderDesc[1] = OVR.ovrHmd_GetRenderDesc(handle, OVR.ovrEye_Right, ovrEyeFov1);
+        if( StereoDevice.DEBUG ) {
+            System.err.println("XXX: eyeRenderDesc[0] "+OVRUtil.toString(eyeRenderDesc[0]));
+            System.err.println("XXX: eyeRenderDesc[1] "+OVRUtil.toString(eyeRenderDesc[1]));
+        }
+
+        final ovrSizei recommenedTex0Size = OVR.ovrHmd_GetFovTextureSize(handle, OVR.ovrEye_Left,  eyeRenderDesc[0].getFov(), pixelsPerDisplayPixel);
+        final ovrSizei recommenedTex1Size = OVR.ovrHmd_GetFovTextureSize(handle, OVR.ovrEye_Right, eyeRenderDesc[1].getFov(), pixelsPerDisplayPixel);
+        if( StereoDevice.DEBUG ) {
+            System.err.println("XXX: recommenedTex0Size "+OVRUtil.toString(recommenedTex0Size));
+            System.err.println("XXX: recommenedTex1Size "+OVRUtil.toString(recommenedTex1Size));
+        }
+        final int unifiedW = Math.max(recommenedTex0Size.getW(), recommenedTex1Size.getW());
+        final int unifiedH = Math.max(recommenedTex0Size.getH(), recommenedTex1Size.getH());
+
+        final DimensionImmutable singleTextureSize = new Dimension(unifiedW, unifiedH);
+        final DimensionImmutable totalTextureSize = new Dimension(recommenedTex0Size.getW() + recommenedTex1Size.getW(), unifiedH);
+        if( StereoDevice.DEBUG ) {
+            System.err.println("XXX: textureSize Single "+singleTextureSize);
+            System.err.println("XXX: textureSize Total  "+totalTextureSize);
+        }
+
+        final RectangleImmutable[] eyeRenderViewports = new RectangleImmutable[2];
+        if( 1 == textureCount ) { // validated in ctor below!
+            eyeRenderViewports[0] = new Rectangle(0, 0,
+                                                  totalTextureSize.getWidth() / 2,
+                                                  totalTextureSize.getHeight());
+
+            eyeRenderViewports[1] = new Rectangle((totalTextureSize.getWidth() + 1) / 2, 0,
+                                                  totalTextureSize.getWidth() / 2,
+                                                  totalTextureSize.getHeight());
+        } else {
+            eyeRenderViewports[0] = new Rectangle(0, 0,
+                                                  singleTextureSize.getWidth(),
+                                                  singleTextureSize.getHeight());
+            eyeRenderViewports[1] = eyeRenderViewports[0];
+        }
+        return new OVRStereoDeviceRenderer(this, distortionBits, textureCount, eyePositionOffset,
+                                           eyeRenderDesc, singleTextureSize, totalTextureSize, eyeRenderViewports, textureUnit);
+    }
+}
\ No newline at end of file
diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceFactory.java b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceFactory.java
new file mode 100644
index 0000000..06f716d
--- /dev/null
+++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceFactory.java
@@ -0,0 +1,62 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl.oculusvr;
+
+import com.jogamp.oculusvr.OVR;
+import com.jogamp.oculusvr.OVRVersion;
+import com.jogamp.oculusvr.OvrHmdContext;
+import com.jogamp.opengl.util.stereo.StereoDevice;
+import com.jogamp.opengl.util.stereo.StereoDevice.Config;
+import com.jogamp.opengl.util.stereo.StereoDeviceFactory;
+
+public class OVRStereoDeviceFactory extends StereoDeviceFactory {
+
+    public static boolean isAvailable() {
+        if( OVR.ovr_Initialize() ) { // recursive ..
+            return 0 < OVR.ovrHmd_Detect();
+        }
+        return false;
+    }
+
+    @Override
+    public final StereoDevice createDevice(final int deviceIndex, final Config config, final boolean verbose) {
+        final OvrHmdContext hmdCtx = OVR.ovrHmd_Create(deviceIndex);
+        if( null == hmdCtx ) {
+            if( verbose ) {
+                System.err.println("Failed to create hmdCtx for device index "+deviceIndex+" on thread "+Thread.currentThread().getName());
+                Thread.dumpStack();
+            }
+            return null;
+        }
+        final OVRStereoDevice ctx = new OVRStereoDevice(this, hmdCtx, deviceIndex);
+        if( verbose ) {
+            System.err.println(OVRVersion.getAvailableCapabilitiesInfo(ctx.hmdDesc, deviceIndex, null).toString());
+        }
+        return ctx;
+    }
+}
diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceRenderer.java b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceRenderer.java
new file mode 100644
index 0000000..3973621
--- /dev/null
+++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRStereoDeviceRenderer.java
@@ -0,0 +1,604 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl.oculusvr;
+
+import java.nio.FloatBuffer;
+import java.nio.ShortBuffer;
+
+import javax.media.nativewindow.util.DimensionImmutable;
+import javax.media.nativewindow.util.RectangleImmutable;
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GLArrayData;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLUniformData;
+
+import jogamp.common.os.PlatformPropsImpl;
+
+import com.jogamp.common.nio.Buffers;
+import com.jogamp.oculusvr.OVR;
+import com.jogamp.oculusvr.OVRException;
+import com.jogamp.oculusvr.OvrHmdContext;
+import com.jogamp.oculusvr.ovrDistortionMesh;
+import com.jogamp.oculusvr.ovrDistortionVertex;
+import com.jogamp.oculusvr.ovrEyeRenderDesc;
+import com.jogamp.oculusvr.ovrFovPort;
+import com.jogamp.oculusvr.ovrFrameTiming;
+import com.jogamp.oculusvr.ovrMatrix4f;
+import com.jogamp.oculusvr.ovrPosef;
+import com.jogamp.oculusvr.ovrRecti;
+import com.jogamp.oculusvr.ovrSizei;
+import com.jogamp.oculusvr.ovrVector2f;
+import com.jogamp.oculusvr.ovrVector3f;
+import com.jogamp.opengl.JoglVersion;
+import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.util.GLArrayDataServer;
+import com.jogamp.opengl.util.glsl.ShaderCode;
+import com.jogamp.opengl.util.glsl.ShaderProgram;
+import com.jogamp.opengl.util.stereo.EyeParameter;
+import com.jogamp.opengl.util.stereo.EyePose;
+import com.jogamp.opengl.util.stereo.StereoDevice;
+import com.jogamp.opengl.util.stereo.StereoDeviceRenderer;
+import com.jogamp.opengl.util.stereo.StereoUtil;
+
+/**
+ * OculusVR Stereo Device Distortion and OpenGL Renderer Utility
+ */
+public class OVRStereoDeviceRenderer implements StereoDeviceRenderer {
+    private static final String shaderPrefix01 = "dist01";
+    private static final String shaderTimewarpSuffix = "_timewarp";
+    private static final String shaderChromaSuffix = "_chroma";
+    private static final String shaderPlainSuffix = "_plain";
+
+    public static class OVREye implements StereoDeviceRenderer.Eye {
+        private final int eyeName;
+        private final int distortionBits;
+        private final int vertexCount;
+        private final int indexCount;
+        private final RectangleImmutable viewport;
+
+        private final GLUniformData eyeToSourceUVScale;
+        private final GLUniformData eyeToSourceUVOffset;
+        private final GLUniformData eyeRotationStart;
+        private final GLUniformData eyeRotationEnd;
+
+        /** 2+2+2+2+2: { vec2 position, vec2 color, vec2 texCoordR, vec2 texCoordG, vec2 texCoordB } */
+        private final GLArrayDataServer iVBO;
+        private final GLArrayData vboPos, vboParams, vboTexCoordsR, vboTexCoordsG, vboTexCoordsB;
+        private final GLArrayDataServer indices;
+
+        private final ovrEyeRenderDesc ovrEyeDesc;
+        private final ovrFovPort ovrEyeFov;
+        private final EyeParameter eyeParameter;
+
+        private ovrPosef ovrEyePose;
+        private final EyePose eyePose;
+
+        @Override
+        public final RectangleImmutable getViewport() { return viewport; }
+
+        @Override
+        public final EyeParameter getEyeParameter() { return eyeParameter; }
+
+        @Override
+        public final EyePose getLastEyePose() { return eyePose; }
+
+        private OVREye(final OvrHmdContext hmdCtx, final int distortionBits,
+                       final float[] eyePositionOffset, final ovrEyeRenderDesc eyeDesc,
+                       final ovrSizei ovrTextureSize, final RectangleImmutable eyeViewport) {
+            this.eyeName = eyeDesc.getEye();
+            this.distortionBits = distortionBits;
+            this.viewport = eyeViewport;
+
+            final boolean usesTimewarp = StereoUtil.usesTimewarpDistortion(distortionBits);
+            final FloatBuffer fstash = Buffers.newDirectFloatBuffer( 2 + 2 + ( usesTimewarp ? 16 + 16 : 0 ) ) ;
+
+            eyeToSourceUVScale = new GLUniformData("ovr_EyeToSourceUVScale", 2, Buffers.slice2Float(fstash, 0, 2));
+            eyeToSourceUVOffset = new GLUniformData("ovr_EyeToSourceUVOffset", 2, Buffers.slice2Float(fstash, 2, 2));
+
+            if( usesTimewarp ) {
+                eyeRotationStart = new GLUniformData("ovr_EyeRotationStart", 4, 4, Buffers.slice2Float(fstash, 4, 16));
+                eyeRotationEnd = new GLUniformData("ovr_EyeRotationEnd", 4, 4, Buffers.slice2Float(fstash, 20, 16));
+            } else {
+                eyeRotationStart = null;
+                eyeRotationEnd = null;
+            }
+
+            this.ovrEyeDesc = eyeDesc;
+            this.ovrEyeFov = eyeDesc.getFov();
+
+            final ovrVector3f eyeViewAdjust = eyeDesc.getViewAdjust();
+            this.eyeParameter = new EyeParameter(eyeName, eyePositionOffset, OVRUtil.getFovHV(ovrEyeFov),
+                                                 eyeViewAdjust.getX(), eyeViewAdjust.getY(), eyeViewAdjust.getZ());
+
+            this.eyePose = new EyePose(eyeName);
+
+            updateEyePose(hmdCtx); // 1st init
+
+            // Setup: eyeToSourceUVScale, eyeToSourceUVOffset
+            {
+                final ovrVector2f[] uvScaleOffsetOut = new ovrVector2f[2];
+                uvScaleOffsetOut[0] = ovrVector2f.create(); // FIXME: remove ctor / double check
+                uvScaleOffsetOut[1] = ovrVector2f.create();
+
+                final ovrRecti ovrEyeRenderViewport = OVRUtil.createOVRRecti(eyeViewport);
+                OVR.ovrHmd_GetRenderScaleAndOffset(ovrEyeFov, ovrTextureSize, ovrEyeRenderViewport, uvScaleOffsetOut);
+                if( StereoDevice.DEBUG ) {
+                    System.err.println("XXX."+eyeName+": eyeParam      "+eyeParameter);
+                    System.err.println("XXX."+eyeName+": uvScale       "+OVRUtil.toString(uvScaleOffsetOut[0]));
+                    System.err.println("XXX."+eyeName+": uvOffset      "+OVRUtil.toString(uvScaleOffsetOut[1]));
+                    System.err.println("XXX."+eyeName+": textureSize   "+OVRUtil.toString(ovrTextureSize));
+                    System.err.println("XXX."+eyeName+": viewport      "+OVRUtil.toString(ovrEyeRenderViewport));
+                }
+                final FloatBuffer eyeToSourceUVScaleFB = eyeToSourceUVScale.floatBufferValue();
+                eyeToSourceUVScaleFB.put(0, uvScaleOffsetOut[0].getX());
+                eyeToSourceUVScaleFB.put(1, uvScaleOffsetOut[0].getY());
+                final FloatBuffer eyeToSourceUVOffsetFB = eyeToSourceUVOffset.floatBufferValue();
+                eyeToSourceUVOffsetFB.put(0, uvScaleOffsetOut[1].getX());
+                eyeToSourceUVOffsetFB.put(1, uvScaleOffsetOut[1].getY());
+            }
+
+            final ovrDistortionMesh meshData = ovrDistortionMesh.create();
+
+            final int ovrDistortionCaps = distBits2OVRDistCaps(distortionBits);
+            if( !OVR.ovrHmd_CreateDistortionMesh(hmdCtx, eyeName, ovrEyeFov, ovrDistortionCaps, meshData) ) {
+                throw new OVRException("Failed to create meshData for eye "+eyeName+", "+OVRUtil.toString(ovrEyeFov)+" and "+StereoUtil.distortionBitsToString(distortionBits));
+            }
+            vertexCount = meshData.getVertexCount();
+            indexCount = meshData.getIndexCount();
+
+            /** 2+2+2+2+2: { vec2 position, vec2 color, vec2 texCoordR, vec2 texCoordG, vec2 texCoordB } */
+            final boolean useChromatic = StereoUtil.usesChromaticDistortion(distortionBits);
+            final boolean useVignette = StereoUtil.usesVignetteDistortion(distortionBits);
+
+            final int compsPerElement = 2+2+2+( useChromatic ? 2+2 /* texCoordG + texCoordB */: 0 );
+            iVBO = GLArrayDataServer.createGLSLInterleaved(compsPerElement, GL.GL_FLOAT, false, vertexCount, GL.GL_STATIC_DRAW);
+            vboPos = iVBO.addGLSLSubArray("ovr_Position", 2, GL.GL_ARRAY_BUFFER);
+            vboParams = iVBO.addGLSLSubArray("ovr_Params", 2, GL.GL_ARRAY_BUFFER);
+            vboTexCoordsR = iVBO.addGLSLSubArray("ovr_TexCoordR", 2, GL.GL_ARRAY_BUFFER);
+            if( useChromatic ) {
+                vboTexCoordsG = iVBO.addGLSLSubArray("ovr_TexCoordG", 2, GL.GL_ARRAY_BUFFER);
+                vboTexCoordsB = iVBO.addGLSLSubArray("ovr_TexCoordB", 2, GL.GL_ARRAY_BUFFER);
+            } else {
+                vboTexCoordsG = null;
+                vboTexCoordsB = null;
+            }
+            indices = GLArrayDataServer.createData(1, GL.GL_SHORT, indexCount, GL.GL_STATIC_DRAW, GL.GL_ELEMENT_ARRAY_BUFFER);
+
+            /** 2+2+2+2+2: { vec2 position, vec2 color, vec2 texCoordR, vec2 texCoordG, vec2 texCoordB } */
+            final FloatBuffer iVBOFB = (FloatBuffer)iVBO.getBuffer();
+            final ovrDistortionVertex[] ovRes = new ovrDistortionVertex[1];
+            ovRes[0] = ovrDistortionVertex.create(); // FIXME: remove ctor / double check
+
+            for ( int vertNum = 0; vertNum < vertexCount; vertNum++ ) {
+                final ovrDistortionVertex ov = meshData.getPVertexData(vertNum, ovRes)[0];
+                ovrVector2f v;
+
+                if( StereoDevice.DUMP_DATA ) {
+                    System.err.println("XXX."+eyeName+": START VERTEX "+vertNum+" / "+vertexCount);
+                }
+                // pos
+                v = ov.getPos();
+                if( StereoDevice.DUMP_DATA ) {
+                    System.err.println("XXX."+eyeName+": pos "+OVRUtil.toString(v));
+                }
+                iVBOFB.put(v.getX());
+                iVBOFB.put(v.getY());
+
+                // params
+                if( useVignette ) {
+                    if( StereoDevice.DUMP_DATA ) {
+                        System.err.println("XXX."+eyeName+": vignette "+ov.getVignetteFactor());
+                    }
+                    iVBOFB.put(ov.getVignetteFactor());
+                } else {
+                    iVBOFB.put(1.0f);
+                }
+                if( StereoDevice.DUMP_DATA ) {
+                    System.err.println("XXX."+eyeName+": timewarp "+ov.getTimeWarpFactor());
+                }
+                iVBOFB.put(ov.getTimeWarpFactor());
+
+                // texCoordR
+                v = ov.getTexR();
+                if( StereoDevice.DUMP_DATA ) {
+                    System.err.println("XXX."+eyeName+": texR "+OVRUtil.toString(v));
+                }
+                iVBOFB.put(v.getX());
+                iVBOFB.put(v.getY());
+
+                if( useChromatic ) {
+                    // texCoordG
+                    v = ov.getTexG();
+                    if( StereoDevice.DUMP_DATA ) {
+                        System.err.println("XXX."+eyeName+": texG "+OVRUtil.toString(v));
+                    }
+                    iVBOFB.put(v.getX());
+                    iVBOFB.put(v.getY());
+
+                    // texCoordB
+                    v = ov.getTexB();
+                    if( StereoDevice.DUMP_DATA ) {
+                        System.err.println("XXX."+eyeName+": texB "+OVRUtil.toString(v));
+                    }
+                    iVBOFB.put(v.getX());
+                    iVBOFB.put(v.getY());
+                }
+            }
+            if( StereoDevice.DUMP_DATA ) {
+                System.err.println("XXX."+eyeName+": iVBO "+iVBO);
+            }
+            {
+                final ShortBuffer in = meshData.getPIndexData();
+                if( StereoDevice.DUMP_DATA ) {
+                    System.err.println("XXX."+eyeName+": idx "+indices+", count "+indexCount);
+                    for(int i=0; i< indexCount; i++) {
+                        if( 0 == i % 16 ) {
+                            System.err.printf("%n%5d: ", i);
+                        }
+                        System.err.printf("%5d, ", (int)in.get(i));
+                    }
+                    System.err.println();
+                }
+                final ShortBuffer out = (ShortBuffer) indices.getBuffer();
+                out.put(in);
+            }
+            if( StereoDevice.DEBUG ) {
+                System.err.println("XXX."+eyeName+": "+this);
+            }
+            OVR.ovrHmd_DestroyDistortionMesh(meshData);
+        }
+
+        private void linkData(final GL2ES2 gl, final ShaderProgram sp) {
+            if( 0 > vboPos.setLocation(gl, sp.program()) ) {
+                throw new GLException("Couldn't locate "+vboPos);
+            }
+            if( 0 > vboParams.setLocation(gl, sp.program()) ) {
+                throw new GLException("Couldn't locate "+vboParams);
+            }
+            if( 0 > vboTexCoordsR.setLocation(gl, sp.program()) ) {
+                throw new GLException("Couldn't locate "+vboTexCoordsR);
+            }
+            if( StereoUtil.usesChromaticDistortion(distortionBits) ) {
+                if( 0 > vboTexCoordsG.setLocation(gl, sp.program()) ) {
+                    throw new GLException("Couldn't locate "+vboTexCoordsG);
+                }
+                if( 0 > vboTexCoordsB.setLocation(gl, sp.program()) ) {
+                    throw new GLException("Couldn't locate "+vboTexCoordsB);
+                }
+            }
+            if( 0 > eyeToSourceUVScale.setLocation(gl, sp.program()) ) {
+                throw new GLException("Couldn't locate "+eyeToSourceUVScale);
+            }
+            if( 0 > eyeToSourceUVOffset.setLocation(gl, sp.program()) ) {
+                throw new GLException("Couldn't locate "+eyeToSourceUVOffset);
+            }
+            if( StereoUtil.usesTimewarpDistortion(distortionBits) ) {
+                if( 0 > eyeRotationStart.setLocation(gl, sp.program()) ) {
+                    throw new GLException("Couldn't locate "+eyeRotationStart);
+                }
+                if( 0 > eyeRotationEnd.setLocation(gl, sp.program()) ) {
+                    throw new GLException("Couldn't locate "+eyeRotationEnd);
+                }
+            }
+            iVBO.seal(gl, true);
+            iVBO.enableBuffer(gl, false);
+            indices.seal(gl, true);
+            indices.enableBuffer(gl, false);
+        }
+
+        private void dispose(final GL2ES2 gl) {
+            iVBO.destroy(gl);
+            indices.destroy(gl);
+        }
+        private void enableVBO(final GL2ES2 gl, final boolean enable) {
+            iVBO.enableBuffer(gl, enable);
+            indices.bindBuffer(gl, enable); // keeps VBO binding if enable:=true
+        }
+
+        private void updateUniform(final GL2ES2 gl, final ShaderProgram sp) {
+            gl.glUniform(eyeToSourceUVScale);
+            gl.glUniform(eyeToSourceUVOffset);
+            if( StereoUtil.usesTimewarpDistortion(distortionBits) ) {
+                gl.glUniform(eyeRotationStart);
+                gl.glUniform(eyeRotationEnd);
+            }
+        }
+
+        private void updateTimewarp(final OvrHmdContext hmdCtx, final ovrPosef eyeRenderPose, final float[] mat4Tmp1, final float[] mat4Tmp2) {
+            final ovrMatrix4f[] timeWarpMatrices = new ovrMatrix4f[2];
+            timeWarpMatrices[0] = ovrMatrix4f.create(); // FIXME: remove ctor / double check
+            timeWarpMatrices[1] = ovrMatrix4f.create();
+            OVR.ovrHmd_GetEyeTimewarpMatrices(hmdCtx, eyeName, eyeRenderPose, timeWarpMatrices);
+
+            final float[] eyeRotationStartM = FloatUtil.transposeMatrix(timeWarpMatrices[0].getM(0, mat4Tmp1), mat4Tmp2);
+            final FloatBuffer eyeRotationStartU = eyeRotationStart.floatBufferValue();
+            eyeRotationStartU.put(eyeRotationStartM);
+            eyeRotationStartU.rewind();
+
+            final float[] eyeRotationEndM = FloatUtil.transposeMatrix(timeWarpMatrices[1].getM(0, mat4Tmp1), mat4Tmp2);
+            final FloatBuffer eyeRotationEndU = eyeRotationEnd.floatBufferValue();
+            eyeRotationEndU.put(eyeRotationEndM);
+            eyeRotationEndU.rewind();
+        }
+
+        /**
+         * Updates {@link #ovrEyePose} and it's extracted
+         * {@link #eyeRenderPoseOrientation} and {@link #eyeRenderPosePosition}.
+         * @param hmdCtx used get the {@link #ovrEyePose} via {@link OVR#ovrHmd_GetEyePose(OvrHmdContext, int)}
+         */
+        private EyePose updateEyePose(final OvrHmdContext hmdCtx) {
+            ovrEyePose = OVR.ovrHmd_GetEyePose(hmdCtx, eyeName);
+            final ovrVector3f pos = ovrEyePose.getPosition();
+            eyePose.setPosition(pos.getX(), pos.getY(), pos.getZ());
+            OVRUtil.copyToQuaternion(ovrEyePose.getOrientation(), eyePose.orientation);
+            return eyePose;
+        }
+
+        @Override
+        public String toString() {
+            return "Eye["+eyeName+", viewport "+viewport+
+                        ", "+eyeParameter+
+                        ", vertices "+vertexCount+", indices "+indexCount+
+                        ", uvScale["+eyeToSourceUVScale.floatBufferValue().get(0)+", "+eyeToSourceUVScale.floatBufferValue().get(1)+
+                        "], uvOffset["+eyeToSourceUVOffset.floatBufferValue().get(0)+", "+eyeToSourceUVOffset.floatBufferValue().get(1)+
+                        "], desc"+OVRUtil.toString(ovrEyeDesc)+", "+eyePose+"]";
+        }
+    }
+
+    private final OVRStereoDevice context;
+    private final OVREye[] eyes;
+    private final int distortionBits;
+    private final int textureCount;
+    private final DimensionImmutable singleTextureSize;
+    private final DimensionImmutable totalTextureSize;
+    private final GLUniformData texUnit0;
+
+
+    private final float[] mat4Tmp1 = new float[16];
+    private final float[] mat4Tmp2 = new float[16];
+
+    private ShaderProgram sp;
+    private ovrFrameTiming frameTiming;
+
+    @Override
+    public String toString() {
+        return "OVRDist[distortion["+StereoUtil.distortionBitsToString(distortionBits)+
+                       "], singleSize "+singleTextureSize+
+                       ", sbsSize "+totalTextureSize+
+                       ", texCount "+textureCount+", texUnit "+getTextureUnit()+
+                       ", "+PlatformPropsImpl.NEWLINE+"  "+eyes[0]+", "+PlatformPropsImpl.NEWLINE+"  "+eyes[1]+"]";
+    }
+
+
+    private static int distBits2OVRDistCaps(final int distortionBits) {
+        int caps = 0;
+        if( StereoUtil.usesTimewarpDistortion(distortionBits) ) {
+            caps |= OVR.ovrDistortionCap_TimeWarp;
+        }
+        if( StereoUtil.usesChromaticDistortion(distortionBits) ) {
+            caps |= OVR.ovrDistortionCap_Chromatic;
+        }
+        if( StereoUtil.usesVignetteDistortion(distortionBits) ) {
+            caps |= OVR.ovrDistortionCap_Vignette;
+        }
+        return caps;
+    }
+
+    /* pp */ OVRStereoDeviceRenderer(final OVRStereoDevice context, final int distortionBits,
+                             final int textureCount, final float[] eyePositionOffset,
+                             final ovrEyeRenderDesc[] eyeRenderDescs, final DimensionImmutable singleTextureSize, final DimensionImmutable totalTextureSize,
+                             final RectangleImmutable[] eyeViewports, final int textureUnit) {
+        if( 1 > textureCount || 2 < textureCount ) {
+            throw new IllegalArgumentException("textureCount can only be 1 or 2, has "+textureCount);
+        }
+        this.context = context;
+        this.eyes = new OVREye[2];
+        this.distortionBits = ( distortionBits | context.getMinimumDistortionBits() ) & context.getSupportedDistortionBits();
+        this.textureCount = textureCount;
+        this.singleTextureSize = singleTextureSize;
+        this.totalTextureSize = totalTextureSize;
+
+        texUnit0 = new GLUniformData("ovr_Texture0", textureUnit);
+
+        final ovrSizei ovrTextureSize = OVRUtil.createOVRSizei( 1 == textureCount ? totalTextureSize : singleTextureSize );
+        eyes[0] = new OVREye(context.handle, this.distortionBits, eyePositionOffset, eyeRenderDescs[0], ovrTextureSize, eyeViewports[0]);
+        eyes[1] = new OVREye(context.handle, this.distortionBits, eyePositionOffset, eyeRenderDescs[1], ovrTextureSize, eyeViewports[1]);
+        sp = null;
+        frameTiming = null;
+    }
+
+    @Override
+    public StereoDevice getDevice() {
+        return context;
+    }
+
+    @Override
+    public final int getDistortionBits() { return distortionBits; }
+
+    @Override
+    public final boolean usesSideBySideStereo() { return true; }
+
+    @Override
+    public final DimensionImmutable getSingleSurfaceSize() { return singleTextureSize; }
+
+    @Override
+    public final DimensionImmutable getTotalSurfaceSize() { return totalTextureSize; }
+
+    @Override
+    public final int getTextureCount() { return textureCount; }
+
+    @Override
+    public final int getTextureUnit() { return texUnit0.intValue(); }
+
+    @Override
+    public final boolean ppAvailable() { return 0 != distortionBits; }
+
+    @Override
+    public final void init(final GL gl) {
+        if( StereoDevice.DEBUG ) {
+            System.err.println(JoglVersion.getGLInfo(gl, null).toString());
+        }
+        if( null != sp ) {
+            throw new IllegalStateException("Already initialized");
+        }
+        final GL2ES2 gl2es2 = gl.getGL2ES2();
+
+        final String vertexShaderBasename;
+        final String fragmentShaderBasename;
+        {
+            final boolean usesTimewarp = StereoUtil.usesTimewarpDistortion(distortionBits);
+            final boolean usesChromatic = StereoUtil.usesChromaticDistortion(distortionBits);
+
+            final StringBuilder sb = new StringBuilder();
+            sb.append(shaderPrefix01);
+            if( !usesChromatic && !usesTimewarp ) {
+                sb.append(shaderPlainSuffix);
+            } else if( usesChromatic && !usesTimewarp ) {
+                sb.append(shaderChromaSuffix);
+            } else if( usesTimewarp ) {
+                sb.append(shaderTimewarpSuffix);
+                if( usesChromatic ) {
+                    sb.append(shaderChromaSuffix);
+                }
+            }
+            vertexShaderBasename = sb.toString();
+            sb.setLength(0);
+            sb.append(shaderPrefix01);
+            if( usesChromatic ) {
+                sb.append(shaderChromaSuffix);
+            } else {
+                sb.append(shaderPlainSuffix);
+            }
+            fragmentShaderBasename = sb.toString();
+        }
+        final ShaderCode vp0 = ShaderCode.create(gl2es2, GL2ES2.GL_VERTEX_SHADER, OVRStereoDeviceRenderer.class, "shader",
+                "shader/bin", vertexShaderBasename, true);
+        final ShaderCode fp0 = ShaderCode.create(gl2es2, GL2ES2.GL_FRAGMENT_SHADER, OVRStereoDeviceRenderer.class, "shader",
+                "shader/bin", fragmentShaderBasename, true);
+        vp0.defaultShaderCustomization(gl2es2, true, true);
+        fp0.defaultShaderCustomization(gl2es2, true, true);
+
+        sp = new ShaderProgram();
+        sp.add(gl2es2, vp0, System.err);
+        sp.add(gl2es2, fp0, System.err);
+        if(!sp.link(gl2es2, System.err)) {
+            throw new GLException("could not link program: "+sp);
+        }
+        sp.useProgram(gl2es2, true);
+        if( 0 > texUnit0.setLocation(gl2es2, sp.program()) ) {
+            throw new OVRException("Couldn't locate "+texUnit0);
+        }
+        eyes[0].linkData(gl2es2, sp);
+        eyes[1].linkData(gl2es2, sp);
+        sp.useProgram(gl2es2, false);
+    }
+
+    @Override
+    public final void dispose(final GL gl) {
+        final GL2ES2 gl2es2 = gl.getGL2ES2();
+        sp.useProgram(gl2es2, false);
+        eyes[0].dispose(gl2es2);
+        eyes[1].dispose(gl2es2);
+        sp.destroy(gl2es2);
+        frameTiming = null;
+    }
+
+    @Override
+    public final Eye getEye(final int eyeNum) {
+        return eyes[eyeNum];
+    }
+
+    @Override
+    public final EyePose updateEyePose(final int eyeNum) {
+        return eyes[eyeNum].updateEyePose(context.handle);
+    }
+
+    @Override
+    public final void beginFrame(final GL gl) {
+        frameTiming = OVR.ovrHmd_BeginFrameTiming(context.handle, 0);
+    }
+
+    @Override
+    public final void endFrame(final GL gl) {
+        if( null == frameTiming ) {
+            throw new IllegalStateException("beginFrame not called");
+        }
+        OVR.ovrHmd_EndFrameTiming(context.handle);
+        frameTiming = null;
+    }
+
+    @Override
+    public final void ppBegin(final GL gl) {
+        if( null == sp ) {
+            throw new IllegalStateException("Not initialized");
+        }
+        if( null == frameTiming ) {
+            throw new IllegalStateException("beginFrame not called");
+        }
+        if( StereoUtil.usesTimewarpDistortion(distortionBits) ) {
+            OVR.ovr_WaitTillTime(frameTiming.getTimewarpPointSeconds());
+        }
+        final GL2ES2 gl2es2 = gl.getGL2ES2();
+
+        gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
+        gl.glClear(GL.GL_COLOR_BUFFER_BIT);
+        gl.glActiveTexture(GL.GL_TEXTURE0 + getTextureUnit());
+
+        gl2es2.glDisable(GL.GL_CULL_FACE);
+        gl2es2.glDisable(GL.GL_DEPTH_TEST);
+        gl2es2.glDisable(GL.GL_BLEND);
+
+        if( !gl2es2.isGLcore() ) {
+            gl2es2.glEnable(GL.GL_TEXTURE_2D);
+        }
+
+        sp.useProgram(gl2es2, true);
+
+        gl2es2.glUniform(texUnit0);
+    }
+
+    @Override
+    public final void ppOneEye(final GL gl, final int eyeNum) {
+        final OVREye eye = eyes[eyeNum];
+        if( StereoUtil.usesTimewarpDistortion(distortionBits) ) {
+            eye.updateTimewarp(context.handle, eye.ovrEyePose, mat4Tmp1, mat4Tmp2);
+        }
+        final GL2ES2 gl2es2 = gl.getGL2ES2();
+
+        eye.updateUniform(gl2es2, sp);
+        eye.enableVBO(gl2es2, true);
+        gl2es2.glDrawElements(GL.GL_TRIANGLES, eye.indexCount, GL.GL_UNSIGNED_SHORT, 0);
+        eyes[eyeNum].enableVBO(gl2es2, false);
+    }
+
+    @Override
+    public final void ppEnd(final GL gl) {
+        sp.useProgram(gl.getGL2ES2(), false);
+    }
+}
diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRUtil.java b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRUtil.java
new file mode 100644
index 0000000..44ec728
--- /dev/null
+++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/OVRUtil.java
@@ -0,0 +1,173 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package jogamp.opengl.oculusvr;
+
+import javax.media.nativewindow.util.Dimension;
+import javax.media.nativewindow.util.DimensionImmutable;
+import javax.media.nativewindow.util.Point;
+import javax.media.nativewindow.util.PointImmutable;
+import javax.media.nativewindow.util.RectangleImmutable;
+
+import com.jogamp.oculusvr.OVR;
+import com.jogamp.oculusvr.ovrEyeRenderDesc;
+import com.jogamp.oculusvr.ovrFovPort;
+import com.jogamp.oculusvr.ovrQuatf;
+import com.jogamp.oculusvr.ovrRecti;
+import com.jogamp.oculusvr.ovrSizei;
+import com.jogamp.oculusvr.ovrVector2f;
+import com.jogamp.oculusvr.ovrVector2i;
+import com.jogamp.oculusvr.ovrVector3f;
+import com.jogamp.opengl.math.FovHVHalves;
+import com.jogamp.opengl.math.Quaternion;
+import com.jogamp.opengl.util.stereo.StereoDeviceRenderer;
+
+/**
+ * OculusVR Data Conversion Helper Functions
+ */
+public class OVRUtil {
+    public static ovrRecti createOVRRecti(final int[] rect) {
+        final ovrRecti res = ovrRecti.create();
+        final ovrVector2i pos = res.getPos();
+        final ovrSizei size = res.getSize();
+        pos.setX(rect[0]);
+        pos.setY(rect[1]);
+        size.setW(rect[2]);
+        size.setH(rect[3]);
+        return res;
+    }
+    public static ovrRecti createOVRRecti(final RectangleImmutable rect) {
+        final ovrRecti res = ovrRecti.create();
+        final ovrVector2i pos = res.getPos();
+        final ovrSizei size = res.getSize();
+        pos.setX(rect.getX());
+        pos.setY(rect.getY());
+        size.setW(rect.getWidth());
+        size.setH(rect.getHeight());
+        return res;
+    }
+    public static ovrRecti[] createOVRRectis(final int[][] rects) {
+        final ovrRecti[] res = new ovrRecti[rects.length];
+        for(int i=0; i<res.length; i++) {
+            res[0] = createOVRRecti(rects[i]);
+        }
+        return res;
+    }
+    public static ovrSizei createOVRSizei(final int[] size) {
+        final ovrSizei res = ovrSizei.create();
+        res.setW(size[0]);
+        res.setH(size[1]);
+        return res;
+    }
+    public static ovrSizei createOVRSizei(final DimensionImmutable size) {
+        final ovrSizei res = ovrSizei.create();
+        res.setW(size.getWidth());
+        res.setH(size.getHeight());
+        return res;
+    }
+    public static DimensionImmutable getOVRSizei(final ovrSizei v) {
+        return new Dimension(v.getW(), v.getH());
+    }
+    public static PointImmutable getVec2iAsPoint(final ovrVector2i v) {
+        return new Point(v.getX(), v.getY());
+    }
+    public static int[] getVec2i(final ovrVector2i v) {
+        return new int[] { v.getX(), v.getY() };
+    }
+    public static void copyVec2iToInt(final ovrVector2i v, final int[] res) {
+        res[0] = v.getX();
+        res[1] = v.getY();
+    }
+    public static float[] getVec3f(final ovrVector3f v) {
+        return new float[] { v.getX(), v.getY(), v.getZ() };
+    }
+    public static void copyVec3fToFloat(final ovrVector3f v, final float[] res) {
+        res[0] = v.getX();
+        res[1] = v.getY();
+        res[2] = v.getZ();
+    }
+    public static Quaternion getQuaternion(final ovrQuatf q) {
+        return new Quaternion(q.getX(), q.getY(), q.getZ(), q.getW());
+    }
+    public static void copyToQuaternion(final ovrQuatf in, final Quaternion  out) {
+        out.set(in.getX(), in.getY(), in.getZ(), in.getW());
+    }
+
+    public static FovHVHalves getFovHV(final ovrFovPort tanHalfFov) {
+        return new FovHVHalves(tanHalfFov.getLeftTan(), tanHalfFov.getRightTan(),
+                               tanHalfFov.getUpTan(), tanHalfFov.getDownTan(),
+                               true);
+    }
+    public static ovrFovPort getOVRFovPort(final FovHVHalves fovHVHalves) {
+        final ovrFovPort tanHalfFov = ovrFovPort.create();
+        final FovHVHalves fovHVHalvesTan = fovHVHalves.toTangents();
+        tanHalfFov.setLeftTan(fovHVHalvesTan.left);
+        tanHalfFov.setRightTan(fovHVHalvesTan.right);
+        tanHalfFov.setUpTan(fovHVHalvesTan.top);
+        tanHalfFov.setDownTan(fovHVHalvesTan.bottom);
+        return tanHalfFov;
+    }
+
+    public static int ovrDistCaps2DistBits(final int ovrDistortionCaps) {
+        int bits = StereoDeviceRenderer.DISTORTION_BARREL;
+        if( 0 != ( OVR.ovrDistortionCap_TimeWarp & ovrDistortionCaps ) ) {
+            bits |= StereoDeviceRenderer.DISTORTION_TIMEWARP;
+        }
+        if( 0 != ( OVR.ovrDistortionCap_Chromatic & ovrDistortionCaps ) ) {
+            bits |= StereoDeviceRenderer.DISTORTION_CHROMATIC;
+        }
+        if( 0 != ( OVR.ovrDistortionCap_Vignette & ovrDistortionCaps ) ) {
+            bits |= StereoDeviceRenderer.DISTORTION_VIGNETTE;
+        }
+        return bits;
+    }
+
+
+    public static String toString(final ovrFovPort fov) {
+        return "["+fov.getLeftTan()+" l, "+fov.getRightTan()+" r, "+
+                   fov.getUpTan()+" u, "+fov.getDownTan()+" d]";
+    }
+    public static String toString(final ovrSizei rect) {
+        return "["+rect.getW()+" x "+rect.getH()+"]";
+    }
+    public static String toString(final ovrRecti rect) {
+        return "["+rect.getPos().getX()+"  / "+rect.getPos().getY()+" "+
+                   rect.getSize().getW()+" x "+rect.getSize().getH()+"]";
+    }
+    public static String toString(final ovrVector2f v2) {
+        return "["+v2.getX()+", "+v2.getY()+"]";
+    }
+    public static String toString(final ovrVector3f v3) {
+        return "["+v3.getX()+", "+v3.getY()+", "+v3.getZ()+"]";
+    }
+    public static String toString(final ovrEyeRenderDesc desc) {
+        return "["+desc.getEye()+", fov"+toString(desc.getFov())+
+                 ", viewport"+toString(desc.getDistortedViewport())+
+                 ", pptCtr"+toString(desc.getPixelsPerTanAngleAtCenter())+
+                 ", view-adjust"+toString(desc.getViewAdjust())+"]";
+    }
+}
diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_chroma.fp b/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_chroma.fp
new file mode 100644
index 0000000..6d450fe
--- /dev/null
+++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_chroma.fp
@@ -0,0 +1,26 @@
+//Copyright 2014 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+  #define varying in
+  out vec4 ovr_FragColor;
+  #define texture2D texture
+#else
+  #define ovr_FragColor gl_FragColor
+#endif
+
+uniform sampler2D  ovr_Texture0;
+
+varying vec3    ovv_Fade;
+varying vec2    ovv_TexCoordR;
+varying vec2    ovv_TexCoordG;
+varying vec2    ovv_TexCoordB;
+
+void main (void)
+{
+  // 3 samples for fixing chromatic aberrations
+  vec3 color = vec3(texture2D(ovr_Texture0, ovv_TexCoordR).r,
+                    texture2D(ovr_Texture0, ovv_TexCoordG).g,
+                    texture2D(ovr_Texture0, ovv_TexCoordB).b);
+  ovr_FragColor = vec4(ovv_Fade * color, 1.0);  // include vignetteFade
+}
+
diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_chroma.vp b/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_chroma.vp
new file mode 100644
index 0000000..254d4b0
--- /dev/null
+++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_chroma.vp
@@ -0,0 +1,33 @@
+//Copyright 2014 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+  #define attribute in
+  #define varying out
+#endif
+
+uniform vec2    ovr_EyeToSourceUVScale;
+uniform vec2    ovr_EyeToSourceUVOffset;
+
+attribute vec2  ovr_Position;
+attribute vec2  ovr_Params;
+attribute vec2  ovr_TexCoordR;
+attribute vec2  ovr_TexCoordG;
+attribute vec2  ovr_TexCoordB;
+
+varying vec3    ovv_Fade;
+varying vec2    ovv_TexCoordR;
+varying vec2    ovv_TexCoordG;
+varying vec2    ovv_TexCoordB;
+
+void main(void)
+{
+    gl_Position = vec4(ovr_Position.xy, 0.5, 1.0);
+    ovv_Fade = vec3(ovr_Params.r); // vignetteFade
+    
+    ovv_TexCoordR = ovr_TexCoordR * ovr_EyeToSourceUVScale + ovr_EyeToSourceUVOffset;
+    ovv_TexCoordR.y = 1.0-ovv_TexCoordR.y;
+    ovv_TexCoordG = ovr_TexCoordG * ovr_EyeToSourceUVScale + ovr_EyeToSourceUVOffset;
+    ovv_TexCoordG.y = 1.0-ovv_TexCoordG.y;
+    ovv_TexCoordB = ovr_TexCoordB * ovr_EyeToSourceUVScale + ovr_EyeToSourceUVOffset;
+    ovv_TexCoordB.y = 1.0-ovv_TexCoordB.y;
+}
diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_plain.fp b/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_plain.fp
new file mode 100644
index 0000000..d3ee5d0
--- /dev/null
+++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_plain.fp
@@ -0,0 +1,22 @@
+//Copyright 2014 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+  #define varying in
+  out vec4 ovr_FragColor;
+  #define texture2D texture
+#else
+  #define ovr_FragColor gl_FragColor
+#endif
+
+uniform sampler2D  ovr_Texture0;
+
+varying vec3    ovv_Fade;
+varying vec2    ovv_TexCoordR;
+
+void main (void)
+{
+  // 3 samples for fixing chromatic aberrations
+  vec3 color = texture2D(ovr_Texture0, ovv_TexCoordR).rgb;
+  ovr_FragColor = vec4(ovv_Fade * color, 1.0);  // include vignetteFade
+}
+
diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_plain.vp b/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_plain.vp
new file mode 100644
index 0000000..6456c7a
--- /dev/null
+++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_plain.vp
@@ -0,0 +1,27 @@
+//Copyright 2014 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+  #define attribute in
+  #define varying out
+#endif
+
+uniform vec2    ovr_EyeToSourceUVScale;
+uniform vec2    ovr_EyeToSourceUVOffset;
+
+attribute vec2  ovr_Position;
+attribute vec2  ovr_Params;
+attribute vec2  ovr_TexCoordR;
+
+varying vec3    ovv_Fade;
+varying vec2    ovv_TexCoordR;
+
+void main(void)
+{
+    gl_Position = vec4(ovr_Position.xy, 0.5, 1.0);
+    ovv_Fade = vec3(ovr_Params.r); // vignetteFade
+    
+    // Vertex inputs are in TanEyeAngle space for the R,G,B channels (i.e. after chromatic aberration and distortion).
+    // Scale them into the correct [0-1],[0-1] UV lookup space (depending on eye)    
+    ovv_TexCoordR = ovr_TexCoordR * ovr_EyeToSourceUVScale + ovr_EyeToSourceUVOffset;
+    ovv_TexCoordR.y = 1.0-ovv_TexCoordR.y;
+}
diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_timewarp.vp b/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_timewarp.vp
new file mode 100644
index 0000000..3485625
--- /dev/null
+++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_timewarp.vp
@@ -0,0 +1,44 @@
+//Copyright 2014 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+  #define attribute in
+  #define varying out
+#endif
+
+uniform vec2    ovr_EyeToSourceUVScale;
+uniform vec2    ovr_EyeToSourceUVOffset;
+uniform mat4    ovr_EyeRotationStart;
+uniform mat4    ovr_EyeRotationEnd;
+
+attribute vec2  ovr_Position;
+attribute vec2  ovr_Params;
+attribute vec2  ovr_TexCoordR;
+
+varying vec3    ovv_Fade;
+varying vec2    ovv_TexCoordR;
+
+void main(void)
+{
+    gl_Position = vec4(ovr_Position.xy, 0.0, 1.0);
+    ovv_Fade = vec3(ovr_Params.r); // vignetteFade
+    
+    // Vertex inputs are in TanEyeAngle space for the R,G,B channels (i.e. after chromatic aberration and distortion).
+    // These are now "real world" vectors in direction (x,y,1) relative to the eye of the HMD.
+    vec3 TanEyeAngle = vec3 ( ovr_TexCoordR, 1.0 );
+    
+    // Accurate time warp lerp vs. faster
+    // Apply the two 3x3 timewarp rotations to these vectors.
+	vec3 TransformedStart = (ovr_EyeRotationStart * vec4(TanEyeAngle, 0)).xyz;
+	vec3 TransformedEnd   = (ovr_EyeRotationEnd * vec4(TanEyeAngle, 0)).xyz;
+    // And blend between them.
+    vec3 Transformed = mix ( TransformedStart, TransformedEnd, ovr_Params.g /* timewarpLerpFactor */ );
+    
+    // Project them back onto the Z=1 plane of the rendered images.
+    float RecipZ = 1.0 / Transformed.z;
+    vec2 Flattened = vec2 ( Transformed.x * RecipZ, Transformed.y * RecipZ );
+    
+    // These are now still in TanEyeAngle space.
+    // Scale them into the correct [0-1],[0-1] UV lookup space (depending on eye)
+    ovv_TexCoordR = Flattened * ovr_EyeToSourceUVScale + ovr_EyeToSourceUVOffset;
+    ovv_TexCoordR.y = 1.0-ovv_TexCoordR.y;
+}
diff --git a/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_timewarp_chroma.vp b/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_timewarp_chroma.vp
new file mode 100644
index 0000000..e2a45e4
--- /dev/null
+++ b/src/oculusvr/classes/jogamp/opengl/oculusvr/shader/dist01_timewarp_chroma.vp
@@ -0,0 +1,65 @@
+//Copyright 2014 JogAmp Community. All rights reserved.
+
+#if __VERSION__ >= 130
+  #define attribute in
+  #define varying out
+#endif
+
+uniform vec2    ovr_EyeToSourceUVScale;
+uniform vec2    ovr_EyeToSourceUVOffset;
+uniform mat4    ovr_EyeRotationStart;
+uniform mat4    ovr_EyeRotationEnd;
+
+attribute vec2  ovr_Position;
+attribute vec2  ovr_Params;
+attribute vec2  ovr_TexCoordR;
+attribute vec2  ovr_TexCoordG;
+attribute vec2  ovr_TexCoordB;
+
+varying vec3    ovv_Fade;
+varying vec2    ovv_TexCoordR;
+varying vec2    ovv_TexCoordG;
+varying vec2    ovv_TexCoordB;
+
+void main(void)
+{
+    gl_Position = vec4(ovr_Position.xy, 0.0, 1.0);
+    ovv_Fade = vec3(ovr_Params.r); // vignetteFade
+    
+    // Vertex inputs are in TanEyeAngle space for the R,G,B channels (i.e. after chromatic aberration and distortion).
+    // These are now "real world" vectors in direction (x,y,1) relative to the eye of the HMD.
+    vec3 TanEyeAngleR = vec3 ( ovr_TexCoordR, 1.0 );
+    vec3 TanEyeAngleG = vec3 ( ovr_TexCoordG, 1.0 );
+    vec3 TanEyeAngleB = vec3 ( ovr_TexCoordB, 1.0 );
+    
+    // Accurate time warp lerp vs. faster
+    // Apply the two 3x3 timewarp rotations to these vectors.
+	vec3 TransformedRStart = (ovr_EyeRotationStart * vec4(TanEyeAngleR, 0)).xyz;
+	vec3 TransformedGStart = (ovr_EyeRotationStart * vec4(TanEyeAngleG, 0)).xyz;
+	vec3 TransformedBStart = (ovr_EyeRotationStart * vec4(TanEyeAngleB, 0)).xyz;
+	vec3 TransformedREnd   = (ovr_EyeRotationEnd * vec4(TanEyeAngleR, 0)).xyz;
+	vec3 TransformedGEnd   = (ovr_EyeRotationEnd * vec4(TanEyeAngleG, 0)).xyz;
+	vec3 TransformedBEnd   = (ovr_EyeRotationEnd * vec4(TanEyeAngleB, 0)).xyz;
+
+    // And blend between them.
+    vec3 TransformedR = mix ( TransformedRStart, TransformedREnd, ovr_Params.g /* timewarpLerpFactor */ );
+    vec3 TransformedG = mix ( TransformedGStart, TransformedGEnd, ovr_Params.g /* timewarpLerpFactor */ );
+    vec3 TransformedB = mix ( TransformedBStart, TransformedBEnd, ovr_Params.g /* timewarpLerpFactor */ );
+    
+    // Project them back onto the Z=1 plane of the rendered images.
+    float RecipZR = 1.0 / TransformedR.z;
+    float RecipZG = 1.0 / TransformedG.z;
+    float RecipZB = 1.0 / TransformedB.z;
+    vec2 FlattenedR = vec2 ( TransformedR.x * RecipZR, TransformedR.y * RecipZR );
+    vec2 FlattenedG = vec2 ( TransformedG.x * RecipZG, TransformedG.y * RecipZG );
+    vec2 FlattenedB = vec2 ( TransformedB.x * RecipZB, TransformedB.y * RecipZB );
+    
+    // These are now still in TanEyeAngle space.
+    // Scale them into the correct [0-1],[0-1] UV lookup space (depending on eye)
+    ovv_TexCoordR = FlattenedR * ovr_EyeToSourceUVScale + ovr_EyeToSourceUVOffset;
+    ovv_TexCoordR.y = 1.0-ovv_TexCoordR.y;
+    ovv_TexCoordG = FlattenedG * ovr_EyeToSourceUVScale + ovr_EyeToSourceUVOffset;
+    ovv_TexCoordG.y = 1.0-ovv_TexCoordG.y;
+    ovv_TexCoordB = FlattenedB * ovr_EyeToSourceUVScale + ovr_EyeToSourceUVOffset;
+    ovv_TexCoordB.y = 1.0-ovv_TexCoordB.y;
+}
diff --git a/src/oculusvr/native/OVRImplMisc.cpp b/src/oculusvr/native/OVRImplMisc.cpp
new file mode 100644
index 0000000..08ebddf
--- /dev/null
+++ b/src/oculusvr/native/OVRImplMisc.cpp
@@ -0,0 +1,30 @@
+#include "OVR_CAPI.h"
+
+#include "CAPI_DistortionRenderer.h"
+
+namespace OVR { namespace CAPI {
+
+    /**
+     * Index is: apiConfig->Header.API, with
+     *   ovrRenderAPIConfig * apiConfig
+     *   ovrRenderAPIConfigHeader Header 
+     *   ovrRenderAPIType Header.API 
+     */
+    DistortionRenderer::CreateFunc DistortionRenderer::APICreateRegistry[ovrRenderAPI_Count] =
+    {
+        0, // None
+        0, // None for GL - &GL::DistortionRenderer::Create,
+        0, // Android_GLES
+        0, // D3D9
+        0, // D3D10
+        0  // D3D11
+    };
+
+}} // namespace OVR::CAPI
+
+//
+// TBD: Replace stdc++ for compatibility !
+// 
+// This is not enough:
+// extern "C" void __cxa_pure_virtual() { while (1); }
+
diff --git a/src/test/com/jogamp/opengl/test/android/LauncherUtil.java b/src/test/com/jogamp/opengl/test/android/LauncherUtil.java
index ac69e1e..11dbe12 100644
--- a/src/test/com/jogamp/opengl/test/android/LauncherUtil.java
+++ b/src/test/com/jogamp/opengl/test/android/LauncherUtil.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -43,45 +43,45 @@ import android.util.Log;
  * Helper class to parse Uri's and programmatically add package names and properties to create an Uri or Intend.
  * <p>
  * The order of the Uri segments (any arguments) is preserved.
- * </p>  
+ * </p>
  */
 public class LauncherUtil {
-    
+
    /** Default launch mode. */
    public static final String LAUNCH_ACTIVITY_NORMAL = "org.jogamp.launcher.action.LAUNCH_ACTIVITY_NORMAL";
-   
+
    /** Transparent launch mode. Note: This seems to be required to achieve translucency, since setTheme(..) doesn't work. */
    public static final String LAUNCH_ACTIVITY_TRANSPARENT = "org.jogamp.launcher.action.LAUNCH_ACTIVITY_TRANSPARENT";
-   
+
    /** FIXME: TODO */
    public static final String LAUNCH_MAIN = "org.jogamp.launcher.action.LAUNCH_MAIN";
-   
+
    /** FIXME: TODO */
    public static final String LAUNCH_JUNIT = "org.jogamp.launcher.action.LAUNCH_JUNIT";
-   
+
    /** The protocol <code>launch</code> */
    public static final String SCHEME = "launch";
-   
+
    /** The host <code>jogamp.org</code> */
    public static final String HOST = "jogamp.org";
-   
+
    static final String SYS_PKG = "sys";
-   
+
    static final String USR_PKG = "pkg";
-   
+
    static final String ARG = "arg";
-   
+
    public static abstract class BaseActivityLauncher extends Activity {
        final OrderedProperties props = new OrderedProperties();
        final ArrayList<String> args = new ArrayList<String>();
-       /** 
+       /**
         * Returns the default {@link LauncherUtil#LAUNCH_ACTIVITY_NORMAL} action.
         * <p>
         * Should be overridden for other action, eg.  {@link LauncherUtil#LAUNCH_ACTIVITY_TRANSPARENT}.
         * </p>
         */
        public String getAction() { return LAUNCH_ACTIVITY_NORMAL; }
-       
+
        /**
         * Returns the properties, which are being propagated to the target activity.
         * <p>
@@ -89,58 +89,58 @@ public class LauncherUtil {
         * </p>
         */
        public final OrderedProperties getProperties() { return props; }
-       
+
        /**
         * Returns the commandline arguments, which are being propagated to the target activity.
         * <p>
         * Maybe be used to set custom commandline arguments.
         * </p>
         */
-       public final ArrayList<String> getArguments() { return args; } 
-       
+       public final ArrayList<String> getArguments() { return args; }
+
        /** Custom initialization hook which can be overriden to setup data, e.g. fill the properties retrieved by {@link #getProperties()}. */
        public void init() { }
-       
+
        /** Returns true if this launcher activity shall end after starting the downstream activity. Defaults to <code>true</code>, override to change behavior. */
        public boolean finishAfterDelegate() { return true; }
-       
+
        /** Must return the downstream Activity class name */
        public abstract String getActivityName();
-       
+
        /** Must return a list of required user packages, at least one containing the activity. */
        public abstract List<String> getUsrPackages();
-       
+
        /** Return a list of required system packages w/ native libraries, may return null or a zero sized list. */
        public abstract List<String> getSysPackages();
 
        @Override
-       public void onCreate(Bundle savedInstanceState) {
+       public void onCreate(final Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
-           
+
            init();
-           
+
            final DataSet data = new DataSet();
            data.setActivityName(getActivityName());
            data.addAllSysPackages(getSysPackages());
            data.addAllUsrPackages(getUsrPackages());
            data.addAllProperties(props);
            data.addAllArguments(args);
-           
+
            final Intent intent = LauncherUtil.getIntent(getAction(), data);
            Log.d(getClass().getSimpleName(), "Launching Activity: "+intent);
            startActivity (intent);
-           
+
            if(finishAfterDelegate()) {
                finish(); // done
            }
-       }        
+       }
    }
-   
+
    public static class OrderedProperties {
        HashMap<String, String> map = new HashMap<String, String>();
-       ArrayList<String> keyList = new ArrayList<String>(); 
-              
-       public final void setProperty(String key, String value) { 
+       ArrayList<String> keyList = new ArrayList<String>();
+
+       public final void setProperty(final String key, final String value) {
            if(key.equals(SYS_PKG)) {
                throw new IllegalArgumentException("Illegal property key, '"+SYS_PKG+"' is reserved");
            }
@@ -157,36 +157,36 @@ public class LauncherUtil {
            }
            keyList.add(key); // new key
        }
-       
-       public final void addAll(OrderedProperties props) {
-           Iterator<String> argKeys = props.keyList.iterator();
+
+       public final void addAll(final OrderedProperties props) {
+           final Iterator<String> argKeys = props.keyList.iterator();
            while(argKeys.hasNext()) {
                    final String key = argKeys.next();
                    setProperty(key, props.map.get(key));
-           }           
+           }
        }
-       
+
        public final void setSystemProperties() {
-           Iterator<String> argKeys = keyList.iterator();
+           final Iterator<String> argKeys = keyList.iterator();
            while(argKeys.hasNext()) {
                    final String key = argKeys.next();
                    System.setProperty(key, map.get(key));
            }
        }
        public final void clearSystemProperties() {
-           Iterator<String> argKeys = keyList.iterator();
+           final Iterator<String> argKeys = keyList.iterator();
            while(argKeys.hasNext()) {
                System.clearProperty(argKeys.next());
            }
        }
-       
-       public final String getProperty(String key) { return map.get(key); }
+
+       public final String getProperty(final String key) { return map.get(key); }
        public final Map<String, String> getProperties() { return map; }
-           
+
        /** Returns the list of property keys in the order, as they were added. */
-       public final List<String> getPropertyKeys() { return keyList; }       
+       public final List<String> getPropertyKeys() { return keyList; }
    }
-   
+
    /**
     * Data set to transfer from and to launch URI consisting out of:
     * <ul>
@@ -205,56 +205,56 @@ public class LauncherUtil {
        static final char ASSIG = '=';
        static final String COLSLASH2 = "://";
        static final String EMPTY = "";
-       
+
        String activityName = null;
        ArrayList<String> sysPackages = new ArrayList<String>();
        ArrayList<String> usrPackages = new ArrayList<String>();
        OrderedProperties properties = new OrderedProperties();
        ArrayList<String> arguments = new ArrayList<String>();
-       
-       public final void setActivityName(String name) { activityName = name; }
+
+       public final void setActivityName(final String name) { activityName = name; }
        public final String getActivityName() { return activityName; }
-              
-       public final void addSysPackage(String p) { 
-           sysPackages.add(p); 
-       }   
-       public final void addAllSysPackages(List<String> plist) { 
+
+       public final void addSysPackage(final String p) {
+           sysPackages.add(p);
+       }
+       public final void addAllSysPackages(final List<String> plist) {
            sysPackages.addAll(plist);
-       }   
+       }
        public final List<String> getSysPackages()  { return sysPackages; }
-       
-       public final void addUsrPackage(String p) { 
-           usrPackages.add(p); 
-       }   
-       public final void addAllUsrPackages(List<String> plist) { 
+
+       public final void addUsrPackage(final String p) {
+           usrPackages.add(p);
+       }
+       public final void addAllUsrPackages(final List<String> plist) {
            usrPackages.addAll(plist);
-       }   
+       }
        public final List<String> getUsrPackages()  { return usrPackages; }
-       
-       public final void setProperty(String key, String value) {
+
+       public final void setProperty(final String key, final String value) {
            properties.setProperty(key, value);
        }
-       public final void addAllProperties(OrderedProperties props) {
+       public final void addAllProperties(final OrderedProperties props) {
            properties.addAll(props);
        }
        public final void setSystemProperties() {
            properties.setSystemProperties();
-       }   
+       }
        public final void clearSystemProperties() {
            properties.clearSystemProperties();
-       }   
-       public final String getProperty(String key) { return properties.getProperty(key); }
+       }
+       public final String getProperty(final String key) { return properties.getProperty(key); }
        public final OrderedProperties getProperties() { return properties; }
        public final List<String> getPropertyKeys() { return properties.getPropertyKeys(); }
-       
-       public final void addArgument(String arg) { arguments.add(arg); }
-       public final void addAllArguments(List<String> args) {
+
+       public final void addArgument(final String arg) { arguments.add(arg); }
+       public final void addAllArguments(final List<String> args) {
            arguments.addAll(args);
        }
        public final ArrayList<String> getArguments() { return arguments; }
-       
+
        public final Uri getUri() {
-           StringBuilder sb = new StringBuilder();
+           final StringBuilder sb = new StringBuilder();
            sb.append(SCHEME).append(COLSLASH2).append(HOST).append(SLASH).append(getActivityName());
            boolean needsQMark = true;
            boolean needsSep = false;
@@ -284,7 +284,7 @@ public class LauncherUtil {
                    needsSep = true;
                }
            }
-           Iterator<String> propKeys = properties.keyList.iterator();
+           final Iterator<String> propKeys = properties.keyList.iterator();
            while(propKeys.hasNext()) {
                if( needsQMark ) {
                    sb.append(QMARK);
@@ -297,7 +297,7 @@ public class LauncherUtil {
                sb.append(key).append(ASSIG).append(properties.map.get(key));
                needsSep = true;
            }
-           Iterator<String> args = arguments.iterator();
+           final Iterator<String> args = arguments.iterator();
            while(args.hasNext()) {
                if( needsQMark ) {
                    sb.append(QMARK);
@@ -308,18 +308,18 @@ public class LauncherUtil {
                }
                sb.append(ARG).append(ASSIG).append(args.next());
                needsSep = true;
-           }           
+           }
            return Uri.parse(sb.toString());
        }
-       
-       public static final DataSet create(Uri uri) {
+
+       public static final DataSet create(final Uri uri) {
            if(!uri.getScheme().equals(SCHEME)) {
                return null;
            }
            if(!uri.getHost().equals(HOST)) {
                return null;
            }
-           DataSet data = new DataSet();
+           final DataSet data = new DataSet();
            {
                String an =  uri.getPath();
                if(SLASH == an.charAt(0)) {
@@ -330,16 +330,16 @@ public class LauncherUtil {
                }
                data.setActivityName(an);
            }
-           
+
            final String q = uri.getQuery();
            final int q_l = null != q ? q.length() : -1;
            int q_e = -1;
            while(q_e < q_l) {
-               int q_b = q_e + 1; // next term
+               final int q_b = q_e + 1; // next term
                q_e = q.indexOf(AMPER, q_b);
                if(0 == q_e) {
                    // single separator
-                   continue; 
+                   continue;
                }
                if(0 > q_e) {
                    // end
@@ -381,41 +381,41 @@ public class LauncherUtil {
            data.validate();
            return data;
        }
-       
+
        public final void validate() {
            if(null == activityName) {
                throw new RuntimeException("Activity is not NULL");
            }
        }
    }
-   
-   public final static Intent getIntent(String action, DataSet data) {
+
+   public final static Intent getIntent(final String action, final DataSet data) {
        data.validate();
        return new Intent(action, data.getUri());
    }
-   
+
    public static void main(String[] args) {
        if(args.length==0) {
            args = new String[] {
-               SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+SYS_PKG+"=jogamp.pack1&"+SYS_PKG+"=javax.pack2&"+USR_PKG+"=com.jogamp.pack3&"+USR_PKG+"=com.jogamp.pack4&jogamp.common.debug=true&com.jogamp.test=false",   
+               SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+SYS_PKG+"=jogamp.pack1&"+SYS_PKG+"=javax.pack2&"+USR_PKG+"=com.jogamp.pack3&"+USR_PKG+"=com.jogamp.pack4&jogamp.common.debug=true&com.jogamp.test=false",
                SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+SYS_PKG+"=jogamp.pack1&jogamp.common.debug=true&com.jogamp.test=false",
                SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&jogamp.common.debug=true&com.jogamp.test=false",
                SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&"+USR_PKG+"=com.jogamp.pack2",
-               SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&"+USR_PKG+"=javax.pack2&"+USR_PKG+"=com.jogamp.pack3&jogamp.common.debug=true&com.jogamp.test=false&"+ARG+"=arg1&"+ARG+"=arg2=arg2value&"+ARG+"=arg3",   
-               SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&jogamp.common.debug=true&com.jogamp.test=false&"+ARG+"=arg1&"+ARG+"=arg2=arg2value&"+ARG+"=arg3",   
-               SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&"+ARG+"=arg1&"+ARG+"=arg2=arg2value&"+ARG+"=arg3"   
+               SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&"+USR_PKG+"=javax.pack2&"+USR_PKG+"=com.jogamp.pack3&jogamp.common.debug=true&com.jogamp.test=false&"+ARG+"=arg1&"+ARG+"=arg2=arg2value&"+ARG+"=arg3",
+               SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&jogamp.common.debug=true&com.jogamp.test=false&"+ARG+"=arg1&"+ARG+"=arg2=arg2value&"+ARG+"=arg3",
+               SCHEME+"://"+HOST+"/com.jogamp.TestActivity?"+USR_PKG+"=jogamp.pack1&"+ARG+"=arg1&"+ARG+"=arg2=arg2value&"+ARG+"=arg3"
            };
        }
        int errors = 0;
        for(int i=0; i<args.length; i++) {
-           String uri_s = args[i];
-           Uri uri0 = Uri.parse(uri_s);
-           DataSet data = DataSet.create(uri0);
+           final String uri_s = args[i];
+           final Uri uri0 = Uri.parse(uri_s);
+           final DataSet data = DataSet.create(uri0);
            if(null == data) {
                errors++;
                System.err.println("Error: NULL JogAmpLauncherUtil: <"+uri_s+"> -> "+uri0+" -> NULL");
            } else {
-               Uri uri1 = data.getUri();
+               final Uri uri1 = data.getUri();
                if(!uri0.equals(uri1)) {
                    errors++;
                    System.err.println("Error: Not equal: <"+uri_s+"> -> "+uri0+" -> "+uri1);
@@ -426,5 +426,5 @@ public class LauncherUtil {
        }
        System.err.println("LauncherUtil Self Test: Errors: "+errors);
    }
-   
+
 }
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
deleted file mode 100644
index 1de0951..0000000
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/**
- * Copyright 2011 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.opengl.test.android;
-
-import java.io.IOException;
-import java.net.HttpURLConnection;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URLConnection;
-import java.util.Arrays;
-
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLProfile;
-
-import jogamp.newt.driver.android.NewtBaseActivity;
-
-import com.jogamp.common.util.IOUtil;
-import com.jogamp.newt.NewtFactory;
-import com.jogamp.newt.event.MouseAdapter;
-import com.jogamp.newt.event.MouseEvent;
-import com.jogamp.newt.opengl.GLWindow;
-
-import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube;
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.av.GLMediaPlayer;
-import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
-import com.jogamp.opengl.util.av.GLMediaPlayer.StreamException;
-import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
-
-import android.os.Bundle;
-import android.util.Log;
-
-public class MovieCubeActivity0 extends NewtBaseActivity {
-   static String TAG = "MovieCubeActivity0";
-
-   MouseAdapter showKeyboardMouseListener = new MouseAdapter() {
-        @Override
-        public void mousePressed(MouseEvent e) {
-           if( e.getPointerCount() == 4 && e.getPressure(0, true) > 0.7f ) {
-               ((com.jogamp.newt.Window) e.getSource()).setKeyboardVisible(true);
-           }
-        }
-   };
-
-   @Override
-   public void onCreate(Bundle savedInstanceState) {
-       super.onCreate(savedInstanceState);
-
-       String[] streamLocs = new String[] {
-               System.getProperty("jnlp.media0_url2"),
-               System.getProperty("jnlp.media0_url1"),
-               System.getProperty("jnlp.media0_url0") };
-       final URI streamLoc = getURI(streamLocs, 0, false);
-       if(null == streamLoc) { throw new RuntimeException("no media reachable: "+Arrays.asList(streamLocs)); }
-
-       // also initializes JOGL
-       final GLCapabilities capsMain = new GLCapabilities(GLProfile.getGL2ES2());
-       capsMain.setBackgroundOpaque(false);
-
-       // screen for layout params ..
-       final com.jogamp.newt.Display dpy = NewtFactory.createDisplay(null);
-       final com.jogamp.newt.Screen scrn = NewtFactory.createScreen(dpy, 0);
-       scrn.addReference();
-
-       try {
-           final Animator anim = new Animator();
-
-           // Main
-           final GLWindow glWindowMain = GLWindow.create(scrn, capsMain);
-           glWindowMain.setFullscreen(true);
-           setContentView(getWindow(), glWindowMain);
-           anim.add(glWindowMain);
-           glWindowMain.setVisible(true);
-           glWindowMain.addMouseListener(showKeyboardMouseListener);
-
-           final MovieCube demoMain = new MovieCube(MovieCube.zoom_def, 0f, 0f);
-           final GLMediaPlayer mPlayer = demoMain.getGLMediaPlayer();
-           mPlayer.addEventListener(new GLMediaEventListener() {
-                @Override
-                public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) {
-                }
-
-                @Override
-                public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
-                    System.err.println("MovieCubeActivity0 AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
-                    System.err.println("MovieCubeActivity0 State: "+mp);
-                    if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
-                        glWindowMain.addGLEventListener(demoMain);
-                        anim.setUpdateFPSFrames(60, null);
-                        anim.resetFPSCounter();
-                    }
-                    if( 0 != ( GLMediaEventListener.EVENT_CHANGE_PLAY & event_mask ) ) {
-                        anim.resetFPSCounter();
-                    }
-                    if( 0 != ( ( GLMediaEventListener.EVENT_CHANGE_ERR | GLMediaEventListener.EVENT_CHANGE_EOS ) & event_mask ) ) {
-                        final StreamException se = mPlayer.getStreamException();
-                        if( null != se ) {
-                            se.printStackTrace();
-                        }
-                        getActivity().finish();
-                    }
-                }
-            });
-           demoMain.initStream(streamLoc, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 0);
-       } catch (IOException e) {
-           e.printStackTrace();
-       }
-
-       scrn.removeReference();
-
-       Log.d(TAG, "onCreate - X");
-   }
-
-   static URI getURI(String path[], int off, boolean checkAvail) {
-       URI uri = null;
-       for(int i=off; null==uri && i<path.length; i++) {
-           if(null != path[i] && path[i].length()>0) {
-               if( checkAvail ) {
-                   final URLConnection uc = IOUtil.getResource(path[i], null);
-                   if( null != uc ) {
-                       try {
-                           uri = uc.getURL().toURI();
-                       } catch (URISyntaxException e) {
-                           uri = null;
-                       }
-                       if( uc instanceof HttpURLConnection ) {
-                           ((HttpURLConnection)uc).disconnect();
-                       }
-                   }
-               } else {
-                   try {
-                       uri = new URI(path[i]);
-                   } catch (URISyntaxException e) {
-                       uri = null;
-                   }
-               }
-               Log.d(TAG, "Stream: <"+path[i]+">: "+(null!=uri));
-           }
-       }
-       return uri;
-   }
-}
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0a.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0a.java
new file mode 100644
index 0000000..79b6952
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0a.java
@@ -0,0 +1,167 @@
+/**
+ * Copyright 2011 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.android;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URLConnection;
+import java.util.Arrays;
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+
+import jogamp.newt.driver.android.NewtBaseActivity;
+
+import com.jogamp.common.util.IOUtil;
+import com.jogamp.newt.NewtFactory;
+import com.jogamp.newt.event.MouseAdapter;
+import com.jogamp.newt.event.MouseEvent;
+import com.jogamp.newt.opengl.GLWindow;
+
+import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube;
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.av.GLMediaPlayer;
+import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
+import com.jogamp.opengl.util.av.GLMediaPlayer.StreamException;
+import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
+
+import android.os.Bundle;
+import android.util.Log;
+
+public class MovieCubeActivity0a extends NewtBaseActivity {
+   static String TAG = "MovieCubeActivity0a";
+
+   MouseAdapter showKeyboardMouseListener = new MouseAdapter() {
+        @Override
+        public void mousePressed(final MouseEvent e) {
+           if( e.getPointerCount() == 4 && e.getPressure(0, true) > 0.7f ) {
+               ((com.jogamp.newt.Window) e.getSource()).setKeyboardVisible(true);
+           }
+        }
+   };
+
+   @Override
+   public void onCreate(final Bundle savedInstanceState) {
+       super.onCreate(savedInstanceState);
+
+       final String[] streamLocs = new String[] {
+               System.getProperty("jnlp.media0_url0"),
+               System.getProperty("jnlp.media0_url1"),
+               System.getProperty("jnlp.media0_url2") };
+       final URI streamLoc = getURI(streamLocs, 0, false);
+       if(null == streamLoc) { throw new RuntimeException("no media reachable: "+Arrays.asList(streamLocs)); }
+
+       // also initializes JOGL
+       final GLCapabilities capsMain = new GLCapabilities(GLProfile.getGL2ES2());
+       capsMain.setBackgroundOpaque(false);
+
+       // screen for layout params ..
+       final com.jogamp.newt.Display dpy = NewtFactory.createDisplay(null);
+       final com.jogamp.newt.Screen scrn = NewtFactory.createScreen(dpy, 0);
+       scrn.addReference();
+
+       try {
+           final Animator anim = new Animator();
+
+           // Main
+           final GLWindow glWindowMain = GLWindow.create(scrn, capsMain);
+           glWindowMain.setFullscreen(true);
+           setContentView(getWindow(), glWindowMain);
+           anim.add(glWindowMain);
+           glWindowMain.setVisible(true);
+           glWindowMain.addMouseListener(showKeyboardMouseListener);
+
+           final MovieCube demoMain = new MovieCube(MovieCube.zoom_def, 0f, 0f, false);
+           final GLMediaPlayer mPlayer = demoMain.getGLMediaPlayer();
+           mPlayer.addEventListener(new GLMediaEventListener() {
+                @Override
+                public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) {
+                }
+
+                @Override
+                public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
+                    System.err.println("MovieCubeActivity0 AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
+                    System.err.println("MovieCubeActivity0 State: "+mp);
+                    if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
+                        glWindowMain.addGLEventListener(demoMain);
+                        anim.setUpdateFPSFrames(60*5, null);
+                        anim.resetFPSCounter();
+                    }
+                    if( 0 != ( GLMediaEventListener.EVENT_CHANGE_PLAY & event_mask ) ) {
+                        anim.resetFPSCounter();
+                    }
+                    if( 0 != ( ( GLMediaEventListener.EVENT_CHANGE_ERR | GLMediaEventListener.EVENT_CHANGE_EOS ) & event_mask ) ) {
+                        final StreamException se = mPlayer.getStreamException();
+                        if( null != se ) {
+                            se.printStackTrace();
+                        }
+                        getActivity().finish();
+                    }
+                }
+            });
+           demoMain.initStream(streamLoc, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 0);
+       } catch (final IOException e) {
+           e.printStackTrace();
+       }
+
+       scrn.removeReference();
+
+       Log.d(TAG, "onCreate - X");
+   }
+
+   static URI getURI(final String path[], final int off, final boolean checkAvail) {
+       URI uri = null;
+       for(int i=off; null==uri && i<path.length; i++) {
+           if(null != path[i] && path[i].length()>0) {
+               if( checkAvail ) {
+                   final URLConnection uc = IOUtil.getResource(path[i], null);
+                   if( null != uc ) {
+                       try {
+                           uri = uc.getURL().toURI();
+                       } catch (final URISyntaxException e) {
+                           uri = null;
+                       }
+                       if( uc instanceof HttpURLConnection ) {
+                           ((HttpURLConnection)uc).disconnect();
+                       }
+                   }
+               } else {
+                   try {
+                       uri = new URI(path[i]);
+                   } catch (final URISyntaxException e) {
+                       uri = null;
+                   }
+               }
+               Log.d(TAG, "Stream: <"+path[i]+">: "+(null!=uri));
+           }
+       }
+       return uri;
+   }
+}
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0b.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0b.java
new file mode 100644
index 0000000..5303276
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivity0b.java
@@ -0,0 +1,169 @@
+/**
+ * Copyright 2011 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.android;
+
+import java.io.IOException;
+import java.net.HttpURLConnection;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URLConnection;
+import java.util.Arrays;
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+
+import jogamp.newt.driver.android.NewtBaseActivity;
+
+import com.jogamp.common.util.IOUtil;
+import com.jogamp.newt.NewtFactory;
+import com.jogamp.newt.event.MouseAdapter;
+import com.jogamp.newt.event.MouseEvent;
+import com.jogamp.newt.opengl.GLWindow;
+
+import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieCube;
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.av.GLMediaPlayer;
+import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
+import com.jogamp.opengl.util.av.GLMediaPlayer.StreamException;
+import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
+
+import android.os.Bundle;
+import android.util.Log;
+
+public class MovieCubeActivity0b extends NewtBaseActivity {
+   static String TAG = "MovieCubeActivity0a";
+
+   MouseAdapter showKeyboardMouseListener = new MouseAdapter() {
+        @Override
+        public void mousePressed(final MouseEvent e) {
+           if( e.getPointerCount() == 4 && e.getPressure(0, true) > 0.7f ) {
+               ((com.jogamp.newt.Window) e.getSource()).setKeyboardVisible(true);
+           }
+        }
+   };
+
+   @Override
+   public void onCreate(final Bundle savedInstanceState) {
+       super.onCreate(savedInstanceState);
+
+       final String[] streamLocs = new String[] {
+               System.getProperty("jnlp.media0_url0"),
+               System.getProperty("jnlp.media0_url1"),
+               System.getProperty("jnlp.media0_url2") };
+       final URI streamLoc = getURI(streamLocs, 0, false);
+       if(null == streamLoc) { throw new RuntimeException("no media reachable: "+Arrays.asList(streamLocs)); }
+
+       // also initializes JOGL
+       final GLCapabilities capsMain = new GLCapabilities(GLProfile.getGL2ES2());
+       capsMain.setNumSamples(4);
+       capsMain.setSampleBuffers(true);
+       capsMain.setBackgroundOpaque(false);
+
+       // screen for layout params ..
+       final com.jogamp.newt.Display dpy = NewtFactory.createDisplay(null);
+       final com.jogamp.newt.Screen scrn = NewtFactory.createScreen(dpy, 0);
+       scrn.addReference();
+
+       try {
+           final Animator anim = new Animator();
+
+           // Main
+           final GLWindow glWindowMain = GLWindow.create(scrn, capsMain);
+           glWindowMain.setFullscreen(true);
+           setContentView(getWindow(), glWindowMain);
+           anim.add(glWindowMain);
+           glWindowMain.setVisible(true);
+           glWindowMain.addMouseListener(showKeyboardMouseListener);
+
+           final MovieCube demoMain = new MovieCube(MovieCube.zoom_def, 0f, 0f, true);
+           final GLMediaPlayer mPlayer = demoMain.getGLMediaPlayer();
+           mPlayer.addEventListener(new GLMediaEventListener() {
+                @Override
+                public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) {
+                }
+
+                @Override
+                public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
+                    System.err.println("MovieCubeActivity0 AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
+                    System.err.println("MovieCubeActivity0 State: "+mp);
+                    if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
+                        glWindowMain.addGLEventListener(demoMain);
+                        anim.setUpdateFPSFrames(60*5, null);
+                        anim.resetFPSCounter();
+                    }
+                    if( 0 != ( GLMediaEventListener.EVENT_CHANGE_PLAY & event_mask ) ) {
+                        anim.resetFPSCounter();
+                    }
+                    if( 0 != ( ( GLMediaEventListener.EVENT_CHANGE_ERR | GLMediaEventListener.EVENT_CHANGE_EOS ) & event_mask ) ) {
+                        final StreamException se = mPlayer.getStreamException();
+                        if( null != se ) {
+                            se.printStackTrace();
+                        }
+                        getActivity().finish();
+                    }
+                }
+            });
+           demoMain.initStream(streamLoc, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 0);
+       } catch (final IOException e) {
+           e.printStackTrace();
+       }
+
+       scrn.removeReference();
+
+       Log.d(TAG, "onCreate - X");
+   }
+
+   static URI getURI(final String path[], final int off, final boolean checkAvail) {
+       URI uri = null;
+       for(int i=off; null==uri && i<path.length; i++) {
+           if(null != path[i] && path[i].length()>0) {
+               if( checkAvail ) {
+                   final URLConnection uc = IOUtil.getResource(path[i], null);
+                   if( null != uc ) {
+                       try {
+                           uri = uc.getURL().toURI();
+                       } catch (final URISyntaxException e) {
+                           uri = null;
+                       }
+                       if( uc instanceof HttpURLConnection ) {
+                           ((HttpURLConnection)uc).disconnect();
+                       }
+                   }
+               } else {
+                   try {
+                       uri = new URI(path[i]);
+                   } catch (final URISyntaxException e) {
+                       uri = null;
+                   }
+               }
+               Log.d(TAG, "Stream: <"+path[i]+">: "+(null!=uri));
+           }
+       }
+       return uri;
+   }
+}
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0.java
deleted file mode 100644
index 1e0d606..0000000
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/**
- * Copyright 2012 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.opengl.test.android;
-
-import java.util.Arrays;
-import java.util.List;
-
-import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
-
-public class MovieCubeActivityLauncher0 extends LauncherUtil.BaseActivityLauncher {
-
-    static String demo = "com.jogamp.opengl.test.android.MovieCubeActivity0";
-    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
-    static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-
-    @Override
-    public void init() {
-       final OrderedProperties props = getProperties();
-       // props.setProperty("jnlp.media0_url2", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_640x360.m4v");
-       props.setProperty("jnlp.media0_url2", "");
-       props.setProperty("jnlp.media0_url1", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media0_url0", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media1_url0", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
-       // props.setProperty("jogamp.debug.JNILibLoader", "true");
-       // props.setProperty("jogamp.debug.NativeLibrary", "true");
-       // props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
-       // props.setProperty("jogamp.debug.IOUtil", "true");
-       // props.setProperty("jogamp.debug.Lock", "true");
-       // props.setProperty("jogamp.debug.Lock.TraceLock", "true");
-       // props.setProperty("nativewindow.debug", "all");
-       // props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
-       // props.setProperty("jogl.debug", "all");
-       // props.setProperty("jogl.debug.GLProfile", "true");
-       // props.setProperty("jogl.debug.GLDrawable", "true");
-       // props.setProperty("jogl.debug.GLContext", "true");
-       props.setProperty("jogl.debug.GLMediaPlayer", "true");
-       props.setProperty("jogl.debug.GLSLCode", "true");
-       // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
-       // props.setProperty("jogl.debug.GLSLState", "true");
-       // props.setProperty("jogl.debug.DebugGL", "true");
-       // props.setProperty("jogl.debug.TraceGL", "true");
-       // props.setProperty("newt.debug", "all");
-       // props.setProperty("newt.debug.Window", "true");
-       // props.setProperty("newt.debug.Window.MouseEvent", "true");
-       // props.setProperty("newt.debug.Window.KeyEvent", "true");
-       props.setProperty("jogamp.debug.IOUtil", "true");
-    }
-
-    @Override
-    public String getActivityName() {
-        return demo;
-    }
-
-    @Override
-    public List<String> getSysPackages() {
-        return Arrays.asList(sys_pkgs);
-    }
-
-    @Override
-    public List<String> getUsrPackages() {
-        return Arrays.asList(usr_pkgs);
-    }
-}
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0a.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0a.java
new file mode 100644
index 0000000..f9703fd
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0a.java
@@ -0,0 +1,86 @@
+/**
+ * Copyright 2012 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.android;
+
+import java.util.Arrays;
+import java.util.List;
+
+import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+
+public class MovieCubeActivityLauncher0a extends LauncherUtil.BaseActivityLauncher {
+
+    static String demo = "com.jogamp.opengl.test.android.MovieCubeActivity0a";
+    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
+    static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
+
+    @Override
+    public void init() {
+       final OrderedProperties props = getProperties();
+       props.setProperty("jnlp.media0_url0", "http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4");
+       props.setProperty("jnlp.media1_url1", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
+       props.setProperty("jnlp.media0_url2", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
+       // props.setProperty("jogamp.debug.JNILibLoader", "true");
+       // props.setProperty("jogamp.debug.NativeLibrary", "true");
+       // props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
+       // props.setProperty("jogamp.debug.IOUtil", "true");
+       // props.setProperty("jogamp.debug.Lock", "true");
+       // props.setProperty("jogamp.debug.Lock.TraceLock", "true");
+       // props.setProperty("nativewindow.debug", "all");
+       // props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
+       // props.setProperty("jogl.debug", "all");
+       // props.setProperty("jogl.debug.GLProfile", "true");
+       // props.setProperty("jogl.debug.GLDrawable", "true");
+       // props.setProperty("jogl.debug.GLContext", "true");
+       props.setProperty("jogl.debug.GLMediaPlayer", "true");
+       props.setProperty("jogl.debug.GLSLCode", "true");
+       // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
+       // props.setProperty("jogl.debug.GLSLState", "true");
+       // props.setProperty("jogl.debug.DebugGL", "true");
+       // props.setProperty("jogl.debug.TraceGL", "true");
+       // props.setProperty("newt.debug", "all");
+       // props.setProperty("newt.debug.Window", "true");
+       // props.setProperty("newt.debug.Window.MouseEvent", "true");
+       // props.setProperty("newt.debug.Window.KeyEvent", "true");
+       props.setProperty("jogamp.debug.IOUtil", "true");
+    }
+
+    @Override
+    public String getActivityName() {
+        return demo;
+    }
+
+    @Override
+    public List<String> getSysPackages() {
+        return Arrays.asList(sys_pkgs);
+    }
+
+    @Override
+    public List<String> getUsrPackages() {
+        return Arrays.asList(usr_pkgs);
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0b.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0b.java
new file mode 100644
index 0000000..81d8a3b
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher0b.java
@@ -0,0 +1,86 @@
+/**
+ * Copyright 2012 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.android;
+
+import java.util.Arrays;
+import java.util.List;
+
+import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
+
+public class MovieCubeActivityLauncher0b extends LauncherUtil.BaseActivityLauncher {
+
+    static String demo = "com.jogamp.opengl.test.android.MovieCubeActivity0b";
+    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
+    static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
+
+    @Override
+    public void init() {
+       final OrderedProperties props = getProperties();
+       props.setProperty("jnlp.media0_url0", "http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4");
+       props.setProperty("jnlp.media1_url1", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
+       props.setProperty("jnlp.media0_url2", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
+       // props.setProperty("jogamp.debug.JNILibLoader", "true");
+       // props.setProperty("jogamp.debug.NativeLibrary", "true");
+       // props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
+       // props.setProperty("jogamp.debug.IOUtil", "true");
+       // props.setProperty("jogamp.debug.Lock", "true");
+       // props.setProperty("jogamp.debug.Lock.TraceLock", "true");
+       // props.setProperty("nativewindow.debug", "all");
+       // props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
+       // props.setProperty("jogl.debug", "all");
+       // props.setProperty("jogl.debug.GLProfile", "true");
+       // props.setProperty("jogl.debug.GLDrawable", "true");
+       // props.setProperty("jogl.debug.GLContext", "true");
+       // props.setProperty("jogl.debug.GLMediaPlayer", "true");
+       props.setProperty("jogl.debug.GLSLCode", "true");
+       // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
+       // props.setProperty("jogl.debug.GLSLState", "true");
+       // props.setProperty("jogl.debug.DebugGL", "true");
+       // props.setProperty("jogl.debug.TraceGL", "true");
+       // props.setProperty("newt.debug", "all");
+       // props.setProperty("newt.debug.Window", "true");
+       // props.setProperty("newt.debug.Window.MouseEvent", "true");
+       // props.setProperty("newt.debug.Window.KeyEvent", "true");
+       props.setProperty("jogamp.debug.IOUtil", "true");
+    }
+
+    @Override
+    public String getActivityName() {
+        return demo;
+    }
+
+    @Override
+    public List<String> getSysPackages() {
+        return Arrays.asList(sys_pkgs);
+    }
+
+    @Override
+    public List<String> getUsrPackages() {
+        return Arrays.asList(usr_pkgs);
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java
index c4eea08..205fa80 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1a.java
@@ -34,17 +34,16 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
 
 public class MovieCubeActivityLauncher1a extends LauncherUtil.BaseActivityLauncher {
 
-    static String demo = "com.jogamp.opengl.test.android.MovieCubeActivity0";
+    static String demo = "com.jogamp.opengl.test.android.MovieCubeActivity0a";
     static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
     static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
 
     @Override
     public void init() {
        final OrderedProperties props = getProperties();
-       props.setProperty("jnlp.media0_url2", "camera:/0");
-       props.setProperty("jnlp.media0_url1", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media0_url0", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media1_url0", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
+       props.setProperty("jnlp.media0_url0", "camera:/0");
+       props.setProperty("jnlp.media0_url1", "");
+       props.setProperty("jnlp.media1_url2", "");
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
        // props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
diff --git a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1b.java b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1b.java
index 26b61dd..2e85775 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1b.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieCubeActivityLauncher1b.java
@@ -34,17 +34,16 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
 
 public class MovieCubeActivityLauncher1b extends LauncherUtil.BaseActivityLauncher {
 
-    static String demo = "com.jogamp.opengl.test.android.MovieCubeActivity0";
+    static String demo = "com.jogamp.opengl.test.android.MovieCubeActivity0b";
     static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
     static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
 
     @Override
     public void init() {
        final OrderedProperties props = getProperties();
-       props.setProperty("jnlp.media0_url2", "camera:/1");
-       props.setProperty("jnlp.media0_url1", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media0_url0", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media1_url0", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
+       props.setProperty("jnlp.media0_url0", "camera:/1");
+       props.setProperty("jnlp.media0_url1", "");
+       props.setProperty("jnlp.media1_url2", "");
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
        // props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
index b5a9ce5..47e1b17 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity0.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -57,77 +57,79 @@ import android.util.Log;
 
 public class MovieSimpleActivity0 extends NewtBaseActivity {
    static String TAG = "MovieSimpleActivity0";
-   
+
    MouseAdapter toFrontMouseListener = new MouseAdapter() {
-       public void mouseClicked(MouseEvent e) {
-           Object src = e.getSource();
+       public void mouseClicked(final MouseEvent e) {
+           final Object src = e.getSource();
            if(src instanceof Window) {
                ((Window)src).requestFocus(false);
            }
        } };
-   
+
    @Override
-   public void onCreate(Bundle savedInstanceState) {
+   public void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
-       
-       final String[] streamLocs = new String[] {                    
-               System.getProperty("jnlp.media0_url2"),
+
+       final String[] streamLocs = new String[] {
+               System.getProperty("jnlp.media0_url0"),
                System.getProperty("jnlp.media0_url1"),
-               System.getProperty("jnlp.media0_url0") };       
+               System.getProperty("jnlp.media0_url2") };
        final URI streamLoc = getURI(streamLocs, 0, false);
        if(null == streamLoc) { throw new RuntimeException("no media reachable: "+Arrays.asList(streamLocs)); }
-       
+
        // also initializes JOGL
        final GLCapabilities capsMain = new GLCapabilities(GLProfile.getGL2ES2());
+       capsMain.setNumSamples(4);
+       capsMain.setSampleBuffers(true);
        capsMain.setBackgroundOpaque(false);
 
        // screen for layout params ..
        final com.jogamp.newt.Display dpy = NewtFactory.createDisplay(null);
        final com.jogamp.newt.Screen scrn = NewtFactory.createScreen(dpy, 0);
        scrn.addReference();
-              
+
        final Animator anim = new Animator();
-       
-       // Main           
+
+       // Main
        final GLWindow glWindowMain = GLWindow.create(scrn, capsMain);
        glWindowMain.setFullscreen(true);
        setContentView(getWindow(), glWindowMain);
        anim.add(glWindowMain);
        glWindowMain.setVisible(true);
-       
+
        final MovieSimple demoMain = new MovieSimple(null);
        demoMain.setScaleOrig(true);
        final GLMediaPlayer mPlayer = demoMain.getGLMediaPlayer();
-       mPlayer.addEventListener( new GLMediaPlayer.GLMediaEventListener() {            
+       mPlayer.addEventListener( new GLMediaPlayer.GLMediaEventListener() {
            @Override
-           public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
-            
+           public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) { }
+
            @Override
-           public void attributesChanged(GLMediaPlayer mp, int event_mask, long when) {
+           public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
                System.err.println("MovieSimpleActivity0 AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
                System.err.println("MovieSimpleActivity0 State: "+mp);
                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
                    glWindowMain.addGLEventListener(demoMain);
-                   anim.setUpdateFPSFrames(60, System.err);
+                   anim.setUpdateFPSFrames(60*5, System.err);
                    anim.resetFPSCounter();
                }
                if( 0 != ( ( GLMediaEventListener.EVENT_CHANGE_ERR | GLMediaEventListener.EVENT_CHANGE_EOS ) & event_mask ) ) {
                    final StreamException se = mPlayer.getStreamException();
                    if( null != se ) {
-                       se.printStackTrace();                        
+                       se.printStackTrace();
                    }
                    getActivity().finish();
                }
            }
        });
        demoMain.initStream(streamLoc, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 0);
-       
+
        scrn.removeReference();
 
        Log.d(TAG, "onCreate - X");
    }
-   
-   static URI getURI(String path[], int off, boolean checkAvail) {
+
+   static URI getURI(final String path[], final int off, final boolean checkAvail) {
        URI uri = null;
        for(int i=off; null==uri && i<path.length; i++) {
            if(null != path[i] && path[i].length()>0) {
@@ -136,7 +138,7 @@ public class MovieSimpleActivity0 extends NewtBaseActivity {
                    if( null != uc ) {
                        try {
                            uri = uc.getURL().toURI();
-                       } catch (URISyntaxException e) {
+                       } catch (final URISyntaxException e) {
                            uri = null;
                        }
                        if( uc instanceof HttpURLConnection ) {
@@ -146,7 +148,7 @@ public class MovieSimpleActivity0 extends NewtBaseActivity {
                } else {
                    try {
                        uri = new URI(path[i]);
-                   } catch (URISyntaxException e) {
+                   } catch (final URISyntaxException e) {
                        uri = null;
                    }
                }
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
index e54300d..7c99e2c 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivity1.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -33,6 +33,7 @@ import java.net.URISyntaxException;
 import java.net.URLConnection;
 import java.util.Arrays;
 
+import javax.media.nativewindow.util.Rectangle;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLProfile;
@@ -46,7 +47,6 @@ import com.jogamp.newt.Window;
 import com.jogamp.newt.event.MouseAdapter;
 import com.jogamp.newt.event.MouseEvent;
 import com.jogamp.newt.opengl.GLWindow;
-
 import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple;
 import com.jogamp.opengl.util.Animator;
 import com.jogamp.opengl.util.av.GLMediaPlayer;
@@ -60,177 +60,178 @@ import android.view.Gravity;
 
 public class MovieSimpleActivity1 extends NewtBaseActivity {
    static String TAG = "MovieSimpleActivity1";
-   
+
    MouseAdapter toFrontMouseListener = new MouseAdapter() {
-       public void mouseClicked(MouseEvent e) {
-           Object src = e.getSource();
+       public void mouseClicked(final MouseEvent e) {
+           final Object src = e.getSource();
            if(src instanceof Window) {
                ((Window)src).requestFocus(false);
            }
        } };
-   
+
    @Override
-   public void onCreate(Bundle savedInstanceState) {
+   public void onCreate(final Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
-       
-       final boolean mPlayerLocal = Boolean.valueOf(System.getProperty("jnlp.mplayer.local"));
+
        final boolean mPlayerNoZoom = Boolean.valueOf(System.getProperty("jnlp.mplayer.nozoom"));
        final boolean mPlayerHUD = Boolean.valueOf(System.getProperty("jnlp.mplayer.hud"));
        final boolean mPlayerSharedHUD = mPlayerHUD && Boolean.valueOf(System.getProperty("jnlp.mplayer.hud.shared"));
-       Log.d(TAG, "onCreate - 0 - mPlayerLocal "+mPlayerLocal+", mPlayerNoScale "+mPlayerNoZoom+", mPlayerHUD "+mPlayerHUD+", mPlayerSharedHUD "+mPlayerSharedHUD);
-       
-       String[] streamLocs = new String[] {                    
-               System.getProperty("jnlp.media0_url2"),
+       Log.d(TAG, "onCreate - 0 - mPlayerNoScale "+mPlayerNoZoom+", mPlayerHUD "+mPlayerHUD+", mPlayerSharedHUD "+mPlayerSharedHUD);
+
+       final String[] streamLocs = new String[] {
+               System.getProperty("jnlp.media0_url0"),
                System.getProperty("jnlp.media0_url1"),
-               System.getProperty("jnlp.media0_url0") };       
-       final URI streamLoc0 = getURI(streamLocs, mPlayerLocal ? 2 : 0, false);
+               System.getProperty("jnlp.media0_url2") };
+       final URI streamLoc0 = getURI(streamLocs, 2, false);
        if(null == streamLoc0) { throw new RuntimeException("no media reachable: "+Arrays.asList(streamLocs)); }
-       
+
        final URI streamLoc1;
        {
            URI _streamLoc1 = null;
            if(mPlayerHUD && !mPlayerSharedHUD) {
-               String[] urls1 = new String[] { System.getProperty("jnlp.media1_url0") };
-               _streamLoc1 = getURI(urls1, 0, false);
+               final String[] urls1 = new String[] { System.getProperty("jnlp.media1_url0") };
+               _streamLoc1 = getURI(urls1, 1, false);
            }
            if(null == _streamLoc1) { _streamLoc1 = streamLoc0; }
            streamLoc1 = _streamLoc1;
        }
-       
+
        setTransparencyTheme();
        setFullscreenFeature(getWindow(), true);
-           
+
        final android.view.ViewGroup viewGroup = new android.widget.FrameLayout(getActivity().getApplicationContext());
        getWindow().setContentView(viewGroup);
-       
+
        // also initializes JOGL
        final GLCapabilities capsMain = new GLCapabilities(GLProfile.getGL2ES2());
+       capsMain.setNumSamples(4);
+       capsMain.setSampleBuffers(true);
        capsMain.setBackgroundOpaque(!mPlayerHUD);
 
        // screen for layout params ..
        final com.jogamp.newt.Display dpy = NewtFactory.createDisplay(null);
        final com.jogamp.newt.Screen scrn = NewtFactory.createScreen(dpy, 0);
        scrn.addReference();
-              
+
        final Animator anim = new Animator();
-       
-       // Main           
+
+       // Main
        final GLWindow glWindowMain = GLWindow.create(scrn, capsMain);
        {
            final int padding = mPlayerHUD ? 32 : 0;
            final android.view.View androidView = ((jogamp.newt.driver.android.WindowDriver)glWindowMain.getDelegatedWindow()).getAndroidView();
-           glWindowMain.setSize(scrn.getWidth()-padding, scrn.getHeight()-padding);
+           glWindowMain.setSurfaceSize(scrn.getWidth()-padding, scrn.getHeight()-padding);
            glWindowMain.setUndecorated(true);
            // setContentView(getWindow(), glWindowMain);
-           viewGroup.addView(androidView, new android.widget.FrameLayout.LayoutParams(glWindowMain.getWidth(), glWindowMain.getHeight(), Gravity.BOTTOM|Gravity.RIGHT));
+           viewGroup.addView(androidView, new android.widget.FrameLayout.LayoutParams(glWindowMain.getSurfaceWidth(), glWindowMain.getSurfaceHeight(), Gravity.BOTTOM|Gravity.RIGHT));
            registerNEWTWindow(glWindowMain);
        }
        anim.add(glWindowMain);
        glWindowMain.setVisible(true);
-       
+
        final MovieSimple demoMain = new MovieSimple(null);
-       final GLMediaPlayer mPlayerMain = demoMain.getGLMediaPlayer();       
+       final GLMediaPlayer mPlayerMain = demoMain.getGLMediaPlayer();
        if(mPlayerHUD) {
            demoMain.setEffects(MovieSimple.EFFECT_GRADIENT_BOTTOM2TOP);
            demoMain.setTransparency(0.9f);
        }
        demoMain.setScaleOrig(mPlayerNoZoom);
-       mPlayerMain.addEventListener( new GLMediaPlayer.GLMediaEventListener() {            
+       mPlayerMain.addEventListener( new GLMediaPlayer.GLMediaEventListener() {
            @Override
-           public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
-            
+           public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) { }
+
            @Override
-           public void attributesChanged(GLMediaPlayer mp, int event_mask, long when) {
+           public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
                System.err.println("MovieSimpleActivity1 AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
                System.err.println("MovieSimpleActivity1 State: "+mp);
                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
                    glWindowMain.addGLEventListener(demoMain);
-                   anim.setUpdateFPSFrames(60, System.err);
+                   anim.setUpdateFPSFrames(60*5, System.err);
                    anim.resetFPSCounter();
                }
                if( 0 != ( ( GLMediaEventListener.EVENT_CHANGE_ERR | GLMediaEventListener.EVENT_CHANGE_EOS ) & event_mask ) ) {
                    final StreamException se = mPlayerMain.getStreamException();
                    if( null != se ) {
-                       se.printStackTrace();                        
+                       se.printStackTrace();
                    }
                    getActivity().finish();
                }
            }
        });
        demoMain.initStream(streamLoc0, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 0);
-              
+
        if(mPlayerHUD) {
-            final GLMediaPlayer mPlayerShared = mPlayerSharedHUD ? mPlayerMain : null; 
+            final GLMediaPlayer mPlayerShared = mPlayerSharedHUD ? mPlayerMain : null;
             final GLCapabilities capsHUD = new GLCapabilities(GLProfile.getGL2ES2());
+            capsHUD.setNumSamples(4);
+            capsHUD.setSampleBuffers(true);
             capsHUD.setBackgroundOpaque(false);
             final GLWindow glWindowHUD = GLWindow.create(scrn, capsHUD);
             glWindowMain.invoke(false, new GLRunnable() {
                 @Override
-                public boolean run(GLAutoDrawable drawable) {
+                public boolean run(final GLAutoDrawable drawable) {
                     final GLMediaPlayer mPlayerSub;
                     final MovieSimple demoHUD;
-                    int x2 = scrn.getX();
-                    int y2 = scrn.getY();
-                    int w2 = scrn.getWidth()/3;
-                    int h2 = scrn.getHeight()/3;
+                    final Rectangle windowBounds = (Rectangle) scrn.getViewportInWindowUnits().cloneMutable();
                     if(null != mPlayerShared) {
                        if(0 < mPlayerShared.getWidth() && mPlayerShared.getWidth()<scrn.getWidth()/2 &&
                           0 < mPlayerShared.getHeight() && mPlayerShared.getHeight()<scrn.getHeight()/2) {
-                           w2 = mPlayerShared.getWidth();
-                           h2 = mPlayerShared.getHeight();
+                           final int[] wh = glWindowHUD.convertToWindowUnits(new int[]{mPlayerShared.getWidth(), mPlayerShared.getHeight()});
+                           windowBounds.setWidth( wh[0] );
+                           windowBounds.setHeight( wh[1] );
                        }
-                       glWindowHUD.setSharedContext(glWindowMain.getContext());
+                       glWindowHUD.setSharedAutoDrawable(glWindowMain);
                        demoHUD = new MovieSimple(mPlayerShared);
                        mPlayerSub = mPlayerShared;
                     } else {
                        demoHUD = new MovieSimple(null);
                        mPlayerSub = demoHUD.getGLMediaPlayer();
                     }
-                    mPlayerSub.addEventListener( new GLMediaPlayer.GLMediaEventListener() {            
+                    mPlayerSub.addEventListener( new GLMediaPlayer.GLMediaEventListener() {
                        @Override
-                       public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
-                        
+                       public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) { }
+
                        @Override
-                       public void attributesChanged(GLMediaPlayer mp, int event_mask, long when) {
+                       public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
                             if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
                                 glWindowHUD.addGLEventListener(demoHUD);
                             }
                            if( 0 != ( ( GLMediaEventListener.EVENT_CHANGE_ERR | GLMediaEventListener.EVENT_CHANGE_EOS ) & event_mask ) ) {
                                final StreamException se = mPlayerMain.getStreamException();
                                if( null != se ) {
-                                   se.printStackTrace();                        
+                                   se.printStackTrace();
                                }
                                getActivity().finish();
                            }
                        }
                     });
                     demoHUD.initStream(streamLoc1, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 0);
-                   
-                    glWindowHUD.setPosition(x2, y2);
-                    glWindowHUD.setSize(w2, h2);
+
+                    glWindowHUD.setPosition(windowBounds.getX(), windowBounds.getY());
+                    glWindowHUD.setSize(windowBounds.getWidth(), windowBounds.getHeight());
                     System.err.println("HUD: "+mPlayerHUD);
-                    System.err.println("HUD: "+w2+"x"+h2);                            
-                    glWindowHUD.addMouseListener(toFrontMouseListener);               
+                    System.err.println("HUD: "+windowBounds);
+                    glWindowHUD.addMouseListener(toFrontMouseListener);
 
                     viewGroup.post(new Runnable() {
                         public void run() {
                             final android.view.View androidView = ((jogamp.newt.driver.android.WindowDriver)glWindowHUD.getDelegatedWindow()).getAndroidView();
                             // addContentView(getWindow(), glWindowHUD, new android.view.ViewGroup.LayoutParams(glWindowHUD.getWidth(), glWindowHUD.getHeight()));
-                            viewGroup.addView(androidView, new android.widget.FrameLayout.LayoutParams(glWindowHUD.getWidth(), glWindowHUD.getHeight(), Gravity.TOP|Gravity.LEFT));
-                            registerNEWTWindow(glWindowHUD);  
+                            viewGroup.addView(androidView, new android.widget.FrameLayout.LayoutParams(glWindowHUD.getSurfaceWidth(), glWindowHUD.getSurfaceHeight(), Gravity.TOP|Gravity.LEFT));
+                            registerNEWTWindow(glWindowHUD);
                             anim.add(glWindowHUD);
                             glWindowHUD.setVisible(true);
                         } } );
                     return true;
                 } } );
        }
-       
+
        scrn.removeReference();
 
        Log.d(TAG, "onCreate - X");
    }
-   
-   static URI getURI(String path[], int off, boolean checkAvail) {
+
+   static URI getURI(final String path[], final int off, final boolean checkAvail) {
        URI uri = null;
        for(int i=off; null==uri && i<path.length; i++) {
            if(null != path[i] && path[i].length()>0) {
@@ -239,7 +240,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
                    if( null != uc ) {
                        try {
                            uri = uc.getURL().toURI();
-                       } catch (URISyntaxException e) {
+                       } catch (final URISyntaxException e) {
                            uri = null;
                        }
                        if( uc instanceof HttpURLConnection ) {
@@ -249,7 +250,7 @@ public class MovieSimpleActivity1 extends NewtBaseActivity {
                } else {
                    try {
                        uri = new URI(path[i]);
-                   } catch (URISyntaxException e) {
+                   } catch (final URISyntaxException e) {
                        uri = null;
                    }
                }
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00b.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00b.java
index 00c9fb9..bcc20f7 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00b.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00b.java
@@ -34,21 +34,16 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
 
 public class MovieSimpleActivityLauncher00b extends LauncherUtil.BaseActivityLauncher {
 
-    static String demo = "com.jogamp.opengl.test.android.MovieSimpleActivity1";
+    static String demo = "com.jogamp.opengl.test.android.MovieSimpleActivity0";
     static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
     static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
 
     @Override
     public void init() {
        final OrderedProperties props = getProperties();
-       props.setProperty("jnlp.mplayer.nozoom",     "false");
-       props.setProperty("jnlp.mplayer.hud",        "false");
-       props.setProperty("jnlp.mplayer.hud.shared", "false");
-       // props.setProperty("jnlp.media0_url2", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_640x360.m4v");
-       props.setProperty("jnlp.media0_url2", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4");
+       props.setProperty("jnlp.media0_url0", "http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4");
        props.setProperty("jnlp.media0_url1", "http://video.webmfiles.org/big-buck-bunny_trailer.webm");
-       props.setProperty("jnlp.media0_url0", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media1_url0", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
+       props.setProperty("jnlp.media0_url2", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
        // props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00c.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00c.java
index 6e37cb8..e9636fb 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00c.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher00c.java
@@ -34,19 +34,16 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
 
 public class MovieSimpleActivityLauncher00c extends LauncherUtil.BaseActivityLauncher {
 
-    static String demo = "com.jogamp.opengl.test.android.MovieSimpleActivity1";
+    static String demo = "com.jogamp.opengl.test.android.MovieSimpleActivity0";
     static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
     static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
 
     @Override
     public void init() {
        final OrderedProperties props = getProperties();
-       props.setProperty("jnlp.mplayer.nozoom",     "false");
-       props.setProperty("jnlp.mplayer.hud",        "false");
-       props.setProperty("jnlp.mplayer.hud.shared", "false");
-       props.setProperty("jnlp.media0_url2", "camera:/0");
-       props.setProperty("jnlp.media0_url1", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media0_url0", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
+       props.setProperty("jnlp.media0_url0", "camera:/0");
+       props.setProperty("jnlp.media0_url1", "");
+       props.setProperty("jnlp.media0_url2", "");
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
        // props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher01a.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher01a.java
index 7f4b911..5fbd907 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher01a.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher01a.java
@@ -44,11 +44,9 @@ public class MovieSimpleActivityLauncher01a extends LauncherUtil.BaseActivityLau
        props.setProperty("jnlp.mplayer.nozoom",     "true");
        props.setProperty("jnlp.mplayer.hud",        "true");
        props.setProperty("jnlp.mplayer.hud.shared", "true");
-       // props.setProperty("jnlp.media0_url2", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_640x360.m4v");
-       props.setProperty("jnlp.media0_url2", "");
-       props.setProperty("jnlp.media0_url1", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media0_url0", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media1_url0", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
+       props.setProperty("jnlp.media0_url0", "http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4");
+       props.setProperty("jnlp.media1_url1", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
+       props.setProperty("jnlp.media0_url2", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
        // props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher01b.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher01b.java
index 2a76d08..d9f6244 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher01b.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher01b.java
@@ -44,11 +44,9 @@ public class MovieSimpleActivityLauncher01b extends LauncherUtil.BaseActivityLau
        props.setProperty("jnlp.mplayer.nozoom",     "false");
        props.setProperty("jnlp.mplayer.hud",        "true");
        props.setProperty("jnlp.mplayer.hud.shared", "true");
-       // props.setProperty("jnlp.media0_url2", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_640x360.m4v");
-       props.setProperty("jnlp.media0_url2", "");
-       props.setProperty("jnlp.media0_url1", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media0_url0", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media1_url0", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
+       props.setProperty("jnlp.media0_url0", "http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4");
+       props.setProperty("jnlp.media1_url1", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
+       props.setProperty("jnlp.media0_url2", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
        // props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
diff --git a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher02.java b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher02.java
index b649de2..09f4f92 100644
--- a/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher02.java
+++ b/src/test/com/jogamp/opengl/test/android/MovieSimpleActivityLauncher02.java
@@ -44,11 +44,9 @@ public class MovieSimpleActivityLauncher02 extends LauncherUtil.BaseActivityLaun
        props.setProperty("jnlp.mplayer.nozoom",     "false");
        props.setProperty("jnlp.mplayer.hud",        "true");
        props.setProperty("jnlp.mplayer.hud.shared", "false");
-       // props.setProperty("jnlp.media0_url2", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_640x360.m4v");
-       props.setProperty("jnlp.media0_url2", "");
-       props.setProperty("jnlp.media0_url1", "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media0_url0", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
-       props.setProperty("jnlp.media1_url0", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
+       props.setProperty("jnlp.media0_url0", "http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4");
+       props.setProperty("jnlp.media1_url1", "http://archive.org/download/ElephantsDream/ed_1024_512kb.mp4");
+       props.setProperty("jnlp.media0_url2", "file:///mnt/sdcard/Movies/BigBuckBunny_320x180.mp4");
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
        // props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTElektronActivity.java b/src/test/com/jogamp/opengl/test/android/NEWTElektronActivity.java
index 596c2c8..9183e57 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTElektronActivity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTElektronActivity.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -44,35 +44,35 @@ import android.util.Log;
 
 public class NEWTElektronActivity extends NewtBaseActivity {
    static String TAG = "NEWTElektronActivity";
-   
+
    @Override
-   public void onCreate(Bundle savedInstanceState) {
+   public void onCreate(final Bundle savedInstanceState) {
        Log.d(TAG, "onCreate - 0");
        super.onCreate(savedInstanceState);
-       
+
        // create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
-       GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
+       final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
        Log.d(TAG, "req caps: "+caps);
-       GLWindow glWindow = GLWindow.create(caps);
+       final GLWindow glWindow = GLWindow.create(caps);
        glWindow.setFullscreen(true);
        setContentView(getWindow(), glWindow);
-       
+
        glWindow.addGLEventListener(new ElektronenMultiplizierer());
        glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
            @Override
-           public void monitorModeChangeNotify(MonitorEvent me) { }
+           public void monitorModeChangeNotify(final MonitorEvent me) { }
            @Override
-           public void monitorModeChanged(MonitorEvent me, boolean success) {
+           public void monitorModeChanged(final MonitorEvent me, final boolean success) {
                System.err.println("MonitorMode Changed (success "+success+"): "+me);
            }
        });
        glWindow.setVisible(true);
-       Animator animator = new Animator(glWindow);
-       
+       final Animator animator = new Animator(glWindow);
+
        animator.setUpdateFPSFrames(60, System.err);
        animator.resetFPSCounter();
        glWindow.resetFPSCounter();
-       
+
        Log.d(TAG, "onCreate - X");
-   }   
+   }
 }
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTElektronActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTElektronActivityLauncher.java
index 527d661..95504b7 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTElektronActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTElektronActivityLauncher.java
@@ -8,16 +8,16 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
 public class NEWTElektronActivityLauncher extends LauncherUtil.BaseActivityLauncher {
 
     static String demo = "com.jogamp.opengl.test.android.NEWTElektronActivity";
-    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };    
+    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
     static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-    
+
     @Override
     public void init() {
-       final OrderedProperties props = getProperties();       
+       final OrderedProperties props = getProperties();
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
        // properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
-       // properties.setProperty("jogamp.debug.IOUtil", "true");       
+       // properties.setProperty("jogamp.debug.IOUtil", "true");
        // properties.setProperty("nativewindow.debug", "all");
        props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
        // properties.setProperty("jogl.debug", "all");
@@ -25,7 +25,7 @@ public class NEWTElektronActivityLauncher extends LauncherUtil.BaseActivityLaunc
        props.setProperty("jogl.debug.GLDrawable", "true");
        props.setProperty("jogl.debug.GLContext", "true");
        props.setProperty("jogl.debug.GLSLCode", "true");
-       props.setProperty("jogl.debug.CapabilitiesChooser", "true");       
+       props.setProperty("jogl.debug.CapabilitiesChooser", "true");
        // properties.setProperty("jogl.debug.GLSLState", "true");
        // properties.setProperty("jogl.debug.DebugGL", "true");
        // properties.setProperty("jogl.debug.TraceGL", "true");
@@ -34,7 +34,7 @@ public class NEWTElektronActivityLauncher extends LauncherUtil.BaseActivityLaunc
        // properties.setProperty("newt.debug.Window.MouseEvent", "true");
        // properties.setProperty("newt.debug.Window.KeyEvent", "true");
     }
-    
+
     @Override
     public String getActivityName() {
         return demo;
@@ -43,7 +43,7 @@ public class NEWTElektronActivityLauncher extends LauncherUtil.BaseActivityLaunc
     public List<String> getSysPackages() {
         return Arrays.asList(sys_pkgs);
     }
-    
+
     @Override
     public List<String> getUsrPackages() {
         return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES1Activity.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES1Activity.java
index f10cfc1..3ec85c1 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES1Activity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES1Activity.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -44,40 +44,40 @@ import android.util.Log;
 
 public class NEWTGearsES1Activity extends NewtBaseActivity {
    static String TAG = "NEWTGearsES1Activity";
-   
+
    @Override
-   public void onCreate(Bundle savedInstanceState) {
+   public void onCreate(final Bundle savedInstanceState) {
        Log.d(TAG, "onCreate - 0");
        super.onCreate(savedInstanceState);
-       
+
        // create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
-       GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
+       final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
        /*
        caps.setRedBits(5);
        caps.setGreenBits(6);
        caps.setBlueBits(5);
        caps.setAlphaBits(0); */
        Log.d(TAG, "req caps: "+caps);
-       GLWindow glWindow = GLWindow.create(caps);
+       final GLWindow glWindow = GLWindow.create(caps);
        glWindow.setFullscreen(true);
        setContentView(getWindow(), glWindow);
-       
+
        glWindow.addGLEventListener(new GearsES1(-1));
        glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
            @Override
-           public void monitorModeChangeNotify(MonitorEvent me) { }
+           public void monitorModeChangeNotify(final MonitorEvent me) { }
            @Override
-           public void monitorModeChanged(MonitorEvent me, boolean success) {
+           public void monitorModeChanged(final MonitorEvent me, final boolean success) {
                System.err.println("MonitorMode Changed (success "+success+"): "+me);
            }
        });
        glWindow.setVisible(true);
-       Animator animator = new Animator(glWindow);
-       
+       final Animator animator = new Animator(glWindow);
+
        animator.setUpdateFPSFrames(60, System.err);
        animator.resetFPSCounter();
        glWindow.resetFPSCounter();
-       
+
        Log.d(TAG, "onCreate - X");
-   }   
+   }
 }
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES1ActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES1ActivityLauncher.java
index dca4531..db4d578 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES1ActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES1ActivityLauncher.java
@@ -7,16 +7,16 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
 
 public class NEWTGearsES1ActivityLauncher extends LauncherUtil.BaseActivityLauncher {
     static String demo = "com.jogamp.opengl.test.android.NEWTGearsES1Activity";
-    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };    
+    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
     static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-    
+
     @Override
     public void init() {
-       final OrderedProperties props = getProperties();       
+       final OrderedProperties props = getProperties();
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
        // properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
-       // properties.setProperty("jogamp.debug.IOUtil", "true");       
+       // properties.setProperty("jogamp.debug.IOUtil", "true");
        // properties.setProperty("nativewindow.debug", "all");
        props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
        // properties.setProperty("jogl.debug", "all");
@@ -24,7 +24,7 @@ public class NEWTGearsES1ActivityLauncher extends LauncherUtil.BaseActivityLaunc
        props.setProperty("jogl.debug.GLDrawable", "true");
        props.setProperty("jogl.debug.GLContext", "true");
        props.setProperty("jogl.debug.GLSLCode", "true");
-       props.setProperty("jogl.debug.CapabilitiesChooser", "true");       
+       props.setProperty("jogl.debug.CapabilitiesChooser", "true");
        // properties.setProperty("jogl.debug.GLSLState", "true");
        // properties.setProperty("jogl.debug.DebugGL", "true");
        // properties.setProperty("jogl.debug.TraceGL", "true");
@@ -33,7 +33,7 @@ public class NEWTGearsES1ActivityLauncher extends LauncherUtil.BaseActivityLaunc
        // properties.setProperty("newt.debug.Window.MouseEvent", "true");
        // properties.setProperty("newt.debug.Window.KeyEvent", "true");
     }
-    
+
     @Override
     public String getActivityName() {
         return demo;
@@ -42,7 +42,7 @@ public class NEWTGearsES1ActivityLauncher extends LauncherUtil.BaseActivityLaunc
     public List<String> getSysPackages() {
         return Arrays.asList(sys_pkgs);
     }
-    
+
     @Override
     public List<String> getUsrPackages() {
         return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java
index 9572ef6..25eb258 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2Activity.java
@@ -56,30 +56,30 @@ public class NEWTGearsES2Activity extends NewtBaseActivity {
    static final String forceKillProcessTest = "demo.force.killProcessTest";
 
    @Override
-   public void onCreate(Bundle savedInstanceState) {
+   public void onCreate(final Bundle savedInstanceState) {
        Log.d(TAG, "onCreate - 0");
        super.onCreate(savedInstanceState);
 
        // create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
-       GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
+       final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
        if( null != System.getProperty(forceRGBA5650) ) {
            Log.d(TAG, "forceRGBA5650");
            caps.setRedBits(5); caps.setGreenBits(6); caps.setBlueBits(5);
        }
 
        Log.d(TAG, "req caps: "+caps);
-       GLWindow glWindow = GLWindow.create(caps);
+       final GLWindow glWindow = GLWindow.create(caps);
        glWindow.setFullscreen(true);
        setContentView(getWindow(), glWindow);
 
-       GearsES2 demo = new GearsES2(-1);
+       final GearsES2 demo = new GearsES2(-1);
        // demo.enableAndroidTrace(true);
        glWindow.addGLEventListener(demo);
        glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
            @Override
-           public void monitorModeChangeNotify(MonitorEvent me) { }
+           public void monitorModeChangeNotify(final MonitorEvent me) { }
            @Override
-           public void monitorModeChanged(MonitorEvent me, boolean success) {
+           public void monitorModeChanged(final MonitorEvent me, final boolean success) {
                System.err.println("MonitorMode Changed (success "+success+"): "+me);
            }
        });
@@ -87,12 +87,12 @@ public class NEWTGearsES2Activity extends NewtBaseActivity {
            Log.d(TAG, "forceKillProcessTest");
            glWindow.addMouseListener(new MouseAdapter() {
             @Override
-            public void mousePressed(MouseEvent e) {
+            public void mousePressed(final MouseEvent e) {
                 if( e.getPointerCount() == 3 ) {
                     Log.d(TAG, "MemoryHog");
                     new Thread(new Runnable() {
                         public void run() {
-                            ArrayList<Buffer> buffers = new ArrayList<Buffer>();
+                            final ArrayList<Buffer> buffers = new ArrayList<Buffer>();
                             while(true) {
                                 final int halfMB = 512 * 1024;
                                 final float osizeMB = buffers.size() * 0.5f;
@@ -102,7 +102,7 @@ public class NEWTGearsES2Activity extends NewtBaseActivity {
                                 System.err.println("MemoryHog: ****** +4k: "+osizeMB+" MB +"+nsizeMB+" MB - Done");
                                 try {
                                     Thread.sleep(500);
-                                } catch (Exception e) {};
+                                } catch (final Exception e) { e.printStackTrace(); };
                             }
                         } }, "MemoryHog").start();
                 } else if( e.getPointerCount() == 4 ) {
@@ -112,7 +112,7 @@ public class NEWTGearsES2Activity extends NewtBaseActivity {
             }
            });
        }
-       Animator animator = new Animator(glWindow);
+       final Animator animator = new Animator(glWindow);
        // animator.setRunAsFastAsPossible(true);
        // glWindow.setSkipContextReleaseThread(animator.getThread());
 
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java
index c87e661..06316c4 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ActivityLauncher.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -37,13 +37,13 @@ public class NEWTGearsES2ActivityLauncher extends LauncherUtil.BaseActivityLaunc
     static String demo = "com.jogamp.opengl.test.android.NEWTGearsES2Activity";
     static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
     static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-    
+
     @Override
     public void init() {
-       final OrderedProperties props = getProperties();       
+       final OrderedProperties props = getProperties();
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
-       // props.setProperty("jogamp.debug.IOUtil", "true");       
+       // props.setProperty("jogamp.debug.IOUtil", "true");
        // properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
        // props.setProperty("nativewindow.debug", "all");
        props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
@@ -52,7 +52,7 @@ public class NEWTGearsES2ActivityLauncher extends LauncherUtil.BaseActivityLaunc
        // props.setProperty("jogl.debug.GLDrawable", "true");
        props.setProperty("jogl.debug.GLContext", "true");
        props.setProperty("jogl.debug.GLSLCode", "true");
-       // props.setProperty("jogl.debug.CapabilitiesChooser", "true");       
+       // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
        // props.setProperty("jogl.debug.GLSLState", "true");
        // props.setProperty("jogl.debug.DebugGL", "true");
        // props.setProperty("jogl.debug.TraceGL", "true");
@@ -62,20 +62,20 @@ public class NEWTGearsES2ActivityLauncher extends LauncherUtil.BaseActivityLaunc
        props.setProperty("newt.debug.Window.MouseEvent", "true");
        props.setProperty("newt.debug.Window.KeyEvent", "true");
        // props.setProperty("newt.debug.Android.MouseEvent", "true");
-       
+
        // props.setProperty("demo.force.killProcessTest", "true");
     }
-    
+
     @Override
     public String getActivityName() {
         return demo;
     }
-    
+
     @Override
     public List<String> getSysPackages() {
         return Arrays.asList(sys_pkgs);
     }
-    
+
     @Override
     public List<String> getUsrPackages() {
         return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ECTActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ECTActivityLauncher.java
index fb00ecb..2e005cb 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ECTActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2ECTActivityLauncher.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -35,15 +35,15 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
 public class NEWTGearsES2ECTActivityLauncher extends LauncherUtil.BaseActivityLauncher {
 
     static String demo = "com.jogamp.opengl.test.android.NEWTGearsES2Activity";
-    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };    
+    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
     static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-    
+
     @Override
     public void init() {
-       final OrderedProperties props = getProperties();       
+       final OrderedProperties props = getProperties();
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
-       // props.setProperty("jogamp.debug.IOUtil", "true");       
+       // props.setProperty("jogamp.debug.IOUtil", "true");
        // properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
        // props.setProperty("nativewindow.debug", "all");
        props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
@@ -52,7 +52,7 @@ public class NEWTGearsES2ECTActivityLauncher extends LauncherUtil.BaseActivityLa
        // props.setProperty("jogl.debug.GLDrawable", "true");
        props.setProperty("jogl.debug.GLContext", "true");
        props.setProperty("jogl.debug.GLSLCode", "true");
-       // props.setProperty("jogl.debug.CapabilitiesChooser", "true");       
+       // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
        // props.setProperty("jogl.debug.GLSLState", "true");
        // props.setProperty("jogl.debug.DebugGL", "true");
        // props.setProperty("jogl.debug.TraceGL", "true");
@@ -60,10 +60,10 @@ public class NEWTGearsES2ECTActivityLauncher extends LauncherUtil.BaseActivityLa
        props.setProperty("newt.debug.Window", "true");
        props.setProperty("newt.debug.Window.MouseEvent", "true");
        props.setProperty("newt.debug.Window.KeyEvent", "true");
-       
-       props.setProperty("demo.force.ect", "true");       
+
+       props.setProperty("demo.force.ect", "true");
     }
-    
+
     @Override
     public String getActivityName() {
         return demo;
@@ -72,7 +72,7 @@ public class NEWTGearsES2ECTActivityLauncher extends LauncherUtil.BaseActivityLa
     public List<String> getSysPackages() {
         return Arrays.asList(sys_pkgs);
     }
-    
+
     @Override
     public List<String> getUsrPackages() {
         return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2RGB565ActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2RGB565ActivityLauncher.java
index 8acd2c0..94e32f1 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2RGB565ActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2RGB565ActivityLauncher.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -35,15 +35,15 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
 public class NEWTGearsES2RGB565ActivityLauncher extends LauncherUtil.BaseActivityLauncher {
 
     static String demo = "com.jogamp.opengl.test.android.NEWTGearsES2Activity";
-    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };    
+    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
     static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-    
+
     @Override
     public void init() {
-       final OrderedProperties props = getProperties();       
+       final OrderedProperties props = getProperties();
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
-       // props.setProperty("jogamp.debug.IOUtil", "true");       
+       // props.setProperty("jogamp.debug.IOUtil", "true");
        // properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
        // props.setProperty("nativewindow.debug", "all");
        props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
@@ -52,7 +52,7 @@ public class NEWTGearsES2RGB565ActivityLauncher extends LauncherUtil.BaseActivit
        // props.setProperty("jogl.debug.GLDrawable", "true");
        props.setProperty("jogl.debug.GLContext", "true");
        props.setProperty("jogl.debug.GLSLCode", "true");
-       // props.setProperty("jogl.debug.CapabilitiesChooser", "true");       
+       // props.setProperty("jogl.debug.CapabilitiesChooser", "true");
        // props.setProperty("jogl.debug.GLSLState", "true");
        // props.setProperty("jogl.debug.DebugGL", "true");
        // props.setProperty("jogl.debug.TraceGL", "true");
@@ -60,10 +60,10 @@ public class NEWTGearsES2RGB565ActivityLauncher extends LauncherUtil.BaseActivit
        props.setProperty("newt.debug.Window", "true");
        props.setProperty("newt.debug.Window.MouseEvent", "true");
        props.setProperty("newt.debug.Window.KeyEvent", "true");
-       
+
        props.setProperty("demo.force.rgba5650", "true");
     }
-    
+
     @Override
     public String getActivityName() {
         return demo;
@@ -72,7 +72,7 @@ public class NEWTGearsES2RGB565ActivityLauncher extends LauncherUtil.BaseActivit
     public List<String> getSysPackages() {
         return Arrays.asList(sys_pkgs);
     }
-    
+
     @Override
     public List<String> getUsrPackages() {
         return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivity.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivity.java
index beaf604..1080b2d 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivity.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -46,43 +46,43 @@ import android.util.Log;
 
 public class NEWTGearsES2TransActivity extends NewtBaseActivity {
    static String TAG = "NEWTGearsES2TransActivity";
-   
+
    @Override
-   public void onCreate(Bundle savedInstanceState) {
+   public void onCreate(final Bundle savedInstanceState) {
        Log.d(TAG, "onCreate - 0");
        super.onCreate(savedInstanceState);
-       
+
        // create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
-       GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
+       final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
        caps.setBackgroundOpaque(false);
-       
+
        Log.d(TAG, "req caps: "+caps);
-       Screen screen = NewtFactory.createScreen(NewtFactory.createDisplay(null), 0);
+       final Screen screen = NewtFactory.createScreen(NewtFactory.createDisplay(null), 0);
        screen.addReference();
-       GLWindow glWindow = GLWindow.create(screen, caps);
-       glWindow.setSize(2*screen.getWidth()/3, 2*screen.getHeight()/3);
+       final GLWindow glWindow = GLWindow.create(screen, caps);
+       glWindow.setSurfaceSize(2*screen.getWidth()/3, 2*screen.getHeight()/3);
        glWindow.setUndecorated(true);
        setContentView(getWindow(), glWindow);
-       
+
        glWindow.addGLEventListener(new GearsES2(-1));
        glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
            @Override
-           public void monitorModeChangeNotify(MonitorEvent me) { }
+           public void monitorModeChangeNotify(final MonitorEvent me) { }
            @Override
-           public void monitorModeChanged(MonitorEvent me, boolean success) {
+           public void monitorModeChanged(final MonitorEvent me, final boolean success) {
                System.err.println("MonitorMode Changed (success "+success+"): "+me);
            }
        });
-       Animator animator = new Animator(glWindow);
+       final Animator animator = new Animator(glWindow);
        // glWindow.setSkipContextReleaseThread(animator.getThread());
-       
+
        glWindow.setVisible(true);
-       
+
        animator.setUpdateFPSFrames(60, System.err);
        animator.resetFPSCounter();
        glWindow.resetFPSCounter();
-       
+
        screen.removeReference();
        Log.d(TAG, "onCreate - X");
-   }   
+   }
 }
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivityLauncher.java
index e6fe2a2..332b26e 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGearsES2TransActivityLauncher.java
@@ -7,17 +7,17 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
 
 public class NEWTGearsES2TransActivityLauncher extends LauncherUtil.BaseActivityLauncher {
     static String demo = "com.jogamp.opengl.test.android.NEWTGearsES2TransActivity";
-    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };    
+    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
     static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-    
+
     @Override
     public void init() {
-       final OrderedProperties props = getProperties();       
+       final OrderedProperties props = getProperties();
        // props.setProperty("jnlp.android.translucent", "true");
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
        // properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
-       // properties.setProperty("jogamp.debug.IOUtil", "true");       
+       // properties.setProperty("jogamp.debug.IOUtil", "true");
        // properties.setProperty("nativewindow.debug", "all");
        props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
        // properties.setProperty("jogl.debug", "all");
@@ -25,7 +25,7 @@ public class NEWTGearsES2TransActivityLauncher extends LauncherUtil.BaseActivity
        props.setProperty("jogl.debug.GLDrawable", "true");
        props.setProperty("jogl.debug.GLContext", "true");
        props.setProperty("jogl.debug.GLSLCode", "true");
-       props.setProperty("jogl.debug.CapabilitiesChooser", "true");       
+       props.setProperty("jogl.debug.CapabilitiesChooser", "true");
        // properties.setProperty("jogl.debug.GLSLState", "true");
        // properties.setProperty("jogl.debug.DebugGL", "true");
        // properties.setProperty("jogl.debug.TraceGL", "true");
@@ -35,24 +35,24 @@ public class NEWTGearsES2TransActivityLauncher extends LauncherUtil.BaseActivity
        // properties.setProperty("newt.debug.Window.KeyEvent", "true");
        props.setProperty("jogamp.debug.IOUtil", "true");
     }
-    
+
     @Override
     public String getActivityName() {
         return demo;
     }
-    
+
     @Override
     public List<String> getSysPackages() {
         return Arrays.asList(sys_pkgs);
     }
-    
+
     @Override
     public List<String> getUsrPackages() {
         return Arrays.asList(usr_pkgs);
     }
-    
+
     @Override
     public String getAction() {
         return LauncherUtil.LAUNCH_ACTIVITY_TRANSPARENT;
-    }      
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivity.java b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivity.java
index 26adf0c..cd7eb4c 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivity.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -44,38 +44,38 @@ import android.util.Log;
 
 public class NEWTGraphUI1pActivity extends NewtBaseActivity {
    static String TAG = "NEWTGraphUIActivity";
-   
+
    @Override
-   public void onCreate(Bundle savedInstanceState) {
+   public void onCreate(final Bundle savedInstanceState) {
        Log.d(TAG, "onCreate - 0");
        super.onCreate(savedInstanceState);
-       
+
        // create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
-       GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
+       final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
        caps.setAlphaBits(4);
        caps.setNumSamples(4);
        caps.setSampleBuffers(true);
        Log.d(TAG, "req caps: "+caps);
-       GLWindow glWindow = GLWindow.create(caps);
+       final GLWindow glWindow = GLWindow.create(caps);
        glWindow.setFullscreen(true);
        setContentView(getWindow(), glWindow);
-       
+
        glWindow.addGLEventListener(new GPUUISceneGLListener0A(0));
        glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
            @Override
-           public void monitorModeChangeNotify(MonitorEvent me) { }
+           public void monitorModeChangeNotify(final MonitorEvent me) { }
            @Override
-           public void monitorModeChanged(MonitorEvent me, boolean success) {
+           public void monitorModeChanged(final MonitorEvent me, final boolean success) {
                System.err.println("MonitorMode Changed (success "+success+"): "+me);
            }
        });
        glWindow.setVisible(true);
-       Animator animator = new Animator(glWindow);
-       
+       final Animator animator = new Animator(glWindow);
+
        animator.setUpdateFPSFrames(60, System.err);
        animator.resetFPSCounter();
        glWindow.resetFPSCounter();
-       
+
        Log.d(TAG, "onCreate - X");
-   }   
+   }
 }
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivityLauncher.java
index c18cf16..5dd8686 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI1pActivityLauncher.java
@@ -7,16 +7,16 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
 
 public class NEWTGraphUI1pActivityLauncher extends LauncherUtil.BaseActivityLauncher {
     static String demo = "com.jogamp.opengl.test.android.NEWTGraphUI1pActivity";
-    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };    
+    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
     static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-    
+
     @Override
     public void init() {
-       final OrderedProperties props = getProperties();       
+       final OrderedProperties props = getProperties();
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
        // props.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
-       // props.setProperty("jogamp.debug.IOUtil", "true");       
+       // props.setProperty("jogamp.debug.IOUtil", "true");
        // props.setProperty("nativewindow.debug", "all");
        props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
        // props.setProperty("jogl.debug", "all");
@@ -24,7 +24,7 @@ public class NEWTGraphUI1pActivityLauncher extends LauncherUtil.BaseActivityLaun
        props.setProperty("jogl.debug.GLDrawable", "true");
        props.setProperty("jogl.debug.GLContext", "true");
        props.setProperty("jogl.debug.GLSLCode", "true");
-       props.setProperty("jogl.debug.CapabilitiesChooser", "true");       
+       props.setProperty("jogl.debug.CapabilitiesChooser", "true");
        // props.setProperty("jogl.debug.GLSLState", "true");
        // props.setProperty("jogl.debug.DebugGL", "true");
        // props.setProperty("jogl.debug.TraceGL", "true");
@@ -33,17 +33,17 @@ public class NEWTGraphUI1pActivityLauncher extends LauncherUtil.BaseActivityLaun
        // props.setProperty("newt.debug.Window.MouseEvent", "true");
        // props.setProperty("newt.debug.Window.KeyEvent", "true");
     }
-    
+
     @Override
     public String getActivityName() {
         return demo;
     }
-    
+
     @Override
     public List<String> getSysPackages() {
         return Arrays.asList(sys_pkgs);
     }
-    
+
     @Override
     public List<String> getUsrPackages() {
         return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java
index ebabfb0..55bdbcf 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivity.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -45,38 +45,36 @@ import android.util.Log;
 
 public class NEWTGraphUI2pActivity extends NewtBaseActivity {
    static String TAG = "NEWTGraphUIActivity";
-   
+
    @Override
-   public void onCreate(Bundle savedInstanceState) {
+   public void onCreate(final Bundle savedInstanceState) {
        Log.d(TAG, "onCreate - 0");
        super.onCreate(savedInstanceState);
-       
+
        // create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
-       GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
+       final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
        caps.setAlphaBits(4);
-       caps.setNumSamples(4);
-       caps.setSampleBuffers(true);
        Log.d(TAG, "req caps: "+caps);
-       GLWindow glWindow = GLWindow.create(caps);
+       final GLWindow glWindow = GLWindow.create(caps);
        glWindow.setFullscreen(true);
        setContentView(getWindow(), glWindow);
-       
+
        glWindow.addGLEventListener(new GPUUISceneGLListener0A(Region.VBAA_RENDERING_BIT));
        glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
            @Override
-           public void monitorModeChangeNotify(MonitorEvent me) { }
+           public void monitorModeChangeNotify(final MonitorEvent me) { }
            @Override
-           public void monitorModeChanged(MonitorEvent me, boolean success) {
+           public void monitorModeChanged(final MonitorEvent me, final boolean success) {
                System.err.println("MonitorMode Changed (success "+success+"): "+me);
            }
        });
        glWindow.setVisible(true);
-       Animator animator = new Animator(glWindow);
-       
+       final Animator animator = new Animator(glWindow);
+
        animator.setUpdateFPSFrames(60, System.err);
        animator.resetFPSCounter();
        glWindow.resetFPSCounter();
-       
+
        Log.d(TAG, "onCreate - X");
-   }   
+   }
 }
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivityLauncher.java
index 501d425..09e500b 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTGraphUI2pActivityLauncher.java
@@ -7,16 +7,16 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
 
 public class NEWTGraphUI2pActivityLauncher extends LauncherUtil.BaseActivityLauncher {
     static String demo = "com.jogamp.opengl.test.android.NEWTGraphUI2pActivity";
-    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };    
+    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
     static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-    
+
     @Override
     public void init() {
-       final OrderedProperties props = getProperties();       
+       final OrderedProperties props = getProperties();
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
        // properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
-       // properties.setProperty("jogamp.debug.IOUtil", "true");       
+       // properties.setProperty("jogamp.debug.IOUtil", "true");
        // properties.setProperty("nativewindow.debug", "all");
        props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
        // properties.setProperty("jogl.debug", "all");
@@ -24,7 +24,7 @@ public class NEWTGraphUI2pActivityLauncher extends LauncherUtil.BaseActivityLaun
        props.setProperty("jogl.debug.GLDrawable", "true");
        props.setProperty("jogl.debug.GLContext", "true");
        props.setProperty("jogl.debug.GLSLCode", "true");
-       props.setProperty("jogl.debug.CapabilitiesChooser", "true");       
+       props.setProperty("jogl.debug.CapabilitiesChooser", "true");
        // properties.setProperty("jogl.debug.GLSLState", "true");
        // properties.setProperty("jogl.debug.DebugGL", "true");
        // properties.setProperty("jogl.debug.TraceGL", "true");
@@ -33,17 +33,17 @@ public class NEWTGraphUI2pActivityLauncher extends LauncherUtil.BaseActivityLaun
        // properties.setProperty("newt.debug.Window.MouseEvent", "true");
        // properties.setProperty("newt.debug.Window.KeyEvent", "true");
     }
-    
+
     @Override
     public String getActivityName() {
         return demo;
     }
-    
+
     @Override
     public List<String> getSysPackages() {
         return Arrays.asList(sys_pkgs);
     }
-    
+
     @Override
     public List<String> getUsrPackages() {
         return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1Activity.java b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1Activity.java
index 08fbf64..f256f98 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1Activity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1Activity.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -44,34 +44,34 @@ import android.util.Log;
 
 public class NEWTRedSquareES1Activity extends NewtBaseActivity {
    static String TAG = "NEWTGearsES1Activity";
-   
+
    @Override
-   public void onCreate(Bundle savedInstanceState) {
+   public void onCreate(final Bundle savedInstanceState) {
        Log.d(TAG, "onCreate - 0");
        super.onCreate(savedInstanceState);
-       
+
        // create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
-       GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
+       final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
        Log.d(TAG, "req caps: "+caps);
-       GLWindow glWindow = GLWindow.create(caps);
+       final GLWindow glWindow = GLWindow.create(caps);
        setContentView(getWindow(), glWindow);
-       
+
        glWindow.addGLEventListener(new RedSquareES1(-1));
        glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
            @Override
-           public void monitorModeChangeNotify(MonitorEvent me) { }
+           public void monitorModeChangeNotify(final MonitorEvent me) { }
            @Override
-           public void monitorModeChanged(MonitorEvent me, boolean success) {
+           public void monitorModeChanged(final MonitorEvent me, final boolean success) {
                System.err.println("MonitorMode Changed (success "+success+"): "+me);
            }
        });
        glWindow.setVisible(true);
-       Animator animator = new Animator(glWindow);
-       
+       final Animator animator = new Animator(glWindow);
+
        animator.setUpdateFPSFrames(60, System.err);
        animator.resetFPSCounter();
        glWindow.resetFPSCounter();
-       
+
        Log.d(TAG, "onCreate - X");
-   }   
+   }
 }
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1ActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1ActivityLauncher.java
index 59bf5ce..4b5a05f 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1ActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES1ActivityLauncher.java
@@ -7,16 +7,16 @@ import com.jogamp.opengl.test.android.LauncherUtil.OrderedProperties;
 
 public class NEWTRedSquareES1ActivityLauncher extends LauncherUtil.BaseActivityLauncher {
     static String demo = "com.jogamp.opengl.test.android.NEWTRedSquareES1Activity";
-    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };    
+    static String[] sys_pkgs = new String[] { "com.jogamp.common", "javax.media.opengl" };
     static String[] usr_pkgs = new String[] { "com.jogamp.opengl.test" };
-    
+
     @Override
     public void init() {
-       final OrderedProperties props = getProperties();       
+       final OrderedProperties props = getProperties();
        // props.setProperty("jogamp.debug.JNILibLoader", "true");
        // props.setProperty("jogamp.debug.NativeLibrary", "true");
        // properties.setProperty("jogamp.debug.NativeLibrary.Lookup", "true");
-       // properties.setProperty("jogamp.debug.IOUtil", "true");       
+       // properties.setProperty("jogamp.debug.IOUtil", "true");
        // properties.setProperty("nativewindow.debug", "all");
        props.setProperty("nativewindow.debug.GraphicsConfiguration", "true");
        // properties.setProperty("jogl.debug", "all");
@@ -24,7 +24,7 @@ public class NEWTRedSquareES1ActivityLauncher extends LauncherUtil.BaseActivityL
        props.setProperty("jogl.debug.GLDrawable", "true");
        props.setProperty("jogl.debug.GLContext", "true");
        props.setProperty("jogl.debug.GLSLCode", "true");
-       props.setProperty("jogl.debug.CapabilitiesChooser", "true");       
+       props.setProperty("jogl.debug.CapabilitiesChooser", "true");
        // properties.setProperty("jogl.debug.GLSLState", "true");
        // properties.setProperty("jogl.debug.DebugGL", "true");
        // properties.setProperty("jogl.debug.TraceGL", "true");
@@ -33,17 +33,17 @@ public class NEWTRedSquareES1ActivityLauncher extends LauncherUtil.BaseActivityL
        // properties.setProperty("newt.debug.Window.MouseEvent", "true");
        // properties.setProperty("newt.debug.Window.KeyEvent", "true");
     }
-    
+
     @Override
     public String getActivityName() {
         return demo;
     }
-    
+
     @Override
     public List<String> getSysPackages() {
         return Arrays.asList(sys_pkgs);
     }
-    
+
     @Override
     public List<String> getUsrPackages() {
         return Arrays.asList(usr_pkgs);
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2Activity.java b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2Activity.java
index 75ae94e..99c65d6 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2Activity.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2Activity.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -44,56 +44,56 @@ import android.util.Log;
 
 public class NEWTRedSquareES2Activity extends NewtBaseActivity {
    static String TAG = "NEWTGearsES2Activity";
-   
+
    @Override
-   public void onCreate(Bundle savedInstanceState) {
+   public void onCreate(final Bundle savedInstanceState) {
        Log.d(TAG, "onCreate - 0");
        super.onCreate(savedInstanceState);
-       
+
        // create GLWindow (-> incl. underlying NEWT Display, Screen & Window)
-       GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
+       final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
        Log.d(TAG, "req caps: "+caps);
-       GLWindow glWindow = GLWindow.create(caps);
+       final GLWindow glWindow = GLWindow.create(caps);
        // glWindow.setSize(200, 200);
        // glWindow.setUndecorated(true);
-       glWindow.setFullscreen(true);       
+       glWindow.setFullscreen(true);
        setContentView(getWindow(), glWindow);
-       
+
        final RedSquareES2 demo = new RedSquareES2(-1);
        // demo.enableAndroidTrace(true);
        glWindow.addGLEventListener(demo);
        glWindow.getScreen().addMonitorModeListener(new MonitorModeListener() {
            @Override
-           public void monitorModeChangeNotify(MonitorEvent me) { }
+           public void monitorModeChangeNotify(final MonitorEvent me) { }
            @Override
-           public void monitorModeChanged(MonitorEvent me, boolean success) {
+           public void monitorModeChanged(final MonitorEvent me, final boolean success) {
                System.err.println("MonitorMode Changed (success "+success+"): "+me);
            }
        });
-       Animator animator = new Animator(glWindow);
+       final Animator animator = new Animator(glWindow);
        // animator.setRunAsFastAsPossible(true);
        // glWindow.setSkipContextReleaseThread(animator.getThread());
        glWindow.setVisible(true);
-       
+
        animator.setUpdateFPSFrames(60, System.err);
        animator.resetFPSCounter();
        glWindow.resetFPSCounter();
-       
+
        Log.d(TAG, "onCreate - X");
    }
-   
+
    @Override
    public void onResume() {
        // android.os.Debug.startMethodTracing("GearsES2.trace");
-       // android.os.Debug.startAllocCounting();       
+       // android.os.Debug.startAllocCounting();
        super.onResume();
    }
-   
+
    @Override
    public void onPause() {
        // android.os.Debug.stopAllocCounting();
        // android.os.Debug.stopMethodTracing();
-       super.onPause();       
+       super.onPause();
    }
-   
+
 }
diff --git a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2ActivityLauncher.java b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2ActivityLauncher.java
index a631eab..40cb4bf 100644
--- a/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2ActivityLauncher.java
+++ b/src/test/com/jogamp/opengl/test/android/NEWTRedSquareES2ActivityLauncher.java
@@ -8,14 +8,14 @@ import android.util.Log;
 
 public class NEWTRedSquareES2ActivityLauncher extends Activity {
        @Override
-       public void onCreate(Bundle savedInstanceState) {
+       public void onCreate(final Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
-           
+
            final Uri uri = Uri.parse("launch://jogamp.org/com.jogamp.opengl.test.android.NEWTRedSquareES2Activity?sys=com.jogamp.common&sys=javax.media.opengl&pkg=com.jogamp.opengl.test");
-           final Intent intent = new Intent("org.jogamp.launcher.action.LAUNCH_ACTIVITY_NORMAL", uri);           
+           final Intent intent = new Intent("org.jogamp.launcher.action.LAUNCH_ACTIVITY_NORMAL", uri);
            Log.d(getClass().getSimpleName(), "Launching Activity: "+intent);
            startActivity (intent);
-           
+
            finish(); // done
-       }        
+       }
 }
diff --git a/src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java b/src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java
index 66889e9..9136b4e 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Bug427GLJPanelTest1.java
@@ -1,9 +1,12 @@
 package com.jogamp.opengl.test.bugs;
 
 import javax.swing.*;
+
 import java.awt.*;
+
 import javax.media.opengl.*;
 import javax.media.opengl.awt.*;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 public class Bug427GLJPanelTest1 extends JFrame implements GLEventListener {
 
@@ -20,35 +23,35 @@ public class Bug427GLJPanelTest1 extends JFrame implements GLEventListener {
                     setLocation(40, 40);
                     setVisible(true);
                 } } );
-        } catch(Exception ex) {
+        } catch(final Exception ex) {
             throw new RuntimeException(ex);
         }
 
-        GLProfile glp = GLProfile.get(GLProfile.GL2);
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLProfile glp = GLProfile.get(GLProfile.GL2);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setDoubleBuffered(true);
         caps.setHardwareAccelerated(true);
 
-        GLJPanel panel = new GLJPanel(caps);
+        final GLJPanel panel = new GLJPanel(caps);
         panel.addGLEventListener(this);
 
         add(panel, BorderLayout.CENTER);
     }
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         final Bug427GLJPanelTest1 demo = new Bug427GLJPanelTest1();
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     demo.setVisible(true);
                 } } );
-        } catch(Exception ex) {
+        } catch(final Exception ex) {
             throw new RuntimeException(ex);
         }
     }
 
-    public void display(GLAutoDrawable drawable) {
-        GL2 gl = drawable.getGL().getGL2();
+    public void display(final GLAutoDrawable drawable) {
+        final GL2 gl = drawable.getGL().getGL2();
 
         gl.glClear(GL.GL_COLOR_BUFFER_BIT);
         gl.glBegin(GL.GL_TRIANGLES);
@@ -66,21 +69,21 @@ public class Bug427GLJPanelTest1 extends JFrame implements GLEventListener {
         gl.glFlush();
     }
 
-    public void init(GLAutoDrawable drawable) {
-        GL2 gl = drawable.getGL().getGL2();
+    public void init(final GLAutoDrawable drawable) {
+        final GL2 gl = drawable.getGL().getGL2();
 
         gl.glClearColor(0, 0, 0, 0);
-        gl.glMatrixMode(GL2.GL_PROJECTION);
+        gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         gl.glLoadIdentity();
         gl.glOrtho(0, 1, 0, 1, -1, 1);
     }
 
-    public void reshape(GLAutoDrawable glDrawable, int x, int y, int w, int h) {
+    public void reshape(final GLAutoDrawable glDrawable, final int x, final int y, final int w, final int h) {
     }
 
-    public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
+    public void displayChanged(final GLAutoDrawable drawable, final boolean modeChanged, final boolean deviceChanged) {
     }
-    
-    public void dispose(GLAutoDrawable drawable) {
+
+    public void dispose(final GLAutoDrawable drawable) {
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv0AppletAWT.java b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv0AppletAWT.java
index f443459..c463ede 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv0AppletAWT.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv0AppletAWT.java
@@ -47,17 +47,17 @@ import com.jogamp.opengl.util.glsl.ShaderState;
  */
 @SuppressWarnings("serial")
 public class Bug735Inv0AppletAWT extends Applet implements Runnable {
-  static public int AWT  = 0;
-  static public int NEWT = 1;
-  
-  static public int APPLET_WIDTH  = 500;
-  static public int APPLET_HEIGHT = 290;
-  static public int TARGET_FPS    = 120;
-  static public int TOOLKIT       = NEWT;
-  static public boolean MANUAL_FRAME_HANDLING = true;
-  
+  static public final int AWT  = 0;
+  static public final int NEWT = 1;
+
+  static public final int APPLET_WIDTH  = 500;
+  static public final int APPLET_HEIGHT = 290;
+  static public final int TARGET_FPS    = 120;
+  static public final int TOOLKIT       = NEWT;
+  static public final boolean MANUAL_FRAME_HANDLING = true;
+
   //////////////////////////////////////////////////////////////////////////////
-  
+
   static private Frame frame;
   static private Bug735Inv0AppletAWT applet;
   private GLCanvas awtCanvas;
@@ -66,52 +66,52 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
   private DrawRunnable drawRunnable;
   private GLContext context;
   private GLU glu;
-  
+
   private int width;
   private int height;
   private Thread thread;
-  
+
   private boolean doneInit = false;
   private boolean doneSetup = false;
-  
-  private long frameRatePeriod = 1000000000L / TARGET_FPS;
+
+  private final long frameRatePeriod = 1000000000L / TARGET_FPS;
   private long millisOffset;
   private int frameCount;
   private float frameRate;
-  
+
   private ShaderCode vertShader;
   private ShaderCode fragShader;
   private ShaderProgram shaderProg;
   private ShaderState shaderState;
   private GLUniformData resolution;
-  private GLUniformData time;  
-  private GLArrayDataServer vertices;   
-  
-  private int fcount = 0, lastm = 0;  
-  private int fint = 1; 
-    
+  private GLUniformData time;
+  private GLArrayDataServer vertices;
+
+  private int fcount = 0, lastm = 0;
+  private final int fint = 1;
+
   public void init() {
     setSize(APPLET_WIDTH, APPLET_HEIGHT);
     setPreferredSize(new Dimension(APPLET_WIDTH, APPLET_HEIGHT));
     width = APPLET_WIDTH;
     height = APPLET_HEIGHT;
   }
-  
+
   public void start() {
     thread = new Thread(this, "Animation Thread");
-    thread.start();    
+    thread.start();
   }
-  
-  public void run() {    
+
+  public void run() {
     int noDelays = 0;
     // Number of frames with a delay of 0 ms before the
     // animation thread yields to other running threads.
     final int NO_DELAYS_PER_YIELD = 15;
     final int TIMEOUT_SECONDS = 2;
-    
+
     long beforeTime = System.nanoTime();
     long overSleepTime = 0L;
-    
+
     millisOffset = System.currentTimeMillis();
     frameCount = 1;
     while (Thread.currentThread() == thread) {
@@ -119,26 +119,26 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
       requestDraw(latch);
       try {
         latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS);
-      } catch (InterruptedException e) {
+      } catch (final InterruptedException e) {
         e.printStackTrace();
       }
-      
+
       if (frameCount == 1) {
         EventQueue.invokeLater(new Runnable() {
           public void run() {
             requestFocusInWindow();
           }
         });
-      }      
-      
-      long afterTime = System.nanoTime();
-      long timeDiff = afterTime - beforeTime;
-      long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;      
+      }
+
+      final long afterTime = System.nanoTime();
+      final long timeDiff = afterTime - beforeTime;
+      final long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;
       if (sleepTime > 0) {  // some time left in this cycle
         try {
           Thread.sleep(sleepTime / 1000000L, (int) (sleepTime % 1000000L));
           noDelays = 0;  // Got some sleep, not delaying anymore
-        } catch (InterruptedException ex) { }
+        } catch (final InterruptedException ex) { }
         overSleepTime = (System.nanoTime() - afterTime) - sleepTime;
       } else {    // sleepTime <= 0; the frame took longer than the period
         overSleepTime = 0L;
@@ -147,54 +147,54 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
           Thread.yield();   // give another thread a chance to run
           noDelays = 0;
         }
-      }      
+      }
       beforeTime = System.nanoTime();
     }
   }
-  
-  public void requestDraw(CountDownLatch latch) {
+
+  public void requestDraw(final CountDownLatch latch) {
     if (!doneInit) {
       initDraw();
     }
-    
-    if (TOOLKIT == AWT) {      
-      awtCanvas.invoke(true, drawRunnable);      
-    } else if (TOOLKIT == NEWT) {     
-      newtWindow.invoke(true, drawRunnable);      
+
+    if (TOOLKIT == AWT) {
+      awtCanvas.invoke(true, drawRunnable);
+    } else if (TOOLKIT == NEWT) {
+      newtWindow.invoke(true, drawRunnable);
     }
-    
+
     if (latch != null) {
       latch.countDown();
-    }    
+    }
   }
-  
+
   private class DrawRunnable implements GLRunnable {
     private boolean notCurrent;
-    
+
     @Override
-    public boolean run(GLAutoDrawable drawable) {
+    public boolean run(final GLAutoDrawable drawable) {
       if (MANUAL_FRAME_HANDLING) {
-        makeContextCurrent();     
+        makeContextCurrent();
       }
-      
+
       if (doneSetup) {
         draw(drawable.getGL().getGL2ES2());
       } else {
         setup(drawable.getGL().getGL2ES2());
-      }      
+      }
       checkGLErrors(drawable.getGL());
-      
+
       if (MANUAL_FRAME_HANDLING) {
         swapBuffers();
         releaseCurrentContext();
       }
-      
+
       return true;
     }
-    
+
     private void makeContextCurrent() {
-      int MAX_CONTEXT_GRAB_ATTEMPTS = 10;
-          
+      final int MAX_CONTEXT_GRAB_ATTEMPTS = 10;
+
       if (context.isCurrent()) {
         notCurrent = false;
       } else {
@@ -218,17 +218,17 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
           } catch (final InterruptedException e) {
             e.printStackTrace();
           }
-          
+
         } while (value == GLContext.CONTEXT_NOT_CURRENT);
-      }   
+      }
     }
-    
+
     private void swapBuffers() {
       final GL gl = GLContext.getCurrentGL();
       gl.glFlush();
-      GLContext.getCurrent().getGLDrawable().swapBuffers();      
+      GLContext.getCurrent().getGLDrawable().swapBuffers();
     }
-    
+
     private void releaseCurrentContext() {
       if (notCurrent) {
         try {
@@ -237,31 +237,31 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
         } catch (final GLException gle) {
           gle.printStackTrace();
         }
-      }      
+      }
     }
   }
-  
+
   private void initGL() {
-    GLProfile profile = GLProfile.getDefault();
-    GLCapabilities caps = new GLCapabilities(profile);
+    final GLProfile profile = GLProfile.getDefault();
+    final GLCapabilities caps = new GLCapabilities(profile);
     caps.setBackgroundOpaque(true);
     caps.setOnscreen(true);
     caps.setSampleBuffers(false);
-    
+
     if (TOOLKIT == AWT) {
       awtCanvas = new GLCanvas(caps);
       awtCanvas.setBounds(0, 0, applet.width, applet.height);
       awtCanvas.setBackground(new Color(0xFFCCCCCC, true));
-      awtCanvas.setFocusable(true); 
-      
+      awtCanvas.setFocusable(true);
+
       applet.setLayout(new BorderLayout());
       applet.add(awtCanvas, BorderLayout.CENTER);
-      
+
       if (MANUAL_FRAME_HANDLING) {
         awtCanvas.setIgnoreRepaint(true);
-        awtCanvas.setAutoSwapBufferMode(false);        
+        awtCanvas.setAutoSwapBufferMode(false);
       }
-    } else if (TOOLKIT == NEWT) {      
+    } else if (TOOLKIT == NEWT) {
       newtWindow = GLWindow.create(caps);
       newtCanvas = new NewtCanvasAWT(newtWindow);
       newtCanvas.setBounds(0, 0, applet.width, applet.height);
@@ -270,14 +270,14 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
 
       applet.setLayout(new BorderLayout());
       applet.add(newtCanvas, BorderLayout.CENTER);
-      
+
       if (MANUAL_FRAME_HANDLING) {
         newtCanvas.setIgnoreRepaint(true);
-        newtWindow.setAutoSwapBufferMode(false);        
+        newtWindow.setAutoSwapBufferMode(false);
       }
     }
   }
-  
+
   private void initDraw() {
     if (TOOLKIT == AWT) {
       awtCanvas.setVisible(true);
@@ -287,7 +287,7 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
         // Request the focus here as it cannot work when the window is not visible
         awtCanvas.requestFocus();
         context = awtCanvas.getContext();
-      }      
+      }
     } else if (TOOLKIT == NEWT) {
       newtCanvas.setVisible(true);
       // Force the realization
@@ -298,37 +298,37 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
         context = newtWindow.getContext();
       }
     }
-    
+
     drawRunnable = new DrawRunnable();
-    
+
     doneInit = true;
   }
-  
-  private void setup(GL2ES2 gl) {
+
+  private void setup(final GL2ES2 gl) {
     if (60 < TARGET_FPS) {
       // Disables vsync
-      gl.setSwapInterval(0);  
+      gl.setSwapInterval(0);
     }
     glu = new GLU();
-    
+
     vertShader = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, LandscapeES2.class, "shader", "shader/bin", "landscape", true);
     fragShader = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, LandscapeES2.class, "shader", "shader/bin", "landscape", true);
     vertShader.defaultShaderCustomization(gl, true, true);
     fragShader.defaultShaderCustomization(gl, true, true);
     shaderProg = new ShaderProgram();
     shaderProg.add(gl, vertShader, System.err);
-    shaderProg.add(gl, fragShader, System.err); 
-    
+    shaderProg.add(gl, fragShader, System.err);
+
     shaderState = new ShaderState();
     shaderState.attachShaderProgram(gl, shaderProg, true);
-    
+
     resolution = new GLUniformData("iResolution", 3, FloatBuffer.wrap(new float[] {width, height, 0}));
     shaderState.ownUniform(resolution);
-    shaderState.uniform(gl, resolution);    
-    
+    shaderState.uniform(gl, resolution);
+
     time = new GLUniformData("iGlobalTime", 0.0f);
     shaderState.ownUniform(time);
-        
+
     vertices = GLArrayDataServer.createGLSL("inVertex", 2, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
     vertices.putf(-1.0f); vertices.putf(-1.0f);
     vertices.putf(+1.0f); vertices.putf(-1.0f);
@@ -337,94 +337,94 @@ public class Bug735Inv0AppletAWT extends Applet implements Runnable {
     vertices.seal(gl, true);
     shaderState.ownAttribute(vertices, true);
     shaderState.useProgram(gl, false);
-    
+
     doneSetup = true;
   }
 
-  private void draw(GL2ES2 gl) {
+  private void draw(final GL2ES2 gl) {
     // gl.glClearColor(0.5f, 0.1f, 0.1f, 1);
     // gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT);
-    
-    shaderState.useProgram(gl, true);    
-    
+
+    shaderState.useProgram(gl, true);
+
     time.setData((System.currentTimeMillis() - millisOffset) / 1000.0f);
     shaderState.uniform(gl, time);
     vertices.enableBuffer(gl, true);
-    gl.glDrawArrays(GL2ES2.GL_TRIANGLE_STRIP, 0, 4);
+    gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
     vertices.enableBuffer(gl, false);
-    
+
     shaderState.useProgram(gl, false);
-    
+
     // Compute current framerate and printout.
-    frameCount++;      
+    frameCount++;
     fcount += 1;
-    int m = (int) (System.currentTimeMillis() - millisOffset);
+    final int m = (int) (System.currentTimeMillis() - millisOffset);
     if (m - lastm > 1000 * fint) {
       frameRate = (float)(fcount) / fint;
       fcount = 0;
       lastm = m;
-    }         
+    }
     if (frameCount % TARGET_FPS == 0) {
-      System.out.println("FrameCount: " + frameCount + " - " + 
+      System.out.println("FrameCount: " + frameCount + " - " +
                          "FrameRate: " + frameRate);
-    }    
-  }  
-    
-  private void checkGLErrors(GL gl) {
-    int err = gl.glGetError();
+    }
+  }
+
+  private void checkGLErrors(final GL gl) {
+    final int err = gl.glGetError();
     if (err != 0) {
-      String errString = glu.gluErrorString(err);
+      final String errString = glu.gluErrorString(err);
       System.out.println(errString);
-    }    
+    }
   }
-  
-  static public void main(String[] args) {    
-    GraphicsEnvironment environment = 
+
+  static public void main(final String[] args) {
+    final GraphicsEnvironment environment =
         GraphicsEnvironment.getLocalGraphicsEnvironment();
-    GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
+    final GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
 
     frame = new Frame(displayDevice.getDefaultConfiguration());
     frame.setBackground(new Color(0xCC, 0xCC, 0xCC));
     frame.setTitle("TestBug735Inv0AppletAWT");
-    
+
     try {
-      Class<?> c = Thread.currentThread().getContextClassLoader().
+      final Class<?> c = Thread.currentThread().getContextClassLoader().
           loadClass(Bug735Inv0AppletAWT.class.getName());
       applet = (Bug735Inv0AppletAWT) c.newInstance();
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw new RuntimeException(e);
-    }    
-    
+    }
+
     frame.setLayout(null);
     frame.add(applet);
     frame.pack();
     frame.setResizable(false);
-    
+
     applet.init();
-    
-    Insets insets = frame.getInsets();
-    int windowW = applet.width + insets.left + insets.right;
-    int windowH = applet.height + insets.top + insets.bottom;
-    frame.setSize(windowW, windowH);    
-    
-    Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();    
+
+    final Insets insets = frame.getInsets();
+    final int windowW = applet.width + insets.left + insets.right;
+    final int windowH = applet.height + insets.top + insets.bottom;
+    frame.setSize(windowW, windowH);
+
+    final Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();
     frame.setLocation(screenRect.x + (screenRect.width - applet.width) / 2,
-        screenRect.y + (screenRect.height - applet.height) / 2);    
-    
-    int usableWindowH = windowH - insets.top - insets.bottom;
+        screenRect.y + (screenRect.height - applet.height) / 2);
+
+    final int usableWindowH = windowH - insets.top - insets.bottom;
     applet.setBounds((windowW - applet.width)/2,
                      insets.top + (usableWindowH - applet.height)/2,
                      applet.width, applet.height);
-    
+
     // This allows to close the frame.
     frame.addWindowListener(new WindowAdapter() {
-      public void windowClosing(WindowEvent e) {
+      public void windowClosing(final WindowEvent e) {
         System.exit(0);
       }
     });
-        
+
     applet.initGL();
     frame.setVisible(true);
-    applet.start();    
+    applet.start();
   }
 }
diff --git a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv1AppletAWT.java b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv1AppletAWT.java
index e8cef5e..580f3ca 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv1AppletAWT.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv1AppletAWT.java
@@ -49,17 +49,17 @@ import com.jogamp.opengl.util.glsl.ShaderState;
  */
 @SuppressWarnings("serial")
 public class Bug735Inv1AppletAWT extends Applet implements Runnable {
-  static public int AWT  = 0;
-  static public int NEWT = 1;
-  
-  static public int APPLET_WIDTH  = 500;
-  static public int APPLET_HEIGHT = 290;
-  static public int TARGET_FPS    = 120;
-  static public int TOOLKIT       = NEWT;
-  static public boolean MANUAL_FRAME_HANDLING = true;
-  
+  static public final int AWT  = 0;
+  static public final int NEWT = 1;
+
+  static public final int APPLET_WIDTH  = 500;
+  static public final int APPLET_HEIGHT = 290;
+  static public final int TARGET_FPS    = 120;
+  static public final int TOOLKIT       = NEWT;
+  static public final boolean MANUAL_FRAME_HANDLING = true;
+
   //////////////////////////////////////////////////////////////////////////////
-  
+
   static private Frame frame;
   static private Bug735Inv1AppletAWT applet;
   private GLCanvas awtCanvas;
@@ -68,52 +68,52 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
   private DrawRunnable drawRunnable;
   // JAU private GLContext context;
   private GLU glu;
-  
+
   private int width;
   private int height;
   private Thread thread;
-  
+
   private boolean doneInit = false;
   private boolean doneSetup = false;
-  
-  private long frameRatePeriod = 1000000000L / TARGET_FPS;
+
+  private final long frameRatePeriod = 1000000000L / TARGET_FPS;
   private long millisOffset;
   private int frameCount;
   private float frameRate;
-  
+
   private ShaderCode vertShader;
   private ShaderCode fragShader;
   private ShaderProgram shaderProg;
   private ShaderState shaderState;
   private GLUniformData resolution;
-  private GLUniformData time;  
-  private GLArrayDataServer vertices;   
-  
-  private int fcount = 0, lastm = 0;  
-  private int fint = 1; 
-    
+  private GLUniformData time;
+  private GLArrayDataServer vertices;
+
+  private int fcount = 0, lastm = 0;
+  private final int fint = 1;
+
   public void init() {
     setSize(APPLET_WIDTH, APPLET_HEIGHT);
     setPreferredSize(new Dimension(APPLET_WIDTH, APPLET_HEIGHT));
     width = APPLET_WIDTH;
     height = APPLET_HEIGHT;
   }
-  
+
   public void start() {
     thread = new Thread(this, "Animation Thread");
-    thread.start();    
+    thread.start();
   }
-  
-  public void run() {    
+
+  public void run() {
     int noDelays = 0;
     // Number of frames with a delay of 0 ms before the
     // animation thread yields to other running threads.
     final int NO_DELAYS_PER_YIELD = 15;
     final int TIMEOUT_SECONDS = 2;
-    
+
     long beforeTime = System.nanoTime();
     long overSleepTime = 0L;
-    
+
     millisOffset = System.currentTimeMillis();
     frameCount = 1;
     while (Thread.currentThread() == thread) {
@@ -121,26 +121,26 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
       requestDraw(latch);
       try {
         latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS);
-      } catch (InterruptedException e) {
+      } catch (final InterruptedException e) {
         e.printStackTrace();
       }
-      
+
       if (frameCount == 1) {
         EventQueue.invokeLater(new Runnable() {
           public void run() {
             requestFocusInWindow();
           }
         });
-      }      
-      
-      long afterTime = System.nanoTime();
-      long timeDiff = afterTime - beforeTime;
-      long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;      
+      }
+
+      final long afterTime = System.nanoTime();
+      final long timeDiff = afterTime - beforeTime;
+      final long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;
       if (sleepTime > 0) {  // some time left in this cycle
         try {
           Thread.sleep(sleepTime / 1000000L, (int) (sleepTime % 1000000L));
           noDelays = 0;  // Got some sleep, not delaying anymore
-        } catch (InterruptedException ex) { }
+        } catch (final InterruptedException ex) { }
         overSleepTime = (System.nanoTime() - afterTime) - sleepTime;
       } else {    // sleepTime <= 0; the frame took longer than the period
         overSleepTime = 0L;
@@ -149,53 +149,53 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
           Thread.yield();   // give another thread a chance to run
           noDelays = 0;
         }
-      }      
+      }
       beforeTime = System.nanoTime();
     }
   }
-  
-  public void requestDraw(CountDownLatch latch) {
+
+  public void requestDraw(final CountDownLatch latch) {
     if (!doneInit) {
       initDraw();
     }
-    
-    if (TOOLKIT == AWT) {      
-      awtCanvas.invoke(true, drawRunnable);      
-    } else if (TOOLKIT == NEWT) {     
-      newtWindow.invoke(true, drawRunnable);      
+
+    if (TOOLKIT == AWT) {
+      awtCanvas.invoke(true, drawRunnable);
+    } else if (TOOLKIT == NEWT) {
+      newtWindow.invoke(true, drawRunnable);
     }
-    
+
     if (latch != null) {
       latch.countDown();
-    }    
+    }
   }
-  
+
   private class DrawRunnable implements GLRunnable {
     private boolean notCurrent;
-    
+
     @Override
-    public boolean run(GLAutoDrawable drawable) {
+    public boolean run(final GLAutoDrawable drawable) {
       if (MANUAL_FRAME_HANDLING) {
-        makeContextCurrent(drawable.getContext());     
+        makeContextCurrent(drawable.getContext());
       }
-      
+
       if (!doneSetup) {
         setup(drawable.getGL().getGL2ES2());
       }
       draw(drawable.getGL().getGL2ES2());
       checkGLErrors(drawable.getGL());
-      
+
       if (MANUAL_FRAME_HANDLING) {
         swapBuffers(drawable.getContext());
         releaseCurrentContext(drawable.getContext());
       }
-      
+
       return true;
     }
-    
-    private void makeContextCurrent(GLContext context) {
-      int MAX_CONTEXT_GRAB_ATTEMPTS = 10;
-          
+
+    private void makeContextCurrent(final GLContext context) {
+      final int MAX_CONTEXT_GRAB_ATTEMPTS = 10;
+
       if (context.isCurrent()) {
         notCurrent = false;
       } else {
@@ -219,18 +219,18 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
           } catch (final InterruptedException e) {
             e.printStackTrace();
           }
-          
+
         } while (value == GLContext.CONTEXT_NOT_CURRENT);
-      }   
+      }
     }
-    
-    private void swapBuffers(GLContext context) {
+
+    private void swapBuffers(final GLContext context) {
       final GL gl = context.getGL();
       gl.glFlush();
-      context.getGLDrawable().swapBuffers();      
+      context.getGLDrawable().swapBuffers();
     }
-    
-    private void releaseCurrentContext(GLContext context) {
+
+    private void releaseCurrentContext(final GLContext context) {
       if (notCurrent) {
         try {
           context.release();
@@ -238,31 +238,31 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
         } catch (final GLException gle) {
           gle.printStackTrace();
         }
-      }      
+      }
     }
   }
-  
+
   private void initGL() {
-    GLProfile profile = GLProfile.getDefault();
-    GLCapabilities caps = new GLCapabilities(profile);
+    final GLProfile profile = GLProfile.getDefault();
+    final GLCapabilities caps = new GLCapabilities(profile);
     caps.setBackgroundOpaque(true);
     caps.setOnscreen(true);
     caps.setSampleBuffers(false);
-    
+
     if (TOOLKIT == AWT) {
       awtCanvas = new GLCanvas(caps);
       awtCanvas.setBounds(0, 0, applet.width, applet.height);
       awtCanvas.setBackground(new Color(0xFFCCCCCC, true));
-      awtCanvas.setFocusable(true); 
-      
+      awtCanvas.setFocusable(true);
+
       applet.setLayout(new BorderLayout());
       applet.add(awtCanvas, BorderLayout.CENTER);
-      
+
       if (MANUAL_FRAME_HANDLING) {
         awtCanvas.setIgnoreRepaint(true);
-        awtCanvas.setAutoSwapBufferMode(false);        
+        awtCanvas.setAutoSwapBufferMode(false);
       }
-    } else if (TOOLKIT == NEWT) {      
+    } else if (TOOLKIT == NEWT) {
       newtWindow = GLWindow.create(caps);
       newtCanvas = new NewtCanvasAWT(newtWindow);
       newtCanvas.setBounds(0, 0, applet.width, applet.height);
@@ -271,14 +271,14 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
 
       applet.setLayout(new BorderLayout());
       applet.add(newtCanvas, BorderLayout.CENTER);
-      
+
       if (MANUAL_FRAME_HANDLING) {
         newtCanvas.setIgnoreRepaint(true);
-        newtWindow.setAutoSwapBufferMode(false);        
+        newtWindow.setAutoSwapBufferMode(false);
       }
     }
   }
-  
+
   private void initDraw() {
     if (TOOLKIT == AWT) {
       awtCanvas.setVisible(true);
@@ -287,7 +287,7 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
       if (awtCanvas.getDelegatedDrawable().isRealized()) {
         // Request the focus here as it cannot work when the window is not visible
         awtCanvas.requestFocus();
-      }      
+      }
     } else if (TOOLKIT == NEWT) {
       newtCanvas.setVisible(true);
       // Force the realization
@@ -297,37 +297,37 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
         newtCanvas.requestFocus();
       }
     }
-    
+
     drawRunnable = new DrawRunnable();
-    
+
     doneInit = true;
   }
-  
-  private void setup(GL2ES2 gl) {
+
+  private void setup(final GL2ES2 gl) {
     if (60 < TARGET_FPS) {
       // Disables vsync
-      gl.setSwapInterval(0);  
-    }    
+      gl.setSwapInterval(0);
+    }
     glu = new GLU();
-    
+
     vertShader = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, LandscapeES2.class, "shader", "shader/bin", "landscape", true);
     fragShader = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, LandscapeES2.class, "shader", "shader/bin", "landscape", true);
     vertShader.defaultShaderCustomization(gl, true, true);
     fragShader.defaultShaderCustomization(gl, true, true);
     shaderProg = new ShaderProgram();
     shaderProg.add(gl, vertShader, System.err);
-    shaderProg.add(gl, fragShader, System.err); 
-    
+    shaderProg.add(gl, fragShader, System.err);
+
     shaderState = new ShaderState();
     shaderState.attachShaderProgram(gl, shaderProg, true);
-    
+
     resolution = new GLUniformData("iResolution", 3, FloatBuffer.wrap(new float[] {width, height, 0}));
     shaderState.ownUniform(resolution);
-    shaderState.uniform(gl, resolution);    
-    
+    shaderState.uniform(gl, resolution);
+
     time = new GLUniformData("iGlobalTime", 0.0f);
     shaderState.ownUniform(time);
-        
+
     vertices = GLArrayDataServer.createGLSL("inVertex", 2, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
     vertices.putf(-1.0f); vertices.putf(-1.0f);
     vertices.putf(+1.0f); vertices.putf(-1.0f);
@@ -336,94 +336,94 @@ public class Bug735Inv1AppletAWT extends Applet implements Runnable {
     vertices.seal(gl, true);
     shaderState.ownAttribute(vertices, true);
     shaderState.useProgram(gl, false);
-    
+
     doneSetup = true;
   }
 
-  private void draw(GL2ES2 gl) {      
+  private void draw(final GL2ES2 gl) {
     // gl.glClearColor(0.5f, 0.1f, 0.1f, 1);
     // gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT);
-    
-    shaderState.useProgram(gl, true);    
-    
+
+    shaderState.useProgram(gl, true);
+
     time.setData((System.currentTimeMillis() - millisOffset) / 1000.0f);
     shaderState.uniform(gl, time);
     vertices.enableBuffer(gl, true);
-    gl.glDrawArrays(GL2ES2.GL_TRIANGLE_STRIP, 0, 4);
+    gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
     vertices.enableBuffer(gl, false);
-    
+
     shaderState.useProgram(gl, false);
-    
+
     // Compute current framerate and printout.
-    frameCount++;      
+    frameCount++;
     fcount += 1;
-    int m = (int) (System.currentTimeMillis() - millisOffset);
+    final int m = (int) (System.currentTimeMillis() - millisOffset);
     if (m - lastm > 1000 * fint) {
       frameRate = (float)(fcount) / fint;
       fcount = 0;
       lastm = m;
-    }         
+    }
     if (frameCount % TARGET_FPS == 0) {
-      System.out.println("FrameCount: " + frameCount + " - " + 
+      System.out.println("FrameCount: " + frameCount + " - " +
                          "FrameRate: " + frameRate);
     }
-  }  
-    
-  private void checkGLErrors(GL gl) {
-    int err = gl.glGetError();
+  }
+
+  private void checkGLErrors(final GL gl) {
+    final int err = gl.glGetError();
     if (err != 0) {
-      String errString = glu.gluErrorString(err);
+      final String errString = glu.gluErrorString(err);
       System.out.println(errString);
-    }    
+    }
   }
-  
-  static public void main(String[] args) {    
-    GraphicsEnvironment environment = 
+
+  static public void main(final String[] args) {
+    final GraphicsEnvironment environment =
         GraphicsEnvironment.getLocalGraphicsEnvironment();
-    GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
+    final GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
 
     frame = new Frame(displayDevice.getDefaultConfiguration());
     frame.setBackground(new Color(0xCC, 0xCC, 0xCC));
     frame.setTitle("TestBug735Inv1AppletAWT");
-    
+
     try {
-      Class<?> c = Thread.currentThread().getContextClassLoader().
+      final Class<?> c = Thread.currentThread().getContextClassLoader().
           loadClass(Bug735Inv1AppletAWT.class.getName());
       applet = (Bug735Inv1AppletAWT) c.newInstance();
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw new RuntimeException(e);
-    }    
-    
+    }
+
     frame.setLayout(null);
     frame.add(applet);
     frame.pack();
     frame.setResizable(false);
-    
+
     applet.init();
-    
-    Insets insets = frame.getInsets();
-    int windowW = applet.width + insets.left + insets.right;
-    int windowH = applet.height + insets.top + insets.bottom;
-    frame.setSize(windowW, windowH);    
-    
-    Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();    
+
+    final Insets insets = frame.getInsets();
+    final int windowW = applet.width + insets.left + insets.right;
+    final int windowH = applet.height + insets.top + insets.bottom;
+    frame.setSize(windowW, windowH);
+
+    final Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();
     frame.setLocation(screenRect.x + (screenRect.width - applet.width) / 2,
-        screenRect.y + (screenRect.height - applet.height) / 2);    
-    
-    int usableWindowH = windowH - insets.top - insets.bottom;
+        screenRect.y + (screenRect.height - applet.height) / 2);
+
+    final int usableWindowH = windowH - insets.top - insets.bottom;
     applet.setBounds((windowW - applet.width)/2,
                      insets.top + (usableWindowH - applet.height)/2,
                      applet.width, applet.height);
-    
+
     // This allows to close the frame.
     frame.addWindowListener(new WindowAdapter() {
-      public void windowClosing(WindowEvent e) {
+      public void windowClosing(final WindowEvent e) {
         System.exit(0);
       }
     });
-        
+
     applet.initGL();
     frame.setVisible(true);
-    applet.start();    
+    applet.start();
   }
 }
diff --git a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv2AppletAWT.java b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv2AppletAWT.java
index 6340d2b..1128c76 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv2AppletAWT.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv2AppletAWT.java
@@ -33,7 +33,7 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
  *   - Use GLEventListener
  *   - Add GLEventListener to GLAutoDrawable
  *   - Use GLAutoDrawable.display() instead of GLAutoDrawable.invoke(true, GLRunnable { init / render })
- *   - Removed MANUAL_FRAME_HANDLING, obsolete due to GLAutoDrawable/GLEventListener 
+ *   - Removed MANUAL_FRAME_HANDLING, obsolete due to GLAutoDrawable/GLEventListener
  * </pre>
  * OSX Results:
  * <pre>
@@ -43,20 +43,20 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
  */
 @SuppressWarnings("serial")
 public class Bug735Inv2AppletAWT extends Applet implements Runnable {
-  static public int AWT  = 0;
-  static public int NEWT = 1;
-  
-  static public int APPLET_WIDTH  = 500;
-  static public int APPLET_HEIGHT = 290;
-  static public int TARGET_FPS    = 120;
-  static public int TOOLKIT       = NEWT;
-  static public boolean IGNORE_AWT_REPAINT = false;
+  static public final int AWT  = 0;
+  static public final int NEWT = 1;
+
+  static public final int APPLET_WIDTH  = 500;
+  static public final int APPLET_HEIGHT = 290;
+  static public final int TARGET_FPS    = 120;
+  static public final int TOOLKIT       = NEWT;
+  static public final boolean IGNORE_AWT_REPAINT = false;
   static public boolean USE_ECT = false;
   static public int SWAP_INTERVAL = 1;
-  
+
   //////////////////////////////////////////////////////////////////////////////
-  
-  static boolean waitForKey = false;  
+
+  static boolean waitForKey = false;
   static private Frame frame;
   static private Bug735Inv2AppletAWT applet;
   private GLCanvas awtCanvas;
@@ -64,14 +64,14 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
   private GLAutoDrawable glad;
   private NewtCanvasAWT newtCanvas;
   private GLEventListener demo;
-  
+
   private int width;
   private int height;
   private Thread thread;
-  
-  private long frameRatePeriod = 1000000000L / TARGET_FPS;
+
+  private final long frameRatePeriod = 1000000000L / TARGET_FPS;
   private int frameCount;
-  
+
   public void init() {
     setSize(APPLET_WIDTH, APPLET_HEIGHT);
     setPreferredSize(new Dimension(APPLET_WIDTH, APPLET_HEIGHT));
@@ -79,23 +79,23 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
     height = APPLET_HEIGHT;
     initGL();
   }
-  
+
   public void start() {
     initDraw();
     thread = new Thread(this, "Animation Thread");
-    thread.start();    
+    thread.start();
   }
-  
-  public void run() {    
+
+  public void run() {
     int noDelays = 0;
     // Number of frames with a delay of 0 ms before the
     // animation thread yields to other running threads.
     final int NO_DELAYS_PER_YIELD = 15;
     final int TIMEOUT_SECONDS = 2;
-    
+
     long beforeTime = System.nanoTime();
     long overSleepTime = 0L;
-    
+
     frameCount = 1;
     while (Thread.currentThread() == thread) {
       if (frameCount == 1) {
@@ -107,23 +107,23 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
         if( USE_ECT ) {
             glad.setExclusiveContextThread(thread);
         }
-      }      
+      }
       final CountDownLatch latch = new CountDownLatch(1);
       requestDraw(latch);
       try {
         latch.await(TIMEOUT_SECONDS, TimeUnit.SECONDS);
-      } catch (InterruptedException e) {
+      } catch (final InterruptedException e) {
         e.printStackTrace();
       }
-            
-      long afterTime = System.nanoTime();
-      long timeDiff = afterTime - beforeTime;
-      long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;      
+
+      final long afterTime = System.nanoTime();
+      final long timeDiff = afterTime - beforeTime;
+      final long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;
       if (sleepTime > 0) {  // some time left in this cycle
         try {
           Thread.sleep(sleepTime / 1000000L, (int) (sleepTime % 1000000L));
           noDelays = 0;  // Got some sleep, not delaying anymore
-        } catch (InterruptedException ex) { }
+        } catch (final InterruptedException ex) { }
         overSleepTime = (System.nanoTime() - afterTime) - sleepTime;
       } else {    // sleepTime <= 0; the frame took longer than the period
         overSleepTime = 0L;
@@ -132,40 +132,40 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
           Thread.yield();   // give another thread a chance to run
           noDelays = 0;
         }
-      }      
+      }
       beforeTime = System.nanoTime();
     }
   }
-  
-  public void requestDraw(CountDownLatch latch) {
+
+  public void requestDraw(final CountDownLatch latch) {
     glad.display();
 
     if (latch != null) {
       latch.countDown();
-    }    
+    }
   }
-  
+
   private void initGL() {
-    GLProfile profile = GLProfile.getDefault();
-    GLCapabilities caps = new GLCapabilities(profile);
+    final GLProfile profile = GLProfile.getDefault();
+    final GLCapabilities caps = new GLCapabilities(profile);
     caps.setBackgroundOpaque(true);
     caps.setOnscreen(true);
     caps.setSampleBuffers(false);
-    
+
     if (TOOLKIT == AWT) {
       awtCanvas = new GLCanvas(caps);
       awtCanvas.setBounds(0, 0, applet.width, applet.height);
       awtCanvas.setBackground(new Color(0xFFCCCCCC, true));
-      awtCanvas.setFocusable(true); 
-      
+      awtCanvas.setFocusable(true);
+
       applet.setLayout(new BorderLayout());
       applet.add(awtCanvas, BorderLayout.CENTER);
-      
+
       if (IGNORE_AWT_REPAINT) {
           awtCanvas.setIgnoreRepaint(true);
       }
       glad = awtCanvas;
-    } else if (TOOLKIT == NEWT) {      
+    } else if (TOOLKIT == NEWT) {
       newtWindow = GLWindow.create(caps);
       newtCanvas = new NewtCanvasAWT(newtWindow);
       newtCanvas.setBounds(0, 0, applet.width, applet.height);
@@ -174,17 +174,17 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
 
       applet.setLayout(new BorderLayout());
       applet.add(newtCanvas, BorderLayout.CENTER);
-      
+
       if (IGNORE_AWT_REPAINT) {
         newtCanvas.setIgnoreRepaint(true);
       }
       glad = newtWindow;
     }
-    
+
     demo = new LandscapeES2(SWAP_INTERVAL);
     glad.addGLEventListener(demo);
   }
-  
+
   private void initDraw() {
     if (TOOLKIT == AWT) {
       awtCanvas.setVisible(true);
@@ -193,7 +193,7 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
       if (awtCanvas.getDelegatedDrawable().isRealized()) {
         // Request the focus here as it cannot work when the window is not visible
         awtCanvas.requestFocus();
-      }      
+      }
     } else if (TOOLKIT == NEWT) {
       newtCanvas.setVisible(true);
       // Force the realization
@@ -204,8 +204,8 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
       }
     }
   }
-  
-  static public void main(String[] args) {    
+
+  static public void main(final String[] args) {
     for(int i=0; i<args.length; i++) {
         if(args[i].equals("-vsync")) {
             i++;
@@ -217,56 +217,56 @@ public class Bug735Inv2AppletAWT extends Applet implements Runnable {
         }
     }
     System.err.println("swapInterval "+SWAP_INTERVAL);
-    System.err.println("exclusiveContext "+USE_ECT);    
+    System.err.println("exclusiveContext "+USE_ECT);
     if(waitForKey) {
         UITestCase.waitForKey("Start");
     }
-    
-    GraphicsEnvironment environment = 
+
+    final GraphicsEnvironment environment =
         GraphicsEnvironment.getLocalGraphicsEnvironment();
-    GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
+    final GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
 
     frame = new Frame(displayDevice.getDefaultConfiguration());
     frame.setBackground(new Color(0xCC, 0xCC, 0xCC));
     frame.setTitle("TestBug735Inv2AppletAWT");
-    
+
     try {
-      Class<?> c = Thread.currentThread().getContextClassLoader().
+      final Class<?> c = Thread.currentThread().getContextClassLoader().
           loadClass(Bug735Inv2AppletAWT.class.getName());
       applet = (Bug735Inv2AppletAWT) c.newInstance();
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw new RuntimeException(e);
-    }    
-    
+    }
+
     frame.setLayout(null);
     frame.add(applet);
     frame.pack();
     frame.setResizable(false);
-    
+
     applet.init();
-    
-    Insets insets = frame.getInsets();
-    int windowW = applet.width + insets.left + insets.right;
-    int windowH = applet.height + insets.top + insets.bottom;
-    frame.setSize(windowW, windowH);    
-    
-    Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();    
+
+    final Insets insets = frame.getInsets();
+    final int windowW = applet.width + insets.left + insets.right;
+    final int windowH = applet.height + insets.top + insets.bottom;
+    frame.setSize(windowW, windowH);
+
+    final Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();
     frame.setLocation(screenRect.x + (screenRect.width - applet.width) / 2,
-        screenRect.y + (screenRect.height - applet.height) / 2);    
-    
-    int usableWindowH = windowH - insets.top - insets.bottom;
+        screenRect.y + (screenRect.height - applet.height) / 2);
+
+    final int usableWindowH = windowH - insets.top - insets.bottom;
     applet.setBounds((windowW - applet.width)/2,
                      insets.top + (usableWindowH - applet.height)/2,
                      applet.width, applet.height);
-    
+
     // This allows to close the frame.
     frame.addWindowListener(new WindowAdapter() {
-      public void windowClosing(WindowEvent e) {
+      public void windowClosing(final WindowEvent e) {
         System.exit(0);
       }
     });
-        
+
     frame.setVisible(true);
-    applet.start();    
+    applet.start();
   }
 }
diff --git a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv3AppletAWT.java b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv3AppletAWT.java
index 0a4c540..83db15c 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv3AppletAWT.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv3AppletAWT.java
@@ -32,7 +32,7 @@ import com.jogamp.opengl.util.AnimatorBase;
  *   - Use GLEventListener
  *   - Add GLEventListener to GLAutoDrawable
  *   - Use GLAutoDrawable.display() instead of GLAutoDrawable.invoke(true, GLRunnable { init / render })
- *   - Removed MANUAL_FRAME_HANDLING, obsolete due to GLAutoDrawable/GLEventListener 
+ *   - Removed MANUAL_FRAME_HANDLING, obsolete due to GLAutoDrawable/GLEventListener
  *   - Use Animator
  *   - Remove applet, component sizes, use frame based size via validate
  *   - Run frame validation/visibility on AWT-EDT
@@ -46,19 +46,19 @@ import com.jogamp.opengl.util.AnimatorBase;
  */
 @SuppressWarnings("serial")
 public class Bug735Inv3AppletAWT extends Applet {
-  static public int AWT  = 0;
-  static public int NEWT = 1;
-  
-  static public int APPLET_WIDTH  = 500;
-  static public int APPLET_HEIGHT = 290;
-  static public int TOOLKIT       = NEWT;
-  static public boolean IGNORE_AWT_REPAINT = false;
+  static public final int AWT  = 0;
+  static public final int NEWT = 1;
+
+  static public final int APPLET_WIDTH  = 500;
+  static public final int APPLET_HEIGHT = 290;
+  static public final int TOOLKIT       = NEWT;
+  static public final boolean IGNORE_AWT_REPAINT = false;
   static public boolean USE_ECT = false;
   static public int SWAP_INTERVAL = 1;
-  
+
   //////////////////////////////////////////////////////////////////////////////
-  
-  static boolean waitForKey = false;  
+
+  static boolean waitForKey = false;
   static private Frame frame;
   static private Bug735Inv3AppletAWT applet;
   private GLCanvas awtCanvas;
@@ -67,10 +67,10 @@ public class Bug735Inv3AppletAWT extends Applet {
   private NewtCanvasAWT newtCanvas;
   private GLEventListener demo;
   private AnimatorBase animator;
-  
+
   private int width;
   private int height;
-  
+
   public void init() {
     setSize(APPLET_WIDTH, APPLET_HEIGHT);
     // JAU setPreferredSize(new Dimension(APPLET_WIDTH, APPLET_HEIGHT));
@@ -78,34 +78,34 @@ public class Bug735Inv3AppletAWT extends Applet {
     height = APPLET_HEIGHT;
     initGL();
   }
-  
+
   public void start() {
     initDraw();
     animator.start();
     animator.setUpdateFPSFrames(60, System.err);
   }
-  
+
   private void initGL() {
-    GLProfile profile = GLProfile.getDefault();
-    GLCapabilities caps = new GLCapabilities(profile);
+    final GLProfile profile = GLProfile.getDefault();
+    final GLCapabilities caps = new GLCapabilities(profile);
     caps.setBackgroundOpaque(true);
     caps.setOnscreen(true);
     caps.setSampleBuffers(false);
-    
+
     if (TOOLKIT == AWT) {
       awtCanvas = new GLCanvas(caps);
       // JAU awtCanvas.setBounds(0, 0, applet.width, applet.height);
       awtCanvas.setBackground(new Color(0xFFCCCCCC, true));
-      awtCanvas.setFocusable(true); 
-      
+      awtCanvas.setFocusable(true);
+
       applet.setLayout(new BorderLayout());
       applet.add(awtCanvas, BorderLayout.CENTER);
-      
+
       if (IGNORE_AWT_REPAINT) {
           awtCanvas.setIgnoreRepaint(true);
       }
       glad = awtCanvas;
-    } else if (TOOLKIT == NEWT) {      
+    } else if (TOOLKIT == NEWT) {
       newtWindow = GLWindow.create(caps);
       newtCanvas = new NewtCanvasAWT(newtWindow);
       // JAU newtCanvas.setBounds(0, 0, applet.width, applet.height);
@@ -114,27 +114,27 @@ public class Bug735Inv3AppletAWT extends Applet {
 
       applet.setLayout(new BorderLayout());
       applet.add(newtCanvas, BorderLayout.CENTER);
-      
+
       if (IGNORE_AWT_REPAINT) {
         newtCanvas.setIgnoreRepaint(true);
       }
       glad = newtWindow;
     }
-    
+
     demo = new LandscapeES2(SWAP_INTERVAL);
     // demo = new GearsES2(SWAP_INTERVAL);
     glad.addGLEventListener(demo);
     animator = new Animator(glad);
     animator.setExclusiveContext(USE_ECT);
   }
-  
+
   private void initDraw() {
     if (TOOLKIT == AWT) {
       // JAU awtCanvas.setVisible(true);
       if (awtCanvas.getDelegatedDrawable().isRealized()) {
         // Request the focus here as it cannot work when the window is not visible
         awtCanvas.requestFocus();
-      }      
+      }
     } else if (TOOLKIT == NEWT) {
       // JAU newtCanvas.setVisible(true);
       // Force the realization
@@ -143,10 +143,10 @@ public class Bug735Inv3AppletAWT extends Applet {
         // Request the focus here as it cannot work when the window is not visible
         newtCanvas.requestFocus();
       }
-    }    
+    }
   }
-  
-  static public void main(String[] args) {    
+
+  static public void main(final String[] args) {
     for(int i=0; i<args.length; i++) {
         if(args[i].equals("-vsync")) {
             i++;
@@ -158,61 +158,61 @@ public class Bug735Inv3AppletAWT extends Applet {
         }
     }
     System.err.println("swapInterval "+SWAP_INTERVAL);
-    System.err.println("exclusiveContext "+USE_ECT);    
+    System.err.println("exclusiveContext "+USE_ECT);
     if(waitForKey) {
         UITestCase.waitForKey("Start");
     }
-    
-    final GraphicsEnvironment environment = 
+
+    final GraphicsEnvironment environment =
         GraphicsEnvironment.getLocalGraphicsEnvironment();
     final GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
 
     frame = new Frame(displayDevice.getDefaultConfiguration());
     frame.setBackground(new Color(0xCC, 0xCC, 0xCC));
     frame.setTitle("TestBug735Inv3AppletAWT");
-    
+
     // This allows to close the frame.
     frame.addWindowListener(new WindowAdapter() {
-      public void windowClosing(WindowEvent e) {
+      public void windowClosing(final WindowEvent e) {
         System.exit(0);
       }
     });
-        
+
     try {
-      Class<?> c = Thread.currentThread().getContextClassLoader().
+      final Class<?> c = Thread.currentThread().getContextClassLoader().
           loadClass(Bug735Inv3AppletAWT.class.getName());
       applet = (Bug735Inv3AppletAWT) c.newInstance();
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw new RuntimeException(e);
-    }    
-    
+    }
+
     // JAU frame.setLayout(null);
     frame.add(applet);
-    
+
     applet.init();
-    
-    Insets insets = frame.getInsets();
+
+    final Insets insets = frame.getInsets();
     final int windowW = applet.width + insets.left + insets.right;
     final int windowH = applet.height + insets.top + insets.bottom;
-    
+
     try {
         SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
                frame.setSize(windowW, windowH);
                frame.validate();
                // JAU frame.pack();
-                Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();    
+                final Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();
                 frame.setLocation(screenRect.x + (screenRect.width - applet.width) / 2,
-                    screenRect.y + (screenRect.height - applet.height) / 2);    
-                
+                    screenRect.y + (screenRect.height - applet.height) / 2);
+
                frame.setResizable(false);
-               frame.setVisible(true);               
+               frame.setVisible(true);
            }
         });
-    } catch (Exception e) {
+    } catch (final Exception e) {
         e.printStackTrace();
-    }        
-    
-    applet.start();    
+    }
+
+    applet.start();
   }
 }
diff --git a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv4AWT.java b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv4AWT.java
index f0be22b..a3fd3fa 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Bug735Inv4AWT.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Bug735Inv4AWT.java
@@ -30,7 +30,7 @@ import com.jogamp.opengl.util.AnimatorBase;
  *   - Use GLEventListener
  *   - Add GLEventListener to GLAutoDrawable
  *   - Use GLAutoDrawable.display() instead of GLAutoDrawable.invoke(true, GLRunnable { init / render })
- *   - Removed MANUAL_FRAME_HANDLING, obsolete due to GLAutoDrawable/GLEventListener 
+ *   - Removed MANUAL_FRAME_HANDLING, obsolete due to GLAutoDrawable/GLEventListener
  *   - Use Animator
  *   - Remove component sizes, use frame based size via validate
  *   - Run frame validation/visibility on AWT-EDT
@@ -44,19 +44,19 @@ import com.jogamp.opengl.util.AnimatorBase;
  * </pre>
  */
 public class Bug735Inv4AWT {
-  static public int AWT  = 0;
-  static public int NEWT = 1;
-  
-  static public int APPLET_WIDTH  = 500;
-  static public int APPLET_HEIGHT = 290;
-  static public int TOOLKIT       = NEWT;
-  static public boolean IGNORE_AWT_REPAINT = false;
+  static public final int AWT  = 0;
+  static public final int NEWT = 1;
+
+  static public final int APPLET_WIDTH  = 500;
+  static public final int APPLET_HEIGHT = 290;
+  static public final int TOOLKIT       = NEWT;
+  static public final boolean IGNORE_AWT_REPAINT = false;
   static public boolean USE_ECT = false;
   static public int SWAP_INTERVAL = 1;
-  
+
   //////////////////////////////////////////////////////////////////////////////
-  
-  static boolean waitForKey = false;  
+
+  static boolean waitForKey = false;
   static private Frame frame;
   static private Bug735Inv4AWT applet;
   private GLCanvas awtCanvas;
@@ -65,39 +65,39 @@ public class Bug735Inv4AWT {
   private NewtCanvasAWT newtCanvas;
   private GLEventListener demo;
   private AnimatorBase animator;
-  
+
   private int width;
   private int height;
-  
+
   public void init() {
     width = APPLET_WIDTH;
     height = APPLET_HEIGHT;
     initGL();
   }
-  
+
   public void start() {
     initDraw();
     animator.start();
     animator.setUpdateFPSFrames(60, System.err);
   }
-  
+
   private void initGL() {
-    GLProfile profile = GLProfile.getDefault();
-    GLCapabilities caps = new GLCapabilities(profile);
+    final GLProfile profile = GLProfile.getDefault();
+    final GLCapabilities caps = new GLCapabilities(profile);
     caps.setBackgroundOpaque(true);
     caps.setOnscreen(true);
     caps.setSampleBuffers(false);
-    
+
     if (TOOLKIT == AWT) {
       awtCanvas = new GLCanvas(caps);
       awtCanvas.setBackground(new Color(0xFFCCCCCC, true));
-      awtCanvas.setFocusable(true); 
-      
+      awtCanvas.setFocusable(true);
+
       if (IGNORE_AWT_REPAINT) {
           awtCanvas.setIgnoreRepaint(true);
       }
       glad = awtCanvas;
-    } else if (TOOLKIT == NEWT) {      
+    } else if (TOOLKIT == NEWT) {
       newtWindow = GLWindow.create(caps);
       newtCanvas = new NewtCanvasAWT(newtWindow);
       newtCanvas.setBackground(new Color(0xFFCCCCCC, true));
@@ -108,20 +108,20 @@ public class Bug735Inv4AWT {
       }
       glad = newtWindow;
     }
-    
+
     demo = new LandscapeES2(SWAP_INTERVAL);
     // demo = new GearsES2(SWAP_INTERVAL);
     glad.addGLEventListener(demo);
     animator = new Animator(glad);
     animator.setExclusiveContext(USE_ECT);
   }
-  
+
   private void initDraw() {
     if (TOOLKIT == AWT) {
       if (awtCanvas.getDelegatedDrawable().isRealized()) {
         // Request the focus here as it cannot work when the window is not visible
         awtCanvas.requestFocus();
-      }      
+      }
     } else if (TOOLKIT == NEWT) {
       // newtCanvas.repaint();
       // Force the realization
@@ -130,10 +130,10 @@ public class Bug735Inv4AWT {
         // Request the focus here as it cannot work when the window is not visible
         newtCanvas.requestFocus();
       }
-    }    
+    }
   }
-  
-  static public void main(String[] args) {    
+
+  static public void main(final String[] args) {
     for(int i=0; i<args.length; i++) {
         if(args[i].equals("-vsync")) {
             i++;
@@ -145,29 +145,29 @@ public class Bug735Inv4AWT {
         }
     }
     System.err.println("swapInterval "+SWAP_INTERVAL);
-    System.err.println("exclusiveContext "+USE_ECT);    
+    System.err.println("exclusiveContext "+USE_ECT);
     if(waitForKey) {
         UITestCase.waitForKey("Start");
     }
-    
-    final GraphicsEnvironment environment = 
+
+    final GraphicsEnvironment environment =
         GraphicsEnvironment.getLocalGraphicsEnvironment();
     final GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
 
     frame = new Frame(displayDevice.getDefaultConfiguration());
     // JAU frame.setBackground(new Color(0xCC, 0xCC, 0xCC));
     frame.setTitle("TestBug735Inv4AWT");
-    
+
     // This allows to close the frame.
     frame.addWindowListener(new WindowAdapter() {
-      public void windowClosing(WindowEvent e) {
+      public void windowClosing(final WindowEvent e) {
         System.exit(0);
       }
     });
-        
+
     applet = new Bug735Inv4AWT();
     applet.init();
-    
+
     if (TOOLKIT == AWT) {
         frame.add(applet.awtCanvas);
     } else if (TOOLKIT == NEWT) {
@@ -175,28 +175,28 @@ public class Bug735Inv4AWT {
     }
     // frame.pack();
     // frame.setResizable(false);
-    
-    Insets insets = frame.getInsets();
+
+    final Insets insets = frame.getInsets();
     final int windowW = applet.width + insets.left + insets.right;
     final int windowH = applet.height + insets.top + insets.bottom;
-    
+
     try {
         SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
                frame.setSize(windowW, windowH);
                frame.validate();
                // frame.pack();
-                Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();    
+                final Rectangle screenRect = displayDevice.getDefaultConfiguration().getBounds();
                 frame.setLocation(screenRect.x + (screenRect.width - applet.width) / 2,
-                    screenRect.y + (screenRect.height - applet.height) / 2);    
-                
-               frame.setVisible(true);               
+                    screenRect.y + (screenRect.height - applet.height) / 2);
+
+               frame.setVisible(true);
            }
         });
-    } catch (Exception e) {
+    } catch (final Exception e) {
         e.printStackTrace();
-    }        
-    
-    applet.start();    
+    }
+
+    applet.start();
   }
 }
diff --git a/src/test/com/jogamp/opengl/test/bugs/DemoBug910ExtendedAWTAppletLifecycleCheck.java b/src/test/com/jogamp/opengl/test/bugs/DemoBug910ExtendedAWTAppletLifecycleCheck.java
index 1d7f6e7..3d43c2f 100644
--- a/src/test/com/jogamp/opengl/test/bugs/DemoBug910ExtendedAWTAppletLifecycleCheck.java
+++ b/src/test/com/jogamp/opengl/test/bugs/DemoBug910ExtendedAWTAppletLifecycleCheck.java
@@ -35,13 +35,14 @@ import java.awt.Component;
 import java.awt.EventQueue;
 import java.awt.Graphics;
 import java.lang.reflect.InvocationTargetException;
+import java.util.concurrent.atomic.AtomicInteger;
 
 @SuppressWarnings("serial")
 public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
 
     private static String currentThreadName() { return "["+Thread.currentThread().getName()+", isAWT-EDT "+EventQueue.isDispatchThread()+"]"; }
 
-    private static void invoke(boolean wait, Runnable r) {
+    private static void invoke(final boolean wait, final Runnable r) {
         if(EventQueue.isDispatchThread()) {
             r.run();
         } else {
@@ -51,24 +52,24 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
             } else {
                 EventQueue.invokeLater(r);
             }
-          } catch (InvocationTargetException e) {
+          } catch (final InvocationTargetException e) {
             throw new RuntimeException(e.getTargetException());
-          } catch (InterruptedException e) {
+          } catch (final InterruptedException e) {
             throw new RuntimeException(e);
           }
         }
     }
 
-    private static final String comp2Str(Component c) {
+    private static final String comp2Str(final Component c) {
         return c.getClass().getSimpleName()+"[visible "+c.isVisible()+", showing "+c.isShowing()+", valid "+c.isValid()+
                 ", displayable "+c.isDisplayable()+", "+c.getX()+"/"+c.getY()+" "+c.getWidth()+"x"+c.getHeight()+"]";
     }
 
-    private void println(String msg) {
+    private void println(final String msg) {
         System.err.println(msg);
     }
 
-    private final void checkComponentState(String msg, boolean expIsContained, int expAddNotifyCount, int expRemoveNotifyCount) {
+    private final void checkComponentState(final String msg, final boolean expIsContained, final int expAddNotifyCount, final int expRemoveNotifyCount) {
         final int compCount = getComponentCount();
         final Component c = 1 <= compCount ? getComponent(0) : null;
         final String clazzName = null != c ? c.getName() : "n/a";
@@ -83,27 +84,27 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
                 ", compCount "+compCount+", compClazz "+clazzName);
     }
 
-    volatile int initCount = 0;
-    volatile int startCount = 0;
-    volatile int stopCount = 0;
-    volatile int destroyCount = 0;
+    AtomicInteger initCount = new AtomicInteger(0);
+    AtomicInteger startCount = new AtomicInteger(0);
+    AtomicInteger stopCount = new AtomicInteger(0);
+    AtomicInteger destroyCount = new AtomicInteger(0);
 
-    private final void checkAppletState(String msg, boolean expIsActive,
-                                        int expInitCount, int expStartCount, int expStopCount, boolean startStopCountEquals, int expDestroyCount) {
+    private final void checkAppletState(final String msg, final boolean expIsActive,
+                                        final int expInitCount, final int expStartCount, final int expStopCount, final boolean startStopCountEquals, final int expDestroyCount) {
         final boolean isActive = this.isActive();
-        final String okS = ( expInitCount == initCount &&
+        final String okS = ( expInitCount == initCount.get() &&
                              expIsActive == isActive &&
-                             expStartCount == startCount &&
-                             expStopCount == stopCount &&
-                             expDestroyCount == destroyCount &&
+                             expStartCount == startCount.get() &&
+                             expStopCount == stopCount.get() &&
+                             expDestroyCount == destroyCount.get() &&
                              ( !startStopCountEquals || startCount == stopCount ) ) ? "OK" : "ERROR";
         println("Applet-State @ "+msg+": "+okS+
                 ", active[exp "+expIsActive+", has "+isActive+"]"+(expIsActive!=isActive?"*":"")+
-                ", init[exp "+expInitCount+", has "+initCount+"]"+(expInitCount!=initCount?"*":"")+
-                ", start[exp "+expStartCount+", has "+startCount+"]"+(expStartCount!=startCount?"*":"")+
-                ", stop[exp "+expStopCount+", has "+stopCount+"]"+(expStopCount!=stopCount?"*":"")+
+                ", init[exp "+expInitCount+", has "+initCount+"]"+(expInitCount!=initCount.get()?"*":"")+
+                ", start[exp "+expStartCount+", has "+startCount+"]"+(expStartCount!=startCount.get()?"*":"")+
+                ", stop[exp "+expStopCount+", has "+stopCount+"]"+(expStopCount!=stopCount.get()?"*":"")+
                 ", start==stop[exp "+startStopCountEquals+", start "+startCount+", stop "+stopCount+"]"+(( startStopCountEquals && startCount != stopCount )?"*":"")+
-                ", destroy[exp "+expDestroyCount+", has "+destroyCount+"]"+(expDestroyCount!=destroyCount?"*":""));
+                ", destroy[exp "+expDestroyCount+", has "+destroyCount+"]"+(expDestroyCount!=destroyCount.get()?"*":""));
     }
 
     private class MyCanvas extends Canvas {
@@ -144,7 +145,7 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
         }
 
         @Override
-        public void paint(Graphics g) {
+        public void paint(final Graphics g) {
             super.paint(g);
             paintCount++;
             final int width = getWidth();
@@ -160,7 +161,7 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
     public void init() {
         final java.awt.Dimension aSize = getSize();
         println("Applet.init() START - applet.size "+aSize+" - "+currentThreadName());
-        initCount++;
+        initCount.incrementAndGet();
         checkAppletState("init", false /* expIsActive */, 1 /* expInitCount */,
                          0 /* expStartCount */, 0 /* expStopCount */, true /* startStopCountEquals */,
                          0 /* expDestroyCount */);
@@ -182,9 +183,9 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
     @Override
     public void start() {
         println("Applet.start() START (isVisible "+isVisible()+", isDisplayable "+isDisplayable()+") - "+currentThreadName());
-        startCount++;
+        startCount.incrementAndGet();
         checkAppletState("start", true /* expIsActive */, 1 /* expInitCount */,
-                         startCount /* expStartCount */, startCount-1 /* expStopCount */, false /* startStopCountEquals */,
+                         startCount.get() /* expStartCount */, startCount.get()-1 /* expStopCount */, false /* startStopCountEquals */,
                          0 /* expDestroyCount */);
         invoke(true, new Runnable() {
             public void run() {
@@ -204,9 +205,9 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
     @Override
     public void stop() {
         println("Applet.stop() START - "+currentThreadName());
-        stopCount++;
+        stopCount.incrementAndGet();
         checkAppletState("stop", false /* expIsActive */, 1 /* expInitCount */,
-                         stopCount /* expStartCount */, stopCount /* expStopCount */, true /* startStopCountEquals */,
+                         stopCount.get() /* expStartCount */, stopCount.get() /* expStopCount */, true /* startStopCountEquals */,
                          0 /* expDestroyCount */);
         invoke(true, new Runnable() {
             public void run() {
@@ -218,9 +219,9 @@ public class DemoBug910ExtendedAWTAppletLifecycleCheck extends Applet {
     @Override
     public void destroy() {
         println("Applet.destroy() START - "+currentThreadName());
-        destroyCount++;
+        destroyCount.incrementAndGet();
         checkAppletState("destroy", false /* expIsActive */, 1 /* expInitCount */,
-                         startCount /* expStartCount */, stopCount /* expStopCount */, true /* startStopCountEquals */,
+                         startCount.get() /* expStartCount */, stopCount.get() /* expStopCount */, true /* startStopCountEquals */,
                          1 /* expDestroyCount */);
         invoke(true, new Runnable() {
             public void run() {
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue326Test1.java b/src/test/com/jogamp/opengl/test/bugs/Issue326Test1.java
index 833f341..802bd65 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Issue326Test1.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue326Test1.java
@@ -9,16 +9,18 @@ import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
 import java.util.Random;
 
+import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.awt.GLCanvas;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 import javax.media.opengl.glu.GLU;
 
 import com.jogamp.opengl.util.Animator;
 import com.jogamp.opengl.util.awt.TextRenderer;
 
-/** 
+/**
  * Demonstrates corruption with older versions of TextRenderer. Two
  * problems: errors when punting from glyph-based renderer to
  * string-by-string renderer, and failure of glyph-based renderer when
@@ -31,64 +33,64 @@ public class Issue326Test1 extends Frame implements GLEventListener {
 
     int width, height;
 
-    public static void main(String[] args) {
-        new Issue326Test1();        
+    public static void main(final String[] args) {
+        new Issue326Test1();
     }
-    
+
     GLCanvas canvas;
     TextRenderer tr ;
-    
+
     public Issue326Test1() {
         super("TextTest");
         this.setSize(800, 800);
         canvas = new GLCanvas();
         canvas.addGLEventListener(this);
         add(canvas);
-        
+
         setVisible(true);
         addWindowListener(new WindowAdapter() {
-                public void windowClosing(WindowEvent e) {
+                public void windowClosing(final WindowEvent e) {
                     System.exit(0);
                 }
             });
     }
 
-    public void display(GLAutoDrawable drawable) {
-        GL2 gl = drawable.getGL().getGL2();
+    public void display(final GLAutoDrawable drawable) {
+        final GL2 gl = drawable.getGL().getGL2();
         gl.glClearColor(0, 0, 0, 0);
-        gl.glClear(GL2.GL_COLOR_BUFFER_BIT|GL2.GL_DEPTH_BUFFER_BIT);
-        
-        
-        gl.glMatrixMode(GL2.GL_PROJECTION);
-        gl.glLoadIdentity();        
+        gl.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT);
+
+
+        gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
+        gl.glLoadIdentity();
         //new GLU().gluPerspective(45f, (float)width/(float)height, 0.1f, 1000f);
         gl.glOrtho(0.0, 800, 0.0, 800, -100.0, 100.0);
-        gl.glMatrixMode(GL2.GL_MODELVIEW);
+        gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         gl.glLoadIdentity();
-        
+
         tr.beginRendering(800,800);
         tr.draw( "die Marktwirtschaft. Da regelt sich � angeblich", 16, 32);
         tr.draw( "Hello World! This text is scrambled", 16, 16);
         tr.endRendering();
-        
+
     }
 
-    public void init(GLAutoDrawable arg0) {
+    public void init(final GLAutoDrawable arg0) {
         tr = new TextRenderer(new java.awt.Font("Verdana", java.awt.Font.PLAIN, 12), true, false, null, false);
         tr.setColor(1, 1, 1 ,1);
     }
 
-    public void reshape(GLAutoDrawable arg0, int arg1, int arg2, int arg3, int arg4) {
+    public void reshape(final GLAutoDrawable arg0, final int arg1, final int arg2, final int arg3, final int arg4) {
         width = arg3;
         height = arg4;
-        GL2 gl = arg0.getGL().getGL2();
+        final GL2 gl = arg0.getGL().getGL2();
         gl.glViewport(0, 0, width, height);
-        gl.glMatrixMode(GL2.GL_PROJECTION);
+        gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         gl.glLoadIdentity();
         gl.glOrtho(0.0, 800, 0.0, 200, -100.0, 100.0);
-        gl.glMatrixMode(GL2.GL_MODELVIEW);
+        gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         gl.glLoadIdentity();
     }
 
-    public void dispose(GLAutoDrawable drawable) {}
+    public void dispose(final GLAutoDrawable drawable) {}
 }
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java b/src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java
index ac5d819..032eaa2 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue326Test2.java
@@ -3,10 +3,13 @@ package com.jogamp.opengl.test.bugs;
 import java.awt.Font;
 import java.awt.Frame;
 import java.awt.event.*;
+
+import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.awt.GLCanvas;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import com.jogamp.opengl.util.awt.*;
 
@@ -20,54 +23,54 @@ public class Issue326Test2 extends Frame implements GLEventListener {
 
     int width, height;
 
-    public static void main(String[] args) {
-        new Issue326Test2();        
+    public static void main(final String[] args) {
+        new Issue326Test2();
     }
-    
+
     GLCanvas canvas;
     TextRenderer tr;
-    
+
     public Issue326Test2() {
         super("");
         this.setSize(800, 800);
         canvas = new GLCanvas();
         canvas.addGLEventListener(this);
         add(canvas);
-        
+
         setVisible(true);
         addWindowListener(new WindowAdapter() {
-                public void windowClosing(WindowEvent e) {
+                public void windowClosing(final WindowEvent e) {
                     System.exit(0);
                 }
             });
     }
 
-    public void display(GLAutoDrawable drawable) {
-        GL2 gl = drawable.getGL().getGL2();
+    public void display(final GLAutoDrawable drawable) {
+        final GL2 gl = drawable.getGL().getGL2();
         gl.glClearColor(0, 0, 0, 0);
-        gl.glClear(GL2.GL_COLOR_BUFFER_BIT|GL2.GL_DEPTH_BUFFER_BIT);
-        
-        tr.beginRendering(drawable.getWidth(), drawable.getHeight());
+        gl.glClear(GL.GL_COLOR_BUFFER_BIT|GL.GL_DEPTH_BUFFER_BIT);
+
+        tr.beginRendering(drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
         tr.draw("LA CLAPI\u00c8RE \nAlt: 1100-1700m \nGlissement de terrain majeur", 16, 80);
         tr.draw("dans la haute Tin\u00e9e, sur un flanc du Parc du Mercantour.", 16, 16);
         tr.endRendering();
-        
+
     }
 
-    public void init(GLAutoDrawable arg0) {
+    public void init(final GLAutoDrawable arg0) {
         tr = new TextRenderer(Font.decode("Arial-BOLD-64"));
         tr.setColor(1, 1, 1 ,1);
     }
 
-    public void reshape(GLAutoDrawable arg0, int x, int y, int w, int h) {
-        GL2 gl = arg0.getGL().getGL2();
-        gl.glMatrixMode(GL2.GL_PROJECTION);
+    public void reshape(final GLAutoDrawable arg0, final int x, final int y, final int w, final int h) {
+        final GL2 gl = arg0.getGL().getGL2();
+        gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         gl.glLoadIdentity();
         gl.glOrtho(0.0, w, 0.0, h, -1, 1);
-        gl.glMatrixMode(GL2.GL_MODELVIEW);
+        gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         gl.glLoadIdentity();
     }
 
-    public void dispose(GLAutoDrawable drawable) {}
+    public void dispose(final GLAutoDrawable drawable) {}
 }
 
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Base.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Base.java
index 2a7afab..54786bb 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Issue344Base.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Base.java
@@ -6,11 +6,14 @@ import java.awt.Frame;
 import java.awt.event.*;
 import java.awt.geom.*;
 
+import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.awt.GLCanvas;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 import javax.media.opengl.glu.*;
+
 import com.jogamp.opengl.util.awt.TextRenderer;
 
 /** Test Code adapted from TextCube.java (in JOGL demos)
@@ -35,17 +38,17 @@ public abstract class Issue344Base implements GLEventListener
 
     protected abstract String getText();
 
-    protected void run(String[] args) {
+    protected void run(final String[] args) {
         final Frame frame = new Frame(getClass().getName());
         frame.setLayout(new BorderLayout());
 
-        GLCanvas canvas = new GLCanvas();
+        final GLCanvas canvas = new GLCanvas();
         canvas.addGLEventListener(this);
         frame.add(canvas, BorderLayout.CENTER);
 
         frame.setSize(512, 512);
         frame.addWindowListener(new WindowAdapter() {
-                public void windowClosing(WindowEvent e) {
+                public void windowClosing(final WindowEvent e) {
                     new Thread(new Runnable() {
                             public void run() {
                                 System.exit(0);
@@ -58,57 +61,57 @@ public abstract class Issue344Base implements GLEventListener
                 public void run() {
                     frame.setVisible(true);
                 } } );
-        } catch(Exception ex) {
+        } catch(final Exception ex) {
             throw new RuntimeException(ex);
         }
     }
 
-    public void init(GLAutoDrawable drawable)
+    public void init(final GLAutoDrawable drawable)
     {
-        GL2 gl = drawable.getGL().getGL2();
+        final GL2 gl = drawable.getGL().getGL2();
 
-        gl.glEnable(GL2.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_DEPTH_TEST);
 
         renderer = new TextRenderer(font, useMipMaps);
 
-        Rectangle2D bounds = renderer.getBounds(getText());
-        float w = (float) bounds.getWidth();
-        float h = (float) bounds.getHeight();
+        final Rectangle2D bounds = renderer.getBounds(getText());
+        final float w = (float) bounds.getWidth();
+        // final float h = (float) bounds.getHeight();
         textScaleFactor = 2.0f / (w * 1.1f);
         gl.setSwapInterval(0);
     }
 
-    public void display(GLAutoDrawable drawable)
+    public void display(final GLAutoDrawable drawable)
     {
-        GL2 gl = drawable.getGL().getGL2();
-        gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
+        final GL2 gl = drawable.getGL().getGL2();
+        gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
 
-        gl.glMatrixMode(GL2.GL_MODELVIEW);
+        gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         gl.glLoadIdentity();
         glu.gluLookAt(0, 0, 10,
                       0, 0, 0,
                       0, 1, 0);
 
         renderer.begin3DRendering();
-        Rectangle2D bounds = renderer.getBounds(getText());
-        float w = (float) bounds.getWidth();
-        float h = (float) bounds.getHeight();
+        final Rectangle2D bounds = renderer.getBounds(getText());
+        final float w = (float) bounds.getWidth();
+        final float h = (float) bounds.getHeight();
         renderer.draw3D(getText(),
                         w / -2.0f * textScaleFactor,
                         h / -2.0f * textScaleFactor,
                         3f,
                         textScaleFactor);
-        
+
         renderer.end3DRendering();
     }
 
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height)
     {
-        GL2 gl = drawable.getGL().getGL2();
-        gl.glMatrixMode(GL2.GL_PROJECTION);
+        final GL2 gl = drawable.getGL().getGL2();
+        gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         gl.glLoadIdentity();
         glu.gluPerspective(15, (float) width / (float) height, 5, 15);
     }
 
-    public void dispose(GLAutoDrawable drawable) {}
+    public void dispose(final GLAutoDrawable drawable) {}
 }
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Test1.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Test1.java
index f0da7cb..384b6e9 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Issue344Test1.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Test1.java
@@ -2,11 +2,11 @@ package com.jogamp.opengl.test.bugs;
 
 public class Issue344Test1 extends Issue344Base {
     protected String getText() {
-        // test 1 - weird artifacts appear with a large font & long string 
+        // test 1 - weird artifacts appear with a large font & long string
         return "abcdefghijklmnopqrstuvwxyz1234567890";
     }
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         new Issue344Test1().run(args);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Test2.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Test2.java
index bb1acf2..9941b3f 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Issue344Test2.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Test2.java
@@ -6,7 +6,7 @@ public class Issue344Test2 extends Issue344Base {
         return "\u201Cabcdefghijklmnopqrstuvwxyz\u201D";
     }
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         new Issue344Test2().run(args);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Test3.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Test3.java
index bb73d84..7ae4245 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Issue344Test3.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Test3.java
@@ -6,7 +6,7 @@ public class Issue344Test3 extends Issue344Base {
         return "abcde";
     }
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         new Issue344Test3().run(args);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/bugs/Issue344Test4.java b/src/test/com/jogamp/opengl/test/bugs/Issue344Test4.java
index de4c37a..87a5b64 100644
--- a/src/test/com/jogamp/opengl/test/bugs/Issue344Test4.java
+++ b/src/test/com/jogamp/opengl/test/bugs/Issue344Test4.java
@@ -6,7 +6,7 @@ public class Issue344Test4 extends Issue344Base {
         return "\u201CGreetings\u201D!";
     }
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         new Issue344Test4().run(args);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java b/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java
index e9609ca..8e647c3 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TestRegionRendererNEWT01.java
@@ -36,6 +36,8 @@ import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLProfile;
 
+import jogamp.common.os.PlatformPropsImpl;
+
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.FixMethodOrder;
@@ -44,33 +46,32 @@ import org.junit.runners.MethodSorters;
 import com.jogamp.common.os.Platform;
 import com.jogamp.graph.curve.Region;
 import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.geom.opengl.SVertex;
+import com.jogamp.graph.geom.SVertex;
 import com.jogamp.newt.opengl.GLWindow;
 import com.jogamp.opengl.test.junit.graph.demos.GPURegionGLListener01;
 import com.jogamp.opengl.test.junit.graph.demos.GPURegionGLListener02;
-import com.jogamp.opengl.test.junit.graph.demos.GPURegionRendererListenerBase01;
+import com.jogamp.opengl.test.junit.graph.demos.GPURendererListenerBase01;
 import com.jogamp.opengl.test.junit.util.UITestCase;
-import com.jogamp.opengl.util.glsl.ShaderState;
 
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestRegionRendererNEWT01 extends UITestCase {
 
-    public static void main(String args[]) throws IOException {
-        String tstname = TestRegionRendererNEWT01.class.getName();
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestRegionRendererNEWT01.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
-    }    
-    
-    static void destroyWindow(GLWindow window) {
+    }
+
+    static void destroyWindow(final GLWindow window) {
         if(null!=window) {
             window.destroy();
         }
     }
 
-    static GLWindow createWindow(String title, GLCapabilitiesImmutable caps, int width, int height) {
+    static GLWindow createWindow(final String title, final GLCapabilitiesImmutable caps, final int width, final int height) {
         Assert.assertNotNull(caps);
 
-        GLWindow window = GLWindow.create(caps);
+        final GLWindow window = GLWindow.create(caps);
         window.setSize(width, height);
         window.setPosition(10, 10);
         window.setTitle(title);
@@ -80,146 +81,209 @@ public class TestRegionRendererNEWT01 extends UITestCase {
         return window;
     }
 
-    @Test
-    public void testRegionRendererR2T01() throws InterruptedException {
-        if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME
-            // FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise). 
+    // @Test
+    public void test00RegionRendererNONE01() throws InterruptedException {
+        final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+        final GLCapabilities caps = new GLCapabilities(glp);
+    //    caps.setOnscreen(false);
+        caps.setAlphaBits(4);
+
+        final GLWindow window = createWindow("shape-vbaa0-msaa0", caps, 800, 400);
+        final RenderState rs = RenderState.createRenderState(SVertex.factory());
+
+        final GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, 0, 0, false, false);
+        demo01Listener.attachInputListenerTo(window);
+        window.addGLEventListener(demo01Listener);
+
+        final RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion01");
+        window.addGLEventListener(listener);
+
+        listener.setTech(-20, 0, -300, 0f, 2);
+        window.display();
+
+        listener.setTech(-20, 0, -150, 0f, 3);
+        window.display();
+
+        listener.setTech(-20, 0,  -50, 0f, 4);
+        window.display();
+
+        destroyWindow(window);
+    }
+
+    // @Test
+    public void test01RegionRendererNONE02() throws InterruptedException {
+        if(Platform.CPUFamily.X86 != PlatformPropsImpl.CPU_ARCH.family) { // FIXME
+            // FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise).
+            // FIXME: Also the GLSL code for VARIABLE_CURVE is not fit for mobile yet!
             System.err.println("disabled on non desktop (x86) arch for now ..");
             return;
         }
-        GLProfile glp = GLProfile.getGL2ES2();
-        
-        GLCapabilities caps = new GLCapabilities(glp);
-        //caps.setOnscreen(false);
-        caps.setAlphaBits(4);    
-
-        GLWindow window = createWindow("shape-vbaa1-msaa0", caps, 800,400);
-        RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
-        GPURegionGLListener02  demo02Listener = new GPURegionGLListener02 (rs, Region.VBAA_RENDERING_BIT, 1140, false, false); 
-        demo02Listener.attachInputListenerTo(window);                
-        window.addGLEventListener(demo02Listener);        
-        
-        RegionGLListener listener = new RegionGLListener(demo02Listener, window.getTitle(), "GPURegionNewtDemo02");
+        final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setAlphaBits(4);
+
+        final GLWindow window = createWindow("shape-vbaa0-msaa0", caps, 800, 400);
+        final RenderState rs = RenderState.createRenderState(SVertex.factory());
+
+        final GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, Region.VARWEIGHT_RENDERING_BIT, 0, false, false);
+        demo01Listener.attachInputListenerTo(window);
+        window.addGLEventListener(demo01Listener);
+
+        final RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion02");
         window.addGLEventListener(listener);
-        
-        listener.setTech(-20, 00, 0f, -300, 400);
+
+        listener.setTech(-20, 0, -300, 0f, 2);
         window.display();
-        
-        listener.setTech(-20, 00, 0f, -150, 800);
+
+        listener.setTech(-20, 0, -150, 0f, 3);
         window.display();
-        
-        listener.setTech(-20, 00, 0f, -50, 1000);
+
+        listener.setTech(-20, 0,  -50, 0f, 4);
         window.display();
 
-        destroyWindow(window); 
+        destroyWindow(window);
     }
-    
+
     @Test
-    public void testRegionRendererMSAA01() throws InterruptedException {
-        GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
-        GLCapabilities caps = new GLCapabilities(glp);
+    public void test10RegionRendererMSAA01() throws InterruptedException {
+        final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+        final GLCapabilities caps = new GLCapabilities(glp);
     //    caps.setOnscreen(false);
-        caps.setAlphaBits(4);    
+        caps.setAlphaBits(4);
         caps.setSampleBuffers(true);
         caps.setNumSamples(4);
 
-        GLWindow window = createWindow("shape-vbaa0-msaa1", caps, 800, 400);
-        RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
+        final GLWindow window = createWindow("shape-vbaa0-msaa1", caps, 800, 400);
+        final RenderState rs = RenderState.createRenderState(SVertex.factory());
 
-        GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, 0, 0, false, false);
-        demo01Listener.attachInputListenerTo(window);        
+        final GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, 0, 0, false, false);
+        demo01Listener.attachInputListenerTo(window);
         window.addGLEventListener(demo01Listener);
-                
-        RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion01");
+
+        final RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion01");
         window.addGLEventListener(listener);
-        
-        listener.setTech(-20, 00, 0f, -300, 400);
+
+        listener.setTech(-20, 00, -300, 0f, 2);
         window.display();
-        
-        listener.setTech(-20, 00, 0f, -150, 800);
+
+        listener.setTech(-20, 00, -150, 0f, 3);
         window.display();
-        
-        listener.setTech(-20, 00, 0f, -50, 1000);
+
+        listener.setTech(-20, 00,  -50, 0f, 4);
         window.display();
-        
-        destroyWindow(window); 
+
+        destroyWindow(window);
     }
-    
-    @Test
-    public void testRegionRendererMSAA02() throws InterruptedException {
-        if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME
+
+    // @Test
+    public void test11RegionRendererMSAA02() throws InterruptedException {
+        if(Platform.CPUFamily.X86 != PlatformPropsImpl.CPU_ARCH.family) { // FIXME
             // FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise).
             // FIXME: Also the GLSL code for VARIABLE_CURVE is not fit for mobile yet!
             System.err.println("disabled on non desktop (x86) arch for now ..");
             return;
         }
-        GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
-        GLCapabilities caps = new GLCapabilities(glp);
-        caps.setAlphaBits(4);    
+        final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setAlphaBits(4);
         caps.setSampleBuffers(true);
         caps.setNumSamples(4);
 
-        GLWindow window = createWindow("shape-vbaa0-msaa1", caps, 800, 400);
-        RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
+        final GLWindow window = createWindow("shape-vbaa0-msaa1", caps, 800, 400);
+        final RenderState rs = RenderState.createRenderState(SVertex.factory());
 
-        GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, Region.VARIABLE_CURVE_WEIGHT_BIT, 0, false, false);
-        demo01Listener.attachInputListenerTo(window);        
+        final GPURegionGLListener01 demo01Listener = new GPURegionGLListener01 (rs, Region.VARWEIGHT_RENDERING_BIT, 0, false, false);
+        demo01Listener.attachInputListenerTo(window);
         window.addGLEventListener(demo01Listener);
-                
-        RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion02");
+
+        final RegionGLListener listener = new RegionGLListener(demo01Listener, window.getTitle(), "GPURegion02");
         window.addGLEventListener(listener);
-        
-        listener.setTech(-20, 00, 0f, -300, 400);
+
+        listener.setTech(-20, 00, -300, 0f, 2);
         window.display();
-        
-        listener.setTech(-20, 00, 0f, -150, 800);
+
+        listener.setTech(-20, 00, -150, 0f, 3);
         window.display();
-        
-        listener.setTech(-20, 00, 0f, -50, 1000);
+
+        listener.setTech(-20, 00,  -50, 0f, 4);
         window.display();
-        
-        destroyWindow(window); 
+
+        destroyWindow(window);
     }
-    
-    private class RegionGLListener implements GLEventListener {
+
+    @Test
+    public void test20RegionRendererR2T01() throws InterruptedException {
+        if(Platform.CPUFamily.X86 != PlatformPropsImpl.CPU_ARCH.family) { // FIXME
+            // FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise).
+            System.err.println("disabled on non desktop (x86) arch for now ..");
+            return;
+        }
+        final GLProfile glp = GLProfile.getGL2ES2();
+
+        final GLCapabilities caps = new GLCapabilities(glp);
+        //caps.setOnscreen(false);
+        caps.setAlphaBits(4);
+
+        final GLWindow window = createWindow("shape-vbaa1-msaa0", caps, 800,400);
+        final RenderState rs = RenderState.createRenderState(SVertex.factory());
+        final GPURegionGLListener02  demo02Listener = new GPURegionGLListener02 (rs, Region.VBAA_RENDERING_BIT, 4, false, false);
+        demo02Listener.attachInputListenerTo(window);
+        window.addGLEventListener(demo02Listener);
+
+        final RegionGLListener listener = new RegionGLListener(demo02Listener, window.getTitle(), "GPURegionNewtDemo02");
+        window.addGLEventListener(listener);
+
+        listener.setTech(-20, 00, -300, 0f, 2);
+        window.display();
+
+        listener.setTech(-20, 00, -150, 0f, 3);
+        window.display();
+
+        listener.setTech(-20, 00,  -50, 0f, 4);
+        window.display();
+
+        destroyWindow(window);
+    }
+
+    private static class RegionGLListener implements GLEventListener {
         String winTitle;
         String name;
-        GPURegionRendererListenerBase01 impl;
-        
-        public RegionGLListener(GPURegionRendererListenerBase01 impl, String title, String name) {
+        GPURendererListenerBase01 impl;
+
+        public RegionGLListener(final GPURendererListenerBase01 impl, final String title, final String name) {
             this.impl = impl;
             this.winTitle = title;
             this.name = name;
         }
-        
-        public void setTech(float xt, float yt, float angle, int zoom, int fboSize){
-            impl.setMatrix(xt, yt, angle, zoom, fboSize);       
+
+        public void setTech(final float xt, final float yt, final int zt, final float angle, final int sampleCount){
+            impl.setMatrix(xt, yt, zt, angle, sampleCount);
         }
 
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
             impl.init(drawable);
         }
-        
-        public void display(GLAutoDrawable drawable) {
+
+        public void display(final GLAutoDrawable drawable) {
             impl.display(drawable);
 
             try {
                 impl.printScreen(drawable, "./", winTitle, name, false);
-            } catch (GLException e) {
+            } catch (final GLException e) {
                 e.printStackTrace();
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 e.printStackTrace();
             }
         }
 
-        public void dispose(GLAutoDrawable drawable) {
+        public void dispose(final GLAutoDrawable drawable) {
             impl.dispose(drawable);
-            
+
         }
 
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
             impl.reshape(drawable, x, y, width, height);
-            
+
         }
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT00.java b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT00.java
index f675e42..3a561ed 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT00.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT00.java
@@ -29,87 +29,131 @@ package com.jogamp.opengl.test.junit.graph;
 
 import java.io.File;
 import java.io.IOException;
-import java.io.PrintWriter;
-import java.io.StringWriter;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GLAnimatorControl;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLCapabilitiesImmutable;
-import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLProfile;
 import javax.media.opengl.GLRunnable;
 
 import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
 import org.junit.FixMethodOrder;
+import org.junit.Test;
 import org.junit.runners.MethodSorters;
 
+import com.jogamp.common.os.Platform;
+import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
 import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.curve.opengl.TextRenderer;
 import com.jogamp.graph.font.Font;
 import com.jogamp.graph.font.FontFactory;
-import com.jogamp.graph.geom.opengl.SVertex;
+import com.jogamp.graph.geom.SVertex;
+import com.jogamp.newt.Window;
 import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.math.geom.AABBox;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.util.Animator;
 import com.jogamp.opengl.util.GLReadBufferUtil;
-import com.jogamp.opengl.util.glsl.ShaderState;
 
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestTextRendererNEWT00 extends UITestCase {
     static final boolean DEBUG = false;
     static final boolean TRACE = false;
-    static long duration = 100; // ms
-    
-    static final float[] textPosition = new float[] {0,0,0};
-    static final int[] texSize = new int[] { 0 }; 
-    static final int fontSize = 24;
-    static Font font;
-
-    @BeforeClass
-    public static void setup() throws IOException {
-        font = FontFactory.get(FontFactory.UBUNTU).getDefault();
-    }
-    
-    static int atoi(String a) {
+    static long Duration = 2000; // ms
+    static boolean WaitStartEnd = false;
+    static boolean TextAnim = false;
+    static int SceneMSAASamples = 0;
+    static int GraphVBAASamples = 0;
+    static int GraphMSAASamples = 0;
+    static boolean ManualTest = false;
+    static int SwapInterval = 0;
+
+    static String fontFileName = null;
+    static int fontSet = 0;
+    static int fontFamily = 0;
+    static int fontStylebits = 0;
+    static float fontSizeFixed = 14f;
+
+    static int atoi(final String a) {
         try {
             return Integer.parseInt(a);
-        } catch (Exception ex) { throw new RuntimeException(ex); }
+        } catch (final Exception ex) { throw new RuntimeException(ex); }
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
+        ManualTest = args.length > 0;
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
-                duration = atoi(args[i]);
+                Duration = atoi(args[i]);
+            } else if(args[i].equals("-fontFile")) {
+                i++;
+                fontFileName = args[i];
+            } else if(args[i].equals("-fontSet")) {
+                i++;
+                fontSet = atoi(args[i]);
+            } else if(args[i].equals("-fontFamily")) {
+                i++;
+                fontFamily = atoi(args[i]);
+            } else if(args[i].equals("-fontStyle")) {
+                i++;
+                fontStylebits = atoi(args[i]);
+            } else if(args[i].equals("-fontSize")) {
+                i++;
+                fontSizeFixed = atoi(args[i]);
+            } else if(args[i].equals("-smsaa")) {
+                i++;
+                SceneMSAASamples = atoi(args[i]);
+            } else if(args[i].equals("-gmsaa")) {
+                i++;
+                GraphMSAASamples = atoi(args[i]);
+            } else if(args[i].equals("-gvbaa")) {
+                i++;
+                GraphVBAASamples = atoi(args[i]);
+            } else if(args[i].equals("-textAnim")) {
+                TextAnim = true;
+            } else if(args[i].equals("-vsync")) {
+                i++;
+                SwapInterval = MiscUtils.atoi(args[i], SwapInterval);
+            } else if(args[i].equals("-wait")) {
+                WaitStartEnd = true;
             }
         }
-        String tstname = TestTextRendererNEWT00.class.getName();
+        System.err.println("Font [set "+fontSet+", family "+fontFamily+", style "+fontStylebits+", size "+fontSizeFixed+"], fontFileName "+fontFileName);
+        System.err.println("Scene MSAA Samples "+SceneMSAASamples);
+        System.err.println("Graph MSAA Samples "+GraphMSAASamples);
+        System.err.println("Graph VBAA Samples "+GraphVBAASamples);
+        System.err.println("swapInterval "+SwapInterval);
+        final String tstname = TestTextRendererNEWT00.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
-    }    
-        
+    }
+
     static void sleep() {
+        sleep(Duration);
+    }
+    static void sleep(final long d) {
         try {
-            System.err.println("** new frame ** (sleep: "+duration+"ms)");
-            Thread.sleep(duration);
-        } catch (InterruptedException ie) {}
+            System.err.println("** new frame ** (sleep: "+d+"ms)");
+            Thread.sleep(d);
+        } catch (final InterruptedException ie) {}
     }
-    
-    static void destroyWindow(GLWindow window) {
+
+    static void destroyWindow(final GLWindow window) {
         if(null!=window) {
             window.destroy();
         }
     }
 
-    static GLWindow createWindow(String title, GLCapabilitiesImmutable caps, int width, int height) {
+    static GLWindow createWindow(final String title, final GLCapabilitiesImmutable caps, final int width, final int height) {
         Assert.assertNotNull(caps);
 
-        GLWindow window = GLWindow.create(caps);
+        final GLWindow window = GLWindow.create(caps);
         window.setSize(width, height);
         window.setPosition(10, 10);
         window.setTitle(title);
@@ -118,122 +162,247 @@ public class TestTextRendererNEWT00 extends UITestCase {
 
         return window;
     }
-    
+
+    @Test
+    public void test00Manual() throws InterruptedException {
+        if( ManualTest ) {
+            testImpl(SceneMSAASamples, GraphMSAASamples, GraphVBAASamples);
+        }
+    }
+    @Test
+    public void test00SceneNoAA() throws InterruptedException {
+        if( !ManualTest ) {
+            testImpl(0, 0, 0);
+        }
+    }
+    @Test
+    public void test01SceneMSAA04() throws InterruptedException {
+        if( !ManualTest ) {
+            testImpl(4, 0, 0);
+        }
+    }
+    @Test
+    public void test02GraphMSAA04() throws InterruptedException {
+        if( !ManualTest ) {
+            testImpl(0, 4, 0);
+        }
+    }
     @Test
-    public void testTextRendererMSAA01() throws InterruptedException {
-        GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
-        GLCapabilities caps = new GLCapabilities(glp);
-        caps.setAlphaBits(4);    
-        caps.setSampleBuffers(true);
-        caps.setNumSamples(4);
-        System.err.println("Requested: "+caps);
-
-        GLWindow window = createWindow("text-vbaa0-msaa1", caps, 800, 400);
+    public void test03GraphVBAA04() throws InterruptedException {
+        if( !ManualTest ) {
+            testImpl(0, 0, 4);
+        }
+    }
+
+    public void testImpl(final int sceneMSAASamples, final int graphMSAASamples, final int graphVBAASamples) throws InterruptedException {
+        final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setAlphaBits(4);
+        if( 0 < sceneMSAASamples ) {
+            caps.setSampleBuffers(true);
+            caps.setNumSamples(sceneMSAASamples);
+        }
+        System.err.println("Requested: "+caps+", graph[msaaSamples "+graphMSAASamples+", vbaaSamples "+graphVBAASamples+"]");
+
+        final GLWindow window = createWindow("text-gvbaa"+graphVBAASamples+"-gmsaa"+graphMSAASamples+"-smsaa"+sceneMSAASamples, caps, 1024, 640);
         window.display();
         System.err.println("Chosen: "+window.getChosenGLCapabilities());
-        
-        final RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
-        final TextRendererListener textGLListener = new TextRendererListener(rs);
-        final TextRenderer renderer = textGLListener.getRenderer();
+        if( WaitStartEnd ) {
+            UITestCase.waitForKey("Start");
+        }
+
+        final RenderState rs = RenderState.createRenderState(SVertex.factory());
+        final int renderModes, sampleCount;
+        if( graphVBAASamples > 0 ) {
+            renderModes = Region.VBAA_RENDERING_BIT;
+            sampleCount = graphVBAASamples;
+        } else if ( graphMSAASamples > 0 ) {
+            renderModes = Region.MSAA_RENDERING_BIT;
+            sampleCount = graphMSAASamples;
+        } else {
+            renderModes = 0;
+            sampleCount = 0;
+        }
+        final TextRendererGLEL textGLListener = new TextRendererGLEL(rs, renderModes, sampleCount);
+        System.err.println(textGLListener.getFontInfo());
+
         window.addGLEventListener(textGLListener);
 
+        final Animator anim = new Animator();
+        anim.add(window);
+        anim.start();
+        anim.setUpdateFPSFrames(60, null);
+        sleep();
         window.invoke(true, new GLRunnable() {
             @Override
-            public boolean run(GLAutoDrawable drawable) {
-                int c=0;
-                renderString(drawable, renderer, "GlueGen", c++, -1, -1000);
-                renderString(drawable, renderer, "JOAL", c++, -1, -1000);
-                renderString(drawable, renderer, "JOGL", c++, -1, -1000);
-                renderString(drawable, renderer, "JOCL", c++, -1, -1000);
+            public boolean run(final GLAutoDrawable drawable) {
                 try {
-                    textGLListener.printScreen(drawable, "./", "TestTextRendererNEWT00-snap"+screenshot_num, false);
-                } catch (Exception e) {
+                    textGLListener.printScreen(renderModes, drawable, "./", "TestTextRendererNEWT00-snap"+screenshot_num, false);
+                    screenshot_num++;
+                } catch (final Exception e) {
                     e.printStackTrace();
                 }
                 return true;
-            }            
+            }
         });
-        sleep();            
-
-        destroyWindow(window); 
-    }    
-    int screenshot_num = 0;
-    
-    int lastRow = -1;
-    
-    void renderString(GLAutoDrawable drawable, TextRenderer renderer, String text, int column, int row, int z0) {
-        final GL2ES2 gl = drawable.getGL().getGL2ES2();
-        final int height = drawable.getHeight();
-        
-        int dx = 0;
-        int dy = height;        
-        if(0>row) {
-            row = lastRow + 1;
-        }
-        AABBox textBox = font.getStringBounds(text, fontSize);
-        dx += font.getAdvanceWidth('X', fontSize) * column;
-        dy -= (int)textBox.getHeight() * ( row + 1 );
-        renderer.resetModelview(null);
-        renderer.translate(gl, dx, dy, z0);
-        renderer.drawString3D(gl, font, text, textPosition, fontSize, texSize);
-        
-        lastRow = row;
+        anim.stop();
+        if( WaitStartEnd ) {
+            UITestCase.waitForKey("Stop");
+        }
+        destroyWindow(window);
     }
-        
-    public class TextRendererListener implements GLEventListener {
-        private GLReadBufferUtil screenshot;
-        private TextRenderer renderer;
-        
-        public TextRendererListener(RenderState rs) {
+    int screenshot_num = 0;
+
+    static final String textX2 =
+        "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nec sapien tellus. \n"+
+        "Ut purus odio, rhoncus sit amet commodo eget, ullamcorper vel urna. Mauris ultricies \n"+
+        "quam iaculis urna cursus ornare. Nullam ut felis a ante ultrices ultricies nec a elit. \n"+
+        "In hac habitasse platea dictumst. Vivamus et mi a quam lacinia pharetra at venenatis est.\n"+
+        "Morbi quis bibendum nibh. Donec lectus orci, sagittis in consequat nec, volutpat nec nisi.\n"+
+        "Donec ut dolor et nulla tristique varius. In nulla magna, fermentum id tempus quis, semper \n"+
+        "in lorem. Maecenas in ipsum ac justo scelerisque sollicitudin. Quisque sit amet neque lorem,\n" +
+        "-------Press H to change text---------\n";
+
+    private static final class TextRendererGLEL extends TextRendererGLELBase {
+        private final GLReadBufferUtil screenshot;
+        private final GLRegion regionFPS, regionFPSAnim;
+        final Font font;
+        final float fontSizeMin, fontSizeMax;
+        private long t0;
+        float fontSizeAnim, fontSizeDelta;
+        float dpiH;
+
+        TextRendererGLEL(final RenderState rs, final int renderModes, final int sampleCount) {
+            super(renderModes, new int[] { sampleCount });
+            setRendererCallbacks(RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable);
+            setRenderState(rs);
+
+            regionFPS = GLRegion.create(renderModes, null);
+            regionFPSAnim = GLRegion.create(renderModes, null);
+            if( null != fontFileName ) {
+                Font _font = null;
+                try {
+                    _font = FontFactory.get(getClass(), fontFileName, false);
+                } catch (final IOException e) {
+                    e.printStackTrace();
+                }
+                font = _font;
+            } else {
+                font = getFont(fontSet, fontFamily, fontStylebits);
+            }
+
+            staticRGBAColor[0] = 0.1f;
+            staticRGBAColor[1] = 0.1f;
+            staticRGBAColor[2] = 0.1f;
+            staticRGBAColor[3] = 1.0f;
+
             this.screenshot = new GLReadBufferUtil(false, false);
-            this.renderer = TextRenderer.create(rs, 0);
-        }
-    
-        public final TextRenderer getRenderer() { return renderer; }
-        
-        public void printScreen(GLAutoDrawable drawable, String dir, String objName, boolean exportAlpha) throws GLException, IOException {
-            StringWriter sw = new StringWriter();
-            PrintWriter pw = new PrintWriter(sw);
-            pw.printf("%s-%03dx%03d-T%04d", objName, drawable.getWidth(), drawable.getHeight(), texSize[0]);
-            
-            final String filename = dir + sw +".png";
+            // fontSizeMin = Math.max(8, fontSizeFixed-5);
+            fontSizeMin = fontSizeFixed;
+            fontSizeMax = fontSizeFixed+8;
+            fontSizeAnim = fontSizeFixed;
+            fontSizeDelta = 0.01f;
+        }
+
+        @Override
+        public void init(final GLAutoDrawable drawable) {
+            super.init(drawable);
+            drawable.getGL().setSwapInterval(SwapInterval);
+            t0 = Platform.currentTimeMillis();
+
+            final Window win = (Window)drawable.getUpstreamWidget();
+            final float[] pixelsPerMM = win.getPixelsPerMM(new float[2]);
+            final float[] dotsPerInch = new float[] { pixelsPerMM[0]*25.4f, pixelsPerMM[1]*25.4f };
+            dpiH = dotsPerInch[1];
+            System.err.println(getFontInfo());
+            System.err.println("fontSize "+fontSizeFixed+", dotsPerMM "+pixelsPerMM[0]+"x"+pixelsPerMM[1]+", dpi "+dotsPerInch[0]+"x"+dotsPerInch[1]+", pixelSize "+font.getPixelSize(fontSizeFixed, dotsPerInch[1] /* dpi display */));
+        }
+
+        @Override
+        public void dispose(final GLAutoDrawable drawable) {
+            final GL2ES2 gl = drawable.getGL().getGL2ES2();
+            screenshot.dispose(gl);
+            regionFPS.destroy(gl);
+            regionFPSAnim.destroy(gl);
+            super.dispose(drawable);
+        }
+
+        public void printScreen(final int renderModes, final GLAutoDrawable drawable, final String dir, final String objName, final boolean exportAlpha) throws GLException, IOException {
+            final String modeS = Region.getRenderModeString(renderModes);
+            final String bname = String.format("%s-msaa%02d-fontsz%02.1f-%03dx%03d-%s%04d", objName,
+                    drawable.getChosenGLCapabilities().getNumSamples(),
+                    TestTextRendererNEWT00.fontSizeFixed, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), modeS, vbaaSampleCount[0]);
+            final String filename = dir + bname +".png";
             if(screenshot.readPixels(drawable.getGL(), false)) {
                 screenshot.write(new File(filename));
             }
         }
-        
-        public void init(GLAutoDrawable drawable) {
-            final GL2ES2 gl = drawable.getGL().getGL2ES2();
-            gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
-            renderer.init(gl);
-            renderer.setAlpha(gl, 1.0f);
-            renderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);        
+
+        String getFontInfo() {
+            final float unitsPerEM_Inv = font.getMetrics().getScale(1f);
+            final float unitsPerEM = 1f / unitsPerEM_Inv;
+            return String.format("Font %s%n %s%nunitsPerEM %f (upem)",
+                    font.getFullFamilyName(null).toString(),
+                    font.getName(Font.NAME_UNIQUNAME),
+                    unitsPerEM);
         }
-        
-        public void reshape(GLAutoDrawable drawable, int xstart, int ystart, int width, int height) {
+
+        @Override
+        public void display(final GLAutoDrawable drawable) {
             final GL2ES2 gl = drawable.getGL().getGL2ES2();
-            
-            gl.glViewport(xstart, ystart, width, height);        
-            // renderer.reshapePerspective(gl, 45.0f, width, height, 0.1f, 1000.0f);
-            renderer.reshapeOrtho(gl, width, height, 0.1f, 1000.0f);
-        }
-    
-        public void display(GLAutoDrawable drawable) {
-            final GL2ES2 gl = drawable.getGL().getGL2ES2();            
+
+            gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
             gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
-            
-            renderString(drawable, renderer, "012345678901234567890123456789", 0,  0, -1000);
-            renderString(drawable, renderer, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 0, -1, -1000);
-            renderString(drawable, renderer, "Hello World", 0, -1, -1000);
-            renderString(drawable, renderer, "4567890123456", 4, -1, -1000);
-            renderString(drawable, renderer, "I like JogAmp", 4, -1, -1000);
-        }        
-    
-        public void dispose(GLAutoDrawable drawable) {
-            final GL2ES2 gl = drawable.getGL().getGL2ES2();            
-            screenshot.dispose(gl);
-            renderer.destroy(gl);
-        }            
-    }
+
+            final GLAnimatorControl anim = drawable.getAnimator();
+            final float lfps = null != anim ? anim.getLastFPS() : 0f;
+            final float tfps = null != anim ? anim.getTotalFPS() : 0f;
+
+            // Note: MODELVIEW is from [ 0 .. height ]
+
+            final long t1 = Platform.currentTimeMillis();
+
+            // final float fontSize = TestTextRendererNEWT00.fontSize;
+
+            fontSizeAnim += fontSizeDelta;
+            if( fontSizeMin >= fontSizeAnim || fontSizeAnim >= fontSizeMax ) {
+                fontSizeDelta *= -1f;
+            }
+
+            final float pixelSize = font.getPixelSize(fontSizeFixed, dpiH);
+            final float pixelSizeAnim = font.getPixelSize(fontSizeAnim, dpiH);
+
+            final String modeS = Region.getRenderModeString(renderModes);
+
+            if( false ) {
+                // renderString(drawable, font, pixelSize, "I - / H P 7 0", 0, 0, 0, 0, -1000f, true);
+                // renderString(drawable, font, pixelSize, "A M > } ] ", 0, 0, 0, 0, -1000f, true);
+                // renderString(drawable, font, pixelSize, "M", 0, 0, 0, 0, -1000f, true);
+                // renderString(drawable, font, pixelSize, "0 6 9 a b O Q A M > } ] ", 0, 0, 0, 0, -1000f, true);
+                // renderString(drawable, font, pixelSize, "012345678901234567890123456789", 0, 0, 0, -1000, true);
+                // renderString(drawable, font, pixelSize, textX2,        0, 0,   0, 0, -1000f, true);
+                // renderString(drawable, font, pixelSize, text1,         0,    0, 0, -1000f, regionFPS); // no-cache
+                final String text1 = lfps+" / "+tfps+" fps, vsync "+gl.getSwapInterval()+", elapsed "+(t1-t0)/1000.0+
+                                     " s, fontSize "+fontSizeFixed+", msaa "+drawable.getChosenGLCapabilities().getNumSamples()+
+                                     ", "+modeS+"-samples "+vbaaSampleCount[0];
+                renderString(drawable, font, pixelSize, text1,              0, 0, 0, 0, -1000, regionFPS); // no-cache
+            } else {
+                final String text1 = String.format("%03.1f/%03.1f fps, vsync %d, elapsed %4.1f s, fontSize %2.2f, msaa %d, %s-samples %d",
+                        lfps, tfps, gl.getSwapInterval(), (t1-t0)/1000.0, fontSizeFixed,
+                        drawable.getChosenGLCapabilities().getNumSamples(), modeS, vbaaSampleCount[0]);
+                renderString(drawable, font, pixelSize, getFontInfo(),                    0, 0, 0, 0, -1000, true);
+                renderString(drawable, font, pixelSize, "012345678901234567890123456789", 0, 0, 0, -1000, true);
+                renderString(drawable, font, pixelSize, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 0, 0, 0, -1000, true);
+                renderString(drawable, font, pixelSize, "Hello World",                    0, 0, 0, -1000, true);
+                renderString(drawable, font, pixelSize, "4567890123456",                  4, 0, 0, -1000, true);
+                renderString(drawable, font, pixelSize, "I like JogAmp",                  4, 0, 0, -1000, true);
+                renderString(drawable, font, pixelSize, "Hello World",                    0, 0, 0, -1000, true);
+                renderString(drawable, font, pixelSize, textX2,                           0, 0, 0, -1000, true);
+                renderString(drawable, font, pixelSize, text1,                            0, 0, 0, -1000, regionFPS); // no-cache
+                if( TextAnim ) {
+                    renderString(drawable, font, pixelSizeAnim, text1,                   0, 0, 0, -1000, regionFPSAnim); // no-cache
+                }
+            }
+        } };
 
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java
index 75a672a..26fc2e0 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT01.java
@@ -37,6 +37,8 @@ import javax.media.opengl.GLCapabilitiesImmutable;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLProfile;
 
+import jogamp.common.os.PlatformPropsImpl;
+
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.FixMethodOrder;
@@ -45,13 +47,11 @@ import org.junit.runners.MethodSorters;
 import com.jogamp.common.os.Platform;
 import com.jogamp.graph.curve.Region;
 import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.curve.opengl.TextRenderer;
 import com.jogamp.graph.font.FontFactory;
-import com.jogamp.graph.geom.opengl.SVertex;
+import com.jogamp.graph.geom.SVertex;
 import com.jogamp.newt.opengl.GLWindow;
 import com.jogamp.opengl.test.junit.graph.demos.GPUTextRendererListenerBase01;
 import com.jogamp.opengl.test.junit.util.UITestCase;
-import com.jogamp.opengl.util.glsl.ShaderState;
 
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
@@ -60,40 +60,40 @@ public class TestTextRendererNEWT01 extends UITestCase {
     static final boolean TRACE = false;
     static long duration = 100; // ms
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         try {
             return Integer.parseInt(a);
-        } catch (Exception ex) { throw new RuntimeException(ex); }
+        } catch (final Exception ex) { throw new RuntimeException(ex); }
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 duration = atoi(args[i]);
             }
         }
-        String tstname = TestTextRendererNEWT01.class.getName();
+        final String tstname = TestTextRendererNEWT01.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
-    }    
-        
+    }
+
     static void sleep() {
         try {
             System.err.println("** new frame ** (sleep: "+duration+"ms)");
             Thread.sleep(duration);
-        } catch (InterruptedException ie) {}
+        } catch (final InterruptedException ie) {}
     }
-    
-    static void destroyWindow(GLWindow window) {
+
+    static void destroyWindow(final GLWindow window) {
         if(null!=window) {
             window.destroy();
         }
     }
 
-    static GLWindow createWindow(String title, GLCapabilitiesImmutable caps, int width, int height) {
+    static GLWindow createWindow(final String title, final GLCapabilitiesImmutable caps, final int width, final int height) {
         Assert.assertNotNull(caps);
 
-        GLWindow window = GLWindow.create(caps);
+        final GLWindow window = GLWindow.create(caps);
         window.setSize(width, height);
         window.setPosition(10, 10);
         window.setTitle(title);
@@ -105,85 +105,85 @@ public class TestTextRendererNEWT01 extends UITestCase {
 
     @Test
     public void testTextRendererR2T01() throws InterruptedException {
-        if(Platform.CPUFamily.X86 != Platform.CPU_ARCH.family) { // FIXME
+        if(Platform.CPUFamily.X86 != PlatformPropsImpl.CPU_ARCH.family) { // FIXME
             // FIXME: Disabled for now - since it doesn't seem fit for mobile (performance wise).
             System.err.println("disabled on non desktop (x86) arch for now ..");
             return;
         }
-        GLProfile glp = GLProfile.getGL2ES2();
-        
-        GLCapabilities caps = new GLCapabilities(glp);
-        caps.setAlphaBits(4);    
+        final GLProfile glp = GLProfile.getGL2ES2();
+
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setAlphaBits(4);
         System.err.println("Requested: "+caps);
 
-        GLWindow window = createWindow("text-vbaa1-msaa0", caps, 800,400);
+        final GLWindow window = createWindow("text-vbaa1-msaa0", caps, 800,400);
         window.display();
         System.err.println("Chosen: "+window.getChosenGLCapabilities());
-        
-        RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
-        TextGLListener textGLListener = new TextGLListener(rs, Region.VBAA_RENDERING_BIT, DEBUG, TRACE);
+
+        final RenderState rs = RenderState.createRenderState(SVertex.factory());
+        final TextGLListener textGLListener = new TextGLListener(rs, Region.VBAA_RENDERING_BIT, DEBUG, TRACE);
         textGLListener.attachInputListenerTo(window);
         window.addGLEventListener(textGLListener);
-        
+
         if(textGLListener.setFontSet(FontFactory.UBUNTU, 0, 0)) {
-            textGLListener.setTech(-400, -30, 0f, -1000, window.getWidth()*2);
+            textGLListener.setTech(-400, -30, 0f, -1000, 2);
             window.display();
             sleep();
-            
-            textGLListener.setTech(-400, -30, 0, -380, window.getWidth()*3);
+
+            textGLListener.setTech(-400, -30, 0f,  -380, 3);
             window.display();
             sleep();
-            
-            textGLListener.setTech(-400, -20, 0, -80, window.getWidth()*4);
+
+            textGLListener.setTech(-400, -20, 0f,   -80, 4);
             window.display();
             sleep();
         }
 
         if(textGLListener.setFontSet(FontFactory.JAVA, 0, 0)) {
-            textGLListener.setTech(-400, -30, 0f, -1000, window.getWidth()*2);
+            textGLListener.setTech(-400, -30, 0f, -1000, 2);
             window.display();
             sleep();
-            
-            textGLListener.setTech(-400, -30, 0, -380, window.getWidth()*3);
+
+            textGLListener.setTech(-400, -30, 0f,  -380, 3);
             window.display();
             sleep();
-            
-            textGLListener.setTech(-400, -20, 0, -80, window.getWidth()*4);
+
+            textGLListener.setTech(-400, -20, 0f,   -80, 4);
             window.display();
             sleep();
         }
-        
-        destroyWindow(window); 
+
+        destroyWindow(window);
     }
-    
+
     @Test
     public void testTextRendererMSAA01() throws InterruptedException {
-        GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
-        GLCapabilities caps = new GLCapabilities(glp);
-        caps.setAlphaBits(4);    
+        final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setAlphaBits(4);
         caps.setSampleBuffers(true);
         caps.setNumSamples(4);
         System.err.println("Requested: "+caps);
 
-        GLWindow window = createWindow("text-vbaa0-msaa1", caps, 800, 400);
+        final GLWindow window = createWindow("text-vbaa0-msaa1", caps, 800, 400);
         window.display();
         System.err.println("Chosen: "+window.getChosenGLCapabilities());
-        
-        RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
-        TextGLListener textGLListener = new TextGLListener(rs, 0, DEBUG, TRACE);
+
+        final RenderState rs = RenderState.createRenderState(SVertex.factory());
+        final TextGLListener textGLListener = new TextGLListener(rs, 0, DEBUG, TRACE);
         textGLListener.attachInputListenerTo(window);
         window.addGLEventListener(textGLListener);
-        
+
         if(textGLListener.setFontSet(FontFactory.UBUNTU, 0, 0)) {
             textGLListener.setTech(-400, -30, 0f, -1000, 0);
             window.display();
             sleep();
-            
-            textGLListener.setTech(-400, -30, 0, -380, 0);
+
+            textGLListener.setTech(-400, -30, 0,   -380, 0);
             window.display();
             sleep();
-            
-            textGLListener.setTech(-400, -20, 0, -80, 0);
+
+            textGLListener.setTech(-400, -20, 0,    -80, 0);
             window.display();
             sleep();
         }
@@ -192,55 +192,53 @@ public class TestTextRendererNEWT01 extends UITestCase {
             textGLListener.setTech(-400, -30, 0f, -1000, 0);
             window.display();
             sleep();
-            
-            textGLListener.setTech(-400, -30, 0, -380, 0);
+
+            textGLListener.setTech(-400, -30, 0,   -380, 0);
             window.display();
             sleep();
-            
-            textGLListener.setTech(-400, -20, 0, -80, 0);
+
+            textGLListener.setTech(-400, -20, 0,    -80, 0);
             window.display();
             sleep();
         }
-        
-        destroyWindow(window); 
+
+        destroyWindow(window);
     }
-    
-    private class TextGLListener extends GPUTextRendererListenerBase01 {
+
+    private static class TextGLListener extends GPUTextRendererListenerBase01 {
         String winTitle;
-        
-        public TextGLListener(RenderState rs, int type, boolean debug, boolean trace) {
-            super(rs, type, debug, trace);
+
+        public TextGLListener(final RenderState rs, final int type, final boolean debug, final boolean trace) {
+            super(rs, type, 4, true, debug, trace);
         }
-        
-        public void attachInputListenerTo(GLWindow window) {
+
+        public void attachInputListenerTo(final GLWindow window) {
             super.attachInputListenerTo(window);
             winTitle = window.getTitle();
         }
-        public void setTech(float xt, float yt, float angle, int zoom, int fboSize){
-            setMatrix(xt, yt, angle, zoom, fboSize);       
+        public void setTech(final float xt, final float yt, final float angle, final int zoom, final int sampleCount){
+            setMatrix(xt, yt, zoom, angle, sampleCount);
         }
 
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
             super.init(drawable);
-            
-            GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+            final GL2ES2 gl = drawable.getGL().getGL2ES2();
             gl.setSwapInterval(1);
             gl.glEnable(GL.GL_DEPTH_TEST);
-            
-            final TextRenderer textRenderer = (TextRenderer) getRenderer();
-            
-            textRenderer.setAlpha(gl, 1.0f);
-            textRenderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);
+
+            final RenderState rs = getRenderer().getRenderState();
+            rs.setColorStatic(0.1f, 0.1f, 0.1f, 1.0f);
         }
-        
-        public void display(GLAutoDrawable drawable) {
+
+        public void display(final GLAutoDrawable drawable) {
             super.display(drawable);
 
             try {
                 printScreen(drawable, "./", winTitle, false);
-            } catch (GLException e) {
+            } catch (final GLException e) {
                 e.printStackTrace();
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 e.printStackTrace();
             }
         }
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java
index bfa942c..cb9f3e3 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TestTextRendererNEWT10.java
@@ -34,6 +34,7 @@ import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLDrawable;
 import javax.media.opengl.GLProfile;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -42,14 +43,15 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.curve.opengl.TextRenderer;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.curve.opengl.TextRegionUtil;
 import com.jogamp.graph.font.Font;
 import com.jogamp.graph.font.FontFactory;
-import com.jogamp.graph.geom.opengl.SVertex;
+import com.jogamp.graph.geom.SVertex;
 import com.jogamp.opengl.math.geom.AABBox;
 import com.jogamp.opengl.test.junit.util.NEWTGLContext;
 import com.jogamp.opengl.test.junit.util.UITestCase;
-import com.jogamp.opengl.util.glsl.ShaderState;
+import com.jogamp.opengl.util.PMVMatrix;
 
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
@@ -60,9 +62,9 @@ public class TestTextRendererNEWT10 extends UITestCase {
     static boolean forceES2 = false;
     static boolean forceGL3 = false;
     static boolean mainRun = false;
-    
-    static final float[] textPosition = new float[] {0,0,0};
-    static final int[] texSize = new int[] { 0 }; 
+    static boolean useMSAA = true;
+
+    static final int[] texSize = new int[] { 0 };
     static final int fontSize = 24;
     static Font font;
 
@@ -70,38 +72,49 @@ public class TestTextRendererNEWT10 extends UITestCase {
     public static void setup() throws IOException {
         font = FontFactory.get(FontFactory.UBUNTU).getDefault();
     }
-    
-    static int atoi(String a) {
+
+    static int atoi(final String a) {
         try {
             return Integer.parseInt(a);
-        } catch (Exception ex) { throw new RuntimeException(ex); }
+        } catch (final Exception ex) { throw new RuntimeException(ex); }
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         mainRun = true;
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 duration = atoi(args[i]);
+            } else if(args[i].equals("-noMSAA")) {
+                useMSAA = false;
             } else if(args[i].equals("-es2")) {
                 forceES2 = true;
             } else if(args[i].equals("-gl3")) {
                 forceGL3 = true;
             }
         }
-        String tstname = TestTextRendererNEWT10.class.getName();
+        final String tstname = TestTextRendererNEWT10.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
-    }    
-        
+    }
+
     static void sleep() {
         try {
             System.err.println("** new frame ** (sleep: "+duration+"ms)");
             Thread.sleep(duration);
-        } catch (InterruptedException ie) {}
+        } catch (final InterruptedException ie) {}
     }
-    
+
+    // @Test
+    public void test00TextRendererNONE01() throws InterruptedException {
+        testTextRendererImpl(0);
+    }
+
     @Test
     public void testTextRendererMSAA01() throws InterruptedException {
+        testTextRendererImpl(4);
+    }
+
+    void testTextRendererImpl(final int sampleCount) throws InterruptedException {
         final GLProfile glp;
         if(forceGL3) {
             glp = GLProfile.get(GLProfile.GL3);
@@ -111,76 +124,80 @@ public class TestTextRendererNEWT10 extends UITestCase {
             glp = GLProfile.getGL2ES2();
         }
         final GLCapabilities caps = new GLCapabilities( glp );
-        caps.setAlphaBits(4);    
-        caps.setSampleBuffers(true);
-        caps.setNumSamples(4);
+        caps.setAlphaBits(4);
+        if( 0 < sampleCount ) {
+            caps.setSampleBuffers(true);
+            caps.setNumSamples(sampleCount);
+        }
         System.err.println("Requested: "+caps);
 
         final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(caps, 800, 400, true);
         final GLDrawable drawable = winctx.context.getGLDrawable();
         final GL2ES2 gl = winctx.context.getGL().getGL2ES2();
-        System.err.println(winctx.context);
 
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
 
         System.err.println("Chosen: "+winctx.window.getChosenCapabilities());
-        
-        final RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
-        final TextRenderer renderer = TextRenderer.create(rs, 0);
+
+        final RenderState rs = RenderState.createRenderState(SVertex.factory());
+        final RegionRenderer renderer = RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable);
+        rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
+        final TextRegionUtil textRenderUtil = new TextRegionUtil(0);
 
         // init
         gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
-        renderer.init(gl);
-        renderer.setAlpha(gl, 1.0f);
-        renderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);        
+        renderer.init(gl, 0);
+        rs.setColorStatic(0.1f, 0.1f, 0.1f, 1.0f);
 
         // reshape
-        gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());        
+        gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
 
         // renderer.reshapePerspective(gl, 45.0f, drawable.getWidth(), drawable.getHeight(), 0.1f, 1000.0f);
-        renderer.reshapeOrtho(gl, drawable.getWidth(), drawable.getHeight(), 0.1f, 1000.0f);
+        renderer.reshapeOrtho(drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), 0.1f, 1000.0f);
 
         // display
-        gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);            
-        renderString(drawable, gl, renderer, "012345678901234567890123456789", 0,  0, -1000);
-        renderString(drawable, gl, renderer, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 0, -1, -1000);
-        renderString(drawable, gl, renderer, "Hello World", 0, -1, -1000);
-        renderString(drawable, gl, renderer, "4567890123456", 4, -1, -1000);
-        renderString(drawable, gl, renderer, "I like JogAmp", 4, -1, -1000);
-        
+        gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+        renderString(drawable, gl, renderer, textRenderUtil, "012345678901234567890123456789", 0,  0, -1000);
+        renderString(drawable, gl, renderer, textRenderUtil, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", 0, -1, -1000);
+        renderString(drawable, gl, renderer, textRenderUtil, "Hello World", 0, -1, -1000);
+        renderString(drawable, gl, renderer, textRenderUtil, "4567890123456", 4, -1, -1000);
+        renderString(drawable, gl, renderer, textRenderUtil, "I like JogAmp", 4, -1, -1000);
+
         int c = 0;
-        renderString(drawable, gl, renderer, "GlueGen", c++, -1, -1000);
-        renderString(drawable, gl, renderer, "JOAL", c++, -1, -1000);
-        renderString(drawable, gl, renderer, "JOGL", c++, -1, -1000);
-        renderString(drawable, gl, renderer, "JOCL", c++, -1, -1000);
-        
+        renderString(drawable, gl, renderer, textRenderUtil, "GlueGen", c++, -1, -1000);
+        renderString(drawable, gl, renderer, textRenderUtil, "JOAL", c++, -1, -1000);
+        renderString(drawable, gl, renderer, textRenderUtil, "JOGL", c++, -1, -1000);
+        renderString(drawable, gl, renderer, textRenderUtil, "JOCL", c++, -1, -1000);
+
         drawable.swapBuffers();
-        sleep();            
+        sleep();
 
         // dispose
         renderer.destroy(gl);
-        
+
         NEWTGLContext.destroyWindow(winctx);
-    }    
-    int screenshot_num = 0;
-    
+    }
+
     int lastRow = -1;
-    
-    void renderString(GLDrawable drawable, GL2ES2 gl, TextRenderer renderer, String text, int column, int row, int z0) {
-        final int height = drawable.getHeight();
-        
+
+    void renderString(final GLDrawable drawable, final GL2ES2 gl, final RegionRenderer renderer, final TextRegionUtil textRenderUtil, final String text, final int column, int row, final int z0) {
+        final int height = drawable.getSurfaceHeight();
+
         int dx = 0;
-        int dy = height;        
+        int dy = height;
         if(0>row) {
             row = lastRow + 1;
         }
-        AABBox textBox = font.getStringBounds(text, fontSize);
+        final AABBox textBox = font.getMetricBounds(text, fontSize);
         dx += font.getAdvanceWidth('X', fontSize) * column;
         dy -= (int)textBox.getHeight() * ( row + 1 );
-        renderer.resetModelview(null);
-        renderer.translate(gl, dx, dy, z0);
-        renderer.drawString3D(gl, font, text, textPosition, fontSize, texSize);
-        
+
+        final PMVMatrix pmv = renderer.getMatrix();
+        pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+        pmv.glLoadIdentity();
+        pmv.glTranslatef(dx, dy, z0);
+        textRenderUtil.drawString3D(gl, renderer, font, fontSize, text, null, texSize);
+
         lastRow = row;
-    }        
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java b/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java
index 1282d5d..f1a6b76 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/TextRendererGLELBase.java
@@ -34,22 +34,70 @@ import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
+import com.jogamp.graph.curve.opengl.GLRegion;
 import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.curve.opengl.TextRenderer;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.curve.opengl.TextRegionUtil;
 import com.jogamp.graph.font.Font;
 import com.jogamp.graph.font.FontFactory;
-import com.jogamp.graph.geom.opengl.SVertex;
-import com.jogamp.opengl.math.geom.AABBox;
+import com.jogamp.graph.font.FontSet;
+import com.jogamp.graph.geom.SVertex;
+import com.jogamp.newt.Window;
 import com.jogamp.opengl.util.PMVMatrix;
-import com.jogamp.opengl.util.glsl.ShaderState;
 
 public abstract class TextRendererGLELBase implements GLEventListener {
-    protected final float[] textPosition = new float[] {0,0,0};
-    protected final int[] texSize = new int[] { 0 };
+    public final int renderModes;
+
+    protected final int[] vbaaSampleCount;
     protected final float[] staticRGBAColor = new float[] { 1f, 1f, 1f, 1f };
 
-    protected final Font font;
-    protected final int usrRenderModes;
+    private boolean exclusivePMVMatrix = true;
+    private PMVMatrix sharedPMVMatrix = null;
+    private RenderState rs = null;
+    private RegionRenderer.GLCallback enableCallback=null, disableCallback=null;
+    protected RegionRenderer renderer = null;
+    protected TextRegionUtil textRenderUtil = null;
+
+    /** scale pixel, default is 1f */
+    protected float pixelScale = 1.0f;
+
+    /** dpi display resolution, queried at {@link #init(GLAutoDrawable)} if NEWT, otherwise 96. */
+    protected float dpiH = 96;
+
+    boolean flipVerticalInGLOrientation = false;
+
+    /**
+     * @param fontSet e.g. default is {@link FontFactory#UBUNTU}
+     * @param fontFamily e.g. default is {@link FontSet#FAMILY_REGULAR}
+     * @param fontStylebits e.g. default is {@link FontSet#STYLE_NONE}
+     * @return the resulting font.
+     */
+    public static Font getFont(final int fontSet, final int fontFamily, final int fontStylebits) {
+        try {
+            return FontFactory.get(fontSet).get(fontFamily, fontStylebits);
+        } catch (final IOException e) {
+            e.printStackTrace();
+        }
+        return null;
+    }
+
+    /**
+     * @param renderModes
+     * @param sampleCount desired multisampling sample count for msaa-rendering.
+     * @see #setRendererCallbacks(com.jogamp.graph.curve.opengl.RegionRenderer.GLCallback, com.jogamp.graph.curve.opengl.RegionRenderer.GLCallback)
+     */
+    public TextRendererGLELBase(final int renderModes, final int[] sampleCount) {
+        this.renderModes = renderModes;
+        this.vbaaSampleCount = sampleCount;
+    }
+
+    /**
+     * <p>
+     * Must be called before {@link #init(GLAutoDrawable)}.
+     * </p>
+     * @param rs
+     */
+    public void setRenderState(final RenderState rs) { this.rs = rs; }
 
     /**
      * In exclusive mode, impl. uses a pixelScale of 1f and orthogonal PMV on window dimensions
@@ -58,72 +106,63 @@ public abstract class TextRendererGLELBase implements GLEventListener {
      * In non-exclusive mode, i.e. shared w/ custom PMV (within another 3d scene),
      * it uses the custom pixelScale and renderString uses normalized 'height', i.e. '1'.
      * </p>
+     * <p>
+     * Must be called before {@link #init(GLAutoDrawable)}.
+     * </p>
      */
-    protected boolean exclusivePMVMatrix = true;
-    protected PMVMatrix usrPMVMatrix = null;
-    protected RenderState rs = null;
-    protected TextRenderer renderer = null;
-
-    /** font size in pixels, default is 24 */
-    protected int fontSize = 24;
-    /** scale pixel, default is 1f */
-    protected float pixelScale = 1.0f;
-    protected int texSizeScale = 2;
-
-    boolean flipVerticalInGLOrientation = false;
+    public void setSharedPMVMatrix(final PMVMatrix pmv) {
+        this.sharedPMVMatrix = pmv;
+    }
 
-    public TextRendererGLELBase(final int renderModes) {
-        usrRenderModes = renderModes;
-        {
-            Font _font = null;
-            try {
-                _font = FontFactory.get(FontFactory.UBUNTU).getDefault();
-            } catch (IOException e) {
-                e.printStackTrace();
-            }
-            this.font = _font;
-        }
+    /**
+     * See {@link RegionRenderer#create(RenderState, com.jogamp.graph.curve.opengl.RegionRenderer.GLCallback, com.jogamp.graph.curve.opengl.RegionRenderer.GLCallback)}.
+     * <p>
+     * Must be called before {@link #init(GLAutoDrawable)}.
+     * </p>
+     */
+    public void setRendererCallbacks(final RegionRenderer.GLCallback enable, final RegionRenderer.GLCallback disable) {
+        this.enableCallback = enable;
+        this.disableCallback = disable;
     }
 
-    public void setFlipVerticalInGLOrientation(boolean v) { flipVerticalInGLOrientation=v; }
-    public final TextRenderer getRenderer() { return renderer; }
+    public void setFlipVerticalInGLOrientation(final boolean v) { flipVerticalInGLOrientation=v; }
+    public final RegionRenderer getRenderer() { return renderer; }
+    public final TextRegionUtil getTextRenderUtil() { return textRenderUtil; }
 
     @Override
-    public void init(GLAutoDrawable drawable) {
-        if( null != font ) {
-            exclusivePMVMatrix = null == usrPMVMatrix;
-            this.rs = RenderState.createRenderState(new ShaderState(), SVertex.factory(), usrPMVMatrix);
-            this.renderer = TextRenderer.create(rs, usrRenderModes);
-            if( 0 == usrRenderModes ) {
-                texSizeScale = 0;
-            }
-            final GL2ES2 gl = drawable.getGL().getGL2ES2();
-            renderer.init(gl);
-            renderer.setAlpha(gl, staticRGBAColor[3]);
-            renderer.setColorStatic(gl, staticRGBAColor[0], staticRGBAColor[1], staticRGBAColor[2]);
-            final ShaderState st = rs.getShaderState();
-            st.useProgram(gl, false);
-        } else {
-            this.rs = null;
-            this.renderer = null;
+    public void init(final GLAutoDrawable drawable) {
+        if( null == this.rs ) {
+            exclusivePMVMatrix = null == sharedPMVMatrix;
+            this.rs = RenderState.createRenderState(SVertex.factory(), sharedPMVMatrix);
+        }
+        this.renderer = RegionRenderer.create(rs, enableCallback, disableCallback);
+        rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
+        this.textRenderUtil = new TextRegionUtil(renderModes);
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+        renderer.init(gl, renderModes);
+        rs.setColorStatic(staticRGBAColor[0], staticRGBAColor[1], staticRGBAColor[2], staticRGBAColor[3]);
+        renderer.enable(gl, false);
+
+        final Object upObj = drawable.getUpstreamWidget();
+        if( upObj instanceof Window ) {
+            final float[] pixelsPerMM = ((Window)upObj).getPixelsPerMM(new float[2]);
+            dpiH = pixelsPerMM[1]*25.4f;
         }
     }
 
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
         if( null != renderer ) {
             final GL2ES2 gl = drawable.getGL().getGL2ES2();
-            final ShaderState st = rs.getShaderState();
-            st.useProgram(gl, true);
+            renderer.enable(gl, true);
             if( exclusivePMVMatrix ) {
                 // renderer.reshapePerspective(gl, 45.0f, width, height, 0.1f, 1000.0f);
-                renderer.reshapeOrtho(gl, width, height, 0.1f, 1000.0f);
+                renderer.reshapeOrtho(width, height, 0.1f, 1000.0f);
                 pixelScale = 1.0f;
             } else {
-                renderer.reshapeNotify(gl, width, height);
+                renderer.reshapeNotify(width, height);
             }
-            st.useProgram(gl, false);
-            texSize[0] = width * texSizeScale;
+            renderer.enable(gl, false);
         }
     }
 
@@ -131,7 +170,7 @@ public abstract class TextRendererGLELBase implements GLEventListener {
     public abstract void display(GLAutoDrawable drawable);
 
     @Override
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         if( null != renderer ) {
             final GL2ES2 gl = drawable.getGL().getGL2ES2();
             renderer.destroy(gl);
@@ -140,13 +179,63 @@ public abstract class TextRendererGLELBase implements GLEventListener {
 
     int lastRow = -1;
 
-    public void renderString(GLAutoDrawable drawable, String text, int column, float tx, float ty, float tz) {
+    /**
+     *
+     * @param drawable
+     * @param font
+     * @param pixelSize Use {@link Font#getPixelSize(float, float)} for resolution correct pixel-size.
+     * @param text
+     * @param column
+     * @param tx
+     * @param ty
+     * @param tz
+     * @param cacheRegion
+     */
+    public void renderString(final GLAutoDrawable drawable,
+                             final Font font, final float pixelSize, final String text,
+                             final int column, final float tx, final float ty, final float tz, final boolean cacheRegion) {
         final int row = lastRow + 1;
-        renderString(drawable, text, column, row, tx, ty, tz);
-        lastRow = row;
+        renderStringImpl(drawable, font, pixelSize, text, column, row, tx, ty, tz, cacheRegion, null);
     }
 
-    public void renderString(GLAutoDrawable drawable, String text, int column, int row, float tx, float ty, float tz) {
+    public void renderString(final GLAutoDrawable drawable,
+                             final Font font, final float pixelSize, final String text,
+                             final int column, final float tx, final float ty, final float tz, final GLRegion region) {
+        final int row = lastRow + 1;
+        renderStringImpl(drawable, font, pixelSize, text, column, row, tx, ty, tz, false, region);
+    }
+
+    /**
+     *
+     * @param drawable
+     * @param font
+     * @param pixelSize Use {@link Font#getPixelSize(float, float)} for resolution correct pixel-size.
+     * @param text
+     * @param column
+     * @param row
+     * @param tx
+     * @param ty
+     * @param tz
+     * @param cacheRegion
+     */
+    public void renderString(final GLAutoDrawable drawable,
+                             final Font font, final float pixelSize, final String text,
+                             final int column, final int row,
+                             final float tx, final float ty, final float tz, final boolean cacheRegion) {
+        renderStringImpl(drawable, font, pixelSize, text, column, row, tx, ty, tz, cacheRegion, null);
+    }
+
+    public void renderString(final GLAutoDrawable drawable,
+                             final Font font, final float pixelSize, final String text,
+                             final int column, final int row,
+                             final float tx, final float ty, final float tz, final GLRegion region) {
+        renderStringImpl(drawable, font, pixelSize, text, column, row, tx, ty, tz, false, region);
+    }
+
+    private void renderStringImpl(final GLAutoDrawable drawable,
+                                  final Font font, final float pixelSize, final String text,
+                                  final int column, final int row,
+                                  final float tx, final float ty, final float tz, final boolean cacheRegion, final GLRegion region) {
         if( null != renderer ) {
             final GL2ES2 gl = drawable.getGL().getGL2ES2();
 
@@ -156,40 +245,43 @@ public abstract class TextRendererGLELBase implements GLEventListener {
             if( !exclusivePMVMatrix )  {
                 dy = 1f-ty;
             } else {
-                final int height = drawable.getHeight();
+                final int height = drawable.getSurfaceHeight();
                 dy = height-ty;
             }
+            final int newLineCount = TextRegionUtil.getCharCount(text, '\n');
+            final float lineHeight = font.getLineHeight(pixelSize);
+            dx += pixelScale * font.getAdvanceWidth('X', pixelSize) * column;
+            dy -= pixelScale * lineHeight * ( row + 1 );
 
-            final AABBox textBox = font.getStringBounds(text, fontSize);
-            dx += pixelScale * font.getAdvanceWidth('X', fontSize) * column;
-            dy -= pixelScale * (int)textBox.getHeight() * ( row + 1 );
-
-            final ShaderState st = rs.getShaderState();
-            final PMVMatrix pmvMatrix = rs.pmvMatrix();
+            final PMVMatrix pmvMatrix = rs.getMatrix();
             pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
             if( !exclusivePMVMatrix )  {
                 pmvMatrix.glPushMatrix();
             } else {
                 pmvMatrix.glLoadIdentity();
             }
-
-            st.useProgram(gl, true);
-            gl.glEnable(GL2ES2.GL_BLEND);
             pmvMatrix.glTranslatef(dx, dy, tz);
             if( flipVerticalInGLOrientation && drawable.isGLOriented() ) {
                 pmvMatrix.glScalef(pixelScale, -1f*pixelScale, 1f);
             } else if( 1f != pixelScale ) {
                 pmvMatrix.glScalef(pixelScale, pixelScale, 1f);
             }
-            renderer.updateMatrix(gl);
-            renderer.drawString3D(gl, font, text, textPosition, fontSize, texSize);
-            st.useProgram(gl, false);
-            gl.glDisable(GL2ES2.GL_BLEND);
+            renderer.enable(gl, true);
+            if( cacheRegion ) {
+                textRenderUtil.drawString3D(gl, renderer, font, pixelSize, text, null, vbaaSampleCount);
+            } else if( null != region ) {
+                TextRegionUtil.drawString3D(gl, region, renderer, font, pixelSize, text, null, vbaaSampleCount,
+                                            textRenderUtil.tempT1, textRenderUtil.tempT2);
+            } else {
+                TextRegionUtil.drawString3D(gl, renderModes, renderer, font, pixelSize, text, null, vbaaSampleCount,
+                                            textRenderUtil.tempT1, textRenderUtil.tempT2);
+            }
+            renderer.enable(gl, false);
 
             if( !exclusivePMVMatrix )  {
                 pmvMatrix.glPopMatrix();
             }
-            lastRow = -1;
+            lastRow = row + newLineCount;
         }
     }
-}
\ No newline at end of file
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java
index 46557e8..82d129f 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener01.java
@@ -31,26 +31,30 @@ package com.jogamp.opengl.test.junit.graph.demos;
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
+
 import com.jogamp.graph.curve.OutlineShape;
 import com.jogamp.graph.curve.opengl.GLRegion;
-import com.jogamp.graph.curve.opengl.RegionRenderer;
 import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.opengl.util.PMVMatrix;
 
 /** Demonstrate the rendering of multiple outlines into one region/OutlineShape
  *  These Outlines are not necessary connected or contained.
  *  The output of this demo shows two identical shapes but the left one
- *  has some vertices with off-curve flag set to true, and the right allt he vertices 
- *  are on the curve. Demos the Res. Independent Nurbs based Curve rendering 
+ *  has some vertices with off-curve flag set to true, and the right allt he vertices
+ *  are on the curve. Demos the Res. Independent Nurbs based Curve rendering
  *
  */
-public class GPURegionGLListener01 extends GPURegionRendererListenerBase01 {
+public class GPURegionGLListener01 extends GPURendererListenerBase01 {
     OutlineShape outlineShape = null;
-    
-    public GPURegionGLListener01 (RenderState rs, int renderModes, int fbosize, boolean debug, boolean trace) {
-        super(rs, renderModes, debug, trace);
-        setMatrix(-20, 00, 0f, -50, fbosize);
+
+    public GPURegionGLListener01 (final RenderState rs, final int renderModes, final int sampleCount, final boolean debug, final boolean trace) {
+        super(RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable), renderModes, debug, trace);
+        rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
+        setMatrix(-20, 00, -50, 0f, sampleCount);
     }
-    
+
     private void createTestOutline(){
         float offset = 0;
         outlineShape = new OutlineShape(getRenderer().getRenderState().getVertexFactory());
@@ -61,14 +65,14 @@ public class GPURegionGLListener01 extends GPURegionRendererListenerBase01 {
         outlineShape.addVertex(6.0f,15.0f, false);
         outlineShape.addVertex(5.0f,8.0f, false);
         outlineShape.addVertex(0.0f,10.0f,true);
-        outlineShape.closeLastOutline();
+        outlineShape.closeLastOutline(true);
         outlineShape.addEmptyOutline();
         outlineShape.addVertex(5.0f,-5.0f,true);
         outlineShape.addVertex(10.0f,-5.0f, false);
         outlineShape.addVertex(10.0f,0.0f, true);
         outlineShape.addVertex(5.0f,0.0f, false);
-        outlineShape.closeLastOutline();
-        
+        outlineShape.closeLastOutline(true);
+
         /** Same shape as above but without any off-curve vertices */
         offset = 30;
         outlineShape.addEmptyOutline();
@@ -79,47 +83,48 @@ public class GPURegionGLListener01 extends GPURegionRendererListenerBase01 {
         outlineShape.addVertex(offset+7.0f,15.0f, true);
         outlineShape.addVertex(offset+6.0f,8.0f, true);
         outlineShape.addVertex(offset+0.0f,10.0f, true);
-        outlineShape.closeLastOutline();
+        outlineShape.closeLastOutline(true);
         outlineShape.addEmptyOutline();
         outlineShape.addVertex(offset+5.0f,0.0f, true);
         outlineShape.addVertex(offset+5.0f,-5.0f, true);
         outlineShape.addVertex(offset+10.0f,-5.0f, true);
         outlineShape.addVertex(offset+10.0f,0.0f, true);
-        outlineShape.closeLastOutline();
-        
-        region = GLRegion.create(outlineShape, getRenderModes());
+        outlineShape.closeLastOutline(true);
+
+        region = GLRegion.create(getRenderModes(), null);
+        region.addOutlineShape(outlineShape, null, region.hasColorChannel() ? getRenderer().getRenderState().getColorStatic(new float[4]) : null);
     }
 
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         super.init(drawable);
-        
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
 
-        final RegionRenderer regionRenderer = (RegionRenderer) getRenderer();
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+        final RenderState rs = getRenderer().getRenderState();
 
         gl.setSwapInterval(1);
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
-        gl.glEnable(GL2ES2.GL_BLEND);
-        regionRenderer.setAlpha(gl, 1.0f);
-        regionRenderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);
-        
+        gl.glEnable(GL.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_BLEND);
+        rs.setColorStatic(0.0f, 0.0f, 0.0f, 1.0f);
+
         createTestOutline();
     }
 
-    public void display(GLAutoDrawable drawable) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+    public void display(final GLAutoDrawable drawable) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
 
         gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
 
-        final RegionRenderer regionRenderer = (RegionRenderer) getRenderer();
-        
-        regionRenderer.resetModelview(null);
-        regionRenderer.translate(null, getXTran(), getYTran(), getZoom());
-        regionRenderer.rotate(gl, getAngle(), 0, 1, 0);
-        if( weight != regionRenderer.getWeight()) {
-            regionRenderer.setWeight(gl, weight);
+        final RegionRenderer regionRenderer = getRenderer();
+        final PMVMatrix pmv = regionRenderer.getMatrix();
+        pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+        pmv.glLoadIdentity();
+        pmv.glTranslatef(getXTran(), getYTran(), getZTran());
+        pmv.glRotatef(getAngle(), 0, 1, 0);
+        if( weight != regionRenderer.getRenderState().getWeight() ) {
+            regionRenderer.getRenderState().setWeight(weight);
         }
-        regionRenderer.draw(gl, region, getPosition(), getTexSize());
-    }        
+        region.draw(gl, regionRenderer, getSampleCount());
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java
index 525c5e6..2486b58 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionGLListener02.java
@@ -28,97 +28,107 @@
 
 package com.jogamp.opengl.test.junit.graph.demos;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import com.jogamp.graph.curve.OutlineShape;
 import com.jogamp.graph.curve.opengl.GLRegion;
-import com.jogamp.graph.curve.opengl.RegionRenderer;
 import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.opengl.util.PMVMatrix;
 
 /** Demonstrate the rendering of multiple OutlineShapes
  *  into one region
  *
  */
-public class GPURegionGLListener02 extends GPURegionRendererListenerBase01 {
-    OutlineShape[] outlineShapes = new OutlineShape[2];
+public class GPURegionGLListener02 extends GPURendererListenerBase01 {
+    List<OutlineShape> outlineShapes = new ArrayList<OutlineShape>();
 
-    public GPURegionGLListener02 (RenderState rs, int renderModes, int fbosize, boolean debug, boolean trace) {
-        super(rs, renderModes, debug, trace);
-        setMatrix(-20, 00, 0f, -50, fbosize);
+    public GPURegionGLListener02 (final RenderState rs, final int renderModes, final int sampleCount, final boolean debug, final boolean trace) {
+        super(RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable), renderModes, debug, trace);
+        rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
+        setMatrix(-20, 00, -50, 0f, sampleCount);
     }
-        
+
     private void createTestOutline(){
         float offset = 0;
-        outlineShapes[0] = new OutlineShape(getRenderer().getRenderState().getVertexFactory());
-        outlineShapes[0].addVertex(0.0f,-10.0f,true);
-        outlineShapes[0].addVertex(15.0f,-10.0f, true);
-        outlineShapes[0].addVertex(10.0f,5.0f, false);
-        outlineShapes[0].addVertex(15.0f,10.0f, true);
-        outlineShapes[0].addVertex(6.0f,15.0f, false);
-        outlineShapes[0].addVertex(5.0f,8.0f, false);
-        outlineShapes[0].addVertex(0.0f,10.0f,true);
-        outlineShapes[0].closeLastOutline();
-        outlineShapes[0].addEmptyOutline();
-        outlineShapes[0].addVertex(5.0f,-5.0f,true);
-        outlineShapes[0].addVertex(10.0f,-5.0f, false);
-        outlineShapes[0].addVertex(10.0f,0.0f, true);
-        outlineShapes[0].addVertex(5.0f,0.0f, false);
-        outlineShapes[0].closeLastOutline();
-        
+        OutlineShape shape = new OutlineShape(getRenderer().getRenderState().getVertexFactory());
+        outlineShapes.add(shape);
+        shape.addVertex(0.0f,-10.0f,true);
+        shape.addVertex(15.0f,-10.0f, true);
+        shape.addVertex(10.0f,5.0f, false);
+        shape.addVertex(15.0f,10.0f, true);
+        shape.addVertex(6.0f,15.0f, false);
+        shape.addVertex(5.0f,8.0f, false);
+        shape.addVertex(0.0f,10.0f,true);
+        shape.closeLastOutline(true);
+        shape.addEmptyOutline();
+        shape.addVertex(5.0f,-5.0f,true);
+        shape.addVertex(10.0f,-5.0f, false);
+        shape.addVertex(10.0f,0.0f, true);
+        shape.addVertex(5.0f,0.0f, false);
+        shape.closeLastOutline(true);
+
         /** Same shape as above but without any off-curve vertices */
-        outlineShapes[1] = new OutlineShape(getRenderer().getRenderState().getVertexFactory());
+        shape = new OutlineShape(getRenderer().getRenderState().getVertexFactory());
+        outlineShapes.add(shape);
         offset = 30;
-        outlineShapes[1].addVertex(offset+0.0f,-10.0f, true);
-        outlineShapes[1].addVertex(offset+17.0f,-10.0f, true);
-        outlineShapes[1].addVertex(offset+11.0f,5.0f, true);
-        outlineShapes[1].addVertex(offset+16.0f,10.0f, true);
-        outlineShapes[1].addVertex(offset+7.0f,15.0f, true);
-        outlineShapes[1].addVertex(offset+6.0f,8.0f, true);
-        outlineShapes[1].addVertex(offset+0.0f,10.0f, true);
-        outlineShapes[1].closeLastOutline();
-        outlineShapes[1].addEmptyOutline();
-        outlineShapes[1].addVertex(offset+5.0f,0.0f, true);
-        outlineShapes[1].addVertex(offset+5.0f,-5.0f, true);
-        outlineShapes[1].addVertex(offset+10.0f,-5.0f, true);
-        outlineShapes[1].addVertex(offset+10.0f,0.0f, true);
-        outlineShapes[1].closeLastOutline();
-        
-        region = GLRegion.create(outlineShapes, getRenderModes());
+        shape.addVertex(offset+0.0f,-10.0f, true);
+        shape.addVertex(offset+17.0f,-10.0f, true);
+        shape.addVertex(offset+11.0f,5.0f, true);
+        shape.addVertex(offset+16.0f,10.0f, true);
+        shape.addVertex(offset+7.0f,15.0f, true);
+        shape.addVertex(offset+6.0f,8.0f, true);
+        shape.addVertex(offset+0.0f,10.0f, true);
+        shape.closeLastOutline(true);
+        shape.addEmptyOutline();
+        shape.addVertex(offset+5.0f,0.0f, true);
+        shape.addVertex(offset+5.0f,-5.0f, true);
+        shape.addVertex(offset+10.0f,-5.0f, true);
+        shape.addVertex(offset+10.0f,0.0f, true);
+        shape.closeLastOutline(true);
+
+        region = GLRegion.create(getRenderModes(), null);
+        region.addOutlineShapes(outlineShapes, null, null);
     }
 
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         super.init(drawable);
-        
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
 
-        final RegionRenderer regionRenderer = (RegionRenderer) getRenderer();
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+        final RenderState rs = getRenderer().getRenderState();
 
         gl.setSwapInterval(1);
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
-        gl.glEnable(GL2ES2.GL_BLEND);
-        regionRenderer.setAlpha(gl, 1.0f);
-        regionRenderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);
-        
+        gl.glEnable(GL.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_BLEND);
+        rs.setColorStatic(0.0f, 0.0f, 0.0f, 1.0f);
+
         createTestOutline();
     }
 
-    public void display(GLAutoDrawable drawable) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+    public void display(final GLAutoDrawable drawable) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
 
         gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
 
-        final RegionRenderer regionRenderer = (RegionRenderer) getRenderer();
-        
-        regionRenderer.resetModelview(null);
-        regionRenderer.translate(null, getXTran(), getYTran(), getZoom());
-        regionRenderer.rotate(gl, getAngle(), 0, 1, 0);
-        if( weight != regionRenderer.getWeight()) {
-            regionRenderer.setWeight(gl, weight);
+        final RegionRenderer regionRenderer = getRenderer();
+
+        final PMVMatrix pmv = regionRenderer.getMatrix();
+        pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+        pmv.glLoadIdentity();
+        pmv.glTranslatef(getXTran(), getYTran(), getZTran());
+        pmv.glRotatef(getAngle(), 0, 1, 0);
+        if( weight != regionRenderer.getRenderState().getWeight() ) {
+            regionRenderer.getRenderState().setWeight(weight);
         }
-        regionRenderer.draw(gl, region, getPosition(), getTexSize());            
-        
-    }        
+        region.draw(gl, regionRenderer, getSampleCount());
+
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo.java
new file mode 100644
index 0000000..77456d5
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo.java
@@ -0,0 +1,156 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.graph.demos;
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+
+import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.geom.SVertex;
+import com.jogamp.newt.event.KeyAdapter;
+import com.jogamp.newt.event.KeyEvent;
+import com.jogamp.newt.event.WindowAdapter;
+import com.jogamp.newt.event.WindowEvent;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.util.Animator;
+
+/** Demonstrate the rendering of multiple outlines into one region/OutlineShape
+ *  These Outlines are not necessary connected or contained.
+ *  The output of this demo shows two identical shapes but the left one
+ *  has some vertices with off-curve flag set to true, and the right allt he vertices
+ *  are on the curve. Demos the Res. Independent Nurbs based Curve rendering
+ *
+ */
+public class GPURegionNewtDemo {
+    static final boolean DEBUG = false;
+    static final boolean TRACE = false;
+
+    static int SceneMSAASamples = 0;
+    static int GraphVBAASamples = 4;
+    static int GraphMSAASamples = 0;
+    static boolean GraphUseWeight = true;
+
+    public static void main(final String[] args) {
+        int width = 800, height = 400;
+        int x = 10, y = 10;
+        if( 0 != args.length ) {
+            SceneMSAASamples = 0;
+            GraphMSAASamples = 0;
+            GraphVBAASamples = 0;
+            GraphUseWeight = false;
+
+            for(int i=0; i<args.length; i++) {
+                if(args[i].equals("-smsaa")) {
+                    i++;
+                    SceneMSAASamples = MiscUtils.atoi(args[i], SceneMSAASamples);
+                } else if(args[i].equals("-gmsaa")) {
+                    i++;
+                    GraphMSAASamples = MiscUtils.atoi(args[i], GraphMSAASamples);
+                    GraphVBAASamples = 0;
+                } else if(args[i].equals("-gvbaa")) {
+                    i++;
+                    GraphMSAASamples = 0;
+                    GraphVBAASamples = MiscUtils.atoi(args[i], GraphVBAASamples);
+                } else if(args[i].equals("-gweight")) {
+                    GraphUseWeight = true;
+                } else if(args[i].equals("-width")) {
+                    i++;
+                    width = MiscUtils.atoi(args[i], width);
+                } else if(args[i].equals("-height")) {
+                    i++;
+                    height = MiscUtils.atoi(args[i], height);
+                } else if(args[i].equals("-x")) {
+                    i++;
+                    x = MiscUtils.atoi(args[i], x);
+                } else if(args[i].equals("-y")) {
+                    i++;
+                    y = MiscUtils.atoi(args[i], y);
+                }
+            }
+        }
+        System.err.println("Desired win size "+width+"x"+height);
+        System.err.println("Desired win pos  "+x+"/"+y);
+        System.err.println("Scene MSAA Samples "+SceneMSAASamples);
+        System.err.println("Graph MSAA Samples"+GraphMSAASamples);
+        System.err.println("Graph VBAA Samples "+GraphVBAASamples);
+        System.err.println("Graph Weight Mode "+GraphUseWeight);
+
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setAlphaBits(4);
+        if( SceneMSAASamples > 0 ) {
+            caps.setSampleBuffers(true);
+            caps.setNumSamples(SceneMSAASamples);
+        }
+        System.out.println("Requested: " + caps);
+
+        int rmode = GraphUseWeight ? Region.VARWEIGHT_RENDERING_BIT : 0;
+        int sampleCount = 0;
+        if( GraphVBAASamples > 0 ) {
+            rmode |= Region.VBAA_RENDERING_BIT;
+            sampleCount += GraphVBAASamples;
+        } else if( GraphMSAASamples > 0 ) {
+            rmode |= Region.MSAA_RENDERING_BIT;
+            sampleCount += GraphMSAASamples;
+        }
+
+        final GLWindow window = GLWindow.create(caps);
+        window.setPosition(x, y);
+        window.setSize(width, height);
+        window.setTitle("GPU Curve Region Newt Demo - graph[vbaa"+GraphVBAASamples+" msaa"+GraphMSAASamples+"], msaa "+SceneMSAASamples);
+
+        final RenderState rs = RenderState.createRenderState(SVertex.factory());
+        final GPURegionGLListener01 regionGLListener = new GPURegionGLListener01 (rs, rmode, sampleCount, DEBUG, TRACE);
+        regionGLListener.attachInputListenerTo(window);
+        window.addGLEventListener(regionGLListener);
+        window.setVisible(true);
+
+        //FPSAnimator animator = new FPSAnimator(60);
+        final Animator animator = new Animator();
+        animator.setUpdateFPSFrames(60, System.err);
+        animator.add(window);
+
+        window.addKeyListener(new KeyAdapter() {
+            public void keyPressed(final KeyEvent arg0) {
+                if(arg0.getKeyCode() == KeyEvent.VK_F4) {
+                    window.destroy();
+                }
+            }
+        });
+        window.addWindowListener(new WindowAdapter() {
+            public void windowDestroyed(final WindowEvent e) {
+                animator.stop();
+            }
+        });
+
+        animator.start();
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo01.java
deleted file mode 100644
index 160dc0f..0000000
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo01.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package com.jogamp.opengl.test.junit.graph.demos;
-
-import javax.media.opengl.FPSCounter;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.graph.curve.Region;
-import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.geom.opengl.SVertex;
-import com.jogamp.newt.event.KeyAdapter;
-import com.jogamp.newt.event.KeyEvent;
-import com.jogamp.newt.event.WindowAdapter;
-import com.jogamp.newt.event.WindowEvent;
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.glsl.ShaderState;
-
-/** Demonstrate the rendering of multiple outlines into one region/OutlineShape
- *  These Outlines are not necessary connected or contained.
- *  The output of this demo shows two identical shapes but the left one
- *  has some vertices with off-curve flag set to true, and the right allt he vertices 
- *  are on the curve. Demos the Res. Independent Nurbs based Curve rendering 
- *
- */
-public class GPURegionNewtDemo01 {
-    static final boolean DEBUG = false;
-    static final boolean TRACE = false;
-    
-    public static void main(String[] args) {
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
-        caps.setAlphaBits(4);
-        caps.setSampleBuffers(true);
-        caps.setNumSamples(4); // 2 samples is not enough ..
-        System.out.println("Requested: " + caps);
-        
-        final GLWindow window = GLWindow.create(caps);
-        window.setPosition(10, 10);
-        window.setSize(800, 400);
-        window.setTitle("GPU Curve Region Newt Demo 01 - vbaa0 msaa1");
-        
-        RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
-        GPURegionGLListener01 regionGLListener = new GPURegionGLListener01 (rs, Region.VARIABLE_CURVE_WEIGHT_BIT, 0, DEBUG, TRACE);
-        regionGLListener.attachInputListenerTo(window);                
-        window.addGLEventListener(regionGLListener);
-
-        window.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);     
-        window.setVisible(true);
-
-        //FPSAnimator animator = new FPSAnimator(60);
-        final Animator animator = new Animator();
-        animator.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);
-        animator.add(window);
-        
-        window.addKeyListener(new KeyAdapter() {
-            public void keyPressed(KeyEvent arg0) {
-                if(arg0.getKeyCode() == KeyEvent.VK_F4) {
-                    window.destroy();
-                }
-            }
-        });
-        window.addWindowListener(new WindowAdapter() {
-            public void windowDestroyed(WindowEvent e) {
-                animator.stop();
-            }
-        });
-                
-        animator.start();
-    }    
-}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo02.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo02.java
deleted file mode 100644
index e7b5c73..0000000
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionNewtDemo02.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package com.jogamp.opengl.test.junit.graph.demos;
-
-import javax.media.opengl.FPSCounter;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.graph.curve.Region;
-import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.geom.opengl.SVertex;
-import com.jogamp.newt.event.KeyAdapter;
-import com.jogamp.newt.event.KeyEvent;
-import com.jogamp.newt.event.WindowAdapter;
-import com.jogamp.newt.event.WindowEvent;
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.glsl.ShaderState;
-
-/** Demonstrate the rendering of multiple OutlineShapes
- *  into one region
- *
- */
-public class GPURegionNewtDemo02 {
-    static final boolean DEBUG = false;
-    static final boolean TRACE = false;
-    
-    public static void main(String[] args) {
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
-        caps.setAlphaBits(4);               
-        System.out.println("Requested: " + caps);
-        
-        final GLWindow window = GLWindow.create(caps);
-        window.setPosition(10, 10);
-        window.setSize(800, 400);
-        window.setTitle("GPU Curve Region Newt Demo 02 - vbaa1 msaa0");
-                
-        RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
-        GPURegionGLListener02  regionGLListener = new GPURegionGLListener02 (rs, Region.VBAA_RENDERING_BIT|Region.VARIABLE_CURVE_WEIGHT_BIT, 1140, DEBUG, TRACE); 
-        regionGLListener.attachInputListenerTo(window);                
-        window.addGLEventListener(regionGLListener);
-             
-        window.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);
-        window.setVisible(true);
-
-        //FPSAnimator animator = new FPSAnimator(60);
-        final Animator animator = new Animator();
-        animator.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);
-        animator.add(window);
-        
-        window.addKeyListener(new KeyAdapter() {
-            public void keyPressed(KeyEvent arg0) {
-                if(arg0.getKeyCode() == KeyEvent.VK_F4) {
-                    window.destroy();
-                }
-            }
-        });
-        window.addWindowListener(new WindowAdapter() {
-            public void windowDestroyed(WindowEvent e) {
-                animator.stop();
-            }
-        });
-                
-        animator.start();
-    }    
-}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionRendererListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionRendererListenerBase01.java
deleted file mode 100644
index 8439d1f..0000000
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURegionRendererListenerBase01.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.opengl.test.junit.graph.demos;
-
-import com.jogamp.graph.curve.OutlineShape;
-import com.jogamp.graph.curve.opengl.RegionRenderer;
-import com.jogamp.graph.curve.opengl.RenderState;
-
-/**
- *
- * Action Keys:
- * - 1/2: zoom in/out
- * - 3/4: font +/-
- * - 6/7: 2nd pass texture size
- * - 0/9: rotate 
- * - s: toogle draw 'font set'
- * - f: toggle draw fps
- * - v: toggle v-sync
- * - space: toggle font (ubuntu/java)
- */
-public abstract class GPURegionRendererListenerBase01 extends GPURendererListenerBase01 {
-    OutlineShape outlineShape = null;
-
-    public GPURegionRendererListenerBase01(RenderState rs, int renderModes, boolean debug, boolean trace) {
-        super(RegionRenderer.create(rs, renderModes), renderModes, debug, trace);
-    }        
-}
\ No newline at end of file
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java
index 4ebb937..159d4b8 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPURendererListenerBase01.java
@@ -41,76 +41,86 @@ import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLPipelineFactory;
 import javax.media.opengl.GLRunnable;
-
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import com.jogamp.graph.curve.Region;
 import com.jogamp.graph.curve.opengl.GLRegion;
-import com.jogamp.graph.curve.opengl.Renderer;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.curve.opengl.RenderState;
 import com.jogamp.newt.event.KeyEvent;
 import com.jogamp.newt.event.KeyListener;
 import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.math.geom.AABBox;
 import com.jogamp.opengl.util.GLReadBufferUtil;
+import com.jogamp.opengl.util.PMVMatrix;
 
 /**
  *
  * Action Keys:
  * - 1/2: zoom in/out
  * - 6/7: 2nd pass texture size
- * - 0/9: rotate 
+ * - 0/9: rotate
  * - Q/W: change weight
  * - v: toggle v-sync
  * - s: screenshot
  */
 public abstract class GPURendererListenerBase01 implements GLEventListener {
-    private GLReadBufferUtil screenshot;
-    private Renderer renderer;
-    private int renderModes;
-    private boolean debug;
-    private boolean trace;
-    
+    private final RegionRenderer renderer;
+    private final int renderModes;
+    private final boolean debug;
+    private final boolean trace;
+
     protected GLRegion region;
 
+    private final GLReadBufferUtil screenshot;
+
     private KeyAction keyAction;
-    
+
     private volatile GLAutoDrawable autoDrawable = null;
-    
+
     private final float[] position = new float[] {0,0,0};
-    
+
+    protected final float zNear = 0.1f, zFar = 7000f;
+    /** Describing the bounding box in model-coordinates of the near-plane parallel at distance one. */
+    protected final AABBox nearPlane1Box;
+
     private float xTran = -10;
-    private float yTran =  10;    
+    private float yTran =  10;
     private float ang = 0f;
-    private float zoom = -70f;
-    private int[] texSize = new int[] { 400 }; 
+    private float zTran = -70f;
+    private final int[] sampleCount = new int[] { 4 };
 
     protected volatile float weight = 1.0f;
     boolean ignoreInput = false;
 
-    public GPURendererListenerBase01(Renderer renderer, int renderModes, boolean debug, boolean trace) {
+    public GPURendererListenerBase01(final RegionRenderer renderer, final int renderModes, final boolean debug, final boolean trace) {
         this.renderer = renderer;
         this.renderModes = renderModes;
         this.debug = debug;
         this.trace = trace;
         this.screenshot = new GLReadBufferUtil(false, false);
+        nearPlane1Box = new AABBox();
     }
-    
-    public final Renderer getRenderer() { return renderer; }
+
+    public final RegionRenderer getRenderer() { return renderer; }
     public final int getRenderModes() { return renderModes; }
-    public final float getZoom() { return zoom; }
+    public final float getZTran() { return zTran; }
     public final float getXTran() { return xTran; }
     public final float getYTran() { return yTran; }
     public final float getAngle() { return ang; }
-    public final int[] getTexSize() { return texSize; }
+    public final int[] getSampleCount() { return sampleCount; }
     public final float[] getPosition() { return position; }
 
-    public void setMatrix(float xtrans, float ytrans, float angle, int zoom, int fbosize) {
+    public void setMatrix(final float xtrans, final float ytrans, final float zTran, final float angle, final int sampleCount) {
         this.xTran = xtrans;
-        this.yTran = ytrans; 
-        this.ang = angle;  
-        this.zoom = zoom;
-        this.texSize[0] = fbosize;     
+        this.yTran = ytrans;
+        this.zTran = zTran;
+        this.ang = angle;
+        this.sampleCount[0] = sampleCount;
     }
-    
-    public void init(GLAutoDrawable drawable) {
+
+    @Override
+    public void init(final GLAutoDrawable drawable) {
         autoDrawable = drawable;
         GL2ES2 gl = drawable.getGL().getGL2ES2();
         if(debug) {
@@ -123,97 +133,131 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
         System.err.println("*** GLDebugMessage "+gl.getContext().isGLDebugMessageEnabled());
         MSAATool.dump(drawable);
         gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
-        getRenderer().init(gl);
+        getRenderer().init(gl, renderModes);
     }
-    
-    public void reshape(GLAutoDrawable drawable, int xstart, int ystart, int width, int height) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
-        gl.glViewport(xstart, ystart, width, height);        
-        renderer.reshapePerspective(gl, 45.0f, width, height, 0.1f, 7000.0f);
-        
+
+    public static void mapWin2ObjectCoords(final PMVMatrix pmv, final int[] view,
+                                           final float zNear, final float zFar,
+                                           final float orthoX, final float orthoY, final float orthoDist,
+                                           final float[] winZ, final float[] objPos) {
+        winZ[0] = (1f/zNear-1f/orthoDist)/(1f/zNear-1f/zFar);
+        pmv.gluUnProject(orthoX, orthoY, winZ[0], view, 0, objPos, 0);
+    }
+
+    @Override
+    public void reshape(final GLAutoDrawable drawable, final int xstart, final int ystart, final int width, final int height) {
+        final PMVMatrix pmv = renderer.getMatrix();
+        renderer.reshapePerspective(45.0f, width, height, zNear, zFar);
+        pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+        pmv.glLoadIdentity();
+        System.err.printf("Reshape: zNear %f,  zFar %f%n", zNear, zFar);
+        System.err.printf("Reshape: Frustum: %s%n", pmv.glGetFrustum());
+        {
+            final float orthoDist = 1f;
+            final float[] obj00Coord = new float[3];
+            final float[] obj11Coord = new float[3];
+            final float[] winZ = new float[1];
+            final int[] view = new int[] { 0, 0, width, height };
+
+            mapWin2ObjectCoords(pmv, view, zNear, zFar, 0f, 0f, orthoDist, winZ, obj00Coord);
+            System.err.printf("Reshape: mapped.00: [%f, %f, %f], winZ %f -> [%f, %f, %f]%n", 0f, 0f, orthoDist, winZ[0], obj00Coord[0], obj00Coord[1], obj00Coord[2]);
+
+            mapWin2ObjectCoords(pmv, view, zNear, zFar, width, height, orthoDist, winZ, obj11Coord);
+            System.err.printf("Reshape: mapped.11: [%f, %f, %f], winZ %f -> [%f, %f, %f]%n", (float)width, (float)height, orthoDist, winZ[0], obj11Coord[0], obj11Coord[1], obj11Coord[2]);
+
+            nearPlane1Box.setSize( obj00Coord[0],  // lx
+                                   obj00Coord[1],  // ly
+                                   obj00Coord[2],  // lz
+                                   obj11Coord[0],  // hx
+                                   obj11Coord[1],  // hy
+                                   obj11Coord[2] );// hz
+            System.err.printf("Reshape: dist1Box: %s%n", nearPlane1Box);
+        }
+
         dumpMatrix();
-        System.err.println("Reshape: "+renderer.getRenderState());        
+        // System.err.println("Reshape: "+renderer.getRenderState());
     }
-    
-    public void dispose(GLAutoDrawable drawable) {
+
+    @Override
+    public void dispose(final GLAutoDrawable drawable) {
         autoDrawable = null;
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
         if(null != region) {
-            region.destroy(gl, renderer.getRenderState());
+            region.destroy(gl);
         }
         screenshot.dispose(gl);
         renderer.destroy(gl);
-    }    
-    
-    public void zoom(int v){
-        zoom += v;
+    }
+
+    public void zoom(final int v){
+        zTran += v;
         dumpMatrix();
     }
-    
-    public void move(float x, float y){
+
+    public void move(final float x, final float y){
         xTran += x;
         yTran += y;
         dumpMatrix();
     }
-    public void rotate(float delta){
+    public void rotate(final float delta){
         ang += delta;
         ang %= 360.0f;
         dumpMatrix();
     }
-    public void editGlobalWeight(float delta) {
-        if( !Renderer.isWeightValid(weight+delta) ) {
+    public void editGlobalWeight(final float delta) {
+        if( !RenderState.isWeightValid(weight+delta) ) {
             return;
         }
         weight += delta;
         System.err.println("Global Weight: "+ weight);
     }
-    
+
     void dumpMatrix() {
-        System.err.println("Matrix: " + xTran + "/" + yTran + " x"+zoom + " @"+ang);
+        System.err.println("Matrix: " + xTran + " / " + yTran + " / "+zTran + " @ "+ang);
     }
-    
-    /** Attach the input listener to the window */ 
-    public void attachInputListenerTo(GLWindow window) {
+
+    /** Attach the input listener to the window */
+    public void attachInputListenerTo(final GLWindow window) {
         if ( null == keyAction ) {
             keyAction = new KeyAction();
-            window.addKeyListener(keyAction);        
+            window.addKeyListener(keyAction);
         }
     }
-    
-    public void detachInputListenerFrom(GLWindow window) {
+
+    public void detachInputListenerFrom(final GLWindow window) {
         if ( null == keyAction ) {
             return;
         }
         window.removeKeyListener(keyAction);
     }
-    
-    public void printScreen(GLAutoDrawable drawable, String dir, String tech, String objName, boolean exportAlpha) throws GLException, IOException {
-        StringWriter sw = new StringWriter();
-        PrintWriter pw = new PrintWriter(sw);
-        pw.printf("-%03dx%03d-Z%04d-T%04d-%s", drawable.getWidth(), drawable.getHeight(), (int)Math.abs(zoom), texSize[0], objName);
-        
+
+    public void printScreen(final GLAutoDrawable drawable, final String dir, final String tech, final String objName, final boolean exportAlpha) throws GLException, IOException {
+        final StringWriter sw = new StringWriter();
+        final PrintWriter pw = new PrintWriter(sw);
+        pw.printf("-%03dx%03d-Z%04d-S%02d-%s", drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), (int)Math.abs(zTran), sampleCount[0], objName);
+
         final String filename = dir + tech + sw +".png";
         if(screenshot.readPixels(drawable.getGL(), false)) {
             screenshot.write(new File(filename));
         }
     }
-    
+
     int screenshot_num = 0;
 
-    public void setIgnoreInput(boolean v) {
+    public void setIgnoreInput(final boolean v) {
         ignoreInput = v;
     }
     public boolean getIgnoreInput() {
         return ignoreInput;
     }
-    
+
     public class KeyAction implements KeyListener {
-        public void keyPressed(KeyEvent arg0) {
+        @Override
+        public void keyPressed(final KeyEvent arg0) {
             if(ignoreInput) {
                 return;
             }
-            
+
             if(arg0.getKeyCode() == KeyEvent.VK_1){
                 zoom(10);
             }
@@ -227,25 +271,25 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
                 move(0, 1);
             }
             else if(arg0.getKeyCode() == KeyEvent.VK_LEFT){
-                move(1, 0);
+                move(-1, 0);
             }
             else if(arg0.getKeyCode() == KeyEvent.VK_RIGHT){
-                move(-1, 0);
+                move(1, 0);
             }
             else if(arg0.getKeyCode() == KeyEvent.VK_6){
-                texSize[0] -= 10;
-                System.err.println("Tex Size: " + texSize[0]);
+                sampleCount[0] -= 1;
+                System.err.println("Sample Count: " + sampleCount[0]);
             }
             else if(arg0.getKeyCode() == KeyEvent.VK_7){
-                texSize[0] += 10;
-                System.err.println("Tex Size: " + texSize[0]);
-            }            
+                sampleCount[0] += 1;
+                System.err.println("Sample Count: " + sampleCount[0]);
+            }
             else if(arg0.getKeyCode() == KeyEvent.VK_0){
                 rotate(1);
             }
             else if(arg0.getKeyCode() == KeyEvent.VK_9){
                 rotate(-1);
-            }  
+            }
             else if(arg0.getKeyCode() == KeyEvent.VK_Q){
                 editGlobalWeight(-0.1f);
             }
@@ -255,9 +299,10 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
             else if(arg0.getKeyCode() == KeyEvent.VK_V) {
                 if(null != autoDrawable) {
                     autoDrawable.invoke(false, new GLRunnable() {
-                        public boolean run(GLAutoDrawable drawable) {
-                            GL gl = drawable.getGL();
-                            int i = gl.getSwapInterval();      
+                        @Override
+                        public boolean run(final GLAutoDrawable drawable) {
+                            final GL gl = drawable.getGL();
+                            int i = gl.getSwapInterval();
                             i = i==0 ? 1 : 0;
                             gl.setSwapInterval(i);
                             final GLAnimatorControl a = drawable.getAnimator();
@@ -271,28 +316,31 @@ public abstract class GPURendererListenerBase01 implements GLEventListener {
                             return true;
                         }
                     });
-                }                
+                }
             }
             else if(arg0.getKeyCode() == KeyEvent.VK_S){
                 rotate(-1);
                     if(null != autoDrawable) {
                         autoDrawable.invoke(false, new GLRunnable() {
-                            public boolean run(GLAutoDrawable drawable) {
+                            @Override
+                            public boolean run(final GLAutoDrawable drawable) {
                                 try {
-                                    final String type = Region.isVBAA(renderModes) ? "vbaa0-msaa1" : "vbaa1-msaa0" + ( Region.isNonUniformWeight(renderModes) ? "-vc" : "-uc" ) ; 
+                                    final String modeS = Region.getRenderModeString(renderModes);
+                                    final String type = modeS + ( Region.hasVariableWeight(renderModes) ? "-vc" : "-uc" ) ;
                                     printScreen(drawable, "./", "demo-"+type, "snap"+screenshot_num, false);
                                     screenshot_num++;
-                                } catch (GLException e) {
+                                } catch (final GLException e) {
                                     e.printStackTrace();
-                                } catch (IOException e) {
+                                } catch (final IOException e) {
                                     e.printStackTrace();
-                                }     
+                                }
                                 return true;
                             }
                         });
-                    }                
-            }  
+                    }
+            }
         }
-        public void keyReleased(KeyEvent arg0) {}
+        @Override
+        public void keyReleased(final KeyEvent arg0) {}
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java
index 5c7d15a..6028793 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextGLListener0A.java
@@ -28,45 +28,44 @@
 package com.jogamp.opengl.test.junit.graph.demos;
 
 
+import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAutoDrawable;
 
+import com.jogamp.graph.curve.Region;
 import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.curve.opengl.TextRenderer;
-import com.jogamp.graph.geom.opengl.SVertex;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.geom.SVertex;
 import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.util.glsl.ShaderState;
 
 public class GPUTextGLListener0A extends GPUTextRendererListenerBase01 {
-    
+
     public GPUTextGLListener0A() {
-        this( RenderState.createRenderState(new ShaderState(), SVertex.factory()), 0, 0, false, false ) ;
+        super(RenderState.createRenderState(SVertex.factory()), Region.VBAA_RENDERING_BIT, 4, true, false, false);
     }
-    
-    public GPUTextGLListener0A(RenderState rs, int numpass, int fbosize, boolean debug, boolean trace) {
-        super(rs, numpass, debug, trace);
-        setMatrix(-400, -30, 0f, -500, fbosize); 
+
+    public GPUTextGLListener0A(final RenderState rs, final int renderModes, final int sampleCount, final boolean blending, final boolean debug, final boolean trace) {
+        super(rs, renderModes, sampleCount, blending, debug, trace);
     }
-    
-    public void init(GLAutoDrawable drawable) {
+
+    public void init(final GLAutoDrawable drawable) {
         if(drawable instanceof GLWindow) {
             final GLWindow glw = (GLWindow) drawable;
             attachInputListenerTo(glw);
-        }        
+        }
         super.init(drawable);
-        
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
-        final TextRenderer textRenderer = (TextRenderer) getRenderer();
-        
+
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+        final RenderState rs = getRenderer().getRenderState();
+
         gl.setSwapInterval(1);
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
-        gl.glEnable(GL2ES2.GL_BLEND);
-        textRenderer.setAlpha(gl, 1.0f);
-        textRenderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);
+        gl.glEnable(GL.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_BLEND);
+        rs.setColorStatic(0.1f, 0.1f, 0.1f, 1.0f);
     }
-    
-    public void dispose(GLAutoDrawable drawable) {
+
+    public void dispose(final GLAutoDrawable drawable) {
         if(drawable instanceof GLWindow) {
             final GLWindow glw = (GLWindow) drawable;
             detachInputListenerFrom(glw);
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java
new file mode 100644
index 0000000..cba70c0
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo.java
@@ -0,0 +1,153 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.junit.graph.demos;
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+
+import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.geom.SVertex;
+import com.jogamp.newt.event.KeyAdapter;
+import com.jogamp.newt.event.KeyEvent;
+import com.jogamp.newt.event.WindowAdapter;
+import com.jogamp.newt.event.WindowEvent;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.util.Animator;
+
+public class GPUTextNewtDemo {
+    /**
+     * FIXME:
+     *
+     * If DEBUG is enabled:
+     *
+     * Caused by: javax.media.opengl.GLException: Thread[main-Display-X11_:0.0-1-EDT-1,5,main] glGetError() returned the following error codes after a call to glFramebufferRenderbuffer(<int> 0x8D40, <int> 0x1902, <int> 0x8D41, <int> 0x1): GL_INVALID_ENUM ( 1280 0x500),
+     * at javax.media.opengl.DebugGL4bc.checkGLGetError(DebugGL4bc.java:33961)
+     * at javax.media.opengl.DebugGL4bc.glFramebufferRenderbuffer(DebugGL4bc.java:33077)
+     * at jogamp.graph.curve.opengl.VBORegion2PGL3.initFBOTexture(VBORegion2PGL3.java:295)
+     */
+    static final boolean DEBUG = false;
+    static final boolean TRACE = false;
+
+    static int SceneMSAASamples = 0;
+    static int GraphVBAASamples = 4;
+    static int GraphMSAASamples = 0;
+
+    public static void main(final String[] args) {
+        int width = 800, height = 400;
+        int x = 10, y = 10;
+        if( 0 != args.length ) {
+            SceneMSAASamples = 0;
+            GraphMSAASamples = 0;
+            GraphVBAASamples = 0;
+
+            for(int i=0; i<args.length; i++) {
+                if(args[i].equals("-smsaa")) {
+                    i++;
+                    SceneMSAASamples = MiscUtils.atoi(args[i], SceneMSAASamples);
+                } else  if(args[i].equals("-gmsaa")) {
+                    i++;
+                    GraphMSAASamples = MiscUtils.atoi(args[i], GraphMSAASamples);
+                    GraphVBAASamples = 0;
+                } else if(args[i].equals("-gvbaa")) {
+                    i++;
+                    GraphMSAASamples = 0;
+                    GraphVBAASamples = MiscUtils.atoi(args[i], GraphVBAASamples);
+                } else if(args[i].equals("-width")) {
+                    i++;
+                    width = MiscUtils.atoi(args[i], width);
+                } else if(args[i].equals("-height")) {
+                    i++;
+                    height = MiscUtils.atoi(args[i], height);
+                } else if(args[i].equals("-x")) {
+                    i++;
+                    x = MiscUtils.atoi(args[i], x);
+                } else if(args[i].equals("-y")) {
+                    i++;
+                    y = MiscUtils.atoi(args[i], y);
+                }
+            }
+        }
+        System.err.println("Desired win size "+width+"x"+height);
+        System.err.println("Desired win pos  "+x+"/"+y);
+        System.err.println("Scene MSAA Samples "+SceneMSAASamples);
+        System.err.println("Graph MSAA Samples "+GraphMSAASamples);
+        System.err.println("Graph VBAA Samples "+GraphVBAASamples);
+
+        final GLProfile glp = GLProfile.getGL2ES2();
+
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setAlphaBits(4);
+        if( SceneMSAASamples > 0 ) {
+            caps.setSampleBuffers(true);
+            caps.setNumSamples(SceneMSAASamples);
+        }
+        System.out.println("Requested: " + caps);
+
+        int rmode = 0; // Region.VARIABLE_CURVE_WEIGHT_BIT;
+        int sampleCount = 0;
+        if( GraphVBAASamples > 0 ) {
+            rmode |= Region.VBAA_RENDERING_BIT;
+            sampleCount += GraphVBAASamples;
+        } else if( GraphMSAASamples > 0 ) {
+            rmode |= Region.MSAA_RENDERING_BIT;
+            sampleCount += GraphMSAASamples;
+        }
+
+        final GLWindow window = GLWindow.create(caps);
+        window.setPosition(x, y);
+        window.setSize(width, height);
+        window.setTitle("GPU Text Newt Demo - graph[vbaa"+GraphVBAASamples+" msaa"+GraphMSAASamples+"], msaa "+SceneMSAASamples);
+
+        final RenderState rs = RenderState.createRenderState(SVertex.factory());
+        final GPUTextGLListener0A textGLListener = new GPUTextGLListener0A(rs, rmode, sampleCount, true, DEBUG, TRACE);
+        // ((TextRenderer)textGLListener.getRenderer()).setCacheLimit(32);
+        window.addGLEventListener(textGLListener);
+        window.setVisible(true);
+        // FPSAnimator animator = new FPSAnimator(60);
+        final Animator animator = new Animator();
+        animator.setUpdateFPSFrames(60, System.err);
+        animator.add(window);
+
+        window.addKeyListener(new KeyAdapter() {
+            public void keyPressed(final KeyEvent arg0) {
+                if(arg0.getKeyCode() == KeyEvent.VK_F4) {
+                    window.destroy();
+                }
+            }
+        });
+        window.addWindowListener(new WindowAdapter() {
+            public void windowDestroyed(final WindowEvent e) {
+                animator.stop();
+            }
+        });
+
+        animator.start();
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo01.java
deleted file mode 100644
index d257f78..0000000
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo01.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.opengl.test.junit.graph.demos;
-
-
-import javax.media.opengl.FPSCounter;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLProfile;
-
-
-import com.jogamp.graph.curve.opengl.GLRegion;
-import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.geom.opengl.SVertex;
-import com.jogamp.newt.event.KeyAdapter;
-import com.jogamp.newt.event.KeyEvent;
-import com.jogamp.newt.event.WindowAdapter;
-import com.jogamp.newt.event.WindowEvent;
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.glsl.ShaderState;
-
-public class GPUTextNewtDemo01 {
-    static final boolean DEBUG = false;
-    static final boolean TRACE = false;
-    
-    public static void main(String[] args) {
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
-        caps.setAlphaBits(4);
-        caps.setSampleBuffers(true);
-        caps.setNumSamples(4); // 2 samples is not enough ..
-        System.out.println("Requested: "+caps);
-        
-        final GLWindow window = GLWindow.create(caps);        
-        window.setPosition(10, 10);
-        window.setSize(800, 400);
-        window.setTitle("GPU Text Newt Demo 01 - vbaa0 msaa1");
-        
-        final RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
-        GPUTextGLListener0A textGLListener = new GPUTextGLListener0A(rs, 0, 0, DEBUG, TRACE);
-        window.addGLEventListener(textGLListener);
-        window.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);        
-        
-        final Animator animator = new Animator();
-        animator.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);
-        animator.add(window);
-        
-        window.addKeyListener(new KeyAdapter() {
-            public void keyPressed(KeyEvent arg0) {
-                if(arg0.getKeyCode() == KeyEvent.VK_F4) {
-                    window.destroy();
-                }
-            }
-        });
-        window.addWindowListener(new WindowAdapter() {
-            public void windowDestroyed(WindowEvent e) {
-                animator.stop();
-            }
-        });
-        
-        window.setVisible(true);
-        // FPSAnimator animator = new FPSAnimator(10);
-        animator.start();
-    }    
-}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo02.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo02.java
deleted file mode 100644
index 1b71cd7..0000000
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextNewtDemo02.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.opengl.test.junit.graph.demos;
-
-import javax.media.opengl.FPSCounter;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.graph.curve.Region;
-import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.geom.opengl.SVertex;
-import com.jogamp.newt.event.KeyAdapter;
-import com.jogamp.newt.event.KeyEvent;
-import com.jogamp.newt.event.WindowAdapter;
-import com.jogamp.newt.event.WindowEvent;
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.glsl.ShaderState;
-
-public class GPUTextNewtDemo02 {
-    /**
-     * FIXME:
-     * 
-     * If DEBUG is enabled:
-     *  
-     * Caused by: javax.media.opengl.GLException: Thread[main-Display-X11_:0.0-1-EDT-1,5,main] glGetError() returned the following error codes after a call to glFramebufferRenderbuffer(<int> 0x8D40, <int> 0x1902, <int> 0x8D41, <int> 0x1): GL_INVALID_ENUM ( 1280 0x500), 
-     * at javax.media.opengl.DebugGL4bc.checkGLGetError(DebugGL4bc.java:33961)
-     * at javax.media.opengl.DebugGL4bc.glFramebufferRenderbuffer(DebugGL4bc.java:33077)
-     * at jogamp.graph.curve.opengl.VBORegion2PGL3.initFBOTexture(VBORegion2PGL3.java:295)
-     */
-    static final boolean DEBUG = false;
-    static final boolean TRACE = false;
-    
-    public static void main(String[] args) {
-        GLProfile glp = GLProfile.getGL2ES2();
-        
-        GLCapabilities caps = new GLCapabilities(glp);
-        caps.setAlphaBits(4);        
-        System.out.println("Requested: "+caps);
-        
-        final GLWindow window = GLWindow.create(caps);
-        
-        window.setPosition(10, 10);
-        window.setSize(800, 400);        
-        window.setTitle("GPU Text Newt Demo 02 - vbaa1 msaa0");
-        
-        RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
-        GPUTextGLListener0A textGLListener = new GPUTextGLListener0A(rs, Region.VBAA_RENDERING_BIT, window.getWidth()*3, DEBUG, TRACE);
-        // ((TextRenderer)textGLListener.getRenderer()).setCacheLimit(32);
-        window.addGLEventListener(textGLListener);
-        
-        window.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);        
-        window.setVisible(true);
-        // FPSAnimator animator = new FPSAnimator(60);
-        final Animator animator = new Animator();
-        animator.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);
-        animator.add(window);
-        
-        window.addKeyListener(new KeyAdapter() {
-            public void keyPressed(KeyEvent arg0) {
-                if(arg0.getKeyCode() == KeyEvent.VK_F4) {
-                    window.destroy();
-                }
-            }
-        });
-        window.addWindowListener(new WindowAdapter() {
-            public void windowDestroyed(WindowEvent e) {
-                animator.stop();
-            }
-        });
-                
-        animator.start();
-    }    
-}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java
index 1dc104c..bb688f9 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUTextRendererListenerBase01.java
@@ -34,15 +34,21 @@ import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAnimatorControl;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLException;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
+import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
 import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.curve.opengl.TextRenderer;
+import com.jogamp.graph.curve.opengl.TextRegionUtil;
 import com.jogamp.graph.font.Font;
 import com.jogamp.graph.font.FontFactory;
+import com.jogamp.newt.Window;
 import com.jogamp.newt.event.KeyEvent;
 import com.jogamp.newt.event.KeyListener;
 import com.jogamp.newt.opengl.GLWindow;
 import com.jogamp.opengl.math.geom.AABBox;
+import com.jogamp.opengl.util.PMVMatrix;
 
 /**
  *
@@ -52,7 +58,7 @@ import com.jogamp.opengl.math.geom.AABBox;
  * - 0/9: rotate
  * - v: toggle v-sync
  * - s: screenshot
- * 
+ *
  * Additional Keys:
  * - 3/4: font +/-
  * - h: toogle draw 'font set'
@@ -61,232 +67,351 @@ import com.jogamp.opengl.math.geom.AABBox;
  * - i: live input text input (CR ends it, backspace supported)
  */
 public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerBase01 {
+    public final TextRegionUtil textRegionUtil;
+    private final GLRegion regionFPS, regionBottom;
     int fontSet = FontFactory.UBUNTU;
     Font font;
-    
+
     int headType = 0;
-    boolean drawFPS = false;
-    final int fontSizeFixed = 6;
-    int fontSize = 40;
+    boolean drawFPS = true;
+    final float fontSizeFName = 8f;
+    final float fontSizeFPS = 10f;
+    final int[] sampleCountFPS = new int[] { 8 };
+    float fontSizeHead = 12f;
+    float fontSizeBottom = 16f;
+    float dpiH = 96;
     final int fontSizeModulo = 100;
     String fontName;
     AABBox fontNameBox;
     String headtext;
     AABBox headbox;
-    
+
     static final String text1 = "abcdefghijklmnopqrstuvwxyz\nABCDEFGHIJKLMNOPQRSTUVWXYZ\n0123456789.:,;(*!?/\\\")$%^&-+@~#<>{}[]";
     static final String text2 = "The quick brown fox jumps over the lazy dog";
-    static final String textX = 
+    static final String textX =
         "JOGAMP graph demo using Resolution Independent NURBS\n"+
         "JOGAMP JOGL - OpenGL ES2 profile\n"+
         "Press 1/2 to zoom in/out the below text\n"+
+        "Press 3/4 to incr/decs font size (alt: head, w/o bottom)\n"+
         "Press 6/7 to edit texture size if using VBAA\n"+
         "Press 0/9 to rotate the below string\n"+
         "Press v to toggle vsync\n"+
         "Press i for live input text input (CR ends it, backspace supported)\n"+
-        "Press f to toggle fps. H for different text, space for font type\n"; 
-    
-    static final String textX2 = 
+        "Press f to toggle fps. H for different text, space for font type\n";
+
+    static final String textX2 =
         "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nec sapien tellus. \n"+
         "Ut purus odio, rhoncus sit amet commodo eget, ullamcorper vel urna. Mauris ultricies \n"+
         "quam iaculis urna cursus ornare. Nullam ut felis a ante ultrices ultricies nec a elit. \n"+
-        "In hac habitasse platea dictumst. Vivamus et mi a quam lacinia pharetra at venenatis est.\n"+ 
+        "In hac habitasse platea dictumst. Vivamus et mi a quam lacinia pharetra at venenatis est.\n"+
         "Morbi quis bibendum nibh. Donec lectus orci, sagittis in consequat nec, volutpat nec nisi.\n"+
         "Donec ut dolor et nulla tristique varius. In nulla magna, fermentum id tempus quis, semper \n"+
         "in lorem. Maecenas in ipsum ac justo scelerisque sollicitudin. Quisque sit amet neque lorem,\n" +
-        "-------Press H to change text---------\n"; 
-    
+        "-------Press H to change text---------";
+
     StringBuilder userString = new StringBuilder();
     boolean userInput = false;
-    
-    public GPUTextRendererListenerBase01(RenderState rs, int modes, boolean debug, boolean trace) {
-        super(TextRenderer.create(rs, modes), modes, debug, trace);
+    public GPUTextRendererListenerBase01(final RenderState rs, final int renderModes, final int sampleCount, final boolean blending, final boolean debug, final boolean trace) {
+        // NOTE_ALPHA_BLENDING: We use alpha-blending
+        super(RegionRenderer.create(rs, blending ? RegionRenderer.defaultBlendEnable : null,
+                                    blending ? RegionRenderer.defaultBlendDisable : null),
+                                    renderModes, debug, trace);
+        rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
+        this.textRegionUtil = new TextRegionUtil(renderModes);
+        this.regionFPS = GLRegion.create(renderModes, null);
+        this.regionBottom = GLRegion.create(renderModes, null);
         try {
             this.font = FontFactory.get(fontSet).getDefault();
             dumpFontNames();
-            
+
             this.fontName = font.toString();
-            this.fontNameBox = font.getStringBounds(fontName, fontSizeFixed*2);
-            switchHeadBox();        
-        } catch (IOException ioe) {
-            System.err.println("Catched: "+ioe.getMessage());
+        } catch (final IOException ioe) {
+            System.err.println("Caught: "+ioe.getMessage());
             ioe.printStackTrace();
         }
+        setMatrix(0, 0, 0, 0f, sampleCount);
     }
 
     void dumpFontNames() {
         System.err.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
         System.err.println(font.getAllNames(null, "\n"));
-        System.err.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");        
+        System.err.println("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++");
     }
-    
+
     void switchHeadBox() {
-        headType = ( headType + 1 ) % 4 ; 
+        headType = ( headType + 1 ) % 4 ;
         switch(headType) {
           case 0:
               headtext = null;
               break;
-              
+
           case 1:
               headtext= textX2;
               break;
           case 2:
               headtext= textX;
               break;
-              
+
           default:
-              headtext = text1;              
+              headtext = text1;
         }
         if(null != headtext) {
-            headbox = font.getStringBounds(headtext, fontSizeFixed*3);
+            headbox = font.getMetricBounds(headtext, font.getPixelSize(fontSizeHead, dpiH));
+        }
+    }
+
+    @Override
+    public void init(final GLAutoDrawable drawable) {
+        super.init(drawable);
+        final Object upObj = drawable.getUpstreamWidget();
+        if( upObj instanceof Window ) {
+            final float[] pixelsPerMM = new float[2];
+            ((Window)upObj).getPixelsPerMM(pixelsPerMM);
+            dpiH = pixelsPerMM[1]*25.4f;
         }
+        fontNameBox = font.getMetricBounds(fontName, font.getPixelSize(fontSizeFName, dpiH));
+        switchHeadBox();
+
     }
 
-    public void display(GLAutoDrawable drawable) {
-        final int width = drawable.getWidth();
-        final int height = drawable.getHeight();
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
-        gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f); // Demo02 needs to have this set here as well .. hmm ?
+    @Override
+    public void reshape(final GLAutoDrawable drawable, final int xstart, final int ystart, final int width, final int height) {
+        super.reshape(drawable, xstart, ystart, width, height);
+        final float dist = 100f;
+        nearPlaneX0 = nearPlane1Box.getMinX() * dist;
+        nearPlaneY0 = nearPlane1Box.getMinY() * dist;
+        nearPlaneZ0 = nearPlane1Box.getMinZ() * dist;
+        final float xd = nearPlane1Box.getWidth() * dist;
+        final float yd = nearPlane1Box.getHeight() * dist;
+        nearPlaneSx = xd  / width;
+        nearPlaneSy = yd / height;
+        nearPlaneS = nearPlaneSy;
+        System.err.printf("Scale: [%f x %f] / [%d x %d] = [%f, %f] -> %f%n", xd, yd, width, height, nearPlaneSx, nearPlaneSy, nearPlaneS);
+    }
+    float nearPlaneX0, nearPlaneY0, nearPlaneZ0, nearPlaneSx, nearPlaneSy, nearPlaneS;
+
+    @Override
+    public void dispose(final GLAutoDrawable drawable) {
+        regionFPS.destroy(drawable.getGL().getGL2ES2());
+        regionBottom.destroy(drawable.getGL().getGL2ES2());
+        super.dispose(drawable);
+    }
+
+    @Override
+    public void display(final GLAutoDrawable drawable) {
+        final int width = drawable.getSurfaceWidth();
+        final int height = drawable.getSurfaceHeight();
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+        gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
 
-        final TextRenderer textRenderer = (TextRenderer) getRenderer();
-        textRenderer.reshapeOrtho(null, width, height, 0.1f, 7000.0f);
-        textRenderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);
-        final GLAnimatorControl animator = drawable.getAnimator();
-        final boolean _drawFPS = drawFPS && null != animator && animator.getTotalFPSFrames()>10;
-        
-        if(_drawFPS) {
-            final float fps = animator.getTotalFPS();
-            final String fpsS = String.valueOf(fps);
-            final int fpsSp = fpsS.indexOf('.');
-            textRenderer.resetModelview(null);
-            textRenderer.translate(gl, fontSizeFixed, fontSizeFixed, -6000);
-            textRenderer.drawString3D(gl, font, fpsS.substring(0, fpsSp+2)+" fps", getPosition(), fontSizeFixed*3, getTexSize());
+        // final float zDistance0 =   500f;
+        // final float zDistance1 =   400f;
+        // final float[] objPos = new float[3];
+        // final float[] winZ = new float[1];
+        // final int[] view = new int[] { 0, 0, drawable.getWidth(),  drawable.getHeight() };
+
+        final RegionRenderer renderer = getRenderer();
+        final RenderState rs = renderer.getRenderState();
+        final PMVMatrix pmv = renderer.getMatrix();
+        pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+        pmv.glLoadIdentity();
+        rs.setColorStatic(0.1f, 0.1f, 0.1f, 1.0f);
+        final float pixelSizeFName = font.getPixelSize(fontSizeFName, dpiH);
+        final float pixelSizeHead = font.getPixelSize(fontSizeHead, dpiH);
+        final float pixelSizeBottom = font.getPixelSize(fontSizeBottom, dpiH);
+
+        if( drawFPS ) {
+            final float pixelSizeFPS = font.getPixelSize(fontSizeFPS, dpiH);
+            final float lfps, tfps, td;
+            final GLAnimatorControl animator = drawable.getAnimator();
+            if( null != animator ) {
+                lfps = animator.getLastFPS();
+                tfps = animator.getTotalFPS();
+                td = animator.getTotalFPSDuration()/1000f;
+            } else {
+                lfps = 0f;
+                tfps = 0f;
+                td = 0f;
+            }
+            final String modeS = Region.getRenderModeString(regionFPS.getRenderModes());
+            final String text = String.format("%03.1f/%03.1f fps, v-sync %d, fontSize [head %.1f, bottom %.1f], %s-samples [%d, this %d], td %4.1f, blend %b, alpha-bits %d",
+                    lfps, tfps, gl.getSwapInterval(), fontSizeHead, fontSizeBottom, modeS, getSampleCount()[0], sampleCountFPS[0], td,
+                    renderer.getRenderState().isHintMaskSet(RenderState.BITHINT_BLENDING_ENABLED),
+                    drawable.getChosenGLCapabilities().getAlphaBits());
+
+            // bottom, half line up
+            pmv.glTranslatef(nearPlaneX0, nearPlaneY0+(nearPlaneS * pixelSizeFPS / 2f), nearPlaneZ0);
+
+            // No cache, keep region alive!
+            TextRegionUtil.drawString3D(gl, regionFPS, renderer, font, nearPlaneS * pixelSizeFPS, text, null, sampleCountFPS,
+                                        textRegionUtil.tempT1, textRegionUtil.tempT2);
         }
-        
-        int dx = width-(int)fontNameBox.getWidth()-2 ;
-        int dy = height - 10;        
-        
-        textRenderer.resetModelview(null);
-        textRenderer.translate(gl, dx, dy, -6000);
-        textRenderer.drawString3D(gl, font, fontName, getPosition(), fontSizeFixed*2, getTexSize());
-        
-        dx  =  10;
-        dy += -(int)fontNameBox.getHeight() - 10;
-        
-        if(null != headtext) { 
-            textRenderer.resetModelview(null);
-            textRenderer.translate(gl, dx, dy, -6000);
-            textRenderer.drawString3D(gl, font, headtext, getPosition(), fontSizeFixed*3, getTexSize());
+
+        float dx = width-fontNameBox.getWidth()-2f;
+        float dy = height - 10f;
+
+        pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+        pmv.glLoadIdentity();
+        pmv.glTranslatef(nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy), nearPlaneZ0);
+        // System.err.printf("FontN: [%f %f] -> [%f %f]%n", dx, dy, nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy));
+        textRegionUtil.drawString3D(gl, renderer, font, nearPlaneS * pixelSizeFName, fontName, null, getSampleCount());
+
+        dx  =  10f;
+        dy += -fontNameBox.getHeight() - 10f;
+
+        if(null != headtext) {
+            pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+            pmv.glLoadIdentity();
+            // System.err.printf("Head: [%f %f] -> [%f %f]%n", dx, dy, nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy));
+            pmv.glTranslatef(nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy), nearPlaneZ0);
+            // pmv.glTranslatef(x0, y1, z0);
+            textRegionUtil.drawString3D(gl, renderer, font, nearPlaneS * pixelSizeHead, headtext, null, getSampleCount());
         }
-        
-        textRenderer.reshapePerspective(null, 45.0f, width, height, 0.1f, 7000.0f);             
 
-        textRenderer.resetModelview(null);            
-        textRenderer.translate(null, getXTran(), getYTran(), getZoom());
-        textRenderer.rotate(gl, getAngle(), 0, 1, 0);
-        textRenderer.setColorStatic(gl, 1.0f, 0.0f, 0.0f);
+        dy += -headbox.getHeight() - font.getLineHeight(pixelSizeBottom);
+
+        pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+        pmv.glLoadIdentity();
+        pmv.glTranslatef(nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy), nearPlaneZ0);
+        // System.err.printf("Bottom: [%f %f] -> [%f %f]%n", dx, dy, nearPlaneX0+(dx*nearPlaneSx), nearPlaneY0+(dy*nearPlaneSy));
+        pmv.glTranslatef(getXTran(), getYTran(), getZTran());
+        pmv.glRotatef(getAngle(), 0, 1, 0);
+        rs.setColorStatic(0.9f, 0.0f, 0.0f, 1.0f);
+
+        if( bottomTextUseFrustum ) {
+            regionBottom.setFrustum(pmv.glGetFrustum());
+        }
         if(!userInput) {
-            textRenderer.drawString3D(gl, font, text2, getPosition(), fontSize, getTexSize());
+            if( bottomTextUseFrustum ) {
+                TextRegionUtil.drawString3D(gl, regionBottom, renderer, font, nearPlaneS * pixelSizeBottom, text2, null, getSampleCount(),
+                                            textRegionUtil.tempT1, textRegionUtil.tempT2);
+            } else {
+                textRegionUtil.drawString3D(gl, renderer, font, nearPlaneS * pixelSizeBottom, text2, null, getSampleCount());
+            }
         } else {
-            textRenderer.drawString3D(gl, font, userString.toString(), getPosition(), fontSize, getTexSize());
+            if( bottomTextUseFrustum ) {
+                TextRegionUtil.drawString3D(gl, regionBottom, renderer, font, nearPlaneS * pixelSizeBottom, userString.toString(), null, getSampleCount(),
+                                            textRegionUtil.tempT1, textRegionUtil.tempT2);
+            } else {
+                textRegionUtil.drawString3D(gl, renderer, font, nearPlaneS * pixelSizeBottom, userString.toString(), null, getSampleCount());
+            }
         }
-    }        
-        
-    public void fontIncr(int v) {
-        fontSize = Math.abs((fontSize + v) % fontSizeModulo) ;
+    }
+    final boolean bottomTextUseFrustum = true;
+
+    public void fontBottomIncr(final int v) {
+        fontSizeBottom = Math.abs((fontSizeBottom + v) % fontSizeModulo) ;
         dumpMatrix(true);
     }
 
-    public boolean nextFontSet() {        
+    public void fontHeadIncr(final int v) {
+        fontSizeHead = Math.abs((fontSizeHead + v) % fontSizeModulo) ;
+        if(null != headtext) {
+            headbox = font.getMetricBounds(headtext, font.getPixelSize(fontSizeHead, dpiH));
+        }
+    }
+
+    public boolean nextFontSet() {
         try {
-            int set = ( fontSet == FontFactory.UBUNTU ) ? FontFactory.JAVA : FontFactory.UBUNTU ;
-            Font _font = FontFactory.get(set).getDefault();
+            final int set = ( fontSet == FontFactory.UBUNTU ) ? FontFactory.JAVA : FontFactory.UBUNTU ;
+            final Font _font = FontFactory.get(set).getDefault();
             if(null != _font) {
                 fontSet = set;
                 font = _font;
                 fontName = font.getFullFamilyName(null).toString();
-                fontNameBox = font.getStringBounds(fontName, fontSizeFixed*3);       
+                fontNameBox = font.getMetricBounds(fontName, font.getPixelSize(fontSizeFName, dpiH));
                 dumpFontNames();
                 return true;
             }
-        } catch (IOException ex) {
-            System.err.println("Catched: "+ex.getMessage());
+        } catch (final IOException ex) {
+            System.err.println("Caught: "+ex.getMessage());
         }
         return false;
     }
-    
-    public boolean setFontSet(int set, int family, int stylebits) {
+
+    public boolean setFontSet(final int set, final int family, final int stylebits) {
         try {
-            Font _font = FontFactory.get(set).get(family, stylebits);
+            final Font _font = FontFactory.get(set).get(family, stylebits);
             if(null != _font) {
                 fontSet = set;
                 font = _font;
                 fontName = font.getFullFamilyName(null).toString();
-                fontNameBox = font.getStringBounds(fontName, fontSizeFixed*3);       
+                fontNameBox = font.getMetricBounds(fontName, font.getPixelSize(fontSizeFName, dpiH));
                 dumpFontNames();
                 return true;
             }
-        } catch (IOException ex) {
-            System.err.println("Catched: "+ex.getMessage());
+        } catch (final IOException ex) {
+            System.err.println("Caught: "+ex.getMessage());
         }
         return false;
     }
-    
+
     public boolean isUserInputMode() { return userInput; }
-    
-    void dumpMatrix(boolean bbox) {
-        System.err.println("Matrix: " + getXTran() + "/" + getYTran() + " x"+getZoom() + " @"+getAngle() +" fontSize "+fontSize);
+
+    void dumpMatrix(final boolean bbox) {
+        System.err.println("Matrix: " + getXTran() + "/" + getYTran() + " x"+getZTran() + " @"+getAngle() +" fontSize "+fontSizeBottom);
         if(bbox) {
-            System.err.println("bbox: "+font.getStringBounds(text2, fontSize));
+            System.err.println("bbox: "+font.getMetricBounds(text2, nearPlaneS * font.getPixelSize(fontSizeBottom, dpiH)));
         }
     }
-    
+
     KeyAction keyAction = null;
-    
+
     @Override
-    public void attachInputListenerTo(GLWindow window) {
+    public void attachInputListenerTo(final GLWindow window) {
         if ( null == keyAction ) {
             keyAction = new KeyAction();
             window.addKeyListener(keyAction);
-            super.attachInputListenerTo(window);            
-        }                
+            super.attachInputListenerTo(window);
+        }
     }
 
     @Override
-    public void detachInputListenerFrom(GLWindow window) {
+    public void detachInputListenerFrom(final GLWindow window) {
         super.detachInputListenerFrom(window);
         if ( null == keyAction ) {
             return;
         }
         window.removeKeyListener(keyAction);
     }
-    
-    public void printScreen(GLAutoDrawable drawable, String dir, String tech, boolean exportAlpha) throws GLException, IOException {
-        final String fn = font.getFullFamilyName(null).toString();        
+
+    public void printScreen(final GLAutoDrawable drawable, final String dir, final String tech, final boolean exportAlpha) throws GLException, IOException {
+        final String fn = font.getFullFamilyName(null).toString();
         printScreen(drawable, dir, tech, fn.replace(' ', '_'), exportAlpha);
     }
-    
+
+    float fontHeadScale = 1f;
+
     public class KeyAction implements KeyListener {
-        public void keyPressed(KeyEvent e) {
+        @Override
+        public void keyPressed(final KeyEvent e) {
             if(userInput) {
                 return;
             }
-            final short s = e.getKeySymbol(); 
+            final short s = e.getKeySymbol();
             if(s == KeyEvent.VK_3) {
-                fontIncr(10);
+                if( e.isAltDown() ) {
+                    fontHeadIncr(1);
+                } else {
+                    fontBottomIncr(1);
+                }
             }
             else if(s == KeyEvent.VK_4) {
-                fontIncr(-10);
+                if( e.isAltDown() ) {
+                    fontHeadIncr(-1);
+                } else {
+                    fontBottomIncr(-1);
+                }
             }
             else if(s == KeyEvent.VK_H) {
                 switchHeadBox();
-            }  
+            }
             else if(s == KeyEvent.VK_F) {
-                drawFPS = !drawFPS; 
-            }  
-            else if(s == KeyEvent.VK_SPACE) {      
+                drawFPS = !drawFPS;
+            }
+            else if(s == KeyEvent.VK_SPACE) {
                 nextFontSet();
             }
             else if(s == KeyEvent.VK_I) {
@@ -294,12 +419,13 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
                 setIgnoreInput(true);
             }
         }
-        
-        public void keyReleased(KeyEvent e) {
+
+        @Override
+        public void keyReleased(final KeyEvent e) {
             if( !e.isPrintableKey() || e.isAutoRepeat() ) {
                 return;
-            }            
-            if(userInput) {                
+            }
+            if(userInput) {
                 final short k = e.getKeySymbol();
                 if( KeyEvent.VK_ENTER == k ) {
                     userInput = false;
@@ -308,7 +434,7 @@ public abstract class GPUTextRendererListenerBase01 extends GPURendererListenerB
                     userString.deleteCharAt(userString.length()-1);
                 } else {
                     final char c = e.getKeyChar();
-                    if( font.isPrintableChar( c ) ) {                 
+                    if( font.isPrintableChar( c ) ) {
                         userString.append(c);
                     }
                 }
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener02.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener02.java
new file mode 100644
index 0000000..80225c9
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener02.java
@@ -0,0 +1,9 @@
+package com.jogamp.opengl.test.junit.graph.demos;
+
+import com.jogamp.graph.curve.Region;
+
+public class GPUUISceneGLListener02 extends GPUUISceneGLListener0A {
+    public GPUUISceneGLListener02() {
+        super(Region.VBAA_RENDERING_BIT);
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener04.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener04.java
new file mode 100644
index 0000000..461e2c1
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener04.java
@@ -0,0 +1,7 @@
+package com.jogamp.opengl.test.junit.graph.demos;
+
+public class GPUUISceneGLListener04 extends GPUUISceneGLListener0A {
+    public GPUUISceneGLListener04() {
+        super(GPUUISceneGLListener0A.DefaultNoAADPIThreshold /* noAADPIThreshold */);
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java
index 59ce284..784fe10 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneGLListener0A.java
@@ -1,7 +1,14 @@
 package com.jogamp.opengl.test.junit.graph.demos;
 
+import java.io.File;
 import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
 
+import javax.media.nativewindow.util.Dimension;
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAnimatorControl;
@@ -15,122 +22,248 @@ import com.jogamp.graph.curve.opengl.RegionRenderer;
 import com.jogamp.graph.curve.opengl.RenderState;
 import com.jogamp.graph.font.Font;
 import com.jogamp.graph.font.FontFactory;
-import com.jogamp.graph.geom.opengl.SVertex;
-import com.jogamp.newt.event.MouseAdapter;
+import com.jogamp.graph.geom.SVertex;
+import com.jogamp.newt.MonitorDevice;
+import com.jogamp.newt.Window;
+import com.jogamp.newt.event.InputEvent;
 import com.jogamp.newt.event.MouseEvent;
+import com.jogamp.newt.event.PinchToZoomGesture;
+import com.jogamp.newt.event.GestureHandler.GestureEvent;
+import com.jogamp.newt.event.MouseEvent.PointerClass;
 import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.math.VectorUtil;
+import com.jogamp.opengl.test.junit.graph.demos.ui.CrossHair;
+import com.jogamp.opengl.test.junit.graph.demos.ui.GLEventListenerButton;
 import com.jogamp.opengl.test.junit.graph.demos.ui.Label;
-import com.jogamp.opengl.test.junit.graph.demos.ui.RIButton;
+import com.jogamp.opengl.test.junit.graph.demos.ui.LabelButton;
+import com.jogamp.opengl.test.junit.graph.demos.ui.MediaPlayerButton;
+import com.jogamp.opengl.test.junit.graph.demos.ui.RoundButton;
 import com.jogamp.opengl.test.junit.graph.demos.ui.SceneUIController;
-import com.jogamp.opengl.test.junit.graph.demos.ui.opengl.UIRegion;
-import com.jogamp.opengl.util.glsl.ShaderState;
+import com.jogamp.opengl.test.junit.graph.demos.ui.ImageSeqButton;
+import com.jogamp.opengl.test.junit.graph.demos.ui.UIShape;
+import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
+import com.jogamp.opengl.test.junit.jogl.demos.es2.RedSquareES2;
+import com.jogamp.opengl.util.GLReadBufferUtil;
+import com.jogamp.opengl.util.av.GLMediaPlayer;
+import com.jogamp.opengl.util.av.GLMediaPlayerFactory;
+import com.jogamp.opengl.util.texture.ImageSequence;
+import com.jogamp.opengl.util.texture.TextureIO;
 
 public class GPUUISceneGLListener0A implements GLEventListener {
 
     private boolean debug = false;
-    private boolean trace = false; 
-    
-    private final int renderModes;
-    private final int[] texSize = new int[1]; 
-    private final int renderModes2;
-    private final int[] texSize2 = new int[1]; 
-    private RegionRenderer regionRenderer;
-    private RenderState rs;
-    
-    int fontSet = FontFactory.UBUNTU;
-    Font font;
-    final int fontSizeFixed = 6;
-    
-    private float xTran = 0;
-    private float yTran = 0;    
-    private float ang = 0f;
-    private float zoom = -200f;
-    private float zoomText = 1f;
+    private boolean trace = false;
+
+    private final float noAADPIThreshold;
+    private final RenderState rs;
+    private final SceneUIController sceneUIController;
+
+    /** -1 == AUTO, TBD @ init(..) */
+    private int renderModes;
+    private RegionRenderer renderer;
+
+    private final int fontSet = FontFactory.UBUNTU;
+    private Font font;
+
+    private final float sceneDist = 3000f;
+    private final float zNear = 0.1f, zFar = 7000f;
+
+    private final float relTop = 5f/6f;
+    private final float relMiddle = 2f/6f;
+    private final float relLeft = 1f/6f;
+
+    /** Proportional Button Size to Window Height, per-vertical-pixels [PVP] */
+    private final float buttonYSizePVP = 0.084f;
+    private final float buttonXSizePVP = 0.105f;
+    private final float fontSizePt = 10f;
+    /** Proportional Font Size to Window Height  for Main Text, per-vertical-pixels [PVP] */
+    private final float fontSizeFixedPVP = 0.046f;
+    /** Proportional Font Size to Window Height for FPS Status Line, per-vertical-pixels [PVP] */
+    private final float fontSizeFpsPVP = 0.038f;
+    private float dpiH = 96;
+
+    /**
+     * Default DPI threshold value to disable {@link Region#VBAA_RENDERING_BIT VBAA}: {@value} dpi
+     * @see #GPUUISceneGLListener0A(float)
+     * @see #GPUUISceneGLListener0A(float, boolean, boolean)
+     */
+    public static final float DefaultNoAADPIThreshold = 200f;
+
     private int currentText = 0;
-    
+
+    private String actionText = null;
     private Label[] labels = null;
     private String[] strings = null;
-    private UIRegion[] labelRegions;
-    private UIRegion fpsRegion = null;
-    private UIRegion jogampRegion = null;
-    private RIButton[] buttons = null;
-    
-    private int numSelectable = 6;
-    
-    private SceneUIController sceneUIController = null;
-    private MultiTouchListener multiTouchListener = null;
-    private boolean showFPS = false;
+    private final List<RoundButton> buttons = new ArrayList<RoundButton>();
+    private int buttonsLeftCount = 0;
+    private Label truePtSizeLabel = null;
+    private Label jogampLabel = null;
+    private Label fpsLabel = null;
+    private CrossHair crossHairCtr = null;
+
+    private boolean ioAttached = false;
     private GLAutoDrawable cDrawable;
-    private float fps = 0; 
-    
-    private String jogamp = "JogAmp - Jogl Graph Module Demo";
-    private float angText = 0;
-    
+
+    private final GLReadBufferUtil screenshot;
+
+    private final String jogamp = "JogAmp - Jogl Graph Module Demo";
+    private final String truePtSize = fontSizePt+" pt font size label - true scale!";
+
     public GPUUISceneGLListener0A() {
       this(0);
     }
-    
-    public GPUUISceneGLListener0A(int renderModes) {
-      this(RenderState.createRenderState(new ShaderState(), SVertex.factory()), renderModes, false, false);
+
+    /**
+     * @param noAADPIThreshold see {@link #DefaultNoAADPIThreshold}
+     */
+    public GPUUISceneGLListener0A(final float noAADPIThreshold) {
+        this(noAADPIThreshold, false, false);
     }
-    
-    public GPUUISceneGLListener0A(RenderState rs, int renderModes, boolean debug, boolean trace) {
-        this.rs = rs;
-        this.renderModes = renderModes;
-        this.texSize[0] = Region.isVBAA(renderModes) ? 400 : 0;
-        this.renderModes2 = 0;
-        this.texSize2[0] = 0;
-        
+
+    /**
+     * @param renderModes
+     */
+    public GPUUISceneGLListener0A(final int renderModes) {
+      this(renderModes, false, false);
+    }
+
+    /**
+     * @param renderModes
+     * @param debug
+     * @param trace
+     */
+    public GPUUISceneGLListener0A(final int renderModes, final boolean debug, final boolean trace) {
+        this(0f, renderModes, debug, trace);
+    }
+
+    /**
+     * @param noAADPIThreshold see {@link #DefaultNoAADPIThreshold}
+     * @param debug
+     * @param trace
+     */
+    public GPUUISceneGLListener0A(final float noAADPIThreshold, final boolean debug, final boolean trace) {
+        this(noAADPIThreshold, 0, debug, trace);
+    }
+
+    private GPUUISceneGLListener0A(final float noAADPIThreshold, final int renderModes, final boolean debug, final boolean trace) {
+        this.noAADPIThreshold = noAADPIThreshold;
+        this.rs = RenderState.createRenderState(SVertex.factory());
         this.debug = debug;
         this.trace = trace;
+
+        this.renderModes = renderModes;
+
         try {
             font = FontFactory.get(FontFactory.UBUNTU).getDefault();
-        } catch (IOException ioe) {
-            System.err.println("Catched: "+ioe.getMessage());
+        } catch (final IOException ioe) {
+            System.err.println("Caught: "+ioe.getMessage());
             ioe.printStackTrace();
         }
-        labelRegions = new UIRegion[3];
-        sceneUIController = new SceneUIController();
+        sceneUIController = new SceneUIController(sceneDist, zNear, zFar);
+        screenshot = new GLReadBufferUtil(false, false);
     }
-    
-    private void initButtons(int width, int height) {
-        buttons = new RIButton[numSelectable];
-        int xaxis = -110;
-        float xSize = 40f;
-        float ySize = 16f;
-        
-        int start = 50;
-        int diff = (int)ySize + 5;
-        
-        buttons[0] = new RIButton(SVertex.factory(), font, "Next Text", xSize, ySize){
-            public void onClick() {
-                   currentText = (currentText+1)%3;
+
+    private void rotateButtons(float[] angdeg) {
+        angdeg = VectorUtil.scaleVec3(angdeg, angdeg, FloatUtil.PI / 180.0f);
+        for(int i=0; i<buttons.size(); i++) {
+            buttons.get(i).getRotation().rotateByEuler( angdeg );
+        }
+    }
+    private void translateButtons(final float tx, final float ty, final float tz) {
+        for(int i=0; i<buttons.size(); i++) {
+            buttons.get(i).translate(tx, ty, tz);
+        }
+    }
+
+    private void setButtonsSpacing(final float dx, final float dy) {
+        for(int i=0; i<buttons.size(); i++) {
+            final RoundButton b = buttons.get(i);
+            if( b instanceof LabelButton ) {
+                final LabelButton lb = (LabelButton) b;
+                final float sx = lb.getSpacingX()+dx, sy = lb.getSpacingY()+dy;
+                System.err.println("Spacing: X "+sx+", Y "+sy);
+                lb.setSpacing(sx, sy);
             }
-            public void onPressed() { }
-            public void onRelease() { }
-        };
-        
-        buttons[0].setPosition(xaxis,start,0);
-        
-        buttons[1] = new RIButton(SVertex.factory(), font, "Show FPS", xSize, ySize){
-            public void onClick() {
+        }
+    }
+
+    private void setButtonsCorner(final float dc) {
+        for(int i=0; i<buttons.size(); i++) {
+            final float c = buttons.get(i).getCorner()+dc;
+            System.err.println("Corner: "+c);
+            buttons.get(i).setCorner(c);
+        }
+    }
+
+    private void resetButtons() {
+        for(int i=0; i<buttons.size(); i++) {
+            final RoundButton b = buttons.get(i);
+            b.getRotation().setIdentity();
+            b.setCorner(RoundButton.DEFAULT_CORNER);
+            if( b instanceof LabelButton ) {
+                ((LabelButton)b).setSpacing(LabelButton.DEFAULT_SPACING_X, LabelButton.DEFAULT_SPACING_Y);
+            }
+        }
+    }
+
+    private void initButtons(final GL2ES2 gl, final int width, final int height, final RegionRenderer renderer) {
+        final boolean pass2Mode = Region.isTwoPass( renderModes ) ;
+        buttons.clear();
+
+        final float buttonXSize = buttonXSizePVP * width;
+        // final float buttonYSize = buttonYSizePVP * height;
+        final float buttonYSize = buttonXSize / 2.5f;
+        System.err.println("Button Size: "+buttonXSizePVP+" x "+buttonYSizePVP+" * "+width+" x "+height+" -> "+buttonXSize+" x "+buttonYSize);
+        final float xStartLeft = 0f; // aligned to left edge w/ space via reshape
+        final float yStartTop = 0f;  // aligned to top edge w/ space via reshape
+        final float diffX = 1.2f * buttonXSize;
+        final float diffY = 1.5f * buttonYSize;
+
+        LabelButton button = new LabelButton(SVertex.factory(), renderModes, font, "Next Text", buttonXSize, buttonYSize);
+        button.translate(xStartLeft,yStartTop-diffY*buttons.size(), 0f);
+        button.addMouseListener(new UIShape.MouseGestureAdapter() {
+            @Override
+            public void mouseClicked(final MouseEvent e) {
+                if( null != labels[currentText] ) {
+                    labels[currentText].setEnabled(false);
+                }
+                currentText = (currentText+1)%labels.length;
+                if( null != labels[currentText] ) {
+                    labels[currentText].setEnabled(true);
+                }
+            } } );
+        button.addMouseListener(dragZoomRotateListener);
+        buttons.add(button);
+
+        button = new LabelButton(SVertex.factory(), renderModes, font, "Show FPS", buttonXSize, buttonYSize);
+        button.setName(100); // FIXME: DEBUG tag
+        button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
+        button.setToggleable(true);
+        button.setToggle(fpsLabel.isEnabled());
+        button.addMouseListener(new UIShape.MouseGestureAdapter() {
+            @Override
+            public void mouseClicked(final MouseEvent e) {
                 final GLAnimatorControl a = cDrawable.getAnimator();
                 if( null != a ) {
                     a.resetFPSCounter();
                 }
-                showFPS = !showFPS;
-            }
-            public void onPressed() { }
-            public void onRelease() { }
-        };
-        buttons[1].setPosition(xaxis,start - diff,0);
-        buttons[1].setToggleable(true);
-        
-        buttons[2] = new RIButton(SVertex.factory(), font, "v-sync", xSize, ySize){
-            public void onClick() {
+                fpsLabel.setEnabled(!fpsLabel.isEnabled());
+            } } );
+        button.addMouseListener(dragZoomRotateListener);
+        buttons.add(button);
+
+        button = new LabelButton(SVertex.factory(), renderModes, font, "v-sync", buttonXSize, buttonYSize);
+        button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
+        button.setToggleable(true);
+        button.setToggle(gl.getSwapInterval()>0);
+        button.addMouseListener(new UIShape.MouseGestureAdapter() {
+            @Override
+            public void mouseClicked(final MouseEvent e) {
                 cDrawable.invoke(false, new GLRunnable() {
-                    public boolean run(GLAutoDrawable drawable) {
-                        GL gl = drawable.getGL();
+                    @Override
+                    public boolean run(final GLAutoDrawable drawable) {
+                        final GL gl = drawable.getGL();
                         gl.setSwapInterval(gl.getSwapInterval()<=0?1:0);
                         final GLAnimatorControl a = drawable.getAnimator();
                         if( null != a ) {
@@ -139,76 +272,426 @@ public class GPUUISceneGLListener0A implements GLEventListener {
                         return true;
                     }
                 });
+            } } );
+        button.addMouseListener(dragZoomRotateListener);
+        buttons.add(button);
+
+        button = new LabelButton(SVertex.factory(), renderModes, font, "< tilt >", buttonXSize, buttonYSize);
+        button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
+        button.addMouseListener(new UIShape.MouseGestureAdapter() {
+            @Override
+            public void mouseClicked(final MouseEvent e) {
+                final Object attachment = e.getAttachment();
+                if( attachment instanceof UIShape.PointerEventInfo ) {
+                    final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
+                    if( shapeEvent.objPos[0] < shapeEvent.shape.getBounds().getCenter()[0] ) {
+                        rotateButtons(new float[] { 0f, -5f, 0f}); // left-half pressed
+                    } else {
+                        rotateButtons(new float[] { 0f,  5f, 0f}); // right-half pressed
+                    }
+                }
             }
-            public void onPressed() { }
-            public void onRelease() { }
-        };
-        buttons[2].setPosition(xaxis,start-diff*2,0);
-        buttons[2].setToggleable(true);
-        
-        buttons[3] = new RIButton(SVertex.factory(), font, "Tilt  +Y", xSize, ySize) {
-            public void onClick() {  
-                ang+=10;
-            }
-            public void onPressed() { 
+            @Override
+            public void mouseWheelMoved(final MouseEvent e) {
+                rotateButtons(new float[] { 0f,  e.getRotation()[1], 0f});
+            } } );
+        buttons.add(button);
+
+        if( pass2Mode ) { // second column to the left
+            button = new LabelButton(SVertex.factory(), renderModes, font, "< samples >", buttonXSize, buttonYSize);
+            button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
+            button.addMouseListener(new UIShape.MouseGestureAdapter() {
+                @Override
+                public void mouseClicked(final MouseEvent e) {
+                    final Object attachment = e.getAttachment();
+                    if( attachment instanceof UIShape.PointerEventInfo ) {
+                        final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
+                        int sampleCount = sceneUIController.getSampleCount();
+                        if( shapeEvent.objPos[0] < shapeEvent.shape.getBounds().getCenter()[0] ) {
+                            // left-half pressed
+                            sampleCount--;
+                        } else {
+                            // right-half pressed
+                            sampleCount++;
+                        }
+                        sampleCount = sceneUIController.setSampleCount(sampleCount); // validated / clipped
+                    }
+                } } );
+            button.addMouseListener(dragZoomRotateListener);
+            buttons.add(button);
+
+            button = new LabelButton(SVertex.factory(), renderModes, font, "< quality >", buttonXSize, buttonYSize);
+            button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
+            button.addMouseListener(new UIShape.MouseGestureAdapter() {
+                @Override
+                public void mouseClicked(final MouseEvent e) {
+                    final Object attachment = e.getAttachment();
+                    if( attachment instanceof UIShape.PointerEventInfo ) {
+                        final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
+                        int quality = shapeEvent.shape.getQuality();
+
+                        if( shapeEvent.objPos[0] < shapeEvent.shape.getBounds().getCenter()[0] ) {
+                            // left-half pressed
+                            if( quality > 0 ) {
+                                quality--;
+                            }
+                        } else {
+                            // right-half pressed
+                            if( quality < Region.MAX_QUALITY ) {
+                                quality++;
+                            }
+                        }
+                        sceneUIController.setAllShapesQuality(quality);
+                    }
+                } } );
+            button.addMouseListener(dragZoomRotateListener);
+            buttons.add(button);
+        }
+
+        button = new LabelButton(SVertex.factory(), renderModes, font, "Quit", buttonXSize, buttonYSize);
+        button.translate(xStartLeft,yStartTop - diffY*buttons.size(), 0f);
+        button.setColor(0.7f, 0.0f, 0.0f, 1.0f);
+        button.setLabelColor(1.2f, 1.2f, 1.2f);
+        button.setPressedColorMod(1.1f, 0.0f, 0.0f, 1.0f);
+        button.addMouseListener(new UIShape.MouseGestureAdapter() {
+            @Override
+            public void mouseClicked(final MouseEvent e) {
+                new Thread() {
+                    public void run() {
+                        if( null != cDrawable ) {
+                            final GLAnimatorControl actrl = cDrawable.getAnimator();
+                            if( null != actrl ) {
+                                actrl.stop();
+                            }
+                            cDrawable.destroy();
+                        }
+                    } }.start();
+            } } );
+        button.addMouseListener(dragZoomRotateListener);
+        buttons.add(button);
+
+        // second column to the left
+        {
+            final int j = 1; // column
+            int k = 0; // row
+            button = new LabelButton(SVertex.factory(), renderModes, font, "y flip", buttonXSize, buttonYSize);
+            button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
+            button.addMouseListener(new UIShape.MouseGestureAdapter() {
+                @Override
+                public void mouseClicked(final MouseEvent e) {
+                    rotateButtons(new float[] { 0f, 180f, 0f});
+                } } );
+            button.addMouseListener(dragZoomRotateListener);
+            buttons.add(button);
 
+            k++;
+            button = new LabelButton(SVertex.factory(), renderModes, font, "x flip", buttonXSize, buttonYSize);
+            button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
+            button.addMouseListener(new UIShape.MouseGestureAdapter() {
+                @Override
+                public void mouseClicked(final MouseEvent e) {
+                    rotateButtons(new float[] { 180f, 0f, 0f});
+                } } );
+            button.addMouseListener(dragZoomRotateListener);
+            buttons.add(button);
+            k++;
+
+            button = new LabelButton(SVertex.factory(), renderModes, font, "+", buttonXSize, buttonYSize);
+            button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
+            button.addMouseListener(new UIShape.MouseGestureAdapter() {
+                @Override
+                public void mouseClicked(final MouseEvent e) {
+                    final Object attachment = e.getAttachment();
+                    if( attachment instanceof UIShape.PointerEventInfo ) {
+                        final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
+                        // rel position to center
+                        final float dx = shapeEvent.objPos[0] - shapeEvent.shape.getBounds().getCenter()[0] ;
+                        final float dy = shapeEvent.objPos[1] - shapeEvent.shape.getBounds().getCenter()[1] ;
+                        // per-cent position to center (remove dependency on dimension)
+                        final float awdx = Math.abs(dx)/shapeEvent.shape.getBounds().getWidth();
+                        final float awdy = Math.abs(dy)/shapeEvent.shape.getBounds().getHeight();
+                        float tx = 0, ty = 0;
+                        if ( awdx > awdy  ) {
+                            tx = dx < 0 ? -5 : 5;
+                        } else {
+                            ty = dy < 0 ? -5 : 5;
+                        }
+                        translateButtons(tx, ty, 0f);
+                    }
+                } } );
+            button.addMouseListener(dragZoomRotateListener);
+            buttons.add(button);
+            k++;
+
+            button = new LabelButton(SVertex.factory(), renderModes, font, "< space >", buttonXSize, buttonYSize);
+            button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
+            button.addMouseListener(new UIShape.MouseGestureAdapter() {
+                @Override
+                public void mouseClicked(final MouseEvent e) {
+                    final Object attachment = e.getAttachment();
+                    if( attachment instanceof UIShape.PointerEventInfo ) {
+                        final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
+                        final float dx, dy;
+                        if( shapeEvent.objPos[0] < shapeEvent.shape.getBounds().getCenter()[0] ) {
+                            dx=-0.01f; dy=-0.005f;
+                        } else {
+                            dx=0.01f; dy=0.005f;
+                        }
+                        setButtonsSpacing(dx, dy);
+                    }
+                }
+                @Override
+                public void mouseWheelMoved(final MouseEvent e) {
+                    setButtonsSpacing(e.getRotation()[0]/100f, e.getRotation()[1]/200f);
+                } } );
+            buttons.add(button);
+            k++;
+
+            button = new LabelButton(SVertex.factory(), renderModes, font, "< corner >", buttonXSize, buttonYSize);
+            button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
+            button.addMouseListener(new UIShape.MouseGestureAdapter() {
+                @Override
+                public void mouseClicked(final MouseEvent e) {
+                    final Object attachment = e.getAttachment();
+                    if( attachment instanceof UIShape.PointerEventInfo ) {
+                        final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
+                        final float dc;
+                        if( shapeEvent.objPos[0] < shapeEvent.shape.getBounds().getCenter()[0] ) {
+                            dc=-0.1f;
+                        } else {
+                            dc=0.1f;
+                        }
+                        setButtonsCorner(dc);
+                    }
+
+                }
+                @Override
+                public void mouseWheelMoved(final MouseEvent e) {
+                    setButtonsCorner(e.getRotation()[1]/20f);
+                } } );
+            buttons.add(button);
+            k++;
+
+            button = new LabelButton(SVertex.factory(), renderModes, font, "reset", buttonXSize, buttonYSize);
+            button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
+            button.addMouseListener(new UIShape.MouseGestureAdapter() {
+                @Override
+                public void mouseClicked(final MouseEvent e) {
+                    resetButtons();
+                } } );
+            button.addMouseListener(dragZoomRotateListener);
+            buttons.add(button);
+            k++;
+
+            button = new LabelButton(SVertex.factory(), renderModes, font, "screenshot", buttonXSize, buttonYSize);
+            button.translate(xStartLeft - diffX*j,yStartTop - diffY*k, 0f);
+            button.addMouseListener(new UIShape.MouseGestureAdapter() {
+                @Override
+                public void mouseClicked(final MouseEvent e) {
+                    cDrawable.invoke(false, new GLRunnable() {
+                        @Override
+                        public boolean run(final GLAutoDrawable drawable) {
+                            printScreen(drawable.getGL());
+                            return true;
+                        }
+                    });
+                } } );
+            button.addMouseListener(dragZoomRotateListener);
+            buttons.add(button);
+            k++;
+        }
+
+        buttonsLeftCount = buttons.size();
+
+        final float button2XSize = 2f*buttonXSize;
+        final float button2YSize = 2f*buttonYSize;
+        final float xStartRight = -button2XSize - 8f; // aligned to right edge via reshape
+        final int texUnitMediaPlayer, texUnitImageButton, texUnitGLELButton;
+        if( false ) {
+            texUnitMediaPlayer=0;
+            texUnitImageButton=0;
+            texUnitGLELButton=0;
+        } else {
+            // works - but not required ..
+            texUnitMediaPlayer=1;
+            texUnitImageButton=2;
+            texUnitGLELButton=3;
+        }
+
+        if( true ) {
+            final GLMediaPlayer mPlayer = GLMediaPlayerFactory.createDefault();
+            mPlayer.setTextureUnit(texUnitMediaPlayer);
+            final MediaPlayerButton mPlayerButton = new MediaPlayerButton(renderer.getRenderState().getVertexFactory(), renderModes,
+                                                                          button2XSize, button2YSize, mPlayer);
+            mPlayerButton.addDefaultEventListener();
+            mPlayerButton.translate(xStartRight, yStartTop - diffY*1, 0f);
+            mPlayerButton.setToggleable(true);
+            mPlayerButton.setToggle(false); // toggle == false -> mute audio
+            mPlayerButton.setToggleOffColorMod(0f, 1f, 0f, 1.0f);
+            mPlayerButton.addMouseListener(dragZoomRotateListener);
+            mPlayerButton.addMouseListener(new UIShape.MouseGestureAdapter() {
+                @Override
+                public void mouseClicked(final MouseEvent e) {
+                    mPlayer.setAudioVolume( mPlayerButton.isToggleOn() ? 1f : 0f );
+                } } );
+            buttons.add(mPlayerButton);
+            try {
+                final URI streamLoc = new URI("http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4");
+                mPlayer.initStream(streamLoc, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.TEXTURE_COUNT_DEFAULT);
+            } catch (final URISyntaxException e1) {
+                e1.printStackTrace();
             }
-            public void onRelease() { }
-        };
-        buttons[3].setPosition(xaxis,start-diff*3,0);
-        
-        buttons[4] = new RIButton(SVertex.factory(), font, "Tilt  -Y", xSize, ySize){
-            public void onClick() {
-                ang-=10;
+        }
+        if( true ) {
+            final ImageSequence imgSeq = new ImageSequence(texUnitImageButton, true);
+            final ImageSeqButton imgButton = new ImageSeqButton(renderer.getRenderState().getVertexFactory(), renderModes,
+                                                                button2XSize, button2YSize, imgSeq);
+            try {
+                imgSeq.addFrame(gl, GPUUISceneGLListener0A.class, "button-released-145x53.png", TextureIO.PNG);
+                imgSeq.addFrame(gl, GPUUISceneGLListener0A.class, "button-pressed-145x53.png", TextureIO.PNG);
+            } catch (final IOException e2) {
+                e2.printStackTrace();
             }
-            public void onPressed() { }
-            public void onRelease() { }
-        };
-        buttons[4].setPosition(xaxis,start-diff*4,0);
-        
-        buttons[5] = new RIButton(SVertex.factory(), font, "Quit", xSize, ySize){
-            public void onClick() {
-                cDrawable.destroy();
+            imgSeq.setManualStepping(true);
+            imgButton.translate(xStartRight, yStartTop - diffY*2.5f, 0f);
+            imgButton.addMouseListener(dragZoomRotateListener);
+            imgButton.addMouseListener(new UIShape.MouseGestureAdapter() {
+                @Override
+                public void mousePressed(final MouseEvent e) {
+                    imgButton.setCurrentIdx(1);
+                    System.err.println("XXX: "+imgButton);
+                }
+                @Override
+                public void mouseReleased(final MouseEvent e) {
+                    imgButton.setCurrentIdx(0);
+                } } );
+            buttons.add(imgButton);
+        }
+        if( true ) {
+            // Issues w/ OSX and NewtCanvasAWT when rendering / animating
+            // Probably related to CALayer - FBO - FBO* (of this button)
+            final GLEventListener glel;
+            if( true ) {
+                final GearsES2 gears = new GearsES2(0);
+                gears.setVerbose(false);
+                gears.setClearColor(new float[] { 0.9f, 0.9f, 0.9f, 1f } );
+                glel = gears;
+            } else if( false ) {
+                glel = new RedSquareES2(0);
+            } else {
+                glel = new GLEventListener() {
+                    @Override
+                    public void init(final GLAutoDrawable drawable) {
+                    }
+
+                    @Override
+                    public void dispose(final GLAutoDrawable drawable) {
+                    }
+
+                    @Override
+                    public void display(final GLAutoDrawable drawable) {
+                        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+                        gl.glClearColor(0.0f, 0.0f, 1.0f, 0.0f);
+                        // gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+                        gl.glClear(GL.GL_COLOR_BUFFER_BIT);
+                    }
+
+                    @Override
+                    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+                    }
+
+                };
             }
-            public void onPressed() { }
-            public void onRelease() { }
-        };
-        buttons[5].setPosition(xaxis,start-diff*5,0);
-        buttons[5].setButtonColor(0.8f, 0.0f, 0.0f);
-        buttons[5].setLabelColor(1.0f, 1.0f, 1.0f);
-        
-        buttons[5].setButtonSelectedColor(0.8f, 0.8f, 0.8f);
-        buttons[5].setLabelSelectedColor(0.8f, 0.0f, 0.0f);
+            final GLEventListenerButton glelButton = new GLEventListenerButton(renderer.getRenderState().getVertexFactory(), renderModes,
+                                                                       button2XSize, button2YSize,
+                                                                       texUnitGLELButton, glel, false /* useAlpha */,
+                                                                       (int)(button2XSize), (int)(button2YSize));
+            glelButton.setToggleable(true);
+            glelButton.setToggle(false); // toggle == true -> animation
+            glelButton.setAnimate(false);
+            glelButton.translate(xStartRight, yStartTop - diffY*4f, 0f);
+            glelButton.addMouseListener(dragZoomRotateListener);
+            glelButton.addMouseListener(new UIShape.MouseGestureAdapter() {
+                @Override
+                public void mouseClicked(final MouseEvent e) {
+                    glelButton.setAnimate( glelButton.isToggleOn() );
+                } } );
+            buttons.add(glelButton);
+        }
     }
-    
+
     private void initTexts() {
-        strings = new String[3];
-        
-        strings[0] = "abcdefghijklmn\nopqrstuvwxyz\nABCDEFGHIJKL\nMNOPQRSTUVWXYZ\n0123456789.:,;(*!?/\\\")$%^&-+@~#<>{}[]";
-        strings[1] = "The quick brown fox\njumps over the lazy\ndog";
-        
-        strings[2] = 
-            "Lorem ipsum dolor sit amet, consectetur\n"+
-            "Ut purus odio, rhoncus sit amet com\n"+
-            "quam iaculis urna cursus ornare. Nullam\n"+
-            "In hac habitasse platea dictumst. Vivam\n"+ 
-            "Morbi quis bibendum nibh. Donec lectus\n"+
-            "Donec ut dolor et nulla tristique variu\n"+
-            "in lorem. Maecenas in ipsum ac justo sc\n";
-        
-        labels = new Label[3];
+        strings = new String[4];
+        int i = 0;
+
+        strings[i++] =
+                     "- Mouse Scroll Over Object\n"+
+                     "   - General\n"+
+                     "     - Z Translation\n"+
+                     "     - Ctrl: Y-Rotation (Shift: X-Rotation)\n"+
+                     "   - Tilt, Space and Corner\n"+
+                     "     - Their respective action via wheel\n"+
+                     "       (shift = other value)\n"+
+                     "\n"+
+                     "- Mouse Drag On Object\n"+
+                     "   - Click on Object and drag mouse\n"+
+                     "   - Current postion in status line at bottom\n"+
+                     "\n"+
+                     "- Tilt Button Rotate Whole Button Group";
+
+        strings[i++] = "abcdefghijklmn\nopqrstuvwxyz\n"+
+                       "ABCDEFGHIJKL\n"+
+                       "MNOPQRSTUVWXYZ\n"+
+                       "0123456789.:,;(*!?/\\\")$%^&-+@~#<>{}[]";
+
+        strings[i++] = "The quick brown fox\njumps over the lazy\ndog";
+
+        strings[i++] =
+            "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec \n"+
+            "Ut purus odio, rhoncus sit amet commodo eget, ullamcorper vel\n"+
+            "quam iaculis urna cursus ornare. Nullam ut felis a ante ultrices\n"+
+            "In hac habitasse platea dictumst. Vivamus et mi a quam lacinia\n"+
+            "Morbi quis bibendum nibh. Donec lectus orci, sagittis in consequat\n"+
+            "Donec ut dolor et nulla tristique varius. In nulla magna, fermentum\n"+
+            "in lorem. Maecenas in ipsum ac justo scelerisque sollicitudin.\n";
+
+        labels = new Label[i];
     }
 
-    public void init(GLAutoDrawable drawable) {
+
+    final boolean enableOthers = true;
+
+    @Override
+    public void init(final GLAutoDrawable drawable) {
+        final Object upObj = drawable.getUpstreamWidget();
+        if( upObj instanceof Window ) {
+            final Window upWin = (Window)upObj;
+            final MonitorDevice mm = upWin.getMainMonitor();
+            final float[] monitorPixelsPerMM = mm.getPixelsPerMM(new float[2]);
+            final float monitorDpiH = monitorPixelsPerMM[1]*25.4f;
+            final float[] surfacePixelsPerMM = upWin.getPixelsPerMM(new float[2]);
+            dpiH = surfacePixelsPerMM[1]*25.4f;
+            System.err.println("Monitor detected: "+mm);
+            System.err.println("Monitor dpi: "+monitorDpiH);
+            System.err.println("Surface scale: native "+new Dimension(upWin.getNativeSurfaceScale(new int[2]))+", current "+new Dimension(upWin.getCurrentSurfaceScale(new int[2])));
+            System.err.println("Surface dpi: "+dpiH);
+        } else {
+            System.err.println("Using default DPI of "+dpiH);
+        }
+        if( 0 == renderModes && !FloatUtil.isZero(noAADPIThreshold, FloatUtil.EPSILON)) {
+            final boolean noAA = dpiH >= noAADPIThreshold;
+            final String noAAs = noAA ? " >= " : " < ";
+            System.err.println("AUTO RenderMode: dpi "+dpiH+noAAs+noAADPIThreshold+" -> noAA "+noAA);
+            renderModes = noAA ? 0 : Region.VBAA_RENDERING_BIT;
+        }
         if(drawable instanceof GLWindow) {
             System.err.println("GPUUISceneGLListener0A: init (1)");
             final GLWindow glw = (GLWindow) drawable;
             attachInputListenerTo(glw);
         } else {
-            System.err.println("GPUUISceneGLListener0A: init (0)");            
+            System.err.println("GPUUISceneGLListener0A: init (0)");
         }
-        final int width = drawable.getWidth();
-        final int height = drawable.getHeight();
+        System.err.println("Chosen: "+drawable.getChosenGLCapabilities());
         cDrawable = drawable;
         GL2ES2 gl = drawable.getGL().getGL2ES2();
         if(debug) {
@@ -217,220 +700,291 @@ public class GPUUISceneGLListener0A implements GLEventListener {
         if(trace) {
             gl = gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", null, gl, new Object[] { System.err } ) ).getGL2ES2();
         }
-        
+
         try {
             font = FontFactory.get(fontSet).getDefault();
-        } catch (IOException ioe) {
-            System.err.println("Catched: "+ioe.getMessage());
+        } catch (final IOException ioe) {
+            System.err.println("Caught: "+ioe.getMessage());
             ioe.printStackTrace();
         }
-        
-        regionRenderer = RegionRenderer.create(rs, renderModes); 
-        
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
-        gl.glEnable(GL2ES2.GL_BLEND);
-        
-        regionRenderer.init(gl);
-        regionRenderer.setAlpha(gl, 1.0f);
-        regionRenderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);
-        
+
+        renderer = RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable);
+        rs.setHintMask(RenderState.BITHINT_GLOBAL_DEPTH_TEST_ENABLED);
+        // renderer = RegionRenderer.create(rs, null, null);
+
+        gl.setSwapInterval(1);
+        gl.glEnable(GL.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_BLEND);
+
+        renderer.init(gl, renderModes);
+
         initTexts();
-        initButtons(width, height);
-        
-        sceneUIController.setRenderer(regionRenderer, rs, renderModes, texSize);
-        sceneUIController.addShape(buttons[0]);
-        sceneUIController.addShape(buttons[1]);
-        sceneUIController.addShape(buttons[2]);
-        sceneUIController.addShape(buttons[3]);
-        sceneUIController.addShape(buttons[4]);
-        sceneUIController.addShape(buttons[5]);
-        drawable.addGLEventListener(sceneUIController);
-                
-        Label jlabel = new Label(SVertex.factory(), font, fontSizeFixed, jogamp){
-            public void onClick() { }
-            public void onPressed() { }
-            public void onRelease() { }
-        };
-        
-        jogampRegion = new UIRegion(jlabel);
+
+        sceneUIController.setRenderer(renderer);
+
+        final float pixelSizeFixed = fontSizeFixedPVP * drawable.getSurfaceHeight();
+        jogampLabel = new Label(renderer.getRenderState().getVertexFactory(), renderModes, font, pixelSizeFixed, jogamp);
+        jogampLabel.addMouseListener(dragZoomRotateListener);
+        sceneUIController.addShape(jogampLabel);
+        jogampLabel.setEnabled(enableOthers);
+
+        final float pixelSize10Pt = font.getPixelSize(fontSizePt, dpiH);
+        System.err.println("10Pt PixelSize: Display "+dpiH+" dpi, fontSize "+fontSizePt+" ppi -> "+pixelSize10Pt+" pixel-size");
+        truePtSizeLabel = new Label(renderer.getRenderState().getVertexFactory(), renderModes, font, pixelSize10Pt, truePtSize);
+        sceneUIController.addShape(truePtSizeLabel);
+        truePtSizeLabel.setEnabled(enableOthers);
+        truePtSizeLabel.translate(0, - 1.5f * jogampLabel.getLineHeight(), 0f);
+        truePtSizeLabel.setColor(0.1f, 0.1f, 0.1f, 1.0f);
+
+        /**
+         *
+         * [Label] Display 112.88889 dpi, fontSize 12.0 ppi -> pixelSize 18.814816
+         * [FPS] Display 112.88889 dpi, fontSize 12.0 ppi -> pixelSize 15.679012
+         */
+        final float pixelSizeFPS = fontSizeFpsPVP * drawable.getSurfaceHeight();
+        fpsLabel = new Label(renderer.getRenderState().getVertexFactory(), renderModes, font, pixelSizeFPS, "Nothing there yet");
+        fpsLabel.addMouseListener(dragZoomRotateListener);
+        sceneUIController.addShape(fpsLabel);
+        fpsLabel.setEnabled(enableOthers);
+        fpsLabel.setColor(0.3f, 0.3f, 0.3f, 1.0f);
+
+        crossHairCtr = new CrossHair(renderer.getRenderState().getVertexFactory(), 0, 100f, 100f, 2f);
+        crossHairCtr.addMouseListener(dragZoomRotateListener);
+        sceneUIController.addShape(crossHairCtr);
+        crossHairCtr.setEnabled(true);
+        crossHairCtr.translate(0f, 0f, -1f);
+
+        initButtons(gl, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), renderer);
+        for(int i=0; i<buttons.size(); i++) {
+            sceneUIController.addShape(buttons.get(i));
+        }
+
+        sceneUIController.init(drawable);
+
         final GLAnimatorControl a = drawable.getAnimator();
         if( null != a ) {
             a.resetFPSCounter();
-        }        
+        }
     }
 
-    public void dispose(GLAutoDrawable drawable) {
+    @Override
+    public void dispose(final GLAutoDrawable drawable) {
         if(drawable instanceof GLWindow) {
             System.err.println("GPUUISceneGLListener0A: dispose (1)");
             final GLWindow glw = (GLWindow) drawable;
             detachInputListenerFrom(glw);
         } else {
-            System.err.println("GPUUISceneGLListener0A: dispose (0)");            
+            System.err.println("GPUUISceneGLListener0A: dispose (0)");
         }
 
-        // sceneUIController will remove itself from the drawable!
-        
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        regionRenderer.destroy(gl);
+        sceneUIController.dispose(drawable); // disposes all registered UIShapes
+
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+        renderer.destroy(gl);
+        screenshot.dispose(gl);
+    }
+
+    private int shotCount = 0;
+
+    public void printScreen(final GL gl)  {
+        final String modeS = Region.getRenderModeString(jogampLabel.getRenderModes());
+        final String filename = String.format("GraphUIDemo-shot%03d-%03dx%03d-S_%s_%02d.png",
+                shotCount++, renderer.getWidth(), renderer.getHeight(),
+                modeS, sceneUIController.getSampleCount());
+        gl.glFinish(); // just make sure rendering finished ..
+        if(screenshot.readPixels(gl, false)) {
+            screenshot.write(new File(filename));
+            System.err.println("Wrote: "+filename);
+        }
     }
 
-    public void display(GLAutoDrawable drawable) {
+    @Override
+    public void display(final GLAutoDrawable drawable) {
         // System.err.println("GPUUISceneGLListener0A: display");
-        final int width = drawable.getWidth();
-        final int height = drawable.getHeight();
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
-        gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
-        gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
-        
-        regionRenderer.reshapePerspective(null, 45.0f, width, height, 0.1f, 7000.0f);
-        sceneUIController.setTranslate(xTran, yTran, zoom);
-        sceneUIController.setRotation(0, ang, 0);
-        
-        renderScene(drawable);
-  }
-    
-    private void renderScene(GLAutoDrawable drawable) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
-        regionRenderer.resetModelview(null);
-        regionRenderer.translate(null, xTran-50, yTran+43, zoom);
-        regionRenderer.translate(gl, 0, 30, 0);
-        regionRenderer.scale(null, zoomText, zoomText, 1);
-        regionRenderer.scale(gl, 1.5f, 1.5f, 1.0f);
-        regionRenderer.rotate(gl, angText , 0, 1, 0);
-        regionRenderer.setColorStatic(gl, 0.0f, 1.0f, 0.0f);
-        regionRenderer.draw(gl, jogampRegion.getRegion(gl, rs, 0), new float[]{0,0,0}, null);
-        
-        if(null == labelRegions[currentText]) {
-            if( null == labels[currentText]) {
-                labels[currentText] = new Label(SVertex.factory(), font, fontSizeFixed, strings[currentText]){
-                    public void onClick() { }
-                    public void onPressed() { }
-                    public void onRelease() { }
-                };
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+        if(null == labels[currentText]) {
+            final float pixelSizeFixed = fontSizeFixedPVP * drawable.getSurfaceHeight();
+            final float dyTop = drawable.getSurfaceHeight() - 2f*jogampLabel.getLineHeight();
+            final float dxMiddle = drawable.getSurfaceWidth() * relMiddle;
+            labels[currentText] = new Label(renderer.getRenderState().getVertexFactory(), renderModes, font, pixelSizeFixed, strings[currentText]);
+            labels[currentText].setColor(0.1f, 0.1f, 0.1f, 1.0f);
+            labels[currentText].setEnabled(enableOthers);
+            labels[currentText].translate(dxMiddle,
+                                          dyTop - 1.5f * jogampLabel.getLineHeight()
+                                                - 1.5f * truePtSizeLabel.getLineHeight(), 0f);
+            labels[currentText].addMouseListener(dragZoomRotateListener);
+            sceneUIController.addShape(labels[currentText]);
+            System.err.println("Label["+currentText+"] CTOR: "+labels[currentText]);
+            System.err.println("Label["+currentText+"] CTOR: "+Arrays.toString(labels[currentText].getTranslate()));
+        }
+        if( fpsLabel.isEnabled() ) {
+            final float lfps, tfps, td;
+            final GLAnimatorControl animator = drawable.getAnimator();
+            if( null != animator ) {
+                lfps = animator.getLastFPS();
+                tfps = animator.getTotalFPS();
+                td = animator.getTotalFPSDuration()/1000f;
+            } else {
+                lfps = 0f;
+                tfps = 0f;
+                td = 0f;
             }
-            labelRegions[currentText] = new UIRegion(labels[currentText]);
-        }
-        
-        regionRenderer.resetModelview(null);
-        regionRenderer.translate(null, xTran-50, yTran, zoom);
-        regionRenderer.translate(gl, 0, 30, 0);
-        regionRenderer.scale(null, zoomText, zoomText, 1);
-        regionRenderer.scale(gl, 1.5f, 1.5f, 1.0f);
-        regionRenderer.rotate(gl, zoomText, 0, 1, 0);
-        
-        regionRenderer.setColorStatic(gl, 0.0f, 0.0f, 0.0f);
-        regionRenderer.draw(gl, labelRegions[currentText].getRegion(gl, rs, renderModes2), new float[]{0,0,0}, texSize2);
-        
-        final GLAnimatorControl animator = drawable.getAnimator();
-        final boolean _drawFPS = showFPS && null != animator;
-        
-        if(_drawFPS && fps != animator.getTotalFPS()) {
-            if(null != fpsRegion) {
-                fpsRegion.destroy(gl, rs);
+            final String modeS = Region.getRenderModeString(renderModes);
+            final String text;
+            if( null == actionText ) {
+                final String timePrec = gl.isGLES() ? "4.0" : "4.1";
+                text = String.format("%03.1f/%03.1f fps, v-sync %d, dpi %.1f, fontSize %.1f, %s-samples %d, q %d, td %"+timePrec+"f, blend %b, alpha %d, msaa %d",
+                    lfps, tfps, gl.getSwapInterval(), dpiH, fontSizeFixedPVP, modeS, sceneUIController.getSampleCount(), fpsLabel.getQuality(), td,
+                    renderer.getRenderState().isHintMaskSet(RenderState.BITHINT_BLENDING_ENABLED),
+                    drawable.getChosenGLCapabilities().getAlphaBits(),
+                    drawable.getChosenGLCapabilities().getNumSamples());
+            } else {
+                text = String.format("%03.1f/%03.1f fps, v-sync %d, fontSize %.1f, %s",
+                    lfps, tfps, gl.getSwapInterval(), fontSizeFixedPVP, actionText);
             }
-            fps = animator.getTotalFPS();
-            final String fpsS = String.valueOf(fps);
-            final int fpsSp = fpsS.indexOf('.');
-            
-            Label fpsLabel = new Label(SVertex.factory(), font, fontSizeFixed, fpsS.substring(0, fpsSp+2)+" fps"){
-                public void onClick() { }
-                public void onPressed() { }
-                public void onRelease() { }
-            };
-            fpsRegion = new UIRegion(fpsLabel);
-        }    
-        if(showFPS && null != fpsRegion) {
-            regionRenderer.translate(gl, 0, -60, 0);
-            regionRenderer.scale(null, zoomText, zoomText, 1);
-            regionRenderer.draw(gl, fpsRegion.getRegion(gl, rs, 0), new float[]{0,0,0}, null);
+            fpsLabel.setText(text);
         }
+        sceneUIController.display(drawable);
     }
-    
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+
+
+    float lastWidth = 0f, lastHeight = 0f;
+
+    @Override
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
         System.err.println("GPUUISceneGLListener0A: reshape");
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
-        gl.glViewport(x, y, width, height);        
-        regionRenderer.reshapePerspective(gl, 45.0f, width, height, 5f, 70.0f);
-    }
 
-    public void attachInputListenerTo(GLWindow window) {
-        if ( null == multiTouchListener ) {
-            multiTouchListener = new MultiTouchListener();
-            window.addMouseListener(multiTouchListener);
+        //
+        // Layout all shapes: Relational move regarding window coordinates
+        //
+        final float dw = width - lastWidth;
+        final float dh = height - lastHeight;
+
+        final float dz = 0f;
+        final float dyTop = dh * relTop;
+        final float dxLeft = dw * relLeft;
+        final float dxRight = dw;
+
+        for(int i=0; i<buttons.size() && i<buttonsLeftCount; i++) {
+            buttons.get(i).translate(dxLeft, dyTop, dz);
+        }
+        for(int i=buttonsLeftCount; i<buttons.size(); i++) {
+            buttons.get(i).translate(dxRight, dyTop, dz);
+        }
+        final float dxMiddleAbs = width * relMiddle;
+        final float dyTopLabelAbs = drawable.getSurfaceHeight() - 2f*jogampLabel.getLineHeight();
+        jogampLabel.setTranslate(dxMiddleAbs, dyTopLabelAbs, dz);
+        truePtSizeLabel.setTranslate(dxMiddleAbs, dyTopLabelAbs, dz);
+        truePtSizeLabel.setTranslate(dxMiddleAbs, dyTopLabelAbs - 1.5f * jogampLabel.getLineHeight(), 0f);
+        fpsLabel.translate(0f, 0f, 0f);
+        if( null != labels[currentText] ) {
+            labels[currentText].setTranslate(dxMiddleAbs,
+                                             dyTopLabelAbs - 1.5f * jogampLabel.getLineHeight()
+                                             - 1.5f * truePtSizeLabel.getLineHeight(), 0f);
+            System.err.println("Label["+currentText+"] MOVE: "+labels[currentText]);
+            System.err.println("Label["+currentText+"] MOVE: "+Arrays.toString(labels[currentText].getTranslate()));
+        }
+        crossHairCtr.translate(dw/2f, dh/2f, 0f);
+
+        sceneUIController.reshape(drawable, x, y, width, height);
+
+        lastWidth = width;
+        lastHeight = height;
+   }
+
+    public void attachInputListenerTo(final GLWindow window) {
+        if ( !ioAttached ) {
+            ioAttached = true;
             sceneUIController.attachInputListenerTo(window);
         }
     }
-    
-    public void detachInputListenerFrom(GLWindow window) {
-        if ( null != multiTouchListener ) {
-            window.removeMouseListener(multiTouchListener);
+
+    public void detachInputListenerFrom(final GLWindow window) {
+        if ( ioAttached ) {
+            ioAttached = false;
             sceneUIController.detachInputListenerFrom(window);
         }
     }
-    
-    private class MultiTouchListener extends MouseAdapter {
-        int lx = 0;
-        int ly = 0;
-        
-        boolean first = false;
-        
+
+    /**
+     * We can share this instance w/ all UI elements,
+     * since only mouse action / gesture is complete for a single one (press, drag, released and click).
+     */
+    private final UIShape.MouseGestureAdapter dragZoomRotateListener = new UIShape.MouseGestureAdapter() {
+        float dragFirstX=-1f, dragFirstY=-1f;
+        boolean dragFirst = false;
+
         @Override
-        public void mousePressed(MouseEvent e) {
-            first = true;  
+        public void mousePressed(final MouseEvent e) {
+            dragFirst = true;
         }
 
         @Override
-        public void mouseReleased(MouseEvent e) {
-            first = false;
+        public void mouseReleased(final MouseEvent e) {
+            dragFirst = false;
+            actionText = null;
         }
 
         @Override
-        public void mouseDragged(MouseEvent e) {
-            System.err.println("demo:mousedragged "+e);
-            if(e.getPointerCount()==2) {
-                // 2 pointers zoom ..
-                if(first) {
-                    lx = Math.abs(e.getY(0)-e.getY(1));
-                    first=false;
-                    return;
-                }
-                int nv = Math.abs(e.getY(0)-e.getY(1));
-                int dy = nv - lx;
-                
-                zoom += 2 * Math.signum(dy);
-                
-                lx = nv;
-            } else {
-                // 1 pointer drag
-                if(first) {
-                    lx = e.getX();
-                    ly = e.getY();
-                    first=false;
-                    return;
-                }
-                int nx = e.getX();
-                int ny = e.getY();
-                int dx = nx - lx;       
-                int dy = ny - ly;
-                if(Math.abs(dx) > Math.abs(dy)){
-                    xTran += Math.signum(dx);
-                }
-                else {
-                    yTran -= Math.signum(dy);
+        public void mouseDragged(final MouseEvent e) {
+            final Object attachment = e.getAttachment();
+            if( attachment instanceof UIShape.PointerEventInfo ) {
+                final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
+                if( e.getPointerCount() == 1 ) {
+                    // 1 pointer drag
+                    if(dragFirst) {
+                        dragFirstX = shapeEvent.objPos[0]; // e.getX();
+                        dragFirstY = shapeEvent.objPos[1]; // e.getY();
+                        dragFirst=false;
+                        return;
+                    }
+                    final float nx = shapeEvent.objPos[0]; // e.getX();
+                    final float ny = shapeEvent.objPos[1]; // e.getY();
+                    final float dx = nx - dragFirstX;
+                    final float dy = ny - dragFirstY;
+                    // final float dy = -(ny - dragLastY);
+                    shapeEvent.shape.translate(dx, dy, 0f);
+                    final float[] tx = shapeEvent.shape.getTranslate();
+                    actionText = String.format("Pos %6.2f / %6.2f / %6.2f", tx[0], tx[1], tx[2]);
                 }
-                lx = nx;
-                ly = ny;
             }
         }
-        
+
         @Override
-        public void mouseWheelMoved(MouseEvent e) {
-            if( !e.isShiftDown() ) {
-                zoom += 2f*e.getRotation()[1]; // vertical: wheel
+        public void mouseWheelMoved(final MouseEvent e) {
+            final Object attachment = e.getAttachment();
+            if( attachment instanceof UIShape.PointerEventInfo ) {
+                final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
+                final boolean isOnscreen = PointerClass.Onscreen == e.getPointerType(0).getPointerClass();
+                if( 0 == ( ~InputEvent.BUTTONALL_MASK & e.getModifiers() ) && !isOnscreen ) {
+                    // offscreen vertical mouse wheel zoom
+                    final float tz = 8f*e.getRotation()[1]; // vertical: wheel
+                    System.err.println("Rotate.Zoom.W: "+tz);
+                    shapeEvent.shape.translate(0f, 0f, tz);
+                } else if( isOnscreen || e.isControlDown() ) {
+                    final float[] rot =  VectorUtil.scaleVec3(e.getRotation(), e.getRotation(), FloatUtil.PI / 180.0f);
+                    if( isOnscreen ) {
+                        System.err.println("XXX: "+e);
+                        // swap axis for onscreen rotation matching natural feel
+                        final float tmp = rot[0]; rot[0] = rot[1]; rot[1] = tmp;
+                        VectorUtil.scaleVec3(rot, rot, 2f);
+                    }
+                    shapeEvent.shape.getRotation().rotateByEuler( rot );
+                }
             }
         }
-    }
-}      
\ No newline at end of file
+        @Override
+        public void gestureDetected(final GestureEvent e) {
+            final Object attachment = e.getAttachment();
+            if( attachment instanceof UIShape.PointerEventInfo ) {
+                final UIShape.PointerEventInfo shapeEvent = (UIShape.PointerEventInfo)attachment;
+                if( e instanceof PinchToZoomGesture.ZoomEvent ) {
+                    final PinchToZoomGesture.ZoomEvent ze = (PinchToZoomGesture.ZoomEvent) e;
+                    final float tz = ze.getDelta() * ze.getScale();
+                    System.err.println("Rotate.Zoom.G: "+tz);
+                    shapeEvent.shape.translate(0f, 0f, tz);
+                }
+            }
+        } };
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtCanvasAWTDemo.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtCanvasAWTDemo.java
new file mode 100644
index 0000000..274fbea
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtCanvasAWTDemo.java
@@ -0,0 +1,189 @@
+package com.jogamp.opengl.test.junit.graph.demos;
+
+import java.awt.Component;
+import java.awt.Frame;
+import java.lang.reflect.InvocationTargetException;
+
+import javax.media.nativewindow.ScalableSurface;
+import javax.media.nativewindow.util.Dimension;
+import javax.media.nativewindow.util.DimensionImmutable;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+import javax.swing.SwingUtilities;
+
+import org.junit.Assume;
+
+import com.jogamp.graph.curve.Region;
+import com.jogamp.newt.awt.NewtCanvasAWT;
+import com.jogamp.newt.event.WindowAdapter;
+import com.jogamp.newt.event.WindowEvent;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.util.Animator;
+
+public class GPUUISceneNewtCanvasAWTDemo {
+    static final boolean DEBUG = false;
+    static final boolean TRACE = false;
+
+    static int SceneMSAASamples = 0;
+    static boolean GraphVBAAMode = false;
+    static boolean GraphMSAAMode = false;
+    static float GraphAutoMode = GPUUISceneGLListener0A.DefaultNoAADPIThreshold;
+
+    static int[] reqSurfacePixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
+
+    static void setComponentSize(final Component comp, final DimensionImmutable new_sz) {
+        try {
+            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    final java.awt.Dimension d = new java.awt.Dimension(new_sz.getWidth(), new_sz.getHeight());
+                    comp.setMinimumSize(d);
+                    comp.setPreferredSize(d);
+                    comp.setSize(d);
+                } } );
+        } catch( final Throwable throwable ) {
+            throwable.printStackTrace();
+            Assume.assumeNoException( throwable );
+        }
+    }
+
+    public static void main(final String[] args) throws InterruptedException, InvocationTargetException {
+        int width = 800, height = 400;
+        int x = 10, y = 10;
+
+        boolean forceES2 = false;
+        boolean forceES3 = false;
+        boolean forceGL3 = false;
+        boolean forceGLDef = false;
+
+        if( 0 != args.length ) {
+            for(int i=0; i<args.length; i++) {
+                if(args[i].equals("-smsaa")) {
+                    i++;
+                    SceneMSAASamples = MiscUtils.atoi(args[i], SceneMSAASamples);
+                    GraphMSAAMode = false;
+                    GraphVBAAMode = false;
+                    GraphAutoMode = 0f;
+                } else if(args[i].equals("-gmsaa")) {
+                    GraphMSAAMode = true;
+                    GraphVBAAMode = false;
+                    GraphAutoMode = 0f;
+                } else if(args[i].equals("-gvbaa")) {
+                    GraphMSAAMode = false;
+                    GraphVBAAMode = true;
+                    GraphAutoMode = 0f;
+                } else if(args[i].equals("-gauto")) {
+                    GraphMSAAMode = false;
+                    GraphVBAAMode = true;
+                    i++;
+                    GraphAutoMode = MiscUtils.atof(args[i], GraphAutoMode);
+                } else if(args[i].equals("-width")) {
+                    i++;
+                    width = MiscUtils.atoi(args[i], width);
+                } else if(args[i].equals("-height")) {
+                    i++;
+                    height = MiscUtils.atoi(args[i], height);
+                } else if(args[i].equals("-x")) {
+                    i++;
+                    x = MiscUtils.atoi(args[i], x);
+                } else if(args[i].equals("-y")) {
+                    i++;
+                    y = MiscUtils.atoi(args[i], y);
+                } else if(args[i].equals("-pixelScale")) {
+                    i++;
+                    final int pS = MiscUtils.atoi(args[i], reqSurfacePixelScale[0]);
+                    reqSurfacePixelScale[0] = pS;
+                    reqSurfacePixelScale[1] = pS;
+                } else if(args[i].equals("-es2")) {
+                    forceES2 = true;
+                } else if(args[i].equals("-es3")) {
+                    forceES3 = true;
+                } else if(args[i].equals("-gl3")) {
+                    forceGL3 = true;
+                } else if(args[i].equals("-gldef")) {
+                    forceGLDef = true;
+                }
+            }
+        }
+        System.err.println("forceES2   "+forceES2);
+        System.err.println("forceES3   "+forceES3);
+        System.err.println("forceGL3   "+forceGL3);
+        System.err.println("forceGLDef "+forceGLDef);
+        System.err.println("Desired win size "+width+"x"+height);
+        System.err.println("Desired win pos  "+x+"/"+y);
+        System.err.println("Scene MSAA Samples "+SceneMSAASamples);
+        System.err.println("Graph MSAA Mode "+GraphMSAAMode);
+        System.err.println("Graph VBAA Mode "+GraphVBAAMode);
+        System.err.println("Graph Auto Mode "+GraphAutoMode+" no-AA dpi threshold");
+
+        final GLProfile glp;
+        if(forceGLDef) {
+            glp = GLProfile.getDefault();
+        } else if(forceGL3) {
+            glp = GLProfile.get(GLProfile.GL3);
+        } else if(forceES3) {
+            glp = GLProfile.get(GLProfile.GLES3);
+        } else if(forceES2) {
+            glp = GLProfile.get(GLProfile.GLES2);
+        } else {
+            glp = GLProfile.getGL2ES2();
+        }
+        System.err.println("GLProfile: "+glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setAlphaBits(4);
+        if( SceneMSAASamples > 0 ) {
+            caps.setSampleBuffers(true);
+            caps.setNumSamples(SceneMSAASamples);
+        }
+        System.out.println("Requested: " + caps);
+
+        final int rmode;
+        if( GraphVBAAMode ) {
+            rmode = Region.VBAA_RENDERING_BIT;
+        } else if( GraphMSAAMode ) {
+            rmode = Region.MSAA_RENDERING_BIT;
+        } else {
+            rmode = 0;
+        }
+
+        final GLWindow window = GLWindow.create(caps);
+        window.setPosition(x, y);
+        window.setSize(width, height);
+        window.setTitle("GraphUI Newt/AWT Demo: graph["+Region.getRenderModeString(rmode)+"], msaa "+SceneMSAASamples);
+        window.setSurfaceScale(reqSurfacePixelScale);
+        final int[] valReqSurfacePixelScale = window.getRequestedSurfaceScale(new int[2]);
+
+        final GPUUISceneGLListener0A sceneGLListener = 0 < GraphAutoMode ? new GPUUISceneGLListener0A(GraphAutoMode, DEBUG, TRACE) :
+                                                                     new GPUUISceneGLListener0A(rmode, DEBUG, TRACE);
+
+        window.addGLEventListener(sceneGLListener);
+        sceneGLListener.attachInputListenerTo(window);
+
+        final Animator animator = new Animator();
+        animator.setUpdateFPSFrames(60, System.err);
+        animator.add(window);
+
+        window.addWindowListener(new WindowAdapter() {
+            public void windowDestroyed(final WindowEvent e) {
+                animator.stop();
+            }
+        });
+
+        final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(window);
+        final Frame frame = new Frame("GraphUI Newt/AWT Demo: graph["+Region.getRenderModeString(rmode)+"], msaa "+SceneMSAASamples);
+
+        setComponentSize(newtCanvasAWT, new Dimension(width, height));
+        frame.add(newtCanvasAWT);
+        SwingUtilities.invokeAndWait(new Runnable() {
+           public void run() {
+               frame.pack();
+               frame.setVisible(true);
+           }
+        });
+        final int[] hasSurfacePixelScale1 = window.getCurrentSurfaceScale(new int[2]);
+        System.err.println("HiDPI PixelScale: "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
+                           valReqSurfacePixelScale[0]+"x"+valReqSurfacePixelScale[1]+" (val) -> "+
+                           hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
+        animator.start();
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo.java
new file mode 100644
index 0000000..16d56a0
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo.java
@@ -0,0 +1,154 @@
+package com.jogamp.opengl.test.junit.graph.demos;
+
+import javax.media.nativewindow.ScalableSurface;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+
+import com.jogamp.graph.curve.Region;
+import com.jogamp.newt.event.WindowAdapter;
+import com.jogamp.newt.event.WindowEvent;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.util.Animator;
+
+public class GPUUISceneNewtDemo {
+    static final boolean DEBUG = false;
+    static final boolean TRACE = false;
+
+    static int SceneMSAASamples = 0;
+    static boolean GraphVBAAMode = false;
+    static boolean GraphMSAAMode = false;
+    static float GraphAutoMode = GPUUISceneGLListener0A.DefaultNoAADPIThreshold;
+
+    static int[] reqSurfacePixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
+
+    public static void main(final String[] args) {
+        int width = 800, height = 400;
+        int x = 10, y = 10;
+
+        boolean forceES2 = false;
+        boolean forceES3 = false;
+        boolean forceGL3 = false;
+        boolean forceGLDef = false;
+
+        if( 0 != args.length ) {
+            for(int i=0; i<args.length; i++) {
+                if(args[i].equals("-smsaa")) {
+                    i++;
+                    SceneMSAASamples = MiscUtils.atoi(args[i], SceneMSAASamples);
+                    GraphMSAAMode = false;
+                    GraphVBAAMode = false;
+                    GraphAutoMode = 0f;
+                } else if(args[i].equals("-gmsaa")) {
+                    GraphMSAAMode = true;
+                    GraphVBAAMode = false;
+                    GraphAutoMode = 0f;
+                } else if(args[i].equals("-gvbaa")) {
+                    GraphMSAAMode = false;
+                    GraphVBAAMode = true;
+                    GraphAutoMode = 0f;
+                } else if(args[i].equals("-gauto")) {
+                    GraphMSAAMode = false;
+                    GraphVBAAMode = true;
+                    i++;
+                    GraphAutoMode = MiscUtils.atof(args[i], GraphAutoMode);
+                } else if(args[i].equals("-width")) {
+                    i++;
+                    width = MiscUtils.atoi(args[i], width);
+                } else if(args[i].equals("-height")) {
+                    i++;
+                    height = MiscUtils.atoi(args[i], height);
+                } else if(args[i].equals("-x")) {
+                    i++;
+                    x = MiscUtils.atoi(args[i], x);
+                } else if(args[i].equals("-y")) {
+                    i++;
+                    y = MiscUtils.atoi(args[i], y);
+                } else if(args[i].equals("-pixelScale")) {
+                    i++;
+                    final int pS = MiscUtils.atoi(args[i], reqSurfacePixelScale[0]);
+                    reqSurfacePixelScale[0] = pS;
+                    reqSurfacePixelScale[1] = pS;
+                } else if(args[i].equals("-es2")) {
+                    forceES2 = true;
+                } else if(args[i].equals("-es3")) {
+                    forceES3 = true;
+                } else if(args[i].equals("-gl3")) {
+                    forceGL3 = true;
+                } else if(args[i].equals("-gldef")) {
+                    forceGLDef = true;
+                }
+            }
+        }
+        System.err.println("forceES2   "+forceES2);
+        System.err.println("forceES3   "+forceES3);
+        System.err.println("forceGL3   "+forceGL3);
+        System.err.println("forceGLDef "+forceGLDef);
+        System.err.println("Desired win size "+width+"x"+height);
+        System.err.println("Desired win pos  "+x+"/"+y);
+        System.err.println("Scene MSAA Samples "+SceneMSAASamples);
+        System.err.println("Graph MSAA Mode "+GraphMSAAMode);
+        System.err.println("Graph VBAA Mode "+GraphVBAAMode);
+        System.err.println("Graph Auto Mode "+GraphAutoMode+" no-AA dpi threshold");
+
+        final GLProfile glp;
+        if(forceGLDef) {
+            glp = GLProfile.getDefault();
+        } else if(forceGL3) {
+            glp = GLProfile.get(GLProfile.GL3);
+        } else if(forceES3) {
+            glp = GLProfile.get(GLProfile.GLES3);
+        } else if(forceES2) {
+            glp = GLProfile.get(GLProfile.GLES2);
+        } else {
+            glp = GLProfile.getGL2ES2();
+        }
+        System.err.println("GLProfile: "+glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setAlphaBits(4);
+        if( SceneMSAASamples > 0 ) {
+            caps.setSampleBuffers(true);
+            caps.setNumSamples(SceneMSAASamples);
+        }
+        System.out.println("Requested: " + caps);
+
+        final int rmode;
+        if( GraphVBAAMode ) {
+            rmode = Region.VBAA_RENDERING_BIT;
+        } else if( GraphMSAAMode ) {
+            rmode = Region.MSAA_RENDERING_BIT;
+        } else {
+            rmode = 0;
+        }
+
+        final GLWindow window = GLWindow.create(caps);
+        window.setPosition(x, y);
+        window.setSize(width, height);
+        window.setTitle("GraphUI Newt Demo: graph["+Region.getRenderModeString(rmode)+"], msaa "+SceneMSAASamples);
+        window.setSurfaceScale(reqSurfacePixelScale);
+        final int[] valReqSurfacePixelScale = window.getRequestedSurfaceScale(new int[2]);
+
+        final GPUUISceneGLListener0A sceneGLListener = 0 < GraphAutoMode ? new GPUUISceneGLListener0A(GraphAutoMode, DEBUG, TRACE) :
+                                                                     new GPUUISceneGLListener0A(rmode, DEBUG, TRACE);
+
+        window.addGLEventListener(sceneGLListener);
+        sceneGLListener.attachInputListenerTo(window);
+
+        final Animator animator = new Animator();
+        animator.setUpdateFPSFrames(60, System.err);
+        animator.add(window);
+
+        window.addWindowListener(new WindowAdapter() {
+            public void windowDestroyed(final WindowEvent e) {
+                animator.stop();
+            }
+        });
+
+        window.setVisible(true);
+        final int[] hasSurfacePixelScale1 = window.getCurrentSurfaceScale(new int[2]);
+        System.err.println("HiDPI PixelScale: "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
+                           valReqSurfacePixelScale[0]+"x"+valReqSurfacePixelScale[1]+" (val) -> "+
+                           hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
+        animator.start();
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo01.java
deleted file mode 100644
index 0563ab2..0000000
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo01.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package com.jogamp.opengl.test.junit.graph.demos;
-
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.geom.opengl.SVertex;
-import com.jogamp.newt.event.WindowAdapter;
-import com.jogamp.newt.event.WindowEvent;
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.glsl.ShaderState;
-
-public class GPUUISceneNewtDemo01 {
-    static final boolean DEBUG = false;
-    static final boolean TRACE = false;
-    
-    public static void main(String[] args) {
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
-        caps.setAlphaBits(4);
-        caps.setSampleBuffers(true);
-        caps.setNumSamples(4);
-        
-        final GLWindow window = GLWindow.create(caps);        
-        window.setPosition(10, 10);
-        window.setSize(680, 480);
-        window.setTitle("GraphUI Newt Demo");
-        
-        final RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
-        GPUUISceneGLListener0A textGLListener = new GPUUISceneGLListener0A(rs, 0, DEBUG, TRACE);
-        window.addGLEventListener(textGLListener);
-        textGLListener.attachInputListenerTo(window);
-        
-        final Animator animator = new Animator();
-        animator.setUpdateFPSFrames(60, System.err);        
-        animator.add(window);
-        
-        window.addWindowListener(new WindowAdapter() {
-            public void windowDestroyed(WindowEvent e) {
-                animator.stop();
-            }
-        });
-        
-        window.setVisible(true);
-        animator.start();
-    }    
-}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo02.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo02.java
deleted file mode 100644
index 4c8da13..0000000
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/GPUUISceneNewtDemo02.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package com.jogamp.opengl.test.junit.graph.demos;
-
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.graph.curve.Region;
-import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.geom.opengl.SVertex;
-import com.jogamp.newt.event.WindowAdapter;
-import com.jogamp.newt.event.WindowEvent;
-import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.glsl.ShaderState;
-
-public class GPUUISceneNewtDemo02 {
-    static final boolean DEBUG = false;
-    static final boolean TRACE = false;
-    
-    public static void main(String[] args) {
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
-        caps.setAlphaBits(4);
-        caps.setSampleBuffers(true);
-        caps.setNumSamples(4);
-        
-        final GLWindow window = GLWindow.create(caps);        
-        window.setPosition(10, 10);
-        window.setSize(680, 480);
-        window.setTitle("GraphUI Newt Demo");
-        
-        final RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
-        GPUUISceneGLListener0A textGLListener = new GPUUISceneGLListener0A(rs, Region.VBAA_RENDERING_BIT, DEBUG, TRACE);
-        window.addGLEventListener(textGLListener);
-        textGLListener.attachInputListenerTo(window);
-        
-        final Animator animator = new Animator();
-        animator.setUpdateFPSFrames(60, System.err);
-        animator.add(window);
-        
-        window.addWindowListener(new WindowAdapter() {
-            public void windowDestroyed(WindowEvent e) {
-                animator.stop();
-            }
-        });
-        
-        window.setVisible(true);
-        animator.start();
-    }    
-}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/MSAATool.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/MSAATool.java
index 4cddb13..d838e42 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/MSAATool.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/MSAATool.java
@@ -34,50 +34,63 @@ import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLCapabilitiesImmutable;
 
 public class MSAATool {
-    public static boolean glIsEnabled(GL gl, int name) {
+    public static boolean glIsEnabled(final GL gl, final int name) {
         boolean isEnabled = false;
         try {
             isEnabled = gl.glIsEnabled(name);
-            int glerr = gl.glGetError();
+            final int glerr = gl.glGetError();
             if(GL.GL_NO_ERROR != glerr) {
                 System.err.println("glIsEnabled(0x"+Integer.toHexString(name)+") -> error 0x"+Integer.toHexString(glerr));
             }
-        } catch (Exception e) {
-            System.err.println("Catched Exception: "+e.getMessage());
+        } catch (final Exception e) {
+            System.err.println("Caught exception: "+e.getMessage());
             // e.printStackTrace();
-        }        
+        }
         return isEnabled;
     }
-    public static void dump(GLAutoDrawable drawable) {
-        float[] vf = new float[] { 0f };
-        byte[] vb = new byte[] { 0 };
-        int[] vi = new int[] { 0, 0 };
-        
+    public static void dump(final GLAutoDrawable drawable) {
+        final float[] vf = new float[] { 0f };
+        final byte[] vb = new byte[] { 0 };
+        final int[] vi = new int[] { 0, 0 };
+
         System.out.println("GL MSAA SETUP:");
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        GLCapabilitiesImmutable caps = drawable.getChosenGLCapabilities();
-        System.out.println("  Caps realised "+caps);        
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+        final GLCapabilitiesImmutable caps = drawable.getChosenGLCapabilities();
+        System.out.println("  Caps realised "+caps);
         System.out.println("  Caps sample buffers "+caps.getSampleBuffers()+", samples "+caps.getNumSamples());
-        
-        System.out.println("  GL MULTISAMPLE "+glIsEnabled(gl, GL2ES2.GL_MULTISAMPLE));
-        // sample buffers min 0, same as GLX_SAMPLE_BUFFERS_ARB or WGL_SAMPLE_BUFFERS_ARB 
-        gl.glGetIntegerv(GL2GL3.GL_SAMPLE_BUFFERS, vi, 0);
+
+        System.out.println("  GL MULTISAMPLE "+glIsEnabled(gl, GL.GL_MULTISAMPLE));
+        // sample buffers min 0, same as GLX_SAMPLE_BUFFERS_ARB or WGL_SAMPLE_BUFFERS_ARB
+        gl.glGetIntegerv(GL.GL_SAMPLE_BUFFERS, vi, 0);
         // samples min 0
-        gl.glGetIntegerv(GL2GL3.GL_SAMPLES, vi, 1);
+        gl.glGetIntegerv(GL.GL_SAMPLES, vi, 1);
         System.out.println("  GL SAMPLE_BUFFERS "+vi[0]+", SAMPLES "+vi[1]);
-        
+
         System.out.println("GL CSAA SETUP:");
         // default FALSE
-        System.out.println("  GL SAMPLE COVERAGE "+glIsEnabled(gl, GL2GL3.GL_SAMPLE_COVERAGE));
+        System.out.println("  GL SAMPLE COVERAGE "+glIsEnabled(gl, GL.GL_SAMPLE_COVERAGE));
         // default FALSE
-        System.out.println("  GL SAMPLE_ALPHA_TO_COVERAGE "+glIsEnabled(gl, GL2GL3.GL_SAMPLE_ALPHA_TO_COVERAGE));
+        System.out.println("  GL SAMPLE_ALPHA_TO_COVERAGE "+glIsEnabled(gl, GL.GL_SAMPLE_ALPHA_TO_COVERAGE));
         // default FALSE
-        System.out.println("  GL SAMPLE_ALPHA_TO_ONE "+glIsEnabled(gl, GL2GL3.GL_SAMPLE_ALPHA_TO_ONE));
+        System.out.println("  GL SAMPLE_ALPHA_TO_ONE "+glIsEnabled(gl, GL.GL_SAMPLE_ALPHA_TO_ONE));
         // default FALSE, value 1, invert false
-        gl.glGetFloatv(GL2GL3.GL_SAMPLE_COVERAGE_VALUE, vf, 0);
-        gl.glGetBooleanv(GL2GL3.GL_SAMPLE_COVERAGE_INVERT, vb, 0);
-        System.out.println("  GL SAMPLE_COVERAGE "+glIsEnabled(gl, GL2GL3.GL_SAMPLE_COVERAGE) + 
+        gl.glGetFloatv(GL.GL_SAMPLE_COVERAGE_VALUE, vf, 0);
+        gl.glGetBooleanv(GL.GL_SAMPLE_COVERAGE_INVERT, vb, 0);
+        System.out.println("  GL SAMPLE_COVERAGE "+glIsEnabled(gl, GL.GL_SAMPLE_COVERAGE) +
                               ": SAMPLE_COVERAGE_VALUE "+vf[0]+
-                              ", SAMPLE_COVERAGE_INVERT "+vb[0]);            
+                              ", SAMPLE_COVERAGE_INVERT "+vb[0]);
+        dumpBlend(gl);
+    }
+    public static void dumpBlend(final GL gl) {
+        final int[] vi = new int[] { 0, 0, 0, 0 };
+        gl.glGetIntegerv(GL.GL_BLEND, vi, 0);
+        gl.glGetIntegerv(GL.GL_BLEND_SRC_ALPHA, vi, 1);
+        gl.glGetIntegerv(GL.GL_BLEND_SRC_RGB, vi, 2);
+        gl.glGetIntegerv(GL.GL_BLEND_DST_RGB, vi, 3);
+        final boolean blendEnabled = vi[0] == GL.GL_TRUE;
+        System.out.println("GL_BLEND "+blendEnabled+"/"+glIsEnabled(gl, GL.GL_BLEND) +
+                           "  GL_SRC_ALPHA 0x"+Integer.toHexString(vi[1])+
+                           "  GL_SRC_RGB 0x"+Integer.toHexString(vi[2])+
+                           "  GL_DST_RGB 0x"+Integer.toHexString(vi[3]));
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/button-pressed-145x53.png b/src/test/com/jogamp/opengl/test/junit/graph/demos/button-pressed-145x53.png
new file mode 100644
index 0000000..1eba3a0
Binary files /dev/null and b/src/test/com/jogamp/opengl/test/junit/graph/demos/button-pressed-145x53.png differ
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/button-released-145x53.png b/src/test/com/jogamp/opengl/test/junit/graph/demos/button-released-145x53.png
new file mode 100644
index 0000000..fe223c6
Binary files /dev/null and b/src/test/com/jogamp/opengl/test/junit/graph/demos/button-released-145x53.png differ
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/CrossHair.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/CrossHair.java
new file mode 100644
index 0000000..0086222
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/CrossHair.java
@@ -0,0 +1,110 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.junit.graph.demos.ui;
+
+import javax.media.opengl.GL2ES2;
+
+import com.jogamp.graph.curve.OutlineShape;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.geom.Vertex;
+import com.jogamp.graph.geom.Vertex.Factory;
+
+/**
+ * GPU based resolution independent Button impl
+ */
+public class CrossHair extends UIShape {
+    private float width, height, lineWidth;
+
+    public CrossHair(final Factory<? extends Vertex> factory, final int renderModes, final float width, final float height, final float linewidth) {
+        super(factory, renderModes);
+        this.width = width;
+        this.height = height;
+        this.lineWidth = linewidth;
+    }
+
+    public final float getWidth() { return width; }
+    public final float getHeight() { return height; }
+    public final float getLineWidth() { return lineWidth; }
+
+    public void setDimension(final float width, final float height, final float lineWidth) {
+        this.width = width;
+        this.height = height;
+        this.lineWidth = lineWidth;
+        markShapeDirty();
+    }
+
+    @Override
+    protected void clearImpl(final GL2ES2 gl, final RegionRenderer renderer) {
+    }
+
+    @Override
+    protected void destroyImpl(final GL2ES2 gl, final RegionRenderer renderer) {
+    }
+
+    @Override
+    protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) {
+        final OutlineShape shape = new OutlineShape(renderer.getRenderState().getVertexFactory());
+
+        final float tw = getWidth();
+        final float th = getHeight();
+        final float twh = tw/2f;
+        final float thh = th/2f;
+        final float lwh = lineWidth/2f;
+
+        final float ctrX = 0f, ctrY = 0f;
+        float ctrZ = 0f;
+
+        // vertical (CCW!)
+        shape.addVertex(ctrX-lwh, ctrY-thh, ctrZ,  true);
+        shape.addVertex(ctrX+lwh, ctrY-thh, ctrZ,  true);
+        shape.addVertex(ctrX+lwh, ctrY+thh, ctrZ,  true);
+        shape.addVertex(ctrX-lwh, ctrY+thh, ctrZ,  true);
+        shape.closeLastOutline(true);
+
+        ctrZ -= 0.05f;
+
+        // horizontal (CCW!)
+        shape.addEmptyOutline();
+        shape.addVertex(ctrX-twh, ctrY-lwh, ctrZ,  true);
+        shape.addVertex(ctrX+twh, ctrY-lwh, ctrZ,  true);
+        shape.addVertex(ctrX+twh, ctrY+lwh, ctrZ,  true);
+        shape.addVertex(ctrX-twh, ctrY+lwh, ctrZ,  true);
+        shape.closeLastOutline(true);
+
+        shape.setIsQuadraticNurbs();
+        shape.setSharpness(shapesSharpness);
+        region.addOutlineShape(shape, null, rgbaColor);
+
+        box.resize(shape.getBounds());
+    }
+
+    @Override
+    public String getSubString() {
+        return super.getSubString()+", dim "+getWidth() + "x" + getHeight();
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/GLEventListenerButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/GLEventListenerButton.java
new file mode 100644
index 0000000..06d8692
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/GLEventListenerButton.java
@@ -0,0 +1,132 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.junit.graph.demos.ui;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDrawable;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.GLOffscreenAutoDrawable;
+
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.geom.Vertex;
+import com.jogamp.graph.geom.Vertex.Factory;
+import com.jogamp.opengl.FBObject;
+import com.jogamp.opengl.util.texture.ImageSequence;
+import com.jogamp.opengl.util.texture.Texture;
+
+/**
+ * GPU based resolution independent Button impl,
+ * rendering {@link GLEventListener} content via FBO as an {@link ImageSequence}.
+ */
+public class GLEventListenerButton extends TextureSeqButton {
+    private final GLEventListener glel;
+    private final boolean useAlpha;
+    private volatile int fboWidth = 200;
+    private volatile int fboHeight = 200;
+    private volatile GLOffscreenAutoDrawable.FBO fboGLAD = null;
+    private boolean animateGLEL = false;
+
+    public GLEventListenerButton(final Factory<? extends Vertex> factory, final int renderModes,
+                                 final float width, final float height, final int textureUnit,
+                                 final GLEventListener glel, final boolean useAlpha, final int fboWidth, final int fboHeight) {
+        super(factory, renderModes, width, height, new ImageSequence(textureUnit, true));
+        this.glel = glel;
+        this.useAlpha = useAlpha;
+
+        setColor(0.95f, 0.95f, 0.95f, 1.0f);
+        setPressedColorMod(1f, 1f, 1f, 0.9f);
+        setToggleOffColorMod(0.8f, 0.8f, 0.8f, 1.0f);
+        setToggleOnColorMod(1.0f, 1.0f, 1.0f, 1.0f);
+
+        this.fboWidth = fboWidth;
+        this.fboHeight = fboHeight;
+    }
+
+    public final void setAnimate(final boolean v) { animateGLEL = v; }
+    public final boolean getAnimate() { return animateGLEL; }
+
+    public final void setFBOSize(final int fboWidth, final int fboHeight) {
+        this.fboWidth = fboWidth;
+        this.fboHeight = fboHeight;
+    }
+
+    public final GLOffscreenAutoDrawable.FBO getFBOAutoDrawable() { return fboGLAD; }
+
+    @Override
+    public void drawShape(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) {
+        if( null == fboGLAD ) {
+            final ImageSequence imgSeq = (ImageSequence)texSeq;
+
+            final GLContext ctx = gl.getContext();
+            final GLDrawable drawable = ctx.getGLDrawable();
+            final GLCapabilitiesImmutable capsHas = drawable.getChosenGLCapabilities();
+            final GLCapabilities caps = (GLCapabilities) capsHas.cloneMutable();
+            caps.setFBO(true);
+            caps.setDoubleBuffered(false);
+            if( !useAlpha ) {
+                caps.setAlphaBits(0);
+            }
+            final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
+
+            fboGLAD = (GLOffscreenAutoDrawable.FBO) factory.createOffscreenAutoDrawable(
+                            drawable.getNativeSurface().getGraphicsConfiguration().getScreen().getDevice(),
+                            caps, null, fboWidth, fboHeight);
+            fboWidth = 0;
+            fboHeight = 0;
+            fboGLAD.setSharedContext(ctx);
+            fboGLAD.setTextureUnit(imgSeq.getTextureUnit());
+            fboGLAD.addGLEventListener(glel);
+            fboGLAD.display(); // 1st init!
+
+            final FBObject.TextureAttachment texA01 = fboGLAD.getColorbuffer(GL.GL_FRONT).getTextureAttachment();
+            final Texture tex = new Texture(texA01.getName(), imgSeq.getTextureTarget(),
+                                    fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(), fboGLAD.getSurfaceWidth(), fboGLAD.getSurfaceHeight(),
+                                    false /* mustFlipVertically */);
+            imgSeq.addFrame(gl, tex);
+            markStateDirty();
+        } else if( 0 != fboWidth*fboHeight ) {
+            fboGLAD.setSurfaceSize(fboWidth, fboHeight);
+            fboWidth = 0;
+            fboHeight = 0;
+            markStateDirty();
+        } else if( animateGLEL ) {
+            fboGLAD.display();
+        }
+
+        super.drawShape(gl, renderer, sampleCount);
+
+        if( animateGLEL ) {
+            markStateDirty(); // keep on going
+        }
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/ImageSeqButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/ImageSeqButton.java
new file mode 100644
index 0000000..5d8e9e8
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/ImageSeqButton.java
@@ -0,0 +1,63 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.junit.graph.demos.ui;
+
+import javax.media.opengl.GL2ES2;
+
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.geom.Vertex;
+import com.jogamp.graph.geom.Vertex.Factory;
+import com.jogamp.opengl.util.texture.ImageSequence;
+
+/**
+ * GPU based resolution independent {@link ImageSequence} Button impl
+ */
+public class ImageSeqButton extends TextureSeqButton {
+
+    public ImageSeqButton(final Factory<? extends Vertex> factory, final int renderModes,
+                         final float width, final float height, final ImageSequence texSeq) {
+        super(factory, renderModes, width, height, texSeq);
+        setColor(0.95f, 0.95f, 0.95f, 1.0f);
+        setPressedColorMod(1f, 1f, 1f, 0.9f);
+        setToggleOffColorMod(0.8f, 0.8f, 0.8f, 1.0f);
+        setToggleOnColorMod(1.0f, 1.0f, 1.0f, 1.0f);
+    }
+
+    public final void setCurrentIdx(final int idx) {
+        ((ImageSequence)texSeq).setCurrentIdx(idx);
+        markStateDirty();
+    }
+
+    @Override
+    public void drawShape(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) {
+        super.drawShape(gl, renderer, sampleCount);
+        if( !((ImageSequence)texSeq).getManualStepping() ) {
+            markStateDirty(); // keep on going
+        }
+    };
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java
index 4fef2d8..1181ef9 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label.java
@@ -29,77 +29,89 @@ package com.jogamp.opengl.test.junit.graph.demos.ui;
 
 import javax.media.opengl.GL2ES2;
 
-import jogamp.graph.curve.text.GlyphString;
+import jogamp.graph.geom.plane.AffineTransform;
 
+import com.jogamp.graph.curve.OutlineShape;
 import com.jogamp.graph.curve.opengl.RegionRenderer;
-import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.graph.curve.opengl.TextRegionUtil;
 import com.jogamp.graph.font.Font;
 import com.jogamp.graph.geom.Vertex;
 import com.jogamp.graph.geom.Vertex.Factory;
 
-public abstract class Label extends UIShape implements UITextShape {
+public class Label extends UIShape {
     protected Font font;
-    protected int size;
+    protected float pixelSize;
     protected String text;
-    protected GlyphString glyphString; 
-    
-    public Label(Factory<? extends Vertex> factory, Font font, int size, String text) {
-        super(factory);
+
+    public Label(final Factory<? extends Vertex> factory, final int renderModes, final Font font, final float pixelSize, final String text) {
+        super(factory, renderModes);
         this.font = font;
-        this.size = size;
+        this.pixelSize = pixelSize;
         this.text = text;
     }
-    
-    public GlyphString getGlyphString() {
-        return glyphString;
-    }
-    
+
     public String getText() {
         return text;
     }
-    
-    public void setText(String text) {
+
+    public void setText(final String text) {
         this.text = text;
-        dirty |= DIRTY_SHAPE;
+        markShapeDirty();
     }
-    
+
     public Font getFont() {
         return font;
     }
 
-    public void setFont(Font font) {
+    public void setFont(final Font font) {
         this.font = font;
-        dirty |= DIRTY_SHAPE;        
+        markShapeDirty();
     }
 
-    public int getSize() {
-        return size;
+    public float getPixelSize() {
+        return pixelSize;
     }
 
-    public void setSize(int size) {
-        this.size = size;
-        dirty |= DIRTY_SHAPE;        
+    public float getLineHeight() {
+        return font.getLineHeight(pixelSize);
     }
 
-    public String toString(){
-        return "Label [" + font.toString() + ", size " + size + ", " + getText() + "]";
+    public void setPixelSize(final float pixelSize) {
+        this.pixelSize = pixelSize;
+        markShapeDirty();
     }
 
     @Override
-    protected void clearImpl() {
-        if(null != glyphString) {
-            glyphString.destroy(null, null);
-        }        
+    protected void clearImpl(final GL2ES2 gl, final RegionRenderer renderer) {
     }
-    
+
+    @Override
+    protected void destroyImpl(final GL2ES2 gl, final RegionRenderer renderer) {
+    }
+
+    private final float[] tmpV3 = new float[3];
+    private final AffineTransform tempT1 = new AffineTransform();
+    private final AffineTransform tempT2 = new AffineTransform();
+
+    private final TextRegionUtil.ShapeVisitor shapeVisitor = new TextRegionUtil.ShapeVisitor() {
+        @Override
+        public void visit(final OutlineShape shape, final AffineTransform t) {
+            shape.setSharpness(shapesSharpness);
+            region.addOutlineShape(shape, t, rgbaColor);
+            box.resize(shape.getBounds(), t, tmpV3);
+        }
+    };
+
     @Override
-    protected void createShape() {
-        clearImpl();
-        glyphString = GlyphString.createString(shape, getVertexFactory(), font, size, text);        
+    protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) {
+        TextRegionUtil.processString(shapeVisitor, null, font, pixelSize, text, tempT1, tempT2);
+        final float[] ctr = box.getCenter();
+        setRotationOrigin( ctr[0], ctr[1], ctr[2]);
     }
 
     @Override
-    public void render(GL2ES2 gl, RenderState rs, RegionRenderer renderer,
-            int renderModes, int[/*1*/] texSize, boolean selection) {        
+    public String getSubString() {
+        final int m = Math.min(text.length(), 8);
+        return super.getSubString()+", psize " + pixelSize + ", '" + text.substring(0, m)+"'";
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label0.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label0.java
new file mode 100644
index 0000000..9a12b71
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/Label0.java
@@ -0,0 +1,105 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.junit.graph.demos.ui;
+
+import jogamp.graph.geom.plane.AffineTransform;
+
+import com.jogamp.graph.curve.OutlineShape;
+import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.TextRegionUtil;
+import com.jogamp.graph.font.Font;
+import com.jogamp.opengl.math.geom.AABBox;
+
+public class Label0 {
+    protected Font font;
+    protected String text;
+    protected final float[] rgbaColor;
+    protected final AABBox box;
+
+    public Label0(final Font font, final String text, final float[] rgbaColor) {
+        this.font = font;
+        this.text = text;
+        this.rgbaColor = rgbaColor;
+        this.box = new AABBox();
+    }
+
+    public final String getText() { return text; }
+
+    public final float[] getColor() { return rgbaColor; }
+
+    public final void setColor(final float r, final float g, final float b, final float a) {
+        this.rgbaColor[0] = r;
+        this.rgbaColor[1] = g;
+        this.rgbaColor[2] = b;
+        this.rgbaColor[3] = a;
+    }
+
+    public final void setText(final String text) {
+        this.text = text;
+    }
+
+    public final Font getFont() { return font; }
+
+    public final void setFont(final Font font) {
+        this.font = font;
+    }
+
+    public final AABBox getBounds() { return box; }
+
+    private final float[] tmpV3 = new float[3];
+    private final AffineTransform tempT1 = new AffineTransform();
+    private final AffineTransform tempT2 = new AffineTransform();
+
+    private final TextRegionUtil.ShapeVisitor shapeVisitor = new TextRegionUtil.ShapeVisitor() {
+        @Override
+        public void visit(final OutlineShape shape, final AffineTransform t) {
+            final AffineTransform t1 = t.preConcatenate(tLeft);
+            region.addOutlineShape(shape, t1, rgbaColor);
+            box.resize(shape.getBounds(), t1, tmpV3);
+        }
+    };
+
+    private Region region;
+    private AffineTransform tLeft;
+
+    public final AABBox addShapeToRegion(final float pixelSize, final Region region, final AffineTransform tLeft) {
+        box.reset();
+        this.region = region;
+        this.tLeft = tLeft;
+        TextRegionUtil.processString(shapeVisitor, null, font, pixelSize, text, tempT1, tempT2);
+        this.region = null;
+        this.tLeft = null;
+        return box;
+    }
+
+    @Override
+    public final String toString(){
+        final int m = Math.min(text.length(), 8);
+        return "Label0 ['" + text.substring(0, m) + "']";
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/LabelButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/LabelButton.java
new file mode 100644
index 0000000..4943c94
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/LabelButton.java
@@ -0,0 +1,174 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.junit.graph.demos.ui;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES2;
+
+import com.jogamp.graph.curve.OutlineShape;
+import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.font.Font;
+import com.jogamp.graph.geom.Vertex;
+import com.jogamp.graph.geom.Vertex.Factory;
+import com.jogamp.opengl.math.geom.AABBox;
+
+/**
+ * GPU based resolution independent Button impl
+ */
+public class LabelButton extends RoundButton {
+    /** {@value} */
+    public static final float DEFAULT_SPACING_X = 0.08f;
+    /** {@value} */
+    public static final float DEFAULT_SPACING_Y = 0.40f;
+
+    private static final float DEFAULT_2PASS_LABEL_ZOFFSET = -0.05f;
+
+    private final Label0 label;
+    private float spacingX = DEFAULT_SPACING_X;
+    private float spacingY = DEFAULT_SPACING_Y;
+
+    public LabelButton(final Factory<? extends Vertex> factory, final int renderModes,
+                       final Font labelFont, final String labelText,
+                       final float width, final float height) {
+        super(factory, renderModes | Region.COLORCHANNEL_RENDERING_BIT, width, height);
+        this.label = new Label0(labelFont, labelText, new float[] { 1.33f, 1.33f, 1.33f, 1.0f }); // 0.75 * 1.33 = 1.0
+        setColor(0.75f, 0.75f, 0.75f, 1.0f);
+        setPressedColorMod(0.9f, 0.9f, 0.9f, 0.7f);
+        setToggleOffColorMod(0.65f, 0.65f, 0.65f, 1.0f);
+        setToggleOnColorMod(0.85f, 0.85f, 0.85f, 1.0f);
+    }
+
+    @Override
+    public void drawShape(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) {
+        if( false ) {
+            // Setup poly offset for z-fighting
+            gl.glEnable(GL.GL_POLYGON_OFFSET_FILL);
+            gl.glPolygonOffset(0f, 1f);
+            super.drawShape(gl, renderer, sampleCount);
+            gl.glDisable(GL.GL_POLYGON_OFFSET_FILL);
+        } else {
+            super.drawShape(gl, renderer, sampleCount);
+        }
+    }
+
+    @Override
+    protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) {
+        final OutlineShape shape = new OutlineShape(renderer.getRenderState().getVertexFactory());
+        if(corner == 0.0f) {
+            createSharpOutline(shape, DEFAULT_2PASS_LABEL_ZOFFSET);
+        } else {
+            createCurvedOutline(shape, DEFAULT_2PASS_LABEL_ZOFFSET);
+        }
+        shape.setIsQuadraticNurbs();
+        shape.setSharpness(shapesSharpness);
+        region.addOutlineShape(shape, null, rgbaColor);
+        box.resize(shape.getBounds());
+
+        // Precompute text-box size .. guessing pixelSize
+        final float lPixelSize0 = 10f;
+        final float lw = width * ( 1f - spacingX ) ;
+        final float lh = height * ( 1f - spacingY ) ;
+        final AABBox lbox0 = label.font.getMetricBounds(label.text, lPixelSize0);
+        final float lsx = lw / lbox0.getWidth();
+        final float lsy = lh / lbox0.getHeight();
+        final float lPixelSize1 = lsx < lsy ? lPixelSize0 * lsx : lPixelSize0 * lsy;
+        if( DRAW_DEBUG_BOX ) {
+            System.err.println("RIButton: spacing "+spacingX+", "+spacingY);
+            System.err.println("RIButton: bbox "+box);
+            System.err.println("RIButton: lbox "+lbox0+", "+label.text);
+            System.err.println("RIButton: net-text "+lw+" x "+lh);
+            System.err.println("RIButton: lsx "+lsx+", lsy "+lsy+": pixelSize "+lPixelSize0+" -> "+lPixelSize1);
+        }
+
+        // Setting pixelSize based on actual text-box size
+        final AABBox lbox1 = label.font.getPointsBounds(null, label.text, lPixelSize1, tempT1, tempT2);
+        // Center text .. (share same center w/ button)
+        final float[] lctr = lbox1.getCenter();
+        final float[] ctr = box.getCenter();
+        final float[] ltx = new float[] { ctr[0] - lctr[0], ctr[1] - lctr[1], 0f };
+
+        final AABBox lbox2 = label.addShapeToRegion(lPixelSize1, region, tempT1.setToTranslation(ltx[0], ltx[1]));
+        if( DRAW_DEBUG_BOX ) {
+            System.err.printf("RIButton.0: lbox1 %s%n", lbox1);
+            System.err.printf("RIButton.0: lbox2 %s%n", lbox2);
+        }
+
+        setRotationOrigin( ctr[0], ctr[1], ctr[2]);
+
+        if( DRAW_DEBUG_BOX ) {
+            System.err.println("XXX.UIShape.RIButton: Added Shape: "+shape+", "+box);
+        }
+    }
+
+    public final float getSpacingX() { return spacingX; }
+    public final float getSpacingY() { return spacingY; }
+
+    /**
+     * In percent of text label
+     * @param spacingX spacing in percent on X, default is {@link #DEFAULT_SPACING_X}
+     * @param spacingY spacing in percent on Y, default is {@link #DEFAULT_SPACING_Y}
+     */
+    public final void setSpacing(final float spacingX, final float spacingY) {
+        if ( spacingX < 0.0f ) {
+            this.spacingX = 0.0f;
+        } else if ( spacingX > 1.0f ) {
+            this.spacingX = 1.0f;
+        } else {
+            this.spacingX = spacingX;
+        }
+        if ( spacingY < 0.0f ) {
+            this.spacingY = 0.0f;
+        } else if ( spacingY > 1.0f ) {
+            this.spacingY = 1.0f;
+        } else {
+            this.spacingY = spacingY;
+        }
+        markShapeDirty();
+    }
+
+    public final float[] getLabelColor() {
+        return label.getColor();
+    }
+
+    public final void setLabelColor(final float r, final float g, final float b) {
+        label.setColor(r, g, b, 1.0f);
+        markShapeDirty();
+    }
+
+    public final void setLabelText(final Font labelFont, final String labelText) {
+        label.setFont(labelFont);
+        label.setText(labelText);
+        markShapeDirty();
+    }
+
+    @Override
+    public String getSubString() {
+        return super.getSubString()+", "+ label + ", " + "spacing: " + spacingX+"/"+spacingY;
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/MediaPlayerButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/MediaPlayerButton.java
new file mode 100644
index 0000000..76b70dd
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/MediaPlayerButton.java
@@ -0,0 +1,131 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.junit.graph.demos.ui;
+
+import javax.media.opengl.GL2ES2;
+
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.geom.Vertex;
+import com.jogamp.graph.geom.Vertex.Factory;
+import com.jogamp.opengl.util.av.GLMediaPlayer;
+import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
+import com.jogamp.opengl.util.av.GLMediaPlayer.StreamException;
+import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
+
+/**
+ * GPU based resolution independent {@link GLMediaPlayer} Button impl
+ */
+public class MediaPlayerButton extends TextureSeqButton {
+    public boolean verbose = false;
+
+    /**
+     * @param factory
+     * @param renderModes
+     * @param width
+     * @param height
+     * @param mPlayer
+     * @param mPlayerListener
+     */
+    public MediaPlayerButton(final Factory<? extends Vertex> factory, final int renderModes,
+                             final float width, final float height,
+                             final GLMediaPlayer mPlayer) {
+        super(factory, renderModes, width, height, mPlayer);
+        setColor(0.8f, 0.8f, 0.8f, 1.0f);
+        setPressedColorMod(1.1f, 1.1f, 1.1f, 0.7f);
+        setToggleOffColorMod(0.8f, 0.8f, 0.8f, 1.0f);
+        setToggleOnColorMod(1.0f, 1.0f, 1.0f, 1.0f);
+        setEnabled(false); // data and shader n/a yet
+    }
+
+    /**
+     * Add the default {@link GLMediaEventListener} to {@link #getGLMediaPlayer() this class's GLMediaPlayer}.
+     */
+    public void addDefaultEventListener() {
+        getGLMediaPlayer().addEventListener(defGLMediaEventListener);
+    }
+
+    public final GLMediaPlayer getGLMediaPlayer() { return (GLMediaPlayer)texSeq; }
+
+    private final GLMediaEventListener defGLMediaEventListener = new GLMediaEventListener() {
+            @Override
+            public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) {
+                // texButton.markStateDirty();
+            }
+
+            @Override
+            public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
+                final GLMediaPlayer mPlayer = (GLMediaPlayer)texSeq;
+                if( verbose ) {
+                    System.err.println("MovieCube AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
+                    System.err.println("MovieCube State: "+mp);
+                }
+                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
+                    MediaPlayerButton.this.setEnabled(true); // data and shader is available ..
+                }
+                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) ) {
+                    // FIXME: mPlayer.resetGLState();
+                }
+                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_EOS & event_mask ) ) {
+                    new Thread() {
+                        public void run() {
+                            // loop for-ever ..
+                            mPlayer.seek(0);
+                            mPlayer.play();
+                        } }.start();
+                } else if( 0 != ( GLMediaEventListener.EVENT_CHANGE_ERR & event_mask ) ) {
+                    final StreamException se = mPlayer.getStreamException();
+                    if( null != se ) {
+                        se.printStackTrace();
+                    }
+                }
+            } };
+
+
+    @Override
+    protected void destroyImpl(final GL2ES2 gl, final RegionRenderer renderer) {
+        ((GLMediaPlayer)texSeq).destroy(gl);
+    }
+
+    @Override
+    public void drawShape(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) {
+        final GLMediaPlayer mPlayer = (GLMediaPlayer)texSeq;
+        if( GLMediaPlayer.State.Initialized == mPlayer.getState() ) {
+            try {
+                mPlayer.initGL(gl);
+                mPlayer.setAudioVolume( 0f );
+                mPlayer.play();
+                markStateDirty();
+            } catch (final Exception e) {
+                e.printStackTrace();
+            }
+        }
+        super.drawShape(gl, renderer, sampleCount);
+        markStateDirty(); // keep on going
+    };
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RIButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RIButton.java
deleted file mode 100644
index 12c90f8..0000000
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RIButton.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.opengl.test.junit.graph.demos.ui;
-
-import javax.media.opengl.GL2ES2;
-
-import com.jogamp.graph.curve.opengl.RegionRenderer;
-import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.font.Font;
-import com.jogamp.graph.geom.Vertex;
-import com.jogamp.graph.geom.Vertex.Factory;
-import com.jogamp.opengl.math.geom.AABBox;
-import com.jogamp.opengl.test.junit.graph.demos.ui.opengl.UIRegion;
-
-/** GPU based resolution independent Button impl
- */
-public abstract class RIButton extends UIShape {
-    private float width, height;
-    private Label label;
-    private float spacing = 4.0f;
-    private float corner = 1.0f;
-    private float labelZOffset = -0.05f;
-    
-    private float[] buttonColor = {0.6f, 0.6f, 0.6f};
-    private float[] buttonSelectedColor = {0.8f,0.8f,0.8f};
-    private float[] labelColor = {1.0f, 1.0f, 1.0f};
-    private float[] labelSelectedColor = {0.1f, 0.1f, 0.1f};
- 
-    
-    public RIButton(Factory<? extends Vertex> factory, Font labelFont, String labelText, float width, float height) {
-        super(factory);
-        
-        // FIXME: Determine font size - PMV Matrix relation ?
-        // this.label = new Label(factory, labelFont, (int)(height - 2f * spacing), labelText);
-        this.label = new Label(factory, labelFont, 10, labelText){
-            public void onClick() { }
-            public void onPressed() { }
-            public void onRelease() { }
-        };
-        
-        this.width = width;
-        this.height = height;
-    }
-
-    public final float getWidth() { return width; }
-    public final float getHeight() { return height; }
-    public float getCorner() { return corner; }
-    public Label getLabel() { return label; }
-
-    public void setDimension(int width, int height) {
-        this.width = width;
-        this.height = height;
-        dirty |= DIRTY_SHAPE;
-    }
-    
-    @Override
-    protected void clearImpl() {
-        label.clear();
-    }
-    
-    @Override
-    protected void createShape() {
-        // FIXME: Only possible if all data (color) is 
-        //        is incl. in Outline Shape.
-        //        Until then - draw each separately!
-        //shape.addOutlinShape( label.getShape() );
-        label.updateShape();
-        
-        final AABBox lbox = label.getBounds();
-        if(corner == 0.0f) {
-            createSharpOutline(lbox);
-        } else {
-            createCurvedOutline(lbox);
-        }
-        float sx = getWidth() / ( 2f*spacing + lbox.getWidth() );
-        float sy = getHeight() / ( 2f*spacing + lbox.getHeight() );
-        
-        setScale(sx, sy, 1);
-    }
-    
-    
-    private void createSharpOutline(AABBox lbox) {
-        float th = (2f*spacing) + lbox.getHeight();
-        float tw = (2f*spacing) + lbox.getWidth();
-        
-        float minX = lbox.getMinX()-spacing;
-        float minY = lbox.getMinY()-spacing;
-        float minZ = labelZOffset;
-        
-        shape.addVertex(minX, minY, minZ,  true);
-        shape.addVertex(minX+tw, minY,  minZ, true);
-        shape.addVertex(minX+tw, minY + th, minZ,  true);
-        shape.addVertex(minX, minY + th, minZ,  true);
-        shape.closeLastOutline();
-    }
-    
-    private void createCurvedOutline(AABBox lbox){
-        float th = 2.0f*spacing + lbox.getHeight();
-        float tw = 2.0f*spacing + lbox.getWidth();
-        
-        float cw = 0.5f*corner*Math.min(tw, th);
-        float ch = 0.5f*corner*Math.min(tw, th);
-        
-        float minX = lbox.getMinX()-spacing;
-        float minY = lbox.getMinY()-spacing;
-        float minZ = labelZOffset;
-        shape.addVertex(minX, minY + ch, minZ, true);
-        shape.addVertex(minX, minY,  minZ, false);
-        shape.addVertex(minX + cw, minY, minZ,  true);
-        shape.addVertex(minX + tw - cw, minY,  minZ, true);
-        shape.addVertex(minX + tw, minY, minZ,  false);
-        shape.addVertex(minX + tw, minY + ch, minZ,  true);
-        shape.addVertex(minX + tw, minY + th- ch, minZ,  true);
-        shape.addVertex(minX + tw, minY + th, minZ,  false);
-        shape.addVertex(minX + tw - cw, minY + th, minZ,  true);
-        shape.addVertex(minX + cw, minY + th, minZ,  true);
-        shape.addVertex(minX, minY + th, minZ,  false);
-        shape.addVertex(minX, minY + th - ch, minZ,  true);
-        shape.closeLastOutline();
-    }
-    
-    public void setCorner(float corner) {
-        if(corner > 1.0f){
-            this.corner = 1.0f;
-        }
-        else if(corner < 0.01f){
-            this.corner = 0.0f;
-        }
-        else{
-            this.corner = corner;
-        }
-        dirty |= DIRTY_SHAPE;
-    }
-    
-    public float getLabelZOffset() {
-        return labelZOffset;
-    }
-
-    public void setLabelZOffset(float labelZOffset) {
-        this.labelZOffset = -labelZOffset;
-        dirty |= DIRTY_SHAPE;
-    }
-    public float getSpacing() {
-        return spacing;
-    }
-
-    public void setSpacing(float spacing) {
-        if(spacing < 0.0f){
-            this.spacing = 0.0f;
-        }
-        else{
-            this.spacing = spacing;
-        }
-        dirty |= DIRTY_SHAPE;
-    }
-    
-    public float[] getButtonColor() {
-        return buttonColor;
-    }
-
-    public void setButtonColor(float r, float g, float b) {
-        this.buttonColor = new float[3];
-        this.buttonColor[0] = r;
-        this.buttonColor[1] = g;
-        this.buttonColor[2] = b;
-    }
-
-    public float[] getLabelColor() {
-        return labelColor;
-    }
-    
-    private UIRegion buttonRegion = null;
-    private UIRegion labelRegion = null;
-    private boolean toggle =false;
-    private boolean toggleable = false;
-
-    public void render(GL2ES2 gl, RenderState rs, RegionRenderer renderer, int renderModes, int[/*1*/] texSize, boolean selection) {
-        if(null == buttonRegion) {
-            buttonRegion = new UIRegion(this);
-            labelRegion = new UIRegion(getLabel());
-        }  
-        
-        gl.glEnable(GL2ES2.GL_POLYGON_OFFSET_FILL);
-        gl.glPolygonOffset(0.0f, 1f);
-        
-        float[] bColor = buttonColor;
-        if(isPressed() || toggle){
-            bColor = buttonSelectedColor;
-        }
-        if(!selection){
-            renderer.setColorStatic(gl, bColor[0], bColor[1], bColor[2]);
-        }
-        renderer.draw(gl, buttonRegion.getRegion(gl, rs, renderModes), getPosition(), texSize);
-        gl.glDisable(GL2ES2.GL_POLYGON_OFFSET_FILL);
-        
-        float[] lColor = labelColor;
-        if(isPressed() || toggle ){
-            lColor = labelSelectedColor;
-        }
-        if(!selection){
-            renderer.setColorStatic(gl, lColor[0], lColor[1], lColor[2]);
-        }
-        renderer.draw(gl, labelRegion.getRegion(gl, rs, renderModes), getPosition(), texSize);
-    }
-    public void setPressed(boolean b) {
-        super.setPressed(b);
-        if(isToggleable() && b) {
-            toggle = !toggle;
-        }
-    }
-    
-    public void setLabelColor(float r, float g, float b) {
-        this.labelColor = new float[3];
-        this.labelColor[0] = r;
-        this.labelColor[1] = g;
-        this.labelColor[2] = b;
-    }
-    
-    public void setButtonSelectedColor(float r, float g, float b){
-        this.buttonSelectedColor = new float[3];
-        this.buttonSelectedColor[0] = r;
-        this.buttonSelectedColor[1] = g;
-        this.buttonSelectedColor[2] = b;
-    }
-    
-    public void setLabelSelectedColor(float r, float g, float b){
-        this.labelSelectedColor = new float[3];
-        this.labelSelectedColor[0] = r;
-        this.labelSelectedColor[1] = g;
-        this.labelSelectedColor[2] = b;
-    }
-
-    public boolean isToggleable() {
-        return toggleable;
-    }
-    
-    public void setToggleable(boolean toggleable) {
-        this.toggleable = toggleable;
-    }
-
-    public String toString() {
-        return "RIButton [" + getWidth() + "x" + getHeight() + ", "
-            + getLabel() + ", " + "spacing: " + spacing
-            + ", " + "corner: " + corner + ", " + "shapeOffset: " + labelZOffset + " ]";
-    }
-}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RoundButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RoundButton.java
new file mode 100644
index 0000000..c455ea3
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/RoundButton.java
@@ -0,0 +1,135 @@
+/**
+ * Copyright 2010 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.junit.graph.demos.ui;
+
+import javax.media.opengl.GL2ES2;
+
+import jogamp.graph.geom.plane.AffineTransform;
+
+import com.jogamp.graph.curve.OutlineShape;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.geom.Vertex;
+import com.jogamp.graph.geom.Vertex.Factory;
+
+public abstract class RoundButton extends UIShape {
+
+    /** {@value} */
+    public static final float DEFAULT_CORNER = 1f;
+    protected float width;
+    protected float height;
+    protected float corner = DEFAULT_CORNER;
+    protected final AffineTransform tempT1 = new AffineTransform();
+    protected final AffineTransform tempT2 = new AffineTransform();
+
+    protected RoundButton(final Factory<? extends Vertex> factory, final int renderModes, final float width, final float height) {
+        super(factory, renderModes);
+        this.width = width;
+        this.height = height;
+    }
+
+    @Override
+    protected void clearImpl(final GL2ES2 gl, final RegionRenderer renderer) {
+    }
+
+    @Override
+    protected void destroyImpl(final GL2ES2 gl, final RegionRenderer renderer) {
+    }
+
+    public final float getWidth() { return width; }
+
+    public final float getHeight() { return height; }
+
+    public final float getCorner() { return corner; }
+
+    public void setDimension(final float width, final float height) {
+        this.width = width;
+        this.height = height;
+        markShapeDirty();
+    }
+
+    protected void createSharpOutline(final OutlineShape shape, final float zOffset) {
+        final float tw = getWidth();
+        final float th = getHeight();
+
+        final float minX = 0;
+        final float minY = 0;
+        final float minZ = zOffset;
+
+        shape.addVertex(minX, minY, minZ,  true);
+        shape.addVertex(minX+tw, minY,  minZ, true);
+        shape.addVertex(minX+tw, minY + th, minZ,  true);
+        shape.addVertex(minX, minY + th, minZ,  true);
+        shape.closeLastOutline(true);
+    }
+
+    protected void createCurvedOutline(final OutlineShape shape, final float zOffset) {
+        final float tw = getWidth();
+        final float th = getHeight();
+        final float dC = 0.5f*corner*Math.min(tw, th);
+
+        final float minX = 0;
+        final float minY = 0;
+        final float minZ = zOffset;
+
+        shape.addVertex(minX, minY + dC, minZ, true);
+        shape.addVertex(minX, minY,  minZ, false);
+
+        shape.addVertex(minX + dC, minY, minZ,  true);
+
+        shape.addVertex(minX + tw - dC, minY,           minZ, true);
+        shape.addVertex(minX + tw,      minY,           minZ, false);
+        shape.addVertex(minX + tw,      minY + dC,      minZ, true);
+        shape.addVertex(minX + tw,      minY + th- dC,  minZ, true);
+        shape.addVertex(minX + tw,      minY + th,      minZ, false);
+        shape.addVertex(minX + tw - dC, minY + th,      minZ, true);
+        shape.addVertex(minX + dC,      minY + th,      minZ, true);
+        shape.addVertex(minX,           minY + th,      minZ, false);
+        shape.addVertex(minX,           minY + th - dC, minZ, true);
+
+        shape.closeLastOutline(true);
+    }
+
+    /** Set corner size, default is {@link #DEFAULT_CORNER} */
+    public void setCorner(final float corner) {
+        if(corner > 1.0f){
+            this.corner = 1.0f;
+        }
+        else if(corner < 0.01f){
+            this.corner = 0.0f;
+        }
+        else{
+            this.corner = corner;
+        }
+        markShapeDirty();
+    }
+
+    @Override
+    public String getSubString() {
+        return super.getSubString()+", dim "+getWidth() + "x" + getHeight() + ", corner " + corner;
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java
index 616dd9b..3d4865b 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/SceneUIController.java
@@ -1,262 +1,518 @@
 package com.jogamp.opengl.test.junit.graph.demos.ui;
 
-import java.nio.ByteBuffer;
-import java.nio.ByteOrder;
-import java.nio.IntBuffer;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLRunnable;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
-import com.jogamp.common.nio.Buffers;
 import com.jogamp.graph.curve.opengl.RegionRenderer;
-import com.jogamp.graph.curve.opengl.RenderState;
+import com.jogamp.newt.event.GestureHandler;
+import com.jogamp.newt.event.InputEvent;
 import com.jogamp.newt.event.MouseEvent;
 import com.jogamp.newt.event.MouseListener;
+import com.jogamp.newt.event.PinchToZoomGesture;
+import com.jogamp.newt.event.GestureHandler.GestureEvent;
 import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.math.Quaternion;
+import com.jogamp.opengl.math.Ray;
+import com.jogamp.opengl.math.VectorUtil;
+import com.jogamp.opengl.math.geom.AABBox;
+import com.jogamp.opengl.util.PMVMatrix;
 
 public class SceneUIController implements GLEventListener{
-    private ArrayList<UIShape> shapes = new ArrayList<UIShape>();
-
-    private int count = 0;
-    private int renderModes; 
-    private int[] texSize; 
-    private RegionRenderer renderer = null;
-    private RenderState rs = null;
-
-    private float[] translate = new float[3];
-    private float[] scale = new float[3];
-    private float[] rotation = new float[3];
-
-    private float[] sceneClearColor = new float[]{0,0,0,1};
-    
-    private int activeId = -1;
-    
+    private final ArrayList<UIShape> shapes = new ArrayList<UIShape>();
+
+    private final float sceneDist, zNear, zFar;
+
+    private RegionRenderer renderer;
+
+    private final int[] sampleCount = new int[1];
+
+    /** Describing the bounding box in model-coordinates of the near-plane parallel at distance one. */
+    private final AABBox nearPlane1Box = new AABBox();
+    private final int[] viewport = new int[] { 0, 0, 0, 0 };
+    private final float[] sceneScale = new float[3];
+    private final float[] scenePlaneOrigin = new float[3];
+
+
+    private volatile UIShape activeShape = null;
+
     private SBCMouseListener sbcMouseListener = null;
-    
+    private SBCGestureListener sbcGestureListener = null;
+    private PinchToZoomGesture pinchToZoomGesture = null;
+
     private GLAutoDrawable cDrawable = null;
 
-    public SceneUIController() {
+    public SceneUIController(final float sceneDist, final float zNear, final float zFar) {
+        this(null, sceneDist, zNear, zFar);
     }
-    
-    public void setRenderer(RegionRenderer renderer, RenderState rs, int renderModes, int[] texSize) {
+
+    public SceneUIController(final RegionRenderer renderer, final float sceneDist, final float zNear, final float zFar) {
         this.renderer = renderer;
-        this.rs = rs;
-        this.renderModes = renderModes;
-        this.texSize = texSize;
+        this.sceneDist = sceneDist;
+        this.zFar = zFar;
+        this.zNear = zNear;
+        this.sampleCount[0] = 4;
     }
-    
-    public SceneUIController(RegionRenderer renderer, RenderState rs, int renderModes, int[] texSize) {
+
+    public void setRenderer(final RegionRenderer renderer) {
         this.renderer = renderer;
-        this.rs = rs;
-        this.renderModes = renderModes;
-        this.texSize = texSize;
     }
-    
-    public void attachInputListenerTo(GLWindow window) {
+
+    public void attachInputListenerTo(final GLWindow window) {
         if(null == sbcMouseListener) {
             sbcMouseListener = new SBCMouseListener();
             window.addMouseListener(sbcMouseListener);
+            sbcGestureListener = new SBCGestureListener();
+            window.addGestureListener(sbcGestureListener);
+            pinchToZoomGesture = new PinchToZoomGesture(window.getNativeSurface(), false);
+            window.addGestureHandler(pinchToZoomGesture);
         }
     }
 
-    public void detachInputListenerFrom(GLWindow window) {
+    public void detachInputListenerFrom(final GLWindow window) {
         if(null != sbcMouseListener) {
             window.removeMouseListener(sbcMouseListener);
+            sbcMouseListener = null;
+            window.removeGestureListener(sbcGestureListener);
+            sbcGestureListener = null;
+            window.removeGestureHandler(pinchToZoomGesture);
+            pinchToZoomGesture = null;
         }
     }
-    
+
     public ArrayList<UIShape> getShapes() {
         return shapes;
     }
-    public void addShape(UIShape b) {
+    public void addShape(final UIShape b) {
         shapes.add(b);
-        count++;
+    }
+    public void removeShape(final UIShape b) {
+        shapes.remove(b);
     }
 
-    public void removeShape(UIShape b) {
-        boolean found = shapes.remove(b);
-        if(found) {
-            count--;
+    public int getSampleCount() { return sampleCount[0]; }
+    public int setSampleCount(final int v) {
+        sampleCount[0] = Math.min(8, Math.max(v, 1)); // clip
+        markAllShapesDirty();
+        return sampleCount[0];
+    }
+
+    public void setAllShapesQuality(final int q) {
+        for(int i=0; i<shapes.size(); i++) {
+            shapes.get(i).setQuality(q);
+        }
+    }
+    public void setAllShapesSharpness(final float sharpness) {
+        for(int i=0; i<shapes.size(); i++) {
+            shapes.get(i).setSharpness(sharpness);
+        }
+    }
+    public void markAllShapesDirty() {
+        for(int i=0; i<shapes.size(); i++) {
+            shapes.get(i).markShapeDirty();
         }
     }
-    
-    public void init(GLAutoDrawable drawable) {
+
+    public final float[] getSceneScale() { return sceneScale; }
+    public final float[] getScenePlaneOrigin() { return scenePlaneOrigin; }
+
+    @Override
+    public void init(final GLAutoDrawable drawable) {
         System.err.println("SceneUIController: init");
         cDrawable = drawable;
     }
-    public void display(GLAutoDrawable drawable) {
-        // System.err.println("SceneUIController: display");
-        final int width = drawable.getWidth();
-        final int height = drawable.getHeight();
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
 
-        render(gl, width, height, renderModes, texSize, false);
+    private void transformShape(final PMVMatrix pmv, final UIShape uiShape) {
+        final float[] uiTranslate = uiShape.getTranslate();
+        pmv.glTranslatef(uiTranslate[0], uiTranslate[1], uiTranslate[2]);
+        // final float dz = 100f;
+
+        final Quaternion quat = uiShape.getRotation();
+        final boolean rotate = !quat.isIdentity();
+        final float[] uiScale = uiShape.getScale();
+        final boolean scale = !VectorUtil.isVec3Equal(uiScale, 0, VectorUtil.VEC3_ONE, 0, FloatUtil.EPSILON);
+        if( rotate || scale ) {
+            final float[] rotOrigin = uiShape.getRotationOrigin();
+            final boolean pivot = !VectorUtil.isVec3Zero(rotOrigin, 0, FloatUtil.EPSILON);
+            // pmv.glTranslatef(0f, 0f, dz);
+            if( pivot ) {
+                pmv.glTranslatef(rotOrigin[0], rotOrigin[1], rotOrigin[2]);
+            }
+            if( scale ) {
+                pmv.glScalef(uiScale[0], uiScale[1], uiScale[2]);
+            }
+            if( rotate ) {
+                pmv.glRotate(quat);
+            }
+            if( pivot ) {
+                pmv.glTranslatef(-rotOrigin[0], -rotOrigin[1], -rotOrigin[2]);
+            }
+            // pmv.glTranslatef(0f, 0f, -dz);
+        }
     }
-   
-    public void dispose(GLAutoDrawable drawable) {
-        System.err.println("SceneUIController: dispose");
-        cDrawable = null;
-        drawable.removeGLEventListener(this);
+
+    private static Comparator<UIShape> shapeZAscComparator = new Comparator<UIShape>() {
+        @Override
+        public int compare(final UIShape s1, final UIShape s2) {
+            final float s1Z = s1.getBounds().getMinZ()+s1.getTranslate()[2];
+            final float s2Z = s2.getBounds().getMinZ()+s2.getTranslate()[2];
+            if( FloatUtil.isEqual(s1Z, s2Z, FloatUtil.EPSILON) ) {
+                return 0;
+            } else if( s1Z < s2Z ){
+                return -1;
+            } else {
+                return 1;
+            }
+        } };
+
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    @Override
+    public void display(final GLAutoDrawable drawable) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+        gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+        gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+
+        final PMVMatrix pmv = renderer.getMatrix();
+        pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+
+        final Object[] shapesS = shapes.toArray();
+        Arrays.sort(shapesS, (Comparator)shapeZAscComparator);
+
+        renderer.enable(gl, true);
+
+        //final int shapeCount = shapes.size();
+        final int shapeCount = shapesS.length;
+        for(int i=0; i<shapeCount; i++) {
+            // final UIShape uiShape = shapes.get(i);
+            final UIShape uiShape = (UIShape)shapesS[i];
+            // System.err.println("Id "+i+": "+uiShape);
+            if( uiShape.isEnabled() ) {
+                uiShape.validate(gl, renderer);
+                pmv.glPushMatrix();
+                transformShape(pmv, uiShape);
+                uiShape.drawShape(gl, renderer, sampleCount);
+                pmv.glPopMatrix();
+            }
+        }
+
+        renderer.enable(gl, false);
     }
 
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width,
-            int height) {
-        System.err.println("SceneUIController: reshape");
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        renderer.reshapePerspective(gl, 45.0f, width, height, 5f, 70.0f);        
+    public void pickShape(final int glWinX, final int glWinY, final float[] objPos, final UIShape[] shape, final Runnable runnable) {
+        if( null == cDrawable ) {
+            return;
+        }
+        cDrawable.invoke(false, new GLRunnable() {
+            @Override
+            public boolean run(final GLAutoDrawable drawable) {
+                shape[0] = pickShapeImpl(glWinX, glWinY, objPos);
+                if( null != shape[0] ) {
+                    runnable.run();
+                }
+                return true;
+            } } );
     }
+    @SuppressWarnings({ "unchecked", "rawtypes" })
+    private UIShape pickShapeImpl(final int glWinX, final int glWinY, final float[] objPos) {
+        final float winZ0 = 0f;
+        final float winZ1 = 0.3f;
+        /**
+            final FloatBuffer winZRB = Buffers.newDirectFloatBuffer(1);
+            gl.glReadPixels( x, y, 1, 1, GL2ES2.GL_DEPTH_COMPONENT, GL.GL_FLOAT, winZRB);
+            winZ1 = winZRB.get(0); // dir
+        */
+        final PMVMatrix pmv = renderer.getMatrix();
+        pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
 
-    public UIShape getShape(GLAutoDrawable drawable,int x, int y) {
-        final int width = drawable.getWidth();
-        final int height = drawable.getHeight();
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+        final Ray ray = new Ray();
 
-        int index = checkSelection(gl, x, y, width, height);
-        if(index == -1)
-            return null;
-        return shapes.get(index);
+        final Object[] shapesS = shapes.toArray();
+        Arrays.sort(shapesS, (Comparator)shapeZAscComparator);
+
+        for(int i=shapesS.length-1; i>=0; i--) {
+            final UIShape uiShape = (UIShape)shapesS[i];
+
+            if( uiShape.isEnabled() ) {
+                pmv.glPushMatrix();
+                transformShape(pmv, uiShape);
+                final boolean ok = pmv.gluUnProjectRay(glWinX, glWinY, winZ0, winZ1, viewport, 0, ray);
+                pmv.glPopMatrix();
+                if( ok ) {
+                    final AABBox sbox = uiShape.getBounds();
+                    if( sbox.intersectsRay(ray) ) {
+                        // System.err.printf("Pick.0: shape %d, [%d, %d, %f/%f] -> %s%n", i, glWinX, glWinY, winZ0, winZ1, ray);
+                        if( null == sbox.getRayIntersection(objPos, ray, FloatUtil.EPSILON, true, dpyTmp1V3, dpyTmp2V3, dpyTmp3V3) ) {
+                            throw new InternalError("Ray "+ray+", box "+sbox);
+                        }
+                        // System.err.printf("Pick.1: shape %d @ [%f, %f, %f], within %s%n", i, objPos[0], objPos[1], objPos[2], uiShape.getBounds());
+                        return uiShape;
+                    }
+                }
+            }
+        }
+        return null;
     }
-    
-    public UIShape getActiveUI() {
-        if(activeId == -1)
-            return null;
-        return shapes.get(activeId);
+    private final float[] dpyTmp1V3 = new float[3];
+    private final float[] dpyTmp2V3 = new float[3];
+    private final float[] dpyTmp3V3 = new float[3];
+
+    public void windowToShapeCoords(final UIShape activeShape, final int glWinX, final int glWinY, final float[] objPos, final Runnable runnable) {
+        if( null == cDrawable || null == activeShape ) {
+            return;
+        }
+        cDrawable.invoke(false, new GLRunnable() {
+            @Override
+            public boolean run(final GLAutoDrawable drawable) {
+                if( windowToShapeCoordsImpl(activeShape, glWinX, glWinY, objPos) ) {
+                    runnable.run();
+                }
+                return true;
+            } } );
     }
-    
-    public void release() {
-        activeId = -1;
+    private boolean windowToShapeCoordsImpl(final UIShape activeShape, final int glWinX, final int glWinY, final float[] objPos) {
+        final PMVMatrix pmv = renderer.getMatrix();
+        pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+
+        pmv.glPushMatrix();
+        transformShape(pmv, activeShape);
+        boolean res = false;
+        final float[] ctr = activeShape.getBounds().getCenter();
+        if( pmv.gluProject(ctr[0], ctr[1], ctr[2], viewport, 0, dpyTmp1V3, 0) ) {
+            // System.err.printf("winToShapeCoords.0: shape %d: obj [%f, %f, %f] -> win [%f, %f, %f]%n", shapeId, ctr[0], ctr[1], ctr[2], dpyTmp1V3[0], dpyTmp1V3[1], dpyTmp1V3[2]);
+            if( pmv.gluUnProject(glWinX, glWinY, dpyTmp1V3[2], viewport, 0, objPos, 0) ) {
+                // System.err.printf("winToShapeCoords.1: shape %d: win [%d, %d, %f] -> obj [%f, %f, %f]%n", shapeId, glWinX, glWinY, dpyTmp1V3[2], objPos[0], objPos[1], objPos[2]);
+                res = true;
+            }
+        }
+        pmv.glPopMatrix();
+        return res;
     }
 
-    private int checkSelection(GL2ES2 gl,int x, int y, int width, int height) {
-        gl.glPixelStorei(GL2ES2.GL_PACK_ALIGNMENT, 4);
-        gl.glPixelStorei(GL2ES2.GL_UNPACK_ALIGNMENT, 4);
-        gl.glClearColor(sceneClearColor[0], sceneClearColor[1], sceneClearColor[2], sceneClearColor[3]);
-        gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+    @Override
+    public void dispose(final GLAutoDrawable drawable) {
+        System.err.println("SceneUIController: dispose");
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+        for(int i=0; i<shapes.size(); i++) {
+            shapes.get(i).destroy(gl, renderer);
+        }
+        shapes.clear();
+        cDrawable = null;
+    }
 
-        render(gl, width, height, 0, null, true);
-        ByteBuffer pixel = Buffers.newDirectByteBuffer(4);
-        pixel.order(ByteOrder.nativeOrder());
-        IntBuffer viewport = IntBuffer.allocate(4);
-        gl.glGetIntegerv(GL2ES2.GL_VIEWPORT, viewport);
-        gl.glReadPixels(x, viewport.get(3) - y, 1, 1, GL2ES2.GL_RGBA,
-                GL2ES2.GL_UNSIGNED_BYTE, pixel);
-
-        int qp = pixel.get(0) & 0xFF;
-        int index = Math.round(((qp/255.0f)*(count+2))-1);
-        if(index < 0 || index >= count)
-            return -1;
-        return index;
+    public static void mapWin2ObjectCoords(final PMVMatrix pmv, final int[] view,
+                                           final float zNear, final float zFar,
+                                           final float orthoX, final float orthoY, final float orthoDist,
+                                           final float[] winZ, final float[] objPos) {
+        winZ[0] = FloatUtil.getOrthoWinZ(orthoDist, zNear, zFar);
+        pmv.gluUnProject(orthoX, orthoY, winZ[0], view, 0, objPos, 0);
     }
 
-    private void render(GL2ES2 gl, int width, int height, int renderModes, int[/*1*/] texSize, boolean select) {
-        renderer.reshapePerspective(null, 45.0f, width, height, 0.1f, 7000.0f);
-        
-        for(int index=0; index < count;index++){
-            if(select) {
-                float color= index+1;
-                renderer.setColorStatic(gl, color/(count+2), color/(count+2), color/(count+2));
-            }
-            float[] s = shapes.get(index).getScale();
-            float[] p = shapes.get(index).getPosition();
-            renderer.resetModelview(null);
-            renderer.translate(null, translate[0]+p[0], translate[1]+p[1], translate[2]+p[2]);
-            renderer.scale(gl, s[0], s[1], s[2]);
-            renderer.rotate(gl, rotation[0], 1, 0, 0);
-            renderer.rotate(gl, rotation[1], 0, 1, 0);
-            renderer.rotate(gl, rotation[2], 0, 0, 1);
-            
-            shapes.get(index).render(gl, rs, renderer, renderModes, texSize, select);
-            renderer.rotate(gl, -rotation[0], 1, 0, 0);
-            renderer.rotate(gl, -rotation[1], 0, 1, 0);
-            renderer.rotate(gl, -rotation[2], 0, 0, 1);
+   @Override
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+        viewport[0] = x;
+        viewport[1] = y;
+        viewport[2] = width;
+        viewport[3] = height;
+
+        final PMVMatrix pmv = renderer.getMatrix();
+        renderer.reshapePerspective(45.0f, width, height, zNear, zFar);
+        pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+        pmv.glLoadIdentity();
+
+        System.err.printf("Reshape: zNear %f,  zFar %f%n", zNear, zFar);
+        System.err.printf("Reshape: Frustum: %s%n", pmv.glGetFrustum());
+        {
+            final float orthoDist = 1f;
+            final float[] obj00Coord = new float[3];
+            final float[] obj11Coord = new float[3];
+            final float[] winZ = new float[1];
+
+            mapWin2ObjectCoords(pmv, viewport, zNear, zFar, 0f, 0f, orthoDist, winZ, obj00Coord);
+            System.err.printf("Reshape: mapped.00: [%f, %f, %f], winZ %f -> [%f, %f, %f]%n", 0f, 0f, orthoDist, winZ[0], obj00Coord[0], obj00Coord[1], obj00Coord[2]);
+
+            mapWin2ObjectCoords(pmv, viewport, zNear, zFar, width, height, orthoDist, winZ, obj11Coord);
+            System.err.printf("Reshape: mapped.11: [%f, %f, %f], winZ %f -> [%f, %f, %f]%n", (float)width, (float)height, orthoDist, winZ[0], obj11Coord[0], obj11Coord[1], obj11Coord[2]);
+
+            nearPlane1Box.setSize( obj00Coord[0],  // lx
+                                   obj00Coord[1],  // ly
+                                   obj00Coord[2],  // lz
+                                   obj11Coord[0],  // hx
+                                   obj11Coord[1],  // hy
+                                   obj11Coord[2] );// hz
+            System.err.printf("Reshape: dist1Box: %s%n", nearPlane1Box);
         }
-    }
+        scenePlaneOrigin[0] = nearPlane1Box.getMinX() * sceneDist;
+        scenePlaneOrigin[1] = nearPlane1Box.getMinY() * sceneDist;
+        scenePlaneOrigin[2] = nearPlane1Box.getMinZ() * sceneDist;
+        sceneScale[0] = ( nearPlane1Box.getWidth() * sceneDist ) / width;
+        sceneScale[1] = ( nearPlane1Box.getHeight() * sceneDist  ) / height;
+        sceneScale[2] = 1f;
+        System.err.printf("Scene Origin [%f, %f, %f]%n", scenePlaneOrigin[0], scenePlaneOrigin[1], scenePlaneOrigin[2]);
+        System.err.printf("Scene Scale  %f * [%f x %f] / [%d x %d] = [%f, %f, %f]%n",
+                sceneDist, nearPlane1Box.getWidth(), nearPlane1Box.getHeight(),
+                width, height,
+                sceneScale[0], sceneScale[1], sceneScale[2]);
 
-    public void setTranslate(float x, float y, float z) {
-        this.translate[0] = x;
-        this.translate[1] = y;
-        this.translate[2] = z;
+        pmv.glTranslatef(scenePlaneOrigin[0], scenePlaneOrigin[1], scenePlaneOrigin[2]);
+        pmv.glScalef(sceneScale[0], sceneScale[1], sceneScale[2]);
     }
 
-    public void setScale(float x, float y, float z) {
-        this.scale[0] = x;
-        this.scale[1] = y;
-        this.scale[2] = z;
+    public final UIShape getShape(final int id) {
+        if( 0 > id ) {
+            return null;
+        }
+        return shapes.get(id);
+    }
+    public final UIShape getActiveShape() {
+        return activeShape;
     }
 
-    public void setRotation(float x, float y, float z) {
-        this.rotation[0] = x;
-        this.rotation[1] = y;
-        this.rotation[2] = z;
+    public void release() {
+        setActiveShape(null);
     }
-    public float[] getSceneClearColor() {
-        return sceneClearColor;
+    private void setActiveShape(final UIShape shape) {
+        activeShape = shape;
     }
 
-    public void setSceneClearColor(float r, float g, float b, float a) {
-        this.sceneClearColor[0] = r;
-        this.sceneClearColor[1] = g;
-        this.sceneClearColor[2] = b;
-        this.sceneClearColor[3] = a;
+    private final class SBCGestureListener implements GestureHandler.GestureListener {
+        @Override
+        public void gestureDetected(final GestureEvent gh) {
+            if( null != activeShape ) {
+                // gesture .. delegate to active shape!
+                final InputEvent orig = gh.getTrigger();
+                if( orig instanceof MouseEvent ) {
+                    final MouseEvent e = (MouseEvent) orig;
+                    // flip to GL window coordinates
+                    final int glWinX = e.getX();
+                    final int glWinY = viewport[3] - e.getY() - 1;
+                    final float[] objPos = new float[3];
+                    final UIShape shape = activeShape;
+                    windowToShapeCoords(shape, glWinX, glWinY, objPos, new Runnable() {
+                        public void run() {
+                            shape.dispatchGestureEvent(gh, glWinX, glWinY, objPos);
+                        } } );
+                }
+            }
+        }
+    }
+
+    final void dispatchMouseEvent(final MouseEvent e, final int glWinX, final int glWinY) {
+        if( null == activeShape ) {
+            dispatchMouseEventPickShape(e, glWinX, glWinY, true);
+        } else {
+            dispatchMouseEventForShape(activeShape, e, glWinX, glWinY);
+        }
     }
-    
+    final void dispatchMouseEventPickShape(final MouseEvent e, final int glWinX, final int glWinY, final boolean setActive) {
+        final float[] objPos = new float[3];
+        final UIShape[] shape = { null };
+        pickShape(glWinX, glWinY, objPos, shape, new Runnable() {
+           public void run() {
+               if( setActive ) {
+                   setActiveShape(shape[0]);
+               }
+               shape[0].dispatchMouseEvent(e, glWinX, glWinY, objPos);
+           } } );
+    }
+    final void dispatchMouseEventForShape(final UIShape shape, final MouseEvent e, final int glWinX, final int glWinY) {
+        final float[] objPos = new float[3];
+        windowToShapeCoords(shape, glWinX, glWinY, objPos, new Runnable() {
+            public void run() {
+                shape.dispatchMouseEvent(e, glWinX, glWinY, objPos);
+            } } );
+    }
+
     private class SBCMouseListener implements MouseListener {
-        int mouseX = -1;
-        int mouseY = -1;
-        
-        public void mouseClicked(MouseEvent e) {
-            UIShape uiShape = getActiveUI();
-            if(uiShape != null){
-                uiShape.onClick();
-            }
+        int lx=-1, ly=-1, lId=-1;
+
+        void clear() {
+            lx = -1; ly = -1; lId = -1;
         }
 
-        public void mousePressed(MouseEvent e) {
-            if(null==cDrawable) {
-                return;
+        @Override
+        public void mousePressed(final MouseEvent e) {
+            if( -1 == lId || e.getPointerId(0) == lId ) {
+                lx = e.getX();
+                ly = e.getY();
+                lId = e.getPointerId(0);
             }
-            mouseX = e.getX();
-            mouseY = e.getY();
-            
-            GLRunnable runnable = new GLRunnable() {
-                public boolean run(GLAutoDrawable drawable) {
-                    UIShape s = getShape(drawable, mouseX, mouseY);
-                    if(null != s) {
-                        activeId = getShapes().indexOf(s);
-                    }
-                    else {
-                        activeId = -1;
-                    }
-                    return false;
-                }
-            };
-            cDrawable.invoke(true, runnable);
-            
-            UIShape uiShape = getActiveUI();
-            
-            if(uiShape != null) {
-                uiShape.setPressed(true);
-                uiShape.onPressed();
+            // flip to GL window coordinates
+            final int glWinX = e.getX();
+            final int glWinY = viewport[3] - e.getY() - 1;
+            dispatchMouseEvent(e, glWinX, glWinY);
+        }
+
+        @Override
+        public void mouseReleased(final MouseEvent e) {
+            // flip to GL window coordinates
+            final int glWinX = e.getX();
+            final int glWinY = viewport[3] - e.getY() - 1;
+            dispatchMouseEvent(e, glWinX, glWinY);
+            if( 1 == e.getPointerCount() ) {
+                // Release active shape: last pointer has been lifted!
+                release();
+                clear();
             }
         }
 
-        public void mouseReleased(MouseEvent e) { 
-            UIShape uiShape = getActiveUI();
-            if(uiShape != null){
-                uiShape.setPressed(false);
-                uiShape.onRelease();
+        @Override
+        public void mouseClicked(final MouseEvent e) {
+            // flip to GL window coordinates
+            final int glWinX = e.getX();
+            final int glWinY = viewport[3] - e.getY() - 1;
+            // activeId should have been released by mouseRelease() already!
+            dispatchMouseEventPickShape(e, glWinX, glWinY, false);
+            // Release active shape: last pointer has been lifted!
+            release();
+            clear();
+        }
+
+        @Override
+        public void mouseDragged(final MouseEvent e) {
+            // drag activeShape, if no gesture-activity, only on 1st pointer
+            if( null != activeShape && !pinchToZoomGesture.isWithinGesture() && e.getPointerId(0) == lId ) {
+                lx = e.getX();
+                ly = e.getY();
+
+                // dragged .. delegate to active shape!
+                // flip to GL window coordinates
+                final int glWinX = lx;
+                final int glWinY = viewport[3] - ly - 1;
+                dispatchMouseEventForShape(activeShape, e, glWinX, glWinY);
             }
         }
 
-        public void mouseMoved(MouseEvent e) { }
-        public void mouseEntered(MouseEvent e) { }
-        public void mouseExited(MouseEvent e) { }
-        public void mouseDragged(MouseEvent e) { }
-        public void mouseWheelMoved(MouseEvent e) { }
-        
+        @Override
+        public void mouseWheelMoved(final MouseEvent e) {
+            // flip to GL window coordinates
+            final int glWinX = lx;
+            final int glWinY = viewport[3] - ly - 1;
+            dispatchMouseEventPickShape(e, glWinX, glWinY, true);
+        }
+
+        @Override
+        public void mouseMoved(final MouseEvent e) {
+            if( -1 == lId || e.getPointerId(0) == lId ) {
+                lx = e.getX();
+                ly = e.getY();
+                lId = e.getPointerId(0);
+            }
+        }
+        @Override
+        public void mouseEntered(final MouseEvent e) { }
+        @Override
+        public void mouseExited(final MouseEvent e) {
+            release();
+            clear();
+        }
     }
 }
\ No newline at end of file
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/TextureSeqButton.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/TextureSeqButton.java
new file mode 100644
index 0000000..25134ed
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/TextureSeqButton.java
@@ -0,0 +1,79 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.junit.graph.demos.ui;
+
+import javax.media.opengl.GL2ES2;
+
+import com.jogamp.graph.curve.OutlineShape;
+import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.geom.Vertex;
+import com.jogamp.graph.geom.Vertex.Factory;
+import com.jogamp.opengl.util.texture.TextureSequence;
+
+/**
+ * GPU based resolution independent {@link TextureSequence} Button impl
+ */
+public class TextureSeqButton extends RoundButton {
+    protected final TextureSequence texSeq;
+
+    public TextureSeqButton(final Factory<? extends Vertex> factory, final int renderModes,
+                         final float width, final float height, final TextureSequence texSeq) {
+        super(factory, renderModes | Region.COLORTEXTURE_RENDERING_BIT, width, height);
+        this.texSeq = texSeq;
+    }
+
+    @Override
+    protected GLRegion createGLRegion() {
+        return GLRegion.create(getRenderModes(), texSeq);
+    }
+
+    public final TextureSequence getTextureSequence() { return this.texSeq; }
+
+    @Override
+    protected void addShapeToRegion(final GL2ES2 gl, final RegionRenderer renderer) {
+        final OutlineShape shape = new OutlineShape(renderer.getRenderState().getVertexFactory());
+        if(corner == 0.0f) {
+            createSharpOutline(shape, 0f);
+        } else {
+            createCurvedOutline(shape, 0f);
+        }
+        shape.setIsQuadraticNurbs();
+        shape.setSharpness(shapesSharpness);
+        region.addOutlineShape(shape, null, rgbaColor);
+        box.resize(shape.getBounds());
+
+        final float[] ctr = box.getCenter();
+        setRotationOrigin( ctr[0], ctr[1], ctr[2]);
+
+        if( DRAW_DEBUG_BOX ) {
+            System.err.println("XXX.UIShape.TextureSeqButton: Added Shape: "+shape+", "+box);
+        }
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java
index da94f6a..65031d7 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIGLListener01.java
@@ -33,32 +33,25 @@ import java.io.IOException;
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import com.jogamp.graph.curve.opengl.RegionRenderer;
 import com.jogamp.graph.curve.opengl.RenderState;
 import com.jogamp.graph.font.Font;
 import com.jogamp.graph.font.FontFactory;
-import com.jogamp.graph.geom.opengl.SVertex;
+import com.jogamp.graph.geom.SVertex;
 import com.jogamp.opengl.test.junit.graph.demos.MSAATool;
-import com.jogamp.opengl.test.junit.graph.demos.ui.opengl.UIRegion;
+import com.jogamp.opengl.util.PMVMatrix;
 
 public class UIGLListener01 extends UIListenerBase01 {
-    
-    public UIGLListener01 (RenderState rs, boolean debug, boolean trace) {
-        super(RegionRenderer.create(rs, 0), debug, trace);
+
+    public UIGLListener01 (final int renderModes, final RenderState rs, final boolean debug, final boolean trace) {
+        super(renderModes, RegionRenderer.create(rs, RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable), debug, trace);
         setMatrix(-20, 00, 0f, -50);
         try {
             final Font font = FontFactory.get(FontFactory.UBUNTU).getDefault();
-            button = new RIButton(SVertex.factory(), font, "Click me!", 4f, 3f){
-                public void onClick() {
-                }
-                public void onPressed() {
-                }
-                public void onRelease() {
-                }
-                
-            };
-            button.setPosition(2,1,0);
+            button = new LabelButton(SVertex.factory(), 0, font, "Click me!", 4f, 3f);
+            button.translate(2,1,0);
             /** Button defaults !
                 button.setLabelColor(1.0f,1.0f,1.0f);
                 button.setButtonColor(0.6f,0.6f,0.6f);
@@ -66,65 +59,49 @@ public class UIGLListener01 extends UIListenerBase01 {
                 button.setSpacing(2.0f);
              */
             System.err.println(button);
-        } catch (IOException ex) {
-            System.err.println("Catched: "+ex.getMessage());
+        } catch (final IOException ex) {
+            System.err.println("Caught: "+ex.getMessage());
             ex.printStackTrace();
-        }            
+        }
     }
-    
-    public void init(GLAutoDrawable drawable) {
+
+    @Override
+    public void init(final GLAutoDrawable drawable) {
         super.init(drawable);
-        
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
 
         gl.setSwapInterval(1);
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
-        gl.glEnable(GL2ES2.GL_POLYGON_OFFSET_FILL);
-        
+        gl.glEnable(GL.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_POLYGON_OFFSET_FILL);
+
         MSAATool.dump(drawable);
     }
 
-    UIRegion regionButton;
-    UIRegion regionLabel;
-    
-    public void display(GLAutoDrawable drawable) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+    @Override
+    public void display(final GLAutoDrawable drawable) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
 
         gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
 
+        final int[] sampleCount = { 4 };
+        final float[] translate = button.getTranslate();
+
         final RegionRenderer regionRenderer = getRegionRenderer();
-        final RenderState rs = regionRenderer.getRenderState();
-        
-        regionRenderer.resetModelview(null);
-        
-        regionRenderer.translate(null, getXTran(), getYTran(), getZoom());
-        regionRenderer.rotate(gl, getAngle(), 0, 1, 0);
-        
-        final float[] bColor = button.getButtonColor();
-        final float[] lColor = button.getLabelColor();        
-        if(null == regionButton) {
-            regionButton = new UIRegion(button);
-            regionLabel = new UIRegion(button.getLabel());
-        }        
-        
-        regionRenderer.setColorStatic(gl, bColor[0], bColor[1], bColor[2]);
-        regionRenderer.draw(gl, regionButton.getRegion(gl, rs, 0), getPosition(), null);
-//        regionRenderer.translate(gl, button.getPosition()[0], button.getPosition()[1], button.getPosition()[2]);
-        regionRenderer.setColorStatic(gl, lColor[0], lColor[1], lColor[2]);
-        regionRenderer.draw(gl, regionLabel.getRegion(gl, rs, 0), getPosition(), null);
-    }        
-    
-    public void dispose(GLAutoDrawable drawable) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        if(null != regionButton) {
-            regionButton.destroy(gl, getRegionRenderer().getRenderState());
-            regionButton = null;
-        }
-        if(null != regionLabel) {
-            regionLabel.destroy(gl, getRegionRenderer().getRenderState());
-            regionButton = null;
-        }
+        final PMVMatrix pmv = regionRenderer.getMatrix();
+        pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+        pmv.glLoadIdentity();
+        pmv.glTranslatef(getXTran(), getYTran(), getZoom());
+        pmv.glRotatef(getAngle(), 0, 1, 0);
+        pmv.glTranslatef(translate[0], translate[1], 0);
+        button.drawShape(gl, regionRenderer, sampleCount);
+    }
+
+    @Override
+    public void dispose(final GLAutoDrawable drawable) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+        button.destroy(gl, getRegionRenderer());
         super.dispose(drawable);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIListenerBase01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIListenerBase01.java
index c94b634..796ed25 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIListenerBase01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIListenerBase01.java
@@ -41,6 +41,7 @@ import javax.media.opengl.GLException;
 import javax.media.opengl.GLPipelineFactory;
 import javax.media.opengl.GLRunnable;
 
+import com.jogamp.graph.curve.Region;
 import com.jogamp.graph.curve.opengl.RegionRenderer;
 import com.jogamp.newt.event.KeyEvent;
 import com.jogamp.newt.event.KeyListener;
@@ -55,39 +56,41 @@ import com.jogamp.opengl.util.GLReadBufferUtil;
  * - 1/2: zoom in/out
  * - 4/5: increase/decrease shape/text spacing
  * - 6/7: increase/decrease corner size
- * - 0/9: rotate 
+ * - 0/9: rotate
  * - v: toggle v-sync
  * - s: screenshot
  */
 public abstract class UIListenerBase01 implements GLEventListener {
-    private GLReadBufferUtil screenshot;
-    private RegionRenderer rRenderer;
-    private boolean debug;
-    private boolean trace;
-    
-    protected RIButton button;
-    
+    private final GLReadBufferUtil screenshot;
+    private final int renderModes;
+    private final RegionRenderer rRenderer;
+    private final boolean debug;
+    private final boolean trace;
+
+    protected LabelButton button;
+
     private KeyAction keyAction;
     private MouseAction mouseAction;
-    
+
     private volatile GLAutoDrawable autoDrawable = null;
-    
+
     private final float[] position = new float[] {0,0,0};
-    
+
     private float xTran = -10;
-    private float yTran =  10;    
+    private float yTran =  10;
     private float ang = 0f;
     private float zoom = -70f;
 
     boolean ignoreInput = false;
 
-    public UIListenerBase01(RegionRenderer rRenderer, boolean debug, boolean trace) {
+    public UIListenerBase01(final int renderModes, final RegionRenderer rRenderer, final boolean debug, final boolean trace) {
+        this.renderModes = renderModes;
         this.rRenderer = rRenderer;
         this.debug = debug;
         this.trace = trace;
         this.screenshot = new GLReadBufferUtil(false, false);
     }
-    
+
     public final RegionRenderer getRegionRenderer() { return rRenderer; }
     public final float getZoom() { return zoom; }
     public final float getXTran() { return xTran; }
@@ -95,14 +98,14 @@ public abstract class UIListenerBase01 implements GLEventListener {
     public final float getAngle() { return ang; }
     public final float[] getPosition() { return position; }
 
-    public void setMatrix(float xtrans, float ytrans, float angle, int zoom) {
+    public void setMatrix(final float xtrans, final float ytrans, final float angle, final int zoom) {
         this.xTran = xtrans;
-        this.yTran = ytrans; 
-        this.ang = angle;  
+        this.yTran = ytrans;
+        this.ang = angle;
         this.zoom = zoom;
     }
-    
-    public void init(GLAutoDrawable drawable) {
+
+    public void init(final GLAutoDrawable drawable) {
         autoDrawable = drawable;
         GL2ES2 gl = drawable.getGL().getGL2ES2();
         if(debug) {
@@ -112,57 +115,57 @@ public abstract class UIListenerBase01 implements GLEventListener {
             gl = gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", null, gl, new Object[] { System.err } ) ).getGL2ES2();
         }
         gl.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
-        getRegionRenderer().init(gl);        
+        getRegionRenderer().init(gl, renderModes);
     }
-    
-    public void reshape(GLAutoDrawable drawable, int xstart, int ystart, int width, int height) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
-        gl.glViewport(xstart, ystart, width, height);        
-        rRenderer.reshapePerspective(gl, 45.0f, width, height, 0.1f, 7000.0f);
+
+    public void reshape(final GLAutoDrawable drawable, final int xstart, final int ystart, final int width, final int height) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+        gl.glViewport(xstart, ystart, width, height);
+        rRenderer.reshapePerspective(45.0f, width, height, 0.1f, 7000.0f);
         dumpMatrix();
     }
-    
-    public void dispose(GLAutoDrawable drawable) {
+
+    public void dispose(final GLAutoDrawable drawable) {
         autoDrawable = null;
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
         screenshot.dispose(gl);
         rRenderer.destroy(gl);
-    }    
-    
-    public void zoom(int v){
+    }
+
+    public void zoom(final int v){
         zoom += v;
         dumpMatrix();
     }
-    
-    public void move(float x, float y){
+
+    public void move(final float x, final float y){
         xTran += x;
         yTran += y;
         dumpMatrix();
     }
-    public void rotate(float delta){
+    public void rotate(final float delta){
         ang += delta;
         ang %= 360.0f;
         dumpMatrix();
     }
-    
+
     void dumpMatrix() {
         System.err.println("Matrix: " + xTran + "/" + yTran + " x"+zoom + " @"+ang);
     }
-    
-    /** Attach the input listener to the window */ 
-    public void attachInputListenerTo(GLWindow window) {
+
+    /** Attach the input listener to the window */
+    public void attachInputListenerTo(final GLWindow window) {
         if ( null == keyAction ) {
             keyAction = new KeyAction();
-            window.addKeyListener(keyAction);        
+            window.addKeyListener(keyAction);
         }
         if ( null == mouseAction ) {
             mouseAction = new MouseAction();
-            window.addMouseListener(mouseAction);        
+            window.addMouseListener(mouseAction);
         }
     }
-    
-    public void detachFrom(GLWindow window) {
+
+    public void detachFrom(final GLWindow window) {
         if ( null == keyAction ) {
             return;
         }
@@ -173,72 +176,72 @@ public abstract class UIListenerBase01 implements GLEventListener {
         window.removeKeyListener(keyAction);
         window.removeMouseListener(mouseAction);
     }
-    
-    public void printScreen(GLAutoDrawable drawable, String dir, String tech, String objName, boolean exportAlpha) throws GLException, IOException {
-        StringWriter sw = new StringWriter();
-        PrintWriter pw = new PrintWriter(sw);
-        pw.printf("-%03dx%03d-Z%04d-T%04d-%s", drawable.getWidth(), drawable.getHeight(), (int)Math.abs(zoom), 0, objName);
-        
+
+    public void printScreen(final GLAutoDrawable drawable, final String dir, final String tech, final String objName, final boolean exportAlpha) throws GLException, IOException {
+        final StringWriter sw = new StringWriter();
+        final PrintWriter pw = new PrintWriter(sw);
+        pw.printf("-%03dx%03d-Z%04d-T%04d-%s", drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), (int)Math.abs(zoom), 0, objName);
+
         final String filename = dir + tech + sw +".png";
         if(screenshot.readPixels(drawable.getGL(), false)) {
             screenshot.write(new File(filename));
         }
     }
-    
+
     int screenshot_num = 0;
 
-    public void setIgnoreInput(boolean v) {
+    public void setIgnoreInput(final boolean v) {
         ignoreInput = v;
     }
     public boolean getIgnoreInput() {
         return ignoreInput;
     }
-    
+
     public class MouseAction implements MouseListener{
 
-        public void mouseClicked(MouseEvent e) {
-            
+        public void mouseClicked(final MouseEvent e) {
+
         }
 
-        public void mouseEntered(MouseEvent e) {
+        public void mouseEntered(final MouseEvent e) {
         }
 
-        public void mouseExited(MouseEvent e) {
+        public void mouseExited(final MouseEvent e) {
         }
 
-        public void mousePressed(MouseEvent e) {
+        public void mousePressed(final MouseEvent e) {
             button.setLabelColor(0.8f,0.8f,0.8f);
-            button.setButtonColor(0.1f, 0.1f, 0.1f);
+            button.setColor(0.1f, 0.1f, 0.1f, 1.0f);
         }
 
-        public void mouseReleased(MouseEvent e) {
+        public void mouseReleased(final MouseEvent e) {
             button.setLabelColor(1.0f,1.0f,1.0f);
-            button.setButtonColor(0.6f,0.6f,0.6f);
+            button.setColor(0.6f,0.6f,0.6f, 1.0f);
         }
 
-        public void mouseMoved(MouseEvent e) {
+        public void mouseMoved(final MouseEvent e) {
             // TODO Auto-generated method stub
-            
+
         }
 
-        public void mouseDragged(MouseEvent e) {
+        public void mouseDragged(final MouseEvent e) {
             // TODO Auto-generated method stub
-            
+
         }
 
-        public void mouseWheelMoved(MouseEvent e) {
+        public void mouseWheelMoved(final MouseEvent e) {
             // TODO Auto-generated method stub
-            
+
         }
-        
+
     }
-    
+
     public class KeyAction implements KeyListener {
-        public void keyPressed(KeyEvent arg0) {
+        public void keyPressed(final KeyEvent arg0) {
             if(ignoreInput) {
                 return;
             }
-            
+
             if(arg0.getKeyCode() == KeyEvent.VK_1){
                 zoom(10);
             }
@@ -258,19 +261,19 @@ public abstract class UIListenerBase01 implements GLEventListener {
                 move(-1, 0);
             }
             else if(arg0.getKeyCode() == KeyEvent.VK_4){
-                button.setSpacing(button.getSpacing()-0.1f);
-                System.err.println("Button Spacing: " + button.getSpacing());
+                button.setSpacing(button.getSpacingX()-0.01f, button.getSpacingY()-0.005f);
+                System.err.println("Button Spacing: " + button.getSpacingX());
             }
             else if(arg0.getKeyCode() == KeyEvent.VK_5){
-                button.setSpacing(button.getSpacing()+0.1f);
-                System.err.println("Button Spacing: " + button.getSpacing());
+                button.setSpacing(button.getSpacingX()+0.01f, button.getSpacingY()+0.005f);
+                System.err.println("Button Spacing: " + button.getSpacingX());
             }
             else if(arg0.getKeyCode() == KeyEvent.VK_6){
-                button.setCorner(button.getCorner()-0.1f);
+                button.setCorner(button.getCorner()-0.01f);
                 System.err.println("Button Corner: " + button.getCorner());
             }
             else if(arg0.getKeyCode() == KeyEvent.VK_7){
-                button.setCorner(button.getCorner()+0.1f);
+                button.setCorner(button.getCorner()+0.01f);
                 System.err.println("Button Corner: " + button.getCorner());
             }
             else if(arg0.getKeyCode() == KeyEvent.VK_0){
@@ -278,13 +281,13 @@ public abstract class UIListenerBase01 implements GLEventListener {
             }
             else if(arg0.getKeyCode() == KeyEvent.VK_9){
                 rotate(-1);
-            }  
+            }
             else if(arg0.getKeyCode() == KeyEvent.VK_V) {
                 if(null != autoDrawable) {
                     autoDrawable.invoke(false, new GLRunnable() {
-                        public boolean run(GLAutoDrawable drawable) {
-                            GL gl = drawable.getGL();
-                            int i = gl.getSwapInterval();      
+                        public boolean run(final GLAutoDrawable drawable) {
+                            final GL gl = drawable.getGL();
+                            int i = gl.getSwapInterval();
                             i = i==0 ? 1 : 0;
                             gl.setSwapInterval(i);
                             final GLAnimatorControl a = drawable.getAnimator();
@@ -295,28 +298,28 @@ public abstract class UIListenerBase01 implements GLEventListener {
                             return true;
                         }
                     });
-                }                
+                }
             }
             else if(arg0.getKeyCode() == KeyEvent.VK_S){
                 rotate(-1);
                     if(null != autoDrawable) {
                         autoDrawable.invoke(false, new GLRunnable() {
-                            public boolean run(GLAutoDrawable drawable) {
+                            public boolean run(final GLAutoDrawable drawable) {
                                 try {
-                                    final String type = ( 1 == rRenderer.getRenderModes() ) ? "r2t0-msaa1" : "r2t1-msaa0" ; 
+                                    final String type = Region.getRenderModeString(renderModes);
                                     printScreen(drawable, "./", "demo-"+type, "snap"+screenshot_num, false);
                                     screenshot_num++;
-                                } catch (GLException e) {
+                                } catch (final GLException e) {
                                     e.printStackTrace();
-                                } catch (IOException e) {
+                                } catch (final IOException e) {
                                     e.printStackTrace();
                                 }
-                                return true;                                
+                                return true;
                             }
                         });
-                    }                
-            }  
+                    }
+            }
         }
-        public void keyReleased(KeyEvent arg0) {}
+        public void keyReleased(final KeyEvent arg0) {}
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UINewtDemo01.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UINewtDemo01.java
index 0577c5f..cd74f19 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UINewtDemo01.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UINewtDemo01.java
@@ -28,68 +28,64 @@
 
 package com.jogamp.opengl.test.junit.graph.demos.ui;
 
-import javax.media.opengl.FPSCounter;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLProfile;
 
 import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.graph.geom.opengl.SVertex;
+import com.jogamp.graph.geom.SVertex;
 import com.jogamp.newt.event.KeyAdapter;
 import com.jogamp.newt.event.KeyEvent;
 import com.jogamp.newt.event.WindowAdapter;
 import com.jogamp.newt.event.WindowEvent;
 import com.jogamp.newt.opengl.GLWindow;
 import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.glsl.ShaderState;
 
 /** Demonstrate the rendering of multiple outlines into one region/OutlineShape
  *  These Outlines are not necessary connected or contained.
  *  The output of this demo shows two identical shapes but the left one
- *  has some vertices with off-curve flag set to true, and the right allt he vertices 
- *  are on the curve. Demos the Res. Independent Nurbs based Curve rendering 
+ *  has some vertices with off-curve flag set to true, and the right allt he vertices
+ *  are on the curve. Demos the Res. Independent Nurbs based Curve rendering
  *
  */
 public class UINewtDemo01 {
     static final boolean DEBUG = false;
     static final boolean TRACE = false;
-    
-    public static void main(String[] args) {
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
+
+    public static void main(final String[] args) {
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setAlphaBits(4);
         caps.setSampleBuffers(true);
         caps.setNumSamples(4);
         System.out.println("Requested: " + caps);
-        
+
         final GLWindow window = GLWindow.create(caps);
         window.setPosition(10, 10);
         window.setSize(800, 400);
         window.setTitle("GPU UI Newt Demo 01");
-        RenderState rs = RenderState.createRenderState(new ShaderState(), SVertex.factory());
-        UIGLListener01 uiGLListener = new UIGLListener01 (rs, DEBUG, TRACE);
-        uiGLListener.attachInputListenerTo(window);        
+        final RenderState rs = RenderState.createRenderState(SVertex.factory());
+        final UIGLListener01 uiGLListener = new UIGLListener01 (0, rs, DEBUG, TRACE);
+        uiGLListener.attachInputListenerTo(window);
         window.addGLEventListener(uiGLListener);
-
-        window.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);        
         window.setVisible(true);
 
         final Animator animator = new Animator();
-        animator.setUpdateFPSFrames(FPSCounter.DEFAULT_FRAMES_PER_INTERVAL, System.err);
+        animator.setUpdateFPSFrames(60, System.err);
         animator.add(window);
-        
+
         window.addKeyListener(new KeyAdapter() {
-            public void keyPressed(KeyEvent arg0) {
+            public void keyPressed(final KeyEvent arg0) {
                 if(arg0.getKeyCode() == KeyEvent.VK_F4) {
                     window.destroy();
                 }
             }
         });
         window.addWindowListener(new WindowAdapter() {
-            public void windowDestroyed(WindowEvent e) {
+            public void windowDestroyed(final WindowEvent e) {
                 animator.stop();
             }
         });
-                
+
         animator.start();
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java
index c38f8f7..3b8c71e 100644
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java
+++ b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UIShape.java
@@ -27,104 +27,517 @@
  */
 package com.jogamp.opengl.test.junit.graph.demos.ui;
 
+import java.util.ArrayList;
+
+import javax.media.nativewindow.NativeWindowException;
 import javax.media.opengl.GL2ES2;
 
 import com.jogamp.graph.curve.OutlineShape;
+import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.GLRegion;
 import com.jogamp.graph.curve.opengl.RegionRenderer;
-import com.jogamp.graph.curve.opengl.RenderState;
 import com.jogamp.graph.geom.Vertex;
 import com.jogamp.graph.geom.Vertex.Factory;
+import com.jogamp.newt.event.GestureHandler.GestureEvent;
+import com.jogamp.newt.event.GestureHandler.GestureListener;
+import com.jogamp.newt.event.MouseAdapter;
+import com.jogamp.newt.event.NEWTEvent;
+import com.jogamp.newt.event.MouseEvent;
+import com.jogamp.newt.event.MouseListener;
+import com.jogamp.opengl.math.Quaternion;
 import com.jogamp.opengl.math.geom.AABBox;
 
 public abstract class UIShape {
+    public static final boolean DRAW_DEBUG_BOX = false;
+
+    protected static final int DIRTY_SHAPE    = 1 << 0 ;
+    protected static final int DIRTY_STATE    = 1 << 1 ;
+
     private final Factory<? extends Vertex> vertexFactory;
-    protected OutlineShape shape;
-    
-    protected static final int DIRTY_SHAPE  = 1 << 0 ;    
-    protected int dirty = DIRTY_SHAPE;
-    
+    private final int renderModes;
+    protected final AABBox box;
+
+    protected final float[] translate = new float[] { 0f, 0f, 0f };
+    protected final Quaternion rotation = new Quaternion();
+    protected final float[] rotOrigin = new float[] { 0f, 0f, 0f };
+    protected final float[] scale = new float[] { 1f, 1f, 1f };
+
+    protected GLRegion region = null;
+    protected int regionQuality = Region.MAX_QUALITY;
+
+    protected int dirty = DIRTY_SHAPE | DIRTY_STATE;
+    protected float shapesSharpness = OutlineShape.DEFAULT_SHARPNESS;
+
+    /** Default base-color w/o color channel, will be modulated w/ pressed- and toggle color */
+    protected final float[] rgbaColor         = {0.75f, 0.75f, 0.75f, 1.0f};
+    /** Default pressed color-factor w/o color channel, modulated base-color. 0.75 * 1.2 = 0.9 */
+    protected final float[] pressedRGBAModulate = {1.2f, 1.2f, 1.2f, 0.7f};
+    /** Default toggle color-factor w/o color channel, modulated base-color.  0.75 * 1.13 ~ 0.85 */
+    protected final float[] toggleOnRGBAModulate = {1.13f, 1.13f, 1.13f, 1.0f};
+    /** Default toggle color-factor w/o color channel, modulated base-color.  0.75 * 0.86 ~ 0.65 */
+    protected final float[] toggleOffRGBAModulate = {0.86f, 0.86f, 0.86f, 1.0f};
+
+    private int name = -1;
+
     private boolean down = false;
+    private boolean toggle = false;
+    private boolean toggleable = false;
+    private boolean enabled = true;
+    private ArrayList<MouseGestureListener> mouseListeners = new ArrayList<MouseGestureListener>();
 
-    public UIShape(Factory<? extends Vertex> factory) {
+    public UIShape(final Factory<? extends Vertex> factory, final int renderModes) {
         this.vertexFactory = factory;
-        this.shape = new OutlineShape(factory);
-    }
-    
-    public void clear() {
-        clearImpl();
-        shape.clear();
-    }
-    
-    public abstract void render(GL2ES2 gl, RenderState rs, RegionRenderer renderer, int renderModes, int[/*1*/] texSize, boolean selection);
-    
-    protected boolean positionDirty = false;
-    
-    private float[] position = new float[]{0,0,0};
-    private float[] scale = new float[]{1.0f,1.0f,1.0f};
-    public void setScale(float x, float y, float z){
-        scale[0] = x;
-        scale[1] = y;
-        scale[2] = z;
-    }
-    
-    public void setPosition(float x, float y, float z) {
-        this.position[0] = x;
-        this.position[1] = y;
-        this.position[2] = z;
-        positionDirty = true;
-    }
-    
-    private void updatePosition () {
-        float minX = shape.getBounds().getLow()[0];
-        float minY = shape.getBounds().getLow()[1];
-        float minZ = shape.getBounds().getLow()[2];
-        System.out.println("Position was: " + (position[0]) + " " + (position[1]) + " " + (position[2]));
-        System.out.println("Position became: " + (position[0] - minX) + " " + (position[1] - minY) + " " + (position[2] - minZ));
-        setPosition(position[0] - minX, position[1] - minY, position[2] - minZ);
-        positionDirty = false;
-    }
-    
-    public float[] getScale() { return scale; }   
-    public float[] getPosition() { return position; }
-    
-    protected abstract void clearImpl();
-    
-    protected abstract void createShape();
-    
-    public boolean updateShape() {
-        if( isShapeDirty() ) {
-            shape.clear();
-            createShape();
-            if(positionDirty){
-                updatePosition();
+        this.renderModes = renderModes;
+        this.box = new AABBox();
+    }
+
+    public void setName(final int name) { this.name = name; }
+    public int getName() { return this.name; }
+
+    public final Vertex.Factory<? extends Vertex> getVertexFactory() { return vertexFactory; }
+
+    public boolean isEnabled() { return enabled; }
+    public void setEnabled(final boolean v) { enabled = v; }
+
+    /**
+     * Clears all data and reset all states as if this instance was newly created
+     * @param gl TODO
+     * @param renderer TODO\
+     */
+    public void clear(final GL2ES2 gl, final RegionRenderer renderer) {
+        clearImpl(gl, renderer);
+        translate[0] = 0f;
+        translate[1] = 0f;
+        translate[2] = 0f;
+        rotation.setIdentity();
+        rotOrigin[0] = 0f;
+        rotOrigin[1] = 0f;
+        rotOrigin[2] = 0f;
+        scale[0] = 1f;
+        scale[1] = 1f;
+        scale[2] = 1f;
+        box.reset();
+        markShapeDirty();
+    }
+
+    /**
+     * Destroys all data
+     * @param gl
+     * @param renderer
+     */
+    public void destroy(final GL2ES2 gl, final RegionRenderer renderer) {
+        destroyImpl(gl, renderer);
+        translate[0] = 0f;
+        translate[1] = 0f;
+        translate[2] = 0f;
+        rotation.setIdentity();
+        rotOrigin[0] = 0f;
+        rotOrigin[1] = 0f;
+        rotOrigin[2] = 0f;
+        scale[0] = 1f;
+        scale[1] = 1f;
+        scale[2] = 1f;
+        box.reset();
+        markShapeDirty();
+    }
+
+    public void setTranslate(final float tx, final float ty, final float tz) {
+        translate[0] = tx;
+        translate[1] = ty;
+        translate[2] = tz;
+        // System.err.println("UIShape.setTranslate: "+tx+"/"+ty+"/"+tz+": "+toString());
+    }
+    public void translate(final float tx, final float ty, final float tz) {
+        translate[0] += tx;
+        translate[1] += ty;
+        translate[2] += tz;
+        // System.err.println("UIShape.translate: "+tx+"/"+ty+"/"+tz+": "+toString());
+    }
+    public final float[] getTranslate() { return translate; }
+    public final Quaternion getRotation() { return rotation; }
+    public final float[] getRotationOrigin() { return rotOrigin; }
+    public void setRotationOrigin(final float rx, final float ry, final float rz) {
+        rotOrigin[0] = rx;
+        rotOrigin[1] = ry;
+        rotOrigin[2] = rz;
+    }
+    public void setScale(final float sx, final float sy, final float sz) {
+        scale[0] = sx;
+        scale[1] = sy;
+        scale[2] = sz;
+    }
+    public void scale(final float sx, final float sy, final float sz) {
+        scale[0] *= sx;
+        scale[1] *= sy;
+        scale[2] *= sz;
+    }
+    public final float[] getScale() { return scale; }
+
+    public final void markShapeDirty() {
+        dirty |= DIRTY_SHAPE;
+    }
+    public final boolean isShapeDirty() {
+        return 0 != ( dirty & DIRTY_SHAPE ) ;
+    }
+    public final void markStateDirty() {
+        dirty |= DIRTY_STATE;
+    }
+    public final boolean isStateDirty() {
+        return 0 != ( dirty & DIRTY_STATE ) ;
+    }
+
+    public final AABBox getBounds() { return box; }
+
+    public final int getRenderModes() { return renderModes; }
+
+    public GLRegion getRegion(final GL2ES2 gl, final RegionRenderer renderer) {
+        validate(gl, renderer);
+        return region;
+    }
+
+    /**
+     * Renders {@link OutlineShape} using local {@link GLRegion} which might be cached or updated.
+     * <p>
+     * No matrix operations (translate, scale, ..) are performed.
+     * </p>
+     * @param gl
+     * @param renderer
+     * @param sampleCount
+     */
+    public void drawShape(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount) {
+        final float r, g, b, a;
+        final boolean isPressed = isPressed(), isToggleOn = isToggleOn();
+        final boolean modBaseColor = !Region.hasColorChannel( renderModes ) && !Region.hasColorTexture( renderModes );
+        if( modBaseColor ) {
+            if( isPressed ) {
+                r = rgbaColor[0]*pressedRGBAModulate[0];
+                g = rgbaColor[1]*pressedRGBAModulate[1];
+                b = rgbaColor[2]*pressedRGBAModulate[2];
+                a = rgbaColor[3]*pressedRGBAModulate[3];
+            } else if( isToggleable() ) {
+                if( isToggleOn ) {
+                    r = rgbaColor[0]*toggleOnRGBAModulate[0];
+                    g = rgbaColor[1]*toggleOnRGBAModulate[1];
+                    b = rgbaColor[2]*toggleOnRGBAModulate[2];
+                    a = rgbaColor[3]*toggleOnRGBAModulate[3];
+                } else {
+                    r = rgbaColor[0]*toggleOffRGBAModulate[0];
+                    g = rgbaColor[1]*toggleOffRGBAModulate[1];
+                    b = rgbaColor[2]*toggleOffRGBAModulate[2];
+                    a = rgbaColor[3]*toggleOffRGBAModulate[3];
+                }
+            } else {
+                r = rgbaColor[0];
+                g = rgbaColor[1];
+                b = rgbaColor[2];
+                a = rgbaColor[3];
+            }
+        } else {
+            if( isPressed ) {
+                r = pressedRGBAModulate[0];
+                g = pressedRGBAModulate[1];
+                b = pressedRGBAModulate[2];
+                a = pressedRGBAModulate[3];
+            } else if( isToggleable() ) {
+                if( isToggleOn ) {
+                    r = toggleOnRGBAModulate[0];
+                    g = toggleOnRGBAModulate[1];
+                    b = toggleOnRGBAModulate[2];
+                    a = toggleOnRGBAModulate[3];
+                } else {
+                    r = toggleOffRGBAModulate[0];
+                    g = toggleOffRGBAModulate[1];
+                    b = toggleOffRGBAModulate[2];
+                    a = toggleOffRGBAModulate[3];
+                }
+            } else {
+                r = rgbaColor[0];
+                g = rgbaColor[1];
+                b = rgbaColor[2];
+                a = rgbaColor[3];
             }
-            dirty &= ~DIRTY_SHAPE;
-            return true;
         }
-        return false;
-    }
-    
-    public final Vertex.Factory<? extends Vertex> getVertexFactory() { return vertexFactory; }    
-    public AABBox getBounds() { return shape.getBounds(); }
-    
-    public OutlineShape getShape() { 
-        updateShape(); 
-        return shape; 
-    }
-    
-    public boolean isShapeDirty() {
-        return 0 != ( dirty & DIRTY_SHAPE ) ;
-    }    
-    
-    public void setPressed(boolean b) {
+        renderer.getRenderState().setColorStatic(r, g, b, a);
+        getRegion(gl, renderer).draw(gl, renderer, sampleCount);
+    }
+
+    protected GLRegion createGLRegion() {
+        return GLRegion.create(renderModes, null);
+    }
+
+    /**
+     * Validates the shape's underlying {@link GLRegion}.
+     *
+     * @param gl
+     * @param renderer
+     */
+    public final void validate(final GL2ES2 gl, final RegionRenderer renderer) {
+        if( isShapeDirty() || null == region ) {
+            box.reset();
+            if( null == region ) {
+                region = createGLRegion();
+            } else {
+                region.clear(gl);
+            }
+            addShapeToRegion(gl, renderer);
+            if( DRAW_DEBUG_BOX ) {
+                region.clear(gl);
+                final OutlineShape shape = new OutlineShape(renderer.getRenderState().getVertexFactory());
+                shape.setSharpness(shapesSharpness);
+                shape.setIsQuadraticNurbs();
+                region.addOutlineShape(shape, null, rgbaColor);
+            }
+            region.setQuality(regionQuality);
+            dirty &= ~(DIRTY_SHAPE|DIRTY_STATE);
+        } else if( isStateDirty() ) {
+            region.markStateDirty();
+            dirty &= ~DIRTY_STATE;
+        }
+    }
+
+    public float[] getColor() {
+        return rgbaColor;
+    }
+
+    public final int getQuality() { return regionQuality; }
+    public final void setQuality(final int q) {
+        this.regionQuality = q;
+        if( null != region ) {
+            region.setQuality(q);
+        }
+    }
+    public final void setSharpness(final float sharpness) {
+        this.shapesSharpness = sharpness;
+        markShapeDirty();
+    }
+    public final float getSharpness() {
+        return shapesSharpness;
+    }
+
+    public final void setColor(final float r, final float g, final float b, final float a) {
+        this.rgbaColor[0] = r;
+        this.rgbaColor[1] = g;
+        this.rgbaColor[2] = b;
+        this.rgbaColor[3] = a;
+    }
+    public final void setPressedColorMod(final float r, final float g, final float b, final float a) {
+        this.pressedRGBAModulate[0] = r;
+        this.pressedRGBAModulate[1] = g;
+        this.pressedRGBAModulate[2] = b;
+        this.pressedRGBAModulate[3] = a;
+    }
+    public final void setToggleOnColorMod(final float r, final float g, final float b, final float a) {
+        this.toggleOnRGBAModulate[0] = r;
+        this.toggleOnRGBAModulate[1] = g;
+        this.toggleOnRGBAModulate[2] = b;
+        this.toggleOnRGBAModulate[3] = a;
+    }
+    public final void setToggleOffColorMod(final float r, final float g, final float b, final float a) {
+        this.toggleOffRGBAModulate[0] = r;
+        this.toggleOffRGBAModulate[1] = g;
+        this.toggleOffRGBAModulate[2] = b;
+        this.toggleOffRGBAModulate[3] = a;
+    }
+
+    @Override
+    public final String toString() {
+        return getClass().getSimpleName()+"["+getSubString()+"]";
+    }
+
+    public String getSubString() {
+        return "enabled "+enabled+", toggle[able "+toggleable+", state "+toggle+"], "+translate[0]+" / "+translate[1]+", box "+box;
+    }
+
+    //
+    // Input
+    //
+
+    public void setPressed(final boolean b) {
         this.down  = b;
+        markStateDirty();
     }
-    
     public boolean isPressed() {
         return this.down;
     }
-    
-    public abstract void onClick();
-    public abstract void onPressed();
-    public abstract void onRelease();
+
+    public void setToggleable(final boolean toggleable) {
+        this.toggleable = toggleable;
+    }
+    public boolean isToggleable() {
+        return toggleable;
+    }
+    public void setToggle(final boolean v) {
+        toggle = v;
+        markStateDirty();
+    }
+    public void toggle() {
+        if( isToggleable() ) {
+            toggle = !toggle;
+        }
+        markStateDirty();
+    }
+    public boolean isToggleOn() { return toggle; }
+
+    public final void addMouseListener(final MouseGestureListener l) {
+        if(l == null) {
+            return;
+        }
+        @SuppressWarnings("unchecked")
+        final ArrayList<MouseGestureListener> clonedListeners = (ArrayList<MouseGestureListener>) mouseListeners.clone();
+        clonedListeners.add(l);
+        mouseListeners = clonedListeners;
+    }
+
+    public final void removeMouseListener(final MouseGestureListener l) {
+        if (l == null) {
+            return;
+        }
+        @SuppressWarnings("unchecked")
+        final ArrayList<MouseGestureListener> clonedListeners = (ArrayList<MouseGestureListener>) mouseListeners.clone();
+        clonedListeners.remove(l);
+        mouseListeners = clonedListeners;
+    }
+
+    /**
+     * Combining {@link MouseListener} and {@link GestureListener}
+     */
+    public static interface MouseGestureListener extends MouseListener, GestureListener {
+    }
+
+    /**
+     * Convenient adapter combining dummy implementation for {@link MouseListener} and {@link GestureListener}
+     */
+    public static abstract class MouseGestureAdapter extends MouseAdapter implements MouseGestureListener {
+        @Override
+        public void gestureDetected(final GestureEvent gh) {
+        }
+    }
+
+    /**
+     * {@link UIShape} event details for propagated {@link NEWTEvent}s
+     * containing reference of {@link #shape the intended shape} as well as
+     * the {@link #objPos rotated relative position} and {@link #rotBounds bounding box}.
+     * The latter fields are also normalized to lower-left zero origin, allowing easier usage.
+     */
+    public static class PointerEventInfo {
+        /** The intended {@link UIShape} instance for this event */
+        public final UIShape shape;
+        /** The relative pointer position inside the intended {@link UIShape}. */
+        public final float[] objPos;
+        /** window x-position in OpenGL model space */
+        public final int glWinX;
+        /** window y-position in OpenGL model space */
+        public final int glWinY;
+
+        PointerEventInfo(final int glWinX, final int glWinY, final UIShape shape, final float[] objPos) {
+            this.glWinX = glWinX;
+            this.glWinY = glWinY;
+            this.shape = shape;
+            this.objPos = objPos;
+        }
+
+        public String toString() {
+            return "EventDetails[winPos ["+glWinX+", "+glWinY+"], objPos ["+objPos[0]+", "+objPos[1]+", "+objPos[2]+"], "+shape+"]";
+        }
+    }
+
+    /**
+     * @param e original Newt {@link GestureEvent}
+     * @param glWinX x-position in OpenGL model space
+     * @param glWinY y-position in OpenGL model space
+     */
+    public final void dispatchGestureEvent(final GestureEvent e, final int glWinX, final int glWinY, final float[] objPos) {
+        e.setAttachment(new PointerEventInfo(glWinX, glWinY, this, objPos));
+        for(int i = 0; !e.isConsumed() && i < mouseListeners.size(); i++ ) {
+            mouseListeners.get(i).gestureDetected(e);
+        }
+    }
+
+    /**
+     *
+     * @param e original Newt {@link MouseEvent}
+     * @param glX x-position in OpenGL model space
+     * @param glY y-position in OpenGL model space
+     */
+    public final void dispatchMouseEvent(final MouseEvent e, final int glWinX, final int glWinY, final float[] objPos) {
+        e.setAttachment(new PointerEventInfo(glWinX, glWinY, this, objPos));
+
+        final short eventType = e.getEventType();
+        if( 1 == e.getPointerCount() ) {
+            switch( eventType ) {
+                case MouseEvent.EVENT_MOUSE_CLICKED:
+                    toggle();
+                    break;
+                case MouseEvent.EVENT_MOUSE_PRESSED:
+                    setPressed(true);
+                    break;
+                case MouseEvent.EVENT_MOUSE_RELEASED:
+                    setPressed(false);
+                    break;
+            }
+        }
+
+        for(int i = 0; !e.isConsumed() && i < mouseListeners.size(); i++ ) {
+            final MouseGestureListener l = mouseListeners.get(i);
+            switch( eventType ) {
+                case MouseEvent.EVENT_MOUSE_CLICKED:
+                    l.mouseClicked(e);
+                    break;
+                case MouseEvent.EVENT_MOUSE_ENTERED:
+                    l.mouseEntered(e);
+                    break;
+                case MouseEvent.EVENT_MOUSE_EXITED:
+                    l.mouseExited(e);
+                    break;
+                case MouseEvent.EVENT_MOUSE_PRESSED:
+                    l.mousePressed(e);
+                    break;
+                case MouseEvent.EVENT_MOUSE_RELEASED:
+                    l.mouseReleased(e);
+                    break;
+                case MouseEvent.EVENT_MOUSE_MOVED:
+                    l.mouseMoved(e);
+                    break;
+                case MouseEvent.EVENT_MOUSE_DRAGGED:
+                    l.mouseDragged(e);
+                    break;
+                case MouseEvent.EVENT_MOUSE_WHEEL_MOVED:
+                    l.mouseWheelMoved(e);
+                    break;
+                default:
+                    throw new NativeWindowException("Unexpected mouse event type " + e.getEventType());
+            }
+        }
+    }
+
+    //
+    //
+    //
+
+    protected abstract void clearImpl(GL2ES2 gl, RegionRenderer renderer);
+    protected abstract void destroyImpl(GL2ES2 gl, RegionRenderer renderer);
+    protected abstract void addShapeToRegion(GL2ES2 gl, RegionRenderer renderer);
+
+    //
+    //
+    //
+
+    protected OutlineShape createDebugOutline(final OutlineShape shape, final AABBox box) {
+        final float tw = box.getWidth();
+        final float th = box.getHeight();
+
+        final float minX = box.getMinX();
+        final float minY = box.getMinY();
+        final float z = box.getMinZ() + 0.025f;
+
+        // CCW!
+        shape.addVertex(minX,    minY,      z, true);
+        shape.addVertex(minX+tw, minY,      z, true);
+        shape.addVertex(minX+tw, minY + th, z, true);
+        shape.addVertex(minX,    minY + th, z, true);
+        shape.closeLastOutline(true);
+
+        return shape;
+    }
+
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UITextShape.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UITextShape.java
deleted file mode 100644
index ee79d9a..0000000
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/UITextShape.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.opengl.test.junit.graph.demos.ui;
-
-import jogamp.graph.curve.text.GlyphString;
-
-/**
- * Marker interface to mark a UIShape implementation for text usage
- */
-public interface UITextShape {
-    GlyphString getGlyphString();
-}
diff --git a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/opengl/UIRegion.java b/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/opengl/UIRegion.java
deleted file mode 100644
index 8827109..0000000
--- a/src/test/com/jogamp/opengl/test/junit/graph/demos/ui/opengl/UIRegion.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * Copyright 2010 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-package com.jogamp.opengl.test.junit.graph.demos.ui.opengl;
-
-import javax.media.opengl.GL2ES2;
-
-import com.jogamp.graph.curve.opengl.GLRegion;
-import com.jogamp.graph.curve.opengl.RenderState;
-import com.jogamp.opengl.test.junit.graph.demos.ui.UIShape;
-import com.jogamp.opengl.test.junit.graph.demos.ui.UITextShape;
-
-public class UIRegion {
-    protected static final int DIRTY_REGION  = 1 << 0 ;    
-    protected int dirty = DIRTY_REGION;
-    
-    private UIShape uiShape;
-    private GLRegion region;
-    
-    public UIRegion(UIShape uis) {
-        this.uiShape = uis;
-    }
-    
-    public boolean updateRegion(GL2ES2 gl, RenderState rs, int renderModes) {
-        if( uiShape.updateShape() || isRegionDirty() ) {
-            destroy(gl, rs);
-            if(uiShape instanceof UITextShape) {
-                region = ((UITextShape)uiShape).getGlyphString().createRegion(gl, renderModes);    
-            } else {
-                region = GLRegion.create(uiShape.getShape(), renderModes);
-            }
-            dirty &= ~DIRTY_REGION;
-            return true;
-        }
-        return false;
-    }
-    
-    public GLRegion getRegion(GL2ES2 gl, RenderState rs, int renderModes) { 
-        updateRegion(gl, rs, renderModes);
-        return region; 
-    }
-    
-    public boolean isRegionDirty() {
-        return 0 != ( dirty & DIRTY_REGION ) ;
-    }
-    
-    public void destroy(GL2ES2 gl, RenderState rs) {
-        if(null != region) {
-            region.destroy(gl, rs);
-            region = null;
-        }                    
-    }
-}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/GLReadBuffer00Base.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/GLReadBuffer00Base.java
index 43f8b89..26974eb 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/GLReadBuffer00Base.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/GLReadBuffer00Base.java
@@ -41,6 +41,9 @@ import org.junit.Test;
 import org.junit.runners.MethodSorters;
 
 import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.font.Font;
 import com.jogamp.opengl.test.junit.graph.TextRendererGLELBase;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 
@@ -51,28 +54,37 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 public abstract class GLReadBuffer00Base extends UITestCase {
 
     public static class TextRendererGLEL extends TextRendererGLELBase {
+        final Font font = getFont(0, 0, 0);
         public int frameNo = 0;
         public int userCounter = 0;
+        private final GLRegion regionFPS;
 
         public TextRendererGLEL() {
             // FIXME: Graph TextRenderer does not AA well w/o MSAA and FBO
-            super(Region.VBAA_RENDERING_BIT);
-            texSizeScale = 2;
+            super(Region.VBAA_RENDERING_BIT, new int[] { 4 });
+            this.setRendererCallbacks(RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable);
+            regionFPS = GLRegion.create(renderModes, null);
 
-            fontSize = 24;
-
-            staticRGBAColor[0] = 1.0f;
-            staticRGBAColor[1] = 1.0f;
-            staticRGBAColor[2] = 1.0f;
+            staticRGBAColor[0] = 0.9f;
+            staticRGBAColor[1] = 0.9f;
+            staticRGBAColor[2] = 0.9f;
             staticRGBAColor[3] = 0.99f;
         }
 
         @Override
-        public void display(GLAutoDrawable drawable) {
-            final String text = String.format("Frame %04d (%03d): %04dx%04d", frameNo, userCounter, drawable.getWidth(), drawable.getHeight());
+        public void dispose(final GLAutoDrawable drawable) {
+            regionFPS.destroy(drawable.getGL().getGL2ES2());
+            super.dispose(drawable);
+        }
+
+        @Override
+        public void display(final GLAutoDrawable drawable) {
+            final String text = String.format("Frame %04d (%03d): %04dx%04d", frameNo, userCounter, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
             System.err.println("TextRendererGLEL.display: "+text);
             if( null != renderer ) {
-                renderString(drawable, text, 0 /* col */, 0 /* row */, 0, 0, -1);
+                final float pixelSize = font.getPixelSize(14f, dpiH);
+                drawable.getGL().glClearColor(1f, 1f, 1f, 0f);
+                renderString(drawable, font, pixelSize, text, 0 /* col */, 0 /* row */, 0, 0, -1, regionFPS);
             } else {
                 System.err.println(text);
             }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/InitConcurrentBaseNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/InitConcurrentBaseNEWT.java
index f1bc0ab..eb9203b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/InitConcurrentBaseNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/InitConcurrentBaseNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import javax.media.nativewindow.Capabilities;
@@ -55,44 +55,45 @@ import com.jogamp.opengl.util.Animator;
  */
 public abstract class InitConcurrentBaseNEWT extends UITestCase {
 
-    static final int demoSize = 128;
-    
+    static final int demoWinSize = 128;
+
     static long duration = 300; // ms
-    
+
     static InsetsImmutable insets = null;
-    static int scrnHeight, scrnWidth;
     static int num_x, num_y;
-    
+
     @BeforeClass
     public static void initClass() {
-        Window dummyWindow = NewtFactory.createWindow(new Capabilities());
-        dummyWindow.setSize(demoSize, demoSize);
+        final Window dummyWindow = NewtFactory.createWindow(new Capabilities());
+        dummyWindow.setSize(demoWinSize, demoWinSize);
         dummyWindow.setVisible(true);
         Assert.assertEquals(true, dummyWindow.isVisible());
         Assert.assertEquals(true, dummyWindow.isNativeValid());
-        insets = dummyWindow.getInsets();        
-        scrnHeight = dummyWindow.getScreen().getHeight();
-        scrnWidth = dummyWindow.getScreen().getWidth();        
-        num_x = scrnWidth  / ( demoSize + insets.getTotalWidth() )  - 2;
-        num_y = scrnHeight / ( demoSize + insets.getTotalHeight() ) - 2;
+        insets = dummyWindow.getInsets();
+        final int scrnHeight = dummyWindow.getScreen().getHeight();
+        final int scrnWidth = dummyWindow.getScreen().getWidth();
+        final int[] demoScreenSize = dummyWindow.convertToPixelUnits(new int[] { demoWinSize, demoWinSize });
+        final int[] insetsScreenSize = dummyWindow.convertToPixelUnits(new int[] { insets.getTotalWidth(), insets.getTotalHeight() });
+        num_x = scrnWidth  / ( demoScreenSize[0] + insetsScreenSize[0] ) - 2;
+        num_y = scrnHeight / ( demoScreenSize[1] + insetsScreenSize[1] ) - 2;
         dummyWindow.destroy();
     }
-    
-    public class JOGLTask implements Runnable {
+
+    public static class JOGLTask implements Runnable {
         private final int id;
         private final Object postSync;
         private final boolean reuse;
         private boolean done = false;
-        
-        public JOGLTask(Object postSync, int id, boolean reuse) {
+
+        public JOGLTask(final Object postSync, final int id, final boolean reuse) {
             this.postSync = postSync;
             this.id = id;
             this.reuse = reuse;
         }
         public void run() {
-            int x = (  id          % num_x ) * ( demoSize + insets.getTotalHeight() );
-            int y = ( (id / num_x) % num_y ) * ( demoSize + insets.getTotalHeight() );
-            
+            final int x = (  id          % num_x ) * ( demoWinSize + insets.getTotalHeight() );
+            final int y = ( (id / num_x) % num_y ) * ( demoWinSize + insets.getTotalHeight() );
+
             System.err.println("JOGLTask "+id+": START: "+x+"/"+y+", reuse "+reuse+" - "+Thread.currentThread().getName());
             final Display display = NewtFactory.createDisplay(null, reuse);
             final Screen screen = NewtFactory.createScreen(display, 0);
@@ -100,36 +101,36 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
             Assert.assertNotNull(glWindow);
             glWindow.setTitle("Task "+id);
             glWindow.setPosition(x + insets.getLeftWidth(), y + insets.getTopHeight() );
-    
+
             glWindow.addGLEventListener(new ValidateLockListener());
             glWindow.addGLEventListener(new GearsES2(0));
-    
-            Animator animator = new Animator(glWindow);
-    
-            glWindow.setSize(demoSize, demoSize);
+
+            final Animator animator = new Animator(glWindow);
+
+            glWindow.setSize(demoWinSize, demoWinSize);
             glWindow.setVisible(true);
             animator.setUpdateFPSFrames(60, null);
-            
+
             System.err.println("JOGLTask "+id+": INITIALIZED: "+", "+display+" - "+Thread.currentThread().getName());
-            
+
             animator.start();
             Assert.assertEquals(true, animator.isAnimating());
             Assert.assertEquals(true, glWindow.isVisible());
             Assert.assertEquals(true, glWindow.isNativeValid());
             Assert.assertEquals(true, glWindow.isRealized());
             System.err.println("JOGLTask "+id+": RUNNING: "+Thread.currentThread().getName());
-    
+
             while(animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
                 try {
                     Thread.sleep(100);
-                } catch (InterruptedException e) {
+                } catch (final InterruptedException e) {
                     e.printStackTrace();
                 }
             }
-    
+
             animator.stop();
             glWindow.destroy();
-            
+
             System.err.println("JOGLTask "+id+": DONE/SYNC: "+Thread.currentThread().getName());
             synchronized (postSync) {
                 done = true;
@@ -137,11 +138,11 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
                 postSync.notifyAll();
             }
         }
-        
+
         public boolean done() { return done; }
     }
 
-    protected static boolean done(JOGLTask[] tasks) {
+    protected static boolean done(final JOGLTask[] tasks) {
         for(int i=tasks.length-1; i>=0; i--) {
             if(!tasks[i].done()) {
                 return false;
@@ -149,8 +150,8 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
         }
         return true;
     }
-    protected static String doneDump(JOGLTask[] tasks) {
-        StringBuilder sb = new StringBuilder();
+    protected static String doneDump(final JOGLTask[] tasks) {
+        final StringBuilder sb = new StringBuilder();
         sb.append("[");
         for(int i=0; i<tasks.length; i++) {
             if(i>0) {
@@ -161,8 +162,8 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
         sb.append("]");
         return sb.toString();
     }
-    
-    protected static boolean isDead(Thread[] threads) {
+
+    protected static boolean isDead(final Thread[] threads) {
         for(int i=threads.length-1; i>=0; i--) {
             if(threads[i].isAlive()) {
                 return false;
@@ -170,8 +171,8 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
         }
         return true;
     }
-    protected static String isAliveDump(Thread[] threads) {
-        StringBuilder sb = new StringBuilder();
+    protected static String isAliveDump(final Thread[] threads) {
+        final StringBuilder sb = new StringBuilder();
         sb.append("[");
         for(int i=0; i<threads.length; i++) {
             if(i>0) {
@@ -182,8 +183,8 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
         sb.append("]");
         return sb.toString();
     }
-    
-    protected void runJOGLTasks(int num, boolean reuse) throws InterruptedException {
+
+    protected void runJOGLTasks(final int num, final boolean reuse) throws InterruptedException {
         System.err.println("InitConcurrentBaseNEWT "+num+" threads, reuse display: "+reuse);
         final String currentThreadName = Thread.currentThread().getName();
         final Object syncDone = new Object();
@@ -194,8 +195,8 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
             tasks[i] = new JOGLTask(syncDone, i, reuse);
             threads[i] = new Thread(tasks[i], currentThreadName+"-jt"+i);
         }
-        final long t0 = System.currentTimeMillis(); 
-        
+        final long t0 = System.currentTimeMillis();
+
         for(i=0; i<num; i++) {
             threads[i].start();
         }
@@ -204,7 +205,7 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
             while(!done(tasks)) {
                 try {
                     syncDone.wait(500);
-                } catch (InterruptedException e) {
+                } catch (final InterruptedException e) {
                     throw new RuntimeException(e);
                 }
                 System.err.println(i+": "+doneDump(tasks));
@@ -213,13 +214,13 @@ public abstract class InitConcurrentBaseNEWT extends UITestCase {
         }
         final long t1 = System.currentTimeMillis();
         System.err.println("total: "+(t1-t0)/1000.0+"s");
-        
+
         Assert.assertTrue("Tasks are incomplete. Complete: "+doneDump(tasks), done(tasks));
         i=0;
         while(i<30 && !isDead(threads)) {
             Thread.sleep(100);
             i++;
         }
-        Assert.assertTrue("Threads are still alive after 3s. Alive: "+isAliveDump(threads), isDead(threads));        
-    }    
+        Assert.assertTrue("Threads are still alive after 3s. Alive: "+isAliveDump(threads), isDead(threads));
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAWTCloseX11DisplayBug565.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAWTCloseX11DisplayBug565.java
index d8506a0..0913cd2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAWTCloseX11DisplayBug565.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAWTCloseX11DisplayBug565.java
@@ -25,18 +25,18 @@ public class TestAWTCloseX11DisplayBug565 {
     try {
       for ( int j = 0; j < 10; j++ ) {
         final int open0;
-        if(NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(false)) {        
+        if(NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(false)) {
             open0 = X11Util.getOpenDisplayConnectionNumber();
         } else {
             open0 = 0;
         }
-                
-        GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault( ) );
+
+        final GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault( ) );
         final Frame frame = new Frame( "AWT Resource X11 Leak - #" + j );
-  
+
         final GLCanvas glCanvas = new GLCanvas( caps );
         frame.add( glCanvas );
-  
+
         try {
           javax.swing.SwingUtilities.invokeAndWait( new Runnable() {
             public void run() {
@@ -45,7 +45,7 @@ public class TestAWTCloseX11DisplayBug565 {
             }
           } );
         }
-        catch ( Throwable t ) {
+        catch ( final Throwable t ) {
           t.printStackTrace();
           Assert.fail(t.getMessage());
         }
@@ -59,7 +59,7 @@ public class TestAWTCloseX11DisplayBug565 {
             }
           } );
         }
-        catch ( Throwable t ) {
+        catch ( final Throwable t ) {
           t.printStackTrace();
           Assert.fail(t.getMessage());
         }
@@ -74,16 +74,16 @@ public class TestAWTCloseX11DisplayBug565 {
         }
       }
     }
-    catch ( Exception e ) {
+    catch ( final Exception e ) {
       e.printStackTrace();
       Assert.fail(e.getMessage());
     }
   }
 
 
-  public static void main(String args[]) {
+  public static void main(final String args[]) {
     org.junit.runner.JUnitCore.main(TestAWTCloseX11DisplayBug565.class.getName());
   }
-  
+
 }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove01GLCanvasSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove01GLCanvasSwingAWT.java
index 3e54bcd..87da699 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove01GLCanvasSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove01GLCanvasSwingAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.awt.AWTException;
@@ -42,6 +42,7 @@ import javax.media.opengl.awt.GLCanvas;
 import javax.swing.JFrame;
 import javax.swing.JPanel;
 import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
 
 import jogamp.nativewindow.jawt.JAWTUtil;
 
@@ -88,9 +89,9 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase {
     @AfterClass
     public static void releaseClass() {
     }
-    
-    protected JPanel create(final JFrame[] top, final int width, final int height, final int num) 
-            throws InterruptedException, InvocationTargetException 
+
+    protected JPanel create(final JFrame[] top, final int width, final int height, final int num)
+            throws InterruptedException, InvocationTargetException
     {
         final JPanel[] jPanel = new JPanel[] { null };
         SwingUtilities.invokeAndWait(new Runnable() {
@@ -100,33 +101,33 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase {
 
                     final JFrame jFrame1 = new JFrame("JFrame #"+num);
                     // jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-                    jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+                    jFrame1.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
                     jFrame1.getContentPane().add(jPanel[0]);
                     jFrame1.setSize(width, height);
-                    
+
                     top[0] = jFrame1;
                 } } );
-        return jPanel[0];        
+        return jPanel[0];
     }
 
-    protected void add(final Container cont, final Component comp) 
-            throws InterruptedException, InvocationTargetException 
+    protected void add(final Container cont, final Component comp)
+            throws InterruptedException, InvocationTargetException
     {
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
-                    cont.add(comp, BorderLayout.CENTER);                    
+                    cont.add(comp, BorderLayout.CENTER);
                 } } );
     }
-    
-    protected void dispose(final GLCanvas glc) 
-            throws InterruptedException, InvocationTargetException 
+
+    protected void dispose(final GLCanvas glc)
+            throws InterruptedException, InvocationTargetException
     {
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
-                    glc.destroy();                    
+                    glc.destroy();
                 } } );
     }
-    
+
     protected void setVisible(final JFrame jFrame, final boolean visible) throws InterruptedException, InvocationTargetException {
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
@@ -135,54 +136,54 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase {
                         jFrame.validate();
                     }
                     jFrame.setVisible(visible);
-                } } ) ;        
+                } } ) ;
     }
-    
+
     protected void dispose(final JFrame jFrame) throws InterruptedException, InvocationTargetException {
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     jFrame.dispose();
-                } } ) ;        
+                } } ) ;
     }
-    
-    protected void runTestGL(boolean onscreen, GLCapabilities caps, int addRemoveOpCount)
+
+    protected void runTestGL(final boolean onscreen, final GLCapabilities caps, final int addRemoveOpCount)
             throws AWTException, InterruptedException, InvocationTargetException
     {
-
         if(waitForKey) {
             UITestCase.waitForKey("Start");
-        }        
+        }
         for(int i=0; i<addRemoveOpCount; i++) {
-            System.err.println("Loop # "+i+" / "+addRemoveCount);
+            int ti = 0;
+            System.err.println("Loop."+(ti++)+" "+(i+1)+"/"+addRemoveOpCount);
             final GLCanvas glc = new GLCanvas(caps);
             Assert.assertNotNull(glc);
             if( !onscreen ) {
                 glc.setShallUseOffscreenLayer(true);
             }
-            Dimension glc_sz = new Dimension(width, height);
+            final Dimension glc_sz = new Dimension(width, height);
             glc.setMinimumSize(glc_sz);
             glc.setPreferredSize(glc_sz);
             glc.setSize(glc_sz);
             final GearsES2 gears = new GearsES2(1);
             gears.setVerbose(false);
             glc.addGLEventListener(gears);
-            
+
             final JFrame[] top = new JFrame[] { null };
             final Container glcCont = create(top, width, height, i);
             add(glcCont, glc);
-            
+
             setVisible(top[0], true);
-                        
+
             final long t0 = System.currentTimeMillis();
             do {
                 glc.display();
                 Thread.sleep(10);
             } while ( ( System.currentTimeMillis() - t0 ) < durationPerTest ) ;
-            
-            System.err.println("GLCanvas isOffscreenLayerSurfaceEnabled: "+glc.isOffscreenLayerSurfaceEnabled()+": "+glc.getChosenGLCapabilities());
-                        
+
+            System.err.println("Loop."+(ti++)+" "+(i+1)+"/"+addRemoveOpCount+": GLCanvas isOffscreenLayerSurfaceEnabled: "+glc.isOffscreenLayerSurfaceEnabled()+": "+glc.getChosenGLCapabilities());
+
             dispose(top[0]);
-            
+
             if( 0 < pauseEach && 0 == i % pauseEach ) {
                 System.err.println("******* P A U S E - Start ********");
                 // OSXUtil.WaitUntilFinish();
@@ -192,7 +193,7 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase {
         }
         if(waitForKeyPost) {
             UITestCase.waitForKey("End");
-        }        
+        }
     }
 
     @Test
@@ -203,7 +204,7 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase {
             System.err.println("No onscreen test requested or platform doesn't support onscreen rendering.");
             return;
         }
-        GLCapabilities caps = new GLCapabilities(glpGL2ES2);
+        final GLCapabilities caps = new GLCapabilities(glpGL2ES2);
         runTestGL(true, caps, addRemoveCount);
     }
 
@@ -219,14 +220,14 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase {
             System.err.println("Only PBuffer test is requested.");
             return;
         }
-        GLCapabilities caps = new GLCapabilities(glpGL2ES2);
+        final GLCapabilities caps = new GLCapabilities(glpGL2ES2);
         if(offscreenPBufferOnly) {
             caps.setPBuffer(true);
             caps.setOnscreen(true); // simulate normal behavior ..
         }
         runTestGL(false, caps, addRemoveCount);
     }
-    
+
     @Test
     public void test03OffscreenPBuffer()
             throws AWTException, InterruptedException, InvocationTargetException
@@ -239,19 +240,19 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase {
             System.err.println("Only FBO test is requested.");
             return;
         }
-        GLCapabilities caps = new GLCapabilities(glpGL2);
+        final GLCapabilities caps = new GLCapabilities(glpGL2);
         caps.setPBuffer(true);
         caps.setOnscreen(true); // simulate normal behavior ..
         runTestGL(false, caps, addRemoveCount);
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     durationPerTest = Long.parseLong(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             } else if(args[i].equals("-loops")) {
                 i++;
                 addRemoveCount = MiscUtils.atoi(args[i], addRemoveCount);
@@ -277,16 +278,16 @@ public class TestAddRemove01GLCanvasSwingAWT extends UITestCase {
         }
         System.err.println("waitForKey                    "+waitForKey);
         System.err.println("waitForKeyPost                "+waitForKeyPost);
-        
+
         System.err.println("addRemoveCount                "+addRemoveCount);
         System.err.println("pauseEach                     "+pauseEach);
-        System.err.println("pauseDuration                 "+pauseDuration);        
-        
+        System.err.println("pauseDuration                 "+pauseDuration);
+
         System.err.println("noOnscreenTest                "+noOnscreenTest);
         System.err.println("noOffscreenTest               "+noOffscreenTest);
         System.err.println("offscreenPBufferOnly          "+offscreenPBufferOnly);
         System.err.println("offscreenFBOOnly              "+offscreenFBOOnly);
-        
-        org.junit.runner.JUnitCore.main(TestAddRemove01GLCanvasSwingAWT.class.getName());        
+
+        org.junit.runner.JUnitCore.main(TestAddRemove01GLCanvasSwingAWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove02GLWindowNewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove02GLWindowNewtCanvasAWT.java
index be8dd3d..7a26c02 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove02GLWindowNewtCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove02GLWindowNewtCanvasAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.awt.AWTException;
@@ -42,6 +42,7 @@ import javax.media.opengl.awt.GLCanvas;
 import javax.swing.JFrame;
 import javax.swing.JPanel;
 import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
 
 import jogamp.nativewindow.jawt.JAWTUtil;
 
@@ -88,45 +89,45 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase {
     @AfterClass
     public static void releaseClass() {
     }
-    
-    protected JPanel create(final JFrame[] top, final int width, final int height, final int num) 
-            throws InterruptedException, InvocationTargetException 
+
+    protected JPanel create(final JFrame[] top, final int width, final int height, final int num)
+            throws InterruptedException, InvocationTargetException
     {
         final JPanel[] jPanel = new JPanel[] { null };
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     jPanel[0] = new JPanel();
                     jPanel[0].setLayout(new BorderLayout());
-                    
+
                     final JFrame jFrame1 = new JFrame("JFrame #"+num);
                     // jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-                    jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+                    jFrame1.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
                     jFrame1.getContentPane().add(jPanel[0]);
                     jFrame1.setSize(width, height);
-                    
+
                     top[0] = jFrame1;
                 } } );
-        return jPanel[0];        
+        return jPanel[0];
     }
 
-    protected void add(final Container cont, final Component comp) 
-            throws InterruptedException, InvocationTargetException 
+    protected void add(final Container cont, final Component comp)
+            throws InterruptedException, InvocationTargetException
     {
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
-                    cont.add(comp, BorderLayout.CENTER);                    
+                    cont.add(comp, BorderLayout.CENTER);
                 } } );
     }
-    
-    protected void dispose(final GLCanvas glc) 
-            throws InterruptedException, InvocationTargetException 
+
+    protected void dispose(final GLCanvas glc)
+            throws InterruptedException, InvocationTargetException
     {
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
-                    glc.destroy();                    
+                    glc.destroy();
                 } } );
     }
-    
+
     protected void setVisible(final JFrame jFrame, final boolean visible) throws InterruptedException, InvocationTargetException {
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
@@ -135,54 +136,54 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase {
                         jFrame.validate();
                     }
                     jFrame.setVisible(visible);
-                } } ) ;        
+                } } ) ;
     }
-    
+
     protected void dispose(final JFrame jFrame) throws InterruptedException, InvocationTargetException {
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     jFrame.dispose();
-                } } ) ;        
+                } } ) ;
     }
-    
-    protected void runTestGL(boolean onscreen, GLCapabilities caps, int addRemoveOpCount)
+
+    protected void runTestGL(final boolean onscreen, final GLCapabilities caps, final int addRemoveOpCount)
             throws AWTException, InterruptedException, InvocationTargetException
     {
 
         for(int i=0; i<addRemoveOpCount; i++) {
             System.err.println("Loop # "+i+" / "+addRemoveCount);
             final GLWindow glw = GLWindow.create(caps);
-            Assert.assertNotNull(glw);            
+            Assert.assertNotNull(glw);
             final NewtCanvasAWT glc = new NewtCanvasAWT(glw);
             Assert.assertNotNull(glc);
             if( !onscreen ) {
                 glc.setShallUseOffscreenLayer(true);
             }
-            Dimension glc_sz = new Dimension(width, height);
+            final Dimension glc_sz = new Dimension(width, height);
             glc.setMinimumSize(glc_sz);
             glc.setPreferredSize(glc_sz);
             glc.setSize(glc_sz);
             final GearsES2 gears = new GearsES2(1);
             gears.setVerbose(false);
             glw.addGLEventListener(gears);
-            
+
             final JFrame[] top = new JFrame[] { null };
             final Container glcCont = create(top, width, height, i);
             add(glcCont, glc);
-            
+
             setVisible(top[0], true);
-                        
+
             final long t0 = System.currentTimeMillis();
             do {
                 glw.display();
                 Thread.sleep(10);
             } while ( ( System.currentTimeMillis() - t0 ) < durationPerTest ) ;
-            
+
             System.err.println("GLCanvas isOffscreenLayerSurfaceEnabled: "+glc.isOffscreenLayerSurfaceEnabled()+": "+glw.getChosenGLCapabilities());
-            
+
             dispose(top[0]);
             glw.destroy();
-            
+
             if( 0 < pauseEach && 0 == i % pauseEach ) {
                 System.err.println("******* P A U S E ********");
                 Thread.sleep(pauseDuration);
@@ -190,7 +191,7 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase {
         }
         if(waitForKeyPost) {
             UITestCase.waitForKey("End");
-        }        
+        }
     }
 
     @Test
@@ -201,7 +202,7 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase {
             System.err.println("No onscreen test requested or platform doesn't support onscreen rendering.");
             return;
         }
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(true, caps, addRemoveCount);
     }
 
@@ -217,10 +218,10 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase {
             System.err.println("Only PBuffer test is requested.");
             return;
         }
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(false, caps, addRemoveCount);
     }
-    
+
     @Test
     public void test03OffscreenPBuffer()
             throws AWTException, InterruptedException, InvocationTargetException
@@ -233,19 +234,19 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase {
             System.err.println("Only FBO test is requested.");
             return;
         }
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setPBuffer(true);
         caps.setOnscreen(true); // simulate normal behavior ..
         runTestGL(false, caps, addRemoveCount);
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     durationPerTest = Long.parseLong(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             } else if(args[i].equals("-loops")) {
                 i++;
                 addRemoveCount = MiscUtils.atoi(args[i], addRemoveCount);
@@ -267,15 +268,15 @@ public class TestAddRemove02GLWindowNewtCanvasAWT extends UITestCase {
                 waitForKey = true;
             } else if(args[i].equals("-waitPost")) {
                 waitForKeyPost = true;
-            }            
+            }
         }
         System.err.println("waitForKey                    "+waitForKey);
         System.err.println("waitForKeyPost                "+waitForKeyPost);
-        
+
         System.err.println("addRemoveCount                "+addRemoveCount);
         System.err.println("pauseEach                     "+pauseEach);
-        System.err.println("pauseDuration                 "+pauseDuration);        
-        
+        System.err.println("pauseDuration                 "+pauseDuration);
+
         System.err.println("noOnscreenTest                "+noOnscreenTest);
         System.err.println("noOffscreenTest               "+noOffscreenTest);
         System.err.println("offscreenPBufferOnly          "+offscreenPBufferOnly);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove03GLWindowNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove03GLWindowNEWT.java
index d994754..70aa4df 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove03GLWindowNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestAddRemove03GLWindowNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.io.IOException;
@@ -71,33 +71,33 @@ public class TestAddRemove03GLWindowNEWT extends UITestCase {
     @AfterClass
     public static void releaseClass() {
     }
-    
-    protected void runTestGL(GLCapabilities caps, int addRemoveOpCount)
+
+    protected void runTestGL(final GLCapabilities caps, final int addRemoveOpCount)
             throws InterruptedException, InvocationTargetException
     {
 
         for(int i=0; i<addRemoveOpCount; i++) {
             System.err.println("Loop # "+i+" / "+addRemoveCount);
             final GLWindow glw = GLWindow.create(caps);
-            Assert.assertNotNull(glw); 
+            Assert.assertNotNull(glw);
             glw.setTitle("GLWindow #"+i);
             glw.setSize(width, height);
             final GearsES2 gears = new GearsES2(1);
             gears.setVerbose(false);
             glw.addGLEventListener(gears);
-            
+
             glw.setVisible(true);
-                        
+
             final long t0 = System.currentTimeMillis();
             do {
                 glw.display();
                 Thread.sleep(10);
             } while ( ( System.currentTimeMillis() - t0 ) < durationPerTest ) ;
-            
+
             System.err.println("GLWindow: "+glw.getChosenGLCapabilities());
-            
+
             glw.destroy();
-            
+
             if( 0 < pauseEach && 0 == i % pauseEach ) {
                 System.err.println("******* P A U S E ********");
                 Thread.sleep(pauseDuration);
@@ -109,17 +109,17 @@ public class TestAddRemove03GLWindowNEWT extends UITestCase {
     public void test01Onscreen()
             throws InterruptedException, InvocationTargetException
     {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, addRemoveCount);
     }
 
-    public static void main(String args[]) throws IOException {        
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     durationPerTest = Long.parseLong(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             } else if(args[i].equals("-loops")) {
                 i++;
                 addRemoveCount = MiscUtils.atoi(args[i], addRemoveCount);
@@ -131,14 +131,14 @@ public class TestAddRemove03GLWindowNEWT extends UITestCase {
                 pauseDuration = MiscUtils.atoi(args[i], pauseDuration);
             } else if(args[i].equals("-wait")) {
                 waitForKey = true;
-            }            
+            }
         }
         System.err.println("waitForKey                    "+waitForKey);
-        
+
         System.err.println("addRemoveCount                "+addRemoveCount);
         System.err.println("pauseEach                     "+pauseEach);
-        System.err.println("pauseDuration                 "+pauseDuration);        
-        
+        System.err.println("pauseDuration                 "+pauseDuration);
+
         if(waitForKey) {
             UITestCase.waitForKey("Start");
         }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext01NEWT.java
index d61ac9a..c17f669 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext01NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -47,12 +47,12 @@ import com.jogamp.opengl.util.Animator;
 
 /**
  * Tests simple recursive GLContext behavior.
- * 
+ *
  * <p>
  * Issues {@link GLContext#makeCurrent()} and {@link GLContext#release()}
  * from within {@link GLEventListener#display(GLAutoDrawable)}.
- * </p>  
- * 
+ * </p>
+ *
  * <https://jogamp.org/bugzilla/show_bug.cgi?id=669>
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
@@ -62,64 +62,64 @@ public class TestBug669RecursiveGLContext01NEWT extends UITestCase {
   public void test01_Plain() {
       test01Impl(false);
   }
-  
+
   @Test(timeout=5000)
   public void test01_Anim() {
       test01Impl(true);
   }
-  
-  private void test01Impl(boolean anim) {      
+
+  private void test01Impl(final boolean anim) {
     final String profile = GLProfile.GL2ES2;
     if(!GLProfile.isAvailable(profile)) { System.err.println(profile+" n/a"); return; }
-        
+
     final GLProfile pro = GLProfile.get(profile);
     final GLCapabilities caps = new GLCapabilities(pro);
     final GLWindow window = GLWindow.create(caps);
-    
+
     final Animator animator = new Animator();
     if(anim) {
         animator.add(window);
     }
     animator.start();
 
-    window.setSize(640, 480);    
+    window.setSize(640, 480);
     window.addGLEventListener(new GLEventListener() {
-      private void makeCurrentRecursive(GLContextImpl context, int lockCount) {        
+      private void makeCurrentRecursive(final GLContextImpl context, final int lockCount) {
         Assert.assertEquals(true, context.isOwner(Thread.currentThread()));
         Assert.assertEquals(lockCount, context.getLockCount());
         Assert.assertEquals(true, context.isCurrent());
-        
+
         Assert.assertEquals(GLContext.CONTEXT_CURRENT, context.makeCurrent()); // recursive: lock +1
-        
+
         Assert.assertEquals(true, context.isOwner(Thread.currentThread()));
         Assert.assertEquals(lockCount+1, context.getLockCount());
         Assert.assertEquals(true, context.isCurrent());
       }
-      private void releaseRecursive(GLContextImpl context, int lockCount) {
+      private void releaseRecursive(final GLContextImpl context, final int lockCount) {
         Assert.assertEquals(true, context.isOwner(Thread.currentThread()));
         Assert.assertEquals(lockCount, context.getLockCount());
         Assert.assertEquals(true, context.isCurrent()); // still current
-        
+
         context.release();  // recursive: lock -1
-        
+
         Assert.assertEquals(true, context.isOwner(Thread.currentThread()));
         Assert.assertEquals(lockCount-1, context.getLockCount());
         Assert.assertEquals(true, context.isCurrent()); // still current
       }
-      
+
       public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
 
       public void init(final GLAutoDrawable drawable) { }
 
       public void dispose(final GLAutoDrawable drawable) { }
 
-      public void display(final GLAutoDrawable drawable) { 
+      public void display(final GLAutoDrawable drawable) {
         final GLContextImpl context = (GLContextImpl)drawable.getContext();
         makeCurrentRecursive(context, 1);
         releaseRecursive(context, 2);
       }
     });
-    window.addGLEventListener(new GearsES2());    
+    window.addGLEventListener(new GearsES2());
 
     try {
         window.setVisible(true);
@@ -129,10 +129,10 @@ public class TestBug669RecursiveGLContext01NEWT extends UITestCase {
         window.destroy();
     }
   }
-  
-  public static void main(String args[]) {
+
+  public static void main(final String args[]) {
       org.junit.runner.JUnitCore.main(TestBug669RecursiveGLContext01NEWT.class.getName());
   }
-  
+
 }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext02NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext02NEWT.java
index d831016..54afe91 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug669RecursiveGLContext02NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -45,12 +45,12 @@ import com.jogamp.opengl.util.Animator;
 
 /**
  * Tests recursive GLContext behavior.
- * 
+ *
  * <p>
- * Issues {@link GLAutoDrawable#display()} of another {@link GLAutoDrawable} 
+ * Issues {@link GLAutoDrawable#display()} of another {@link GLAutoDrawable}
  * from within {@link GLEventListener#display(GLAutoDrawable)}.
  * </p>
- *   
+ *
  * <https://jogamp.org/bugzilla/show_bug.cgi?id=669>
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
@@ -60,26 +60,26 @@ public class TestBug669RecursiveGLContext02NEWT extends UITestCase {
   public void test01_Plain() {
       test01Impl(false);
   }
-  
+
   @Test(timeout=5000)
   public void test01_Anim() {
       test01Impl(true);
   }
-  
-  private void test01Impl(boolean anim) {      
+
+  private void test01Impl(final boolean anim) {
     final String profile = GLProfile.GL2ES2;
     if(!GLProfile.isAvailable(profile)) { System.err.println(profile+" n/a"); return; }
-        
+
     final GLProfile pro = GLProfile.get(profile);
     final GLCapabilities caps = new GLCapabilities(pro);
-    
+
     final GLWindow window2 = GLWindow.create(caps); // display() triggered by window's GLEventListener!
     window2.setPosition(0, 0);
     window2.setSize(200, 200);
     window2.addGLEventListener(new RedSquareES2());
-    
+
     final GLWindow window1 = GLWindow.create(caps);
-    
+
     final Animator animator1 = new Animator();
     final Animator animator2 = new Animator();
     if(anim) {
@@ -112,11 +112,11 @@ public class TestBug669RecursiveGLContext02NEWT extends UITestCase {
         if(anim) {
             try {
                 Thread.sleep(500);
-            } catch(InterruptedException ie) {}
+            } catch(final InterruptedException ie) {}
         }
     } finally {
         animator1.stop();
-        
+
         final int win1Frames = window1.getTotalFPSFrames();
         final int win2Frames = window2.getTotalFPSFrames();
         System.err.println("Window1: frames "+win1Frames);
@@ -126,10 +126,10 @@ public class TestBug669RecursiveGLContext02NEWT extends UITestCase {
         window2.destroy();
     }
   }
-  
-  public static void main(String args[]) {
+
+  public static void main(final String args[]) {
       org.junit.runner.JUnitCore.main(TestBug669RecursiveGLContext02NEWT.class.getName());
   }
-  
+
 }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug692GL3VAONEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug692GL3VAONEWT.java
index 5337b64..0a9ff5a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug692GL3VAONEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestBug692GL3VAONEWT.java
@@ -33,6 +33,8 @@ import java.nio.ShortBuffer;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GL3;
 import javax.media.opengl.GL3bc;
 import javax.media.opengl.GLAutoDrawable;
@@ -83,7 +85,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
         public enum Mode {
             CPU_SRC {
                 @Override
-                void display(GL3VAODemo t, GL3bc gl) {
+                void display(final GL3VAODemo t, final GL3bc gl) {
                     t.displayCPUSourcing(gl);
                 }
             },
@@ -91,7 +93,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
             /** Traditional one without using VAO */
             VBO_ONLY {
                 @Override
-                void display(GL3VAODemo t, GL3bc gl) {
+                void display(final GL3VAODemo t, final GL3bc gl) {
                     t.displayVBOOnly(gl);
                 }
             },
@@ -99,7 +101,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
             /** Using VAOs throws [incorrectly as of JOGL 2.0rc11] a GLException */
             VBO_VAO {
                 @Override
-                void display(GL3VAODemo t, GL3bc gl) {
+                void display(final GL3VAODemo t, final GL3bc gl) {
                     t.displayVBOVAO(gl);
                 }
             };
@@ -111,7 +113,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
         private Mode currentMode;
         private int currentModeIdx;
 
-        public GL3VAODemo(Mode[] modes) {
+        public GL3VAODemo(final Mode[] modes) {
             allModes = modes;
             currentMode = allModes[0];
             currentModeIdx = 0;
@@ -136,11 +138,11 @@ public class TestBug692GL3VAONEWT extends UITestCase {
 
         private int vao  = -1;
 
-        private static int createShader(final GL3 gl, int type,
+        private static int createShader(final GL3 gl, final int type,
                 final String[] srcLines){
-            int shaderID = gl.glCreateShader(type);
+            final int shaderID = gl.glCreateShader(type);
             assert shaderID > 0;
-            int[] lengths  = new int[srcLines.length];
+            final int[] lengths  = new int[srcLines.length];
             for (int i = 0; i < srcLines.length; i++) {
                 lengths[i] = srcLines[i].length();
             }
@@ -149,28 +151,28 @@ public class TestBug692GL3VAONEWT extends UITestCase {
             return shaderID;
         }
 
-        private void initBuffers(GL3 gl) {
+        private void initBuffers(final GL3 gl) {
             // IDs for 2 buffers
-            int[] buffArray = new int[2];
+            final int[] buffArray = new int[2];
             gl.glGenBuffers(buffArray.length, buffArray, 0);
             vbo = buffArray[0];
             assert vbo > 0;
 
             // Bind buffer and upload data
-            gl.glBindBuffer(GL3.GL_ARRAY_BUFFER, vbo);
-            gl.glBufferData(GL3.GL_ARRAY_BUFFER, vertexColorData.length * Buffers.SIZEOF_FLOAT,
-                            vertexColorDataBuffer, GL3.GL_STATIC_DRAW);
-            gl.glBindBuffer(GL3.GL_ARRAY_BUFFER, 0);
+            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo);
+            gl.glBufferData(GL.GL_ARRAY_BUFFER, vertexColorData.length * Buffers.SIZEOF_FLOAT,
+                            vertexColorDataBuffer, GL.GL_STATIC_DRAW);
+            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
 
             // Buffer with the 3 indices required for one triangle
             ibo = buffArray[1];
             assert ibo > 0;
-            gl.glBindBuffer(GL3.GL_ELEMENT_ARRAY_BUFFER, ibo);
-            gl.glBufferData(GL3.GL_ELEMENT_ARRAY_BUFFER,indices.length*Buffers.SIZEOF_SHORT,
-                            indicesBuffer, GL3.GL_STATIC_DRAW);
-            gl.glBindBuffer(GL3.GL_ELEMENT_ARRAY_BUFFER, 0);
+            gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, ibo);
+            gl.glBufferData(GL.GL_ELEMENT_ARRAY_BUFFER,indices.length*Buffers.SIZEOF_SHORT,
+                            indicesBuffer, GL.GL_STATIC_DRAW);
+            gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
         }
-        private void initShaders(GL3 gl) {
+        private void initShaders(final GL3 gl) {
             final String[] vertSrc = new String[]{
                 "#version 150\n",
                 "in vec4 vPosition;\n",
@@ -181,7 +183,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
                 "    gl_Position = vPosition;\n",
                 "}\n"
             };
-            vertID = createShader(gl, GL3.GL_VERTEX_SHADER, vertSrc);
+            vertID = createShader(gl, GL2ES2.GL_VERTEX_SHADER, vertSrc);
 
             final String[] fragSrc = new String[]{
                 "#version 150\n",
@@ -190,7 +192,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
                 "    gl_FragColor = pColor;\n",
                 "}\n"
             };
-            fragID = createShader(gl, GL3.GL_FRAGMENT_SHADER, fragSrc);
+            fragID = createShader(gl, GL2ES2.GL_FRAGMENT_SHADER, fragSrc);
 
             // We're done with the compiler
             gl.glReleaseShaderCompiler();
@@ -203,10 +205,10 @@ public class TestBug692GL3VAONEWT extends UITestCase {
             gl.glValidateProgram(progID);
         }
 
-        private int initVAO(GL3 gl) {
-            int[] buff = new int[1];
+        private int initVAO(final GL3 gl) {
+            final int[] buff = new int[1];
             gl.glGenVertexArrays(1, buff, 0);
-            int vao = buff[0];
+            final int vao = buff[0];
             Assert.assertTrue("Invalid VAO: "+vao, vao > 0);
 
 
@@ -216,29 +218,29 @@ public class TestBug692GL3VAONEWT extends UITestCase {
             gl.glUseProgram(0);
 
             gl.glBindVertexArray(vao);
-            gl.glBindBuffer(GL3.GL_ARRAY_BUFFER, vbo);
-            gl.glBindBuffer(GL3.GL_ELEMENT_ARRAY_BUFFER, ibo);
+            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo);
+            gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, ibo);
 
             gl.glEnableVertexAttribArray(posLoc);
             gl.glEnableVertexAttribArray(colorLoc);
 
             final int stride = 6 * Buffers.SIZEOF_FLOAT;
             final int cOff   = 3 * Buffers.SIZEOF_FLOAT;
-            gl.glVertexAttribPointer(posLoc,  3, GL3.GL_FLOAT, false, stride, 0L);
-            gl.glVertexAttribPointer(colorLoc,3, GL3.GL_FLOAT, false, stride, cOff);
+            gl.glVertexAttribPointer(posLoc,  3, GL.GL_FLOAT, false, stride, 0L);
+            gl.glVertexAttribPointer(colorLoc,3, GL.GL_FLOAT, false, stride, cOff);
 
             gl.glBindVertexArray(0);
             // See class documentation above!
-            gl.glBindBuffer(GL3.GL_ARRAY_BUFFER, 0);
-            gl.glBindBuffer(GL3.GL_ELEMENT_ARRAY_BUFFER, 0);
+            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+            gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
             return vao;
         }
 
         @Override
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
             final GL3 gl = drawable.getGL().getGL3();
-            gl.glEnable(GL3.GL_DEPTH_TEST);
-            gl.glDisable(GL3.GL_CULL_FACE);
+            gl.glEnable(GL.GL_DEPTH_TEST);
+            gl.glDisable(GL.GL_CULL_FACE);
             initBuffers(gl);
             initShaders(gl);
 
@@ -248,7 +250,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
         }
 
         @Override
-        public void dispose(GLAutoDrawable drawable) {
+        public void dispose(final GLAutoDrawable drawable) {
             final GL3 gl = drawable.getGL().getGL3();
             gl.glDeleteBuffers(2, new int[]{vbo, ibo}, 0);
             gl.glDetachShader(progID, fragID);
@@ -266,12 +268,12 @@ public class TestBug692GL3VAONEWT extends UITestCase {
 
             final int stride = 6 * Buffers.SIZEOF_FLOAT;
             // final int cOff   = 3 * Buffers.SIZEOF_FLOAT;
-            gl.glVertexAttribPointer(posLoc,  3, GL3.GL_FLOAT, false, stride, vertexColorDataBuffer);
+            gl.glVertexAttribPointer(posLoc,  3, GL.GL_FLOAT, false, stride, vertexColorDataBuffer);
             vertexColorDataBuffer.position(3); // move to cOff
-            gl.glVertexAttribPointer(colorLoc,3, GL3.GL_FLOAT, false, stride, vertexColorDataBuffer);
+            gl.glVertexAttribPointer(colorLoc,3, GL.GL_FLOAT, false, stride, vertexColorDataBuffer);
             vertexColorDataBuffer.position(0); // rewind cOff
 
-            gl.glDrawElements(GL3.GL_TRIANGLES, 3, GL3.GL_UNSIGNED_SHORT, indicesBuffer);
+            gl.glDrawElements(GL.GL_TRIANGLES, 3, GL.GL_UNSIGNED_SHORT, indicesBuffer);
 
             gl.glDisableVertexAttribArray(posLoc);
             gl.glDisableVertexAttribArray(colorLoc);
@@ -283,36 +285,36 @@ public class TestBug692GL3VAONEWT extends UITestCase {
             gl.glEnableVertexAttribArray(posLoc);
             gl.glEnableVertexAttribArray(colorLoc);
 
-            gl.glBindBuffer(GL3.GL_ARRAY_BUFFER, vbo);
+            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo);
             final int stride = 6 * Buffers.SIZEOF_FLOAT;
             final int cOff   = 3 * Buffers.SIZEOF_FLOAT;
-            gl.glVertexAttribPointer(posLoc,  3, GL3.GL_FLOAT, false, stride, 0L);
-            gl.glVertexAttribPointer(colorLoc,3, GL3.GL_FLOAT, false, stride, cOff);
-            gl.glBindBuffer(GL3.GL_ELEMENT_ARRAY_BUFFER, ibo);
-            gl.glDrawElements(GL3.GL_TRIANGLES, 3, GL3.GL_UNSIGNED_SHORT, 0L);
+            gl.glVertexAttribPointer(posLoc,  3, GL.GL_FLOAT, false, stride, 0L);
+            gl.glVertexAttribPointer(colorLoc,3, GL.GL_FLOAT, false, stride, cOff);
+            gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, ibo);
+            gl.glDrawElements(GL.GL_TRIANGLES, 3, GL.GL_UNSIGNED_SHORT, 0L);
 
             gl.glDisableVertexAttribArray(posLoc);
             gl.glDisableVertexAttribArray(colorLoc);
-            gl.glBindBuffer(GL3.GL_ARRAY_BUFFER, 0);
-            gl.glBindBuffer(GL3.GL_ELEMENT_ARRAY_BUFFER, 0);
+            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+            gl.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
         }
 
         private void displayVBOVAO(final GL3 gl) {
             try {
                 gl.glBindVertexArray(vao);
-                gl.glDrawElements(GL3.GL_TRIANGLES, 3, GL3.GL_UNSIGNED_SHORT, 0L);
+                gl.glDrawElements(GL.GL_TRIANGLES, 3, GL.GL_UNSIGNED_SHORT, 0L);
                 gl.glBindVertexArray(0);
-            } catch (GLException ex) {
+            } catch (final GLException ex) {
                 Logger.getLogger(TestBug692GL3VAONEWT.class.getName()).log(Level.SEVERE,null,ex);
             }
         }
 
         @Override
-        public void display(GLAutoDrawable drawable) {
+        public void display(final GLAutoDrawable drawable) {
             final GL3bc gl = drawable.getGL().getGL3bc();
-            float color = ((float) currentMode.ordinal() + 1) / (Mode.values().length + 2);
+            final float color = ((float) currentMode.ordinal() + 1) / (Mode.values().length + 2);
             gl.glClearColor(color, color, color, 0);
-            gl.glClear(GL3.GL_COLOR_BUFFER_BIT | GL3.GL_DEPTH_BUFFER_BIT);
+            gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
             gl.glUseProgram(progID);
             final Mode newMode;
             {
@@ -328,18 +330,18 @@ public class TestBug692GL3VAONEWT extends UITestCase {
         }
 
         @Override
-        public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h) {
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int w, final int h) {
         }
     }
 
-    private void testImpl(GLProfile profile, GL3VAODemo.Mode[] modes) throws InterruptedException {
+    private void testImpl(final GLProfile profile, final GL3VAODemo.Mode[] modes) throws InterruptedException {
         final GLCapabilities capabilities = new GLCapabilities(profile);
         final GLWindow glWindow = GLWindow.create(capabilities);
         glWindow.setSize(512, 512);
 
-        Animator anim = new Animator(glWindow);
+        final Animator anim = new Animator(glWindow);
 
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
         glWindow.addKeyListener(quitAdapter);
         glWindow.addWindowListener(quitAdapter);
 
@@ -365,7 +367,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
             System.err.println("GL3bc n/a");
             return;
         }
-        GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC };
+        final GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC };
         testImpl(GLProfile.get(GLProfile.GL3bc), modes);
     }
 
@@ -375,7 +377,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
             System.err.println("GL3bc n/a");
             return;
         }
-        GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.VBO_ONLY };
+        final GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.VBO_ONLY };
         testImpl(GLProfile.get(GLProfile.GL3bc), modes);
     }
 
@@ -385,7 +387,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
             System.err.println("GL3bc n/a");
             return;
         }
-        GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.VBO_VAO };
+        final GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.VBO_VAO };
         testImpl(GLProfile.get(GLProfile.GL3bc), modes);
     }
 
@@ -395,7 +397,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
             System.err.println("GL3bc n/a");
             return;
         }
-        GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC, GL3VAODemo.Mode.VBO_ONLY };
+        final GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC, GL3VAODemo.Mode.VBO_ONLY };
         testImpl(GLProfile.get(GLProfile.GL3bc), modes);
     }
 
@@ -405,7 +407,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
             System.err.println("GL3bc n/a");
             return;
         }
-        GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC, GL3VAODemo.Mode.VBO_VAO };
+        final GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC, GL3VAODemo.Mode.VBO_VAO };
         testImpl(GLProfile.get(GLProfile.GL3bc), modes);
     }
 
@@ -415,7 +417,7 @@ public class TestBug692GL3VAONEWT extends UITestCase {
             System.err.println("GL3bc n/a");
             return;
         }
-        GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.VBO_ONLY, GL3VAODemo.Mode.VBO_VAO };
+        final GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.VBO_ONLY, GL3VAODemo.Mode.VBO_VAO };
         testImpl(GLProfile.get(GLProfile.GL3bc), modes);
     }
 
@@ -425,17 +427,17 @@ public class TestBug692GL3VAONEWT extends UITestCase {
             System.err.println("GL3bc n/a");
             return;
         }
-        GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC, GL3VAODemo.Mode.VBO_ONLY, GL3VAODemo.Mode.VBO_VAO };
+        final GL3VAODemo.Mode[] modes = new GL3VAODemo.Mode[] { GL3VAODemo.Mode.CPU_SRC, GL3VAODemo.Mode.VBO_ONLY, GL3VAODemo.Mode.VBO_VAO };
         testImpl(GLProfile.get(GLProfile.GL3bc), modes);
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 duration = MiscUtils.atoi(args[++i], (int)duration);
             }
         }
-        String tstname = TestBug692GL3VAONEWT.class.getName();
+        final String tstname = TestBug692GL3VAONEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestCPUSourcingAPINEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestCPUSourcingAPINEWT.java
index 388c579..fe598db 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestCPUSourcingAPINEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestCPUSourcingAPINEWT.java
@@ -36,6 +36,7 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.util.GLBuffers;
 
+import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAutoDrawable;
@@ -71,11 +72,11 @@ public class TestCPUSourcingAPINEWT extends UITestCase {
         private int fragID = -1;
         private int progID = -1;
 
-        private static int createShader(final GL2ES2 gl, int type,
+        private static int createShader(final GL2ES2 gl, final int type,
                 final String[] srcLines){
-            int shaderID = gl.glCreateShader(type);
+            final int shaderID = gl.glCreateShader(type);
             assert shaderID > 0;
-            int[] lengths  = new int[srcLines.length];
+            final int[] lengths  = new int[srcLines.length];
             for (int i = 0; i < srcLines.length; i++) {
                 lengths[i] = srcLines[i].length();
             }
@@ -84,7 +85,7 @@ public class TestCPUSourcingAPINEWT extends UITestCase {
             return shaderID;
         }
 
-        private void initShaders(GL2ES2 gl) {
+        private void initShaders(final GL2ES2 gl) {
             final String[] vertSrc = new String[]{
                 "#version 150\n",
                 "in vec4 vPosition;\n",
@@ -118,17 +119,17 @@ public class TestCPUSourcingAPINEWT extends UITestCase {
         }
 
         @Override
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
             final GL2ES2 gl = drawable.getGL().getGL2ES2();
-            gl.glEnable(GL2ES2.GL_DEPTH_TEST);
-            gl.glDisable(GL2ES2.GL_CULL_FACE);
+            gl.glEnable(GL.GL_DEPTH_TEST);
+            gl.glDisable(GL.GL_CULL_FACE);
             initShaders(gl);
 
             gl.setSwapInterval(1);
         }
 
         @Override
-        public void dispose(GLAutoDrawable drawable) {
+        public void dispose(final GLAutoDrawable drawable) {
             final GL2ES2 gl = drawable.getGL().getGL2ES2();
             gl.glDetachShader(progID, fragID);
             gl.glDetachShader(progID, vertID);
@@ -145,22 +146,22 @@ public class TestCPUSourcingAPINEWT extends UITestCase {
 
             final int stride = 6 * Buffers.SIZEOF_FLOAT;
             // final int cOff   = 3 * Buffers.SIZEOF_FLOAT;
-            gl.glVertexAttribPointer(posLoc,  3, GL2ES2.GL_FLOAT, false, stride, vertexColorDataBuffer);
+            gl.glVertexAttribPointer(posLoc,  3, GL.GL_FLOAT, false, stride, vertexColorDataBuffer);
             vertexColorDataBuffer.position(3); // move to cOff
-            gl.glVertexAttribPointer(colorLoc,3, GL2ES2.GL_FLOAT, false, stride, vertexColorDataBuffer);
+            gl.glVertexAttribPointer(colorLoc,3, GL.GL_FLOAT, false, stride, vertexColorDataBuffer);
             vertexColorDataBuffer.position(0); // rewind cOff
 
-            gl.glDrawElements(GL2ES2.GL_TRIANGLES, 3, GL2ES2.GL_UNSIGNED_SHORT, indicesBuffer);
+            gl.glDrawElements(GL.GL_TRIANGLES, 3, GL.GL_UNSIGNED_SHORT, indicesBuffer);
 
             gl.glDisableVertexAttribArray(posLoc);
             gl.glDisableVertexAttribArray(colorLoc);
         }
 
         @Override
-        public void display(GLAutoDrawable drawable) {
+        public void display(final GLAutoDrawable drawable) {
             final GL2ES2 gl = drawable.getGL().getGL2ES2();
             gl.glClearColor(0x44, 0x44, 0x44, 0);
-            gl.glClear(GL2ES2.GL_COLOR_BUFFER_BIT | GL2ES2.GL_DEPTH_BUFFER_BIT);
+            gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
             gl.glUseProgram(progID);
 
             // Hard casting is of course invalid!
@@ -171,14 +172,14 @@ public class TestCPUSourcingAPINEWT extends UITestCase {
         }
 
         @Override
-        public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h) {
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int w, final int h) {
         }
     }
 
-    private void testImpl(GLProfile profile) throws InterruptedException {
+    private void testImpl(final GLProfile profile) throws InterruptedException {
         final GLCapabilities capabilities = new GLCapabilities(profile);
-        GLDrawableFactory factory = GLDrawableFactory.getFactory(profile);
-        GLOffscreenAutoDrawable glad = factory.createOffscreenAutoDrawable(null, capabilities, null, 512, 512);
+        final GLDrawableFactory factory = GLDrawableFactory.getFactory(profile);
+        final GLOffscreenAutoDrawable glad = factory.createOffscreenAutoDrawable(null, capabilities, null, 512, 512);
 
         final Demo vaoTest = new Demo();
         glad.addGLEventListener(vaoTest);
@@ -206,14 +207,14 @@ public class TestCPUSourcingAPINEWT extends UITestCase {
         GLException exp = null;
         try {
             testImpl(glp);
-        } catch(GLException gle) {
+        } catch(final GLException gle) {
             exp = gle;
             System.err.println("Expected Exception: "+exp.getMessage());
         }
         Assert.assertNotNull("Excpected GLException missing due to CPU Sourcing w/ GL3 core context", exp);
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableDeadlockAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableDeadlockAWT.java
index 1548c08..2559fe3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableDeadlockAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableDeadlockAWT.java
@@ -60,7 +60,7 @@ public class TestFBOAutoDrawableDeadlockAWT extends UITestCase {
     height = 512;
   }
 
-  protected void runTestGL( GLCapabilities caps ) throws InterruptedException, InvocationTargetException {
+  protected void runTestGL( final GLCapabilities caps ) throws InterruptedException, InvocationTargetException {
     final GLOffscreenAutoDrawable fbod = GLDrawableFactory.getFactory(caps.getGLProfile()).createOffscreenAutoDrawable(
         null, caps, new DefaultGLCapabilitiesChooser(), 512, 512);
 
@@ -88,7 +88,7 @@ public class TestFBOAutoDrawableDeadlockAWT extends UITestCase {
                         System.err.println("BB.2");
                         rTask.getSyncObject().wait();
                         System.err.println("BB.3");
-                    } catch (InterruptedException e) {
+                    } catch (final InterruptedException e) {
                         throw new RuntimeException(e);
                     }
                     System.err.println("BB.X");
@@ -104,20 +104,20 @@ public class TestFBOAutoDrawableDeadlockAWT extends UITestCase {
 
   @Test(timeout = 2000) // 2s timeout
   public void testDeadlock() throws InterruptedException, InvocationTargetException {
-    GLCapabilities caps = new GLCapabilities( glp );
+    final GLCapabilities caps = new GLCapabilities( glp );
     runTestGL( caps );
   }
 
   static long duration = 500; // ms
 
-  public static void main( String args[] ) {
+  public static void main( final String args[] ) {
     for ( int i = 0; i < args.length; i++ ) {
       if ( args[ i ].equals( "-time" ) ) {
         i++;
         try {
           duration = Integer.parseInt( args[ i ] );
         }
-        catch ( Exception ex ) {
+        catch ( final Exception ex ) {
           ex.printStackTrace();
         }
       }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java
index cc06136..6bbe00f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOAutoDrawableFactoryNEWT.java
@@ -28,14 +28,13 @@
 
 package com.jogamp.opengl.test.junit.jogl.acore;
 
-import java.io.IOException;
-
 import javax.media.opengl.GL;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLCapabilitiesImmutable;
 import javax.media.opengl.GLContext;
 import javax.media.opengl.GLDrawableFactory;
 import javax.media.opengl.GLEventListener;
+import javax.media.opengl.GLFBODrawable;
 import javax.media.opengl.GLOffscreenAutoDrawable;
 import javax.media.opengl.GLProfile;
 
@@ -73,66 +72,107 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
     }
 
     @Test
-    public void testGL2ES2_Demo1_SingleBuffer_Normal() throws InterruptedException {
+    public void test01a_GL2ES2_Demo1_SingleBuffer_Normal() throws InterruptedException {
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setDoubleBuffered(false);
+        testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new GearsES2(0));
+    }
+    @Test
+    public void test01b_GL2ES2_Demo1_SingleBuffer_NoTex() throws InterruptedException {
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setDoubleBuffered(false);
+        testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_USE_DEPTH, new GearsES2(0));
+    }
+    @Test
+    public void test01c_GL2ES2_Demo1_SingleBuffer_NoTexNoDepth() throws InterruptedException {
         final GLProfile glp = GLProfile.getGL2ES2();
         final GLCapabilities caps = new GLCapabilities(glp);
         caps.setDoubleBuffered(false);
-        testGLFBODrawableImpl(caps, new GearsES2(0));
+        testGLFBODrawableImpl(caps, 0, new GearsES2(0));
     }
 
     @Test
-    public void testGL2ES2_Demo1_DoubleBuffer_Normal() throws InterruptedException {
+    public void test02a_GL2ES2_Demo1_DoubleBuffer_Normal() throws InterruptedException {
         final GLProfile glp = GLProfile.getGL2ES2();
         final GLCapabilities caps = new GLCapabilities(glp);
         caps.setDoubleBuffered(true); // default
-        testGLFBODrawableImpl(caps, new GearsES2(0));
+        testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new GearsES2(0));
     }
 
     @Test
-    public void testGL2ES2_Demo2MSAA4() throws InterruptedException {
+    public void test03a_GL2ES2_Demo2MSAA4_Normal() throws InterruptedException {
         final GLProfile glp = GLProfile.getGL2ES2();
         final GLCapabilities caps = new GLCapabilities(glp);
         caps.setSampleBuffers(true);
         caps.setNumSamples(4);
-        testGLFBODrawableImpl(caps, new MultisampleDemoES2(true));
+        testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new MultisampleDemoES2(true));
+    }
+    @Test
+    public void test03b_GL2ES2_Demo2MSAA4_NoTex() throws InterruptedException {
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setSampleBuffers(true);
+        caps.setNumSamples(4);
+        testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_USE_DEPTH, new MultisampleDemoES2(true));
+    }
+    @Test
+    public void test03c_GL2ES2_Demo2MSAA4_NoTexNoDepth() throws InterruptedException {
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setSampleBuffers(true);
+        caps.setNumSamples(4);
+        testGLFBODrawableImpl(caps, 0, new MultisampleDemoES2(true));
     }
 
     @Test
-    public void testGL2ES2_FBODemoMSAA4() throws InterruptedException {
+    public void test04_GL2ES2_FBODemoMSAA4_Normal() throws InterruptedException {
         final GLProfile glp = GLProfile.getGL2ES2();
         final FBOMix2DemosES2 demo = new FBOMix2DemosES2(0);
         demo.setDoRotation(false);
         final GLCapabilities caps = new GLCapabilities(glp);
         caps.setSampleBuffers(true);
         caps.setNumSamples(4);
-        testGLFBODrawableImpl(caps, demo);
+        testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, demo);
     }
 
     @Test
-    public void testEGLES2_Demo0Normal() throws InterruptedException {
+    public void test11_EGLES2_Demo0Normal() throws InterruptedException {
         if( GLProfile.isAvailable(GLProfile.GLES2) )  {
             final GLProfile glp = GLProfile.get(GLProfile.GLES2);
             final GLCapabilities caps = new GLCapabilities(glp);
-            testGLFBODrawableImpl(caps, new GearsES2(0));
+            testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new GearsES2(0));
         } else {
             System.err.println("EGL ES2 n/a");
         }
     }
 
     @Test
-    public void testEGLES2_Demo0MSAA4() throws InterruptedException {
+    public void test13_EGLES2_Demo0MSAA4() throws InterruptedException {
         if( GLProfile.isAvailable(GLProfile.GLES2) )  {
             final GLProfile glp = GLProfile.get(GLProfile.GLES2);
             final GLCapabilities caps = new GLCapabilities(glp);
             caps.setSampleBuffers(true);
             caps.setNumSamples(4);
-            testGLFBODrawableImpl(caps, new GearsES2(0));
+            testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new GearsES2(0));
         } else {
             System.err.println("EGL ES2 n/a");
         }
     }
 
-    void testGLFBODrawableImpl(GLCapabilities caps, GLEventListener demo) throws InterruptedException {
+    @Test
+    public void test21_GL3_Demo0Normal() throws InterruptedException {
+        if( GLProfile.isAvailable(GLProfile.GL3) )  {
+            final GLProfile glp = GLProfile.get(GLProfile.GL3);
+            final GLCapabilities caps = new GLCapabilities(glp);
+            testGLFBODrawableImpl(caps, GLFBODrawable.FBOMODE_DEFAULT, new GearsES2(0));
+        } else {
+            System.err.println("GL3 n/a");
+        }
+    }
+
+    void testGLFBODrawableImpl(final GLCapabilities caps, final int fboMode, final GLEventListener demo) throws InterruptedException {
         caps.setFBO(true);
         final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
         final GLOffscreenAutoDrawable.FBO glad = (GLOffscreenAutoDrawable.FBO)
@@ -142,6 +182,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
         System.out.println("Realized GLAD: "+glad);
         System.out.println("Realized GLAD: "+glad.getChosenGLCapabilities());
         Assert.assertTrue("FBO drawable is initialized before ctx creation", !glad.isInitialized());
+        glad.setFBOMode(fboMode);
 
         glad.display(); // initial display incl. init!
         {
@@ -151,6 +192,9 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
         }
         Assert.assertTrue("FBO drawable is not initialized after ctx creation", glad.isInitialized());
 
+        // final boolean useTexture = 0 != ( GLFBODrawable.FBOMODE_USE_TEXTURE & glad.getFBOMode() );
+        final boolean useDepth = 0 != ( GLFBODrawable.FBOMODE_USE_DEPTH & glad.getFBOMode() );
+
         //
         // FBO incl. MSAA is fully initialized now
         //
@@ -170,20 +214,20 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
         Assert.assertTrue("FBO Back  is not initialized before ctx creation", fboBack.isInitialized());
 
         if( chosenCaps.getDoubleBuffered() ) {
-            Assert.assertTrue("FBO are equal: "+fboFront+" == "+fboBack, !fboFront.equals(fboBack));
+            Assert.assertNotEquals("FBO are equal: "+fboFront+" == "+fboBack, fboFront, fboBack);
             Assert.assertNotSame(fboFront, fboBack);
         } else {
-            Assert.assertTrue("FBO are not equal: "+fboFront+" != "+fboBack, fboFront.equals(fboBack));
+            Assert.assertEquals("FBO are not equal: "+fboFront+" != "+fboBack, fboFront, fboBack);
             Assert.assertSame(fboFront, fboBack);
         }
 
-        final FBObject.TextureAttachment texAttachA, texAttachB;
+        final FBObject.Colorbuffer color0, color1;
 
-        texAttachA = glad.getTextureBuffer(GL.GL_FRONT);
+        color0 = glad.getColorbuffer(GL.GL_FRONT);
         if(0==glad.getNumSamples()) {
-            texAttachB = glad.getTextureBuffer(GL.GL_BACK);
+            color1 = glad.getColorbuffer(GL.GL_BACK);
         } else {
-            texAttachB = null;
+            color1 = null;
         }
 
         final FBObject.Colorbuffer colorA, colorB;
@@ -194,19 +238,26 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
         colorB = fboBack.getColorbuffer(0);
         Assert.assertNotNull(colorB);
 
-        depthA = fboFront.getDepthAttachment();
-        Assert.assertNotNull(depthA);
-        depthB = fboBack.getDepthAttachment();
-        Assert.assertNotNull(depthB);
+        if( useDepth ) {
+            depthA = fboFront.getDepthAttachment();
+            Assert.assertNotNull(depthA);
+            depthB = fboBack.getDepthAttachment();
+            Assert.assertNotNull(depthB);
+        } else {
+            depthA = null;
+            depthB = null;
+        }
 
         glad.display(); // SWAP_ODD
 
         if( chosenCaps.getDoubleBuffered() ) {
             // double buffer or MSAA
-            Assert.assertTrue("Color attachments are equal: "+colorB+" == "+colorA, !colorB.equals(colorA));
+            Assert.assertNotEquals("Color attachments are equal: "+colorB+" == "+colorA, colorA, colorB);
             Assert.assertNotSame(colorB, colorA);
-            Assert.assertTrue("Depth attachments are equal: "+depthB+" == "+depthA, !depthB.equals(depthA));
-            Assert.assertNotSame(depthB, depthA);
+            if( useDepth ) {
+                Assert.assertNotEquals("Depth attachments are equal: "+depthB+" == "+depthA, depthA, depthB);
+                Assert.assertNotSame(depthB, depthA);
+            }
         } else {
             // single buffer
             Assert.assertEquals(colorA, colorB);
@@ -215,40 +266,40 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
             Assert.assertSame(depthA, depthB);
         }
 
-        Assert.assertEquals(texAttachA, colorA);
-        Assert.assertSame(texAttachA, colorA);
+        Assert.assertEquals(color0, colorA);
+        Assert.assertSame(color0, colorA);
         if(0==glad.getNumSamples()) {
-            Assert.assertEquals(texAttachB, colorB);
-            Assert.assertSame(texAttachB, colorB);
+            Assert.assertEquals(color1, colorB);
+            Assert.assertSame(color1, colorB);
         }
 
         if( chosenCaps.getNumSamples() > 0 ) {
             // MSAA
-            FBObject _fboFront = glad.getFBObject(GL.GL_FRONT);
-            FBObject _fboBack = glad.getFBObject(GL.GL_BACK);
-            Assert.assertTrue("FBO are not equal: "+fboFront+" != "+_fboFront, fboFront.equals(_fboFront));
+            final FBObject _fboFront = glad.getFBObject(GL.GL_FRONT);
+            final FBObject _fboBack = glad.getFBObject(GL.GL_BACK);
+            Assert.assertEquals("FBO are not equal: "+fboFront+" != "+_fboFront, fboFront, _fboFront);
             Assert.assertSame(fboFront, _fboFront);
-            Assert.assertTrue("FBO are not equal: "+fboBack+" != "+_fboBack, fboBack.equals(_fboBack));
+            Assert.assertEquals("FBO are not equal: "+fboBack+" != "+_fboBack, fboBack, _fboBack);
             Assert.assertSame(fboBack, _fboBack);
         } else if( chosenCaps.getDoubleBuffered() ) {
             // real double buffer
-            FBObject _fboFront = glad.getFBObject(GL.GL_FRONT);
-            FBObject _fboBack = glad.getFBObject(GL.GL_BACK);
-            Assert.assertTrue("FBO are not equal: "+fboBack+" != "+_fboFront, fboBack.equals(_fboFront));
+            final FBObject _fboFront = glad.getFBObject(GL.GL_FRONT);
+            final FBObject _fboBack = glad.getFBObject(GL.GL_BACK);
+            Assert.assertEquals("FBO are not equal: "+fboBack+" != "+_fboFront, fboBack, _fboFront);
             Assert.assertSame(fboBack, _fboFront);
-            Assert.assertTrue("FBO are not equal: "+fboFront+" != "+_fboBack, fboFront.equals(_fboBack));
+            Assert.assertEquals("FBO are not equal: "+fboFront+" != "+_fboBack, fboFront, _fboBack);
             Assert.assertSame(fboFront, _fboBack);
         } else {
             // single buffer
-            FBObject _fboFront = glad.getFBObject(GL.GL_FRONT);
-            FBObject _fboBack = glad.getFBObject(GL.GL_BACK);
-            Assert.assertTrue("FBO are not equal: "+fboFront+" != "+_fboFront, fboFront.equals(_fboFront));
+            final FBObject _fboFront = glad.getFBObject(GL.GL_FRONT);
+            final FBObject _fboBack = glad.getFBObject(GL.GL_BACK);
+            Assert.assertEquals("FBO are not equal: "+fboFront+" != "+_fboFront, fboFront, _fboFront);
             Assert.assertSame(fboFront, _fboFront);
-            Assert.assertTrue("FBO are not equal: "+fboBack+" != "+_fboFront, fboBack.equals(_fboFront));
+            Assert.assertEquals("FBO are not equal: "+fboBack+" != "+_fboFront, fboBack, _fboFront);
             Assert.assertSame(fboBack, _fboFront);
-            Assert.assertTrue("FBO are not equal: "+fboBack+" != "+_fboBack, fboBack.equals(_fboBack));
+            Assert.assertEquals("FBO are not equal: "+fboBack+" != "+_fboBack, fboBack, _fboBack);
             Assert.assertSame(fboBack, _fboBack);
-            Assert.assertTrue("FBO are not equal: "+fboFront+" != "+_fboBack, fboFront.equals(_fboBack));
+            Assert.assertEquals("FBO are not equal: "+fboFront+" != "+_fboBack, fboFront, _fboBack);
             Assert.assertSame(fboFront, _fboBack);
         }
 
@@ -265,8 +316,8 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
 
         // 2, 3 (resize + display)
         szStep = 1;
-        glad.setSize(widthStep*szStep, heightStep*szStep); // SWAP_EVEN
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(),
+        glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); // SWAP_EVEN
+        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
                           AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();  //  - SWAP_ODD
@@ -292,12 +343,16 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
             FBObject.RenderAttachment _depth = _fboFront.getDepthAttachment();
             System.err.println("Resize1.oldDepth "+depthA);
             System.err.println("Resize1.newDepth "+_depth);
-            Assert.assertNotNull(_depth);
+            if( useDepth ) {
+                Assert.assertNotNull(_depth);
+            }
 
             Assert.assertEquals(depthA, _depth);
             Assert.assertSame(depthA, _depth);
             _depth = _fboBack.getDepthAttachment();
-            Assert.assertNotNull(_depth);
+            if( useDepth ) {
+                Assert.assertNotNull(_depth);
+            }
             Assert.assertEquals(depthB, _depth);
             Assert.assertSame(depthB, _depth);
 
@@ -309,8 +364,8 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
 
         // 4, 5 (resize + display)
         szStep = 4;
-        glad.setSize(widthStep*szStep, heightStep*szStep); // SWAP_ODD
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(),
+        glad.setSurfaceSize(widthStep*szStep, heightStep*szStep); // SWAP_ODD
+        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
                           AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display(); //  - SWAP_EVEN
@@ -339,12 +394,16 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
             Assert.assertSame(colorB, _color);
 
             FBObject.RenderAttachment _depth = fboBack.getDepthAttachment();
-            Assert.assertNotNull(_depth); // MSAA back w/ depth
+            if( useDepth ) {
+                Assert.assertNotNull(_depth); // MSAA back w/ depth
+            }
             Assert.assertEquals(depthB, _depth);
             Assert.assertSame(depthB, _depth);
 
             _depth = fboFront.getDepthAttachment();
-            Assert.assertNotNull(_depth);
+            if( useDepth ) {
+                Assert.assertNotNull(_depth);
+            }
             Assert.assertEquals(depthA, _depth);
             Assert.assertSame(depthA, _depth);
 
@@ -355,14 +414,17 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
         }
 
         // 6 + 7 (samples + display)
-        glad.setNumSamples(glad.getGL(), chosenCaps.getNumSamples() > 0 ? 0 : 4); // triggers repaint
+        final int oldSampleCount = chosenCaps.getNumSamples();
+        final int newSampleCount = oldSampleCount > 0 ? 0 : 4;
+        System.out.println("Resize3.sampleCount: "+oldSampleCount+" -> "+newSampleCount);
+        glad.setNumSamples(glad.getGL(), newSampleCount); // triggers repaint
         snapshotGLEventListener.setMakeSnapshot();
         glad.display(); // actual screenshot
 
         // 8, 9 (resize + samples + display)
         szStep = 3;
-        glad.setSize(widthStep*szStep, heightStep*szStep);
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(),
+        glad.setSurfaceSize(widthStep*szStep, heightStep*szStep);
+        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
                           AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
@@ -371,7 +433,7 @@ public class TestFBOAutoDrawableFactoryNEWT extends UITestCase {
         System.out.println("Fin: "+glad);
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws Exception {
         org.junit.runner.JUnitCore.main(TestFBOAutoDrawableFactoryNEWT.class.getName());
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMRTNEWT01.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMRTNEWT01.java
index 7ec8715..ba57c6d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMRTNEWT01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMRTNEWT01.java
@@ -52,6 +52,7 @@ import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLDrawable;
 import javax.media.opengl.GLProfile;
 import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -73,17 +74,17 @@ public class TestFBOMRTNEWT01 extends UITestCase {
             return;
         }
         final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(
-                new GLCapabilities(GLProfile.getGL2GL3()), width/step, height/step, true);        
+                new GLCapabilities(GLProfile.getGL2GL3()), width/step, height/step, true);
         final GLDrawable drawable = winctx.context.getGLDrawable();
-        GL2GL3 gl = winctx.context.getGL().getGL2GL3();
+        final GL2GL3 gl = winctx.context.getGL().getGL2GL3();
         // gl = gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", null, gl, null) ).getGL2GL3();
         System.err.println(winctx.context);
 
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        // test code ..        
+        // test code ..
         final ShaderState st = new ShaderState();
         // st.setVerbose(true);
-        
+
         final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
                 "shader/bin", "fbo-mrt-1", true);
         final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
@@ -93,12 +94,12 @@ public class TestFBOMRTNEWT01 extends UITestCase {
         final ShaderProgram sp0 = new ShaderProgram();
         sp0.add(gl, vp0, System.err);
         sp0.add(gl, fp0, System.err);
-        Assert.assertTrue(0 != sp0.program()); 
+        Assert.assertTrue(0 != sp0.program());
         Assert.assertTrue(!sp0.inUse());
         Assert.assertTrue(!sp0.linked());
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());        
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
         st.attachShaderProgram(gl, sp0, false);
-        
+
         final ShaderCode vp1 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
                 "shader/bin", "fbo-mrt-2", true);
         final ShaderCode fp1 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
@@ -107,20 +108,20 @@ public class TestFBOMRTNEWT01 extends UITestCase {
         fp1.defaultShaderCustomization(gl, true, true);
         final ShaderProgram sp1 = new ShaderProgram();
         sp1.add(gl, vp1, System.err);
-        sp1.add(gl, fp1, System.err);       
-        Assert.assertTrue(0 != sp1.program()); 
+        sp1.add(gl, fp1, System.err);
+        Assert.assertTrue(0 != sp1.program());
         Assert.assertTrue(!sp1.inUse());
         Assert.assertTrue(!sp1.linked());
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());        
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
         st.attachShaderProgram(gl, sp1, true);
-                        
+
         final PMVMatrix pmvMatrix = new PMVMatrix();
         final GLUniformData pmvMatrixUniform = new GLUniformData("gcu_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        st.ownUniform(pmvMatrixUniform);       
+        st.ownUniform(pmvMatrixUniform);
         st.uniform(gl, pmvMatrixUniform);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         final GLArrayDataServer vertices0 = GLArrayDataServer.createGLSL("gca_Vertices", 3, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
         // st.bindAttribLocation(gl, 0, vertices0);
         vertices0.putf(0); vertices0.putf(1);  vertices0.putf(0);
@@ -131,7 +132,7 @@ public class TestFBOMRTNEWT01 extends UITestCase {
         st.ownAttribute(vertices0, true);
         vertices0.enableBuffer(gl, false);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         final GLArrayDataServer colors0 = GLArrayDataServer.createGLSL("gca_Colors", 4, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
         // st.bindAttribLocation(gl, 1, colors0);
         colors0.putf(1); colors0.putf(0);  colors0.putf(1); colors0.putf(1);
@@ -142,20 +143,20 @@ public class TestFBOMRTNEWT01 extends UITestCase {
         st.ownAttribute(colors0, true);
         colors0.enableBuffer(gl, false);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         final GLUniformData texUnit0 = new GLUniformData("gcs_TexUnit0", 0);
-        st.ownUniform(texUnit0);       
+        st.ownUniform(texUnit0);
         st.uniform(gl, texUnit0);
         final GLUniformData texUnit1 = new GLUniformData("gcs_TexUnit1", 1);
-        st.ownUniform(texUnit1);       
+        st.ownUniform(texUnit1);
         st.uniform(gl, texUnit1);
-                
+
         final GLArrayDataServer texCoords0 = GLArrayDataServer.createGLSL("gca_TexCoords", 2, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
         // st.bindAttribLocation(gl, 2, texCoords0);
         texCoords0.putf(0f); texCoords0.putf(1f);
         texCoords0.putf(1f);  texCoords0.putf(1f);
         texCoords0.putf(0f); texCoords0.putf(0f);
-        texCoords0.putf(1f);  texCoords0.putf(0f);        
+        texCoords0.putf(1f);  texCoords0.putf(0f);
         texCoords0.seal(gl, true);
         st.ownAttribute(texCoords0, true);
         texCoords0.enableBuffer(gl, false);
@@ -163,10 +164,10 @@ public class TestFBOMRTNEWT01 extends UITestCase {
 
         final int texA0Point = 0; // attachment point for texA0
         final int texA1Point = 1; // attachment point for texA1
-        
+
         // FBO w/ 2 texture2D color buffers
         final FBObject fbo_mrt = new FBObject();
-        fbo_mrt.reset(gl, drawable.getWidth(), drawable.getHeight());
+        fbo_mrt.reset(gl, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
         final TextureAttachment texA0 = fbo_mrt.attachTexture2D(gl, texA0Point, true, GL.GL_NEAREST, GL.GL_NEAREST, GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE);
         final TextureAttachment texA1;
         if(fbo_mrt.getMaxColorAttachments() > 1) {
@@ -178,44 +179,44 @@ public class TestFBOMRTNEWT01 extends UITestCase {
         fbo_mrt.attachRenderbuffer(gl, Type.DEPTH, 24);
         Assert.assertTrue( fbo_mrt.isStatusValid() ) ;
         fbo_mrt.unbind(gl);
-        
+
         // misc GL setup
         gl.glClearColor(1, 1, 1, 1);
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_DEPTH_TEST);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
 
         // reshape
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glOrthof(0f, 1f, 0f, 1f, -10f, 10f);
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
         st.uniform(gl, pmvMatrixUniform);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         final int[] two_buffers = new int[] { GL.GL_COLOR_ATTACHMENT0+texA0Point, GL.GL_COLOR_ATTACHMENT0+texA1Point };
         final int[] bck_buffers = new int[] { GL2GL3.GL_BACK_LEFT };
-        
+
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
         int step_i = 0;
-        int[] last_snap_size = new int[] { 0, 0 };
-        
+        final int[] last_snap_size = new int[] { 0, 0 };
+
         for(int i=0; i<durationPerTest; i+=50) {
             // pass 1 - MRT: Red -> buffer0, Green -> buffer1
-            st.attachShaderProgram(gl, sp0, true);           
+            st.attachShaderProgram(gl, sp0, true);
             vertices0.enableBuffer(gl, true);
             colors0.enableBuffer(gl, true);
-            
+
             fbo_mrt.bind(gl);
             gl.glDrawBuffers(2, two_buffers, 0);
-            gl.glViewport(0, 0, fbo_mrt.getWidth(), fbo_mrt.getHeight());        
-            
+            gl.glViewport(0, 0, fbo_mrt.getWidth(), fbo_mrt.getHeight());
+
             gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
             gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
             fbo_mrt.unbind(gl);
             vertices0.enableBuffer(gl, false);
             colors0.enableBuffer(gl, false);
-            
+
             // pass 2 - mix buffer0, buffer1 and blue
             // rg = buffer0.rg + buffer1.rg, b = Blue - length(rg);
             st.attachShaderProgram(gl, sp1, true);
@@ -223,10 +224,10 @@ public class TestFBOMRTNEWT01 extends UITestCase {
             colors0.enableBuffer(gl, true);
             texCoords0.enableBuffer(gl, true);
             gl.glDrawBuffers(1, bck_buffers, 0);
-            
-            gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
-            
-            gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit0.intValue());            
+
+            gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
+
+            gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit0.intValue());
             fbo_mrt.use(gl, texA0);
             if(null != texA1) {
                 gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit1.intValue());
@@ -238,43 +239,43 @@ public class TestFBOMRTNEWT01 extends UITestCase {
             vertices0.enableBuffer(gl, false);
             colors0.enableBuffer(gl, false);
             texCoords0.enableBuffer(gl, false);
-            
+
             {
                 final NativeSurface ns = gl.getContext().getGLReadDrawable().getNativeSurface();
-                if(last_snap_size[0] != ns.getWidth() && last_snap_size[1] != ns.getHeight()) {
+                if(last_snap_size[0] != ns.getSurfaceWidth() && last_snap_size[1] != ns.getSurfaceHeight()) {
                     gl.glFinish(); // sync .. no swap buffers yet!
                     snapshot(step_i, null, gl, screenshot, TextureIO.PNG, null); // overwrite ok
-                    last_snap_size[0] = ns.getWidth();
-                    last_snap_size[1] = ns.getHeight();
+                    last_snap_size[0] = ns.getSurfaceWidth();
+                    last_snap_size[1] = ns.getSurfaceHeight();
                 }
             }
-            
+
             drawable.swapBuffers();
             Thread.sleep(50);
-            int j = (int) ( (long)i / (durationPerTest/(long)step) ) + 1;
+            final int j = (int) ( i / (durationPerTest/step) ) + 1;
             if(j>step_i) {
-                int w = width/step * j;
-                int h = height/step * j;
+                final int w = width/step * j;
+                final int h = height/step * j;
                 System.err.println("resize: "+step_i+" -> "+j+" - "+w+"x"+h);
                 fbo_mrt.reset(gl, w, h);
                 winctx.window.setSize(w, h);
                 step_i = j;
             }
         }
-        
+
         NEWTGLContext.destroyWindow(winctx);
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         System.err.println("main - start");
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
             }
         }
-        String tstname = TestFBOMRTNEWT01.class.getName();
+        final String tstname = TestFBOMRTNEWT01.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
         System.err.println("main - end");
-    }    
+    }
 }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMix2DemosES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMix2DemosES2NEWT.java
index 42f7ba6..f8feefd 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMix2DemosES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOMix2DemosES2NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.io.BufferedReader;
@@ -61,7 +61,7 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestFBOMix2DemosES2NEWT extends UITestCase {    
+public class TestFBOMix2DemosES2NEWT extends UITestCase {
     static long duration = 500; // ms
     static int swapInterval = 1;
     static boolean showFPS = false;
@@ -70,19 +70,19 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase {
     static boolean demo0Only = false;
     static int globalNumSamples = 0;
     static boolean mainRun = false;
-    
+
     @AfterClass
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilitiesImmutable caps, int numSamples) throws InterruptedException {
+    protected void runTestGL(final GLCapabilitiesImmutable caps, final int numSamples) throws InterruptedException {
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
         System.err.println("requested: vsync "+swapInterval+", "+caps);
         final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle("Gears NEWT Test (translucent "+!caps.isBackgroundOpaque()+"), swapInterval "+swapInterval);
         if(mainRun) {
-            glWindow.setSize(512, 512);            
+            glWindow.setSize(512, 512);
         } else {
             glWindow.setSize(128, 128);
         }
@@ -95,50 +95,50 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase {
         glWindow.addGLEventListener(new GLEventListener() {
             int i=0, c=0;
             int origS;
-            public void init(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {
                 origS = demo.getMSAA();
             }
-            public void dispose(GLAutoDrawable drawable) {}
-            public void display(GLAutoDrawable drawable) {
+            public void dispose(final GLAutoDrawable drawable) {}
+            public void display(final GLAutoDrawable drawable) {
                 if(mainRun) return;
-                
-                final int dw = drawable.getWidth();
-                final int dh = drawable.getHeight();
+
+                final int dw = drawable.getSurfaceWidth();
+                final int dh = drawable.getSurfaceHeight();
                 c++;
-                
+
                 if(dw<800) {
                     System.err.println("XXX: "+dw+"x"+dh+", c "+c);
                     if(0 == c%3) {
-                        snapshot(i++, "msaa"+demo.getMSAA(), drawable.getGL(), screenshot, TextureIO.PNG, null);                        
+                        snapshot(i++, "msaa"+demo.getMSAA(), drawable.getGL(), screenshot, TextureIO.PNG, null);
                     }
                     if( 3 == c ) {
-                        new Thread() { 
+                        new Thread() {
                             @Override
                             public void run() {
                                 demo.setMSAA(4);
                             } }.start();
                     } else if( 6 == c ) {
-                        new Thread() { 
+                        new Thread() {
                             @Override
                             public void run() {
                                 demo.setMSAA(8);
                             } }.start();
                     } else if(9 == c) {
                         c=0;
-                        new Thread() { 
+                        new Thread() {
                             @Override
                             public void run() {
                                 glWindow.setSize(dw+256, dh+256);
                                 demo.setMSAA(origS);
-                            } }.start();                            
+                            } }.start();
                     }
                 }
             }
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
-        
-        Animator animator = new Animator(glWindow);
-        QuitAdapter quitAdapter = new QuitAdapter();
+
+        final Animator animator = new Animator(glWindow);
+        final QuitAdapter quitAdapter = new QuitAdapter();
 
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -146,35 +146,35 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase {
         glWindow.addWindowListener(quitAdapter);
 
         glWindow.addWindowListener(new WindowAdapter() {
-            public void windowResized(WindowEvent e) {
-                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
+            public void windowResized(final WindowEvent e) {
+                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
+            }
+            public void windowMoved(final WindowEvent e) {
+                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
             }
-            public void windowMoved(WindowEvent e) {
-                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
-            }            
         });
-        
+
         glWindow.addKeyListener(new KeyAdapter() {
-            public void keyReleased(KeyEvent e) {
+            public void keyReleased(final KeyEvent e) {
                 if( !e.isPrintableKey() || e.isAutoRepeat() ) {
                     return;
-                }            
+                }
                 System.err.println("*** "+e);
                 if(e.getKeyChar()=='f') {
                     new Thread() {
                         public void run() {
-                            System.err.println("[set fullscreen  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+                            System.err.println("[set fullscreen  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
                             glWindow.setFullscreen(!glWindow.isFullscreen());
-                            System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+                            System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
                     } }.start();
                 } else if(e.getKeyChar()=='d') {
                     demo.setDemo0Only(!demo.getDemo0Only());
                 } else {
-                    int num = e.getKeyChar() - '0';
+                    final int num = e.getKeyChar() - '0';
                     System.err.println("*** "+num);
                     if(0 <= num && num <= 8) {
                         System.err.println("MSAA: "+demo.getMSAA()+" -> "+num);
-                        demo.setMSAA(num);                        
+                        demo.setMSAA(num);
                     }
                 }
             }
@@ -184,13 +184,13 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase {
         // glWindow.setSkipContextReleaseThread(animator.getThread());
 
         glWindow.setVisible(true);
-        
+
         System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
         System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
-        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
-        
+        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
+
         animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
-        
+
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
             Thread.sleep(100);
         }
@@ -205,25 +205,25 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase {
     @Test
     public void test01_Main() throws InterruptedException {
         if( mainRun ) {
-            GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
+            final GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
             caps.setAlphaBits(1);
-            runTestGL(caps, globalNumSamples);            
+            runTestGL(caps, globalNumSamples);
         }
     }
-    
+
     @Test
     public void test01() throws InterruptedException {
         if( mainRun ) return ;
-        GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
+        final GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
         caps.setAlphaBits(1);
         runTestGL(caps, 0);
     }
 
-    public static void main(String args[]) throws IOException {        
+    public static void main(final String args[]) throws IOException {
         boolean waitForKey = false;
-        
+
         mainRun = true;
-        
+
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
@@ -248,16 +248,16 @@ public class TestFBOMix2DemosES2NEWT extends UITestCase {
                 mainRun = false;
             }
         }
-        
+
         System.err.println("swapInterval "+swapInterval);
         System.err.println("forceES2 "+forceES2);
 
         if(waitForKey) {
-            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+            final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
             System.err.println("Press enter to continue");
             try {
                 System.err.println(stdin.readLine());
-            } catch (IOException e) { }
+            } catch (final IOException e) { }
         }
         org.junit.runner.JUnitCore.main(TestFBOMix2DemosES2NEWT.class.getName());
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java
index 51dd9df..13feb23 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOffThreadSharedContextMix2DemosES2NEWT.java
@@ -107,7 +107,7 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException {
+    protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException {
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(false, false);
         System.err.println("requested: vsync "+swapInterval+", "+caps);
 
@@ -127,27 +127,27 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
         final int fbod2_texUnit = 1;
 
         final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
-        GLCapabilities fbodCaps = (GLCapabilities) caps.cloneMutable();
+        final GLCapabilities fbodCaps = (GLCapabilities) caps.cloneMutable();
         // fbodCaps.setDoubleBuffered(false);
 
         final Mix2TexturesES2 mixerDemo = new Mix2TexturesES2(1, fbod1_texUnit, fbod2_texUnit);
 
         // FBOD1
         final GLOffscreenAutoDrawable.FBO fbod1 = (GLOffscreenAutoDrawable.FBO)
-                factory.createOffscreenAutoDrawable(null, fbodCaps, null, glWindow.getWidth(), glWindow.getHeight());
+                factory.createOffscreenAutoDrawable(null, fbodCaps, null, glWindow.getSurfaceWidth(), glWindow.getSurfaceHeight());
         fbod1.setSharedAutoDrawable(glWindow);
         fbod1.setUpstreamWidget(glWindow); // connect the real GLWindow (mouse/key) to offscreen!
         fbod1.setTextureUnit(fbod1_texUnit);
         {
-            GearsES2 demo0 = new GearsES2(-1);
+            final GearsES2 demo0 = new GearsES2(-1);
             fbod1.addGLEventListener(demo0);
             fbod1.addGLEventListener(new GLFinishOnDisplay());
             demo0.setIgnoreFocus(true);
         }
         fbod1.getNativeSurface().addSurfaceUpdatedListener(new SurfaceUpdatedListener() {
             @Override
-            public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
-                mixerDemo.setTexID0(fbod1.getTextureBuffer(GL.GL_FRONT).getName());
+            public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
+                mixerDemo.setTexID0(fbod1.getColorbuffer(GL.GL_FRONT).getName());
             } });
         fbod1.display(); // init
         System.err.println("FBOD1 "+fbod1);
@@ -155,34 +155,34 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
 
         // FBOD2
         final GLOffscreenAutoDrawable.FBO fbod2 = (GLOffscreenAutoDrawable.FBO)
-                factory.createOffscreenAutoDrawable(null, fbodCaps, null, glWindow.getWidth(), glWindow.getHeight());
+                factory.createOffscreenAutoDrawable(null, fbodCaps, null, glWindow.getSurfaceWidth(), glWindow.getSurfaceHeight());
         fbod2.setSharedAutoDrawable(glWindow);
         fbod2.setTextureUnit(fbod2_texUnit);
         fbod2.addGLEventListener(new RedSquareES2(-1));
         fbod2.addGLEventListener(new GLFinishOnDisplay());
         fbod2.getNativeSurface().addSurfaceUpdatedListener(new SurfaceUpdatedListener() {
             @Override
-            public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
-                mixerDemo.setTexID1(fbod2.getTextureBuffer(GL.GL_FRONT).getName());
+            public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
+                mixerDemo.setTexID1(fbod2.getColorbuffer(GL.GL_FRONT).getName());
             } });
         fbod2.display(); // init
         System.err.println("FBOD2 "+fbod2);
         Assert.assertTrue(fbod2.isInitialized());
 
         // preinit texIDs
-        mixerDemo.setTexID0(fbod1.getTextureBuffer(GL.GL_FRONT).getName());
-        mixerDemo.setTexID1(fbod2.getTextureBuffer(GL.GL_FRONT).getName());
+        mixerDemo.setTexID0(fbod1.getColorbuffer(GL.GL_FRONT).getName());
+        mixerDemo.setTexID1(fbod2.getColorbuffer(GL.GL_FRONT).getName());
 
         glWindow.addGLEventListener(mixerDemo);
         glWindow.addGLEventListener(new GLEventListener() {
             int i=0, c=0;
-            public void init(GLAutoDrawable drawable) {}
-            public void dispose(GLAutoDrawable drawable) {}
-            public void display(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {}
+            public void dispose(final GLAutoDrawable drawable) {}
+            public void display(final GLAutoDrawable drawable) {
                 if(mainRun) return;
 
-                final int dw = drawable.getWidth();
-                final int dh = drawable.getHeight();
+                final int dw = drawable.getSurfaceWidth();
+                final int dh = drawable.getSurfaceHeight();
                 c++;
 
                 if(dw<800) {
@@ -200,9 +200,9 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
                     }
                 }
             }
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-                fbod1.setSize(width, height);
-                fbod2.setSize(width, height);
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+                fbod1.setSurfaceSize(width, height);
+                fbod2.setSurfaceSize(width, height);
             }
         });
 
@@ -213,7 +213,7 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
         final Animator animator1 = new Animator();
         animator1.add(glWindow);
 
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
 
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -221,11 +221,11 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
         glWindow.addWindowListener(quitAdapter);
 
         glWindow.addWindowListener(new WindowAdapter() {
-            public void windowResized(WindowEvent e) {
-                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
+            public void windowResized(final WindowEvent e) {
+                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
             }
-            public void windowMoved(WindowEvent e) {
-                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
+            public void windowMoved(final WindowEvent e) {
+                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
             }
         });
 
@@ -237,7 +237,7 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
 
         System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
         System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
-        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
+        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
 
         animator0.setUpdateFPSFrames(30, showFPS ? System.err : null);
         animator1.setUpdateFPSFrames(60, showFPS ? System.err : null);
@@ -263,12 +263,12 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
 
     @Test
     public void test01() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
+        final GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
         caps.setAlphaBits(1);
         runTestGL(caps);
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         boolean waitForKey = false;
 
         mainRun = true;
@@ -295,11 +295,11 @@ public class TestFBOOffThreadSharedContextMix2DemosES2NEWT extends UITestCase {
         System.err.println("forceES2 "+forceES2);
 
         if(waitForKey) {
-            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+            final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
             System.err.println("Press enter to continue");
             try {
                 System.err.println(stdin.readLine());
-            } catch (IOException e) { }
+            } catch (final IOException e) { }
         }
         org.junit.runner.JUnitCore.main(TestFBOOffThreadSharedContextMix2DemosES2NEWT.class.getName());
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java
index 3c6c61f..4ed762a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestFBOOnThreadSharedContext1DemoES2NEWT.java
@@ -105,7 +105,7 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException {
+    protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException {
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(false, false);
         System.err.println("requested: vsync "+swapInterval+", "+caps);
 
@@ -124,51 +124,51 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase {
         final int fbod1_texUnit = 0;
 
         final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
-        GLCapabilities fbodCaps = (GLCapabilities) caps.cloneMutable();
+        final GLCapabilities fbodCaps = (GLCapabilities) caps.cloneMutable();
         // fbodCaps.setDoubleBuffered(false);
 
         final Mix2TexturesES2 mixerDemo = new Mix2TexturesES2(1, fbod1_texUnit, 0);
 
         // FBOD1
         final GLOffscreenAutoDrawable.FBO fbod1 = (GLOffscreenAutoDrawable.FBO)
-                factory.createOffscreenAutoDrawable(null, fbodCaps, null, glWindow.getWidth(), glWindow.getHeight());
+                factory.createOffscreenAutoDrawable(null, fbodCaps, null, glWindow.getSurfaceWidth(), glWindow.getSurfaceHeight());
         fbod1.setSharedAutoDrawable(glWindow);
         fbod1.setUpstreamWidget(glWindow); // connect the real GLWindow (mouse/key) to offscreen!
         fbod1.setTextureUnit(fbod1_texUnit);
         {
-            GearsES2 demo0 = new GearsES2(-1);
+            final GearsES2 demo0 = new GearsES2(-1);
             fbod1.addGLEventListener(demo0);
             fbod1.addGLEventListener(new GLFinishOnDisplay());
             demo0.setIgnoreFocus(true);
         }
         fbod1.getNativeSurface().addSurfaceUpdatedListener(new SurfaceUpdatedListener() {
             @Override
-            public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
-                mixerDemo.setTexID0(fbod1.getTextureBuffer(GL.GL_FRONT).getName());
+            public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
+                mixerDemo.setTexID0(fbod1.getColorbuffer(GL.GL_FRONT).getName());
             } });
         fbod1.display(); // init
         System.err.println("FBOD1 "+fbod1);
         Assert.assertTrue(fbod1.isInitialized());
 
         // preinit texIDs
-        mixerDemo.setTexID0(fbod1.getTextureBuffer(GL.GL_FRONT).getName());
+        mixerDemo.setTexID0(fbod1.getColorbuffer(GL.GL_FRONT).getName());
 
         glWindow.addWindowListener(new WindowAdapter() {
             @Override
-            public void windowResized(WindowEvent e) {
-                fbod1.setSize(glWindow.getWidth(), glWindow.getHeight());
+            public void windowResized(final WindowEvent e) {
+                fbod1.setSurfaceSize(glWindow.getSurfaceWidth(), glWindow.getSurfaceHeight());
             }
         });
         glWindow.addGLEventListener(mixerDemo);
         glWindow.addGLEventListener(new GLEventListener() {
             int i=0, c=0;
-            public void init(GLAutoDrawable drawable) {}
-            public void dispose(GLAutoDrawable drawable) {}
-            public void display(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {}
+            public void dispose(final GLAutoDrawable drawable) {}
+            public void display(final GLAutoDrawable drawable) {
                 if(mainRun) return;
 
-                final int dw = drawable.getWidth();
-                final int dh = drawable.getHeight();
+                final int dw = drawable.getSurfaceWidth();
+                final int dh = drawable.getSurfaceHeight();
                 c++;
 
                 if(dw<800) {
@@ -186,14 +186,14 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase {
                     }
                 }
             }
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
 
         final Animator animator1 = new Animator();
         animator1.add(fbod1);
         animator1.add(glWindow);
 
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
 
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -201,11 +201,11 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase {
         glWindow.addWindowListener(quitAdapter);
 
         glWindow.addWindowListener(new WindowAdapter() {
-            public void windowResized(WindowEvent e) {
-                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
+            public void windowResized(final WindowEvent e) {
+                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
             }
-            public void windowMoved(WindowEvent e) {
-                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
+            public void windowMoved(final WindowEvent e) {
+                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
             }
         });
 
@@ -216,7 +216,7 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase {
 
         System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
         System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
-        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
+        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
 
         animator1.setUpdateFPSFrames(60, showFPS ? System.err : null);
 
@@ -236,12 +236,12 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase {
 
     @Test
     public void test01() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
+        final GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES2());
         caps.setAlphaBits(1);
         runTestGL(caps);
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         boolean waitForKey = false;
 
         mainRun = true;
@@ -268,11 +268,11 @@ public class TestFBOOnThreadSharedContext1DemoES2NEWT extends UITestCase {
         System.err.println("forceES2 "+forceES2);
 
         if(waitForKey) {
-            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+            final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
             System.err.println("Press enter to continue");
             try {
                 System.err.println(stdin.readLine());
-            } catch (IOException e) { }
+            } catch (final IOException e) { }
         }
         org.junit.runner.JUnitCore.main(TestFBOOnThreadSharedContext1DemoES2NEWT.class.getName());
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateNEWT.java
index 91bae16..85f9d9e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateNEWT.java
@@ -55,6 +55,7 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
 
 /**
  * Test using a NEWT {@link Window} for onscreen case.
@@ -72,7 +73,7 @@ import com.jogamp.opengl.util.Animator;
 public class TestGLAutoDrawableDelegateNEWT extends UITestCase {
     static long duration = 500; // ms
 
-    void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+    void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
         final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
 
         //
@@ -105,27 +106,27 @@ public class TestGLAutoDrawableDelegateNEWT extends UITestCase {
 
         window.addWindowListener(new WindowAdapter() {
                 @Override
-                public void windowRepaint(WindowUpdateEvent e) {
+                public void windowRepaint(final WindowUpdateEvent e) {
                     glad.windowRepaintOp();
                 }
 
                 @Override
-                public void windowResized(WindowEvent e) {
-                    glad.windowResizedOp(window.getWidth(), window.getHeight());
+                public void windowResized(final WindowEvent e) {
+                    glad.windowResizedOp(window.getSurfaceWidth(), window.getSurfaceHeight());
                 }
             });
 
         glad.addGLEventListener(demo);
 
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
         window.addKeyListener(quitAdapter);
         window.addWindowListener(quitAdapter);
 
-        Animator animator = new Animator();
+        final Animator animator = new Animator();
         animator.setUpdateFPSFrames(60, System.err);
-        animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+        animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
         animator.add(glad);
         animator.start();
         Assert.assertTrue(animator.isStarted());
@@ -150,7 +151,7 @@ public class TestGLAutoDrawableDelegateNEWT extends UITestCase {
         doTest(reqGLCaps, new GearsES2(1));
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java
index 3d49a0d..94bff72 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.io.IOException;
@@ -61,14 +61,14 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 /**
  * Tests using a NEWT {@link Window} for on- and offscreen cases.
  * <p>
- * Each test creates a {@link GLDrawable} using the 
+ * Each test creates a {@link GLDrawable} using the
  * {@link GLDrawableFactory#createGLDrawable(javax.media.nativewindow.NativeSurface) factory model}.
  * The {@link GLContext} is derived {@link GLDrawable#createContext(GLContext) from the drawable}.
  * </p>
  * <p>
  * Finally a {@link GLAutoDrawableDelegate} is created with the just created {@link GLDrawable} and {@link GLContext}.
- * It is being used to run the {@link GLEventListener}.  
- * </p> 
+ * It is being used to run the {@link GLEventListener}.
+ * </p>
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
@@ -76,22 +76,22 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
     static final int heightStep = 600/4;
     volatile int szStep = 2;
 
-    static GLCapabilities getCaps(String profile) {
+    static GLCapabilities getCaps(final String profile) {
         if( !GLProfile.isAvailable(profile) )  {
             System.err.println("Profile "+profile+" n/a");
             return null;
         }
         return new GLCapabilities(GLProfile.get(profile));
     }
-    
-    void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+
+    void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
         System.out.println("Requested  GL Caps: "+reqGLCaps);
         final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
         final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
         System.out.println("Expected   GL Caps: "+expGLCaps);
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
+        //
         final Window window = NewtFactory.createWindow(reqGLCaps);
         Assert.assertNotNull(window);
         window.setSize(widthStep*szStep, heightStep*szStep);
@@ -99,7 +99,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         Assert.assertTrue(AWTRobotUtil.waitForVisible(window, true));
         Assert.assertTrue(AWTRobotUtil.waitForRealized(window, true));
         System.out.println("Window: "+window.getClass().getName());
-        
+
         // Check caps of NativeWindow config w/o GL
         final CapabilitiesImmutable chosenCaps = window.getGraphicsConfiguration().getChosenCapabilities();
         System.out.println("Window Caps Pre_GL: "+chosenCaps);
@@ -109,13 +109,13 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         Assert.assertTrue(chosenCaps.getRedBits()>5);
 
         //
-        // Create native OpenGL resources .. XGL/WGL/CGL .. 
+        // Create native OpenGL resources .. XGL/WGL/CGL ..
         // equivalent to GLAutoDrawable methods: setVisible(true)
-        //         
+        //
         final GLDrawable drawable = factory.createGLDrawable(window);
         Assert.assertNotNull(drawable);
         System.out.println("Drawable    Pre-GL(0): "+drawable.getClass().getName()+", "+drawable.getNativeSurface().getClass().getName());
-        
+
         //
         drawable.setRealized(true);
         Assert.assertTrue(drawable.isRealized());
@@ -123,13 +123,13 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         System.out.println("Window Caps PostGL   : "+window.getGraphicsConfiguration().getChosenCapabilities());
         System.out.println("Drawable   Post-GL(1): "+drawable.getClass().getName()+", "+drawable.getNativeSurface().getClass().getName());
 
-        // Note: FBO Drawable realization happens at 1st context.makeCurrent(), 
+        // Note: FBO Drawable realization happens at 1st context.makeCurrent(),
         //       and hence only then it's caps can _fully_ reflect expectations,
         //       i.e. depth, stencil and MSAA will be valid only after makeCurrent(),
         //       where on-/offscreen state after setRealized(true)
         //       See GLFBODrawable API doc in this regard!
-        
-        
+
+
         final GLCapabilitiesImmutable chosenGLCaps01 = drawable.getChosenGLCapabilities();
         System.out.println("Chosen     GL Caps(1): "+chosenGLCaps01);
         Assert.assertNotNull(chosenGLCaps01);
@@ -137,13 +137,13 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         Assert.assertEquals(expGLCaps.isFBO(), chosenGLCaps01.isFBO());
         Assert.assertEquals(expGLCaps.isPBuffer(), chosenGLCaps01.isPBuffer());
         Assert.assertEquals(expGLCaps.isBitmap(), chosenGLCaps01.isBitmap());
-        
+
         final GLContext context = drawable.createContext(null);
         Assert.assertNotNull(context);
-        int res = context.makeCurrent();
+        final int res = context.makeCurrent();
         Assert.assertTrue(GLContext.CONTEXT_CURRENT_NEW==res || GLContext.CONTEXT_CURRENT==res);
         context.release();
-        
+
         // Check caps of GLDrawable after realization
         final GLCapabilitiesImmutable chosenGLCaps02 = drawable.getChosenGLCapabilities();
         System.out.println("Chosen     GL Caps(2): "+chosenGLCaps02);
@@ -158,12 +158,12 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         Assert.assertEquals(expGLCaps.isFBO(), chosenGLCaps02.isFBO());
         Assert.assertEquals(expGLCaps.isPBuffer(), chosenGLCaps02.isPBuffer());
         Assert.assertEquals(expGLCaps.isBitmap(), chosenGLCaps02.isBitmap());
-        /** Single/Double buffer cannot be checked since result may vary .. 
+        /** Single/Double buffer cannot be checked since result may vary ..
         if(chosenGLCaps.isOnscreen() || chosenGLCaps.isFBO()) {
             // dbl buffer may be disabled w/ offscreen pbuffer and bitmap
             Assert.assertEquals(expGLCaps.getDoubleBuffered(), chosenGLCaps.getDoubleBuffered());
         } */
-        
+
         final GLAutoDrawableDelegate glad = new GLAutoDrawableDelegate(drawable, context, window, false, null) {
                 @Override
                 protected void destroyImplInLock() {
@@ -171,57 +171,64 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
                     window.destroy(); // destroys the actual window, incl. the device
                 }
             };
-        
+
         window.setWindowDestroyNotifyAction( new Runnable() {
             public void run() {
                 glad.windowDestroyNotifyOp();
             } } );
-                
+
         window.addWindowListener(new WindowAdapter() {
                 @Override
-                public void windowRepaint(WindowUpdateEvent e) {
+                public void windowRepaint(final WindowUpdateEvent e) {
                     glad.windowRepaintOp();
                 }
 
                 @Override
-                public void windowResized(WindowEvent e) {
-                    glad.windowResizedOp(window.getWidth(), window.getHeight());
+                public void windowResized(final WindowEvent e) {
+                    glad.windowResizedOp(window.getSurfaceWidth(), window.getSurfaceHeight());
                 }
             });
 
         glad.addGLEventListener(demo);
-        
+
         final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
         glad.addGLEventListener(snapshotGLEventListener);
-        
+
         glad.display(); // initial resize/display
-        
+
         // 1 - szStep = 2
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), 
-                          AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
+        final int[] expSurfaceSize = glad.getNativeSurface().convertToPixelUnits(new int[] { widthStep*szStep, heightStep*szStep });
+        Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
+                          AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1]));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
-        
+
         // 2, 3 (resize + display)
         szStep = 1;
         window.setSize(widthStep*szStep, heightStep*szStep);
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), 
-                          AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
+        expSurfaceSize[0] = widthStep*szStep;
+        expSurfaceSize[1] = heightStep*szStep;
+        glad.getNativeSurface().convertToPixelUnits(expSurfaceSize);
+        Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
+                          AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1]));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
-                
+
         // 4, 5 (resize + display)
         szStep = 4;
         window.setSize(widthStep*szStep, heightStep*szStep);
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), 
-                          AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
+        expSurfaceSize[0] = widthStep*szStep;
+        expSurfaceSize[1] = heightStep*szStep;
+        glad.getNativeSurface().convertToPixelUnits(expSurfaceSize);
+        Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
+                          AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1]));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
-        
+
         Thread.sleep(50);
-        
+
         glad.destroy();
-        System.out.println("Fin Drawable: "+drawable);        
+        System.out.println("Fin Drawable: "+drawable);
         System.out.println("Fin Window: "+window);
     }
 
@@ -236,7 +243,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
             System.err.println(JoglVersion.getDefaultOpenGLInfo(f.getDefaultDevice(), null, true).toString());
         }
     }
-    
+
     @Test
     public void testGL2OnScreenSglBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -244,14 +251,14 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setDoubleBuffered(false);
         doTest(reqGLCaps, new GearsES2(1));
     }
-  
+
     @Test
     public void testGL2OnScreenDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
         if(null == reqGLCaps) return;
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenAutoDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -269,7 +276,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setDoubleBuffered(false);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenFBODblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -278,7 +285,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setFBO(true);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenPbufferDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -287,7 +294,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setPBuffer(true);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenPbufferSglBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -297,7 +304,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setDoubleBuffered(false);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenBitmapSglBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -307,7 +314,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setDoubleBuffered(false);
         doTest(reqGLCaps, new Gears(1));
     }
-    
+
     @Test
     public void testES2OnScreenSglBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -315,14 +322,14 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setDoubleBuffered(false);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OnScreenDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
         if(null == reqGLCaps) return;
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OffScreenAutoDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -340,7 +347,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setDoubleBuffered(false);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OffScreenFBODblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -349,7 +356,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setFBO(true);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OffScreenPbufferDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -358,7 +365,7 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setPBuffer(true);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OffScreenPbufferSglBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -368,20 +375,20 @@ public class TestGLAutoDrawableDelegateOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setDoubleBuffered(false);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     /** Not implemented !
     @Test
     public void testES2OffScreenBitmapDblBuf() throws InterruptedException {
         if(!checkProfile(GLProfile.GLES2)) {
             return;
         }
-        final GLCapabilities reqGLCaps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));        
+        final GLCapabilities reqGLCaps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
         reqGLCaps.setOnscreen(false);
         reqGLCaps.setBitmap(true);
         doTest(reqGLCaps, new GearsES2(1));
     } */
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         org.junit.runner.JUnitCore.main(TestGLAutoDrawableDelegateOnOffscrnCapsNEWT.class.getName());
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java
index a5799a6..5c90e80 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.java
@@ -64,7 +64,7 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase {
     static final int heightStep = 600/4;
     volatile int szStep = 2;
 
-    static GLCapabilities getCaps(String profile) {
+    static GLCapabilities getCaps(final String profile) {
         if( !GLProfile.isAvailable(profile) )  {
             System.err.println("Profile "+profile+" n/a");
             return null;
@@ -72,7 +72,7 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase {
         return new GLCapabilities(GLProfile.get(profile));
     }
 
-    void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+    void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
         System.out.println("Requested  GL Caps: "+reqGLCaps);
         final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
         final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
@@ -127,23 +127,23 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase {
         glad.display(); // initial resize/display
 
         // 1 - szStep = 2
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(),
+        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
                           AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
 
         // 2, 3 (resize + display)
         szStep = 1;
-        glad.setSize(widthStep*szStep, heightStep*szStep);
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(),
+        glad.setSurfaceSize(widthStep*szStep, heightStep*szStep);
+        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
                           AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
 
         // 4, 5 (resize + display)
         szStep = 4;
-        glad.setSize(widthStep*szStep, heightStep*szStep);
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(),
+        glad.setSurfaceSize(widthStep*szStep, heightStep*szStep);
+        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
                           AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
@@ -338,7 +338,7 @@ public class TestGLAutoDrawableFactoryES2OffscrnCapsNEWT extends UITestCase {
         doTest(reqGLCaps, new GearsES2(1));
     }  */
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         org.junit.runner.JUnitCore.main(TestGLAutoDrawableFactoryES2OffscrnCapsNEWT.class.getName());
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java
index 09e2113..a5a340b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.java
@@ -64,7 +64,7 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase {
     static final int heightStep = 600/4;
     volatile int szStep = 2;
 
-    static GLCapabilities getCaps(String profile) {
+    static GLCapabilities getCaps(final String profile) {
         if( !GLProfile.isAvailable(profile) )  {
             System.err.println("Profile "+profile+" n/a");
             return null;
@@ -72,7 +72,7 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase {
         return new GLCapabilities(GLProfile.get(profile));
     }
 
-    void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+    void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
         System.out.println("Requested  GL Caps: "+reqGLCaps);
         final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
         final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
@@ -127,23 +127,23 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase {
         glad.display(); // initial resize/display
 
         // 1 - szStep = 2
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(),
+        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
                           AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
 
         // 2, 3 (resize + display)
         szStep = 1;
-        glad.setSize(widthStep*szStep, heightStep*szStep);
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(),
+        glad.setSurfaceSize(widthStep*szStep, heightStep*szStep);
+        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
                           AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
 
         // 4, 5 (resize + display)
         szStep = 4;
-        glad.setSize(widthStep*szStep, heightStep*szStep);
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(),
+        glad.setSurfaceSize(widthStep*szStep, heightStep*szStep);
+        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
                           AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
@@ -377,7 +377,7 @@ public class TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT extends UITestCase {
         doTest(reqGLCaps, new Gears(1));
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         org.junit.runner.JUnitCore.main(TestGLAutoDrawableFactoryGL2OffscrnCapsNEWT.class.getName());
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java
index f35f8c8..51c7c07 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.java
@@ -64,7 +64,7 @@ public class TestGLAutoDrawableFactoryGLnBitmapCapsNEWT extends UITestCase {
     static final int heightStep = 600/4;
     volatile int szStep = 2;
 
-    void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+    void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
         System.out.println("Requested  GL Caps: "+reqGLCaps);
         final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
         final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
@@ -119,23 +119,23 @@ public class TestGLAutoDrawableFactoryGLnBitmapCapsNEWT extends UITestCase {
         glad.display(); // initial resize/display
 
         // 1 - szStep = 2
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(),
+        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
                           AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
 
         // 2, 3 (resize + display)
         szStep = 1;
-        glad.setSize(widthStep*szStep, heightStep*szStep);
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(),
+        glad.setSurfaceSize(widthStep*szStep, heightStep*szStep);
+        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
                           AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
 
         // 4, 5 (resize + display)
         szStep = 4;
-        glad.setSize(widthStep*szStep, heightStep*szStep);
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(),
+        glad.setSurfaceSize(widthStep*szStep, heightStep*szStep);
+        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
                           AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
@@ -178,7 +178,7 @@ public class TestGLAutoDrawableFactoryGLnBitmapCapsNEWT extends UITestCase {
         doTest(reqGLCaps, new Gears(1));
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         org.junit.runner.JUnitCore.main(TestGLAutoDrawableFactoryGLnBitmapCapsNEWT.class.getName());
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java
index ab64b5d..8f8bb8f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.awt.Dimension;
@@ -67,14 +67,14 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
     static boolean waitForKey = false;
     volatile int szStep = 2;
 
-    static GLCapabilities getCaps(String profile) {
+    static GLCapabilities getCaps(final String profile) {
         if( !GLProfile.isAvailable(profile) )  {
             System.err.println("Profile "+profile+" n/a");
             return null;
         }
         return new GLCapabilities(GLProfile.get(profile));
     }
-    
+
     static void setGLCanvasSize(final Frame frame, final GLCanvas glc, final int width, final int height) {
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -86,17 +86,17 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
                     frame.pack();
                     frame.validate();
                 } } );
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }       
+        }
     }
-    
+
     static interface MyGLEventListener extends GLEventListener {
         void setMakeSnapshot();
     }
-    
-    void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+
+    void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
         if(reqGLCaps.isOnscreen() && JAWTUtil.isOffscreenLayerRequired()) {
             System.err.println("onscreen layer n/a");
             return;
@@ -114,29 +114,29 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
         //
         final GLCanvas glad = new GLCanvas(reqGLCaps); // will implicit trigger offscreen layer - if !onscreen && supported
         Assert.assertNotNull(glad);
-        Dimension glc_sz = new Dimension(widthStep*szStep, heightStep*szStep);
+        final Dimension glc_sz = new Dimension(widthStep*szStep, heightStep*szStep);
         glad.setMinimumSize(glc_sz);
         glad.setPreferredSize(glc_sz);
         glad.setSize(glc_sz);
         final Frame frame = new Frame(getSimpleTestName("."));
         Assert.assertNotNull(frame);
-        frame.add(glad);        
-        
+        frame.add(glad);
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame.pack();
                     frame.setVisible(true);
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
-        
+
         Assert.assertTrue(AWTRobotUtil.waitForVisible(glad, true));
         Assert.assertTrue(AWTRobotUtil.waitForRealized(glad, true));
         System.out.println("Window: "+glad.getClass().getName());
-        
+
         // Check caps of NativeWindow config w/o GL
         final CapabilitiesImmutable chosenCaps = glad.getChosenGLCapabilities();
         System.out.println("Window Caps Pre_GL: "+chosenCaps);
@@ -146,20 +146,20 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
         Assert.assertTrue(chosenCaps.getRedBits()>5);
 
         glad.display(); // force native context creation
-        
+
         //
-        // Create native OpenGL resources .. XGL/WGL/CGL .. 
+        // Create native OpenGL resources .. XGL/WGL/CGL ..
         // equivalent to GLAutoDrawable methods: setVisible(true)
-        //         
+        //
         {
             final GLDrawable actualDrawable = glad.getDelegatedDrawable();
             Assert.assertNotNull(actualDrawable);
             System.out.println("Drawable    Pre-GL(0): "+actualDrawable.getClass().getName()+", "+actualDrawable.getNativeSurface().getClass().getName());
         }
-        
+
         System.out.println("Window Caps PostGL   : "+glad.getChosenGLCapabilities());
         System.out.println("Drawable   Post-GL(1): "+glad.getClass().getName()+", "+glad.getNativeSurface().getClass().getName());
-        
+
         // Check caps of GLDrawable after realization
         final GLCapabilitiesImmutable chosenGLCaps = glad.getChosenGLCapabilities();
         System.out.println("Chosen     GL Caps(1): "+chosenGLCaps);
@@ -172,55 +172,62 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
         Assert.assertEquals(expGLCaps.isFBO(), chosenGLCaps.isFBO());
         Assert.assertEquals(expGLCaps.isPBuffer(), chosenGLCaps.isPBuffer());
         Assert.assertEquals(expGLCaps.isBitmap(), chosenGLCaps.isBitmap());
-        /** Single/Double buffer cannot be checked since result may vary .. 
+        /** Single/Double buffer cannot be checked since result may vary ..
         if(chosenGLCaps.isOnscreen() || chosenGLCaps.isFBO()) {
             // dbl buffer may be disabled w/ offscreen pbuffer and bitmap
             Assert.assertEquals(expGLCaps.getDoubleBuffered(), chosenGLCaps.getDoubleBuffered());
         } */
 
         {
-            GLContext context = glad.getContext();
+            final GLContext context = glad.getContext();
             System.out.println("Chosen     GL CTX (2): "+context.getGLVersion());
             Assert.assertNotNull(context);
             Assert.assertTrue(context.isCreated());
         }
-        
+
         System.out.println("Chosen     GL Caps(2): "+glad.getChosenGLCapabilities());
         System.out.println("Drawable   Post-GL(2): "+glad.getClass().getName()+", "+glad.getNativeSurface().getClass().getName());
-        
+
         glad.addGLEventListener(demo);
-        
+
         final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
         glad.addGLEventListener(snapshotGLEventListener);
-        
+
         glad.display(); // initial resize/display
-        
+
         // 1 - szStep = 2
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), 
-                          AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
+        final int[] expSurfaceSize = glad.getNativeSurface().convertToPixelUnits(new int[] { widthStep*szStep, heightStep*szStep });
+        Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
+                          AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1]));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
-        
+
         // 2, 3 (resize + display)
         szStep = 1;
         setGLCanvasSize(frame, glad, widthStep*szStep, heightStep*szStep);
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), 
-                          AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
+        expSurfaceSize[0] = widthStep*szStep;
+        expSurfaceSize[1] = heightStep*szStep;
+        glad.getNativeSurface().convertToPixelUnits(expSurfaceSize);
+        Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
+                          AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1]));
         glad.display();
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
-                
+
         // 4, 5 (resize + display)
         szStep = 4;
         setGLCanvasSize(frame, glad, widthStep*szStep, heightStep*szStep);
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), 
-                          AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
+        expSurfaceSize[0] = widthStep*szStep;
+        expSurfaceSize[1] = heightStep*szStep;
+        glad.getNativeSurface().convertToPixelUnits(expSurfaceSize);
+        Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
+                          AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1]));
         glad.display();
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
-        
+
         Thread.sleep(50);
-        
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
@@ -228,10 +235,10 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
                     frame.remove(glad);
                     frame.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }        
+        }
         System.out.println("Fin: "+glad);
     }
 
@@ -246,14 +253,14 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
             System.err.println(JoglVersion.getDefaultOpenGLInfo(f.getDefaultDevice(), null, true).toString());
         }
     }
-    
+
     @Test
     public void testGL2OnScreenDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
         if(null == reqGLCaps) return;
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OnScreenDblBufStencil() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -261,7 +268,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
         reqGLCaps.setStencilBits(1);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OnScreenDblBufMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -270,7 +277,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
         reqGLCaps.setNumSamples(4);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OnScreenDblBufStencilMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -280,7 +287,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
         reqGLCaps.setNumSamples(4);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenAutoDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -298,7 +305,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
         reqGLCaps.setStencilBits(1);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenFBODblBufMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -309,7 +316,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
         reqGLCaps.setNumSamples(4);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenFBODblBufStencilMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -321,7 +328,7 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
         reqGLCaps.setNumSamples(4);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenPbuffer() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -330,8 +337,8 @@ public class TestGLAutoDrawableGLCanvasOnOffscrnCapsAWT extends UITestCase {
         reqGLCaps.setPBuffer(true);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-wait")) {
                 waitForKey = true;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java
index 9332b0f..2e29340 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.io.IOException;
@@ -57,8 +57,8 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 /**
  * Tests using a NEWT {@link GLWindow} {@link GLAutoDrawable auto drawable} for on- and offscreen cases.
  * <p>
- * The NEWT  {@link GLAutoDrawable} is being used to run the {@link GLEventListener}.  
- * </p> 
+ * The NEWT  {@link GLAutoDrawable} is being used to run the {@link GLEventListener}.
+ * </p>
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
@@ -69,23 +69,23 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
     static interface MyGLEventListener extends GLEventListener {
         void setMakeSnapshot();
     }
-    
-    static GLCapabilities getCaps(String profile) {
+
+    static GLCapabilities getCaps(final String profile) {
         if( !GLProfile.isAvailable(profile) )  {
             System.err.println("Profile "+profile+" n/a");
             return null;
         }
         return new GLCapabilities(GLProfile.get(profile));
     }
-    
-    void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+
+    void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
         System.out.println("Requested  GL Caps: "+reqGLCaps);
         final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
         final GLCapabilitiesImmutable expGLCaps = GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, null);
         System.out.println("Expected   GL Caps: "+expGLCaps);
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
+        //
         final GLWindow glad = GLWindow.create(reqGLCaps);
         Assert.assertNotNull(glad);
         glad.setSize(widthStep*szStep, heightStep*szStep);
@@ -93,7 +93,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         Assert.assertTrue(AWTRobotUtil.waitForVisible(glad, true));
         Assert.assertTrue(AWTRobotUtil.waitForRealized(glad, true));
         System.out.println("Window: "+glad.getClass().getName());
-        
+
         // Check caps of NativeWindow config w/o GL
         final CapabilitiesImmutable chosenCaps = glad.getGraphicsConfiguration().getChosenCapabilities();
         System.out.println("Window Caps Pre_GL: "+chosenCaps);
@@ -103,18 +103,18 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         Assert.assertTrue(chosenCaps.getRedBits()>5);
 
         //
-        // Create native OpenGL resources .. XGL/WGL/CGL .. 
+        // Create native OpenGL resources .. XGL/WGL/CGL ..
         // equivalent to GLAutoDrawable methods: setVisible(true)
-        //         
+        //
         {
             final GLDrawable actualDrawable = glad.getDelegatedDrawable();
             Assert.assertNotNull(actualDrawable);
             System.out.println("Drawable    Pre-GL(0): "+actualDrawable.getClass().getName()+", "+actualDrawable.getNativeSurface().getClass().getName());
         }
-        
+
         System.out.println("Window Caps PostGL   : "+glad.getGraphicsConfiguration().getChosenCapabilities());
         System.out.println("Drawable   Post-GL(1): "+glad.getClass().getName()+", "+glad.getNativeSurface().getClass().getName());
-        
+
         // Check caps of GLDrawable after realization
         final GLCapabilitiesImmutable chosenGLCaps = glad.getChosenGLCapabilities();
         System.out.println("Chosen     GL Caps(1): "+chosenGLCaps);
@@ -127,7 +127,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         Assert.assertEquals(expGLCaps.isFBO(), chosenGLCaps.isFBO());
         Assert.assertEquals(expGLCaps.isPBuffer(), chosenGLCaps.isPBuffer());
         Assert.assertEquals(expGLCaps.isBitmap(), chosenGLCaps.isBitmap());
-        /** Single/Double buffer cannot be checked since result may vary .. 
+        /** Single/Double buffer cannot be checked since result may vary ..
         if(chosenGLCaps.isOnscreen() || chosenGLCaps.isFBO()) {
             // dbl buffer may be disabled w/ offscreen pbuffer and bitmap
             Assert.assertEquals(expGLCaps.getDoubleBuffered(), chosenGLCaps.getDoubleBuffered());
@@ -135,46 +135,53 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
 
         glad.display();
         {
-            GLContext context = glad.getContext();
+            final GLContext context = glad.getContext();
             System.out.println("Chosen     GL CTX (2): "+context.getGLVersion());
             Assert.assertNotNull(context);
             Assert.assertTrue(context.isCreated());
         }
-        
+
         System.out.println("Chosen     GL Caps(2): "+glad.getChosenGLCapabilities());
         System.out.println("Drawable   Post-GL(2): "+glad.getClass().getName()+", "+glad.getNativeSurface().getClass().getName());
-        
+
         glad.addGLEventListener(demo);
-        
+
         final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
         glad.addGLEventListener(snapshotGLEventListener);
-        
+
         glad.display(); // initial resize/display
-        
+
         // 1 - szStep = 2
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), 
-                          AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
+        final int[] expSurfaceSize = glad.getNativeSurface().convertToPixelUnits(new int[] { widthStep*szStep, heightStep*szStep });
+        Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
+                          AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1]));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
-        
+
         // 2, 3 (resize + display)
         szStep = 1;
         glad.setSize(widthStep*szStep, heightStep*szStep);
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), 
-                          AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
+        expSurfaceSize[0] = widthStep*szStep;
+        expSurfaceSize[1] = heightStep*szStep;
+        glad.getNativeSurface().convertToPixelUnits(expSurfaceSize);
+        Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
+                          AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1]));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
-                
+
         // 4, 5 (resize + display)
         szStep = 4;
         glad.setSize(widthStep*szStep, heightStep*szStep);
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), 
-                          AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
+        expSurfaceSize[0] = widthStep*szStep;
+        expSurfaceSize[1] = heightStep*szStep;
+        glad.getNativeSurface().convertToPixelUnits(expSurfaceSize);
+        Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
+                          AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1]));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
-        
+
         Thread.sleep(50);
-        
+
         glad.destroy();
         System.out.println("Fin: "+glad);
     }
@@ -190,7 +197,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
             System.err.println(JoglVersion.getDefaultOpenGLInfo(f.getDefaultDevice(), null, true).toString());
         }
     }
-    
+
     @Test
     public void testGL2OnScreenSglBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -198,14 +205,14 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setDoubleBuffered(false);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OnScreenDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
         if(null == reqGLCaps) return;
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OnScreenDblBufStencil() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -213,7 +220,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setStencilBits(1);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OnScreenDblBufMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -222,7 +229,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setNumSamples(4);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OnScreenDblBufStencilMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -232,7 +239,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setNumSamples(4);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenAutoDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -250,7 +257,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setDoubleBuffered(false);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenFBODblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -259,7 +266,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setFBO(true);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenFBODblBufStencil() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -269,7 +276,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setStencilBits(1);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenFBODblBufMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -280,7 +287,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setNumSamples(4);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenFBODblBufStencilMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -292,7 +299,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setNumSamples(4);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenPbufferDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -301,7 +308,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setPBuffer(true);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenPbufferSglBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -311,7 +318,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setDoubleBuffered(false);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenBitmapSglBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -321,7 +328,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setDoubleBuffered(false);
         doTest(reqGLCaps, new Gears(1));
     }
-    
+
     @Test
     public void testES2OnScreenSglBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -329,14 +336,14 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setDoubleBuffered(false);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OnScreenDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
         if(null == reqGLCaps) return;
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OnScreenDblBufStencil() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -344,7 +351,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setStencilBits(1);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OnScreenDblBufMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -353,7 +360,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setNumSamples(4);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OnScreenDblBufStencilMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -363,7 +370,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setNumSamples(4);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OffScreenAutoDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -381,7 +388,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setDoubleBuffered(false);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OffScreenFBODblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -390,7 +397,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setFBO(true);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OffScreenFBODblBufStencil() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -400,7 +407,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setStencilBits(1);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OffScreenFBODblBufMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -411,7 +418,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setNumSamples(4);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OffScreenFBODblBufStencilMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -423,7 +430,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setNumSamples(4);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OffScreenPbufferDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -432,7 +439,7 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setPBuffer(true);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testES2OffScreenPbufferSglBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
@@ -442,20 +449,20 @@ public class TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT extends UITestCase {
         reqGLCaps.setDoubleBuffered(false);
         doTest(reqGLCaps, new GearsES2(1));
     }
-    
+
     /** Not implemented !
     @Test
     public void testES2OffScreenBitmapDblBuf() throws InterruptedException {
         if(!checkProfile(GLProfile.GLES2)) {
             return;
         }
-        final GLCapabilities reqGLCaps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));        
+        final GLCapabilities reqGLCaps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
         reqGLCaps.setOnscreen(false);
         reqGLCaps.setBitmap(true);
         doTest(reqGLCaps, new GearsES2(1));
     } */
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         org.junit.runner.JUnitCore.main(TestGLAutoDrawableGLWindowOnOffscrnCapsNEWT.class.getName());
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java
index ae5dc61..b95fa0c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.awt.Component;
@@ -63,8 +63,8 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 /**
  * Tests using a NEWT {@link GLWindow} {@link GLAutoDrawable auto drawable} for on- and offscreen cases.
  * <p>
- * The NEWT  {@link GLAutoDrawable} is being used to run the {@link GLEventListener}.  
- * </p> 
+ * The NEWT  {@link GLAutoDrawable} is being used to run the {@link GLEventListener}.
+ * </p>
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase {
@@ -72,14 +72,14 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
     static final int heightStep = 600/4;
     volatile int szStep = 2;
 
-    static GLCapabilities getCaps(String profile) {
+    static GLCapabilities getCaps(final String profile) {
         if( !GLProfile.isAvailable(profile) )  {
             System.err.println("Profile "+profile+" n/a");
             return null;
         }
         return new GLCapabilities(GLProfile.get(profile));
     }
-    
+
     static void setComponentSize(final Frame frame, final Component comp, final int width, final int height) {
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -91,17 +91,17 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
                     frame.pack();
                     frame.validate();
                 } } );
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }       
+        }
     }
-    
+
     static interface MyGLEventListener extends GLEventListener {
         void setMakeSnapshot();
     }
-    
-    void doTest(boolean offscreenLayer, GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+
+    void doTest(final boolean offscreenLayer, final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
         if(!offscreenLayer && JAWTUtil.isOffscreenLayerRequired()) {
             System.err.println("onscreen layer n/a");
             return;
@@ -112,43 +112,43 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
         }
         System.out.println("Requested  GL Caps: "+reqGLCaps);
         final GLDrawableFactory factory = GLDrawableFactory.getFactory(reqGLCaps.getGLProfile());
-        final AbstractGraphicsDevice device = factory.getDefaultDevice();        
+        final AbstractGraphicsDevice device = factory.getDefaultDevice();
         final GLCapabilitiesImmutable expGLCaps = offscreenLayer ?
                             GLGraphicsConfigurationUtil.fixOffscreenGLCapabilities(reqGLCaps, factory, device) :
                             GLGraphicsConfigurationUtil.fixGLCapabilities(reqGLCaps, factory, device);
         System.out.println("Expected   GL Caps: "+expGLCaps);
-        
+
         final GLWindow glad = GLWindow.create(reqGLCaps);
         Assert.assertNotNull(glad);
 
-        
+
         final NewtCanvasAWT nca = new NewtCanvasAWT(glad);
         Assert.assertNotNull(nca);
-        Dimension size0 = new Dimension(widthStep*szStep, heightStep*szStep);
+        final Dimension size0 = new Dimension(widthStep*szStep, heightStep*szStep);
         nca.setShallUseOffscreenLayer(offscreenLayer); // trigger offscreen layer - if supported
         nca.setPreferredSize(size0);
         nca.setMinimumSize(size0);
         nca.setSize(size0);
-        
+
         final Frame frame = new Frame(getSimpleTestName("."));
         Assert.assertNotNull(frame);
-        frame.add(nca);        
-        
+        frame.add(nca);
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame.pack();
                     frame.setVisible(true);
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
-        
+
         Assert.assertTrue(AWTRobotUtil.waitForVisible(glad, true));
         Assert.assertTrue(AWTRobotUtil.waitForRealized(glad, true));
         System.out.println("Window: "+glad.getClass().getName());
-        
+
         // Check caps of NativeWindow config w/o GL
         final CapabilitiesImmutable chosenCaps = glad.getChosenGLCapabilities();
         System.out.println("Window Caps Pre_GL: "+chosenCaps);
@@ -158,20 +158,20 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
         Assert.assertTrue(chosenCaps.getRedBits()>5);
 
         glad.display(); // force native context creation
-        
+
         //
-        // Create native OpenGL resources .. XGL/WGL/CGL .. 
+        // Create native OpenGL resources .. XGL/WGL/CGL ..
         // equivalent to GLAutoDrawable methods: setVisible(true)
-        //         
+        //
         {
             final GLDrawable actualDrawable = glad.getDelegatedDrawable();
             Assert.assertNotNull(actualDrawable);
             System.out.println("Drawable    Pre-GL(0): "+actualDrawable.getClass().getName()+", "+actualDrawable.getNativeSurface().getClass().getName());
         }
-        
+
         System.out.println("Window Caps PostGL   : "+glad.getChosenGLCapabilities());
         System.out.println("Drawable   Post-GL(1): "+glad.getClass().getName()+", "+glad.getNativeSurface().getClass().getName());
-        
+
         // Check caps of GLDrawable after realization
         final GLCapabilitiesImmutable chosenGLCaps = glad.getChosenGLCapabilities();
         System.out.println("Chosen     GL Caps(1): "+chosenGLCaps);
@@ -184,55 +184,62 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
         Assert.assertEquals(expGLCaps.isFBO(), chosenGLCaps.isFBO());
         Assert.assertEquals(expGLCaps.isPBuffer(), chosenGLCaps.isPBuffer());
         Assert.assertEquals(expGLCaps.isBitmap(), chosenGLCaps.isBitmap());
-        /** Single/Double buffer cannot be checked since result may vary .. 
+        /** Single/Double buffer cannot be checked since result may vary ..
         if(chosenGLCaps.isOnscreen() || chosenGLCaps.isFBO()) {
             // dbl buffer may be disabled w/ offscreen pbuffer and bitmap
             Assert.assertEquals(expGLCaps.getDoubleBuffered(), chosenGLCaps.getDoubleBuffered());
         } */
 
         {
-            GLContext context = glad.getContext();
+            final GLContext context = glad.getContext();
             System.out.println("Chosen     GL CTX (2): "+context.getGLVersion());
             Assert.assertNotNull(context);
             Assert.assertTrue(context.isCreated());
         }
-        
+
         System.out.println("Chosen     GL Caps(2): "+glad.getChosenGLCapabilities());
         System.out.println("Drawable   Post-GL(2): "+glad.getClass().getName()+", "+glad.getNativeSurface().getClass().getName());
-        
+
         glad.addGLEventListener(demo);
-        
+
         final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
         glad.addGLEventListener(snapshotGLEventListener);
-        
+
         glad.display(); // initial resize/display
-        
+
         // 1 - szStep = 2
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), 
-                          AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
+        final int[] expSurfaceSize = glad.getNativeSurface().convertToPixelUnits(new int[] { widthStep*szStep, heightStep*szStep });
+        Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
+                          AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1]));
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
-        
+
         // 2, 3 (resize + display)
         szStep = 1;
         setComponentSize(frame, nca, widthStep*szStep, heightStep*szStep);
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), 
-                          AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
+        expSurfaceSize[0] = widthStep*szStep;
+        expSurfaceSize[1] = heightStep*szStep;
+        glad.getNativeSurface().convertToPixelUnits(expSurfaceSize);
+        Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
+                          AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1]));
         glad.display();
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
-                
+
         // 4, 5 (resize + display)
         szStep = 4;
         setComponentSize(frame, nca, widthStep*szStep, heightStep*szStep);
-        Assert.assertTrue("Size not reached: Expected "+(widthStep*szStep)+"x"+(heightStep*szStep)+", Is "+glad.getWidth()+"x"+glad.getHeight(), 
-                          AWTRobotUtil.waitForSize(glad, widthStep*szStep, heightStep*szStep));
+        expSurfaceSize[0] = widthStep*szStep;
+        expSurfaceSize[1] = heightStep*szStep;
+        glad.getNativeSurface().convertToPixelUnits(expSurfaceSize);
+        Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glad.getSurfaceWidth()+"x"+glad.getSurfaceHeight(),
+                          AWTRobotUtil.waitForSize(glad, expSurfaceSize[0], expSurfaceSize[1]));
         glad.display();
         snapshotGLEventListener.setMakeSnapshot();
         glad.display();
-        
+
         Thread.sleep(50);
-        
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
@@ -240,10 +247,10 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
                     frame.remove(nca);
                     frame.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }        
+        }
         glad.destroy();
         System.out.println("Fin: "+nca);
         System.out.println("Fin: "+glad);
@@ -260,14 +267,14 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
             System.err.println(JoglVersion.getDefaultOpenGLInfo(f.getDefaultDevice(), null, true).toString());
         }
     }
-    
+
     @Test
     public void testGL2OnScreenDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
         if(null == reqGLCaps) return;
         doTest(false, reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OnScreenDblBufStencil() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -275,7 +282,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
         reqGLCaps.setStencilBits(1);
         doTest(false, reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OnScreenDblBufMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -284,7 +291,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
         reqGLCaps.setNumSamples(4);
         doTest(false, reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OnScreenDblBufStencilMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -294,7 +301,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
         reqGLCaps.setNumSamples(4);
         doTest(false, reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenLayerAutoDblBuf() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -311,7 +318,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
         reqGLCaps.setStencilBits(1);
         doTest(true, reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenFBODblBufMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -322,7 +329,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
         reqGLCaps.setNumSamples(4);
         doTest(true, reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenFBODblBufStencilMSAA() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -334,7 +341,7 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
         reqGLCaps.setNumSamples(4);
         doTest(true, reqGLCaps, new GearsES2(1));
     }
-    
+
     @Test
     public void testGL2OffScreenPbuffer() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2);
@@ -343,8 +350,8 @@ public class TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT extends UITestCase
         reqGLCaps.setOnscreen(true); // get native NEWT Window, not OffscreenWindow
         doTest(true, reqGLCaps, new GearsES2(1));
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         org.junit.runner.JUnitCore.main(TestGLAutoDrawableNewtCanvasAWTOnOffscrnCapsAWT.class.getName());
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLContextSurfaceLockNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLContextSurfaceLockNEWT.java
index c64bb38..b647073 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLContextSurfaceLockNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLContextSurfaceLockNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,15 +20,16 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.io.IOException;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.media.nativewindow.NativeSurface;
 import javax.media.opengl.GLAutoDrawable;
@@ -47,37 +48,37 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestGLContextSurfaceLockNEWT extends UITestCase {
     static final int demoSize = 64;
-    
+
     public abstract class MyRunnable implements Runnable {
         final Object postSync;
         final int id;
         boolean done = false;
-        
-        public MyRunnable(Object postSync, int id) {
+
+        public MyRunnable(final Object postSync, final int id) {
             this.postSync = postSync;
             this.id = id;
         }
-        
+
         public boolean done() { return done; }
     }
-    
+
     public class RudeAnimator extends MyRunnable {
         private final GLAutoDrawable glad;
         private final int frameCount;
-        
-        public RudeAnimator(GLAutoDrawable glad, int frameCount, Object postSync, int id) {
+
+        public RudeAnimator(final GLAutoDrawable glad, final int frameCount, final Object postSync, final int id) {
             super(postSync, id);
             this.glad = glad;
             this.frameCount = frameCount;
         }
-        
+
         public void run() {
             System.err.println("Animatr "+id+", count "+frameCount+": PRE: "+Thread.currentThread().getName());
-            
+
             for(int c=0; c<frameCount; c++) {
                 glad.display();
             }
-            
+
             System.err.println("Animatr "+id+": DONE/SYNC: "+Thread.currentThread().getName());
             synchronized (postSync) {
                 done = true;
@@ -94,26 +95,26 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
     public class RudeResizer extends MyRunnable {
         private final GLWindow win;
         private final int actionCount;
-        
-        public RudeResizer(GLWindow win, int actionCount, Object postSync, int id) {
+
+        public RudeResizer(final GLWindow win, final int actionCount, final Object postSync, final int id) {
             super(postSync, id);
             this.win = win;
             this.actionCount = actionCount;
         }
-        
+
         public void run() {
             System.err.println("Resizer "+id+", count "+actionCount+": PRE: "+Thread.currentThread().getName());
-            
+
             for(int c=0; c<actionCount; c++) {
                 win.runOnEDTIfAvail(true, new Runnable() {
                     public void run() {
                         // Normal resize, may trigger immediate display within lock
-                        win.setSize(win.getWidth()+1, win.getHeight()+1);
+                        win.setSize(win.getSurfaceWidth()+1, win.getSurfaceHeight()+1);
 
                         // Force display within surface lock.
-                        // This procedure emulates the sensitive behavior 
+                        // This procedure emulates the sensitive behavior
                         // for all platforms directly.
-                        int res = win.lockSurface();
+                        final int res = win.lockSurface();
                         if(res > NativeSurface.LOCK_SURFACE_NOT_READY) {
                             try {
                                 win.display();
@@ -123,7 +124,7 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
                         }
                     }});
             }
-            
+
             System.err.println("Resizer "+id+": DONE/SYNC: "+Thread.currentThread().getName());
             synchronized (postSync) {
                 done = true;
@@ -132,8 +133,8 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
             }
         }
     }
-    
-    protected static boolean done(MyRunnable[] tasks) {
+
+    protected static boolean done(final MyRunnable[] tasks) {
         for(int i=tasks.length-1; i>=0; i--) {
             if(!tasks[i].done()) {
                 return false;
@@ -141,8 +142,8 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
         }
         return true;
     }
-    
-    protected static boolean isDead(Thread[] threads) {
+
+    protected static boolean isDead(final Thread[] threads) {
         for(int i=threads.length-1; i>=0; i--) {
             if(threads[i].isAlive()) {
                 return false;
@@ -150,52 +151,52 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
         }
         return true;
     }
-    
-    protected class MyEventCounter implements GLEventListener {
-        volatile int reshapeCount = 0;
-        volatile int displayCount = 0;
-        
+
+    protected static class MyEventCounter implements GLEventListener {
+        AtomicInteger reshapeCount = new AtomicInteger(0);
+        AtomicInteger displayCount = new AtomicInteger(0);
+
         @Override
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
         }
 
         @Override
-        public void dispose(GLAutoDrawable drawable) {
+        public void dispose(final GLAutoDrawable drawable) {
             System.err.println("*** reshapes: "+reshapeCount+", displays "+displayCount);
         }
 
         @Override
-        public void display(GLAutoDrawable drawable) {
-            displayCount++;
+        public void display(final GLAutoDrawable drawable) {
+            displayCount.incrementAndGet();
         }
 
         @Override
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-            reshapeCount++;
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+            reshapeCount.incrementAndGet();
         }
-        
+
         public void reset() {
-            reshapeCount = 0;
-            displayCount = 0;            
+            reshapeCount.set(0);
+            displayCount.set(0);
         }
     }
-    
-    protected void runJOGLTasks(int animThreadCount, int frameCount, int reszThreadCount, int resizeCount) throws InterruptedException {
+
+    protected void runJOGLTasks(final int animThreadCount, final int frameCount, final int reszThreadCount, final int resizeCount) throws InterruptedException {
         final GLWindow glWindow = GLWindow.create(new GLCapabilities(GLProfile.getDefault()));
         final MyEventCounter myEventCounter = new MyEventCounter();
-        
+
         glWindow.addGLEventListener(new GearsES2(0));
         glWindow.addGLEventListener(myEventCounter);
         glWindow.setSize(demoSize, demoSize);
         glWindow.setVisible(true);
-        
+
         final String currentThreadName = Thread.currentThread().getName();
         final Object sync = new Object();
         final MyRunnable[] animTasks = new MyRunnable[animThreadCount];
         final MyRunnable[] resizeTasks = new MyRunnable[animThreadCount];
         final Thread[] animThreads = new Thread[reszThreadCount];
         final Thread[] resizeThreads = new Thread[reszThreadCount];
-        
+
         System.err.println("animThreadCount "+animThreadCount+", frameCount "+frameCount);
         System.err.println("reszThreadCount "+reszThreadCount+", resizeCount "+resizeCount);
         System.err.println("tasks "+(animTasks.length+resizeTasks.length)+", threads "+(animThreads.length+resizeThreads.length));
@@ -212,7 +213,7 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
         }
 
         myEventCounter.reset();
-        
+
         int j=0, k=0;
         for(int i=0; i<reszThreadCount+animThreadCount; i++) {
             if(0==i%2) {
@@ -227,7 +228,7 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
             while(!done(resizeTasks) || !done(animTasks)) {
                 try {
                     sync.wait();
-                } catch (InterruptedException e) {
+                } catch (final InterruptedException e) {
                     throw new RuntimeException(e);
                 }
             }
@@ -237,30 +238,30 @@ public class TestGLContextSurfaceLockNEWT extends UITestCase {
             Thread.sleep(100);
             i++;
         }
-        
+
         glWindow.destroy();
     }
-    
+
     @Test
     public void test01_1A1RThreads_100Resizes() throws InterruptedException {
         runJOGLTasks(1, 200, 1, 100);
     }
-    
+
     @Test
     public void test01_3A3RThreads_50Resizes() throws InterruptedException {
         runJOGLTasks(3, 100, 3, 50);
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     // duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
-        String tstname = TestGLContextSurfaceLockNEWT.class.getName();
+        final String tstname = TestGLContextSurfaceLockNEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java
index f0950fb..50beb8a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug00NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,17 +20,18 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.io.IOException;
 
 import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLContext;
@@ -53,56 +54,56 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestGLDebug00NEWT extends UITestCase {
-    
+
     static String dbgTstMsg0 = "Hello World";
     static int dbgTstId0 = 42;
-    
-    public class WindowContext {        
+
+    public static class WindowContext {
         public final Window window;
         public final GLContext context;
-        
-        public WindowContext(Window w, GLContext c) {
+
+        public WindowContext(final Window w, final GLContext c) {
             window = w;
             context = c;
         }
-    }       
-    
-    WindowContext createWindow(GLProfile glp, boolean debugGL) {        
-        GLCapabilities caps = new GLCapabilities(glp);
+    }
+
+    WindowContext createWindow(final GLProfile glp, final boolean debugGL) {
+        final GLCapabilities caps = new GLCapabilities(glp);
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
-        Display display = NewtFactory.createDisplay(null); // local display
+        //
+        final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
 
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
 
-        Window window = NewtFactory.createWindow(screen, caps);
+        final Window window = NewtFactory.createWindow(screen, caps);
         Assert.assertNotNull(window);
         window.setSize(128, 128);
         window.setVisible(true);
 
-        GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
-        GLDrawable drawable = factory.createGLDrawable(window);
+        final GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
+        final GLDrawable drawable = factory.createGLDrawable(window);
         Assert.assertNotNull(drawable);
-        
+
         drawable.setRealized(true);
-        
-        GLContext context = drawable.createContext(null);
+
+        final GLContext context = drawable.createContext(null);
         Assert.assertNotNull(context);
-        
+
         context.enableGLDebugMessage(debugGL);
-        
-        int res = context.makeCurrent();
+
+        final int res = context.makeCurrent();
         Assert.assertTrue(GLContext.CONTEXT_CURRENT_NEW==res || GLContext.CONTEXT_CURRENT==res);
-        
+
         return new WindowContext(window, context);
     }
 
-    void destroyWindow(WindowContext winctx) {
-        GLDrawable drawable = winctx.context.getGLDrawable();
-        
+    void destroyWindow(final WindowContext winctx) {
+        final GLDrawable drawable = winctx.context.getGLDrawable();
+
         Assert.assertNotNull(winctx.context);
         winctx.context.destroy();
 
@@ -113,19 +114,19 @@ public class TestGLDebug00NEWT extends UITestCase {
         winctx.window.destroy();
     }
 
-    
-    void test01GLDebug01EnableDisable(boolean enable) throws InterruptedException {
-        GLProfile glp = GLProfile.getDefault();
-        
-        WindowContext winctx = createWindow(glp, enable);
-        String glDebugExt = winctx.context.getGLDebugMessageExtension();
+
+    void test01GLDebug01EnableDisable(final boolean enable) throws InterruptedException {
+        final GLProfile glp = GLProfile.getDefault();
+
+        final WindowContext winctx = createWindow(glp, enable);
+        final String glDebugExt = winctx.context.getGLDebugMessageExtension();
         System.err.println("glDebug extension: "+glDebugExt);
         System.err.println("glDebug enabled: "+winctx.context.isGLDebugMessageEnabled());
         System.err.println("glDebug sync: "+winctx.context.isGLDebugSynchronous());
-        System.err.println("context version: "+winctx.context.getGLVersion());        
-        
+        System.err.println("context version: "+winctx.context.getGLVersion());
+
         Assert.assertEquals((null == glDebugExt) ? false : enable, winctx.context.isGLDebugMessageEnabled());
-        
+
         destroyWindow(winctx);
     }
 
@@ -138,95 +139,95 @@ public class TestGLDebug00NEWT extends UITestCase {
     public void test01GLDebugEnabled() throws InterruptedException {
         test01GLDebug01EnableDisable(true);
     }
-    
+
     @Test
     public void test02GLDebugError() throws InterruptedException {
-        GLProfile glp = GLProfile.getDefault();
-        
-        WindowContext winctx = createWindow(glp, true);
-        
-        MyGLDebugListener myGLDebugListener = new MyGLDebugListener(
-                GL2GL3.GL_DEBUG_SOURCE_API,
-                GL2GL3.GL_DEBUG_TYPE_ERROR,
-                GL2GL3.GL_DEBUG_SEVERITY_HIGH);
+        final GLProfile glp = GLProfile.getDefault();
+
+        final WindowContext winctx = createWindow(glp, true);
+
+        final MyGLDebugListener myGLDebugListener = new MyGLDebugListener(
+                GL2ES2.GL_DEBUG_SOURCE_API,
+                GL2ES2.GL_DEBUG_TYPE_ERROR,
+                GL2ES2.GL_DEBUG_SEVERITY_HIGH);
         winctx.context.addGLDebugListener(myGLDebugListener);
-        
-        GL gl = winctx.context.getGL();
-        
+
+        final GL gl = winctx.context.getGL();
+
         gl.glBindFramebuffer(-1, -1); // ERROR !
-        
+
         if( winctx.context.isGLDebugMessageEnabled() ) {
             Assert.assertEquals(true, myGLDebugListener.received());
-        }                
-        
+        }
+
         destroyWindow(winctx);
     }
-    
+
     @Test
     public void test03GLDebugInsert() throws InterruptedException {
-        GLProfile glp = GLProfile.getDefault();
-        WindowContext winctx = createWindow(glp, true);
-        MyGLDebugListener myGLDebugListener = new MyGLDebugListener(dbgTstMsg0, dbgTstId0);
+        final GLProfile glp = GLProfile.getDefault();
+        final WindowContext winctx = createWindow(glp, true);
+        final MyGLDebugListener myGLDebugListener = new MyGLDebugListener(dbgTstMsg0, dbgTstId0);
         winctx.context.addGLDebugListener(myGLDebugListener);
-        
-        String glDebugExt = winctx.context.getGLDebugMessageExtension();        
+
+        final String glDebugExt = winctx.context.getGLDebugMessageExtension();
         Assert.assertEquals((null == glDebugExt) ? false : true, winctx.context.isGLDebugMessageEnabled());
-        
+
         if( winctx.context.isGLDebugMessageEnabled() ) {
-            winctx.context.glDebugMessageInsert(GL2GL3.GL_DEBUG_SOURCE_APPLICATION, 
-                                                GL2GL3.GL_DEBUG_TYPE_OTHER,
-                                                dbgTstId0, 
-                                                GL2GL3.GL_DEBUG_SEVERITY_MEDIUM, dbgTstMsg0);
+            winctx.context.glDebugMessageInsert(GL2ES2.GL_DEBUG_SOURCE_APPLICATION,
+                                                GL2ES2.GL_DEBUG_TYPE_OTHER,
+                                                dbgTstId0,
+                                                GL2ES2.GL_DEBUG_SEVERITY_MEDIUM, dbgTstMsg0);
             Assert.assertEquals(true, myGLDebugListener.received());
-        }                
-        
+        }
+
         destroyWindow(winctx);
     }
 
-    
-    public static void main(String args[]) throws IOException {
-        String tstname = TestGLDebug00NEWT.class.getName();
+
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestGLDebug00NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
-    
-    public class MyGLDebugListener implements GLDebugListener {
+
+    public static class MyGLDebugListener implements GLDebugListener {
         int recSource;
         int recType;
         int recSeverity;
-        
+
         String recMsg;
         int recId;
         boolean received = false;
-        
-        public MyGLDebugListener(int recSource, int recType, int recSeverity) {
+
+        public MyGLDebugListener(final int recSource, final int recType, final int recSeverity) {
             this.recSource = recSource;
             this.recType = recType;
             this.recSeverity = recSeverity;
             this.recMsg = null;
             this.recId = -1;
-            
+
         }
-        public MyGLDebugListener(String recMsg, int recId) {
+        public MyGLDebugListener(final String recMsg, final int recId) {
             this.recSource = -1;
             this.recType = -1;
             this.recSeverity = -1;
             this.recMsg = recMsg;
             this.recId = recId;
         }
-        
+
         public boolean received() { return received; }
-        
-        public void messageSent(GLDebugMessage event) {
-            System.err.println("XXX: "+event);            
+
+        public void messageSent(final GLDebugMessage event) {
+            System.err.println("XXX: "+event);
             if(null != recMsg && recMsg.equals(event.getDbgMsg()) && recId == event.getDbgId()) {
                 received = true;
-            } else if(0 <= recSource && recSource == event.getDbgSource() && 
+            } else if(0 <= recSource && recSource == event.getDbgSource() &&
                                         recType == event.getDbgType() &&
                                         recSeverity== event.getDbgSeverity() ) {
-                received = true;                
+                received = true;
             }
             // Thread.dumpStack();
-        }        
+        }
     }
 }
-    
+
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java
index 76bf330..7428040 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLDebug01NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,16 +20,17 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.io.IOException;
 
+import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLCapabilities;
@@ -49,16 +50,16 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestGLDebug01NEWT extends UITestCase {
-    
+
     static String dbgTstMsg0 = "Hello World";
     static int dbgTstId0 = 42;
-    
-    GLWindow createWindow(GLProfile glp, boolean debugGL) {        
-        GLCapabilities caps = new GLCapabilities(glp);
+
+    GLWindow createWindow(final GLProfile glp, final boolean debugGL) {
+        final GLCapabilities caps = new GLCapabilities(glp);
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
-        GLWindow window = GLWindow.create(caps);
+        //
+        final GLWindow window = GLWindow.create(caps);
         Assert.assertNotNull(window);
         window.setContextCreationFlags(debugGL?GLContext.CTX_OPTION_DEBUG:0);
         window.setSize(128, 128);
@@ -66,44 +67,44 @@ public class TestGLDebug01NEWT extends UITestCase {
 
         Assert.assertNotNull(window.getContext());
         Assert.assertNotNull(window.getContext().isCreated());
-        
+
         return window;
     }
 
-    void destroyWindow(GLWindow window) {
+    void destroyWindow(final GLWindow window) {
         window.destroy();
     }
 
-    
-    void test01GLDebug01EnableDisable(boolean enable, final String dbgTstMsg, final int dbgTstId) throws InterruptedException {
-        GLProfile glp = GLProfile.getDefault();
-        
+
+    void test01GLDebug01EnableDisable(final boolean enable, final String dbgTstMsg, final int dbgTstId) throws InterruptedException {
+        final GLProfile glp = GLProfile.getDefault();
+
         final GLWindow window = createWindow(glp, enable);
         final GLContext ctx = window.getContext();
-        MyGLDebugListener myGLDebugListener = new MyGLDebugListener(dbgTstMsg, dbgTstId);
+        final MyGLDebugListener myGLDebugListener = new MyGLDebugListener(dbgTstMsg, dbgTstId);
         if(enable) {
             ctx.addGLDebugListener(myGLDebugListener);
-        }        
-        String glDebugExt = ctx.getGLDebugMessageExtension();
+        }
+        final String glDebugExt = ctx.getGLDebugMessageExtension();
         System.err.println("glDebug extension: "+glDebugExt);
         System.err.println("glDebug enabled: "+ctx.isGLDebugMessageEnabled());
         System.err.println("glDebug sync: "+ ctx.isGLDebugSynchronous());
         System.err.println("context version: "+ctx.getGLVersion());
-        
+
         Assert.assertEquals((null == glDebugExt) ? false : enable, ctx.isGLDebugMessageEnabled());
         if(ctx.isGLDebugMessageEnabled() && null != dbgTstMsg && 0 <= dbgTstId) {
             window.invoke(true, new GLRunnable() {
-                public boolean run(GLAutoDrawable drawable) {
-                    drawable.getContext().glDebugMessageInsert(GL2GL3.GL_DEBUG_SOURCE_APPLICATION, 
-                                                               GL2GL3.GL_DEBUG_TYPE_OTHER,
-                                                               dbgTstId, 
-                                                               GL2GL3.GL_DEBUG_SEVERITY_MEDIUM, dbgTstMsg);
+                public boolean run(final GLAutoDrawable drawable) {
+                    drawable.getContext().glDebugMessageInsert(GL2ES2.GL_DEBUG_SOURCE_APPLICATION,
+                                                               GL2ES2.GL_DEBUG_TYPE_OTHER,
+                                                               dbgTstId,
+                                                               GL2ES2.GL_DEBUG_SEVERITY_MEDIUM, dbgTstMsg);
                     return true;
                 }
             });
             Assert.assertEquals(true, myGLDebugListener.received());
-        } 
-        
+        }
+
         destroyWindow(window);
     }
 
@@ -116,77 +117,77 @@ public class TestGLDebug01NEWT extends UITestCase {
     public void test01GLDebug01Enabled() throws InterruptedException {
         test01GLDebug01EnableDisable(true, dbgTstMsg0, dbgTstId0);
     }
-    
+
     @Test
     public void test02GLDebug01Error() throws InterruptedException {
-        GLProfile glp = GLProfile.getDefault();
-        
-        GLWindow window = createWindow(glp, true);
-        
-        MyGLDebugListener myGLDebugListener = new MyGLDebugListener(
-                GL2GL3.GL_DEBUG_SOURCE_API,
-                GL2GL3.GL_DEBUG_TYPE_ERROR,
-                GL2GL3.GL_DEBUG_SEVERITY_HIGH);
+        final GLProfile glp = GLProfile.getDefault();
+
+        final GLWindow window = createWindow(glp, true);
+
+        final MyGLDebugListener myGLDebugListener = new MyGLDebugListener(
+                GL2ES2.GL_DEBUG_SOURCE_API,
+                GL2ES2.GL_DEBUG_TYPE_ERROR,
+                GL2ES2.GL_DEBUG_SEVERITY_HIGH);
         window.getContext().addGLDebugListener(myGLDebugListener);
-        
+
         window.invoke(true, new GLRunnable() {
-            public boolean run(GLAutoDrawable drawable) {
+            public boolean run(final GLAutoDrawable drawable) {
                 drawable.getGL().glBindFramebuffer(-1, -1); // ERROR !
                 return true;
             }
         } );
-        
+
         if( window.getContext().isGLDebugMessageEnabled() ) {
             Assert.assertEquals(true, myGLDebugListener.received());
-        }                
-        
+        }
+
         destroyWindow(window);
     }
-    
-    
-    public static void main(String args[]) throws IOException {
-        String tstname = TestGLDebug01NEWT.class.getName();
+
+
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestGLDebug01NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
-    
-    public class MyGLDebugListener implements GLDebugListener {
+
+    public static class MyGLDebugListener implements GLDebugListener {
         int recSource;
         int recType;
         int recSeverity;
-        
+
         String recMsg;
         int recId;
         boolean received = false;
-        
-        public MyGLDebugListener(int recSource, int recType, int recSeverity) {
+
+        public MyGLDebugListener(final int recSource, final int recType, final int recSeverity) {
             this.recSource = recSource;
             this.recType = recType;
             this.recSeverity = recSeverity;
             this.recMsg = null;
             this.recId = -1;
-            
+
         }
-        public MyGLDebugListener(String recMsg, int recId) {
+        public MyGLDebugListener(final String recMsg, final int recId) {
             this.recSource = -1;
             this.recType = -1;
             this.recSeverity = -1;
             this.recMsg = recMsg;
             this.recId = recId;
         }
-        
+
         public boolean received() { return received; }
-        
-        public void messageSent(GLDebugMessage event) {
-            System.err.println("XXX: "+event);            
+
+        public void messageSent(final GLDebugMessage event) {
+            System.err.println("XXX: "+event);
             if(null != recMsg && recMsg.equals(event.getDbgMsg()) && recId == event.getDbgId()) {
                 received = true;
-            } else if(0 <= recSource && recSource == event.getDbgSource() && 
+            } else if(0 <= recSource && recSource == event.getDbgSource() &&
                                         recType == event.getDbgType() &&
                                         recSeverity== event.getDbgSeverity() ) {
-                received = true;                
+                received = true;
             }
             // Thread.dumpStack();
-        }        
+        }
     }
 }
-    
+
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLException01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLException01NEWT.java
new file mode 100644
index 0000000..cdbe3af
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLException01NEWT.java
@@ -0,0 +1,412 @@
+/**
+ * Copyright 2011 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.acore;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
+
+import javax.media.opengl.GLAnimatorControl;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.GLRunnable;
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.FixMethodOrder;
+import org.junit.runners.MethodSorters;
+
+ at FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class TestGLException01NEWT extends UITestCase {
+    static GLProfile glp;
+    static int width, height;
+
+    @SuppressWarnings("serial")
+    static class AnimException extends RuntimeException {
+        final Thread thread;
+        final GLAnimatorControl animator;
+        final GLAutoDrawable drawable;
+        public AnimException(final Thread thread, final GLAnimatorControl animator, final GLAutoDrawable drawable, final Throwable cause) {
+            super(cause);
+            this.thread = thread;
+            this.animator = animator;
+            this.drawable = drawable;
+        }
+    }
+
+    @BeforeClass
+    public static void initClass() {
+        glp = GLProfile.getGL2ES2();
+        Assert.assertNotNull(glp);
+        width  = 512;
+        height = 512;
+    }
+
+    public static void dumpThrowable(final Throwable t) {
+        System.err.println("User caught exception "+t.getClass().getSimpleName()+": "+t.getMessage()+" on thread "+Thread.currentThread().getName());
+        t.printStackTrace();
+    }
+
+    protected void runTestGL(final GLCapabilities caps, final boolean onThread,
+                             final boolean throwInInit, final boolean throwInDisplay,
+                             final boolean throwInReshape, final boolean throwInInvoke,
+                             final boolean throwInDispose) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
+        Assert.assertNotNull(glWindow);
+        glWindow.setTitle(getTestMethodName());
+        final GearsES2 demo1 = new GearsES2();
+        demo1.setVerbose(false);
+        glWindow.addGLEventListener(demo1);
+        final AtomicInteger cleanInitCount = new AtomicInteger();
+        final AtomicInteger cleanDisposeCount = new AtomicInteger();
+        final AtomicInteger cleanDisplayCount = new AtomicInteger();
+        final AtomicInteger cleanReshapeCount = new AtomicInteger();
+        final AtomicInteger cleanInvokeCount = new AtomicInteger();
+        final AtomicInteger allInitCount = new AtomicInteger();
+        final AtomicInteger allDisposeCount = new AtomicInteger();
+        final AtomicInteger allDisplayCount = new AtomicInteger();
+        final AtomicInteger allReshapeCount = new AtomicInteger();
+        final AtomicInteger allInvokeCount = new AtomicInteger();
+        final AtomicInteger exceptionSent = new AtomicInteger();
+
+        glWindow.addGLEventListener(new GLEventListener() {
+            @Override
+            public void init(final GLAutoDrawable drawable) {
+                if( throwInInit ) {
+                    exceptionSent.incrementAndGet();
+                    throw new RuntimeException("<Injected GLEventListener exception in init: #"+exceptionSent.get()+" on thread "+Thread.currentThread().getName()+">");
+                }
+            }
+            @Override
+            public void dispose(final GLAutoDrawable drawable) {
+                if( throwInDispose ) {
+                    exceptionSent.incrementAndGet();
+                    throw new RuntimeException("<Injected GLEventListener exception in dispose: #"+exceptionSent.get()+" on thread "+Thread.currentThread().getName()+">");
+                }
+            }
+            @Override
+            public void display(final GLAutoDrawable drawable) {
+                if( throwInDisplay ) {
+                    exceptionSent.incrementAndGet();
+                    throw new RuntimeException("<Injected GLEventListener exception in display: #"+exceptionSent.get()+" on thread "+Thread.currentThread().getName()+">");
+                }
+            }
+            @Override
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+                if( throwInReshape ) {
+                    exceptionSent.incrementAndGet();
+                    throw new RuntimeException("<Injected GLEventListener exception in reshape: #"+exceptionSent.get()+" on thread "+Thread.currentThread().getName()+">");
+                }
+            }
+        });
+        final GLRunnable glRunnableInject = new GLRunnable() {
+            @Override
+            public boolean run(final GLAutoDrawable drawable) {
+                if( throwInInvoke ) {
+                    exceptionSent.incrementAndGet();
+                    throw new RuntimeException("<Injected GLEventListener exception in invoke: #"+exceptionSent.get()+" on thread "+Thread.currentThread().getName()+">");
+                }
+                return true;
+            }
+        };
+        final GLRunnable glRunnableCount = new GLRunnable() {
+            @Override
+            public boolean run(final GLAutoDrawable drawable) {
+                if( 0 == exceptionSent.get() ) {
+                    cleanInvokeCount.incrementAndGet();
+                }
+                allInvokeCount.incrementAndGet();
+                return true;
+            }
+        };
+
+        glWindow.addGLEventListener(new GLEventListener() {
+            @Override
+            public void init(final GLAutoDrawable drawable) {
+                if( 0 == exceptionSent.get() ) {
+                    cleanInitCount.incrementAndGet();
+                }
+                allInitCount.incrementAndGet();
+            }
+            @Override
+            public void dispose(final GLAutoDrawable drawable) {
+                if( 0 == exceptionSent.get() ) {
+                    cleanDisposeCount.incrementAndGet();
+                }
+                allDisposeCount.incrementAndGet();
+            }
+            @Override
+            public void display(final GLAutoDrawable drawable) {
+                if( 0 == exceptionSent.get() ) {
+                    cleanDisplayCount.incrementAndGet();
+                }
+                allDisplayCount.incrementAndGet();
+            }
+            @Override
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+                if( 0 == exceptionSent.get() ) {
+                    cleanReshapeCount.incrementAndGet();
+                }
+                allReshapeCount.incrementAndGet();
+            }
+        });
+
+        RuntimeException exceptionAtInitReshapeDisplay = null;
+        RuntimeException exceptionAtInvoke = null;
+        RuntimeException exceptionAtDispose = null;
+        final List<AnimException> exceptionsAtGLAnimatorControl = new ArrayList<AnimException>();
+        final GLAnimatorControl.UncaughtExceptionHandler uncaughtExceptionHandler;
+
+        final Animator animator;
+        if( onThread ) {
+            animator = null;
+            uncaughtExceptionHandler = null;
+        } else {
+            animator = new Animator(glWindow);
+            uncaughtExceptionHandler = new GLAnimatorControl.UncaughtExceptionHandler() {
+                @Override
+                public void uncaughtException(final GLAnimatorControl animator, final GLAutoDrawable drawable, final Throwable cause) {
+                    final AnimException ae = new AnimException(animator.getThread(), animator, drawable, cause);
+                    exceptionsAtGLAnimatorControl.add(ae);
+                    dumpThrowable(ae);
+                } };
+            animator.setUncaughtExceptionHandler(uncaughtExceptionHandler);
+        }
+
+        glWindow.setSize(width, height);
+
+        if( !onThread ) {
+            animator.setUpdateFPSFrames(1, null);
+            animator.start();
+        }
+        try {
+            glWindow.setVisible(true);
+        } catch (final RuntimeException re) {
+            exceptionAtInitReshapeDisplay = re;
+            dumpThrowable(re);
+        }
+
+        try {
+            glWindow.invoke(true, glRunnableInject);
+            glWindow.invoke(true, glRunnableCount);
+        } catch (final RuntimeException re) {
+            exceptionAtInvoke = re;
+            dumpThrowable(re);
+        }
+
+        final long t0 = System.currentTimeMillis();
+        long t1 = t0;
+        while(0 == exceptionSent.get() && ( onThread || animator.isAnimating() ) && t1-t0<duration ) {
+            if( onThread ) {
+                try {
+                    glWindow.display();
+                } catch (final RuntimeException re) {
+                    exceptionAtInitReshapeDisplay = re;
+                    dumpThrowable(re);
+                }
+            }
+            Thread.sleep(100);
+            t1 = System.currentTimeMillis();
+        }
+
+        if( !onThread ) {
+            animator.stop();
+        }
+        try {
+            glWindow.destroy();
+        } catch (final RuntimeException re) {
+            exceptionAtDispose = re;
+            dumpThrowable(re);
+        }
+
+        final boolean onAnimThread = !onThread && !throwInDispose; /** dispose happens on [AWT|NEWT] EDT, not on animator thread! */
+
+        System.err.println("This-Thread                     : "+onThread);
+        System.err.println("Anim-Thread                     : "+onAnimThread);
+        System.err.println("ExceptionSent                   : "+exceptionSent.get());
+        System.err.println("Exception @ Init/Reshape/Display: "+(null != exceptionAtInitReshapeDisplay));
+        System.err.println("Exception @ Invoke              : "+(null != exceptionAtInvoke));
+        System.err.println("Exception @ Dispose             : "+(null != exceptionAtDispose));
+        System.err.println("Exception @ GLAnimatorControl   : "+exceptionsAtGLAnimatorControl.size());
+        System.err.println("Init Count                      : "+cleanInitCount.get()+" / "+allInitCount.get());
+        System.err.println("Reshape Count                   : "+cleanReshapeCount.get()+" / "+allReshapeCount.get());
+        System.err.println("Display Count                   : "+cleanDisplayCount.get()+" / "+allDisplayCount.get());
+        System.err.println("Invoke Count                    : "+cleanInvokeCount.get()+" / "+allInvokeCount.get());
+        System.err.println("Dispose Count                   : "+cleanDisposeCount.get()+" / "+allDisposeCount.get());
+
+        if( throwInInit || throwInReshape || throwInDisplay || throwInDispose || throwInInvoke ) {
+            Assert.assertTrue("Not one exception sent, but "+exceptionSent.get(), 0 < exceptionSent.get());
+            if( onAnimThread ) {
+                Assert.assertEquals("No exception forwarded from init to animator-handler", 1, exceptionsAtGLAnimatorControl.size());
+                Assert.assertNull("Exception forwarded from init, on-thread", exceptionAtInitReshapeDisplay);
+            }
+            if( throwInInit ) {
+                if( !onAnimThread ) {
+                    Assert.assertNotNull("No exception forwarded from init, on-thread", exceptionAtInitReshapeDisplay);
+                    Assert.assertEquals("Exception forwarded from init to animator-handler", 0, exceptionsAtGLAnimatorControl.size());
+                }
+                Assert.assertEquals("Init Count", 0, cleanInitCount.get());
+                Assert.assertEquals("Reshape Count", 0, cleanReshapeCount.get());
+                Assert.assertEquals("Display Count", 0, cleanDisplayCount.get());
+                Assert.assertEquals("Invoke Count", 0, cleanInvokeCount.get());
+                Assert.assertEquals("Dispose Count", 0, cleanDisposeCount.get());
+            } else if( throwInReshape ) {
+                if( !onAnimThread ) {
+                    Assert.assertNotNull("No exception forwarded from reshape, on-thread", exceptionAtInitReshapeDisplay);
+                    Assert.assertEquals("Exception forwarded from init to animator-handler", 0, exceptionsAtGLAnimatorControl.size());
+                }
+                Assert.assertEquals("Init Count", 1, cleanInitCount.get());
+                Assert.assertEquals("Reshape Count", 0, cleanReshapeCount.get());
+                Assert.assertEquals("Display Count", 0, cleanDisplayCount.get());
+                Assert.assertEquals("Invoke Count", 0, cleanInvokeCount.get());
+                Assert.assertEquals("Dispose Count", 0, cleanDisposeCount.get());
+            } else if( throwInDisplay ) {
+                if( !onAnimThread ) {
+                    Assert.assertNotNull("No exception forwarded from display, on-thread", exceptionAtInitReshapeDisplay);
+                    Assert.assertEquals("Exception forwarded from init to animator-handler", 0, exceptionsAtGLAnimatorControl.size());
+                }
+                Assert.assertEquals("Init Count", 1, cleanInitCount.get());
+                Assert.assertEquals("Reshape Count", 1, cleanReshapeCount.get());
+                Assert.assertEquals("Display Count", 0, cleanDisplayCount.get());
+                Assert.assertEquals("Invoke Count", 0, cleanInvokeCount.get());
+                Assert.assertEquals("Dispose Count", 0, cleanDisposeCount.get());
+            } else if( throwInInvoke ) {
+                if( !onAnimThread ) {
+                    Assert.assertNotNull("No exception forwarded from invoke, on-thread", exceptionAtInvoke);
+                    Assert.assertEquals("Exception forwarded from init to animator-handler", 0, exceptionsAtGLAnimatorControl.size());
+                }
+                Assert.assertEquals("Init Count", 1, cleanInitCount.get());
+                Assert.assertEquals("Reshape Count", 1, cleanReshapeCount.get());
+                Assert.assertTrue  ("Display count not greater-equal 1, but "+cleanDisplayCount.get(), 1 <= cleanDisplayCount.get());
+                Assert.assertEquals("Invoke Count", 0, cleanInvokeCount.get());
+                Assert.assertEquals("Dispose Count", 0, cleanDisposeCount.get());
+            } else if( throwInDispose ) {
+                if( !onAnimThread ) {
+                    Assert.assertNotNull("No exception forwarded from dispose, on-thread", exceptionAtDispose);
+                    Assert.assertEquals("Exception forwarded from init to animator-handler", 0, exceptionsAtGLAnimatorControl.size());
+                }
+                Assert.assertEquals("Init Count", 1, cleanInitCount.get());
+                Assert.assertEquals("Reshape Count", 1, cleanReshapeCount.get());
+                Assert.assertTrue  ("Display count not greater-equal 1, but "+cleanDisplayCount.get(), 1 <= cleanDisplayCount.get());
+                Assert.assertEquals("Invoke Count", 1, cleanInvokeCount.get());
+                Assert.assertEquals("Dispose Count", 0, cleanDisposeCount.get());
+            }
+        }
+    }
+
+    @Test
+    public void test01OnThreadAtInit() throws InterruptedException {
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setBackgroundOpaque(true); // default
+        runTestGL(caps, true /* onThread */, true /* init */, false /* display */, false /* reshape */, false /* invoke */, false /* dispose */);
+    }
+    @Test
+    public void test02OnThreadAtReshape() throws InterruptedException {
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setBackgroundOpaque(true); // default
+        runTestGL(caps, true /* onThread */, false /* init */, false /* display */, true /* reshape */, false /* invoke */, false /* dispose */);
+    }
+    @Test
+    public void test03OnThreadAtDisplay() throws InterruptedException {
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setBackgroundOpaque(true); // default
+        runTestGL(caps, true /* onThread */, false /* init */, true /* display */, false /* reshape */, false /* invoke */, false /* dispose */);
+    }
+    @Test
+    public void test04OnThreadAtInvoke() throws InterruptedException {
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setBackgroundOpaque(true); // default
+        runTestGL(caps, true /* onThread */, false /* init */, true /* display */, false /* reshape */, true /* invoke */, false /* dispose */);
+    }
+    @Test
+    public void test05OnThreadAtDispose() throws InterruptedException {
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setBackgroundOpaque(true); // default
+        runTestGL(caps, true /* onThread */, false /* init */, false /* display */, false /* reshape */, false /* invoke */, true /* dispose */);
+    }
+
+    @Test
+    public void test11OffThreadAtInit() throws InterruptedException {
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setBackgroundOpaque(true); // default
+        runTestGL(caps, false /* onThread */, true /* init */, false /* display */, false /* reshape */, false /* invoke */, false /* dispose */);
+    }
+    @Test
+    public void test12OffThreadAtReshape() throws InterruptedException {
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setBackgroundOpaque(true); // default
+        runTestGL(caps, false /* onThread */, false /* init */, false /* display */, true /* reshape */, false /* invoke */, false /* dispose */);
+    }
+    @Test
+    public void test13OffThreadAtDisplay() throws InterruptedException {
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setBackgroundOpaque(true); // default
+        runTestGL(caps, false /* onThread */, false /* init */, true /* display */, false /* reshape */, false /* invoke */, false /* dispose */);
+    }
+    @Test
+    public void test14OffThreadAtInvoke() throws InterruptedException {
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setBackgroundOpaque(true); // default
+        runTestGL(caps, false /* onThread */, false /* init */, true /* display */, false /* reshape */, true /* invoke */, false /* dispose */);
+    }
+    @Test
+    public void test15OffThreadAtDispose() throws InterruptedException {
+        final GLCapabilities caps = new GLCapabilities(glp);
+        caps.setBackgroundOpaque(true); // default
+        runTestGL(caps, false /* onThread */, false /* init */, false /* display */, false /* reshape */, false /* invoke */, true /* dispose */);
+    }
+
+    static long duration = 500; // ms
+
+    public static void main(final String args[]) {
+        boolean waitForKey = false;
+
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                i++;
+                duration = MiscUtils.atol(args[i], duration);
+            } else if(args[i].equals("-wait")) {
+                waitForKey = true;
+            }
+        }
+        if( waitForKey ) {
+            UITestCase.waitForKey("main");
+        }
+        org.junit.runner.JUnitCore.main(TestGLException01NEWT.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLExtensionQueryOffscreen.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLExtensionQueryOffscreen.java
index 4bc8e7e..b3a0de8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLExtensionQueryOffscreen.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLExtensionQueryOffscreen.java
@@ -39,8 +39,6 @@ import javax.media.opengl.GLDrawableFactory;
 import javax.media.opengl.GLOffscreenAutoDrawable;
 import javax.media.opengl.GLProfile;
 
-import jogamp.opengl.GLDrawableFactoryImpl;
-
 import org.junit.Test;
 import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
@@ -48,35 +46,13 @@ import org.junit.runners.MethodSorters;
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestGLExtensionQueryOffscreen {
 
-    public static void main(String[] args) {
-        TestGLExtensionQueryOffscreen instance = new TestGLExtensionQueryOffscreen();
-        instance.testJogl2ExtensionCheck1();
-        instance.testJogl2ExtensionCheck2();
-    }
-
-    /**
-     * @deprecated This test uses a non public API in jogamp.opengl.* and hence is not recommended
-     */
-    @Test
-    public void testJogl2ExtensionCheck1() {
-        GLDrawableFactoryImpl factory = (GLDrawableFactoryImpl) GLDrawableFactory.getDesktopFactory();
-        GLContext sharedContext = factory.getOrCreateSharedContext(null);
-        sharedContext.makeCurrent();
-        String extensions;
-        try {
-            extensions = sharedContext.getGL().glGetString(GL.GL_EXTENSIONS);
-        } finally {
-            sharedContext.release();
-        }
-        String[] tabExtensions = extensions.split(" ");
-        SortedSet<String> setExtensions = new TreeSet<String>();
-        Collections.addAll(setExtensions, tabExtensions);
-        System.out.println("SharedContext: "+sharedContext);
-        System.out.println("SharedContext: "+setExtensions);
+    public static void main(final String[] args) {
+        final TestGLExtensionQueryOffscreen instance = new TestGLExtensionQueryOffscreen();
+        instance.testJogl2ExtensionCheck();
     }
 
     @Test
-    public void testJogl2ExtensionCheck2() {
+    public void testJogl2ExtensionCheck() {
         final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
         final GLOffscreenAutoDrawable drawable = factory.createOffscreenAutoDrawable(null, caps, null, 256, 256);
@@ -89,8 +65,8 @@ public class TestGLExtensionQueryOffscreen {
         } finally {
             context.release();
         }
-        String[] tabExtensions = extensions.split(" ");
-        SortedSet<String> setExtensions = new TreeSet<String>();
+        final String[] tabExtensions = extensions.split(" ");
+        final SortedSet<String> setExtensions = new TreeSet<String>();
         Collections.addAll(setExtensions, tabExtensions);
         System.out.println("DefaultContext: "+context);
         System.out.println("DefaultContext: "+setExtensions);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug651NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug651NEWT.java
index 5efe21e..5ef0254 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug651NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug651NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import com.jogamp.newt.opengl.GLWindow;
@@ -34,6 +34,7 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GL2ES3;
 import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLCapabilities;
@@ -50,11 +51,11 @@ import org.junit.runners.MethodSorters;
 /**
  * Some GL state values are broken w/ Mesa 9.0 w/ multiple different context.
  * <p>
- * This bug lies within Mesa3D (any renderer) and is fixed in 
+ * This bug lies within Mesa3D (any renderer) and is fixed in
  * commit 8dc79ae7d73cf6711c2182ff9a5d37ef6c989d23.
  * </p>
  * <p>
- * Mesa3D Version 9.0 still exposes this bug, 
+ * Mesa3D Version 9.0 still exposes this bug,
  * where 9.0.1 has it fixed w/ above commit.
  * </p>
  * <https://jogamp.org/bugzilla/show_bug.cgi?id=651>
@@ -73,9 +74,9 @@ public class TestGLMesaBug651NEWT extends UITestCase {
     public static void releaseClass() {
     }
 
-    class UnitTester implements GLEventListener {
+    static class UnitTester implements GLEventListener {
         @Override
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
             final GL gl = drawable.getGL();
             System.err.println("GL UnitTester");
             System.err.println("  GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
@@ -86,37 +87,37 @@ public class TestGLMesaBug651NEWT extends UITestCase {
             System.err.println("  GL Profile: "+gl.getGLProfile());
             System.err.println("  GL Renderer Quirks:" + gl.getContext().getRendererQuirks().toString());
             System.err.println("  GL:" + gl + ", " + gl.getContext().getGLVersion());
-                        
+
             final int _glerr = gl.glGetError(); // clear pre-error
             System.err.println("  - pre GL-Error 0x"+Integer.toHexString(_glerr));
-            
-            final int[] val = new int[1];            
+
+            final int[] val = new int[1];
             final int[] glerr = new int[] { GL.GL_NO_ERROR, GL.GL_NO_ERROR, GL.GL_NO_ERROR, GL.GL_NO_ERROR, GL.GL_NO_ERROR };
-            int i=0;            
-            
+            int i=0;
+
             val[0]=0;
             gl.glGetIntegerv(GL.GL_MAX_TEXTURE_SIZE, val, 0);
-            System.out.println("  - GL_MAX_TEXTURE_SIZE: " + val[0]);                
+            System.out.println("  - GL_MAX_TEXTURE_SIZE: " + val[0]);
             glerr[i] = gl.glGetError(); // clear pre-error
             System.err.println("  - GL-Error 0x"+Integer.toHexString(glerr[i]));
             i++;
-            
+
             val[0]=0;
-            gl.glGetIntegerv(GL2ES2.GL_ACTIVE_TEXTURE, val, 0);
-            System.out.println("  - GL_ACTIVE_TEXTURE: " + val[0]);                
+            gl.glGetIntegerv(GL.GL_ACTIVE_TEXTURE, val, 0);
+            System.out.println("  - GL_ACTIVE_TEXTURE: " + val[0]);
             glerr[i] = gl.glGetError(); // clear pre-error
             System.err.println("  - GL-Error 0x"+Integer.toHexString(glerr[i]));
             i++;
-            
+
             if(gl.isGL2ES2()) {
                 val[0]=0;
                 gl.glGetIntegerv(GL2ES2.GL_MAX_TEXTURE_IMAGE_UNITS, val, 0);
-                System.out.println("  - GL_MAX_TEXTURE_IMAGE_UNITS: " + val[0]);                
+                System.out.println("  - GL_MAX_TEXTURE_IMAGE_UNITS: " + val[0]);
                 glerr[i] = gl.glGetError(); // clear pre-error
                 System.err.println("  - GL-Error 0x"+Integer.toHexString(glerr[i]));
             }
             i++;
-            
+
             if( gl.hasFullFBOSupport() || gl.isExtensionAvailable(GLExtensions.NV_fbo_color_attachments) ) {
                 val[0]=0;
                 gl.glGetIntegerv(GL2ES2.GL_MAX_COLOR_ATTACHMENTS, val, 0);
@@ -125,24 +126,24 @@ public class TestGLMesaBug651NEWT extends UITestCase {
                 System.err.println("  - GL-Error 0x"+Integer.toHexString(glerr[i]));
             }
             i++;
-            
+
             if( gl.hasFullFBOSupport() ) {
                 val[0]=0;
-                gl.glGetIntegerv(GL2GL3.GL_MAX_SAMPLES, val, 0);
+                gl.glGetIntegerv(GL2ES3.GL_MAX_SAMPLES, val, 0);
                 System.out.println("  - GL_MAX_SAMPLES: " + val[0]);
                 glerr[i] = gl.glGetError(); // clear pre-error
                 System.err.println("  - GL-Error 0x"+Integer.toHexString(glerr[i]));
             }
             i++;
-                        
+
             boolean ok = true;
             String res="";
             for(int j=0; j<i; j++) {
-                switch(j) {                
+                switch(j) {
                     case 0: res += "GL_MAX_TEXTURE_SIZE"; break;
                     case 1: res += "GL_ACTIVE_TEXTURE"; break;
                     case 2: res += "GL_MAX_TEXTURE_IMAGE_UNITS"; break;
-                    case 3: res += "GL_MAX_COLOR_ATTACHMENTS"; break; 
+                    case 3: res += "GL_MAX_COLOR_ATTACHMENTS"; break;
                     case 4: res += "GL_MAX_SAMPLES"; break;
                 }
                 if(GL.GL_NO_ERROR == glerr[j]) {
@@ -156,70 +157,70 @@ public class TestGLMesaBug651NEWT extends UITestCase {
         }
 
         @Override
-        public void dispose(GLAutoDrawable drawable) {
+        public void dispose(final GLAutoDrawable drawable) {
         }
 
         @Override
-        public void display(GLAutoDrawable drawable) {
+        public void display(final GLAutoDrawable drawable) {
         }
 
         @Override
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-        }        
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+        }
     }
-    
-    protected void runTestGL(GLCapabilities caps) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
+
+    protected void runTestGL(final GLCapabilities caps) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle(getSimpleTestName("."));
 
-        UnitTester demo = new UnitTester();
-        
+        final UnitTester demo = new UnitTester();
+
         glWindow.addGLEventListener(demo);
 
         glWindow.setSize(width, height);
-        glWindow.setVisible(true);        
+        glWindow.setVisible(true);
         glWindow.display();
-        
+
         glWindow.destroy();
     }
-    
+
     @Test
     public void test01_ES1() throws InterruptedException {
         if(!GLProfile.isAvailable(GLProfile.GLES1)) { System.err.println("GLES1 n/a"); return; }
-        GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
+        final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
         runTestGL(caps);
     }
-    
+
     @Test
     public void test02__ES2() throws InterruptedException {
         if(!GLProfile.isAvailable(GLProfile.GLES2)) { System.err.println("GLES2 n/a"); return; }
-        GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
+        final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
         runTestGL(caps);
     }
-            
+
     @Test
     public void test03_GL2() throws InterruptedException {
         if(!GLProfile.isAvailable(GLProfile.GL2)) { System.err.println("GL2 n/a"); return; }
-        GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
+        final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
         runTestGL(caps);
     }
-    
+
     @Test
     public void test04_GL3() throws InterruptedException {
         if(!GLProfile.isAvailable(GLProfile.GL3)) { System.err.println("GL3 n/a"); return; }
-        GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL3));
+        final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL3));
         runTestGL(caps);
     }
-    
+
     @Test
     public void test05_GL4() throws InterruptedException {
         if(!GLProfile.isAvailable(GLProfile.GL4)) { System.err.println("GL4 n/a"); return; }
-        GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL4));
+        final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL4));
         runTestGL(caps);
     }
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestGLMesaBug651NEWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug658NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug658NEWT.java
index cb225b9..a91eae0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug658NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLMesaBug658NEWT.java
@@ -20,11 +20,11 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 /**
  * The 3.1 compatibility context on Mesa >= 9.0 seems to be broken.
  * <p>
- * This bug lies within Mesa3D (any renderer) and is fixed in 
+ * This bug lies within Mesa3D (any renderer) and is fixed in
  * commit ??? (not yet).
  * </p>
  * <p>
- * Mesa3D Version 9.0 still exposes this bug, 
+ * Mesa3D Version 9.0 still exposes this bug,
  * where 9.?.? has it fixed w/ above commit.
  * </p>
  * <https://jogamp.org/bugzilla/show_bug.cgi?id=658>
@@ -36,25 +36,25 @@ public class TestGLMesaBug658NEWT extends UITestCase {
   public void test00ShowAvailProfiles() {
       System.err.println(JoglVersion.getDefaultOpenGLInfo(null, null, false).toString());
   }
-  
+
   @Test
   public void test10GL2PolygonModeFailure() {
       testGLNPolygonModeFailureImpl(GLProfile.GL2);
   }
-  
+
   @Test
   public void test11GL3bcPolygonModeFailure() {
       testGLNPolygonModeFailureImpl(GLProfile.GL3bc);
   }
-  
+
   @Test
   public void test12GL3PolygonModeFailure() {
       testGLNPolygonModeFailureImpl(GLProfile.GL3);
   }
-  
-  private void testGLNPolygonModeFailureImpl(String profile) {
+
+  private void testGLNPolygonModeFailureImpl(final String profile) {
     if(!GLProfile.isAvailable(profile)) { System.err.println(profile+" n/a"); return; }
-        
+
     final GLProfile pro = GLProfile.get(profile);
     final GLCapabilities caps = new GLCapabilities(pro);
     final GLWindow window = GLWindow.create(caps);
@@ -82,7 +82,7 @@ public class TestGLMesaBug658NEWT extends UITestCase {
         System.err.println("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
         System.err.println("GL_VERSION: " + gl.glGetString(GL.GL_VERSION));
         System.err.println("GL Renderer Quirks:" + gl.getContext().getRendererQuirks().toString());
-        
+
         if( gl.isGL2() || gl.isGLES2() ) { // compatibility profile || ES2
             gl.glPolygonMode(GL.GL_FRONT, GL2GL3.GL_FILL);
         } else {
@@ -113,24 +113,24 @@ public class TestGLMesaBug658NEWT extends UITestCase {
     }
   }
 
-  @Test 
+  @Test
   public void test20GL2BindArrayAttributeFails() {
       testGLNBindArrayAttributeFailsImpl(GLProfile.GL2);
   }
-  
-  @Test 
+
+  @Test
   public void test21GL3bcBindArrayAttributeFails() {
       testGLNBindArrayAttributeFailsImpl(GLProfile.GL3bc);
   }
-  
-  @Test 
+
+  @Test
   public void test22GL3BindArrayAttributeFails() {
       testGLNBindArrayAttributeFailsImpl(GLProfile.GL3);
   }
-  
-  private void testGLNBindArrayAttributeFailsImpl(String profile) {
+
+  private void testGLNBindArrayAttributeFailsImpl(final String profile) {
     if(!GLProfile.isAvailable(profile)) { System.err.println(profile+ " n/a"); return; }
-    
+
     final GLProfile pro = GLProfile.get(profile);
     final GLCapabilities caps = new GLCapabilities(pro);
     final GLWindow window = GLWindow.create(caps);
@@ -172,7 +172,7 @@ public class TestGLMesaBug658NEWT extends UITestCase {
         gl.glEnableVertexAttribArray(1);
         Assert.assertTrue(gl.glGetError() == GL.GL_NO_ERROR);
         gl.glVertexAttribPointer(1, 4, GL.GL_FLOAT, false, 0, 0L);
-        Assert.assertTrue(gl.glGetError() == GL.GL_NO_ERROR); // FIXME On Mesa 9.0.1 w/ GL 3.1 -> GL.GL_INVALID_OPERATION ? 
+        Assert.assertTrue(gl.glGetError() == GL.GL_NO_ERROR); // FIXME On Mesa 9.0.1 w/ GL 3.1 -> GL.GL_INVALID_OPERATION ?
       }
 
       public void dispose(
@@ -194,10 +194,10 @@ public class TestGLMesaBug658NEWT extends UITestCase {
         window.destroy();
     }
   }
-  
-  public static void main(String args[]) {
+
+  public static void main(final String args[]) {
       org.junit.runner.JUnitCore.main(TestGLMesaBug658NEWT.class.getName());
   }
-  
+
 }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLPointsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLPointsNEWT.java
index 7d3a7b8..fb6a50f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLPointsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLPointsNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import com.jogamp.newt.opengl.GLWindow;
@@ -59,8 +59,8 @@ public class TestGLPointsNEWT extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL0(GLCapabilities caps, PointsDemo demo) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
+    protected void runTestGL0(final GLCapabilities caps, final PointsDemo demo) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle(getSimpleTestName("."));
 
@@ -71,87 +71,87 @@ public class TestGLPointsNEWT extends UITestCase {
 
         glWindow.setSize(width, height);
         glWindow.setVisible(true);
-        
+
         demo.setSmoothPoints(false);
         snap.setMakeSnapshot();
         snap.setPostSNDetail("flat");
         glWindow.display();
-        
+
         demo.setSmoothPoints(true);
         snap.setMakeSnapshot();
         snap.setPostSNDetail("smooth");
         glWindow.display();
-        
-        demo.setPointParams(2f, 40f, 0.01f, 0.0f, 0.01f, 1f);        
+
+        demo.setPointParams(2f, 40f, 0.01f, 0.0f, 0.01f, 1f);
         snap.setMakeSnapshot();
         snap.setPostSNDetail("attn0");
         glWindow.display();
-        
+
         glWindow.removeGLEventListener(demo);
-        
+
         glWindow.destroy();
     }
-    
-    protected void runTestGL(GLCapabilities caps, PointsDemo demo, boolean forceFFPEmu) throws InterruptedException {
+
+    protected void runTestGL(final GLCapabilities caps, final PointsDemo demo, final boolean forceFFPEmu) throws InterruptedException {
         // final PointsDemoES2 demo01 = new PointsDemoES2();
-        runTestGL0(caps, demo);        
+        runTestGL0(caps, demo);
     }
 
     @Test
     public void test01FFP__GL2() throws InterruptedException {
         if(!GLProfile.isAvailable(GLProfile.GL2)) { System.err.println("GL2 n/a"); return; }
-        GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
+        final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
         runTestGL(caps, new PointsDemoES1(), false);
     }
-    
+
     @Test
     public void test02FFP__ES1() throws InterruptedException {
         if(!GLProfile.isAvailable(GLProfile.GLES1)) { System.err.println("GLES1 n/a"); return; }
-        GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
+        final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES1));
         runTestGL(caps, new PointsDemoES1(), false);
     }
-    
+
     @Test
     public void test03FFP__ES2() throws InterruptedException {
         if(!GLProfile.isAvailable(GLProfile.GLES2)) { System.err.println("GLES2 n/a"); return; }
-        GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
-        PointsDemoES1 demo = new PointsDemoES1();
+        final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
+        final PointsDemoES1 demo = new PointsDemoES1();
         demo.setForceFFPEmu(true, false, false, false);
         runTestGL(caps, demo, false);
     }
-    
+
     @Test
     public void test04FFP__GL2ES2() throws InterruptedException {
         if(!GLProfile.isAvailable(GLProfile.GL2ES2)) { System.err.println("GL2ES2 n/a"); return; }
-        GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
-        PointsDemoES1 demo = new PointsDemoES1();
+        final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES2));
+        final PointsDemoES1 demo = new PointsDemoES1();
         demo.setForceFFPEmu(true, false, false, false);
         runTestGL(caps, demo, false);
     }
-    
+
     @Test
     public void test11GLSL_GL2() throws InterruptedException {
         if(!GLProfile.isAvailable(GLProfile.GL2)) { System.err.println("GL2 n/a"); return; }
-        GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
+        final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
         runTestGL(caps, new PointsDemoES2(), false);
     }
-        
+
     @Test
     public void test12GLSL_ES2() throws InterruptedException {
         if(!GLProfile.isAvailable(GLProfile.GLES2)) { System.err.println("GLES2 n/a"); return; }
-        GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
+        final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
         runTestGL(caps, new PointsDemoES2(), false); // should be FFPEmu implicit
     }
-        
+
     static long duration = 1000; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         org.junit.runner.JUnitCore.main(TestGLPointsNEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile00NEWT.java
index df182c5..5861d42 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile00NEWT.java
@@ -47,7 +47,7 @@ public class TestGLProfile00NEWT extends UITestCase {
     public void testInitSingleton() throws InterruptedException {
         GLProfile.initSingleton();
         System.err.println("Desktop");
-        GLDrawableFactory desktopFactory = GLDrawableFactory.getDesktopFactory();
+        final GLDrawableFactory desktopFactory = GLDrawableFactory.getDesktopFactory();
         if( null != desktopFactory ) {
             System.err.println(JoglVersion.getDefaultOpenGLInfo(desktopFactory.getDefaultDevice(), null, false));
             System.err.println(Platform.getNewline()+Platform.getNewline()+Platform.getNewline());
@@ -56,7 +56,7 @@ public class TestGLProfile00NEWT extends UITestCase {
         }
 
         System.err.println("EGL");
-        GLDrawableFactory eglFactory = GLDrawableFactory.getEGLFactory();
+        final GLDrawableFactory eglFactory = GLDrawableFactory.getEGLFactory();
         if( null != eglFactory ) {
             System.err.println(JoglVersion.getDefaultOpenGLInfo(eglFactory.getDefaultDevice(), null, false));
         } else {
@@ -64,8 +64,8 @@ public class TestGLProfile00NEWT extends UITestCase {
         }
     }
 
-    public static void main(String args[]) throws IOException {
-        String tstname = TestGLProfile00NEWT.class.getName();
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestGLProfile00NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java
index 88d643a..9e87513 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLProfile01NEWT.java
@@ -72,12 +72,13 @@ public class TestGLProfile01NEWT extends UITestCase {
         }
     }
 
-    static void validate(GLProfile glp) {
+    static void validate(final GLProfile glp) {
         final boolean gles3CompatAvail = GLContext.isGLES3CompatibleAvailable(GLProfile.getDefaultDevice());
         if( glp.getImplName().equals(GLProfile.GL4bc) ) {
             Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL4bc));
             Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL4));
             Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL3bc));
+            Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL3));
             Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2));
             Assert.assertTrue(GLProfile.isAvailable(GLProfile.GL2GL3));
             if( gles3CompatAvail ) {
@@ -169,7 +170,7 @@ public class TestGLProfile01NEWT extends UITestCase {
         }
     }
 
-    static void validate(GL gl) {
+    static void validate(final GL gl) {
         final GLContext ctx = gl.getContext();
         final boolean gles3CompatAvail = ctx.isGLES3Compatible();
 
@@ -282,7 +283,7 @@ public class TestGLProfile01NEWT extends UITestCase {
     public void test01GLProfileDefault() throws InterruptedException {
         System.out.println("GLProfile "+GLProfile.glAvailabilityToString());
         System.out.println("GLProfile.getDefaultDevice(): "+GLProfile.getDefaultDevice());
-        GLProfile glp = GLProfile.getDefault();
+        final GLProfile glp = GLProfile.getDefault();
         System.out.println("GLProfile.getDefault(): "+glp);
         validate(glp);
         dumpVersion(glp);
@@ -291,7 +292,7 @@ public class TestGLProfile01NEWT extends UITestCase {
     @Test
     public void test02GLProfileMaxProgrammable() throws InterruptedException {
         // Assuming at least one programmable profile is available
-        GLProfile glp = GLProfile.getMaxProgrammable(true);
+        final GLProfile glp = GLProfile.getMaxProgrammable(true);
         System.out.println("GLProfile.getMaxProgrammable(): "+glp);
         validate(glp);
         dumpVersion(glp);
@@ -300,7 +301,7 @@ public class TestGLProfile01NEWT extends UITestCase {
     @Test
     public void test03GLProfileMaxFixedFunc() throws InterruptedException {
         // Assuming at least one fixed function profile is available
-        GLProfile glp = GLProfile.getMaxFixedFunc(true);
+        final GLProfile glp = GLProfile.getMaxFixedFunc(true);
         System.out.println("GLProfile.getMaxFixedFunc(): "+glp);
         validate(glp);
         dumpVersion(glp);
@@ -312,7 +313,7 @@ public class TestGLProfile01NEWT extends UITestCase {
             System.out.println("GLProfile GL2ES1 n/a");
             return;
         }
-        GLProfile glp = GLProfile.getGL2ES1();
+        final GLProfile glp = GLProfile.getGL2ES1();
         System.out.println("GLProfile GL2ES1: "+glp);
         validate(glp);
         dumpVersion(glp);
@@ -324,7 +325,7 @@ public class TestGLProfile01NEWT extends UITestCase {
             System.out.println("GLProfile GL2ES2 n/a");
             return;
         }
-        GLProfile glp = GLProfile.getGL2ES2();
+        final GLProfile glp = GLProfile.getGL2ES2();
         System.out.println("GLProfile GL2ES2: "+glp);
         validate(glp);
         dumpVersion(glp);
@@ -336,15 +337,15 @@ public class TestGLProfile01NEWT extends UITestCase {
             System.out.println("GLProfile GL4ES3 n/a");
             return;
         }
-        GLProfile glp = GLProfile.getGL4ES3();
+        final GLProfile glp = GLProfile.getGL4ES3();
         System.out.println("GLProfile GL4ES3: "+glp);
         validate(glp);
         dumpVersion(glp);
     }
 
-    void testSpecificProfile(String glps) throws InterruptedException {
+    void testSpecificProfile(final String glps) throws InterruptedException {
         if(GLProfile.isAvailable(glps)) {
-            GLProfile glp = GLProfile.get(glps);
+            final GLProfile glp = GLProfile.get(glps);
             validate(glp);
             dumpVersion(glp);
         } else {
@@ -392,15 +393,15 @@ public class TestGLProfile01NEWT extends UITestCase {
         testSpecificProfile(GLProfile.GLES3);
     }
 
-    protected void dumpVersion(GLProfile glp) throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
-        GLWindow glWindow = GLWindow.create(caps);
+    protected void dumpVersion(final GLProfile glp) throws InterruptedException {
+        final GLCapabilities caps = new GLCapabilities(glp);
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle("TestGLProfile01NEWT");
 
         glWindow.addGLEventListener(new GLEventListener() {
 
-            public void init(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {
                 final GL gl = drawable.getGL();
                 System.err.println(JoglVersion.getGLStrings(gl, null, true));
 
@@ -446,13 +447,13 @@ public class TestGLProfile01NEWT extends UITestCase {
                 }
             }
 
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
             }
 
-            public void display(GLAutoDrawable drawable) {
+            public void display(final GLAutoDrawable drawable) {
             }
 
-            public void dispose(GLAutoDrawable drawable) {
+            public void dispose(final GLAutoDrawable drawable) {
             }
         });
 
@@ -464,8 +465,8 @@ public class TestGLProfile01NEWT extends UITestCase {
         glWindow.destroy();
     }
 
-    public static void main(String args[]) throws IOException {
-        String tstname = TestGLProfile01NEWT.class.getName();
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestGLProfile01NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLCanvasAWT.java
index 0f77aff..2b6c84b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLCanvasAWT.java
@@ -100,7 +100,7 @@ public class TestGLReadBuffer01GLCanvasAWT extends GLReadBuffer00Base {
                     frame.pack();
                     frame.setVisible(true);
                 } } );
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -118,34 +118,34 @@ public class TestGLReadBuffer01GLCanvasAWT extends GLReadBuffer00Base {
                 textRendererGLEL.userCounter = i + 1;
                 glad.display();
             }
-            try { Thread.sleep(duration); } catch (InterruptedException e) { }
+            try { Thread.sleep(duration); } catch (final InterruptedException e) { }
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                     public void run() {
                         frame.setSize(size1);
                         frame.validate();
                     } } );
-            try { Thread.sleep(duration); } catch (InterruptedException e) { }
+            try { Thread.sleep(duration); } catch (final InterruptedException e) { }
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                     public void run() {
                         frame.setSize(size2);
                         frame.validate();
                     } } );
-            try { Thread.sleep(duration); } catch (InterruptedException e) { }
+            try { Thread.sleep(duration); } catch (final InterruptedException e) { }
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                     public void run() {
                         frame.setSize(size0);
                         frame.validate();
                     } } );
-            try { Thread.sleep(duration); } catch (InterruptedException e) { }
+            try { Thread.sleep(duration); } catch (final InterruptedException e) { }
 
             if( doSnapshot ) {
                 glad.disposeGLEventListener(snapshotGLEL, true /* remove */);
             }
             final Animator anim = new Animator(glad);
             anim.start();
-            try { Thread.sleep(2*duration); } catch (InterruptedException e) { }
+            try { Thread.sleep(2*duration); } catch (final InterruptedException e) { }
             anim.stop();
-        } catch (Exception e1) {
+        } catch (final Exception e1) {
             e1.printStackTrace();
         }
         try {
@@ -153,7 +153,7 @@ public class TestGLReadBuffer01GLCanvasAWT extends GLReadBuffer00Base {
                     public void run() {
                         frame.dispose();
                     } } );
-        } catch (Exception e1) {
+        } catch (final Exception e1) {
             e1.printStackTrace();
         }
     }
@@ -182,26 +182,26 @@ public class TestGLReadBuffer01GLCanvasAWT extends GLReadBuffer00Base {
         }
 
         @Override
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
             defAutoSwapMode = drawable.getAutoSwapBufferMode();
             swapBuffersBeforeRead = GLDrawableUtil.swapBuffersBeforeRead(drawable.getChosenGLCapabilities());
             drawable.setAutoSwapBufferMode( !swapBuffersBeforeRead );
         }
         @Override
-        public void dispose(GLAutoDrawable drawable) {
+        public void dispose(final GLAutoDrawable drawable) {
             drawable.setAutoSwapBufferMode( defAutoSwapMode );
         }
         @Override
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         @Override
-        public void display(GLAutoDrawable drawable) {
+        public void display(final GLAutoDrawable drawable) {
             snapshot(i++, drawable.getGL(), TextureIO.PNG, null);
         }
-        public void snapshot(int sn, GL gl, String fileSuffix, String destPath) {
+        public void snapshot(final int sn, final GL gl, final String fileSuffix, final String destPath) {
             final GLDrawable drawable = gl.getContext().getGLReadDrawable();
             final String postSNDetail = String.format("awt-usr%03d", textRendererGLEL.userCounter);
             final String filenameAWT = getSnapshotFilename(sn, postSNDetail,
-                                                           drawable.getChosenGLCapabilities(), drawable.getWidth(), drawable.getHeight(),
+                                                           drawable.getChosenGLCapabilities(), drawable.getSurfaceWidth(), drawable.getSurfaceHeight(),
                                                            glReadBufferUtil.hasAlpha(), fileSuffix, destPath);
             if( swapBuffersBeforeRead ) {
                 drawable.swapBuffers();
@@ -219,7 +219,7 @@ public class TestGLReadBuffer01GLCanvasAWT extends GLReadBuffer00Base {
             final File fout = new File(filenameAWT);
             try {
                 ImageIO.write(image, "png", fout);
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 e.printStackTrace();
             }
             /**
@@ -235,7 +235,7 @@ public class TestGLReadBuffer01GLCanvasAWT extends GLReadBuffer00Base {
     static boolean doSnapshot = true;
     static boolean keyFrame = false;
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLJPanelAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLJPanelAWT.java
index e93356d..7f5755f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLJPanelAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLJPanelAWT.java
@@ -98,7 +98,7 @@ public class TestGLReadBuffer01GLJPanelAWT extends GLReadBuffer00Base {
                     frame.pack();
                     frame.setVisible(true);
                 } } );
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -116,34 +116,34 @@ public class TestGLReadBuffer01GLJPanelAWT extends GLReadBuffer00Base {
                 textRendererGLEL.userCounter = i + 1;
                 glad.display();
             }
-            try { Thread.sleep(duration); } catch (InterruptedException e) { }
+            try { Thread.sleep(duration); } catch (final InterruptedException e) { }
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                     public void run() {
                         frame.setSize(size1);
                         frame.validate();
                     } } );
-            try { Thread.sleep(duration); } catch (InterruptedException e) { }
+            try { Thread.sleep(duration); } catch (final InterruptedException e) { }
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                     public void run() {
                         frame.setSize(size2);
                         frame.validate();
                     } } );
-            try { Thread.sleep(duration); } catch (InterruptedException e) { }
+            try { Thread.sleep(duration); } catch (final InterruptedException e) { }
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                     public void run() {
                         frame.setSize(size0);
                         frame.validate();
                     } } );
-            try { Thread.sleep(duration); } catch (InterruptedException e) { }
+            try { Thread.sleep(duration); } catch (final InterruptedException e) { }
 
             if( doSnapshot ) {
                 glad.disposeGLEventListener(snapshotGLEL, true /* remove */);
             }
             final Animator anim = new Animator(glad);
             anim.start();
-            try { Thread.sleep(2*duration); } catch (InterruptedException e) { }
+            try { Thread.sleep(2*duration); } catch (final InterruptedException e) { }
             anim.stop();
-        } catch (Exception e1) {
+        } catch (final Exception e1) {
             e1.printStackTrace();
         }
         try {
@@ -151,7 +151,7 @@ public class TestGLReadBuffer01GLJPanelAWT extends GLReadBuffer00Base {
                     public void run() {
                         frame.dispose();
                     } } );
-        } catch (Exception e1) {
+        } catch (final Exception e1) {
             e1.printStackTrace();
         }
     }
@@ -184,26 +184,26 @@ public class TestGLReadBuffer01GLJPanelAWT extends GLReadBuffer00Base {
         }
 
         @Override
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
             defAutoSwapMode = drawable.getAutoSwapBufferMode();
             swapBuffersBeforeRead = GLDrawableUtil.swapBuffersBeforeRead(drawable.getChosenGLCapabilities());
             drawable.setAutoSwapBufferMode( !swapBuffersBeforeRead );
         }
         @Override
-        public void dispose(GLAutoDrawable drawable) {
+        public void dispose(final GLAutoDrawable drawable) {
             drawable.setAutoSwapBufferMode( defAutoSwapMode );
         }
         @Override
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         @Override
-        public void display(GLAutoDrawable drawable) {
+        public void display(final GLAutoDrawable drawable) {
             snapshot(i++, drawable.getGL(), TextureIO.PNG, null);
         }
-        public void snapshot(int sn, GL gl, String fileSuffix, String destPath) {
+        public void snapshot(final int sn, final GL gl, final String fileSuffix, final String destPath) {
             final GLDrawable drawable = gl.getContext().getGLReadDrawable();
             final String postSNDetail = String.format("awt-usr%03d", textRendererGLEL.userCounter);
             final String filenameAWT = getSnapshotFilename(sn, postSNDetail,
-                                                           drawable.getChosenGLCapabilities(), drawable.getWidth(), drawable.getHeight(),
+                                                           drawable.getChosenGLCapabilities(), drawable.getSurfaceWidth(), drawable.getSurfaceHeight(),
                                                            glReadBufferUtil.hasAlpha(), fileSuffix, destPath);
             if( swapBuffersBeforeRead ) {
                 drawable.swapBuffers();
@@ -221,7 +221,7 @@ public class TestGLReadBuffer01GLJPanelAWT extends GLReadBuffer00Base {
             final File fout = new File(filenameAWT);
             try {
                 ImageIO.write(image, "png", fout);
-            } catch (IOException e) {
+            } catch (final IOException e) {
                 e.printStackTrace();
             }
             /**
@@ -237,7 +237,7 @@ public class TestGLReadBuffer01GLJPanelAWT extends GLReadBuffer00Base {
     static boolean doSnapshot = true;
     static boolean keyFrame = false;
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLWindowNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLWindowNEWT.java
index a170d9b..8e0e6bf 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLWindowNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLReadBuffer01GLWindowNEWT.java
@@ -82,11 +82,11 @@ public class TestGLReadBuffer01GLWindowNEWT extends GLReadBuffer00Base {
                 glad.addGLEventListener(snapshotGLEL);
             }
             glad.setVisible(true);
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
-        final DimensionImmutable size0 = new Dimension(glad.getWidth(), glad.getHeight());
+        final DimensionImmutable size0 = new Dimension(glad.getSurfaceWidth(), glad.getSurfaceHeight());
         final DimensionImmutable size1 = new Dimension(size0.getWidth()+100, size0.getHeight()+100);
         final DimensionImmutable size2 = new Dimension(size0.getWidth()-100, size0.getHeight()-100);
         try {
@@ -99,22 +99,22 @@ public class TestGLReadBuffer01GLWindowNEWT extends GLReadBuffer00Base {
                 textRendererGLEL.userCounter = i + 1;
                 glad.display();
             }
-            try { Thread.sleep(duration); } catch (InterruptedException e) { }
+            try { Thread.sleep(duration); } catch (final InterruptedException e) { }
             glad.setSize(size1.getWidth(), size1.getHeight());
-            try { Thread.sleep(duration); } catch (InterruptedException e) { }
+            try { Thread.sleep(duration); } catch (final InterruptedException e) { }
             glad.setSize(size2.getWidth(), size2.getHeight());
-            try { Thread.sleep(duration); } catch (InterruptedException e) { }
+            try { Thread.sleep(duration); } catch (final InterruptedException e) { }
             glad.setSize(size0.getWidth(), size0.getHeight());
-            try { Thread.sleep(duration); } catch (InterruptedException e) { }
+            try { Thread.sleep(duration); } catch (final InterruptedException e) { }
 
             if( doSnapshot ) {
                 glad.disposeGLEventListener(snapshotGLEL, true /* remove */);
             }
             final Animator anim = new Animator(glad);
             anim.start();
-            try { Thread.sleep(2*duration); } catch (InterruptedException e) { }
+            try { Thread.sleep(2*duration); } catch (final InterruptedException e) { }
             anim.stop();
-        } catch (Exception e1) {
+        } catch (final Exception e1) {
             e1.printStackTrace();
         }
         glad.destroy();
@@ -136,26 +136,26 @@ public class TestGLReadBuffer01GLWindowNEWT extends GLReadBuffer00Base {
         }
 
         @Override
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
             defAutoSwapMode = drawable.getAutoSwapBufferMode();
             swapBuffersBeforeRead = GLDrawableUtil.swapBuffersBeforeRead(drawable.getChosenGLCapabilities());
             drawable.setAutoSwapBufferMode( !swapBuffersBeforeRead );
         }
         @Override
-        public void dispose(GLAutoDrawable drawable) {
+        public void dispose(final GLAutoDrawable drawable) {
             drawable.setAutoSwapBufferMode( defAutoSwapMode );
         }
         @Override
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         @Override
-        public void display(GLAutoDrawable drawable) {
+        public void display(final GLAutoDrawable drawable) {
             snapshot(i++, drawable, TextureIO.PNG, null);
         }
-        public void snapshot(int sn, GLAutoDrawable drawable, String fileSuffix, String destPath) {
+        public void snapshot(final int sn, final GLAutoDrawable drawable, final String fileSuffix, final String destPath) {
             final GL gl = drawable.getGL();
             final String postSNDetail = String.format("jgl-usr%03d", textRendererGLEL.userCounter);
             final String filenameJGL = getSnapshotFilename(sn, postSNDetail,
-                                                           drawable.getChosenGLCapabilities(), drawable.getWidth(), drawable.getHeight(),
+                                                           drawable.getChosenGLCapabilities(), drawable.getSurfaceWidth(), drawable.getSurfaceHeight(),
                                                            glReadBufferUtil.hasAlpha(), fileSuffix, destPath);
             if( swapBuffersBeforeRead ) {
                 drawable.swapBuffers();
@@ -178,7 +178,7 @@ public class TestGLReadBuffer01GLWindowNEWT extends GLReadBuffer00Base {
     static boolean doSnapshot = true;
     static boolean keyFrame = false;
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLVersionParsing00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLVersionParsing00NEWT.java
index 7ae49fe..44c9372 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLVersionParsing00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGLVersionParsing00NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.io.IOException;
@@ -75,20 +75,20 @@ public class TestGLVersionParsing00NEWT extends UITestCase {
         "OpenGL 2.1 LaLa", // 3
         "4.2.11762 Compatibility Profile Context" // 4
     };
-    
+
     public static final VersionNumberString[] glVersionNumbers = new VersionNumberString[] {
-        new VersionNumberString(2, 1, 0, glVersionStrings00[0]), 
-        new VersionNumberString(2, 1, 0, glVersionStrings00[1]), 
+        new VersionNumberString(2, 1, 0, glVersionStrings00[0]),
+        new VersionNumberString(2, 1, 0, glVersionStrings00[1]),
         new VersionNumberString(4, 2, 0, glVersionStrings00[2]),
         new VersionNumberString(4, 2, 0, glVersionStrings00[3]),
-        new VersionNumberString(2, 1, 0, glVersionStrings00[4]), 
+        new VersionNumberString(2, 1, 0, glVersionStrings00[4]),
         new VersionNumberString(4, 2, 0, glVersionStrings00[5]),
         new VersionNumberString(4, 2, 0, glVersionStrings00[6]),
         new VersionNumberString(2, 0, 0, glVersionStrings00[7]),
         new VersionNumberString(2, 0, 0, glVersionStrings00[8]),
         new VersionNumberString(2, 0, 0, glVersionStrings00[9]),
         new VersionNumberString(2, 0, 0, glVersionStrings00[10]),
-        
+
         new VersionNumberString(2, 1, 0, glVersionStrings01[0]),
         new VersionNumberString(2, 1, 0, glVersionStrings01[1]),
         new VersionNumberString(2, 1, 0, glVersionStrings01[2]),
@@ -99,7 +99,7 @@ public class TestGLVersionParsing00NEWT extends UITestCase {
         new VersionNumberString(2, 0, 0, glVersionStrings01[7]),
         new VersionNumberString(2, 0, 0, glVersionStrings01[8]),
         new VersionNumberString(2, 0, 0, glVersionStrings01[9]),
-        
+
         new VersionNumberString(2, 1, 0, glVersionStrings02[0]),
         new VersionNumberString(2, 0, 0, glVersionStrings02[1]),
         new VersionNumberString(2, 0, 0, glVersionStrings02[2]),
@@ -135,10 +135,10 @@ public class TestGLVersionParsing00NEWT extends UITestCase {
         new VersionNumberString(0, 0, 0, glVersionStrings02[0]),
         new VersionNumberString(0, 0, 0, glVersionStrings02[1]),
         new VersionNumberString(0, 0, 0, glVersionStrings02[2]),
-        new VersionNumberString(0, 0, 0, glVersionStrings02[3]),        
-        new VersionNumberString(0, 0, 0, glVersionStrings02[4])        
+        new VersionNumberString(0, 0, 0, glVersionStrings02[3]),
+        new VersionNumberString(0, 0, 0, glVersionStrings02[4])
     };
-    
+
     @Test
     public void test01GLVersion() throws InterruptedException {
         for(int i=0; i<glVersionNumbers.length; i++) {
@@ -166,7 +166,7 @@ public class TestGLVersionParsing00NEWT extends UITestCase {
             Assert.assertTrue(!has.hasMinor());
             Assert.assertTrue(!has.hasSub());
             Assert.assertTrue(!has.isValid());
-        }        
+        }
         {
             final GLVersionNumber has = GLVersionNumber.create("GL Nope");
             System.err.println("Test-X3: "+has+", valid "+has.isValid()+", define ["+has.hasMajor()+":"+has.hasMinor()+":"+has.hasSub()+"]");
@@ -174,10 +174,10 @@ public class TestGLVersionParsing00NEWT extends UITestCase {
             Assert.assertTrue(!has.hasMinor());
             Assert.assertTrue(!has.hasSub());
             Assert.assertTrue(!has.isValid());
-        }        
+        }
     }
 
-    private void testGLVendorVersionImpl(VersionNumberString[] versionNumberString, boolean withMajor, boolean withMinor, boolean withSub) throws InterruptedException {
+    private void testGLVendorVersionImpl(final VersionNumberString[] versionNumberString, final boolean withMajor, final boolean withMinor, final boolean withSub) throws InterruptedException {
         for(int i=0; i<versionNumberString.length; i++) {
             final VersionNumberString exp = versionNumberString[i];
             final VersionNumberString has = GLVersionNumber.createVendorVersion(exp.getVersionString());
@@ -188,16 +188,16 @@ public class TestGLVersionParsing00NEWT extends UITestCase {
             Assert.assertEquals(exp, has);
         }
     }
-    
+
     @Test
     public void test02GLVendorVersion() throws InterruptedException {
         testGLVendorVersionImpl(glVendorVersionNumbersWithSub, true, true, true);
         testGLVendorVersionImpl(glVendorVersionNumbersNoSub, true, true, false);
         testGLVendorVersionImpl(glVendorVersionNumbersNone, false, false, false);
     }
-    
-    public static void main(String args[]) throws IOException {
-        String tstname = TestGLVersionParsing00NEWT.class.getName();
+
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestGLVersionParsing00NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGPUMemSec01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGPUMemSec01NEWT.java
index 93713c7..1f9e6e8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGPUMemSec01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestGPUMemSec01NEWT.java
@@ -50,17 +50,17 @@ import org.junit.runners.MethodSorters;
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestGPUMemSec01NEWT extends UITestCase {
-    static String hexString(int i) {
+    static String hexString(final int i) {
         return "0x"+Integer.toHexString(i);
     }
-    static String exceptionMsg(String pre, int format, int type, int components, int width, int height, int rl1, int rl4, int rl8) {
-        return pre + 
+    static String exceptionMsg(final String pre, final int format, final int type, final int components, final int width, final int height, final int rl1, final int rl4, final int rl8) {
+        return pre +
              ": fmt "+hexString(format)+", type "+hexString(type)+", comps "+components+
              ", "+width+"x"+height+
-             ", rowlenA1 "+rl1+", rowlenA4 "+rl4+", rowlenA8 "+rl8;        
+             ", rowlenA1 "+rl1+", rowlenA4 "+rl4+", rowlenA8 "+rl8;
     }
-    
-    static NEWTGLContext.WindowContext createCurrentGLOffscreenWindow(GLProfile glp, int width, int height) throws GLException, InterruptedException {
+
+    static NEWTGLContext.WindowContext createCurrentGLOffscreenWindow(final GLProfile glp, final int width, final int height) throws GLException, InterruptedException {
         final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOffscreenWindow(
                 new GLCapabilities(glp), width, height, true);
         final GL gl = winctx.context.getGL();
@@ -68,112 +68,112 @@ public class TestGPUMemSec01NEWT extends UITestCase {
         // System.err.println("Pre GL Error: 0x"+Integer.toHexString(gl.glGetError()));
         // System.err.println(winctx.drawable);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         // misc GL setup
         gl.glClearColor(1, 1, 1, 1);
         gl.glEnable(GL.GL_DEPTH_TEST);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        gl.glViewport(0, 0, width, height);        
+        gl.glViewport(0, 0, width, height);
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         return winctx;
     }
-    
-    static int readPixelsCheck(GL gl, int format, int type, int components, int width, int height) throws InterruptedException {
+
+    static int readPixelsCheck(final GL gl, final int format, final int type, final int components, final int width, final int height) throws InterruptedException {
         int expectedExceptions = 0;
-        
-        final int rowlenA1 = width * components;    
-        
-        final int rowlenA4 = ( ( width * components + 3 ) / 4 ) * 4 ;        
+
+        final int rowlenA1 = width * components;
+
+        final int rowlenA4 = ( ( width * components + 3 ) / 4 ) * 4 ;
         Assert.assertTrue(rowlenA4 % 4 == 0);
 
         final int rowlenA8 = ( ( width * components + 7 ) / 8 ) * 8 ;
         Assert.assertTrue(rowlenA8 % 8 == 0);
-        
-        GLPixelStorageModes psm = new GLPixelStorageModes();
+
+        final GLPixelStorageModes psm = new GLPixelStorageModes();
         psm.setPackAlignment(gl, 1);
-        
+
         Exception ee = null;
-        
+
         // ok size !
         try {
-            ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1);
+            final ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1);
             gl.glReadPixels(0, 0, width, height, format, type, bb);
             Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             ee = e;
         }
         Assert.assertNull(
-            exceptionMsg("Unexpected IndexOutOfBoundsException (size ok, alignment 1)", 
+            exceptionMsg("Unexpected IndexOutOfBoundsException (size ok, alignment 1)",
                          format, type, components, width, height, rowlenA1, rowlenA4, rowlenA8), ee);
         ee = null;
-        
-        
+
+
         // too small -10 !
         try {
-            ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1-10);
+            final ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1-10);
             gl.glReadPixels(0, 0, width, height, format, type, bb);
             Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             ee = e;
             System.err.println(
-                exceptionMsg("OK Expected IndexOutOfBoundsException (size-10 bytes)", 
+                exceptionMsg("OK Expected IndexOutOfBoundsException (size-10 bytes)",
                              format, type, components, width, height, rowlenA1, rowlenA4, rowlenA8)+
                              ": "+ee.getMessage());
-            expectedExceptions++;            
+            expectedExceptions++;
         }
         Assert.assertNotNull(
-            exceptionMsg("Expected IndexOutOfBoundsException (size-10 bytes)", 
+            exceptionMsg("Expected IndexOutOfBoundsException (size-10 bytes)",
                          format, type, components, width, height, rowlenA1, rowlenA4, rowlenA8), ee);
         ee = null;
-        
+
         // too small size/4 !
         try {
-            ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1/4);
+            final ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1/4);
             gl.glReadPixels(0, 0, width, height, format, type, bb);
             Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             ee = e;
             System.err.println(
-                exceptionMsg("OK Expected IndexOutOfBoundsException (size/4 bytes)", 
+                exceptionMsg("OK Expected IndexOutOfBoundsException (size/4 bytes)",
                              format, type, components, width, height, rowlenA1, rowlenA4, rowlenA8)+
                              ": "+ee.getMessage());
-            expectedExceptions++;            
+            expectedExceptions++;
         }
         Assert.assertNotNull(
-            exceptionMsg("Expected IndexOutOfBoundsException (size/4 bytes)", 
+            exceptionMsg("Expected IndexOutOfBoundsException (size/4 bytes)",
                          format, type, components, width, height, rowlenA1, rowlenA4, rowlenA8), ee);
         ee = null;
 
         //
         // Alignment test
-        //         
+        //
         psm.setPackAlignment(gl, 4);
-        
+
         // ok size !
         try {
-            ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA4);
+            final ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA4);
             gl.glReadPixels(0, 0, width, height, format, type, bb);
             Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             ee = e;
         }
         Assert.assertNull(
-            exceptionMsg("Unexpected IndexOutOfBoundsException (size ok, alignment 4)", 
+            exceptionMsg("Unexpected IndexOutOfBoundsException (size ok, alignment 4)",
                          format, type, components, width, height, rowlenA1, rowlenA4, rowlenA8), ee);
         ee = null;
-        
+
         // too small if rowlenA1%4 > 0
         try {
-            ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1);
+            final ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1);
             gl.glReadPixels(0, 0, width, height, format, type, bb);
             Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             ee = e;
             if(rowlenA1%4>0) {
                 System.err.println(
-                    exceptionMsg("OK Expected IndexOutOfBoundsException (alignment 4)", 
+                    exceptionMsg("OK Expected IndexOutOfBoundsException (alignment 4)",
                                  format, type, components, width, height, rowlenA1, rowlenA4, rowlenA8)+
                                  ": "+ee.getMessage());
                 expectedExceptions++;
@@ -181,40 +181,40 @@ public class TestGPUMemSec01NEWT extends UITestCase {
         }
         if(rowlenA1%4>0) {
             Assert.assertNotNull(
-                exceptionMsg("Expected IndexOutOfBoundsException (alignment 4)", 
+                exceptionMsg("Expected IndexOutOfBoundsException (alignment 4)",
                              format, type, components, width, height, rowlenA1, rowlenA4, rowlenA8), ee);
         } else {
             Assert.assertNull(
-                exceptionMsg("Unexpected IndexOutOfBoundsException (alignment 4)", 
-                             format, type, components, width, height, rowlenA1, rowlenA4, rowlenA8), ee);            
+                exceptionMsg("Unexpected IndexOutOfBoundsException (alignment 4)",
+                             format, type, components, width, height, rowlenA1, rowlenA4, rowlenA8), ee);
         }
         ee = null;
-        
+
         psm.setPackAlignment(gl, 8);
-        
+
         // ok size !
         try {
-            ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA8);
+            final ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA8);
             gl.glReadPixels(0, 0, width, height, format, type, bb);
             Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             ee = e;
         }
         Assert.assertNull(
-            exceptionMsg("Unexpected IndexOutOfBoundsException (size ok, alignment 8)", 
+            exceptionMsg("Unexpected IndexOutOfBoundsException (size ok, alignment 8)",
                          format, type, components, width, height, rowlenA1, rowlenA4, rowlenA8), ee);
         ee = null;
-        
+
         // too small if rowlenA1%8 > 0
         try {
-            ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1);
+            final ByteBuffer bb = Buffers.newDirectByteBuffer(height*rowlenA1);
             gl.glReadPixels(0, 0, width, height, format, type, bb);
             Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        } catch(IndexOutOfBoundsException e) {
+        } catch(final IndexOutOfBoundsException e) {
             ee = e;
             if(rowlenA1%8>0) {
                 System.err.println(
-                    exceptionMsg("OK Expected IndexOutOfBoundsException (alignment 8)", 
+                    exceptionMsg("OK Expected IndexOutOfBoundsException (alignment 8)",
                                  format, type, components, width, height, rowlenA1, rowlenA4, rowlenA8)+
                                  ": "+ee.getMessage());
                 expectedExceptions++;
@@ -222,89 +222,89 @@ public class TestGPUMemSec01NEWT extends UITestCase {
         }
         if(rowlenA1%8>0) {
             Assert.assertNotNull(
-                exceptionMsg("Expected IndexOutOfBoundsException (alignment 8)", 
+                exceptionMsg("Expected IndexOutOfBoundsException (alignment 8)",
                              format, type, components, width, height, rowlenA1, rowlenA4, rowlenA8), ee);
         } else {
             Assert.assertNull(
-                exceptionMsg("Unexpected IndexOutOfBoundsException (alignment 8)", 
-                             format, type, components, width, height, rowlenA1, rowlenA4, rowlenA8), ee);            
+                exceptionMsg("Unexpected IndexOutOfBoundsException (alignment 8)",
+                             format, type, components, width, height, rowlenA1, rowlenA4, rowlenA8), ee);
         }
         ee = null;
-        
-        psm.restore(gl);        
-        
-        return expectedExceptions;            
+
+        psm.restore(gl);
+
+        return expectedExceptions;
     }
-    
+
     @Test
     public void testReadPixelsGL_640x480xRGBAxUB() throws InterruptedException {
-        GLProfile glp = GLProfile.getDefault();
+        final GLProfile glp = GLProfile.getDefault();
         final int width = 640;
         final int height= 480;
-        
+
         // preset ..
         final NEWTGLContext.WindowContext winctx = createCurrentGLOffscreenWindow(glp, width, height);
         final GLDrawable drawable = winctx.context.getGLDrawable();
         final GL gl = winctx.context.getGL();
-        
+
         // 2 x too small - 0 x alignment
         Assert.assertEquals(2, readPixelsCheck(gl, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, 4, width, height));
-                        
+
         drawable.swapBuffers();
         Thread.sleep(50);
-        
+
         NEWTGLContext.destroyWindow(winctx);
     }
 
     @Test
     public void testReadPixelsGL_99x100xRGBxUB() throws InterruptedException {
-        GLProfile glp = GLProfile.getGL2ES2();
+        final GLProfile glp = GLProfile.getGL2ES2();
         final int wwidth = 640;
         final int wheight= 480;
         final int rwidth =  99;
         final int rheight= 100;
-        
+
         // preset ..
         final NEWTGLContext.WindowContext winctx = createCurrentGLOffscreenWindow(glp, wwidth, wheight);
         final GLDrawable drawable = winctx.context.getGLDrawable();
         final GL gl = winctx.context.getGL();
-        
+
         // 2 x too small - 1 x alignment
         Assert.assertEquals(3, readPixelsCheck(gl, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, 4, rwidth, rheight));
-                        
+
         drawable.swapBuffers();
         Thread.sleep(50);
-        
+
         NEWTGLContext.destroyWindow(winctx);
     }
-    
+
     @Test
     public void testReadPixelsGL2GL3_640x480xRGBxUB() throws InterruptedException {
-        GLProfile glp = GLProfile.getGL2ES2();
+        final GLProfile glp = GLProfile.getGL2ES2();
         if(!glp.isGL2ES3()) {
             System.err.println("GL2ES3 n/a skip test");
             return;
         }
         final int width = 640;
         final int height= 480;
-        
+
         // preset ..
         final NEWTGLContext.WindowContext winctx = createCurrentGLOffscreenWindow(glp, width, height);
         final GLDrawable drawable = winctx.context.getGLDrawable();
         final GL gl = winctx.context.getGL();
-        
+
         // 2 x too small - 0 x alignment
         Assert.assertEquals(2, readPixelsCheck(gl, GL.GL_RGB, GL.GL_UNSIGNED_BYTE, 3, width, height));
-                        
+
         drawable.swapBuffers();
         Thread.sleep(50);
-        
+
         NEWTGLContext.destroyWindow(winctx);
     }
-    
+
     @Test
     public void testReadPixelsGL2GL3_99x100xRGBxUB() throws InterruptedException {
-        GLProfile glp = GLProfile.getGL2ES2();
+        final GLProfile glp = GLProfile.getGL2ES2();
         if(!glp.isGL2ES3()) {
             System.err.println("GL2ES3 n/a skip test");
             return;
@@ -313,24 +313,24 @@ public class TestGPUMemSec01NEWT extends UITestCase {
         final int wheight= 480;
         final int rwidth =  99;
         final int rheight= 100;
-        
+
         // preset ..
         final NEWTGLContext.WindowContext winctx = createCurrentGLOffscreenWindow(glp, wwidth, wheight);
         final GLDrawable drawable = winctx.context.getGLDrawable();
         final GL gl = winctx.context.getGL();
-        
+
         // 2 x too small - 2 x alignment
         Assert.assertEquals(4, readPixelsCheck(gl, GL.GL_RGB, GL.GL_UNSIGNED_BYTE, 3, rwidth, rheight));
-                        
+
         drawable.swapBuffers();
         Thread.sleep(50);
-        
+
         NEWTGLContext.destroyWindow(winctx);
     }
-    
+
     @Test
     public void testReadPixelsGL2GL3_640x480xREDxUB() throws InterruptedException {
-        GLProfile glp = GLProfile.getGL2ES2();
+        final GLProfile glp = GLProfile.getGL2ES2();
         if(!glp.isGL2ES3()) {
             System.err.println("GL2ES3 n/a skip test");
             return;
@@ -342,45 +342,45 @@ public class TestGPUMemSec01NEWT extends UITestCase {
         final NEWTGLContext.WindowContext winctx = createCurrentGLOffscreenWindow(glp, width, height);
         final GLDrawable drawable = winctx.context.getGLDrawable();
         final GL2GL3 gl = winctx.context.getGL().getGL2GL3();
-        
+
         // 2 x too small - 0 x alignment
         Assert.assertEquals(2, readPixelsCheck(gl, GL2ES2.GL_RED, GL.GL_UNSIGNED_BYTE, 1, width, height));
-                        
+
         drawable.swapBuffers();
         Thread.sleep(50);
-        
+
         NEWTGLContext.destroyWindow(winctx);
     }
 
     @Test
     public void testReadPixelsGL2GL3_102x100xREDxUB() throws InterruptedException {
-        GLProfile glp = GLProfile.getGL2ES2();
+        final GLProfile glp = GLProfile.getGL2ES2();
         if(!glp.isGL2ES3()) {
             System.err.println("GL2ES3 n/a skip test");
             return;
         }
-        int wwidth = 640;
-        int wheight= 480;
-        int rwidth = 102;
-        int rheight= 100;
+        final int wwidth = 640;
+        final int wheight= 480;
+        final int rwidth = 102;
+        final int rheight= 100;
 
         // preset ..
         final NEWTGLContext.WindowContext winctx = createCurrentGLOffscreenWindow(glp, wwidth, wheight);
         final GLDrawable drawable = winctx.context.getGLDrawable();
         final GL2GL3 gl = winctx.context.getGL().getGL2GL3();
-        
+
         // 2 x too small - 2 x alignment
         Assert.assertEquals(4, readPixelsCheck(gl, GL2ES2.GL_RED, GL.GL_UNSIGNED_BYTE, 1, rwidth, rheight));
-                        
+
         drawable.swapBuffers();
         Thread.sleep(50);
-        
+
         NEWTGLContext.destroyWindow(winctx);
     }
-    
-    public static void main(String args[]) throws IOException {
-        String tstname = TestGPUMemSec01NEWT.class.getName();
+
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestGPUMemSec01NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
-    }    
+    }
 }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent01NEWT.java
index 7aca280..2fc3071 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent01NEWT.java
@@ -66,16 +66,16 @@ public class TestInitConcurrent01NEWT extends InitConcurrentBaseNEWT {
         }
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
-        String tstname = TestInitConcurrent01NEWT.class.getName();
+        final String tstname = TestInitConcurrent01NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent02NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent02NEWT.java
index 67b3cef..71796e5 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestInitConcurrent02NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.io.IOException;
@@ -46,7 +46,7 @@ import com.jogamp.common.os.Platform;
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestInitConcurrent02NEWT extends InitConcurrentBaseNEWT {
     static boolean mainRun = false;
-    
+
     @Test(timeout=180000) // TO 3 min
     public void test02TwoThreads() throws InterruptedException {
         if(!mainRun) {
@@ -55,7 +55,7 @@ public class TestInitConcurrent02NEWT extends InitConcurrentBaseNEWT {
         }
         runJOGLTasks(2, false);
     }
-    
+
     @Test(timeout=180000) // TO 3 min
     public void test02FourThreads() throws InterruptedException {
         if(!mainRun) {
@@ -64,7 +64,7 @@ public class TestInitConcurrent02NEWT extends InitConcurrentBaseNEWT {
         }
         runJOGLTasks(4, false);
     }
-    
+
     @Test(timeout=180000) // TO 3 min
     public void test16SixteenThreads() throws InterruptedException {
         if(!mainRun) {
@@ -78,9 +78,9 @@ public class TestInitConcurrent02NEWT extends InitConcurrentBaseNEWT {
             runJOGLTasks( 6, false);
         }
     }
-    
-    public static void main(String args[]) throws IOException {
-        mainRun = true;        
+
+    public static void main(final String args[]) throws IOException {
+        mainRun = true;
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-normalRun")) {
                 mainRun = false;
@@ -88,10 +88,10 @@ public class TestInitConcurrent02NEWT extends InitConcurrentBaseNEWT {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
-        String tstname = TestInitConcurrent02NEWT.class.getName();
+        final String tstname = TestInitConcurrent02NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLCanvasAWT.java
index 5c60d09..6395c14 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLCanvasAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.io.IOException;
@@ -43,12 +43,12 @@ public class TestMainVersionGLCanvasAWT extends UITestCase {
 
     @Test
     public void testMain() throws InterruptedException {
-        GLCanvas.main(null);
+        GLCanvas.main(new String[0]);
     }
 
 
-    public static void main(String args[]) throws IOException {
-        String tstname = TestMainVersionGLCanvasAWT.class.getName();
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestMainVersionGLCanvasAWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLWindowNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLWindowNEWT.java
index 85de65e..3b9a8c9 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLWindowNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMainVersionGLWindowNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.io.IOException;
@@ -43,7 +43,7 @@ public class TestMainVersionGLWindowNEWT extends UITestCase {
 
     @Test
     public void testMain() throws InterruptedException {
-        JoglVersion j = JoglVersion.getInstance();
+        final JoglVersion j = JoglVersion.getInstance();
         System.out.println("Implementation-Version: "+j.getImplementationVersion());
         System.out.println("Implementation-Build: "+j.getImplementationBuild());
         System.out.println("Implementation-Branch: "+j.getImplementationBranch());
@@ -52,9 +52,9 @@ public class TestMainVersionGLWindowNEWT extends UITestCase {
     }
 
 
-    public static void main(String[] args) throws IOException {
+    public static void main(final String[] args) throws IOException {
         TestMainVersionGLWindowNEWT.args = args;
-        String tstname = TestMainVersionGLWindowNEWT.class.getName();
+        final String tstname = TestMainVersionGLWindowNEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMapBufferRead01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMapBufferRead01NEWT.java
index 23778ec..d94c24a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMapBufferRead01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestMapBufferRead01NEWT.java
@@ -63,7 +63,7 @@ public class TestMapBufferRead01NEWT extends UITestCase {
             System.err.println("Test requires GL2/GL3 profile.");
             return;
         }
-        ByteBuffer verticiesBB = ByteBuffer.allocate(4*9);
+        final ByteBuffer verticiesBB = ByteBuffer.allocate(4*9);
         verticiesBB.order(ByteOrder.nativeOrder());
         testWriteRead01(verticiesBB, false /* useRange */);
     }
@@ -73,7 +73,7 @@ public class TestMapBufferRead01NEWT extends UITestCase {
             System.err.println("Test requires GL2/GL3 profile.");
             return;
         }
-        ByteBuffer verticiesBB = Buffers.newDirectByteBuffer(4*9);
+        final ByteBuffer verticiesBB = Buffers.newDirectByteBuffer(4*9);
         testWriteRead01(verticiesBB, false /* useRange */);
     }
 
@@ -83,7 +83,7 @@ public class TestMapBufferRead01NEWT extends UITestCase {
             System.err.println("Test requires GL3 or GLES3 profile.");
             return;
         }
-        ByteBuffer verticiesBB = ByteBuffer.allocate(4*9);
+        final ByteBuffer verticiesBB = ByteBuffer.allocate(4*9);
         verticiesBB.order(ByteOrder.nativeOrder());
         testWriteRead01(verticiesBB, true/* useRange */);
     }
@@ -93,18 +93,18 @@ public class TestMapBufferRead01NEWT extends UITestCase {
             System.err.println("Test requires GL3 or GLES3 profile.");
             return;
         }
-        ByteBuffer verticiesBB = Buffers.newDirectByteBuffer(4*9);
+        final ByteBuffer verticiesBB = Buffers.newDirectByteBuffer(4*9);
         testWriteRead01(verticiesBB, true /* useRange */);
     }
 
-    private void testWriteRead01(ByteBuffer verticiesBB, boolean useRange) throws InterruptedException {
+    private void testWriteRead01(final ByteBuffer verticiesBB, final boolean useRange) throws InterruptedException {
         final GLProfile glp = GLProfile.getMaxProgrammable(true);
         final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOffscreenWindow(
                 new GLCapabilities(glp), 800, 600, true);
         try {
             final GL gl = winctx.context.getGL();
 
-            int[] vertexBuffer = new int[1];
+            final int[] vertexBuffer = new int[1];
 
             verticiesBB.putFloat(-0.3f);
             verticiesBB.putFloat(-0.2f);
@@ -171,8 +171,8 @@ public class TestMapBufferRead01NEWT extends UITestCase {
             NEWTGLContext.destroyWindow(winctx);
         }
     }
-    public static void main(String args[]) throws IOException {
-        String tstname = TestMapBufferRead01NEWT.class.getName();
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestMapBufferRead01NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNEWTCloseX11DisplayBug565.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNEWTCloseX11DisplayBug565.java
index 83e55b7..a0e846d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNEWTCloseX11DisplayBug565.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNEWTCloseX11DisplayBug565.java
@@ -1,6 +1,7 @@
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import jogamp.nativewindow.x11.X11Util;
+
 import org.junit.Assert;
 import org.junit.Test;
 import org.junit.FixMethodOrder;
@@ -10,22 +11,21 @@ import com.jogamp.newt.opengl.GLWindow;
 
 import javax.media.nativewindow.NativeWindowFactory;
 import javax.media.opengl.DefaultGLCapabilitiesChooser;
+import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLCapabilitiesImmutable;
 import javax.media.opengl.GLDrawableFactory;
 import javax.media.opengl.GLOffscreenAutoDrawable;
-import javax.media.opengl.GLPbuffer;
 import javax.media.opengl.GLProfile;
 
 /**
- * Tests the closing the device of GLWindow and GLPBuffer in JOGL
+ * Tests the closing the device of GLWindow and off-screen GLAutoDrawable using FBO and PBuffer in JOGL
  */
- at SuppressWarnings("deprecation")
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestNEWTCloseX11DisplayBug565 {
 
   @Test
-  public void testX11WindowMemoryLeak() throws Exception {
+  public void test01X11WindowMemoryLeak() throws Exception {
     GLProfile.initSingleton(); // ensure shared resource runner is done
     try {
       for ( int j = 0; j < 10; j++ ) {
@@ -36,9 +36,9 @@ public class TestNEWTCloseX11DisplayBug565 {
             open0 = 0;
         }
 
-        GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault( ) );
+        final GLCapabilitiesImmutable caps = new GLCapabilities( GLProfile.getDefault( ) );
 
-        GLWindow window = GLWindow.create(caps);
+        final GLWindow window = GLWindow.create(caps);
         window.setTitle("NEWT Resource X11 Leak - #" + j );
         window.setSize( 128, 128 );
         window.setVisible(true);
@@ -56,7 +56,7 @@ public class TestNEWTCloseX11DisplayBug565 {
         }
       }
     }
-    catch ( Exception e ) {
+    catch ( final Exception e ) {
       e.printStackTrace();
       Assert.fail(e.getMessage());
     }
@@ -64,7 +64,7 @@ public class TestNEWTCloseX11DisplayBug565 {
 
 
   @Test
-  public void testX11WindowMemoryLeakGLPbuffer() throws Exception {
+  public void test02X11WindowMemoryLeakPBufferAutoDrawable() throws Exception {
     GLProfile.initSingleton(); // ensure shared resource runner is done
     try {
       for ( int j = 0; j < 10; j++ ) {
@@ -75,17 +75,9 @@ public class TestNEWTCloseX11DisplayBug565 {
             open0 = 0;
         }
         final GLProfile glp = GLProfile.getDefault( );
-        GLCapabilitiesImmutable caps = new GLCapabilities( glp );
-
-
-        GLPbuffer buffer = GLDrawableFactory.getFactory( glp ).createGLPbuffer(
-            null,
-            caps,
-            new DefaultGLCapabilitiesChooser(),
-            256,
-            256,
-            null
-        );
+        final GLCapabilities caps = new GLCapabilities( glp );
+        caps.setPBuffer(true);
+        final GLAutoDrawable buffer = GLDrawableFactory.getFactory( glp ).createOffscreenAutoDrawable(null, caps, null, 256, 256);
         buffer.display();
         buffer.destroy();
 
@@ -99,14 +91,14 @@ public class TestNEWTCloseX11DisplayBug565 {
         }
       }
     }
-    catch ( Exception e ) {
+    catch ( final Exception e ) {
       e.printStackTrace();
       Assert.fail(e.getMessage());
     }
   }
 
   @Test
-  public void testX11WindowMemoryLeakFBOAutoDrawable() throws Exception {
+  public void test03X11WindowMemoryLeakFBOAutoDrawable() throws Exception {
     GLProfile.initSingleton(); // ensure shared resource runner is done
     try {
       for ( int j = 0; j < 10; j++ ) {
@@ -117,10 +109,10 @@ public class TestNEWTCloseX11DisplayBug565 {
             open0 = 0;
         }
         final GLProfile glp = GLProfile.getDefault( );
-        GLCapabilitiesImmutable caps = new GLCapabilities( glp );
+        final GLCapabilitiesImmutable caps = new GLCapabilities( glp );
 
 
-        GLOffscreenAutoDrawable buffer = GLDrawableFactory.getFactory( glp ).createOffscreenAutoDrawable(
+        final GLOffscreenAutoDrawable buffer = GLDrawableFactory.getFactory( glp ).createOffscreenAutoDrawable(
             null, caps, new DefaultGLCapabilitiesChooser(), 256, 256);
         buffer.display();
         buffer.destroy();
@@ -135,13 +127,13 @@ public class TestNEWTCloseX11DisplayBug565 {
         }
       }
     }
-    catch ( Exception e ) {
+    catch ( final Exception e ) {
       e.printStackTrace();
       Assert.fail(e.getMessage());
     }
   }
 
-  public static void main(String args[]) {
+  public static void main(final String args[]) {
     org.junit.runner.JUnitCore.main(TestNEWTCloseX11DisplayBug565.class.getName());
   }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNVSwapGroupNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNVSwapGroupNEWT.java
index e41f22a..b0c6bd6 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNVSwapGroupNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestNVSwapGroupNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import com.jogamp.newt.opengl.GLWindow;
@@ -63,31 +63,31 @@ public class TestNVSwapGroupNEWT extends UITestCase {
         height = 256;
     }
 
-    protected GLWindow runTestGL(Animator animator, int x, int y, final int group, final int barrier) {
-        GLWindow glWindow = GLWindow.create(caps);
+    protected GLWindow runTestGL(final Animator animator, final int x, final int y, final int group, final int barrier) {
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y);
 
         glWindow.setSize(width, height);
 
-        GearsES2 gears = new GearsES2(1);
+        final GearsES2 gears = new GearsES2(1);
         glWindow.addGLEventListener(new GLEventListener() {
-            public void init(GLAutoDrawable drawable) {
-                int[] maxVals = new int[] { -1, -1 } ;
-                GLContext glc = drawable.getContext();
-                boolean r = glc.queryMaxSwapGroups(maxVals, 0, maxVals, 1);
+            public void init(final GLAutoDrawable drawable) {
+                final int[] maxVals = new int[] { -1, -1 } ;
+                final GLContext glc = drawable.getContext();
+                final boolean r = glc.queryMaxSwapGroups(maxVals, 0, maxVals, 1);
                 System.err.println("swap group max groups "+maxVals[0]+", barriers "+maxVals[0]+", "+r);
                 if(maxVals[0]>=group) {
                     System.err.println("swap group joing 1: "+glc.joinSwapGroup(group));
                     if(maxVals[1]>=barrier) {
                         System.err.println("swap group bind 1-1: "+glc.bindSwapBarrier(group, barrier));
                     }
-                }                
+                }
             }
-            public void dispose(GLAutoDrawable drawable) {}
-            public void display(GLAutoDrawable drawable) {}
-            public void reshape(GLAutoDrawable drawable, int x, int y,
-                    int width, int height) {}
+            public void dispose(final GLAutoDrawable drawable) {}
+            public void display(final GLAutoDrawable drawable) {}
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y,
+                    final int width, final int height) {}
         });
         glWindow.addGLEventListener(gears);
 
@@ -105,14 +105,14 @@ public class TestNVSwapGroupNEWT extends UITestCase {
     @Test
     public void test01() throws InterruptedException {
         // make sure it won't be active for now !
-        int swap_group = 9999; 
-        int swap_barrier = 9999; 
-        
-        Animator animator = new Animator();
-        GLWindow f1 = runTestGL(animator, 0, 0, swap_group, swap_barrier);
-        InsetsImmutable insets = f1.getInsets();
-        GLWindow f2 = runTestGL(animator, width+insets.getTotalWidth(), 0, swap_group, swap_barrier);
-        animator.setUpdateFPSFrames(1, null);        
+        final int swap_group = 9999;
+        final int swap_barrier = 9999;
+
+        final Animator animator = new Animator();
+        final GLWindow f1 = runTestGL(animator, 0, 0, swap_group, swap_barrier);
+        final InsetsImmutable insets = f1.getInsets();
+        final GLWindow f2 = runTestGL(animator, width+insets.getTotalWidth(), 0, swap_group, swap_barrier);
+        animator.setUpdateFPSFrames(1, null);
         animator.start();
         while(animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
             Thread.sleep(100);
@@ -128,13 +128,13 @@ public class TestNVSwapGroupNEWT extends UITestCase {
 
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         org.junit.runner.JUnitCore.main(TestNVSwapGroupNEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer01GLCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer01GLCanvasAWT.java
index c93e54e..f968867 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer01GLCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer01GLCanvasAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.awt.BorderLayout;
@@ -80,32 +80,32 @@ public class TestOffscreenLayer01GLCanvasAWT extends UITestCase {
         preferredGLSize = new Dimension(400,200);
     }
 
-    private void setupFrameAndShow(final Frame f, java.awt.Component comp) throws InterruptedException, InvocationTargetException {
-        
-        Container c = new Container();
+    private void setupFrameAndShow(final Frame f, final java.awt.Component comp) throws InterruptedException, InvocationTargetException {
+
+        final Container c = new Container();
         c.setLayout(new BorderLayout());
         c.add(new Button("north"), BorderLayout.NORTH);
         c.add(new Button("south"), BorderLayout.SOUTH);
         c.add(new Button("east"), BorderLayout.EAST);
         c.add(new Button("west"), BorderLayout.WEST);
         c.add(comp, BorderLayout.CENTER);
-        
+
         f.setLayout(new BorderLayout());
         f.add(new Button("NORTH"), BorderLayout.NORTH);
         f.add(new Button("SOUTH"), BorderLayout.SOUTH);
         f.add(new Button("EAST"), BorderLayout.EAST);
         f.add(new Button("WEST"), BorderLayout.WEST);
         f.add(c, BorderLayout.CENTER);
-        
+
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 f.pack();
                 f.validate();
                 f.setVisible(true);
-            }});        
+            }});
     }
-    
-    private void end(GLAnimatorControl actrl, final Frame f, Window w) throws InterruptedException, InvocationTargetException {
+
+    private void end(final GLAnimatorControl actrl, final Frame f, final Window w) throws InterruptedException, InvocationTargetException {
         actrl.stop();
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
@@ -119,33 +119,33 @@ public class TestOffscreenLayer01GLCanvasAWT extends UITestCase {
     @Test
     public void testInfo00() throws InterruptedException, InvocationTargetException {
         System.err.println("Java Version: "+Platform.getJavaVersionNumber());
-        System.err.println("OS Version: "+Platform.getOSVersionNumber());        
+        System.err.println("OS Version: "+Platform.getOSVersionNumber());
         System.err.println("JAWTUtil.isOffscreenLayerRequired(): "+JAWTUtil.isOffscreenLayerRequired());
         System.err.println("JAWTUtil.isOffscreenLayerSupported(): "+JAWTUtil.isOffscreenLayerSupported());
     }
-    
+
     @Test
-    public void test01_GLDefault() throws InterruptedException, InvocationTargetException {        
+    public void test01_GLDefault() throws InterruptedException, InvocationTargetException {
         testOffscreenLayerGLCanvas_Impl(null);
     }
-    
+
     @Test
-    public void test01_GL3() throws InterruptedException, InvocationTargetException {        
+    public void test01_GL3() throws InterruptedException, InvocationTargetException {
         if( !GLProfile.isAvailable(GLProfile.GL3) ) {
             System.err.println("GL3 n/a");
             return;
         }
         testOffscreenLayerGLCanvas_Impl(GLProfile.get(GLProfile.GL3));
     }
-    
-    private void testOffscreenLayerGLCanvas_Impl(GLProfile glp) throws InterruptedException, InvocationTargetException {
+
+    private void testOffscreenLayerGLCanvas_Impl(final GLProfile glp) throws InterruptedException, InvocationTargetException {
         if(!JAWTUtil.isOffscreenLayerSupported()) {
             System.err.println("offscreen layer n/a");
             return;
-        }        
+        }
         final Frame frame1 = new Frame("AWT Parent Frame");
-        
-        GLCapabilities caps = new GLCapabilities(glp);
+
+        final GLCapabilities caps = new GLCapabilities(glp);
         if(singleBuffer) {
             caps.setDoubleBuffered(false);
         }
@@ -162,20 +162,20 @@ public class TestOffscreenLayer01GLCanvasAWT extends UITestCase {
         glc.setPreferredSize(preferredGLSize);
         glc.setMinimumSize(preferredGLSize);
         glc.setSize(preferredGLSize);
-        
-        GearsES2 demo1 = new GearsES2(swapInterval);
+
+        final GearsES2 demo1 = new GearsES2(swapInterval);
         if(noAnimation) {
             demo1.setDoRotation(false);
         }
         glc.addGLEventListener(demo1);
-        
+
         frame1.setSize(frameSize0);
         setupFrameAndShow(frame1, glc);
         Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glc, true));
         Assert.assertEquals(true, AWTRobotUtil.waitForVisible(glc, true));
         Assert.assertEquals(true, glc.isOffscreenLayerSurfaceEnabled());
-        
-        GLAnimatorControl animator1 = new Animator(glc);
+
+        final GLAnimatorControl animator1 = new Animator(glc);
         if(!noAnimation) {
             animator1.start();
         }
@@ -187,20 +187,20 @@ public class TestOffscreenLayer01GLCanvasAWT extends UITestCase {
                 frame1.setSize(frameSize1);
                 frame1.pack();
                 frame1.validate();
-            }});        
-        
+            }});
+
         Thread.sleep(durationPerTest/2);
-        
-        end(animator1, frame1, null);  
+
+        end(animator1, frame1, null);
         if( waitForKey ) {
             UITestCase.waitForKey("Continue");
         }
     }
-    
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
-        Window window = glWindow.getDelegatedWindow();
+        final Window window = glWindow.getDelegatedWindow();
         if(debug) {
             MiscUtils.setFieldIfExists(demo, "glDebug", true);
             MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -210,15 +210,15 @@ public class TestOffscreenLayer01GLCanvasAWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
@@ -240,7 +240,7 @@ public class TestOffscreenLayer01GLCanvasAWT extends UITestCase {
         if(waitForKey) {
             UITestCase.waitForKey("Start");
         }
-        String tstname = TestOffscreenLayer01GLCanvasAWT.class.getName();
+        final String tstname = TestOffscreenLayer01GLCanvasAWT.class.getName();
         /*
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer02NewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer02NewtCanvasAWT.java
index 5335d85..d48d490 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer02NewtCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestOffscreenLayer02NewtCanvasAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.awt.BorderLayout;
@@ -80,31 +80,31 @@ public class TestOffscreenLayer02NewtCanvasAWT extends UITestCase {
         preferredGLSize = new Dimension(400,200);
     }
 
-    private void setupFrameAndShow(final Frame f, java.awt.Component comp) throws InterruptedException, InvocationTargetException {
-        Container c = new Container();
+    private void setupFrameAndShow(final Frame f, final java.awt.Component comp) throws InterruptedException, InvocationTargetException {
+        final Container c = new Container();
         c.setLayout(new BorderLayout());
         c.add(new Button("north"), BorderLayout.NORTH);
         c.add(new Button("south"), BorderLayout.SOUTH);
         c.add(new Button("east"), BorderLayout.EAST);
         c.add(new Button("west"), BorderLayout.WEST);
         c.add(comp, BorderLayout.CENTER);
-        
+
         f.setLayout(new BorderLayout());
         f.add(new Button("NORTH"), BorderLayout.NORTH);
         f.add(new Button("SOUTH"), BorderLayout.SOUTH);
         f.add(new Button("EAST"), BorderLayout.EAST);
         f.add(new Button("WEST"), BorderLayout.WEST);
         f.add(c, BorderLayout.CENTER);
-        
+
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 f.pack();
                 f.validate();
                 f.setVisible(true);
-            }});        
+            }});
     }
-    
-    private void end(GLAnimatorControl actrl, final Frame f, Window w) throws InterruptedException, InvocationTargetException {
+
+    private void end(final GLAnimatorControl actrl, final Frame f, final Window w) throws InterruptedException, InvocationTargetException {
         actrl.stop();
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
@@ -114,12 +114,12 @@ public class TestOffscreenLayer02NewtCanvasAWT extends UITestCase {
             w.destroy();
         }
     }
-    
+
     @Test
-    public void test01_GLDefault() throws InterruptedException, InvocationTargetException {        
+    public void test01_GLDefault() throws InterruptedException, InvocationTargetException {
         testOffscreenLayerNewtCanvas_Impl(null);
     }
-    
+
     @Test
     public void test02_GL3() throws InterruptedException, InvocationTargetException {
         if( !GLProfile.isAvailable(GLProfile.GL3) ) {
@@ -128,15 +128,15 @@ public class TestOffscreenLayer02NewtCanvasAWT extends UITestCase {
         }
         testOffscreenLayerNewtCanvas_Impl(GLProfile.get(GLProfile.GL3));
     }
-    
-    private void testOffscreenLayerNewtCanvas_Impl(GLProfile glp) throws InterruptedException, InvocationTargetException {
+
+    private void testOffscreenLayerNewtCanvas_Impl(final GLProfile glp) throws InterruptedException, InvocationTargetException {
         if(!JAWTUtil.isOffscreenLayerSupported()) {
             System.err.println("offscreen layer n/a");
             return;
-        }        
+        }
         final Frame frame1 = new Frame("AWT Parent Frame");
-        
-        GLCapabilities caps = new GLCapabilities(glp);
+
+        final GLCapabilities caps = new GLCapabilities(glp);
         if(singleBuffer) {
             caps.setDoubleBuffered(false);
         }
@@ -148,30 +148,30 @@ public class TestOffscreenLayer02NewtCanvasAWT extends UITestCase {
             caps.setPBuffer(true);
             caps.setOnscreen(true); // get native NEWT Window, not OffscreenWindow
         }
-        GLWindow glWindow1 = GLWindow.create(caps);
-        
+        final GLWindow glWindow1 = GLWindow.create(caps);
+
         final NewtCanvasAWT newtCanvasAWT1 = new NewtCanvasAWT(glWindow1);
         newtCanvasAWT1.setShallUseOffscreenLayer(true); // trigger offscreen layer - if supported
         newtCanvasAWT1.setPreferredSize(preferredGLSize);
         newtCanvasAWT1.setMinimumSize(preferredGLSize);
         newtCanvasAWT1.setSize(preferredGLSize);
-        
-        GearsES2 demo1 = new GearsES2(swapInterval);
+
+        final GearsES2 demo1 = new GearsES2(swapInterval);
         if(noAnimation) {
             demo1.setDoRotation(false);
         }
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
         glWindow1.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT1, glWindow1, null));
-        
+
         frame1.setSize(frameSize0);
         setupFrameAndShow(frame1, newtCanvasAWT1);
         Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glWindow1, true));
         Assert.assertEquals(true, AWTRobotUtil.waitForVisible(glWindow1, true));
         Assert.assertEquals(newtCanvasAWT1.getNativeWindow(),glWindow1.getParent());
         Assert.assertEquals(true, newtCanvasAWT1.isOffscreenLayerSurfaceEnabled());
-        
-        GLAnimatorControl animator1 = new Animator(glWindow1);
+
+        final GLAnimatorControl animator1 = new Animator(glWindow1);
         if(!noAnimation) {
             animator1.start();
         }
@@ -183,20 +183,20 @@ public class TestOffscreenLayer02NewtCanvasAWT extends UITestCase {
                 frame1.setSize(frameSize1);
                 frame1.pack();
                 frame1.validate();
-            }});        
-        
+            }});
+
         Thread.sleep(durationPerTest/2);
-        
+
         end(animator1, frame1, glWindow1);
         if( waitForKey ) {
             UITestCase.waitForKey("Continue");
         }
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
-        Window window = glWindow.getDelegatedWindow();
+        final Window window = glWindow.getDelegatedWindow();
         if(debug) {
             MiscUtils.setFieldIfExists(demo, "glDebug", true);
             MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -206,15 +206,15 @@ public class TestOffscreenLayer02NewtCanvasAWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
@@ -236,7 +236,7 @@ public class TestOffscreenLayer02NewtCanvasAWT extends UITestCase {
         if(waitForKey) {
             UITestCase.waitForKey("Start");
         }
-        String tstname = TestOffscreenLayer02NewtCanvasAWT.class.getName();
+        final String tstname = TestOffscreenLayer02NewtCanvasAWT.class.getName();
         /*
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestPBufferDeadlockAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestPBufferDeadlockAWT.java
index a1f0d33..ec37766 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestPBufferDeadlockAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestPBufferDeadlockAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -30,10 +30,9 @@ package com.jogamp.opengl.test.junit.jogl.acore;
 import java.awt.EventQueue;
 import java.lang.reflect.InvocationTargetException;
 
-import javax.media.opengl.DefaultGLCapabilitiesChooser;
+import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLDrawableFactory;
-import javax.media.opengl.GLPbuffer;
 import javax.media.opengl.GLProfile;
 
 import jogamp.nativewindow.jawt.JAWTUtil;
@@ -47,7 +46,6 @@ import org.junit.runners.MethodSorters;
 import com.jogamp.common.util.RunnableTask;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 
- at SuppressWarnings("deprecation")
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestPBufferDeadlockAWT extends UITestCase {
   static GLProfile glp;
@@ -61,13 +59,9 @@ public class TestPBufferDeadlockAWT extends UITestCase {
     height = 512;
   }
 
-  protected void runTestGL( GLCapabilities caps ) throws InterruptedException, InvocationTargetException {
-    final GLPbuffer pbuffer = GLDrawableFactory.getFactory( GLProfile.getGL2ES2() ).createGLPbuffer(
-        null,
-        caps, new DefaultGLCapabilitiesChooser(),
-        512, 512,
-        null
-    );
+  protected void runTestGL( final GLCapabilities caps ) throws InterruptedException, InvocationTargetException {
+    caps.setPBuffer(true);
+    final GLAutoDrawable pbuffer = GLDrawableFactory.getFactory( caps.getGLProfile() ).createOffscreenAutoDrawable(null, caps, null, 512, 512);
 
     final boolean[] done = {false};
     final Runnable pbufferCreationAction = new Runnable() {
@@ -78,30 +72,30 @@ public class TestPBufferDeadlockAWT extends UITestCase {
         System.err.println("AA.X");
       }
     };
-    
+
     EventQueue.invokeAndWait(new Runnable() {
         public void run() {
             Assert.assertTrue(EventQueue.isDispatchThread());
             JAWTUtil.lockToolkit();
             try {
-                final RunnableTask rTask = new RunnableTask(pbufferCreationAction, new Object(), false, null);                    
+                final RunnableTask rTask = new RunnableTask(pbufferCreationAction, new Object(), false, null);
                 System.err.println("BB.0: "+rTask.getSyncObject());
                 synchronized (rTask.getSyncObject()) {
                     System.err.println("BB.1: "+rTask.getSyncObject());
-                    new Thread(rTask, Thread.currentThread().getName()+"-Pbuffer_Creation").start();                
+                    new Thread(rTask, Thread.currentThread().getName()+"-Pbuffer_Creation").start();
                     try {
                         System.err.println("BB.2");
                         rTask.getSyncObject().wait();
                         System.err.println("BB.3");
-                    } catch (InterruptedException e) {
+                    } catch (final InterruptedException e) {
                         throw new RuntimeException(e);
-                    }                    
+                    }
                     System.err.println("BB.X");
                 }
             } finally {
                 JAWTUtil.unlockToolkit();
             }
-        }        
+        }
     });
     Assert.assertTrue(done[0]);
     pbuffer.destroy();
@@ -109,24 +103,24 @@ public class TestPBufferDeadlockAWT extends UITestCase {
 
   @Test(timeout = 2000) // 2s timeout
   public void testDeadlock() throws InterruptedException, InvocationTargetException {
-    GLCapabilities caps = new GLCapabilities( glp );
+    final GLCapabilities caps = new GLCapabilities( glp );
     runTestGL( caps );
   }
 
   static long duration = 500; // ms
 
-  public static void main( String args[] ) {
+  public static void main( final String args[] ) {
     for ( int i = 0; i < args.length; i++ ) {
       if ( args[ i ].equals( "-time" ) ) {
         i++;
         try {
           duration = Integer.parseInt( args[ i ] );
         }
-        catch ( Exception ex ) {
+        catch ( final Exception ex ) {
           ex.printStackTrace();
         }
       }
     }
     org.junit.runner.JUnitCore.main( TestPBufferDeadlockAWT.class.getName() );
   }
-} 
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java
index 77657f6..44ff2d2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListAWT.java
@@ -106,7 +106,7 @@ public class TestSharedContextListAWT extends UITestCase {
         frame.setLocation(x, y);
         frame.setSize(width, height);
 
-        Gears gears = new Gears(vsync ? 1 : 0);
+        final Gears gears = new Gears(vsync ? 1 : 0);
         if(useShared) {
             gears.setGears(sharedGears.getGear1(), sharedGears.getGear2(), sharedGears.getGear3());
         }
@@ -129,11 +129,11 @@ public class TestSharedContextListAWT extends UITestCase {
         final Frame f1 = new Frame();
         final Frame f2 = new Frame();
         final Frame f3 = new Frame();
-        Animator animator = new Animator();
+        final Animator animator = new Animator();
 
         final GLCanvas glc1 = runTestGL(f1, animator, 0,     0,      true, false);
-        int x0 = f1.getX();
-        int y0 = f1.getY();
+        final int x0 = f1.getX();
+        final int y0 = f1.getY();
 
         final GLCanvas glc2 = runTestGL(f2, animator,
                                         x0+width,
@@ -166,11 +166,11 @@ public class TestSharedContextListAWT extends UITestCase {
                         Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glc2, false));
                         f3.dispose();
                         Assert.assertEquals(true, AWTRobotUtil.waitForRealized(glc3, false));
-                    } catch (Throwable t) {
+                    } catch (final Throwable t) {
                         throw new RuntimeException(t);
                     }
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -180,13 +180,13 @@ public class TestSharedContextListAWT extends UITestCase {
 
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         org.junit.runner.JUnitCore.main(TestSharedContextListAWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java
index 09173fb..6f8d6c6 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT.java
@@ -87,17 +87,17 @@ public class TestSharedContextListNEWT extends UITestCase {
         sharedDrawable = null;
     }
 
-    protected GLWindow runTestGL(Animator animator, int x, int y, boolean useShared, boolean vsync) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
+    protected GLWindow runTestGL(final Animator animator, final int x, final int y, final boolean useShared, final boolean vsync) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared "+useShared);
         if(useShared) {
-            glWindow.setSharedContext(sharedDrawable.getContext());
+            glWindow.setSharedAutoDrawable(sharedDrawable);
         }
 
         glWindow.setSize(width, height);
 
-        Gears gears = new Gears(vsync ? 1 : 0);
+        final Gears gears = new Gears(vsync ? 1 : 0);
         if(useShared) {
             gears.setGears(sharedGears.getGear1(), sharedGears.getGear2(), sharedGears.getGear3());
         }
@@ -116,12 +116,12 @@ public class TestSharedContextListNEWT extends UITestCase {
     @Test
     public void test01() throws InterruptedException {
         initShared();
-        Animator animator = new Animator();
-        GLWindow f1 = runTestGL(animator, 0, 0, true, false);
-        InsetsImmutable insets = f1.getInsets();
-        GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
+        final Animator animator = new Animator();
+        final GLWindow f1 = runTestGL(animator, 0, 0, true, false);
+        final InsetsImmutable insets = f1.getInsets();
+        final GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
                                           f1.getY()+0, true, false);
-        GLWindow f3 = runTestGL(animator, f1.getX()+0,
+        final GLWindow f3 = runTestGL(animator, f1.getX()+0,
                                           f1.getY()+height+insets.getTotalHeight(), false, true);
         animator.setUpdateFPSFrames(1, null);
         animator.start();
@@ -139,13 +139,13 @@ public class TestSharedContextListNEWT extends UITestCase {
 
     static long duration = 500; // ms
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         /**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java
index 967c94e..1646777 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextListNEWT2.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import java.io.IOException;
@@ -87,18 +87,18 @@ public class TestSharedContextListNEWT2 extends UITestCase {
         sharedDrawable = null;
     }
 
-    protected GLWindow runTestGL(Animator animator, int x, int y, boolean useShared, boolean vsync) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
-        
+    protected GLWindow runTestGL(final Animator animator, final int x, final int y, final boolean useShared, final boolean vsync) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
+
         Assert.assertNotNull(glWindow);
         glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared "+useShared);
         if(useShared) {
-            glWindow.setSharedContext(sharedDrawable.getContext());
+            glWindow.setSharedAutoDrawable(sharedDrawable);
         }
 
         glWindow.setSize(width, height);
 
-        Gears gears = new Gears(vsync ? 1 : 0);
+        final Gears gears = new Gears(vsync ? 1 : 0);
         if(useShared) {
             gears.setGears(sharedGears.getGear1(), sharedGears.getGear2(), sharedGears.getGear3());
         }
@@ -111,31 +111,31 @@ public class TestSharedContextListNEWT2 extends UITestCase {
         Assert.assertTrue(AWTRobotUtil.waitForRealized(glWindow, true));
         Assert.assertTrue(AWTRobotUtil.waitForVisible(glWindow, true));
         glWindow.setPosition(x, y);
-        
+
         return glWindow;
     }
 
     @Test(timeout=10000)
     public void test01() throws InterruptedException {
         initShared();
-        
+
         final GLWindow f1 = runTestGL(new Animator(), 0, 0, true, false);
         final InsetsImmutable insets = f1.getInsets();
-        final GLWindow f2 = runTestGL(new Animator(), f1.getX()+width+insets.getTotalWidth(), 
+        final GLWindow f2 = runTestGL(new Animator(), f1.getX()+width+insets.getTotalWidth(),
                                       f1.getY()+0, true, false);
-        final GLWindow f3 = runTestGL(new Animator(), f1.getX()+0, 
+        final GLWindow f3 = runTestGL(new Animator(), f1.getX()+0,
                                       f1.getY()+height+insets.getTotalHeight(), true, false);
 
         try {
 			Thread.sleep(duration);
-		} catch(Exception e) {
+		} catch(final Exception e) {
 			e.printStackTrace();
 		}
 
         f1.destroy();
         f2.destroy();
         f3.destroy();
-        
+
         // f1.getAnimator().stop();
         // f2.getAnimator().stop();
         // f3.getAnimator().stop();
@@ -145,19 +145,19 @@ public class TestSharedContextListNEWT2 extends UITestCase {
 
     static long duration = 2000; // ms
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         /**
         BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         System.err.println("Press enter to continue");
-        System.err.println(stdin.readLine()); */         
+        System.err.println(stdin.readLine()); */
         org.junit.runner.JUnitCore.main(TestSharedContextListNEWT2.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java
index ff98d6f..11ca642 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextNewtAWTBug523.java
@@ -40,6 +40,7 @@ import java.util.HashSet;
 import java.util.Set;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
@@ -51,6 +52,8 @@ import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLOffscreenAutoDrawable;
 import javax.media.opengl.GLProfile;
 import javax.media.opengl.awt.GLCanvas;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
+import javax.media.opengl.fixedfunc.GLPointerFunc;
 import javax.media.opengl.glu.GLU;
 import javax.swing.Box;
 import javax.swing.BoxLayout;
@@ -58,6 +61,7 @@ import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
 import javax.swing.JSlider;
+import javax.swing.SwingConstants;
 import javax.swing.SwingUtilities;
 import javax.swing.event.ChangeEvent;
 import javax.swing.event.ChangeListener;
@@ -119,8 +123,8 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
     // Buffer objects can be shared across shared OpenGL context.
     // If we run with sharedContext, then the tests will use these shared buffer objects,
     // otherwise each event listener allocates its own buffer objects.
-    private static volatile int[] sharedVertexBufferObjects = {0};
-    private static volatile int[] sharedIndexBufferObjects = {0};
+    private static AtomicInteger sharedVertexBufferObjects = new AtomicInteger(0);
+    private static AtomicInteger sharedIndexBufferObjects = new AtomicInteger(0);
 
     @BeforeClass
     public static void initClass() {
@@ -129,7 +133,7 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
         }
     }
 
-    static private GLOffscreenAutoDrawable initShared(GLCapabilities caps) {
+    static private GLOffscreenAutoDrawable initShared(final GLCapabilities caps) {
         final GLOffscreenAutoDrawable sharedDrawable = GLDrawableFactory.getFactory(caps.getGLProfile()).createOffscreenAutoDrawable(null, caps, null, 64, 64);
         Assert.assertNotNull(sharedDrawable);
         // init and render one frame, which will setup the Gears display lists
@@ -140,7 +144,7 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
         return sharedDrawable;
     }
 
-    static private void releaseShared(GLOffscreenAutoDrawable sharedDrawable) {
+    static private void releaseShared(final GLOffscreenAutoDrawable sharedDrawable) {
         if(null != sharedDrawable) {
             sharedDrawable.destroy();
         }
@@ -152,12 +156,12 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
         boolean useShared;
         int canvasWidth;
         int canvasHeight;
-        private final float boundsRadius = 2f;
+        private static final float boundsRadius = 2f;
         private float viewDistance;
-        private float viewDistanceFactor = 1.0f;
+        private static float viewDistanceFactor = 1.0f;
         private float xAxisRotation;
         private float yAxisRotation;
-        private final float viewFovDegrees = 15f;
+        private static final float viewFovDegrees = 15f;
 
         // Buffer objects can be shared across canvas instances, if those canvases are initialized with the same GLContext.
         // If we run with sharedBufferObjects true, then the tests will use these shared buffer objects.
@@ -165,8 +169,8 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
         private final int [] privateVertexBufferObjects = {0};
         private final int [] privateIndexBufferObjects = {0};
 
-        public static int createVertexBuffer(GL2 gl2) {
-            final FloatBuffer vertexBuffer = GLBuffers.newDirectFloatBuffer(18);
+        public static int createVertexBuffer(final GL2 gl2) {
+            final FloatBuffer vertexBuffer = Buffers.newDirectFloatBuffer(18);
             vertexBuffer.put(new float[]{
                     1.0f, -0.5f, 0f,    // vertex 1
                     0f, 0f, 1f,         // normal 1
@@ -179,46 +183,46 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
 
             final int[] vbo = { 0 };
             gl2.glGenBuffers(1, vbo, 0);
-            gl2.glBindBuffer(GL2.GL_ARRAY_BUFFER, vbo[0]);
-            gl2.glBufferData(GL2.GL_ARRAY_BUFFER, vertexBuffer.capacity() * Buffers.SIZEOF_FLOAT, vertexBuffer, GL2.GL_STATIC_DRAW);
-            gl2.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
+            gl2.glBindBuffer(GL.GL_ARRAY_BUFFER, vbo[0]);
+            gl2.glBufferData(GL.GL_ARRAY_BUFFER, vertexBuffer.capacity() * Buffers.SIZEOF_FLOAT, vertexBuffer, GL.GL_STATIC_DRAW);
+            gl2.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
             return vbo[0];
         }
-        public static int createVertexIndexBuffer(GL2 gl2) {
-            final IntBuffer indexBuffer = GLBuffers.newDirectIntBuffer(3);
+        public static int createVertexIndexBuffer(final GL2 gl2) {
+            final IntBuffer indexBuffer = Buffers.newDirectIntBuffer(3);
             indexBuffer.put(new int[]{0, 1, 2});
             indexBuffer.position(0);
 
             final int[] vbo = { 0 };
             gl2.glGenBuffers(1, vbo, 0);
-            gl2.glBindBuffer(GL2.GL_ELEMENT_ARRAY_BUFFER, vbo[0]);
-            gl2.glBufferData(GL2.GL_ELEMENT_ARRAY_BUFFER, indexBuffer.capacity() * Buffers.SIZEOF_INT, indexBuffer, GL2.GL_STATIC_DRAW);
-            gl2.glBindBuffer(GL2.GL_ELEMENT_ARRAY_BUFFER, 0);
+            gl2.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, vbo[0]);
+            gl2.glBufferData(GL.GL_ELEMENT_ARRAY_BUFFER, indexBuffer.capacity() * Buffers.SIZEOF_INT, indexBuffer, GL.GL_STATIC_DRAW);
+            gl2.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
             return vbo[0];
         }
 
-        TwoTriangles (int canvasWidth, int canvasHeight, boolean useShared) {
+        TwoTriangles (final int canvasWidth, final int canvasHeight, final boolean useShared) {
             // instanceNum = instanceCounter++;
             this.canvasWidth = canvasWidth;
             this.canvasHeight = canvasHeight;
             this.useShared = useShared;
         }
 
-        public void setXAxisRotation(float xRot) {
+        public void setXAxisRotation(final float xRot) {
             xAxisRotation = xRot;
         }
 
-        public void setYAxisRotation(float yRot) {
+        public void setYAxisRotation(final float yRot) {
             yAxisRotation = yRot;
         }
 
-        public void setViewDistanceFactor(float factor) {
+        public void setViewDistanceFactor(final float factor) {
             viewDistanceFactor = factor;
         }
 
 
-        public void init(GLAutoDrawable drawable) {
-            GL2 gl2 = drawable.getGL().getGL2();
+        public void init(final GLAutoDrawable drawable) {
+            final GL2 gl2 = drawable.getGL().getGL2();
 
             System.err.println("INIT GL IS: " + gl2.getClass().getName());
 
@@ -237,19 +241,22 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
                 //
                 if (useShared) {
                     System.err.println("Using shared VBOs on slave 0x"+Integer.toHexString(hashCode()));
-                    vertexBufferObjects = sharedVertexBufferObjects;
-                    indexBufferObjects = sharedIndexBufferObjects;
+                    privateVertexBufferObjects[0] = sharedVertexBufferObjects.get();
+                    privateIndexBufferObjects[0] = sharedIndexBufferObjects.get();
                 } else {
                     System.err.println("Using local VBOs on slave 0x"+Integer.toHexString(hashCode()));
-                    vertexBufferObjects = privateVertexBufferObjects;
-                    indexBufferObjects = privateIndexBufferObjects;
                 }
+                vertexBufferObjects = privateVertexBufferObjects;
+                indexBufferObjects = privateIndexBufferObjects;
 
                 // if buffer sharing is enabled, then the first of the two event listeners to be
                 // initialized will allocate the buffers, and the other will re-use the allocated one
                 if (vertexBufferObjects[0] == 0) {
                     System.err.println("Creating vertex VBO on slave 0x"+Integer.toHexString(hashCode()));
                     vertexBufferObjects[0] = createVertexBuffer(gl2);
+                    if (useShared) {
+                        sharedVertexBufferObjects.set(vertexBufferObjects[0]);
+                    }
                 }
 
                 // A check in the case that buffer sharing is enabled but context sharing is not enabled -- in that
@@ -259,13 +266,13 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
                 // I found that with my system glDrawElements causes a runtime exception 50% of the time. Executing the binds
                 // to unshareable buffers sets up glDrawElements for unpredictable crashes -- sometimes it does, sometimes not.
                 if (gl2.glIsBuffer(vertexBufferObjects[0])) {
-                    gl2.glBindBuffer(GL2.GL_ARRAY_BUFFER, vertexBufferObjects[0]);
+                    gl2.glBindBuffer(GL.GL_ARRAY_BUFFER, vertexBufferObjects[0]);
                     //
-                    gl2.glEnableClientState(GL2.GL_VERTEX_ARRAY);
-                    gl2.glVertexPointer(3, GL2.GL_FLOAT, 6 * GLBuffers.SIZEOF_FLOAT, 0);
+                    gl2.glEnableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
+                    gl2.glVertexPointer(3, GL.GL_FLOAT, 6 * Buffers.SIZEOF_FLOAT, 0);
                     //
-                    gl2.glEnableClientState(GL2.GL_NORMAL_ARRAY);
-                    gl2.glNormalPointer(GL2.GL_FLOAT, 6 * GLBuffers.SIZEOF_FLOAT, 3 * GLBuffers.SIZEOF_FLOAT);
+                    gl2.glEnableClientState(GLPointerFunc.GL_NORMAL_ARRAY);
+                    gl2.glNormalPointer(GL.GL_FLOAT, 6 * Buffers.SIZEOF_FLOAT, 3 * Buffers.SIZEOF_FLOAT);
                 } else {
                     System.err.println("Vertex VBO is not a buffer on slave 0x"+Integer.toHexString(hashCode()));
                 }
@@ -273,19 +280,22 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
                 if (indexBufferObjects[0] == 0) {
                     System.err.println("Creating index VBO on slave 0x"+Integer.toHexString(hashCode()));
                     indexBufferObjects[0] = createVertexIndexBuffer(gl2);
+                    if (useShared) {
+                        sharedIndexBufferObjects.set(indexBufferObjects[0]);
+                    }
                 }
 
                 // again, a check in the case that buffer sharing is enabled but context sharing is not enabled
                 if (gl2.glIsBuffer(indexBufferObjects[0])) {
-                    gl2.glBindBuffer(GL2.GL_ELEMENT_ARRAY_BUFFER, indexBufferObjects[0]);
+                    gl2.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, indexBufferObjects[0]);
                 } else {
                     System.err.println("Index VBO is not a buffer on slave 0x"+Integer.toHexString(hashCode()));
                 }
 
-                gl2.glBindBuffer(GL2.GL_ELEMENT_ARRAY_BUFFER, 0);
-                gl2.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
-                gl2.glDisableClientState(GL2.GL_VERTEX_ARRAY);
-                gl2.glDisableClientState(GL2.GL_NORMAL_ARRAY);
+                gl2.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
+                gl2.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+                gl2.glDisableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
+                gl2.glDisableClientState(GLPointerFunc.GL_NORMAL_ARRAY);
 
                 initializationCounter++;
             } // synchronized (this)
@@ -295,12 +305,12 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
 
         }
 
-        public void dispose(GLAutoDrawable drawable) {
+        public void dispose(final GLAutoDrawable drawable) {
 
             synchronized (this) {
                 initializationCounter--;
 
-                GL2 gl2 = drawable.getGL().getGL2();
+                final GL2 gl2 = drawable.getGL().getGL2();
 
                 // release shared resources
                 if (initializationCounter == 0 || !useShared) {
@@ -308,12 +318,13 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
                     int [] vertexBufferObjects;
                     int [] indexBufferObjects;
                     if (useShared) {
-                        vertexBufferObjects = sharedVertexBufferObjects;
-                        indexBufferObjects = sharedIndexBufferObjects;
-                    } else {
-                        vertexBufferObjects = privateVertexBufferObjects;
-                        indexBufferObjects = privateIndexBufferObjects;
+                        privateVertexBufferObjects[0] = sharedVertexBufferObjects.get();
+                        privateIndexBufferObjects[0] = sharedIndexBufferObjects.get();
+                        sharedVertexBufferObjects.set(0);
+                        sharedIndexBufferObjects.set(0);
                     }
+                    vertexBufferObjects = privateVertexBufferObjects;
+                    indexBufferObjects = privateIndexBufferObjects;
 
                     gl2.glDeleteBuffers(1, vertexBufferObjects, 0);
                     logAnyErrorCodes(this, gl2, "dispose.2");
@@ -328,10 +339,10 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
             } // synchronized (this)
         }
 
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
         }
 
-        public void display(GLAutoDrawable drawable) {
+        public void display(final GLAutoDrawable drawable) {
 
             // wait until all instances are initialized before attempting to draw using the
             // vertex array object, because the buffers are allocated in init and when the
@@ -342,22 +353,22 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
                 }
             }
 
-            GL2 gl2 = drawable.getGL().getGL2();
-            GLU glu = new GLU();
+            final GL2 gl2 = drawable.getGL().getGL2();
+            final GLU glu = new GLU();
 
             logAnyErrorCodes(this, gl2, "display.0");
 
             // Clear the drawing area
-            gl2.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
+            gl2.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
 
             gl2.glViewport(0, 0, canvasWidth, canvasHeight);
-            gl2.glMatrixMode(GL2.GL_PROJECTION);
+            gl2.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
             gl2.glLoadIdentity();
             glu.gluPerspective(viewFovDegrees, (float)canvasWidth/(float)canvasHeight,
                                viewDistance*viewDistanceFactor-boundsRadius, viewDistance*viewDistanceFactor+boundsRadius);
 
             // Reset the current matrix to the "identity"
-            gl2.glMatrixMode(GL2.GL_MODELVIEW);
+            gl2.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
             gl2.glLoadIdentity();
 
             // draw the scene
@@ -368,8 +379,8 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
             gl2.glRotatef(xAxisRotation, 1, 0, 0);
             gl2.glRotatef(yAxisRotation, 0, 1, 0);
 
-            gl2.glDisable(GL2.GL_CULL_FACE);
-            gl2.glEnable(GL2.GL_DEPTH_TEST);
+            gl2.glDisable(GL.GL_CULL_FACE);
+            gl2.glEnable(GL.GL_DEPTH_TEST);
 
             logAnyErrorCodes(this, gl2, "display.1");
 
@@ -385,11 +396,11 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
             logAnyErrorCodes(this, gl2, "display.X");
         }
 
-        public void drawTwoTriangles(GL2 gl2) {
+        public void drawTwoTriangles(final GL2 gl2) {
 
             // draw a red triangle the old fashioned way
             gl2.glColor3f(1f, 0f, 0f);
-            gl2.glBegin(GL2.GL_TRIANGLES);
+            gl2.glBegin(GL.GL_TRIANGLES);
             gl2.glVertex3d(-1.5, -0.5, 0);
             gl2.glNormal3d(0, 0, 1);
             gl2.glVertex3d(-0.5, -0.5, 0);
@@ -411,12 +422,11 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
             int [] indexBufferObjects;
             synchronized (this) {
                 if (useShared) {
-                    vertexBufferObjects = sharedVertexBufferObjects;
-                    indexBufferObjects = sharedIndexBufferObjects;
-                } else {
-                    vertexBufferObjects = privateVertexBufferObjects;
-                    indexBufferObjects = privateIndexBufferObjects;
+                    privateVertexBufferObjects[0] = sharedVertexBufferObjects.get();
+                    privateIndexBufferObjects[0] = sharedIndexBufferObjects.get();
                 }
+                vertexBufferObjects = privateVertexBufferObjects;
+                indexBufferObjects = privateIndexBufferObjects;
             } // synchronized (this)
 
             // A check in the case that buffer sharing is enabled but context sharing is not enabled -- in that
@@ -429,12 +439,12 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
             final boolean isVBO2 = gl2.glIsBuffer(vertexBufferObjects[0]);
             final boolean useVBO = isVBO1 && isVBO2;
             if ( useVBO ) {
-                gl2.glBindBuffer(GL2.GL_ARRAY_BUFFER, vertexBufferObjects[0]);
-                gl2.glBindBuffer(GL2.GL_ELEMENT_ARRAY_BUFFER, indexBufferObjects[0]);
+                gl2.glBindBuffer(GL.GL_ARRAY_BUFFER, vertexBufferObjects[0]);
+                gl2.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, indexBufferObjects[0]);
 
-                gl2.glEnableClientState(GL2.GL_VERTEX_ARRAY);
+                gl2.glEnableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
                 // gl2.glVertexPointer(3, GL2.GL_FLOAT, 6 * GLBuffers.SIZEOF_FLOAT, 0);
-                gl2.glEnableClientState(GL2.GL_NORMAL_ARRAY);
+                gl2.glEnableClientState(GLPointerFunc.GL_NORMAL_ARRAY);
                 // gl2.glNormalPointer(GL2.GL_FLOAT, 6 * GLBuffers.SIZEOF_FLOAT, 3 * GLBuffers.SIZEOF_FLOAT);
                 vboBound = true;
             }
@@ -444,24 +454,24 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
 
             if (vboBound) {
                 gl2.glColor3f(0f, 0f, 1f);
-                gl2.glDrawElements(GL2.GL_TRIANGLES, 3, GL2.GL_UNSIGNED_INT, 0);
-                gl2.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
-                gl2.glBindBuffer(GL2.GL_ELEMENT_ARRAY_BUFFER, 0);
-                gl2.glDisableClientState(GL2.GL_VERTEX_ARRAY);
-                gl2.glDisableClientState(GL2.GL_NORMAL_ARRAY);
+                gl2.glDrawElements(GL.GL_TRIANGLES, 3, GL.GL_UNSIGNED_INT, 0);
+                gl2.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+                gl2.glBindBuffer(GL.GL_ELEMENT_ARRAY_BUFFER, 0);
+                gl2.glDisableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
+                gl2.glDisableClientState(GLPointerFunc.GL_NORMAL_ARRAY);
             }
 
             logAnyErrorCodes(this, gl2, "drawTwoTriangles.3");
         }
 
-        public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
+        public void displayChanged(final GLAutoDrawable drawable, final boolean modeChanged, final boolean deviceChanged) {
         }
 
     } // inner class TwoTriangles
 
     private static final Set<String> errorSet = new HashSet<String>();
 
-    public static void logAnyErrorCodes(Object obj, GL gl, String prefix) {
+    public static void logAnyErrorCodes(final Object obj, final GL gl, final String prefix) {
         final int glError = gl.glGetError();
         if(glError != GL.GL_NO_ERROR) {
             final String errStr = "GL-Error: "+prefix + " on obj 0x"+Integer.toHexString(obj.hashCode())+", OpenGL error: 0x" + Integer.toHexString(glError);
@@ -498,19 +508,19 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
      * @return the distance the camera should be from the center of the scenes
      *         bounding sphere
      */
-    public static float setupViewFrustum(GL2 gl2, int width, int height, float boundsRadius, float zoomFactor, float viewFovDegrees) {
+    public static float setupViewFrustum(final GL2 gl2, final int width, final int height, final float boundsRadius, final float zoomFactor, final float viewFovDegrees) {
     	assert boundsRadius > 0.0f;
     	assert zoomFactor > 0.0f;
     	assert viewFovDegrees > 0.0f;
 
-        GLU glu = new GLU();
+        final GLU glu = new GLU();
 
         final float aspectRatio = (float) width / (float) height;
         final float boundRadiusAdjusted = boundsRadius / zoomFactor;
         final float lowestFov = aspectRatio > 1.0f ? viewFovDegrees : aspectRatio * viewFovDegrees;
         final float viewDist = (float) (boundRadiusAdjusted / Math.sin( (lowestFov / 2.0) * (Math.PI / 180.0) ));
 
-        gl2.glMatrixMode(GL2.GL_PROJECTION);
+        gl2.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         gl2.glLoadIdentity();
         glu.gluPerspective(viewFovDegrees, aspectRatio,	0.1*viewDist, viewDist + boundRadiusAdjusted);
 
@@ -549,7 +559,7 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
         // GLDrawableFactory factory = GLDrawableFactory.getFactory(GLProfile.get(GLProfile.GL2));
         // GLContext sharedContext = factory.getOrCreateSharedContext(factory.getDefaultDevice());
         //
-        GLCapabilities glCapabilities = new GLCapabilities(GLProfile.get(GLProfile.GL2));
+        final GLCapabilities glCapabilities = new GLCapabilities(GLProfile.get(GLProfile.GL2));
         glCapabilities.setSampleBuffers(true);
         glCapabilities.setNumSamples(4);
 
@@ -569,19 +579,19 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
         final GLAutoDrawable openGLAutoDrawable2;
 
         if (useNewt) {
-            GLWindow glWindow1 = GLWindow.create(glCapabilities);
+            final GLWindow glWindow1 = GLWindow.create(glCapabilities);
             if(shareContext) {
                 glWindow1.setSharedAutoDrawable(sharedDrawable);
             }
-            NewtCanvasAWT newtCanvasAWT1 = new NewtCanvasAWT(glWindow1);
+            final NewtCanvasAWT newtCanvasAWT1 = new NewtCanvasAWT(glWindow1);
             newtCanvasAWT1.setPreferredSize(new Dimension(eventListener1.canvasWidth, eventListener1.canvasHeight));
             glWindow1.addGLEventListener(eventListener1);
             //
-            GLWindow glWindow2 = GLWindow.create(glCapabilities);
+            final GLWindow glWindow2 = GLWindow.create(glCapabilities);
             if(shareContext) {
                 glWindow2.setSharedAutoDrawable(sharedDrawable);
             }
-            NewtCanvasAWT newtCanvasAWT2 = new NewtCanvasAWT(glWindow2);
+            final NewtCanvasAWT newtCanvasAWT2 = new NewtCanvasAWT(glWindow2);
             newtCanvasAWT2.setPreferredSize(new Dimension(eventListener2.canvasWidth, eventListener2.canvasHeight));
             glWindow2.addGLEventListener(eventListener2);
 
@@ -620,52 +630,52 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
 
         // Create slider for x rotation.
         // The vertically oriented slider rotates around the x axis
-        final JSlider xAxisRotationSlider = new JSlider(JSlider.VERTICAL, -180, 180, 1);
+        final JSlider xAxisRotationSlider = new JSlider(SwingConstants.VERTICAL, -180, 180, 1);
         xAxisRotationSlider.setPaintTicks(false);
         xAxisRotationSlider.setPaintLabels(false);
         xAxisRotationSlider.setSnapToTicks(false);
         xAxisRotationSlider.addChangeListener(new ChangeListener() {
 
-            public void stateChanged(ChangeEvent e) {
+            public void stateChanged(final ChangeEvent e) {
                 eventListener1.setXAxisRotation(xAxisRotationSlider.getValue());
                 eventListener2.setXAxisRotation(xAxisRotationSlider.getValue());
             }
         });
-        JLabel xAxisRotationLabel = new JLabel("X-Axis Rotation");
+        final JLabel xAxisRotationLabel = new JLabel("X-Axis Rotation");
 
         // Create slider for y rotation.
         // The horizontally oriented slider rotates around the y axis
-        final JSlider yAxisRotationSlider = new JSlider(JSlider.HORIZONTAL, -180, 180, 1);
+        final JSlider yAxisRotationSlider = new JSlider(SwingConstants.HORIZONTAL, -180, 180, 1);
         yAxisRotationSlider.setPaintTicks(false);
         yAxisRotationSlider.setPaintLabels(false);
         yAxisRotationSlider.setSnapToTicks(false);
         yAxisRotationSlider.addChangeListener(new ChangeListener() {
 
-            public void stateChanged(ChangeEvent e) {
+            public void stateChanged(final ChangeEvent e) {
                 eventListener1.setYAxisRotation(yAxisRotationSlider.getValue());
                 eventListener2.setYAxisRotation(yAxisRotationSlider.getValue());
             }
         });
-        JLabel yAxisRotationLabel = new JLabel("Y-Axis Rotation");
+        final JLabel yAxisRotationLabel = new JLabel("Y-Axis Rotation");
 
         // Create slider for view distance factor.
         // We want a range of 0.0 to 10.0 with 0.1 increments (so we can scale down using 0.0 to 1.0).
         // So, set JSlider to 0 to 100 and divide by 10.0 in stateChanged
-        final JSlider viewDistanceFactorSlider = new JSlider(JSlider.HORIZONTAL, 0, 100, 10);
+        final JSlider viewDistanceFactorSlider = new JSlider(SwingConstants.HORIZONTAL, 0, 100, 10);
         viewDistanceFactorSlider.setPaintTicks(false);
         viewDistanceFactorSlider.setPaintLabels(false);
         viewDistanceFactorSlider.setSnapToTicks(false);
         viewDistanceFactorSlider.addChangeListener(new ChangeListener() {
 
-            public void stateChanged(ChangeEvent e) {
+            public void stateChanged(final ChangeEvent e) {
                 eventListener1.setViewDistanceFactor(viewDistanceFactorSlider.getValue() / 10.0f);
                 eventListener2.setViewDistanceFactor(viewDistanceFactorSlider.getValue() / 10.0f);
             }
         });
-        JLabel viewDistanceFactorLabel = new JLabel("View Distance Factor");
+        final JLabel viewDistanceFactorLabel = new JLabel("View Distance Factor");
 
         // group the view distance and label into a vertical panel
-        JPanel viewDistancePanel = new JPanel();
+        final JPanel viewDistancePanel = new JPanel();
         viewDistancePanel.setLayout(new BoxLayout(viewDistancePanel, BoxLayout.PAGE_AXIS));
         viewDistancePanel.add(Box.createVerticalGlue());
         viewDistancePanel.add(viewDistanceFactorSlider);
@@ -673,14 +683,14 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
         viewDistancePanel.add(Box.createVerticalGlue());
 
         // group both OpenGL canvases / windows into a horizontal panel
-        JPanel openGLPanel = new JPanel();
+        final JPanel openGLPanel = new JPanel();
         openGLPanel.setLayout(new BoxLayout(openGLPanel, BoxLayout.LINE_AXIS));
         openGLPanel.add(openGLComponent1);
         openGLPanel.add(Box.createHorizontalStrut(5));
         openGLPanel.add(openGLComponent2);
 
         // group the open GL panel and the y-axis rotation slider into a vertical panel.
-        JPanel canvasAndYAxisPanel = new JPanel();
+        final JPanel canvasAndYAxisPanel = new JPanel();
         canvasAndYAxisPanel.setLayout(new BoxLayout(canvasAndYAxisPanel, BoxLayout.PAGE_AXIS));
         canvasAndYAxisPanel.add(openGLPanel);
         canvasAndYAxisPanel.add(Box.createVerticalGlue());
@@ -688,12 +698,12 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
         canvasAndYAxisPanel.add(yAxisRotationLabel);
 
         // group the X-axis rotation slider and label into a horizontal panel.
-        JPanel xAxisPanel = new JPanel();
+        final JPanel xAxisPanel = new JPanel();
         xAxisPanel.setLayout(new BoxLayout(xAxisPanel, BoxLayout.LINE_AXIS));
         xAxisPanel.add(xAxisRotationSlider);
         xAxisPanel.add(xAxisRotationLabel);
 
-        JPanel mainPanel = (JPanel) frame.getContentPane();
+        final JPanel mainPanel = (JPanel) frame.getContentPane();
         mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.LINE_AXIS));
         mainPanel.add(viewDistancePanel);
         mainPanel.add(Box.createHorizontalGlue());
@@ -713,7 +723,7 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
         frame.addWindowListener(new WindowAdapter() {
 
             @Override
-            public void windowClosing(WindowEvent e) {
+            public void windowClosing(final WindowEvent e) {
                 closingSemaphore.release();
             }
         });
@@ -729,9 +739,9 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
 
         // wait for the window to be visible and start the animation
         try {
-            boolean windowOpened = windowOpenSemaphore.tryAcquire(5000, TimeUnit.MILLISECONDS);
+            final boolean windowOpened = windowOpenSemaphore.tryAcquire(5000, TimeUnit.MILLISECONDS);
             Assert.assertEquals(true, windowOpened);
-        } catch (InterruptedException e) {
+        } catch (final InterruptedException e) {
             System.err.println("Closing wait interrupted: " + e.getMessage());
         }
         animator.start();
@@ -742,9 +752,9 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
                 Thread.sleep(100);
             }
             AWTRobotUtil.closeWindow(frame, true, awtClosingListener);
-            boolean windowClosed = closingSemaphore.tryAcquire(5000, TimeUnit.MILLISECONDS);
+            final boolean windowClosed = closingSemaphore.tryAcquire(5000, TimeUnit.MILLISECONDS);
             Assert.assertEquals(true, windowClosed);
-        } catch (InterruptedException e) {
+        } catch (final InterruptedException e) {
             System.err.println("Closing wait interrupted: " + e.getMessage());
         }
         animator.stop();
@@ -766,9 +776,9 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
         // wait for orderly destruction; it seems that if we share a GLContext across newt windows, bad things happen;
         // I must be doing something wrong but I haven't figured it out yet
         try {
-            boolean windowsDisposed = closingSemaphore.tryAcquire(5000, TimeUnit.MILLISECONDS);
+            final boolean windowsDisposed = closingSemaphore.tryAcquire(5000, TimeUnit.MILLISECONDS);
             Assert.assertEquals(true, windowsDisposed);
-        } catch (InterruptedException e) {
+        } catch (final InterruptedException e) {
             System.err.println("Closing wait interrupted: " + e.getMessage());
         }
 
@@ -784,7 +794,7 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
             if (acquired){
                 disposalSuccesses++;
             }
-        } catch (InterruptedException e) {
+        } catch (final InterruptedException e) {
             System.err.println("Clean exit interrupted: " + e.getMessage());
         }
 
@@ -793,15 +803,15 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
         releaseShared(sharedDrawable);
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String[] args) throws IOException {
+    public static void main(final String[] args) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 if (++i < args.length) {
@@ -810,7 +820,7 @@ public class TestSharedContextNewtAWTBug523 extends UITestCase {
             }
         }
 
-        String testname = TestSharedContextNewtAWTBug523.class.getName();
+        final String testname = TestSharedContextNewtAWTBug523.class.getName();
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             testname,
             "filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java
index 0f4f8fc..8f84e29 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES1NEWT.java
@@ -92,7 +92,7 @@ public class TestSharedContextVBOES1NEWT extends UITestCase {
     }
 
     private void initShared() throws InterruptedException {
-        GLDrawable dummyDrawable = GLDrawableFactory.getFactory(glp).createDummyDrawable(null, true /* createNewDevice */, caps, null);
+        final GLDrawable dummyDrawable = GLDrawableFactory.getFactory(glp).createDummyDrawable(null, true /* createNewDevice */, caps, null);
         dummyDrawable.setRealized(true);
         sharedDrawable = new GLAutoDrawableDelegate(dummyDrawable, null, null, true /*ownDevice*/, null) { };
         Assert.assertNotNull(sharedDrawable);
@@ -114,18 +114,18 @@ public class TestSharedContextVBOES1NEWT extends UITestCase {
         sharedDrawable.destroy();
     }
 
-    protected GLWindow runTestGL(Animator animator, int x, int y, boolean useShared, boolean vsync) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
+    protected GLWindow runTestGL(final Animator animator, final int x, final int y, final boolean useShared, final boolean vsync) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setPosition(x, y);
         glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared "+useShared);
         if(useShared) {
-            glWindow.setSharedContext(sharedDrawable.getContext());
+            glWindow.setSharedAutoDrawable(sharedDrawable);
         }
 
         glWindow.setSize(width, height);
 
-        GearsES1 gears = new GearsES1(vsync ? 1 : 0);
+        final GearsES1 gears = new GearsES1(vsync ? 1 : 0);
         if(useShared) {
             gears.setSharedGearsObjects(sharedGears.getGear1(), sharedGears.getGear2(), sharedGears.getGear3());
         }
@@ -153,12 +153,12 @@ public class TestSharedContextVBOES1NEWT extends UITestCase {
     @Test
     public void test01() throws InterruptedException {
         initShared();
-        Animator animator = new Animator();
-        GLWindow f1 = runTestGL(animator, 0, 0, true, false);
-        InsetsImmutable insets = f1.getInsets();
-        GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
+        final Animator animator = new Animator();
+        final GLWindow f1 = runTestGL(animator, 0, 0, true, false);
+        final InsetsImmutable insets = f1.getInsets();
+        final GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
                                           f1.getY()+0, true, false);
-        GLWindow f3 = runTestGL(animator, f1.getX()+0,
+        final GLWindow f3 = runTestGL(animator, f1.getX()+0,
                                           f1.getY()+height+insets.getTotalHeight(), false, true);
         animator.setUpdateFPSFrames(1, null);
         animator.start();
@@ -176,13 +176,13 @@ public class TestSharedContextVBOES1NEWT extends UITestCase {
 
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         org.junit.runner.JUnitCore.main(TestSharedContextVBOES1NEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java
index 3b576fa..a5b5653 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3.java
@@ -81,7 +81,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
         }
     }
 
-    protected GLCanvas createGLCanvas(final Frame frame, int x, int y, GearsES2 gears) throws InterruptedException {
+    protected GLCanvas createGLCanvas(final Frame frame, final int x, final int y, final GearsES2 gears) throws InterruptedException {
         final GLCanvas glCanvas = new GLCanvas(caps);
         Assert.assertNotNull(glCanvas);
         glCanvas.addGLEventListener(gears);
@@ -178,7 +178,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
 
         try {
             Thread.sleep(duration);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
         // Stopped animator allows native windowing system 'repaint' event
@@ -199,7 +199,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
                     } else {
                         f1.dispose();
                     }
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     throw new RuntimeException(t);
                 }
             }});
@@ -207,12 +207,8 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 try {
-                    if( destroyCleanOrder ) {
-                        f2.dispose();
-                    } else {
-                        f2.dispose();
-                    }
-                } catch (Throwable t) {
+                    f2.dispose();
+                } catch (final Throwable t) {
                     throw new RuntimeException(t);
                 }
             }});
@@ -225,7 +221,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
                     } else {
                         f3.dispose();
                     }
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     throw new RuntimeException(t);
                 }
             }});
@@ -332,7 +328,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
 
         try {
             Thread.sleep(duration);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
         // Stopped animator allows native windowing system 'repaint' event
@@ -357,7 +353,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
                     } else {
                         f1.dispose();
                     }
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     throw new RuntimeException(t);
                 }
             }});
@@ -365,12 +361,8 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 try {
-                    if( destroyCleanOrder ) {
-                        f2.dispose();
-                    } else {
-                        f2.dispose();
-                    }
-                } catch (Throwable t) {
+                    f2.dispose();
+                } catch (final Throwable t) {
                     throw new RuntimeException(t);
                 }
             }});
@@ -383,7 +375,7 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
                     } else {
                         f3.dispose();
                     }
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     throw new RuntimeException(t);
                 }
             }});
@@ -395,13 +387,13 @@ public class TestSharedContextVBOES2AWT3 extends UITestCase {
 
     static long duration = 1000; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         /**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java
index d4079e3..4c9cb72 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2AWT3b.java
@@ -81,7 +81,7 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase {
         }
     }
 
-    protected GLJPanel createGLJPanel(final Frame frame, int x, int y, GearsES2 gears) throws InterruptedException {
+    protected GLJPanel createGLJPanel(final Frame frame, final int x, final int y, final GearsES2 gears) throws InterruptedException {
         final GLJPanel glCanvas = new GLJPanel(caps);
         Assert.assertNotNull(glCanvas);
         glCanvas.addGLEventListener(gears);
@@ -169,7 +169,7 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase {
 
         try {
             Thread.sleep(duration);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
         // Stopped animator allows native windowing system 'repaint' event
@@ -183,7 +183,7 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase {
                     f3.dispose();
                     f2.dispose();
                     f1.dispose();
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     throw new RuntimeException(t);
                 }
             }});
@@ -281,7 +281,7 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase {
 
         try {
             Thread.sleep(duration);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
         // Stopped animator allows native windowing system 'repaint' event
@@ -299,7 +299,7 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase {
                     f3.dispose();
                     f2.dispose();
                     f1.dispose();
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     throw new RuntimeException(t);
                 }
             }});
@@ -311,13 +311,13 @@ public class TestSharedContextVBOES2AWT3b extends UITestCase {
 
     static long duration = 1000; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         /**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java
index 010368b..d2d1384 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT0.java
@@ -33,6 +33,7 @@ import java.util.List;
 import com.jogamp.newt.opengl.GLWindow;
 
 import javax.media.nativewindow.util.InsetsImmutable;
+import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLContext;
 import javax.media.opengl.GLProfile;
@@ -76,14 +77,14 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
         }
     }
 
-    protected GLWindow runTestGL(Animator animator, int x, int y, GearsES2 gears, GLContext sharedContext) throws InterruptedException {
-        final boolean useShared = null != sharedContext;
-        GLWindow glWindow = GLWindow.create(caps);
+    protected GLWindow runTestGL(final Animator animator, final int x, final int y, final GearsES2 gears, final GLAutoDrawable sharedDrawable) throws InterruptedException {
+        final boolean useShared = null != sharedDrawable;
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setPosition(x, y);
         glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared "+useShared);
         if(useShared) {
-            glWindow.setSharedContext(sharedContext);
+            glWindow.setSharedAutoDrawable(sharedDrawable);
         }
         glWindow.setSize(width, height);
         glWindow.addGLEventListener(gears);
@@ -107,7 +108,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
     public void test02CommonAnimatorMapBuffer() throws InterruptedException {
         testCommonAnimatorSharedImpl(true);
     }
-    private void testCommonAnimatorSharedImpl(boolean useMappedBuffers) throws InterruptedException {
+    private void testCommonAnimatorSharedImpl(final boolean useMappedBuffers) throws InterruptedException {
         final Animator animator = new Animator();
 
         //
@@ -130,7 +131,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
         final GearsES2 g2 = new GearsES2(0);
         g2.setSharedGearsObjects(g1.getGear1(), g1.getGear2(), g1.getGear3());
         final GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
-                                                f1.getY()+0, g2, f1.getContext());
+                                                f1.getY()+0, g2, f1);
         final GLContext ctx2 = f2.getContext();
         Assert.assertTrue("Ctx1 is not shared", ctx1.isShared());
         Assert.assertTrue("Ctx2 is not shared", ctx2.isShared());
@@ -153,7 +154,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
         final GearsES2 g3 = new GearsES2(0);
         g3.setSharedGearsObjects(g1.getGear1(), g1.getGear2(), g1.getGear3());
         final GLWindow f3 = runTestGL(animator, f1.getX()+0,
-                                                f1.getY()+height+insets.getTotalHeight(), g3, f1.getContext());
+                                                f1.getY()+height+insets.getTotalHeight(), g3, f1);
 
         final GLContext ctx3 = f3.getContext();
         Assert.assertTrue("Ctx1 is not shared", ctx1.isShared());
@@ -184,7 +185,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
 
         try {
             Thread.sleep(duration);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
 
@@ -210,7 +211,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
             Assert.assertEquals("Ctx2 has unexpected number of created shares", 1, ctx2Shares.size());
             Assert.assertEquals("Ctx3 has unexpected number of created shares", 2, ctx3Shares.size());
         }
-        try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+        try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
 
         f2.destroy();
         Assert.assertTrue(AWTRobotUtil.waitForVisible(f2, false));
@@ -234,7 +235,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
             Assert.assertEquals("Ctx2 has unexpected number of created shares", 1, ctx2Shares.size());
             Assert.assertEquals("Ctx3 has unexpected number of created shares", 1, ctx3Shares.size());
         }
-        try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+        try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
 
         f1.destroy();
         Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false));
@@ -258,7 +259,7 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
             Assert.assertEquals("Ctx2 has unexpected number of created shares", 0, ctx2Shares.size());
             Assert.assertEquals("Ctx3 has unexpected number of created shares", 0, ctx3Shares.size());
         }
-        try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+        try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
 
         animator.stop();
         Assert.assertEquals(false, animator.isAnimating());
@@ -267,13 +268,13 @@ public class TestSharedContextVBOES2NEWT0 extends UITestCase {
     static long duration = 1000; // ms
     static long durationPostDestroy = 1000; // ms - ~60 frames post destroy
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         /**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java
index 7051bac..fb15509 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT1.java
@@ -97,9 +97,9 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase {
         }
     }
 
-    private void initShared(boolean onscreen) throws InterruptedException {
+    private void initShared(final boolean onscreen) throws InterruptedException {
         if(onscreen) {
-            GLWindow glWindow = GLWindow.create(caps);
+            final GLWindow glWindow = GLWindow.create(caps);
             Assert.assertNotNull(glWindow);
             glWindow.setSize(width, height);
             glWindow.setVisible(true);
@@ -129,18 +129,18 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase {
         sharedDrawable = null;
     }
 
-    protected GLWindow runTestGL(Animator animator, int x, int y, boolean useShared, boolean vsync) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
+    protected GLWindow runTestGL(final Animator animator, final int x, final int y, final boolean useShared, final boolean vsync) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setPosition(x, y);
         glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared "+useShared);
         if(useShared) {
-            glWindow.setSharedContext(sharedDrawable.getContext());
+            glWindow.setSharedAutoDrawable(sharedDrawable);
         }
 
         glWindow.setSize(width, height);
 
-        GearsES2 gears = new GearsES2(vsync ? 1 : 0);
+        final GearsES2 gears = new GearsES2(vsync ? 1 : 0);
         if(useShared) {
             gears.setSharedGearsObjects(sharedGears.getGear1(), sharedGears.getGear2(), sharedGears.getGear3());
         }
@@ -172,16 +172,16 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase {
     @Test
     public void test01CommonAnimatorSharedOnscreen() throws InterruptedException {
         initShared(true);
-        Animator animator = new Animator();
-        GLWindow f1 = runTestGL(animator, 0, 0, true, false);
-        InsetsImmutable insets = f1.getInsets();
-        GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
+        final Animator animator = new Animator();
+        final GLWindow f1 = runTestGL(animator, 0, 0, true, false);
+        final InsetsImmutable insets = f1.getInsets();
+        final GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
                                           f1.getY()+0, true, false);
-        GLWindow f3 = runTestGL(animator, f1.getX()+0,
+        final GLWindow f3 = runTestGL(animator, f1.getX()+0,
                                           f1.getY()+height+insets.getTotalHeight(), true, false);
         try {
             Thread.sleep(duration);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
         animator.stop();
@@ -205,16 +205,16 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase {
     @Test
     public void test02CommonAnimatorSharedOffscreen() throws InterruptedException {
         initShared(false);
-        Animator animator = new Animator();
-        GLWindow f1 = runTestGL(animator, 0, 0, true, false);
-        InsetsImmutable insets = f1.getInsets();
-        GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
+        final Animator animator = new Animator();
+        final GLWindow f1 = runTestGL(animator, 0, 0, true, false);
+        final InsetsImmutable insets = f1.getInsets();
+        final GLWindow f2 = runTestGL(animator, f1.getX()+width+insets.getTotalWidth(),
                                           f1.getY()+0, true, false);
-        GLWindow f3 = runTestGL(animator, f1.getX()+0,
+        final GLWindow f3 = runTestGL(animator, f1.getX()+0,
                                           f1.getY()+height+insets.getTotalHeight(), true, false);
         try {
             Thread.sleep(duration);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
         animator.stop();
@@ -238,19 +238,19 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase {
     @Test
     public void test03EachWithAnimatorSharedOffscreen() throws InterruptedException {
         initShared(false);
-        Animator animator1 = new Animator();
-        Animator animator2 = new Animator();
-        Animator animator3 = new Animator();
-        GLWindow f1 = runTestGL(animator1, 0, 0, true, false);
-        InsetsImmutable insets = f1.getInsets();
-        GLWindow f2 = runTestGL(animator2, f1.getX()+width+insets.getTotalWidth(),
+        final Animator animator1 = new Animator();
+        final Animator animator2 = new Animator();
+        final Animator animator3 = new Animator();
+        final GLWindow f1 = runTestGL(animator1, 0, 0, true, false);
+        final InsetsImmutable insets = f1.getInsets();
+        final GLWindow f2 = runTestGL(animator2, f1.getX()+width+insets.getTotalWidth(),
                                 f1.getY()+0, true, false);
-        GLWindow f3 = runTestGL(animator3, f1.getX()+0,
+        final GLWindow f3 = runTestGL(animator3, f1.getX()+0,
                                 f1.getY()+height+insets.getTotalHeight(), true, false);
 
         try {
             Thread.sleep(duration);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
         animator1.stop();
@@ -275,13 +275,13 @@ public class TestSharedContextVBOES2NEWT1 extends UITestCase {
 
     static long duration = 1000; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         /**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java
index e8e4cc7..a101c05 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT2.java
@@ -84,8 +84,8 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
         }
     }
 
-    protected GLWindow createGLWindow(int x, int y, GearsES2 gears) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
+    protected GLWindow createGLWindow(final int x, final int y, final GearsES2 gears) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setPosition(x, y);
         glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared true");
@@ -105,12 +105,12 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
         syncedOneAnimator(false);
     }
 
-    public void syncedOneAnimator(boolean destroyCleanOrder) throws InterruptedException {
+    public void syncedOneAnimator(final boolean destroyCleanOrder) throws InterruptedException {
         final Animator animator = new Animator();
         final GearsES2 g1 = new GearsES2(0);
         final GLWindow f1 = createGLWindow(0, 0, g1);
         animator.add(f1);
-        InsetsImmutable insets = f1.getInsets();
+        final InsetsImmutable insets = f1.getInsets();
 
         final GearsES2 g2 = new GearsES2(0);
         g2.setSharedGears(g1);
@@ -127,13 +127,12 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
         // f1's shared GLContext is ready !
         f1.invoke(false, new GLRunnable() {
             @Override
-            public boolean run(GLAutoDrawable drawable) {
-                final GLContext ctx1 = f1.getContext();
-                Assert.assertTrue("Ctx is shared before shared creation", !ctx1.isShared());
-                f2.setSharedContext(ctx1);
+            public boolean run(final GLAutoDrawable drawable) {
+                Assert.assertTrue("Ctx is shared before shared creation", !f1.getContext().isShared());
+                f2.setSharedAutoDrawable(f1);
                 f2.setVisible(true);
                 f2.display(); // kick off GLContext ..
-                f3.setSharedContext(ctx1);
+                f3.setSharedAutoDrawable(f1);
                 f3.setVisible(true);
                 f3.display(); // kick off GLContext ..
                 return true;
@@ -188,7 +187,7 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
 
         try {
             Thread.sleep(duration);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
         animator.stop();
@@ -223,7 +222,7 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
         asyncEachAnimator(false);
     }
 
-    public void asyncEachAnimator(boolean destroyCleanOrder) throws InterruptedException {
+    public void asyncEachAnimator(final boolean destroyCleanOrder) throws InterruptedException {
         final Animator a1 = new Animator();
         final GearsES2 g1 = new GearsES2(0);
         final GLWindow f1 = createGLWindow(0, 0, g1);
@@ -231,7 +230,7 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
         a1.start();
         f1.setVisible(true);
 
-        InsetsImmutable insets = f1.getInsets();
+        final InsetsImmutable insets = f1.getInsets();
 
         final Animator a2 = new Animator();
         final GearsES2 g2 = new GearsES2(0);
@@ -252,12 +251,11 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
         // f1's shared GLContext is ready !
         f1.invoke(false, new GLRunnable() {
             @Override
-            public boolean run(GLAutoDrawable drawable) {
-                final GLContext ctx1 = f1.getContext();
-                Assert.assertTrue("Ctx is shared before shared creation", !ctx1.isShared());
-                f2.setSharedContext(ctx1);
+            public boolean run(final GLAutoDrawable drawable) {
+                Assert.assertTrue("Ctx is shared before shared creation", !f1.getContext().isShared());
+                f2.setSharedAutoDrawable(f1);
                 f2.setVisible(true);
-                f3.setSharedContext(ctx1);
+                f3.setSharedAutoDrawable(f1);
                 f3.setVisible(true);
                 return true;
             }
@@ -305,7 +303,7 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
 
         try {
             Thread.sleep(duration);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
         // Stopped animator allows native windowing system 'repaint' event
@@ -338,13 +336,13 @@ public class TestSharedContextVBOES2NEWT2 extends UITestCase {
 
     static long duration = 1000; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         /**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java
index a8684ad..bfd1a92 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2NEWT3.java
@@ -81,8 +81,8 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
         }
     }
 
-    protected GLWindow createGLWindow(int x, int y, GearsES2 gears) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
+    protected GLWindow createGLWindow(final int x, final int y, final GearsES2 gears) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setPosition(x, y);
         glWindow.setTitle("Shared Gears NEWT Test: "+x+"/"+y+" shared true");
@@ -110,14 +110,14 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
         syncedOneAnimator(false, true);
     }
 
-    public void syncedOneAnimator(boolean destroyCleanOrder, boolean useMappedBuffers) throws InterruptedException {
+    public void syncedOneAnimator(final boolean destroyCleanOrder, final boolean useMappedBuffers) throws InterruptedException {
         final Animator animator = new Animator();
         final GearsES2 g1 = new GearsES2(0);
         g1.setUseMappedBuffers(useMappedBuffers);
         g1.setValidateBuffers(true);
         final GLWindow f1 = createGLWindow(0, 0, g1);
         animator.add(f1);
-        InsetsImmutable insets = f1.getInsets();
+        final InsetsImmutable insets = f1.getInsets();
 
         final GearsES2 g2 = new GearsES2(0);
         g2.setSharedGears(g1);
@@ -183,32 +183,32 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
 
         try {
             Thread.sleep(duration);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
 
         if( destroyCleanOrder ) {
             System.err.println("XXX Destroy in clean order NOW");
             f3.destroy();
-            try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+            try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
             f2.destroy();
-            try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+            try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
             f1.destroy();
-            try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+            try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
         } else {
             System.err.println("XXX Destroy in creation order NOW - Driver Impl. Ma trigger driver Bug i.e. not postponing GL ctx destruction after releasing all refs.");
             animator.pause();
             f1.destroy();
             animator.resume();
-            try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+            try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
 
             animator.pause();
             f2.destroy();
             animator.resume();
-            try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+            try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
 
             f3.destroy();
-            try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+            try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
         }
         Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false));
         Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, false));
@@ -238,7 +238,7 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
         asyncEachAnimator(false, true);
     }
 
-    public void asyncEachAnimator(boolean destroyCleanOrder, boolean useMappedBuffers) throws InterruptedException {
+    public void asyncEachAnimator(final boolean destroyCleanOrder, final boolean useMappedBuffers) throws InterruptedException {
         final Animator a1 = new Animator();
         final GearsES2 g1 = new GearsES2(0);
         g1.setUseMappedBuffers(useMappedBuffers);
@@ -248,7 +248,7 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
         a1.start();
         // f1.setVisible(true); // we do this post f2 .. to test pending creation!
 
-        InsetsImmutable insets = f1.getInsets();
+        final InsetsImmutable insets = f1.getInsets();
 
         final Animator a2 = new Animator();
         final GearsES2 g2 = new GearsES2(0);
@@ -317,7 +317,7 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
 
         try {
             Thread.sleep(duration);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
 
@@ -325,13 +325,13 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
             System.err.println("XXX Destroy in clean order NOW");
             a3.stop();
             f3.destroy();
-            try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+            try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
             a2.stop();
             f2.destroy();
-            try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+            try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
             a1.stop();
             f1.destroy();
-            try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+            try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
         } else {
             System.err.println("XXX Destroy in creation order NOW - Driver Impl. May trigger driver Bug i.e. not postponing GL ctx destruction after releasing all refs.");
             a1.stop();
@@ -340,17 +340,17 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
             f1.destroy();
             a2.resume();
             a3.resume();
-            try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+            try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
 
             a2.stop();
             a3.pause();
             f2.destroy();
             a3.resume();
-            try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+            try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
 
             a3.stop();
             f3.destroy();
-            try { Thread.sleep(durationPostDestroy); } catch(Exception e) { e.printStackTrace(); }
+            try { Thread.sleep(durationPostDestroy); } catch(final Exception e) { e.printStackTrace(); }
         }
         Assert.assertTrue(AWTRobotUtil.waitForVisible(f1, false));
         Assert.assertTrue(AWTRobotUtil.waitForRealized(f1, false));
@@ -363,13 +363,13 @@ public class TestSharedContextVBOES2NEWT3 extends UITestCase {
     static long duration = 1000; // ms
     static long durationPostDestroy = 1000; // ms - ~60 frames post destroy
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         /**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java
index 9ccfd39..90cb503 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextVBOES2SWT3.java
@@ -149,7 +149,7 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase {
                 display.dispose();
                }});
         }
-        catch( Throwable throwable ) {
+        catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -162,7 +162,7 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase {
         composite3 = null;
     }
 
-    protected GLCanvas createGLCanvas(final Shell shell, final Composite composite, final int x, final int y, GearsES2 gears) throws InterruptedException {
+    protected GLCanvas createGLCanvas(final Shell shell, final Composite composite, final int x, final int y, final GearsES2 gears) throws InterruptedException {
         final GLCanvas glCanvas = GLCanvas.create( composite, 0, caps, null);
         Assert.assertNotNull( glCanvas );
         glCanvas.addGLEventListener(gears);
@@ -241,7 +241,7 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase {
 
         try {
             Thread.sleep(duration);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
         // Stopped animator allows native windowing system 'repaint' event
@@ -335,7 +335,7 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase {
 
         try {
             Thread.sleep(duration);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
         // Stopped animator allows native windowing system 'repaint' event
@@ -357,13 +357,13 @@ public class TestSharedContextVBOES2SWT3 extends UITestCase {
 
     static long duration = 1000; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         /**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextWithJTabbedPaneAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextWithJTabbedPaneAWT.java
index d6a6f7b..e62bbc6 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextWithJTabbedPaneAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestSharedContextWithJTabbedPaneAWT.java
@@ -43,6 +43,9 @@ import javax.media.opengl.GLContext;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLProfile;
 import javax.media.opengl.awt.GLCanvas;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
+import javax.media.opengl.fixedfunc.GLPointerFunc;
 import javax.swing.JFrame;
 import javax.swing.JPanel;
 import javax.swing.JTabbedPane;
@@ -63,7 +66,7 @@ public class TestSharedContextWithJTabbedPaneAWT extends UITestCase {
 
     static class DemoInstance {
         protected static GLCapabilities getCaps() {
-            GLCapabilities caps = new GLCapabilities(GLProfile.getMaxFixedFunc(true));
+            final GLCapabilities caps = new GLCapabilities(GLProfile.getMaxFixedFunc(true));
 
             caps.setAlphaBits(8);
             caps.setRedBits(8);
@@ -82,8 +85,8 @@ public class TestSharedContextWithJTabbedPaneAWT extends UITestCase {
             final GLCanvas canvas;
             final boolean shared;
 
-            public SharedGLPanel(GLCanvas shareWith, int width, int height) {
-                GLContext sharedCtx = shareWith != null ? shareWith.getContext() : null;
+            public SharedGLPanel(final GLCanvas shareWith, final int width, final int height) {
+                final GLContext sharedCtx = shareWith != null ? shareWith.getContext() : null;
                 System.err.println("XXX WWPanel: shareWith "+shareWith+", sharedCtx "+sharedCtx);
                 canvas = new GLCanvas(getCaps()); // same caps for 1st and 2nd shared ctx !
                 if( null != shareWith) {
@@ -102,7 +105,7 @@ public class TestSharedContextWithJTabbedPaneAWT extends UITestCase {
             }
 
             @Override
-            public void init(GLAutoDrawable glAutoDrawable) {
+            public void init(final GLAutoDrawable glAutoDrawable) {
                 if (!shared) {
                     Assert.assertNull("Buffer is set, but instance is share master", bufferId);
                     makeVBO(glAutoDrawable);
@@ -120,56 +123,56 @@ public class TestSharedContextWithJTabbedPaneAWT extends UITestCase {
                     gl.glColor3f(0, 0, 0);
                     gl.glClearColor(1f, 1f, 1f, 1f);
                 }
-                gl.glShadeModel(GL2.GL_FLAT);
+                gl.glShadeModel(GLLightingFunc.GL_FLAT);
             }
 
             @Override
-            public void dispose(GLAutoDrawable glAutoDrawable) {}
+            public void dispose(final GLAutoDrawable glAutoDrawable) {}
 
             @Override
-            public void display(GLAutoDrawable glAutoDrawable) {
+            public void display(final GLAutoDrawable glAutoDrawable) {
                 final GL2 gl = glAutoDrawable.getGL().getGL2();
 
                 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
 
-                gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
-                gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, bufferId[0]);
-                gl.glVertexPointer(3, GL2.GL_FLOAT, 0, 0);
-                gl.glDrawArrays(GL2.GL_LINES, 0, 2);
+                gl.glEnableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
+                gl.glBindBuffer(GL.GL_ARRAY_BUFFER, bufferId[0]);
+                gl.glVertexPointer(3, GL.GL_FLOAT, 0, 0);
+                gl.glDrawArrays(GL.GL_LINES, 0, 2);
             }
 
             @Override
-            public void reshape(GLAutoDrawable glAutoDrawable, int i, int i1, int i2, int i3) {
-                int w = getWidth();
-                int h = getHeight();
+            public void reshape(final GLAutoDrawable glAutoDrawable, final int i, final int i1, final int i2, final int i3) {
+                final int w = getWidth();
+                final int h = getHeight();
 
                 final GL2 gl = glAutoDrawable.getGL().getGL2();
 
                 gl.glViewport(0, 0, w, h);
-                gl.glMatrixMode(GL2.GL_PROJECTION);
+                gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
                 gl.glLoadIdentity();
                 gl.glOrtho(0, 1, 0, 1, -1, 1);
-                gl.glMatrixMode(GL2.GL_MODELVIEW);
+                gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
                 gl.glLoadIdentity();
             }
         }
 
-        protected void makeVBO(GLAutoDrawable drawable) {
-            GL2 gl = drawable.getGL().getGL2();
+        protected void makeVBO(final GLAutoDrawable drawable) {
+            final GL2 gl = drawable.getGL().getGL2();
 
             bufferId = new int[1];
             gl.glGenBuffers(1, bufferId, 0);
-            gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, bufferId[0]);
+            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, bufferId[0]);
 
-            FloatBuffer vertices = Buffers.newDirectFloatBuffer(6);
+            final FloatBuffer vertices = Buffers.newDirectFloatBuffer(6);
             vertices.put(0).put(0).put(0);
             vertices.put(1).put(1).put(0);
-            gl.glBufferData(GL2.GL_ARRAY_BUFFER, vertices.capacity() * 4, vertices.rewind(), GL2.GL_STATIC_DRAW);
+            gl.glBufferData(GL.GL_ARRAY_BUFFER, vertices.capacity() * 4, vertices.rewind(), GL.GL_STATIC_DRAW);
         }
 
         public JTabbedPane tabbedPanel;
 
-        public DemoInstance(JFrame f) {
+        public DemoInstance(final JFrame f) {
             try
             {
                 GLProfile.initSingleton(); // Lets have init debug messages above below marker
@@ -180,8 +183,8 @@ public class TestSharedContextWithJTabbedPaneAWT extends UITestCase {
                 f.add(tabbedPanel, BorderLayout.CENTER);
 
                 // Create two World Windows that share resources.
-                SharedGLPanel wwpA = new SharedGLPanel(null, 600, 600);
-                SharedGLPanel wwpB = new SharedGLPanel(wwpA.canvas, wwpA.getWidth(), wwpA.getHeight());
+                final SharedGLPanel wwpA = new SharedGLPanel(null, 600, 600);
+                final SharedGLPanel wwpB = new SharedGLPanel(wwpA.canvas, wwpA.getWidth(), wwpA.getHeight());
 
                 tabbedPanel.add(wwpA, "Window A");
                 tabbedPanel.add(wwpB, "Window B");
@@ -194,7 +197,7 @@ public class TestSharedContextWithJTabbedPaneAWT extends UITestCase {
                 f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
                 f.pack();
                 f.setResizable(true);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
             }
         }
@@ -251,7 +254,7 @@ public class TestSharedContextWithJTabbedPaneAWT extends UITestCase {
             } });
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteAWT.java
index 9f367ef..d8ae8bc 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteAWT.java
@@ -63,7 +63,7 @@ public class TestShutdownCompleteAWT extends UITestCase {
 
         glCanvas.addGLEventListener(new GearsES2(1));
 
-        Animator animator = new Animator(glCanvas);
+        final Animator animator = new Animator(glCanvas);
 
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
@@ -103,7 +103,7 @@ public class TestShutdownCompleteAWT extends UITestCase {
         }
     }
 
-    protected void oneLife(boolean glInfo) throws InterruptedException, InvocationTargetException {
+    protected void oneLife(final boolean glInfo) throws InterruptedException, InvocationTargetException {
         final long t0 = Platform.currentTimeMicros();
         GLProfile.initSingleton();
         final long t1 = Platform.currentTimeMicros();
@@ -148,7 +148,7 @@ public class TestShutdownCompleteAWT extends UITestCase {
     static boolean initOnly = false;
     static boolean waitForKey = false;
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-wait")) {
                 waitForKey = true;
@@ -160,7 +160,7 @@ public class TestShutdownCompleteAWT extends UITestCase {
         if(waitForKey) {
             UITestCase.waitForKey("Start");
         }
-        String tstname = TestShutdownCompleteAWT.class.getName();
+        final String tstname = TestShutdownCompleteAWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteNEWT.java
index e7d1cb8..10f3342 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestShutdownCompleteNEWT.java
@@ -51,18 +51,18 @@ public class TestShutdownCompleteNEWT extends UITestCase {
 
     static long duration = 300; // ms
 
-    protected void runTestGL(boolean onscreen) throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
+    protected void runTestGL(final boolean onscreen) throws InterruptedException {
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
         caps.setOnscreen(onscreen);
         caps.setPBuffer(!onscreen);
 
-        GLWindow glWindow = GLWindow.create(caps);
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle("Gears NEWT Test");
 
         glWindow.addGLEventListener(new GearsES2());
 
-        Animator animator = new Animator(glWindow);
+        final Animator animator = new Animator(glWindow);
 
         glWindow.setSize(256, 256);
         glWindow.setVisible(true);
@@ -88,7 +88,7 @@ public class TestShutdownCompleteNEWT extends UITestCase {
         }
     }
 
-    protected void oneLife(boolean glInfo) throws InterruptedException {
+    protected void oneLife(final boolean glInfo) throws InterruptedException {
         if(waitForEach) {
             UITestCase.waitForKey("Start One Life");
         }
@@ -137,7 +137,7 @@ public class TestShutdownCompleteNEWT extends UITestCase {
     static boolean waitForEach = false;
     static boolean waitForKey = false;
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-wait")) {
                 waitForKey = true;
@@ -153,7 +153,7 @@ public class TestShutdownCompleteNEWT extends UITestCase {
             UITestCase.waitForKey("Start");
         }
 
-        String tstname = TestShutdownCompleteNEWT.class.getName();
+        final String tstname = TestShutdownCompleteNEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java
new file mode 100644
index 0000000..6f38c4b
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestVersionSemanticsNOUI.java
@@ -0,0 +1,114 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.junit.jogl.acore;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URISyntaxException;
+import java.util.HashSet;
+import java.util.Set;
+
+import org.junit.FixMethodOrder;
+import org.junit.Test;
+import org.junit.runners.MethodSorters;
+import org.osjava.jardiff.DiffCriteria;
+import org.osjava.jardiff.SimpleDiffCriteria;
+import org.semver.Delta;
+
+import com.jogamp.common.util.JogampVersion;
+import com.jogamp.common.util.VersionNumberString;
+import com.jogamp.junit.util.JunitTracer;
+import com.jogamp.junit.util.VersionSemanticsUtil;
+import com.jogamp.opengl.JoglVersion;
+
+ at FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class TestVersionSemanticsNOUI extends JunitTracer {
+    static final String jarFile = "jogl-all.jar";
+    static final VersionNumberString preVersionNumber = new VersionNumberString("2.1.5");
+    static final Delta.CompatibilityType expectedCompatibilityType = Delta.CompatibilityType.NON_BACKWARD_COMPATIBLE;
+
+    static final DiffCriteria diffCriteria = new SimpleDiffCriteria();
+    // static final DiffCriteria diffCriteria = new PublicDiffCriteria();
+
+    static final JogampVersion curVersion = JoglVersion.getInstance();
+    static final VersionNumberString curVersionNumber = new VersionNumberString(curVersion.getImplementationVersion());
+
+    static final Set<String> excludes;
+    static {
+        excludes = new HashSet<String>();
+        excludes.add("^\\Qjogamp/\\E.*$");
+    }
+
+
+    // @Test
+    public void testVersionV212V213() throws IllegalArgumentException, IOException, URISyntaxException {
+        testVersions(diffCriteria, Delta.CompatibilityType.BACKWARD_COMPATIBLE_USER, "2.1.2", "2.1.3");
+    }
+
+    // @Test
+    public void testVersionV213V214() throws IllegalArgumentException, IOException, URISyntaxException {
+        testVersions(diffCriteria, Delta.CompatibilityType.BACKWARD_COMPATIBLE_USER, "2.1.3", "2.1.4");
+    }
+
+    // @Test
+    public void testVersionV214V215() throws IllegalArgumentException, IOException, URISyntaxException {
+        testVersions(diffCriteria, Delta.CompatibilityType.BACKWARD_COMPATIBLE_USER, "2.1.4", "2.1.5");
+    }
+
+    void testVersions(final DiffCriteria diffCriteria, final Delta.CompatibilityType expectedCompatibilityType,
+                      final String v1, final String v2) throws IllegalArgumentException, IOException, URISyntaxException {
+        final VersionNumberString preVersionNumber = new VersionNumberString(v1);
+        final File previousJar = new File("lib/v"+v1+"/"+jarFile);
+
+        final VersionNumberString curVersionNumber = new VersionNumberString(v2);
+        final File currentJar = new File("lib/v"+v2+"/"+jarFile);
+
+        VersionSemanticsUtil.testVersion(diffCriteria, expectedCompatibilityType,
+                                         previousJar, preVersionNumber,
+                                         currentJar, curVersionNumber,
+                                         excludes);
+    }
+
+    @Test
+    public void testVersionLatest() throws IllegalArgumentException, IOException, URISyntaxException {
+        final File previousJar = new File("lib/v"+preVersionNumber.getVersionString()+"/"+jarFile);
+
+        final ClassLoader currentCL = TestVersionSemanticsNOUI.class.getClassLoader();
+
+        VersionSemanticsUtil.testVersion(diffCriteria, expectedCompatibilityType,
+                                         previousJar, preVersionNumber,
+                                         curVersion.getClass(), currentCL, curVersionNumber,
+                                         excludes);
+    }
+
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestVersionSemanticsNOUI.class.getName();
+        org.junit.runner.JUnitCore.main(tstname);
+    }
+
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestX11DefaultDisplay.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestX11DefaultDisplay.java
index fca2beb..9ac190b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestX11DefaultDisplay.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/TestX11DefaultDisplay.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore;
 
 import javax.media.nativewindow.AbstractGraphicsDevice;
@@ -64,7 +64,7 @@ public class TestX11DefaultDisplay extends UITestCase {
         System.setProperty("nativewindow.x11.display.default", x11DefaultDisplay);
     }
 
-    protected void runTestGL(GLCapabilities caps) throws InterruptedException {
+    protected void runTestGL(final GLCapabilities caps) throws InterruptedException {
         final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle(getSimpleTestName("."));
@@ -76,21 +76,21 @@ public class TestX11DefaultDisplay extends UITestCase {
         final SnapshotGLEventListener snap = new SnapshotGLEventListener();
         snap.setPostSNDetail(demo.getClass().getSimpleName());
         glWindow.addGLEventListener(snap);
-        
-        Animator animator = new Animator(glWindow);
-        QuitAdapter quitAdapter = new QuitAdapter();
+
+        final Animator animator = new Animator(glWindow);
+        final QuitAdapter quitAdapter = new QuitAdapter();
 
         glWindow.addKeyListener(quitAdapter);
         glWindow.addWindowListener(quitAdapter);
 
         animator.start();
-        
+
         glWindow.setVisible(true);
 
         System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
         System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
-        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
-        
+        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
+
         animator.setUpdateFPSFrames(60, System.err);
         snap.setMakeSnapshot();
 
@@ -106,12 +106,12 @@ public class TestX11DefaultDisplay extends UITestCase {
     public void test00_DefaultDevice() {
         final AbstractGraphicsDevice defaultDevice = GLProfile.getDefaultDevice();
         System.out.println("GLProfile "+GLProfile.glAvailabilityToString());
-        System.out.println("GLProfile.getDefaultDevice(): "+defaultDevice);        
-        GLProfile glp = GLProfile.getDefault();
+        System.out.println("GLProfile.getDefaultDevice(): "+defaultDevice);
+        final GLProfile glp = GLProfile.getDefault();
         System.out.println("GLProfile.getDefault(): "+glp);
-        
-        GLCapabilities caps = new GLCapabilities(glp);        
-        GLWindow glWindow = GLWindow.create(caps);
+
+        final GLCapabilities caps = new GLCapabilities(glp);
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
 
         glWindow.addGLEventListener(new DumpGLInfo());
@@ -121,19 +121,19 @@ public class TestX11DefaultDisplay extends UITestCase {
 
         glWindow.display();
         glWindow.destroy();
-        
+
         if( NativeWindowFactory.TYPE_X11 == NativeWindowFactory.getNativeWindowType(true) ) {
             Assert.assertEquals("X11 Default device does not match", defaultDevice.getConnection(), x11DefaultDisplay);
         }
     }
-    
+
     @Test
     public void test01_GLDefaultRendering() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(null);
+        final GLCapabilities caps = new GLCapabilities(null);
         runTestGL(caps);
     }
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/Bug898AnimatorFromEDTAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/Bug898AnimatorFromEDTAWT.java
index 55e045d..764973f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/Bug898AnimatorFromEDTAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/Bug898AnimatorFromEDTAWT.java
@@ -56,7 +56,7 @@ public class Bug898AnimatorFromEDTAWT extends javax.swing.JFrame {
         //Layout
         setMinimumSize(new Dimension(640, 480));
         getContentPane().setLayout(new BorderLayout());
-        GLCanvas panel = new GLCanvas(new GLCapabilities(GLProfile.getMaxProgrammable(true)));
+        final GLCanvas panel = new GLCanvas(new GLCapabilities(GLProfile.getMaxProgrammable(true)));
         getContentPane().add(panel, BorderLayout.CENTER);
         pack();
         //Animator
@@ -69,19 +69,19 @@ public class Bug898AnimatorFromEDTAWT extends javax.swing.JFrame {
             long step = 1;
 
             @Override
-            public void init(GLAutoDrawable glad) {
+            public void init(final GLAutoDrawable glad) {
                 startTime = System.currentTimeMillis();
             }
 
             @Override
-            public void dispose(GLAutoDrawable glad) {
+            public void dispose(final GLAutoDrawable glad) {
             }
 
             @Override
-            public void display(GLAutoDrawable glad) {
-                long time = System.currentTimeMillis();
+            public void display(final GLAutoDrawable glad) {
+                final long time = System.currentTimeMillis();
                 if (animator.isAnimating() && step * 2000 < time - startTime) {
-                    long td = time - lastTime;
+                    final long td = time - lastTime;
                     lastTime = time;
                     animator.pause();
                     System.out.println(Thread.currentThread().getName()+": #"+step+" "+td+" ms: animator.pause(): paused "+animator);
@@ -89,13 +89,13 @@ public class Bug898AnimatorFromEDTAWT extends javax.swing.JFrame {
                         public void run() {
                             try {
                                 Thread.sleep(1000);
-                            } catch (InterruptedException e) {
+                            } catch (final InterruptedException e) {
                                 e.printStackTrace();
                             }
                             SwingUtilities.invokeLater(new Runnable() {
                                 @Override
                                 public void run() {
-                                    long td = System.currentTimeMillis() - lastTime;
+                                    final long td = System.currentTimeMillis() - lastTime;
                                     if (animator.isPaused()) {
                                         animator.resume(); //Doesn't work on v2.0.2 or higher
                                         System.out.println(Thread.currentThread().getName()+": #"+step+" "+td+" ms: animator.resume(): animating "+animator);
@@ -110,7 +110,7 @@ public class Bug898AnimatorFromEDTAWT extends javax.swing.JFrame {
             }
 
             @Override
-            public void reshape(GLAutoDrawable glad, int i, int i1, int i2, int i3) {
+            public void reshape(final GLAutoDrawable glad, final int i, final int i1, final int i2, final int i3) {
             }
         });
         //Start animation
@@ -118,7 +118,7 @@ public class Bug898AnimatorFromEDTAWT extends javax.swing.JFrame {
         System.out.println("animator.start()");
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         java.awt.EventQueue.invokeLater(new Runnable() {
             @Override
             public void run() {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAWTCardLayoutAnimatorStartStopBug532.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAWTCardLayoutAnimatorStartStopBug532.java
index 3790a87..97f8b3f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAWTCardLayoutAnimatorStartStopBug532.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAWTCardLayoutAnimatorStartStopBug532.java
@@ -18,6 +18,7 @@ import javax.swing.JComboBox;
 import javax.swing.JFrame;
 import javax.swing.JLabel;
 import javax.swing.JPanel;
+import javax.swing.WindowConstants;
 
 import org.junit.Test;
 import org.junit.FixMethodOrder;
@@ -74,12 +75,12 @@ public class TestAWTCardLayoutAnimatorStartStopBug532 extends UITestCase {
         testImpl(AnimatorControlBehavior.Continue, false);
     }
 
-    private static String id(Object obj) { return "0x" + ( null!=obj ? Integer.toHexString(obj.hashCode()) : "nil" ); }
-    private static String str(Component c) {
+    private static String id(final Object obj) { return "0x" + ( null!=obj ? Integer.toHexString(obj.hashCode()) : "nil" ); }
+    private static String str(final Component c) {
         return id(c)+": "+c.getClass().getSimpleName()+"[visible "+c.isVisible()+", showing "+c.isShowing()+", valid "+c.isValid()+
                 ", displayable "+c.isDisplayable()+", "+c.getX()+"/"+c.getY()+" "+c.getWidth()+"x"+c.getHeight()+"]";
     }
-    void testImpl(final AnimatorControlBehavior animCtrl, boolean useFPSAnimator) throws InterruptedException, InvocationTargetException {
+    void testImpl(final AnimatorControlBehavior animCtrl, final boolean useFPSAnimator) throws InterruptedException, InvocationTargetException {
       final GLProfile glp = GLProfile.get(GLProfile.GL2);
       final GLCapabilities caps = new GLCapabilities(glp);
       final GLCanvas canvas = new GLCanvas(caps);
@@ -119,12 +120,12 @@ public class TestAWTCardLayoutAnimatorStartStopBug532 extends UITestCase {
       final JFrame frame = new JFrame();
       frame.setTitle(getSimpleTestName(" - "));
       frame.addWindowListener(new WindowAdapter() {
-         public void windowClosing(WindowEvent e) {
+         public void windowClosing(final WindowEvent e) {
             animatorCtrl.stop();
             shouldStop = true;
          }
       });
-      frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+      frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
 
       final JLabel label = new JLabel("A label to cover the canvas");
 
@@ -235,7 +236,7 @@ public class TestAWTCardLayoutAnimatorStartStopBug532 extends UITestCase {
 
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java
index 42f170a..d39abba 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLJPanel01AWT.java
@@ -49,7 +49,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
     static final int width = 640;
     static final int height = 480;
 
-    protected GLJPanel createGLJPanel(final GLCapabilities caps, final Frame frame, int x, int y, GearsES2 gears) throws InterruptedException {
+    protected GLJPanel createGLJPanel(final GLCapabilities caps, final Frame frame, final int x, final int y, final GearsES2 gears) throws InterruptedException {
         final GLJPanel glCanvas = new GLJPanel(caps);
         Assert.assertNotNull(glCanvas);
         glCanvas.addGLEventListener(gears);
@@ -60,7 +60,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
         return glCanvas;
     }
 
-    static void pauseAnimator(Animator animator, boolean pause) {
+    static void pauseAnimator(final Animator animator, final boolean pause) {
         if(pause) {
             animator.pause();
             Assert.assertEquals(true, animator.isStarted());
@@ -73,7 +73,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
             Assert.assertEquals(true, animator.isAnimating());
         }
     }
-    static void stopAnimator(Animator animator) {
+    static void stopAnimator(final Animator animator) {
         animator.stop();
         Assert.assertEquals(false, animator.isStarted());
         Assert.assertEquals(false, animator.isPaused());
@@ -133,7 +133,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
 
         try {
             Thread.sleep(duration/3);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
 
@@ -141,7 +141,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
 
         try {
             Thread.sleep(duration/3);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
 
@@ -149,7 +149,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
 
         try {
             Thread.sleep(duration/3);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
 
@@ -163,7 +163,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
                     f1.dispose();
                     f2.dispose();
                     f3.dispose();
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     throw new RuntimeException(t);
                 }
             }});
@@ -235,7 +235,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
 
         try {
             Thread.sleep(duration/3);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
 
@@ -245,7 +245,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
 
         try {
             Thread.sleep(duration/3);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
 
@@ -255,7 +255,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
 
         try {
             Thread.sleep(duration/3);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
 
@@ -271,7 +271,7 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
                     f1.dispose();
                     f2.dispose();
                     f3.dispose();
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     throw new RuntimeException(t);
                 }
             }});
@@ -283,13 +283,13 @@ public class TestAnimatorGLJPanel01AWT extends UITestCase {
 
     static long duration = 3*500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         /**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java
index 7b0fbe9..0389251 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/anim/TestAnimatorGLWindow01NEWT.java
@@ -48,7 +48,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
     static final int width = 640;
     static final int height = 480;
 
-    protected GLWindow createGLWindow(final GLCapabilities caps, int x, int y, GearsES2 gears) throws InterruptedException {
+    protected GLWindow createGLWindow(final GLCapabilities caps, final int x, final int y, final GearsES2 gears) throws InterruptedException {
         final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.addGLEventListener(gears);
@@ -58,7 +58,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
         return glWindow;
     }
 
-    static void pauseAnimator(Animator animator, boolean pause) {
+    static void pauseAnimator(final Animator animator, final boolean pause) {
         if(pause) {
             animator.pause();
             Assert.assertEquals(true, animator.isStarted());
@@ -71,7 +71,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
             Assert.assertEquals(true, animator.isAnimating());
         }
     }
-    static void stopAnimator(Animator animator) {
+    static void stopAnimator(final Animator animator) {
         animator.stop();
         Assert.assertEquals(false, animator.isStarted());
         Assert.assertEquals(false, animator.isPaused());
@@ -125,7 +125,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
 
         try {
             Thread.sleep(duration/3);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
 
@@ -133,7 +133,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
 
         try {
             Thread.sleep(duration/3);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
 
@@ -141,7 +141,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
 
         try {
             Thread.sleep(duration/3);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
 
@@ -208,7 +208,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
 
         try {
             Thread.sleep(duration/3);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
 
@@ -218,7 +218,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
 
         try {
             Thread.sleep(duration/3);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
 
@@ -228,7 +228,7 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
 
         try {
             Thread.sleep(duration/3);
-        } catch(Exception e) {
+        } catch(final Exception e) {
             e.printStackTrace();
         }
 
@@ -249,13 +249,13 @@ public class TestAnimatorGLWindow01NEWT extends UITestCase {
 
     static long duration = 3*500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         /**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00.java
index 4980e85..6e10d65 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.ect;
 
 import com.jogamp.newt.NewtFactory;
@@ -54,44 +54,45 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 /**
- * ExclusiveContextThread base implementation to test correctness of the ExclusiveContext feature _and_ AnimatorBase. 
+ * ExclusiveContextThread base implementation to test correctness of the ExclusiveContext feature _and_ AnimatorBase.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public abstract class ExclusiveContextBase00 extends UITestCase {
     static boolean testExclusiveWithAWT = false;
-    static final int durationParts = 9;         
+    static final int durationParts = 9;
     static long duration = 320 * durationParts; // ms ~ 20 frames
-    
+
     static boolean showFPS = false;
     static int showFPSRate = 100;
-    
-    static final int demoSize = 128;
-    
+
+    static final int demoWinSize = 128;
+
     static InsetsImmutable insets = null;
-    static int scrnHeight, scrnWidth;
     static int num_x, num_y;
-    
+
     static int swapInterval = 0;
-    
+
     @BeforeClass
     public static void initClass00() {
-        Window dummyWindow = NewtFactory.createWindow(new Capabilities());
-        dummyWindow.setSize(demoSize, demoSize);
+        final Window dummyWindow = NewtFactory.createWindow(new Capabilities());
+        dummyWindow.setSize(demoWinSize, demoWinSize);
         dummyWindow.setVisible(true);
         Assert.assertEquals(true, dummyWindow.isVisible());
         Assert.assertEquals(true, dummyWindow.isNativeValid());
-        insets = dummyWindow.getInsets();        
-        scrnHeight = dummyWindow.getScreen().getHeight();
-        scrnWidth = dummyWindow.getScreen().getWidth();        
-        num_x = scrnWidth  / ( demoSize + insets.getTotalWidth() )  - 2;
-        num_y = scrnHeight / ( demoSize + insets.getTotalHeight() ) - 2;
+        insets = dummyWindow.getInsets();
+        final int scrnHeight = dummyWindow.getScreen().getHeight();
+        final int scrnWidth = dummyWindow.getScreen().getWidth();
+        final int[] demoScreenSize = dummyWindow.convertToPixelUnits(new int[] { demoWinSize, demoWinSize });
+        final int[] insetsScreenSize = dummyWindow.convertToPixelUnits(new int[] { insets.getTotalWidth(), insets.getTotalHeight() });
+        num_x = scrnWidth  / ( demoScreenSize[0] + insetsScreenSize[0] ) - 2;
+        num_y = scrnHeight / ( demoScreenSize[1] + insetsScreenSize[1] ) - 2;
         dummyWindow.destroy();
     }
 
     @AfterClass
     public static void releaseClass00() {
     }
-    
+
     protected abstract boolean isAWTTestCase();
     protected abstract Thread getAWTRenderThread();
     protected abstract AnimatorBase createAnimator();
@@ -99,7 +100,7 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
     protected abstract void setGLAutoDrawableVisible(GLAutoDrawable[] glads);
     protected abstract void destroyGLAutoDrawableVisible(GLAutoDrawable glad);
 
-    protected void runTestGL(GLCapabilitiesImmutable caps, int drawableCount, boolean exclusive, boolean preAdd, boolean shortenTest) throws InterruptedException {
+    protected void runTestGL(final GLCapabilitiesImmutable caps, final int drawableCount, final boolean exclusive, final boolean preAdd, final boolean shortenTest) throws InterruptedException {
         final boolean useAWTRenderThread = isAWTTestCase();
         if( useAWTRenderThread && exclusive ) {
             if( testExclusiveWithAWT ) {
@@ -116,20 +117,20 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
         final Thread awtRenderThread = getAWTRenderThread();
         final AnimatorBase animator = createAnimator();
         if( !useAWTRenderThread ) {
-            animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+            animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
         }
         final GLAutoDrawable[] drawables = new GLAutoDrawable[drawableCount];
         for(int i=0; i<drawableCount; i++) {
-            final int x = (  i          % num_x ) * ( demoSize + insets.getTotalHeight() ) + insets.getLeftWidth();
-            final int y = ( (i / num_x) % num_y ) * ( demoSize + insets.getTotalHeight() ) + insets.getTopHeight();
-            
-            drawables[i] = createGLAutoDrawable("Win #"+i, x, y, demoSize, demoSize, caps);
+            final int x = (  i          % num_x ) * ( demoWinSize + insets.getTotalHeight() ) + insets.getLeftWidth();
+            final int y = ( (i / num_x) % num_y ) * ( demoWinSize + insets.getTotalHeight() ) + insets.getTopHeight();
+
+            drawables[i] = createGLAutoDrawable("Win #"+i, x, y, demoWinSize, demoWinSize, caps);
             Assert.assertNotNull(drawables[i]);
             final GearsES2 demo = new GearsES2(swapInterval);
             demo.setVerbose(false);
             drawables[i].addGLEventListener(demo);
         }
-        
+
         if( preAdd ) {
             for(int i=0; i<drawableCount; i++) {
                 animator.add(drawables[i]);
@@ -144,10 +145,10 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
         }
         Assert.assertFalse(animator.isAnimating());
         Assert.assertFalse(animator.isStarted());
-        
+
         // Animator Start
         Assert.assertTrue(animator.start());
-        
+
         Assert.assertTrue(animator.isStarted());
         if( preAdd ) {
             Assert.assertTrue(animator.isAnimating());
@@ -166,7 +167,7 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
             Assert.assertTrue(animator.isAnimating());
         }
         Assert.assertEquals(exclusive, animator.isExclusiveContextEnabled());
-        
+
         // After start, ExclusiveContextThread is set
         {
             final Thread ect = animator.getExclusiveContextThread();
@@ -178,14 +179,14 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
                 }
             } else {
                 Assert.assertEquals(null, ect);
-            }   
+            }
             for(int i=0; i<drawableCount; i++) {
                 Assert.assertEquals(ect, drawables[i].getExclusiveContextThread());
             }
             setGLAutoDrawableVisible(drawables);
         }
         animator.setUpdateFPSFrames(showFPSRate, showFPS ? System.err : null);
-        
+
         // Normal run ..
         Thread.sleep(duration/durationParts); // 1
 
@@ -197,19 +198,19 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
                     Assert.assertEquals(awtRenderThread, ect);
                 } else {
                     Assert.assertEquals(animator.getThread(), ect);
-                }            
+                }
                 for(int i=0; i<drawableCount; i++) {
                     final Thread t = drawables[i].setExclusiveContextThread(null);
                     Assert.assertEquals(ect, t);
                 }
-                
+
                 Thread.sleep(duration/durationParts); // 2
-                
+
                 for(int i=0; i<drawableCount; i++) {
                     // poll until clearing drawable ECT is established
                     {
                         boolean ok = null == drawables[i].getExclusiveContextThread();
-                        int c = 0; 
+                        int c = 0;
                         while(!ok && c<5*50) { // 5*50*20 = 5s TO
                             Thread.sleep(20);
                             ok = null == drawables[i].getExclusiveContextThread();
@@ -223,10 +224,10 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
                     final Thread t = drawables[i].setExclusiveContextThread(ect);
                     Assert.assertEquals(null, t);
                 }
-                
+
                 Thread.sleep(duration/durationParts); // 3
             }
-            
+
             // Disable/Enable exclusive mode via Animator for all GLAutoDrawable
             if(exclusive) {
                 final Thread ect = animator.getExclusiveContextThread();
@@ -234,31 +235,31 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
                     Assert.assertEquals(awtRenderThread, ect);
                 } else {
                     Assert.assertEquals(animator.getThread(), ect);
-                }            
-                
+                }
+
                 Assert.assertEquals(true, animator.setExclusiveContext(false));
                 Assert.assertFalse(animator.isExclusiveContextEnabled());
                 for(int i=0; i<drawableCount; i++) {
                     Assert.assertEquals(null, drawables[i].getExclusiveContextThread());
                 }
-                
+
                 Thread.sleep(duration/durationParts); // 4
-                
+
                 Assert.assertEquals(null, animator.setExclusiveContext(ect));
                 Assert.assertTrue(animator.isExclusiveContextEnabled());
                 Assert.assertEquals(ect, animator.getExclusiveContextThread());
                 for(int i=0; i<drawableCount; i++) {
                     Assert.assertEquals(ect, drawables[i].getExclusiveContextThread());
                 }
-                
+
                 Thread.sleep(duration/durationParts); // 5
-            }        
-    
+            }
+
             Assert.assertEquals(exclusive, animator.isExclusiveContextEnabled());
             Assert.assertTrue(animator.isStarted());
             Assert.assertTrue(animator.isAnimating());
             Assert.assertFalse(animator.isPaused());
-            
+
             // Animator Pause
             Assert.assertTrue(animator.pause());
             Assert.assertTrue(animator.isStarted());
@@ -277,9 +278,9 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
             }
             for(int i=0; i<drawableCount; i++) {
                 Assert.assertEquals(null, drawables[i].getExclusiveContextThread());
-            }        
+            }
             Thread.sleep(duration/durationParts); // 6
-            
+
             // Animator Resume
             Assert.assertTrue(animator.resume());
             Assert.assertTrue(animator.isStarted());
@@ -295,32 +296,32 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
                 }
                 for(int i=0; i<drawableCount; i++) {
                     Assert.assertEquals(ect, drawables[i].getExclusiveContextThread());
-                }        
+                }
             } else {
                 Assert.assertEquals(null, animator.getExclusiveContextThread());
                 for(int i=0; i<drawableCount; i++) {
                     Assert.assertEquals(null, drawables[i].getExclusiveContextThread());
-                }        
+                }
             }
             Thread.sleep(duration/durationParts); // 7
-            
+
             // Animator Stop #1
-            Assert.assertTrue(animator.stop());        
+            Assert.assertTrue(animator.stop());
             Assert.assertFalse(animator.isAnimating());
             Assert.assertFalse(animator.isStarted());
-            Assert.assertFalse(animator.isPaused());        
+            Assert.assertFalse(animator.isPaused());
             Assert.assertEquals(exclusive, animator.isExclusiveContextEnabled());
             Assert.assertEquals(null, animator.getExclusiveContextThread());
             for(int i=0; i<drawableCount; i++) {
                 Assert.assertEquals(null, drawables[i].getExclusiveContextThread());
             }
             Thread.sleep(duration/durationParts); // 8
-            
+
             // Animator Re-Start
-            Assert.assertTrue(animator.start());        
+            Assert.assertTrue(animator.start());
             Assert.assertTrue(animator.isStarted());
             Assert.assertTrue(animator.isAnimating());
-            Assert.assertEquals(exclusive, animator.isExclusiveContextEnabled());        
+            Assert.assertEquals(exclusive, animator.isExclusiveContextEnabled());
             // After start, ExclusiveContextThread is set
             {
                 final Thread ect = animator.getExclusiveContextThread();
@@ -332,13 +333,13 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
                     }
                 } else {
                     Assert.assertEquals(null, ect);
-                }   
+                }
                 for(int i=0; i<drawableCount; i++) {
                     Assert.assertEquals(ect, drawables[i].getExclusiveContextThread());
                 }
             }
             Thread.sleep(duration/durationParts); // 9
-            
+
             // Remove all drawables .. while running!
             for(int i=0; i<drawableCount; i++) {
                 final GLAutoDrawable drawable = drawables[i];
@@ -348,22 +349,22 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
             Assert.assertTrue(animator.isStarted());
             Assert.assertFalse(animator.isAnimating()); // no drawables in list!
         } // !shortenTest
-        
+
         // Animator Stop #2
-        Assert.assertTrue(animator.stop());       
+        Assert.assertTrue(animator.stop());
         Assert.assertFalse(animator.isAnimating());
         Assert.assertFalse(animator.isStarted());
-        Assert.assertFalse(animator.isPaused());        
+        Assert.assertFalse(animator.isPaused());
         Assert.assertEquals(exclusive, animator.isExclusiveContextEnabled());
         Assert.assertEquals(null, animator.getExclusiveContextThread());
-        
+
         // Destroy GLWindows
         for(int i=0; i<drawableCount; i++) {
             destroyGLAutoDrawableVisible(drawables[i]);
             Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(drawables[i], false));
-        }        
-    }    
-    
+        }
+    }
+
     @Test
     public void test01NormalPre_1Win() throws InterruptedException {
         final GLProfile glp = GLProfile.getGL2ES2();
@@ -384,40 +385,40 @@ public abstract class ExclusiveContextBase00 extends UITestCase {
         final GLCapabilities caps = new GLCapabilities( glp );
         runTestGL(caps, 1 /* numWin */, true /* exclusive */, true /* preAdd */, false /* short */);
     }
-    
+
     @Test
     public void test04ExclPost_1Win() throws InterruptedException {
         final GLProfile glp = GLProfile.getGL2ES2();
         final GLCapabilities caps = new GLCapabilities( glp );
         runTestGL(caps, 1 /* numWin */, true /* exclusive */, false /* preAdd */, true /* short */);
     }
-    
+
     @Test
     public void test05NormalPre_4Win() throws InterruptedException {
         final GLProfile glp = GLProfile.getGL2ES2();
         final GLCapabilities caps = new GLCapabilities( glp );
         runTestGL(caps, 4 /* numWin */, false /* exclusive */, true /* preAdd */, false /* short */);
     }
-    
+
     @Test
     public void test06NormalPost_4Win() throws InterruptedException {
         final GLProfile glp = GLProfile.getGL2ES2();
         final GLCapabilities caps = new GLCapabilities( glp );
         runTestGL(caps, 4 /* numWin */, false /* exclusive */, false /* preAdd */, true /* short */);
     }
-    
+
     @Test
     public void test07ExclPre_4Win() throws InterruptedException {
         final GLProfile glp = GLProfile.getGL2ES2();
         final GLCapabilities caps = new GLCapabilities( glp );
         runTestGL(caps, 4 /* numWin */, true /* exclusive */, true /* preAdd */, false /* short */);
     }
-    
+
     @Test
     public void test08ExclPost_4Win() throws InterruptedException {
         final GLProfile glp = GLProfile.getGL2ES2();
         final GLCapabilities caps = new GLCapabilities( glp );
         runTestGL(caps, 4 /* numWin */, true /* exclusive */, false /* preAdd */, true /* short */);
     }
-    
+
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00AWT.java
index 5608fe2..414841a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.ect;
 
 import java.awt.BorderLayout;
@@ -49,62 +49,62 @@ import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.VersionNumber;
 
 /**
- * ExclusiveContextThread base implementation to test correctness of the ExclusiveContext feature _and_ AnimatorBase with AWT. 
+ * ExclusiveContextThread base implementation to test correctness of the ExclusiveContext feature _and_ AnimatorBase with AWT.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public abstract class ExclusiveContextBase00AWT extends ExclusiveContextBase00 {
 
     static Thread awtEDT;
-    static boolean osxCALayerAWTModBug; 
-    
+    static boolean osxCALayerAWTModBug;
+
     @BeforeClass
     public static void initClass00AWT() {
-        
+
         final VersionNumber version170 = new VersionNumber(1, 7, 0);
-        osxCALayerAWTModBug = Platform.OSType.MACOS == Platform.getOSType() && 
+        osxCALayerAWTModBug = Platform.OSType.MACOS == Platform.getOSType() &&
                               0 > Platform.getJavaVersionNumber().compareTo(version170);
         System.err.println("OSX CALayer AWT-Mod Bug "+osxCALayerAWTModBug);
         System.err.println("OSType "+Platform.getOSType());
         System.err.println("Java Version "+Platform.getJavaVersionNumber());
-     
+
         try {
             EventQueue.invokeAndWait(new Runnable() {
                 public void run() {
                     awtEDT = Thread.currentThread();
                 } } );
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
             Assert.assertNull(e);
         }
-        
+
     }
-    
+
     @AfterClass
     public static void releaseClass00AWT() {
     }
-    
+
     @Override
     protected boolean isAWTTestCase() { return true; }
-    
+
     @Override
     protected Thread getAWTRenderThread() {
         return awtEDT;
     }
-    
+
     @Override
-    protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, GLCapabilitiesImmutable caps) {
+    protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, final GLCapabilitiesImmutable caps) {
         final GLCanvas glCanvas = new GLCanvas();
-        
+
         // FIXME: Below AWT layouts freezes OSX/Java7 @ setVisible: Window.setVisible .. CWrapper at NSWindow.isKeyWindow
         // final Dimension sz = new Dimension(width, height);
         // glCanvas.setMinimumSize(sz);
         // glCanvas.setPreferredSize(sz);
-        // glCanvas.setSize(sz);        
+        // glCanvas.setSize(sz);
         try {
             EventQueue.invokeAndWait(new Runnable() {
                 public void run() {
-                    final Frame frame = new Frame(); 
-                    frame.setLayout(new BorderLayout());      
+                    final Frame frame = new Frame();
+                    frame.setLayout(new BorderLayout());
                     frame.setMinimumSize(new Dimension(width, height));
                     frame.setBounds(x, y, width, height);
                     frame.add(glCanvas, BorderLayout.CENTER);
@@ -114,22 +114,22 @@ public abstract class ExclusiveContextBase00AWT extends ExclusiveContextBase00 {
                         frame.setTitle(title);
                     }
                 } });
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
             Assert.assertNull(e);
         }
-        
+
         return glCanvas;
     }
-    
-    protected Frame getFrame(GLAutoDrawable glad) {
+
+    protected Frame getFrame(final GLAutoDrawable glad) {
         Container p = ((Component)glad).getParent();
         while( null != p && !( p instanceof Frame ) ) {
             p = p.getParent();
         }
-        return (Frame)p;                
+        return (Frame)p;
     }
-    
+
     @Override
     protected void setGLAutoDrawableVisible(final GLAutoDrawable[] glads) {
         try {
@@ -138,27 +138,27 @@ public abstract class ExclusiveContextBase00AWT extends ExclusiveContextBase00 {
                     final int count = glads.length;
                     for(int i=0; i<count; i++) {
                         final GLAutoDrawable glad = glads[i];
-                        final Frame frame = getFrame(glad);        
+                        final Frame frame = getFrame(glad);
                         frame.setVisible(true);
-                    } 
+                    }
                 } } );
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
             Assert.assertNull(e);
         }
     }
-    
+
     @Override
-    protected void destroyGLAutoDrawableVisible(GLAutoDrawable glad) {
+    protected void destroyGLAutoDrawableVisible(final GLAutoDrawable glad) {
         final Frame frame = getFrame(glad);
         try {
             EventQueue.invokeAndWait(new Runnable() {
                 public void run() {
                     frame.dispose();
                 } } );
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
             Assert.assertNull(e);
         }
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00NEWT.java
index 3f2de01..9fe8bd0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase00NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.ect;
 
 import com.jogamp.newt.Display;
@@ -43,55 +43,55 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 /**
- * ExclusiveContextThread base implementation to test correctness of the ExclusiveContext feature _and_ AnimatorBase with NEWT. 
+ * ExclusiveContextThread base implementation to test correctness of the ExclusiveContext feature _and_ AnimatorBase with NEWT.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public abstract class ExclusiveContextBase00NEWT extends ExclusiveContextBase00 {
 
     static Display dpy;
     static Screen screen;
-    
+
     @BeforeClass
     public static void initClass00NEWT() {
         dpy = NewtFactory.createDisplay(null);
-        screen = NewtFactory.createScreen(dpy, 0);        
+        screen = NewtFactory.createScreen(dpy, 0);
     }
-    
+
     @AfterClass
     public static void releaseClass00NEWT() {
         screen = null;
         dpy = null;
     }
-    
+
     @Override
     protected boolean isAWTTestCase() { return false; }
-    
+
     @Override
     protected Thread getAWTRenderThread() {
         return null;
     }
-    
+
     @Override
-    protected GLAutoDrawable createGLAutoDrawable(String title, int x, int y, int width, int height, GLCapabilitiesImmutable caps) {
-        GLWindow glWindow = GLWindow.create(screen, caps);
+    protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, final GLCapabilitiesImmutable caps) {
+        final GLWindow glWindow = GLWindow.create(screen, caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle(title);
         glWindow.setSize(width, height);
         glWindow.setPosition(x, y);
         return glWindow;
     }
-    
+
     @Override
-    protected void setGLAutoDrawableVisible(GLAutoDrawable[] glads) {
+    protected void setGLAutoDrawableVisible(final GLAutoDrawable[] glads) {
         final int count = glads.length;
         for(int i=0; i<count; i++) {
             final GLAutoDrawable glad = glads[i];
             ((GLWindow)glad).setVisible(true);
         }
     }
-    
+
     @Override
-    protected void destroyGLAutoDrawableVisible(GLAutoDrawable glad) {
+    protected void destroyGLAutoDrawableVisible(final GLAutoDrawable glad) {
         ((GLWindow)glad).destroy();
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10.java
index 5166227..02f6efd 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.ect;
 
 import com.jogamp.newt.NewtFactory;
@@ -54,43 +54,44 @@ import org.junit.Test;
 import org.junit.runners.MethodSorters;
 
 /**
- * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with AnimatorBase. 
+ * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with AnimatorBase.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public abstract class ExclusiveContextBase10 extends UITestCase {
     static boolean testExclusiveWithAWT = false;
     static long duration = 1400;
-    
+
     static boolean showFPS = true;
     static int showFPSRate = 60;
-    
-    static final int demoSize = 128;
-    
+
+    static final int demoWinSize = 128;
+
     static InsetsImmutable insets = null;
-    static int scrnHeight, scrnWidth;
     static int num_x, num_y;
-    
+
     static int swapInterval = 0;
-    
+
     @BeforeClass
     public static void initClass00() {
-        Window dummyWindow = NewtFactory.createWindow(new Capabilities());
-        dummyWindow.setSize(demoSize, demoSize);
+        final Window dummyWindow = NewtFactory.createWindow(new Capabilities());
+        dummyWindow.setSize(demoWinSize, demoWinSize);
         dummyWindow.setVisible(true);
         Assert.assertEquals(true, dummyWindow.isVisible());
         Assert.assertEquals(true, dummyWindow.isNativeValid());
-        insets = dummyWindow.getInsets();        
-        scrnHeight = dummyWindow.getScreen().getHeight();
-        scrnWidth = dummyWindow.getScreen().getWidth();        
-        num_x = scrnWidth  / ( demoSize + insets.getTotalWidth() )  - 2;
-        num_y = scrnHeight / ( demoSize + insets.getTotalHeight() ) - 2;
+        insets = dummyWindow.getInsets();
+        final int scrnHeight = dummyWindow.getScreen().getHeight();
+        final int scrnWidth = dummyWindow.getScreen().getWidth();
+        final int[] demoScreenSize = dummyWindow.convertToPixelUnits(new int[] { demoWinSize, demoWinSize });
+        final int[] insetsScreenSize = dummyWindow.convertToPixelUnits(new int[] { insets.getTotalWidth(), insets.getTotalHeight() });
+        num_x = scrnWidth  / ( demoScreenSize[0] + insetsScreenSize[0] ) - 2;
+        num_y = scrnHeight / ( demoScreenSize[1] + insetsScreenSize[1] ) - 2;
         dummyWindow.destroy();
     }
 
     @AfterClass
     public static void releaseClass00() {
     }
-    
+
     protected abstract boolean isAWTTestCase();
     protected abstract Thread getAWTRenderThread();
     protected abstract AnimatorBase createAnimator();
@@ -98,7 +99,7 @@ public abstract class ExclusiveContextBase10 extends UITestCase {
     protected abstract void setGLAutoDrawableVisible(GLAutoDrawable[] glads);
     protected abstract void destroyGLAutoDrawableVisible(GLAutoDrawable glad);
 
-    protected void runTestGL(GLCapabilitiesImmutable caps, int drawableCount, boolean exclusive) throws InterruptedException {
+    protected void runTestGL(final GLCapabilitiesImmutable caps, final int drawableCount, final boolean exclusive) throws InterruptedException {
         final boolean useAWTRenderThread = isAWTTestCase();
         if( useAWTRenderThread && exclusive ) {
             if( testExclusiveWithAWT ) {
@@ -115,20 +116,20 @@ public abstract class ExclusiveContextBase10 extends UITestCase {
         final Thread awtRenderThread = getAWTRenderThread();
         final AnimatorBase animator = createAnimator();
         if( !useAWTRenderThread ) {
-            animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+            animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
         }
         final GLAutoDrawable[] drawables = new GLAutoDrawable[drawableCount];
         for(int i=0; i<drawableCount; i++) {
-            final int x = (  i          % num_x ) * ( demoSize + insets.getTotalHeight() ) + insets.getLeftWidth();
-            final int y = ( (i / num_x) % num_y ) * ( demoSize + insets.getTotalHeight() ) + insets.getTopHeight();
-            
-            drawables[i] = createGLAutoDrawable("Win #"+i, x, y, demoSize, demoSize, caps);
+            final int x = (  i          % num_x ) * ( demoWinSize + insets.getTotalHeight() ) + insets.getLeftWidth();
+            final int y = ( (i / num_x) % num_y ) * ( demoWinSize + insets.getTotalHeight() ) + insets.getTopHeight();
+
+            drawables[i] = createGLAutoDrawable("Win #"+i, x, y, demoWinSize, demoWinSize, caps);
             Assert.assertNotNull(drawables[i]);
             final GearsES2 demo = new GearsES2(swapInterval);
             demo.setVerbose(false);
             drawables[i].addGLEventListener(demo);
         }
-        
+
         for(int i=0; i<drawableCount; i++) {
             animator.add(drawables[i]);
         }
@@ -141,14 +142,14 @@ public abstract class ExclusiveContextBase10 extends UITestCase {
         }
         Assert.assertFalse(animator.isAnimating());
         Assert.assertFalse(animator.isStarted());
-        
+
         // Animator Start
         Assert.assertTrue(animator.start());
-        
+
         Assert.assertTrue(animator.isStarted());
         Assert.assertTrue(animator.isAnimating());
         Assert.assertEquals(exclusive, animator.isExclusiveContextEnabled());
-        
+
         // After start, ExclusiveContextThread is set
         {
             final Thread ect = animator.getExclusiveContextThread();
@@ -160,32 +161,32 @@ public abstract class ExclusiveContextBase10 extends UITestCase {
                 }
             } else {
                 Assert.assertEquals(null, ect);
-            }   
+            }
             for(int i=0; i<drawableCount; i++) {
                 Assert.assertEquals(ect, drawables[i].getExclusiveContextThread());
             }
             setGLAutoDrawableVisible(drawables);
         }
         animator.setUpdateFPSFrames(showFPSRate, showFPS ? System.err : null);
-        
+
         // Normal run ..
         Thread.sleep(duration);
-        
+
         // Animator Stop #2
-        Assert.assertTrue(animator.stop());       
+        Assert.assertTrue(animator.stop());
         Assert.assertFalse(animator.isAnimating());
         Assert.assertFalse(animator.isStarted());
-        Assert.assertFalse(animator.isPaused());        
+        Assert.assertFalse(animator.isPaused());
         Assert.assertEquals(exclusive, animator.isExclusiveContextEnabled());
         Assert.assertEquals(null, animator.getExclusiveContextThread());
-        
+
         // Destroy GLWindows
         for(int i=0; i<drawableCount; i++) {
             destroyGLAutoDrawableVisible(drawables[i]);
             Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(drawables[i], false));
-        }        
-    }    
-    
+        }
+    }
+
     @Test
     public void test01Normal_1Win() throws InterruptedException {
         final GLProfile glp = GLProfile.getGL2ES2();
@@ -199,18 +200,18 @@ public abstract class ExclusiveContextBase10 extends UITestCase {
         final GLCapabilities caps = new GLCapabilities( glp );
         runTestGL(caps, 1 /* numWin */, true /* exclusive */);
     }
-    
+
     @Test
     public void test05Normal_4Win() throws InterruptedException {
         final GLProfile glp = GLProfile.getGL2ES2();
         final GLCapabilities caps = new GLCapabilities( glp );
         runTestGL(caps, 4 /* numWin */, false /* exclusive */);
     }
-    
+
     @Test
     public void test07Excl_4Win() throws InterruptedException {
         final GLProfile glp = GLProfile.getGL2ES2();
         final GLCapabilities caps = new GLCapabilities( glp );
         runTestGL(caps, 4 /* numWin */, true /* exclusive */);
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10AWT.java
index 237479e..8f47150 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.ect;
 
 import java.awt.BorderLayout;
@@ -49,62 +49,62 @@ import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.VersionNumber;
 
 /**
- * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with AnimatorBase and AWT. 
+ * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with AnimatorBase and AWT.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public abstract class ExclusiveContextBase10AWT extends ExclusiveContextBase10 {
 
     static Thread awtEDT;
-    static boolean osxCALayerAWTModBug; 
-    
+    static boolean osxCALayerAWTModBug;
+
     @BeforeClass
     public static void initClass00AWT() {
-        
+
         final VersionNumber version170 = new VersionNumber(1, 7, 0);
-        osxCALayerAWTModBug = Platform.OSType.MACOS == Platform.getOSType() && 
+        osxCALayerAWTModBug = Platform.OSType.MACOS == Platform.getOSType() &&
                               0 > Platform.getJavaVersionNumber().compareTo(version170);
         System.err.println("OSX CALayer AWT-Mod Bug "+osxCALayerAWTModBug);
         System.err.println("OSType "+Platform.getOSType());
         System.err.println("Java Version "+Platform.getJavaVersionNumber());
-     
+
         try {
             EventQueue.invokeAndWait(new Runnable() {
                 public void run() {
                     awtEDT = Thread.currentThread();
                 } } );
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
             Assert.assertNull(e);
         }
-        
+
     }
-    
+
     @AfterClass
     public static void releaseClass00AWT() {
     }
-    
+
     @Override
     protected boolean isAWTTestCase() { return true; }
-    
+
     @Override
     protected Thread getAWTRenderThread() {
         return awtEDT;
     }
-    
+
     @Override
-    protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, GLCapabilitiesImmutable caps) {
+    protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, final GLCapabilitiesImmutable caps) {
         final GLCanvas glCanvas = new GLCanvas();
-        
+
         // FIXME: Below AWT layouts freezes OSX/Java7 @ setVisible: Window.setVisible .. CWrapper at NSWindow.isKeyWindow
         // final Dimension sz = new Dimension(width, height);
         // glCanvas.setMinimumSize(sz);
         // glCanvas.setPreferredSize(sz);
-        // glCanvas.setSize(sz);        
+        // glCanvas.setSize(sz);
         try {
             EventQueue.invokeAndWait(new Runnable() {
                 public void run() {
-                    final Frame frame = new Frame(); 
-                    frame.setLayout(new BorderLayout());      
+                    final Frame frame = new Frame();
+                    frame.setLayout(new BorderLayout());
                     frame.setMinimumSize(new Dimension(width, height));
                     frame.setBounds(x, y, width, height);
                     frame.add(glCanvas, BorderLayout.CENTER);
@@ -114,22 +114,22 @@ public abstract class ExclusiveContextBase10AWT extends ExclusiveContextBase10 {
                         frame.setTitle(title);
                     }
                 } });
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
             Assert.assertNull(e);
         }
-        
+
         return glCanvas;
     }
-    
-    protected Frame getFrame(GLAutoDrawable glad) {
+
+    protected Frame getFrame(final GLAutoDrawable glad) {
         Container p = ((Component)glad).getParent();
         while( null != p && !( p instanceof Frame ) ) {
             p = p.getParent();
         }
-        return (Frame)p;                
+        return (Frame)p;
     }
-    
+
     @Override
     protected void setGLAutoDrawableVisible(final GLAutoDrawable[] glads) {
         try {
@@ -138,27 +138,27 @@ public abstract class ExclusiveContextBase10AWT extends ExclusiveContextBase10 {
                     final int count = glads.length;
                     for(int i=0; i<count; i++) {
                         final GLAutoDrawable glad = glads[i];
-                        final Frame frame = getFrame(glad);        
+                        final Frame frame = getFrame(glad);
                         frame.setVisible(true);
-                    } 
+                    }
                 } } );
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
             Assert.assertNull(e);
         }
     }
-    
+
     @Override
-    protected void destroyGLAutoDrawableVisible(GLAutoDrawable glad) {
+    protected void destroyGLAutoDrawableVisible(final GLAutoDrawable glad) {
         final Frame frame = getFrame(glad);
         try {
             EventQueue.invokeAndWait(new Runnable() {
                 public void run() {
                     frame.dispose();
                 } } );
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
             Assert.assertNull(e);
         }
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10NEWT.java
index fc8cad0..84e6ed7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/ExclusiveContextBase10NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.ect;
 
 import com.jogamp.newt.Display;
@@ -43,55 +43,55 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 /**
- * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with AnimatorBase and NEWT. 
+ * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with AnimatorBase and NEWT.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public abstract class ExclusiveContextBase10NEWT extends ExclusiveContextBase10 {
 
     static Display dpy;
     static Screen screen;
-    
+
     @BeforeClass
     public static void initClass00NEWT() {
         dpy = NewtFactory.createDisplay(null);
-        screen = NewtFactory.createScreen(dpy, 0);        
+        screen = NewtFactory.createScreen(dpy, 0);
     }
-    
+
     @AfterClass
     public static void releaseClass00NEWT() {
         screen = null;
         dpy = null;
     }
-    
+
     @Override
     protected boolean isAWTTestCase() { return false; }
-    
+
     @Override
     protected Thread getAWTRenderThread() {
         return null;
     }
-    
+
     @Override
-    protected GLAutoDrawable createGLAutoDrawable(String title, int x, int y, int width, int height, GLCapabilitiesImmutable caps) {
-        GLWindow glWindow = GLWindow.create(screen, caps);
+    protected GLAutoDrawable createGLAutoDrawable(final String title, final int x, final int y, final int width, final int height, final GLCapabilitiesImmutable caps) {
+        final GLWindow glWindow = GLWindow.create(screen, caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle(title);
         glWindow.setSize(width, height);
         glWindow.setPosition(x, y);
         return glWindow;
     }
-    
+
     @Override
-    protected void setGLAutoDrawableVisible(GLAutoDrawable[] glads) {
+    protected void setGLAutoDrawableVisible(final GLAutoDrawable[] glads) {
         final int count = glads.length;
         for(int i=0; i<count; i++) {
             final GLAutoDrawable glad = glads[i];
             ((GLWindow)glad).setVisible(true);
         }
     }
-    
+
     @Override
-    protected void destroyGLAutoDrawableVisible(GLAutoDrawable glad) {
+    protected void destroyGLAutoDrawableVisible(final GLAutoDrawable glad) {
         ((GLWindow)glad).destroy();
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimAWT.java
index 038e078..6a6f579 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.ect;
 
 import java.io.IOException;
@@ -39,17 +39,17 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 /**
- * ExclusiveContextThread VSync Animator to test correctness of the ExclusiveContext feature _and_ Animator with AWT. 
+ * ExclusiveContextThread VSync Animator to test correctness of the ExclusiveContext feature _and_ Animator with AWT.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestExclusiveContext01VSyncAnimAWT extends ExclusiveContextBase00AWT {    
-    
+public class TestExclusiveContext01VSyncAnimAWT extends ExclusiveContextBase00AWT {
+
     @Override
     protected AnimatorBase createAnimator() {
         return new Animator();
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimNEWT.java
index d523479..a90dc0a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext01VSyncAnimNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.ect;
 
 import java.io.IOException;
@@ -38,17 +38,17 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 /**
- * ExclusiveContextThread VSync Animator to test correctness of the ExclusiveContext feature _and_ Animator with NEWT. 
+ * ExclusiveContextThread VSync Animator to test correctness of the ExclusiveContext feature _and_ Animator with NEWT.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestExclusiveContext01VSyncAnimNEWT extends ExclusiveContextBase00NEWT {    
+public class TestExclusiveContext01VSyncAnimNEWT extends ExclusiveContextBase00NEWT {
 
     @Override
     protected AnimatorBase createAnimator() {
         return new Animator();
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimAWT.java
index f6697c6..0769fc9 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.ect;
 
 import java.io.IOException;
@@ -38,17 +38,17 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 /**
- * ExclusiveContextThread FPS Animator to test correctness of the ExclusiveContext feature _and_ FPSAnimator with AWT. 
+ * ExclusiveContextThread FPS Animator to test correctness of the ExclusiveContext feature _and_ FPSAnimator with AWT.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestExclusiveContext02FPSAnimAWT extends ExclusiveContextBase00AWT {    
-        
+public class TestExclusiveContext02FPSAnimAWT extends ExclusiveContextBase00AWT {
+
     @Override
     protected AnimatorBase createAnimator() {
         return new FPSAnimator(0);
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimNEWT.java
index 33819c8..c919307 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext02FPSAnimNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.ect;
 
 import java.io.IOException;
@@ -38,17 +38,17 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 /**
- * ExclusiveContextThread FPS Animator to test correctness of the ExclusiveContext feature _and_ FPSAnimator with NEWT. 
+ * ExclusiveContextThread FPS Animator to test correctness of the ExclusiveContext feature _and_ FPSAnimator with NEWT.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestExclusiveContext02FPSAnimNEWT extends ExclusiveContextBase00NEWT {    
-        
+public class TestExclusiveContext02FPSAnimNEWT extends ExclusiveContextBase00NEWT {
+
     @Override
     protected AnimatorBase createAnimator() {
         return new FPSAnimator(0);
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext11VSyncAnimNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext11VSyncAnimNEWT.java
index 5067d6c..08d385d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext11VSyncAnimNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext11VSyncAnimNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.ect;
 
 import java.io.IOException;
@@ -38,17 +38,17 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 /**
- * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with Animator and NEWT. 
+ * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with Animator and NEWT.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestExclusiveContext11VSyncAnimNEWT extends ExclusiveContextBase10NEWT {    
+public class TestExclusiveContext11VSyncAnimNEWT extends ExclusiveContextBase10NEWT {
 
     @Override
     protected AnimatorBase createAnimator() {
         return new Animator();
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext12FPSAnimNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext12FPSAnimNEWT.java
index 993b67e..8a45192 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext12FPSAnimNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/ect/TestExclusiveContext12FPSAnimNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.ect;
 
 import java.io.IOException;
@@ -38,17 +38,17 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 /**
- * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with FPSAnimator and NEWT. 
+ * ExclusiveContextThread base implementation to test performance impact of the ExclusiveContext feature with FPSAnimator and NEWT.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestExclusiveContext12FPSAnimNEWT extends ExclusiveContextBase10NEWT {    
-        
+public class TestExclusiveContext12FPSAnimNEWT extends ExclusiveContextBase10NEWT {
+
     @Override
     protected AnimatorBase createAnimator() {
         return new FPSAnimator(0);
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/GLContextDrawableSwitchBase.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/GLContextDrawableSwitchBase.java
deleted file mode 100644
index 8c9d6c2..0000000
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/GLContextDrawableSwitchBase.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/**
- * Copyright 2013 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- *
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- *
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
-
-package com.jogamp.opengl.test.junit.jogl.acore.glels;
-
-import java.awt.Dimension;
-import java.awt.Frame;
-
-import javax.media.opengl.GLAnimatorControl;
-import javax.media.opengl.GLAutoDrawable;
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLContext;
-import javax.media.opengl.GLDrawableFactory;
-import javax.media.opengl.GLOffscreenAutoDrawable;
-import javax.media.opengl.GLProfile;
-import javax.media.opengl.awt.GLCanvas;
-
-import jogamp.nativewindow.jawt.JAWTUtil;
-
-import com.jogamp.newt.Screen;
-import com.jogamp.newt.opengl.GLWindow;
-
-import com.jogamp.opengl.GLEventListenerState;
-import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
-import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
-import com.jogamp.opengl.test.junit.util.GLEventListenerCounter;
-import com.jogamp.opengl.test.junit.util.UITestCase;
-
-import org.junit.Assert;
-import org.junit.Assume;
-import org.junit.BeforeClass;
-
-/**
- * Test re-association of GLContext/GLDrawables,
- * here GLContext's survival of GLDrawable destruction
- * and reuse w/ new or recreated GLDrawable.
- * <p>
- * Test utilizes {@link GLEventListenerState} for preserving the
- * GLAutoDrawable state, i.e. GLContext, all GLEventListener
- * and the GLAnimatorControl association.
- * </p>
- * <p>
- * See Bug 665 - https://jogamp.org/bugzilla/show_bug.cgi?id=665.
- * </p>
- */
-public abstract class GLContextDrawableSwitchBase extends UITestCase {
-    static protected enum GLADType { GLCanvasOnscreen, GLCanvasOffscreen, GLWindow, GLOffscreen };
-
-    // default period for 1 GLAD cycle
-    static long duration = 1000; // ms
-
-    static int width, height;
-
-    static GLCapabilities getCaps(String profile) {
-        if( !GLProfile.isAvailable(profile) )  {
-            System.err.println("Profile "+profile+" n/a");
-            return null;
-        }
-        return new GLCapabilities(GLProfile.get(profile));
-    }
-
-    @BeforeClass
-    public static void initClass() {
-        width  = 256;
-        height = 256;
-    }
-
-    static void setGLCanvasSize(final GLCanvas glc, final Dimension new_sz) {
-        try {
-            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-                public void run() {
-                    glc.setMinimumSize(new_sz);
-                    glc.setPreferredSize(new_sz);
-                    glc.setSize(new_sz);
-                } } );
-        } catch( Throwable throwable ) {
-            throwable.printStackTrace();
-            Assume.assumeNoException( throwable );
-        }
-    }
-
-    static void setFrameVisible(final Frame frame) throws InterruptedException {
-        try {
-        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-            public void run() {
-                frame.pack();
-                frame.setVisible(true);
-            }});
-        } catch( Throwable throwable ) {
-            throwable.printStackTrace();
-            Assume.assumeNoException( throwable );
-        }
-    }
-
-    static void destroyFrame(final Frame frame) throws InterruptedException {
-        try {
-        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-            public void run() {
-                frame.dispose();
-            }});
-        } catch( Throwable throwable ) {
-            throwable.printStackTrace();
-            Assume.assumeNoException( throwable );
-        }
-    }
-
-    private GLOffscreenAutoDrawable createGLOffscreenAutoDrawable(GLCapabilities caps, int width, int height) throws InterruptedException {
-        final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
-        return factory.createOffscreenAutoDrawable(null, caps, null, width, height);
-    }
-
-    protected static boolean validateOnOffscreenLayer(GLADType gladType1, GLADType gladType2) {
-        final boolean useOffscreenLayer = GLADType.GLCanvasOffscreen == gladType1 || GLADType.GLCanvasOffscreen == gladType2 ;
-        final boolean useOnscreenLayer = GLADType.GLCanvasOnscreen == gladType1 || GLADType.GLCanvasOnscreen == gladType2 ;
-        if( useOffscreenLayer ) {
-            if( !JAWTUtil.isOffscreenLayerSupported() ) {
-                System.err.println("Platform doesn't support offscreen rendering.");
-                return false;
-            }
-        } else if( useOnscreenLayer ) {
-            if( JAWTUtil.isOffscreenLayerRequired() ) {
-                System.err.println("Platform requires offscreen rendering.");
-                return false;
-            }
-        }
-        return true;
-    }
-
-    protected void testGLADOneLifecycle(Screen screen, GLCapabilities caps, GLADType gladType, int width,
-                                        int height, GLEventListenerCounter glelTracker,
-                                        SnapshotGLEventListener snapshotGLEventListener, final GLEventListenerState glelsIn, final GLEventListenerState glelsOut[], GLAnimatorControl animator)
-            throws InterruptedException {
-
-        System.err.println("GLAD Lifecycle.0 "+gladType+", restoring "+((null!=glelsIn)?true:false)+", preserving "+((null!=glelsOut)?true:false));
-        final Frame frame;
-        final GLAutoDrawable glad;
-        if( GLADType.GLCanvasOnscreen == gladType ) {
-            if( jogamp.nativewindow.jawt.JAWTUtil.isOffscreenLayerRequired() ) {
-                throw new InternalError("Platform requires offscreen rendering, but onscreen requested: "+gladType);
-            }
-            frame = new Frame("AWT GLCanvas");
-
-            glad = new GLCanvas(caps);
-            setGLCanvasSize((GLCanvas)glad, new Dimension(width, height));
-            frame.add((GLCanvas)glad);
-        } else if( GLADType.GLCanvasOffscreen == gladType ) {
-            if( !jogamp.nativewindow.jawt.JAWTUtil.isOffscreenLayerSupported() ) {
-                throw new InternalError("Platform doesn't support offscreen rendering: "+gladType);
-            }
-            frame = new Frame("AWT GLCanvas");
-
-            glad = new GLCanvas(caps);
-            ((GLCanvas)glad).setShallUseOffscreenLayer(true);
-            setGLCanvasSize((GLCanvas)glad, new Dimension(width, height));
-            frame.add((GLCanvas)glad);
-        } else if( GLADType.GLWindow == gladType ) {
-            frame = null;
-
-            if( null != screen ) {
-                glad = GLWindow.create(screen, caps);
-            } else {
-                glad = GLWindow.create(caps);
-            }
-            ((GLWindow)glad).setTitle("Newt GLWindow");
-            ((GLWindow)glad).setSize(width, height);
-        } else if( GLADType.GLOffscreen == gladType ) {
-            frame = null;
-
-            glad = this.createGLOffscreenAutoDrawable(caps, width, height);
-        } else {
-            throw new InternalError("Unsupported: "+gladType);
-        }
-
-        if( null == glelsIn ) {
-            if( null != animator ) {
-                animator.add(glad);
-            }
-            glad.addGLEventListener(glelTracker);
-            glad.addGLEventListener(new GearsES2(1));
-            glad.addGLEventListener(snapshotGLEventListener);
-        }
-        snapshotGLEventListener.setMakeSnapshot();
-
-        if( GLADType.GLCanvasOnscreen == gladType || GLADType.GLCanvasOffscreen == gladType ) {
-            setFrameVisible(frame);
-            Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, true));
-        } else if( GLADType.GLWindow == gladType ) {
-            ((GLWindow)glad).setVisible(true);
-        }
-        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glad, true));
-        Assert.assertNotNull(glad.getContext());
-        Assert.assertTrue(glad.isRealized());
-
-        if( null != glelsIn ) {
-            Assert.assertEquals(0, glad.getGLEventListenerCount());
-            System.err.println(".. restoring.0");
-            glelsIn.moveTo(glad);
-            System.err.println(".. restoring.X");
-
-            Assert.assertEquals(1, glelTracker.initCount);
-            Assert.assertTrue(1 <= glelTracker.reshapeCount);
-            Assert.assertTrue(1 <= glelTracker.displayCount);
-            Assert.assertEquals(0, glelTracker.disposeCount);
-            Assert.assertEquals(3, glad.getGLEventListenerCount());
-
-            Assert.assertEquals(glelsIn.context, glad.getContext());
-            Assert.assertEquals(glelsIn.listenerCount(), glad.getGLEventListenerCount());
-            Assert.assertEquals(glelsIn.context.getGLReadDrawable(), glad.getDelegatedDrawable());
-            Assert.assertEquals(glelsIn.context.getGLDrawable(), glad.getDelegatedDrawable());
-            Assert.assertEquals(false, glelsIn.isOwner());
-        }
-
-        for (int wait=0; wait<AWTRobotUtil.POLL_DIVIDER &&
-                         ( 1 > glelTracker.initCount || 1 > glelTracker.reshapeCount || 1 > glelTracker.displayCount );
-             wait++) {
-            Thread.sleep(AWTRobotUtil.TIME_SLICE);
-        }
-
-        final long t0 = System.currentTimeMillis();
-        long t1 = t0;
-
-        while( ( t1 - t0 ) < duration ) {
-            Thread.sleep(100);
-            t1 = System.currentTimeMillis();
-        }
-
-        Assert.assertEquals(1, glelTracker.initCount);
-        Assert.assertTrue(1 <= glelTracker.reshapeCount);
-        Assert.assertTrue(1 <= glelTracker.displayCount);
-        Assert.assertEquals(0, glelTracker.disposeCount);
-
-        if( null != glelsOut ) {
-            final GLContext context1 = glad.getContext();
-            System.err.println(".. preserving.0");
-            glelsOut[0] = GLEventListenerState.moveFrom(glad);
-            System.err.println(".. preserving.X");
-
-            Assert.assertEquals(context1, glelsOut[0].context);
-            Assert.assertNull(context1.getGLReadDrawable());
-            Assert.assertNull(context1.getGLDrawable());
-            Assert.assertEquals(3, glelsOut[0].listenerCount());
-            Assert.assertEquals(true, glelsOut[0].isOwner());
-            Assert.assertEquals(null, glad.getContext());
-            Assert.assertEquals(0, glad.getGLEventListenerCount());
-        }
-        if( GLADType.GLCanvasOnscreen == gladType || GLADType.GLCanvasOffscreen == gladType ) {
-            destroyFrame(frame);
-            Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, false));
-        } else if( GLADType.GLWindow == gladType ) {
-            glad.destroy();
-        } else if( GLADType.GLOffscreen == gladType ) {
-            glad.destroy();
-        }
-        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glad, false));
-
-        Assert.assertEquals(1, glelTracker.initCount);
-        Assert.assertTrue(1 <= glelTracker.reshapeCount);
-        Assert.assertTrue(1 <= glelTracker.displayCount);
-        if( null != glelsOut ) {
-            Assert.assertEquals(0, glelTracker.disposeCount);
-        } else {
-            Assert.assertEquals(1, glelTracker.disposeCount);
-        }
-        System.err.println("GLAD Lifecycle.X "+gladType);
-    }
-}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/GLContextDrawableSwitchBase0.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/GLContextDrawableSwitchBase0.java
new file mode 100644
index 0000000..08614f9
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/GLContextDrawableSwitchBase0.java
@@ -0,0 +1,264 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.acore.glels;
+
+import java.lang.reflect.InvocationTargetException;
+
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.Threading;
+
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.GLDrawableUtil;
+import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
+import com.jogamp.opengl.test.junit.util.QuitAdapter;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.FixMethodOrder;
+import org.junit.runners.MethodSorters;
+
+/**
+ * Test re-association (switching) of GLWindow /GLDrawables,
+ * from GLWindow/GLOffscreenAutoDrawable to an GLOffscreenAutoDrawable and back.
+ */
+ at FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public abstract class GLContextDrawableSwitchBase0 extends UITestCase {
+    static int width, height;
+    static boolean testEvenUnsafeSwapGLContext = false;
+
+    static GLCapabilities getCaps(final String profile) {
+        if( !GLProfile.isAvailable(profile) )  {
+            System.err.println("Profile "+profile+" n/a");
+            return null;
+        }
+        return new GLCapabilities(GLProfile.get(profile));
+    }
+
+    @BeforeClass
+    public static void initClass() {
+        width  = 256;
+        height = 256;
+    }
+
+    public abstract GLAutoDrawable createGLAutoDrawable(final QuitAdapter quitAdapter, final GLCapabilitiesImmutable caps, final int width, final int height) throws InterruptedException, InvocationTargetException;
+    public abstract void destroyGLAutoDrawable(final GLAutoDrawable glad) throws InterruptedException, InvocationTargetException;
+
+    @Test(timeout=30000)
+    public void test01aSwitch2Onscreen2OnscreenGL2ES2_Def() throws InterruptedException, InvocationTargetException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        testImpl(reqGLCaps, true);
+    }
+
+    @Test(timeout=30000)
+    public void test01bSwitch2Onscreen2OffscreenGL2ES2_Def() throws InterruptedException, InvocationTargetException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        testImpl(reqGLCaps, false);
+    }
+
+    @Test(timeout=30000)
+    public void test01cSwitch2Offscreen2OffscreenGL2ES2_Def() throws InterruptedException, InvocationTargetException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        reqGLCaps.setOnscreen(false);
+        testImpl(reqGLCaps, false);
+    }
+
+    @Test(timeout=30000)
+    public void test01dSwitch2Offscreen2OnscreenGL2ES2_Def() throws InterruptedException, InvocationTargetException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        reqGLCaps.setOnscreen(false);
+        testImpl(reqGLCaps, true);
+    }
+
+    @Test(timeout=30000)
+    public void test02aSwitch2Onscreen2OnscreenGL2ES2_MSAA() throws InterruptedException, InvocationTargetException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        reqGLCaps.setNumSamples(4);
+        reqGLCaps.setSampleBuffers(true);
+        testImpl(reqGLCaps, true);
+    }
+
+    @Test(timeout=30000)
+    public void test02bSwitch2Onscreen2OffscreenGL2ES2_MSAA() throws InterruptedException, InvocationTargetException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        reqGLCaps.setNumSamples(4);
+        reqGLCaps.setSampleBuffers(true);
+        testImpl(reqGLCaps, false);
+    }
+
+    @Test(timeout=30000)
+    public void test02cSwitch2Offscreen2OffscreenGL2ES2_MSAA() throws InterruptedException, InvocationTargetException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        reqGLCaps.setOnscreen(false);
+        reqGLCaps.setNumSamples(4);
+        reqGLCaps.setSampleBuffers(true);
+        testImpl(reqGLCaps, false);
+    }
+
+    @Test(timeout=30000)
+    public void test02dSwitch2Offscreen2OnscreenGL2ES2_MSAA() throws InterruptedException, InvocationTargetException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        reqGLCaps.setOnscreen(false);
+        reqGLCaps.setNumSamples(4);
+        reqGLCaps.setSampleBuffers(true);
+        testImpl(reqGLCaps, true);
+    }
+
+    @Test(timeout=30000)
+    public void test03aSwitch2Onscreen2OnscreenGL2ES2_Accu() throws InterruptedException, InvocationTargetException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        reqGLCaps.setAccumRedBits(1);
+        reqGLCaps.setAccumGreenBits(1);
+        reqGLCaps.setAccumBlueBits(1);
+        testImpl(reqGLCaps, true);
+    }
+
+    @Test(timeout=30000)
+    public void test03bSwitch2Onscreen2OffscreenGL2ES2_Accu() throws InterruptedException, InvocationTargetException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        reqGLCaps.setAccumRedBits(1);
+        reqGLCaps.setAccumGreenBits(1);
+        reqGLCaps.setAccumBlueBits(1);
+        testImpl(reqGLCaps, false);
+    }
+
+    @Test(timeout=30000)
+    public void test03cSwitch2Offscreen2OffscreenGL2ES2_Accu() throws InterruptedException, InvocationTargetException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        reqGLCaps.setOnscreen(false);
+        reqGLCaps.setAccumRedBits(1);
+        reqGLCaps.setAccumGreenBits(1);
+        reqGLCaps.setAccumBlueBits(1);
+        testImpl(reqGLCaps, false);
+    }
+
+    @Test(timeout=30000)
+    public void test03dSwitch2Offscreen2OnscreenGL2ES2_Accu() throws InterruptedException, InvocationTargetException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        reqGLCaps.setOnscreen(false);
+        reqGLCaps.setAccumRedBits(1);
+        reqGLCaps.setAccumGreenBits(1);
+        reqGLCaps.setAccumBlueBits(1);
+        testImpl(reqGLCaps, true);
+    }
+
+    private void testImpl(final GLCapabilitiesImmutable srcCapsRequested, final boolean dstOnscreen) throws InterruptedException, InvocationTargetException {
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        final GLAutoDrawable gladSource = createGLAutoDrawable(quitAdapter, srcCapsRequested, width, height);
+
+        final GLCapabilitiesImmutable srcCapsChosen = gladSource.getChosenGLCapabilities();
+
+        final GLCapabilities dstCaps = (GLCapabilities) srcCapsChosen.cloneMutable();
+        dstCaps.setOnscreen(dstOnscreen);
+
+        final boolean isSwapGLContextSafe = GLDrawableUtil.isSwapGLContextSafe(srcCapsRequested, srcCapsChosen, dstCaps);
+        System.err.println("Source Caps Requested: "+srcCapsRequested);
+        System.err.println("Source Caps Chosen   : "+srcCapsChosen);
+        System.err.println("Dest   Caps Requested: "+dstCaps);
+        System.err.println("Is SwapGLContext safe: "+isSwapGLContextSafe);
+
+        if( !isSwapGLContextSafe && !testEvenUnsafeSwapGLContext ) {
+            System.err.println("Supressing unsafe tests ...");
+            destroyGLAutoDrawable(gladSource);
+            return;
+        }
+
+        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
+        final GearsES2 gears = new GearsES2(1);
+        gears.setVerbose(false);
+        gladSource.addGLEventListener(gears);
+        gladSource.addGLEventListener(snapshotGLEventListener);
+        snapshotGLEventListener.setMakeSnapshot();
+
+        final Animator animator = new Animator();
+        animator.add(gladSource);
+        animator.start();
+
+        int s = 0;
+        final long t0 = System.currentTimeMillis();
+        long t1 = t0;
+
+        final GLAutoDrawable gladDest = createGLAutoDrawable(quitAdapter, dstCaps, width, height);
+        RuntimeException caught = null;
+        try {
+            while( !quitAdapter.shouldQuit() && ( t1 - t0 ) < duration ) {
+                if( ( t1 - t0 ) / period > s) {
+                    s++;
+                    System.err.println(s+" - switch - START "+ ( t1 - t0 ));
+
+                    final Runnable switchAction = new Runnable() {
+                            public void run() {
+                                GLDrawableUtil.swapGLContextAndAllGLEventListener(gladSource, gladDest);
+                            } };
+
+                    // switch context _and_ the demo synchronously
+                    if( gladSource.isThreadGLCapable() && gladDest.isThreadGLCapable() ) {
+                        switchAction.run();
+                    } else {
+                        Threading.invokeOnOpenGLThread(true, switchAction);
+                    }
+                    snapshotGLEventListener.setMakeSnapshot();
+
+                    System.err.println(s+" - switch - END "+ ( t1 - t0 ));
+                }
+                Thread.sleep(100);
+                t1 = System.currentTimeMillis();
+            }
+        } catch (final RuntimeException t) {
+            caught = t;
+        }
+
+        animator.stop();
+        destroyGLAutoDrawable(gladDest);
+        destroyGLAutoDrawable(gladSource);
+
+        if( null != caught ) {
+            throw caught;
+        }
+    }
+
+    // default timing for 2 switches
+    static long duration = 2900; // ms
+    static long period = 1000; // ms
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/GLContextDrawableSwitchBase1.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/GLContextDrawableSwitchBase1.java
new file mode 100644
index 0000000..0e7ea3e
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/GLContextDrawableSwitchBase1.java
@@ -0,0 +1,291 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.acore.glels;
+
+import java.awt.Dimension;
+import java.awt.Frame;
+
+import javax.media.opengl.GLAnimatorControl;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLContext;
+import javax.media.opengl.GLDrawableFactory;
+import javax.media.opengl.GLOffscreenAutoDrawable;
+import javax.media.opengl.GLProfile;
+import javax.media.opengl.awt.GLCanvas;
+
+import jogamp.nativewindow.jawt.JAWTUtil;
+
+import com.jogamp.newt.Screen;
+import com.jogamp.newt.opengl.GLWindow;
+
+import com.jogamp.opengl.GLEventListenerState;
+import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
+import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
+import com.jogamp.opengl.test.junit.util.GLEventListenerCounter;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+
+import org.junit.Assert;
+import org.junit.Assume;
+import org.junit.BeforeClass;
+
+/**
+ * Test re-association of GLContext/GLDrawables,
+ * here GLContext's survival of GLDrawable destruction
+ * and reuse w/ new or recreated GLDrawable.
+ * <p>
+ * Test utilizes {@link GLEventListenerState} for preserving the
+ * GLAutoDrawable state, i.e. GLContext, all GLEventListener
+ * and the GLAnimatorControl association.
+ * </p>
+ * <p>
+ * See Bug 665 - https://jogamp.org/bugzilla/show_bug.cgi?id=665.
+ * </p>
+ */
+public abstract class GLContextDrawableSwitchBase1 extends UITestCase {
+    static protected enum GLADType { GLCanvasOnscreen, GLCanvasOffscreen, GLWindow, GLOffscreen };
+
+    // default period for 1 GLAD cycle
+    static long duration = 1000; // ms
+
+    static int width, height;
+
+    static GLCapabilities getCaps(final String profile) {
+        if( !GLProfile.isAvailable(profile) )  {
+            System.err.println("Profile "+profile+" n/a");
+            return null;
+        }
+        return new GLCapabilities(GLProfile.get(profile));
+    }
+
+    @BeforeClass
+    public static void initClass() {
+        width  = 256;
+        height = 256;
+    }
+
+    static void setGLCanvasSize(final GLCanvas glc, final Dimension new_sz) {
+        try {
+            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    glc.setMinimumSize(new_sz);
+                    glc.setPreferredSize(new_sz);
+                    glc.setSize(new_sz);
+                } } );
+        } catch( final Throwable throwable ) {
+            throwable.printStackTrace();
+            Assume.assumeNoException( throwable );
+        }
+    }
+
+    static void setFrameVisible(final Frame frame) throws InterruptedException {
+        try {
+        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame.pack();
+                frame.setVisible(true);
+            }});
+        } catch( final Throwable throwable ) {
+            throwable.printStackTrace();
+            Assume.assumeNoException( throwable );
+        }
+    }
+
+    static void destroyFrame(final Frame frame) throws InterruptedException {
+        try {
+        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+            public void run() {
+                frame.dispose();
+            }});
+        } catch( final Throwable throwable ) {
+            throwable.printStackTrace();
+            Assume.assumeNoException( throwable );
+        }
+    }
+
+    private GLOffscreenAutoDrawable createGLOffscreenAutoDrawable(final GLCapabilities caps, final int width, final int height) throws InterruptedException {
+        final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
+        return factory.createOffscreenAutoDrawable(null, caps, null, width, height);
+    }
+
+    protected static boolean validateOnOffscreenLayer(final GLADType gladType1, final GLADType gladType2) {
+        final boolean useOffscreenLayer = GLADType.GLCanvasOffscreen == gladType1 || GLADType.GLCanvasOffscreen == gladType2 ;
+        final boolean useOnscreenLayer = GLADType.GLCanvasOnscreen == gladType1 || GLADType.GLCanvasOnscreen == gladType2 ;
+        if( useOffscreenLayer ) {
+            if( !JAWTUtil.isOffscreenLayerSupported() ) {
+                System.err.println("Platform doesn't support offscreen rendering.");
+                return false;
+            }
+        } else if( useOnscreenLayer ) {
+            if( JAWTUtil.isOffscreenLayerRequired() ) {
+                System.err.println("Platform requires offscreen rendering.");
+                return false;
+            }
+        }
+        return true;
+    }
+
+    protected void testGLADOneLifecycle(final Screen screen, final GLCapabilities caps, final GLADType gladType, final int width,
+                                        final int height, final GLEventListenerCounter glelTracker,
+                                        final SnapshotGLEventListener snapshotGLEventListener, final GLEventListenerState glelsIn, final GLEventListenerState glelsOut[], final GLAnimatorControl animator)
+            throws InterruptedException {
+
+        System.err.println("GLAD Lifecycle.0 "+gladType+", restoring "+((null!=glelsIn)?true:false)+", preserving "+((null!=glelsOut)?true:false));
+        final Frame frame;
+        final GLAutoDrawable glad;
+        if( GLADType.GLCanvasOnscreen == gladType ) {
+            if( jogamp.nativewindow.jawt.JAWTUtil.isOffscreenLayerRequired() ) {
+                throw new InternalError("Platform requires offscreen rendering, but onscreen requested: "+gladType);
+            }
+            frame = new Frame("AWT GLCanvas");
+
+            glad = new GLCanvas(caps);
+            setGLCanvasSize((GLCanvas)glad, new Dimension(width, height));
+            frame.add((GLCanvas)glad);
+        } else if( GLADType.GLCanvasOffscreen == gladType ) {
+            if( !jogamp.nativewindow.jawt.JAWTUtil.isOffscreenLayerSupported() ) {
+                throw new InternalError("Platform doesn't support offscreen rendering: "+gladType);
+            }
+            frame = new Frame("AWT GLCanvas");
+
+            glad = new GLCanvas(caps);
+            ((GLCanvas)glad).setShallUseOffscreenLayer(true);
+            setGLCanvasSize((GLCanvas)glad, new Dimension(width, height));
+            frame.add((GLCanvas)glad);
+        } else if( GLADType.GLWindow == gladType ) {
+            frame = null;
+
+            if( null != screen ) {
+                glad = GLWindow.create(screen, caps);
+            } else {
+                glad = GLWindow.create(caps);
+            }
+            ((GLWindow)glad).setTitle("Newt GLWindow");
+            ((GLWindow)glad).setSize(width, height);
+        } else if( GLADType.GLOffscreen == gladType ) {
+            frame = null;
+
+            glad = this.createGLOffscreenAutoDrawable(caps, width, height);
+        } else {
+            throw new InternalError("Unsupported: "+gladType);
+        }
+
+        if( null == glelsIn ) {
+            if( null != animator ) {
+                animator.add(glad);
+            }
+            glad.addGLEventListener(glelTracker);
+            glad.addGLEventListener(new GearsES2(1));
+            glad.addGLEventListener(snapshotGLEventListener);
+        }
+        snapshotGLEventListener.setMakeSnapshot();
+
+        if( GLADType.GLCanvasOnscreen == gladType || GLADType.GLCanvasOffscreen == gladType ) {
+            setFrameVisible(frame);
+            Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, true));
+        } else if( GLADType.GLWindow == gladType ) {
+            ((GLWindow)glad).setVisible(true);
+        }
+        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glad, true));
+        Assert.assertNotNull(glad.getContext());
+        Assert.assertTrue(glad.isRealized());
+
+        if( null != glelsIn ) {
+            Assert.assertEquals(0, glad.getGLEventListenerCount());
+            System.err.println(".. restoring.0");
+            glelsIn.moveTo(glad);
+            System.err.println(".. restoring.X");
+
+            Assert.assertEquals(1, glelTracker.initCount);
+            Assert.assertTrue(1 <= glelTracker.reshapeCount);
+            Assert.assertTrue(1 <= glelTracker.displayCount);
+            Assert.assertEquals(0, glelTracker.disposeCount);
+            Assert.assertEquals(3, glad.getGLEventListenerCount());
+
+            Assert.assertEquals(glelsIn.context, glad.getContext());
+            Assert.assertEquals(glelsIn.listenerCount(), glad.getGLEventListenerCount());
+            Assert.assertEquals(glelsIn.context.getGLReadDrawable(), glad.getDelegatedDrawable());
+            Assert.assertEquals(glelsIn.context.getGLDrawable(), glad.getDelegatedDrawable());
+            Assert.assertEquals(false, glelsIn.isOwner());
+        }
+
+        for (int wait=0; wait<AWTRobotUtil.POLL_DIVIDER &&
+                         ( 1 > glelTracker.initCount || 1 > glelTracker.reshapeCount || 1 > glelTracker.displayCount );
+             wait++) {
+            Thread.sleep(AWTRobotUtil.TIME_SLICE);
+        }
+
+        final long t0 = System.currentTimeMillis();
+        long t1 = t0;
+
+        while( ( t1 - t0 ) < duration ) {
+            Thread.sleep(100);
+            t1 = System.currentTimeMillis();
+        }
+
+        Assert.assertEquals(1, glelTracker.initCount);
+        Assert.assertTrue(1 <= glelTracker.reshapeCount);
+        Assert.assertTrue(1 <= glelTracker.displayCount);
+        Assert.assertEquals(0, glelTracker.disposeCount);
+
+        if( null != glelsOut ) {
+            final GLContext context1 = glad.getContext();
+            System.err.println(".. preserving.0");
+            glelsOut[0] = GLEventListenerState.moveFrom(glad);
+            System.err.println(".. preserving.X");
+
+            Assert.assertEquals(context1, glelsOut[0].context);
+            Assert.assertNull(context1.getGLReadDrawable());
+            Assert.assertNull(context1.getGLDrawable());
+            Assert.assertEquals(3, glelsOut[0].listenerCount());
+            Assert.assertEquals(true, glelsOut[0].isOwner());
+            Assert.assertEquals(null, glad.getContext());
+            Assert.assertEquals(0, glad.getGLEventListenerCount());
+        }
+        if( GLADType.GLCanvasOnscreen == gladType || GLADType.GLCanvasOffscreen == gladType ) {
+            destroyFrame(frame);
+            Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, false));
+        } else if( GLADType.GLWindow == gladType ) {
+            glad.destroy();
+        } else if( GLADType.GLOffscreen == gladType ) {
+            glad.destroy();
+        }
+        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glad, false));
+
+        Assert.assertEquals(1, glelTracker.initCount);
+        Assert.assertTrue(1 <= glelTracker.reshapeCount);
+        Assert.assertTrue(1 <= glelTracker.displayCount);
+        if( null != glelsOut ) {
+            Assert.assertEquals(0, glelTracker.disposeCount);
+        } else {
+            Assert.assertEquals(1, glelTracker.disposeCount);
+        }
+        System.err.println("GLAD Lifecycle.X "+gladType);
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestBug722GLContextDrawableSwitchNewt2AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestBug722GLContextDrawableSwitchNewt2AWT.java
index 24eefe7..e961fe3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestBug722GLContextDrawableSwitchNewt2AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestBug722GLContextDrawableSwitchNewt2AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.glels;
 
 import java.io.IOException;
@@ -54,20 +54,20 @@ import org.junit.runners.MethodSorters;
  * </p>
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestBug722GLContextDrawableSwitchNewt2AWT extends GLContextDrawableSwitchBase {
+public class TestBug722GLContextDrawableSwitchNewt2AWT extends GLContextDrawableSwitchBase1 {
 
     static int loops = 10;
     static long duration2 = 100; // ms
-    
+
     /**
      * Interesting artifact w/ ATI proprietary driver is that the
      * bug causing the quirk {@link GLRendererQuirks#DontCloseX11Display}
      * also causes an XCB crash when reusing the X11 display connection
      * from AWT -> NEWT. Pre-allocating the X11 Display and keeping it referenced
-     * to avoid such re-usage worksaround this problem.  
+     * to avoid such re-usage worksaround this problem.
      */
     public static boolean fixedNewtDisplay = true;
-    
+
     @Test(timeout=180000) // TO 3 min
     public void test11GLWindow2GLCanvasOnScrnGL2ES2() throws InterruptedException {
         final GLCapabilities caps = getCaps(GLProfile.GL2ES2);
@@ -80,14 +80,14 @@ public class TestBug722GLContextDrawableSwitchNewt2AWT extends GLContextDrawable
             return;
         }
 
-        
-        GLADType gladType1 = GLADType.GLWindow;
-        GLADType gladType2 = GLADType.GLCanvasOnscreen;
-        
-        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();        
+
+        final GLADType gladType1 = GLADType.GLWindow;
+        final GLADType gladType2 = GLADType.GLCanvasOnscreen;
+
+        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
         final Animator animator = new Animator();
         animator.start();
-        
+
         final Display dpy;
         final Screen screen;
         if( fixedNewtDisplay ) {
@@ -97,43 +97,43 @@ public class TestBug722GLContextDrawableSwitchNewt2AWT extends GLContextDrawable
         } else {
             dpy = null;
             screen = null;
-        }        
-        
+        }
+
         duration = duration2;
-        
-        for(int i=0; i<loops; i++) {        
+
+        for(int i=0; i<loops; i++) {
             final GLEventListenerState glels[] = new GLEventListenerState[1];
             final GLEventListenerCounter glelTracker = new GLEventListenerCounter();
-            
+
             // - create glad1 w/o context
             // - create context using glad1 and assign it to glad1
             {
                 System.err.println("Test "+i+"/"+loops+".1: GLAD-1 "+gladType1+", preserving.");
-                testGLADOneLifecycle(screen, caps, gladType1, width, height, 
+                testGLADOneLifecycle(screen, caps, gladType1, width, height,
                                      glelTracker, snapshotGLEventListener,
-                                     null, 
-                                     glels, animator); 
+                                     null,
+                                     glels, animator);
                 System.err.println("Test "+i+"/"+loops+".1: done");
             }
-            
+
             // - create glad2 w/ survived context
             {
                 System.err.println("Test "+i+"/"+loops+".2: GLAD-1 "+gladType2+", restoring.");
-                testGLADOneLifecycle(screen, caps, gladType2, width+100, height+100, 
+                testGLADOneLifecycle(screen, caps, gladType2, width+100, height+100,
                                      glelTracker, snapshotGLEventListener,
-                                     glels[0], 
+                                     glels[0],
                                      null, null);
                 System.err.println("Test "+i+"/"+loops+".2: done.");
             }
         }
         animator.stop();
-        
+
         if( fixedNewtDisplay ) {
             screen.removeReference();
         }
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
@@ -148,7 +148,7 @@ public class TestBug722GLContextDrawableSwitchNewt2AWT extends GLContextDrawable
         /**
         BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         System.err.println("Press enter to continue");
-        System.err.println(stdin.readLine()); */         
+        System.err.println(stdin.readLine()); */
         org.junit.runner.JUnitCore.main(TestBug722GLContextDrawableSwitchNewt2AWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch01NEWT.java
index 633d9de..603c858 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch01NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.glels;
 
 import java.io.IOException;
@@ -69,21 +69,21 @@ import org.junit.runners.MethodSorters;
 public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
     static int width, height;
 
-    static GLCapabilities getCaps(String profile) {
+    static GLCapabilities getCaps(final String profile) {
         if( !GLProfile.isAvailable(profile) )  {
             System.err.println("Profile "+profile+" n/a");
             return null;
         }
         return new GLCapabilities(GLProfile.get(profile));
     }
-    
+
     @BeforeClass
     public static void initClass() {
         width  = 256;
         height = 256;
     }
 
-    private GLAutoDrawable createGLAutoDrawable(GLCapabilities caps, int x, int y, int width, int height, WindowListener wl) throws InterruptedException {
+    private GLAutoDrawable createGLAutoDrawable(final GLCapabilities caps, final int x, final int y, final int width, final int height, final WindowListener wl) throws InterruptedException {
         final Window window = NewtFactory.createWindow(caps);
         Assert.assertNotNull(window);
         window.setPosition(x, y);
@@ -91,71 +91,71 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
         window.setVisible(true);
         Assert.assertTrue(AWTRobotUtil.waitForVisible(window, true));
         Assert.assertTrue(AWTRobotUtil.waitForRealized(window, true));
-            
+
         final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
         final GLDrawable drawable = factory.createGLDrawable(window);
         Assert.assertNotNull(drawable);
-        
+
         drawable.setRealized(true);
         Assert.assertTrue(drawable.isRealized());
-        
+
         final GLContext context = drawable.createContext(null);
         Assert.assertNotNull(context);
-        
+
         final GLAutoDrawableDelegate glad = new GLAutoDrawableDelegate(drawable, context, window, false, null) {
             @Override
             protected void destroyImplInLock() {
                 super.destroyImplInLock();
                 window.destroy(); // destroys the actual window
-            }            
+            }
         };
-        
+
         window.setWindowDestroyNotifyAction( new Runnable() {
             public void run() {
                 glad.windowDestroyNotifyOp();
             } } );
-        
+
         // add basic window interaction
         window.addWindowListener(new WindowAdapter() {
             @Override
-            public void windowRepaint(WindowUpdateEvent e) {
+            public void windowRepaint(final WindowUpdateEvent e) {
                 glad.windowRepaintOp();
             }
             @Override
-            public void windowResized(WindowEvent e) {
-                glad.windowResizedOp(window.getWidth(), window.getHeight());
+            public void windowResized(final WindowEvent e) {
+                glad.windowResizedOp(window.getSurfaceWidth(), window.getSurfaceHeight());
             }
         });
         window.addWindowListener(wl);
-        
+
         return glad;
     }
-        
+
     @Test(timeout=30000)
     public void testSwitch2WindowSingleContextGL2ES2() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
         if(null == reqGLCaps) return;
         testSwitch2WindowSingleContextImpl(reqGLCaps);
     }
-    
+
     @Test(timeout=30000)
     public void testSwitch2WindowSingleContextGLES2() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
         if(null == reqGLCaps) return;
         testSwitch2WindowSingleContextImpl(reqGLCaps);
     }
-    
-    private void testSwitch2WindowSingleContextImpl(GLCapabilities caps) throws InterruptedException {
+
+    private void testSwitch2WindowSingleContextImpl(final GLCapabilities caps) throws InterruptedException {
         final QuitAdapter quitAdapter = new QuitAdapter();
-        
-        GLAutoDrawable glad1 = createGLAutoDrawable(caps,         64, 64,     width,     height, quitAdapter);
-        GLAutoDrawable glad2 = createGLAutoDrawable(caps, 2*64+width, 64, width+100, height+100, quitAdapter);
-        
+
+        final GLAutoDrawable glad1 = createGLAutoDrawable(caps,         64, 64,     width,     height, quitAdapter);
+        final GLAutoDrawable glad2 = createGLAutoDrawable(caps, 2*64+width, 64, width+100, height+100, quitAdapter);
+
         // create single context using glad1 and assign it to glad1,
         // destroy the prev. context afterwards.
         {
             final GLContext newCtx = glad1.createContext(null);
-            Assert.assertNotNull(newCtx);        
+            Assert.assertNotNull(newCtx);
             final GLContext oldCtx = glad1.setContext(newCtx, true);
             Assert.assertNotNull(oldCtx);
             Assert.assertFalse(oldCtx.isCreated());
@@ -163,22 +163,22 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
             Assert.assertTrue(GLContext.CONTEXT_CURRENT_NEW==res || GLContext.CONTEXT_CURRENT==res);
             newCtx.release();
         }
-        
-        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();        
-        GearsES2 gears = new GearsES2(1);
+
+        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
+        final GearsES2 gears = new GearsES2(1);
         glad1.addGLEventListener(gears);
         glad1.addGLEventListener(snapshotGLEventListener);
         snapshotGLEventListener.setMakeSnapshot();
-        
-        Animator animator = new Animator();
+
+        final Animator animator = new Animator();
         animator.add(glad1);
         animator.add(glad2);
         animator.start();
-        
+
         int s = 0;
-        long t0 = System.currentTimeMillis();
+        final long t0 = System.currentTimeMillis();
         long t1 = t0;
-        
+
         while( !quitAdapter.shouldQuit() && ( t1 - t0 ) < duration ) {
             if( ( t1 - t0 ) / period > s) {
                 s++;
@@ -186,8 +186,8 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
 
                 // switch context _and_ the demo synchronously
                 GLDrawableUtil.swapGLContextAndAllGLEventListener(glad1, glad2);
-                
-                System.err.println(s+" - switch - END "+ ( t1 - t0 ));                
+
+                System.err.println(s+" - switch - END "+ ( t1 - t0 ));
             }
             Thread.sleep(100);
             t1 = System.currentTimeMillis();
@@ -195,56 +195,56 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
 
         animator.stop();
         glad1.destroy();
-        glad2.destroy();        
+        glad2.destroy();
     }
-    
+
     @Test(timeout=30000)
     public void testSwitch2GLWindowOneDemoGL2ES2() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
         if(null == reqGLCaps) return;
         testSwitch2GLWindowOneDemoImpl(reqGLCaps);
     }
-    
+
     @Test(timeout=30000)
     public void testSwitch2GLWindowOneDemoGLES2() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
         if(null == reqGLCaps) return;
         testSwitch2GLWindowOneDemoImpl(reqGLCaps);
     }
-    
-    private void testSwitch2GLWindowOneDemoImpl(GLCapabilities caps) throws InterruptedException {
-        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();        
+
+    private void testSwitch2GLWindowOneDemoImpl(final GLCapabilities caps) throws InterruptedException {
+        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
         final GearsES2 gears = new GearsES2(1);
         final QuitAdapter quitAdapter = new QuitAdapter();
-        
-        GLWindow glWindow1 = GLWindow.create(caps);        
+
+        final GLWindow glWindow1 = GLWindow.create(caps);
         glWindow1.setTitle("win1");
         glWindow1.setSize(width, height);
         glWindow1.setPosition(64, 64);
         glWindow1.addGLEventListener(0, gears);
         glWindow1.addGLEventListener(snapshotGLEventListener);
         glWindow1.addWindowListener(quitAdapter);
-        
-        GLWindow glWindow2 = GLWindow.create(caps);                
-        glWindow2.setTitle("win2");        
+
+        final GLWindow glWindow2 = GLWindow.create(caps);
+        glWindow2.setTitle("win2");
         glWindow2.setSize(width+100, height+100);
         glWindow2.setPosition(2*64+width, 64);
         glWindow2.addWindowListener(quitAdapter);
 
-        Animator animator = new Animator();
+        final Animator animator = new Animator();
         animator.add(glWindow1);
         animator.add(glWindow2);
         animator.start();
-        
+
         glWindow1.setVisible(true);
         glWindow2.setVisible(true);
 
         snapshotGLEventListener.setMakeSnapshot();
-         
+
         int s = 0;
-        long t0 = System.currentTimeMillis();
+        final long t0 = System.currentTimeMillis();
         long t1 = t0;
-        
+
         while( !quitAdapter.shouldQuit() && ( t1 - t0 ) < duration ) {
             if( ( t1 - t0 ) / period > s) {
                 s++;
@@ -254,11 +254,11 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
 
                 // switch context _and_ the demo synchronously
                 GLDrawableUtil.swapGLContextAndAllGLEventListener(glWindow1, glWindow2);
-                
+
                 System.err.println(s+" - B w1-h 0x"+Long.toHexString(glWindow1.getHandle())+",-ctx 0x"+Long.toHexString(glWindow1.getContext().getHandle()));
                 System.err.println(s+" - B w2-h 0x"+Long.toHexString(glWindow2.getHandle())+",-ctx 0x"+Long.toHexString(glWindow2.getContext().getHandle()));
                 System.err.println(s+" - switch - END "+ ( t1 - t0 ));
-                
+
                 snapshotGLEventListener.setMakeSnapshot();
             }
             Thread.sleep(100);
@@ -268,61 +268,61 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
         animator.stop();
         glWindow1.destroy();
         glWindow2.destroy();
-        
+
     }
-    
+
     @Test(timeout=30000)
     public void testSwitch2GLWindowEachWithOwnDemoGL2ES2() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
         if(null == reqGLCaps) return;
         testSwitch2GLWindowEachWithOwnDemoImpl(reqGLCaps);
     }
-    
+
     @Test(timeout=30000)
     public void testSwitch2GLWindowEachWithOwnDemoGLES2() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
         if(null == reqGLCaps) return;
         testSwitch2GLWindowEachWithOwnDemoImpl(reqGLCaps);
     }
-    
-    public void testSwitch2GLWindowEachWithOwnDemoImpl(GLCapabilities caps) throws InterruptedException {
+
+    public void testSwitch2GLWindowEachWithOwnDemoImpl(final GLCapabilities caps) throws InterruptedException {
         final GearsES2 gears = new GearsES2(1);
         final RedSquareES2 rsquare = new RedSquareES2(1);
         final QuitAdapter quitAdapter = new QuitAdapter();
-        final SnapshotGLEventListener snapshotGLEventListener1 = new SnapshotGLEventListener();        
-        final SnapshotGLEventListener snapshotGLEventListener2 = new SnapshotGLEventListener();        
-        
-        GLWindow glWindow1 = GLWindow.create(caps);        
+        final SnapshotGLEventListener snapshotGLEventListener1 = new SnapshotGLEventListener();
+        final SnapshotGLEventListener snapshotGLEventListener2 = new SnapshotGLEventListener();
+
+        final GLWindow glWindow1 = GLWindow.create(caps);
         glWindow1.setTitle("win1");
         glWindow1.setSize(width, height);
         glWindow1.setPosition(64, 64);
         glWindow1.addGLEventListener(0, gears);
         glWindow1.addGLEventListener(snapshotGLEventListener1);
         glWindow1.addWindowListener(quitAdapter);
-        
-        GLWindow glWindow2 = GLWindow.create(caps);                
-        glWindow2.setTitle("win2");        
+
+        final GLWindow glWindow2 = GLWindow.create(caps);
+        glWindow2.setTitle("win2");
         glWindow2.setSize(width+100, height+100);
         glWindow2.setPosition(2*64+width, 64);
         glWindow2.addGLEventListener(0, rsquare);
         glWindow2.addGLEventListener(snapshotGLEventListener2);
         glWindow2.addWindowListener(quitAdapter);
 
-        Animator animator = new Animator();
+        final Animator animator = new Animator();
         animator.add(glWindow1);
         animator.add(glWindow2);
         animator.start();
-        
+
         glWindow1.setVisible(true);
         glWindow2.setVisible(true);
 
         snapshotGLEventListener1.setMakeSnapshot();
         snapshotGLEventListener2.setMakeSnapshot();
-        
+
         int s = 0;
-        long t0 = System.currentTimeMillis();
+        final long t0 = System.currentTimeMillis();
         long t1 = t0;
-        
+
         while( !quitAdapter.shouldQuit() && ( t1 - t0 ) < duration ) {
             if( ( t1 - t0 ) / period > s) {
                 s++;
@@ -330,7 +330,7 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
                 System.err.println(s+" - A w1-h 0x"+Long.toHexString(glWindow1.getHandle())+",-ctx 0x"+Long.toHexString(glWindow1.getContext().getHandle()));
                 System.err.println(s+" - A w2-h 0x"+Long.toHexString(glWindow2.getHandle())+",-ctx 0x"+Long.toHexString(glWindow2.getContext().getHandle()));
                 GLDrawableUtil.swapGLContextAndAllGLEventListener(glWindow1, glWindow2);
-                System.err.println(s+" - B w1-h 0x"+Long.toHexString(glWindow1.getHandle())+",-ctx 0x"+Long.toHexString(glWindow1.getContext().getHandle()));                
+                System.err.println(s+" - B w1-h 0x"+Long.toHexString(glWindow1.getHandle())+",-ctx 0x"+Long.toHexString(glWindow1.getContext().getHandle()));
                 System.err.println(s+" - B w2-h 0x"+Long.toHexString(glWindow2.getHandle())+",-ctx 0x"+Long.toHexString(glWindow2.getContext().getHandle()));
                 System.err.println(s+" - switch - END "+ ( t1 - t0 ));
                 snapshotGLEventListener1.setMakeSnapshot();
@@ -347,31 +347,31 @@ public class TestGLContextDrawableSwitch01NEWT extends UITestCase {
         // System.err.println("post-del-w1: w1: "+glWindow1);
         // System.err.println("post-del-w1: w2: "+glWindow2);
         glWindow2.destroy();
-        
+
     }
 
     // default timing for 2 switches
     static long duration = 2200; // ms
     static long period = 1000; // ms
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             } else if(args[i].equals("-period")) {
                 i++;
                 try {
                     period = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         /**
         BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         System.err.println("Press enter to continue");
-        System.err.println(stdin.readLine()); */         
+        System.err.println(stdin.readLine()); */
         org.junit.runner.JUnitCore.main(TestGLContextDrawableSwitch01NEWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch02AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch02AWT.java
index 316199d..d9f2d0e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch02AWT.java
@@ -29,6 +29,7 @@
 package com.jogamp.opengl.test.junit.jogl.acore.glels;
 
 import java.awt.BorderLayout;
+import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.Frame;
 import java.io.IOException;
@@ -38,21 +39,15 @@ import com.jogamp.newt.event.TraceWindowAdapter;
 import com.jogamp.newt.event.awt.AWTWindowAdapter;
 
 import javax.media.opengl.GLAutoDrawable;
-import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLCapabilitiesImmutable;
 import javax.media.opengl.GLDrawableFactory;
-import javax.media.opengl.GLProfile;
 import javax.media.opengl.awt.GLCanvas;
 
-import com.jogamp.opengl.util.Animator;
-import com.jogamp.opengl.util.GLDrawableUtil;
+import jogamp.nativewindow.awt.AWTMisc;
 
-import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
-import com.jogamp.opengl.test.junit.util.UITestCase;
 
 import org.junit.Assert;
-import org.junit.BeforeClass;
-import org.junit.Test;
 import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
@@ -61,34 +56,25 @@ import org.junit.runners.MethodSorters;
  * from GLCanvas to an GLOffscreenAutoDrawable and back.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestGLContextDrawableSwitch02AWT extends UITestCase {
-    static int width, height;
+public class TestGLContextDrawableSwitch02AWT extends GLContextDrawableSwitchBase0 {
 
-    static GLCapabilities getCaps(String profile) {
-        if( !GLProfile.isAvailable(profile) )  {
-            System.err.println("Profile "+profile+" n/a");
-            return null;
-        }
-        return new GLCapabilities(GLProfile.get(profile));
-    }
-
-    @BeforeClass
-    public static void initClass() {
-        width  = 256;
-        height = 256;
-    }
-
-    private GLAutoDrawable createGLAutoDrawable(final Frame frame, GLCapabilities caps, int width, int height) throws InterruptedException, InvocationTargetException {
+    @Override
+    public GLAutoDrawable createGLAutoDrawable(final QuitAdapter quitAdapter, final GLCapabilitiesImmutable caps, final int width, final int height) throws InterruptedException, InvocationTargetException {
         final GLAutoDrawable glad;
         if( caps.isOnscreen() ) {
-            GLCanvas glCanvas = new GLCanvas(caps);
+            final Frame frame = new Frame("Gears AWT Test");
+            Assert.assertNotNull(frame);
+
+            final GLCanvas glCanvas = new GLCanvas(caps);
             Assert.assertNotNull(glCanvas);
-            Dimension glc_sz = new Dimension(width, height);
+            final Dimension glc_sz = new Dimension(width, height);
             glCanvas.setMinimumSize(glc_sz);
             glCanvas.setPreferredSize(glc_sz);
             glCanvas.setSize(glc_sz);
             glad = glCanvas;
 
+            new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glCanvas).addTo(frame);
+
             frame.setLayout(new BorderLayout());
             frame.add(glCanvas, BorderLayout.CENTER);
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -96,7 +82,6 @@ public class TestGLContextDrawableSwitch02AWT extends UITestCase {
                     frame.pack();
                     frame.setVisible(true);
                 }});
-
         } else {
             final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
             glad = factory.createOffscreenAutoDrawable(null, caps, null, width, height);
@@ -105,82 +90,34 @@ public class TestGLContextDrawableSwitch02AWT extends UITestCase {
         return glad;
     }
 
-    @Test(timeout=30000)
-    public void testSwitch2AWTGLCanvas2OffscreenGL2ES2() throws InterruptedException, InvocationTargetException {
-        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
-        if(null == reqGLCaps) return;
-        testSwitch2AWTGLCanvas2OffscreenImpl(reqGLCaps);
-    }
-
-    private void testSwitch2AWTGLCanvas2OffscreenImpl(GLCapabilities capsOnscreen) throws InterruptedException, InvocationTargetException {
-        final GLCapabilities capsOffscreen = (GLCapabilities) capsOnscreen.clone();
-        capsOffscreen.setOnscreen(false);
-
-        final QuitAdapter quitAdapter = new QuitAdapter();
-
-        final Frame frame = new Frame("Gears AWT Test");
-        Assert.assertNotNull(frame);
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
-
-        GLAutoDrawable glCanvas = createGLAutoDrawable(frame, capsOnscreen, width, height);
-
-        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
-        GearsES2 gears = new GearsES2(1);
-        glCanvas.addGLEventListener(gears);
-        glCanvas.addGLEventListener(snapshotGLEventListener);
-        snapshotGLEventListener.setMakeSnapshot();
-
-        Animator animator = new Animator();
-        animator.add(glCanvas);
-        animator.start();
-
-        int s = 0;
-        long t0 = System.currentTimeMillis();
-        long t1 = t0;
-
-        GLAutoDrawable glOffscreen = createGLAutoDrawable(null,  capsOffscreen, width, height);
-        while( !quitAdapter.shouldQuit() && ( t1 - t0 ) < duration ) {
-            if( ( t1 - t0 ) / period > s) {
-                s++;
-                System.err.println(s+" - switch - START "+ ( t1 - t0 ));
-
-                // switch context _and_ the demo synchronously
-                GLDrawableUtil.swapGLContextAndAllGLEventListener(glCanvas, glOffscreen);
-                snapshotGLEventListener.setMakeSnapshot();
-
-                System.err.println(s+" - switch - END "+ ( t1 - t0 ));
-            }
-            Thread.sleep(100);
-            t1 = System.currentTimeMillis();
+    @Override
+    public void destroyGLAutoDrawable(final GLAutoDrawable glad) throws InterruptedException, InvocationTargetException {
+        if( glad.getChosenGLCapabilities().isOnscreen() ) {
+            final Frame frame = AWTMisc.getFrame((Component)glad);
+            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    final Frame _frame = frame;
+                    _frame.dispose();
+                }});
+        } else {
+            glad.destroy();
         }
-
-        animator.stop();
-        // glCanvas.destroy();
-        glOffscreen.destroy();
-
-        javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
-            public void run() {
-                final Frame _frame = frame;
-                _frame.dispose();
-            }});
     }
 
-    // default timing for 2 switches
-    static long duration = 2900; // ms
-    static long period = 1000; // ms
-
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             } else if(args[i].equals("-period")) {
                 i++;
                 try {
                     period = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
+            } else if(args[i].equals("-testUnsafe")) {
+                testEvenUnsafeSwapGLContext = true;
             }
         }
         /**
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch02NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch02NEWT.java
new file mode 100644
index 0000000..c8a78d0
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch02NEWT.java
@@ -0,0 +1,100 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.acore.glels;
+
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+
+import com.jogamp.newt.opengl.GLWindow;
+
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLCapabilitiesImmutable;
+import javax.media.opengl.GLDrawableFactory;
+
+import com.jogamp.opengl.test.junit.util.QuitAdapter;
+
+import org.junit.Assert;
+import org.junit.FixMethodOrder;
+import org.junit.runners.MethodSorters;
+
+/**
+ * Test re-association (switching) of GLWindow /GLDrawables,
+ * from GLWindow/GLOffscreenAutoDrawable to an GLOffscreenAutoDrawable and back.
+ */
+ at FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class TestGLContextDrawableSwitch02NEWT extends GLContextDrawableSwitchBase0 {
+    @Override
+    public GLAutoDrawable createGLAutoDrawable(final QuitAdapter quitAdapter, final GLCapabilitiesImmutable caps, final int width, final int height) throws InterruptedException, InvocationTargetException {
+        final GLAutoDrawable glad;
+        if( caps.isOnscreen() ) {
+            final GLWindow glWindow = GLWindow.create(caps);
+            Assert.assertNotNull(glWindow);
+            glad = glWindow;
+
+            if( null != quitAdapter ) {
+                glWindow.addWindowListener(quitAdapter);
+            }
+
+            glWindow.setVisible(true);
+        } else {
+            final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
+            glad = factory.createOffscreenAutoDrawable(null, caps, null, width, height);
+            Assert.assertNotNull(glad);
+        }
+        return glad;
+    }
+
+    @Override
+    public void destroyGLAutoDrawable(final GLAutoDrawable glad) throws InterruptedException, InvocationTargetException {
+        glad.destroy();
+    }
+
+    public static void main(final String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                i++;
+                try {
+                    duration = Integer.parseInt(args[i]);
+                } catch (final Exception ex) { ex.printStackTrace(); }
+            } else if(args[i].equals("-period")) {
+                i++;
+                try {
+                    period = Integer.parseInt(args[i]);
+                } catch (final Exception ex) { ex.printStackTrace(); }
+            } else if(args[i].equals("-testUnsafe")) {
+                testEvenUnsafeSwapGLContext = true;
+            }
+        }
+        /**
+        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+        System.err.println("Press enter to continue");
+        System.err.println(stdin.readLine()); */
+        org.junit.runner.JUnitCore.main(TestGLContextDrawableSwitch02NEWT.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch10NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch10NEWT.java
index 4225cd9..822898e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch10NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch10NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.glels;
 
 import java.io.IOException;
@@ -63,11 +63,11 @@ import org.junit.runners.MethodSorters;
 
 /**
  * Test re-association of GLContext/GLDrawables,
- * here GLContext's survival of GLDrawable destruction 
+ * here GLContext's survival of GLDrawable destruction
  * and reuse w/ new or recreated GLDrawable.
  * <p>
- * Test utilizes {@link GLEventListenerState} for preserving the 
- * GLAutoDrawable state, i.e. GLContext, all GLEventListener 
+ * Test utilizes {@link GLEventListenerState} for preserving the
+ * GLAutoDrawable state, i.e. GLContext, all GLEventListener
  * and the GLAnimatorControl association.
  * </p>
  * <p>
@@ -84,21 +84,21 @@ public class TestGLContextDrawableSwitch10NEWT extends UITestCase {
 
     static int width, height;
 
-    static GLCapabilities getCaps(String profile) {
+    static GLCapabilities getCaps(final String profile) {
         if( !GLProfile.isAvailable(profile) )  {
             System.err.println("Profile "+profile+" n/a");
             return null;
         }
         return new GLCapabilities(GLProfile.get(profile));
     }
-    
+
     @BeforeClass
     public static void initClass() {
         width  = 256;
         height = 256;
     }
 
-    private GLAutoDrawable createGLAutoDrawableWithoutContext(GLCapabilities caps, int x, int y, int width, int height, WindowListener wl) throws InterruptedException {
+    private GLAutoDrawable createGLAutoDrawableWithoutContext(final GLCapabilities caps, final int x, final int y, final int width, final int height, final WindowListener wl) throws InterruptedException {
         final Window window = NewtFactory.createWindow(caps);
         Assert.assertNotNull(window);
         window.setPosition(x, y);
@@ -106,87 +106,87 @@ public class TestGLContextDrawableSwitch10NEWT extends UITestCase {
         window.setVisible(true);
         Assert.assertTrue(AWTRobotUtil.waitForVisible(window, true));
         Assert.assertTrue(AWTRobotUtil.waitForRealized(window, true));
-            
+
         final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
         final GLDrawable drawable = factory.createGLDrawable(window);
         Assert.assertNotNull(drawable);
-        
+
         drawable.setRealized(true);
         Assert.assertTrue(drawable.isRealized());
-        
+
         final GLAutoDrawableDelegate glad = new GLAutoDrawableDelegate(drawable, null, window, false, null) {
             @Override
             protected void destroyImplInLock() {
                 super.destroyImplInLock();
                 window.destroy(); // destroys the actual window
-            }            
+            }
         };
-        
+
         window.setWindowDestroyNotifyAction( new Runnable() {
             public void run() {
                 glad.windowDestroyNotifyOp();
             } } );
-        
+
         // add basic window interaction
         window.addWindowListener(new WindowAdapter() {
             @Override
-            public void windowRepaint(WindowUpdateEvent e) {
+            public void windowRepaint(final WindowUpdateEvent e) {
                 glad.windowRepaintOp();
             }
             @Override
-            public void windowResized(WindowEvent e) {
-                glad.windowResizedOp(window.getWidth(), window.getHeight());
+            public void windowResized(final WindowEvent e) {
+                glad.windowResizedOp(window.getSurfaceWidth(), window.getSurfaceHeight());
             }
         });
         window.addWindowListener(wl);
-        
+
         return glad;
     }
-    
+
     @Test(timeout=30000)
     public void test01GLADDelegateGL2ES2() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
         if(null == reqGLCaps) return;
         testGLADDelegateImpl(reqGLCaps);
     }
-    
+
     @Test(timeout=30000)
     public void test02GLADDelegateGLES2() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
         if(null == reqGLCaps) return;
         testGLADDelegateImpl(reqGLCaps);
     }
-    
-    private void testGLADDelegateImpl(GLCapabilities caps) throws InterruptedException {
+
+    private void testGLADDelegateImpl(final GLCapabilities caps) throws InterruptedException {
         final GLEventListenerCounter glelCounter = new GLEventListenerCounter();
-        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();        
+        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
         final Animator animator = new Animator();
         animator.start();
-        
+
         final GLEventListenerState glls1;
-        
+
         // - create glad1 w/o context
         // - create context using glad1 and assign it to glad1
         {
-            final QuitAdapter quitAdapter = new QuitAdapter();        
+            final QuitAdapter quitAdapter = new QuitAdapter();
             final GLAutoDrawable glad1 = createGLAutoDrawableWithoutContext(caps,         64, 64,     width,     height, quitAdapter);
             final GLContext context1 = glad1.createContext(null);
             glad1.setContext(context1, true);
             animator.add(glad1);
-            
+
             glad1.addGLEventListener(glelCounter);
             glad1.addGLEventListener(new GearsES2(1));
             glad1.addGLEventListener(snapshotGLEventListener);
             snapshotGLEventListener.setMakeSnapshot();
-            
+
             final long t0 = System.currentTimeMillis();
             long t1 = t0;
-            
+
             while( !quitAdapter.shouldQuit() && ( t1 - t0 ) < duration ) {
                 Thread.sleep(100);
                 t1 = System.currentTimeMillis();
             }
-    
+
             Assert.assertEquals(1, glelCounter.initCount);
             Assert.assertTrue(1 <= glelCounter.reshapeCount);
             Assert.assertTrue(1 <= glelCounter.displayCount);
@@ -195,11 +195,11 @@ public class TestGLContextDrawableSwitch10NEWT extends UITestCase {
             Assert.assertEquals(3, glad1.getGLEventListenerCount());
             Assert.assertEquals(context1.getGLReadDrawable(), glad1.getDelegatedDrawable());
             Assert.assertEquals(context1.getGLDrawable(), glad1.getDelegatedDrawable());
-            
+
             // - dis-associate context from glad1
             // - destroy glad1
             glls1 = GLEventListenerState.moveFrom(glad1);
-            
+
             Assert.assertEquals(1, glelCounter.initCount);
             Assert.assertTrue(1 <= glelCounter.reshapeCount);
             Assert.assertTrue(1 <= glelCounter.displayCount);
@@ -211,27 +211,27 @@ public class TestGLContextDrawableSwitch10NEWT extends UITestCase {
             Assert.assertEquals(true, glls1.isOwner());
             Assert.assertEquals(null, glad1.getContext());
             Assert.assertEquals(0, glad1.getGLEventListenerCount());
-            
+
             glad1.destroy();
             Assert.assertEquals(1, glelCounter.initCount);
             Assert.assertTrue(1 <= glelCounter.reshapeCount);
             Assert.assertTrue(1 <= glelCounter.displayCount);
             Assert.assertEquals(0, glelCounter.disposeCount);
         }
-        
+
         // - create glad2 w/ survived context
         {
-            final QuitAdapter quitAdapter = new QuitAdapter();        
+            final QuitAdapter quitAdapter = new QuitAdapter();
             final GLAutoDrawable glad2 = createGLAutoDrawableWithoutContext(caps, 2*64+width, 64, width+100, height+100, quitAdapter);
             snapshotGLEventListener.setMakeSnapshot();
-            
+
             Assert.assertEquals(null, glad2.getContext());
             Assert.assertEquals(0, glad2.getGLEventListenerCount());
-            
+
             glls1.moveTo(glad2);
-            
+
             Assert.assertTrue(glad2.isRealized());
-            
+
             Assert.assertEquals(1, glelCounter.initCount);
             Assert.assertTrue(1 <= glelCounter.reshapeCount);
             Assert.assertTrue(1 <= glelCounter.displayCount);
@@ -241,15 +241,15 @@ public class TestGLContextDrawableSwitch10NEWT extends UITestCase {
             Assert.assertEquals(glls1.context.getGLReadDrawable(), glad2.getDelegatedDrawable());
             Assert.assertEquals(glls1.context.getGLDrawable(), glad2.getDelegatedDrawable());
             Assert.assertEquals(false, glls1.isOwner());
-            
+
             final long t0 = System.currentTimeMillis();
             long t1 = t0;
-            
+
             while( !quitAdapter.shouldQuit() && ( t1 - t0 ) < duration ) {
                 Thread.sleep(100);
                 t1 = System.currentTimeMillis();
             }
-    
+
             glad2.destroy();
             Assert.assertEquals(1, glelCounter.initCount);
             Assert.assertTrue(1 <= glelCounter.reshapeCount);
@@ -258,20 +258,20 @@ public class TestGLContextDrawableSwitch10NEWT extends UITestCase {
         }
         animator.stop();
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         /**
         BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         System.err.println("Press enter to continue");
-        System.err.println(stdin.readLine()); */         
+        System.err.println(stdin.readLine()); */
         org.junit.runner.JUnitCore.main(TestGLContextDrawableSwitch10NEWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch11NewtAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch11NewtAWT.java
index e5f61a4..f1c08c8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch11NewtAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch11NewtAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.glels;
 
 import java.io.IOException;
@@ -45,11 +45,11 @@ import org.junit.runners.MethodSorters;
 
 /**
  * Test re-association of GLContext/GLDrawables,
- * here GLContext's survival of GLDrawable destruction 
+ * here GLContext's survival of GLDrawable destruction
  * and reuse w/ new or recreated GLDrawable.
  * <p>
- * Test utilizes {@link GLEventListenerState} for preserving the 
- * GLAutoDrawable state, i.e. GLContext, all GLEventListener 
+ * Test utilizes {@link GLEventListenerState} for preserving the
+ * GLAutoDrawable state, i.e. GLContext, all GLEventListener
  * and the GLAnimatorControl association.
  * </p>
  * <p>
@@ -60,7 +60,7 @@ import org.junit.runners.MethodSorters;
  * </p>
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestGLContextDrawableSwitch11NewtAWT extends GLContextDrawableSwitchBase {
+public class TestGLContextDrawableSwitch11NewtAWT extends GLContextDrawableSwitchBase1 {
 
     @Test(timeout=30000)
     public void test21GLWindowGL2ES2() throws InterruptedException {
@@ -68,54 +68,54 @@ public class TestGLContextDrawableSwitch11NewtAWT extends GLContextDrawableSwitc
         if(null == reqGLCaps) return;
         testGLWindowImpl(reqGLCaps);
     }
-    
+
     @Test(timeout=30000)
     public void test22GLWindowGLES2() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
         if(null == reqGLCaps) return;
         testGLWindowImpl(reqGLCaps);
     }
-    
-    private void testGLWindowImpl(GLCapabilities caps) throws InterruptedException {
-        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();        
+
+    private void testGLWindowImpl(final GLCapabilities caps) throws InterruptedException {
+        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
         final GLEventListenerCounter glelTracker = new GLEventListenerCounter();
         final Animator animator = new Animator();
         animator.start();
-        
+
         final GLEventListenerState glels[] = new GLEventListenerState[1];
-        
+
         // - create glad1 w/o context
         // - create context using glad1 and assign it to glad1
         {
-            testGLADOneLifecycle(null, caps, GLADType.GLWindow, width, 
+            testGLADOneLifecycle(null, caps, GLADType.GLWindow, width,
                                  height, glelTracker,
-                                 snapshotGLEventListener, 
-                                 null, glels, animator); 
+                                 snapshotGLEventListener,
+                                 null, glels, animator);
         }
-        
+
         // - create glad2 w/ survived context
         {
-            testGLADOneLifecycle(null, caps, GLADType.GLWindow, width+100, 
+            testGLADOneLifecycle(null, caps, GLADType.GLWindow, width+100,
                                  height+100, glelTracker,
-                                 snapshotGLEventListener, 
+                                 snapshotGLEventListener,
                                  glels[0], null, null);
         }
         animator.stop();
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         /**
         BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         System.err.println("Press enter to continue");
-        System.err.println(stdin.readLine()); */         
+        System.err.println(stdin.readLine()); */
         org.junit.runner.JUnitCore.main(TestGLContextDrawableSwitch11NewtAWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch12AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch12AWT.java
index d17d899..795e537 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch12AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch12AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.acore.glels;
 
 import java.io.IOException;
@@ -46,11 +46,11 @@ import org.junit.runners.MethodSorters;
 
 /**
  * Test re-association of GLContext/GLDrawables,
- * here GLContext's survival of GLDrawable destruction 
+ * here GLContext's survival of GLDrawable destruction
  * and reuse w/ new or recreated GLDrawable.
  * <p>
- * Test utilizes {@link GLEventListenerState} for preserving the 
- * GLAutoDrawable state, i.e. GLContext, all GLEventListener 
+ * Test utilizes {@link GLEventListenerState} for preserving the
+ * GLAutoDrawable state, i.e. GLContext, all GLEventListener
  * and the GLAnimatorControl association.
  * </p>
  * <p>
@@ -61,7 +61,7 @@ import org.junit.runners.MethodSorters;
  * </p>
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestGLContextDrawableSwitch12AWT extends GLContextDrawableSwitchBase {
+public class TestGLContextDrawableSwitch12AWT extends GLContextDrawableSwitchBase1 {
 
     @Test(timeout=30000)
     public void test01GLCanvasOnscreenGL2ES2() throws InterruptedException {
@@ -69,29 +69,29 @@ public class TestGLContextDrawableSwitch12AWT extends GLContextDrawableSwitchBas
         if(null == reqGLCaps) return;
         testGLCanvasImpl(reqGLCaps, false);
     }
-    
+
     @Test(timeout=30000)
     public void test02GLCanvasOnscreenGLES2() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
         if(null == reqGLCaps) return;
         testGLCanvasImpl(reqGLCaps, false);
     }
-    
+
     @Test(timeout=30000)
     public void test11GLCanvasOffscreenGL2ES2() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
         if(null == reqGLCaps) return;
         testGLCanvasImpl(reqGLCaps, true);
     }
-    
+
     @Test(timeout=30000)
     public void test12GLCanvasOffscreenGLES2() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
         if(null == reqGLCaps) return;
         testGLCanvasImpl(reqGLCaps, true);
     }
-    
-    private void testGLCanvasImpl(GLCapabilities caps, boolean offscreenLayer) throws InterruptedException {
+
+    private void testGLCanvasImpl(final GLCapabilities caps, final boolean offscreenLayer) throws InterruptedException {
         if( offscreenLayer ) {
             if( !JAWTUtil.isOffscreenLayerSupported() ) {
                 System.err.println("Platform doesn't support offscreen rendering.");
@@ -103,45 +103,45 @@ public class TestGLContextDrawableSwitch12AWT extends GLContextDrawableSwitchBas
                 return;
             }
         }
-        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();        
+        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
         final GLEventListenerCounter glelTracker = new GLEventListenerCounter();
         final Animator animator = new Animator();
         animator.start();
-        
+
         final GLEventListenerState glels[] = new GLEventListenerState[1];
-        
+
         // - create glad1 w/o context
         // - create context using glad1 and assign it to glad1
         {
-            testGLADOneLifecycle(null, caps, offscreenLayer ? GLADType.GLCanvasOffscreen : GLADType.GLCanvasOnscreen, width, 
+            testGLADOneLifecycle(null, caps, offscreenLayer ? GLADType.GLCanvasOffscreen : GLADType.GLCanvasOnscreen, width,
                                  height, glelTracker,
-                                 snapshotGLEventListener, 
-                                 null, glels, animator); 
+                                 snapshotGLEventListener,
+                                 null, glels, animator);
         }
-        
+
         // - create glad2 w/ survived context
         {
-            testGLADOneLifecycle(null, caps, offscreenLayer ? GLADType.GLCanvasOffscreen : GLADType.GLCanvasOnscreen, width+100, 
+            testGLADOneLifecycle(null, caps, offscreenLayer ? GLADType.GLCanvasOffscreen : GLADType.GLCanvasOnscreen, width+100,
                                  height+100, glelTracker,
-                                 snapshotGLEventListener, 
+                                 snapshotGLEventListener,
                                  glels[0], null, null);
         }
         animator.stop();
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         /**
         BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         System.err.println("Press enter to continue");
-        System.err.println(stdin.readLine()); */         
+        System.err.println(stdin.readLine()); */
         org.junit.runner.JUnitCore.main(TestGLContextDrawableSwitch12AWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch13Newt2AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch13Newt2AWT.java
new file mode 100644
index 0000000..27d5ff8
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch13Newt2AWT.java
@@ -0,0 +1,195 @@
+/**
+ * Copyright 2013 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.acore.glels;
+
+import java.io.IOException;
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+
+
+import com.jogamp.newt.Display;
+import com.jogamp.newt.NewtFactory;
+import com.jogamp.newt.Screen;
+import com.jogamp.opengl.GLEventListenerState;
+import com.jogamp.opengl.GLRendererQuirks;
+import com.jogamp.opengl.util.Animator;
+
+import com.jogamp.opengl.test.junit.util.GLEventListenerCounter;
+
+import org.junit.Test;
+import org.junit.FixMethodOrder;
+import org.junit.runners.MethodSorters;
+
+/**
+ * Test re-association of GLContext/GLDrawables,
+ * here GLContext's survival of GLDrawable destruction
+ * and reuse w/ new or recreated GLDrawable.
+ * <p>
+ * Test utilizes {@link GLEventListenerState} for preserving the
+ * GLAutoDrawable state, i.e. GLContext, all GLEventListener
+ * and the GLAnimatorControl association.
+ * </p>
+ * <p>
+ * This test moves the {@link GLEventListenerState} from a
+ * NEWT GLWindow before it's destruction to an AWT GLCanvas after it's creation
+ * and vice versa
+ * </p>
+ * <p>
+ * See Bug 665 - https://jogamp.org/bugzilla/show_bug.cgi?id=665.
+ * </p>
+ * <p>
+ * Interesting artifact w/ ATI proprietary driver is that the
+ * bug causing the quirk {@link GLRendererQuirks#DontCloseX11Display}
+ * also causes an XCB crash when reusing the X11 display connection
+ * from AWT -> NEWT. Pre-allocating the X11 Display and keeping it referenced
+ * to avoid such re-usage worksaround this problem.
+ * </p>
+ */
+ at FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class TestGLContextDrawableSwitch13Newt2AWT extends GLContextDrawableSwitchBase1 {
+
+    @Test(timeout=30000)
+    public void test01GLCanvasOnScrn2GLWindowGL2ES2() throws InterruptedException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        testGLCanvas2GLWindowImpl(null, reqGLCaps, GLADType.GLCanvasOnscreen, GLADType.GLWindow);
+    }
+
+    @Test(timeout=30000)
+    public void test02GLCanvasOnScrn2GLWindowGLES2() throws InterruptedException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
+        if(null == reqGLCaps) return;
+        testGLCanvas2GLWindowImpl(null, reqGLCaps, GLADType.GLCanvasOnscreen, GLADType.GLWindow);
+    }
+
+    @Test(timeout=30000)
+    public void test11GLWindow2GLCanvasOnScrnGL2ES2() throws InterruptedException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        final Display dpy = NewtFactory.createDisplay(null);
+        final Screen screen = NewtFactory.createScreen(dpy, 0);
+        screen.addReference();
+        testGLCanvas2GLWindowImpl(screen, reqGLCaps, GLADType.GLWindow, GLADType.GLCanvasOnscreen);
+        screen.removeReference();
+    }
+
+    @Test(timeout=30000)
+    public void test12GLWindow2GLCanvasOnScrnGLES2() throws InterruptedException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
+        if(null == reqGLCaps) return;
+        final Display dpy = NewtFactory.createDisplay(null);
+        final Screen screen = NewtFactory.createScreen(dpy, 0);
+        screen.addReference();
+        testGLCanvas2GLWindowImpl(screen, reqGLCaps, GLADType.GLWindow, GLADType.GLCanvasOnscreen);
+        screen.removeReference();
+    }
+
+    @Test(timeout=30000)
+    public void test21GLCanvasOffScrn2GLWindowGL2ES2() throws InterruptedException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        testGLCanvas2GLWindowImpl(null, reqGLCaps, GLADType.GLCanvasOffscreen, GLADType.GLWindow);
+    }
+
+    @Test(timeout=30000)
+    public void test22GLCanvasOffScrn2GLWindowGLES2() throws InterruptedException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
+        if(null == reqGLCaps) return;
+        testGLCanvas2GLWindowImpl(null, reqGLCaps, GLADType.GLCanvasOffscreen, GLADType.GLWindow);
+    }
+
+    @Test(timeout=30000)
+    public void test31GLWindow2GLCanvasOffScrnGL2ES2() throws InterruptedException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
+        if(null == reqGLCaps) return;
+        final Display dpy = NewtFactory.createDisplay(null);
+        final Screen screen = NewtFactory.createScreen(dpy, 0);
+        screen.addReference();
+        testGLCanvas2GLWindowImpl(screen, reqGLCaps, GLADType.GLWindow, GLADType.GLCanvasOffscreen);
+        screen.removeReference();
+    }
+
+    @Test(timeout=30000)
+    public void test32GLWindow2GLCanvasOffScrnGLES2() throws InterruptedException {
+        final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
+        if(null == reqGLCaps) return;
+        final Display dpy = NewtFactory.createDisplay(null);
+        final Screen screen = NewtFactory.createScreen(dpy, 0);
+        screen.addReference();
+        testGLCanvas2GLWindowImpl(screen, reqGLCaps, GLADType.GLWindow, GLADType.GLCanvasOffscreen);
+        screen.removeReference();
+    }
+
+    private void testGLCanvas2GLWindowImpl(final Screen screen, final GLCapabilities caps, final GLADType gladType1, final GLADType gladType2) throws InterruptedException {
+        if( !validateOnOffscreenLayer(gladType1, gladType2) ) {
+            return;
+        }
+        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
+        final GLEventListenerCounter glelTracker = new GLEventListenerCounter();
+        final Animator animator = new Animator();
+        animator.start();
+
+        final GLEventListenerState glels[] = new GLEventListenerState[1];
+
+        // - create glad1 w/o context
+        // - create context using glad1 and assign it to glad1
+        {
+            testGLADOneLifecycle(screen, caps, gladType1, width,
+                                 height, glelTracker,
+                                 snapshotGLEventListener,
+                                 null, glels, animator);
+        }
+
+        // - create glad2 w/ survived context
+        {
+            testGLADOneLifecycle(screen, caps, gladType2, width+100,
+                                 height+100, glelTracker,
+                                 snapshotGLEventListener,
+                                 glels[0], null, null);
+        }
+        animator.stop();
+    }
+
+    public static void main(final String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                i++;
+                try {
+                    duration = Integer.parseInt(args[i]);
+                } catch (final Exception ex) { ex.printStackTrace(); }
+            }
+        }
+        /**
+        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+        System.err.println("Press enter to continue");
+        System.err.println(stdin.readLine()); */
+        org.junit.runner.JUnitCore.main(TestGLContextDrawableSwitch13Newt2AWT.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch21Newt2AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch21Newt2AWT.java
deleted file mode 100644
index 2b0f43d..0000000
--- a/src/test/com/jogamp/opengl/test/junit/jogl/acore/glels/TestGLContextDrawableSwitch21Newt2AWT.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/**
- * Copyright 2013 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.opengl.test.junit.jogl.acore.glels;
-
-import java.io.IOException;
-
-import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLProfile;
-
-
-import com.jogamp.newt.Display;
-import com.jogamp.newt.NewtFactory;
-import com.jogamp.newt.Screen;
-import com.jogamp.opengl.GLEventListenerState;
-import com.jogamp.opengl.GLRendererQuirks;
-import com.jogamp.opengl.util.Animator;
-
-import com.jogamp.opengl.test.junit.util.GLEventListenerCounter;
-
-import org.junit.Test;
-import org.junit.FixMethodOrder;
-import org.junit.runners.MethodSorters;
-
-/**
- * Test re-association of GLContext/GLDrawables,
- * here GLContext's survival of GLDrawable destruction 
- * and reuse w/ new or recreated GLDrawable.
- * <p>
- * Test utilizes {@link GLEventListenerState} for preserving the 
- * GLAutoDrawable state, i.e. GLContext, all GLEventListener 
- * and the GLAnimatorControl association.
- * </p>
- * <p>
- * This test moves the {@link GLEventListenerState} from a 
- * NEWT GLWindow before it's destruction to an AWT GLCanvas after it's creation
- * and vice versa 
- * </p>
- * <p>
- * See Bug 665 - https://jogamp.org/bugzilla/show_bug.cgi?id=665.
- * </p>
- * <p>
- * Interesting artifact w/ ATI proprietary driver is that the
- * bug causing the quirk {@link GLRendererQuirks#DontCloseX11Display}
- * also causes an XCB crash when reusing the X11 display connection
- * from AWT -> NEWT. Pre-allocating the X11 Display and keeping it referenced
- * to avoid such re-usage worksaround this problem.  
- * </p>
- */
- at FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestGLContextDrawableSwitch21Newt2AWT extends GLContextDrawableSwitchBase {
-
-    @Test(timeout=30000)
-    public void test01GLCanvasOnScrn2GLWindowGL2ES2() throws InterruptedException {
-        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
-        if(null == reqGLCaps) return;
-        testGLCanvas2GLWindowImpl(null, reqGLCaps, GLADType.GLCanvasOnscreen, GLADType.GLWindow);
-    }
-    
-    @Test(timeout=30000)
-    public void test02GLCanvasOnScrn2GLWindowGLES2() throws InterruptedException {
-        final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
-        if(null == reqGLCaps) return;
-        testGLCanvas2GLWindowImpl(null, reqGLCaps, GLADType.GLCanvasOnscreen, GLADType.GLWindow);
-    }
-    
-    @Test(timeout=30000)
-    public void test11GLWindow2GLCanvasOnScrnGL2ES2() throws InterruptedException {
-        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
-        if(null == reqGLCaps) return;
-        final Display dpy = NewtFactory.createDisplay(null);
-        final Screen screen = NewtFactory.createScreen(dpy, 0);
-        screen.addReference();
-        testGLCanvas2GLWindowImpl(screen, reqGLCaps, GLADType.GLWindow, GLADType.GLCanvasOnscreen);
-        screen.removeReference();
-    }
-    
-    @Test(timeout=30000)
-    public void test12GLWindow2GLCanvasOnScrnGLES2() throws InterruptedException {
-        final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
-        if(null == reqGLCaps) return;
-        final Display dpy = NewtFactory.createDisplay(null);
-        final Screen screen = NewtFactory.createScreen(dpy, 0);
-        screen.addReference();
-        testGLCanvas2GLWindowImpl(screen, reqGLCaps, GLADType.GLWindow, GLADType.GLCanvasOnscreen);
-        screen.removeReference();
-    }
-    
-    @Test(timeout=30000)
-    public void test21GLCanvasOffScrn2GLWindowGL2ES2() throws InterruptedException {
-        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
-        if(null == reqGLCaps) return;
-        testGLCanvas2GLWindowImpl(null, reqGLCaps, GLADType.GLCanvasOffscreen, GLADType.GLWindow);
-    }
-    
-    @Test(timeout=30000)
-    public void test22GLCanvasOffScrn2GLWindowGLES2() throws InterruptedException {
-        final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
-        if(null == reqGLCaps) return;
-        testGLCanvas2GLWindowImpl(null, reqGLCaps, GLADType.GLCanvasOffscreen, GLADType.GLWindow);
-    }
-    
-    @Test(timeout=30000)
-    public void test31GLWindow2GLCanvasOffScrnGL2ES2() throws InterruptedException {
-        final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
-        if(null == reqGLCaps) return;
-        final Display dpy = NewtFactory.createDisplay(null);
-        final Screen screen = NewtFactory.createScreen(dpy, 0);
-        screen.addReference();
-        testGLCanvas2GLWindowImpl(screen, reqGLCaps, GLADType.GLWindow, GLADType.GLCanvasOffscreen);
-        screen.removeReference();
-    }
-    
-    @Test(timeout=30000)
-    public void test32GLWindow2GLCanvasOffScrnGLES2() throws InterruptedException {
-        final GLCapabilities reqGLCaps = getCaps(GLProfile.GLES2);
-        if(null == reqGLCaps) return;
-        final Display dpy = NewtFactory.createDisplay(null);
-        final Screen screen = NewtFactory.createScreen(dpy, 0);
-        screen.addReference();
-        testGLCanvas2GLWindowImpl(screen, reqGLCaps, GLADType.GLWindow, GLADType.GLCanvasOffscreen);
-        screen.removeReference();
-    }
-    
-    private void testGLCanvas2GLWindowImpl(Screen screen, GLCapabilities caps, GLADType gladType1, GLADType gladType2) throws InterruptedException {
-        if( !validateOnOffscreenLayer(gladType1, gladType2) ) {
-            return;
-        }
-        final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();        
-        final GLEventListenerCounter glelTracker = new GLEventListenerCounter();
-        final Animator animator = new Animator();
-        animator.start();
-        
-        final GLEventListenerState glels[] = new GLEventListenerState[1];
-        
-        // - create glad1 w/o context
-        // - create context using glad1 and assign it to glad1
-        {
-            testGLADOneLifecycle(screen, caps, gladType1, width, 
-                                 height, glelTracker,
-                                 snapshotGLEventListener, 
-                                 null, glels, animator); 
-        }
-        
-        // - create glad2 w/ survived context
-        {
-            testGLADOneLifecycle(screen, caps, gladType2, width+100, 
-                                 height+100, glelTracker,
-                                 snapshotGLEventListener, 
-                                 glels[0], null, null);
-        }
-        animator.stop();
-    }
-    
-    public static void main(String args[]) throws IOException {
-        for(int i=0; i<args.length; i++) {
-            if(args[i].equals("-time")) {
-                i++;
-                try {
-                    duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
-            }
-        }
-        /**
-        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
-        System.err.println("Press enter to continue");
-        System.err.println(stdin.readLine()); */         
-        org.junit.runner.JUnitCore.main(TestGLContextDrawableSwitch21Newt2AWT.class.getName());
-    }
-}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/ManualHiDPIBufferedImage01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/ManualHiDPIBufferedImage01AWT.java
new file mode 100644
index 0000000..6ccc9d2
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/ManualHiDPIBufferedImage01AWT.java
@@ -0,0 +1,71 @@
+package com.jogamp.opengl.test.junit.jogl.awt;
+
+import java.awt.BorderLayout;
+import java.awt.Canvas;
+import java.awt.Dimension;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.lang.reflect.InvocationTargetException;
+
+import javax.swing.JCheckBox;
+import javax.swing.JComponent;
+import javax.swing.JFrame;
+import javax.swing.SwingUtilities;
+
+/**
+ * Manual test for BufferedImage behavior w/ OSX HiDPI pixel scale usage.
+ */
+public class ManualHiDPIBufferedImage01AWT {
+
+    static final int width  = 200;
+    static final int height = 100;
+
+    public static void main(final String[] args) throws InterruptedException, InvocationTargetException {
+        final JFrame frame = new JFrame();
+
+        SwingUtilities.invokeLater(new Runnable() {
+            @Override
+            public void run() {
+                final Image image1 = getImage(getCheckBox("High-DPI (no)", false), width, height, 1);
+                final Image image2 = getImage(getCheckBox("High-DPI (yes)", true), width, height, 2);
+                System.err.println("Image1: "+image1);
+                System.err.println("Image2: "+image2);
+
+                @SuppressWarnings("serial")
+                final Canvas canvas = new Canvas() {
+                    @Override
+                    public void paint(final Graphics g) {
+                        super.paint(g);
+                        g.drawImage(image1, 0, 0,          width, height, this);
+                        g.drawImage(image2, 0, height + 5, width, height, this);
+                    }
+                };
+                frame.getContentPane().add(getCheckBox("High-DPI (ref)", false), BorderLayout.NORTH);
+                frame.getContentPane().add(canvas, BorderLayout.CENTER);
+
+                frame.setBounds((1440-400)/2, 100, 400, 400);
+                frame.validate();
+                frame.setVisible(true);
+            }
+        });
+    }
+
+    static JCheckBox getCheckBox(final String text, final boolean selected) {
+        final JCheckBox checkBox = new JCheckBox(text);
+        checkBox.setSelected(selected);
+        checkBox.setSize(new Dimension(width, height));
+        return checkBox;
+    }
+
+    static Image getImage(final JComponent component, final int width, final int height, final int scale) {
+        final BufferedImage image = new BufferedImage(width*scale, height*scale, BufferedImage.TYPE_INT_ARGB);
+        final Graphics g = image.getGraphics();
+        ((Graphics2D) g).scale(scale, scale);
+        component.paint(g);
+        g.dispose();
+
+        return image;
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java
index 6152fb1..1bfe313 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT01GLn.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.awt;
 
 import javax.media.opengl.GLProfile;
@@ -53,13 +53,13 @@ public class TestAWT01GLn extends UITestCase {
         System.out.println("GLProfile "+GLProfile.glAvailabilityToString());
     }
 
-    protected void runTestGL(GLCapabilities caps) throws InterruptedException {
+    protected void runTestGL(final GLCapabilities caps) throws InterruptedException {
         final Frame frame = new Frame("Texture Test");
         Assert.assertNotNull(frame);
-        
+
         final GLCanvas glCanvas = new GLCanvas(caps);
         Assert.assertNotNull(glCanvas);
-        
+
         glCanvas.addGLEventListener(new GearsES2());
         frame.add(glCanvas);
 
@@ -71,23 +71,23 @@ public class TestAWT01GLn extends UITestCase {
                     // Ensure 1st paint of GLCanvas will have a valid size, hence drawable gets created.
                     frame.setSize(512, 512);
                     frame.validate();
-            
+
                     frame.setVisible(true);
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
 
         glCanvas.display(); // one in process display
 
-        Animator animator = new Animator(glCanvas);
+        final Animator animator = new Animator(glCanvas);
         animator.start();
 
         Thread.sleep(500); // 500 ms
 
         animator.stop();
-        
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
@@ -95,7 +95,7 @@ public class TestAWT01GLn extends UITestCase {
                     frame.remove(glCanvas);
                     frame.dispose();
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
@@ -103,10 +103,10 @@ public class TestAWT01GLn extends UITestCase {
 
     @Test
     public void test01GLDefault() throws InterruptedException {
-        GLProfile glp = GLProfile.getDefault();
+        final GLProfile glp = GLProfile.getDefault();
         System.out.println("GLProfile Default: "+glp);
         if(glp.isGL2ES2()) {
-            GLCapabilities caps = new GLCapabilities(glp);
+            final GLCapabilities caps = new GLCapabilities(glp);
             runTestGL(caps);
         } else {
             System.out.println("not a GL2ES2 profile");
@@ -116,9 +116,9 @@ public class TestAWT01GLn extends UITestCase {
     @Test
     public void test02GL2() throws InterruptedException {
         if(GLProfile.isAvailable(GLProfile.GL2)) {
-            GLProfile glprofile = GLProfile.get(GLProfile.GL2);
+            final GLProfile glprofile = GLProfile.get(GLProfile.GL2);
             System.out.println( "GLProfile GL2: " + glprofile );
-            GLCapabilities caps = new GLCapabilities(glprofile);
+            final GLCapabilities caps = new GLCapabilities(glprofile);
             runTestGL(caps);
         } else {
             System.out.println("GL2 n/a");
@@ -128,16 +128,16 @@ public class TestAWT01GLn extends UITestCase {
     @Test
     public void test02ES2() throws InterruptedException {
         if(GLProfile.isAvailable(GLProfile.GLES2)) {
-            GLProfile glprofile = GLProfile.get(GLProfile.GLES2);
+            final GLProfile glprofile = GLProfile.get(GLProfile.GLES2);
             System.out.println( "GLProfile GLES2: " + glprofile );
-            GLCapabilities caps = new GLCapabilities(glprofile);
+            final GLCapabilities caps = new GLCapabilities(glprofile);
             runTestGL(caps);
         } else {
             System.out.println("GLES2 n/a");
         }
     }
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestAWT01GLn.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java
index 349674e..4122094 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT02WindowClosing.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.awt;
 
 import com.jogamp.opengl.test.junit.util.UITestCase;
@@ -47,7 +47,7 @@ public class TestAWT02WindowClosing extends UITestCase {
     @Test
     public void test01WindowClosing() throws InterruptedException {
         final Frame frame = new Frame();
-        ClosingWindowAdapter closingWindowAdapter = new ClosingWindowAdapter(frame);
+        final ClosingWindowAdapter closingWindowAdapter = new ClosingWindowAdapter(frame);
         frame.addWindowListener(closingWindowAdapter);
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -55,7 +55,7 @@ public class TestAWT02WindowClosing extends UITestCase {
                     frame.setSize(500, 500);
                     frame.setVisible(true);
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
@@ -63,8 +63,8 @@ public class TestAWT02WindowClosing extends UITestCase {
         Thread.sleep(durationPerTest);
         if(!closingWindowAdapter.closingCalled) {
             // programatically issue windowClosing
-            Toolkit tk = Toolkit.getDefaultToolkit();
-            EventQueue evtQ = tk.getSystemEventQueue();
+            final Toolkit tk = Toolkit.getDefaultToolkit();
+            final EventQueue evtQ = tk.getSystemEventQueue();
             evtQ.postEvent(new WindowEvent(frame, WindowEvent.WINDOW_CLOSING));
             Thread.sleep(200);
         }
@@ -74,25 +74,25 @@ public class TestAWT02WindowClosing extends UITestCase {
     static class ClosingWindowAdapter extends WindowAdapter {
         boolean closingCalled = false;
         Frame frame;
-        public ClosingWindowAdapter(Frame frame) {
+        public ClosingWindowAdapter(final Frame frame) {
             this.frame = frame;
         }
-        public void windowClosing(WindowEvent ev) {
+        public void windowClosing(final WindowEvent ev) {
                 System.out.println("windowClosing() called ..");
                 closingCalled = true;
                 frame.dispose();
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java
index 7282687..920fdda 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestAWT03GLCanvasRecreate01.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.awt;
 
 import javax.media.opengl.GLProfile;
@@ -81,7 +81,7 @@ public class TestAWT03GLCanvasRecreate01 extends UITestCase {
         frame1.add(label);
         frame1.setSize(512, 512);
         frame1.setLocation(0, 0);
-        
+
         frame2 = new Frame("Frame 2");
         Assert.assertNotNull(frame2);
         frame2.add(label);
@@ -101,7 +101,7 @@ public class TestAWT03GLCanvasRecreate01 extends UITestCase {
                     frame1.dispose();
                     frame2.dispose();
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
@@ -121,7 +121,7 @@ public class TestAWT03GLCanvasRecreate01 extends UITestCase {
                     frame.add(glCanvas);
                     frame.validate();
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
@@ -135,7 +135,7 @@ public class TestAWT03GLCanvasRecreate01 extends UITestCase {
                     frame.add(label);
                     frame.validate();
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
@@ -147,7 +147,7 @@ public class TestAWT03GLCanvasRecreate01 extends UITestCase {
                 public void run() {
                     frame.setVisible(v);
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
@@ -175,7 +175,7 @@ public class TestAWT03GLCanvasRecreate01 extends UITestCase {
         Thread.sleep(durationPerTest/4);
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java
index 00e14b0..8fbe680 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug460GLCanvasNPEAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.awt;
 
 import javax.media.opengl.GLCapabilities;
@@ -40,18 +40,18 @@ import org.junit.runners.MethodSorters;
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestBug460GLCanvasNPEAWT {
 
-    public static void main(String[] args) {
-        TestBug460GLCanvasNPEAWT instance = new TestBug460GLCanvasNPEAWT();
+    public static void main(final String[] args) {
+        final TestBug460GLCanvasNPEAWT instance = new TestBug460GLCanvasNPEAWT();
         instance.testIncompleteGLCanvasNPE();
     }
 
     @Test
     public void testIncompleteGLCanvasNPE() {
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
-        GLCanvas glc = new GLCanvas(caps);
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCanvas glc = new GLCanvas(caps);
         // GLDrawableFactory factory = glc.getFactory(); // null ok: not realized
         // GLCapabilitiesImmutable glci = glc.getChosenGLCapabilities(); -> NPE ok: .. not realized
-        GLCapabilitiesImmutable glCapsRequested = glc.getRequestedGLCapabilities();
+        final GLCapabilitiesImmutable glCapsRequested = glc.getRequestedGLCapabilities();
         System.out.println("ReqCaps: "+glCapsRequested);
         System.out.println("GLCanvas: "+glc);
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461FBOSupersamplingSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461FBOSupersamplingSwingAWT.java
index 96ec8ab..c85c746 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461FBOSupersamplingSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461FBOSupersamplingSwingAWT.java
@@ -57,7 +57,7 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.util.awt.AWTGLReadBufferUtil;
 
 /**
- * Tests for bug 461, a failure of GLDrawableFactory.createGLPbuffer() on Windows
+ * Tests for bug 461, a failure of GLDrawableFactory.createOffscreenAutoDrawable(..) on Windows
  * when the stencil buffer is turned on.
  *
  * @author Wade Walker (from code sample provided by Owen Dimond)
@@ -69,8 +69,8 @@ public class TestBug461FBOSupersamplingSwingAWT extends UITestCase implements GL
     GLOffscreenAutoDrawable offScreenBuffer;
     AWTGLReadBufferUtil awtGLReadBufferUtil;
 
-    private void render(GLAutoDrawable drawable) {
-        GL2 gl = drawable.getGL().getGL2();
+    private void render(final GLAutoDrawable drawable) {
+        final GL2 gl = drawable.getGL().getGL2();
         Assert.assertNotNull(gl);
         gl.glClear(GL.GL_COLOR_BUFFER_BIT);
 
@@ -86,37 +86,36 @@ public class TestBug461FBOSupersamplingSwingAWT extends UITestCase implements GL
     }
 
     /* @Override */
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         awtGLReadBufferUtil = new AWTGLReadBufferUtil(drawable.getGLProfile(), false);
     }
 
     /* @Override */
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
     }
 
     /* @Override */
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         render(offScreenBuffer);
-        // BufferedImage outputImage = com.jogamp.opengl.util.awt.Screenshot.readToBufferedImage(200, 200, false);
-        BufferedImage outputImage = awtGLReadBufferUtil.readPixelsToBufferedImage(drawable.getGL(), 0, 0, 200, 200, true /* awtOrientation */);
+        final BufferedImage outputImage = awtGLReadBufferUtil.readPixelsToBufferedImage(drawable.getGL(), 0, 0, 200, 200, true /* awtOrientation */);
         Assert.assertNotNull(outputImage);
-        ImageIcon imageIcon = new ImageIcon(outputImage);
+        final ImageIcon imageIcon = new ImageIcon(outputImage);
         final JLabel imageLabel = new JLabel(imageIcon);
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
-                    Container cont = jframe.getContentPane();
+                    final Container cont = jframe.getContentPane();
                     cont.removeAll();
                     cont.add(imageLabel);
                     cont.validate();
                 }});
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
         }
     }
 
     /* @Override */
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         try {
             awtGLReadBufferUtil.dispose(drawable.getGL());
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -124,7 +123,7 @@ public class TestBug461FBOSupersamplingSwingAWT extends UITestCase implements GL
                     jframe.setVisible(false);
                     jframe.dispose();
                 }});
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
         }
     }
@@ -134,25 +133,24 @@ public class TestBug461FBOSupersamplingSwingAWT extends UITestCase implements GL
         jframe = new JFrame("Offscreen Supersampling");
         Assert.assertNotNull(jframe);
         jframe.addWindowListener(new WindowAdapter() {
-            public void windowClosing(WindowEvent e) {
+            public void windowClosing(final WindowEvent e) {
                 System.exit(0);
             }
         });
 
-        GLProfile glp = GLProfile.get(GLProfile.GL2);
+        final GLProfile glp = GLProfile.get(GLProfile.GL2);
         Assert.assertNotNull(glp);
 
-        GLDrawableFactory fac = GLDrawableFactory.getFactory(glp);
+        final GLDrawableFactory fac = GLDrawableFactory.getFactory(glp);
         Assert.assertNotNull(fac);
 
-        Assert.assertTrue( fac.canCreateGLPbuffer(GLProfile.getDefaultDevice(), glp) );
-
-        GLCapabilities glCap = new GLCapabilities(glp);
+        final GLCapabilities glCap = new GLCapabilities(glp);
         Assert.assertNotNull(glCap);
 
         // COMMENTING OUT THIS LINE FIXES THE ISSUE.
         // Setting this in JOGL1 works. Thus this is a JOGL2 issue.
         glCap.setSampleBuffers(true);
+        glCap.setNumSamples(4);
 
         // Without line below, there is an error on Windows.
         // glCap.setDoubleBuffered(false); // implicit double buffer -> MSAA + FBO
@@ -177,7 +175,7 @@ public class TestBug461FBOSupersamplingSwingAWT extends UITestCase implements GL
         offScreenBuffer.destroy();
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461PBufferSupersamplingSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461PBufferSupersamplingSwingAWT.java
index a1abbe2..85bf2ce 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461PBufferSupersamplingSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug461PBufferSupersamplingSwingAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -30,7 +30,6 @@ package com.jogamp.opengl.test.junit.jogl.awt;
 
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
- 
 import java.awt.image.BufferedImage;
 import java.lang.reflect.InvocationTargetException;
 
@@ -40,7 +39,7 @@ import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLDrawableFactory;
 import javax.media.opengl.GLEventListener;
-import javax.media.opengl.GLPbuffer;
+import javax.media.opengl.GLOffscreenAutoDrawable;
 import javax.media.opengl.GLProfile;
 import javax.swing.ImageIcon;
 import javax.swing.JFrame;
@@ -52,23 +51,24 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.util.awt.AWTGLReadBufferUtil;
 
 /**
- * Tests for bug 461, a failure of GLDrawableFactory.createGLPbuffer() on Windows
+ * Tests for bug 461, a failure of PBuffer GLDrawableFactory.createOffscreenAutoDrawable(..) on Windows
  * when the stencil buffer is turned on.
  *
- * @author Wade Walker (from code sample provided by Owen Dimond)
+ * @author Wade Walker (from code sample provided by Owen Dimond), et al.
  */
- at SuppressWarnings("deprecation")
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestBug461PBufferSupersamplingSwingAWT extends UITestCase implements GLEventListener {
     JFrame jframe;
-    GLPbuffer offScreenBuffer;
-    
-    private void render(GLAutoDrawable drawable) {
-        GL2 gl = drawable.getGL().getGL2();
+    GLOffscreenAutoDrawable offScreenBuffer;
+    AWTGLReadBufferUtil screenshot;
+
+    private void render(final GLAutoDrawable drawable) {
+        final GL2 gl = drawable.getGL().getGL2();
         Assert.assertNotNull(gl);
-        gl.glClear(GL.GL_COLOR_BUFFER_BIT);      
+        gl.glClear(GL.GL_COLOR_BUFFER_BIT);
 
         // draw a triangle filling the window
         gl.glBegin(GL.GL_TRIANGLES);
@@ -80,73 +80,84 @@ public class TestBug461PBufferSupersamplingSwingAWT extends UITestCase implement
         gl.glVertex2d(1, -1);
         gl.glEnd();
     }
-    
+
     /* @Override */
-    public void init(GLAutoDrawable drawable) {                        
+    public void init(final GLAutoDrawable drawable) {
+        screenshot = new AWTGLReadBufferUtil(drawable.getGLProfile(), false);
     }
 
     /* @Override */
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-    }    
-    
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+    }
+
     /* @Override */
-    public void display(GLAutoDrawable drawable) {             
+    public void display(final GLAutoDrawable drawable) {
         render(offScreenBuffer);
-        BufferedImage outputImage = com.jogamp.opengl.util.awt.Screenshot.readToBufferedImage(200, 200, false);        
+        final BufferedImage outputImage = screenshot.readPixelsToBufferedImage(drawable.getGL(), 0, 0, 200, 200, true /* awtOrientation */);
         Assert.assertNotNull(outputImage);
-        ImageIcon imageIcon = new ImageIcon(outputImage);
-        JLabel imageLabel = new JLabel(imageIcon);        
+        final ImageIcon imageIcon = new ImageIcon(outputImage);
+        final JLabel imageLabel = new JLabel(imageIcon);
         jframe.getContentPane().add(imageLabel);
     }
 
     /* @Override */
-    public void dispose(GLAutoDrawable drawable) {  
+    public void dispose(final GLAutoDrawable drawable) {
+        screenshot.dispose(drawable.getGL());
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     jframe.setVisible(false);
                     jframe.dispose();
                 }});
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
         }
     }
 
     @Test
-    public void testOffscreenSupersampling() throws InterruptedException, InvocationTargetException {
+    public void test01DefaultOffscreenSupersampling() throws InterruptedException, InvocationTargetException {
+        final GLProfile glp = GLProfile.get(GLProfile.GL2);
+        Assert.assertNotNull(glp);
+        final GLCapabilities glCap = new GLCapabilities(glp);
+        test(glCap);
+    }
+
+    @Test
+    public void test02PBufferOffscreenSupersampling() throws InterruptedException, InvocationTargetException {
+        final GLProfile glp = GLProfile.get(GLProfile.GL2);
+        Assert.assertNotNull(glp);
+        final GLCapabilities glCap = new GLCapabilities(glp);
+        glCap.setPBuffer(true);
+        test(glCap);
+    }
+
+    void test(final GLCapabilities glCap) throws InterruptedException, InvocationTargetException {
         jframe = new JFrame("Offscreen Supersampling");
         Assert.assertNotNull(jframe);
         jframe.setSize( 300, 300);
         jframe.addWindowListener(new WindowAdapter() {
-            public void windowClosing(WindowEvent e) {
+            public void windowClosing(final WindowEvent e) {
                 System.exit(0);
             }
         });
 
-        GLProfile glp = GLProfile.get(GLProfile.GL2);
-        Assert.assertNotNull(glp);
-        
-        GLDrawableFactory fac = GLDrawableFactory.getFactory(glp);
+        final GLDrawableFactory fac = GLDrawableFactory.getFactory(glCap.getGLProfile());
         Assert.assertNotNull(fac);
-        
-        Assert.assertTrue( fac.canCreateGLPbuffer(GLProfile.getDefaultDevice(), glp) );
-        
-        GLCapabilities glCap = new GLCapabilities(glp);
-        Assert.assertNotNull(glCap);
-        
-        // COMMENTING OUT THIS LINE FIXES THE ISSUE. 
+
+        // COMMENTING OUT THIS LINE FIXES THE ISSUE.
         // Setting this in JOGL1 works. Thus this is a JOGL2 issue.
         glCap.setSampleBuffers(true);
-      
+        glCap.setNumSamples(4);
+
         // Without line below, there is an error on Windows.
         glCap.setDoubleBuffered(false);
         // Needed for drop shadows
         glCap.setStencilBits(1);
 
         //makes a new buffer
-        offScreenBuffer = fac.createGLPbuffer(GLProfile.getDefaultDevice(), glCap, null, 200, 200, null);
+        offScreenBuffer = fac.createOffscreenAutoDrawable(null, glCap, null, 200, 200);
         Assert.assertNotNull(offScreenBuffer);
-        offScreenBuffer.addGLEventListener(this);        
+        offScreenBuffer.addGLEventListener(this);
         offScreenBuffer.display();
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
@@ -155,7 +166,7 @@ public class TestBug461PBufferSupersamplingSwingAWT extends UITestCase implement
         offScreenBuffer.destroy();
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestBug461PBufferSupersamplingSwingAWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug551AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug551AWT.java
index 51eb222..8b99343 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug551AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug551AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.awt;
 
 import java.lang.reflect.InvocationTargetException;
@@ -61,35 +61,35 @@ public class TestBug551AWT extends UITestCase {
 
     static void checkGraphicsEnvironment() {
         Rectangle virtualBounds = new Rectangle();
-        GraphicsEnvironment ge =GraphicsEnvironment.getLocalGraphicsEnvironment();
-        GraphicsDevice[] gs = ge.getScreenDevices();
+        final GraphicsEnvironment ge =GraphicsEnvironment.getLocalGraphicsEnvironment();
+        final GraphicsDevice[] gs = ge.getScreenDevices();
 
-        //write graphics devices to log 
+        //write graphics devices to log
         System.err.println("number of graphics devices " + gs.length);
         for(int i =0 ; i < gs.length; i++) {
             System.err.println(gs[i].toString());
         }
 
         //check for bounds
-        for (int j = 0; j < gs.length; j++) { 
-            GraphicsDevice gd = gs[j];
-            GraphicsConfiguration[] gc = gd.getConfigurations();
+        for (int j = 0; j < gs.length; j++) {
+            final GraphicsDevice gd = gs[j];
+            final GraphicsConfiguration[] gc = gd.getConfigurations();
             for (int i=0; i < gc.length; i++) {
                 System.err.println("graphics configuration for device " + j + " is: " + gc[i].getBounds());
                 virtualBounds = virtualBounds.union(gc[i].getBounds());
-            }            
+            }
         }
 
     }
-    
+
     protected void runTestGL() throws InterruptedException, InvocationTargetException {
         final Window window = new JFrame(this.getSimpleTestName(" - "));
         final GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
-        
+
         // final array as mutable container hack
         final GLCanvas[] glCanvas = new GLCanvas[1];
 
-        Runnable test = new Runnable() {
+        final Runnable test = new Runnable() {
             public void run() {
                 glCanvas[0] = new GLCanvas(caps);
                 glCanvas[0].addGLEventListener(new GearsES2());
@@ -106,13 +106,13 @@ public class TestBug551AWT extends UITestCase {
             }
         };
 
-        Runnable cleanup = new Runnable() {
+        final Runnable cleanup = new Runnable() {
             public void run() {
                 System.out.println("cleaning up...");
                 window.setVisible(false);
                 try {
                     window.removeAll();
-                } catch (Throwable t) {
+                } catch (final Throwable t) {
                     assumeNoException(t);
                     t.printStackTrace();
                 }
@@ -124,7 +124,7 @@ public class TestBug551AWT extends UITestCase {
         // AWT / Swing on EDT..
         invokeAndWait(test);
 
-        Animator animator = new Animator(glCanvas[0]);
+        final Animator animator = new Animator(glCanvas[0]);
         animator.start();
         Thread.sleep(1000);
         animator.stop();
@@ -144,7 +144,7 @@ public class TestBug551AWT extends UITestCase {
         runTestGL();
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestBug551AWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug572AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug572AWT.java
index 2343360..5fb4433 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug572AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug572AWT.java
@@ -58,7 +58,7 @@ public class TestBug572AWT extends UITestCase {
      static class Cleanup implements Runnable {
         Window window;
 
-        public Cleanup(Window w) {
+        public Cleanup(final Window w) {
             window = w;
         }
 
@@ -67,7 +67,7 @@ public class TestBug572AWT extends UITestCase {
             window.setVisible(false);
             try {
                 window.removeAll();
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 Assume.assumeNoException(t);
                 t.printStackTrace();
             }
@@ -95,7 +95,7 @@ public class TestBug572AWT extends UITestCase {
                     window.setSize(512, 512);
                     window.validate();
                 } else {
-                    Dimension size = new Dimension(512, 512);
+                    final Dimension size = new Dimension(512, 512);
                     glCanvas.setPreferredSize(size);
                     glCanvas.setMinimumSize(size);
                     window.pack();
@@ -164,7 +164,7 @@ public class TestBug572AWT extends UITestCase {
         testRealizeGLCanvas(false, false);
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestBug572AWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug611AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug611AWT.java
index d8e781d..e64df66 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug611AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug611AWT.java
@@ -15,25 +15,25 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 
 /**
  * As reported in Bug 611, on Windows XP is a performance issue:
- * After JOGL initialization there seems to be a huge time lag 
+ * After JOGL initialization there seems to be a huge time lag
  * when trying to open the Desktop folder.
  * <p>
  * Test disabled since showing the Desktop folder will
- * disturb the 'desktop' .. if there is another way to show 
+ * disturb the 'desktop' .. if there is another way to show
  * the performance bug, pls do so.
  * </p>
  * <p>
  * Since Windows XP is out of life .. we may not care ..
- * </p> 
+ * </p>
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestBug611AWT extends UITestCase {
-    
+
     @Test
     public void test00() {
-        // make junit happy 
+        // make junit happy
     }
-    
+
     // @Test
     public void test01() {
         try {
@@ -46,17 +46,17 @@ public class TestBug611AWT extends UITestCase {
                 desktop = null;
             }
             if(null != desktop) {
-                String home = System.getProperty("user.home");
+                final String home = System.getProperty("user.home");
                 File homeFolder = null;
                 if(null != home) {
                     {
-                        File tst = new File(home + "/Desktop");
+                        final File tst = new File(home + "/Desktop");
                         if( tst.canRead() ) {
                             homeFolder = tst;
                         }
                     }
                     if(null == homeFolder) {
-                        File tst = new File(home);
+                        final File tst = new File(home);
                         if( tst.canRead() ) {
                             homeFolder = tst;
                         }
@@ -73,12 +73,12 @@ public class TestBug611AWT extends UITestCase {
                     desktop.open(homeFolder);
                 }
             }
-        } catch(Exception ex) {
+        } catch(final Exception ex) {
             ex.printStackTrace();
         }
     }
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestBug611AWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug642JSplitPaneMixHwLw01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug642JSplitPaneMixHwLw01AWT.java
index 57210a9..fffffcb 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug642JSplitPaneMixHwLw01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug642JSplitPaneMixHwLw01AWT.java
@@ -37,7 +37,7 @@ import com.jogamp.opengl.util.FPSAnimator;
 
 /**
  * Documenting Bug 642 (related to Bug 586)
- * 
+ *
  * <p>
  * JSplitPane cannot mix hw/lw components, only if setting property '-Dsun.awt.disableMixing=true'.
  * </p>
@@ -47,62 +47,62 @@ import com.jogamp.opengl.util.FPSAnimator;
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestBug642JSplitPaneMixHwLw01AWT extends UITestCase {
     static long durationPerTest = 500;
-    
+
     static {
         // too late: use at cmd-line '-Dsun.awt.disableMixing=true' works
         // System.setProperty("sun.awt.disableMixing", "true");
     }
 
     /**
-     * Doesn't work either .. 
+     * Doesn't work either ..
      */
     @SuppressWarnings("serial")
     public static class TransparentJScrollPane extends JScrollPane {
 
-        public TransparentJScrollPane(Component view) {
+        public TransparentJScrollPane(final Component view) {
             super(view);
-    
+
             setOpaque(false);
-       
+
             try {
                 ReflectionUtil.callStaticMethod(
-                                            "com.sun.awt.AWTUtilities", "setComponentMixingCutoutShape", 
-                                            new Class<?>[] { Component.class, Shape.class }, 
-                                            new Object[] { this, new Rectangle() } , 
+                                            "com.sun.awt.AWTUtilities", "setComponentMixingCutoutShape",
+                                            new Class<?>[] { Component.class, Shape.class },
+                                            new Object[] { this, new Rectangle() } ,
                                             GraphicsConfiguration.class.getClassLoader());
                 System.err.println("com.sun.awt.AWTUtilities.setComponentMixingCutoutShape(..) passed");
-            } catch (RuntimeException re) {
+            } catch (final RuntimeException re) {
                 System.err.println("com.sun.awt.AWTUtilities.setComponentMixingCutoutShape(..) failed: "+re.getMessage());
             }
         }
-    
+
         @Override
-        public void setOpaque(boolean isOpaque) {
+        public void setOpaque(final boolean isOpaque) {
         }
     }
-    
-    protected void runTestGL(GLCapabilities caps, boolean useGLJPanel, boolean useContainer) throws InterruptedException {
+
+    protected void runTestGL(final GLCapabilities caps, final boolean useGLJPanel, final boolean useContainer) throws InterruptedException {
         final String typeS = useGLJPanel ? "LW" : "HW";
         final JFrame frame = new JFrame("Mix Hw/Lw Swing - Canvas "+typeS);
         Assert.assertNotNull(frame);
-        
+
         final Dimension f_sz = new Dimension(824,568);
         // final Dimension f_sz = new Dimension(600,400);
         // final Dimension glc_sz = new Dimension(500,600);
-        
+
         frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
-        
+
         final Component glComp;
         final GLAutoDrawable glad;
         if(useGLJPanel) {
             final GLJPanel glJPanel = new GLJPanel(new GLCapabilities(GLProfile.getDefault()));
-            Assert.assertNotNull(glJPanel);        
+            Assert.assertNotNull(glJPanel);
             glJPanel.addGLEventListener(new GearsES2());
             glComp = glJPanel;
             glad = glJPanel;
         } else {
             final GLCanvas glCanvas = new GLCanvas(new GLCapabilities(GLProfile.getDefault()));
-            Assert.assertNotNull(glCanvas);        
+            Assert.assertNotNull(glCanvas);
             glCanvas.addGLEventListener(new GearsES2());
             if( useContainer ) {
                 final Container cont = new Container();
@@ -114,20 +114,20 @@ public class TestBug642JSplitPaneMixHwLw01AWT extends UITestCase {
             }
             glad = glCanvas;
         }
-        
+
         final Container contentPane = frame.getContentPane();
-        
-        JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
+
+        final JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
         splitPane.setResizeWeight(0.5d);
         splitPane.setLeftComponent(glComp);
         // splitPane.setLeftComponent(new JPanel());
         // splitPane.setLeftComponent(new Canvas());
         splitPane.setRightComponent(new JPanel());
-        contentPane.add(splitPane, BorderLayout.CENTER);            
+        contentPane.add(splitPane, BorderLayout.CENTER);
 
         final GLAnimatorControl animator = useGLJPanel ? new FPSAnimator(glad, 60) : new Animator(glad);
         animator.start();
-        
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
@@ -137,7 +137,7 @@ public class TestBug642JSplitPaneMixHwLw01AWT extends UITestCase {
                     frame.setVisible(true);
                     // however, Hw/Lw mixing is still a problem ..
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
@@ -146,14 +146,14 @@ public class TestBug642JSplitPaneMixHwLw01AWT extends UITestCase {
         Thread.sleep(durationPerTest);
 
         animator.stop();
-        
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame.setVisible(false);
                     frame.dispose();
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
@@ -161,26 +161,26 @@ public class TestBug642JSplitPaneMixHwLw01AWT extends UITestCase {
 
     @Test
     public void test01JSplitPaneWithHwGLCanvasPlain() throws InterruptedException {
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, false, false);
     }
 
     @Test
     public void test02JSplitPaneWithHwGLCanvasContainer() throws InterruptedException {
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, false, true);
     }
-    
+
     @Test
     public void test03JSplitPaneWithLwGLJPanel() throws InterruptedException {
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, true, false);
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
@@ -189,11 +189,11 @@ public class TestBug642JSplitPaneMixHwLw01AWT extends UITestCase {
         /**
         BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         System.err.println("Press enter to continue");
-        System.err.println(stdin.readLine()); 
+        System.err.println(stdin.readLine());
         */
         System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestBug642JSplitPaneMixHwLw01AWT.class.getName();
+        final String tstname = TestBug642JSplitPaneMixHwLw01AWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
-    
+
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug664GLCanvasSetVisibleSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug664GLCanvasSetVisibleSwingAWT.java
index 2a0bbfe..36c1e11 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug664GLCanvasSetVisibleSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug664GLCanvasSetVisibleSwingAWT.java
@@ -44,6 +44,7 @@ import javax.media.opengl.awt.GLCanvas;
 import javax.swing.JFrame;
 import javax.swing.JPanel;
 import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
 
 import jogamp.nativewindow.jawt.JAWTUtil;
 
@@ -95,7 +96,7 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase {
 
                     final JFrame jFrame1 = new JFrame("JFrame #"+num);
                     // jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-                    jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+                    jFrame1.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
                     jFrame1.getContentPane().add(jPanel[0]);
                     jFrame1.setSize(width, height);
 
@@ -147,33 +148,33 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase {
 
     private volatile int frameCount = 0;
 
-    protected void runTestGL(boolean onscreen, GLCapabilities caps)
+    protected void runTestGL(final boolean onscreen, final GLCapabilities caps)
             throws AWTException, InterruptedException, InvocationTargetException
     {
 
         for(int i=0; i<1; i++) {
-            Animator anim = new Animator();
+            final Animator anim = new Animator();
             final GLCanvas glc = new GLCanvas(caps);
             Assert.assertNotNull(glc);
             anim.add(glc);
             if( !onscreen ) {
                 glc.setShallUseOffscreenLayer(true);
             }
-            Dimension glc_sz = new Dimension(width, height);
+            final Dimension glc_sz = new Dimension(width, height);
             glc.setMinimumSize(glc_sz);
             glc.setPreferredSize(glc_sz);
             glc.setSize(glc_sz);
             glc.addGLEventListener(new GLEventListener() {
                 @Override
-                public void init(GLAutoDrawable drawable) {}
+                public void init(final GLAutoDrawable drawable) {}
                 @Override
-                public void dispose(GLAutoDrawable drawable) {}
+                public void dispose(final GLAutoDrawable drawable) {}
                 @Override
-                public void display(GLAutoDrawable drawable) {
+                public void display(final GLAutoDrawable drawable) {
                     frameCount++;
                 }
                 @Override
-                public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+                public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
             });
             final GearsES2 gears = new GearsES2(1);
             gears.setVerbose(false);
@@ -235,7 +236,7 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase {
             System.err.println("Offscreen test requested or platform requires it.");
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         if(shallUseOffscreenPBufferLayer) {
             caps.setPBuffer(true);
             caps.setOnscreen(true); // simulate normal behavior ..
@@ -251,7 +252,7 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase {
             System.err.println("Platform doesn't support offscreen test.");
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         if(shallUseOffscreenPBufferLayer) {
             caps.setPBuffer(true);
             caps.setOnscreen(true); // simulate normal behavior ..
@@ -259,13 +260,13 @@ public class TestBug664GLCanvasSetVisibleSwingAWT extends UITestCase {
         runTestGL(false, caps);
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     durationPerTest = Long.parseLong(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             } else if(args[i].equals("-layeredFBO")) {
                 shallUseOffscreenFBOLayer = true;
             } else if(args[i].equals("-layeredPBuffer")) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug675BeansInDesignTimeAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug675BeansInDesignTimeAWT.java
index 3363fdd..12ebe88 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug675BeansInDesignTimeAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug675BeansInDesignTimeAWT.java
@@ -97,7 +97,7 @@ public class TestBug675BeansInDesignTimeAWT extends UITestCase {
         } );
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816GLCanvasFrameHoppingB849B889AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816GLCanvasFrameHoppingB849B889AWT.java
index 51d00a5..f169a27 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816GLCanvasFrameHoppingB849B889AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816GLCanvasFrameHoppingB849B889AWT.java
@@ -95,17 +95,17 @@ public class TestBug816GLCanvasFrameHoppingB849B889AWT extends UITestCase {
         frame2.setSize(640, 480);
         frame2.setLocation(800, 64);
 
-        GLProfile profile = GLProfile.get(GLProfile.GL2ES2);
-        GLCapabilities glCapabilities = new GLCapabilities(profile);
+        final GLProfile profile = GLProfile.get(GLProfile.GL2ES2);
+        final GLCapabilities glCapabilities = new GLCapabilities(profile);
         final GLCanvas glCanvas = new GLCanvas(glCapabilities);
         glCanvas.setSize(new java.awt.Dimension(640, 480));
         glCanvas.addGLEventListener(new GearsES2(1));
         panel1.add(glCanvas, BorderLayout.CENTER);
 
-        JButton bMoveP1toP2 = new JButton("Move to Panel2");
+        final JButton bMoveP1toP2 = new JButton("Move to Panel2");
         bMoveP1toP2.addActionListener(new ActionListener() {
             @Override
-            public void actionPerformed(java.awt.event.ActionEvent evt) {
+            public void actionPerformed(final java.awt.event.ActionEvent evt) {
                 System.err.println("XXXX Move P1 -> P2 - START");
                 dumpGLCanvasStats(glCanvas);
                 panel2.add(glCanvas, BorderLayout.CENTER);
@@ -123,10 +123,10 @@ public class TestBug816GLCanvasFrameHoppingB849B889AWT extends UITestCase {
         });
         panel1.add(bMoveP1toP2, BorderLayout.NORTH);
 
-        JButton bMoveP2toP1 = new JButton("Move to Panel1");
+        final JButton bMoveP2toP1 = new JButton("Move to Panel1");
         bMoveP2toP1.addActionListener(new ActionListener() {
             @Override
-            public void actionPerformed(ActionEvent e) {
+            public void actionPerformed(final ActionEvent e) {
                 System.err.println("XXXX Move P2 -> P1 - START");
                 dumpGLCanvasStats(glCanvas);
                 panel1.add(glCanvas, BorderLayout.CENTER);
@@ -241,14 +241,14 @@ public class TestBug816GLCanvasFrameHoppingB849B889AWT extends UITestCase {
             } });
     }
 
-    private static String id(Object obj) { return "0x"+Integer.toHexString(obj.hashCode()); }
+    private static String id(final Object obj) { return "0x"+Integer.toHexString(obj.hashCode()); }
 
-    static void dumpGLCanvasStats(GLCanvas glCanvas) {
+    static void dumpGLCanvasStats(final GLCanvas glCanvas) {
         System.err.println("XXXX GLCanvas: comp "+glCanvas+", visible "+glCanvas.isVisible()+", showing "+glCanvas.isShowing()+
-                ", displayable "+glCanvas.isDisplayable()+", "+glCanvas.getWidth()+"x"+glCanvas.getHeight());
+                ", displayable "+glCanvas.isDisplayable()+", "+glCanvas.getSurfaceWidth()+"x"+glCanvas.getSurfaceHeight());
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java
index 84af232..efb7119 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816JTabbedPanelVisibilityB849B878AWT.java
@@ -78,8 +78,8 @@ public class TestBug816JTabbedPanelVisibilityB849B878AWT extends UITestCase {
         panel1.setLayout(new BorderLayout());
         panel2.setLayout(new BorderLayout());
 
-        GLProfile profile = GLProfile.get(GLProfile.GL2ES2);
-        GLCapabilities glCapabilities = new GLCapabilities(profile);
+        final GLProfile profile = GLProfile.get(GLProfile.GL2ES2);
+        final GLCapabilities glCapabilities = new GLCapabilities(profile);
         final GLCanvas glCanvas = new GLCanvas(glCapabilities);
         glCanvas.setSize(new java.awt.Dimension(640, 480));
         glCanvas.addGLEventListener(new GearsES2(1));
@@ -93,7 +93,7 @@ public class TestBug816JTabbedPanelVisibilityB849B878AWT extends UITestCase {
 
         tabbedPanel.addChangeListener(new javax.swing.event.ChangeListener() {
             @Override
-            public void stateChanged(javax.swing.event.ChangeEvent evt) {
+            public void stateChanged(final javax.swing.event.ChangeEvent evt) {
                 if (tabbedPanel.getSelectedIndex() == 0) {
                     System.err.println("XXXX Add GLCanvas Panel2("+id(panel2)+" -> Panel1("+id(panel1)+") START");
                     dumpGLCanvasStats(glCanvas);
@@ -174,14 +174,14 @@ public class TestBug816JTabbedPanelVisibilityB849B878AWT extends UITestCase {
             } });
     }
 
-    private static String id(Object obj) { return "0x"+Integer.toHexString(obj.hashCode()); }
+    private static String id(final Object obj) { return "0x"+Integer.toHexString(obj.hashCode()); }
 
-    static void dumpGLCanvasStats(GLCanvas glCanvas) {
+    static void dumpGLCanvasStats(final GLCanvas glCanvas) {
         System.err.println("XXXX GLCanvas: comp "+glCanvas+", visible "+glCanvas.isVisible()+", showing "+glCanvas.isShowing()+
-                ", displayable "+glCanvas.isDisplayable()+", "+glCanvas.getWidth()+"x"+glCanvas.getHeight());
+                ", displayable "+glCanvas.isDisplayable()+", "+glCanvas.getSurfaceWidth()+"x"+glCanvas.getSurfaceHeight());
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos01AWT.java
index ace578e..83cde8f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos01AWT.java
@@ -101,7 +101,7 @@ public class TestBug816OSXCALayerPos01AWT extends UITestCase {
                         frame.pack();
                     }
                 } } );
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -115,13 +115,13 @@ public class TestBug816OSXCALayerPos01AWT extends UITestCase {
                         frame.validate();
                     }
                 } } );
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
     }
 
-    protected void runTestGL(GLCapabilities caps, FrameLayout frameLayout, final boolean twoCanvas, final boolean resizeByComp) throws InterruptedException, InvocationTargetException {
+    protected void runTestGL(final GLCapabilities caps, final FrameLayout frameLayout, final boolean twoCanvas, final boolean resizeByComp) throws InterruptedException, InvocationTargetException {
         final JFrame frame = new JFrame("Bug816: "+this.getTestMethodName());
         Assert.assertNotNull(frame);
         final Container framePane = frame.getContentPane();
@@ -191,33 +191,33 @@ public class TestBug816OSXCALayerPos01AWT extends UITestCase {
                 }
                 break;
             case Split: {
-                    Dimension sbDim = new Dimension(16, 16);
-                    JScrollPane vsp = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+                    final Dimension sbDim = new Dimension(16, 16);
+                    final JScrollPane vsp = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
                     {
-                        JScrollBar vsb = vsp.getVerticalScrollBar();
+                        final JScrollBar vsb = vsp.getVerticalScrollBar();
                         vsb.setPreferredSize(sbDim);
-                        BoundedRangeModel model = vsb.getModel();
+                        final BoundedRangeModel model = vsb.getModel();
                         model.setMinimum(0);
                         model.setMaximum(100);
                         model.setValue(50);
                         model.setExtent(1);
                         vsb.setEnabled(true);
                     }
-                    JScrollPane hsp = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
+                    final JScrollPane hsp = new JScrollPane(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
                     {
-                        JScrollBar hsb = hsp.getHorizontalScrollBar();
+                        final JScrollBar hsb = hsp.getHorizontalScrollBar();
                         hsb.setPreferredSize(sbDim);
-                        BoundedRangeModel model = hsb.getModel();
+                        final BoundedRangeModel model = hsb.getModel();
                         model.setMinimum(0);
                         model.setMaximum(100);
                         model.setValue(50);
                         model.setExtent(1);
                         hsb.setEnabled(true);
                     }
-                    JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true,
+                    final JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true,
                             twoCanvas ? glCanvas2 : vsp, glCanvas1 );
                     horizontalSplitPane.setResizeWeight(0.5);
-                    JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
+                    final JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
                         true, horizontalSplitPane, hsp);
                     verticalSplitPane.setResizeWeight(0.5);
                     framePane.add(verticalSplitPane);
@@ -236,9 +236,8 @@ public class TestBug816OSXCALayerPos01AWT extends UITestCase {
         if( twoCanvas ) {
             animator.add(glCanvas2);
         }
-        QuitAdapter quitAdapter = new QuitAdapter();
-
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glCanvas1).addTo(frame);
 
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
@@ -259,9 +258,9 @@ public class TestBug816OSXCALayerPos01AWT extends UITestCase {
         Assert.assertTrue(animator.isStarted());
         Assert.assertTrue(animator.isAnimating());
 
-        System.err.println("canvas1 pos/siz: "+glCanvas1.getX()+"/"+glCanvas1.getY()+" "+glCanvas1.getWidth()+"x"+glCanvas1.getHeight());
+        System.err.println("canvas1 pos/siz: "+glCanvas1.getX()+"/"+glCanvas1.getY()+" "+glCanvas1.getSurfaceWidth()+"x"+glCanvas1.getSurfaceHeight());
         if( twoCanvas ) {
-            System.err.println("canvas2 pos/siz: "+glCanvas2.getX()+"/"+glCanvas2.getY()+" "+glCanvas2.getWidth()+"x"+glCanvas2.getHeight());
+            System.err.println("canvas2 pos/siz: "+glCanvas2.getX()+"/"+glCanvas2.getY()+" "+glCanvas2.getSurfaceWidth()+"x"+glCanvas2.getSurfaceHeight());
         }
 
         Thread.sleep(Math.max(1000, duration/2));
@@ -273,9 +272,9 @@ public class TestBug816OSXCALayerPos01AWT extends UITestCase {
             } else {
                setFrameSize(frame, true, frameRSizeHalf);
             }
-            System.err.println("resize canvas1 pos/siz: "+glCanvas1.getX()+"/"+glCanvas1.getY()+" "+glCanvas1.getWidth()+"x"+glCanvas1.getHeight());
+            System.err.println("resize canvas1 pos/siz: "+glCanvas1.getX()+"/"+glCanvas1.getY()+" "+glCanvas1.getSurfaceWidth()+"x"+glCanvas1.getSurfaceHeight());
             if( twoCanvas ) {
-                System.err.println("resize canvas2 pos/siz: "+glCanvas2.getX()+"/"+glCanvas2.getY()+" "+glCanvas2.getWidth()+"x"+glCanvas2.getHeight());
+                System.err.println("resize canvas2 pos/siz: "+glCanvas2.getX()+"/"+glCanvas2.getY()+" "+glCanvas2.getSurfaceWidth()+"x"+glCanvas2.getSurfaceHeight());
             }
         }
 
@@ -446,7 +445,7 @@ public class TestBug816OSXCALayerPos01AWT extends UITestCase {
 
     static int testNum = -1;
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos02AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos02AWT.java
index df24fc6..fa9ea71 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos02AWT.java
@@ -80,19 +80,19 @@ public class TestBug816OSXCALayerPos02AWT extends UITestCase {
 
         final Animator animator = new Animator();
         animator.add(glCanvas1);
-        QuitAdapter quitAdapter = new QuitAdapter();
 
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glCanvas1).addTo(frame);
 
         // Build a GUI where the canvas 3D is located at top right of the frame
         // and can be resized with split panes dividers
-        JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
+        final JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
             true, new JScrollPane(), glCanvas1);
         verticalSplitPane.setResizeWeight(0.5);
-        JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
+        final JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
             true, new JScrollPane(), verticalSplitPane);
         horizontalSplitPane.setResizeWeight(0.5);
-        JRootPane intermediateRootPane = new JRootPane();
+        final JRootPane intermediateRootPane = new JRootPane();
         intermediateRootPane.setContentPane(horizontalSplitPane);
         frame.add(intermediateRootPane);
 
@@ -139,7 +139,7 @@ public class TestBug816OSXCALayerPos02AWT extends UITestCase {
         return GLProfile.getMaxProgrammableCore(true);
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03aB729AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03aB729AWT.java
index 29dc9a1..74d18ce 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03aB729AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03aB729AWT.java
@@ -87,14 +87,14 @@ public class TestBug816OSXCALayerPos03aB729AWT extends UITestCase {
 
         final Animator animator = new Animator();
         animator.add(glCanvas1);
-        QuitAdapter quitAdapter = new QuitAdapter();
 
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glCanvas1).addTo(frame);
 
         // Create a check box that hides / shows canvas
         final Checkbox checkbox = new Checkbox("Visible canvas", true);
         checkbox.addItemListener(new ItemListener() {
-            public void itemStateChanged(ItemEvent ev) {
+            public void itemStateChanged(final ItemEvent ev) {
                 final boolean visible = checkbox.getState();
                 System.err.println("XXXX Canvas setVisible "+visible);
                 glCanvas1.setVisible(visible);
@@ -153,7 +153,7 @@ public class TestBug816OSXCALayerPos03aB729AWT extends UITestCase {
         return GLProfile.getMaxProgrammableCore(true);
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03bB849AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03bB849AWT.java
index 3e60c8b..9a9a7fc 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03bB849AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03bB849AWT.java
@@ -93,14 +93,14 @@ public class TestBug816OSXCALayerPos03bB849AWT extends UITestCase {
 
         final Animator animator = new Animator();
         animator.add(glCanvas1);
-        QuitAdapter quitAdapter = new QuitAdapter();
 
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glCanvas1).addTo(frame);
 
         // Create a check box that hides / shows canvas
         final Checkbox checkbox = new Checkbox("Visible canvas", true);
         checkbox.addItemListener(new ItemListener() {
-            public void itemStateChanged(ItemEvent ev) {
+            public void itemStateChanged(final ItemEvent ev) {
                 final boolean visible = checkbox.getState();
                 System.err.println("XXXX Panel setVisible "+visible);
                 panel.setVisible(visible);
@@ -159,7 +159,7 @@ public class TestBug816OSXCALayerPos03bB849AWT extends UITestCase {
         return GLProfile.getMaxProgrammableCore(true);
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03cB849AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03cB849AWT.java
index 24f9de9..afdf6fb 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03cB849AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos03cB849AWT.java
@@ -95,14 +95,14 @@ public class TestBug816OSXCALayerPos03cB849AWT extends UITestCase {
 
         final Animator animator = new Animator();
         animator.add(glCanvas1);
-        QuitAdapter quitAdapter = new QuitAdapter();
 
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glCanvas1).addTo(frame);
 
         // Create a check box that hides / shows canvas
         final JCheckBox checkbox = new JCheckBox("Visible canvas", true);
         checkbox.addItemListener(new ItemListener() {
-            public void itemStateChanged(ItemEvent ev) {
+            public void itemStateChanged(final ItemEvent ev) {
                 final boolean visible = checkbox.getSelectedObjects()!=null;
                 System.err.println("XXXX Panel setVisible "+visible);
                 panel.setVisible(visible);
@@ -161,7 +161,7 @@ public class TestBug816OSXCALayerPos03cB849AWT extends UITestCase {
         return GLProfile.getMaxProgrammableCore(true);
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04aAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04aAWT.java
index b558b16..78fcbfe 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04aAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04aAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.awt;
 
 import java.awt.BorderLayout;
@@ -59,55 +59,55 @@ import com.jogamp.opengl.util.Animator;
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestBug816OSXCALayerPos04aAWT extends UITestCase {
-    static long duration = 1600; // ms    
+    static long duration = 1600; // ms
     static int width=640, height=480;
-    
+
     @Test
     public void test() throws InterruptedException, InvocationTargetException {
         final GLCapabilities caps = new GLCapabilities(getGLP());
-        
+
         final Frame frame = new Frame("TestBug816OSXCALayerPos04aAWT");
         Assert.assertNotNull(frame);
 
         final GLCanvas glCanvas1 = new GLCanvas(caps);
         Assert.assertNotNull(glCanvas1);
         glCanvas1.addGLEventListener(new GearsES2(1));
-        
+
         final Animator animator = new Animator();
         animator.add(glCanvas1);
-        QuitAdapter quitAdapter = new QuitAdapter();
-        
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glCanvas1).addTo(frame);
 
         // Display the canvas 3D in a dialog child of a frame
         frame.setSize(400, 400);
-        
+
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 frame.setLocation(100, 100);
                 frame.setSize(width, height);
                 frame.setVisible(true);
-            }});                
+            }});
         Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, true));
-        
+
         final Dialog dialog = new Dialog(frame, "Bug 816 AWT Top-Level Dialog");
         dialog.setLayout(new BorderLayout());
         dialog.add(glCanvas1, BorderLayout.CENTER);
-        
+
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 dialog.setLocation(200, 200);
                 dialog.setSize(width/2, height/2);
                 dialog.setVisible(true);
-            }});        
+            }});
         Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(dialog, true));
-        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glCanvas1, true)); 
-        
+        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glCanvas1, true));
+
         animator.start();
         Assert.assertTrue(animator.isStarted());
         Assert.assertTrue(animator.isAnimating());
         animator.setUpdateFPSFrames(60, System.err);
-        
+
         final long t0 = System.currentTimeMillis();
         long t1 = t0;
         while(!quitAdapter.shouldQuit() && t1 - t0 < duration) {
@@ -117,7 +117,7 @@ public class TestBug816OSXCALayerPos04aAWT extends UITestCase {
 
         Assert.assertNotNull(frame);
         Assert.assertNotNull(glCanvas1);
-        
+
         Assert.assertNotNull(animator);
         animator.stop();
         Assert.assertFalse(animator.isAnimating());
@@ -138,15 +138,15 @@ public class TestBug816OSXCALayerPos04aAWT extends UITestCase {
     static GLProfile getGLP() {
         return GLProfile.getMaxProgrammableCore(true);
     }
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 duration = MiscUtils.atol(args[i], duration);
             }
         }
-        
+
         org.junit.runner.JUnitCore.main(TestBug816OSXCALayerPos04aAWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04bAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04bAWT.java
index b502dbd..8f1917e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04bAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestBug816OSXCALayerPos04bAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.awt;
 
 import java.awt.BorderLayout;
@@ -59,55 +59,55 @@ import com.jogamp.opengl.util.Animator;
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestBug816OSXCALayerPos04bAWT extends UITestCase {
-    static long duration = 1600; // ms    
+    static long duration = 1600; // ms
     static int width=640, height=480;
-    
+
     @Test
     public void test() throws InterruptedException, InvocationTargetException {
         final GLCapabilities caps = new GLCapabilities(getGLP());
-        
+
         final JFrame frame = new JFrame("TestBug816OSXCALayerPos04bAWT");
         Assert.assertNotNull(frame);
 
         final GLCanvas glCanvas1 = new GLCanvas(caps);
         Assert.assertNotNull(glCanvas1);
         glCanvas1.addGLEventListener(new GearsES2(1));
-        
+
         final Animator animator = new Animator();
         animator.add(glCanvas1);
-        QuitAdapter quitAdapter = new QuitAdapter();
-        
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glCanvas1).addTo(frame);
 
         // Display the canvas 3D in a dialog child of a frame
         frame.setSize(400, 400);
-        
+
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 frame.setLocation(100, 100);
                 frame.setSize(width, height);
                 frame.setVisible(true);
-            }});        
+            }});
         Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, true));
-        
-        final JDialog dialog = new JDialog(frame, "Bug 816 AWT Top-Level JDialog");        
+
+        final JDialog dialog = new JDialog(frame, "Bug 816 AWT Top-Level JDialog");
         dialog.setLayout(new BorderLayout());
         dialog.add(glCanvas1, BorderLayout.CENTER);
-        
+
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 dialog.setLocation(200, 200);
                 dialog.setSize(width/2, height/2);
                 dialog.setVisible(true);
-            }});        
+            }});
         Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(dialog, true));
         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glCanvas1, true));
-        
+
         animator.start();
         Assert.assertTrue(animator.isStarted());
         Assert.assertTrue(animator.isAnimating());
         animator.setUpdateFPSFrames(60, System.err);
-        
+
         final long t0 = System.currentTimeMillis();
         long t1 = t0;
         while(!quitAdapter.shouldQuit() && t1 - t0 < duration) {
@@ -117,7 +117,7 @@ public class TestBug816OSXCALayerPos04bAWT extends UITestCase {
 
         Assert.assertNotNull(frame);
         Assert.assertNotNull(glCanvas1);
-        
+
         Assert.assertNotNull(animator);
         animator.stop();
         Assert.assertFalse(animator.isAnimating());
@@ -138,15 +138,15 @@ public class TestBug816OSXCALayerPos04bAWT extends UITestCase {
     static GLProfile getGLP() {
         return GLProfile.getMaxProgrammableCore(true);
     }
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 duration = MiscUtils.atol(args[i], duration);
             }
         }
-        
+
         org.junit.runner.JUnitCore.main(TestBug816OSXCALayerPos04bAWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock00AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock00AWT.java
index 4623046..edb489a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock00AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock00AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.awt;
 
 import javax.media.opengl.GLAutoDrawable;
@@ -59,100 +59,100 @@ public class TestGLCanvasAWTActionDeadlock00AWT extends UITestCase {
 
     GLEventListener gle1 = null;
     GLEventListener gle2 = null;
-    
+
     @Test
     public void test01Animator() throws InterruptedException {
         testImpl(new Animator(), 0, false);
     }
-    
+
     @Test
     public void test02FPSAnimator() throws InterruptedException {
         testImpl(new FPSAnimator(30), 0, false);
     }
-    
+
     @Test
     public void test02FPSAnimator_RestartOnAWTEDT() throws InterruptedException {
         testImpl(new FPSAnimator(30), 100, false);
     }
-    
+
     /** May crash due to invalid thread usage, i.e. non AWT-EDT
     @Test
     public void test02FPSAnimator_RestartOnCurrentThread() throws InterruptedException {
         testImpl(new FPSAnimator(30), 100, true);
     } */
-    
-    void testImpl(final AnimatorBase animator, int restartPeriod, boolean restartOnCurrentThread) throws InterruptedException {
+
+    void testImpl(final AnimatorBase animator, final int restartPeriod, final boolean restartOnCurrentThread) throws InterruptedException {
         final Frame frame1 = new Frame("Frame 1");
         gle1 = new GLEventListener() {
             @Override
-            public void init(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {
             }
 
             @Override
-            public void dispose(GLAutoDrawable drawable) {
+            public void dispose(final GLAutoDrawable drawable) {
             }
 
             @Override
-            public void display(GLAutoDrawable drawable) {
+            public void display(final GLAutoDrawable drawable) {
                 frame1.setTitle("f "+frameCount+", fps "+animator.getLastFPS());
                 frameCount++;
             }
 
             @Override
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-            }            
-        };        
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+            }
+        };
         gle2 = new GearsES2();
 
         Assert.assertNotNull(frame1);
         {
-            Insets insets = frame1.getInsets();
-            int w = width + insets.left + insets.right;
-            int h = height + insets.top + insets.bottom;
+            final Insets insets = frame1.getInsets();
+            final int w = width + insets.left + insets.right;
+            final int h = height + insets.top + insets.bottom;
             frame1.setSize(w, h);
         }
         frame1.setLocation(0, 0);
         frame1.setTitle("Generic Title");
-        
+
         GLCanvas glCanvas = createGLCanvas();
         glCanvas.addGLEventListener(gle1);
         glCanvas.addGLEventListener(gle2);
-        
+
         animator.setUpdateFPSFrames(60, System.err);
         animator.add(glCanvas);
         animator.start();
 
         attachGLCanvas(frame1, glCanvas, false);
-        
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame1.setVisible(true);
                 }});
-        } catch (Throwable t) { 
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
-        
+
         final long sleep = 0 < restartPeriod ? restartPeriod : 100;
         long togo = durationPerTest;
         while( 0 < togo ) {
             if(0 < restartPeriod) {
                 glCanvas = restart(frame1, glCanvas, restartOnCurrentThread);
             }
-            
+
             Thread.sleep(sleep);
-            
+
             togo -= sleep;
         }
-        
+
         dispose(frame1, glCanvas);
         animator.stop();
-        
-        gle1 = null;                
+
+        gle1 = null;
         gle2 = null;
     }
-    
+
     void dispose(final Frame frame, final GLCanvas glCanvas) {
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -160,32 +160,32 @@ public class TestGLCanvasAWTActionDeadlock00AWT extends UITestCase {
                     glCanvas.destroy();
                     frame.dispose();
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
     }
-        
-    GLCanvas restart(final Frame frame, GLCanvas glCanvas, boolean restartOnCurrentThread) throws InterruptedException {
+
+    GLCanvas restart(final Frame frame, GLCanvas glCanvas, final boolean restartOnCurrentThread) throws InterruptedException {
         glCanvas.disposeGLEventListener(gle1, true);
         glCanvas.disposeGLEventListener(gle2, true);
         detachGLCanvas(frame, glCanvas, restartOnCurrentThread);
-                    
+
         glCanvas = createGLCanvas();
-        
+
         attachGLCanvas(frame, glCanvas, restartOnCurrentThread);
         glCanvas.addGLEventListener(gle1);
         glCanvas.addGLEventListener(gle2);
-        
+
         return glCanvas;
     }
-    
-    void attachGLCanvas(final Frame frame, final GLCanvas glCanvas, boolean restartOnCurrentThread) {
+
+    void attachGLCanvas(final Frame frame, final GLCanvas glCanvas, final boolean restartOnCurrentThread) {
         System.err.println("*** attachGLCanvas.0 on-current-thread "+restartOnCurrentThread+", currentThread "+Thread.currentThread().getName());
         if( restartOnCurrentThread ) {
             frame.setLayout(new BorderLayout());
             frame.add(glCanvas, BorderLayout.CENTER);
-            frame.validate();            
+            frame.validate();
         } else {
             try {
                 javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -194,19 +194,19 @@ public class TestGLCanvasAWTActionDeadlock00AWT extends UITestCase {
                         frame.add(glCanvas, BorderLayout.CENTER);
                         frame.validate();
                     }});
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 t.printStackTrace();
                 Assume.assumeNoException(t);
             }
         }
         System.err.println("*** attachGLCanvas.X");
     }
-    
-    void detachGLCanvas(final Frame frame, final GLCanvas glCanvas, boolean restartOnCurrentThread) {
+
+    void detachGLCanvas(final Frame frame, final GLCanvas glCanvas, final boolean restartOnCurrentThread) {
         System.err.println("*** detachGLCanvas.0 on-current-thread "+restartOnCurrentThread+", currentThread "+Thread.currentThread().getName());
         if( restartOnCurrentThread ) {
             frame.remove(glCanvas);
-            frame.validate();            
+            frame.validate();
         } else {
             try {
                 javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -214,26 +214,26 @@ public class TestGLCanvasAWTActionDeadlock00AWT extends UITestCase {
                         frame.remove(glCanvas);
                         frame.validate();
                     }});
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 t.printStackTrace();
                 Assume.assumeNoException(t);
             }
         }
         System.err.println("*** detachGLCanvas.X");
     }
-    
+
     int frameCount = 0;
-    
+
     GLCanvas createGLCanvas() {
         System.err.println("*** createGLCanvas.0");
         final GLCanvas glCanvas = new GLCanvas();
         glCanvas.setBounds(0, 0, width, height);
         Assert.assertNotNull(glCanvas);
         System.err.println("*** createGLCanvas.X");
-        return glCanvas;        
+        return glCanvas;
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java
index ba06f91..5b605ff 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock01AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.awt;
 
 import javax.media.opengl.GLAutoDrawable;
@@ -61,9 +61,9 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 /**
- * BUG on OSX/CALayer w/ Java6: 
+ * BUG on OSX/CALayer w/ Java6:
  * If frame.setTitle() is issued right after initialization the call hangs in
- * <pre> 
+ * <pre>
  * at apple.awt.CWindow._setTitle(Native Method)
  *  at apple.awt.CWindow.setTitle(CWindow.java:765) [1.6.0_37, build 1.6.0_37-b06-434-11M3909]
  * </pre>
@@ -75,7 +75,7 @@ import org.junit.runners.MethodSorters;
  * e.g. setResizable*().
  * </p>
  * <p>
- * Users shall make sure all mutable AWT calls are performed on the EDT, even before 1st setVisible(true) ! 
+ * Users shall make sure all mutable AWT calls are performed on the EDT, even before 1st setVisible(true) !
  * </p>
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
@@ -86,30 +86,30 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
 
     GLEventListener gle1 = null;
     GLEventListener gle2 = null;
-    
+
     @Test
     public void test00NoAnimator() throws InterruptedException, InvocationTargetException {
         testImpl(null, 0, false);
     }
-    
+
     @Test
     public void test01Animator() throws InterruptedException, InvocationTargetException {
         testImpl(new Animator(), 0, false);
     }
-    
+
     @Test
     public void test02FPSAnimator() throws InterruptedException, InvocationTargetException {
         testImpl(new FPSAnimator(30), 0, false);
     }
-    
+
     @Test
     public void test02FPSAnimator_RestartOnAWTEDT() throws InterruptedException, InvocationTargetException {
         testImpl(new FPSAnimator(30), 200, false);
     }
-    
+
     /** May crash due to invalid thread usage, i.e. non AWT-EDT
-     * @throws InvocationTargetException 
-     * @throws InterruptedException 
+     * @throws InvocationTargetException
+     * @throws InterruptedException
     @Test
     public void test02FPSAnimator_RestartOnCurrentThread() throws InterruptedException {
         testImpl(new FPSAnimator(30), 200, true);
@@ -125,50 +125,50 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
                 frame.setTitle(msg);
             } } );
     }
-    
-    void testImpl(final AnimatorBase animator, int restartPeriod, boolean restartOnCurrentThread) throws InterruptedException, InvocationTargetException {
+
+    void testImpl(final AnimatorBase animator, final int restartPeriod, final boolean restartOnCurrentThread) throws InterruptedException, InvocationTargetException {
         final Frame frame1 = new Frame("Frame 1");
         final Applet applet1 = new Applet() {
-            private static final long serialVersionUID = 1L;            
+            private static final long serialVersionUID = 1L;
         };
-        
+
         final VersionNumber version170 = new VersionNumber(1, 7, 0);
-        final boolean osxCALayerAWTModBug = Platform.OSType.MACOS == Platform.getOSType() && 
+        final boolean osxCALayerAWTModBug = Platform.OSType.MACOS == Platform.getOSType() &&
                                             0 > Platform.getJavaVersionNumber().compareTo(version170);
         System.err.println("OSX CALayer AWT-Mod Bug "+osxCALayerAWTModBug);
         System.err.println("OSType "+Platform.getOSType());
         System.err.println("Java Version "+Platform.getJavaVersionNumber());
-        
+
         Assert.assertNotNull(frame1);
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 frame1.setLayout(null);
                 frame1.pack();
                 {
-                    Insets insets = frame1.getInsets();
-                    int w = width + insets.left + insets.right;
-                    int h = height + insets.top + insets.bottom;
+                    final Insets insets = frame1.getInsets();
+                    final int w = width + insets.left + insets.right;
+                    final int h = height + insets.top + insets.bottom;
                     frame1.setSize(w, h);
-                    
-                    int usableH = h - insets.top - insets.bottom;
-                    applet1.setBounds((w - width)/2, insets.top + (usableH - height)/2, width, height);      
+
+                    final int usableH = h - insets.top - insets.bottom;
+                    applet1.setBounds((w - width)/2, insets.top + (usableH - height)/2, width, height);
                 }
                 frame1.setLocation(0, 0);
                 frame1.setTitle("Generic Title");
                 frame1.add(applet1);
             }});
-                        
+
         frame1.addWindowListener(new WindowAdapter() {
-          public void windowClosing(WindowEvent e) {
+          public void windowClosing(final WindowEvent e) {
               dispose(frame1, applet1);
           }
-        });    
-        
+        });
+
         gle1 = new GLEventListener() {
             boolean justInitialized = true;
-            
+
             @Override
-            public void init(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {
                 justInitialized = true;
                 if( !osxCALayerAWTModBug ) {
                     System.err.println("*Init*: CT "+Thread.currentThread().getName());
@@ -178,13 +178,13 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
             }
 
             @Override
-            public void dispose(GLAutoDrawable drawable) {
+            public void dispose(final GLAutoDrawable drawable) {
                 System.err.println("*Dispose*: CT "+Thread.currentThread().getName());
                 setFrameTitle(frame1, "DISPOSE");
             }
 
             @Override
-            public void display(GLAutoDrawable drawable) {
+            public void display(final GLAutoDrawable drawable) {
                 if( !osxCALayerAWTModBug || !justInitialized ) {
                     System.err.println("*Display*: CT "+Thread.currentThread().getName());
                     setFrameTitle(frame1, "f "+frameCount+", fps "+( null != animator ? animator.getLastFPS() : 0));
@@ -195,19 +195,19 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
             }
 
             @Override
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
                 if( !osxCALayerAWTModBug || !justInitialized ) {
                     System.err.println("*Reshape*: CT "+Thread.currentThread().getName());
                     setFrameTitle(frame1, "RESHAPE");
                 }
-            }            
-        };        
+            }
+        };
         gle2 = new GearsES2();
 
         GLCanvas glCanvas = createGLCanvas();
         glCanvas.addGLEventListener(gle1);
         glCanvas.addGLEventListener(gle2);
-        
+
         if(null != animator) {
             System.err.println("About to start Animator: CT "+Thread.currentThread().getName());
             animator.setUpdateFPSFrames(60, System.err);
@@ -216,7 +216,7 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
         }
 
         attachGLCanvas(applet1, glCanvas, false);
-        
+
         System.err.println("About to setVisible.0 CT "+Thread.currentThread().getName());
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -225,12 +225,12 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
                     frame1.setVisible(true);
                     System.err.println("About to setVisible.1.X CT "+Thread.currentThread().getName());
                 }});
-        } catch (Throwable t) { 
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
         System.err.println("About to setVisible.X CT "+Thread.currentThread().getName());
-        
+
         final long sleep = 0 < restartPeriod ? restartPeriod : 100;
         long togo = durationPerTest;
         while( 0 < togo ) {
@@ -240,23 +240,23 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
             if(0 < restartPeriod) {
                 glCanvas = restart(applet1, glCanvas, restartOnCurrentThread);
             }
-            
+
             Thread.sleep(sleep);
-            
+
             togo -= sleep;
         }
-        
+
         dispose(frame1, applet1);
         if(null != animator) {
             animator.stop();
         }
-        
-        gle1 = null;                
+
+        gle1 = null;
         gle2 = null;
     }
-    
+
     int frameCount = 0;
-    
+
     GLCanvas createGLCanvas() {
         System.err.println("*** createGLCanvas.0");
         final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
@@ -268,7 +268,7 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
         Assert.assertNotNull(glCanvas);
         System.err.println("*** createGLCanvas.X");
         frameCount = 0;
-        return glCanvas;        
+        return glCanvas;
     }
 
     void dispose(final Frame frame, final Applet applet) {
@@ -278,27 +278,27 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
                     frame.remove(applet);
                     frame.dispose();
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
     }
-    
-    GLCanvas restart(final Applet applet, GLCanvas glCanvas, boolean restartOnCurrentThread) throws InterruptedException {
+
+    GLCanvas restart(final Applet applet, GLCanvas glCanvas, final boolean restartOnCurrentThread) throws InterruptedException {
         glCanvas.disposeGLEventListener(gle1, true);
         glCanvas.disposeGLEventListener(gle2, true);
         detachGLCanvas(applet, glCanvas, restartOnCurrentThread);
-                    
+
         glCanvas = createGLCanvas();
-        
+
         attachGLCanvas(applet, glCanvas, restartOnCurrentThread);
         glCanvas.addGLEventListener(gle1);
         glCanvas.addGLEventListener(gle2);
-        
+
         return glCanvas;
     }
-    
-    void attachGLCanvas(final Applet applet, final GLCanvas glCanvas, boolean restartOnCurrentThread) {
+
+    void attachGLCanvas(final Applet applet, final GLCanvas glCanvas, final boolean restartOnCurrentThread) {
         System.err.println("*** attachGLCanvas.0 on-current-thread "+restartOnCurrentThread+", currentThread "+Thread.currentThread().getName());
         if( restartOnCurrentThread ) {
             applet.setLayout(new BorderLayout());
@@ -312,15 +312,15 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
                         applet.add(glCanvas, BorderLayout.CENTER);
                         applet.validate();
                     }});
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 t.printStackTrace();
                 Assume.assumeNoException(t);
             }
         }
         System.err.println("*** attachGLCanvas.X");
     }
-    
-    void detachGLCanvas(final Applet applet, final GLCanvas glCanvas, boolean restartOnCurrentThread) {
+
+    void detachGLCanvas(final Applet applet, final GLCanvas glCanvas, final boolean restartOnCurrentThread) {
         System.err.println("*** detachGLCanvas.0 on-current-thread "+restartOnCurrentThread+", currentThread "+Thread.currentThread().getName());
         if( restartOnCurrentThread ) {
             applet.remove(glCanvas);
@@ -329,18 +329,18 @@ public class TestGLCanvasAWTActionDeadlock01AWT extends UITestCase {
             try {
                 javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                     public void run() {
-                        applet.remove(glCanvas);                        
+                        applet.remove(glCanvas);
                         applet.validate();
                     }});
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 t.printStackTrace();
                 Assume.assumeNoException(t);
             }
         }
         System.err.println("*** detachGLCanvas.X");
     }
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java
index 605f97f..596ada6 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLCanvasAWTActionDeadlock02AWT.java
@@ -202,14 +202,14 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
         height = 300;
         final MiniPApplet applet = this;
 
-        GraphicsEnvironment environment =
+        final GraphicsEnvironment environment =
           GraphicsEnvironment.getLocalGraphicsEnvironment();
-        GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
+        final GraphicsDevice displayDevice = environment.getDefaultScreenDevice();
         frame = new Frame(displayDevice.getDefaultConfiguration());
 
         final Rectangle fullScreenRect;
         if (fullScreen) {
-          DisplayMode mode = displayDevice.getDisplayMode();
+          final DisplayMode mode = displayDevice.getDisplayMode();
           fullScreenRect = new Rectangle(0, 0, mode.getWidth(), mode.getHeight());
         } else {
           fullScreenRect = null;
@@ -228,7 +228,7 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
                         frame.setBounds(fullScreenRect);
                         frame.setVisible(true);
                     }});
-            } catch (Throwable t) {
+            } catch (final Throwable t) {
                 t.printStackTrace();
                 Assume.assumeNoException(t);
             }
@@ -251,21 +251,21 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
                                        (fullScreenRect.height - applet.height) / 2,
                                        applet.width, applet.height);
                     } else {
-                      Insets insets = frame.getInsets();
+                      final Insets insets = frame.getInsets();
 
-                      int windowW = applet.width + insets.left + insets.right;
-                      int windowH = applet.height + insets.top + insets.bottom;
-                      int locationX = 100;
-                      int locationY = 100;
+                      final int windowW = applet.width + insets.left + insets.right;
+                      final int windowH = applet.height + insets.top + insets.bottom;
+                      final int locationX = 100;
+                      final int locationY = 100;
 
                       frame.setSize(windowW, windowH);
                       frame.setLocation(locationX, locationY);
 
-                      int usableWindowH = windowH - insets.top - insets.bottom;
+                      final int usableWindowH = windowH - insets.top - insets.bottom;
                       applet.setBounds((windowW - width)/2, insets.top + (usableWindowH - height)/2, width, height);
                     }
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
@@ -273,10 +273,10 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
 
         frame.add(this);
         frame.addWindowListener(new WindowAdapter() {
-          public void windowClosing(WindowEvent e) {
+          public void windowClosing(final WindowEvent e) {
               try {
                   dispose();
-              } catch (Exception ex) {
+              } catch (final Exception ex) {
                   Assume.assumeNoException(ex);
               }
           }
@@ -388,7 +388,7 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
         }
       }
 
-      void draw(GL2 gl) {
+      void draw(final GL2 gl) {
         if( !osxCALayerAWTModBug || !justInitialized ) {
             AWTEDTExecutor.singleton.invoke(true, new Runnable() {
                 public void run() {
@@ -408,8 +408,8 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
           System.out.println(OPENGL_VERSION);
           System.out.println(OPENGL_EXTENSIONS);
 
-          int[] temp = { 0 };
-          gl.glGetIntegerv(GL2.GL_MAX_SAMPLES, temp, 0);
+          final int[] temp = { 0 };
+          gl.glGetIntegerv(GL2ES3.GL_MAX_SAMPLES, temp, 0);
           System.out.println("Maximum number of samples supported by the hardware: " + temp[0]);
           System.out.println("Frame: "+frame);
           System.out.println("Applet: "+MiniPApplet.this);
@@ -418,7 +418,7 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
         }
 
         if (currentSamples == -1) {
-          int[] temp = { 0 };
+          final int[] temp = { 0 };
           gl.glGetIntegerv(GL.GL_SAMPLES, temp, 0);
           currentSamples = temp[0];
           if (numSamples != currentSamples) {
@@ -439,7 +439,7 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
         }
 
         if (restarted) {
-          int[] temp = { 0 };
+          final int[] temp = { 0 };
           gl.glGetIntegerv(GL.GL_SAMPLES, temp, 0);
           if (numSamples != temp[0]) {
             System.err.println("Multisampling level requested " + numSamples + " not supported. Using " + temp[0] + "samples instead.");
@@ -465,7 +465,7 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
         gl.glFlush();
 
         fcount += 1;
-        int m = (int) (System.currentTimeMillis() - millisOffset);
+        final int m = (int) (System.currentTimeMillis() - millisOffset);
         if (m - lastm > 1000 * fint) {
           frate = (float)(fcount) / fint;
           fcount = 0;
@@ -475,14 +475,14 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
       }
 
       void clock() {
-        long afterTime = System.nanoTime();
-        long timeDiff = afterTime - beforeTime;
-        long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;
+        final long afterTime = System.nanoTime();
+        final long timeDiff = afterTime - beforeTime;
+        final long sleepTime = (frameRatePeriod - timeDiff) - overSleepTime;
 
         if (sleepTime > 0) {  // some time left in this cycle
           try {
             Thread.sleep(sleepTime / 1000000L, (int) (sleepTime % 1000000L));
-          } catch (InterruptedException ex) { }
+          } catch (final InterruptedException ex) { }
 
           overSleepTime = (System.nanoTime() - afterTime) - sleepTime;
 
@@ -495,48 +495,48 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
 
       class SimpleListener implements GLEventListener {
         @Override
-        public void display(GLAutoDrawable drawable) {
+        public void display(final GLAutoDrawable drawable) {
             draw(drawable.getGL().getGL2());
             justInitialized = false;
         }
 
         @Override
-        public void dispose(GLAutoDrawable drawable) { }
+        public void dispose(final GLAutoDrawable drawable) { }
 
         @Override
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
             justInitialized = true;
         }
 
         @Override
-        public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h) { }
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int w, final int h) { }
       }
 
-      public void mouseDragged(MouseEvent ev) {
+      public void mouseDragged(final MouseEvent ev) {
         if (printEventInfo) {
           System.err.println("Mouse dragged event: " + ev);
         }
       }
 
-      public void mouseMoved(MouseEvent ev) {
+      public void mouseMoved(final MouseEvent ev) {
         if (printEventInfo) {
           System.err.println("Mouse moved event: " + ev);
         }
       }
 
-      public void keyPressed(KeyEvent ev) {
+      public void keyPressed(final KeyEvent ev) {
         if (printEventInfo) {
           System.err.println("Key pressed event: " + ev);
         }
       }
 
-      public void keyReleased(KeyEvent ev) {
+      public void keyReleased(final KeyEvent ev) {
         if (printEventInfo) {
           System.err.println("Key released event: " + ev);
         }
       }
 
-      public void keyTyped(KeyEvent ev) {
+      public void keyTyped(final KeyEvent ev) {
         if (printEventInfo) {
           System.err.println("Key typed event: " + ev);
         }
@@ -545,18 +545,18 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
       /** An Animator subclass which renders one frame at the time
        *  upon calls to the requestRender() method.
        **/
-      public class CustomAnimator extends AnimatorBase {
+      public static class CustomAnimator extends AnimatorBase {
           private Timer timer = null;
           private TimerTask task = null;
           private volatile boolean shouldRun;
 
-          protected String getBaseName(String prefix) {
+          protected String getBaseName(final String prefix) {
               return "Custom" + prefix + "Animator" ;
           }
 
           /** Creates an CustomAnimator with an initial drawable to
            * animate. */
-          public CustomAnimator(GLAutoDrawable drawable) {
+          public CustomAnimator(final GLAutoDrawable drawable) {
               if (drawable != null) {
                   add(drawable);
               }
@@ -629,8 +629,8 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
               }
               animThread = null;
               try {
-                  Thread.sleep(20); // ~ 1/60 hz wait, since we can't ctrl stopped threads
-              } catch (InterruptedException e) { }
+                  Thread.sleep(20); // ~ 1/60 hz wait, since we can't ctrl stopped threads / holding the lock is OK here!
+              } catch (final InterruptedException e) { }
               return true;
           }
 
@@ -644,21 +644,21 @@ public class TestGLCanvasAWTActionDeadlock02AWT extends UITestCase {
   public void test00() {
     TestGLCanvasAWTActionDeadlock02AWT.MiniPApplet mini;
     try {
-      Class<?> c = Thread.currentThread().getContextClassLoader().loadClass(TestGLCanvasAWTActionDeadlock02AWT.MiniPApplet.class.getName());
+      final Class<?> c = Thread.currentThread().getContextClassLoader().loadClass(TestGLCanvasAWTActionDeadlock02AWT.MiniPApplet.class.getName());
       mini = (TestGLCanvasAWTActionDeadlock02AWT.MiniPApplet) c.newInstance();
-    } catch (Exception e) {
+    } catch (final Exception e) {
       throw new RuntimeException(e);
     }
     if (mini != null) {
       try {
           mini.run();
-      } catch (Exception ex) {
+      } catch (final Exception ex) {
           Assume.assumeNoException(ex);
       }
     }
   }
 
-  public static void main(String args[]) {
+  public static void main(final String args[]) {
     for(int i=0; i<args.length; i++) {
         if(args[i].equals("-frames")) {
             framesPerTest = MiscUtils.atoi(args[++i], framesPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelResize01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelResize01AWT.java
index 2133d62..cc2c9ef 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelResize01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelResize01AWT.java
@@ -133,13 +133,13 @@ public class TestGLJPanelResize01AWT extends UITestCase {
                     // frame[0].pack();
                     frame[0].setVisible(true);
                 } } );
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
         try {
             Thread.sleep(duration);
-        } catch (InterruptedException e1) {
+        } catch (final InterruptedException e1) {
             e1.printStackTrace();
         }
         try {
@@ -147,7 +147,7 @@ public class TestGLJPanelResize01AWT extends UITestCase {
                     public void run() {
                         frame[0].dispose();
                     } } );
-        } catch (Exception e1) {
+        } catch (final Exception e1) {
             e1.printStackTrace();
         }
     }
@@ -184,7 +184,7 @@ public class TestGLJPanelResize01AWT extends UITestCase {
 
     static long duration = 600; // ms
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         boolean useSwingDoubleBuffer=false, manual=false;
 
         for(int i=0; i<args.length; i++) {
@@ -199,7 +199,7 @@ public class TestGLJPanelResize01AWT extends UITestCase {
         }
         if( manual ) {
             GLProfile.initSingleton();
-            TestGLJPanelResize01AWT demo = new TestGLJPanelResize01AWT();
+            final TestGLJPanelResize01AWT demo = new TestGLJPanelResize01AWT();
             demo.test(new GLCapabilities(null), esize01, useSwingDoubleBuffer);
         } else {
             org.junit.runner.JUnitCore.main(TestGLJPanelResize01AWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelTextureStateAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelTextureStateAWT.java
index 2d4c6da..8cf4b68 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelTextureStateAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestGLJPanelTextureStateAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,18 +20,19 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.awt;
 
 
 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.RedSquareES2;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.TextureDraw02ES2ListenerFBO;
+import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
 import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
 import com.jogamp.opengl.test.junit.util.UITestCase;
@@ -47,11 +48,9 @@ import javax.swing.JFrame;
 
 import com.jogamp.opengl.util.texture.TextureIO;
 import com.jogamp.opengl.util.texture.TextureState;
-import com.jogamp.opengl.util.Animator;
 import com.jogamp.opengl.util.GLReadBufferUtil;
 
 import java.awt.Dimension;
-
 import java.io.IOException;
 
 import org.junit.Assert;
@@ -62,57 +61,81 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 /**
- * Unit test for bug 826, test {@link GLJPanel}'s {@link TextureState} save and restore. 
+ * Unit test for bug 826, test {@link GLJPanel}'s {@link TextureState} save and restore.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestGLJPanelTextureStateAWT extends UITestCase {
     static boolean showFPS = false;
-    static long duration = 100; // ms
+    static long duration = 250; // ms
 
     @BeforeClass
     public static void initClass() {
     }
 
-    public void testImpl(final boolean keepTextureBound, final int texUnit) 
-            throws InterruptedException, IOException 
+    static void setFrameSize(final JFrame frame, final boolean frameLayout, final java.awt.Dimension new_sz) {
+        try {
+            javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
+                public void run() {
+                    frame.setSize(new_sz);
+                    if( frameLayout ) {
+                        frame.validate();
+                    }
+                } } );
+        } catch( final Throwable throwable ) {
+            throwable.printStackTrace();
+            Assume.assumeNoException( throwable );
+        }
+    }
+
+    public void testImpl(final boolean keepTextureBound, final int texUnit)
+            throws InterruptedException, IOException
     {
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
         GLProfile glp;
         if(GLProfile.isAvailable(GLProfile.GL2ES2)) {
             glp = GLProfile.getGL2ES2();
         } else {
-            System.err.println(getSimpleTestName(".")+": GLProfile n/a");            
+            System.err.println(getSimpleTestName(".")+": GLProfile n/a");
             return;
         }
         final GLCapabilities caps = new GLCapabilities(glp);
-        
+
         final GLJPanel glc = new GLJPanel(caps);
-        Dimension glc_sz = new Dimension(800, 400);
+        // final GLCanvas glc = new GLCanvas(caps);
+        final Dimension glc_sz = new Dimension(640, 480);
+        final Dimension glc_sz2 = new Dimension(800, 400);
         glc.setMinimumSize(glc_sz);
         glc.setPreferredSize(glc_sz);
         final JFrame frame = new JFrame("TestGLJPanelTextureStateAWT");
-        Assert.assertNotNull(frame);        
+        Assert.assertNotNull(frame);
         frame.getContentPane().add(glc);
 
-        final TextureDraw02ES2ListenerFBO gle0;
+        final GLEventListener gle0;
         {
             final GearsES2 gle0sub = new GearsES2( 0 );
             // gle1sub.setClearBuffers(false);
-            gle0 = new TextureDraw02ES2ListenerFBO(gle0sub, 1, texUnit ) ;
+            final TextureDraw02ES2ListenerFBO demo = new TextureDraw02ES2ListenerFBO(gle0sub, 1, texUnit ) ;
+            demo.setKeepTextureBound(keepTextureBound);
+            demo.setClearBuffers(false);
+            gle0 = demo;
         }
-        gle0.setKeepTextureBound(keepTextureBound);
-        gle0.setClearBuffers(false);
-        
-        final RedSquareES2 gle1 = new RedSquareES2( 1 ) ;
-        gle1.setClearBuffers(false);
-        
+
+        final GLEventListener gle1;
+        {
+            final RedSquareES2 demo = new RedSquareES2( 1 ) ;
+            demo.setClearBuffers(false);
+            gle1 = demo;
+        }
+
+        final boolean[] glelError = { false };
+
         glc.addGLEventListener(new GLEventListener() {
             int gle0X, gle0Y, gle0W, gle0H;
             int gle1X, gle1Y, gle1W, gle1H;
             int tX, tY, tW, tH;
             int shot = 0;
-            
-            void setupTex(GL gl) {
+
+            void setupTex(final GL gl) {
                 // Note: FBObject uses diff defaults, i.e.: GL_NEAREST and GL_CLAMP_TO_EDGE
                 if( keepTextureBound ) {
                     gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
@@ -121,11 +144,11 @@ public class TestGLJPanelTextureStateAWT extends UITestCase {
                     gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_REPEAT);
                 }
             }
-            
+
             @Override
-            public void init(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {
                 // Initialize w/ arbitrary values !
-                GL2ES2 gl = drawable.getGL().getGL2ES2();
+                final GL2ES2 gl = drawable.getGL().getGL2ES2();
                 gl.glActiveTexture(GL.GL_TEXTURE0 + 1);
                 gl.glBindTexture(GL.GL_TEXTURE_2D, 0);
                 gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, GL.GL_LINEAR);
@@ -138,112 +161,121 @@ public class TestGLJPanelTextureStateAWT extends UITestCase {
                 gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, GL.GL_NEAREST);
                 gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_REPEAT);
                 gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_T, GL.GL_REPEAT);
-                
+
                 gle0.init(drawable);
                 gle1.init(drawable);
                 setupTex(gl);
             }
 
             @Override
-            public void dispose(GLAutoDrawable drawable) { 
+            public void dispose(final GLAutoDrawable drawable) {
                 gle0.dispose(drawable);
                 gle1.dispose(drawable);
             }
             @Override
-            public void display(GLAutoDrawable drawable) { 
-                GL2ES2 gl = drawable.getGL().getGL2ES2();
-                
+            public void display(final GLAutoDrawable drawable) {
+                final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
                 gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
                 gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
-                
-                // restore viewport test
-                final int[] viewport = new int[] { 0, 0, 0, 0 };
-                gl.glGetIntegerv(GL.GL_VIEWPORT, viewport, 0);
-                if( gle0X != viewport[0] || gle0Y != viewport[1] || gle0W != viewport[2] || gle0H != viewport[3] ) {
-                    final String msg = "Expected "+viewport[0]+"/"+viewport[1]+" "+viewport[2]+"x"+viewport[3]+
-                                        ", actual "+gle0X+"/"+gle0Y+" "+gle0W+"x"+gle0H;
-                    Assert.assertTrue("Viewport not restored: "+msg, false);
+
+                // test viewport
+                {
+                    final int[] viewport = new int[] { 0, 0, 0, 0 };
+                    gl.glGetIntegerv(GL.GL_VIEWPORT, viewport, 0);
+                    if( gle1X != viewport[0] || gle1Y != viewport[1] || gle1W != viewport[2] || gle1H != viewport[3] ) {
+                        final String msg = "Expected "+gle1X+"/"+gle1Y+" "+gle1W+"x"+gle1H+
+                                            ", actual "+viewport[0]+"/"+viewport[1]+" "+viewport[2]+"x"+viewport[3];
+                        Assert.assertTrue("Viewport not restored: "+msg, false);
+                        glelError[0] = true;
+                    }
                 }
-                
-                // gl.glViewport(gle0X, gle0Y, gle0W, gle0H); // restore viewport test
+
+                gl.glViewport(gle0X, gle0Y, gle0W, gle0H);
                 gle0.display(drawable);
-                
+
                 gl.glViewport(gle1X, gle1Y, gle1W, gle1H);
                 gle1.display(drawable);
-                
+
                 shot++;
                 if( 4 == shot ) {
                     gl.glViewport(tX, tY, tW, tH);
                     snapshot(0, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
-                }                
-                
-                gl.glViewport(gle0X, gle0Y, gle0W, gle0H); // restore viewport test
-                
-                final TextureState ts = new TextureState(drawable.getGL(), GL.GL_TEXTURE_2D);
+                    gl.glViewport(gle1X, gle1Y, gle1W, gle1H); // restore viewport test
+                }
+
+                final TextureState ts = new TextureState(drawable.getGL(), GL.GL_TEXTURE_2D); // as set via gle0!
                 // System.err.println("XXX: "+ts);
                 Assert.assertEquals("Texture unit changed", GL.GL_TEXTURE0+texUnit, ts.getUnit());
-                if( keepTextureBound ) {                
-                    Assert.assertEquals("Texture mag-filter changed", GL.GL_LINEAR, ts.getMagFilter());
-                    Assert.assertEquals("Texture mag-filter changed", GL.GL_LINEAR, ts.getMinFilter());
-                    Assert.assertEquals("Texture wrap-s changed", GL.GL_REPEAT, ts.getWrapS());
-                    Assert.assertEquals("Texture wrap-t changed", GL.GL_REPEAT, ts.getWrapT());
+                if( keepTextureBound ) {
+                    Assert.assertEquals("Texture mag-filter changed: "+ts, GL.GL_LINEAR, ts.getMagFilter());
+                    Assert.assertEquals("Texture mag-filter changed: "+ts, GL.GL_LINEAR, ts.getMinFilter());
+                    Assert.assertEquals("Texture wrap-s changed: "+ts, GL.GL_REPEAT, ts.getWrapS());
+                    Assert.assertEquals("Texture wrap-t changed: "+ts, GL.GL_REPEAT, ts.getWrapT());
+                    glelError[0] = GL.GL_LINEAR != ts.getMagFilter() || GL.GL_LINEAR != ts.getMinFilter() ||
+                                   GL.GL_REPEAT != ts.getWrapS()     || GL.GL_REPEAT != ts.getWrapT();
                 }
             }
             final int border = 5;
             @Override
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
                 gle0X = x + border;
                 gle0Y = y;
                 gle0W = width/2 - 2*border;
                 gle0H = height;
-                
+                // System.err.println("GLEL0 "+gle0X+"/"+gle0Y+" "+gle0W+"x"+gle0H);
+
                 gle1X = gle0X + gle0W + 2*border;
                 gle1Y = y;
                 gle1W = width/2 - 2*border;
                 gle1H = height;
-                
+                // System.err.println("GLEL1 "+gle1X+"/"+gle1Y+" "+gle1W+"x"+gle1H);
+
                 tX = x;
                 tY = y;
                 tW = width;
                 tH = height;
-                
-                GL2ES2 gl = drawable.getGL().getGL2ES2();
+                // System.err.println("Total "+tX+"/"+tY+" "+tW+"x"+tH);
+
+                final GL2ES2 gl = drawable.getGL().getGL2ES2();
                 gl.glViewport(gle0X, gle0Y, gle0W, gle0H);
-                gle0.reshape(drawable, gle0X, gle0Y, gle0W, gle0H);
-                
+                gle0.reshape(drawable, 0, 0, gle0W, gle0H); // don't 'skip' about gle0X/gle0Y
+
                 gl.glViewport(gle1X, gle1Y, gle1W, gle1H);
-                gle1.reshape(drawable, gle1X, gle1Y, gle1W, gle1H);
-                
-                gl.glViewport(gle0X, gle0Y, gle0W, gle0H); // restore viewport test
-                
+                gle1.reshape(drawable, 0, 0, gle1W, gle1H); // don't 'skip' about gle0X/gle0Y
+
                 if( keepTextureBound ) {
                     setupTex(gl);
                 }
-            }             
+            }
         });
 
-        Animator animator = new Animator(glc);
-        animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
-        QuitAdapter quitAdapter = new QuitAdapter();
-        new com.jogamp.newt.event.awt.AWTKeyAdapter(quitAdapter).addTo(glc);
-        new com.jogamp.newt.event.awt.AWTWindowAdapter(quitAdapter).addTo(glc);
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new com.jogamp.newt.event.awt.AWTKeyAdapter(quitAdapter, glc).addTo(glc);
+        new com.jogamp.newt.event.awt.AWTWindowAdapter(quitAdapter, glc).addTo(glc);
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame.pack();
                     frame.setVisible(true);
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }        
-        animator.start();
+        }
+        Assert.assertTrue("Component didn't become visible", AWTRobotUtil.waitForVisible(glc, true));
+        Assert.assertTrue("Component didn't become realized", AWTRobotUtil.waitForRealized(glc, true));
+        Thread.sleep(100);
+        setFrameSize(frame, true, glc_sz2);
+        System.err.println("window resize pos/siz: "+glc.getX()+"/"+glc.getY()+" "+glc.getSurfaceWidth()+"x"+glc.getSurfaceHeight());
+        Thread.sleep(100);
 
-        while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
+        final long t0 = System.currentTimeMillis();
+        while(!quitAdapter.shouldQuit() && System.currentTimeMillis()-t0<duration) {
+            glc.display();
             Thread.sleep(100);
         }
-        
-        animator.stop();
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
@@ -251,12 +283,13 @@ public class TestGLJPanelTextureStateAWT extends UITestCase {
                     frame.remove(glc);
                     frame.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }        
+        }
+        Assume.assumeFalse("Error occured in GLEL .. see log file above", glelError[0]);
     }
-    
+
     @Test
     public void test01_texUnit0_keepTex0_ES2() throws InterruptedException, IOException {
         testImpl(false /* keepTextureBound */, 0 /* texUnit */);
@@ -269,14 +302,14 @@ public class TestGLJPanelTextureStateAWT extends UITestCase {
     public void test03_texUnit1_keepTex1_ES2() throws InterruptedException, IOException {
         testImpl(true /* keepTextureBound */, 1 /* texUnit */);
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 duration = MiscUtils.atol(args[i], duration);
             }
         }
-        org.junit.runner.JUnitCore.main(TestGLJPanelTextureStateAWT.class.getName());        
+        org.junit.runner.JUnitCore.main(TestGLJPanelTextureStateAWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestIsRealizedConcurrency01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestIsRealizedConcurrency01AWT.java
index 3f8b76a..d75ff66 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestIsRealizedConcurrency01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestIsRealizedConcurrency01AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.awt;
 
 import javax.media.opengl.awt.GLCanvas;
@@ -49,22 +49,22 @@ import org.junit.runners.MethodSorters;
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestIsRealizedConcurrency01AWT extends UITestCase {
     static long durationPerTest = 500; // ms
-        
+
     @Test
     public void testAddRemove() throws InterruptedException, InvocationTargetException {
         final Dimension f_sz = new Dimension(512, 512);
-        
+
         final GLCanvas glCanvas = new GLCanvas();
         Assert.assertNotNull(glCanvas);
         glCanvas.addGLEventListener(new GearsES2());
 
         final Animator animator = new Animator(glCanvas);
         animator.start();
-        
+
         final Frame frame = new Frame("Frame");
-        Assert.assertNotNull(frame);        
+        Assert.assertNotNull(frame);
         frame.add(glCanvas);
-        
+
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 frame.setLocation(0, 0);
@@ -83,17 +83,17 @@ public class TestIsRealizedConcurrency01AWT extends UITestCase {
                 frame.validate();
             }});
         Thread.sleep(durationPerTest/2);
-        
+
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 glCanvas.destroy();
                 frame.dispose();
             }});
-        
+
         animator.stop();
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestJScrollPaneMixHwLw01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestJScrollPaneMixHwLw01AWT.java
index 28fb79c..ec9cece 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestJScrollPaneMixHwLw01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestJScrollPaneMixHwLw01AWT.java
@@ -32,7 +32,7 @@ import com.jogamp.opengl.util.Animator;
 
 /**
  * Documenting Bug 586
- * 
+ *
  * <p>
  * JScrollPane cannot mix hw/lw components, only if setting property '-Dsun.awt.disableMixing=true'.
  * </p>
@@ -45,65 +45,65 @@ import com.jogamp.opengl.util.Animator;
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestJScrollPaneMixHwLw01AWT extends UITestCase {
     static long durationPerTest = 500;
-    
+
     static {
         // too late: use at cmd-line '-Dsun.awt.disableMixing=true' works
         // System.setProperty("sun.awt.disableMixing", "true");
     }
 
     /**
-     * Doesn't work either .. 
+     * Doesn't work either ..
      */
     @SuppressWarnings("serial")
     public static class TransparentJScrollPane extends JScrollPane {
 
-        public TransparentJScrollPane(Component view) {
+        public TransparentJScrollPane(final Component view) {
             super(view);
-    
+
             setOpaque(false);
-       
+
             try {
                 ReflectionUtil.callStaticMethod(
-                                            "com.sun.awt.AWTUtilities", "setComponentMixingCutoutShape", 
-                                            new Class<?>[] { Component.class, Shape.class }, 
-                                            new Object[] { this, new Rectangle() } , 
+                                            "com.sun.awt.AWTUtilities", "setComponentMixingCutoutShape",
+                                            new Class<?>[] { Component.class, Shape.class },
+                                            new Object[] { this, new Rectangle() } ,
                                             GraphicsConfiguration.class.getClassLoader());
                 System.err.println("com.sun.awt.AWTUtilities.setComponentMixingCutoutShape(..) passed");
-            } catch (RuntimeException re) {
+            } catch (final RuntimeException re) {
                 System.err.println("com.sun.awt.AWTUtilities.setComponentMixingCutoutShape(..) failed: "+re.getMessage());
             }
         }
-    
+
         @Override
-        public void setOpaque(boolean isOpaque) {
+        public void setOpaque(final boolean isOpaque) {
         }
     }
-    
-    protected void runTestGL(GLCapabilities caps, boolean useJScroll) throws InterruptedException {
+
+    protected void runTestGL(final GLCapabilities caps, final boolean useJScroll) throws InterruptedException {
         final String typeS = useJScroll ? "LW" : "HW";
         final JFrame frame = new JFrame("Mix Hw/Lw Swing - ScrollPane "+typeS);
         Assert.assertNotNull(frame);
-        
+
         final Dimension f_sz = new Dimension(600,400);
         final Dimension glc_sz = new Dimension(500,600);
-        
+
         final GLCanvas glCanvas = new GLCanvas(caps);
-        Assert.assertNotNull(glCanvas);        
+        Assert.assertNotNull(glCanvas);
         glCanvas.addGLEventListener(new GearsES2());
         glCanvas.setPreferredSize(glc_sz);
-        
-        JPanel panel = new JPanel(new BorderLayout());
+
+        final JPanel panel = new JPanel(new BorderLayout());
         panel.setOpaque(false);
         if(useJScroll) {
-            final JScrollPane scrollPane = new TransparentJScrollPane(glCanvas);      
+            final JScrollPane scrollPane = new TransparentJScrollPane(glCanvas);
             panel.add(scrollPane, BorderLayout.CENTER);
         } else {
-            ScrollPane scrollPane = new ScrollPane();
+            final ScrollPane scrollPane = new ScrollPane();
             scrollPane.add(glCanvas);
             panel.add(scrollPane, BorderLayout.CENTER);
         }
-        
-        JTextArea textArea = new JTextArea();
+
+        final JTextArea textArea = new JTextArea();
         textArea.setText("Test\nTest\nTest\nTest\n");
 
         panel.add(textArea, BorderLayout.NORTH);
@@ -119,25 +119,25 @@ public class TestJScrollPaneMixHwLw01AWT extends UITestCase {
                     frame.setSize(f_sz);
                     frame.setVisible(true);
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
 
-        Animator animator = new Animator(glCanvas);
+        final Animator animator = new Animator(glCanvas);
         animator.start();
 
         Thread.sleep(durationPerTest);
 
         animator.stop();
-        
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame.setVisible(false);
                     frame.dispose();
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
@@ -145,19 +145,19 @@ public class TestJScrollPaneMixHwLw01AWT extends UITestCase {
 
     // @Test doesn't work
     public void test01JScrollPane() throws InterruptedException {
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, true);
     }
 
     @Test
     public void test01ScrollPane() throws InterruptedException {
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, false);
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
@@ -166,11 +166,11 @@ public class TestJScrollPaneMixHwLw01AWT extends UITestCase {
         /**
         BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         System.err.println("Press enter to continue");
-        System.err.println(stdin.readLine()); 
+        System.err.println(stdin.readLine());
         */
         System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestJScrollPaneMixHwLw01AWT.class.getName();
+        final String tstname = TestJScrollPaneMixHwLw01AWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
-    
+
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java
index ccdaf6e..d241012 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/TestSwingAWT01GLn.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.awt;
 
 import java.lang.reflect.InvocationTargetException;
@@ -83,7 +83,7 @@ public class TestSwingAWT01GLn extends UITestCase {
             // final array as mutable container hack
             final GLCanvas[] glCanvas = new GLCanvas[1];
 
-            Runnable test = new Runnable() {
+            final Runnable test = new Runnable() {
                 public void run() {
                     glCanvas[0] = new GLCanvas(caps);
                     glCanvas[0].addGLEventListener(new GearsES2());
@@ -100,13 +100,13 @@ public class TestSwingAWT01GLn extends UITestCase {
                 }
             };
 
-            Runnable cleanup = new Runnable() {
+            final Runnable cleanup = new Runnable() {
                 public void run() {
                     System.out.println("cleaning up...");
                     window.setVisible(false);
                     try {
                         window.removeAll();
-                    } catch (Throwable t) {
+                    } catch (final Throwable t) {
                         assumeNoException(t);
                         t.printStackTrace();
                     }
@@ -118,7 +118,7 @@ public class TestSwingAWT01GLn extends UITestCase {
             // AWT / Swing on EDT..
             invokeAndWait(test);
 
-            Animator animator = new Animator(glCanvas[0]);
+            final Animator animator = new Animator(glCanvas[0]);
             animator.start();
             Thread.sleep(1000);
             animator.stop();
@@ -130,10 +130,10 @@ public class TestSwingAWT01GLn extends UITestCase {
 
     @Test
     public void test01GLDefault() throws InterruptedException, InvocationTargetException {
-        GLProfile glp = GLProfile.getDefault();
+        final GLProfile glp = GLProfile.getDefault();
         System.out.println("GLProfile Default: "+glp);
         if(glp.isGL2ES2()) {
-            GLCapabilities caps = new GLCapabilities(glp);
+            final GLCapabilities caps = new GLCapabilities(glp);
             runTestGL(caps);
         } else {
             System.out.println("not a GL2ES2 profile");
@@ -143,16 +143,16 @@ public class TestSwingAWT01GLn extends UITestCase {
     @Test
     public void test02GL2() throws InterruptedException, InvocationTargetException {
         if(GLProfile.isAvailable(GLProfile.GL2)) {
-            GLProfile glprofile = GLProfile.get(GLProfile.GL2);
+            final GLProfile glprofile = GLProfile.get(GLProfile.GL2);
             System.out.println( "GLProfile GL2: " + glprofile );
-            GLCapabilities caps = new GLCapabilities(glprofile);
+            final GLCapabilities caps = new GLCapabilities(glprofile);
             runTestGL(caps);
         } else {
             System.out.println("GL2 n/a");
         }
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestSwingAWT01GLn.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java
index 066e5fe..4b1da1e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TestAWTTextRendererUseVertexArrayBug464.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.awt.text;
 
 import javax.media.opengl.GLProfile;
@@ -49,15 +49,15 @@ import org.junit.runners.MethodSorters;
 
 /*
  * Unit tests for Bug464
- * Some ATI-Drivers crash the JVM if VBO-related glFunctions are called. This test checks 
+ * Some ATI-Drivers crash the JVM if VBO-related glFunctions are called. This test checks
  * if TextRenderer calls any of these functions while it's useVertexArray variable is set
  * to false.
- * 2D- and 3D-TextRendering is tested by creating a GLCanvas showing a simple line of text 
+ * 2D- and 3D-TextRendering is tested by creating a GLCanvas showing a simple line of text
  * while filtering all glFunction calls by using a modified version of TraceGL2.
  * VBO-related function are logged to the disallowedMethodCalls String of the GLEventListener
- * instead of being executed (to prevent JVM crashes). Therefore, if the 
+ * instead of being executed (to prevent JVM crashes). Therefore, if the
  * disallowedMethodCalls isn't an empty String after the test, the test fails.
- * 
+ *
  * Other classes related to this test:
  *   TestTextRendererGLEventListener01
  *   TestTextRendererTraceGL2Mock01
@@ -67,7 +67,7 @@ import org.junit.runners.MethodSorters;
 public class TestAWTTextRendererUseVertexArrayBug464 extends UITestCase {
     static GLProfile glp;
     static GLCapabilities caps;
-    
+
     private GLCanvas glCanvas;
     private Frame frame;
 
@@ -92,7 +92,7 @@ public class TestAWTTextRendererUseVertexArrayBug464 extends UITestCase {
                     frame.setSize(512, 512);
                     frame.setVisible(true);
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -107,10 +107,10 @@ public class TestAWTTextRendererUseVertexArrayBug464 extends UITestCase {
                     frame.remove(glCanvas);
                     frame.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }        
+        }
         glCanvas=null;
         frame=null;
     }
@@ -118,45 +118,45 @@ public class TestAWTTextRendererUseVertexArrayBug464 extends UITestCase {
     @Test
     public void testTextRendererDraw2D() throws InterruptedException {
 
-        TextRendererGLEventListener01 listener = new TextRendererGLEventListener01(1);
+        final TextRendererGLEventListener01 listener = new TextRendererGLEventListener01(1);
         Assert.assertNotNull(listener);
         glCanvas.addGLEventListener(listener);
-        Animator animator = new Animator(glCanvas);
+        final Animator animator = new Animator(glCanvas);
 
         animator.start();
-    
+
         Thread.sleep(500); // 500 ms
-    
+
         animator.stop();
-        
-        String disallowedMethods = listener.getDisallowedMethodCalls();
+
+        final String disallowedMethods = listener.getDisallowedMethodCalls();
         if (!disallowedMethods.equals("")) {
             Assert.fail("Following VBO-related glMethods have been called: "+ disallowedMethods);
         }
     }
-    
+
     @Test
     public void testTextRendererDraw3D() throws InterruptedException {
 
-        TextRendererGLEventListener01 listener = new TextRendererGLEventListener01(2);
+        final TextRendererGLEventListener01 listener = new TextRendererGLEventListener01(2);
         Assert.assertNotNull(listener);
         glCanvas.addGLEventListener(listener);
-        Animator animator = new Animator(glCanvas);
+        final Animator animator = new Animator(glCanvas);
 
         animator.start();
-    
+
         Thread.sleep(500); // 500 ms
-    
+
         animator.stop();
-        
-        String disallowedMethods = listener.getDisallowedMethodCalls();
+
+        final String disallowedMethods = listener.getDisallowedMethodCalls();
         if (!disallowedMethods.equals("")) {
             Assert.fail("Following VBO-related glMethods have been called: "+ disallowedMethods);
         }
     }
 
-    public static void main(String args[]) throws IOException {
-        String tstname = TestAWTTextRendererUseVertexArrayBug464.class.getName();
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestAWTTextRendererUseVertexArrayBug464.class.getName();
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
             "filtertrace=true",
@@ -168,5 +168,5 @@ public class TestAWTTextRendererUseVertexArrayBug464 extends UITestCase {
             "logtestlistenerevents=true",
             "formatter=org.apache.tools.ant.taskdefs.optional.junit.PlainJUnitResultFormatter",
             "formatter=org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter,TEST-"+tstname+".xml" } );
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java
index c966845..44089ff 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererGLEventListener01.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.awt.text;
 
 import java.awt.Font;
@@ -33,10 +33,12 @@ import java.io.OutputStream;
 import java.io.PrintStream;
 
 import com.jogamp.opengl.util.awt.TextRenderer;
+
 import javax.media.opengl.GL2ES1;
 import javax.media.opengl.GL2;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 import javax.media.opengl.glu.GLU;
 
 import org.junit.Assert;
@@ -45,58 +47,58 @@ import org.junit.Assert;
  * Unit tests for Bug464
  * GLEventListener for unit test TestAWTTextRendererUseVertexArrayBug464. The display
  * method renders the String "ABC123#+?" to the lower left corner of the canvas.
- *  
+ *
  * The testNumber variable is used to switch between 2D- and 3D-textrendering in the display
  * method.
  * The disallowedMethodCalls variable is used to log VBO-related glFunction calls during
  * the execution of the test.
- * 
+ *
  * Other classes related to this test:
  *   TestAWTTextRendererUseVertexArrayBug464
  *   TextRendererTraceGL2Mock01
  */
 
 public class TextRendererGLEventListener01 implements GLEventListener {
-    private GLU glu = new GLU();
+    private final GLU glu = new GLU();
     private TextRenderer renderer;
     private String text;
     private String disallowedMethodCalls;
-    private int testNumber;
-    
-    public TextRendererGLEventListener01(int testNumber) {
+    private final int testNumber;
+
+    public TextRendererGLEventListener01(final int testNumber) {
         this.disallowedMethodCalls = "";
         this.testNumber = testNumber;
     }
 
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         renderer = new TextRenderer(new Font("SansSerif", Font.BOLD, 36));
         renderer.setUseVertexArrays(false);
         Assert.assertNotNull(renderer);
         Assert.assertFalse(renderer.getUseVertexArrays());
-        
+
         text = "ABC123#+?";
-        
-        PrintStream nullStream = new PrintStream(new OutputStream(){ public void write(int b){}});
+
+        final PrintStream nullStream = new PrintStream(new OutputStream(){ public void write(final int b){}});
         drawable.setGL(new TextRendererTraceGL2Mock01(drawable.getGL().getGL2(), nullStream, this));
     }
 
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-        GL2 gl = drawable.getGL().getGL2();
-        gl.glMatrixMode(GL2ES1.GL_PROJECTION);
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+        final GL2 gl = drawable.getGL().getGL2();
+        gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         gl.glLoadIdentity();
         glu.gluOrtho2D(0, 1, 0, 1);
-        gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+        gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         gl.glLoadIdentity();
     }
 
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         renderer.dispose();
     }
 
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         if (disallowedMethodCalls.equals("")) {
             if (testNumber == 1) {
-                renderer.beginRendering(drawable.getWidth(), drawable.getHeight());
+                renderer.beginRendering(drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
                 renderer.setColor(1.0f, 1.0f, 1.0f, 1.0f);
                 renderer.draw(text, 0, 0);
                 renderer.endRendering();
@@ -109,14 +111,14 @@ public class TextRendererGLEventListener01 implements GLEventListener {
             }
         }
     }
-    
-    public void disallowedMethodCalled (String method) {
+
+    public void disallowedMethodCalled (final String method) {
         if (!disallowedMethodCalls.equals("")) {
             disallowedMethodCalls += ", ";
         }
         disallowedMethodCalls += method;
     }
-    
+
     public String getDisallowedMethodCalls() {
         return this.disallowedMethodCalls;
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererTraceGL2Mock01.java b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererTraceGL2Mock01.java
index 86714fc..3adcf98 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererTraceGL2Mock01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/awt/text/TextRendererTraceGL2Mock01.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -40,8 +40,8 @@ import com.jogamp.common.nio.Buffers;
 
 /*
  * Unit tests for Bug464
- * Modified Version of TraceGL2 for unit test TestAWTTextRendererUseVertexArrayBug464. 
- * This class overrides all glFunctions related to VBO's according to 
+ * Modified Version of TraceGL2 for unit test TestAWTTextRendererUseVertexArrayBug464.
+ * This class overrides all glFunctions related to VBO's according to
  * http://code.google.com/p/glextensions/wiki/GL_ARB_vertex_buffer_object:
  *   glBindBuffer (glBindBufferARB)
  *   glDeleteBuffers (glDeleteBuffersARB)
@@ -56,81 +56,81 @@ import com.jogamp.common.nio.Buffers;
  *   glGetBufferPointerv (glGetBufferPointervARB)
  * Calls to the overridden methods are logged to the disallowedMethodCalls variable of
  * the GLEventListener instead of being passed to the downstreamGL object.
- * 
+ *
  * Other classes related to this test:
  *   TestAWTTextRendererUseVertexArrayBug464
  *   TextRendererGLEventListener01
  */
 
 public class TextRendererTraceGL2Mock01 extends TraceGL2 {
-    
+
     TextRendererGLEventListener01 listener;
 
-    public TextRendererTraceGL2Mock01(GL2 downstreamGL2, PrintStream stream, TextRendererGLEventListener01 listener) {
+    public TextRendererTraceGL2Mock01(final GL2 downstreamGL2, final PrintStream stream, final TextRendererGLEventListener01 listener) {
         super(downstreamGL2, stream);
         this.listener = listener;
-    }    
+    }
 
     @Override
-    public void glGetBufferSubData(int arg0, long arg1, long arg2, Buffer arg3) {
+    public void glGetBufferSubData(final int arg0, final long arg1, final long arg2, final Buffer arg3) {
         listener.disallowedMethodCalled("glGetBufferSubData");
     }
 
     @Override
-    public ByteBuffer glMapBuffer(int arg0, int arg1) {
+    public ByteBuffer glMapBuffer(final int arg0, final int arg1) {
         listener.disallowedMethodCalled("glMapBuffer");
         return Buffers.newDirectByteBuffer(0);
     }
 
     @Override
-    public void glGetBufferParameteriv(int arg0, int arg1, IntBuffer arg2) {
+    public void glGetBufferParameteriv(final int arg0, final int arg1, final IntBuffer arg2) {
         listener.disallowedMethodCalled("glGetBufferParameteriv");
     }
 
     @Override
-    public boolean glUnmapBuffer(int arg0) {
+    public boolean glUnmapBuffer(final int arg0) {
         listener.disallowedMethodCalled("glUnmapBuffer");
         return false;
     }
-    
+
     @Override
-    public void glGenBuffers(int arg0, IntBuffer arg1) {
+    public void glGenBuffers(final int arg0, final IntBuffer arg1) {
         listener.disallowedMethodCalled("glGenBuffers");
     }
 
     @Override
-    public void glGenBuffers(int arg0, int[] arg1, int arg2) {
+    public void glGenBuffers(final int arg0, final int[] arg1, final int arg2) {
         listener.disallowedMethodCalled("glGenBuffers");
     }
 
     @Override
-    public boolean glIsBuffer(int arg0) {
+    public boolean glIsBuffer(final int arg0) {
         listener.disallowedMethodCalled("glIsBuffer");
         return false;
     }
 
     @Override
-    public void glBindBuffer(int arg0, int arg1) {
+    public void glBindBuffer(final int arg0, final int arg1) {
         listener.disallowedMethodCalled("glBindBuffer");
     }
 
     @Override
-    public void glDeleteBuffers(int arg0, int[] arg1, int arg2) {
+    public void glDeleteBuffers(final int arg0, final int[] arg1, final int arg2) {
         listener.disallowedMethodCalled("glDeleteBuffers");
     }
 
     @Override
-    public void glBufferSubData(int arg0, long arg1, long arg2, Buffer arg3) {
+    public void glBufferSubData(final int arg0, final long arg1, final long arg2, final Buffer arg3) {
         listener.disallowedMethodCalled("glBufferSubData");
     }
 
     @Override
-    public void glGetBufferParameteriv(int arg0, int arg1, int[] arg2, int arg3) {
+    public void glGetBufferParameteriv(final int arg0, final int arg1, final int[] arg2, final int arg3) {
         listener.disallowedMethodCalled("glGetBufferParameteriv");
     }
 
     @Override
-    public void glBufferData(int arg0, long arg1, Buffer arg2, int arg3) {
+    public void glBufferData(final int arg0, final long arg1, final Buffer arg2, final int arg3) {
         listener.disallowedMethodCalled("glBufferData");
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java
index efdd2e1..02265ad 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/MultisampleChooser01.java
@@ -48,22 +48,22 @@ import javax.media.opengl.GLCapabilitiesImmutable;
 class MultisampleChooser01 extends DefaultGLCapabilitiesChooser {
 
     @Override
-    public int chooseCapabilities(final CapabilitiesImmutable desired, 
-                                  final List<? extends CapabilitiesImmutable> available, 
+    public int chooseCapabilities(final CapabilitiesImmutable desired,
+                                  final List<? extends CapabilitiesImmutable> available,
                                   final int windowSystemRecommendedChoice) {
         boolean anyHaveSampleBuffers = false;
         for (int i = 0; i < available.size(); i++) {
-            GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) available.get(i);
+            final GLCapabilitiesImmutable caps = (GLCapabilitiesImmutable) available.get(i);
             if ( caps.getSampleBuffers() ) {
                 anyHaveSampleBuffers = true;
                 break;
             }
         }
-        int selection = super.chooseCapabilities(desired, available, windowSystemRecommendedChoice);
+        final int selection = super.chooseCapabilities(desired, available, windowSystemRecommendedChoice);
         if (!anyHaveSampleBuffers) {
             System.err.println("WARNING: antialiasing will be disabled because none of the available pixel formats had it to offer");
         } else {
-            GLCapabilitiesImmutable selected = (GLCapabilitiesImmutable) available.get(selection);
+            final GLCapabilitiesImmutable selected = (GLCapabilitiesImmutable) available.get(selection);
             if (!selected.getSampleBuffers()) {
                 System.err.println("WARNING: antialiasing will be disabled because the DefaultGLCapabilitiesChooser didn't supply it");
             }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageAWT.java
index e87c344..c1b29b3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageAWT.java
@@ -28,7 +28,6 @@
 package com.jogamp.opengl.test.junit.jogl.caps;
 
 import java.io.File;
-import java.io.IOException;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
@@ -39,8 +38,9 @@ import javax.media.opengl.GLDrawableFactory;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLProfile;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
-import com.jogamp.opengl.util.awt.Screenshot;
+import com.jogamp.opengl.util.awt.AWTGLReadBufferUtil;
 import com.jogamp.opengl.util.texture.TextureIO;
 
 import java.awt.image.BufferedImage;
@@ -55,15 +55,17 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestBug605FlippedImageAWT extends UITestCase {
     class FlippedImageTest implements GLEventListener {
-        public void display(GLAutoDrawable drawable) {
-            GL2 gl = drawable.getGL().getGL2();
+        AWTGLReadBufferUtil screenshot;
+
+        public void display(final GLAutoDrawable drawable) {
+            final GL2 gl = drawable.getGL().getGL2();
 
             gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
             gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT | GL2.GL_ACCUM_BUFFER_BIT );
 
-            gl.glMatrixMode(GL2.GL_PROJECTION);
+            gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
             gl.glLoadIdentity();
-            gl.glMatrixMode(GL2.GL_MODELVIEW);
+            gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
             gl.glLoadIdentity();
 
             // red below
@@ -82,38 +84,39 @@ public class TestBug605FlippedImageAWT extends UITestCase {
             }
             gl.glFinish();
 
-            final int width = drawable.getWidth();
-            final int height = drawable.getHeight();
+            final int width = drawable.getSurfaceWidth();
+            final int height = drawable.getSurfaceHeight();
 
             final String fname = getSnapshotFilename(0, null, caps, width, height, false, TextureIO.PNG, null);
+            final BufferedImage image;
             try {
-                Screenshot.writeToFile(new File(fname), width, height, false);
-            } catch (GLException e) {
+                image = screenshot.readPixelsToBufferedImage(gl, 0, 0, width, height, true /* awtOrientation */);
+                screenshot.write(new File(fname));
+            } catch (final GLException e) {
                 throw e;
-            } catch (IOException e) {
-                throw new GLException(e);
             }
-            testFlipped(width, height);
+            testFlipped(image, width, height);
         }
 
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
             final GL gl = drawable.getGL();
             System.err.println("GL_RENDERER: "+gl.glGetString(GL.GL_RENDERER));
             System.err.println("GL_VERSION: "+gl.glGetString(GL.GL_VERSION));
+            screenshot = new AWTGLReadBufferUtil(drawable.getGLProfile(), false);
+        }
+        public void reshape(final GLAutoDrawable glDrawable, final int x, final int y, final int w, final int h) {}
+        public void displayChanged(final GLAutoDrawable drawable, final boolean modeChanged, final boolean deviceChanged) {}
+        public void dispose(final GLAutoDrawable drawable) {
+            screenshot.dispose(drawable.getGL());
         }
-        public void reshape(GLAutoDrawable glDrawable, int x, int y, int w, int h) {}
-        public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {}
-        public void dispose(GLAutoDrawable drawable) {}
     }
 
     static final int green = 0x0000ff00; // above
     static final int red   = 0x00ff0000; // below
 
-    private void testFlipped(int width, int height) {
+    private void testFlipped(final BufferedImage image, final int width, final int height) {
         // Default origin 0/0 is lower left corner, so is the memory layout
         // However AWT origin 0/0 is upper left corner
-        final BufferedImage image = Screenshot.readToBufferedImage(width, height);
-
         final int below = image.getRGB(0, height-1) & 0x00ffffff;
         System.err.println("below: 0x"+Integer.toHexString(below));
 
@@ -129,7 +132,7 @@ public class TestBug605FlippedImageAWT extends UITestCase {
         }
     }
 
-    private void test(GLCapabilitiesImmutable caps) {
+    private void test(final GLCapabilitiesImmutable caps) {
 
         final GLDrawableFactory glFactory = GLDrawableFactory.getFactory(caps.getGLProfile());
         final GLAutoDrawable glad = glFactory.createOffscreenAutoDrawable(null, caps, null, 256, 256);
@@ -181,7 +184,7 @@ public class TestBug605FlippedImageAWT extends UITestCase {
         test(caps);
     }
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         org.junit.runner.JUnitCore.main(TestBug605FlippedImageAWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageNEWT.java
index 28fcb98..2d879a6 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestBug605FlippedImageNEWT.java
@@ -37,6 +37,7 @@ import javax.media.opengl.GLCapabilitiesImmutable;
 import javax.media.opengl.GLDrawableFactory;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLProfile;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -49,15 +50,15 @@ import com.jogamp.opengl.util.GLReadBufferUtil;
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestBug605FlippedImageNEWT extends UITestCase {
     static class FlippedImageTest implements GLEventListener {
-        public void display(GLAutoDrawable drawable) {
-            GL2 gl = drawable.getGL().getGL2();
+        public void display(final GLAutoDrawable drawable) {
+            final GL2 gl = drawable.getGL().getGL2();
 
             gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
             gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT | GL.GL_STENCIL_BUFFER_BIT | GL2.GL_ACCUM_BUFFER_BIT );
 
-            gl.glMatrixMode(GL2.GL_PROJECTION);
+            gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
             gl.glLoadIdentity();
-            gl.glMatrixMode(GL2.GL_MODELVIEW);
+            gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
             gl.glLoadIdentity();
 
             // red below
@@ -77,26 +78,26 @@ public class TestBug605FlippedImageNEWT extends UITestCase {
             gl.glFinish();
         }
 
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
             final GL gl = drawable.getGL();
             System.err.println("GL_RENDERER: "+gl.glGetString(GL.GL_RENDERER));
             System.err.println("GL_VERSION: "+gl.glGetString(GL.GL_VERSION));
         }
-        public void reshape(GLAutoDrawable glDrawable, int x, int y, int w, int h) {}
-        public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {}
-        public void dispose(GLAutoDrawable drawable) {}
+        public void reshape(final GLAutoDrawable glDrawable, final int x, final int y, final int w, final int h) {}
+        public void displayChanged(final GLAutoDrawable drawable, final boolean modeChanged, final boolean deviceChanged) {}
+        public void dispose(final GLAutoDrawable drawable) {}
     }
 
     static final int green = 0x0000ff00; // above
     static final int red   = 0x00ff0000; // below
 
-    private int getRGB(ByteBuffer bb, int o) {
+    private int getRGB(final ByteBuffer bb, final int o) {
         return ( bb.get(o+0) & 0x000000ff ) << 16 |
                ( bb.get(o+1) & 0x000000ff ) << 8 |
                ( bb.get(o+2) & 0x000000ff );
     }
 
-    private void testFlipped(ByteBuffer bb, int width, int height, int comp) {
+    private void testFlipped(final ByteBuffer bb, final int width, final int height, final int comp) {
         // Default origin 0/0 is lower left corner, so is the memory layout
 
         // x=0, y=0: RGB -> _RGB [high-byte .. low-byte]
@@ -116,7 +117,7 @@ public class TestBug605FlippedImageNEWT extends UITestCase {
         }
     }
 
-    private void test(GLCapabilitiesImmutable caps) {
+    private void test(final GLCapabilitiesImmutable caps) {
         final GLReadBufferUtil rbu = new GLReadBufferUtil(false, false);
         final GLDrawableFactory glFactory = GLDrawableFactory.getFactory(caps.getGLProfile());
         final GLAutoDrawable glad = glFactory.createOffscreenAutoDrawable(null, caps, null, 256, 256);
@@ -130,7 +131,7 @@ public class TestBug605FlippedImageNEWT extends UITestCase {
         glad.display();
         System.err.println("XXX "+glad.getChosenGLCapabilities());
         System.err.println("XXX "+glad.getContext().getGLVersion());
-        testFlipped((ByteBuffer)rbu.getPixelBuffer().buffer, glad.getWidth(), glad.getHeight(), 3);
+        testFlipped((ByteBuffer)rbu.getPixelBuffer().buffer, glad.getSurfaceWidth(), glad.getSurfaceHeight(), 3);
 
         glad.destroy();
     }
@@ -172,7 +173,7 @@ public class TestBug605FlippedImageNEWT extends UITestCase {
         test(caps);
     }
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         org.junit.runner.JUnitCore.main(TestBug605FlippedImageNEWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1AWT.java
index ba93dcd..7ae9e85 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1AWT.java
@@ -67,14 +67,14 @@ public class TestMultisampleES1AWT extends UITestCase {
   static long durationPerTest = 60; // ms
   private GLCanvas canvas;
 
-  public static void main(String[] args) {
+  public static void main(final String[] args) {
      for(int i=0; i<args.length; i++) {
         if(args[i].equals("-time")) {
             durationPerTest = MiscUtils.atoi(args[++i], 500);
         }
      }
      System.out.println("durationPerTest: "+durationPerTest);
-     String tstname = TestMultisampleES1AWT.class.getName();
+     final String tstname = TestMultisampleES1AWT.class.getName();
      org.junit.runner.JUnitCore.main(tstname);
   }
 
@@ -93,11 +93,11 @@ public class TestMultisampleES1AWT extends UITestCase {
     testMultiSampleAAImpl(8);
   }
 
-  private void testMultiSampleAAImpl(int reqSamples) throws InterruptedException, InvocationTargetException {
+  private void testMultiSampleAAImpl(final int reqSamples) throws InterruptedException, InvocationTargetException {
     final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
-    GLProfile glp = GLProfile.getMaxFixedFunc(true);
-    GLCapabilities caps = new GLCapabilities(glp);
-    GLCapabilitiesChooser chooser = new MultisampleChooser01();
+    final GLProfile glp = GLProfile.getMaxFixedFunc(true);
+    final GLCapabilities caps = new GLCapabilities(glp);
+    final GLCapabilitiesChooser chooser = new MultisampleChooser01();
 
     if(reqSamples>0) {
         caps.setSampleBuffers(true);
@@ -108,12 +108,12 @@ public class TestMultisampleES1AWT extends UITestCase {
     canvas.addGLEventListener(new MultisampleDemoES1(reqSamples>0?true:false));
     canvas.addGLEventListener(new GLEventListener() {
         int displayCount = 0;
-        public void init(GLAutoDrawable drawable) {}
-        public void dispose(GLAutoDrawable drawable) {}
-        public void display(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {}
+        public void dispose(final GLAutoDrawable drawable) {}
+        public void display(final GLAutoDrawable drawable) {
             snapshot(displayCount++, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
         }
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
     });
 
     final Frame frame = new Frame("Multi Samples "+reqSamples);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1NEWT.java
index cf30c50..4996f78 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES1NEWT.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -62,14 +62,14 @@ public class TestMultisampleES1NEWT extends UITestCase {
   static long durationPerTest = 60; // ms
   private GLWindow window;
 
-  public static void main(String[] args) {
+  public static void main(final String[] args) {
      for(int i=0; i<args.length; i++) {
         if(args[i].equals("-time")) {
             durationPerTest = MiscUtils.atoi(args[++i], 500);
         }
      }
      System.out.println("durationPerTest: "+durationPerTest);
-     String tstname = TestMultisampleES1NEWT.class.getName();
+     final String tstname = TestMultisampleES1NEWT.class.getName();
      org.junit.runner.JUnitCore.main(tstname);
   }
 
@@ -113,16 +113,16 @@ public class TestMultisampleES1NEWT extends UITestCase {
     testMultiSampleAAImpl(true, false, 8);
   }
 
-  private void testMultiSampleAAImpl(boolean useFBO, boolean usePBuffer, int reqSamples) throws InterruptedException {
+  private void testMultiSampleAAImpl(final boolean useFBO, final boolean usePBuffer, final int reqSamples) throws InterruptedException {
     final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
-    GLProfile glp = GLProfile.getMaxFixedFunc(true);
-    GLCapabilities caps = new GLCapabilities(glp);
-    GLCapabilitiesChooser chooser = new MultisampleChooser01();
+    final GLProfile glp = GLProfile.getMaxFixedFunc(true);
+    final GLCapabilities caps = new GLCapabilities(glp);
+    final GLCapabilitiesChooser chooser = new MultisampleChooser01();
 
     caps.setAlphaBits(1);
     caps.setFBO(useFBO);
     caps.setPBuffer(usePBuffer);
-    
+
     if(reqSamples>0) {
         caps.setSampleBuffers(true);
         caps.setNumSamples(reqSamples);
@@ -133,12 +133,12 @@ public class TestMultisampleES1NEWT extends UITestCase {
     window.addGLEventListener(new MultisampleDemoES1(reqSamples>0?true:false));
     window.addGLEventListener(new GLEventListener() {
         int displayCount = 0;
-        public void init(GLAutoDrawable drawable) {}
-        public void dispose(GLAutoDrawable drawable) {}
-        public void display(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {}
+        public void dispose(final GLAutoDrawable drawable) {}
+        public void display(final GLAutoDrawable drawable) {
             snapshot(displayCount++, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
         }
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
     });
     window.setSize(512, 512);
     window.setVisible(true);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES2NEWT.java
index 008568f..daac8ad 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestMultisampleES2NEWT.java
@@ -1,22 +1,22 @@
 /*
  * Copyright (c) 2003 Sun Microsystems, Inc. All Rights Reserved.
  * Copyright (c) 2010 JogAmp Community. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
  * met:
- * 
+ *
  * - Redistribution of source code must retain the above copyright
  *   notice, this list of conditions and the following disclaimer.
- * 
+ *
  * - Redistribution in binary form must reproduce the above copyright
  *   notice, this list of conditions and the following disclaimer in the
  *   documentation and/or other materials provided with the distribution.
- * 
+ *
  * Neither the name of Sun Microsystems, Inc. or the names of
  * contributors may be used to endorse or promote products derived from
  * this software without specific prior written permission.
- * 
+ *
  * This software is provided "AS IS," without a warranty of any kind. ALL
  * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
  * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
@@ -29,11 +29,11 @@
  * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
  * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
  * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
- * 
+ *
  * You acknowledge that this software is not designed or intended for use
  * in the design, construction, operation or maintenance of any nuclear
  * facility.
- * 
+ *
  * Sun gratefully acknowledges that this software was originally authored
  * and developed by Kenneth Bradley Russell and Christopher John Kline.
  */
@@ -61,14 +61,14 @@ import com.jogamp.opengl.util.texture.TextureIO;
 public class TestMultisampleES2NEWT extends UITestCase {
   static long durationPerTest = 60; // ms
 
-  public static void main(String[] args) {
+  public static void main(final String[] args) {
      for(int i=0; i<args.length; i++) {
         if(args[i].equals("-time")) {
             durationPerTest = MiscUtils.atoi(args[++i], 500);
         }
      }
      System.out.println("durationPerTest: "+durationPerTest);
-     String tstname = TestMultisampleES2NEWT.class.getName();
+     final String tstname = TestMultisampleES2NEWT.class.getName();
      org.junit.runner.JUnitCore.main(tstname);
   }
 
@@ -102,16 +102,16 @@ public class TestMultisampleES2NEWT extends UITestCase {
     testMultiSampleAAImpl(true, false, 8);
   }
 
-  private void testMultiSampleAAImpl(boolean useFBO, boolean usePBuffer, int reqSamples) throws InterruptedException {
+  private void testMultiSampleAAImpl(final boolean useFBO, final boolean usePBuffer, final int reqSamples) throws InterruptedException {
     final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
-    GLProfile glp = GLProfile.getGL2ES2();
-    GLCapabilities caps = new GLCapabilities(glp);
-    GLCapabilitiesChooser chooser = new MultisampleChooser01();
+    final GLProfile glp = GLProfile.getGL2ES2();
+    final GLCapabilities caps = new GLCapabilities(glp);
+    final GLCapabilitiesChooser chooser = new MultisampleChooser01();
 
     caps.setAlphaBits(1);
     caps.setFBO(useFBO);
     caps.setPBuffer(usePBuffer);
-    
+
     if(reqSamples>0) {
         caps.setSampleBuffers(true);
         caps.setNumSamples(reqSamples);
@@ -122,12 +122,12 @@ public class TestMultisampleES2NEWT extends UITestCase {
     window.addGLEventListener(new MultisampleDemoES2(reqSamples>0?true:false));
     window.addGLEventListener(new GLEventListener() {
         int displayCount = 0;
-        public void init(GLAutoDrawable drawable) {}
-        public void dispose(GLAutoDrawable drawable) {}
-        public void display(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {}
+        public void dispose(final GLAutoDrawable drawable) {}
+        public void display(final GLAutoDrawable drawable) {
             snapshot(displayCount++, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
         }
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
     });
     window.setSize(512, 512);
     window.setVisible(true);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyAWT.java
index 7ba6b09..521d9c2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.caps;
 
 import java.awt.BorderLayout;
@@ -73,23 +73,23 @@ public class TestTranslucencyAWT extends UITestCase {
 
     static Frame getTranslucentFrame() {
         GraphicsConfiguration gc=null;
-        GraphicsDevice[] devices= GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
+        final GraphicsDevice[] devices= GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
         for (int i = 0; i < devices.length ; i++)
         {
-            GraphicsConfiguration[] configs = devices[i].getConfigurations();
+            final GraphicsConfiguration[] configs = devices[i].getConfigurations();
             for (int j = 0; j < configs.length ; j++) {
-                GraphicsConfiguration config = configs[j];
-                ColorModel tcm = config.getColorModel(Transparency.TRANSLUCENT);
-                boolean capable1 = ( null != tcm ) ? tcm.getTransparency() == Transparency.TRANSLUCENT : false;
+                final GraphicsConfiguration config = configs[j];
+                final ColorModel tcm = config.getColorModel(Transparency.TRANSLUCENT);
+                final boolean capable1 = ( null != tcm ) ? tcm.getTransparency() == Transparency.TRANSLUCENT : false;
                 boolean capable2 = false;
                 try {
                     capable2 = ((Boolean)ReflectionUtil.callStaticMethod(
-                                                "com.sun.awt.AWTUtilities", "isTranslucencyCapable", 
-                                                new Class<?>[] { GraphicsConfiguration.class }, 
-                                                new Object[] { config } , 
+                                                "com.sun.awt.AWTUtilities", "isTranslucencyCapable",
+                                                new Class<?>[] { GraphicsConfiguration.class },
+                                                new Object[] { config } ,
                                                 GraphicsConfiguration.class.getClassLoader())).booleanValue();
                     System.err.println("com.sun.awt.AWTUtilities.isTranslucencyCapable(config) passed: "+capable2);
-                } catch (RuntimeException re) {
+                } catch (final RuntimeException re) {
                     System.err.println("com.sun.awt.AWTUtilities.isTranslucencyCapable(config) failed: "+re.getMessage());
                 }
                 System.err.println(i+":"+j+" "+config+", "+tcm+", capable "+capable1+"/"+capable2);
@@ -108,18 +108,18 @@ public class TestTranslucencyAWT extends UITestCase {
         frame.setTitle("AWT Parent Frame (opaque: "+(null==gc)+")");
         return frame;
     }
-    
+
     @Test
     public void test() throws InterruptedException, InvocationTargetException {
         final Frame frame1 = getTranslucentFrame();
         final GLCanvas glCanvas= new GLCanvas(glCaps);
-        
+
         glCanvas.setPreferredSize(size);
 
-        GLEventListener demo1 = new GearsES2(1);
+        final GLEventListener demo1 = new GearsES2(1);
         // setDemoFields(demo1, glCanvas, false);
         glCanvas.addGLEventListener(demo1);
-        GLAnimatorControl animator1 = new Animator(glCanvas);
+        final GLAnimatorControl animator1 = new Animator(glCanvas);
         animator1.start();
 
         final Container cont1 = new Container();
@@ -155,21 +155,21 @@ public class TestTranslucencyAWT extends UITestCase {
         frame1.dispose();
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
             }
         }
-        String tstname = TestTranslucencyAWT.class.getName();
+        final String tstname = TestTranslucencyAWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyNEWT.java
index 8d65fde..10ac941 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/caps/TestTranslucencyNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,22 +20,21 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.caps;
 
 import com.jogamp.newt.event.KeyAdapter;
 import com.jogamp.newt.event.KeyEvent;
 import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
-
 import com.jogamp.opengl.util.Animator;
-
 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
 
 import javax.media.opengl.GLCapabilities;
@@ -60,7 +59,7 @@ public class TestTranslucencyNEWT extends UITestCase {
             glp = GLProfile.get(GLProfile.getDefaultEGLDevice(), GLProfile.GLES2);
         } else */ {
             // default device, somehow ES2 compatible
-            glp = GLProfile.getGL2ES2(); 
+            glp = GLProfile.getGL2ES2();
         }
         Assert.assertNotNull(glp);
         width  = 512;
@@ -71,15 +70,15 @@ public class TestTranslucencyNEWT extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilities caps, boolean undecorated) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
+    protected void runTestGL(final GLCapabilities caps, final boolean undecorated) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle("Gears NEWT Test (translucent "+!caps.isBackgroundOpaque()+")");
         glWindow.setUndecorated(undecorated);
         glWindow.addGLEventListener(new GearsES2());
 
-        Animator animator = new Animator(glWindow);
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final Animator animator = new Animator(glWindow);
+        final QuitAdapter quitAdapter = new QuitAdapter();
 
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -88,10 +87,10 @@ public class TestTranslucencyNEWT extends UITestCase {
 
         final GLWindow f_glWindow = glWindow;
         glWindow.addKeyListener(new KeyAdapter() {
-            public void keyReleased(KeyEvent e) {
+            public void keyReleased(final KeyEvent e) {
                 if( !e.isPrintableKey() || e.isAutoRepeat() ) {
                     return;
-                }            
+                }
                 if(e.getKeyChar()=='f') {
                     new Thread() {
                         public void run() {
@@ -121,40 +120,45 @@ public class TestTranslucencyNEWT extends UITestCase {
 
     @Test
     public void test01OpaqueDecorated() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setBackgroundOpaque(true); // default
         runTestGL(caps, false);
     }
 
     @Test
     public void test01TransparentDecorated() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setBackgroundOpaque(false);
         // This is done implicit now ..
-        // caps.setAlphaBits(1); 
+        // caps.setAlphaBits(1);
         runTestGL(caps, false);
     }
 
     @Test
     public void test01TransparentUndecorated() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setBackgroundOpaque(false);
         // This is done implicit now ..
-        // caps.setAlphaBits(1); 
+        // caps.setAlphaBits(1);
         runTestGL(caps, true);
     }
-    
+
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
+        boolean waitForKey = false;
+
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
-                try {
-                    duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                duration = MiscUtils.atol(args[i], duration);
+            } else if(args[i].equals("-wait")) {
+                waitForKey = true;
             }
         }
+        if( waitForKey ) {
+            UITestCase.waitForKey("main");
+        }
         org.junit.runner.JUnitCore.main(TestTranslucencyNEWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/GLFinishOnDisplay.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/GLFinishOnDisplay.java
index cb76f10..b59cddc 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/GLFinishOnDisplay.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/GLFinishOnDisplay.java
@@ -1,22 +1,29 @@
 /**
- * Copyright (C) 2013 JogAmp Community. All rights reserved.
+ * Copyright 2013 JogAmp Community. All rights reserved.
  *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
  */
 package com.jogamp.opengl.test.junit.jogl.demos;
 
@@ -25,16 +32,16 @@ import javax.media.opengl.GLEventListener;
 
 public class GLFinishOnDisplay implements GLEventListener {
     @Override
-    public void init(GLAutoDrawable drawable) { }
-    
+    public void init(final GLAutoDrawable drawable) { }
+
     @Override
-    public void dispose(GLAutoDrawable drawable) { }
-    
+    public void dispose(final GLAutoDrawable drawable) { }
+
     @Override
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         drawable.getGL().glFinish();
     }
-    
+
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/GearsObject.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/GearsObject.java
index 00d360f..01cc4b7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/GearsObject.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/GearsObject.java
@@ -51,18 +51,18 @@ public abstract class GearsObject {
     public abstract void addInterleavedVertexAndNormalArrays(GLArrayDataServer array, int components);
     public abstract void draw(GL gl, float x, float y, float angle);
 
-    private GLArrayDataServer createInterleavedClone(GLArrayDataServer ads) {
+    private GLArrayDataServer createInterleavedClone(final GLArrayDataServer ads) {
       final GLArrayDataServer n = new GLArrayDataServer(ads);
       n.setInterleavedOffset(0);
       return n;
     }
 
-    private void init(GL gl, GLArrayDataServer array) {
+    private void init(final GL gl, final GLArrayDataServer array) {
         array.enableBuffer(gl, true);
         array.enableBuffer(gl, false);
     }
 
-    public void destroy(GL gl) {
+    public void destroy(final GL gl) {
         if(!isShared) {
             // could be already destroyed by shared configuration
             if(null != frontFace) {
@@ -93,7 +93,7 @@ public abstract class GearsObject {
         isShared = false;
     }
 
-    public GearsObject ( GearsObject shared ) {
+    public GearsObject ( final GearsObject shared ) {
         isShared = true;
         validateBuffers = shared.validateBuffers;
         frontFace = createInterleavedClone(shared.frontFace);
@@ -112,21 +112,21 @@ public abstract class GearsObject {
     }
 
     public GearsObject (
-            GL gl,
-            boolean useMappedBuffers,
-            FloatBuffer gearColor,
-            float inner_radius,
-            float outer_radius,
-            float width, int teeth, float tooth_depth, boolean validateBuffers)
+            final GL gl,
+            final boolean useMappedBuffers,
+            final FloatBuffer gearColor,
+            final float inner_radius,
+            final float outer_radius,
+            final float width, final int teeth, final float tooth_depth, final boolean validateBuffers)
     {
         final float dz = width * 0.5f;
         int i;
         float r0, r1, r2;
         float angle, da;
         float u, v, len;
-        float s[] = new float[5];
-        float c[] = new float[5];
-        float normal[] = new float[3];
+        final float s[] = new float[5];
+        final float c[] = new float[5];
+        final float normal[] = new float[3];
         // final int tris_per_tooth = 32;
 
         this.validateBuffers = validateBuffers;
@@ -320,7 +320,7 @@ public abstract class GearsObject {
         return "GearsObj[0x"+Integer.toHexString(hashCode())+", vbo ff "+ffVBO+", fs "+fsVBO+", bf "+bfVBO+", bs "+bsVBO+"]";
     }
 
-    static void vert(GLArrayDataServer array, float x, float y, float z, float n[]) {
+    static void vert(final GLArrayDataServer array, final float x, final float y, final float z, final float n[]) {
         array.putf(x);
         array.putf(y);
         array.putf(z);
@@ -329,7 +329,7 @@ public abstract class GearsObject {
         array.putf(n[2]);
     }
 
-    static void sincos(float x, float sin[], int sinIdx, float cos[], int cosIdx) {
+    static void sincos(final float x, final float sin[], final int sinIdx, final float cos[], final int cosIdx) {
         sin[sinIdx] = (float) Math.sin(x);
         cos[cosIdx] = (float) Math.cos(x);
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/PointsDemo.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/PointsDemo.java
index 4f2e415..f394ab3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/PointsDemo.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/PointsDemo.java
@@ -32,17 +32,17 @@ import javax.media.opengl.GLEventListener;
 public abstract class PointsDemo implements GLEventListener {
     int swapInterval = 0;
     final int edge = 8; // 8*8
-    
-    public PointsDemo(int swapInterval) {
+
+    public PointsDemo(final int swapInterval) {
         this.swapInterval = swapInterval;
     }
 
     public PointsDemo() {
         this.swapInterval = 1;
     }
-    
+
     public abstract void setSmoothPoints(boolean v);
-    
-    public abstract void setPointParams(float minSize, float maxSize, float distAttenConst, float distAttenLinear, float distAttenQuadratic, float fadeThreshold);    
-        
+
+    public abstract void setPointParams(float minSize, float maxSize, float distAttenConst, float distAttenLinear, float distAttenQuadratic, float fadeThreshold);
+
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureDraw01Accessor.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureDraw01Accessor.java
index 7283a20..a508751 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureDraw01Accessor.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureDraw01Accessor.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,17 +20,17 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos;
 
 import com.jogamp.opengl.util.texture.Texture;
 
 public interface TextureDraw01Accessor {
-    public void setKeepTextureBound(boolean v);    
+    public void setKeepTextureBound(boolean v);
     public Texture getTexture();
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureSequenceDemo01.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureSequenceDemo01.java
deleted file mode 100644
index b015aeb..0000000
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/TextureSequenceDemo01.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package com.jogamp.opengl.test.junit.jogl.demos;
-
-import java.net.URLConnection;
-
-import javax.media.opengl.GL;
-import javax.media.opengl.GLException;
-import javax.media.opengl.GLProfile;
-
-import com.jogamp.common.util.IOUtil;
-import com.jogamp.opengl.util.texture.Texture;
-import com.jogamp.opengl.util.texture.TextureData;
-import com.jogamp.opengl.util.texture.TextureIO;
-import com.jogamp.opengl.util.texture.TextureSequence;
-
-public class TextureSequenceDemo01 implements TextureSequence {
-    TextureSequence.TextureFrame frame = null;
-    int textureUnit = 0;
-    protected int[] texMinMagFilter = { GL.GL_NEAREST, GL.GL_NEAREST };
-    protected int[] texWrapST = { GL.GL_CLAMP_TO_EDGE, GL.GL_CLAMP_TO_EDGE };
-    final boolean useBuildInTexLookup;
-
-    public TextureSequenceDemo01(boolean useBuildInTexLookup) {
-        this.useBuildInTexLookup = useBuildInTexLookup;
-    }
-
-    public void initGLResources(GL gl) throws GLException {
-        if(null == frame) {
-            TextureData texData = null;
-            try {
-                URLConnection urlConn = IOUtil.getResource("jogl/util/data/av/test-ntsc01-57x32.png", this.getClass().getClassLoader());
-                if(null != urlConn) {
-                    texData = TextureIO.newTextureData(GLProfile.getGL2ES2(), urlConn.getInputStream(), false, TextureIO.PNG);
-                }
-            } catch (Exception e) {
-                e.printStackTrace();
-            }
-            final Texture tex = new Texture(gl, texData);
-            frame = new TextureSequence.TextureFrame(tex);
-            tex.bind(gl);
-            gl.glTexParameteri(tex.getTarget(), GL.GL_TEXTURE_MIN_FILTER, texMinMagFilter[0]);
-            gl.glTexParameteri(tex.getTarget(), GL.GL_TEXTURE_MAG_FILTER, texMinMagFilter[1]);
-            gl.glTexParameteri(tex.getTarget(), GL.GL_TEXTURE_WRAP_S, texWrapST[0]);
-            gl.glTexParameteri(tex.getTarget(), GL.GL_TEXTURE_WRAP_T, texWrapST[1]);
-        }
-    }
-
-    public void destroyGLResources(GL gl) {
-        if(null != frame) {
-            frame.getTexture().destroy(gl);
-            frame = null;
-        }
-    }
-
-    public void destroy(GL gl) throws GLException {
-        frame.getTexture().destroy(gl);
-        frame = null;
-    }
-
-    @Override
-    public int getTextureTarget() {
-        return GL.GL_TEXTURE_2D;
-    }
-
-    @Override
-    public int getTextureUnit() {
-        return textureUnit;
-    }
-
-    @Override
-    public int[] getTextureMinMagFilter() {
-        return texMinMagFilter;
-    }
-
-    @Override
-    public int[] getTextureWrapST() {
-        return texWrapST;
-    }
-
-    @Override
-    public TextureSequence.TextureFrame getLastTexture() throws IllegalStateException {
-        return frame; // may return null
-    }
-
-    @Override
-    public TextureSequence.TextureFrame getNextTexture(GL gl) throws IllegalStateException {
-        return frame;
-    }
-
-    @Override
-    public String getRequiredExtensionsShaderStub() throws IllegalStateException {
-        return "// TextTextureSequence: No extensions required\n";
-    }
-
-    @Override
-    public String getTextureSampler2DType() throws IllegalStateException {
-        return "sampler2D" ;
-    }
-
-    private String textureLookupFunctionName = "myTexture2D";
-
-    @Override
-    public String getTextureLookupFunctionName(String desiredFuncName) throws IllegalStateException {
-        if(useBuildInTexLookup) {
-            return "texture2D";
-        }
-        if(null != desiredFuncName && desiredFuncName.length()>0) {
-            textureLookupFunctionName = desiredFuncName;
-        }
-        return textureLookupFunctionName;
-    }
-
-    @Override
-    public String getTextureLookupFragmentShaderImpl() throws IllegalStateException {
-        if(useBuildInTexLookup) {
-          return "";
-        }
-        return
-          "\n"+
-          "vec4 "+textureLookupFunctionName+"(in "+getTextureSampler2DType()+" image, in vec2 texCoord) {\n"+
-          "  return texture2D(image, texCoord);\n"+
-          "}\n\n";
-    }
-}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java
index f4c5e8b..b1df926 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsES1.java
@@ -31,6 +31,8 @@ import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLPipelineFactory;
 import javax.media.opengl.GLProfile;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import com.jogamp.newt.Window;
 import com.jogamp.newt.event.KeyAdapter;
@@ -73,7 +75,7 @@ public class GearsES1 implements GLEventListener {
 
   private int prevMouseX, prevMouseY;
 
-  public GearsES1(int swapInterval) {
+  public GearsES1(final int swapInterval) {
     this.swapInterval = swapInterval;
   }
 
@@ -81,20 +83,20 @@ public class GearsES1 implements GLEventListener {
     this.swapInterval = 1;
   }
 
-  public void setForceFFPEmu(boolean forceFFPEmu, boolean verboseFFPEmu, boolean debugFFPEmu, boolean traceFFPEmu) {
+  public void setForceFFPEmu(final boolean forceFFPEmu, final boolean verboseFFPEmu, final boolean debugFFPEmu, final boolean traceFFPEmu) {
     this.forceFFPEmu = forceFFPEmu;
     this.verboseFFPEmu = verboseFFPEmu;
     this.debugFFPEmu = debugFFPEmu;
     this.traceFFPEmu = traceFFPEmu;
   }
 
-  public void setGearsColors(FloatBuffer gear1Color, FloatBuffer gear2Color, FloatBuffer gear3Color) {
+  public void setGearsColors(final FloatBuffer gear1Color, final FloatBuffer gear2Color, final FloatBuffer gear3Color) {
     this.gear1Color = gear1Color;
     this.gear2Color = gear2Color;
     this.gear3Color = gear3Color;
   }
 
-  public void setSharedGearsObjects(GearsObject g1, GearsObject g2, GearsObject g3) {
+  public void setSharedGearsObjects(final GearsObject g1, final GearsObject g2, final GearsObject g3) {
       gear1 = g1;
       gear2 = g2;
       gear3 = g3;
@@ -117,10 +119,10 @@ public class GearsES1 implements GLEventListener {
 
   public boolean usesSharedGears() { return usesSharedGears; }
 
-  public void setUseMappedBuffers(boolean v) { useMappedBuffers = v; }
-  public void setValidateBuffers(boolean v) { validateBuffers = v; }
+  public void setUseMappedBuffers(final boolean v) { useMappedBuffers = v; }
+  public void setValidateBuffers(final boolean v) { validateBuffers = v; }
 
-  public void init(GLAutoDrawable drawable) {
+  public void init(final GLAutoDrawable drawable) {
     System.err.println(Thread.currentThread()+" GearsES1.init ...");
 
     // Use debug pipeline
@@ -144,13 +146,13 @@ public class GearsES1 implements GLEventListener {
         try {
             // Debug ..
             gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", GL2ES1.class, gl, null) );
-        } catch (Exception e) {e.printStackTrace();}
+        } catch (final Exception e) {e.printStackTrace();}
     }
     if(trace) {
         try {
             // Trace ..
             gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES1.class, gl, new Object[] { System.err } ) );
-        } catch (Exception e) {e.printStackTrace();}
+        } catch (final Exception e) {e.printStackTrace();}
     }
 
     System.err.println("GearsES1 init on "+Thread.currentThread());
@@ -158,11 +160,11 @@ public class GearsES1 implements GLEventListener {
     System.err.println("INIT GL IS: " + gl.getClass().getName());
     System.err.println(JoglVersion.getGLStrings(gl, null, false).toString());
 
-    gl.glLightfv(GL2ES1.GL_LIGHT0, GL2ES1.GL_POSITION, pos, 0);
+    gl.glLightfv(GLLightingFunc.GL_LIGHT0, GLLightingFunc.GL_POSITION, pos, 0);
     gl.glEnable(GL.GL_CULL_FACE);
-    gl.glEnable(GL2ES1.GL_LIGHTING);
-    gl.glEnable(GL2ES1.GL_LIGHT0);
-    gl.glEnable(GL2ES1.GL_DEPTH_TEST);
+    gl.glEnable(GLLightingFunc.GL_LIGHTING);
+    gl.glEnable(GLLightingFunc.GL_LIGHT0);
+    gl.glEnable(GL.GL_DEPTH_TEST);
 
     /* make the gears */
     if(null == gear1) {
@@ -189,7 +191,7 @@ public class GearsES1 implements GLEventListener {
         System.err.println("gear3 reused: "+gear3);
     }
 
-    gl.glEnable(GL2ES1.GL_NORMALIZE);
+    gl.glEnable(GLLightingFunc.GL_NORMALIZE);
 
     final Object upstreamWidget = drawable.getUpstreamWidget();
     if (upstreamWidget instanceof Window) {
@@ -198,35 +200,35 @@ public class GearsES1 implements GLEventListener {
         window.addKeyListener(gearsKeys);
     } else if (GLProfile.isAWTAvailable() && upstreamWidget instanceof java.awt.Component) {
         final java.awt.Component comp = (java.awt.Component) upstreamWidget;
-        new com.jogamp.newt.event.awt.AWTMouseAdapter(gearsMouse).addTo(comp);
-        new com.jogamp.newt.event.awt.AWTKeyAdapter(gearsKeys).addTo(comp);
+        new com.jogamp.newt.event.awt.AWTMouseAdapter(gearsMouse, drawable).addTo(comp);
+        new com.jogamp.newt.event.awt.AWTKeyAdapter(gearsKeys, drawable).addTo(comp);
     }
     System.err.println(Thread.currentThread()+" GearsES1.init FIN");
   }
 
-  public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+  public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
     System.err.println(Thread.currentThread()+" GearsES1.reshape "+x+"/"+y+" "+width+"x"+height+", swapInterval "+swapInterval);
-    GL2ES1 gl = drawable.getGL().getGL2ES1();
+    final GL2ES1 gl = drawable.getGL().getGL2ES1();
 
     gl.setSwapInterval(swapInterval);
 
-    gl.glMatrixMode(GL2ES1.GL_PROJECTION);
+    gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
 
     gl.glLoadIdentity();
     if(height>width) {
-        float h = (float)height / (float)width;
+        final float h = (float)height / (float)width;
         gl.glFrustumf(-1.0f, 1.0f, -h, h, 5.0f, 60.0f);
     } else {
-        float h = (float)width / (float)height;
+        final float h = (float)width / (float)height;
         gl.glFrustumf(-h, h, -1.0f, 1.0f, 5.0f, 60.0f);
     }
-    gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+    gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
     gl.glLoadIdentity();
     gl.glTranslatef(0.0f, 0.0f, -40.0f);
     System.err.println(Thread.currentThread()+" GearsES1.reshape FIN");
   }
 
-  public void dispose(GLAutoDrawable drawable) {
+  public void dispose(final GLAutoDrawable drawable) {
     System.err.println(Thread.currentThread()+" GearsES1.dispose ... ");
     final Object upstreamWidget = drawable.getUpstreamWidget();
     if (upstreamWidget instanceof Window) {
@@ -234,7 +236,7 @@ public class GearsES1 implements GLEventListener {
         window.removeMouseListener(gearsMouse);
         window.removeKeyListener(gearsKeys);
     }
-    GL gl = drawable.getGL();
+    final GL gl = drawable.getGL();
     gear1.destroy(gl);
     gear1 = null;
     gear2.destroy(gl);
@@ -244,12 +246,12 @@ public class GearsES1 implements GLEventListener {
     System.err.println(Thread.currentThread()+" GearsES1.dispose FIN");
   }
 
-  public void display(GLAutoDrawable drawable) {
+  public void display(final GLAutoDrawable drawable) {
     // Turn the gears' teeth
     angle += 2.0f;
 
     // Get the GL corresponding to the drawable we are animating
-    GL2ES1 gl = drawable.getGL().getGL2ES1();
+    final GL2ES1 gl = drawable.getGL().getGL2ES1();
 
     final boolean hasFocus;
     final Object upstreamWidget = drawable.getUpstreamWidget();
@@ -295,8 +297,8 @@ public class GearsES1 implements GLEventListener {
 
 
   class GearsKeyAdapter extends KeyAdapter {
-    public void keyPressed(KeyEvent e) {
-        int kc = e.getKeyCode();
+    public void keyPressed(final KeyEvent e) {
+        final int kc = e.getKeyCode();
         if(KeyEvent.VK_LEFT == kc) {
             view_roty -= 1;
         } else if(KeyEvent.VK_RIGHT == kc) {
@@ -310,32 +312,36 @@ public class GearsES1 implements GLEventListener {
   }
 
   class GearsMouseAdapter extends MouseAdapter {
-      public void mousePressed(MouseEvent e) {
+      public void mousePressed(final MouseEvent e) {
         prevMouseX = e.getX();
         prevMouseY = e.getY();
       }
 
-      public void mouseReleased(MouseEvent e) {
+      public void mouseReleased(final MouseEvent e) {
       }
 
-      public void mouseDragged(MouseEvent e) {
-        int x = e.getX();
-        int y = e.getY();
+      public void mouseDragged(final MouseEvent e) {
+        final int x = e.getX();
+        final int y = e.getY();
         int width=0, height=0;
-        Object source = e.getSource();
+        final Object source = e.getSource();
         if(source instanceof Window) {
-            Window window = (Window) source;
-            width=window.getWidth();
-            height=window.getHeight();
+            final Window window = (Window) source;
+            width=window.getSurfaceWidth();
+            height=window.getSurfaceHeight();
+        } else if (source instanceof GLAutoDrawable) {
+            final GLAutoDrawable glad = (GLAutoDrawable) source;
+            width = glad.getSurfaceWidth();
+            height = glad.getSurfaceHeight();
         } else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) {
-            java.awt.Component comp = (java.awt.Component) source;
-            width=comp.getWidth();
+            final java.awt.Component comp = (java.awt.Component) source;
+            width=comp.getWidth();     // FIXME HiDPI: May need to convert window units -> pixel units!
             height=comp.getHeight();
         } else {
             throw new RuntimeException("Event source neither Window nor Component: "+source);
         }
-        float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)width);
-        float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)height);
+        final float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)width);
+        final float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)height);
 
         prevMouseX = x;
         prevMouseY = y;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java
index 777fb04..bd487ea 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/GearsObjectES1.java
@@ -26,6 +26,7 @@ import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES1;
 import javax.media.opengl.GLBufferStorage;
 import javax.media.opengl.GLException;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
 import javax.media.opengl.fixedfunc.GLPointerFunc;
 
 import com.jogamp.opengl.test.junit.jogl.demos.GearsObject;
@@ -37,13 +38,13 @@ import com.jogamp.opengl.util.GLArrayDataServer;
  */
 public class GearsObjectES1 extends GearsObject {
 
-    public GearsObjectES1(GL gl, boolean useMappedBuffers, FloatBuffer gearColor, float inner_radius,
-            float outer_radius, float width, int teeth, float tooth_depth, boolean validateBuffers) {
+    public GearsObjectES1(final GL gl, final boolean useMappedBuffers, final FloatBuffer gearColor, final float inner_radius,
+            final float outer_radius, final float width, final int teeth, final float tooth_depth, final boolean validateBuffers) {
         super(gl, useMappedBuffers, gearColor, inner_radius, outer_radius, width, teeth, tooth_depth, validateBuffers);
     }
 
     @Override
-    public GLArrayDataServer createInterleaved(boolean useMappedBuffers, int comps, int dataType, boolean normalized, int initialSize, int vboUsage) {
+    public GLArrayDataServer createInterleaved(final boolean useMappedBuffers, final int comps, final int dataType, final boolean normalized, final int initialSize, final int vboUsage) {
         if( useMappedBuffers ) {
             return GLArrayDataServer.createFixedInterleavedMapped(comps, dataType, normalized, initialSize, vboUsage);
         } else {
@@ -52,12 +53,12 @@ public class GearsObjectES1 extends GearsObject {
     }
 
     @Override
-    public void addInterleavedVertexAndNormalArrays(GLArrayDataServer array, int components) {
+    public void addInterleavedVertexAndNormalArrays(final GLArrayDataServer array, final int components) {
         array.addFixedSubArray(GLPointerFunc.GL_VERTEX_ARRAY, components, GL.GL_ARRAY_BUFFER);
         array.addFixedSubArray(GLPointerFunc.GL_NORMAL_ARRAY, components, GL.GL_ARRAY_BUFFER);
     }
 
-    private void draw(GL2ES1 gl, GLArrayDataServer array, int mode) {
+    private void draw(final GL2ES1 gl, final GLArrayDataServer array, final int mode) {
         if( !isShared || gl.glIsBuffer(array.getVBOName()) ) {
             array.enableBuffer(gl, true);
             if( validateBuffers ) {
@@ -80,20 +81,20 @@ public class GearsObjectES1 extends GearsObject {
     }
 
     @Override
-    public void draw(GL _gl, float x, float y, float angle) {
-        GL2ES1 gl = _gl.getGL2ES1();
+    public void draw(final GL _gl, final float x, final float y, final float angle) {
+        final GL2ES1 gl = _gl.getGL2ES1();
         gl.glPushMatrix();
         gl.glTranslatef(x, y, 0f);
         gl.glRotatef(angle, 0f, 0f, 1f);
-        gl.glMaterialfv(GL2ES1.GL_FRONT_AND_BACK, GL2ES1.GL_AMBIENT_AND_DIFFUSE, gearColor);
+        gl.glMaterialfv(GL.GL_FRONT_AND_BACK, GLLightingFunc.GL_AMBIENT_AND_DIFFUSE, gearColor);
 
-        gl.glShadeModel(GL2ES1.GL_FLAT);
+        gl.glShadeModel(GLLightingFunc.GL_FLAT);
         draw(gl, frontFace, GL.GL_TRIANGLE_STRIP);
         draw(gl, frontSide, GL.GL_TRIANGLES);
         draw(gl, backFace, GL.GL_TRIANGLE_STRIP);
         draw(gl, backSide, GL.GL_TRIANGLES);
         draw(gl, outwardFace, GL.GL_TRIANGLE_STRIP);
-        gl.glShadeModel(GL2ES1.GL_SMOOTH);
+        gl.glShadeModel(GLLightingFunc.GL_SMOOTH);
         draw(gl, insideRadiusCyl, GL.GL_TRIANGLE_STRIP);
         gl.glPopMatrix();
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/MultisampleDemoES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/MultisampleDemoES1.java
index 4b4c7f2..681628a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/MultisampleDemoES1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/MultisampleDemoES1.java
@@ -44,6 +44,7 @@ import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES1;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import com.jogamp.opengl.util.ImmModeSink;
 
@@ -52,59 +53,59 @@ public class MultisampleDemoES1 implements GLEventListener {
     boolean multisample;
     ImmModeSink immModeSink;
 
-    public MultisampleDemoES1(boolean multisample) {
+    public MultisampleDemoES1(final boolean multisample) {
         this.multisample = multisample;
     }
 
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         System.err.println();
         System.err.println("Requested: " + drawable.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities());
         System.err.println();
         System.err.println("Chosen   : " + drawable.getChosenGLCapabilities());
         System.err.println();
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
+        final GL2ES1 gl = drawable.getGL().getGL2ES1();
         if (multisample) {
             gl.glEnable(GL.GL_MULTISAMPLE);
         }
         gl.glClearColor(0, 0, 0, 0);
         //      gl.glEnable(GL.GL_DEPTH_TEST);
         //      gl.glDepthFunc(GL.GL_LESS);
-        gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+        gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         gl.glLoadIdentity();
-        gl.glMatrixMode(GL2ES1.GL_PROJECTION);
+        gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         gl.glLoadIdentity();
         gl.glOrtho(-1, 1, -1, 1, -1, 1);
         if (multisample) {
             gl.glDisable(GL.GL_MULTISAMPLE);
         }
-        immModeSink = ImmModeSink.createFixed(40, 
+        immModeSink = ImmModeSink.createFixed(40,
                                               3, GL.GL_FLOAT, // vertex
                                               0, GL.GL_FLOAT, // color
                                               0, GL.GL_FLOAT, // normal
-                                              0, GL.GL_FLOAT, // texCoords 
+                                              0, GL.GL_FLOAT, // texCoords
                                               GL.GL_STATIC_DRAW);
         final int numSteps = 20;
         final double increment = Math.PI / numSteps;
         final double radius = 1;
         immModeSink.glBegin(GL.GL_LINES);
         for (int i = numSteps - 1; i >= 0; i--) {
-            immModeSink.glVertex3f((float) (radius * Math.cos(i * increment)), 
-                                   (float) (radius * Math.sin(i * increment)), 
+            immModeSink.glVertex3f((float) (radius * Math.cos(i * increment)),
+                                   (float) (radius * Math.sin(i * increment)),
                                    0f);
-            immModeSink.glVertex3f((float) (-1.0 * radius * Math.cos(i * increment)), 
-                                   (float) (-1.0 * radius * Math.sin(i * increment)), 
+            immModeSink.glVertex3f((float) (-1.0 * radius * Math.cos(i * increment)),
+                                   (float) (-1.0 * radius * Math.sin(i * increment)),
                                    0f);
         }
         immModeSink.glEnd(gl, false);
     }
 
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         immModeSink.destroy(drawable.getGL());
         immModeSink = null;
     }
 
-    public void display(GLAutoDrawable drawable) {
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
+    public void display(final GLAutoDrawable drawable) {
+        final GL2ES1 gl = drawable.getGL().getGL2ES1();
         if (multisample) {
             gl.glEnable(GL.GL_MULTISAMPLE);
         }
@@ -116,9 +117,9 @@ public class MultisampleDemoES1 implements GLEventListener {
     }
 
     // Unused routines
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
     }
 
-    public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
+    public void displayChanged(final GLAutoDrawable drawable, final boolean modeChanged, final boolean deviceChanged) {
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OlympicES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OlympicES1.java
index 04fe264..9f5940b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OlympicES1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OlympicES1.java
@@ -10,6 +10,8 @@ import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLPipelineFactory;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 import javax.media.opengl.glu.GLU;
 import javax.media.opengl.glu.gl2es1.GLUgl2es1;
 
@@ -28,10 +30,10 @@ public class OlympicES1 implements GLEventListener
     private boolean debug = false ;
     private boolean trace = false ;
 
-    // private static final double M_PI= 3.141592654;
-    private static final double M_2PI= 2*3.141592654;
+    // private static final double M_PI= Math.PI;
+    private static final double M_2PI = 2.0*Math.PI;
 
-    private static final int 
+    private static final int
     // XSIZE=   100,
     // YSIZE=   75,
     RINGS= 5,
@@ -60,36 +62,36 @@ public class OlympicES1 implements GLEventListener
     private int iters[];
     private ImmModeSink theTorus;
 
-    private float lmodel_ambient[] = {0.0f, 0.0f, 0.0f, 0.0f};
-    private float lmodel_twoside[] = {0.0f, 0.0f, 0.0f, 0.0f};
+    private final float lmodel_ambient[] = {0.0f, 0.0f, 0.0f, 0.0f};
+    private final float lmodel_twoside[] = {0.0f, 0.0f, 0.0f, 0.0f};
     // private float lmodel_local[] = {0.0f, 0.0f, 0.0f, 0.0f};
-    private float light0_ambient[] = {0.1f, 0.1f, 0.1f, 1.0f};
-    private float light0_diffuse[] = {1.0f, 1.0f, 1.0f, 0.0f};
-    private float light0_position[] = {0.8660254f, 0.5f, 1f, 0f};
-    private float light0_specular[] = {1.0f, 1.0f, 1.0f, 0.0f};
-    private float bevel_mat_ambient[] = {0.0f, 0.0f, 0.0f, 1.0f};
-    private float bevel_mat_shininess[] = {40.0f, 0f, 0f, 0f};
-    private float bevel_mat_specular[] = {1.0f, 1.0f, 1.0f, 0.0f};
-    private float bevel_mat_diffuse[] = {1.0f, 0.0f, 0.0f, 0.0f};
-    private int swapInterval;
+    private final float light0_ambient[] = {0.1f, 0.1f, 0.1f, 1.0f};
+    private final float light0_diffuse[] = {1.0f, 1.0f, 1.0f, 0.0f};
+    private final float light0_position[] = {0.8660254f, 0.5f, 1f, 0f};
+    private final float light0_specular[] = {1.0f, 1.0f, 1.0f, 0.0f};
+    private final float bevel_mat_ambient[] = {0.0f, 0.0f, 0.0f, 1.0f};
+    private final float bevel_mat_shininess[] = {40.0f, 0f, 0f, 0f};
+    private final float bevel_mat_specular[] = {1.0f, 1.0f, 1.0f, 0.0f};
+    private final float bevel_mat_diffuse[] = {1.0f, 0.0f, 0.0f, 0.0f};
+    private final int swapInterval;
     private GLU glu;
 
     public OlympicES1() {
         swapInterval = 1;
     }
 
-    public OlympicES1(int swapInterval) {
+    public OlympicES1(final int swapInterval) {
         this.swapInterval = swapInterval;
     }
 
-    public void setForceFFPEmu(boolean forceFFPEmu, boolean verboseFFPEmu, boolean debugFFPEmu, boolean traceFFPEmu) {
+    public void setForceFFPEmu(final boolean forceFFPEmu, final boolean verboseFFPEmu, final boolean debugFFPEmu, final boolean traceFFPEmu) {
         this.forceFFPEmu = forceFFPEmu;
         this.verboseFFPEmu = verboseFFPEmu;
         this.debugFFPEmu = debugFFPEmu;
         this.traceFFPEmu = traceFFPEmu;
     }
-    
-    public void init(GLAutoDrawable drawable) 
+
+    public void init(final GLAutoDrawable drawable)
     {
         GL _gl = drawable.getGL();
 
@@ -109,13 +111,13 @@ public class OlympicES1 implements GLEventListener
             try {
                 // Debug ..
                 gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", GL2ES1.class, gl, null) );
-            } catch (Exception e) {e.printStackTrace();} 
+            } catch (final Exception e) {e.printStackTrace();}
         }
         if(trace) {
             try {
                 // Trace ..
                 gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES1.class, gl, new Object[] { System.err } ) );
-            } catch (Exception e) {e.printStackTrace();}
+            } catch (final Exception e) {e.printStackTrace();}
         }
 
         System.err.println("OlympicES1 init on "+Thread.currentThread());
@@ -129,7 +131,8 @@ public class OlympicES1 implements GLEventListener
         System.err.println("GL Profile: "+gl.getGLProfile());
         System.err.println("GL:" + gl + ", " + gl.getContext().getGLVersion());
 
-        glu = GLUgl2es1.createGLU(gl);
+        glu = GLU.createGLU(gl);
+        System.err.println("GLU:" + glu.getClass().getName());
 
         rgb_colors=new byte[RINGS][3];
         mapped_colors=new int [RINGS];
@@ -140,11 +143,11 @@ public class OlympicES1 implements GLEventListener
         iters=new int[RINGS];
 
         int i;
-        float top_y = 1.0f;
-        float bottom_y = 0.0f;
-        float top_z = 0.15f;
-        float bottom_z = 0.69f;
-        float spacing = 2.5f;
+        final float top_y = 1.0f;
+        final float bottom_y = 0.0f;
+        final float top_z = 0.15f;
+        final float bottom_z = 0.69f;
+        final float spacing = 2.5f;
 
         for (i = 0; i < RINGS; i++) {
             rgb_colors[i][0] = rgb_colors[i][1] = rgb_colors[i][2] = (byte)0;
@@ -180,11 +183,11 @@ public class OlympicES1 implements GLEventListener
         dests[GREENRING][1] = bottom_y;
         dests[GREENRING][2] = bottom_z;
 
-        theTorus = ImmModeSink.createFixed(40, 
+        theTorus = ImmModeSink.createFixed(40,
                 3, GL.GL_FLOAT, // vertex
                 0, GL.GL_FLOAT, // color
                 3, GL.GL_FLOAT, // normal
-                0, GL.GL_FLOAT, // texCoords 
+                0, GL.GL_FLOAT, // texCoords
                 GL.GL_STATIC_DRAW);
         FillTorus(gl, theTorus, 0.1f, 8, 1.0f, 25);
 
@@ -193,58 +196,57 @@ public class OlympicES1 implements GLEventListener
         gl.glEnable(GL.GL_DEPTH_TEST);
         gl.glClearDepth(1.0);
 
-        gl.glLightfv(GL2ES1.GL_LIGHT0, GL2ES1.GL_AMBIENT, light0_ambient, 0);
-        gl.glLightfv(GL2ES1.GL_LIGHT0, GL2ES1.GL_DIFFUSE, light0_diffuse, 0);
-        gl.glLightfv(GL2ES1.GL_LIGHT0, GL2ES1.GL_SPECULAR, light0_specular, 0);
-        gl.glLightfv(GL2ES1.GL_LIGHT0, GL2ES1.GL_POSITION, light0_position, 0);
-        gl.glEnable(GL2ES1.GL_LIGHT0);
+        gl.glLightfv(GLLightingFunc.GL_LIGHT0, GLLightingFunc.GL_AMBIENT, light0_ambient, 0);
+        gl.glLightfv(GLLightingFunc.GL_LIGHT0, GLLightingFunc.GL_DIFFUSE, light0_diffuse, 0);
+        gl.glLightfv(GLLightingFunc.GL_LIGHT0, GLLightingFunc.GL_SPECULAR, light0_specular, 0);
+        gl.glLightfv(GLLightingFunc.GL_LIGHT0, GLLightingFunc.GL_POSITION, light0_position, 0);
+        gl.glEnable(GLLightingFunc.GL_LIGHT0);
 
         // gl.glLightModelfv(GL2.GL_LIGHT_MODEL_LOCAL_VIEWER, lmodel_local, 0);
         gl.glLightModelfv(GL2ES1.GL_LIGHT_MODEL_TWO_SIDE, lmodel_twoside, 0);
         gl.glLightModelfv(GL2ES1.GL_LIGHT_MODEL_AMBIENT, lmodel_ambient, 0);
-        gl.glEnable(GL2ES1.GL_LIGHTING);
+        gl.glEnable(GLLightingFunc.GL_LIGHTING);
 
         gl.glClearColor(0.5f, 0.5f, 0.5f, 0.0f);
 
-        gl.glMaterialfv(GL.GL_FRONT, GL2ES1.GL_AMBIENT, bevel_mat_ambient, 0);
-        gl.glMaterialfv(GL.GL_FRONT, GL2ES1.GL_SHININESS, bevel_mat_shininess, 0);
-        gl.glMaterialfv(GL.GL_FRONT, GL2ES1.GL_SPECULAR, bevel_mat_specular, 0);
-        gl.glMaterialfv(GL.GL_FRONT, GL2ES1.GL_DIFFUSE, bevel_mat_diffuse, 0);
+        gl.glMaterialfv(GL.GL_FRONT, GLLightingFunc.GL_AMBIENT, bevel_mat_ambient, 0);
+        gl.glMaterialfv(GL.GL_FRONT, GLLightingFunc.GL_SHININESS, bevel_mat_shininess, 0);
+        gl.glMaterialfv(GL.GL_FRONT, GLLightingFunc.GL_SPECULAR, bevel_mat_specular, 0);
+        gl.glMaterialfv(GL.GL_FRONT, GLLightingFunc.GL_DIFFUSE, bevel_mat_diffuse, 0);
 
         // gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL2ES1.GL_DIFFUSE);
-        gl.glEnable(GL2ES1.GL_COLOR_MATERIAL);
-        gl.glShadeModel(GL2ES1.GL_SMOOTH);
+        gl.glEnable(GLLightingFunc.GL_COLOR_MATERIAL);
+        gl.glShadeModel(GLLightingFunc.GL_SMOOTH);
 
-        ReInit();        
+        ReInit();
         t0 = System.currentTimeMillis();
         tL = t0;
     }
 
 
     @Override
-    public void dispose(GLAutoDrawable glad) {
-        glu.destroy();
+    public void dispose(final GLAutoDrawable glad) {
         glu = null;
         theTorus.destroy(glad.getGL());
-        theTorus = null;        
+        theTorus = null;
     }
 
 
     @Override
-    public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
-        final GL2ES1 gl = glad.getGL().getGL2ES1();        
+    public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
+        final GL2ES1 gl = glad.getGL().getGL2ES1();
         gl.setSwapInterval(swapInterval);
 
-        gl.glMatrixMode(GL2ES1.GL_PROJECTION);
+        gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         gl.glLoadIdentity();
         glu.gluPerspective(45f, (float) width / (float) height, 0.1f, 100.0f);
-        gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+        gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         gl.glLoadIdentity();
         glu.gluLookAt(0, 0, 10, 0, 0, 0, 0, 1, 0);
     }
 
     @Override
-    public void display(GLAutoDrawable glad) {
+    public void display(final GLAutoDrawable glad) {
         final GL2ES1 gl = glad.getGL().getGL2ES1();
         int i;
 
@@ -254,7 +256,7 @@ public class OlympicES1 implements GLEventListener
         for (i = 0; i < RINGS; i++) {
             gl.glColor4ub(rgb_colors[i][0], rgb_colors[i][1], rgb_colors[i][2], (byte)1);
             gl.glPushMatrix();
-            gl.glTranslatef(dests[i][0] + offsets[i][0], 
+            gl.glTranslatef(dests[i][0] + offsets[i][0],
                     dests[i][1] + offsets[i][1],
                     dests[i][2] + offsets[i][2]);
             gl.glRotatef(angs[i], rotAxis[i][0], rotAxis[i][1], rotAxis[i][2]);
@@ -267,11 +269,11 @@ public class OlympicES1 implements GLEventListener
 
     long t0, tL;
 
-    protected void animationCalc() 
+    protected void animationCalc()
     {
         int i, j;
 
-        long t1 = System.currentTimeMillis();
+        final long t1 = System.currentTimeMillis();
         if( t1 - tL < 50 ) {
             return;
         }
@@ -311,7 +313,7 @@ public class OlympicES1 implements GLEventListener
         }
     }
 
-    protected static void FillTorus(GL gl, ImmModeSink immModeSink, float rc, int numc, float rt, int numt)
+    protected static void FillTorus(final GL gl, final ImmModeSink immModeSink, final float rc, final int numc, final float rt, final int numt)
     {
         int i, j, k;
         double s, t;
@@ -339,7 +341,7 @@ public class OlympicES1 implements GLEventListener
         }
     }
 
-    protected float Clamp(int iters_left, float t)
+    protected float Clamp(final int iters_left, final float t)
     {
         if (iters_left < 3) {
             return 0.0f;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OneTriangle.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OneTriangle.java
index 4b05f1a..aaa7da3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OneTriangle.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/OneTriangle.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -30,6 +30,7 @@ package com.jogamp.opengl.test.junit.jogl.demos.es1;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES1;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 import javax.media.opengl.glu.GLU;
 import javax.media.opengl.glu.gl2es1.GLUgl2es1;
 
@@ -41,31 +42,31 @@ import com.jogamp.opengl.util.ImmModeSink;
  */
 public class OneTriangle {
 
-    public static void setup( GL2ES1 gl, int width, int height ) {
-        gl.glMatrixMode( GL2ES1.GL_PROJECTION );
+    public static void setup( final GL2ES1 gl, final int width, final int height ) {
+        gl.glMatrixMode( GLMatrixFunc.GL_PROJECTION );
         gl.glLoadIdentity();
 
         // coordinate system origin at lower left with width and height same as the window
-        GLU glu = new GLUgl2es1();
+        final GLU glu = new GLUgl2es1();
         glu.gluOrtho2D( 0.0f, width, 0.0f, height );
 
-        gl.glMatrixMode( GL2ES1.GL_MODELVIEW );
+        gl.glMatrixMode( GLMatrixFunc.GL_MODELVIEW );
         gl.glLoadIdentity();
 
-        gl.glViewport( 0, 0, width, height );        
+        gl.glViewport( 0, 0, width, height );
     }
 
-    public static void render( GL2ES1 gl, int width, int height) {
+    public static void render( final GL2ES1 gl, final int width, final int height) {
         gl.glClear( GL.GL_COLOR_BUFFER_BIT );
 
         // draw a triangle filling the window
         gl.glLoadIdentity();
-        
-        ImmModeSink immModeSink = ImmModeSink.createFixed(3*3, 
+
+        final ImmModeSink immModeSink = ImmModeSink.createFixed(3*3,
                                                           3, GL.GL_FLOAT, // vertex
                                                           3, GL.GL_FLOAT, // color
                                                           0, GL.GL_FLOAT, // normal
-                                                          0, GL.GL_FLOAT, // texCoords 
+                                                          0, GL.GL_FLOAT, // texCoords
                                                           GL.GL_STATIC_DRAW);
         immModeSink.glBegin(GL.GL_TRIANGLES);
         immModeSink.glColor3f( 1, 0, 0 );
@@ -73,7 +74,7 @@ public class OneTriangle {
         immModeSink.glColor3f( 0, 1, 0 );
         immModeSink.glVertex2f( width, 0 );
         immModeSink.glColor3f( 0, 0, 1 );
-        immModeSink.glVertex2f( width / 2, height );
+        immModeSink.glVertex2f( width / 2f, height );
         immModeSink.glEnd(gl, true);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/PointsDemoES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/PointsDemoES1.java
index 5f0c99a..3aced12 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/PointsDemoES1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/PointsDemoES1.java
@@ -41,6 +41,8 @@ import javax.media.opengl.GL2ES1;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLPipelineFactory;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
+import javax.media.opengl.fixedfunc.GLPointerFunc;
 import javax.media.opengl.glu.GLU;
 import javax.media.opengl.glu.gl2es1.GLUgl2es1;
 
@@ -58,24 +60,24 @@ public class PointsDemoES1 extends PointsDemo {
     final int edge = 8; // 8*8
     boolean smooth = false;
 
-    public PointsDemoES1(int swapInterval) {
+    public PointsDemoES1(final int swapInterval) {
         this.swapInterval = swapInterval;
     }
 
     public PointsDemoES1() {
         this.swapInterval = 1;
     }
-        
-    public void setForceFFPEmu(boolean forceFFPEmu, boolean verboseFFPEmu, boolean debugFFPEmu, boolean traceFFPEmu) {
+
+    public void setForceFFPEmu(final boolean forceFFPEmu, final boolean verboseFFPEmu, final boolean debugFFPEmu, final boolean traceFFPEmu) {
         this.forceFFPEmu = forceFFPEmu;
         this.verboseFFPEmu = verboseFFPEmu;
         this.debugFFPEmu = debugFFPEmu;
         this.traceFFPEmu = traceFFPEmu;
     }
-    
-    public void setSmoothPoints(boolean v) { smooth = v; }
-    
-    public void init(GLAutoDrawable glad) {
+
+    public void setSmoothPoints(final boolean v) { smooth = v; }
+
+    public void init(final GLAutoDrawable glad) {
         GL _gl = glad.getGL();
 
         if(debugFFPEmu) {
@@ -89,27 +91,27 @@ public class PointsDemoES1 extends PointsDemo {
             trace = false;
         }
         GL2ES1 gl = FixedFuncUtil.wrapFixedFuncEmul(_gl, ShaderSelectionMode.AUTO, null, forceFFPEmu, verboseFFPEmu);
-        
+
         if(debug) {
             try {
                 // Debug ..
                 gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", GL2ES1.class, gl, null) );
-            } catch (Exception e) {e.printStackTrace();} 
+            } catch (final Exception e) {e.printStackTrace();}
         }
         if(trace) {
             try {
                 // Trace ..
                 gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES1.class, gl, new Object[] { System.err } ) );
-            } catch (Exception e) {e.printStackTrace();}
-        }                
-        
+            } catch (final Exception e) {e.printStackTrace();}
+        }
+
         System.err.println("GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
         System.err.println("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
         System.err.println("GL_VERSION: " + gl.glGetString(GL.GL_VERSION));
         System.err.println("GL Profile: "+gl.getGLProfile());
-        
+
         // Allocate Vertex Array
-        vertices = GLArrayDataServer.createFixed(GL2ES1.GL_VERTEX_ARRAY, 3, GL.GL_FLOAT, false, edge*edge, GL.GL_STATIC_DRAW);
+        vertices = GLArrayDataServer.createFixed(GLPointerFunc.GL_VERTEX_ARRAY, 3, GL.GL_FLOAT, false, edge*edge, GL.GL_STATIC_DRAW);
         pointSizes = new float[edge*edge];
         for(int i=0; i<edge; i++) {
             for(int j=0; j<edge; j++) {
@@ -125,10 +127,10 @@ public class PointsDemoES1 extends PointsDemo {
         vertices.enableBuffer(gl, false);
 
         // OpenGL Render Settings
-        gl.glEnable(GL2ES1.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_DEPTH_TEST);
     }
 
-    public void setPointParams(float minSize, float maxSize, float distAttenConst, float distAttenLinear, float distAttenQuadratic, float fadeThreshold) {
+    public void setPointParams(final float minSize, final float maxSize, final float distAttenConst, final float distAttenLinear, final float distAttenQuadratic, final float fadeThreshold) {
         pointMinSize = minSize;
         pointMaxSize = maxSize;
         pointFadeThreshold = fadeThreshold;
@@ -136,25 +138,25 @@ public class PointsDemoES1 extends PointsDemo {
         pointDistAtten.put(1, distAttenLinear);
         pointDistAtten.put(2, distAttenQuadratic);
     }
-    
+
     /** default values */
     private float pointMinSize = 0.0f;
     private float pointMaxSize = 4096.0f;
     private float pointFadeThreshold = 1.0f;
     private final FloatBuffer pointDistAtten = Buffers.newDirectFloatBuffer(new float[] {  1.0f, 0.0f, 0.0f });
 
-    public void display(GLAutoDrawable glad) {
-        GL2ES1 gl = glad.getGL().getGL2ES1();
+    public void display(final GLAutoDrawable glad) {
+        final GL2ES1 gl = glad.getGL().getGL2ES1();
         gl.glClearColor(0f, 0f, 0f, 0f);
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
-        gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+        gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         gl.glLoadIdentity();
         gl.glTranslatef(0, 0, -10);
 
         gl.glColor4f(1.0f, 1.0f, 1.0f, 1.0f );
-        
+
         vertices.enableBuffer(gl, true);
-        
+
         gl.glEnable ( GL.GL_BLEND );
         gl.glBlendFunc ( GL.GL_SRC_ALPHA, GL.GL_ONE );
         if(smooth) {
@@ -164,35 +166,35 @@ public class PointsDemoES1 extends PointsDemo {
         }
         gl.glPointParameterf(GL2ES1.GL_POINT_SIZE_MIN, pointMinSize );
         gl.glPointParameterf(GL2ES1.GL_POINT_SIZE_MAX, pointMaxSize );
-        gl.glPointParameterf(GL2ES1.GL_POINT_FADE_THRESHOLD_SIZE, pointFadeThreshold);
+        gl.glPointParameterf(GL.GL_POINT_FADE_THRESHOLD_SIZE, pointFadeThreshold);
         gl.glPointParameterfv(GL2ES1.GL_POINT_DISTANCE_ATTENUATION, pointDistAtten );
-        
+
         for(int i=edge*edge-1; i>=0; i--) {
             gl.glPointSize(pointSizes[i]);
-            gl.glDrawArrays(GL.GL_POINTS, i, 1);            
-        }        
-        
+            gl.glDrawArrays(GL.GL_POINTS, i, 1);
+        }
+
         vertices.enableBuffer(gl, false);
     }
 
-    public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
         // Thread.dumpStack();
-        GL2ES1 gl = glad.getGL().getGL2ES1();
-        
-        if(-1 != swapInterval) {        
+        final GL2ES1 gl = glad.getGL().getGL2ES1();
+
+        if(-1 != swapInterval) {
             gl.setSwapInterval(swapInterval); // in case switching the drawable (impl. may bound attribute there)
         }
-        
+
         // Set location in front of camera
-        gl.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         gl.glLoadIdentity();
         glu.gluPerspective(45.0F, ( (float) width / (float) height ) / 1.0f, 1.0F, 100.0F);
         //gl.glOrthof(-4.0f, 4.0f, -4.0f, 4.0f, 1.0f, 100.0f);
     }
 
-    public void dispose(GLAutoDrawable glad) {
-        GL2ES1 gl = glad.getGL().getGL2ES1();
+    public void dispose(final GLAutoDrawable glad) {
+        final GL2ES1 gl = glad.getGL().getGL2ES1();
         vertices.destroy(gl);
         vertices = null;
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/RedSquareES1.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/RedSquareES1.java
index 5891bce..1f81261 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/RedSquareES1.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/RedSquareES1.java
@@ -32,7 +32,7 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
     long startTime = 0;
     long curTime = 0;
 
-    public RedSquareES1(int swapInterval) {
+    public RedSquareES1(final int swapInterval) {
         this.swapInterval = swapInterval;
     }
 
@@ -41,33 +41,33 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
     }
 
     @Override
-    public void addTileRendererNotify(TileRendererBase tr) {
+    public void addTileRendererNotify(final TileRendererBase tr) {
         tileRendererInUse = tr;
         doRotateBeforePrinting = doRotate;
         setDoRotation(false);
     }
     @Override
-    public void removeTileRendererNotify(TileRendererBase tr) {
+    public void removeTileRendererNotify(final TileRendererBase tr) {
         tileRendererInUse = null;
         setDoRotation(doRotateBeforePrinting);
     }
     @Override
-    public void startTileRendering(TileRendererBase tr) {
+    public void startTileRendering(final TileRendererBase tr) {
         System.err.println("RedSquareES1.startTileRendering: "+tr);
     }
     @Override
-    public void endTileRendering(TileRendererBase tr) {
+    public void endTileRendering(final TileRendererBase tr) {
         System.err.println("RedSquareES1.endTileRendering: "+tr);
     }
 
-    public void setDoRotation(boolean rotate) { this.doRotate = rotate; }
-    public void setForceFFPEmu(boolean forceFFPEmu, boolean verboseFFPEmu, boolean debugFFPEmu, boolean traceFFPEmu) {
+    public void setDoRotation(final boolean rotate) { this.doRotate = rotate; }
+    public void setForceFFPEmu(final boolean forceFFPEmu, final boolean verboseFFPEmu, final boolean debugFFPEmu, final boolean traceFFPEmu) {
         this.forceFFPEmu = forceFFPEmu;
         this.verboseFFPEmu = verboseFFPEmu;
         this.debugFFPEmu = debugFFPEmu;
         this.traceFFPEmu = traceFFPEmu;
     }
-    public void setFlipVerticalInGLOrientation(boolean v) { flipVerticalInGLOrientation=v; }
+    public void setFlipVerticalInGLOrientation(final boolean v) { flipVerticalInGLOrientation=v; }
 
     // FIXME: we must add storage of the pointers in the GL state to
     // the GLImpl classes. The need for this can be seen by making
@@ -80,7 +80,7 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
     private FloatBuffer vertices;
 
     @Override
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         System.err.println(Thread.currentThread()+" RedSquareES1.init ...");
         GL _gl = drawable.getGL();
 
@@ -100,13 +100,13 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
             try {
                 // Debug ..
                 gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", GL2ES1.class, gl, null) );
-            } catch (Exception e) {e.printStackTrace();}
+            } catch (final Exception e) {e.printStackTrace();}
         }
         if(trace) {
             try {
                 // Trace ..
                 gl = (GL2ES1) gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES1.class, gl, new Object[] { System.err } ) );
-            } catch (Exception e) {e.printStackTrace();}
+            } catch (final Exception e) {e.printStackTrace();}
         }
 
         System.err.println("RedSquareES1 init on "+Thread.currentThread());
@@ -139,7 +139,7 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
     }
 
     @Override
-    public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
         final GL2ES1 gl = glad.getGL().getGL2ES1();
         if(-1 != swapInterval) {
             gl.setSwapInterval(swapInterval);
@@ -148,15 +148,15 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
     }
 
     @Override
-    public void reshapeTile(TileRendererBase tr,
-                            int tileX, int tileY, int tileWidth, int tileHeight,
-                            int imageWidth, int imageHeight) {
+    public void reshapeTile(final TileRendererBase tr,
+                            final int tileX, final int tileY, final int tileWidth, final int tileHeight,
+                            final int imageWidth, final int imageHeight) {
         final GL2ES1 gl = tr.getAttachedDrawable().getGL().getGL2ES1();
         gl.setSwapInterval(0);
         reshapeImpl(gl, tileX, tileY, tileWidth, tileHeight, imageWidth, imageHeight);
     }
 
-    void reshapeImpl(GL2ES1 gl, int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight) {
+    void reshapeImpl(final GL2ES1 gl, final int tileX, final int tileY, final int tileWidth, final int tileHeight, final int imageWidth, final int imageHeight) {
         System.err.println(Thread.currentThread()+" RedSquareES1.reshape "+tileX+"/"+tileY+" "+tileWidth+"x"+tileHeight+" of "+imageWidth+"x"+imageHeight+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(gl.getContext().getGLDrawable().getHandle())+", tileRendererInUse "+tileRendererInUse);
 
         // Set location in front of camera
@@ -196,9 +196,9 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
     }
 
     @Override
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         curTime = System.currentTimeMillis();
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
+        final GL2ES1 gl = drawable.getGL().getGL2ES1();
         if( null != tileRendererInUse ) {
             gl.glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
         } else {
@@ -210,7 +210,7 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
         gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         gl.glLoadIdentity();
         gl.glTranslatef(0, 0, -10);
-        float ang = doRotate ? ((curTime - startTime) * 360.0f) / 4000.0f : 1f;
+        final float ang = doRotate ? ((curTime - startTime) * 360.0f) / 4000.0f : 1f;
         gl.glRotatef(ang, 0, 0, 1);
         gl.glRotatef(ang, 0, 1, 0);
 
@@ -223,9 +223,9 @@ public class RedSquareES1 implements GLEventListener, TileRendererBase.TileRende
     }
 
     @Override
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         System.err.println(Thread.currentThread()+" RedSquareES1.dispose ... ");
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
+        final GL2ES1 gl = drawable.getGL().getGL2ES1();
         gl.glDisableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
         gl.glDisableClientState(GLPointerFunc.GL_COLOR_ARRAY);
         colors.clear();
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestGearsES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestGearsES1NEWT.java
index 8abb0cc..a093cc0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestGearsES1NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestGearsES1NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.es1.newt;
 
 import com.jogamp.newt.event.KeyAdapter;
@@ -66,8 +66,8 @@ public class TestGearsES1NEWT extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilities caps, boolean forceFFPEmu) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
+    protected void runTestGL(final GLCapabilities caps, final boolean forceFFPEmu) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle("Gears NEWT Test");
 
@@ -77,8 +77,8 @@ public class TestGearsES1NEWT extends UITestCase {
         final SnapshotGLEventListener snap = new SnapshotGLEventListener();
         glWindow.addGLEventListener(snap);
 
-        Animator animator = new Animator(glWindow);
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final Animator animator = new Animator(glWindow);
+        final QuitAdapter quitAdapter = new QuitAdapter();
 
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -87,10 +87,10 @@ public class TestGearsES1NEWT extends UITestCase {
 
         final GLWindow f_glWindow = glWindow;
         glWindow.addKeyListener(new KeyAdapter() {
-            public void keyReleased(KeyEvent e) {
+            public void keyReleased(final KeyEvent e) {
                 if( !e.isPrintableKey() || e.isAutoRepeat() ) {
                     return;
-                }            
+                }
                 if(e.getKeyChar()=='f') {
                     new Thread() {
                         public void run() {
@@ -121,19 +121,19 @@ public class TestGearsES1NEWT extends UITestCase {
 
     @Test
     public void test00() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES1());
+        final GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES1());
         runTestGL(caps, forceFFPEmu);
     }
-    
+
     static long duration = 500; // ms
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             } else if(args[i].equals("-vsync")) {
                 i++;
                 swapInterval = MiscUtils.atoi(args[i], swapInterval);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestOlympicES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestOlympicES1NEWT.java
index c12ef95..a29e9a3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestOlympicES1NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestOlympicES1NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.es1.newt;
 
 import com.jogamp.newt.opengl.GLWindow;
@@ -33,8 +33,8 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
 import com.jogamp.opengl.test.junit.jogl.demos.es1.OlympicES1;
-
 import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
 
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLProfile;
@@ -65,34 +65,34 @@ public class TestOlympicES1NEWT extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilities caps) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
+    protected void runTestGL(final GLCapabilities caps) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle("Olympic NEWT Test");
 
-        OlympicES1 demo = new OlympicES1( swapInterval );
-        demo.setForceFFPEmu(forceFFPEmu, verboseFFPEmu, false, false);        
-        glWindow.addGLEventListener(demo);        
+        final OlympicES1 demo = new OlympicES1( swapInterval );
+        demo.setForceFFPEmu(forceFFPEmu, verboseFFPEmu, false, false);
+        glWindow.addGLEventListener(demo);
         final SnapshotGLEventListener snap = new SnapshotGLEventListener();
         glWindow.addGLEventListener(snap);
 
-        Animator animator = new Animator();
-        animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+        final Animator animator = new Animator();
+        animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
         animator.setExclusiveContext(exclusiveContext);
-        
-        QuitAdapter quitAdapter = new QuitAdapter();
+
+        final QuitAdapter quitAdapter = new QuitAdapter();
         glWindow.addKeyListener(quitAdapter);
         glWindow.addWindowListener(quitAdapter);
         glWindow.setSize(width, height);
         glWindow.setVisible(true);
-        
+
         animator.add(glWindow);
         animator.start();
         animator.setUpdateFPSFrames(60, System.err);
         Assert.assertTrue(animator.isStarted());
         Assert.assertTrue(animator.isAnimating());
         Assert.assertEquals(exclusiveContext ? animator.getThread() : null, glWindow.getExclusiveContextThread());
-        
+
         snap.setMakeSnapshot();
 
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
@@ -109,19 +109,19 @@ public class TestOlympicES1NEWT extends UITestCase {
 
     @Test
     public void test00() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES1());
+        final GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES1());
         runTestGL(caps);
     }
 
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             } else if(args[i].equals("-vsync")) {
                 i++;
                 swapInterval = MiscUtils.atoi(args[i], swapInterval);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestRedSquareES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestRedSquareES1NEWT.java
index 200936f..c164990 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestRedSquareES1NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es1/newt/TestRedSquareES1NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.es1.newt;
 
 import com.jogamp.newt.event.KeyAdapter;
@@ -64,8 +64,8 @@ public class TestRedSquareES1NEWT extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilities caps, boolean forceFFPEmu) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
+    protected void runTestGL(final GLCapabilities caps, final boolean forceFFPEmu) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle("Gears NEWT Test");
 
@@ -75,8 +75,8 @@ public class TestRedSquareES1NEWT extends UITestCase {
         final SnapshotGLEventListener snap = new SnapshotGLEventListener();
         glWindow.addGLEventListener(snap);
 
-        Animator animator = new Animator(glWindow);
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final Animator animator = new Animator(glWindow);
+        final QuitAdapter quitAdapter = new QuitAdapter();
 
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -85,10 +85,10 @@ public class TestRedSquareES1NEWT extends UITestCase {
 
         final GLWindow f_glWindow = glWindow;
         glWindow.addKeyListener(new KeyAdapter() {
-            public void keyReleased(KeyEvent e) {
+            public void keyReleased(final KeyEvent e) {
                 if( !e.isPrintableKey() || e.isAutoRepeat() ) {
                     return;
-                }            
+                }
                 if(e.getKeyChar()=='f') {
                     new Thread() {
                         public void run() {
@@ -119,19 +119,19 @@ public class TestRedSquareES1NEWT extends UITestCase {
 
     @Test
     public void test00() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES1());
+        final GLCapabilities caps = new GLCapabilities(forceES2 ? GLProfile.get(GLProfile.GLES2) : GLProfile.getGL2ES1());
         runTestGL(caps, forceFFPEmu);
     }
-    
+
     static long duration = 1000; // ms
 
-    public static void main(String args[]) {        
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             } else if(args[i].equals("-es2")) {
                 forceES2 = true;
             } else if(args[i].equals("-ffpemu")) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/ElektronenMultiplizierer.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/ElektronenMultiplizierer.java
index 3120a18..c54dad4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/ElektronenMultiplizierer.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/ElektronenMultiplizierer.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -40,6 +40,7 @@ import javax.media.opengl.GLCapabilitiesImmutable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLProfile;
 import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import com.jogamp.common.nio.Buffers;
 import com.jogamp.newt.event.KeyAdapter;
@@ -54,36 +55,36 @@ import com.jogamp.opengl.util.glsl.ShaderState;
 /**
  * <pre>
  *   __ __|_  ___________________________________________________________________________  ___|__ __
- *  //    /\                                           _                                  /\    \\  
- * //____/  \__     __ _____ _____ _____ _____ _____  | |     __ _____ _____ __        __/  \____\\ 
- *  \    \  / /  __|  |     |   __|  _  |     |  _  | | |  __|  |     |   __|  |      /\ \  /    /  
- *   \____\/_/  |  |  |  |  |  |  |     | | | |   __| | | |  |  |  |  |  |  |  |__   "  \_\/____/   
- *  /\    \     |_____|_____|_____|__|__|_|_|_|__|    | | |_____|_____|_____|_____|  _  /    /\     
- * /  \____\                       http://jogamp.org  |_|                              /____/  \    
- * \  /   "' _________________________________________________________________________ `"   \  /    
+ *  //    /\                                           _                                  /\    \\
+ * //____/  \__     __ _____ _____ _____ _____ _____  | |     __ _____ _____ __        __/  \____\\
+ *  \    \  / /  __|  |     |   __|  _  |     |  _  | | |  __|  |     |   __|  |      /\ \  /    /
+ *   \____\/_/  |  |  |  |  |  |  |     | | | |   __| | | |  |  |  |  |  |  |  |__   "  \_\/____/
+ *  /\    \     |_____|_____|_____|__|__|_|_|_|__|    | | |_____|_____|_____|_____|  _  /    /\
+ * /  \____\                       http://jogamp.org  |_|                              /____/  \
+ * \  /   "' _________________________________________________________________________ `"   \  /
  *  \/____.                                                                             .____\/
- * </pre>     
+ * </pre>
  *
  * <p>
- * JOGL2 port of my PC 4k intro competition entry for Revision 2011. Sure it got a little bigger 
+ * JOGL2 port of my PC 4k intro competition entry for Revision 2011. Sure it got a little bigger
  * while porting but the shader and control code remained more or less untouched. The intro renders
- * a fullscreen billboard using a single fragment shader. The shader encapsulates basically two 
+ * a fullscreen billboard using a single fragment shader. The shader encapsulates basically two
  * different routines: A sphere-tracing based raymarcher for a single fractal formula and a bitmap
  * orbit trap julia+mandelbrot fractal renderer. Additionally an inline-processing analog-distortion
  * filter is applied to all rendered fragments to make the overall look more interesting.
  * </p>
  *
  * <p>
- * The different intro parts are all parameter variations of the two routines in the fragment shader 
+ * The different intro parts are all parameter variations of the two routines in the fragment shader
  * synched to the music: Parts 3+5 are obviously the mandelbrot and julia bitmap orbit traps, and parts
  * 1,2,4 and 6 are pure fractal sphere tracing.
  * </p>
  *
  * <p>
  * During the development of the intro it turned out that perfectly raymarching every pixel of the orbit
- * trapped julia+mandelbrot fractal was way to slow even on highend hardware. So I inserted a lowres 
+ * trapped julia+mandelbrot fractal was way to slow even on highend hardware. So I inserted a lowres
  * intermediate FBO to be used by the bitmap based orbit trap routine wich was ofcourse way faster, but
- * had the obvious upscaling artefacts. Maybe I'll produce a perfect quality version for very patient 
+ * had the obvious upscaling artefacts. Maybe I'll produce a perfect quality version for very patient
  * people with insane hardware :)
  * </p>
  *
@@ -119,21 +120,21 @@ public class ElektronenMultiplizierer implements GLEventListener {
 
 //BEGIN --- BaseGlobalEnvironment replacement ---
 
-    private final GLCapabilities mCaps; 
+    private final GLCapabilities mCaps;
     // private final GLU mGlu;
 
-    private String      mCommandLineParameter_BaseRoutineClassName;
-    private boolean     mCommandLineParameter_MultiSampling;
-    private int         mCommandLineParameter_NumberOfSampleBuffers;
-    private boolean     mCommandLineParameter_AnisotropicFiltering;
-    private float       mCommandLineParameter_AnisotropyLevel;
-    private boolean     mCommandLineParameter_FrameCapture;
-    private boolean     mCommandLineParameter_FrameSkip;
+    private final String      mCommandLineParameter_BaseRoutineClassName;
+    private final boolean     mCommandLineParameter_MultiSampling;
+    private final int         mCommandLineParameter_NumberOfSampleBuffers;
+    private final boolean     mCommandLineParameter_AnisotropicFiltering;
+    private final float       mCommandLineParameter_AnisotropyLevel;
+    private final boolean     mCommandLineParameter_FrameCapture;
+    private final boolean     mCommandLineParameter_FrameSkip;
     private boolean     mUsesFullScreenMode;
     private int         mFrameCounter;
-    private int         mCommandLineParameter_FrameRate;
+    private final int         mCommandLineParameter_FrameRate;
     private long        mFrameSkipAverageFramerateTimeStart;
-    private long        mFrameSkipAverageFramerateTimeEnd; 
+    private long        mFrameSkipAverageFramerateTimeEnd;
     private boolean     mFrameSkipManual;
     // private int         mSkippedFramesCounter;
 //    private BaseMusic mBaseMusic;
@@ -145,7 +146,7 @@ public class ElektronenMultiplizierer implements GLEventListener {
     private GLUniformData mScreenDimensionUniform;
     private GLArrayDataServer vertices0;
     // private GLArrayDataServer texCoords0;
-    
+
     public String   getBaseRoutineClassName()       { return mCommandLineParameter_BaseRoutineClassName; }
     public boolean  preferMultiSampling()           { return mCommandLineParameter_MultiSampling; }
     public int      getNumberOfSamplingBuffers()    { return mCommandLineParameter_NumberOfSampleBuffers; }
@@ -157,24 +158,24 @@ public class ElektronenMultiplizierer implements GLEventListener {
     public boolean  usesFullScreenMode()            { return mUsesFullScreenMode; }
 
     class TimeShiftKeys extends KeyAdapter {
-        public void keyPressed(KeyEvent e) {
+        public void keyPressed(final KeyEvent e) {
             if(KeyEvent.VK_RIGHT == e.getKeyCode()) {
                 skipFrames(120);
             } else if(KeyEvent.VK_LEFT == e.getKeyCode()) {
                 skipFrames(-120);
-            }                
-        }    
+            }
+        }
     }
     TimeShiftKeys timeShiftKeys;
-    
+
     public ElektronenMultiplizierer (
-            String inBaseRoutineClassName,
-            boolean inMultiSampling,
-            int inNumberOfSampleBuffers,
-            boolean inAnisotropicFiltering,
-            float inAnisotropyLevel,
-            boolean inFrameCapture,
-            boolean inFrameSkip, int desiredFrameRate, int startFrame
+            final String inBaseRoutineClassName,
+            final boolean inMultiSampling,
+            final int inNumberOfSampleBuffers,
+            final boolean inAnisotropicFiltering,
+            final float inAnisotropyLevel,
+            final boolean inFrameCapture,
+            final boolean inFrameSkip, final int desiredFrameRate, final int startFrame
     ) {
         // mGlu = new GLU();
         mCommandLineParameter_BaseRoutineClassName = inBaseRoutineClassName;
@@ -195,42 +196,42 @@ public class ElektronenMultiplizierer implements GLEventListener {
             mCaps.setAccumGreenBits(1);
             mCaps.setAccumRedBits(1);
             // turns out we need to have alpha, otherwise no AA will be visible
-            mCaps.setAlphaBits(1); 
+            mCaps.setAlphaBits(1);
         }
-        
+
         mFrameSkipAverageFramerateTimeStart = 0;
-        mFrameCounter = 0;        
+        mFrameCounter = 0;
         skipFrames(startFrame);
         timeShiftKeys = new TimeShiftKeys();
     }
-    
+
     public ElektronenMultiplizierer() {
-        this(null, false, -1, false, -1.0f, false, true, 30, 0);        
+        this(null, false, -1, false, -1.0f, false, true, 30, 0);
     }
-    
+
     /**
      * skip frames by turning back start time
-     * @param frames positive or negative values 
+     * @param frames positive or negative values
      */
-    public void skipFrames(int frames) {
+    public void skipFrames(final int frames) {
         final long dft = 1000000000/mCommandLineParameter_FrameRate;
         mFrameSkipAverageFramerateTimeStart -= frames * dft ;
         mFrameSkipManual = true;
     }
-    
+
     public GLCapabilitiesImmutable getGLCapabilities() {
         return mCaps;
     }
 
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         if(drawable instanceof GLWindow) {
             final GLWindow glw = (GLWindow) drawable;
             glw.addKeyListener(0, timeShiftKeys);
         }
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
         gl.setSwapInterval(1);
 
-        st = new ShaderState();        
+        st = new ShaderState();
         final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(), "shader",
                 "shader/bin", "default", true);
         final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(), "shader",
@@ -238,48 +239,48 @@ public class ElektronenMultiplizierer implements GLEventListener {
           //    "shader", "shader/bin", "elektronenmultiplizierer_port", true);
         vp0.defaultShaderCustomization(gl, true, true);
         fp0.defaultShaderCustomization(gl, true, true);
-        
+
         final ShaderProgram sp0 = new ShaderProgram();
         sp0.add(gl, vp0, System.err);
-        sp0.add(gl, fp0, System.err);       
+        sp0.add(gl, fp0, System.err);
         st.attachShaderProgram(gl, sp0, true);
-                
-        final float XRESf = (float) drawable.getWidth();
-        final float YRESf = (float) drawable.getHeight();
+
+        final float XRESf = drawable.getSurfaceWidth();
+        final float YRESf = drawable.getSurfaceHeight();
 
         mScreenDimensionUniform = new GLUniformData("resolution", 2, Buffers.newDirectFloatBuffer(2));
         final FloatBuffer mScreenDimensionV = (FloatBuffer) mScreenDimensionUniform.getBuffer();
         mScreenDimensionV.put(0, XRESf);
         mScreenDimensionV.put(1, YRESf);
-        st.ownUniform(mScreenDimensionUniform);       
-        st.uniform(gl, mScreenDimensionUniform);        
-        
+        st.ownUniform(mScreenDimensionUniform);
+        st.uniform(gl, mScreenDimensionUniform);
+
         pmvMatrix = new PMVMatrix();
         pmvMatrixUniform = new GLUniformData("gcu_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
         st.ownUniform(pmvMatrixUniform);
         st.uniform(gl, pmvMatrixUniform);
-                 
+
         vertices0 = GLArrayDataServer.createGLSL("gca_Vertices", 2, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
         vertices0.putf(0);     vertices0.putf(YRESf);
         vertices0.putf(XRESf); vertices0.putf(YRESf);
         vertices0.putf(0);     vertices0.putf(0);
         vertices0.putf(XRESf); vertices0.putf(0);
-        vertices0.seal(gl, true);        
+        vertices0.seal(gl, true);
         st.ownAttribute(vertices0, true);
         vertices0.enableBuffer(gl, false);
-        
+
         /**
         texCoords0 = GLArrayDataServer.createGLSL("gca_TexCoords", 2, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
         texCoords0.putf(0f); texCoords0.putf(1f);
         texCoords0.putf(1f);  texCoords0.putf(1f);
-        texCoords0.putf(0f);  texCoords0.putf(0f);        
+        texCoords0.putf(0f);  texCoords0.putf(0f);
         texCoords0.putf(1f); texCoords0.putf(0f);
         texCoords0.seal(gl, true);
         st.ownAttribute(texCoords0, true);
         texCoords0.enableBuffer(gl, false); */
 
         //generate framebufferobject
-        int[] result = new int[1];
+        final int[] result = new int[1];
         gl.glGenTextures(1, result, 0);
         mFrameBufferTextureID = result[0];
         gl.glBindTexture(GL_TEXTURE_2D, mFrameBufferTextureID);
@@ -308,20 +309,20 @@ public class ElektronenMultiplizierer implements GLEventListener {
         // if NO music is used sync to mainloop start ...
         // (add up current time due to possible turned back start time by skip frames)
         mFrameSkipAverageFramerateTimeStart += System.nanoTime();
-        
+
 //        mBaseMusic = new BaseMusic(BaseGlobalEnvironment.getInstance().getMusicFileName());
 //        mBaseMusic.init();
 //        mBaseMusic.play();
     }
 
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         if (wantsFrameSkip()) {
             mFrameSkipAverageFramerateTimeEnd = System.nanoTime();
-            double tDesiredFrameRate = (float)getDesiredFramerate();
-            double tSingleFrameTime = 1000000000.0f/tDesiredFrameRate;
-            double tElapsedTime = mFrameSkipAverageFramerateTimeEnd - mFrameSkipAverageFramerateTimeStart;
-            double mFrameCounterTargetValue = tElapsedTime/tSingleFrameTime;
-            double mFrameCounterDifference = mFrameCounterTargetValue-mFrameCounter;
+            final double tDesiredFrameRate = getDesiredFramerate();
+            final double tSingleFrameTime = 1000000000.0f/tDesiredFrameRate;
+            final double tElapsedTime = mFrameSkipAverageFramerateTimeEnd - mFrameSkipAverageFramerateTimeStart;
+            final double mFrameCounterTargetValue = tElapsedTime/tSingleFrameTime;
+            final double mFrameCounterDifference = mFrameCounterTargetValue-mFrameCounter;
             if (mFrameSkipManual || mFrameCounterDifference>2) {
                 mFrameCounter+=mFrameCounterDifference;
                 // mSkippedFramesCounter+=mFrameCounterDifference;
@@ -331,11 +332,11 @@ public class ElektronenMultiplizierer implements GLEventListener {
             }
             mFrameSkipManual = false;
         }
-       
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
-        final int XRES = drawable.getWidth();
-        final int YRES = drawable.getHeight();
+
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+        final int XRES = drawable.getSurfaceWidth();
+        final int YRES = drawable.getSurfaceHeight();
 
 //        if (!getBaseMusic().isOffline()) {
 //            //if music IS used sync to first second of music ...
@@ -349,7 +350,7 @@ public class ElektronenMultiplizierer implements GLEventListener {
 //        mBaseMusic.synchonizeMusic();
 
         //use this for offline rendering/capture ...
-        int MMTime_u_ms = (int)((((float)mFrameCounter)*44100.0f)/60.0f);
+        int MMTime_u_ms = (int)(((mFrameCounter)*44100.0f)/60.0f);
         //use this for music synched rendering ...
         //int MMTime_u_ms = (int)(BaseRoutineRuntime.getInstance().getBaseMusic().getPositionInMilliseconds()*(44100.0f/1000.0f));
         //dedicated sync variable for each event ... kinda lame but who cares X-)
@@ -362,7 +363,7 @@ public class ElektronenMultiplizierer implements GLEventListener {
         if (MMTime_u_ms>=4438408 && !mSyncEvent_07) { mSyncEvent_07 = true; handleSyncEvent(MMTime_u_ms); }
         if (MMTime_u_ms>=5482831 && !mSyncEvent_08) { mSyncEvent_08 = true; handleSyncEvent(MMTime_u_ms); }
         //calculate current time based on 60fps reference framerate ...
-        MMTime_u_ms = (int)((((float)mFrameCounter)*44100.0f)/60.0f);
+        MMTime_u_ms = (int)(((mFrameCounter)*44100.0f)/60.0f);
         gl.glDisable(GL_CULL_FACE);
         gl.glDisable(GL_DEPTH_TEST);
 
@@ -371,13 +372,13 @@ public class ElektronenMultiplizierer implements GLEventListener {
         vertices0.enableBuffer(gl, true);
         // texCoords0.enableBuffer(gl, true);
 
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glOrthof(0f, XRES, YRES, 0f, -1f, 1f);
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
         st.uniform(gl, pmvMatrixUniform);
-        
+
         gl.glActiveTexture(GL_TEXTURE0);
 
         //gogogo! O-)
@@ -385,8 +386,8 @@ public class ElektronenMultiplizierer implements GLEventListener {
         if (tBrightnessSync<1) {
             tBrightnessSync=1;
         }
-        mEffectTime = (float)((MMTime_u_ms-mEffectSyncTime)/100000.0f);
-        
+        mEffectTime = (MMTime_u_ms-mEffectSyncTime)/100000.0f;
+
         if (mSyncEventNumber==0 && mEffectTime<4.0f) {
             //fadein and fullscreen rotate
             tBrightnessSync = mEffectTime/4.0f;
@@ -394,12 +395,12 @@ public class ElektronenMultiplizierer implements GLEventListener {
              //fullscrenn mushroom transform
              tBrightnessSync = 1.0f-((mEffectTime-12.0f)/3.5f);
         }
-        
+
         if (mSyncEventNumber==0 || mSyncEventNumber==1) {
              //zoomin from fog
              mEffectNumber = 3;
              mEffectTime *= 1.75;
-             float tEffectTimeMax = 9.3f; 
+             final float tEffectTimeMax = 9.3f;
              if (mEffectTime>=tEffectTimeMax) {
                  mEffectTime=tEffectTimeMax;
              }
@@ -424,10 +425,10 @@ public class ElektronenMultiplizierer implements GLEventListener {
              mEffectNumber = 6;
              mEffectTime *= 0.364f;
         }
-         
+
         gl.glBindFramebuffer(GL_FRAMEBUFFER, mFrameBufferObjectID);
-        // gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());                
-        GLUniformData en = st.getUniform("en");
+        // gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
+        final GLUniformData en = st.getUniform("en");
         if(mSyncEventNumber==7) {
              en.setData(2);
         }
@@ -437,8 +438,8 @@ public class ElektronenMultiplizierer implements GLEventListener {
              en.setData(0);
         }
         st.uniform(gl, en);
-         
-        GLUniformData et = st.getUniform("et");
+
+        final GLUniformData et = st.getUniform("et");
         st.uniform(gl, et.setData(9.1f));
 
         st.uniform(gl, st.getUniform("tm").setData(MMTime_u_ms/40000.0f));
@@ -447,7 +448,7 @@ public class ElektronenMultiplizierer implements GLEventListener {
         if(mSyncEventNumber==4 || mSyncEventNumber==7) {
            //render to fbo only when using julia/mandel orbittrap ...
            // gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-           gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);        
+           gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
         }
         gl.glBindFramebuffer(GL_FRAMEBUFFER, 0);
         st.uniform(gl, en.setData(mEffectNumber));
@@ -459,19 +460,19 @@ public class ElektronenMultiplizierer implements GLEventListener {
         gl.glBindTexture(GL_TEXTURE_2D, mFrameBufferTextureID);
 
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
-        gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);        
+        gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
 
         vertices0.enableBuffer(gl, false);
-        // texCoords0.enableBuffer(gl, false);         
+        // texCoords0.enableBuffer(gl, false);
         st.useProgram(gl, false);
 
         //---
         mFrameCounter++;
     }
 
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
         st.useProgram(gl, true);
         vertices0.seal(false);
         vertices0.rewind();
@@ -479,34 +480,34 @@ public class ElektronenMultiplizierer implements GLEventListener {
         vertices0.putf(width); vertices0.putf(height);
         vertices0.putf(0);     vertices0.putf(0);
         vertices0.putf(width); vertices0.putf(0);
-        vertices0.seal(gl, true);        
+        vertices0.seal(gl, true);
         st.ownAttribute(vertices0, true);
         vertices0.enableBuffer(gl, false);
-        
+
         final FloatBuffer mScreenDimensionV = (FloatBuffer) mScreenDimensionUniform.getBuffer();
-        mScreenDimensionV.put(0, (float) width);
-        mScreenDimensionV.put(1, (float) height);
+        mScreenDimensionV.put(0, width);
+        mScreenDimensionV.put(1, height);
         st.uniform(gl, mScreenDimensionUniform);
 
         st.useProgram(gl, false);
-        gl.glViewport(0, 0, width, height);                
+        gl.glViewport(0, 0, width, height);
     }
 
-    public void dispose(GLAutoDrawable drawable) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+    public void dispose(final GLAutoDrawable drawable) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
         gl.glDeleteFramebuffers(1, new int[] { mFrameBufferObjectID }, 0);
         gl.glDeleteTextures(1, new int[] { mFrameBufferTextureID }, 0);
         st.destroy(gl);
         if(drawable instanceof GLWindow) {
             final GLWindow glw = (GLWindow) drawable;
             glw.removeKeyListener(timeShiftKeys);
-        }      
+        }
     }
 
 //    public BaseMusic getBaseMusic() {
 //        return mBaseMusic;
 //    }
-    
+
     public void resetFrameCounter() {
         mFrameCounter = 0;
     }
@@ -530,7 +531,7 @@ public class ElektronenMultiplizierer implements GLEventListener {
     protected boolean mSyncEvent_07;
     protected boolean mSyncEvent_08;
 
-    public void handleSyncEvent(int inMMTime_u_ms) {
+    public void handleSyncEvent(final int inMMTime_u_ms) {
         mSyncTime = inMMTime_u_ms;
         mSyncEventNumber++;
         System.out.println("NEW SYNC EVENT! tSyncEventNumber="+mSyncEventNumber+" tSyncTime="+mSyncTime);
@@ -538,5 +539,5 @@ public class ElektronenMultiplizierer implements GLEventListener {
             mEffectSyncTime = inMMTime_u_ms;
         }
     }
-    
+
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java
index add11ff..6cd9723 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/FBOMix2DemosES2.java
@@ -1,22 +1,29 @@
 /**
- * Copyright (C) 2011 JogAmp Community. All rights reserved.
+ * Copyright 2011 JogAmp Community. All rights reserved.
  *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
  */
 package com.jogamp.opengl.test.junit.jogl.demos.es2;
 
@@ -44,134 +51,134 @@ public class FBOMix2DemosES2 implements GLEventListener {
     private final int swapInterval;
     private int numSamples;
     private boolean demo0Only;
-    
-    
+
+
     private final ShaderState st;
     private final PMVMatrix pmvMatrix;
-    
-    private final FBObject fbo0;    
+
+    private final FBObject fbo0;
     private final FBObject fbo1;
-    
+
     private TextureAttachment fbo0Tex;
     private TextureAttachment fbo1Tex;
-        
+
     private ShaderProgram sp0;
     private GLUniformData pmvMatrixUniform;
     private GLArrayDataServer interleavedVBO;
     private GLUniformData texUnit0;
     private GLUniformData texUnit1;
-    
-    public FBOMix2DemosES2(int swapInterval) {
+
+    public FBOMix2DemosES2(final int swapInterval) {
         demo0 = new GearsES2(-1);
         demo0.setIgnoreFocus(true);
         demo1 = new RedSquareES2(-1);
         this.swapInterval = swapInterval;
-        
+
         st = new ShaderState();
-        // st.setVerbose(true);        
+        // st.setVerbose(true);
         pmvMatrix = new PMVMatrix();
-        
-        fbo0 = new FBObject();        
+
+        fbo0 = new FBObject();
         fbo1 = new FBObject();
-        
+
         numSamples = 0;
         demo0Only = false;
     }
-    
-    public void setDemo0Only(boolean v) { 
-        this.demo0Only = v; 
+
+    public void setDemo0Only(final boolean v) {
+        this.demo0Only = v;
     }
     public boolean getDemo0Only() { return demo0Only; }
-    
-    public void setMSAA(int numSamples) { 
-        this.numSamples=numSamples; 
+
+    public void setMSAA(final int numSamples) {
+        this.numSamples=numSamples;
     }
     public int getMSAA() { return numSamples; }
-    
-    public void setDoRotation(boolean rotate) { demo1.setDoRotation(rotate); }
-    
+
+    public void setDoRotation(final boolean rotate) { demo1.setDoRotation(rotate); }
+
     @Override
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
+
         demo0.init(drawable);
         demo1.init(drawable);
-        
+
         final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, FBOMix2DemosES2.class, "shader",
                 "shader/bin", "texture01_xxx", true);
         final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, FBOMix2DemosES2.class, "shader",
                 "shader/bin", "texture02_xxx", true);
         vp0.defaultShaderCustomization(gl, true, true);
         fp0.defaultShaderCustomization(gl, true, true);
-        
+
         sp0 = new ShaderProgram();
         sp0.add(gl, vp0, System.err);
-        sp0.add(gl, fp0, System.err);       
+        sp0.add(gl, fp0, System.err);
         st.attachShaderProgram(gl, sp0, true);
-        
+
         pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
-        st.ownUniform(pmvMatrixUniform);       
+        st.ownUniform(pmvMatrixUniform);
         st.uniform(gl, pmvMatrixUniform);
-        
+
         interleavedVBO = GLArrayDataServer.createGLSLInterleaved(3+4+2, GL.GL_FLOAT, false, 3*4, GL.GL_STATIC_DRAW);
-        {        
-            interleavedVBO.addGLSLSubArray("mgl_Vertex",        3, GL.GL_ARRAY_BUFFER);            
-            interleavedVBO.addGLSLSubArray("mgl_Color",         4, GL.GL_ARRAY_BUFFER);            
+        {
+            interleavedVBO.addGLSLSubArray("mgl_Vertex",        3, GL.GL_ARRAY_BUFFER);
+            interleavedVBO.addGLSLSubArray("mgl_Color",         4, GL.GL_ARRAY_BUFFER);
             //interleavedVBO.addGLSLSubArray("mgl_Normal",        3, GL.GL_ARRAY_BUFFER);
             interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
 
-            FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
-            
+            final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
+
             for(int i=0; i<4; i++) {
                 ib.put(s_quadVertices,  i*3, 3);
-                ib.put(s_quadColors,    i*4, 4);  
+                ib.put(s_quadColors,    i*4, 4);
                 //ib.put(s_cubeNormals,   i*3, 3);
                 ib.put(s_quadTexCoords, i*2, 2);
-            }                        
+            }
         }
         interleavedVBO.seal(gl, true);
         interleavedVBO.enableBuffer(gl, false);
         st.ownAttribute(interleavedVBO, true);
-                
+
         texUnit0 = new GLUniformData("mgl_Texture0", 0);
-        st.ownUniform(texUnit0);       
+        st.ownUniform(texUnit0);
         st.uniform(gl, texUnit0);
         texUnit1 = new GLUniformData("mgl_Texture1", 1);
-        st.ownUniform(texUnit1);       
+        st.ownUniform(texUnit1);
         st.uniform(gl, texUnit1);
-        
+
         st.useProgram(gl, false);
-        
+
         System.err.println("**** Init");
         initFBOs(gl, drawable);
-        
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);        
+
+        gl.glEnable(GL.GL_DEPTH_TEST);
     }
-    
-    private void initFBOs(GL gl, GLAutoDrawable drawable) {
+
+    private void initFBOs(final GL gl, final GLAutoDrawable drawable) {
         // remove all texture attachments, since MSAA uses just color-render-buffer
         // and non-MSAA uses texture2d-buffer
         fbo0.detachAllColorbuffer(gl);
         fbo1.detachAllColorbuffer(gl);
-            
-        fbo0.reset(gl, drawable.getWidth(), drawable.getHeight(), numSamples, false);
-        fbo1.reset(gl, drawable.getWidth(), drawable.getHeight(), numSamples, false);
+
+        fbo0.reset(gl, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), numSamples, false);
+        fbo1.reset(gl, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), numSamples, false);
         if(fbo0.getNumSamples() != fbo1.getNumSamples()) {
             throw new InternalError("sample size mismatch: \n\t0: "+fbo0+"\n\t1: "+fbo1);
-        }        
+        }
         numSamples = fbo0.getNumSamples();
-        
+
         if(numSamples>0) {
             fbo0.attachColorbuffer(gl, 0, true);
             fbo0.resetSamplingSink(gl);
             fbo1.attachColorbuffer(gl, 0, true);
             fbo1.resetSamplingSink(gl);
-            fbo0Tex = fbo0.getSamplingSink();
-            fbo1Tex = fbo1.getSamplingSink();
+            fbo0Tex = fbo0.getSamplingSink().getTextureAttachment();
+            fbo1Tex = fbo1.getSamplingSink().getTextureAttachment();
         } else {
             fbo0Tex = fbo0.attachTexture2D(gl, 0, true);
             fbo1Tex = fbo1.attachTexture2D(gl, 0, true);
-        }        
+        }
         numSamples=fbo0.getNumSamples();
         fbo0.attachRenderbuffer(gl, Type.DEPTH, 24);
         fbo0.unbind(gl);
@@ -179,31 +186,31 @@ public class FBOMix2DemosES2 implements GLEventListener {
         fbo1.unbind(gl);
     }
 
-    private void resetFBOs(GL gl, GLAutoDrawable drawable) {
-        fbo0.reset(gl, drawable.getWidth(), drawable.getHeight(), numSamples, true);
-        fbo1.reset(gl, drawable.getWidth(), drawable.getHeight(), numSamples, true);
+    private void resetFBOs(final GL gl, final GLAutoDrawable drawable) {
+        fbo0.reset(gl, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), numSamples, true);
+        fbo1.reset(gl, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), numSamples, true);
         if(fbo0.getNumSamples() != fbo1.getNumSamples()) {
             throw new InternalError("sample size mismatch: \n\t0: "+fbo0+"\n\t1: "+fbo1);
-        }        
+        }
         numSamples = fbo0.getNumSamples();
         if(numSamples>0) {
-            fbo0Tex = fbo0.getSamplingSink();
-            fbo1Tex = fbo1.getSamplingSink();
+            fbo0Tex = fbo0.getSamplingSink().getTextureAttachment();
+            fbo1Tex = fbo1.getSamplingSink().getTextureAttachment();
         } else {
-            fbo0Tex = (TextureAttachment) fbo0.getColorbuffer(0);
-            fbo1Tex = (TextureAttachment) fbo1.getColorbuffer(0);
-        }        
+            fbo0Tex = fbo0.getColorbuffer(0).getTextureAttachment();
+            fbo1Tex = fbo1.getColorbuffer(0).getTextureAttachment();
+        }
     }
-    
+
     @Override
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
         demo0.dispose(drawable);
         demo1.dispose(drawable);
         fbo0.destroy(gl);
         fbo1.destroy(gl);
         st.destroy(gl);
-        
+
         fbo0Tex = null;
         fbo1Tex = null;
         sp0 = null;
@@ -212,32 +219,32 @@ public class FBOMix2DemosES2 implements GLEventListener {
     }
 
     @Override
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
 
         if( fbo0.getNumSamples() != numSamples ) {
             System.err.println("**** NumSamples: "+fbo0.getNumSamples()+" -> "+numSamples);
             resetFBOs(gl, drawable);
         }
-        
+
         if(0 < numSamples) {
             gl.glEnable(GL.GL_MULTISAMPLE);
         }
-        
+
         fbo0.bind(gl);
         demo0.display(drawable);
         fbo0.unbind(gl);
-        
+
         if(!demo0Only) {
             fbo1.bind(gl);
             demo1.display(drawable);
             fbo1.unbind(gl);
         }
-        
+
         st.useProgram(gl, true);
         gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
-        
+
         gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit0.intValue());
         fbo0.use(gl, fbo0Tex);
         if(!demo0Only) {
@@ -245,68 +252,68 @@ public class FBOMix2DemosES2 implements GLEventListener {
             fbo1.use(gl, fbo1Tex);
         }
         interleavedVBO.enableBuffer(gl, true);
-        
+
         if( !gl.isGLcore() ) {
             gl.glEnable(GL.GL_TEXTURE_2D);
         }
-        
+
         gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
-        
+
         interleavedVBO.enableBuffer(gl, false);
         fbo0.unuse(gl);
         if(!demo0Only) {
             fbo1.unuse(gl);
         }
-        
-        st.useProgram(gl, false);        
+
+        st.useProgram(gl, false);
     }
 
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
-        if(-1 != swapInterval) {        
+
+        if(-1 != swapInterval) {
             gl.setSwapInterval(swapInterval); // in case switching the drawable (impl. may bound attribute there)
         }
-        
+
         System.err.println("**** Reshape: "+width+"x"+height);
-        resetFBOs(gl, drawable);            
-        
+        resetFBOs(gl, drawable);
+
         fbo0.bind(gl);
         demo0.reshape(drawable, x, y, width, height);
         fbo0.unbind(gl);
         fbo1.bind(gl);
         demo1.reshape(drawable, x, y, width, height);
         fbo1.unbind(gl);
-        
+
         pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 10.0f);
 
         pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
-        
+
         st.useProgram(gl, true);
         st.uniform(gl, pmvMatrixUniform);
         st.useProgram(gl, false);
-        
+
     }
 
-    private static final float[] s_quadVertices = { 
+    private static final float[] s_quadVertices = {
       -1f, -1f, 0f, // LB
        1f, -1f, 0f, // RB
       -1f,  1f, 0f, // LT
-       1f,  1f, 0f  // RT 
+       1f,  1f, 0f  // RT
     };
-    private static final float[] s_quadColors = { 
+    private static final float[] s_quadColors = {
       1f, 1f, 1f, 1f,
       1f, 1f, 1f, 1f,
       1f, 1f, 1f, 1f,
       1f, 1f, 1f, 1f };
-    private static final float[] s_quadTexCoords = { 
+    private static final float[] s_quadTexCoords = {
             0f, 0f, // LB
             1f, 0f, // RB
-            0f, 1f, // LT   
+            0f, 1f, // LT
             1f, 1f  // RT
     };
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
index 653937a..84cd893 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsES2.java
@@ -31,12 +31,19 @@ import com.jogamp.newt.event.MouseListener;
 import com.jogamp.newt.event.PinchToZoomGesture;
 import com.jogamp.newt.event.GestureHandler.GestureEvent;
 import com.jogamp.opengl.JoglVersion;
+import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.math.Quaternion;
+import com.jogamp.opengl.math.VectorUtil;
 import com.jogamp.opengl.test.junit.jogl.demos.GearsObject;
+import com.jogamp.opengl.util.CustomGLEventListener;
 import com.jogamp.opengl.util.PMVMatrix;
 import com.jogamp.opengl.util.TileRendererBase;
 import com.jogamp.opengl.util.glsl.ShaderCode;
 import com.jogamp.opengl.util.glsl.ShaderProgram;
 import com.jogamp.opengl.util.glsl.ShaderState;
+import com.jogamp.opengl.util.stereo.EyeParameter;
+import com.jogamp.opengl.util.stereo.EyePose;
+import com.jogamp.opengl.util.stereo.StereoGLEventListener;
 
 import java.nio.FloatBuffer;
 
@@ -45,15 +52,15 @@ import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAnimatorControl;
 import javax.media.opengl.GLAutoDrawable;
-import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLProfile;
 import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 /**
  * GearsES2.java <BR>
  * @author Brian Paul (converted to Java by Ron Cemer and Sven Gothel) <P>
  */
-public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererListener {
+public class GearsES2 implements StereoGLEventListener, TileRendererBase.TileRendererListener {
     private final FloatBuffer lightPos = Buffers.newDirectFloatBuffer( new float[] { 5.0f, 5.0f, 10.0f } );
 
     private ShaderState st = null;
@@ -62,6 +69,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
     private GLUniformData colorU = null;
     private float view_rotx = 20.0f, view_roty = 30.0f;
     private boolean flipVerticalInGLOrientation = false;
+    private final boolean customRendering = false;
 
     private final float view_rotz = 0.0f;
     private float panX = 0.0f, panY = 0.0f, panZ=0.0f;
@@ -73,7 +81,6 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
     private FloatBuffer gear1Color=GearsObject.red, gear2Color=GearsObject.green, gear3Color=GearsObject.blue;
     private float angle = 0.0f;
     private int swapInterval = 0;
-    private boolean pmvUseBackingArray = true; // the default for PMVMatrix now, since it's faster
     // private MouseListener gearsMouse = new TraceMouseAdapter(new GearsMouseAdapter());
     public MouseListener gearsMouse = new GearsMouseAdapter();
     public KeyListener gearsKeys = new GearsKeyAdapter();
@@ -90,7 +97,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
     private PinchToZoomGesture pinchToZoomGesture = null;
 
 
-    public GearsES2(int swapInterval) {
+    public GearsES2(final int swapInterval) {
         this.swapInterval = swapInterval;
     }
 
@@ -99,53 +106,49 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
     }
 
     @Override
-    public void addTileRendererNotify(TileRendererBase tr) {
+    public void addTileRendererNotify(final TileRendererBase tr) {
         tileRendererInUse = tr;
         doRotateBeforePrinting = doRotate;
         setDoRotation(false);
     }
     @Override
-    public void removeTileRendererNotify(TileRendererBase tr) {
+    public void removeTileRendererNotify(final TileRendererBase tr) {
         tileRendererInUse = null;
         setDoRotation(doRotateBeforePrinting);
     }
     @Override
-    public void startTileRendering(TileRendererBase tr) {
+    public void startTileRendering(final TileRendererBase tr) {
         System.err.println("GearsES2.startTileRendering: "+sid()+""+tr);
     }
     @Override
-    public void endTileRendering(TileRendererBase tr) {
+    public void endTileRendering(final TileRendererBase tr) {
         System.err.println("GearsES2.endTileRendering: "+sid()+""+tr);
     }
 
-    public void setIgnoreFocus(boolean v) { ignoreFocus = v; }
-    public void setDoRotation(boolean rotate) { this.doRotate = rotate; }
-    public void setClearBuffers(boolean v) { clearBuffers = v; }
-    public void setVerbose(boolean v) { verbose = v; }
-    public void setFlipVerticalInGLOrientation(boolean v) { flipVerticalInGLOrientation=v; }
-
-    public void setPMVUseBackingArray(boolean pmvUseBackingArray) {
-        this.pmvUseBackingArray = pmvUseBackingArray;
-    }
+    public void setIgnoreFocus(final boolean v) { ignoreFocus = v; }
+    public void setDoRotation(final boolean rotate) { this.doRotate = rotate; }
+    public void setClearBuffers(final boolean v) { clearBuffers = v; }
+    public void setVerbose(final boolean v) { verbose = v; }
+    public void setFlipVerticalInGLOrientation(final boolean v) { flipVerticalInGLOrientation=v; }
 
     /** float[4] */
-    public void setClearColor(float[] clearColor) {
+    public void setClearColor(final float[] clearColor) {
         this.clearColor = clearColor;
     }
 
-    public void setGearsColors(FloatBuffer gear1Color, FloatBuffer gear2Color, FloatBuffer gear3Color) {
+    public void setGearsColors(final FloatBuffer gear1Color, final FloatBuffer gear2Color, final FloatBuffer gear3Color) {
         this.gear1Color = gear1Color;
         this.gear2Color = gear2Color;
         this.gear3Color = gear3Color;
     }
 
-    public void setSharedGearsObjects(GearsObjectES2 g1, GearsObjectES2 g2, GearsObjectES2 g3) {
+    public void setSharedGearsObjects(final GearsObjectES2 g1, final GearsObjectES2 g2, final GearsObjectES2 g3) {
         gear1 = g1;
         gear2 = g2;
         gear3 = g3;
     }
 
-    public void setSharedGears(GearsES2 shared) {
+    public void setSharedGears(final GearsES2 shared) {
         sharedGears = shared;
     }
 
@@ -166,8 +169,12 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
 
     public boolean usesSharedGears() { return usesSharedGears; }
 
-    public void setUseMappedBuffers(boolean v) { useMappedBuffers = v; }
-    public void setValidateBuffers(boolean v) { validateBuffers = v; }
+    public void setUseMappedBuffers(final boolean v) { useMappedBuffers = v; }
+    public void setValidateBuffers(final boolean v) { validateBuffers = v; }
+
+    public PMVMatrix getPMVMatrix() {
+        return pmvMatrix;
+    }
 
     private static final int TIME_OUT     = 2000; // 2s
     private static final int POLL_DIVIDER   = 20; // TO/20
@@ -176,7 +183,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
     /**
      * @return True if this GLEventListener became initialized within TIME_OUT 2s
      */
-    public boolean waitForInit(boolean initialized) throws InterruptedException {
+    public boolean waitForInit(final boolean initialized) throws InterruptedException {
         int wait;
         for (wait=0; wait<POLL_DIVIDER && initialized != isInit ; wait++) {
             Thread.sleep(TIME_SLICE);
@@ -187,7 +194,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
     private final String sid() { return "0x"+Integer.toHexString(hashCode()); }
 
     @Override
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         if(null != sharedGears && !sharedGears.isInit() ) {
             System.err.println(Thread.currentThread()+" GearsES2.init.0 "+sid()+": pending shared Gears .. re-init later XXXXX");
             drawable.setGLEventListenerInitState(this, false);
@@ -207,8 +214,6 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
             return;
         }
 
-        gl.glEnable(GL.GL_DEPTH_TEST);
-
         st = new ShaderState();
         // st.setVerbose(true);
         final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(), "shader",
@@ -224,13 +229,13 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
         // Use debug pipeline
         // drawable.setGL(new DebugGL(drawable.getGL()));
 
-        pmvMatrix = new PMVMatrix(pmvUseBackingArray);
+        pmvMatrix = new PMVMatrix();
         st.attachObject("pmvMatrix", pmvMatrix);
         pmvMatrixUniform = new GLUniformData("pmvMatrix", 4, 4, pmvMatrix.glGetPMvMvitMatrixf()); // P, Mv, Mvi and Mvit
         st.ownUniform(pmvMatrixUniform);
         st.uniform(gl, pmvMatrixUniform);
 
-        GLUniformData lightU = new GLUniformData("lightPos", 3, lightPos);
+        final GLUniformData lightU = new GLUniformData("lightPos", 3, lightPos);
         st.ownUniform(lightU);
         st.uniform(gl, lightU);
 
@@ -302,8 +307,8 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
             window.addGestureHandler(pinchToZoomGesture);
         } else if (GLProfile.isAWTAvailable() && upstreamWidget instanceof java.awt.Component) {
             final java.awt.Component comp = (java.awt.Component) upstreamWidget;
-            new com.jogamp.newt.event.awt.AWTMouseAdapter(gearsMouse).addTo(comp);
-            new com.jogamp.newt.event.awt.AWTKeyAdapter(gearsKeys).addTo(comp);
+            new com.jogamp.newt.event.awt.AWTMouseAdapter(gearsMouse, drawable).addTo(comp);
+            new com.jogamp.newt.event.awt.AWTKeyAdapter(gearsKeys, drawable).addTo(comp);
         }
 
         st.useProgram(gl, false);
@@ -320,7 +325,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
 
     private final GestureHandler.GestureListener pinchToZoomListener = new GestureHandler.GestureListener() {
         @Override
-        public void gestureDetected(GestureEvent gh) {
+        public void gestureDetected(final GestureEvent gh) {
             final PinchToZoomGesture.ZoomEvent ze = (PinchToZoomGesture.ZoomEvent) gh;
             final float zoom = ze.getZoom(); //  * ( ze.getTrigger().getPointerCount() - 1 ); <- too much ..
             panZ = zoom * 30f - 30f; // [0 .. 2] -> [-30f .. 30f]
@@ -328,7 +333,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
     };
 
     @Override
-    public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
         if( !isInit ) { return; }
         final GL2ES2 gl = glad.getGL().getGL2ES2();
         if(-1 != swapInterval) {
@@ -338,16 +343,20 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
     }
 
     @Override
-    public void reshapeTile(TileRendererBase tr,
-                            int tileX, int tileY, int tileWidth, int tileHeight,
-                            int imageWidth, int imageHeight) {
+    public void reshapeTile(final TileRendererBase tr,
+                            final int tileX, final int tileY, final int tileWidth, final int tileHeight,
+                            final int imageWidth, final int imageHeight) {
         if( !isInit ) { return; }
         final GL2ES2 gl = tr.getAttachedDrawable().getGL().getGL2ES2();
         gl.setSwapInterval(0);
         reshapeImpl(gl, tileX, tileY, tileWidth, tileHeight, imageWidth, imageHeight);
     }
 
-    void reshapeImpl(GL2ES2 gl, int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight) {
+    private final float zNear = 2f;
+    private final float zFar = 10000f;
+    private final float zViewDist = 20.0f;
+
+    void reshapeImpl(final GL2ES2 gl, final int tileX, final int tileY, final int tileWidth, final int tileHeight, final int imageWidth, final int imageHeight) {
         final boolean msaa = gl.getContext().getGLDrawable().getChosenGLCapabilities().getSampleBuffers();
         if(verbose) {
             System.err.println(Thread.currentThread()+" GearsES2.reshape "+sid()+" "+tileX+"/"+tileY+" "+tileWidth+"x"+tileHeight+" of "+imageWidth+"x"+imageHeight+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(gl.getContext().getGLDrawable().getHandle())+", msaa "+msaa+", tileRendererInUse "+tileRendererInUse);
@@ -357,18 +366,16 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
             return;
         }
 
-        st.useProgram(gl, true);
-
         // compute projection parameters 'normal'
         float left, right, bottom, top;
         if( imageHeight > imageWidth ) {
-            float a = (float)imageHeight / (float)imageWidth;
+            final float a = (float)imageHeight / (float)imageWidth;
             left = -1.0f;
             right = 1.0f;
             bottom = -a;
             top = a;
         } else {
-            float a = (float)imageWidth / (float)imageHeight;
+            final float a = (float)imageWidth / (float)imageHeight;
             left = -a;
             right = a;
             bottom = -1.0f;
@@ -389,25 +396,68 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
             System.err.println(">> GearsES2 "+sid()+", angle "+angle+", [l "+left+", r "+right+", b "+bottom+", t "+top+"] "+w+"x"+h+" -> [l "+l+", r "+r+", b "+b+", t "+t+"] "+_w+"x"+_h+", v-flip "+flipVerticalInGLOrientation);
         }
 
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
         if( flipVerticalInGLOrientation && gl.getContext().getGLDrawable().isGLOriented() ) {
             pmvMatrix.glScalef(1f, -1f, 1f);
         }
-        pmvMatrix.glFrustumf(l, r, b, t, 5.0f, 200.0f);
+        pmvMatrix.glFrustumf(l, r, b, t, zNear, zFar);
 
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
-        pmvMatrix.glTranslatef(0.0f, 0.0f, -40.0f);
+        pmvMatrix.glTranslatef(0.0f, 0.0f, -zViewDist);
+        st.useProgram(gl, true);
         st.uniform(gl, pmvMatrixUniform);
         st.useProgram(gl, false);
-
-        // System.err.println(Thread.currentThread()+" GearsES2.reshape FIN");
     }
     // private boolean useAndroidDebug = false;
 
+    private final float[] mat4Tmp1 = new float[16];
+    private final float[] mat4Tmp2 = new float[16];
+    private final float[] vec3Tmp1 = new float[3];
+    private final float[] vec3Tmp2 = new float[3];
+    private final float[] vec3Tmp3 = new float[3];
+
+    @Override
+    public void reshapeForEye(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height,
+                              final EyeParameter eyeParam, final EyePose eyePose) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
+        final float[] mat4Projection = FloatUtil.makePerspective(mat4Tmp1, 0, true, eyeParam.fovhv, zNear, zFar);
+        if( flipVerticalInGLOrientation && gl.getContext().getGLDrawable().isGLOriented() ) {
+            pmvMatrix.glLoadIdentity();
+            pmvMatrix.glScalef(1f, -1f, 1f);
+            pmvMatrix.glMultMatrixf(mat4Projection, 0);
+        } else {
+            pmvMatrix.glLoadMatrixf(mat4Projection, 0);
+        }
+
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+
+        final Quaternion rollPitchYaw = new Quaternion();
+        // private final float eyeYaw = FloatUtil.PI; // 180 degrees in radians
+        // rollPitchYaw.rotateByAngleY(eyeYaw);
+        final float[] shiftedEyePos = rollPitchYaw.rotateVector(vec3Tmp1, 0, eyePose.position, 0);
+        VectorUtil.addVec3(shiftedEyePos, shiftedEyePos, eyeParam.positionOffset);
+
+        rollPitchYaw.mult(eyePose.orientation);
+        final float[] up = rollPitchYaw.rotateVector(vec3Tmp2, 0, VectorUtil.VEC3_UNIT_Y, 0);
+        final float[] forward = rollPitchYaw.rotateVector(vec3Tmp3, 0, VectorUtil.VEC3_UNIT_Z_NEG, 0);
+        final float[] center = VectorUtil.addVec3(forward, shiftedEyePos, forward);
+
+        final float[] mLookAt = FloatUtil.makeLookAt(mat4Tmp1, 0, shiftedEyePos, 0, center, 0, up, 0, mat4Tmp2);
+        final float[] mViewAdjust = FloatUtil.makeTranslation(mat4Tmp2, true, eyeParam.distNoseToPupilX, eyeParam.distMiddleToPupilY, eyeParam.eyeReliefZ);
+        final float[] mat4Modelview = FloatUtil.multMatrix(mViewAdjust, mLookAt);
+
+        pmvMatrix.glLoadMatrixf(mat4Modelview, 0);
+        pmvMatrix.glTranslatef(0.0f, 0.0f, -zViewDist);
+        st.useProgram(gl, true);
+        st.uniform(gl, pmvMatrixUniform);
+        st.useProgram(gl, false);
+    }
+
     @Override
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         if( !isInit ) { return; }
         isInit = false;
         if(verbose) {
@@ -444,16 +494,25 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
     }
 
     @Override
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
+        display(drawable, 0);
+    }
+
+    @Override
+    public void display(final GLAutoDrawable drawable, final int flags) {
         if( !isInit ) { return; }
         if(null != sharedGears && !sharedGears.isInit() ) { return; }
-        GLAnimatorControl anim = drawable.getAnimator();
+        final GLAnimatorControl anim = drawable.getAnimator();
         if( verbose && ( null == anim || !anim.isAnimating() ) ) {
-            System.err.println(Thread.currentThread()+" GearsES2.display "+sid()+" "+drawable.getWidth()+"x"+drawable.getHeight()+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(drawable.getHandle()));
+            System.err.println(Thread.currentThread()+" GearsES2.display "+sid()+" "+drawable.getSurfaceWidth()+"x"+drawable.getSurfaceHeight()+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(drawable.getHandle()));
         }
+
+        final boolean repeatedFrame = 0 != ( CustomGLEventListener.DISPLAY_REPEAT & flags );
+        final boolean dontClear = 0 != ( CustomGLEventListener.DISPLAY_DONTCLEAR & flags );
+
         // Turn the gears' teeth
-        if(doRotate) {
-            angle += 2.0f;
+        if( doRotate && !repeatedFrame ) {
+            angle += 0.5f;
         }
 
         // Get the GL corresponding to the drawable we are animating
@@ -467,7 +526,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
           hasFocus = true;
         }
 
-        if( clearBuffers ) {
+        if( clearBuffers && !dontClear ) {
             if( null != clearColor ) {
               gl.glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
             } else if( null != tileRendererInUse ) {
@@ -492,11 +551,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
             return;
         }
 
-        // Only possible if we do not flip the projection matrix
-        final boolean enableCullFace = ! ( flipVerticalInGLOrientation && gl.getContext().getGLDrawable().isGLOriented() );
-        if( enableCullFace ) {
-            gl.glEnable(GL.GL_CULL_FACE);
-        }
+        setGLStates(gl, true);
 
         st.useProgram(gl, true);
         pmvMatrix.glPushMatrix();
@@ -511,8 +566,22 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
         pmvMatrix.glPopMatrix();
         st.useProgram(gl, false);
 
-        if( enableCullFace ) {
-            gl.glDisable(GL.GL_CULL_FACE);
+        setGLStates(gl, false);
+    }
+
+    public void setGLStates(final GL2ES2 gl, final boolean enable) {
+        // Culling only possible if we do not flip the projection matrix
+        final boolean useCullFace = ! ( flipVerticalInGLOrientation && gl.getContext().getGLDrawable().isGLOriented() || customRendering );
+        if( enable ) {
+            gl.glEnable(GL.GL_DEPTH_TEST);
+            if( useCullFace ) {
+                gl.glEnable(GL.GL_CULL_FACE);
+            }
+        } else {
+            gl.glDisable(GL.GL_DEPTH_TEST);
+            if( useCullFace ) {
+                gl.glDisable(GL.GL_CULL_FACE);
+            }
         }
     }
 
@@ -523,13 +592,13 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
 
     boolean confinedFixedCenter = false;
 
-    public void setConfinedFixedCenter(boolean v) {
+    public void setConfinedFixedCenter(final boolean v) {
         confinedFixedCenter = v;
     }
 
     class GearsKeyAdapter extends KeyAdapter {
-        public void keyPressed(KeyEvent e) {
-            int kc = e.getKeyCode();
+        public void keyPressed(final KeyEvent e) {
+            final int kc = e.getKeyCode();
             if(KeyEvent.VK_LEFT == kc) {
                 view_roty -= 1;
             } else if(KeyEvent.VK_RIGHT == kc) {
@@ -546,20 +615,20 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
         private int prevMouseX, prevMouseY;
 
         @Override
-        public void mouseClicked(MouseEvent e) {
+        public void mouseClicked(final MouseEvent e) {
         }
 
         @Override
-        public void mouseEntered(MouseEvent e) {
+        public void mouseEntered(final MouseEvent e) {
         }
 
         @Override
-        public void mouseExited(MouseEvent e) {
+        public void mouseExited(final MouseEvent e) {
         }
 
         @Override
-        public void mouseWheelMoved(MouseEvent e) {
-            float[] rot = e.getRotation();
+        public void mouseWheelMoved(final MouseEvent e) {
+            final float[] rot = e.getRotation();
             if( e.isControlDown() ) {
                 // alternative zoom
                 final float incr = e.isShiftDown() ? rot[0] : rot[1] * 0.5f ;
@@ -572,7 +641,7 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
             }
         }
 
-        public void mousePressed(MouseEvent e) {
+        public void mousePressed(final MouseEvent e) {
             if( e.getPointerCount()==1 ) {
                 prevMouseX = e.getX();
                 prevMouseY = e.getY();
@@ -584,10 +653,10 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
             }
         }
 
-        public void mouseReleased(MouseEvent e) {
+        public void mouseReleased(final MouseEvent e) {
         }
 
-        public void mouseMoved(MouseEvent e) {
+        public void mouseMoved(final MouseEvent e) {
             if( e.isConfined() ) {
                 navigate(e);
             } else {
@@ -598,28 +667,28 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
             }
         }
 
-        public void mouseDragged(MouseEvent e) {
+        public void mouseDragged(final MouseEvent e) {
             navigate(e);
         }
 
-        private void navigate(MouseEvent e) {
+        private void navigate(final MouseEvent e) {
             int x = e.getX();
             int y = e.getY();
 
             int width, height;
-            Object source = e.getSource();
+            final Object source = e.getSource();
             Window window = null;
             if(source instanceof Window) {
                 window = (Window) source;
-                width=window.getWidth();
-                height=window.getHeight();
+                width=window.getSurfaceWidth();
+                height=window.getSurfaceHeight();
             } else if (source instanceof GLAutoDrawable) {
-                GLAutoDrawable glad = (GLAutoDrawable) source;
-                width = glad.getWidth();
-                height = glad.getHeight();
+                final GLAutoDrawable glad = (GLAutoDrawable) source;
+                width = glad.getSurfaceWidth();
+                height = glad.getSurfaceHeight();
             } else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) {
-                java.awt.Component comp = (java.awt.Component) source;
-                width=comp.getWidth();
+                final java.awt.Component comp = (java.awt.Component) source;
+                width=comp.getWidth(); // FIXME HiDPI: May need to convert window units -> pixel units!
                 height=comp.getHeight();
             } else {
                 throw new RuntimeException("Event source neither Window nor Component: "+source);
@@ -629,8 +698,8 @@ public class GearsES2 implements GLEventListener, TileRendererBase.TileRendererL
             view_rotx += thetaX;
             view_roty += thetaY;
             if(e.isConfined() && confinedFixedCenter && null!=window) {
-                x=window.getWidth()/2;
-                y=window.getHeight()/2;
+                x=window.getSurfaceWidth()/2;
+                y=window.getSurfaceHeight()/2;
                 window.warpPointer(x, y);
             }
             prevMouseX = x;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java
index 4cef639..7088eb7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/GearsObjectES2.java
@@ -43,11 +43,11 @@ public class GearsObjectES2 extends GearsObject {
     final GLUniformData colorUniform;
     final ShaderState st;
 
-    public GearsObjectES2(GL gl, boolean useMappedBuffers, ShaderState st, FloatBuffer gearColor,
-                          float inner_radius, float outer_radius,
-                          float width,
-                          int teeth,
-                          float tooth_depth, PMVMatrix pmvMatrix, GLUniformData pmvMatrixUniform, GLUniformData colorUniform, boolean validateBuffers)
+    public GearsObjectES2(final GL gl, final boolean useMappedBuffers, final ShaderState st, final FloatBuffer gearColor,
+                          final float inner_radius, final float outer_radius,
+                          final float width,
+                          final int teeth,
+                          final float tooth_depth, final PMVMatrix pmvMatrix, final GLUniformData pmvMatrixUniform, final GLUniformData colorUniform, final boolean validateBuffers)
     {
         super(gl, useMappedBuffers, gearColor, inner_radius, outer_radius, width, teeth, tooth_depth, validateBuffers);
         this.pmvMatrix = pmvMatrix;
@@ -57,10 +57,10 @@ public class GearsObjectES2 extends GearsObject {
         associate(st);
     }
 
-    public GearsObjectES2(GearsObjectES2 shared,
-                          ShaderState st,
-                          PMVMatrix pmvMatrix,
-                          GLUniformData pmvMatrixUniform, GLUniformData colorUniform)
+    public GearsObjectES2(final GearsObjectES2 shared,
+                          final ShaderState st,
+                          final PMVMatrix pmvMatrix,
+                          final GLUniformData pmvMatrixUniform, final GLUniformData colorUniform)
     {
         super(shared);
         this.pmvMatrix = pmvMatrix;
@@ -70,7 +70,7 @@ public class GearsObjectES2 extends GearsObject {
         associate(st);
     }
 
-    private void associate(ShaderState st) {
+    private void associate(final ShaderState st) {
         frontFace.associate(st, true);
         frontSide.associate(st, true);
         backFace.associate(st, true);
@@ -80,7 +80,7 @@ public class GearsObjectES2 extends GearsObject {
     }
 
     @Override
-    public GLArrayDataServer createInterleaved(boolean useMappedBuffers, int comps, int dataType, boolean normalized, int initialSize, int vboUsage) {
+    public GLArrayDataServer createInterleaved(final boolean useMappedBuffers, final int comps, final int dataType, final boolean normalized, final int initialSize, final int vboUsage) {
         if( useMappedBuffers ) {
             return GLArrayDataServer.createGLSLInterleavedMapped(comps, dataType, normalized, initialSize, vboUsage);
         } else {
@@ -89,12 +89,12 @@ public class GearsObjectES2 extends GearsObject {
     }
 
     @Override
-    public void addInterleavedVertexAndNormalArrays(GLArrayDataServer array, int components) {
+    public void addInterleavedVertexAndNormalArrays(final GLArrayDataServer array, final int components) {
         array.addGLSLSubArray("vertices", components, GL.GL_ARRAY_BUFFER);
         array.addGLSLSubArray("normals", components, GL.GL_ARRAY_BUFFER);
     }
 
-    private void draw(GL2ES2 gl, GLArrayDataServer array, int mode, int face) {
+    private void draw(final GL2ES2 gl, final GLArrayDataServer array, final int mode, final int face) {
         if( !isShared || gl.glIsBuffer(array.getVBOName()) ) {
             if( validateBuffers ) {
                 array.bindBuffer(gl, true);
@@ -119,7 +119,7 @@ public class GearsObjectES2 extends GearsObject {
     }
 
     @Override
-    public void draw(GL _gl, float x, float y, float angle) {
+    public void draw(final GL _gl, final float x, final float y, final float angle) {
         final GL2ES2 gl = _gl.getGL2ES2();
         pmvMatrix.glPushMatrix();
         pmvMatrix.glTranslatef(x, y, 0f);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/LandscapeES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/LandscapeES2.java
index e7f980c..72524aa 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/LandscapeES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/LandscapeES2.java
@@ -1,22 +1,29 @@
 /**
- * Copyright (C) 2013 JogAmp Community. All rights reserved.
+ * Copyright 2013 JogAmp Community. All rights reserved.
  *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
  */
 package com.jogamp.opengl.test.junit.jogl.demos.es2;
 
@@ -39,7 +46,7 @@ public class LandscapeES2 implements GLEventListener {
     private int swapInterval = 0;
     private boolean verbose = true;
 
-    static public int TARGET_FPS    = 120;
+    static public final int TARGET_FPS    = 120;
     private long millisOffset;
     private int frameCount;
     private float frameRate;
@@ -47,15 +54,15 @@ public class LandscapeES2 implements GLEventListener {
     private ShaderCode fragShader;
     private ShaderProgram shaderProg;
     private ShaderState shaderState;
-    private float[] resolution; 
+    private float[] resolution;
     private GLUniformData resolutionUni;
-    private GLUniformData timeUni;  
-    private GLArrayDataServer vertices;   
-      
-    private int fcount = 0, lastm = 0;  
-    private int fint = 1;
-      
-    public LandscapeES2(int swapInterval) {
+    private GLUniformData timeUni;
+    private GLArrayDataServer vertices;
+
+    private int fcount = 0, lastm = 0;
+    private final int fint = 1;
+
+    public LandscapeES2(final int swapInterval) {
         this.swapInterval = swapInterval;
     }
 
@@ -63,11 +70,11 @@ public class LandscapeES2 implements GLEventListener {
         this.swapInterval = 1;
     }
 
-    public void setVerbose(boolean v) { verbose = v; }
-    
-    public void init(GLAutoDrawable drawable) {
+    public void setVerbose(final boolean v) { verbose = v; }
+
+    public void init(final GLAutoDrawable drawable) {
         System.err.println(Thread.currentThread()+" LandscapeES2.init ...");
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
 
         if(verbose) {
             System.err.println("LandscapeES2 init on "+Thread.currentThread());
@@ -89,19 +96,19 @@ public class LandscapeES2 implements GLEventListener {
         fragShader.defaultShaderCustomization(gl, true, true);
         shaderProg = new ShaderProgram();
         shaderProg.add(gl, vertShader, System.err);
-        shaderProg.add(gl, fragShader, System.err); 
-        
+        shaderProg.add(gl, fragShader, System.err);
+
         shaderState = new ShaderState();
         shaderState.attachShaderProgram(gl, shaderProg, true);
-        
-        resolution = new float[] { drawable.getWidth(), drawable.getHeight(), 0};
+
+        resolution = new float[] { drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), 0};
         resolutionUni = new GLUniformData("iResolution", 3, FloatBuffer.wrap(resolution));
         shaderState.ownUniform(resolutionUni);
         shaderState.uniform(gl, resolutionUni);
-        
+
         timeUni = new GLUniformData("iGlobalTime", 0.0f);
         shaderState.ownUniform(timeUni);
-            
+
         vertices = GLArrayDataServer.createGLSL("inVertex", 2, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
         vertices.putf(-1.0f); vertices.putf(-1.0f);
         vertices.putf(+1.0f); vertices.putf(-1.0f);
@@ -112,71 +119,71 @@ public class LandscapeES2 implements GLEventListener {
         shaderState.useProgram(gl, false);
 
         millisOffset = System.currentTimeMillis();
-        
+
         System.err.println(Thread.currentThread()+" LandscapeES2.init FIN");
     }
 
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
         System.err.println(Thread.currentThread()+" LandscapeES2.reshape "+x+"/"+y+" "+width+"x"+height+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(drawable.getHandle()));
-        
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
+
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
         if(-1 != swapInterval) {
             gl.setSwapInterval(swapInterval); // in case switching the drawable (impl. may bound attribute there)
         }
-        
+
         shaderState.useProgram(gl, true);
-        
-        resolution[0] = drawable.getWidth();
-        resolution[1] = drawable.getHeight();
+
+        resolution[0] = drawable.getSurfaceWidth();
+        resolution[1] = drawable.getSurfaceHeight();
         shaderState.uniform(gl, resolutionUni);
-                
+
         shaderState.useProgram(gl, false);
     }
 
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         System.err.println(Thread.currentThread()+" LandscapeES2.dispose ... ");
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
         shaderState.useProgram(gl, false);
         shaderState.destroy(gl);
         shaderState = null;
-        
+
         System.err.println(Thread.currentThread()+" LandscapeES2.dispose FIN");
     }
 
-    public void display(GLAutoDrawable drawable) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+    public void display(final GLAutoDrawable drawable) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
         // Shader fills complete framebuffer regardless of DEPTH, no Clear required.
         // gl.glClearColor(0.5f, 0.1f, 0.1f, 1);
         // gl.glClear(GL.GL_COLOR_BUFFER_BIT);
-        
-        shaderState.useProgram(gl, true);    
-        
+
+        shaderState.useProgram(gl, true);
+
         timeUni.setData((System.currentTimeMillis() - millisOffset) / 1000.0f);
         shaderState.uniform(gl, timeUni);
         vertices.enableBuffer(gl, true);
-        gl.glDrawArrays(GL2ES2.GL_TRIANGLE_STRIP, 0, 4);
+        gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
         vertices.enableBuffer(gl, false);
-        
+
         shaderState.useProgram(gl, false);
-        
+
         // Compute current framerate and printout.
-        frameCount++;      
+        frameCount++;
         fcount += 1;
-        int m = (int) (System.currentTimeMillis() - millisOffset);
+        final int m = (int) (System.currentTimeMillis() - millisOffset);
         if (m - lastm > 1000 * fint) {
           frameRate = (float)(fcount) / fint;
           fcount = 0;
           lastm = m;
-        }         
+        }
         if (frameCount % TARGET_FPS == 0) {
           System.out.println("FrameCount: " + frameCount + " - " + "FrameRate: " + frameRate);
-        }    
+        }
     }
-    
+
     boolean confinedFixedCenter = false;
-    
-    public void setConfinedFixedCenter(boolean v) {
+
+    public void setConfinedFixedCenter(final boolean v) {
         confinedFixedCenter = v;
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/Mix2TexturesES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/Mix2TexturesES2.java
index b695054..58161f5 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/Mix2TexturesES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/Mix2TexturesES2.java
@@ -1,22 +1,29 @@
 /**
- * Copyright (C) 2011 JogAmp Community. All rights reserved.
+ * Copyright 2011 JogAmp Community. All rights reserved.
  *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
  */
 package com.jogamp.opengl.test.junit.jogl.demos.es2;
 
@@ -37,24 +44,24 @@ import com.jogamp.opengl.util.glsl.ShaderState;
 
 public class Mix2TexturesES2 implements GLEventListener {
     private final int swapInterval;
-    
+
     private final ShaderState st;
     private final PMVMatrix pmvMatrix;
     private final GLUniformData texUnit0, texUnit1;
-    
-    private Object syncTexIDs = new Object();
+
+    private final Object syncTexIDs = new Object();
     private int texID0, texID1;
     private ShaderProgram sp0;
     private GLUniformData pmvMatrixUniform;
     private GLArrayDataServer interleavedVBO;
-    
-    public Mix2TexturesES2(int swapInterval, int texUnit0, int texUnit1) {
+
+    public Mix2TexturesES2(final int swapInterval, final int texUnit0, final int texUnit1) {
         this.swapInterval = swapInterval;
-        
+
         st = new ShaderState();
-        // st.setVerbose(true);        
+        // st.setVerbose(true);
         pmvMatrix = new PMVMatrix();
-        
+
         if(0 == texUnit1) {
             this.texUnit0 = new GLUniformData("mgl_ActiveTexture", texUnit0);
             this.texUnit1 = null;
@@ -65,147 +72,147 @@ public class Mix2TexturesES2 implements GLEventListener {
         this.texID0 = 0;
         this.texID1 = 0;
     }
-    
-    public void setTexID0(int texID) {
+
+    public void setTexID0(final int texID) {
         synchronized( syncTexIDs ) {
             this.texID0 = texID;
         }
     }
-    public void setTexID1(int texID) {
+    public void setTexID1(final int texID) {
         synchronized( syncTexIDs ) {
             this.texID1 = texID;
         }
     }
-        
+
     @Override
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
+
         final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, Mix2TexturesES2.class, "shader",
                 "shader/bin", "texture01_xxx", true);
         final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, Mix2TexturesES2.class, "shader",
                 "shader/bin", null == texUnit1 ? "texture01_xxx" : "texture02_xxx", true);
         vp0.defaultShaderCustomization(gl, true, true);
         fp0.defaultShaderCustomization(gl, true, true);
-        
+
         sp0 = new ShaderProgram();
         sp0.add(gl, vp0, System.err);
-        sp0.add(gl, fp0, System.err);       
+        sp0.add(gl, fp0, System.err);
         st.attachShaderProgram(gl, sp0, true);
-        
+
         pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
-        st.ownUniform(pmvMatrixUniform);       
+        st.ownUniform(pmvMatrixUniform);
         st.uniform(gl, pmvMatrixUniform);
-        
+
         interleavedVBO = GLArrayDataServer.createGLSLInterleaved(3+4+2, GL.GL_FLOAT, false, 3*4, GL.GL_STATIC_DRAW);
-        {        
-            interleavedVBO.addGLSLSubArray("mgl_Vertex",        3, GL.GL_ARRAY_BUFFER);            
-            interleavedVBO.addGLSLSubArray("mgl_Color",         4, GL.GL_ARRAY_BUFFER);            
+        {
+            interleavedVBO.addGLSLSubArray("mgl_Vertex",        3, GL.GL_ARRAY_BUFFER);
+            interleavedVBO.addGLSLSubArray("mgl_Color",         4, GL.GL_ARRAY_BUFFER);
             //interleavedVBO.addGLSLSubArray("mgl_Normal",        3, GL.GL_ARRAY_BUFFER);
             interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
 
-            FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
-            
+            final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
+
             for(int i=0; i<4; i++) {
                 ib.put(s_quadVertices,  i*3, 3);
-                ib.put(s_quadColors,    i*4, 4);  
+                ib.put(s_quadColors,    i*4, 4);
                 //ib.put(s_cubeNormals,   i*3, 3);
                 ib.put(s_quadTexCoords, i*2, 2);
-            }                        
+            }
         }
         interleavedVBO.seal(gl, true);
         interleavedVBO.enableBuffer(gl, false);
         st.ownAttribute(interleavedVBO, true);
-                
+
         st.ownUniform(texUnit0);
         st.uniform(gl, texUnit0);
         if(null != texUnit1) {
-            st.ownUniform(texUnit1);       
+            st.ownUniform(texUnit1);
             st.uniform(gl, texUnit1);
         }
-        
-        st.useProgram(gl, false);        
+
+        st.useProgram(gl, false);
     }
-    
+
     @Override
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
         st.destroy(gl);
-        
+
         sp0 = null;
         pmvMatrixUniform = null;
         interleavedVBO = null;
     }
 
     @Override
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
 
         st.useProgram(gl, true);
         gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
-        
+
         interleavedVBO.enableBuffer(gl, true);
-        
+
         synchronized( syncTexIDs ) {
             if(0<texID0) {
                 gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit0.intValue());
                 gl.glBindTexture(GL.GL_TEXTURE_2D, texID0);
             }
-            
+
             if(0<texID1 && null != texUnit1) {
                 gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit1.intValue());
                 gl.glBindTexture(GL.GL_TEXTURE_2D, texID1);
             }
-            
+
             if( !gl.isGLcore() ) {
                 gl.glEnable(GL.GL_TEXTURE_2D);
             }
-            
+
             gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
         }
-        
+
         interleavedVBO.enableBuffer(gl, false);
-        
-        st.useProgram(gl, false);        
+
+        st.useProgram(gl, false);
     }
 
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
-        if(-1 != swapInterval) {        
+
+        if(-1 != swapInterval) {
             gl.setSwapInterval(swapInterval); // in case switching the drawable (impl. may bound attribute there)
         }
-        
+
         pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 10.0f);
 
         pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
-        
+
         st.useProgram(gl, true);
         st.uniform(gl, pmvMatrixUniform);
         st.useProgram(gl, false);
-        
+
     }
 
-    private static final float[] s_quadVertices = { 
+    private static final float[] s_quadVertices = {
       -1f, -1f, 0f, // LB
        1f, -1f, 0f, // RB
       -1f,  1f, 0f, // LT
-       1f,  1f, 0f  // RT 
+       1f,  1f, 0f  // RT
     };
-    private static final float[] s_quadColors = { 
+    private static final float[] s_quadColors = {
       1f, 1f, 1f, 1f,
       1f, 1f, 1f, 1f,
       1f, 1f, 1f, 1f,
       1f, 1f, 1f, 1f };
-    private static final float[] s_quadTexCoords = { 
+    private static final float[] s_quadTexCoords = {
             0f, 0f, // LB
             1f, 0f, // RB
-            0f, 1f, // LT   
+            0f, 1f, // LT
             1f, 1f  // RT
     };
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/MultisampleDemoES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/MultisampleDemoES2.java
index 430ea45..7c4c510 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/MultisampleDemoES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/MultisampleDemoES2.java
@@ -62,43 +62,43 @@ public class MultisampleDemoES2 implements GLEventListener {
     private GLUniformData pmvMatrixUniform;
     private ImmModeSink immModeSink;
 
-    public MultisampleDemoES2(boolean multisample) {
+    public MultisampleDemoES2(final boolean multisample) {
         this.multisample = multisample;
         st = new ShaderState();
-        st.setVerbose(true);        
-        pmvMatrix = new PMVMatrix();        
+        st.setVerbose(true);
+        pmvMatrix = new PMVMatrix();
     }
 
-    public void init(GLAutoDrawable glad) {
+    public void init(final GLAutoDrawable glad) {
         final GL2ES2 gl = glad.getGL().getGL2ES2();
-                
+
         System.err.println();
         System.err.println("req. msaa: "+multisample);
         System.err.println("Requested: " + glad.getNativeSurface().getGraphicsConfiguration().getRequestedCapabilities());
-        multisample = multisample & glad.getChosenGLCapabilities().getNumSamples() > 0 ;
+        multisample = multisample && glad.getChosenGLCapabilities().getNumSamples() > 0 ;
         System.err.println("Chosen   : " + glad.getChosenGLCapabilities());
         System.err.println("has  msaa: "+multisample);
         System.err.println();
-                
+
         final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MultisampleDemoES2.class, "shader",
                 "shader/bin", "mgl_default_xxx", true);
         final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, MultisampleDemoES2.class, "shader",
                 "shader/bin", "mgl_default_xxx", true);
         vp0.defaultShaderCustomization(gl, true, true);
         fp0.defaultShaderCustomization(gl, true, true);
-        
+
         sp0 = new ShaderProgram();
         sp0.add(gl, vp0, System.err);
-        sp0.add(gl, fp0, System.err);       
+        sp0.add(gl, fp0, System.err);
         st.attachShaderProgram(gl, sp0, true);
-        
+
         pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
-        st.ownUniform(pmvMatrixUniform);       
+        st.ownUniform(pmvMatrixUniform);
         st.uniform(gl, pmvMatrixUniform);
-        
-        // Using predef array names, see 
+
+        // Using predef array names, see
         //    GLPointerFuncUtil.getPredefinedArrayIndexName(glArrayIndex);
-        immModeSink = ImmModeSink.createGLSL(40, 
+        immModeSink = ImmModeSink.createGLSL(40,
                                               3, GL.GL_FLOAT,  // vertex
                                               4, GL.GL_FLOAT,  // color
                                               0, GL.GL_FLOAT,  // normal
@@ -109,28 +109,28 @@ public class MultisampleDemoES2 implements GLEventListener {
         final double radius = 1;
         immModeSink.glBegin(GL.GL_LINES);
         for (int i = numSteps - 1; i >= 0; i--) {
-            immModeSink.glVertex3f((float) (radius * Math.cos(i * increment)), 
-                                   (float) (radius * Math.sin(i * increment)), 
+            immModeSink.glVertex3f((float) (radius * Math.cos(i * increment)),
+                                   (float) (radius * Math.sin(i * increment)),
                                    0f);
-            immModeSink.glColor4f( 1f, 1f, 1f, 1f ); 
-            immModeSink.glVertex3f((float) (-1.0 * radius * Math.cos(i * increment)), 
-                                   (float) (-1.0 * radius * Math.sin(i * increment)), 
+            immModeSink.glColor4f( 1f, 1f, 1f, 1f );
+            immModeSink.glVertex3f((float) (-1.0 * radius * Math.cos(i * increment)),
+                                   (float) (-1.0 * radius * Math.sin(i * increment)),
                                    0f);
-            immModeSink.glColor4f( 1f, 1f, 1f, 1f ); 
+            immModeSink.glColor4f( 1f, 1f, 1f, 1f );
         }
         immModeSink.glEnd(gl, false);
-        
+
         st.useProgram(gl, false);
     }
 
-    public void dispose(GLAutoDrawable glad) {
+    public void dispose(final GLAutoDrawable glad) {
         final GL2ES2 gl = glad.getGL().getGL2ES2();
         immModeSink.destroy(gl);
         immModeSink = null;
         st.destroy(gl);
     }
 
-    public void display(GLAutoDrawable glad) {
+    public void display(final GLAutoDrawable glad) {
         final GL2ES2 gl = glad.getGL().getGL2ES2();
         if (multisample) {
             gl.glEnable(GL.GL_MULTISAMPLE);
@@ -139,16 +139,16 @@ public class MultisampleDemoES2 implements GLEventListener {
         //      gl.glEnable(GL.GL_DEPTH_TEST);
         //      gl.glDepthFunc(GL.GL_LESS);
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
-        
+
         st.useProgram(gl, true);
-        
+
         immModeSink.draw(gl, true);
-        
+
         st.useProgram(gl, false);
     }
 
     // Unused routines
-    public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
         System.err.println("reshape ..");
         final GL2ES2 gl = glad.getGL().getGL2ES2();
         pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
@@ -157,12 +157,12 @@ public class MultisampleDemoES2 implements GLEventListener {
         pmvMatrix.glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 10.0f);
         pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
-        
+
         st.useProgram(gl, true);
         st.uniform(gl, pmvMatrixUniform);
         st.useProgram(gl, false);
     }
 
-    public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
+    public void displayChanged(final GLAutoDrawable drawable, final boolean modeChanged, final boolean deviceChanged) {
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/PointsDemoES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/PointsDemoES2.java
index 52af491..8a99a4d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/PointsDemoES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/PointsDemoES2.java
@@ -43,6 +43,7 @@ import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 public class PointsDemoES2 extends PointsDemo {
     ShaderState st;
@@ -54,40 +55,40 @@ public class PointsDemoES2 extends PointsDemo {
     final int edge = 8; // 8*8
     /** vec4[2]: { (sz, smooth, attnMinSz, attnMaxSz), (attnCoeff(3), attnFadeTs) } */
     private static final String mgl_PointParams     = "mgl_PointParams";
-    
+
     /** ( pointSize, pointSmooth, attn. pointMinSize, attn. pointMaxSize ) , ( attenuation coefficients 1f 0f 0f, attenuation fade theshold 1f )   */
-    private final FloatBuffer pointParams = Buffers.newDirectFloatBuffer(new float[] {  1.0f, 0.0f, 0.0f, 4096.0f, 1.0f, 0.0f, 0.0f, 1.0f }); 
+    private final FloatBuffer pointParams = Buffers.newDirectFloatBuffer(new float[] {  1.0f, 0.0f, 0.0f, 4096.0f, 1.0f, 0.0f, 0.0f, 1.0f });
 
-    public PointsDemoES2(int swapInterval) {
+    public PointsDemoES2(final int swapInterval) {
         this.swapInterval = swapInterval;
     }
 
     public PointsDemoES2() {
         this.swapInterval = 1;
     }
-    
-    public void setSmoothPoints(boolean v) { 
-        pointParams.put(1, v ? 1.0f : 0.0f); 
+
+    public void setSmoothPoints(final boolean v) {
+        pointParams.put(1, v ? 1.0f : 0.0f);
     }
-        
-    public void setPointParams(float minSize, float maxSize, float distAttenConst, float distAttenLinear, float distAttenQuadratic, float fadeThreshold) {
+
+    public void setPointParams(final float minSize, final float maxSize, final float distAttenConst, final float distAttenLinear, final float distAttenQuadratic, final float fadeThreshold) {
         pointParams.put(2, minSize);
         pointParams.put(3, maxSize);
         pointParams.put(4+0, distAttenConst);
         pointParams.put(4+1, distAttenLinear);
         pointParams.put(4+2, distAttenQuadratic);
-        pointParams.put(4+3, fadeThreshold);        
+        pointParams.put(4+3, fadeThreshold);
     }
-    
-    public void init(GLAutoDrawable glad) {
-        GL2ES2 gl = glad.getGL().getGL2ES2();
-        
+
+    public void init(final GLAutoDrawable glad) {
+        final GL2ES2 gl = glad.getGL().getGL2ES2();
+
         System.err.println("GL_VENDOR: " + gl.glGetString(GL.GL_VENDOR));
         System.err.println("GL_RENDERER: " + gl.glGetString(GL.GL_RENDERER));
         System.err.println("GL_VERSION: " + gl.glGetString(GL.GL_VERSION));
         System.err.println("GL GLSL: "+gl.hasGLSL()+", has-compiler-func: "+gl.isFunctionAvailable("glCompileShader")+", version "+(gl.hasGLSL() ? gl.glGetString(GL2ES2.GL_SHADING_LANGUAGE_VERSION) : "none"));
         System.err.println("GL Profile: "+gl.getGLProfile());
-        
+
         st = new ShaderState();
         st.setVerbose(true);
         final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(), "shader",
@@ -100,23 +101,23 @@ public class PointsDemoES2 extends PointsDemo {
         sp0.add(gl, vp0, System.err);
         sp0.add(gl, fp0, System.err);
         st.attachShaderProgram(gl, sp0, true);
-        
+
         // setup mgl_PMVMatrix
         pmvMatrix = new PMVMatrix();
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
+        pmvMatrix.glLoadIdentity();
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
-        pmvMatrix.glLoadIdentity();       
         pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
         st.ownUniform(pmvMatrixUniform);
-        st.uniform(gl, pmvMatrixUniform);        
-        
+        st.uniform(gl, pmvMatrixUniform);
+
         st.uniform(gl, new GLUniformData(mgl_PointParams, 4, pointParams));
-        
+
         final GLUniformData colorStaticUniform = new GLUniformData("mgl_ColorStatic", 4, Buffers.newDirectFloatBuffer(new float[] { 1.0f, 1.0f, 1.0f, 1.0f }) );
         st.uniform(gl, colorStaticUniform);
         st.ownUniform(colorStaticUniform);
-        
+
         // Allocate Vertex Array
         vertices = GLArrayDataServer.createGLSL("mgl_Vertex", 3, GL.GL_FLOAT, false, edge*edge, GL.GL_STATIC_DRAW);
         pointSizes = GLArrayDataServer.createGLSL("mgl_PointSize", 1, GL.GL_FLOAT, false, edge*edge, GL.GL_STATIC_DRAW);
@@ -138,29 +139,29 @@ public class PointsDemoES2 extends PointsDemo {
         pointSizes.enableBuffer(gl, false);
 
         // OpenGL Render Settings
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
-        st.useProgram(gl, false);        
+        gl.glEnable(GL.GL_DEPTH_TEST);
+        st.useProgram(gl, false);
     }
 
-    public void display(GLAutoDrawable glad) {
-        GL2ES2 gl = glad.getGL().getGL2ES2();
+    public void display(final GLAutoDrawable glad) {
+        final GL2ES2 gl = glad.getGL().getGL2ES2();
         gl.glClearColor(0f, 0f, 0f, 0f);
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
         st.useProgram(gl, true);
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glTranslatef(0, 0, -10);
-        st.uniform(gl, pmvMatrixUniform);        
+        st.uniform(gl, pmvMatrixUniform);
 
-        GLUniformData ud = st.getUniform(mgl_PointParams);
+        final GLUniformData ud = st.getUniform(mgl_PointParams);
         if(null!=ud) {
-            // same data object 
+            // same data object
             st.uniform(gl, ud);
         }
-        
+
         vertices.enableBuffer(gl, true);
         pointSizes.enableBuffer(gl, true);
-        
+
         if(gl.isGL2GL3()) {
             gl.glEnable(GL2GL3.GL_VERTEX_PROGRAM_POINT_SIZE);
         }
@@ -171,27 +172,27 @@ public class PointsDemoES2 extends PointsDemo {
         gl.glBlendFunc ( GL.GL_SRC_ALPHA, GL.GL_ONE );
 
         gl.glDrawArrays(GL.GL_POINTS, 0, edge*edge);
-        
+
         if(gl.isGL2GL3()) {
             gl.glDisable(GL2GL3.GL_VERTEX_PROGRAM_POINT_SIZE);
         }
-        
+
         pointSizes.enableBuffer(gl, false);
         vertices.enableBuffer(gl, false);
         st.useProgram(gl, false);
     }
 
-    public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
         // Thread.dumpStack();
-        GL2ES2 gl = glad.getGL().getGL2ES2();
-        
-        if(-1 != swapInterval) {        
+        final GL2ES2 gl = glad.getGL().getGL2ES2();
+
+        if(-1 != swapInterval) {
             gl.setSwapInterval(swapInterval); // in case switching the drawable (impl. may bound attribute there)
         }
-        
+
         st.useProgram(gl, true);
         // Set location in front of camera
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.gluPerspective(45.0F, ( (float) width / (float) height ) / 1.0f, 1.0F, 100.0F);
         //pmvMatrix.glOrthof(-4.0f, 4.0f, -4.0f, 4.0f, 1.0f, 100.0f);
@@ -199,11 +200,10 @@ public class PointsDemoES2 extends PointsDemo {
         st.useProgram(gl, false);
     }
 
-    public void dispose(GLAutoDrawable glad) {
-        GL2ES2 gl = glad.getGL().getGL2ES2();
+    public void dispose(final GLAutoDrawable glad) {
+        final GL2ES2 gl = glad.getGL().getGL2ES2();
         st.destroy(gl);
         st = null;
-        pmvMatrix.destroy();
         pmvMatrix = null;
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java
index 715a97d..8058d1b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareES2.java
@@ -40,6 +40,7 @@ import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRendererListener {
     private ShaderState st;
@@ -55,43 +56,43 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
     private TileRendererBase tileRendererInUse = null;
     private boolean doRotateBeforePrinting;
 
-    public RedSquareES2(int swapInterval) {
+    public RedSquareES2(final int swapInterval) {
         this.swapInterval = swapInterval;
     }
 
     public RedSquareES2() {
         this.swapInterval = 1;
     }
-        
+
     @Override
-    public void addTileRendererNotify(TileRendererBase tr) {
+    public void addTileRendererNotify(final TileRendererBase tr) {
         tileRendererInUse = tr;
         doRotateBeforePrinting = doRotate;
-        setDoRotation(false);      
+        setDoRotation(false);
     }
     @Override
-    public void removeTileRendererNotify(TileRendererBase tr) {
+    public void removeTileRendererNotify(final TileRendererBase tr) {
         tileRendererInUse = null;
-        setDoRotation(doRotateBeforePrinting);      
+        setDoRotation(doRotateBeforePrinting);
     }
     @Override
-    public void startTileRendering(TileRendererBase tr) {
+    public void startTileRendering(final TileRendererBase tr) {
         System.err.println("RedSquareES2.startTileRendering: "+tr);
     }
     @Override
-    public void endTileRendering(TileRendererBase tr) {
+    public void endTileRendering(final TileRendererBase tr) {
         System.err.println("RedSquareES2.endTileRendering: "+tr);
     }
-    
-    public void setAspect(float aspect) { this.aspect = aspect; }
-    public void setDoRotation(boolean rotate) { this.doRotate = rotate; }
-    public void setClearBuffers(boolean v) { clearBuffers = v; }
-    
+
+    public void setAspect(final float aspect) { this.aspect = aspect; }
+    public void setDoRotation(final boolean rotate) { this.doRotate = rotate; }
+    public void setClearBuffers(final boolean v) { clearBuffers = v; }
+
     @Override
-    public void init(GLAutoDrawable glad) {
+    public void init(final GLAutoDrawable glad) {
         System.err.println(Thread.currentThread()+" RedSquareES2.init: tileRendererInUse "+tileRendererInUse);
         final GL2ES2 gl = glad.getGL().getGL2ES2();
-        
+
         System.err.println("RedSquareES2 init on "+Thread.currentThread());
         System.err.println("Chosen GLCapabilities: " + glad.getChosenGLCapabilities());
         System.err.println("INIT GL IS: " + gl.getClass().getName());
@@ -112,17 +113,17 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
         sp0.add(gl, vp0, System.err);
         sp0.add(gl, fp0, System.err);
         st.attachShaderProgram(gl, sp0, true);
-        
+
         // setup mgl_PMVMatrix
         pmvMatrix = new PMVMatrix();
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
+        pmvMatrix.glLoadIdentity();
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
-        pmvMatrix.glLoadIdentity();       
         pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
         st.ownUniform(pmvMatrixUniform);
-        st.uniform(gl, pmvMatrixUniform);        
-        
+        st.uniform(gl, pmvMatrixUniform);
+
         // Allocate Vertex Array
         vertices = GLArrayDataServer.createGLSL("mgl_Vertex", 3, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
         vertices.putf(-2); vertices.putf( 2); vertices.putf( 0);
@@ -132,28 +133,28 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
         vertices.seal(gl, true);
         st.ownAttribute(vertices, true);
         vertices.enableBuffer(gl, false);
-        
+
         // Allocate Color Array
         colors= GLArrayDataServer.createGLSL("mgl_Color", 4, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
         colors.putf(1); colors.putf(0); colors.putf(0); colors.putf(1);
         colors.putf(0); colors.putf(0); colors.putf(1); colors.putf(1);
         colors.putf(1); colors.putf(0); colors.putf(0); colors.putf(1);
         colors.putf(1); colors.putf(0); colors.putf(0); colors.putf(1);
-        colors.seal(gl, true);          
+        colors.seal(gl, true);
         st.ownAttribute(colors, true);
         colors.enableBuffer(gl, false);
-        
+
         // OpenGL Render Settings
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
-        st.useProgram(gl, false);        
+        gl.glEnable(GL.GL_DEPTH_TEST);
+        st.useProgram(gl, false);
 
         t0 = System.currentTimeMillis();
         System.err.println(Thread.currentThread()+" RedSquareES2.init FIN");
     }
 
     @Override
-    public void display(GLAutoDrawable glad) {
-        long t1 = System.currentTimeMillis();
+    public void display(final GLAutoDrawable glad) {
+        final long t1 = System.currentTimeMillis();
 
         final GL2ES2 gl = glad.getGL().getGL2ES2();
         if( clearBuffers ) {
@@ -169,15 +170,15 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
         }
         st.useProgram(gl, true);
         // One rotation every four seconds
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glTranslatef(0, 0, -10);
         if(doRotate) {
-            float ang = ((float) (t1 - t0) * 360.0F) / 4000.0F;
+            final float ang = ((t1 - t0) * 360.0F) / 4000.0F;
             pmvMatrix.glRotatef(ang, 0, 0, 1);
             pmvMatrix.glRotatef(ang, 0, 1, 0);
         }
-        st.uniform(gl, pmvMatrixUniform);        
+        st.uniform(gl, pmvMatrixUniform);
 
         // Draw a square
         vertices.enableBuffer(gl, true);
@@ -189,41 +190,41 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
     }
 
     @Override
-    public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
         final GL2ES2 gl = glad.getGL().getGL2ES2();
-        if(-1 != swapInterval) {        
+        if(-1 != swapInterval) {
             gl.setSwapInterval(swapInterval);
         }
         reshapeImpl(gl, x, y, width, height, width, height);
     }
-    
+
     @Override
-    public void reshapeTile(TileRendererBase tr,
-                            int tileX, int tileY, int tileWidth, int tileHeight, 
-                            int imageWidth, int imageHeight) {
+    public void reshapeTile(final TileRendererBase tr,
+                            final int tileX, final int tileY, final int tileWidth, final int tileHeight,
+                            final int imageWidth, final int imageHeight) {
         final GL2ES2 gl = tr.getAttachedDrawable().getGL().getGL2ES2();
         gl.setSwapInterval(0);
         reshapeImpl(gl, tileX, tileY, tileWidth, tileHeight, imageWidth, imageHeight);
     }
-    
-    void reshapeImpl(GL2ES2 gl, int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight) {
+
+    void reshapeImpl(final GL2ES2 gl, final int tileX, final int tileY, final int tileWidth, final int tileHeight, final int imageWidth, final int imageHeight) {
         System.err.println(Thread.currentThread()+" RedSquareES2.reshape "+tileX+"/"+tileY+" "+tileWidth+"x"+tileHeight+" of "+imageWidth+"x"+imageHeight+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(gl.getContext().getGLDrawable().getHandle())+", tileRendererInUse "+tileRendererInUse);
         // Thread.dumpStack();
         if( !gl.hasGLSL() ) {
             return;
         }
-        
+
         st.useProgram(gl, true);
         // Set location in front of camera
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
-        
+
         // compute projection parameters 'normal' perspective
         final float fovy=45f;
         final float aspect2 = ( (float) imageWidth / (float) imageHeight ) / aspect;
         final float zNear=1f;
         final float zFar=100f;
-        
+
         // compute projection parameters 'normal' frustum
         final float top=(float)Math.tan(fovy*((float)Math.PI)/360.0f)*zNear;
         final float bottom=-1.0f*top;
@@ -231,23 +232,23 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
         final float right=aspect2*top;
         final float w = right - left;
         final float h = top - bottom;
-        
+
         // compute projection parameters 'tiled'
         final float l = left + tileX * w / imageWidth;
         final float r = l + tileWidth * w / imageWidth;
         final float b = bottom + tileY * h / imageHeight;
         final float t = b + tileHeight * h / imageHeight;
-        
+
         pmvMatrix.glFrustumf(l, r, b, t, zNear, zFar);
         //pmvMatrix.glOrthof(-4.0f, 4.0f, -4.0f, 4.0f, 1.0f, 100.0f);
         st.uniform(gl, pmvMatrixUniform);
         st.useProgram(gl, false);
-        
+
         System.err.println(Thread.currentThread()+" RedSquareES2.reshape FIN");
     }
 
     @Override
-    public void dispose(GLAutoDrawable glad) {
+    public void dispose(final GLAutoDrawable glad) {
         System.err.println(Thread.currentThread()+" RedSquareES2.dispose: tileRendererInUse "+tileRendererInUse);
         final GL2ES2 gl = glad.getGL().getGL2ES2();
         if( !gl.hasGLSL() ) {
@@ -255,8 +256,7 @@ public class RedSquareES2 implements GLEventListener, TileRendererBase.TileRende
         }
         st.destroy(gl);
         st = null;
-        pmvMatrix.destroy();
         pmvMatrix = null;
         System.err.println(Thread.currentThread()+" RedSquareES2.dispose FIN");
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareMappedES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareMappedES2.java
index f0c9fc6..35449b3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareMappedES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/RedSquareMappedES2.java
@@ -43,6 +43,7 @@ import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLBufferStorage;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.TileRendererListener {
     private ShaderState st;
@@ -58,7 +59,7 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
     private TileRendererBase tileRendererInUse = null;
     private boolean doRotateBeforePrinting;
 
-    public RedSquareMappedES2(int swapInterval) {
+    public RedSquareMappedES2(final int swapInterval) {
         this.swapInterval = swapInterval;
     }
 
@@ -67,31 +68,31 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
     }
 
     @Override
-    public void addTileRendererNotify(TileRendererBase tr) {
+    public void addTileRendererNotify(final TileRendererBase tr) {
         tileRendererInUse = tr;
         doRotateBeforePrinting = doRotate;
         setDoRotation(false);
     }
     @Override
-    public void removeTileRendererNotify(TileRendererBase tr) {
+    public void removeTileRendererNotify(final TileRendererBase tr) {
         tileRendererInUse = null;
         setDoRotation(doRotateBeforePrinting);
     }
     @Override
-    public void startTileRendering(TileRendererBase tr) {
+    public void startTileRendering(final TileRendererBase tr) {
         System.err.println("RedSquareES2.startTileRendering: "+tr);
     }
     @Override
-    public void endTileRendering(TileRendererBase tr) {
+    public void endTileRendering(final TileRendererBase tr) {
         System.err.println("RedSquareES2.endTileRendering: "+tr);
     }
 
-    public void setAspect(float aspect) { this.aspect = aspect; }
-    public void setDoRotation(boolean rotate) { this.doRotate = rotate; }
-    public void setClearBuffers(boolean v) { clearBuffers = v; }
+    public void setAspect(final float aspect) { this.aspect = aspect; }
+    public void setDoRotation(final boolean rotate) { this.doRotate = rotate; }
+    public void setClearBuffers(final boolean v) { clearBuffers = v; }
 
     @Override
-    public void init(GLAutoDrawable glad) {
+    public void init(final GLAutoDrawable glad) {
         System.err.println(Thread.currentThread()+" RedSquareES2.init: tileRendererInUse "+tileRendererInUse);
         final GL2ES2 gl = glad.getGL().getGL2ES2();
 
@@ -118,9 +119,9 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
 
         // setup mgl_PMVMatrix
         pmvMatrix = new PMVMatrix();
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
         pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
         st.ownUniform(pmvMatrixUniform);
@@ -163,7 +164,7 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
         colors.enableBuffer(gl, false);
 
         // OpenGL Render Settings
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_DEPTH_TEST);
         st.useProgram(gl, false);
 
         t0 = System.currentTimeMillis();
@@ -171,8 +172,8 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
     }
 
     @Override
-    public void display(GLAutoDrawable glad) {
-        long t1 = System.currentTimeMillis();
+    public void display(final GLAutoDrawable glad) {
+        final long t1 = System.currentTimeMillis();
 
         final GL2ES2 gl = glad.getGL().getGL2ES2();
         if( clearBuffers ) {
@@ -188,11 +189,11 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
         }
         st.useProgram(gl, true);
         // One rotation every four seconds
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glTranslatef(0, 0, -10);
         if(doRotate) {
-            float ang = ((t1 - t0) * 360.0F) / 4000.0F;
+            final float ang = ((t1 - t0) * 360.0F) / 4000.0F;
             pmvMatrix.glRotatef(ang, 0, 0, 1);
             pmvMatrix.glRotatef(ang, 0, 1, 0);
         }
@@ -208,7 +209,7 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
     }
 
     @Override
-    public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
         final GL2ES2 gl = glad.getGL().getGL2ES2();
         if(-1 != swapInterval) {
             gl.setSwapInterval(swapInterval);
@@ -217,15 +218,15 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
     }
 
     @Override
-    public void reshapeTile(TileRendererBase tr,
-                            int tileX, int tileY, int tileWidth, int tileHeight,
-                            int imageWidth, int imageHeight) {
+    public void reshapeTile(final TileRendererBase tr,
+                            final int tileX, final int tileY, final int tileWidth, final int tileHeight,
+                            final int imageWidth, final int imageHeight) {
         final GL2ES2 gl = tr.getAttachedDrawable().getGL().getGL2ES2();
         gl.setSwapInterval(0);
         reshapeImpl(gl, tileX, tileY, tileWidth, tileHeight, imageWidth, imageHeight);
     }
 
-    void reshapeImpl(GL2ES2 gl, int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight) {
+    void reshapeImpl(final GL2ES2 gl, final int tileX, final int tileY, final int tileWidth, final int tileHeight, final int imageWidth, final int imageHeight) {
         System.err.println(Thread.currentThread()+" RedSquareES2.reshape "+tileX+"/"+tileY+" "+tileWidth+"x"+tileHeight+" of "+imageWidth+"x"+imageHeight+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(gl.getContext().getGLDrawable().getHandle())+", tileRendererInUse "+tileRendererInUse);
         // Thread.dumpStack();
         if( !gl.hasGLSL() ) {
@@ -234,7 +235,7 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
 
         st.useProgram(gl, true);
         // Set location in front of camera
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
 
         // compute projection parameters 'normal' perspective
@@ -266,7 +267,7 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
     }
 
     @Override
-    public void dispose(GLAutoDrawable glad) {
+    public void dispose(final GLAutoDrawable glad) {
         System.err.println(Thread.currentThread()+" RedSquareES2.dispose: tileRendererInUse "+tileRendererInUse);
         final GL2ES2 gl = glad.getGL().getGL2ES2();
         if( !gl.hasGLSL() ) {
@@ -274,7 +275,6 @@ public class RedSquareMappedES2 implements GLEventListener, TileRendererBase.Til
         }
         st.destroy(gl);
         st = null;
-        pmvMatrix.destroy();
         pmvMatrix = null;
         System.err.println(Thread.currentThread()+" RedSquareES2.dispose FIN");
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw01ES2Listener.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw01ES2Listener.java
index 8aa3a00..c87c04f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw01ES2Listener.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw01ES2Listener.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.es2;
 
 import java.nio.FloatBuffer;
@@ -53,37 +53,37 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A
     Texture  texture;
     int textureUnit;
     boolean keepTextureBound;
-    
+
     ShaderState st;
     PMVMatrix pmvMatrix;
     GLUniformData pmvMatrixUniform;
     GLArrayDataServer interleavedVBO;
     float[] clearColor = new float[] { 1.0f, 1.0f, 1.0f, 1.0f };
-    
+
     /**
-     * 
+     *
      * @param td
      * @param textureUnit of range [0..]
      */
-    public TextureDraw01ES2Listener(TextureData td, int textureUnit) {
+    public TextureDraw01ES2Listener(final TextureData td, final int textureUnit) {
         this.textureData = td;
         this.textureUnit = textureUnit;
         this.keepTextureBound = false;
     }
-    
-    public void setClearColor(float[] clearColor) {
+
+    public void setClearColor(final float[] clearColor) {
         this.clearColor = clearColor;
     }
 
     @Override
-    public void setKeepTextureBound(boolean v) {
+    public void setKeepTextureBound(final boolean v) {
         this.keepTextureBound = v;
     }
     @Override
     public Texture getTexture( ) {
         return this.texture;
     }
-    
+
     /**
     public void setTextureData(GL gl, TextureData textureData ) {
         if(null!=texture) {
@@ -95,23 +95,23 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A
         }
         this.textureData = textureData;
         this.texture = TextureIO.newTexture(this.textureData);
-        
+
         // fix VBO !
     } */
 
     static final String shaderBasename = "texture01_xxx";
-       
-    private void initShader(GL2ES2 gl, boolean use_program) {
+
+    private void initShader(final GL2ES2 gl, final boolean use_program) {
         // Create & Compile the shader objects
-        ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(), 
+        final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
                                             "shader", "shader/bin", shaderBasename, true);
-        ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(), 
+        final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
                                             "shader", "shader/bin", shaderBasename, true);
         rsVp.defaultShaderCustomization(gl, true, true);
         rsFp.defaultShaderCustomization(gl, true, true);
-        
+
         // Create & Link the shader program
-        ShaderProgram sp = new ShaderProgram();
+        final ShaderProgram sp = new ShaderProgram();
         sp.add(rsVp);
         sp.add(rsFp);
         if(!sp.link(gl, System.err)) {
@@ -122,24 +122,24 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A
         st = new ShaderState();
         st.attachShaderProgram(gl, sp, use_program);
     }
-    
+
     @Override
-    public void init(GLAutoDrawable glad) {
-        if(null!=textureData) {
-            this.texture = TextureIO.newTexture(glad.getGL(), textureData);
+    public void init(final GLAutoDrawable glad) {
+        if( null != textureData ) {
+            texture = TextureIO.newTexture(glad.getGL(), textureData);
         }
-        GL2ES2 gl = glad.getGL().getGL2ES2();
-        
+        final GL2ES2 gl = glad.getGL().getGL2ES2();
+
         initShader(gl, true);
-                
+
         // setup mgl_PMVMatrix
         pmvMatrix = new PMVMatrix();
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
+        pmvMatrix.glLoadIdentity();
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
-        pmvMatrix.glLoadIdentity();       
         pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
-        
+
         st.ownUniform(pmvMatrixUniform);
         if(!st.uniform(gl, pmvMatrixUniform)) {
             throw new GLException("Error setting PMVMatrix in shader: "+st);
@@ -148,33 +148,35 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A
             throw new GLException("Error setting mgl_ActiveTexture in shader: "+st);
         }
 
-        // fetch the flipped texture coordinates
-        texture.getImageTexCoords().getST_LB_RB_LT_RT(s_quadTexCoords, 0, 1f, 1f);
-        
+        if( null != texture ) {
+            // fetch the flipped texture coordinates
+            texture.getImageTexCoords().getST_LB_RB_LT_RT(s_quadTexCoords, 0, 1f, 1f);
+        }
+
         interleavedVBO = GLArrayDataServer.createGLSLInterleaved(3+4+2, GL.GL_FLOAT, false, 3*4, GL.GL_STATIC_DRAW);
-        {        
-            interleavedVBO.addGLSLSubArray("mgl_Vertex",        3, GL.GL_ARRAY_BUFFER);            
-            interleavedVBO.addGLSLSubArray("mgl_Color",         4, GL.GL_ARRAY_BUFFER);            
+        {
+            interleavedVBO.addGLSLSubArray("mgl_Vertex",        3, GL.GL_ARRAY_BUFFER);
+            interleavedVBO.addGLSLSubArray("mgl_Color",         4, GL.GL_ARRAY_BUFFER);
             //interleavedVBO.addGLSLSubArray("mgl_Normal",        3, GL.GL_ARRAY_BUFFER);
             interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
 
-            FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
-            
+            final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
+
             for(int i=0; i<4; i++) {
                 ib.put(s_quadVertices,  i*3, 3);
-                ib.put(s_quadColors,    i*4, 4);  
+                ib.put(s_quadColors,    i*4, 4);
                 //ib.put(s_cubeNormals,   i*3, 3);
                 ib.put(s_quadTexCoords, i*2, 2);
-            }                        
+            }
         }
         interleavedVBO.seal(gl, true);
         interleavedVBO.enableBuffer(gl, false);
         st.ownAttribute(interleavedVBO, true);
-        
+
         // OpenGL Render Settings
         gl.glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
-        
+        gl.glEnable(GL.GL_DEPTH_TEST);
+
         if( keepTextureBound && null != texture  ) {
             gl.glActiveTexture(GL.GL_TEXTURE0 + textureUnit);
             texture.enable(gl);
@@ -184,28 +186,28 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A
     }
 
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
         // Clear background to white
         gl.glClearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]);
         if(null != st) {
             pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
             pmvMatrix.glLoadIdentity();
             pmvMatrix.glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 10.0f);
-    
+
             pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
             pmvMatrix.glLoadIdentity();
-            
+
             st.useProgram(gl, true);
             st.uniform(gl, pmvMatrixUniform);
             st.useProgram(gl, false);
-        }        
+        }
     }
 
     @Override
-    public void dispose(GLAutoDrawable drawable) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+    public void dispose(final GLAutoDrawable drawable) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
         if(null!=texture) {
             texture.disable(gl);
             texture.destroy(gl);
@@ -215,50 +217,49 @@ public class TextureDraw01ES2Listener implements GLEventListener, TextureDraw01A
         }
 
         pmvMatrixUniform = null;
-        pmvMatrix.destroy();
         pmvMatrix=null;
         st.destroy(gl);
         st=null;
     }
 
     @Override
-    public void display(GLAutoDrawable drawable) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+    public void display(final GLAutoDrawable drawable) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
 
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
 
-        st.useProgram(gl, true);        
+        st.useProgram(gl, true);
         interleavedVBO.enableBuffer(gl, true);
         if( !keepTextureBound && null != texture ) {
-            gl.glActiveTexture(GL.GL_TEXTURE0 + textureUnit);        
+            gl.glActiveTexture(GL.GL_TEXTURE0 + textureUnit);
             texture.enable(gl);
             texture.bind(gl);
         }
-        
+
         gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
-        
+
         if( !keepTextureBound && null != texture  ) {
             texture.disable(gl);
         }
-        interleavedVBO.enableBuffer(gl, false);        
+        interleavedVBO.enableBuffer(gl, false);
         st.useProgram(gl, false);
     }
-    
-    private static final float[] s_quadVertices = { 
+
+    private static final float[] s_quadVertices = {
       -1f, -1f, 0f, // LB
        1f, -1f, 0f, // RB
       -1f,  1f, 0f, // LT
-       1f,  1f, 0f  // RT 
+       1f,  1f, 0f  // RT
     };
-    private static final float[] s_quadColors = { 
+    private static final float[] s_quadColors = {
       1f, 1f, 1f, 1f,
       1f, 1f, 1f, 1f,
       1f, 1f, 1f, 1f,
       1f, 1f, 1f, 1f };
-    private static final float[] s_quadTexCoords = { 
+    private static final float[] s_quadTexCoords = {
             0f, 0f, // LB
             1f, 0f, // RB
-            0f, 1f, // LT   
+            0f, 1f, // LT
             1f, 1f  // RT
     };
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java
index aac0080..0c5d89e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureDraw02ES2ListenerFBO.java
@@ -1,22 +1,29 @@
 /**
- * Copyright (C) 2011 JogAmp Community. All rights reserved.
+ * Copyright 2011 JogAmp Community. All rights reserved.
  *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- * 
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
  */
 package com.jogamp.opengl.test.junit.jogl.demos.es2;
 
@@ -42,135 +49,135 @@ public class TextureDraw02ES2ListenerFBO implements GLEventListener {
     private final GLEventListener demo;
     private final int swapInterval;
     private boolean clearBuffers = true;
-    private int numSamples;    
+    private int numSamples;
     int textureUnit;
     boolean keepTextureBound;
-    
+
     private final ShaderState st;
     private final PMVMatrix pmvMatrix;
-    
-    private final FBObject fbo0;    
-    
+
+    private final FBObject fbo0;
+
     private TextureAttachment fbo0Tex;
-        
+
     private ShaderProgram sp0;
     private GLUniformData pmvMatrixUniform;
     private GLArrayDataServer interleavedVBO;
     private GLUniformData texUnit0;
-    
-    public TextureDraw02ES2ListenerFBO(GLEventListener demo, int swapInterval, int textureUnit) {
+
+    public TextureDraw02ES2ListenerFBO(final GLEventListener demo, final int swapInterval, final int textureUnit) {
         this.demo = demo;
         this.swapInterval = swapInterval;
         this.textureUnit = textureUnit;
         this.keepTextureBound = false;
-        
+
         st = new ShaderState();
-        // st.setVerbose(true);        
+        // st.setVerbose(true);
         pmvMatrix = new PMVMatrix();
-        
+
         fbo0 = new FBObject();
-        
+
         numSamples = 0;
     }
-    
-    public void setClearBuffers(boolean v) { clearBuffers = v; }
-    
-    public void setKeepTextureBound(boolean v) {
+
+    public void setClearBuffers(final boolean v) { clearBuffers = v; }
+
+    public void setKeepTextureBound(final boolean v) {
         this.keepTextureBound = v;
     }
-    public void setMSAA(int numSamples) { 
-        this.numSamples=numSamples; 
+    public void setMSAA(final int numSamples) {
+        this.numSamples=numSamples;
     }
     public int getMSAA() { return numSamples; }
-    
+
     @Override
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
+
         demo.init(drawable);
-        
+
         final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, TextureDraw02ES2ListenerFBO.class, "shader",
                 "shader/bin", "texture01_xxx", true);
         final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, TextureDraw02ES2ListenerFBO.class, "shader",
                 "shader/bin", "texture02_xxx", true);
         vp0.defaultShaderCustomization(gl, true, true);
         fp0.defaultShaderCustomization(gl, true, true);
-        
+
         sp0 = new ShaderProgram();
         sp0.add(gl, vp0, System.err);
-        sp0.add(gl, fp0, System.err);       
+        sp0.add(gl, fp0, System.err);
         st.attachShaderProgram(gl, sp0, true);
-        
+
         pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
-        st.ownUniform(pmvMatrixUniform);       
+        st.ownUniform(pmvMatrixUniform);
         st.uniform(gl, pmvMatrixUniform);
-        
+
         interleavedVBO = GLArrayDataServer.createGLSLInterleaved(3+4+2, GL.GL_FLOAT, false, 3*4, GL.GL_STATIC_DRAW);
-        {        
-            interleavedVBO.addGLSLSubArray("mgl_Vertex",        3, GL.GL_ARRAY_BUFFER);            
-            interleavedVBO.addGLSLSubArray("mgl_Color",         4, GL.GL_ARRAY_BUFFER);            
+        {
+            interleavedVBO.addGLSLSubArray("mgl_Vertex",        3, GL.GL_ARRAY_BUFFER);
+            interleavedVBO.addGLSLSubArray("mgl_Color",         4, GL.GL_ARRAY_BUFFER);
             //interleavedVBO.addGLSLSubArray("mgl_Normal",        3, GL.GL_ARRAY_BUFFER);
             interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
 
-            FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
-            
+            final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
+
             for(int i=0; i<4; i++) {
                 ib.put(s_quadVertices,  i*3, 3);
-                ib.put(s_quadColors,    i*4, 4);  
+                ib.put(s_quadColors,    i*4, 4);
                 //ib.put(s_cubeNormals,   i*3, 3);
                 ib.put(s_quadTexCoords, i*2, 2);
-            }                        
+            }
         }
         interleavedVBO.seal(gl, true);
         interleavedVBO.enableBuffer(gl, false);
         st.ownAttribute(interleavedVBO, true);
-                
+
         texUnit0 = new GLUniformData("mgl_Texture0", textureUnit);
-        st.ownUniform(texUnit0);       
+        st.ownUniform(texUnit0);
         st.uniform(gl, texUnit0);
-        
+
         st.useProgram(gl, false);
-                
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);        
+
+        gl.glEnable(GL.GL_DEPTH_TEST);
     }
-    
-    private void initFBOs(GL gl, int width, int height) {
+
+    private void initFBOs(final GL gl, final int width, final int height) {
         // remove all texture attachments, since MSAA uses just color-render-buffer
         // and non-MSAA uses texture2d-buffer
         fbo0.detachAllColorbuffer(gl);
-            
+
         fbo0.reset(gl, width, height, numSamples, false);
         numSamples = fbo0.getNumSamples();
-        
+
         if(numSamples>0) {
             fbo0.attachColorbuffer(gl, 0, true);
             fbo0.resetSamplingSink(gl);
-            fbo0Tex = fbo0.getSamplingSink();
+            fbo0Tex = fbo0.getSamplingSink().getTextureAttachment();
         } else {
             fbo0Tex = fbo0.attachTexture2D(gl, 0, true);
-        }        
+        }
         numSamples=fbo0.getNumSamples();
         fbo0.attachRenderbuffer(gl, Type.DEPTH, 24);
         fbo0.unbind(gl);
     }
 
-    private void resetFBOs(GL gl, int width, int height) {
+    private void resetFBOs(final GL gl, final int width, final int height) {
         fbo0.reset(gl, width, height, numSamples, true);
         numSamples = fbo0.getNumSamples();
         if(numSamples>0) {
-            fbo0Tex = fbo0.getSamplingSink();
+            fbo0Tex = fbo0.getSamplingSink().getTextureAttachment();
         } else {
-            fbo0Tex = (TextureAttachment) fbo0.getColorbuffer(0);
-        }        
+            fbo0Tex = fbo0.getColorbuffer(0).getTextureAttachment();
+        }
     }
-    
+
     @Override
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
         demo.dispose(drawable);
         fbo0.destroy(gl);
         st.destroy(gl);
-        
+
         fbo0Tex = null;
         sp0 = null;
         pmvMatrixUniform = null;
@@ -178,28 +185,28 @@ public class TextureDraw02ES2ListenerFBO implements GLEventListener {
     }
 
     @Override
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
 
         if( fbo0.getNumSamples() != numSamples ) {
             System.err.println("**** NumSamples: "+fbo0.getNumSamples()+" -> "+numSamples);
-            resetFBOs(gl, drawable.getWidth(), drawable.getHeight());
+            resetFBOs(gl, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
         }
-        
+
         if(0 < numSamples) {
             gl.glEnable(GL.GL_MULTISAMPLE);
         }
-        
+
         fbo0.bind(gl);
         demo.display(drawable);
         fbo0.unbind(gl);
-        
+
         st.useProgram(gl, true);
         if( clearBuffers ) {
             gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
             gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
         }
-        
+
         if( !keepTextureBound ) {
             gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit0.intValue());
             fbo0.use(gl, fbo0Tex);
@@ -209,41 +216,41 @@ public class TextureDraw02ES2ListenerFBO implements GLEventListener {
         }
         gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit0.intValue());
         interleavedVBO.enableBuffer(gl, true);
-                
+
         gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
-        
+
         interleavedVBO.enableBuffer(gl, false);
-        
+
         if( !keepTextureBound ) {
             fbo0.unuse(gl);
         }
-        
-        st.useProgram(gl, false);        
+
+        st.useProgram(gl, false);
     }
 
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
-        if(-1 != swapInterval) {        
+
+        if(-1 != swapInterval) {
             gl.setSwapInterval(swapInterval); // in case switching the drawable (impl. may bound attribute there)
         }
-        
+
         if( !fbo0.isInitialized() ) {
             System.err.println("**** Reshape.Init: "+width+"x"+height);
             initFBOs(gl, width, height);
-        } else {        
+        } else {
             System.err.println("**** Reshape.Reset: "+width+"x"+height);
             if( keepTextureBound ) {
                 fbo0.unuse(gl);
             }
             resetFBOs(gl, width, height);
         }
-        
+
         fbo0.bind(gl);
         demo.reshape(drawable, x, y, width, height);
         fbo0.unbind(gl);
-        
+
         if( keepTextureBound ) {
             gl.glActiveTexture(GL.GL_TEXTURE0 + texUnit0.intValue());
             fbo0.use(gl, fbo0Tex);
@@ -251,35 +258,35 @@ public class TextureDraw02ES2ListenerFBO implements GLEventListener {
                 gl.glEnable(GL.GL_TEXTURE_2D);
             }
         }
-        
+
         pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 10.0f);
 
         pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
-        
+
         st.useProgram(gl, true);
         st.uniform(gl, pmvMatrixUniform);
         st.useProgram(gl, false);
-        
+
     }
 
-    private static final float[] s_quadVertices = { 
+    private static final float[] s_quadVertices = {
       -1f, -1f, 0f, // LB
        1f, -1f, 0f, // RB
       -1f,  1f, 0f, // LT
-       1f,  1f, 0f  // RT 
+       1f,  1f, 0f  // RT
     };
-    private static final float[] s_quadColors = { 
+    private static final float[] s_quadColors = {
       1f, 1f, 1f, 1f,
       1f, 1f, 1f, 1f,
       1f, 1f, 1f, 1f,
       1f, 1f, 1f, 1f };
-    private static final float[] s_quadTexCoords = { 
+    private static final float[] s_quadTexCoords = {
             0f, 0f, // LB
             1f, 0f, // RB
-            0f, 1f, // LT   
+            0f, 1f, // LT
             1f, 1f  // RT
     };
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
index b02238c..99b943c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/TextureSequenceCubeES2.java
@@ -57,7 +57,7 @@ import com.jogamp.opengl.util.texture.TextureSequence;
 import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
 
 public class TextureSequenceCubeES2 implements GLEventListener {
-    public TextureSequenceCubeES2 (TextureSequence texSource, boolean innerCube, float zoom0, float rotx, float roty) {
+    public TextureSequenceCubeES2 (final TextureSequence texSource, final boolean innerCube, final float zoom0, final float rotx, final float roty) {
         this.texSeq = texSource;
         this.innerCube = innerCube;
         this.zoom      = zoom0;
@@ -84,23 +84,27 @@ public class TextureSequenceCubeES2 implements GLEventListener {
         int ly = 0;
         boolean first = false;
 
-        public void mousePressed(MouseEvent e) {
+        public void mousePressed(final MouseEvent e) {
             first = true;
         }
-        public void mouseMoved(MouseEvent e) {
+        public void mouseMoved(final MouseEvent e) {
             first = false;
         }
-        public void mouseDragged(MouseEvent e) {
+        public void mouseDragged(final MouseEvent e) {
             int width, height;
-            Object source = e.getSource();
+            final Object source = e.getSource();
             Window window = null;
             if(source instanceof Window) {
                 window = (Window) source;
-                width=window.getWidth();
-                height=window.getHeight();
+                width=window.getSurfaceWidth();
+                height=window.getSurfaceHeight();
+            } else if (source instanceof GLAutoDrawable) {
+                final GLAutoDrawable glad = (GLAutoDrawable) source;
+                width = glad.getSurfaceWidth();
+                height = glad.getSurfaceHeight();
             } else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) {
-                java.awt.Component comp = (java.awt.Component) source;
-                width=comp.getWidth();
+                final java.awt.Component comp = (java.awt.Component) source;
+                width=comp.getWidth(); // FIXME HiDPI: May need to convert window units -> pixel units!
                 height=comp.getHeight();
             } else {
                 throw new RuntimeException("Event source neither Window nor Component: "+source);
@@ -112,8 +116,8 @@ public class TextureSequenceCubeES2 implements GLEventListener {
                     first=false;
                     return;
                 }
-                int nv = Math.abs(e.getY(0)-e.getY(1));
-                int dy = nv - lx;
+                final int nv = Math.abs(e.getY(0)-e.getY(1));
+                final int dy = nv - lx;
 
                 {
                     final float o = zoom;
@@ -131,15 +135,15 @@ public class TextureSequenceCubeES2 implements GLEventListener {
                     first=false;
                     return;
                 }
-                int nx = e.getX();
-                int ny = e.getY();
+                final int nx = e.getX();
+                final int ny = e.getY();
                 view_roty += 360f * ( (float)( nx - lx ) / (float)width );
                 view_rotx += 360f * ( (float)( ny - ly ) / (float)height );
                 lx = nx;
                 ly = ny;
             }
         }
-        public void mouseWheelMoved(MouseEvent e) {
+        public void mouseWheelMoved(final MouseEvent e) {
             // System.err.println("XXX "+e);
             if( !e.isShiftDown() ) {
                 final float o = zoom;
@@ -153,11 +157,11 @@ public class TextureSequenceCubeES2 implements GLEventListener {
     static final String shaderBasename = "texsequence_xxx";
     static final String myTextureLookupName = "myTexture2D";
 
-    private void initShader(GL2ES2 gl) {
+    private void initShader(final GL2ES2 gl) {
         // Create & Compile the shader objects
-        ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
+        final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
                                             "shader", "shader/bin", shaderBasename, true);
-        ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
+        final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
                                             "shader", "shader/bin", shaderBasename, true);
 
         boolean preludeGLSLVersion = true;
@@ -176,7 +180,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
 
         int rsFpPos = preludeGLSLVersion ? rsFp.addGLSLVersion(gl) : 0;
         rsFpPos = rsFp.insertShaderSource(0, rsFpPos, texSeq.getRequiredExtensionsShaderStub());
-        rsFpPos = rsFp.addDefaultShaderPrecision(gl, rsFpPos);
+        rsFp.addDefaultShaderPrecision(gl, rsFpPos);
 
         final String texLookupFuncName = texSeq.getTextureLookupFunctionName(myTextureLookupName);
         rsFp.replaceInShaderSource(myTextureLookupName, texLookupFuncName);
@@ -188,7 +192,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
         rsFp.insertShaderSource(0, "TEXTURE-SEQUENCE-CODE-BEGIN", 0, sFpIns);
 
         // Create & Link the shader program
-        ShaderProgram sp = new ShaderProgram();
+        final ShaderProgram sp = new ShaderProgram();
         sp.add(rsVp);
         sp.add(rsFp);
         if(!sp.link(gl, System.err)) {
@@ -202,8 +206,8 @@ public class TextureSequenceCubeES2 implements GLEventListener {
 
     GLArrayDataServer interleavedVBO, cubeIndicesVBO;
 
-    public void init(GLAutoDrawable drawable) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+    public void init(final GLAutoDrawable drawable) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
         System.err.println(JoglVersion.getGLInfo(gl, null));
         final TextureFrame frame = texSeq.getLastTexture();
         if( null == frame ) {
@@ -217,7 +221,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
         st.useProgram(gl, true);
 
         pmvMatrix = new PMVMatrix();
-        reshapePMV(drawable.getWidth(), drawable.getHeight());
+        reshapePMV(drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
         pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
         if(!st.uniform(gl, pmvMatrixUniform)) {
             throw new GLException("Error setting PMVMatrix in shader: "+st);
@@ -228,7 +232,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
 
 
         // calculate centered tex coords w/ aspect ratio
-        float[] fixedCubeTexCoords = new float[s_cubeTexCoords.length];
+        final float[] fixedCubeTexCoords = new float[s_cubeTexCoords.length];
         {
             final float aspect = tex.getAspectRatio();
             final TextureCoords tc = tex.getImageTexCoords();
@@ -260,7 +264,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
             //interleavedVBO.addGLSLSubArray("mgl_Normal",        3, GL.GL_ARRAY_BUFFER);
             interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
 
-            FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
+            final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
 
             for(int i=0; i<6*4; i++) {
                 ib.put(s_cubeVertices,  i*3, 3);
@@ -282,7 +286,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
         st.ownAttribute(cubeIndicesVBO, true);
 
 
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_DEPTH_TEST);
 
         st.useProgram(gl, false);
 
@@ -292,7 +296,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
             window.addMouseListener(mouseAction);
         } else if (GLProfile.isAWTAvailable() && upstreamWidget instanceof java.awt.Component) {
             final java.awt.Component comp = (java.awt.Component) upstreamWidget;
-            new com.jogamp.newt.event.awt.AWTMouseAdapter(mouseAction).addTo(comp);
+            new com.jogamp.newt.event.awt.AWTMouseAdapter(mouseAction, drawable).addTo(comp);
         }
 
         // Let's show the completed shader state ..
@@ -300,19 +304,11 @@ public class TextureSequenceCubeES2 implements GLEventListener {
         System.out.println(st);
     }
 
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
 
         gl.glViewport(0, 0, width, height);
 
-        if(innerCube) {
-            // Clear background to white
-            gl.glClearColor(1.0f, 1.0f, 1.0f, 0.4f);
-        } else {
-            // Clear background to blue
-            gl.glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
-        }
-
         if(!innerCube) {
             // lights on
         } else {
@@ -330,7 +326,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
     }
 
 
-    private void reshapePMV(int width, int height) {
+    private void reshapePMV(final int width, final int height) {
         if(null != pmvMatrix) {
             pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
             pmvMatrix.glLoadIdentity();
@@ -351,15 +347,12 @@ public class TextureSequenceCubeES2 implements GLEventListener {
 
 
     @Override
-    public void dispose(GLAutoDrawable drawable) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+    public void dispose(final GLAutoDrawable drawable) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
 
         texSeq = null;
         pmvMatrixUniform = null;
-        if( null != pmvMatrix ) {
-            pmvMatrix.destroy();
-            pmvMatrix=null;
-        }
+        pmvMatrix=null;
         if( null != st ) {
             st.destroy(gl);
             st=null;
@@ -367,9 +360,16 @@ public class TextureSequenceCubeES2 implements GLEventListener {
     }
 
     @Override
-    public void display(GLAutoDrawable drawable) {
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+    public void display(final GLAutoDrawable drawable) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
 
+        if(innerCube) {
+            // Clear background to white
+            gl.glClearColor(1.0f, 1.0f, 1.0f, 0.4f);
+        } else {
+            // Clear background to blue
+            gl.glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
+        }
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
 
         if( null == st ) {
@@ -397,7 +397,7 @@ public class TextureSequenceCubeES2 implements GLEventListener {
             }
         }
         cubeIndicesVBO.bindBuffer(gl, true); // keeps VBO binding
-        gl.glDrawElements(GL2ES2.GL_TRIANGLES, cubeIndicesVBO.getElementCount() * cubeIndicesVBO.getComponentCount(), GL2ES2.GL_UNSIGNED_SHORT, 0);
+        gl.glDrawElements(GL.GL_TRIANGLES, cubeIndicesVBO.getElementCount() * cubeIndicesVBO.getComponentCount(), GL.GL_UNSIGNED_SHORT, 0);
         cubeIndicesVBO.bindBuffer(gl, false);
 
         if(null != tex) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/CrossFadePlayer.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/CrossFadePlayer.java
index 02f62c4..e5e752d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/CrossFadePlayer.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/CrossFadePlayer.java
@@ -47,7 +47,7 @@ public class CrossFadePlayer
 	static GLMediaPlayer[] player;
 	static volatile boolean stop = false;
 
-	public static void main(String[] args)
+	public static void main(final String[] args)
 	{
 
         if(args.length==0) {
@@ -57,13 +57,13 @@ public class CrossFadePlayer
                     "and i will try CrossFade-play them all in parallel!");
         }
 
-		GLMediaEventListener mediaEventListener = new GLMediaEventListener()
+		final GLMediaEventListener mediaEventListener = new GLMediaEventListener()
 		{
 			@Override
-			public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
+			public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) { }
 
 			@Override
-			public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when)
+			public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when)
 			{
 				System.out.println("\n***\nEvent mask changed: " + event_mask);
 				System.out.println("Timestamp: "+ when);
@@ -80,7 +80,7 @@ public class CrossFadePlayer
                                 if ( GLMediaPlayer.State.Paused == mp.getState() ) { // init OK
                                     mp.play();
                                 }
-                            } catch (Exception e) {
+                            } catch (final Exception e) {
                                 e.printStackTrace();
                             }
                         }
@@ -126,7 +126,7 @@ public class CrossFadePlayer
         // Initialize media players
         player = new GLMediaPlayer[args.length];
         int i=0;
-        for( String arg: args ) {
+        for( final String arg: args ) {
             player[i] = GLMediaPlayerFactory.createDefault();
             if(player[i]!=null){
                 System.out.println("Created CrossFade player: "+ i + " " + player[i].getClass().getName());
@@ -137,18 +137,18 @@ public class CrossFadePlayer
                         System.out.println("No file selected: arg " + i +" = "+ filename);
                         player[i]=null;
                     } else {
-                        File file = new File(filename);
+                        final File file = new File(filename);
                         if(!file.exists()){
                             System.out.println("File do not exist");
                         } else {
-                            URI uri = file.toURI();
+                            final URI uri = file.toURI();
                             System.out.println("State of player "+ i +": " + player[i].getState().toString());
                             System.out.println("...initializing stream "+ i +"...");
                             player[i].initStream(uri, GLMediaPlayer.STREAM_ID_NONE, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.TEXTURE_COUNT_DEFAULT);
 
                         }
                     }
-                } catch (Exception e1) {
+                } catch (final Exception e1) {
                     e1.printStackTrace();
                 }
             } else {
@@ -159,17 +159,17 @@ public class CrossFadePlayer
 
 
         // Main thread CrossFade until playback is done
-		long startTime = com.jogamp.common.os.Platform.currentTimeMillis();
-        double piPlayers = Math.PI*2.0f/args.length;
+		final long startTime = com.jogamp.common.os.Platform.currentTimeMillis();
+        final double piPlayers = Math.PI*2.0f/args.length;
 		StreamException se = null;
 		while( null == se && stop == false ) {
 				try {
 					Thread.sleep(100);
-				} catch (InterruptedException e) { }
+				} catch (final InterruptedException e) { }
 
                 // Find out the longest duration...
                 float maxDuration = 1000.0f ;
-                for(GLMediaPlayer p: player) {
+                for(final GLMediaPlayer p: player) {
                     if(p!=null){
                         if( p.getDuration() > maxDuration) {
                             maxDuration = p.getDuration();
@@ -178,15 +178,15 @@ public class CrossFadePlayer
                 }
 
 				// tune the volume on players to crossfade!
-				float progress = (com.jogamp.common.os.Platform.currentTimeMillis()-startTime)/maxDuration;
+				final float progress = (com.jogamp.common.os.Platform.currentTimeMillis()-startTime)/maxDuration;
 
                 i = 0;
-                for(GLMediaPlayer p: player){
+                for(final GLMediaPlayer p: player){
                     if(p!=null){
-                        AudioSink sink = p.getAudioSink();
+                        final AudioSink sink = p.getAudioSink();
 				        if(sink != null){
-                            float volume = (float) (0.5f+(0.5f*(Math.cos(40.0f*progress+(piPlayers*i)))));
-                            float playbacktime = com.jogamp.common.os.Platform.currentTimeMillis()-startTime;
+                            final float volume = (float) (0.5f+(0.5f*(Math.cos(40.0f*progress+(piPlayers*i)))));
+                            final float playbacktime = com.jogamp.common.os.Platform.currentTimeMillis()-startTime;
                             // System.out.println("player: "+ i +" volume = " + volume +" progress = "+ progress +" time = "+ playbacktime + " / duration = " + maxDuration);
                             sink.setVolume(volume);
 				        }
@@ -202,7 +202,7 @@ public class CrossFadePlayer
                 }
 		}
 
-        for(GLMediaPlayer p: player) {
+        for(final GLMediaPlayer p: player) {
             if(p!=null)
                 p.destroy(null);
         }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
index b148eba..607bfd1 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieCube.java
@@ -33,6 +33,7 @@ import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
 
+import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAnimatorControl;
 import javax.media.opengl.GLAutoDrawable;
@@ -43,6 +44,8 @@ import javax.media.opengl.GLProfile;
 
 import com.jogamp.common.util.IOUtil;
 import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
 import com.jogamp.graph.font.Font;
 import com.jogamp.newt.Window;
 import com.jogamp.newt.event.KeyAdapter;
@@ -77,13 +80,15 @@ public class MovieCube implements GLEventListener {
     private long lastPerfPos = 0;
     private volatile boolean resetGLState = false;
 
-    /** Blender's Big Buck Bunny Trailer: 24f 640p VP8, Vorbis 44100Hz mono, WebM/Matroska Stream. */
+    /** Blender's Big Buck Bunny: 24f 416p H.264,  AAC 48000 Hz, 2 ch, mpeg stream. */
     public static final URI defURI;
     static {
         URI _defURI = null;
         try {
-            _defURI = new URI("http://video.webmfiles.org/big-buck-bunny_trailer.webm");
-        } catch (URISyntaxException e) {
+            // Blender's Big Buck Bunny Trailer: 24f 640p VP8, Vorbis 44100Hz mono, WebM/Matroska Stream.
+            // _defURI = new URI("http://video.webmfiles.org/big-buck-bunny_trailer.webm");
+            _defURI = new URI("http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4");
+        } catch (final URISyntaxException e) {
             e.printStackTrace();
         }
         defURI = _defURI;
@@ -98,14 +103,14 @@ public class MovieCube implements GLEventListener {
      * </p>
      */
     public MovieCube() throws IOException, URISyntaxException {
-        this(zoom_def, 0f, 0f);
+        this(zoom_def, 0f, 0f, true);
 
         mPlayer.addEventListener(new GLMediaEventListener() {
             @Override
-            public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
+            public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) { }
 
             @Override
-            public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
+            public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
                 System.err.println("MovieCube AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
                 System.err.println("MovieCube State: "+mp);
                 if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) ) {
@@ -126,7 +131,7 @@ public class MovieCube implements GLEventListener {
         while( null == se && GLMediaPlayer.State.Initialized != mPlayer.getState() ) {
             try {
                 Thread.sleep(16);
-            } catch (InterruptedException e) { }
+            } catch (final InterruptedException e) { }
             se = mPlayer.getStreamException();
         }
         if( null != se ) {
@@ -135,20 +140,23 @@ public class MovieCube implements GLEventListener {
         }
     }
 
-    /** Custom constructor, user needs to issue {@link #initStream(URI, int, int, int)} afterwards. */
-    public MovieCube(float zoom0, float rotx, float roty) throws IOException {
+    /**
+     * Custom constructor, user needs to issue {@link #initStream(URI, int, int, int)} afterwards.
+     */
+    public MovieCube(final float zoom0, final float rotx, final float roty, final boolean showText) throws IOException {
         this.zoom0 = zoom0;
         this.rotx = rotx;
         this.roty = roty;
+        this.showText = showText;
         mPlayer = GLMediaPlayerFactory.createDefault();
     }
 
-    public void initStream(URI streamLoc, int vid, int aid, int textureCount) {
+    public void initStream(final URI streamLoc, final int vid, final int aid, final int textureCount) {
         mPlayer.initStream(streamLoc, vid, aid, textureCount);
         System.out.println("pC.1b "+mPlayer);
     }
 
-    public void setSwapInterval(int v) { this.swapInterval = v; }
+    public void setSwapInterval(final int v) { this.swapInterval = v; }
 
     public GLMediaPlayer getGLMediaPlayer() { return mPlayer; }
 
@@ -156,40 +164,59 @@ public class MovieCube implements GLEventListener {
         resetGLState = true;
     }
 
-    private final class InfoTextRendererGLELBase extends TextRendererGLELBase {
-        static final float z_diff = 0.001f;
-        final float underlineSize;
+    final int[] textSampleCount = { 4 };
 
-        InfoTextRendererGLELBase() {
+    private final class InfoTextRendererGLELBase extends TextRendererGLELBase {
+        private static final float z_diff = 0.001f;
+        private final Font font = getFont(0, 0, 0);
+        private final float fontSize1 = 12;
+        private final float fontSize2 = 10;
+        private final GLRegion regionFPS;
+        private float pixelSize1, pixelSize2, underlineSize;
+
+        InfoTextRendererGLELBase(final int rmode, final boolean lowPerfDevice) {
             // FIXME: Graph TextRenderer does not AA well w/o MSAA and FBO
-            super(Region.VBAA_RENDERING_BIT);
-            texSizeScale = 2;
+            super(rmode, MovieCube.this.textSampleCount);
+            this.setRendererCallbacks(RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable);
+            if( lowPerfDevice ) {
+                regionFPS = null;
+            } else {
+                regionFPS = GLRegion.create(renderModes, null);
+                System.err.println("RegionFPS "+Region.getRenderModeString(renderModes)+", sampleCount "+textSampleCount[0]+", class "+regionFPS.getClass().getName());
+            }
+            staticRGBAColor[0] = 0.1f;
+            staticRGBAColor[1] = 0.1f;
+            staticRGBAColor[2] = 0.1f;
+            staticRGBAColor[3] = 1.0f;
+        }
 
-            fontSize = 1;
-            pixelScale = 1.0f / ( fontSize * 20f );
+        @Override
+        public void init(final GLAutoDrawable drawable) {
+            // non-exclusive mode!
+            this.setSharedPMVMatrix(cube.pmvMatrix);
+            super.init(drawable);
 
+            pixelSize1 = font.getPixelSize(fontSize1, dpiH);
+            pixelSize2 = font.getPixelSize(fontSize2, dpiH);
+            pixelScale = 1.0f / ( pixelSize1 * 20f );
             // underlineSize: 'underline' amount of pixel below 0/0 (Note: lineGap is negative)
             final Font.Metrics metrics = font.getMetrics();
-            final float lineGap = metrics.getLineGap(fontSize);
-            final float descent = metrics.getDescent(fontSize);
+            final float lineGap = metrics.getLineGap(pixelSize1);
+            final float descent = metrics.getDescent(pixelSize1);
             underlineSize = descent - lineGap;
-            // System.err.println("XXX: fLG "+lineGap+", fDesc "+descent+", underlineSize "+underlineSize);
-
-            staticRGBAColor[0] = 0.0f;
-            staticRGBAColor[1] = 0.0f;
-            staticRGBAColor[2] = 0.0f;
-            staticRGBAColor[3] = 1.0f;
+            System.err.println("XXX: dpiH "+dpiH+", fontSize "+fontSize1+", pixelSize "+pixelSize1+", pixelScale "+pixelScale+", fLG "+lineGap+", fDesc "+descent+", underlineSize "+underlineSize);
         }
 
         @Override
-        public void init(GLAutoDrawable drawable) {
-            // non-exclusive mode!
-            this.usrPMVMatrix = cube.pmvMatrix;
-            super.init(drawable);
+        public void dispose(final GLAutoDrawable drawable) {
+            if( null != regionFPS ) {
+                regionFPS.destroy(drawable.getGL().getGL2ES2());
+            }
+            super.dispose(drawable);
         }
 
         @Override
-        public void display(GLAutoDrawable drawable) {
+        public void display(final GLAutoDrawable drawable) {
             final GLAnimatorControl anim = drawable.getAnimator();
             final float lfps = null != anim ? anim.getLastFPS() : 0f;
             final float tfps = null != anim ? anim.getTotalFPS() : 0f;
@@ -215,9 +242,9 @@ public class MovieCube implements GLEventListener {
                                "; underlineSize "+underlineSize+" "+(pixelScale*underlineSize)+
                                "; yoff "+yoff1+", yoff2 "+yoff2); */
 
-            // FIXME: Graph TextRenderer does not scale well, i.e. text update per 1/10s cause too much recompute of regions!
-            // final String text1 = String.format("%03.1f/%03.1f s, %s (%01.2fx, vol %01.2f), a %01.2f, fps %02.1f -> %02.1f / %02.1f, v-sync %d",
-            final String text1 = String.format("%03.0f/%03.0f s, %s (%01.2fx, vol %01.2f), a %01.2f, fps %02.1f -> %02.1f / %02.1f, v-sync %d",
+            final GL gl = drawable.getGL();
+            final String ptsPrec = null != regionFPS ? "3.1" : "3.0";
+            final String text1 = String.format("%0"+ptsPrec+"f/%0"+ptsPrec+"f s, %s (%01.2fx, vol %01.2f), a %01.2f, fps %02.1f -> %02.1f / %02.1f, v-sync %d",
                     pts, mPlayer.getDuration() / 1000f,
                     mPlayer.getState().toString().toLowerCase(), mPlayer.getPlaySpeed(), mPlayer.getAudioVolume(),
                     aspect, mPlayer.getFramerate(), lfps, tfps, swapIntervalSet);
@@ -227,17 +254,23 @@ public class MovieCube implements GLEventListener {
                     mPlayer.getVID(), mPlayer.getVideoBitrate()/1000, mPlayer.getVideoCodec());
             final String text4 = mPlayer.getURI().getRawPath();
             if( displayOSD && null != renderer ) {
-                renderString(drawable, text1, 1 /* col */, -1 /* row */, -1+z_diff, yoff1, 1f+z_diff);
-                renderString(drawable, text2, 1 /* col */,  0 /* row */, -1+z_diff, yoff2, 1f+z_diff);
-                renderString(drawable, text3, 1 /* col */,  1 /* row */, -1+z_diff, yoff2, 1f+z_diff);
-                renderString(drawable, text4, 1 /* col */,  2 /* row */, -1+z_diff, yoff2, 1f+z_diff);
+                gl.glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
+                if( null != regionFPS ) {
+                    renderString(drawable, font, pixelSize1, text1, 1 /* col */, -1 /* row */, -1+z_diff, yoff1, 1f+z_diff, regionFPS); // no-cache
+                } else {
+                    renderString(drawable, font, pixelSize1, text1, 1 /* col */, -1 /* row */, -1+z_diff, yoff1, 1f+z_diff, true);
+                }
+                renderString(drawable, font, pixelSize2, text2, 1 /* col */,  0 /* row */, -1+z_diff, yoff2, 1f+z_diff, true);
+                renderString(drawable, font, pixelSize2, text3, 1 /* col */,  1 /* row */, -1+z_diff, yoff2, 1f+z_diff, true);
+                renderString(drawable, font, pixelSize2, text4, 1 /* col */,  2 /* row */, -1+z_diff, yoff2, 1f+z_diff, true);
             }
         } };
-    private final InfoTextRendererGLELBase textRendererGLEL = new InfoTextRendererGLELBase();
+    private InfoTextRendererGLELBase textRendererGLEL = null;
+    final boolean showText;
     private boolean displayOSD = true;
 
     private final KeyListener keyAction = new KeyAdapter() {
-        public void keyReleased(KeyEvent e)  {
+        public void keyReleased(final KeyEvent e)  {
             if( e.isAutoRepeat() ) {
                 return;
             }
@@ -312,7 +345,7 @@ public class MovieCube implements GLEventListener {
     };
 
     @Override
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         if(null == mPlayer) {
             throw new InternalError("mPlayer null");
         }
@@ -324,7 +357,7 @@ public class MovieCube implements GLEventListener {
         }
         resetGLState = false;
 
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
         System.err.println(JoglVersion.getGLInfo(gl, null));
 
         cube = new TextureSequenceCubeES2(mPlayer, false, zoom0, rotx, roty);
@@ -336,7 +369,7 @@ public class MovieCube implements GLEventListener {
         if( GLMediaPlayer.State.Initialized == mPlayer.getState() ) {
             try {
                 mPlayer.initGL(gl);
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
                 if(null != mPlayer) {
                     mPlayer.destroy(gl);
@@ -357,23 +390,32 @@ public class MovieCube implements GLEventListener {
             added = true;
         } else { added = false; }
         System.err.println("MC.init: kl-added "+added+", "+drawable.getClass().getName());
-        drawable.addGLEventListener(textRendererGLEL);
+
+        if( showText ) {
+            final int rmode = drawable.getChosenGLCapabilities().getSampleBuffers() ? 0 : Region.VBAA_RENDERING_BIT;
+            final boolean lowPerfDevice = gl.isGLES();
+            textRendererGLEL = new InfoTextRendererGLELBase(rmode, lowPerfDevice);
+            drawable.addGLEventListener(textRendererGLEL);
+        }
     }
 
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
         if(null == mPlayer) { return; }
         cube.reshape(drawable, x, y, width, height);
     }
 
     @Override
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         System.err.println(Thread.currentThread()+" MovieCube.dispose ... ");
-        drawable.disposeGLEventListener(textRendererGLEL, true);
+        if( null != textRendererGLEL ) {
+            drawable.disposeGLEventListener(textRendererGLEL, true);
+            textRendererGLEL = null;
+        }
         disposeImpl(drawable, true);
     }
 
-    private void disposeImpl(GLAutoDrawable drawable, boolean disposePlayer) {
+    private void disposeImpl(final GLAutoDrawable drawable, final boolean disposePlayer) {
         if(null == mPlayer) { return; }
         final Object upstreamWidget = drawable.getUpstreamWidget();
         if (upstreamWidget instanceof Window) {
@@ -391,7 +433,7 @@ public class MovieCube implements GLEventListener {
 
 
     @Override
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         if(-1 != swapInterval) {
             final GL2ES2 gl = drawable.getGL().getGL2ES2();
             gl.setSwapInterval(swapInterval); // in case switching the drawable (impl. may bound attribute there)
@@ -406,7 +448,7 @@ public class MovieCube implements GLEventListener {
             System.err.println("XXX resetGLState");
             disposeImpl(drawable, false);
             init(drawable);
-            reshape(drawable, 0, 0, drawable.getWidth(), drawable.getHeight());
+            reshape(drawable, 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
         }
 
         final long currentPos = System.currentTimeMillis();
@@ -417,10 +459,10 @@ public class MovieCube implements GLEventListener {
         cube.display(drawable);
     }
 
-    public static void main(String[] args) throws IOException, InterruptedException, URISyntaxException {
+    public static void main(final String[] args) throws IOException, InterruptedException, URISyntaxException {
         int swapInterval = 1;
-        int width = 510;
-        int height = 300;
+        int width = 800;
+        int height = 600;
         int textureCount = GLMediaPlayer.TEXTURE_COUNT_DEFAULT; // default - threaded
 
         boolean forceES2 = false;
@@ -494,7 +536,7 @@ public class MovieCube implements GLEventListener {
         System.err.println("forceGLDef "+forceGLDef);
         System.err.println("swapInterval "+swapInterval);
 
-        final MovieCube mc = new MovieCube(zoom_def, 0f, 0f);
+        final MovieCube mc = new MovieCube(zoom_def, 0f, 0f, true);
         mc.setSwapInterval(swapInterval);
 
         final GLProfile glp;
@@ -510,29 +552,32 @@ public class MovieCube implements GLEventListener {
             glp = GLProfile.getGL2ES2();
         }
         System.err.println("GLProfile: "+glp);
-        final GLWindow window = GLWindow.create(new GLCapabilities(glp));
+        final GLCapabilities caps = new GLCapabilities(glp);
+        // caps.setAlphaBits(4); // NOTE_ALPHA_BLENDING: We go w/o alpha and blending!
+        final GLWindow window = GLWindow.create(caps);
         final Animator anim = new Animator(window);
         window.addWindowListener(new WindowAdapter() {
-            public void windowDestroyed(WindowEvent e) {
+            public void windowDestroyed(final WindowEvent e) {
                 anim.stop();
             }
         });
         window.setSize(width, height);
         window.setVisible(true);
+        System.err.println("Chosen: "+window.getChosenGLCapabilities());
         anim.start();
 
         mc.mPlayer.addEventListener(new GLMediaEventListener() {
             @Override
-            public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) {
+            public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) {
             }
 
             @Override
-            public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
+            public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
                 System.err.println("MovieCube AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
                 System.err.println("MovieCube State: "+mp);
                 if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) ) {
                     if( origSize ) {
-                        window.setSize(mp.getWidth(), mp.getHeight());
+                        window.setSurfaceSize(mp.getWidth(), mp.getHeight());
                     }
                     // window.disposeGLEventListener(ms, false /* remove */ );
                     mc.resetGLState();
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSBSStereo.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSBSStereo.java
new file mode 100644
index 0000000..9098ad0
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSBSStereo.java
@@ -0,0 +1,872 @@
+/**
+ * Copyright 2012 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.demos.es2.av;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.nio.FloatBuffer;
+
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GLAnimatorControl;
+import javax.media.opengl.GLAutoDrawable;
+import javax.media.opengl.GLES2;
+import javax.media.opengl.GLException;
+import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
+
+import com.jogamp.common.os.Platform;
+import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.font.Font;
+import com.jogamp.newt.Window;
+import com.jogamp.newt.event.KeyAdapter;
+import com.jogamp.newt.event.KeyEvent;
+import com.jogamp.newt.event.KeyListener;
+import com.jogamp.newt.event.MouseAdapter;
+import com.jogamp.newt.event.MouseEvent;
+import com.jogamp.newt.event.MouseListener;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.GLExtensions;
+import com.jogamp.opengl.JoglVersion;
+import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.math.Quaternion;
+import com.jogamp.opengl.math.VectorUtil;
+import com.jogamp.opengl.test.junit.graph.TextRendererGLELBase;
+import com.jogamp.opengl.test.junit.util.UITestCase;
+import com.jogamp.opengl.util.CustomGLEventListener;
+import com.jogamp.opengl.util.GLArrayDataServer;
+import com.jogamp.opengl.util.PMVMatrix;
+import com.jogamp.opengl.util.av.GLMediaPlayer;
+import com.jogamp.opengl.util.av.GLMediaPlayer.GLMediaEventListener;
+import com.jogamp.opengl.util.av.GLMediaPlayerFactory;
+import com.jogamp.opengl.util.glsl.ShaderCode;
+import com.jogamp.opengl.util.glsl.ShaderProgram;
+import com.jogamp.opengl.util.glsl.ShaderState;
+import com.jogamp.opengl.util.stereo.EyeParameter;
+import com.jogamp.opengl.util.stereo.EyePose;
+import com.jogamp.opengl.util.stereo.StereoClientRenderer;
+import com.jogamp.opengl.util.stereo.StereoGLEventListener;
+import com.jogamp.opengl.util.texture.Texture;
+import com.jogamp.opengl.util.texture.TextureCoords;
+import com.jogamp.opengl.util.texture.TextureSequence;
+import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame;
+
+/**
+ * Side-By-Side (SBS) 3D Movie Player for {@link StereoClientRenderer}
+ * <p>
+ * The movie is assumed to be symmetrical SBS,
+ * the left-eye receives the left-part of the texture
+ * and the right-eye the right-part.
+ * </p>
+ */
+public class MovieSBSStereo implements StereoGLEventListener {
+    public static final String WINDOW_KEY = "window";
+    public static final String STEREO_RENDERER_KEY = "stereo";
+    public static final String PLAYER = "player";
+
+    private static boolean waitForKey = false;
+    private int surfWidth, surfHeight;
+    private int prevMouseX; // , prevMouseY;
+    private int rotate = 0;
+    private float zoom0;
+    private float zoom1;
+    private float zoom;
+    private long startTime;
+    private final float alpha = 1.0f;
+
+    private GLMediaPlayer mPlayer;
+    private boolean mPlayerScaleOrig;
+    private float[] verts = null;
+    private GLArrayDataServer interleavedVBOLeft;
+    private GLArrayDataServer interleavedVBORight;
+    private volatile boolean resetGLState = false;
+    private StereoClientRenderer stereoClientRenderer;
+
+    private ShaderState st;
+    private PMVMatrix pmvMatrix;
+    private GLUniformData pmvMatrixUniform;
+    private static final String shaderBasename = "texsequence_xxx";
+    private static final String myTextureLookupName = "myTexture2D";
+
+    /** Blender's Big Buck Bunny: 24f 416p H.264,  AAC 48000 Hz, 2 ch, mpeg stream. */
+    public static final URI defURI;
+    static {
+        URI _defURI = null;
+        try {
+            // Blender's Big Buck Bunny Trailer: 24f 640p VP8, Vorbis 44100Hz mono, WebM/Matroska Stream.
+            // _defURI = new URI("http://video.webmfiles.org/big-buck-bunny_trailer.webm");
+            _defURI = new URI("http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4");
+        } catch (final URISyntaxException e) {
+            e.printStackTrace();
+        }
+        defURI = _defURI;
+    }
+
+    final int[] textSampleCount = { 4 };
+
+    private final class InfoTextRendererGLELBase extends TextRendererGLELBase {
+        private final Font font = getFont(0, 0, 0);
+        private final float fontSize = 1f; // 0.01f;
+        private final GLRegion regionFPS;
+
+        InfoTextRendererGLELBase(final int rmode, final boolean lowPerfDevice) {
+            // FIXME: Graph TextRenderer does not AA well w/o MSAA and FBO
+            super(rmode, textSampleCount);
+            this.setRendererCallbacks(RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable);
+            if( lowPerfDevice ) {
+                regionFPS = null;
+            } else {
+                regionFPS = GLRegion.create(renderModes, null);
+                System.err.println("RegionFPS "+Region.getRenderModeString(renderModes)+", sampleCount "+textSampleCount[0]+", class "+regionFPS.getClass().getName());
+            }
+            staticRGBAColor[0] = 0.9f;
+            staticRGBAColor[1] = 0.9f;
+            staticRGBAColor[2] = 0.9f;
+            staticRGBAColor[3] = 1.0f;
+        }
+
+        @Override
+        public void init(final GLAutoDrawable drawable) {
+            super.init(drawable);
+        }
+
+        @Override
+        public void dispose(final GLAutoDrawable drawable) {
+            if( null != regionFPS ) {
+                regionFPS.destroy(drawable.getGL().getGL2ES2());
+            }
+            super.dispose(drawable);
+        }
+
+        @Override
+        public void display(final GLAutoDrawable drawable) {
+            final GLAnimatorControl anim = drawable.getAnimator();
+            final float lfps = null != anim ? anim.getLastFPS() : 0f;
+            final float tfps = null != anim ? anim.getTotalFPS() : 0f;
+            final boolean hasVideo = GLMediaPlayer.STREAM_ID_NONE != mPlayer.getVID();
+            final float pts = ( hasVideo ? mPlayer.getVideoPTS() : mPlayer.getAudioPTS() ) / 1000f;
+
+            // Note: MODELVIEW is from [ 0 .. height ]
+
+            final int height = 0; // drawable.getSurfaceHeight();
+
+            final float aspect = (float)mPlayer.getWidth() / (float)mPlayer.getHeight();
+
+            final String ptsPrec = null != regionFPS ? "3.1" : "3.0";
+            final String text1 = String.format("%0"+ptsPrec+"f/%0"+ptsPrec+"f s, %s (%01.2fx, vol %01.2f), a %01.2f, fps %02.1f -> %02.1f / %02.1f",
+                    pts, mPlayer.getDuration() / 1000f,
+                    mPlayer.getState().toString().toLowerCase(), mPlayer.getPlaySpeed(), mPlayer.getAudioVolume(),
+                    aspect, mPlayer.getFramerate(), lfps, tfps);
+            final String text2 = String.format("audio: id %d, kbps %d, codec %s",
+                    mPlayer.getAID(), mPlayer.getAudioBitrate()/1000, mPlayer.getAudioCodec());
+            final String text3 = String.format("video: id %d, kbps %d, codec %s",
+                    mPlayer.getVID(), mPlayer.getVideoBitrate()/1000, mPlayer.getVideoCodec());
+            final String text4 = mPlayer.getURI().getRawPath();
+            if( displayOSD && null != renderer ) {
+                // We share ClearColor w/ MovieSimple's init !
+                final float pixelSize = font.getPixelSize(fontSize, dpiH);
+                if( null != regionFPS ) {
+                    renderString(drawable, font, pixelSize, text1, 1 /* col */,  1 /* row */, 0,      0, -1, regionFPS); // no-cache
+                } else {
+                    renderString(drawable, font, pixelSize, text1, 1 /* col */,  1 /* row */, 0,      0, -1, true);
+                }
+                renderString(drawable, font, pixelSize, text2, 1 /* col */, -4 /* row */, 0, height, -1, true);
+                renderString(drawable, font, pixelSize, text3, 1 /* col */, -3 /* row */, 0, height,  0, true);
+                renderString(drawable, font, pixelSize, text4, 1 /* col */, -2 /* row */, 0, height,  1, true);
+            }
+        } };
+    private final boolean enableTextRendererGLEL = false;
+    private InfoTextRendererGLELBase textRendererGLEL = null;
+    private boolean displayOSD = false;
+
+    private final MouseListener mouseAction = new MouseAdapter() {
+        public void mousePressed(final MouseEvent e) {
+            if(e.getY()<=surfHeight/2 && null!=mPlayer && 1 == e.getClickCount()) {
+                if(GLMediaPlayer.State.Playing == mPlayer.getState()) {
+                    mPlayer.pause(false);
+                } else {
+                    mPlayer.play();
+                }
+            }
+        }
+        public void mouseReleased(final MouseEvent e) {
+            if(e.getY()<=surfHeight/2) {
+                rotate = -1;
+                zoom = zoom0;
+                System.err.println("zoom: "+zoom);
+            }
+        }
+        public void mouseMoved(final MouseEvent e) {
+            prevMouseX = e.getX();
+            // prevMouseY = e.getY();
+        }
+        public void mouseDragged(final MouseEvent e) {
+            final int x = e.getX();
+            final int y = e.getY();
+
+            if(y>surfHeight/2) {
+                final float dp  = (float)(x-prevMouseX)/(float)surfWidth;
+                final int pts0 = GLMediaPlayer.STREAM_ID_NONE != mPlayer.getVID() ? mPlayer.getVideoPTS() : mPlayer.getAudioPTS();
+                mPlayer.seek(pts0 + (int) (mPlayer.getDuration() * dp));
+            } else {
+                mPlayer.play();
+                rotate = 1;
+                zoom = zoom1;
+            }
+
+            prevMouseX = x;
+            // prevMouseY = y;
+        }
+        public void mouseWheelMoved(final MouseEvent e) {
+            if( !e.isShiftDown() ) {
+                zoom += e.getRotation()[1]/10f; // vertical: wheel
+                System.err.println("zoom: "+zoom);
+            }
+        } };
+
+    private final KeyListener keyAction = new KeyAdapter() {
+        public void keyReleased(final KeyEvent e)  {
+            if( e.isAutoRepeat() ) {
+                return;
+            }
+            System.err.println("MC "+e);
+            final int pts0 = GLMediaPlayer.STREAM_ID_NONE != mPlayer.getVID() ? mPlayer.getVideoPTS() : mPlayer.getAudioPTS();
+            int pts1 = 0;
+            switch(e.getKeySymbol()) {
+                case KeyEvent.VK_O:          displayOSD = !displayOSD; break;
+                case KeyEvent.VK_RIGHT:      pts1 = pts0 +  1000; break;
+                case KeyEvent.VK_UP:         pts1 = pts0 + 10000; break;
+                case KeyEvent.VK_PAGE_UP:    pts1 = pts0 + 30000; break;
+                case KeyEvent.VK_LEFT:       pts1 = pts0 -  1000; break;
+                case KeyEvent.VK_DOWN:       pts1 = pts0 - 10000; break;
+                case KeyEvent.VK_PAGE_DOWN:  pts1 = pts0 - 30000; break;
+                case KeyEvent.VK_ESCAPE:
+                case KeyEvent.VK_HOME:
+                case KeyEvent.VK_BACK_SPACE: {
+                    mPlayer.seek(0);
+                    break;
+                }
+                case KeyEvent.VK_SPACE: {
+                    if(GLMediaPlayer.State.Paused == mPlayer.getState()) {
+                        mPlayer.play();
+                    } else {
+                        mPlayer.pause(false);
+                    }
+                    break;
+                }
+                case KeyEvent.VK_MULTIPLY:
+                      mPlayer.setPlaySpeed(1.0f);
+                      break;
+                case KeyEvent.VK_SUBTRACT: {
+                      float playSpeed = mPlayer.getPlaySpeed();
+                      if( e.isShiftDown() ) {
+                          playSpeed /= 2.0f;
+                      } else {
+                          playSpeed -= 0.1f;
+                      }
+                      mPlayer.setPlaySpeed(playSpeed);
+                    } break;
+                case KeyEvent.VK_ADD: {
+                      float playSpeed = mPlayer.getPlaySpeed();
+                      if( e.isShiftDown() ) {
+                          playSpeed *= 2.0f;
+                      } else {
+                          playSpeed += 0.1f;
+                      }
+                      mPlayer.setPlaySpeed(playSpeed);
+                    } break;
+                case KeyEvent.VK_M: {
+                      float audioVolume = mPlayer.getAudioVolume();
+                      if( audioVolume > 0.5f ) {
+                          audioVolume = 0f;
+                      } else {
+                          audioVolume = 1f;
+                      }
+                      mPlayer.setAudioVolume(audioVolume);
+                    } break;
+            }
+
+            if( 0 != pts1 ) {
+                mPlayer.seek(pts1);
+            }
+        } };
+
+    /** user needs to issue {@link #initStream(URI, int, int, int)} afterwards. */
+    public MovieSBSStereo() throws IllegalStateException {
+        mPlayerScaleOrig = false;
+        mPlayer = GLMediaPlayerFactory.createDefault();
+        mPlayer.attachObject(PLAYER, this);
+        System.out.println("pC.1a "+mPlayer);
+    }
+
+    public void initStream(final URI streamLoc, final int vid, final int aid, final int textureCount) {
+        mPlayer.initStream(streamLoc, vid, aid, textureCount);
+        System.out.println("pC.1b "+mPlayer);
+    }
+
+    public GLMediaPlayer getGLMediaPlayer() { return mPlayer; }
+
+    public void setScaleOrig(final boolean v) {
+        mPlayerScaleOrig = v;
+    }
+
+    public void setStereoClientRenderer(final StereoClientRenderer scr) {
+        stereoClientRenderer = scr;
+    }
+    public StereoClientRenderer getStereoClientRenderer() { return stereoClientRenderer; }
+
+    public void resetGLState() {
+        resetGLState = true;
+    }
+
+    private void initShader(final GL2ES2 gl) {
+        // Create & Compile the shader objects
+        final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MovieSBSStereo.class,
+                                            "../shader", "../shader/bin", shaderBasename, true);
+        final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, MovieSBSStereo.class,
+                                            "../shader", "../shader/bin", shaderBasename, true);
+
+        boolean preludeGLSLVersion = true;
+        if( GLES2.GL_TEXTURE_EXTERNAL_OES == mPlayer.getTextureTarget() ) {
+            if( !gl.isExtensionAvailable(GLExtensions.OES_EGL_image_external) ) {
+                throw new GLException(GLExtensions.OES_EGL_image_external+" requested but not available");
+            }
+            if( Platform.OSType.ANDROID == Platform.getOSType() && gl.isGLES3() ) {
+                // Bug on Nexus 10, ES3 - Android 4.3, where
+                // GL_OES_EGL_image_external extension directive leads to a failure _with_ '#version 300 es' !
+                //   P0003: Extension 'GL_OES_EGL_image_external' not supported
+                preludeGLSLVersion = false;
+            }
+        }
+        rsVp.defaultShaderCustomization(gl, preludeGLSLVersion, true);
+
+        int rsFpPos = preludeGLSLVersion ? rsFp.addGLSLVersion(gl) : 0;
+        rsFpPos = rsFp.insertShaderSource(0, rsFpPos, mPlayer.getRequiredExtensionsShaderStub());
+        rsFp.addDefaultShaderPrecision(gl, rsFpPos);
+
+        final String texLookupFuncName = mPlayer.getTextureLookupFunctionName(myTextureLookupName);
+        rsFp.replaceInShaderSource(myTextureLookupName, texLookupFuncName);
+
+        // Inject TextureSequence shader details
+        final StringBuilder sFpIns = new StringBuilder();
+        sFpIns.append("uniform ").append(mPlayer.getTextureSampler2DType()).append(" mgl_ActiveTexture;\n");
+        sFpIns.append(mPlayer.getTextureLookupFragmentShaderImpl());
+        rsFp.insertShaderSource(0, "TEXTURE-SEQUENCE-CODE-BEGIN", 0, sFpIns);
+
+        // Create & Link the shader program
+        final ShaderProgram sp = new ShaderProgram();
+        sp.add(rsVp);
+        sp.add(rsFp);
+        if(!sp.link(gl, System.err)) {
+            throw new GLException("Couldn't link program: "+sp);
+        }
+
+        // Let's manage all our states using ShaderState.
+        st = new ShaderState();
+        st.attachShaderProgram(gl, sp, false);
+    }
+
+    @Override
+    public void init(final GLAutoDrawable drawable) {
+        if(null == mPlayer) {
+            throw new InternalError("mPlayer null");
+        }
+        if( GLMediaPlayer.State.Uninitialized == mPlayer.getState() ) {
+            throw new IllegalStateException("mPlayer in uninitialized state: "+mPlayer);
+        }
+        final boolean hasVideo = GLMediaPlayer.STREAM_ID_NONE != mPlayer.getVID();
+        resetGLState = false;
+
+        zoom0 =  -2.1f;
+        zoom1 = -5f;
+        zoom = 0f;
+
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+        System.err.println(JoglVersion.getGLInfo(gl, null));
+        System.err.println("Alpha: "+alpha+", opaque "+drawable.getChosenGLCapabilities().isBackgroundOpaque()+
+                           ", "+drawable.getClass().getName()+", "+drawable);
+
+        if(waitForKey) {
+            UITestCase.waitForKey("Init>");
+        }
+        final Texture tex;
+        try {
+            System.out.println("p0 "+mPlayer);
+            if(GLMediaPlayer.State.Initialized == mPlayer.getState() ) {
+                mPlayer.initGL(gl);
+            }
+            System.out.println("p1 "+mPlayer);
+            final TextureFrame frame = mPlayer.getLastTexture();
+            if( null != frame ) {
+                if( !hasVideo ) {
+                    throw new InternalError("XXX: "+mPlayer);
+                }
+                tex = frame.getTexture();
+                if( null == tex ) {
+                    throw new InternalError("XXX: "+mPlayer);
+                }
+            } else {
+                tex = null;
+                if( hasVideo ) {
+                    throw new InternalError("XXX: "+mPlayer);
+                }
+            }
+            mPlayer.setTextureMinMagFilter( new int[] { GL.GL_NEAREST, GL.GL_NEAREST } );
+        } catch (final Exception glex) {
+            glex.printStackTrace();
+            if(null != mPlayer) {
+                mPlayer.destroy(gl);
+                mPlayer = null;
+            }
+            throw new GLException(glex);
+        }
+
+        if( hasVideo ) {
+            initShader(gl);
+
+            // Push the 1st uniform down the path
+            st.useProgram(gl, true);
+
+            final int[] viewPort = new int[] { 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight()};
+            pmvMatrix = new PMVMatrix();
+            reshapePMV(viewPort[2], viewPort[3]);
+            pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
+            if(!st.uniform(gl, pmvMatrixUniform)) {
+                throw new GLException("Error setting PMVMatrix in shader: "+st);
+            }
+            if(!st.uniform(gl, new GLUniformData("mgl_ActiveTexture", mPlayer.getTextureUnit()))) {
+                throw new GLException("Error setting mgl_ActiveTexture in shader: "+st);
+            }
+
+            final float dWidth = drawable.getSurfaceWidth();
+            final float dHeight = drawable.getSurfaceHeight();
+            final float mWidth = mPlayer.getWidth();
+            final float mHeight = mPlayer.getHeight();
+            final float mAspect = mWidth/mHeight;
+            System.err.println("XXX0: mov aspect: "+mAspect);
+            float xs, ys;
+            if(mPlayerScaleOrig && mWidth < dWidth && mHeight < dHeight) {
+                xs   = mAspect * ( mWidth / dWidth ) ; ys   =  xs / mAspect ;
+            } else {
+                xs   = mAspect; ys   = 1f; // b>h
+            }
+            verts = new float[] { -1f*xs, -1f*ys, 0f, // LB
+                                   1f*xs,  1f*ys, 0f  // RT
+                                };
+            {
+                System.err.println("XXX0: pixel  LB: "+verts[0]+", "+verts[1]+", "+verts[2]);
+                System.err.println("XXX0: pixel  RT: "+verts[3]+", "+verts[4]+", "+verts[5]);
+                final float[] winLB = new float[3];
+                final float[] winRT = new float[3];
+                pmvMatrix.gluProject(verts[0], verts[1], verts[2], viewPort, 0, winLB, 0);
+                pmvMatrix.gluProject(verts[3], verts[4], verts[5], viewPort, 0, winRT, 0);
+                System.err.println("XXX0: win   LB: "+winLB[0]+", "+winLB[1]+", "+winLB[2]);
+                System.err.println("XXX0: win   RT: "+winRT[0]+", "+winRT[1]+", "+winRT[2]);
+            }
+
+            interleavedVBOLeft = GLArrayDataServer.createGLSLInterleaved(3+4+2, GL.GL_FLOAT, false, 3*4, GL.GL_STATIC_DRAW);
+            {
+                interleavedVBOLeft.addGLSLSubArray("mgl_Vertex",        3, GL.GL_ARRAY_BUFFER);
+                interleavedVBOLeft.addGLSLSubArray("mgl_Color",         4, GL.GL_ARRAY_BUFFER);
+                interleavedVBOLeft.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
+            }
+            interleavedVBORight = GLArrayDataServer.createGLSLInterleaved(3+4+2, GL.GL_FLOAT, false, 3*4, GL.GL_STATIC_DRAW);
+            {
+                interleavedVBORight.addGLSLSubArray("mgl_Vertex",        3, GL.GL_ARRAY_BUFFER);
+                interleavedVBORight.addGLSLSubArray("mgl_Color",         4, GL.GL_ARRAY_BUFFER);
+                interleavedVBORight.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
+            }
+            updateInterleavedVBO(gl, interleavedVBOLeft, tex, 0);
+            updateInterleavedVBO(gl, interleavedVBORight, tex, 1);
+
+            st.ownAttribute(interleavedVBOLeft, true);
+            st.ownAttribute(interleavedVBORight, true);
+            gl.glClearColor(0.3f, 0.3f, 0.3f, 0.3f);
+
+            gl.glEnable(GL.GL_DEPTH_TEST);
+
+            st.useProgram(gl, false);
+
+            // Let's show the completed shader state ..
+            System.out.println("iVBOLeft : "+interleavedVBOLeft);
+            System.out.println("iVBORight: "+interleavedVBORight);
+            System.out.println(st);
+        }
+
+        mPlayer.play();
+        System.out.println("play.0 "+mPlayer);
+        startTime = System.currentTimeMillis();
+
+        final Object upstreamWidget = drawable.getUpstreamWidget();
+        if (upstreamWidget instanceof Window) {
+            final Window window = (Window) upstreamWidget;
+            window.addMouseListener(mouseAction);
+            window.addKeyListener(keyAction);
+            surfWidth = window.getSurfaceWidth();
+            surfHeight = window.getSurfaceHeight();
+        }
+        final int rmode = drawable.getChosenGLCapabilities().getSampleBuffers() ? 0 : Region.VBAA_RENDERING_BIT;
+        final boolean lowPerfDevice = gl.isGLES();
+        if( enableTextRendererGLEL ) {
+            textRendererGLEL = new InfoTextRendererGLELBase(rmode, lowPerfDevice);
+            textRendererGLEL.init(drawable);
+        } else {
+            textRendererGLEL = null;
+        }
+    }
+
+    protected void updateInterleavedVBO(final GL gl, final GLArrayDataServer iVBO, final Texture tex, final int eyeNum) {
+        final boolean wasEnabled = iVBO.enabled();
+        iVBO.seal(gl, false);
+        iVBO.rewind();
+        {
+            final FloatBuffer ib = (FloatBuffer)iVBO.getBuffer();
+            final TextureCoords tc = tex.getImageTexCoords();
+            final float texHalfWidth = tc.right()/2f;
+            System.err.println("XXX0: "+tc+", texHalfWidth "+texHalfWidth);
+            System.err.println("XXX0: tex aspect: "+tex.getAspectRatio());
+            System.err.println("XXX0: tex y-flip: "+tex.getMustFlipVertically());
+
+             // left-bottom
+            ib.put(verts[0]);  ib.put(verts[1]);  ib.put(verts[2]);
+            ib.put( 1);    ib.put( 1);     ib.put( 1);    ib.put(alpha);
+            if( 0 == eyeNum ) {
+                ib.put( tc.left() );  ib.put( tc.bottom() );
+            } else {
+                ib.put( tc.left() + texHalfWidth );  ib.put( tc.bottom() );
+            }
+
+             // right-bottom
+            ib.put(verts[3]);  ib.put(verts[1]);  ib.put(verts[2]);
+            ib.put( 1);    ib.put( 1);     ib.put( 1);    ib.put(alpha);
+            if( 0 == eyeNum ) {
+                ib.put( texHalfWidth );  ib.put( tc.bottom() );
+            } else {
+                ib.put( tc.right() );  ib.put( tc.bottom() );
+            }
+
+             // left-top
+            ib.put(verts[0]);  ib.put(verts[4]);  ib.put(verts[2]);
+            ib.put( 1);    ib.put( 1);     ib.put( 1);    ib.put(alpha);
+            if( 0 == eyeNum ) {
+                ib.put( tc.left() );  ib.put( tc.top() );
+            } else {
+                ib.put( tc.left() + texHalfWidth );  ib.put( tc.top() );
+            }
+
+             // right-top
+            ib.put(verts[3]);  ib.put(verts[4]);  ib.put(verts[2]);
+            ib.put( 1);    ib.put( 1);     ib.put( 1);    ib.put(alpha);
+            if( 0 == eyeNum ) {
+                ib.put( texHalfWidth );  ib.put( tc.top() );
+            } else {
+                ib.put( tc.right() );  ib.put( tc.top() );
+            }
+        }
+        iVBO.seal(gl, true);
+        if( !wasEnabled ) {
+            iVBO.enableBuffer(gl, false);
+        }
+    }
+
+    @Override
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+        surfWidth = width;
+        surfHeight = height;
+
+        if(null == mPlayer) { return; }
+
+        if(null != st) {
+            reshapePMV(width, height);
+            st.useProgram(gl, true);
+            st.uniform(gl, pmvMatrixUniform);
+            st.useProgram(gl, false);
+        }
+
+        System.out.println("pR "+mPlayer);
+        if( null != textRendererGLEL ) {
+            textRendererGLEL.reshape(drawable, 0, 0, width, height);
+        }
+    }
+
+    private final float zNear = 0.1f;
+    private final float zFar = 10000f;
+
+    private void reshapePMV(final int width, final int height) {
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
+        pmvMatrix.glLoadIdentity();
+        pmvMatrix.gluPerspective(45.0f, (float)width / (float)height, zNear, zFar);
+
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+        pmvMatrix.glLoadIdentity();
+        pmvMatrix.glTranslatef(0, 0, zoom0);
+    }
+
+    private final float[] mat4Tmp1 = new float[16];
+    private final float[] mat4Tmp2 = new float[16];
+    private final float[] vec3Tmp1 = new float[3];
+    private final float[] vec3Tmp2 = new float[3];
+    private final float[] vec3Tmp3 = new float[3];
+
+    GLArrayDataServer interleavedVBOCurrent = null;
+
+    @Override
+    public void reshapeForEye(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height,
+                              final EyeParameter eyeParam, final EyePose eyePose) {
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+        interleavedVBOCurrent = 0 == eyeParam.number ? interleavedVBOLeft : interleavedVBORight;
+
+        surfWidth = drawable.getSurfaceWidth();
+        surfHeight = drawable.getSurfaceHeight();
+
+        if(null == mPlayer) { return; }
+        if(null == st) { return; }
+
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
+        final float[] mat4Projection = FloatUtil.makePerspective(mat4Tmp1, 0, true, eyeParam.fovhv, zNear, zFar);
+        pmvMatrix.glLoadMatrixf(mat4Projection, 0);
+
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+        final Quaternion rollPitchYaw = new Quaternion();
+        final float[] shiftedEyePos = rollPitchYaw.rotateVector(vec3Tmp1, 0, eyePose.position, 0);
+        VectorUtil.addVec3(shiftedEyePos, shiftedEyePos, eyeParam.positionOffset);
+
+        rollPitchYaw.mult(eyePose.orientation);
+        final float[] up = rollPitchYaw.rotateVector(vec3Tmp2, 0, VectorUtil.VEC3_UNIT_Y, 0);
+        final float[] forward = rollPitchYaw.rotateVector(vec3Tmp3, 0, VectorUtil.VEC3_UNIT_Z_NEG, 0);
+        final float[] center = VectorUtil.addVec3(forward, shiftedEyePos, forward);
+
+        final float[] mLookAt = FloatUtil.makeLookAt(mat4Tmp1, 0, shiftedEyePos, 0, center, 0, up, 0, mat4Tmp2);
+        final float[] mViewAdjust = FloatUtil.makeTranslation(mat4Tmp2, true, eyeParam.distNoseToPupilX, eyeParam.distMiddleToPupilY, eyeParam.eyeReliefZ);
+        final float[] mat4Modelview = FloatUtil.multMatrix(mViewAdjust, mLookAt);
+        pmvMatrix.glLoadMatrixf(mat4Modelview, 0);
+        pmvMatrix.glTranslatef(0, 0, zoom0);
+        st.useProgram(gl, true);
+        st.uniform(gl, pmvMatrixUniform);
+        st.useProgram(gl, false);
+        if( null != textRendererGLEL ) {
+            textRendererGLEL.reshape(drawable, 0, 0, width, height);
+        }
+    }
+
+    @Override
+    public void dispose(final GLAutoDrawable drawable) {
+        if( null != textRendererGLEL ) {
+            textRendererGLEL.dispose(drawable);
+            textRendererGLEL = null;
+        }
+        disposeImpl(drawable, true);
+    }
+
+    private void disposeImpl(final GLAutoDrawable drawable, final boolean disposePlayer) {
+        if(null == mPlayer) { return; }
+
+        final Object upstreamWidget = drawable.getUpstreamWidget();
+        if (upstreamWidget instanceof Window) {
+            final Window window = (Window) upstreamWidget;
+            window.removeMouseListener(mouseAction);
+            window.removeKeyListener(keyAction);
+        }
+
+        System.out.println("pD.1 "+mPlayer+", disposePlayer "+disposePlayer);
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+        if( disposePlayer ) {
+            mPlayer.destroy(gl);
+            System.out.println("pD.X "+mPlayer);
+            mPlayer=null;
+        }
+        pmvMatrixUniform = null;
+        if(null != pmvMatrix) {
+            pmvMatrix=null;
+        }
+        if(null != st) {
+            st.destroy(gl);
+            st=null;
+        }
+    }
+
+    long lastPerfPos = 0;
+
+    @Override
+    public void display(final GLAutoDrawable drawable) {
+        display(drawable, 0);
+    }
+
+    @Override
+    public void display(final GLAutoDrawable drawable, final int flags) {
+        // TODO Auto-generated method stub
+        final boolean repeatedFrame = 0 != ( CustomGLEventListener.DISPLAY_REPEAT & flags );
+        final boolean dontClear = 0 != ( CustomGLEventListener.DISPLAY_DONTCLEAR & flags );
+        final GLArrayDataServer iVBO = null != interleavedVBOCurrent ? interleavedVBOCurrent : interleavedVBOLeft;
+
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
+        if(null == mPlayer) { return; }
+
+        if( resetGLState ) {
+            resetGLState = false;
+            System.err.println("XXX resetGLState");
+            disposeImpl(drawable, false);
+            init(drawable);
+            reshape(drawable, 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
+        }
+
+        final long currentPos = System.currentTimeMillis();
+        if( currentPos - lastPerfPos > 2000 ) {
+            System.err.println( mPlayer.getPerfString() );
+            lastPerfPos = currentPos;
+        }
+
+        if( !dontClear ) {
+            gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+        }
+
+        if(null == st) {
+            return;
+        }
+
+        st.useProgram(gl, true);
+
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+        pmvMatrix.glPushMatrix();
+        pmvMatrix.glTranslatef(0, 0, zoom);
+        if( rotate > 0) {
+            final float ang = ((System.currentTimeMillis() - startTime) * 360.0f) / 8000.0f;
+            pmvMatrix.glRotatef(ang, 0, 0, 1);
+        } else {
+            rotate = 0;
+        }
+        st.uniform(gl, pmvMatrixUniform);
+        iVBO.enableBuffer(gl, true);
+        Texture tex = null;
+        if(null!=mPlayer) {
+            final TextureSequence.TextureFrame texFrame;
+            if( repeatedFrame ) {
+                texFrame=mPlayer.getLastTexture();
+            } else {
+                texFrame=mPlayer.getNextTexture(gl);
+            }
+            if(null != texFrame) {
+                tex = texFrame.getTexture();
+                gl.glActiveTexture(GL.GL_TEXTURE0+mPlayer.getTextureUnit());
+                tex.enable(gl);
+                tex.bind(gl);
+            }
+        }
+        gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
+        if(null != tex) {
+            tex.disable(gl);
+        }
+        iVBO.enableBuffer(gl, false);
+        st.useProgram(gl, false);
+        pmvMatrix.glPopMatrix();
+
+        if( null != textRendererGLEL ) {
+            textRendererGLEL.display(drawable);
+        }
+    }
+
+    static class StereoGLMediaEventListener implements GLMediaEventListener {
+            void destroyWindow(final Window window) {
+                new Thread() {
+                    public void run() {
+                        window.destroy();
+                    } }.start();
+            }
+
+            @Override
+            public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) {
+            }
+
+            @Override
+            public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
+                System.err.println("MovieSimple AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
+                System.err.println("MovieSimple State: "+mp);
+                final GLWindow window = (GLWindow) mp.getAttachedObject(WINDOW_KEY);
+                final MovieSBSStereo ms = (MovieSBSStereo)mp.getAttachedObject(PLAYER);
+                final StereoClientRenderer stereoClientRenderer = (StereoClientRenderer) mp.getAttachedObject(STEREO_RENDERER_KEY);
+
+                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) ) {
+                    System.err.println("MovieSimple State: CHANGE_SIZE");
+                    // window.disposeGLEventListener(ms, false /* remove */ );
+                    ms.resetGLState();
+                }
+                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_INIT & event_mask ) ) {
+                    System.err.println("MovieSimple State: INIT");
+                    // Use GLEventListener in all cases [A+V, V, A]
+                    stereoClientRenderer.addGLEventListener(ms);
+                    final GLAnimatorControl anim = window.getAnimator();
+                    anim.setUpdateFPSFrames(60, null);
+                    anim.resetFPSCounter();
+                    ms.setStereoClientRenderer(stereoClientRenderer);
+                }
+                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_PLAY & event_mask ) ) {
+                    window.getAnimator().resetFPSCounter();
+                }
+
+                boolean destroy = false;
+                Throwable err = null;
+
+                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_EOS & event_mask ) ) {
+                    err = ms.mPlayer.getStreamException();
+                    if( null != err ) {
+                        System.err.println("MovieSimple State: EOS + Exception");
+                        destroy = true;
+                    } else {
+                        System.err.println("MovieSimple State: EOS");
+                        new Thread() {
+                            public void run() {
+                                mp.setPlaySpeed(1f);
+                                mp.seek(0);
+                                mp.play();
+                            }
+                        }.start();
+                    }
+                }
+                if( 0 != ( GLMediaEventListener.EVENT_CHANGE_ERR & event_mask ) ) {
+                    err = ms.mPlayer.getStreamException();
+                    if( null != err ) {
+                        System.err.println("MovieSimple State: ERR + Exception");
+                    } else {
+                        System.err.println("MovieSimple State: ERR");
+                    }
+                    destroy = true;
+                }
+                if( destroy ) {
+                    if( null != err ) {
+                        err.printStackTrace();
+                    }
+                    destroyWindow(window);
+                }
+            }
+        };
+    public final static StereoGLMediaEventListener stereoGLMediaEventListener = new StereoGLMediaEventListener();
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
index 787dbab..0d11915 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/av/MovieSimple.java
@@ -49,6 +49,9 @@ import javax.media.opengl.fixedfunc.GLMatrixFunc;
 import com.jogamp.common.os.Platform;
 import com.jogamp.common.util.IOUtil;
 import com.jogamp.graph.curve.Region;
+import com.jogamp.graph.curve.opengl.GLRegion;
+import com.jogamp.graph.curve.opengl.RegionRenderer;
+import com.jogamp.graph.font.Font;
 import com.jogamp.newt.Window;
 import com.jogamp.newt.event.KeyAdapter;
 import com.jogamp.newt.event.KeyEvent;
@@ -87,11 +90,11 @@ public class MovieSimple implements GLEventListener {
     public static final int EFFECT_GRADIENT_BOTTOM2TOP     = 1<<1;
     public static final int EFFECT_TRANSPARENT             = 1<<3;
 
-    private static final String WINDOW_KEY = "window";
-    private static final String PLAYER = "player";
+    public static final String WINDOW_KEY = "window";
+    public static final String PLAYER = "player";
 
     private static boolean waitForKey = false;
-    private int winWidth, winHeight;
+    private int surfWidth, surfHeight;
     private int prevMouseX; // , prevMouseY;
     private int rotate = 0;
     private boolean  orthoProjection = true;
@@ -118,34 +121,58 @@ public class MovieSimple implements GLEventListener {
     private static final String shaderBasename = "texsequence_xxx";
     private static final String myTextureLookupName = "myTexture2D";
 
-    /** Blender's Big Buck Bunny Trailer: 24f 640p VP8, Vorbis 44100Hz mono, WebM/Matroska Stream. */
+    /** Blender's Big Buck Bunny: 24f 416p H.264,  AAC 48000 Hz, 2 ch, mpeg stream. */
     public static final URI defURI;
     static {
         URI _defURI = null;
         try {
-            _defURI = new URI("http://video.webmfiles.org/big-buck-bunny_trailer.webm");
-        } catch (URISyntaxException e) {
+            // Blender's Big Buck Bunny Trailer: 24f 640p VP8, Vorbis 44100Hz mono, WebM/Matroska Stream.
+            // _defURI = new URI("http://video.webmfiles.org/big-buck-bunny_trailer.webm");
+            _defURI = new URI("http://archive.org/download/BigBuckBunny_328/BigBuckBunny_512kb.mp4");
+        } catch (final URISyntaxException e) {
             e.printStackTrace();
         }
         defURI = _defURI;
     }
 
+    final int[] textSampleCount = { 4 };
+
     private final class InfoTextRendererGLELBase extends TextRendererGLELBase {
-        InfoTextRendererGLELBase() {
+        private final Font font = getFont(0, 0, 0);
+        private final float fontSize = 10f;
+        private final GLRegion regionFPS;
+
+        InfoTextRendererGLELBase(final int rmode, final boolean lowPerfDevice) {
             // FIXME: Graph TextRenderer does not AA well w/o MSAA and FBO
-            super(Region.VBAA_RENDERING_BIT);
-            texSizeScale = 2;
+            super(rmode, textSampleCount);
+            this.setRendererCallbacks(RegionRenderer.defaultBlendEnable, RegionRenderer.defaultBlendDisable);
+            if( lowPerfDevice ) {
+                regionFPS = null;
+            } else {
+                regionFPS = GLRegion.create(renderModes, null);
+                System.err.println("RegionFPS "+Region.getRenderModeString(renderModes)+", sampleCount "+textSampleCount[0]+", class "+regionFPS.getClass().getName());
+            }
+            staticRGBAColor[0] = 0.9f;
+            staticRGBAColor[1] = 0.9f;
+            staticRGBAColor[2] = 0.9f;
+            staticRGBAColor[3] = 1.0f;
+        }
 
-            fontSize = 18;
+        @Override
+        public void init(final GLAutoDrawable drawable) {
+            super.init(drawable);
+        }
 
-            staticRGBAColor[0] = 1.0f;
-            staticRGBAColor[1] = 1.0f;
-            staticRGBAColor[2] = 1.0f;
-            staticRGBAColor[3] = 1.0f;
+        @Override
+        public void dispose(final GLAutoDrawable drawable) {
+            if( null != regionFPS ) {
+                regionFPS.destroy(drawable.getGL().getGL2ES2());
+            }
+            super.dispose(drawable);
         }
 
         @Override
-        public void display(GLAutoDrawable drawable) {
+        public void display(final GLAutoDrawable drawable) {
             final GLAnimatorControl anim = drawable.getAnimator();
             final float lfps = null != anim ? anim.getLastFPS() : 0f;
             final float tfps = null != anim ? anim.getTotalFPS() : 0f;
@@ -154,13 +181,12 @@ public class MovieSimple implements GLEventListener {
 
             // Note: MODELVIEW is from [ 0 .. height ]
 
-            final int height = drawable.getHeight();
+            final int height = drawable.getSurfaceHeight();
 
             final float aspect = (float)mPlayer.getWidth() / (float)mPlayer.getHeight();
 
-            // FIXME: Graph TextRenderer does not scale well, i.e. text update per 1/10s cause too much recompute of regions!
-            // final String text1 = String.format("%03.1f/%03.1f s, %s (%01.2fx, vol %01.2f), a %01.2f, fps %02.1f -> %02.1f / %02.1f, v-sync %d",
-            final String text1 = String.format("%03.0f/%03.0f s, %s (%01.2fx, vol %01.2f), a %01.2f, fps %02.1f -> %02.1f / %02.1f, v-sync %d",
+            final String ptsPrec = null != regionFPS ? "3.1" : "3.0";
+            final String text1 = String.format("%0"+ptsPrec+"f/%0"+ptsPrec+"f s, %s (%01.2fx, vol %01.2f), a %01.2f, fps %02.1f -> %02.1f / %02.1f, v-sync %d",
                     pts, mPlayer.getDuration() / 1000f,
                     mPlayer.getState().toString().toLowerCase(), mPlayer.getPlaySpeed(), mPlayer.getAudioVolume(),
                     aspect, mPlayer.getFramerate(), lfps, tfps, swapIntervalSet);
@@ -170,18 +196,24 @@ public class MovieSimple implements GLEventListener {
                     mPlayer.getVID(), mPlayer.getVideoBitrate()/1000, mPlayer.getVideoCodec());
             final String text4 = mPlayer.getURI().getRawPath();
             if( displayOSD && null != renderer ) {
-                renderString(drawable, text1, 1 /* col */,  1 /* row */, 0, 0,      -1);
-                renderString(drawable, text2, 1 /* col */, -4 /* row */, 0, height, -1);
-                renderString(drawable, text3, 1 /* col */, -3 /* row */, 0, height, -1);
-                renderString(drawable, text4, 1 /* col */, -2 /* row */, 0, height, -1);
+                // We share ClearColor w/ MovieSimple's init !
+                final float pixelSize = font.getPixelSize(fontSize, dpiH);
+                if( null != regionFPS ) {
+                    renderString(drawable, font, pixelSize, text1, 1 /* col */,  1 /* row */, 0,      0, -1, regionFPS); // no-cache
+                } else {
+                    renderString(drawable, font, pixelSize, text1, 1 /* col */,  1 /* row */, 0,      0, -1, true);
+                }
+                renderString(drawable, font, pixelSize, text2, 1 /* col */, -4 /* row */, 0, height, -1, true);
+                renderString(drawable, font, pixelSize, text3, 1 /* col */, -3 /* row */, 0, height, -1, true);
+                renderString(drawable, font, pixelSize, text4, 1 /* col */, -2 /* row */, 0, height, -1, true);
             }
         } };
-    private final InfoTextRendererGLELBase textRendererGLEL = new InfoTextRendererGLELBase();
+    private InfoTextRendererGLELBase textRendererGLEL = null;
     private boolean displayOSD = true;
 
     private final MouseListener mouseAction = new MouseAdapter() {
-        public void mousePressed(MouseEvent e) {
-            if(e.getY()<=winHeight/2 && null!=mPlayer && 1 == e.getClickCount()) {
+        public void mousePressed(final MouseEvent e) {
+            if(e.getY()<=surfHeight/2 && null!=mPlayer && 1 == e.getClickCount()) {
                 if(GLMediaPlayer.State.Playing == mPlayer.getState()) {
                     mPlayer.pause(false);
                 } else {
@@ -189,23 +221,23 @@ public class MovieSimple implements GLEventListener {
                 }
             }
         }
-        public void mouseReleased(MouseEvent e) {
-            if(e.getY()<=winHeight/2) {
+        public void mouseReleased(final MouseEvent e) {
+            if(e.getY()<=surfHeight/2) {
                 rotate = -1;
                 zoom = zoom0;
                 System.err.println("zoom: "+zoom);
             }
         }
-        public void mouseMoved(MouseEvent e) {
+        public void mouseMoved(final MouseEvent e) {
             prevMouseX = e.getX();
             // prevMouseY = e.getY();
         }
-        public void mouseDragged(MouseEvent e) {
-            int x = e.getX();
-            int y = e.getY();
+        public void mouseDragged(final MouseEvent e) {
+            final int x = e.getX();
+            final int y = e.getY();
 
-            if(y>winHeight/2) {
-                final float dp  = (float)(x-prevMouseX)/(float)winWidth;
+            if(y>surfHeight/2) {
+                final float dp  = (float)(x-prevMouseX)/(float)surfWidth;
                 final int pts0 = GLMediaPlayer.STREAM_ID_NONE != mPlayer.getVID() ? mPlayer.getVideoPTS() : mPlayer.getAudioPTS();
                 mPlayer.seek(pts0 + (int) (mPlayer.getDuration() * dp));
             } else {
@@ -217,7 +249,7 @@ public class MovieSimple implements GLEventListener {
             prevMouseX = x;
             // prevMouseY = y;
         }
-        public void mouseWheelMoved(MouseEvent e) {
+        public void mouseWheelMoved(final MouseEvent e) {
             if( !e.isShiftDown() ) {
                 zoom += e.getRotation()[1]/10f; // vertical: wheel
                 System.err.println("zoom: "+zoom);
@@ -225,7 +257,7 @@ public class MovieSimple implements GLEventListener {
         } };
 
     private final KeyListener keyAction = new KeyAdapter() {
-        public void keyReleased(KeyEvent e)  {
+        public void keyReleased(final KeyEvent e)  {
             if( e.isAutoRepeat() ) {
                 return;
             }
@@ -311,10 +343,10 @@ public class MovieSimple implements GLEventListener {
 
         mPlayer.addEventListener(new GLMediaEventListener() {
             @Override
-            public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) { }
+            public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) { }
 
             @Override
-            public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
+            public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
                 System.err.println("MovieCube AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
                 System.err.println("MovieCube State: "+mp);
                 if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) ) {
@@ -335,7 +367,7 @@ public class MovieSimple implements GLEventListener {
         while( null == se && GLMediaPlayer.State.Initialized != mPlayer.getState() ) {
             try {
                 Thread.sleep(16);
-            } catch (InterruptedException e) { }
+            } catch (final InterruptedException e) { }
             se = mPlayer.getStreamException();
         }
         if( null != se ) {
@@ -345,7 +377,7 @@ public class MovieSimple implements GLEventListener {
     }
 
     /** Custom constructor, user needs to issue {@link #initStream(URI, int, int, int)} afterwards. */
-    public MovieSimple(GLMediaPlayer sharedMediaPlayer) throws IllegalStateException {
+    public MovieSimple(final GLMediaPlayer sharedMediaPlayer) throws IllegalStateException {
         mPlayer = sharedMediaPlayer;
         mPlayerScaleOrig = false;
         mPlayerShared = null != mPlayer;
@@ -356,26 +388,26 @@ public class MovieSimple implements GLEventListener {
         System.out.println("pC.1a shared "+mPlayerShared+", "+mPlayer);
     }
 
-    public void initStream(URI streamLoc, int vid, int aid, int textureCount) {
+    public void initStream(final URI streamLoc, final int vid, final int aid, final int textureCount) {
         mPlayer.initStream(streamLoc, vid, aid, textureCount);
         System.out.println("pC.1b "+mPlayer);
     }
 
-    public void setSwapInterval(int v) { this.swapInterval = v; }
+    public void setSwapInterval(final int v) { this.swapInterval = v; }
 
     public GLMediaPlayer getGLMediaPlayer() { return mPlayer; }
 
-    public void setScaleOrig(boolean v) {
+    public void setScaleOrig(final boolean v) {
         mPlayerScaleOrig = v;
     }
 
     /** defaults to true */
-    public void setOrthoProjection(boolean v) { orthoProjection=v; }
+    public void setOrthoProjection(final boolean v) { orthoProjection=v; }
     public boolean getOrthoProjection() { return orthoProjection; }
 
-    public boolean hasEffect(int e) { return 0 != ( effects & e ) ; }
-    public void setEffects(int e) { effects = e; };
-    public void setTransparency(float alpha) {
+    public boolean hasEffect(final int e) { return 0 != ( effects & e ) ; }
+    public void setEffects(final int e) { effects = e; };
+    public void setTransparency(final float alpha) {
         this.effects |= EFFECT_TRANSPARENT;
         this.alpha = alpha;
     }
@@ -384,11 +416,11 @@ public class MovieSimple implements GLEventListener {
         resetGLState = true;
     }
 
-    private void initShader(GL2ES2 gl) {
+    private void initShader(final GL2ES2 gl) {
         // Create & Compile the shader objects
-        ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MovieSimple.class,
+        final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, MovieSimple.class,
                                             "../shader", "../shader/bin", shaderBasename, true);
-        ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, MovieSimple.class,
+        final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, MovieSimple.class,
                                             "../shader", "../shader/bin", shaderBasename, true);
 
         boolean preludeGLSLVersion = true;
@@ -407,7 +439,7 @@ public class MovieSimple implements GLEventListener {
 
         int rsFpPos = preludeGLSLVersion ? rsFp.addGLSLVersion(gl) : 0;
         rsFpPos = rsFp.insertShaderSource(0, rsFpPos, mPlayer.getRequiredExtensionsShaderStub());
-        rsFpPos = rsFp.addDefaultShaderPrecision(gl, rsFpPos);
+        rsFp.addDefaultShaderPrecision(gl, rsFpPos);
 
         final String texLookupFuncName = mPlayer.getTextureLookupFunctionName(myTextureLookupName);
         rsFp.replaceInShaderSource(myTextureLookupName, texLookupFuncName);
@@ -419,7 +451,7 @@ public class MovieSimple implements GLEventListener {
         rsFp.insertShaderSource(0, "TEXTURE-SEQUENCE-CODE-BEGIN", 0, sFpIns);
 
         // Create & Link the shader program
-        ShaderProgram sp = new ShaderProgram();
+        final ShaderProgram sp = new ShaderProgram();
         sp.add(rsVp);
         sp.add(rsFp);
         if(!sp.link(gl, System.err)) {
@@ -432,7 +464,7 @@ public class MovieSimple implements GLEventListener {
     }
 
     @Override
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         if(null == mPlayer) {
             throw new InternalError("mPlayer null");
         }
@@ -446,7 +478,7 @@ public class MovieSimple implements GLEventListener {
         zoom1 = orthoProjection ? 0f : -5f;
         zoom = zoom0;
 
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
         System.err.println(JoglVersion.getGLInfo(gl, null));
         System.err.println("Alpha: "+alpha+", opaque "+drawable.getChosenGLCapabilities().isBackgroundOpaque()+
                            ", "+drawable.getClass().getName()+", "+drawable);
@@ -479,7 +511,7 @@ public class MovieSimple implements GLEventListener {
             if(!mPlayerShared) {
                 mPlayer.setTextureMinMagFilter( new int[] { GL.GL_NEAREST, GL.GL_LINEAR } );
             }
-        } catch (Exception glex) {
+        } catch (final Exception glex) {
             glex.printStackTrace();
             if(!mPlayerShared && null != mPlayer) {
                 mPlayer.destroy(gl);
@@ -494,7 +526,7 @@ public class MovieSimple implements GLEventListener {
             // Push the 1st uniform down the path
             st.useProgram(gl, true);
 
-            int[] viewPort = new int[] { 0, 0, drawable.getWidth(), drawable.getHeight()};
+            final int[] viewPort = new int[] { 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight()};
             pmvMatrix = new PMVMatrix();
             reshapePMV(viewPort[2], viewPort[3]);
             pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
@@ -505,11 +537,11 @@ public class MovieSimple implements GLEventListener {
                 throw new GLException("Error setting mgl_ActiveTexture in shader: "+st);
             }
 
-            float dWidth = drawable.getWidth();
-            float dHeight = drawable.getHeight();
-            float mWidth = mPlayer.getWidth();
-            float mHeight = mPlayer.getHeight();
-            float mAspect = mWidth/mHeight;
+            final float dWidth = drawable.getSurfaceWidth();
+            final float dHeight = drawable.getSurfaceHeight();
+            final float mWidth = mPlayer.getWidth();
+            final float mHeight = mPlayer.getHeight();
+            final float mAspect = mWidth/mHeight;
             System.err.println("XXX0: mov aspect: "+mAspect);
             float xs, ys;
             if(orthoProjection) {
@@ -531,8 +563,8 @@ public class MovieSimple implements GLEventListener {
             {
                 System.err.println("XXX0: pixel  LB: "+verts[0]+", "+verts[1]+", "+verts[2]);
                 System.err.println("XXX0: pixel  RT: "+verts[3]+", "+verts[4]+", "+verts[5]);
-                float[] winLB = new float[3];
-                float[] winRT = new float[3];
+                final float[] winLB = new float[3];
+                final float[] winRT = new float[3];
                 pmvMatrix.gluProject(verts[0], verts[1], verts[2], viewPort, 0, winLB, 0);
                 pmvMatrix.gluProject(verts[3], verts[4], verts[5], viewPort, 0, winRT, 0);
                 System.err.println("XXX0: win   LB: "+winLB[0]+", "+winLB[1]+", "+winLB[2]);
@@ -550,7 +582,7 @@ public class MovieSimple implements GLEventListener {
             st.ownAttribute(interleavedVBO, true);
             gl.glClearColor(0.3f, 0.3f, 0.3f, 0.3f);
 
-            gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+            gl.glEnable(GL.GL_DEPTH_TEST);
 
             st.useProgram(gl, false);
 
@@ -570,13 +602,16 @@ public class MovieSimple implements GLEventListener {
             final Window window = (Window) upstreamWidget;
             window.addMouseListener(mouseAction);
             window.addKeyListener(keyAction);
-            winWidth = window.getWidth();
-            winHeight = window.getHeight();
+            surfWidth = window.getSurfaceWidth();
+            surfHeight = window.getSurfaceHeight();
         }
+        final int rmode = drawable.getChosenGLCapabilities().getSampleBuffers() ? 0 : Region.VBAA_RENDERING_BIT;
+        final boolean lowPerfDevice = gl.isGLES();
+        textRendererGLEL = new InfoTextRendererGLELBase(rmode, lowPerfDevice);
         drawable.addGLEventListener(textRendererGLEL);
     }
 
-    protected void updateInterleavedVBO(GL gl, Texture tex) {
+    protected void updateInterleavedVBO(final GL gl, final Texture tex) {
         final float ss = 1f, ts = 1f; // scale tex-coord
         final boolean wasEnabled = interleavedVBO.enabled();
         interleavedVBO.seal(gl, false);
@@ -608,20 +643,12 @@ public class MovieSimple implements GLEventListener {
 
              // left-top
             ib.put(verts[0]);  ib.put(verts[4]);  ib.put(verts[2]);
-            if( hasEffect(EFFECT_GRADIENT_BOTTOM2TOP) ) {
-                ib.put( 1);    ib.put( 1);     ib.put( 1);    ib.put(alpha);
-            } else {
-                ib.put( 1);    ib.put( 1);     ib.put( 1);    ib.put(alpha);
-            }
+            ib.put( 1);    ib.put( 1);     ib.put( 1);    ib.put(alpha);
             ib.put( tc.left()   *ss);  ib.put( tc.top()    *ts);
 
              // right-top
             ib.put(verts[3]);  ib.put(verts[4]);  ib.put(verts[2]);
-            if( hasEffect(EFFECT_GRADIENT_BOTTOM2TOP) ) {
-                ib.put( 1);    ib.put( 1);     ib.put( 1);    ib.put(alpha);
-            } else {
-                ib.put( 1);    ib.put( 1);     ib.put( 1);    ib.put(alpha);
-            }
+            ib.put( 1);    ib.put( 1);     ib.put( 1);    ib.put(alpha);
             ib.put( tc.right()  *ss);  ib.put( tc.top()    *ts);
         }
         interleavedVBO.seal(gl, true);
@@ -631,11 +658,11 @@ public class MovieSimple implements GLEventListener {
     }
 
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
         if(null == mPlayer) { return; }
-        winWidth = width;
-        winHeight = height;
+        surfWidth = width;
+        surfHeight = height;
 
         if(null != st) {
             reshapePMV(width, height);
@@ -647,7 +674,10 @@ public class MovieSimple implements GLEventListener {
         System.out.println("pR "+mPlayer);
     }
 
-    private void reshapePMV(int width, int height) {
+    private final float zNear = 1f;
+    private final float zFar = 10f;
+
+    private void reshapePMV(final int width, final int height) {
         pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
         if(orthoProjection) {
@@ -656,7 +686,7 @@ public class MovieSimple implements GLEventListener {
             pmvMatrix.glOrthof(-fw, fw, -fh, fh, -1.0f, 1.0f);
             nearPlaneNormalized = 0f;
         } else {
-            pmvMatrix.gluPerspective(45.0f, (float)width / (float)height, 1f, 10.0f);
+            pmvMatrix.gluPerspective(45.0f, (float)width / (float)height, zNear, zFar);
             nearPlaneNormalized = 1f/(10f-1f);
         }
         System.err.println("XXX0: Perspective nearPlaneNormalized: "+nearPlaneNormalized);
@@ -667,12 +697,13 @@ public class MovieSimple implements GLEventListener {
     }
 
     @Override
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         drawable.disposeGLEventListener(textRendererGLEL, true);
+        textRendererGLEL = null;
         disposeImpl(drawable, true);
     }
 
-    private void disposeImpl(GLAutoDrawable drawable, boolean disposePlayer) {
+    private void disposeImpl(final GLAutoDrawable drawable, final boolean disposePlayer) {
         if(null == mPlayer) { return; }
 
         final Object upstreamWidget = drawable.getUpstreamWidget();
@@ -683,7 +714,7 @@ public class MovieSimple implements GLEventListener {
         }
 
         System.out.println("pD.1 "+mPlayer+", disposePlayer "+disposePlayer);
-        GL2ES2 gl = drawable.getGL().getGL2ES2();
+        final GL2ES2 gl = drawable.getGL().getGL2ES2();
         if( disposePlayer ) {
             if(!mPlayerShared) {
                 mPlayer.destroy(gl);
@@ -693,7 +724,6 @@ public class MovieSimple implements GLEventListener {
         }
         pmvMatrixUniform = null;
         if(null != pmvMatrix) {
-            pmvMatrix.destroy();
             pmvMatrix=null;
         }
         if(null != st) {
@@ -705,7 +735,7 @@ public class MovieSimple implements GLEventListener {
     long lastPerfPos = 0;
 
     @Override
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
         if(-1 != swapInterval) {
             gl.setSwapInterval(swapInterval); // in case switching the drawable (impl. may bound attribute there)
@@ -720,7 +750,7 @@ public class MovieSimple implements GLEventListener {
             System.err.println("XXX resetGLState");
             disposeImpl(drawable, false);
             init(drawable);
-            reshape(drawable, 0, 0, drawable.getWidth(), drawable.getHeight());
+            reshape(drawable, 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
         }
 
         final long currentPos = System.currentTimeMillis();
@@ -751,7 +781,7 @@ public class MovieSimple implements GLEventListener {
         Texture tex = null;
         if(null!=mPlayer) {
             final TextureSequence.TextureFrame texFrame;
-            if(mPlayerShared) {
+            if( mPlayerShared ) {
                 texFrame=mPlayer.getLastTexture();
             } else {
                 texFrame=mPlayer.getNextTexture(gl);
@@ -780,11 +810,11 @@ public class MovieSimple implements GLEventListener {
             }
 
             @Override
-            public void newFrameAvailable(GLMediaPlayer ts, TextureFrame newFrame, long when) {
+            public void newFrameAvailable(final GLMediaPlayer ts, final TextureFrame newFrame, final long when) {
             }
 
             @Override
-            public void attributesChanged(final GLMediaPlayer mp, int event_mask, long when) {
+            public void attributesChanged(final GLMediaPlayer mp, final int event_mask, final long when) {
                 System.err.println("MovieSimple AttributesChanges: events_mask 0x"+Integer.toHexString(event_mask)+", when "+when);
                 System.err.println("MovieSimple State: "+mp);
                 final GLWindow window = (GLWindow) mp.getAttachedObject(WINDOW_KEY);
@@ -792,7 +822,7 @@ public class MovieSimple implements GLEventListener {
                 if( 0 != ( GLMediaEventListener.EVENT_CHANGE_SIZE & event_mask ) ) {
                     System.err.println("MovieSimple State: CHANGE_SIZE");
                     if( origSize ) {
-                        window.setSize(mp.getWidth(), mp.getHeight());
+                        window.setSurfaceSize(mp.getWidth(), mp.getHeight());
                     }
                     // window.disposeGLEventListener(ms, false /* remove */ );
                     ms.resetGLState();
@@ -868,14 +898,14 @@ public class MovieSimple implements GLEventListener {
                 }
             }
         };
-    final static MyGLMediaEventListener myGLMediaEventListener = new MyGLMediaEventListener();
+    public final static MyGLMediaEventListener myGLMediaEventListener = new MyGLMediaEventListener();
 
     static boolean loopEOS = false;
     static boolean origSize;
 
-    public static void main(String[] args) throws IOException, URISyntaxException {
+    public static void main(final String[] args) throws IOException, URISyntaxException {
         int swapInterval = 1;
-        int width = 640;
+        int width = 800;
         int height = 600;
         int textureCount = 3; // default - threaded
         boolean ortho = true;
@@ -899,7 +929,7 @@ public class MovieSimple implements GLEventListener {
             }
             windowCount = _windowCount;
         }
-        String[] urls_s = new String[windowCount];
+        final String[] urls_s = new String[windowCount];
         String file_s1=null, file_s2=null;
         {
             boolean _origSize = false;
@@ -962,7 +992,7 @@ public class MovieSimple implements GLEventListener {
         if( null != urls_s[0] ) {
             streamLoc0 = new URI(urls_s[0]);
         } else if( null != file_s1 ) {
-            File movieFile = new File(file_s1);
+            final File movieFile = new File(file_s1);
             streamLoc0 = movieFile.toURI();
         } else if( null != file_s2 ) {
             streamLoc0 = IOUtil.toURISimple(new File(file_s2));
@@ -993,7 +1023,8 @@ public class MovieSimple implements GLEventListener {
             glp = GLProfile.getGL2ES2();
         }
         System.err.println("GLProfile: "+glp);
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
+        // caps.setAlphaBits(4); // NOTE_ALPHA_BLENDING: We go w/o alpha and blending!
 
         final MovieSimple[] mss = new MovieSimple[windowCount];
         final GLWindow[] windows = new GLWindow[windowCount];
@@ -1002,7 +1033,7 @@ public class MovieSimple implements GLEventListener {
             anim.start();
             windows[i] = GLWindow.create(caps);
             windows[i].addWindowListener(new WindowAdapter() {
-                public void windowDestroyed(WindowEvent e) {
+                public void windowDestroyed(final WindowEvent e) {
                     anim.stop();
                 }
             });
@@ -1032,4 +1063,5 @@ public class MovieSimple implements GLEventListener {
             mss[i].initStream(streamLocN, vid, aid, textureCount);
         }
     }
+
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas01.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas01.java
index 4cecd90..9866e76 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas01.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -61,7 +61,7 @@ public class Bug816AppletGLCanvas01 extends Applet implements GLEventListener {
     public static JPanel appletHolder;
     public static boolean isApplet = true;
 
-    static public void main(String args[]) {
+    static public void main(final String args[]) {
         Applet myApplet = null;
         isApplet = false;
 
@@ -69,7 +69,7 @@ public class Bug816AppletGLCanvas01 extends Applet implements GLEventListener {
         appletStarter(myApplet, "Bug861AppletGLCanvasTest01", 800, 600);
     }
 
-    static public void appletStarter(final Applet des, String frameName, int width, int height) {
+    static public void appletStarter(final Applet des, final String frameName, final int width, final int height) {
         appletHolder = new JPanel();
         if (frame != null) {
             frame.dispose();
@@ -84,16 +84,16 @@ public class Bug816AppletGLCanvas01 extends Applet implements GLEventListener {
         appletHolder.add(des);
 
         frame.setVisible(true);
-        int frameBorderSize = appletHolder.getLocationOnScreen().x - frame.getLocationOnScreen().x;
-        int titleBarHeight = appletHolder.getLocationOnScreen().y - frame.getLocationOnScreen().y;
-        int frameWidth = width + 2 * frameBorderSize;
-        int frameHeight = height + titleBarHeight + frameBorderSize;
+        final int frameBorderSize = appletHolder.getLocationOnScreen().x - frame.getLocationOnScreen().x;
+        final int titleBarHeight = appletHolder.getLocationOnScreen().y - frame.getLocationOnScreen().y;
+        final int frameWidth = width + 2 * frameBorderSize;
+        final int frameHeight = height + titleBarHeight + frameBorderSize;
         frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         frame.setSize(frameWidth, frameHeight);
         frame.setVisible(true);
         des.init();
         frame.addWindowListener(new WindowAdapter() {
-            public void windowClosing(WindowEvent e) {
+            public void windowClosing(final WindowEvent e) {
                 System.exit(0);
             }
         });
@@ -107,28 +107,28 @@ public class Bug816AppletGLCanvas01 extends Applet implements GLEventListener {
         setBackground(Color.gray);
         setLayout(null);
 
-        GLProfile glp = GLProfile.getDefault();
-        GLCapabilities caps = new GLCapabilities(glp);
-        GLCanvas canvas = new GLCanvas((GLCapabilitiesImmutable) caps);
+        final GLProfile glp = GLProfile.getDefault();
+        final GLCapabilities caps = new GLCapabilities(glp);
+        final GLCanvas canvas = new GLCanvas(caps);
         canvas.setBounds(50, 50, 200, 450);
         canvas.addGLEventListener(this);
         add(canvas);
     }
 
-    public void init(GLAutoDrawable gLAutoDrawable) {
-        GL gl = gLAutoDrawable.getGL();
+    public void init(final GLAutoDrawable gLAutoDrawable) {
+        final GL gl = gLAutoDrawable.getGL();
         gl.glClearColor(1.0f, 0.0f, 0.0f, 1.0f);
         gl.glClear(GL.GL_COLOR_BUFFER_BIT);
         gLAutoDrawable.swapBuffers();
     }
 
-    public void dispose(GLAutoDrawable glad) {
+    public void dispose(final GLAutoDrawable glad) {
     }
 
-    public void display(GLAutoDrawable glad) {
+    public void display(final GLAutoDrawable glad) {
     }
 
-    public void reshape(GLAutoDrawable glad, int i, int i1, int i2, int i3) {
+    public void reshape(final GLAutoDrawable glad, final int i, final int i1, final int i2, final int i3) {
     }
 
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02a.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02a.java
index 3bbb423..6218edd 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02a.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02a.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -62,7 +62,7 @@ public class Bug816AppletGLCanvas02a extends Applet {
     }
 
     private GLCanvas createCanvas() {
-        GLCanvas canvas = new GLCanvas();
+        final GLCanvas canvas = new GLCanvas();
         canvas.addGLEventListener(new GearsES2(1));
         canvas.setSize(300, 300);
         animator.add(canvas);
@@ -72,7 +72,7 @@ public class Bug816AppletGLCanvas02a extends Applet {
     String currentThreadName() {
         return Thread.currentThread().getName();
     }
-    
+
     @Override
     public void start() {
         System.err.println("GearsApplet: start() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02b.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02b.java
index 87a7ea4..62eb8ea 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02b.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletGLCanvas02b.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -62,7 +62,7 @@ public class Bug816AppletGLCanvas02b extends Applet {
     }
 
     private GLCanvas createCanvas() {
-        GLCanvas canvas = new GLCanvas();
+        final GLCanvas canvas = new GLCanvas();
         canvas.addGLEventListener(new GearsES2(1));
         canvas.setSize(300, 300);
         animator.add(canvas);
@@ -72,7 +72,7 @@ public class Bug816AppletGLCanvas02b extends Applet {
     String currentThreadName() {
         return Thread.currentThread().getName();
     }
-    
+
     @Override
     public void start() {
         System.err.println("GearsApplet: start() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03a.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03a.java
index a0ce938..3212293 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03a.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03a.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -59,24 +59,24 @@ public class Bug816AppletOSXCALayerPos03a extends Applet {
     @Override
     public void init() {
         System.err.println("GearsApplet: init() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
-        GLProfile glp = GLProfile.getDefault();
+        final GLProfile glp = GLProfile.getDefault();
         final GLCapabilities caps = new GLCapabilities(glp);
         final GLCanvas glCanvas1 = new GLCanvas(caps);
         glCanvas1.addGLEventListener(new GearsES2(1));
-        
+
         animator = new Animator();
         animator.add(glCanvas1);
         setLayout(new BorderLayout());
-        
-        // Build a GUI where the canvas 3D is located at top right of the frame 
+
+        // Build a GUI where the canvas 3D is located at top right of the frame
         // and can be resized with split panes dividers
-        JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, 
-            true, new JScrollPane(), glCanvas1);    
+        final JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
+            true, new JScrollPane(), glCanvas1);
         verticalSplitPane.setResizeWeight(0.5);
-        JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, 
+        final JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
             true, new JScrollPane(), verticalSplitPane);
         horizontalSplitPane.setResizeWeight(0.5);
-        JRootPane intermediateRootPane = new JRootPane();
+        final JRootPane intermediateRootPane = new JRootPane();
         intermediateRootPane.setContentPane(horizontalSplitPane);
         add(intermediateRootPane, BorderLayout.CENTER);
         System.err.println("GearsApplet: init() - end [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
@@ -85,7 +85,7 @@ public class Bug816AppletOSXCALayerPos03a extends Applet {
     String currentThreadName() {
         return Thread.currentThread().getName();
     }
-    
+
     @Override
     public void start() {
         System.err.println("GearsApplet: start() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03b.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03b.java
index 48dac25..491bc5f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03b.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug816AppletOSXCALayerPos03b.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -57,24 +57,24 @@ public class Bug816AppletOSXCALayerPos03b extends JApplet {
     @Override
     public void init() {
         System.err.println("GearsApplet: init() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
-        GLProfile glp = GLProfile.getDefault();
+        final GLProfile glp = GLProfile.getDefault();
         final GLCapabilities caps = new GLCapabilities(glp);
         final GLCanvas glCanvas1 = new GLCanvas(caps);
         glCanvas1.addGLEventListener(new GearsES2(1));
-        
+
         animator = new Animator();
         animator.add(glCanvas1);
         setSize(640, 480);
-        
-        // Build a GUI where the canvas 3D is located at top right of the frame 
+
+        // Build a GUI where the canvas 3D is located at top right of the frame
         // and can be resized with split panes dividers
-        JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, 
-            true, new JScrollPane(), glCanvas1);    
+        final JSplitPane verticalSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT,
+            true, new JScrollPane(), glCanvas1);
         verticalSplitPane.setResizeWeight(0.5);
-        JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, 
+        final JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
             true, new JScrollPane(), verticalSplitPane);
         horizontalSplitPane.setResizeWeight(0.5);
-        JRootPane intermediateRootPane = new JRootPane();
+        final JRootPane intermediateRootPane = new JRootPane();
         intermediateRootPane.setContentPane(horizontalSplitPane);
         intermediateRootPane.setSize(640, 480);
         this.add(intermediateRootPane);
@@ -84,7 +84,7 @@ public class Bug816AppletOSXCALayerPos03b extends JApplet {
     String currentThreadName() {
         return Thread.currentThread().getName();
     }
-    
+
     @Override
     public void start() {
         System.err.println("GearsApplet: start() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug848AppletGLCanvas01.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug848AppletGLCanvas01.java
index c3d40b7..e85e84c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug848AppletGLCanvas01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/Bug848AppletGLCanvas01.java
@@ -62,8 +62,8 @@ public class Bug848AppletGLCanvas01 extends Applet {
         System.err.println("GearsApplet: init() - end [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
     }
 
-    private GLCanvas createCanvas(int vsyncI) {
-        GLCanvas canvas = new GLCanvas();
+    private GLCanvas createCanvas(final int vsyncI) {
+        final GLCanvas canvas = new GLCanvas();
         canvas.addGLEventListener(new GearsES2(vsyncI));
         canvas.setSize(300, 300);
         animators.add(new Animator(canvas));
@@ -77,7 +77,7 @@ public class Bug848AppletGLCanvas01 extends Applet {
     @Override
     public void start() {
         System.err.println("GearsApplet: start() - begin [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
-        for (GLAnimatorControl control : animators) {
+        for (final GLAnimatorControl control : animators) {
             control.start();
             control.setUpdateFPSFrames(60, System.err);
         }
@@ -87,7 +87,7 @@ public class Bug848AppletGLCanvas01 extends Applet {
     @Override
     public void stop() {
         System.err.println("GearsApplet: stop() - [visible "+isVisible()+", displayable "+isDisplayable()+"] - "+currentThreadName());
-        for (GLAnimatorControl control : animators) {
+        for (final GLAnimatorControl control : animators) {
             control.stop();
         }
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java
index 58600da..d8c4341 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,25 +20,27 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.es2.awt;
 
+import javax.media.nativewindow.ScalableSurface;
 import javax.media.opengl.*;
 
 import com.jogamp.opengl.util.Animator;
+
 import javax.media.opengl.awt.GLCanvas;
 
 import com.jogamp.common.os.Platform;
 import com.jogamp.newt.event.awt.AWTKeyAdapter;
 import com.jogamp.newt.event.awt.AWTWindowAdapter;
+import com.jogamp.newt.event.KeyEvent;
 import com.jogamp.newt.event.TraceKeyAdapter;
 import com.jogamp.newt.event.TraceWindowAdapter;
-
 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
 import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
 import com.jogamp.opengl.test.junit.util.MiscUtils;
@@ -53,6 +55,8 @@ import java.awt.Dimension;
 import java.awt.EventQueue;
 import java.awt.Frame;
 import java.awt.TextArea;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStreamReader;
@@ -70,15 +74,17 @@ import org.junit.runners.MethodSorters;
 public class TestGearsES2AWT extends UITestCase {
     public enum FrameLayout { None, TextOnBottom, BorderCenterSurrounded, DoubleBorderCenterSurrounded };
     public enum ResizeBy { Component, Frame };
-    
-    static long duration = 500; // ms    
-    static int width, height;
+
+    static long duration = 500; // ms
+    static int width = 640, height = 480;
+    static int xpos = 10, ypos = 10;
     static FrameLayout frameLayout = FrameLayout.None;
     static ResizeBy resizeBy = ResizeBy.Component;
-    
+    static int[] reqSurfacePixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
+
     static boolean forceES2 = false;
     static boolean forceGL3 = false;
-    static boolean mainRun = false;
+    static boolean manualTest = false;
     static boolean shallUseOffscreenFBOLayer = false;
     static boolean shallUseOffscreenPBufferLayer = false;
     static boolean useMSAA = false;
@@ -94,14 +100,12 @@ public class TestGearsES2AWT extends UITestCase {
 
     @BeforeClass
     public static void initClass() {
-        width  = 640;
-        height = 480;
         try {
             EventQueue.invokeAndWait(new Runnable() {
                 public void run() {
                     awtEDT = Thread.currentThread();
                 } } );
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
             Assert.assertNull(e);
         }
@@ -122,10 +126,10 @@ public class TestGearsES2AWT extends UITestCase {
                         frame.pack();
                     }
                 } } );
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }       
+        }
     }
     static void setFrameSize(final Frame frame, final boolean frameLayout, final java.awt.Dimension new_sz) {
         try {
@@ -136,12 +140,12 @@ public class TestGearsES2AWT extends UITestCase {
                         frame.validate();
                     }
                 } } );
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }       
+        }
     }
-    
+
     static void setSize(final ResizeBy resizeBy, final Frame frame, final boolean frameLayout, final Component comp, final java.awt.Dimension new_sz) {
         switch( resizeBy ) {
             case Component:
@@ -150,17 +154,26 @@ public class TestGearsES2AWT extends UITestCase {
             case Frame:
                 setFrameSize(frame, frameLayout, new_sz);
                 break;
-        }        
+        }
+    }
+
+    private void setTitle(final Frame frame, final GLCanvas glc, final GLCapabilitiesImmutable caps) {
+        final String capsA = caps.isBackgroundOpaque() ? "opaque" : "transl";
+        final java.awt.Rectangle b = glc.getBounds();
+        frame.setTitle("GLCanvas["+capsA+"], swapI "+swapInterval+", win: ["+b.x+"/"+b.y+" "+b.width+"x"+b.height+"], pix: "+glc.getSurfaceWidth()+"x"+glc.getSurfaceHeight());
     }
-    
-    protected void runTestGL(GLCapabilities caps, final ResizeBy resizeBy, FrameLayout frameLayout) throws InterruptedException, InvocationTargetException {
+
+    protected void runTestGL(final GLCapabilities caps, final ResizeBy resizeBy, final FrameLayout frameLayout) throws InterruptedException, InvocationTargetException {
         final Frame frame = new Frame("GearsES2 AWT Test");
         Assert.assertNotNull(frame);
 
         final GLCanvas glCanvas = new GLCanvas(caps);
         Assert.assertNotNull(glCanvas);
         setSize(resizeBy, frame, false, glCanvas, new Dimension(width, height));
-        
+        glCanvas.setSurfaceScale(reqSurfacePixelScale);
+        final int[] valReqSurfacePixelScale = glCanvas.getRequestedSurfaceScale(new int[2]);
+        frame.setLocation(xpos, ypos);
+
         switch( frameLayout) {
             case None:
                 frame.add(glCanvas);
@@ -174,7 +187,7 @@ public class TestGearsES2AWT extends UITestCase {
                 frame.setLayout(new BorderLayout());
                 frame.add(ta, BorderLayout.SOUTH);
                 frame.add(glCanvas, BorderLayout.CENTER);
-                break;                
+                break;
             case BorderCenterSurrounded:
                 frame.setLayout(new BorderLayout());
                 frame.add(new Button("NORTH"), BorderLayout.NORTH);
@@ -184,14 +197,14 @@ public class TestGearsES2AWT extends UITestCase {
                 frame.add(glCanvas, BorderLayout.CENTER);
                 break;
             case DoubleBorderCenterSurrounded:
-                Container c = new Container();
+                final Container c = new Container();
                 c.setLayout(new BorderLayout());
                 c.add(new Button("north"), BorderLayout.NORTH);
                 c.add(new Button("south"), BorderLayout.SOUTH);
                 c.add(new Button("east"), BorderLayout.EAST);
                 c.add(new Button("west"), BorderLayout.WEST);
                 c.add(glCanvas, BorderLayout.CENTER);
-                
+
                 frame.setLayout(new BorderLayout());
                 frame.add(new Button("NORTH"), BorderLayout.NORTH);
                 frame.add(new Button("SOUTH"), BorderLayout.SOUTH);
@@ -200,11 +213,29 @@ public class TestGearsES2AWT extends UITestCase {
                 frame.add(c, BorderLayout.CENTER);
                 break;
         }
-        frame.setTitle("Gears AWT Test (translucent "+!caps.isBackgroundOpaque()+"), swapInterval "+swapInterval);
+        setTitle(frame, glCanvas, caps);
+
+        frame.addComponentListener(new ComponentListener() {
+            @Override
+            public void componentResized(final ComponentEvent e) {
+                setTitle(frame, glCanvas, caps);
+            }
+
+            @Override
+            public void componentMoved(final ComponentEvent e) {
+                setTitle(frame, glCanvas, caps);
+            }
+
+            @Override
+            public void componentShown(final ComponentEvent e) { }
+
+            @Override
+            public void componentHidden(final ComponentEvent e) { }
+        });
 
         final GearsES2 demo = new GearsES2(swapInterval);
         glCanvas.addGLEventListener(demo);
-        
+
         final SnapshotGLEventListener snap = new SnapshotGLEventListener();
         glCanvas.addGLEventListener(snap);
 
@@ -212,23 +243,59 @@ public class TestGearsES2AWT extends UITestCase {
         if( useAnimator && exclusiveContext ) {
             animator.setExclusiveContext(awtEDT);
         }
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter), glCanvas).addTo(glCanvas);
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glCanvas).addTo(frame);
 
-        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(glCanvas);
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+        final com.jogamp.newt.event.KeyListener kl = new com.jogamp.newt.event.KeyAdapter() {
+            @Override
+            public void keyPressed(final KeyEvent e) {
+                if( e.isAutoRepeat() ) {
+                    return;
+                }
+                if(e.getKeyChar()=='x') {
+                    final int[] hadSurfacePixelScale = glCanvas.getCurrentSurfaceScale(new int[2]);
+                    final int[] reqSurfacePixelScale;
+                    if( hadSurfacePixelScale[0] == ScalableSurface.IDENTITY_PIXELSCALE ) {
+                        reqSurfacePixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
+                    } else {
+                        reqSurfacePixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+                    }
+                    System.err.println("[set PixelScale pre]: had "+hadSurfacePixelScale[0]+"x"+hadSurfacePixelScale[1]+" -> req "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]);
+                    glCanvas.setSurfaceScale(reqSurfacePixelScale);
+                    final int[] valReqSurfacePixelScale = glCanvas.getRequestedSurfaceScale(new int[2]);
+                    final int[] hasSurfacePixelScale0 = glCanvas.getNativeSurface().convertToPixelUnits(new int[] { 1, 1 });
+                    final int[] hasSurfacePixelScale1 = glCanvas.getCurrentSurfaceScale(new int[2]);
+                    System.err.println("[set PixelScale post]: "+hadSurfacePixelScale[0]+"x"+hadSurfacePixelScale[1]+" (had) -> "+
+                                       reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
+                                       valReqSurfacePixelScale[0]+"x"+valReqSurfacePixelScale[1]+" (val) -> "+
+                                       hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
+                    setTitle(frame, glCanvas, caps);
+                    Assert.assertArrayEquals(hasSurfacePixelScale0, hasSurfacePixelScale1);
+                }
+            } };
+        new AWTKeyAdapter(kl, glCanvas).addTo(glCanvas);
 
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                if( ResizeBy.Frame == resizeBy ) {
                    frame.validate();
                } else {
-                   frame.pack();                   
-               }                
+                   frame.pack();
+               }
                frame.setVisible(true);
-            }});        
+            }});
         Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, true));
-        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glCanvas, true)); 
-        
+        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glCanvas, true));
+
+        final int[] hasSurfacePixelScale0 = glCanvas.getNativeSurface().convertToPixelUnits(new int[] { 1, 1 });
+        final int[] hasSurfacePixelScale1 = glCanvas.getCurrentSurfaceScale(new int[2]);
+        System.err.println("HiDPI PixelScale: "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
+                           valReqSurfacePixelScale[0]+"x"+valReqSurfacePixelScale[1]+" (val) -> "+
+                           hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
+        setTitle(frame, glCanvas, caps);
+        Assert.assertArrayEquals(hasSurfacePixelScale0, hasSurfacePixelScale1);
+
         if( useAnimator ) {
             animator.start();
             Assert.assertTrue(animator.isStarted());
@@ -236,19 +303,19 @@ public class TestGearsES2AWT extends UITestCase {
             Assert.assertEquals(exclusiveContext ? awtEDT : null, glCanvas.getExclusiveContextThread());
             animator.setUpdateFPSFrames(60, System.err);
         }
-        
-        System.err.println("canvas pos/siz: "+glCanvas.getX()+"/"+glCanvas.getY()+" "+glCanvas.getWidth()+"x"+glCanvas.getHeight());
+
+        System.err.println("canvas pos/siz: "+glCanvas.getX()+"/"+glCanvas.getY()+" "+glCanvas.getSurfaceWidth()+"x"+glCanvas.getSurfaceHeight());
 
         snap.setMakeSnapshot();
-        
+
         if( null != rwsize ) {
-            Thread.sleep(500); // 500ms delay 
+            Thread.sleep(500); // 500ms delay
             setSize(resizeBy, frame, true, glCanvas, rwsize);
-            System.err.println("window resize pos/siz: "+glCanvas.getX()+"/"+glCanvas.getY()+" "+glCanvas.getWidth()+"x"+glCanvas.getHeight());
+            System.err.println("window resize pos/siz: "+glCanvas.getX()+"/"+glCanvas.getY()+" "+glCanvas.getSurfaceWidth()+"x"+glCanvas.getSurfaceHeight());
         }
-        
+
         snap.setMakeSnapshot();
-        
+
         final long t0 = System.currentTimeMillis();
         long t1 = t0;
         while(!quitAdapter.shouldQuit() && t1 - t0 < duration) {
@@ -258,7 +325,7 @@ public class TestGearsES2AWT extends UITestCase {
 
         Assert.assertNotNull(frame);
         Assert.assertNotNull(glCanvas);
-        
+
         if( useAnimator ) {
             Assert.assertNotNull(animator);
             Assert.assertEquals(exclusiveContext ? awtEDT : null, glCanvas.getExclusiveContextThread());
@@ -316,8 +383,8 @@ public class TestGearsES2AWT extends UITestCase {
 
     @Test
     public void test02_GLES2() throws InterruptedException, InvocationTargetException {
-        if(mainRun) return;
-        
+        if(manualTest) return;
+
         if( !GLProfile.isAvailable(GLProfile.GLES2) ) {
             System.err.println("GLES2 n/a");
             return;
@@ -326,11 +393,11 @@ public class TestGearsES2AWT extends UITestCase {
         final GLCapabilities caps = new GLCapabilities( glp );
         runTestGL(caps, resizeBy, frameLayout);
     }
-    
+
     @Test
     public void test03_GL3() throws InterruptedException, InvocationTargetException {
-        if(mainRun) return;
-        
+        if(manualTest) return;
+
         if( !GLProfile.isAvailable(GLProfile.GL3) ) {
             System.err.println("GL3 n/a");
             return;
@@ -339,22 +406,49 @@ public class TestGearsES2AWT extends UITestCase {
         final GLCapabilities caps = new GLCapabilities( glp );
         runTestGL(caps, resizeBy, frameLayout);
     }
-    
-    public static void main(String args[]) {
+
+    @Test
+    public void test99_PixelScale1_DefaultNorm() throws InterruptedException, InvocationTargetException {
+        if( manualTest ) return;
+
+        reqSurfacePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+        reqSurfacePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
+
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
+        runTestGL(caps, resizeBy, frameLayout);
+    }
+
+    public static void main(final String args[]) {
         boolean waitForKey = false;
         int rw=-1, rh=-1;
-        
-        mainRun = true;
+
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 duration = MiscUtils.atol(args[i], duration);
+            } else if(args[i].equals("-width")) {
+                i++;
+                width = MiscUtils.atoi(args[i], width);
+            } else if(args[i].equals("-height")) {
+                i++;
+                height = MiscUtils.atoi(args[i], height);
+            } else if(args[i].equals("-x")) {
+                i++;
+                xpos = MiscUtils.atoi(args[i], xpos);
+            } else if(args[i].equals("-y")) {
+                i++;
+                ypos = MiscUtils.atoi(args[i], ypos);
             } else if(args[i].equals("-rwidth")) {
                 i++;
                 rw = MiscUtils.atoi(args[i], rw);
             } else if(args[i].equals("-rheight")) {
                 i++;
                 rh = MiscUtils.atoi(args[i], rh);
+            } else if(args[i].equals("-pixelScale")) {
+                i++;
+                final int pS = MiscUtils.atoi(args[i], reqSurfacePixelScale[0]);
+                reqSurfacePixelScale[0] = pS;
+                reqSurfacePixelScale[1] = pS;
             } else if(args[i].equals("-layout")) {
                 i++;
                 frameLayout = FrameLayout.valueOf(args[i]);
@@ -391,12 +485,14 @@ public class TestGearsES2AWT extends UITestCase {
                 shutdownDisposeFrame = false;
             } else if(args[i].equals("-shutdownSystemExit")) {
                 shutdownSystemExit = true;
+            } else if(args[i].equals("-manual")) {
+                manualTest = true;
             }
         }
         if( 0 < rw && 0 < rh ) {
             rwsize = new Dimension(rw, rh);
         }
-        
+
         System.err.println("resize "+rwsize);
         System.err.println("frameLayout "+frameLayout);
         System.err.println("resizeBy "+resizeBy);
@@ -406,16 +502,16 @@ public class TestGearsES2AWT extends UITestCase {
         System.err.println("exclusiveContext "+exclusiveContext);
         System.err.println("useMSAA "+useMSAA);
         System.err.println("useAnimator "+useAnimator);
-        
+
         System.err.println("shallUseOffscreenFBOLayer     "+shallUseOffscreenFBOLayer);
         System.err.println("shallUseOffscreenPBufferLayer "+shallUseOffscreenPBufferLayer);
-        
+
         if(waitForKey) {
-            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+            final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
             System.err.println("Press enter to continue");
             try {
                 System.err.println(stdin.readLine());
-            } catch (IOException e) { }
+            } catch (final IOException e) { }
         }
         org.junit.runner.JUnitCore.main(TestGearsES2AWT.class.getName());
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java
index 46e39be..dd16b88 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelAWT.java
@@ -31,9 +31,13 @@ package com.jogamp.opengl.test.junit.jogl.demos.es2.awt;
 import java.awt.AWTException;
 import java.awt.BorderLayout;
 import java.awt.Dimension;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
 import java.lang.reflect.InvocationTargetException;
 
+import javax.media.nativewindow.ScalableSurface;
 import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLCapabilitiesImmutable;
 import javax.media.opengl.GLProfile;
 import javax.media.opengl.awt.GLJPanel;
 import javax.swing.JFrame;
@@ -47,12 +51,14 @@ import org.junit.Test;
 import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
+import com.jogamp.newt.event.KeyEvent;
 import com.jogamp.newt.event.TraceKeyAdapter;
 import com.jogamp.newt.event.TraceWindowAdapter;
 import com.jogamp.newt.event.awt.AWTKeyAdapter;
 import com.jogamp.newt.event.awt.AWTWindowAdapter;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
 import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears;
+import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
 import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
 import com.jogamp.opengl.test.junit.util.UITestCase;
@@ -71,6 +77,8 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
     static boolean useAnimator = true;
     static boolean manualTest = false;
     static boolean skipGLOrientationVerticalFlip = false;
+    static int xpos = 10, ypos = 10;
+    static int[] reqSurfacePixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
 
     @BeforeClass
     public static void initClass() {
@@ -92,13 +100,19 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
                         frame.validate();
                     }
                 } } );
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
     }
 
-    protected void runTestGL(GLCapabilities caps)
+    private void setTitle(final JFrame frame, final GLJPanel glc, final GLCapabilitiesImmutable caps) {
+        final String capsA = caps.isBackgroundOpaque() ? "opaque" : "transl";
+        final java.awt.Rectangle b = glc.getBounds();
+        frame.setTitle("GLJPanel["+capsA+"], swapI "+swapInterval+", win: ["+b.x+"/"+b.y+" "+b.width+"x"+b.height+"], pix: "+glc.getSurfaceWidth()+"x"+glc.getSurfaceHeight());
+    }
+
+    protected void runTestGL(final GLCapabilities caps)
             throws AWTException, InterruptedException, InvocationTargetException
     {
         final JFrame frame = new JFrame("Swing GLJPanel");
@@ -110,6 +124,8 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
         glJPanel.setMinimumSize(wsize);
         glJPanel.setPreferredSize(wsize);
         glJPanel.setSize(wsize);
+        glJPanel.setSurfaceScale(reqSurfacePixelScale);
+        final int[] valReqSurfacePixelScale = glJPanel.getRequestedSurfaceScale(new int[2]);
         if( caps.isBitmap() || caps.getGLProfile().isGL2() ) {
             final Gears gears = new Gears(swapInterval);
             gears.setFlipVerticalInGLOrientation(skipGLOrientationVerticalFlip);
@@ -121,6 +137,26 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
         }
         final SnapshotGLEventListener snap = new SnapshotGLEventListener();
         glJPanel.addGLEventListener(snap);
+        setTitle(frame, glJPanel, caps);
+        frame.setLocation(xpos, ypos);
+
+        frame.addComponentListener(new ComponentListener() {
+            @Override
+            public void componentResized(final ComponentEvent e) {
+                setTitle(frame, glJPanel, caps);
+            }
+
+            @Override
+            public void componentMoved(final ComponentEvent e) {
+                setTitle(frame, glJPanel, caps);
+            }
+
+            @Override
+            public void componentShown(final ComponentEvent e) { }
+
+            @Override
+            public void componentHidden(final ComponentEvent e) { }
+        });
 
         final FPSAnimator animator = useAnimator ? new FPSAnimator(glJPanel, 60) : null;
 
@@ -131,6 +167,16 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
                     frame.pack();
                     frame.setVisible(true);
                 } } ) ;
+        Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, true));
+        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glJPanel, true));
+
+        final int[] hasSurfacePixelScale0 = glJPanel.getNativeSurface().convertToPixelUnits(new int[] { 1, 1 });
+        final int[] hasSurfacePixelScale1 = glJPanel.getCurrentSurfaceScale(new int[2]);
+        System.err.println("HiDPI PixelScale: "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
+                           valReqSurfacePixelScale[0]+"x"+valReqSurfacePixelScale[1]+" (val) -> "+
+                           hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
+        setTitle(frame, glJPanel, caps);
+        Assert.assertArrayEquals(hasSurfacePixelScale0, hasSurfacePixelScale1);
 
         if( useAnimator ) {
             animator.setUpdateFPSFrames(60, System.err);
@@ -138,17 +184,45 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
             Assert.assertEquals(true, animator.isAnimating());
         }
 
-        QuitAdapter quitAdapter = new QuitAdapter();
-
-        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(glJPanel);
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter), glJPanel).addTo(glJPanel);
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glJPanel).addTo(frame);
+
+        final com.jogamp.newt.event.KeyListener kl = new com.jogamp.newt.event.KeyAdapter() {
+            @Override
+            public void keyPressed(final KeyEvent e) {
+                if( e.isAutoRepeat() ) {
+                    return;
+                }
+                if(e.getKeyChar()=='x') {
+                    final int[] hadSurfacePixelScale = glJPanel.getCurrentSurfaceScale(new int[2]);
+                    final int[] reqSurfacePixelScale;
+                    if( hadSurfacePixelScale[0] == ScalableSurface.IDENTITY_PIXELSCALE ) {
+                        reqSurfacePixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
+                    } else {
+                        reqSurfacePixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+                    }
+                    System.err.println("[set PixelScale pre]: had "+hadSurfacePixelScale[0]+"x"+hadSurfacePixelScale[1]+" -> req "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]);
+                    glJPanel.setSurfaceScale(reqSurfacePixelScale);
+                    final int[] valReqSurfacePixelScale = glJPanel.getRequestedSurfaceScale(new int[2]);
+                    final int[] hasSurfacePixelScale0 = glJPanel.getNativeSurface().convertToPixelUnits(new int[] { 1, 1 });
+                    final int[] hasSurfacePixelScale1 = glJPanel.getCurrentSurfaceScale(new int[2]);
+                    System.err.println("[set PixelScale post]: "+hadSurfacePixelScale[0]+"x"+hadSurfacePixelScale[1]+" (had) -> "+
+                                       reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
+                                       valReqSurfacePixelScale[0]+"x"+valReqSurfacePixelScale[1]+" (val) -> "+
+                                       hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
+                    setTitle(frame, glJPanel, caps);
+                    Assert.assertArrayEquals(hasSurfacePixelScale0, hasSurfacePixelScale1);
+                }
+            } };
+        new AWTKeyAdapter(kl, glJPanel).addTo(glJPanel);
 
         snap.setMakeSnapshot();
 
         if( null != rwsize ) {
             Thread.sleep(500); // 500ms delay
             setFrameSize(frame, true, rwsize);
-            System.err.println("window resize pos/siz: "+glJPanel.getX()+"/"+glJPanel.getY()+" "+glJPanel.getWidth()+"x"+glJPanel.getHeight());
+            System.err.println("window resize pos/siz: "+glJPanel.getX()+"/"+glJPanel.getY()+" "+glJPanel.getSurfaceWidth()+"x"+glJPanel.getSurfaceHeight());
         }
 
         snap.setMakeSnapshot();
@@ -169,11 +243,13 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
 
         Assert.assertNotNull(frame);
         Assert.assertNotNull(glJPanel);
-        Assert.assertNotNull(animator);
 
         if( useAnimator ) {
+            Assert.assertNotNull(animator);
             animator.stop();
             Assert.assertEquals(false, animator.isAnimating());
+        } else {
+            Assert.assertNull(animator);
         }
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
@@ -199,7 +275,7 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
         } else {
             glp = GLProfile.getGL2ES2();
         }
-        GLCapabilities caps = new GLCapabilities( glp );
+        final GLCapabilities caps = new GLCapabilities( glp );
         if(useMSAA) {
             caps.setNumSamples(4);
             caps.setSampleBuffers(true);
@@ -220,7 +296,7 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
         if( manualTest ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         caps.setNumSamples(4);
         caps.setSampleBuffers(true);
         runTestGL(caps);
@@ -233,7 +309,7 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
         if( manualTest ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         caps.setPBuffer(true);
         runTestGL(caps);
     }
@@ -245,7 +321,7 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
         if( manualTest ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         caps.setNumSamples(4);
         caps.setSampleBuffers(true);
         caps.setPBuffer(true);
@@ -259,7 +335,7 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
         if( manualTest ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         caps.setBitmap(true);
         runTestGL(caps);
     }
@@ -271,7 +347,7 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
         if( manualTest ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         caps.setNumSamples(4);
         caps.setSampleBuffers(true);
         caps.setBitmap(true);
@@ -312,9 +388,23 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
         runTestGL(caps);
     }
 
+    @Test
+    public void test99_PixelScale1_DefaultNorm()
+            throws AWTException, InterruptedException, InvocationTargetException
+    {
+        if( manualTest ) {
+            return;
+        }
+        reqSurfacePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+        reqSurfacePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
+
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        runTestGL(caps);
+    }
+
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         int w=640, h=480, rw=-1, rh=-1;
 
         for(int i=0; i<args.length; i++) {
@@ -333,12 +423,23 @@ public class TestGearsES2GLJPanelAWT extends UITestCase {
             } else if(args[i].equals("-height")) {
                 i++;
                 h = MiscUtils.atoi(args[i], h);
+            } else if(args[i].equals("-x")) {
+                i++;
+                xpos = MiscUtils.atoi(args[i], xpos);
+            } else if(args[i].equals("-y")) {
+                i++;
+                ypos = MiscUtils.atoi(args[i], ypos);
             } else if(args[i].equals("-rwidth")) {
                 i++;
                 rw = MiscUtils.atoi(args[i], rw);
             } else if(args[i].equals("-rheight")) {
                 i++;
                 rh = MiscUtils.atoi(args[i], rh);
+            } else if(args[i].equals("-pixelScale")) {
+                i++;
+                final int pS = MiscUtils.atoi(args[i], reqSurfacePixelScale[0]);
+                reqSurfacePixelScale[0] = pS;
+                reqSurfacePixelScale[1] = pS;
             } else if(args[i].equals("-userVFlip")) {
                 skipGLOrientationVerticalFlip = true;
             } else if(args[i].equals("-vsync")) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelsAWT.java
index e48fc78..11d9da7 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelsAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/awt/TestGearsES2GLJPanelsAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.es2.awt;
 
 import java.awt.AWTException;
@@ -69,7 +69,7 @@ import com.jogamp.opengl.util.awt.AWTGLPixelBuffer.SingleAWTGLPixelBufferProvide
 public class TestGearsES2GLJPanelsAWT extends UITestCase {
     static int demoCount = 4;
     static boolean jOpaque = false; // flicker-less w/o opaque, opaque leads to overdraw w/ mixed clipRects -> flicker - due to JComponent _paintImmediately(..) (?)
-    static boolean glOpaque = true; // can be either .. 
+    static boolean glOpaque = true; // can be either ..
     static float glAlpha = 0.3f;
     static boolean jZOrder = false;
     static GLProfile glp;
@@ -81,13 +81,13 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
     static boolean manualTest = false;
     static boolean initSingleBuffer = false;
 
-    /** 
-     * Even though GLJPanel uses a SingleAWTGLPixelBufferProvider per default, 
-     * we like to initialize it's size to a common maximum to ensure 
+    /**
+     * Even though GLJPanel uses a SingleAWTGLPixelBufferProvider per default,
+     * we like to initialize it's size to a common maximum to ensure
      * only one {@link AWTGLPixelBuffer} gets allocated.
      */
     static SingleAWTGLPixelBufferProvider singleAWTGLPixelBufferProvider;
-    
+
     @BeforeClass
     public static void initClass() {
         if(GLProfile.isAvailable(GLProfile.GL2)) {
@@ -96,7 +96,7 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
         } else {
             setTestSupported(false);
         }
-        
+
         if( initSingleBuffer ) {
             singleAWTGLPixelBufferProvider = new SingleAWTGLPixelBufferProvider( glp.isGL2ES3() /* allowRowStride */);
             singleAWTGLPixelBufferProvider.initSingleton(4, 600, 600, 1, true);
@@ -108,12 +108,12 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
     @AfterClass
     public static void releaseClass() {
     }
-    
+
     final static boolean useInterPanel = true;
-    
+
     /** Adds new JPanel to frame's content pane at index 0 */
-    private JComponent addPanel(GLCapabilitiesImmutable caps, GLAnimatorControl anim, final JFrame frame, boolean opaque, int x, int y, int w, int h, FloatBuffer color, float[] clearColor) 
-            throws InterruptedException, InvocationTargetException 
+    private JComponent addPanel(final GLCapabilitiesImmutable caps, final GLAnimatorControl anim, final JFrame frame, final boolean opaque, final int x, final int y, final int w, final int h, final FloatBuffer color, final float[] clearColor)
+            throws InterruptedException, InvocationTargetException
     {
         final GLJPanel canvas = new GLJPanel(caps);
         if( initSingleBuffer ) {
@@ -127,7 +127,7 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
         if( caps.isBitmap() ) {
             demo = new Gears(swapInterval);
         } else {
-            GearsES2 gdemo = new GearsES2(swapInterval);
+            final GearsES2 gdemo = new GearsES2(swapInterval);
             gdemo.setIgnoreFocus(true);
             gdemo.setGearsColors(color, color, color);
             gdemo.setClearColor(clearColor);
@@ -145,12 +145,12 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
             panel.setBounds(x, y, w, h);
             panel.setOpaque(opaque);
             text = new JTextField(x+"/"+y+" "+w+"x"+h);
-            text.setOpaque(true);    
+            text.setOpaque(true);
         } else {
             panel = null;
             text = null;
         }
-        
+
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     if ( useInterPanel ) {
@@ -164,7 +164,7 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
         return useInterPanel ? panel : canvas;
     }
 
-    public static final FloatBuffer red =    Buffers.newDirectFloatBuffer( new float[] { 1.0f, 0.0f, 0.0f, 1.0f } );    
+    public static final FloatBuffer red =    Buffers.newDirectFloatBuffer( new float[] { 1.0f, 0.0f, 0.0f, 1.0f } );
     public static final FloatBuffer green =  Buffers.newDirectFloatBuffer( new float[] { 0.0f, 1.0f, 0.0f, 1.0f } );
     public static final FloatBuffer blue =   Buffers.newDirectFloatBuffer( new float[] { 0.0f, 0.0f, 1.0f, 1.0f } );
     public static final FloatBuffer yellow = Buffers.newDirectFloatBuffer( new float[] { 1.0f, 1.0f, 0.0f, 1.0f } );
@@ -175,43 +175,43 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
     public static final float[] blueish   = new float[] { 0.0f,  0.0f,  grayf, glAlpha };
     public static final float[] yellowish = new float[] { grayf, grayf, 0.0f,  glAlpha };
     public static final float[] greyish   = new float[] { grayf, grayf, grayf,  glAlpha };
-    
-    protected void relayout(Container cont, float oW, float oH) {
+
+    protected void relayout(final Container cont, final float oW, final float oH) {
         final int count = cont.getComponentCount();
         final int nW = cont.getWidth();
         final int nH = cont.getHeight();
         for(int i = 0 ; i < count; i++ ) {
             final Component comp = cont.getComponent(i);
-            float fx = comp.getX() / oW;
-            float fy = comp.getY() / oH;
-            float fw = comp.getWidth() / oW;
-            float fh = comp.getHeight() / oH;
+            final float fx = comp.getX() / oW;
+            final float fy = comp.getY() / oH;
+            final float fw = comp.getWidth() / oW;
+            final float fh = comp.getHeight() / oH;
             comp.setBounds( (int)(fx * nW), (int)(fy * nH), (int)(fw * nW), (int)(fh * nH) );
         }
     }
-    
-    protected void runTestGL(GLCapabilities caps)
+
+    protected void runTestGL(final GLCapabilities caps)
             throws AWTException, InterruptedException, InvocationTargetException
     {
         if( !glOpaque ) {
             caps.setAlphaBits(caps.getRedBits());
         }
-        
+
         final JFrame frame = new JFrame("Swing GLJPanel");
         Assert.assertNotNull(frame);
-        
+
         final FPSAnimator animator = useAnimator ? new FPSAnimator(60) : null;
 
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame.getContentPane().setLayout(null);
                 } } );
-        
+
         final float[] oldSize = new float[] { 600f, 600f };
-        
+
         frame.addComponentListener(new ComponentAdapter() {
             @Override
-            public void componentResized(ComponentEvent e) {
+            public void componentResized(final ComponentEvent e) {
                 final int count = frame.getComponentCount();
                 for(int i = 0 ; i < count; i++ ) {
                     relayout(frame.getContentPane(), oldSize[0], oldSize[1]);
@@ -243,7 +243,7 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
                 cont.setComponentZOrder(cont.getComponent(i), count - 1 - i);
             }
         }
-          
+
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame.setSize((int)oldSize[0], (int)oldSize[1]);
@@ -258,7 +258,7 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
             Assert.assertEquals(true, animator.isAnimating());
         }
 
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
 
         final long t0 = System.currentTimeMillis();
         long t1 = t0;
@@ -287,7 +287,7 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
     public void test01_DefaultNorm()
             throws AWTException, InterruptedException, InvocationTargetException
     {
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         if(useMSAA) {
             caps.setNumSamples(4);
             caps.setSampleBuffers(true);
@@ -308,12 +308,12 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
         if( manualTest ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         caps.setNumSamples(4);
         caps.setSampleBuffers(true);
         runTestGL(caps);
     }
-    
+
     @Test
     public void test03_PbufferNorm()
             throws AWTException, InterruptedException, InvocationTargetException
@@ -321,11 +321,11 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
         if( manualTest ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         caps.setPBuffer(true);
         runTestGL(caps);
     }
-    
+
     @Test
     public void test04_PbufferMsaa()
             throws AWTException, InterruptedException, InvocationTargetException
@@ -333,13 +333,13 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
         if( manualTest ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         caps.setNumSamples(4);
         caps.setSampleBuffers(true);
         caps.setPBuffer(true);
         runTestGL(caps);
     }
-    
+
     @Test
     public void test05_BitmapNorm()
             throws AWTException, InterruptedException, InvocationTargetException
@@ -347,11 +347,11 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
         if( manualTest ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         caps.setBitmap(true);
         runTestGL(caps);
     }
-    
+
     @Test
     public void test06_BitmapMsaa()
             throws AWTException, InterruptedException, InvocationTargetException
@@ -359,16 +359,16 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
         if( manualTest ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         caps.setNumSamples(4);
         caps.setSampleBuffers(true);
         caps.setBitmap(true);
         runTestGL(caps);
     }
-    
+
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
@@ -415,8 +415,8 @@ public class TestGearsES2GLJPanelsAWT extends UITestCase {
         System.err.println("shallUsePBuffer "+shallUsePBuffer);
         System.err.println("shallUseBitmap "+shallUseBitmap);
         System.err.println("manualTest "+manualTest);
-        System.err.println("useSingleBuffer "+initSingleBuffer);        
-        
+        System.err.println("useSingleBuffer "+initSingleBuffer);
+
         org.junit.runner.JUnitCore.main(TestGearsES2GLJPanelsAWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestElektronenMultipliziererNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestElektronenMultipliziererNEWT.java
index 6c48853..2d334e8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestElektronenMultipliziererNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestElektronenMultipliziererNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.es2.newt;
 
 import com.jogamp.newt.event.KeyAdapter;
@@ -66,17 +66,17 @@ public class TestElektronenMultipliziererNEWT extends UITestCase {
     static final int desiredFrameRate = 30;
     static int startFrame = 1700;
     static long duration = 5000; // ms
-    
+
     @BeforeClass
     public static void initClass() {
-        GLProfile glp = GLProfile.getDefault();
+        final GLProfile glp = GLProfile.getDefault();
         if( ! ( glp.isHardwareRasterizer() && glp.isGL2ES3() ) ) {
             // Sorry .. mobile ES2 is too slow for this one.
             setTestSupported(false);
             return;
         }
     }
-    
+
     protected void run() throws InterruptedException {
         final ElektronenMultiplizierer demo = new ElektronenMultiplizierer(
                 tRoutineClassName,
@@ -85,17 +85,17 @@ public class TestElektronenMultipliziererNEWT extends UITestCase {
                 tFrameCapture,
                 tFrameSkip, desiredFrameRate, startFrame
         );
-        GLCapabilitiesImmutable caps = demo.getGLCapabilities();
-        
-        GLWindow glWindow = GLWindow.create(caps);
+        final GLCapabilitiesImmutable caps = demo.getGLCapabilities();
+
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setSize(width, height);
         glWindow.setTitle("ElektronenMultiplizierer (GL2ES2/NEWT)");
         glWindow.addGLEventListener(demo);
 
-        Animator animator = new Animator(glWindow);
+        final Animator animator = new Animator(glWindow);
         animator.setUpdateFPSFrames(60, System.err);
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
 
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -104,10 +104,10 @@ public class TestElektronenMultipliziererNEWT extends UITestCase {
 
         final GLWindow f_glWindow = glWindow;
         glWindow.addKeyListener(new KeyAdapter() {
-            public void keyReleased(KeyEvent e) {
+            public void keyReleased(final KeyEvent e) {
                 if( !e.isPrintableKey() || e.isAutoRepeat() ) {
                     return;
-                }            
+                }
                 if(e.getKeyChar()=='f') {
                     new Thread() {
                         public void run() {
@@ -137,19 +137,19 @@ public class TestElektronenMultipliziererNEWT extends UITestCase {
         run();
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
             if(args[i].equals("-sframe")) {
                 i++;
                 try {
                     startFrame = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         org.junit.runner.JUnitCore.main(TestElektronenMultipliziererNEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java
index 5d5b0c9..29c5aac 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NEWT.java
@@ -29,6 +29,7 @@
 package com.jogamp.opengl.test.junit.jogl.demos.es2.newt;
 
 import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
 import java.net.URLConnection;
 
 import com.jogamp.common.util.IOUtil;
@@ -50,10 +51,13 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
 import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
+import com.jogamp.opengl.util.Gamma;
 import com.jogamp.opengl.util.PNGPixelRect;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
 
 import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.nativewindow.ScalableSurface;
 import javax.media.nativewindow.util.Dimension;
 import javax.media.nativewindow.util.Point;
 import javax.media.nativewindow.util.PointImmutable;
@@ -66,6 +70,7 @@ import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLProfile;
 
 import jogamp.newt.DefaultEDTUtil;
+import jogamp.newt.driver.PNGIcon;
 
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -79,6 +84,7 @@ public class TestGearsES2NEWT extends UITestCase {
     static int screenIdx = 0;
     static PointImmutable wpos;
     static DimensionImmutable wsize, rwsize=null;
+    static int[] reqSurfacePixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
 
     static long duration = 500; // ms
     static boolean opaque = true;
@@ -86,7 +92,6 @@ public class TestGearsES2NEWT extends UITestCase {
     static boolean undecorated = false;
     static boolean alwaysOnTop = false;
     static boolean fullscreen = false;
-    static boolean pmvUseBackingArray = true;
     static int swapInterval = 1;
     static boolean waitForKey = false;
     static boolean mouseVisible = true;
@@ -99,7 +104,7 @@ public class TestGearsES2NEWT extends UITestCase {
     static boolean forceES3 = false;
     static boolean forceGL3 = false;
     static boolean forceGL2 = false;
-    static boolean mainRun = false;
+    static boolean manualTest = false;
     static boolean exclusiveContext = false;
     static boolean useAnimator = true;
     static boolean useMappedBuffers = false;
@@ -117,13 +122,21 @@ public class TestGearsES2NEWT extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilitiesImmutable caps, boolean undecorated) throws InterruptedException {
+    private void setTitle(final Window win, final GLCapabilitiesImmutable caps) {
+        final String capsA = caps.isBackgroundOpaque() ? "opaque" : "transl";
+        final float[] sDPI = win.getPixelsPerMM(new float[2]);
+        sDPI[0] *= 25.4f;
+        sDPI[1] *= 25.4f;
+        win.setTitle("GLWindow["+capsA+"], swapI "+swapInterval+", win: "+win.getBounds()+", pix: "+win.getSurfaceWidth()+"x"+win.getSurfaceHeight()+", sDPI "+sDPI[0]+" x "+sDPI[1]);
+    }
+    protected void runTestGL(final GLCapabilitiesImmutable caps, final boolean undecorated) throws InterruptedException {
         System.err.println("requested: vsync "+swapInterval+", "+caps);
-        Display dpy = NewtFactory.createDisplay(null);
-        Screen screen = NewtFactory.createScreen(dpy, screenIdx);
+        final Display dpy = NewtFactory.createDisplay(null);
+        final Screen screen = NewtFactory.createScreen(dpy, screenIdx);
         final GLWindow glWindow = GLWindow.create(screen, caps);
         Assert.assertNotNull(glWindow);
-        glWindow.setTitle("Gears NEWT Test (translucent "+!caps.isBackgroundOpaque()+"), swapInterval "+swapInterval+", size "+wsize+", pos "+wpos);
+        glWindow.setSurfaceScale(reqSurfacePixelScale);
+        final int[] valReqSurfacePixelScale = glWindow.getRequestedSurfaceScale(new int[2]);
         glWindow.setSize(wsize.getWidth(), wsize.getHeight());
         if(null != wpos) {
             glWindow.setPosition(wpos.getX(), wpos.getY());
@@ -135,7 +148,6 @@ public class TestGearsES2NEWT extends UITestCase {
         glWindow.confinePointer(mouseConfined);
 
         final GearsES2 demo = new GearsES2(swapInterval);
-        demo.setPMVUseBackingArray(pmvUseBackingArray);
         demo.setUseMappedBuffers(useMappedBuffers);
         demo.setValidateBuffers(true);
         glWindow.addGLEventListener(demo);
@@ -144,24 +156,24 @@ public class TestGearsES2NEWT extends UITestCase {
         glWindow.addGLEventListener(snap);
         if(waitForKey) {
             glWindow.addGLEventListener(new GLEventListener() {
-                public void init(GLAutoDrawable drawable) { }
-                public void dispose(GLAutoDrawable drawable) { }
-                public void display(GLAutoDrawable drawable) {
-                    GLAnimatorControl  actrl = drawable.getAnimator();
+                public void init(final GLAutoDrawable drawable) { }
+                public void dispose(final GLAutoDrawable drawable) { }
+                public void display(final GLAutoDrawable drawable) {
+                    final GLAnimatorControl  actrl = drawable.getAnimator();
                     if(waitForKey && actrl.getTotalFPSFrames() == 60*3) {
                         UITestCase.waitForKey("3s mark");
                         actrl.resetFPSCounter();
                         waitForKey = false;
                     }
                 }
-                public void reshape(GLAutoDrawable drawable, int x, int y,
-                        int width, int height) { }
+                public void reshape(final GLAutoDrawable drawable, final int x, final int y,
+                        final int width, final int height) { }
             });
         }
 
         final Animator animator = useAnimator ? new Animator() : null;
         if( useAnimator ) {
-            animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+            animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
             animator.setExclusiveContext(exclusiveContext);
         }
 
@@ -172,11 +184,13 @@ public class TestGearsES2NEWT extends UITestCase {
         glWindow.addWindowListener(quitAdapter);
 
         glWindow.addWindowListener(new WindowAdapter() {
-            public void windowResized(WindowEvent e) {
-                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
+            public void windowResized(final WindowEvent e) {
+                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
+                setTitle(glWindow, caps);
             }
-            public void windowMoved(WindowEvent e) {
-                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
+            public void windowMoved(final WindowEvent e) {
+                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
+                setTitle(glWindow, caps);
             }
         });
 
@@ -190,7 +204,7 @@ public class TestGearsES2NEWT extends UITestCase {
                 try {
                     _pointerIcon = disp.createPointerIcon(res, 8, 8);
                     System.err.println("Create PointerIcon #01: "+_pointerIcon);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     e.printStackTrace();
                 }
                 pointerIcons[0] = _pointerIcon;
@@ -201,12 +215,12 @@ public class TestGearsES2NEWT extends UITestCase {
                 try {
                     _pointerIcon = disp.createPointerIcon(res, 0, 0);
                     System.err.println("Create PointerIcon #02: "+_pointerIcon);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     e.printStackTrace();
                 }
                 pointerIcons[1] = _pointerIcon;
             }
-            {
+            if( PNGIcon.isAvailable() ) {
                 PointerIcon _pointerIcon = null;
                 final IOUtil.ClassResources res = new IOUtil.ClassResources(glWindow.getClass(), new String[] { "jogamp-pointer-64x64.png" } );
                 try {
@@ -215,7 +229,7 @@ public class TestGearsES2NEWT extends UITestCase {
                     System.err.println("Create PointerIcon #03: "+image);
                     _pointerIcon = disp.createPointerIcon(image, 32, 0);
                     System.err.println("Create PointerIcon #03: "+_pointerIcon);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     e.printStackTrace();
                 }
                 pointerIcons[2] = _pointerIcon;
@@ -228,6 +242,9 @@ public class TestGearsES2NEWT extends UITestCase {
 
         glWindow.addKeyListener(new KeyAdapter() {
             int pointerIconIdx = 0;
+            float gamma = 1f;
+            float brightness = 0f;
+            float contrast = 1f;
 
             @Override
             public void keyPressed(final KeyEvent e) {
@@ -238,7 +255,7 @@ public class TestGearsES2NEWT extends UITestCase {
                     new Thread() {
                         public void run() {
                             final Thread t = glWindow.setExclusiveContextThread(null);
-                            System.err.println("[set fullscreen  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+                            System.err.println("[set fullscreen  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
                             if( glWindow.isFullscreen() ) {
                                 glWindow.setFullscreen( false );
                             } else {
@@ -248,16 +265,25 @@ public class TestGearsES2NEWT extends UITestCase {
                                     glWindow.setFullscreen( true );
                                 }
                             }
-                            System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+                            System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
                             glWindow.setExclusiveContextThread(t);
                     } }.start();
+                } else if( e.getKeySymbol()== KeyEvent.VK_G ) {
+                    new Thread() {
+                        public void run() {
+                            final float newGamma = gamma + ( e.isShiftDown() ? -0.1f : 0.1f );
+                            System.err.println("[set gamma]: "+gamma+" -> "+newGamma);
+                            if( Gamma.setDisplayGamma(glWindow, newGamma, brightness, contrast) ) {
+                                gamma = newGamma;
+                            }
+                    } }.start();
                 } else if(e.getKeyChar()=='a') {
                     new Thread() {
                         public void run() {
                             final Thread t = glWindow.setExclusiveContextThread(null);
-                            System.err.println("[set alwaysontop pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+                            System.err.println("[set alwaysontop pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
                             glWindow.setAlwaysOnTop(!glWindow.isAlwaysOnTop());
-                            System.err.println("[set alwaysontop post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+                            System.err.println("[set alwaysontop post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
                             glWindow.setExclusiveContextThread(t);
                     } }.start();
                 } else if(e.getKeyChar()=='d') {
@@ -265,18 +291,18 @@ public class TestGearsES2NEWT extends UITestCase {
                         public void run() {
                             final Thread t = glWindow.setExclusiveContextThread(null);
                             // while( null != glWindow.getExclusiveContextThread() ) ;
-                            System.err.println("[set undecorated  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", d "+glWindow.isUndecorated()+", "+glWindow.getInsets());
+                            System.err.println("[set undecorated  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", d "+glWindow.isUndecorated()+", "+glWindow.getInsets());
                             glWindow.setUndecorated(!glWindow.isUndecorated());
-                            System.err.println("[set undecorated post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", d "+glWindow.isUndecorated()+", "+glWindow.getInsets());
+                            System.err.println("[set undecorated post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", d "+glWindow.isUndecorated()+", "+glWindow.getInsets());
                             glWindow.setExclusiveContextThread(t);
                     } }.start();
                 } else if(e.getKeyChar()=='s') {
                     new Thread() {
                         public void run() {
                             final Thread t = glWindow.setExclusiveContextThread(null);
-                            System.err.println("[set position  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
+                            System.err.println("[set position  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
                             glWindow.setPosition(100, 100);
-                            System.err.println("[set position post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
+                            System.err.println("[set position post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
                             glWindow.setExclusiveContextThread(t);
                     } }.start();
                 } else if(e.getKeyChar()=='c') {
@@ -332,15 +358,34 @@ public class TestGearsES2NEWT extends UITestCase {
                         public void run() {
                             final Thread t = glWindow.setExclusiveContextThread(null);
                             System.err.println("[set mouse pos pre]");
-                            glWindow.warpPointer(glWindow.getWidth()/2, glWindow.getHeight()/2);
+                            glWindow.warpPointer(glWindow.getSurfaceWidth()/2, glWindow.getSurfaceHeight()/2);
                             System.err.println("[set mouse pos post]");
                             glWindow.setExclusiveContextThread(t);
                     } }.start();
+                } else if(e.getKeyChar()=='x') {
+                    final int[] hadSurfacePixelScale = glWindow.getCurrentSurfaceScale(new int[2]);
+                    final int[] reqSurfacePixelScale;
+                    if( hadSurfacePixelScale[0] == ScalableSurface.IDENTITY_PIXELSCALE ) {
+                        reqSurfacePixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
+                    } else {
+                        reqSurfacePixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+                    }
+                    System.err.println("[set PixelScale pre]: had "+hadSurfacePixelScale[0]+"x"+hadSurfacePixelScale[1]+" -> req "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]);
+                    glWindow.setSurfaceScale(reqSurfacePixelScale);
+                    final int[] valReqSurfacePixelScale = glWindow.getRequestedSurfaceScale(new int[2]);
+                    final int[] hasSurfacePixelScale0 = glWindow.convertToPixelUnits(new int[] { 1, 1 });
+                    final int[] hasSurfacePixelScale1 = glWindow.getCurrentSurfaceScale(new int[2]);
+                    System.err.println("[set PixelScale post]: "+hadSurfacePixelScale[0]+"x"+hadSurfacePixelScale[1]+" (had) -> "+
+                                       reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
+                                       valReqSurfacePixelScale[0]+"x"+valReqSurfacePixelScale[1]+" (val) -> "+
+                                       hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
+                    setTitle(glWindow, caps);
+                    Assert.assertArrayEquals(hasSurfacePixelScale0, hasSurfacePixelScale1);
                 }
             }
         });
         glWindow.addMouseListener(new MouseAdapter() {
-            public void mouseClicked(MouseEvent e) {
+            public void mouseClicked(final MouseEvent e) {
                 if(e.getClickCount() == 2 && e.getPointerCount() == 1) {
                     glWindow.setFullscreen(!glWindow.isFullscreen());
                     System.err.println("setFullscreen: "+glWindow.isFullscreen());
@@ -359,11 +404,11 @@ public class TestGearsES2NEWT extends UITestCase {
         if( SysExit.displayError == sysExit || SysExit.displayExit == sysExit || SysExit.displayEDTError == sysExit ) {
             glWindow.addGLEventListener(new GLEventListener() {
                 @Override
-                public void init(GLAutoDrawable drawable) {}
+                public void init(final GLAutoDrawable drawable) {}
                 @Override
-                public void dispose(GLAutoDrawable drawable) { }
+                public void dispose(final GLAutoDrawable drawable) { }
                 @Override
-                public void display(GLAutoDrawable drawable) {
+                public void display(final GLAutoDrawable drawable) {
                     final GLAnimatorControl anim = drawable.getAnimator();
                     if( null != anim && anim.isAnimating() ) {
                         final long ms = anim.getTotalFPSDuration();
@@ -395,7 +440,7 @@ public class TestGearsES2NEWT extends UITestCase {
                     }
                 }
                 @Override
-                public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+                public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
             });
         }
 
@@ -406,14 +451,22 @@ public class TestGearsES2NEWT extends UITestCase {
 
         System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
         System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
-        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
+        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
+
+        final int[] hasSurfacePixelScale0 = glWindow.convertToPixelUnits(new int[] { 1, 1 });
+        final int[] hasSurfacePixelScale1 = glWindow.getCurrentSurfaceScale(new int[2]);
+        System.err.println("HiDPI PixelScale: "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
+                           valReqSurfacePixelScale[0]+"x"+valReqSurfacePixelScale[1]+" (val) -> "+
+                           hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
+        setTitle(glWindow, caps);
+        Assert.assertArrayEquals(hasSurfacePixelScale0, hasSurfacePixelScale1);
 
         snap.setMakeSnapshot();
 
         if( null != rwsize ) {
             Thread.sleep(500); // 500ms delay
             glWindow.setSize(rwsize.getWidth(), rwsize.getHeight());
-            System.err.println("window resize pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
+            System.err.println("window resize pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
         }
 
         snap.setMakeSnapshot();
@@ -490,7 +543,7 @@ public class TestGearsES2NEWT extends UITestCase {
 
     @Test
     public void test02_GLES2() throws InterruptedException {
-        if(mainRun) return;
+        if(manualTest) return;
 
         if( !GLProfile.isAvailable(GLProfile.GLES2) ) {
             System.err.println("GLES2 n/a");
@@ -503,7 +556,7 @@ public class TestGearsES2NEWT extends UITestCase {
 
     @Test
     public void test03_GL3() throws InterruptedException {
-        if(mainRun) return;
+        if(manualTest) return;
 
         if( !GLProfile.isAvailable(GLProfile.GL3) ) {
             System.err.println("GL3 n/a");
@@ -514,9 +567,18 @@ public class TestGearsES2NEWT extends UITestCase {
         runTestGL(caps, undecorated);
     }
 
-    public static void main(String args[]) throws IOException {
-        mainRun = true;
+    @Test
+    public void test99_PixelScale1_DefaultNorm() throws InterruptedException, InvocationTargetException {
+        if( manualTest ) return;
+
+        reqSurfacePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+        reqSurfacePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
 
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
+        runTestGL(caps, undecorated);
+    }
+
+    public static void main(final String args[]) throws IOException {
         int x=0, y=0, w=640, h=480, rw=-1, rh=-1;
         boolean usePos = false;
 
@@ -535,8 +597,6 @@ public class TestGearsES2NEWT extends UITestCase {
                 alwaysOnTop = true;
             } else if(args[i].equals("-fullscreen")) {
                 fullscreen = true;
-            } else if(args[i].equals("-pmvDirect")) {
-                pmvUseBackingArray = false;
             } else if(args[i].equals("-vsync")) {
                 i++;
                 swapInterval = MiscUtils.atoi(args[i], swapInterval);
@@ -578,6 +638,11 @@ public class TestGearsES2NEWT extends UITestCase {
                 i++;
                 y = MiscUtils.atoi(args[i], y);
                 usePos = true;
+            } else if(args[i].equals("-pixelScale")) {
+                i++;
+                final int pS = MiscUtils.atoi(args[i], reqSurfacePixelScale[0]);
+                reqSurfacePixelScale[0] = pS;
+                reqSurfacePixelScale[1] = pS;
             } else if(args[i].equals("-rwidth")) {
                 i++;
                 rw = MiscUtils.atoi(args[i], rw);
@@ -595,6 +660,8 @@ public class TestGearsES2NEWT extends UITestCase {
             } else if(args[i].equals("-sysExit")) {
                 i++;
                 sysExit = SysExit.valueOf(args[i]);
+            } else if(args[i].equals("-manual")) {
+                manualTest = true;
             }
         }
         wsize = new Dimension(w, h);
@@ -614,7 +681,6 @@ public class TestGearsES2NEWT extends UITestCase {
         System.err.println("undecorated "+undecorated);
         System.err.println("atop "+alwaysOnTop);
         System.err.println("fullscreen "+fullscreen);
-        System.err.println("pmvDirect "+(!pmvUseBackingArray));
         System.err.println("mouseVisible "+mouseVisible);
         System.err.println("mouseConfined "+mouseConfined);
         System.err.println("pointerIcon "+setPointerIcon);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java
index 5d091bb..2dca3ad 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.es2.newt;
 
 import java.awt.BorderLayout;
@@ -34,6 +34,8 @@ import java.awt.Component;
 import java.awt.Container;
 import java.awt.Frame;
 import java.awt.TextArea;
+import java.awt.event.ComponentEvent;
+import java.awt.event.ComponentListener;
 import java.io.IOException;
 import java.lang.reflect.InvocationTargetException;
 
@@ -41,7 +43,9 @@ import com.jogamp.common.os.Platform;
 import com.jogamp.newt.Display;
 import com.jogamp.newt.NewtFactory;
 import com.jogamp.newt.Screen;
+import com.jogamp.newt.Window;
 import com.jogamp.newt.awt.NewtCanvasAWT;
+import com.jogamp.newt.event.KeyEvent;
 import com.jogamp.newt.event.WindowEvent;
 import com.jogamp.newt.event.WindowAdapter;
 import com.jogamp.newt.opengl.GLWindow;
@@ -50,9 +54,11 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
 import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
 import com.jogamp.opengl.test.junit.newt.parenting.NewtAWTReparentingKeyAdapter;
 
+import javax.media.nativewindow.ScalableSurface;
 import javax.media.nativewindow.util.Dimension;
 import javax.media.nativewindow.util.Point;
 import javax.media.nativewindow.util.PointImmutable;
@@ -71,21 +77,21 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestGearsES2NewtCanvasAWT extends UITestCase {    
+public class TestGearsES2NewtCanvasAWT extends UITestCase {
     public enum FrameLayout { None, TextOnBottom, BorderBottom, BorderBottom2, BorderCenter, BorderCenterSurrounded, DoubleBorderCenterSurrounded };
     public enum ResizeBy { GLWindow, Component, Frame };
-    
+
     static int screenIdx = 0;
     static PointImmutable wpos;
     static DimensionImmutable wsize, rwsize = null;
     static FrameLayout frameLayout = FrameLayout.None;
     static ResizeBy resizeBy = ResizeBy.Component;
-    
+    static int[] reqSurfacePixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
+
     static long duration = 500; // ms
     static boolean opaque = true;
     static int forceAlpha = -1;
     static boolean fullscreen = false;
-    static boolean pmvUseBackingArray = true;
     static int swapInterval = 1;
     static boolean showFPS = false;
     static int loops = 1;
@@ -93,10 +99,10 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
     static boolean shallUseOffscreenFBOLayer = false;
     static boolean forceES2 = false;
     static boolean forceGL3 = false;
-    static boolean mainRun = false;
+    static boolean manualTest = false;
     static boolean exclusiveContext = false;
     static boolean useAnimator = true;
-    
+
     @BeforeClass
     public static void initClass() {
         if(null == wsize) {
@@ -117,16 +123,16 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
                         frame.pack();
                     } } );
             }
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }       
+        }
     }
     static void setComponentSize(final Frame frame, final Component comp, final DimensionImmutable new_sz) {
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
-                    java.awt.Dimension d = new java.awt.Dimension(new_sz.getWidth(), new_sz.getHeight());
+                    final java.awt.Dimension d = new java.awt.Dimension(new_sz.getWidth(), new_sz.getHeight());
                     comp.setMinimumSize(d);
                     comp.setPreferredSize(d);
                     comp.setSize(d);
@@ -134,27 +140,27 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
                         frame.pack();
                     }
                 } } );
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }       
+        }
     }
     static void setFrameSize(final Frame frame, final boolean frameLayout, final DimensionImmutable new_sz) {
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
-                    java.awt.Dimension d = new java.awt.Dimension(new_sz.getWidth(), new_sz.getHeight());
+                    final java.awt.Dimension d = new java.awt.Dimension(new_sz.getWidth(), new_sz.getHeight());
                     frame.setSize(d);
                     if( frameLayout ) {
                         frame.validate();
                     }
                 } } );
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }       
+        }
     }
-    
+
     static void setSize(final ResizeBy resizeBy, final Frame frame, final boolean frameLayout, final Component comp, final GLWindow glw, final DimensionImmutable new_sz) {
         switch( resizeBy ) {
             case GLWindow:
@@ -166,24 +172,38 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
             case Frame:
                 setFrameSize(frame, frameLayout, new_sz);
                 break;
-        }        
+        }
+    }
+
+    private void setTitle(final Frame frame, final NewtCanvasAWT glc, final Window win, final GLCapabilitiesImmutable caps) {
+        final String capsA = caps.isBackgroundOpaque() ? "opaque" : "transl";
+        {
+            final java.awt.Rectangle b = glc.getBounds();
+            frame.setTitle("NewtCanvasAWT["+capsA+"], swapI "+swapInterval+", win: ["+b.x+"/"+b.y+" "+b.width+"x"+b.height+"], pix: "+glc.getNativeWindow().getSurfaceWidth()+"x"+glc.getNativeWindow().getSurfaceHeight());
+        }
+        final float[] sDPI = win.getPixelsPerMM(new float[2]);
+        sDPI[0] *= 25.4f;
+        sDPI[1] *= 25.4f;
+        win.setTitle("GLWindow["+capsA+"], swapI "+swapInterval+", win: "+win.getBounds()+", pix: "+win.getSurfaceWidth()+"x"+win.getSurfaceHeight()+", sDPI "+sDPI[0]+" x "+sDPI[1]);
     }
-    
+
     // public enum ResizeBy { GLWindow, Component, Frame };
     protected void runTestGL(final GLCapabilitiesImmutable caps, final ResizeBy resizeBy, final FrameLayout frameLayout) throws InterruptedException, InvocationTargetException {
         System.err.println("requested: vsync "+swapInterval+", "+caps);
-        Display dpy = NewtFactory.createDisplay(null);
-        Screen screen = NewtFactory.createScreen(dpy, screenIdx);
+        final Display dpy = NewtFactory.createDisplay(null);
+        final Screen screen = NewtFactory.createScreen(dpy, screenIdx);
         final GLWindow glWindow = GLWindow.create(screen, caps);
         Assert.assertNotNull(glWindow);
-        
+        glWindow.setSurfaceScale(reqSurfacePixelScale);
+        final int[] valReqSurfacePixelScale = glWindow.getRequestedSurfaceScale(new int[2]);
+
         final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
         if ( shallUseOffscreenFBOLayer ) {
             newtCanvasAWT.setShallUseOffscreenLayer(true);
         }
-        
+
         final Frame frame = new Frame("AWT Parent Frame");
-        
+
         setSize(resizeBy, frame, false, newtCanvasAWT, glWindow, wsize);
 
         switch( frameLayout) {
@@ -199,7 +219,7 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
                 frame.setLayout(new BorderLayout());
                 frame.add(ta, BorderLayout.SOUTH);
                 frame.add(newtCanvasAWT, BorderLayout.CENTER);
-                break;                
+                break;
             case BorderBottom:
                 frame.setLayout(new BorderLayout());
                 frame.add(newtCanvasAWT, BorderLayout.SOUTH);
@@ -222,14 +242,14 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
                 frame.add(newtCanvasAWT, BorderLayout.CENTER);
                 break;
             case DoubleBorderCenterSurrounded:
-                Container c = new Container();
+                final Container c = new Container();
                 c.setLayout(new BorderLayout());
                 c.add(new Button("north"), BorderLayout.NORTH);
                 c.add(new Button("south"), BorderLayout.SOUTH);
                 c.add(new Button("east"), BorderLayout.EAST);
                 c.add(new Button("west"), BorderLayout.WEST);
                 c.add(newtCanvasAWT, BorderLayout.CENTER);
-                
+
                 frame.setLayout(new BorderLayout());
                 frame.add(new Button("NORTH"), BorderLayout.NORTH);
                 frame.add(new Button("SOUTH"), BorderLayout.SOUTH);
@@ -238,19 +258,34 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
                 frame.add(c, BorderLayout.CENTER);
                 break;
         }
-        
-        frame.setTitle("Gears NewtCanvasAWT Test (translucent "+!caps.isBackgroundOpaque()+"), swapInterval "+swapInterval+", size "+wsize+", pos "+wpos);
-        
+
         final GearsES2 demo = new GearsES2(swapInterval);
-        demo.setPMVUseBackingArray(pmvUseBackingArray);
         glWindow.addGLEventListener(demo);
-        
+
+        frame.addComponentListener(new ComponentListener() {
+            @Override
+            public void componentResized(final ComponentEvent e) {
+                setTitle(frame, newtCanvasAWT, glWindow, caps);
+            }
+
+            @Override
+            public void componentMoved(final ComponentEvent e) {
+                setTitle(frame, newtCanvasAWT, glWindow, caps);
+            }
+
+            @Override
+            public void componentShown(final ComponentEvent e) { }
+
+            @Override
+            public void componentHidden(final ComponentEvent e) { }
+        });
+
         final Animator animator = useAnimator ? new Animator() : null;
         if( useAnimator ) {
-            animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+            animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
             animator.setExclusiveContext(exclusiveContext);
         }
-        
+
         final QuitAdapter quitAdapter = new QuitAdapter();
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -258,16 +293,43 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
         glWindow.addWindowListener(quitAdapter);
 
         glWindow.addWindowListener(new WindowAdapter() {
-            public void windowResized(WindowEvent e) {
-                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
+            public void windowResized(final WindowEvent e) {
+                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
+            }
+            public void windowMoved(final WindowEvent e) {
+                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
             }
-            public void windowMoved(WindowEvent e) {
-                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
-            }            
         });
-        
+
         glWindow.addKeyListener(new NewtAWTReparentingKeyAdapter(frame, newtCanvasAWT, glWindow, quitAdapter));
-        
+        glWindow.addKeyListener(new com.jogamp.newt.event.KeyAdapter() {
+            @Override
+            public void keyPressed(final KeyEvent e) {
+                if( e.isAutoRepeat() ) {
+                    return;
+                }
+                if(e.getKeyChar()=='x') {
+                    final int[] hadSurfacePixelScale = glWindow.getCurrentSurfaceScale(new int[2]);
+                    final int[] reqSurfacePixelScale;
+                    if( hadSurfacePixelScale[0] == ScalableSurface.IDENTITY_PIXELSCALE ) {
+                        reqSurfacePixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
+                    } else {
+                        reqSurfacePixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+                    }
+                    System.err.println("[set PixelScale pre]: had "+hadSurfacePixelScale[0]+"x"+hadSurfacePixelScale[1]+" -> req "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]);
+                    glWindow.setSurfaceScale(reqSurfacePixelScale);
+                    final int[] valReqSurfacePixelScale = glWindow.getRequestedSurfaceScale(new int[2]);
+                    final int[] hasSurfacePixelScale0 = glWindow.convertToPixelUnits(new int[] { 1, 1 });
+                    final int[] hasSurfacePixelScale1 = glWindow.getCurrentSurfaceScale(new int[2]);
+                    System.err.println("[set PixelScale post]: "+hadSurfacePixelScale[0]+"x"+hadSurfacePixelScale[1]+" (had) -> "+
+                                       reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
+                                       valReqSurfacePixelScale[0]+"x"+valReqSurfacePixelScale[1]+" (val) -> "+
+                                       hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
+                    setTitle(frame, newtCanvasAWT, glWindow, caps);
+                    Assert.assertArrayEquals(hasSurfacePixelScale0, hasSurfacePixelScale1);
+                }
+            } } );
+
         if( useAnimator ) {
             animator.add(glWindow);
             animator.start();
@@ -281,28 +343,36 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
                if( ResizeBy.Frame == resizeBy ) {
                    frame.validate();
                } else {
-                   frame.pack();                   
-               }                
-               frame.setVisible(true);               
+                   frame.pack();
+               }
+               frame.setVisible(true);
            }
-        });        
+        });
         Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, true));
-        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow, true)); 
-        
+        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow, true));
+
         if( useAnimator ) {
             animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
         }
-        
+
         System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
         System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
-        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
-                
+        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
+
+        final int[] hasSurfacePixelScale0 = glWindow.convertToPixelUnits(new int[] { 1, 1 });
+        final int[] hasSurfacePixelScale1 = glWindow.getCurrentSurfaceScale(new int[2]);
+        System.err.println("HiDPI PixelScale: "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
+                           valReqSurfacePixelScale[0]+"x"+valReqSurfacePixelScale[1]+" (val) -> "+
+                           hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
+        setTitle(frame, newtCanvasAWT, glWindow, caps);
+        Assert.assertArrayEquals(hasSurfacePixelScale0, hasSurfacePixelScale1);
+
         if( null != rwsize ) {
-            Thread.sleep(500); // 500ms delay 
+            Thread.sleep(500); // 500ms delay
             setSize(resizeBy, frame, true, newtCanvasAWT, glWindow, rwsize);
-            System.err.println("window resize "+rwsize+" -> pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
+            System.err.println("window resize "+rwsize+" -> pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
         }
-        
+
         final long t0 = System.currentTimeMillis();
         long t1 = t0;
         while(!quitAdapter.shouldQuit() && t1-t0<duration) {
@@ -318,8 +388,8 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
         }
         Assert.assertEquals(null, glWindow.getExclusiveContextThread());
         SwingUtilities.invokeAndWait(new Runnable() {
-           public void run() {               
-               frame.dispose();               
+           public void run() {
+               frame.dispose();
            }
         });
         glWindow.destroy();
@@ -341,7 +411,7 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
             final GLCapabilities caps = new GLCapabilities( glp );
             caps.setBackgroundOpaque(opaque);
             if(-1 < forceAlpha) {
-                caps.setAlphaBits(forceAlpha); 
+                caps.setAlphaBits(forceAlpha);
             }
             runTestGL(caps, resizeBy, frameLayout);
             if(loop_shutdown) {
@@ -352,8 +422,8 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
 
     @Test
     public void test02GL3() throws InterruptedException, InvocationTargetException {
-        if(mainRun) return;
-        
+        if(manualTest) return;
+
         if( !GLProfile.isAvailable(GLProfile.GL3) ) {
             System.err.println("GL3 n/a");
             return;
@@ -362,14 +432,23 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
         final GLCapabilities caps = new GLCapabilities( glp );
         runTestGL(caps, resizeBy, frameLayout);
     }
-    
-    public static void main(String args[]) throws IOException {
-        mainRun = true;
-        
+
+    @Test
+    public void test99_PixelScale1_DefaultNorm() throws InterruptedException, InvocationTargetException {
+        if( manualTest ) return;
+
+        reqSurfacePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+        reqSurfacePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
+
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
+        runTestGL(caps, resizeBy, frameLayout);
+    }
+
+    public static void main(final String args[]) throws IOException {
         int x=0, y=0, w=640, h=480;
         int rw=-1, rh=-1;
         boolean usePos = false;
-        
+
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
@@ -393,8 +472,6 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
                 forceAlpha = MiscUtils.atoi(args[i], 0);
             } else if(args[i].equals("-fullscreen")) {
                 fullscreen = true;
-            } else if(args[i].equals("-pmvDirect")) {
-                pmvUseBackingArray = false;
             } else if(args[i].equals("-vsync")) {
                 i++;
                 swapInterval = MiscUtils.atoi(args[i], swapInterval);
@@ -424,6 +501,11 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
                 i++;
                 y = MiscUtils.atoi(args[i], y);
                 usePos = true;
+            } else if(args[i].equals("-pixelScale")) {
+                i++;
+                final int pS = MiscUtils.atoi(args[i], reqSurfacePixelScale[0]);
+                reqSurfacePixelScale[0] = pS;
+                reqSurfacePixelScale[1] = pS;
             } else if(args[i].equals("-screen")) {
                 i++;
                 screenIdx = MiscUtils.atoi(args[i], 0);
@@ -432,17 +514,19 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
                 loops = MiscUtils.atoi(args[i], 1);
             } else if(args[i].equals("-loop-shutdown")) {
                 loop_shutdown = true;
+            } else if(args[i].equals("-manual")) {
+                manualTest = true;
             }
         }
         wsize = new Dimension(w, h);
         if( 0 < rw && 0 < rh ) {
             rwsize = new Dimension(rw, rh);
         }
-        
+
         if(usePos) {
             wpos = new Point(x, y);
         }
-        
+
         System.err.println("frameLayout "+frameLayout);
         System.err.println("resizeBy "+resizeBy);
         System.err.println("position "+wpos);
@@ -450,9 +534,8 @@ public class TestGearsES2NewtCanvasAWT extends UITestCase {
         System.err.println("resize "+rwsize);
         System.err.println("screen "+screenIdx);
         System.err.println("translucent "+(!opaque));
-        System.err.println("forceAlpha "+forceAlpha);        
+        System.err.println("forceAlpha "+forceAlpha);
         System.err.println("fullscreen "+fullscreen);
-        System.err.println("pmvDirect "+(!pmvUseBackingArray));        
         System.err.println("loops "+loops);
         System.err.println("loop shutdown "+loop_shutdown);
         System.err.println("shallUseOffscreenFBOLayer     "+shallUseOffscreenFBOLayer);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java
index 9b2db6b..c3c7d68 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestGearsES2NewtCanvasSWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.es2.newt;
 
 import java.io.IOException;
@@ -43,16 +43,14 @@ import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
 import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
-
 import com.jogamp.opengl.util.Animator;
-
+import com.jogamp.opengl.util.AnimatorBase;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
 
 import javax.media.nativewindow.util.Dimension;
 import javax.media.nativewindow.util.Point;
 import javax.media.nativewindow.util.PointImmutable;
 import javax.media.nativewindow.util.DimensionImmutable;
-
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLCapabilitiesImmutable;
 import javax.media.opengl.GLProfile;
@@ -73,7 +71,7 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestGearsES2NewtCanvasSWT extends UITestCase {    
+public class TestGearsES2NewtCanvasSWT extends UITestCase {
     static int screenIdx = 0;
     static PointImmutable wpos;
     static DimensionImmutable wsize, rwsize = null;
@@ -82,7 +80,6 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
     static boolean opaque = true;
     static int forceAlpha = -1;
     static boolean fullscreen = false;
-    static boolean pmvUseBackingArray = true;
     static int swapInterval = 1;
     static boolean showFPS = false;
     static int loops = 1;
@@ -91,7 +88,7 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
     static boolean forceGL3 = false;
     static boolean mainRun = false;
     static boolean exclusiveContext = false;
-    
+
     @BeforeClass
     public static void initClass() {
         if(null == wsize) {
@@ -107,16 +104,16 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
     Shell shell = null;
     Composite composite = null;
     com.jogamp.newt.Display swtNewtDisplay = null;
-    
+
     @Before
     public void init() {
         SWTAccessor.invoke(true, new Runnable() {
-            public void run() {        
+            public void run() {
                 display = new Display();
                 Assert.assertNotNull( display );
             }});
         display.syncExec(new Runnable() {
-            public void run() {        
+            public void run() {
                 shell = new Shell( display );
                 Assert.assertNotNull( shell );
                 shell.setLayout( new FillLayout() );
@@ -143,7 +140,7 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
                 display.dispose();
                }});
         }
-        catch( Throwable throwable ) {
+        catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -152,48 +149,47 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
         shell = null;
         composite = null;
     }
-    
-    protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
+
+    protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
         System.err.println("requested: vsync "+swapInterval+", "+caps);
-        com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, screenIdx);
+        final com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, screenIdx);
         final GLWindow glWindow = GLWindow.create(screen, caps);
         Assert.assertNotNull(glWindow);
-        
+
         final GearsES2 demo = new GearsES2(swapInterval);
-        demo.setPMVUseBackingArray(pmvUseBackingArray);
         glWindow.addGLEventListener(demo);
-        
-        Animator animator = new Animator();
-        animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+
+        final Animator animator = new Animator();
+        animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
         animator.setExclusiveContext(exclusiveContext);
-        
-        QuitAdapter quitAdapter = new QuitAdapter();
+
+        final QuitAdapter quitAdapter = new QuitAdapter();
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
         glWindow.addKeyListener(quitAdapter);
         glWindow.addWindowListener(quitAdapter);
 
         glWindow.addWindowListener(new WindowAdapter() {
-            public void windowResized(WindowEvent e) {
-                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
+            public void windowResized(final WindowEvent e) {
+                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
+            }
+            public void windowMoved(final WindowEvent e) {
+                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
             }
-            public void windowMoved(WindowEvent e) {
-                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
-            }            
         });
-        
+
         glWindow.addKeyListener(new KeyAdapter() {
-            public void keyReleased(KeyEvent e) {
+            public void keyReleased(final KeyEvent e) {
                 if( !e.isPrintableKey() || e.isAutoRepeat() ) {
                     return;
-                }            
+                }
                 if(e.getKeyChar()=='f') {
                     new Thread() {
                         public void run() {
                             final Thread t = glWindow.setExclusiveContextThread(null);
-                            System.err.println("[set fullscreen  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+                            System.err.println("[set fullscreen  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
                             glWindow.setFullscreen(!glWindow.isFullscreen());
-                            System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+                            System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
                             glWindow.setExclusiveContextThread(t);
                     } }.start();
                 }
@@ -219,13 +215,13 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
               shell.open();
            }
         });
-        
+
         animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
-        
+
         System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
         System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
-        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
-                
+        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
+
         if( null != rwsize ) {
             for(int i=0; i<50; i++) { // 500 ms dispatched delay
                 if( !display.readAndDispatch() ) {
@@ -238,9 +234,9 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
                   shell.setSize( rwsize.getWidth(), rwsize.getHeight() );
                }
             });
-            System.err.println("window resize pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
+            System.err.println("window resize pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
         }
-        
+
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
             if( !display.readAndDispatch() ) {
                 // blocks on linux .. display.sleep();
@@ -253,7 +249,7 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
         Assert.assertFalse(animator.isAnimating());
         Assert.assertFalse(animator.isStarted());
         Assert.assertEquals(null, glWindow.getExclusiveContextThread());
-        
+
         canvas1.dispose();
         glWindow.destroy();
         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow, false));
@@ -274,7 +270,7 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
             final GLCapabilities caps = new GLCapabilities( glp );
             caps.setBackgroundOpaque(opaque);
             if(-1 < forceAlpha) {
-                caps.setAlphaBits(forceAlpha); 
+                caps.setAlphaBits(forceAlpha);
             }
             runTestGL(caps);
             if(loop_shutdown) {
@@ -286,7 +282,7 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
     @Test
     public void test02GL3() throws InterruptedException, InvocationTargetException {
         if(mainRun) return;
-        
+
         if( !GLProfile.isAvailable(GLProfile.GL3) ) {
             System.err.println("GL3 n/a");
             return;
@@ -295,13 +291,13 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
         final GLCapabilities caps = new GLCapabilities( glp );
         runTestGL(caps);
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         mainRun = true;
-        
+
         int x=0, y=0, w=640, h=480, rw=-1, rh=-1;
         boolean usePos = false;
-        
+
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
@@ -313,8 +309,6 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
                 forceAlpha = MiscUtils.atoi(args[i], 0);
             } else if(args[i].equals("-fullscreen")) {
                 fullscreen = true;
-            } else if(args[i].equals("-pmvDirect")) {
-                pmvUseBackingArray = false;
             } else if(args[i].equals("-vsync")) {
                 i++;
                 swapInterval = MiscUtils.atoi(args[i], swapInterval);
@@ -360,18 +354,17 @@ public class TestGearsES2NewtCanvasSWT extends UITestCase {
         if( 0 < rw && 0 < rh ) {
             rwsize = new Dimension(rw, rh);
         }
-        
+
         if(usePos) {
             wpos = new Point(x, y);
         }
         System.err.println("position "+wpos);
         System.err.println("size "+wsize);
-        System.err.println("resize "+rwsize);        
+        System.err.println("resize "+rwsize);
         System.err.println("screen "+screenIdx);
         System.err.println("translucent "+(!opaque));
-        System.err.println("forceAlpha "+forceAlpha);        
+        System.err.println("forceAlpha "+forceAlpha);
         System.err.println("fullscreen "+fullscreen);
-        System.err.println("pmvDirect "+(!pmvUseBackingArray));        
         System.err.println("loops "+loops);
         System.err.println("loop shutdown "+loop_shutdown);
         System.err.println("forceES2 "+forceES2);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NEWT.java
index 50a5de1..d792683 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.es2.newt;
 
 import com.jogamp.newt.event.KeyAdapter;
@@ -34,9 +34,8 @@ import com.jogamp.newt.opengl.GLWindow;
 import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
-
 import com.jogamp.opengl.util.Animator;
-
+import com.jogamp.opengl.util.AnimatorBase;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.LandscapeES2;
 
 import javax.media.opengl.GLCapabilities;
@@ -56,7 +55,7 @@ public class TestLandscapeES2NEWT extends UITestCase {
     static boolean exclusiveContext = false;
     static boolean useAnimator = true;
 
-    protected void runTestGL(GLCapabilities caps) throws InterruptedException {
+    protected void runTestGL(final GLCapabilities caps) throws InterruptedException {
         System.err.println("requested: swapInterval "+swapInterval+", "+caps);
         final GLWindow glWindow = GLWindow.create(caps);
         glWindow.setTitle(getSimpleTestName("."));
@@ -68,14 +67,14 @@ public class TestLandscapeES2NEWT extends UITestCase {
         final SnapshotGLEventListener snap = new SnapshotGLEventListener();
         snap.setPostSNDetail(demo.getClass().getSimpleName());
         glWindow.addGLEventListener(snap);
-        
+
         final Animator animator = useAnimator ? new Animator() : null;
         if( useAnimator ) {
-            animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+            animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
             animator.setExclusiveContext(exclusiveContext);
         }
-        
-        QuitAdapter quitAdapter = new QuitAdapter();
+
+        final QuitAdapter quitAdapter = new QuitAdapter();
 
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -83,10 +82,10 @@ public class TestLandscapeES2NEWT extends UITestCase {
         glWindow.addWindowListener(quitAdapter);
 
         glWindow.addKeyListener(new KeyAdapter() {
-            public void keyReleased(KeyEvent e) {
+            public void keyReleased(final KeyEvent e) {
                 if( !e.isPrintableKey() || e.isAutoRepeat() ) {
                     return;
-                }            
+                }
                 if(e.getKeyChar()=='f') {
                     new Thread() {
                         public void run() {
@@ -112,10 +111,10 @@ public class TestLandscapeES2NEWT extends UITestCase {
 
         System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
         System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
-        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
-        
+        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
+
         snap.setMakeSnapshot();
-        
+
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
             Thread.sleep(100);
         }
@@ -139,11 +138,11 @@ public class TestLandscapeES2NEWT extends UITestCase {
         final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps);
     }
-    
+
     @Test
     public void test02GL3() throws InterruptedException {
         if(mainRun) return;
-        
+
         if( !GLProfile.isAvailable(GLProfile.GL3) ) {
             System.err.println("GL3 n/a");
             return;
@@ -151,11 +150,11 @@ public class TestLandscapeES2NEWT extends UITestCase {
         final GLProfile glp = GLProfile.get(GLProfile.GL3);
         final GLCapabilities caps = new GLCapabilities( glp );
         runTestGL(caps);
-    }    
+    }
 
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         mainRun = true;
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NewtCanvasAWT.java
index adc2b23..0f55813 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NewtCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestLandscapeES2NewtCanvasAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.es2.newt;
 
 import java.awt.Frame;
@@ -43,6 +43,7 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
 import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.LandscapeES2;
 import com.jogamp.opengl.test.junit.newt.parenting.NewtAWTReparentingKeyAdapter;
 
@@ -58,9 +59,9 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestLandscapeES2NewtCanvasAWT extends UITestCase {    
+public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
     static DimensionImmutable wsize = new Dimension(500, 290);
-    
+
     static long duration = 500; // ms
     static int swapInterval = 1;
     static boolean shallUseOffscreenFBOLayer = false;
@@ -69,36 +70,36 @@ public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
     static boolean mainRun = false;
     static boolean exclusiveContext = false;
     static boolean useAnimator = true;
-    
+
     // public enum ResizeBy { GLWindow, Component, Frame };
     protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
         System.err.println("requested: vsync "+swapInterval+", "+caps);
-        Display dpy = NewtFactory.createDisplay(null);
-        Screen screen = NewtFactory.createScreen(dpy, 0);
+        final Display dpy = NewtFactory.createDisplay(null);
+        final Screen screen = NewtFactory.createScreen(dpy, 0);
         final GLWindow glWindow = GLWindow.create(screen, caps);
-        
+
         final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
         if ( shallUseOffscreenFBOLayer ) {
             newtCanvasAWT.setShallUseOffscreenLayer(true);
         }
-        
+
         final Frame frame = new Frame("AWT Parent Frame");
         {
-            java.awt.Dimension d = new java.awt.Dimension(wsize.getWidth(), wsize.getHeight());
+            final java.awt.Dimension d = new java.awt.Dimension(wsize.getWidth(), wsize.getHeight());
             frame.setSize(d);
         }
         frame.add(newtCanvasAWT);
         frame.setTitle("Gears NewtCanvasAWT Test (translucent "+!caps.isBackgroundOpaque()+"), swapInterval "+swapInterval+", size "+wsize);
-        
+
         final LandscapeES2 demo = new LandscapeES2(swapInterval);
         glWindow.addGLEventListener(demo);
-        
+
         final Animator animator = useAnimator ? new Animator() : null;
         if( useAnimator ) {
-            animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+            animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
             animator.setExclusiveContext(exclusiveContext);
         }
-        
+
         final QuitAdapter quitAdapter = new QuitAdapter();
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -106,16 +107,16 @@ public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
         glWindow.addWindowListener(quitAdapter);
 
         glWindow.addWindowListener(new WindowAdapter() {
-            public void windowResized(WindowEvent e) {
-                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
+            public void windowResized(final WindowEvent e) {
+                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
+            }
+            public void windowMoved(final WindowEvent e) {
+                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
             }
-            public void windowMoved(WindowEvent e) {
-                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
-            }            
         });
-        
+
         glWindow.addKeyListener(new NewtAWTReparentingKeyAdapter(frame, newtCanvasAWT, glWindow, quitAdapter));
-        
+
         if( useAnimator ) {
             animator.add(glWindow);
             animator.start();
@@ -124,18 +125,18 @@ public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
         SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
                frame.validate();
-               frame.setVisible(true);               
+               frame.setVisible(true);
            }
-        });        
-        
+        });
+
         if( useAnimator ) {
             animator.setUpdateFPSFrames(60, System.err);
         }
-        
+
         System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
         System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
-        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
-                
+        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
+
         final long t0 = System.currentTimeMillis();
         long t1 = t0;
         while(!quitAdapter.shouldQuit() && t1-t0<duration) {
@@ -147,8 +148,8 @@ public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
             animator.stop();
         }
         SwingUtilities.invokeAndWait(new Runnable() {
-           public void run() {               
-               frame.dispose();               
+           public void run() {
+               frame.dispose();
            }
         });
         glWindow.destroy();
@@ -171,7 +172,7 @@ public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
     @Test
     public void test02GL3() throws InterruptedException, InvocationTargetException {
         if(mainRun) return;
-        
+
         if( !GLProfile.isAvailable(GLProfile.GL3) ) {
             System.err.println("GL3 n/a");
             return;
@@ -180,10 +181,10 @@ public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
         final GLCapabilities caps = new GLCapabilities( glp );
         runTestGL(caps);
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         mainRun = true;
-        
+
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
@@ -203,7 +204,7 @@ public class TestLandscapeES2NewtCanvasAWT extends UITestCase {
                 forceGL3 = true;
             }
         }
-        
+
         System.err.println("size "+wsize);
         System.err.println("shallUseOffscreenFBOLayer     "+shallUseOffscreenFBOLayer);
         System.err.println("forceES2 "+forceES2);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java
index 6300bbd..52f4473 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/newt/TestRedSquareES2NEWT.java
@@ -73,7 +73,7 @@ public class TestRedSquareES2NEWT extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilities caps) throws InterruptedException {
+    protected void runTestGL(final GLCapabilities caps) throws InterruptedException {
         System.err.println("requested: vsync "+vsync+", "+caps);
         final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
@@ -96,8 +96,8 @@ public class TestRedSquareES2NEWT extends UITestCase {
         snap.setPostSNDetail(demo.getClass().getSimpleName());
         glWindow.addGLEventListener(snap);
 
-        Animator animator = new Animator(glWindow);
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final Animator animator = new Animator(glWindow);
+        final QuitAdapter quitAdapter = new QuitAdapter();
 
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -105,7 +105,7 @@ public class TestRedSquareES2NEWT extends UITestCase {
         glWindow.addWindowListener(quitAdapter);
 
         glWindow.addKeyListener(new KeyAdapter() {
-            public void keyReleased(KeyEvent e) {
+            public void keyReleased(final KeyEvent e) {
                 if( !e.isPrintableKey() || e.isAutoRepeat() ) {
                     return;
                 }
@@ -129,7 +129,7 @@ public class TestRedSquareES2NEWT extends UITestCase {
 
         System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
         System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
-        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
+        System.err.println("window pos/siz: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
 
         animator.setUpdateFPSFrames(60, System.err);
         snap.setMakeSnapshot();
@@ -182,7 +182,7 @@ public class TestRedSquareES2NEWT extends UITestCase {
 
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         mainRun = true;
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
@@ -203,6 +203,7 @@ public class TestRedSquareES2NEWT extends UITestCase {
                 loop_shutdown = true;
             }
         }
+        System.err.println("duration "+duration);
         System.err.println("loops "+loops);
         System.err.println("loop shutdown "+loop_shutdown);
         System.err.println("forceES2 "+forceES2);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java
index 07f3a97..9284ec4 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/shader/RedSquareShader.java
@@ -29,7 +29,7 @@
 package com.jogamp.opengl.test.junit.jogl.demos.es2.shader;
 
 public class RedSquareShader {
-    public static String VERTEX_SHADER_TEXT =
+    public static final String VERTEX_SHADER_TEXT =
                 " #ifdef GL_ES\n" +
                 "  precision mediump float;\n" +
                 "  precision mediump int;\n" +
@@ -38,7 +38,7 @@ public class RedSquareShader {
                 "#if __VERSION__ >= 130\n" +
                 "  #define attribute in\n" +
                 "  #define varying out\n" +
-                "#endif\n"+               
+                "#endif\n"+
                 "\n" +
                 "uniform mat4    mgl_PMVMatrix[2];\n" +
                 "attribute vec4    mgl_Vertex;\n" +
@@ -51,7 +51,7 @@ public class RedSquareShader {
                 "  gl_Position = mgl_PMVMatrix[0] * mgl_PMVMatrix[1] * mgl_Vertex;\n" +
                 "}\n" ;
 
-    public static String FRAGMENT_SHADER_TEXT =
+    public static final String FRAGMENT_SHADER_TEXT =
                 " #ifdef GL_ES\n" +
                 "  precision mediump float;\n" +
                 "  precision mediump int;\n" +
@@ -61,7 +61,7 @@ public class RedSquareShader {
                 "  #define varying in\n" +
                 "  out vec4 mgl_FragColor;\n" +
                 "#else\n" +
-                "  #define mgl_FragColor gl_FragColor\n" +   
+                "  #define mgl_FragColor gl_FragColor\n" +
                 "#endif\n" +
                 "\n" +
                 "varying   vec4    frontColor;\n" +
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/swt/TestGearsES2SWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/swt/TestGearsES2SWT.java
index b6463ac..7ecb639 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/swt/TestGearsES2SWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/es2/swt/TestGearsES2SWT.java
@@ -35,16 +35,14 @@ import com.jogamp.nativewindow.swt.SWTAccessor;
 import com.jogamp.opengl.swt.GLCanvas;
 import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.UITestCase;
-
 import com.jogamp.opengl.util.Animator;
-
+import com.jogamp.opengl.util.AnimatorBase;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
 
 import javax.media.nativewindow.util.Dimension;
 import javax.media.nativewindow.util.Point;
 import javax.media.nativewindow.util.PointImmutable;
 import javax.media.nativewindow.util.DimensionImmutable;
-
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLCapabilitiesImmutable;
 import javax.media.opengl.GLProfile;
@@ -74,7 +72,6 @@ public class TestGearsES2SWT extends UITestCase {
     static boolean opaque = true;
     static int forceAlpha = -1;
     static boolean fullscreen = false;
-    static boolean pmvUseBackingArray = true;
     static int swapInterval = 1;
     static boolean showFPS = false;
     static int loops = 1;
@@ -133,7 +130,7 @@ public class TestGearsES2SWT extends UITestCase {
                 display.dispose();
                }});
         }
-        catch( Throwable throwable ) {
+        catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -142,18 +139,17 @@ public class TestGearsES2SWT extends UITestCase {
         composite = null;
     }
 
-    protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
+    protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
         System.err.println("requested: vsync "+swapInterval+", "+caps);
 
         final GLCanvas canvas = GLCanvas.create( composite, 0, caps, null);
         Assert.assertNotNull( canvas );
 
         final GearsES2 demo = new GearsES2(swapInterval);
-        demo.setPMVUseBackingArray(pmvUseBackingArray);
         canvas.addGLEventListener(demo);
 
-        Animator animator = new Animator();
-        animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+        final Animator animator = new Animator();
+        animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
         animator.setExclusiveContext(exclusiveContext);
 
         animator.add(canvas);
@@ -183,7 +179,7 @@ public class TestGearsES2SWT extends UITestCase {
         }
         System.err.println("NW chosen: "+canvas.getDelegatedDrawable().getChosenGLCapabilities());
         System.err.println("GL chosen: "+canvas.getChosenGLCapabilities());
-        System.err.println("window pos/siz: "+canvas.getLocation()+" "+canvas.getWidth()+"x"+canvas.getHeight());
+        System.err.println("window pos/siz: "+canvas.getLocation()+" "+canvas.getSurfaceWidth()+"x"+canvas.getSurfaceHeight());
 
         if( null != rwsize ) {
             for(int i=0; i<50; i++) { // 500 ms dispatched delay
@@ -197,7 +193,7 @@ public class TestGearsES2SWT extends UITestCase {
                   shell.setSize( rwsize.getWidth(), rwsize.getHeight() );
                }
             });
-            System.err.println("window resize pos/siz: "+canvas.getLocation()+" "+canvas.getWidth()+"x"+canvas.getHeight());
+            System.err.println("window resize pos/siz: "+canvas.getLocation()+" "+canvas.getSurfaceWidth()+"x"+canvas.getSurfaceHeight());
         }
 
         while(animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
@@ -256,7 +252,7 @@ public class TestGearsES2SWT extends UITestCase {
         runTestGL(caps);
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         mainRun = true;
 
         int x=0, y=0, w=640, h=480, rw=-1, rh=-1;
@@ -273,8 +269,6 @@ public class TestGearsES2SWT extends UITestCase {
                 forceAlpha = MiscUtils.atoi(args[i], 0);
             } else if(args[i].equals("-fullscreen")) {
                 fullscreen = true;
-            } else if(args[i].equals("-pmvDirect")) {
-                pmvUseBackingArray = false;
             } else if(args[i].equals("-vsync")) {
                 i++;
                 swapInterval = MiscUtils.atoi(args[i], swapInterval);
@@ -331,7 +325,6 @@ public class TestGearsES2SWT extends UITestCase {
         System.err.println("translucent "+(!opaque));
         System.err.println("forceAlpha "+forceAlpha);
         System.err.println("fullscreen "+fullscreen);
-        System.err.println("pmvDirect "+(!pmvUseBackingArray));
         System.err.println("loops "+loops);
         System.err.println("loop shutdown "+loop_shutdown);
         System.err.println("forceES2 "+forceES2);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Gears.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Gears.java
index 0d71c7a..dbc760d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Gears.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Gears.java
@@ -3,9 +3,12 @@ package com.jogamp.opengl.test.junit.jogl.demos.gl2;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
+import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLProfile;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import com.jogamp.newt.Window;
 import com.jogamp.newt.event.InputEvent;
@@ -43,7 +46,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
   // private boolean mouseRButtonDown = false;
   private int prevMouseX, prevMouseY;
 
-  public Gears(int swapInterval) {
+  public Gears(final int swapInterval) {
     this.swapInterval = swapInterval;
   }
 
@@ -52,30 +55,30 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
   }
 
   @Override
-  public void addTileRendererNotify(TileRendererBase tr) {
+  public void addTileRendererNotify(final TileRendererBase tr) {
       tileRendererInUse = tr;
       doRotateBeforePrinting = doRotate;
       setDoRotation(false);
   }
   @Override
-  public void removeTileRendererNotify(TileRendererBase tr) {
+  public void removeTileRendererNotify(final TileRendererBase tr) {
       tileRendererInUse = null;
       setDoRotation(doRotateBeforePrinting);
   }
   @Override
-  public void startTileRendering(TileRendererBase tr) {
+  public void startTileRendering(final TileRendererBase tr) {
       System.err.println("Gears.startTileRendering: "+tr);
   }
   @Override
-  public void endTileRendering(TileRendererBase tr) {
+  public void endTileRendering(final TileRendererBase tr) {
       System.err.println("Gears.endTileRendering: "+tr);
   }
 
-  public void setDoRotation(boolean rotate) { doRotate = rotate; }
-  public void setVerbose(boolean v) { verbose = v; }
-  public void setFlipVerticalInGLOrientation(boolean v) { flipVerticalInGLOrientation=v; }
+  public void setDoRotation(final boolean rotate) { doRotate = rotate; }
+  public void setVerbose(final boolean v) { verbose = v; }
+  public void setFlipVerticalInGLOrientation(final boolean v) { flipVerticalInGLOrientation=v; }
 
-  public void setGears(int g1, int g2, int g3) {
+  public void setGears(final int g1, final int g2, final int g3) {
       gear1 = g1;
       gear2 = g2;
       gear3 = g3;
@@ -97,8 +100,8 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
   public int getGear3() { return gear3; }
 
   @Override
-  public void init(GLAutoDrawable drawable) {
-    GL2 gl = drawable.getGL().getGL2();
+  public void init(final GLAutoDrawable drawable) {
+    final GL2 gl = drawable.getGL().getGL2();
 
     init(gl);
 
@@ -109,12 +112,12 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
         window.addKeyListener(gearsKeys);
     } else if (GLProfile.isAWTAvailable() && upstreamWidget instanceof java.awt.Component) {
         final java.awt.Component comp = (java.awt.Component) upstreamWidget;
-        new AWTMouseAdapter(gearsMouse).addTo(comp);
-        new AWTKeyAdapter(gearsKeys).addTo(comp);
+        new AWTMouseAdapter(gearsMouse, drawable).addTo(comp);
+        new AWTKeyAdapter(gearsKeys, drawable).addTo(comp);
     }
   }
 
-  public void init(GL2 gl) {
+  public void init(final GL2 gl) {
     final float lightPos[] = { 5.0f, 5.0f, 10.0f, 0.0f };
     final float red[] = { 0.8f, 0.1f, 0.0f, 0.7f };
     final float green[] = { 0.0f, 0.8f, 0.2f, 0.7f };
@@ -128,20 +131,20 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
         System.err.println(JoglVersion.getGLStrings(gl, null, false).toString());
     }
 
-    gl.glLightfv(GL2.GL_LIGHT0, GL2.GL_POSITION, lightPos, 0);
+    gl.glLightfv(GLLightingFunc.GL_LIGHT0, GLLightingFunc.GL_POSITION, lightPos, 0);
     if( ! ( flipVerticalInGLOrientation && gl.getContext().getGLDrawable().isGLOriented() ) ) {
         // Only possible if we do not flip the projection matrix
-        gl.glEnable(GL2.GL_CULL_FACE);
+        gl.glEnable(GL.GL_CULL_FACE);
     }
-    gl.glEnable(GL2.GL_LIGHTING);
-    gl.glEnable(GL2.GL_LIGHT0);
-    gl.glEnable(GL2.GL_DEPTH_TEST);
+    gl.glEnable(GLLightingFunc.GL_LIGHTING);
+    gl.glEnable(GLLightingFunc.GL_LIGHT0);
+    gl.glEnable(GL.GL_DEPTH_TEST);
 
     /* make the gears */
     if(0>=gear1) {
         gear1 = gl.glGenLists(1);
         gl.glNewList(gear1, GL2.GL_COMPILE);
-        gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE, red, 0);
+        gl.glMaterialfv(GL.GL_FRONT, GLLightingFunc.GL_AMBIENT_AND_DIFFUSE, red, 0);
         gear(gl, 1.0f, 4.0f, 1.0f, 20, 0.7f);
         gl.glEndList();
         System.err.println("gear1 list created: "+gear1);
@@ -152,7 +155,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
     if(0>=gear2) {
         gear2 = gl.glGenLists(1);
         gl.glNewList(gear2, GL2.GL_COMPILE);
-        gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE, green, 0);
+        gl.glMaterialfv(GL.GL_FRONT, GLLightingFunc.GL_AMBIENT_AND_DIFFUSE, green, 0);
         gear(gl, 0.5f, 2.0f, 2.0f, 10, 0.7f);
         gl.glEndList();
         System.err.println("gear2 list created: "+gear2);
@@ -163,7 +166,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
     if(0>=gear3) {
         gear3 = gl.glGenLists(1);
         gl.glNewList(gear3, GL2.GL_COMPILE);
-        gl.glMaterialfv(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE, blue, 0);
+        gl.glMaterialfv(GL.GL_FRONT, GLLightingFunc.GL_AMBIENT_AND_DIFFUSE, blue, 0);
         gear(gl, 1.3f, 2.0f, 0.5f, 10, 0.7f);
         gl.glEndList();
         System.err.println("gear3 list created: "+gear3);
@@ -171,11 +174,11 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
         System.err.println("gear3 list reused: "+gear3);
     }
 
-    gl.glEnable(GL2.GL_NORMALIZE);
+    gl.glEnable(GLLightingFunc.GL_NORMALIZE);
   }
 
   @Override
-  public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+  public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
       final GL2 gl = glad.getGL().getGL2();
       if(-1 != swapInterval) {
           gl.setSwapInterval(swapInterval);
@@ -184,15 +187,15 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
   }
 
   @Override
-  public void reshapeTile(TileRendererBase tr,
-          int tileX, int tileY, int tileWidth, int tileHeight,
-          int imageWidth, int imageHeight) {
+  public void reshapeTile(final TileRendererBase tr,
+          final int tileX, final int tileY, final int tileWidth, final int tileHeight,
+          final int imageWidth, final int imageHeight) {
       final GL2 gl = tr.getAttachedDrawable().getGL().getGL2();
       gl.setSwapInterval(0);
       reshape(gl, tileX, tileY, tileWidth, tileHeight, imageWidth, imageHeight);
   }
 
-  public void reshape(GL2 gl, int tileX, int tileY, int tileWidth, int tileHeight, int imageWidth, int imageHeight) {
+  public void reshape(final GL2 gl, final int tileX, final int tileY, final int tileWidth, final int tileHeight, final int imageWidth, final int imageHeight) {
     final boolean msaa = gl.getContext().getGLDrawable().getChosenGLCapabilities().getSampleBuffers();
     System.err.println(Thread.currentThread()+" Gears.reshape "+tileX+"/"+tileY+" "+tileWidth+"x"+tileHeight+" of "+imageWidth+"x"+imageHeight+", swapInterval "+swapInterval+", drawable 0x"+Long.toHexString(gl.getContext().getGLDrawable().getHandle())+", msaa "+msaa+", tileRendererInUse "+tileRendererInUse);
 
@@ -203,13 +206,13 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
     // compute projection parameters 'normal'
     float left, right, bottom, top;
     if( imageHeight > imageWidth ) {
-        float a = (float)imageHeight / (float)imageWidth;
+        final float a = (float)imageHeight / (float)imageWidth;
         left = -1.0f;
         right = 1.0f;
         bottom = -a;
         top = a;
     } else {
-        float a = (float)imageWidth / (float)imageHeight;
+        final float a = (float)imageWidth / (float)imageHeight;
         left = -a;
         right = a;
         bottom = -1.0f;
@@ -231,14 +234,14 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
         System.err.println(">> Gears angle "+angle+", [l "+left+", r "+right+", b "+bottom+", t "+top+"] "+w+"x"+h+" -> [l "+l+", r "+r+", b "+b+", t "+t+"] "+_w+"x"+_h+", v-flip "+flipVerticalInGLOrientation);
     }
 
-    gl.glMatrixMode(GL2.GL_PROJECTION);
+    gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
     gl.glLoadIdentity();
     if( flipVerticalInGLOrientation && gl.getContext().getGLDrawable().isGLOriented() ) {
         gl.glScalef(1f, -1f, 1f);
     }
     gl.glFrustum(l, r, b, t, 5.0f, 60.0f);
 
-    gl.glMatrixMode(GL2.GL_MODELVIEW);
+    gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
     gl.glLoadIdentity();
     gl.glTranslatef(0.0f, 0.0f, -40.0f);
 
@@ -248,7 +251,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
   }
 
   @Override
-  public void dispose(GLAutoDrawable drawable) {
+  public void dispose(final GLAutoDrawable drawable) {
     System.err.println(Thread.currentThread()+" Gears.dispose: tileRendererInUse "+tileRendererInUse);
     try {
         final Object upstreamWidget = drawable.getUpstreamWidget();
@@ -257,14 +260,14 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
             window.removeMouseListener(gearsMouse);
             window.removeKeyListener(gearsKeys);
         }
-    } catch (Exception e) { System.err.println("Catched: "); e.printStackTrace(); }
+    } catch (final Exception e) { System.err.println("Caught: "); e.printStackTrace(); }
     setGears(0, 0, 0);
   }
 
   @Override
-  public void display(GLAutoDrawable drawable) {
+  public void display(final GLAutoDrawable drawable) {
     // Get the GL corresponding to the drawable we are animating
-    GL2 gl = drawable.getGL().getGL2();
+    final GL2 gl = drawable.getGL().getGL2();
     final boolean msaa = gl.getContext().getGLDrawable().getChosenGLCapabilities().getSampleBuffers();
 
     if( msaa ) {
@@ -283,16 +286,16 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
         (drawable instanceof javax.media.opengl.awt.GLJPanel) &&
         !((javax.media.opengl.awt.GLJPanel) drawable).isOpaque() &&
         ((javax.media.opengl.awt.GLJPanel) drawable).shouldPreserveColorBufferIfTranslucent()) {
-      gl.glClear(GL2.GL_DEPTH_BUFFER_BIT);
+      gl.glClear(GL.GL_DEPTH_BUFFER_BIT);
     } else {
-      gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
+      gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
     }
     displayImpl(gl);
     if( msaa ) {
         gl.glDisable(GL.GL_MULTISAMPLE);
     }
   }
-  public void display(GL2 gl) {
+  public void display(final GL2 gl) {
     final boolean msaa = gl.getContext().getGLDrawable().getChosenGLCapabilities().getSampleBuffers();
     if( msaa ) {
         gl.glEnable(GL.GL_MULTISAMPLE);
@@ -302,13 +305,13 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
     } else {
         gl.glClearColor(1.0f, 1.0f, 1.0f, 0.0f);
     }
-    gl.glClear(GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT);
+    gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
     displayImpl(gl);
     if( msaa ) {
         gl.glDisable(GL.GL_MULTISAMPLE);
     }
   }
-  private void displayImpl(GL2 gl) {
+  private void displayImpl(final GL2 gl) {
     if( doRotate ) {
         // Turn the gears' teeth
         angle += 2.0f;
@@ -346,12 +349,12 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
     gl.glPopMatrix();
   }
 
-  public static void gear(GL2 gl,
-                          float inner_radius,
-                          float outer_radius,
-                          float width,
-                          int teeth,
-                          float tooth_depth)
+  public static void gear(final GL2 gl,
+                          final float inner_radius,
+                          final float outer_radius,
+                          final float width,
+                          final int teeth,
+                          final float tooth_depth)
   {
     int i;
     float r0, r1, r2;
@@ -364,7 +367,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
 
     da = 2.0f * (float) Math.PI / teeth / 4.0f;
 
-    gl.glShadeModel(GL2.GL_FLAT);
+    gl.glShadeModel(GLLightingFunc.GL_FLAT);
 
     gl.glNormal3f(0.0f, 0.0f, 1.0f);
 
@@ -384,7 +387,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
     gl.glEnd();
 
     /* draw front sides of teeth */
-    gl.glBegin(GL2.GL_QUADS);
+    gl.glBegin(GL2GL3.GL_QUADS);
     for (i = 0; i < teeth; i++)
       {
         angle = i * 2.0f * (float) Math.PI / teeth;
@@ -408,7 +411,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
     gl.glEnd();
 
     /* draw back sides of teeth */
-    gl.glBegin(GL2.GL_QUADS);
+    gl.glBegin(GL2GL3.GL_QUADS);
     for (i = 0; i < teeth; i++)
       {
         angle = i * 2.0f * (float) Math.PI / teeth;
@@ -448,7 +451,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
     gl.glVertex3f(r1 * (float)Math.cos(0), r1 * (float)Math.sin(0), -width * 0.5f);
     gl.glEnd();
 
-    gl.glShadeModel(GL2.GL_SMOOTH);
+    gl.glShadeModel(GLLightingFunc.GL_SMOOTH);
 
     /* draw inside radius cylinder */
     gl.glBegin(GL2.GL_QUAD_STRIP);
@@ -463,8 +466,8 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
   }
 
   class GearsKeyAdapter extends KeyAdapter {
-    public void keyPressed(KeyEvent e) {
-        int kc = e.getKeyCode();
+    public void keyPressed(final KeyEvent e) {
+        final int kc = e.getKeyCode();
         if(KeyEvent.VK_LEFT == kc) {
             view_roty -= 1;
         } else if(KeyEvent.VK_RIGHT == kc) {
@@ -478,7 +481,7 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
   }
 
   class GearsMouseAdapter extends MouseAdapter {
-      public void mousePressed(MouseEvent e) {
+      public void mousePressed(final MouseEvent e) {
         prevMouseX = e.getX();
         prevMouseY = e.getY();
         if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0) {
@@ -486,30 +489,34 @@ public class Gears implements GLEventListener, TileRendererBase.TileRendererList
         }
       }
 
-      public void mouseReleased(MouseEvent e) {
+      public void mouseReleased(final MouseEvent e) {
         if ((e.getModifiers() & InputEvent.BUTTON3_MASK) != 0) {
           // mouseRButtonDown = false;
         }
       }
 
-      public void mouseDragged(MouseEvent e) {
-        int x = e.getX();
-        int y = e.getY();
+      public void mouseDragged(final MouseEvent e) {
+        final int x = e.getX();
+        final int y = e.getY();
         int width=0, height=0;
-        Object source = e.getSource();
+        final Object source = e.getSource();
         if(source instanceof Window) {
-            Window window = (Window) source;
-            width=window.getWidth();
-            height=window.getHeight();
+            final Window window = (Window) source;
+            width=window.getSurfaceWidth();
+            height=window.getSurfaceHeight();
+        } else if (source instanceof GLAutoDrawable) {
+            final GLAutoDrawable glad = (GLAutoDrawable) source;
+            width = glad.getSurfaceWidth();
+            height = glad.getSurfaceHeight();
         } else if (GLProfile.isAWTAvailable() && source instanceof java.awt.Component) {
-            java.awt.Component comp = (java.awt.Component) source;
-            width=comp.getWidth();
+            final java.awt.Component comp = (java.awt.Component) source;
+            width=comp.getWidth(); // FIXME HiDPI: May need to convert window units -> pixel units!
             height=comp.getHeight();
         } else {
             throw new RuntimeException("Event source neither Window nor Component: "+source);
         }
-        float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)width);
-        float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)height);
+        final float thetaY = 360.0f * ( (float)(x-prevMouseX)/(float)width);
+        final float thetaX = 360.0f * ( (float)(prevMouseY-y)/(float)height);
 
         prevMouseX = x;
         prevMouseY = y;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Teapot.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Teapot.java
index dac917e..d29688b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Teapot.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/Teapot.java
@@ -6,8 +6,11 @@ import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
+import javax.media.opengl.fixedfunc.GLLightingFunc;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import com.jogamp.common.util.IOUtil;
+import com.jogamp.opengl.test.junit.jogl.util.texture.PNGTstFiles;
 import com.jogamp.opengl.util.gl2.GLUT;
 import com.jogamp.opengl.util.texture.Texture;
 import com.jogamp.opengl.util.texture.TextureIO;
@@ -21,21 +24,21 @@ public class Teapot implements GLEventListener {
     private GLUT glut;
 
     /* glTexGen stuff: */
-    private float sgenparams[] = { 1.0f, 1.0f, 1.0f, 0.0f };
-    
+    private final float sgenparams[] = { 1.0f, 1.0f, 1.0f, 0.0f };
+
     private Texture tex = null;
 
     @Override
-    public void init(GLAutoDrawable drawable) {
-        GL2 gl = drawable.getGL().getGL2();
+    public void init(final GLAutoDrawable drawable) {
+        final GL2 gl = drawable.getGL().getGL2();
         glut = new GLUT();
 
         gl.glClearColor(0.5f, 0.5f, 0.5f, 0.0f);
 
         try {
-            URLConnection urlConn = IOUtil.getResource("jogl/util/data/av/test-ntsc01-57x32.png", this.getClass().getClassLoader());
+            final URLConnection urlConn = IOUtil.getResource(PNGTstFiles.class, "test-ntscP_3-01-160x90.png");
             tex = TextureIO.newTexture(gl, TextureIO.newTextureData(gl.getGLProfile(), urlConn.getInputStream(), false, TextureIO.PNG));
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
         }
         tex.bind(gl);
@@ -54,8 +57,8 @@ public class Teapot implements GLEventListener {
         // gl.glTexImage1D(GL2.GL_TEXTURE_1D, 0, 3, stripeImageWidth, 0,
         // GL.GL_RGB, GL.GL_UNSIGNED_BYTE, stripeImageBuf);
 
-        gl.glTexParameterf(GL2.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_REPEAT);
-        
+        gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_WRAP_S, GL.GL_REPEAT);
+
         // gl.glTexGeni(GL2.GL_S, GL2.GL_TEXTURE_GEN_MODE, GL2.GL_OBJECT_LINEAR);
         // gl.glTexGenfv(GL2.GL_S, GL2.GL_OBJECT_PLANE, sgenparams, 0);
 
@@ -63,28 +66,28 @@ public class Teapot implements GLEventListener {
         gl.glDepthFunc(GL.GL_LESS);
         // gl.glEnable(GL2.GL_TEXTURE_GEN_S);
         // gl.glEnable(GL2.GL_TEXTURE_1D);
-        gl.glEnable(GL2.GL_TEXTURE_2D);
-        gl.glEnable(GL2.GL_CULL_FACE);
-        gl.glEnable(GL2.GL_LIGHTING);
-        gl.glEnable(GL2.GL_LIGHT0);
+        gl.glEnable(GL.GL_TEXTURE_2D);
+        gl.glEnable(GL.GL_CULL_FACE);
+        gl.glEnable(GLLightingFunc.GL_LIGHTING);
+        gl.glEnable(GLLightingFunc.GL_LIGHT0);
         gl.glEnable(GL2.GL_AUTO_NORMAL);
-        gl.glEnable(GL2.GL_NORMALIZE);
+        gl.glEnable(GLLightingFunc.GL_NORMALIZE);
         gl.glFrontFace(GL.GL_CW);
         gl.glCullFace(GL.GL_BACK);
-        gl.glMaterialf(GL.GL_FRONT, GL2.GL_SHININESS, 64.0f);
+        gl.glMaterialf(GL.GL_FRONT, GLLightingFunc.GL_SHININESS, 64.0f);
     }
 
     float angleZ = 0.0f;
     float rotDir = 1.0f;
     public float rotIncr = 0.4f;
-    
+
     @Override
-    public void display(GLAutoDrawable gLDrawable) {
+    public void display(final GLAutoDrawable gLDrawable) {
         final GL2 gl = gLDrawable.getGL().getGL2();
 
         tex.bind(gl);
-        gl.glEnable(GL2.GL_TEXTURE_2D);
-        
+        gl.glEnable(GL.GL_TEXTURE_2D);
+
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
         gl.glPushMatrix();
         gl.glRotatef(angleZ, 0.0f, 1.0f, 0.0f);
@@ -97,28 +100,28 @@ public class Teapot implements GLEventListener {
         } else if (angleZ <= 0.0f ) {
             rotDir = +1.0f;
         }
-        angleZ += rotIncr * rotDir;    
+        angleZ += rotIncr * rotDir;
     }
 
     @Override
-    public void reshape(GLAutoDrawable gLDrawable, int x, int y, int w, int h) {
-        GL2 gl = gLDrawable.getGL().getGL2();
+    public void reshape(final GLAutoDrawable gLDrawable, final int x, final int y, final int w, final int h) {
+        final GL2 gl = gLDrawable.getGL().getGL2();
 
         gl.glViewport(0, 0, w, h);
-        gl.glMatrixMode(GL2.GL_PROJECTION);
+        gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         gl.glLoadIdentity();
         if (w <= h) {
-            gl.glOrtho(-3.5, 3.5, -3.5 * (float) h / (float) w, 
-                        3.5 * (float) h / (float) w, -3.5, 3.5);
+            gl.glOrtho(-3.5, 3.5, -3.5 * h / w,
+                        3.5 * h / w, -3.5, 3.5);
         } else {
-            gl.glOrtho(-3.5 * (float) w / (float) h,
-                        3.5 * (float) w / (float) h, -3.5, 3.5, -3.5, 3.5);
+            gl.glOrtho(-3.5 * w / h,
+                        3.5 * w / h, -3.5, 3.5, -3.5, 3.5);
         }
-        gl.glMatrixMode(GL2.GL_MODELVIEW);
+        gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         gl.glLoadIdentity();
     }
 
     @Override
-    public void dispose(GLAutoDrawable gLDrawable) {
+    public void dispose(final GLAutoDrawable gLDrawable) {
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/TextureDraw01GL2Listener.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/TextureDraw01GL2Listener.java
index fb8e6bf..7862293 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/TextureDraw01GL2Listener.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/TextureDraw01GL2Listener.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.gl2;
 
 import com.jogamp.opengl.test.junit.jogl.demos.TextureDraw01Accessor;
@@ -33,35 +33,39 @@ import com.jogamp.opengl.util.texture.Texture;
 import com.jogamp.opengl.util.texture.TextureCoords;
 import com.jogamp.opengl.util.texture.TextureData;
 import com.jogamp.opengl.util.texture.TextureIO;
+
+import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES1;
 import javax.media.opengl.GL2;
+import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 import javax.media.opengl.glu.GLU;
 
 public class TextureDraw01GL2Listener implements GLEventListener, TextureDraw01Accessor {
-    private GLU      glu = new GLU();
-    private TextureData textureData;
+    private final GLU      glu = new GLU();
+    private final TextureData textureData;
     private Texture  texture;
     boolean keepTextureBound;
-    
-    public TextureDraw01GL2Listener(TextureData td) {
+
+    public TextureDraw01GL2Listener(final TextureData td) {
         this.textureData = td;
         this.keepTextureBound = false;
     }
 
     @Override
-    public void setKeepTextureBound(boolean v) {
+    public void setKeepTextureBound(final boolean v) {
         this.keepTextureBound = v;
     }
     @Override
     public Texture getTexture( ) {
         return this.texture;
     }
-    
+
     @Override
-    public void init(GLAutoDrawable drawable) {
-        GL2 gl = drawable.getGL().getGL2();
+    public void init(final GLAutoDrawable drawable) {
+        final GL2 gl = drawable.getGL().getGL2();
         if(null!=textureData) {
             this.texture = TextureIO.newTexture(drawable.getGL(), textureData);
             if( keepTextureBound ) {
@@ -72,18 +76,18 @@ public class TextureDraw01GL2Listener implements GLEventListener, TextureDraw01A
     }
 
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-        GL2 gl = drawable.getGL().getGL2();
-        gl.glMatrixMode(GL2ES1.GL_PROJECTION);
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+        final GL2 gl = drawable.getGL().getGL2();
+        gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         gl.glLoadIdentity();
         glu.gluOrtho2D(0, 1, 0, 1);
-        gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+        gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         gl.glLoadIdentity();
     }
 
     @Override
-    public void dispose(GLAutoDrawable drawable) {
-        GL2 gl = drawable.getGL().getGL2();
+    public void dispose(final GLAutoDrawable drawable) {
+        final GL2 gl = drawable.getGL().getGL2();
         if(null!=texture) {
             texture.disable(gl);
             texture.destroy(gl);
@@ -94,8 +98,8 @@ public class TextureDraw01GL2Listener implements GLEventListener, TextureDraw01A
     }
 
     @Override
-    public void display(GLAutoDrawable drawable) {
-        GL2 gl = drawable.getGL().getGL2();
+    public void display(final GLAutoDrawable drawable) {
+        final GL2 gl = drawable.getGL().getGL2();
 
         // draw one quad with the texture
         if(null!=texture) {
@@ -103,9 +107,9 @@ public class TextureDraw01GL2Listener implements GLEventListener, TextureDraw01A
                 texture.enable(gl);
                 texture.bind(gl);
             }
-            gl.glTexEnvi(GL2.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_REPLACE);
-            TextureCoords coords = texture.getImageTexCoords();
-            gl.glBegin(GL2.GL_QUADS);
+            gl.glTexEnvi(GL2ES1.GL_TEXTURE_ENV, GL2ES1.GL_TEXTURE_ENV_MODE, GL.GL_REPLACE);
+            final TextureCoords coords = texture.getImageTexCoords();
+            gl.glBegin(GL2GL3.GL_QUADS);
             gl.glTexCoord2f(coords.left(), coords.bottom());
             gl.glVertex3f(0, 0, 0);
             gl.glTexCoord2f(coords.right(), coords.bottom());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/Bug818GLJPanelApplet.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/Bug818GLJPanelApplet.java
index 7e3d78b..8280919 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/Bug818GLJPanelApplet.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/Bug818GLJPanelApplet.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -38,12 +38,14 @@ import java.nio.FloatBuffer;
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
 import javax.media.opengl.GL2ES1;
+import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.awt.GLCanvas;
 import javax.media.opengl.awt.GLJPanel;
 import javax.media.opengl.fixedfunc.GLLightingFunc;
 import javax.media.opengl.fixedfunc.GLMatrixFunc;
+import javax.media.opengl.fixedfunc.GLPointerFunc;
 import javax.swing.JApplet;
 import javax.swing.JPanel;
 import javax.swing.JFrame;
@@ -76,7 +78,7 @@ public class Bug818GLJPanelApplet extends JApplet {
   public static JPanel appletHolder;
   public static boolean isApplet = true;
 
-  static public void main(String args[]) {
+  static public void main(final String args[]) {
     isApplet = false;
 
     final JApplet myApplet = new Bug818GLJPanelApplet();
@@ -88,7 +90,7 @@ public class Bug818GLJPanelApplet extends JApplet {
 
     frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
     frame.addWindowListener(new WindowAdapter() {
-      public void windowClosing(WindowEvent e) {
+      public void windowClosing(final WindowEvent e) {
         System.exit(0);
       }
     });
@@ -101,7 +103,7 @@ public class Bug818GLJPanelApplet extends JApplet {
                 frame.pack();
                 frame.setVisible(true);
             } } );
-    } catch( Throwable throwable ) {
+    } catch( final Throwable throwable ) {
         throwable.printStackTrace();
     }
 
@@ -151,97 +153,97 @@ public class Bug818GLJPanelApplet extends JApplet {
      * Self-contained example (within a single class only to keep it simple) displaying a rotating quad
      */
     static class JOGLQuad implements GLEventListener {
-    
+
         private static final float[] VERTEX_DATA = {
             -1.0f, 1.0f, 0.0f,      // Top Left
             1.0f, 1.0f, 0.0f,       // Top Right
             1.0f, -1.0f, 0.0f,      // Bottom Right
             -1.0f, -1.0f, 0.0f      // Bottom Left
         };
-    
+
         private static final float[] TEXCOORD_DATA = {
             0.0f, 1.0f,     // Top Left
             1.0f, 1.0f,     // Top Right
             1.0f, 0.0f,     // Bottom Right
             0.0f, 0.0f      // Bottom Left
         };
-    
-        private FloatBuffer vertexBuf;
-    
-        private FloatBuffer texCoordBuf;
-    
+
+        private final FloatBuffer vertexBuf;
+
+        private final FloatBuffer texCoordBuf;
+
         private int vertexVBO;
-    
+
         private int texCoordVBO;
-    
+
         private float rotateT = 0.0f;
-    
-        private boolean canvas;
-    
+
+        private final boolean canvas;
+
         private Texture texture;
-    
-        JOGLQuad(boolean canvas) {
-    
+
+        JOGLQuad(final boolean canvas) {
+
             this.canvas = canvas;
-    
+
             ByteBuffer bb = ByteBuffer.allocateDirect(VERTEX_DATA.length * 4);
             bb.order(ByteOrder.nativeOrder());
             vertexBuf = bb.asFloatBuffer();
             vertexBuf.put(VERTEX_DATA);
             vertexBuf.rewind();
-    
+
             bb = ByteBuffer.allocateDirect(TEXCOORD_DATA.length * 4);
             bb.order(ByteOrder.nativeOrder());
             texCoordBuf = bb.asFloatBuffer();
             texCoordBuf.put(TEXCOORD_DATA);
             texCoordBuf.rewind();
         }
-    
+
         @Override
-        public void init(GLAutoDrawable glDrawable) {
-    
+        public void init(final GLAutoDrawable glDrawable) {
+
             final GL2 gl = glDrawable.getGL().getGL2();
-            
+
             System.err.println(VersionUtil.getPlatformInfo());
             System.err.println(JoglVersion.getGLInfo(gl, null, false /* withCapabilitiesAndExtensionInfo */).toString());
-            
+
             gl.glShadeModel(GLLightingFunc.GL_SMOOTH);
             gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
             gl.glClearDepth(1.0f);
             gl.glEnable(GL.GL_DEPTH_TEST);
             gl.glDepthFunc(GL.GL_LEQUAL);
             gl.glHint(GL2ES1.GL_PERSPECTIVE_CORRECTION_HINT, GL.GL_NICEST);
-    
-            int[] tmp = new int[2];
+
+            final int[] tmp = new int[2];
             gl.glGenBuffers(tmp.length, tmp, 0);
             vertexVBO = tmp[0];
             texCoordVBO = tmp[1];
-    
-            gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, vertexVBO);
-            gl.glBufferData(GL2.GL_ARRAY_BUFFER, VERTEX_DATA.length * 4, vertexBuf, GL2.GL_STATIC_DRAW);
-            gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, texCoordVBO);
-            gl.glBufferData(GL2.GL_ARRAY_BUFFER, TEXCOORD_DATA.length * 4, texCoordBuf, GL2.GL_STATIC_DRAW);
-            gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
-    
+
+            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vertexVBO);
+            gl.glBufferData(GL.GL_ARRAY_BUFFER, VERTEX_DATA.length * 4, vertexBuf, GL.GL_STATIC_DRAW);
+            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, texCoordVBO);
+            gl.glBufferData(GL.GL_ARRAY_BUFFER, TEXCOORD_DATA.length * 4, texCoordBuf, GL.GL_STATIC_DRAW);
+            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+
             try {
-                InputStream stream = getClass().getClassLoader().getResourceAsStream("com/jogamp/opengl/test/junit/jogl/util/texture/test-ntscN_3-01-160x90-90pct-yuv444-base.jpg");
+                final InputStream stream = getClass().getClassLoader().getResourceAsStream("com/jogamp/opengl/test/junit/jogl/util/texture/test-ntscN_3-01-160x90-90pct-yuv444-base.jpg");
                 texture = TextureIO.newTexture(stream, true, TextureIO.JPG);
-            } catch (Exception exc) {
+            } catch (final Exception exc) {
                 exc.printStackTrace(System.err);
             }
         }
-    
+
         @Override
-        public void dispose(GLAutoDrawable drawable) {
-    
+        public void dispose(final GLAutoDrawable drawable) {
+
             final GL2 gl = drawable.getGL().getGL2();
-            int[] tmp = new int[] {vertexVBO, texCoordVBO};
+            final int[] tmp = new int[] {vertexVBO, texCoordVBO};
             gl.glGenBuffers(tmp.length, tmp, 0);
         }
-    
+
         @Override
-        public void reshape(GLAutoDrawable gLDrawable, int x, int y, int width, int height) {
-    
+        public void reshape(final GLAutoDrawable gLDrawable, final int x, final int y, final int width, final int height) {
+
             final GL2 gl = gLDrawable.getGL().getGL2();
             final float aspect = (float) width / (float) height;
             gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
@@ -252,55 +254,55 @@ public class Bug818GLJPanelApplet extends JApplet {
             gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
             gl.glLoadIdentity();
         }
-    
+
         @Override
-        public void display(GLAutoDrawable gLDrawable) {
-    
+        public void display(final GLAutoDrawable gLDrawable) {
+
             final GL2 gl = gLDrawable.getGL().getGL2();
-    
+
             gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
             gl.glLoadIdentity();
             gl.glTranslatef(0.0f, 0.0f, -5.0f);
-    
+
             // rotate about the three axes
             gl.glRotatef(rotateT, 1.0f, 0.0f, 0.0f);
             gl.glRotatef(rotateT, 0.0f, 1.0f, 0.0f);
             gl.glRotatef(rotateT, 0.0f, 0.0f, 1.0f);
-    
+
             // set the color of the quad
             if (canvas) {
                 gl.glColor3f(0.2f, 1.0f, 1.0f);
             } else {
                 gl.glColor3f(1.0f, 0.2f, 0.2f);
             }
-    
+
             if (texture != null) {
                 texture.bind(gl);
                 texture.enable(gl);
             } else {
                 System.err.println("no texture");
             }
-    
+
             // Draw A Quad
-            gl.glEnableClientState(GL2.GL_VERTEX_ARRAY);
-            gl.glEnableClientState(GL2.GL_TEXTURE_COORD_ARRAY);
-            gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, vertexVBO);
-            gl.glVertexPointer(3, GL2.GL_FLOAT, 0, 0);
-            gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, texCoordVBO);
-            gl.glTexCoordPointer(2, GL2.GL_FLOAT, 0, 0);
-            gl.glBindBuffer(GL2.GL_ARRAY_BUFFER, 0);
-            gl.glDrawArrays(GL2.GL_QUADS, 0, 4);
-            gl.glDisableClientState(GL2.GL_TEXTURE_COORD_ARRAY);
-            gl.glDisableClientState(GL2.GL_VERTEX_ARRAY);
-    
+            gl.glEnableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
+            gl.glEnableClientState(GLPointerFunc.GL_TEXTURE_COORD_ARRAY);
+            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, vertexVBO);
+            gl.glVertexPointer(3, GL.GL_FLOAT, 0, 0);
+            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, texCoordVBO);
+            gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, 0);
+            gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
+            gl.glDrawArrays(GL2GL3.GL_QUADS, 0, 4);
+            gl.glDisableClientState(GLPointerFunc.GL_TEXTURE_COORD_ARRAY);
+            gl.glDisableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
+
             if (texture != null) {
                 texture.disable(gl);
             }
-    
+
             // increasing rotation for the next iteration
             rotateT += 0.2f;
         }
-    
+
     }
 }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGLJPanelAWTBug450.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGLJPanelAWTBug450.java
index 0a8c406..ee5149b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGLJPanelAWTBug450.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGLJPanelAWTBug450.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -38,6 +38,7 @@ import javax.media.opengl.glu.gl2.GLUgl2;
 
 import com.jogamp.opengl.test.junit.jogl.demos.es2.RedSquareES2;
 import com.jogamp.opengl.test.junit.util.UITestCase;
+
 import java.awt.AWTException;
 import java.awt.BorderLayout;
 import java.lang.reflect.InvocationTargetException;
@@ -56,7 +57,7 @@ import org.junit.runners.MethodSorters;
 /**
  * Test for bug 450, which causes the right part of the frame to be black
  * for all x >= height.
- * 
+ *
  * Draws the Gears demo in a window that's twice as wide than it is tall,
  * and checks to see if a particular pixel in the right half of the frame
  * is colored.
@@ -86,7 +87,7 @@ public class TestGLJPanelAWTBug450 extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilities caps)
+    protected void runTestGL(final GLCapabilities caps)
             throws AWTException, InterruptedException, InvocationTargetException
     {
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
@@ -95,26 +96,26 @@ public class TestGLJPanelAWTBug450 extends UITestCase {
 
         final GLJPanel glJPanel = new GLJPanel(caps);
         Assert.assertNotNull(glJPanel);
-        RedSquareES2 demo = new RedSquareES2();
+        final RedSquareES2 demo = new RedSquareES2();
         demo.setAspect((float)width/(float)height);
         demo.setDoRotation(false);
         glJPanel.addGLEventListener(demo);
         glJPanel.addGLEventListener(new GLEventListener() {
             int f = 0;
             @Override
-            public void init(GLAutoDrawable drawable) {
-                // drawable.getGL().glClearColor(0, 0, 1, 1);                
+            public void init(final GLAutoDrawable drawable) {
+                // drawable.getGL().glClearColor(0, 0, 1, 1);
             }
             @Override
-            public void display(GLAutoDrawable drawable) {
+            public void display(final GLAutoDrawable drawable) {
                 // look at one pixel at the bottom of the frame, just right of
                 // the center line, and make sure it's not black
-                GL2 gl = GLUgl2.getCurrentGL2();
-                ByteBuffer bytebuffer = ByteBuffer.allocateDirect( 3 );
-                gl.glReadPixels( r_x, r_y, 1, 1, GL2.GL_BGR, GL2.GL_UNSIGNED_BYTE, bytebuffer );
-                byte byte0 = bytebuffer.get( 0 );
-                byte byte1 = bytebuffer.get( 1 );
-                byte byte2 = bytebuffer.get( 2 );
+                final GL2 gl = GLUgl2.getCurrentGL2();
+                final ByteBuffer bytebuffer = ByteBuffer.allocateDirect( 3 );
+                gl.glReadPixels( r_x, r_y, 1, 1, GL2GL3.GL_BGR, GL.GL_UNSIGNED_BYTE, bytebuffer );
+                final byte byte0 = bytebuffer.get( 0 );
+                final byte byte1 = bytebuffer.get( 1 );
+                final byte byte2 = bytebuffer.get( 2 );
                 if( (byte0 == 0) && (byte1 == 0) && (byte2 == 0) ) {
                     failed = true;
                 }
@@ -125,12 +126,12 @@ public class TestGLJPanelAWTBug450 extends UITestCase {
                 f++;
             }
             @Override
-            public void dispose(GLAutoDrawable drawable) {}
+            public void dispose(final GLAutoDrawable drawable) {}
             @Override
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
 
-        FPSAnimator animator = new FPSAnimator(glJPanel, 60);
+        final FPSAnimator animator = new FPSAnimator(glJPanel, 60);
 
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
@@ -139,7 +140,7 @@ public class TestGLJPanelAWTBug450 extends UITestCase {
                     frame.setVisible(true);
                 } } ) ;
 
-        animator.setUpdateFPSFrames(1, null);        
+        animator.setUpdateFPSFrames(1, null);
         animator.start();
         Assert.assertEquals(true, animator.isAnimating());
 
@@ -169,19 +170,19 @@ public class TestGLJPanelAWTBug450 extends UITestCase {
     public void test01()
             throws AWTException, InterruptedException, InvocationTargetException
     {
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         runTestGL(caps);
     }
 
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         org.junit.runner.JUnitCore.main(TestGLJPanelAWTBug450.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java
index 24a6d57..8e2b02f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,23 +20,24 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.gl2.awt;
 
 import javax.media.opengl.*;
 
 import com.jogamp.opengl.util.Animator;
+
 import javax.media.opengl.awt.GLCanvas;
+
 import com.jogamp.newt.event.awt.AWTKeyAdapter;
 import com.jogamp.newt.event.awt.AWTWindowAdapter;
 import com.jogamp.newt.event.TraceKeyAdapter;
 import com.jogamp.newt.event.TraceWindowAdapter;
-
 import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
@@ -80,13 +81,13 @@ public class TestGearsAWT extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilities caps) throws InterruptedException, InvocationTargetException {
+    protected void runTestGL(final GLCapabilities caps) throws InterruptedException, InvocationTargetException {
         final Frame frame = new Frame("Gears AWT Test");
         Assert.assertNotNull(frame);
 
         final GLCanvas glCanvas = new GLCanvas(caps);
         Assert.assertNotNull(glCanvas);
-        Dimension glc_sz = new Dimension(width, height);
+        final Dimension glc_sz = new Dimension(width, height);
         glCanvas.setMinimumSize(glc_sz);
         glCanvas.setPreferredSize(glc_sz);
         glCanvas.setSize(glc_sz);
@@ -94,18 +95,18 @@ public class TestGearsAWT extends UITestCase {
 
         glCanvas.addGLEventListener(new Gears(1));
 
-        Animator animator = new Animator(glCanvas);
-        QuitAdapter quitAdapter = new QuitAdapter();
-
-        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(glCanvas);
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter), glCanvas).addTo(glCanvas);
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glCanvas).addTo(frame);
 
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 frame.pack();
                 frame.setVisible(true);
             }});
-        animator.setUpdateFPSFrames(60, System.err);        
+
+        final Animator animator = new Animator(glCanvas);
+        animator.setUpdateFPSFrames(60, System.err);
         animator.start();
 
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
@@ -132,7 +133,7 @@ public class TestGearsAWT extends UITestCase {
 
     @Test
     public void test01() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         if( msaaCount > 0 ) {
             caps.setSampleBuffers(true);
             caps.setNumSamples(msaaCount);
@@ -142,28 +143,28 @@ public class TestGearsAWT extends UITestCase {
 
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             } else if(args[i].equals("-msaa")) {
                 i++;
                 try {
                     msaaCount = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             } else if(args[i].equals("-wait")) {
                 waitForKey = true;
-            }            
+            }
         }
         if(waitForKey) {
-            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+            final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
             System.err.println("Press enter to continue");
             try {
                 System.err.println(stdin.readLine());
-            } catch (IOException e) { }
+            } catch (final IOException e) { }
         }
         org.junit.runner.JUnitCore.main(TestGearsAWT.class.getName());
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWTAnalyzeBug455.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWTAnalyzeBug455.java
index 66b9e4a..751bd44 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWTAnalyzeBug455.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsAWTAnalyzeBug455.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,26 +20,28 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.gl2.awt;
 
 import javax.media.opengl.*;
 
 import com.jogamp.opengl.util.Animator;
+
 import javax.media.opengl.awt.GLCanvas;
+
 import com.jogamp.newt.event.awt.AWTKeyAdapter;
 import com.jogamp.newt.event.awt.AWTWindowAdapter;
 import com.jogamp.newt.event.TraceKeyAdapter;
 import com.jogamp.newt.event.TraceWindowAdapter;
-
 import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
+
 import java.awt.Frame;
 import java.io.BufferedReader;
 import java.io.IOException;
@@ -79,28 +81,28 @@ public class TestGearsAWTAnalyzeBug455 extends UITestCase {
     }
 
     static class Swapper implements GLEventListener {
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
             System.err.println("auto-swap: "+drawable.getAutoSwapBufferMode());
         }
-        public void dispose(GLAutoDrawable drawable) {
+        public void dispose(final GLAutoDrawable drawable) {
         }
-        public void display(GLAutoDrawable drawable) {
+        public void display(final GLAutoDrawable drawable) {
             if(!drawable.getAutoSwapBufferMode()) {
-                GL2 gl = drawable.getGL().getGL2();
+                final GL2 gl = drawable.getGL().getGL2();
                 // copy the colored content of the back buffer into the front buffer
                 // gl.glPushAttrib(GL.GL_COLOR_BUFFER_BIT);
                 gl.glReadBuffer(GL.GL_BACK);  // def. in dbl buff mode: GL_BACK
                 gl.glDrawBuffer(GL.GL_FRONT); // def. in dbl buff mode: GL_BACK
-                gl.glCopyPixels(0, 0, drawable.getWidth(), drawable.getHeight(), GL2.GL_COLOR);
+                gl.glCopyPixels(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight(), GL2ES3.GL_COLOR);
                 // gl.glPopAttrib();
                 gl.glDrawBuffer(GL.GL_BACK); // def. in dbl buff mode: GL_BACK
-            }            
+            }
+        }
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width,
+                final int height) {
         }
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width,
-                int height) {
-        }        
     }
-    protected void runTestGL(GLCapabilities caps) throws InterruptedException, InvocationTargetException {
+    protected void runTestGL(final GLCapabilities caps) throws InterruptedException, InvocationTargetException {
         final Frame frame = new Frame("Gears AWT Test");
         Assert.assertNotNull(frame);
 
@@ -112,18 +114,18 @@ public class TestGearsAWTAnalyzeBug455 extends UITestCase {
         glCanvas.addGLEventListener(new Gears(0));
         glCanvas.addGLEventListener(new Swapper());
 
-        Animator animator = new Animator(glCanvas);
-        QuitAdapter quitAdapter = new QuitAdapter();
-
-        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(glCanvas);
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter), glCanvas).addTo(glCanvas);
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glCanvas).addTo(frame);
 
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 frame.setSize(512, 512);
                 frame.setVisible(true);
             }});
-        animator.setUpdateFPSFrames(60, System.err);        
+
+        final Animator animator = new Animator(glCanvas);
+        animator.setUpdateFPSFrames(60, System.err);
         animator.start();
 
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
@@ -150,18 +152,18 @@ public class TestGearsAWTAnalyzeBug455 extends UITestCase {
 
     @Test
     public void test01() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setDoubleBuffered(true); // code assumes dbl buffer setup
         runTestGL(caps);
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             } else if(args[i].equals("-wait")) {
                 waitForKey = true;
             } else if(args[i].equals("-autoswap")) {
@@ -170,11 +172,11 @@ public class TestGearsAWTAnalyzeBug455 extends UITestCase {
         }
         System.err.println("altSwap "+altSwap);
         if(waitForKey) {
-            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+            final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
             System.err.println("Press enter to continue");
             try {
                 System.err.println(stdin.readLine());
-            } catch (IOException e) { }
+            } catch (final IOException e) { }
         }
         org.junit.runner.JUnitCore.main(TestGearsAWTAnalyzeBug455.class.getName());
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java
index 5de08c7..3650e49 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/awt/TestGearsGLJPanelAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.gl2.awt;
 
 import javax.media.opengl.*;
@@ -35,6 +35,7 @@ import com.jogamp.newt.event.TraceWindowAdapter;
 import com.jogamp.newt.event.awt.AWTKeyAdapter;
 import com.jogamp.newt.event.awt.AWTWindowAdapter;
 import com.jogamp.opengl.util.FPSAnimator;
+
 import javax.media.opengl.awt.GLJPanel;
 
 import com.jogamp.opengl.test.junit.jogl.demos.gl2.Gears;
@@ -46,6 +47,7 @@ import java.awt.AWTException;
 import java.awt.BorderLayout;
 import java.awt.Dimension;
 import java.lang.reflect.InvocationTargetException;
+
 import javax.swing.JFrame;
 import javax.swing.SwingUtilities;
 
@@ -83,7 +85,7 @@ public class TestGearsGLJPanelAWT extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilities caps)
+    protected void runTestGL(final GLCapabilities caps)
             throws AWTException, InterruptedException, InvocationTargetException
     {
         final JFrame frame = new JFrame("Swing GLJPanel");
@@ -91,7 +93,7 @@ public class TestGearsGLJPanelAWT extends UITestCase {
 
         final GLJPanel glJPanel = new GLJPanel(caps);
         Assert.assertNotNull(glJPanel);
-        Dimension glc_sz = new Dimension(width, height);
+        final Dimension glc_sz = new Dimension(width, height);
         glJPanel.setMinimumSize(glc_sz);
         glJPanel.setPreferredSize(glc_sz);
         glJPanel.setSize(glc_sz);
@@ -115,11 +117,10 @@ public class TestGearsGLJPanelAWT extends UITestCase {
             Assert.assertEquals(true, animator.isAnimating());
         }
 
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter), glJPanel).addTo(glJPanel);
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glJPanel).addTo(frame);
 
-        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(glJPanel);
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
-        
         final long t0 = System.currentTimeMillis();
         long t1 = t0;
         boolean triggerSnap = false;
@@ -156,7 +157,7 @@ public class TestGearsGLJPanelAWT extends UITestCase {
     public void test01_DefaultNorm()
             throws AWTException, InterruptedException, InvocationTargetException
     {
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         if(useMSAA) {
             caps.setNumSamples(4);
             caps.setSampleBuffers(true);
@@ -177,12 +178,12 @@ public class TestGearsGLJPanelAWT extends UITestCase {
         if( manualTest ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         caps.setNumSamples(4);
         caps.setSampleBuffers(true);
         runTestGL(caps);
     }
-    
+
     @Test
     public void test03_PbufferNorm()
             throws AWTException, InterruptedException, InvocationTargetException
@@ -190,11 +191,11 @@ public class TestGearsGLJPanelAWT extends UITestCase {
         if( manualTest ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         caps.setPBuffer(true);
         runTestGL(caps);
     }
-    
+
     @Test
     public void test04_PbufferMsaa()
             throws AWTException, InterruptedException, InvocationTargetException
@@ -202,13 +203,13 @@ public class TestGearsGLJPanelAWT extends UITestCase {
         if( manualTest ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         caps.setNumSamples(4);
         caps.setSampleBuffers(true);
         caps.setPBuffer(true);
         runTestGL(caps);
     }
-    
+
     @Test
     public void test05_BitmapNorm()
             throws AWTException, InterruptedException, InvocationTargetException
@@ -216,11 +217,11 @@ public class TestGearsGLJPanelAWT extends UITestCase {
         if( manualTest ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         caps.setBitmap(true);
         runTestGL(caps);
     }
-    
+
     @Test
     public void test06_BitmapMsaa()
             throws AWTException, InterruptedException, InvocationTargetException
@@ -228,16 +229,16 @@ public class TestGearsGLJPanelAWT extends UITestCase {
         if( manualTest ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getDefault());
         caps.setNumSamples(4);
         caps.setSampleBuffers(true);
         caps.setBitmap(true);
         runTestGL(caps);
     }
-    
+
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
@@ -263,7 +264,7 @@ public class TestGearsGLJPanelAWT extends UITestCase {
         System.err.println("shallUsePBuffer "+shallUsePBuffer);
         System.err.println("shallUseBitmap "+shallUseBitmap);
         System.err.println("manualTest "+manualTest);
-        
+
         org.junit.runner.JUnitCore.main(TestGearsGLJPanelAWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java
index a513425..4cefd95 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.gl2.newt;
 
 import com.jogamp.newt.event.KeyAdapter;
@@ -69,15 +69,15 @@ public class TestGearsNEWT extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilities caps) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
+    protected void runTestGL(final GLCapabilities caps) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle("Gears NEWT Test");
 
         glWindow.addGLEventListener(new Gears());
 
-        Animator animator = new Animator(glWindow);
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final Animator animator = new Animator(glWindow);
+        final QuitAdapter quitAdapter = new QuitAdapter();
 
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -86,10 +86,10 @@ public class TestGearsNEWT extends UITestCase {
 
         final GLWindow f_glWindow = glWindow;
         glWindow.addKeyListener(new KeyAdapter() {
-            public void keyReleased(KeyEvent e) {
+            public void keyReleased(final KeyEvent e) {
                 if( !e.isPrintableKey() || e.isAutoRepeat() ) {
                     return;
-                }            
+                }
                 if(e.getKeyChar()=='f') {
                     new Thread() {
                         public void run() {
@@ -119,19 +119,19 @@ public class TestGearsNEWT extends UITestCase {
 
     @Test
     public void test01() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps);
     }
 
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         org.junit.runner.JUnitCore.main(TestGearsNEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java
index 84e6670..beee5ff 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestGearsNewtAWTWrapper.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.gl2.newt;
 
 import javax.media.nativewindow.*;
@@ -69,19 +69,19 @@ public class TestGearsNewtAWTWrapper extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException {
-        Display nDisplay = NewtFactory.createDisplay(NativeWindowFactory.TYPE_AWT, null, false); // local display
-        Screen nScreen  = NewtFactory.createScreen(nDisplay, 0); // screen 0
-        Window nWindow = NewtFactory.createWindow(nScreen, caps);
+    protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException {
+        final Display nDisplay = NewtFactory.createDisplay(NativeWindowFactory.TYPE_AWT, null, false); // local display
+        final Screen nScreen  = NewtFactory.createScreen(nDisplay, 0); // screen 0
+        final Window nWindow = NewtFactory.createWindow(nScreen, caps);
 
-        GLWindow glWindow = GLWindow.create(nWindow);
+        final GLWindow glWindow = GLWindow.create(nWindow);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle("Gears NewtAWTWrapper Test");
 
         glWindow.addGLEventListener(new GearsES2(1));
 
-        Animator animator = useAnimator ? new Animator(glWindow) : null;
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final Animator animator = useAnimator ? new Animator(glWindow) : null;
+        final QuitAdapter quitAdapter = new QuitAdapter();
 
         glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
@@ -89,28 +89,35 @@ public class TestGearsNewtAWTWrapper extends UITestCase {
         if( useAnimator ) {
             animator.start();
         }
-        
+
         int div = 3;
         glWindow.setSize(width/div, height/div);
         glWindow.setVisible(true);
         if( doResizeTest ) {
             glWindow.display();
-            Assert.assertTrue("Size not reached: Expected "+(width/div)+"x"+(height/div)+", Is "+glWindow.getWidth()+"x"+glWindow.getHeight(), 
-                              AWTRobotUtil.waitForSize(glWindow, width/div, height/div));
+            final int[] expSurfaceSize = glWindow.getNativeSurface().convertToPixelUnits(new int[] { width/div, height/div });
+            Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight(),
+                              AWTRobotUtil.waitForSize(glWindow, expSurfaceSize[0], expSurfaceSize[1]));
             Thread.sleep(600);
-    
+
             div = 2;
             glWindow.setSize(width/div, height/div);
             glWindow.display();
-            Assert.assertTrue("Size not reached: Expected "+(width/div)+"x"+(height/div)+", Is "+glWindow.getWidth()+"x"+glWindow.getHeight(), 
-                              AWTRobotUtil.waitForSize(glWindow, width/div, height/div));
+            expSurfaceSize[0] = width/div;
+            expSurfaceSize[1] = height/div;
+            glWindow.getNativeSurface().convertToPixelUnits(expSurfaceSize);
+            Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight(),
+                              AWTRobotUtil.waitForSize(glWindow, expSurfaceSize[0], expSurfaceSize[1]));
             Thread.sleep(600);
-               
+
             div = 1;
             glWindow.setSize(width/div, height/div);
             glWindow.display();
-            Assert.assertTrue("Size not reached: Expected "+(width/div)+"x"+(height/div)+", Is "+glWindow.getWidth()+"x"+glWindow.getHeight(), 
-                              AWTRobotUtil.waitForSize(glWindow, width/div, height/div));
+            expSurfaceSize[0] = width/div;
+            expSurfaceSize[1] = height/div;
+            glWindow.getNativeSurface().convertToPixelUnits(expSurfaceSize);
+            Assert.assertTrue("Surface Size not reached: Expected "+expSurfaceSize[0]+"x"+expSurfaceSize[1]+", Is "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight(),
+                              AWTRobotUtil.waitForSize(glWindow, expSurfaceSize[0], expSurfaceSize[1]));
             Thread.sleep(600);
         }
 
@@ -129,11 +136,11 @@ public class TestGearsNewtAWTWrapper extends UITestCase {
 
     @Test
     public void test01() throws InterruptedException {
-        GLCapabilitiesImmutable caps = new GLCapabilities(glp);
+        final GLCapabilitiesImmutable caps = new GLCapabilities(glp);
         runTestGL(caps);
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestTeapotNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestTeapotNEWT.java
index 5a22fc7..975d35a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestTeapotNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl2/newt/TestTeapotNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.demos.gl2.newt;
 
 import com.jogamp.newt.opengl.GLWindow;
@@ -67,11 +67,11 @@ public class TestTeapotNEWT extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilities caps, boolean withAnimator) throws InterruptedException {
+    protected void runTestGL(final GLCapabilities caps, final boolean withAnimator) throws InterruptedException {
         final GLWindow glWindow = GLWindow.create(caps);
-        
+
         glWindow.setTitle("Teapot NEWT Test");
-        Teapot demo = new Teapot();
+        final Teapot demo = new Teapot();
         if( !withAnimator ) {
             demo.rotIncr *= 10f;
         }
@@ -119,13 +119,13 @@ public class TestTeapotNEWT extends UITestCase {
         final GLCapabilities caps = new GLCapabilities(GLProfile.getMaxFixedFunc(true));
         runTestGL(caps, true);
     }
-    
+
     @Test
     public void test02_DefCaps_NoAnim() throws InterruptedException {
         final GLCapabilities caps = new GLCapabilities(GLProfile.getMaxFixedFunc(true));
         runTestGL(caps, false);
     }
-    
+
     @Test
     public void test12_FBOCaps_NoAnim() throws InterruptedException {
         final GLCapabilities caps = new GLCapabilities(GLProfile.getMaxFixedFunc(true));
@@ -148,13 +148,13 @@ public class TestTeapotNEWT extends UITestCase {
 
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         org.junit.runner.JUnitCore.main(TestTeapotNEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/GeomShader01TextureGL3.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/GeomShader01TextureGL3.java
index e692863..30840c1 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/GeomShader01TextureGL3.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/GeomShader01TextureGL3.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -60,10 +60,10 @@ import com.jogamp.opengl.util.texture.TextureIO;
  * geometry shader.
  * </p>
  * <p>
- * If the <code>XYZ flipping</code> geometry shader functions properly, 
+ * If the <code>XYZ flipping</code> geometry shader functions properly,
  * the texture will be flipped horizontally and vertically.
- * </p> 
- * 
+ * </p>
+ *
  * @author Chuck Ritola December 2012
  * @author Sven Gothel (GL3 core, pass-though, core geometry shader)
  */
@@ -77,13 +77,13 @@ public class GeomShader01TextureGL3 implements GLEventListener  {
 
     static final String shaderBasename = "texture01_xxx";
     static final String[] geomShaderBaseNames = new String[] { "passthrough01_xxx", "flipXYZ01_xxx" };
-    
-    public GeomShader01TextureGL3(int geomShader) {
+
+    public GeomShader01TextureGL3(final int geomShader) {
         this.geomShader = geomShader;
     }
 
     @Override
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         {
             final GL gl = drawable.getGL();
             System.err.println("Init - START - useGeomShader "+geomShader+" -> "+geomShaderBaseNames[geomShader]);
@@ -100,22 +100,22 @@ public class GeomShader01TextureGL3 implements GLEventListener  {
             if( !ShaderUtil.isGeometryShaderSupported(gl) ) {
                 throw new RuntimeException("GL object not >= 3.2, i.e. no geometry shader support.: "+gl);
             }
-        }        
+        }
         final GL3 gl = drawable.getGL().getGL3();
 
         final ShaderProgram sp;
         {
             final ShaderCode vs, gs, fs;
-            vs = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(), 
+            vs = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, this.getClass(),
                                    "shader", "shader/bin", shaderBasename, true);
-            gs = ShaderCode.create(gl, GL3.GL_GEOMETRY_SHADER, this.getClass(), 
+            gs = ShaderCode.create(gl, GL3.GL_GEOMETRY_SHADER, this.getClass(),
                                    "shader", "shader/bin", geomShaderBaseNames[geomShader], true);
-            fs = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(), 
-                                   "shader", "shader/bin", shaderBasename, true);        
+            fs = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, this.getClass(),
+                                   "shader", "shader/bin", shaderBasename, true);
             vs.defaultShaderCustomization(gl, true, true);
             gs.defaultShaderCustomization(gl, true, true);
             fs.defaultShaderCustomization(gl, true, true);
-            
+
             sp = new ShaderProgram();
             sp.add(gl, vs, System.err);
             sp.add(gl, gs, System.err);
@@ -124,20 +124,20 @@ public class GeomShader01TextureGL3 implements GLEventListener  {
                 throw new GLException("Couldn't link program: "+sp);
             }
         }
-        
+
         st=new ShaderState();
         st.attachShaderProgram(gl, sp, true);
-        
+
         // setup mgl_PMVMatrix
         pmvMatrix = new PMVMatrix();
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
+        pmvMatrix.glLoadIdentity();
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
-        pmvMatrix.glLoadIdentity();       
         pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf()); // P, Mv
         st.ownUniform(pmvMatrixUniform);
-        st.uniform(gl, pmvMatrixUniform);        
-        
+        st.uniform(gl, pmvMatrixUniform);
+
         st.ownUniform(pmvMatrixUniform);
         if(!st.uniform(gl, pmvMatrixUniform)) {
             throw new GLException("Error setting PMVMatrix in shader: "+st);
@@ -148,19 +148,19 @@ public class GeomShader01TextureGL3 implements GLEventListener  {
 
         try {
             texture = createTestTexture(gl);
-        } catch (IOException e) {
+        } catch (final IOException e) {
             throw new RuntimeException(e);
         }
         if(null == texture) {
             throw new RuntimeException("Could not load test texture");
         }
-        
+
         // Tri order:
         //   TL, BL, BR
         //   TL, TR, BR
         {
             int i=0;
-            TextureCoords tc = texture.getImageTexCoords();        
+            final TextureCoords tc = texture.getImageTexCoords();
             s_triTexCoords[i++] = tc.left();  s_triTexCoords[i++] = tc.top();
             s_triTexCoords[i++] = tc.left();  s_triTexCoords[i++] = tc.bottom();
             s_triTexCoords[i++] = tc.right(); s_triTexCoords[i++] = tc.bottom();
@@ -168,31 +168,31 @@ public class GeomShader01TextureGL3 implements GLEventListener  {
             s_triTexCoords[i++] = tc.right(); s_triTexCoords[i++] = tc.top();
             s_triTexCoords[i++] = tc.right(); s_triTexCoords[i++] = tc.bottom();
         }
-        
+
         interleavedVBO = GLArrayDataServer.createGLSLInterleaved(2+4+2, GL.GL_FLOAT, false, 3*6, GL.GL_STATIC_DRAW);
-        {        
+        {
             interleavedVBO.addGLSLSubArray("mgl_Vertex",        2, GL.GL_ARRAY_BUFFER);
             interleavedVBO.addGLSLSubArray("mgl_Color",         4, GL.GL_ARRAY_BUFFER);
             interleavedVBO.addGLSLSubArray("mgl_MultiTexCoord", 2, GL.GL_ARRAY_BUFFER);
 
-            FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
-            
+            final FloatBuffer ib = (FloatBuffer)interleavedVBO.getBuffer();
+
             for(int i=0; i<6; i++) {
                 ib.put(s_triVertices,  i*2, 2);
                 ib.put(s_triColors,    i*4, 4);
                 ib.put(s_triTexCoords, i*2, 2);
-            }                        
+            }
         }
         interleavedVBO.seal(gl, true);
         interleavedVBO.enableBuffer(gl, false);
         st.ownAttribute(interleavedVBO, true);
-        
+
         gl.glClearColor(0f, 0f, 0f, 0f);
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
         st.useProgram(gl, false);
     }
 
-    private Texture createTestTexture(GL3 gl) throws IOException  {
+    private Texture createTestTexture(final GL3 gl) throws IOException  {
         final URLConnection urlConn = IOUtil.getResource(this.getClass(), "../../util/texture/test-ntscN_3-01-160x90.png");
         if(null == urlConn) { return null; }
         final InputStream istream = urlConn.getInputStream();
@@ -202,9 +202,9 @@ public class GeomShader01TextureGL3 implements GLEventListener  {
         texData.destroy();
         return res;
     }
-    
+
     @Override
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         final GL3 gl = drawable.getGL().getGL3();
         if(null!=texture) {
             texture.disable(gl);
@@ -213,19 +213,18 @@ public class GeomShader01TextureGL3 implements GLEventListener  {
 
         if(null != st) {
             pmvMatrixUniform = null;
-            pmvMatrix.destroy();
             pmvMatrix=null;
             st.destroy(gl);
             st=null;
         }
     }
-    
+
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-        GL3 gl = drawable.getGL().getGL3();
-        
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+        final GL3 gl = drawable.getGL().getGL3();
+
         gl.setSwapInterval(1);
-        
+
         // Clear background to white
         gl.glClearColor(1.0f, 1.0f, 1.0f, 0.4f);
 
@@ -233,42 +232,42 @@ public class GeomShader01TextureGL3 implements GLEventListener  {
             pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
             pmvMatrix.glLoadIdentity();
             pmvMatrix.glOrthof(-1.0f, 1.0f, -1.0f, 1.0f, 0.0f, 10.0f);
-    
+
             pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
             pmvMatrix.glLoadIdentity();
-            
+
             st.useProgram(gl, true);
             st.uniform(gl, pmvMatrixUniform);
             st.useProgram(gl, false);
-        }        
+        }
     }
-    
+
     @Override
-    public void display(GLAutoDrawable drawable)  {
+    public void display(final GLAutoDrawable drawable)  {
         final GL3 gl = drawable.getGL().getGL3();
-        
+
         gl.glClear(GL.GL_DEPTH_BUFFER_BIT | GL.GL_COLOR_BUFFER_BIT);
 
         if(null != st) {
             //Draw the image as a pseudo-quad using two triangles
-            st.useProgram(gl, true);        
+            st.useProgram(gl, true);
             interleavedVBO.enableBuffer(gl, true);
             gl.glActiveTexture(GL.GL_TEXTURE0);
             texture.enable(gl);
             texture.bind(gl);
-            
+
             gl.glDrawArrays(GL.GL_TRIANGLES, 0, 6);
-            
-            texture.disable(gl);                                
-            interleavedVBO.enableBuffer(gl, false);        
+
+            texture.disable(gl);
+            interleavedVBO.enableBuffer(gl, false);
             st.useProgram(gl, false);
         }
     }//end display()
-    
-    private static final float[] s_triVertices = { 
+
+    private static final float[] s_triVertices = {
            -1f,  1f, // TL
            -1f, -1f, // BL
-            1f, -1f, // BR   
+            1f, -1f, // BR
            -1f,  1f, // TL
             1f,  1f, // TR
             1f, -1f  // BR
@@ -281,13 +280,13 @@ public class GeomShader01TextureGL3 implements GLEventListener  {
             1f, 1f, 1f, 1f,
             1f, 1f, 1f, 1f
     };
-    private static final float[] s_triTexCoords = { 
+    private static final float[] s_triTexCoords = {
             0f, 1f, // TL
             0f, 0f, // BL
-            1f, 0f, // BR   
+            1f, 0f, // BR
             0f, 1f, // TL
             1f, 1f, // TR
             1f, 0f  // BR
     };
-    
+
 }//end Test
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/newt/TestGeomShader01TextureGL3NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/newt/TestGeomShader01TextureGL3NEWT.java
index 8e582bd..583334e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/newt/TestGeomShader01TextureGL3NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/demos/gl3/newt/TestGeomShader01TextureGL3NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -51,73 +51,73 @@ import com.jogamp.opengl.util.Animator;
 public class TestGeomShader01TextureGL3NEWT extends UITestCase {
     static long duration = 500; // ms
 
-    static GLCapabilities getCaps(String profile) {
+    static GLCapabilities getCaps(final String profile) {
         if( !GLProfile.isAvailable(profile) )  {
             System.err.println("Profile "+profile+" n/a");
             return null;
         }
         return new GLCapabilities(GLProfile.get(profile));
     }
-    
+
     @Test
     public void test01_GL3Core_Passthrough() throws InterruptedException {
-        GLCapabilities caps = getCaps(GLProfile.GL3);
+        final GLCapabilities caps = getCaps(GLProfile.GL3);
         if( null == caps ) { return; }
         testImpl(caps, 0);
     }
-    
+
     @Test
     public void test02_GL3Core_FlipXYZ() throws InterruptedException {
-        GLCapabilities caps = getCaps(GLProfile.GL3);
+        final GLCapabilities caps = getCaps(GLProfile.GL3);
         if( null == caps ) { return; }
         testImpl(caps, 1);
     }
-    
+
     @Test
     public void test11_GL3Compat_Passthrough() throws InterruptedException {
-        GLCapabilities caps = getCaps(GLProfile.GL3bc);
+        final GLCapabilities caps = getCaps(GLProfile.GL3bc);
         if( null == caps ) { return; }
         testImpl(caps, 0);
     }
-    
+
     @Test
     public void test12_GL3Compat_FlipXYZ() throws InterruptedException {
-        GLCapabilities caps = getCaps(GLProfile.GL3bc);
+        final GLCapabilities caps = getCaps(GLProfile.GL3bc);
         if( null == caps ) { return; }
         testImpl(caps, 1);
     }
-    
-    private void testImpl(GLCapabilities caps, int geomShader) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
+
+    private void testImpl(final GLCapabilities caps, final int geomShader) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setSize(800, 600);
         glWindow.setVisible(true);
         glWindow.setTitle("JOGL Geometry Shader Banana Test");
         Assert.assertTrue(glWindow.isNativeValid());
-        
-        QuitAdapter quitAdapter = new QuitAdapter();
+
+        final QuitAdapter quitAdapter = new QuitAdapter();
         glWindow.addKeyListener(quitAdapter);
         glWindow.addWindowListener(quitAdapter);
         glWindow.addGLEventListener( new GeomShader01TextureGL3(geomShader) );
-        
+
         final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
         glWindow.addGLEventListener(snapshotGLEventListener);
-        
+
         final Animator animator = new Animator(glWindow);
         animator.start();
-        
+
         animator.setUpdateFPSFrames(60, System.err);
         snapshotGLEventListener.setMakeSnapshot();
-        
+
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
             Thread.sleep(100);
         }
-        
+
         animator.stop();
         glWindow.destroy();
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java
index f55e331..96db8e5 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/GLSLMiscHelper.java
@@ -32,6 +32,7 @@ import com.jogamp.opengl.util.glsl.ShaderState;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GLBufferStorage;
 import javax.media.opengl.GLDrawable;
 
 import org.junit.Assert;
@@ -39,33 +40,34 @@ import org.junit.Assert;
 public class GLSLMiscHelper {
     public static final int frames_perftest = 600; // frames
     public static final int frames_warmup   = 100; // frames
-    
-    public static void validateGLArrayDataServerState(GL2ES2 gl, ShaderState st, GLArrayDataServer data) {
-        int[] qi = new int[1];
-        if(null != st) {            
-            Assert.assertEquals(data, st.getAttribute(data.getName()));            
+
+    public static void validateGLArrayDataServerState(final GL2ES2 gl, final ShaderState st, final GLArrayDataServer data) {
+        final int[] qi = new int[1];
+        if(null != st) {
+            Assert.assertEquals(data, st.getAttribute(data.getName()));
             if(st.shaderProgram().linked()) {
                 Assert.assertEquals(data.getLocation(), st.getCachedAttribLocation(data.getName()));
                 Assert.assertEquals(data.getLocation(), st.getAttribLocation(gl, data));
                 Assert.assertEquals(data.getLocation(), st.getAttribLocation(gl, data.getName()));
-                Assert.assertEquals(data.getLocation(), gl.glGetAttribLocation(st.shaderProgram().program(), data.getName()));                
+                Assert.assertEquals(data.getLocation(), gl.glGetAttribLocation(st.shaderProgram().program(), data.getName()));
             }
         }
         gl.glGetVertexAttribiv(data.getLocation(), GL2ES2.GL_VERTEX_ATTRIB_ARRAY_ENABLED, qi, 0);
         Assert.assertEquals(data.enabled()?GL.GL_TRUE:GL.GL_FALSE, qi[0]);
         gl.glGetVertexAttribiv(data.getLocation(), GL2ES2.GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, qi, 0);
-        Assert.assertEquals(data.getVBOName(), qi[0]);  
-        Assert.assertEquals(data.getSizeInBytes(), gl.glGetBufferSize(data.getVBOName()));        
+        Assert.assertEquals(data.getVBOName(), qi[0]);
+        final GLBufferStorage glStore = gl.getBufferStorage(data.getVBOName());
+        Assert.assertEquals("GLBufferStorage size mismatch, storage "+glStore, data.getSizeInBytes(), null != glStore ? glStore.getSize() : -1);
     }
 
-    public static void pause(long ms) throws InterruptedException {
-        long t0 = System.currentTimeMillis();
+    public static void pause(final long ms) throws InterruptedException {
+        final long t0 = System.currentTimeMillis();
         while( System.currentTimeMillis() - t0 < ms) {
             Thread.sleep(ms);
-        }        
+        }
     }
-    
-    public static void displayVCArrays(GLDrawable drawable, GL2ES2 gl, ShaderState st, boolean preEnable, GLArrayDataServer vertices, GLArrayDataServer colors, boolean postDisable, int num, long postDelay) throws InterruptedException {
+
+    public static void displayVCArrays(final GLDrawable drawable, final GL2ES2 gl, final ShaderState st, final boolean preEnable, final GLArrayDataServer vertices, final GLArrayDataServer colors, final boolean postDisable, final int num, final long postDelay) throws InterruptedException {
         System.err.println("screen #"+num);
         if(preEnable) {
             vertices.enableBuffer(gl, true);
@@ -79,11 +81,11 @@ public class GLSLMiscHelper {
         }
         Assert.assertTrue(vertices.enabled());
         Assert.assertTrue(colors.enabled());
-        
+
         validateGLArrayDataServerState(gl, st, vertices);
         validateGLArrayDataServerState(gl, st, colors);
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
-        gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);        
+        gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
         if(postDisable) {
             vertices.enableBuffer(gl, false);
@@ -93,24 +95,24 @@ public class GLSLMiscHelper {
         }
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
         drawable.swapBuffers();
-        if(postDelay>0) { pause(postDelay); }        
+        if(postDelay>0) { pause(postDelay); }
     }
-    
-    public static void displayVCArraysNoChecks(GLDrawable drawable, GL2ES2 gl, boolean preEnable, GLArrayDataServer vertices, GLArrayDataServer colors, boolean postDisable) throws InterruptedException {
+
+    public static void displayVCArraysNoChecks(final GLDrawable drawable, final GL2ES2 gl, final boolean preEnable, final GLArrayDataServer vertices, final GLArrayDataServer colors, final boolean postDisable) throws InterruptedException {
         if(preEnable) {
             vertices.enableBuffer(gl, true);
             colors.enableBuffer(gl, true);
         }
         gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
-        gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);        
+        gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
         if(postDisable) {
             vertices.enableBuffer(gl, false);
             colors.enableBuffer(gl, false);
         }
         drawable.swapBuffers();
     }
-    
-    public static GLArrayDataServer createVertices(GL2ES2 gl, ShaderState st, int shaderProgram, int location, float[] vertices) {
+
+    public static GLArrayDataServer createVertices(final GL2ES2 gl, final ShaderState st, final int shaderProgram, final int location, final float[] vertices) {
         if(null != st && 0 != shaderProgram) {
             throw new InternalError("Use either ShaderState _or_ shader-program, not both");
         }
@@ -118,7 +120,7 @@ public class GLSLMiscHelper {
             throw new InternalError("Pass a valid ShaderState _xor_ shader-program, not none");
         }
         // Allocate Vertex Array0
-        GLArrayDataServer vDataArray = GLArrayDataServer.createGLSL("mgl_Vertex", 3, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
+        final GLArrayDataServer vDataArray = GLArrayDataServer.createGLSL("mgl_Vertex", 3, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
         if(null != st) {
             st.ownAttribute(vDataArray, true);
             if(0<=location) {
@@ -144,29 +146,29 @@ public class GLSLMiscHelper {
         Assert.assertTrue(vDataArray.isVBOWritten());
         Assert.assertTrue(vDataArray.sealed());
         Assert.assertEquals(4, vDataArray.getElementCount());
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());        
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
         Assert.assertEquals(0, gl.getBoundBuffer(GL.GL_ARRAY_BUFFER)); // should be cleared ASAP
         validateGLArrayDataServerState(gl, st, vDataArray);
         return vDataArray;
     }
-    public static float[] vertices0 = new float[] { -2f,  2f, 0f,
-                                                     2f,  2f, 0f,
-                                                    -2f, -2f, 0f,
-                                                     2f, -2f, 0f };
-        
-    public static float[] vertices1 = new float[] { -2f,  1f, 0f,
-                                                     2f,  1f, 0f,
-                                                    -2f, -1f, 0f,
-                                                     2f, -1f, 0f };
-    
-    public static GLArrayDataServer createColors(GL2ES2 gl, ShaderState st, int shaderProgram, int location, float[] colors) {
+    public static final float[] vertices0 = new float[] { -2f,  2f, 0f,
+                                                           2f,  2f, 0f,
+                                                          -2f, -2f, 0f,
+                                                           2f, -2f, 0f };
+
+    public static final float[] vertices1 = new float[] { -2f,  1f, 0f,
+                                                           2f,  1f, 0f,
+                                                          -2f, -1f, 0f,
+                                                           2f, -1f, 0f };
+
+    public static GLArrayDataServer createColors(final GL2ES2 gl, final ShaderState st, final int shaderProgram, final int location, final float[] colors) {
         if(null != st && 0 != shaderProgram) {
             throw new InternalError("Use either ShaderState _or_ shader-program, not both");
         }
         if(null == st && 0 == shaderProgram) {
             throw new InternalError("Pass a valid ShaderState _xor_ shader-program, not none");
         }
-        GLArrayDataServer cDataArray = GLArrayDataServer.createGLSL("mgl_Color", 4, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
+        final GLArrayDataServer cDataArray = GLArrayDataServer.createGLSL("mgl_Color", 4, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
         if(null != st) {
             st.ownAttribute(cDataArray, true);
             if(0<=location) {
@@ -194,14 +196,14 @@ public class GLSLMiscHelper {
         validateGLArrayDataServerState(gl, st, cDataArray);
         return cDataArray;
     }
-    public static float[] colors0 = new float[] { 1f, 0f, 0f, 1f,
-                                                  0f, 0f, 1f, 1f,
-                                                  1f, 0f, 0f, 1f,
-                                                  1f, 0f, 1f, 1f };
-    
-    public static float[] colors1 = new float[] { 1f, 0f, 1f, 1f,
-                                                  0f, 1f, 0f, 1f,
-                                                  1f, 0f, 1f, 1f,
-                                                  1f, 0f, 1f, 1f };
-    
+    public static final float[] colors0 = new float[] { 1f, 0f, 0f, 1f,
+                                                        0f, 0f, 1f, 1f,
+                                                        1f, 0f, 0f, 1f,
+                                                        1f, 0f, 1f, 1f };
+
+    public static final float[] colors1 = new float[] { 1f, 0f, 1f, 1f,
+                                                        0f, 1f, 0f, 1f,
+                                                        1f, 0f, 1f, 1f,
+                                                        1f, 0f, 1f, 1f };
+
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState01NEWT.java
index c240731..b3e01ac 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState01NEWT.java
@@ -38,12 +38,14 @@ import com.jogamp.opengl.test.junit.util.NEWTGLContext;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 
 import java.io.IOException;
+
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLDrawable;
 import javax.media.opengl.GLProfile;
 import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -61,7 +63,7 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
 
     static final int vertices0_loc = 0; // FIXME: AMD needs this to be location 0 ? hu ?
     static final int colors0_loc = 1;
-    
+
     @Test
     public void test00NoShaderState_Validation() throws InterruptedException {
         // preset ..
@@ -72,109 +74,109 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
         System.err.println(winctx.context);
 
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
-        // test code ..        
-        final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, 
+
+        // test code ..
+        final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class,
                 "shader", "shader/bin", "RedSquareShader", true);
-        final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, 
+        final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class,
                 "shader", "shader/bin", "RedSquareShader", true);
         rsVp.defaultShaderCustomization(gl, true, true);
         rsFp.defaultShaderCustomization(gl, true, true);
 
         final ShaderProgram sp = new ShaderProgram();
         Assert.assertTrue(0 == sp.program());
-        
+
         sp.add(gl, rsVp, System.err);
         sp.add(gl, rsFp, System.err);
-        
-        Assert.assertTrue(0 != sp.program()); 
+
+        Assert.assertTrue(0 != sp.program());
         Assert.assertTrue(!sp.inUse());
         Assert.assertTrue(!sp.linked());
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         Assert.assertTrue( sp.link(gl, System.err) );
         sp.useProgram(gl, true);
-        
+
         // Allocate Vertex Array0
         final GLArrayDataServer vertices0 = GLSLMiscHelper.createVertices(gl, null, sp.program(), vertices0_loc, GLSLMiscHelper.vertices0);
-        System.err.println("vertices0: " + vertices0);        
+        System.err.println("vertices0: " + vertices0);
         vertices0.enableBuffer(gl, false);
         Assert.assertEquals(vertices0_loc, vertices0.getLocation());
-        
+
         // Allocate Color Array0
         final GLArrayDataServer colors0 = GLSLMiscHelper.createColors(gl, null, sp.program(), colors0_loc, GLSLMiscHelper.colors0);
         System.err.println("colors0: " + colors0);
         colors0.enableBuffer(gl, false);
         Assert.assertEquals(colors0_loc, colors0.getLocation());
-                               
+
         Assert.assertTrue(sp.link(gl, System.err));
         Assert.assertTrue(sp.linked());
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         Assert.assertEquals(vertices0_loc, vertices0.getLocation());
         GLSLMiscHelper.validateGLArrayDataServerState(gl, null, vertices0);
-        
+
         Assert.assertEquals(colors0_loc, colors0.getLocation());
         GLSLMiscHelper.validateGLArrayDataServerState(gl, null, colors0);
-        
+
         sp.useProgram(gl, true);
         Assert.assertTrue(sp.inUse());
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         // setup mgl_PMVMatrix
         final PMVMatrix pmvMatrix = new PMVMatrix();
         final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
         pmvMatrixUniform.setLocation(gl, sp.program());
         gl.glUniform(pmvMatrixUniform);
-        
+
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         // Allocate Vertex Array1
         final GLArrayDataServer vertices1 = GLSLMiscHelper.createVertices(gl, null, sp.program(), -1, GLSLMiscHelper.vertices1);
         System.err.println("vertices1: " + vertices1);
         vertices1.enableBuffer(gl, false);
         GLSLMiscHelper.validateGLArrayDataServerState(gl, null, vertices1);
-        
+
         // Allocate Color Array1
         final GLArrayDataServer colors1 = GLSLMiscHelper.createColors(gl, null, sp.program(), -1, GLSLMiscHelper.colors1);
         System.err.println("colors1: " + colors1);
         colors1.enableBuffer(gl, false);
         GLSLMiscHelper.validateGLArrayDataServerState(gl, null, colors1);
-        
+
         // misc GL setup
         gl.glClearColor(0, 0, 0, 1);
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_DEPTH_TEST);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
 
         // reshape
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
-        pmvMatrix.gluPerspective(45.0F, (float) drawable.getWidth() / (float) drawable.getHeight(), 1.0F, 100.0F);
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.gluPerspective(45.0F, (float) drawable.getSurfaceWidth() / (float) drawable.getSurfaceHeight(), 1.0F, 100.0F);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glTranslatef(0, 0, -10);
         gl.glUniform(pmvMatrixUniform);
-        
-        gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());        
+
+        gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         // display #1 vertices0 / colors0 (post-disable)
         GLSLMiscHelper.displayVCArrays(drawable, gl, null, true, vertices0, colors0, true, 1, durationPerTest);
 
         // display #2 #1 vertices1 / colors1 (post-disable)
         GLSLMiscHelper.displayVCArrays(drawable, gl, null, true, vertices1, colors1, true, 2, durationPerTest);
-        
+
         // display #3 vertices0 / colors0 (post-disable)
         GLSLMiscHelper.displayVCArrays(drawable, gl, null, true, vertices0, colors0, true, 3, durationPerTest);
-        
+
         // cleanup
         sp.useProgram(gl, false);
         sp.destroy(gl);
         vertices1.destroy(gl);
         colors0.destroy(gl);
         colors1.destroy(gl);
-        
+
         NEWTGLContext.destroyWindow(winctx);
     }
 
@@ -188,10 +190,10 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
         System.err.println(winctx.context);
 
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
-        // test code ..        
+
+        // test code ..
         final ShaderState st = new ShaderState();
-        
+
         final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
                 "shader/bin", "RedSquareShader", true);
         final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
@@ -201,95 +203,95 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
 
         final ShaderProgram sp = new ShaderProgram();
         Assert.assertTrue(0 == sp.program());
-        
+
         sp.add(gl, rsVp, System.err);
         sp.add(gl, rsFp, System.err);
-        
-        Assert.assertTrue(0 != sp.program()); 
+
+        Assert.assertTrue(0 != sp.program());
         Assert.assertTrue(!sp.inUse());
         Assert.assertTrue(!sp.linked());
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         st.attachShaderProgram(gl, sp, false);
         Assert.assertTrue(!sp.inUse());
         Assert.assertTrue(!sp.linked());
-        
+
         // Allocate Vertex Array0
         final GLArrayDataServer vertices0 = GLSLMiscHelper.createVertices(gl, st, 0, vertices0_loc, GLSLMiscHelper.vertices0);
-        System.err.println("vertices0: " + vertices0);        
+        System.err.println("vertices0: " + vertices0);
         vertices0.enableBuffer(gl, false);
         Assert.assertEquals(vertices0_loc, vertices0.getLocation());
-        
+
         // Allocate Color Array0
         final GLArrayDataServer colors0 = GLSLMiscHelper.createColors(gl, st, 0, colors0_loc, GLSLMiscHelper.colors0);
         System.err.println("colors0: " + colors0);
         colors0.enableBuffer(gl, false);
         Assert.assertEquals(colors0_loc, colors0.getLocation());
-                               
+
         Assert.assertTrue(sp.link(gl, System.err));
         Assert.assertTrue(sp.linked());
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         Assert.assertEquals(vertices0_loc, vertices0.getLocation());
         GLSLMiscHelper.validateGLArrayDataServerState(gl, st, vertices0);
-        
+
         Assert.assertEquals(colors0_loc, colors0.getLocation());
         GLSLMiscHelper.validateGLArrayDataServerState(gl, st, colors0);
-        
+
         st.useProgram(gl, true);
         Assert.assertTrue(sp.inUse());
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         // setup mgl_PMVMatrix
         final PMVMatrix pmvMatrix = new PMVMatrix();
         final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
         st.ownUniform(pmvMatrixUniform);
-        
+
         st.uniform(gl, pmvMatrixUniform);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
         Assert.assertEquals(pmvMatrixUniform, st.getUniform("mgl_PMVMatrix"));
-        
+
         // Allocate Vertex Array1
         final GLArrayDataServer vertices1 = GLSLMiscHelper.createVertices(gl, st, 0, -1, GLSLMiscHelper.vertices1);
         System.err.println("vertices1: " + vertices1);
         vertices1.enableBuffer(gl, false);
         GLSLMiscHelper.validateGLArrayDataServerState(gl, st, vertices1);
-        
+
         // Allocate Color Array1
         final GLArrayDataServer colors1 = GLSLMiscHelper.createColors(gl, st, 0, -1, GLSLMiscHelper.colors1);
         System.err.println("colors1: " + colors1);
         colors1.enableBuffer(gl, false);
         GLSLMiscHelper.validateGLArrayDataServerState(gl, st, colors1);
-        
+
         // misc GL setup
         gl.glClearColor(0, 0, 0, 1);
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_DEPTH_TEST);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
 
         // reshape
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
-        pmvMatrix.gluPerspective(45.0F, (float) drawable.getWidth() / (float) drawable.getHeight(), 1.0F, 100.0F);
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.gluPerspective(45.0F, (float) drawable.getSurfaceWidth() / (float) drawable.getSurfaceHeight(), 1.0F, 100.0F);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glTranslatef(0, 0, -10);
         st.uniform(gl, pmvMatrixUniform);
-        gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());        
+        gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         // display #1 vertices0 / colors0 (post-disable)
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 1, durationPerTest);
 
         // display #2 #1 vertices1 / colors1 (post-disable)
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 2, durationPerTest);
-        
+
         // display #3 vertices0 / colors0 (post-disable)
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 3, durationPerTest);
-        
+
         // cleanup
         st.destroy(gl);
-        
+
         NEWTGLContext.destroyWindow(winctx);
     }
 
@@ -301,8 +303,8 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
     public void test03ShaderState_PerformanceSingleToggleEnable() throws InterruptedException {
         testShaderState_PerformanceSingleImpl(true);
     }
-    
-    private void testShaderState_PerformanceSingleImpl(boolean toggleEnable) throws InterruptedException {
+
+    private void testShaderState_PerformanceSingleImpl(final boolean toggleEnable) throws InterruptedException {
         // preset ..
         final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(
                 new GLCapabilities(GLProfile.getGL2ES2()), 480, 480, false);
@@ -310,12 +312,12 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
         final GL2ES2 gl = winctx.context.getGL().getGL2ES2();
         System.err.println(winctx.context);
         gl.setSwapInterval(0);
-        
+
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
-        // test code ..        
+
+        // test code ..
         final ShaderState st = new ShaderState();
-        
+
         final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
                 "shader/bin", "RedSquareShader", true);
         final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
@@ -326,70 +328,70 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
         final ShaderProgram sp = new ShaderProgram();
         sp.add(rsVp);
         sp.add(rsFp);
-        
+
         sp.init(gl);
         Assert.assertTrue(sp.link(gl, System.err));
-        
-        st.attachShaderProgram(gl, sp, true);        
-        
+
+        st.attachShaderProgram(gl, sp, true);
+
         // setup mgl_PMVMatrix
         final PMVMatrix pmvMatrix = new PMVMatrix();
-        final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());       
+        final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
         st.ownUniform(pmvMatrixUniform);
         st.uniform(gl, pmvMatrixUniform);
-        
+
         // Allocate Vertex Array0
         final GLArrayDataServer vertices0 = GLSLMiscHelper.createVertices(gl, st, 0, -1, GLSLMiscHelper.vertices0);
         vertices0.enableBuffer(gl, toggleEnable ? false : true);
-        
+
         // Allocate Color Array0
         final GLArrayDataServer colors0 = GLSLMiscHelper.createColors(gl, st, 0, -1, GLSLMiscHelper.colors0);
         colors0.enableBuffer(gl, toggleEnable ? false : true);
-        
+
         // misc GL setup
         gl.glClearColor(0, 0, 0, 1);
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_DEPTH_TEST);
 
         // reshape
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
-        pmvMatrix.gluPerspective(45.0F, (float) drawable.getWidth() / (float) drawable.getHeight(), 1.0F, 100.0F);
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.gluPerspective(45.0F, (float) drawable.getSurfaceWidth() / (float) drawable.getSurfaceHeight(), 1.0F, 100.0F);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glTranslatef(0, 0, -10);
         st.uniform(gl, pmvMatrixUniform);
-        gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());        
+        gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
 
         gl.setSwapInterval(0);
-        
+
         // validation ..
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, toggleEnable, vertices0, colors0, toggleEnable, 1, 0);
-        
+
         // warmup ..
         for(int frames=0; frames<GLSLMiscHelper.frames_warmup; frames++) {
             GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, toggleEnable, vertices0, colors0, toggleEnable);
         }
-        
+
         // measure ..
-        long t0 = System.currentTimeMillis();
+        final long t0 = System.currentTimeMillis();
         int frames;
-        
+
         for(frames=0; frames<GLSLMiscHelper.frames_perftest; frames++) {
             GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, toggleEnable, vertices0, colors0, toggleEnable);
-        }        
+        }
         final long t1 = System.currentTimeMillis();
-        final long dt = t1 - t0;        
-        final double fps = ( frames * 1000.0 ) / (double) dt;
-        final String fpsS = String.valueOf(fps);        
-        final int fpsSp = fpsS.indexOf('.');        
-        System.err.println("testShaderState00PerformanceSingle toggleEnable "+toggleEnable+": "+dt/1000.0 +"s: "+ frames + "f, " + fpsS.substring(0, fpsSp+2) + " fps, "+dt/frames+" ms/f");        
-        
+        final long dt = t1 - t0;
+        final double fps = ( frames * 1000.0 ) / dt;
+        final String fpsS = String.valueOf(fps);
+        final int fpsSp = fpsS.indexOf('.');
+        System.err.println("testShaderState00PerformanceSingle toggleEnable "+toggleEnable+": "+dt/1000.0 +"s: "+ frames + "f, " + fpsS.substring(0, fpsSp+2) + " fps, "+dt/frames+" ms/f");
+
         // cleanup
         st.destroy(gl);
-        
-        NEWTGLContext.destroyWindow(winctx);        
+
+        NEWTGLContext.destroyWindow(winctx);
     }
-    
+
     @Test(timeout=240000)
     public void test04ShaderState_PerformanceDouble() throws InterruptedException {
         // preset ..
@@ -399,12 +401,12 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
         final GL2ES2 gl = winctx.context.getGL().getGL2ES2();
         System.err.println(winctx.context);
         gl.setSwapInterval(0);
-        
+
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
-        // test code ..        
+
+        // test code ..
         final ShaderState st = new ShaderState();
-        
+
         final ShaderCode rsVp = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
                 "shader/bin", "RedSquareShader", true);
         final ShaderCode rsFp = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
@@ -415,82 +417,82 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
         final ShaderProgram sp = new ShaderProgram();
         sp.add(rsVp);
         sp.add(rsFp);
-        
+
         sp.init(gl);
         Assert.assertTrue(sp.link(gl, System.err));
-        
-        st.attachShaderProgram(gl, sp, true);        
-        
+
+        st.attachShaderProgram(gl, sp, true);
+
         // setup mgl_PMVMatrix
         final PMVMatrix pmvMatrix = new PMVMatrix();
         final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
         st.ownUniform(pmvMatrixUniform);
         st.uniform(gl, pmvMatrixUniform);
-        
+
         // Allocate Vertex Array0
         final GLArrayDataServer vertices0 = GLSLMiscHelper.createVertices(gl, st, 0, -1, GLSLMiscHelper.vertices0);
         vertices0.enableBuffer(gl, false);
-        
+
         // Allocate Vertex Array1
         final GLArrayDataServer vertices1 = GLSLMiscHelper.createVertices(gl, st, 0, -1, GLSLMiscHelper.vertices1);
         vertices1.enableBuffer(gl, false);
-        
+
         // Allocate Color Array0
         final GLArrayDataServer colors0 = GLSLMiscHelper.createColors(gl, st, 0, -1, GLSLMiscHelper.colors0);
         colors0.enableBuffer(gl, false);
-        
+
         // Allocate Color Array1
         final GLArrayDataServer colors1 = GLSLMiscHelper.createColors(gl, st, 0, -1, GLSLMiscHelper.colors1);
         colors1.enableBuffer(gl, false);
-        
+
         // misc GL setup
         gl.glClearColor(0, 0, 0, 1);
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_DEPTH_TEST);
 
         // reshape
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
-        pmvMatrix.gluPerspective(45.0F, (float) drawable.getWidth() / (float) drawable.getHeight(), 1.0F, 100.0F);
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.gluPerspective(45.0F, (float) drawable.getSurfaceWidth() / (float) drawable.getSurfaceHeight(), 1.0F, 100.0F);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glTranslatef(0, 0, -10);
         st.uniform(gl, pmvMatrixUniform);
-        gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());        
+        gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
 
         gl.setSwapInterval(0);
-                
+
         // validation ..
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 1, 0);
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 2, 0);
-                
+
         // warmup ..
         for(int frames=0; frames<GLSLMiscHelper.frames_warmup; frames+=2) {
             GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices0, colors0, true);
             GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices1, colors1, true);
         }
-        
+
         // measure ..
-        long t0 = System.currentTimeMillis();
+        final long t0 = System.currentTimeMillis();
         int frames;
-        
+
         for(frames=0; frames<GLSLMiscHelper.frames_perftest; frames+=2) {
             GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices0, colors0, true);
             GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices1, colors1, true);
-        }        
+        }
         final long t1 = System.currentTimeMillis();
-        final long dt = t1 - t0;        
-        final double fps = ( frames * 1000.0 ) / (double) dt;
-        final String fpsS = String.valueOf(fps);        
-        final int fpsSp = fpsS.indexOf('.');        
-        System.err.println("testShaderState01PerformanceDouble: "+dt/1000.0 +"s: "+ frames + "f, " + fpsS.substring(0, fpsSp+2) + " fps, "+dt/frames+" ms/f");        
-        
+        final long dt = t1 - t0;
+        final double fps = ( frames * 1000.0 ) / dt;
+        final String fpsS = String.valueOf(fps);
+        final int fpsSp = fpsS.indexOf('.');
+        System.err.println("testShaderState01PerformanceDouble: "+dt/1000.0 +"s: "+ frames + "f, " + fpsS.substring(0, fpsSp+2) + " fps, "+dt/frames+" ms/f");
+
         // cleanup
         st.destroy(gl);
-        
+
         NEWTGLContext.destroyWindow(winctx);
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         System.err.println("main - start");
         boolean wait = false;
         for(int i=0; i<args.length; i++) {
@@ -504,16 +506,16 @@ public class TestGLSLShaderState01NEWT extends UITestCase {
         }
         if(wait) {
             while(-1 == System.in.read()) ;
-            TestGLSLShaderState01NEWT tst = new TestGLSLShaderState01NEWT();
+            final TestGLSLShaderState01NEWT tst = new TestGLSLShaderState01NEWT();
             try {
                 tst.test04ShaderState_PerformanceDouble();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
             }
         } else {
-            String tstname = TestGLSLShaderState01NEWT.class.getName();
+            final String tstname = TestGLSLShaderState01NEWT.class.getName();
             org.junit.runner.JUnitCore.main(tstname);
         }
         System.err.println("main - end");
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState02NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState02NEWT.java
index eb5a3fc..21d9454 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLShaderState02NEWT.java
@@ -38,12 +38,14 @@ import com.jogamp.opengl.test.junit.util.NEWTGLContext;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 
 import java.io.IOException;
+
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLDrawable;
 import javax.media.opengl.GLProfile;
 import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -60,7 +62,7 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
 
     static final int vertices0_loc = 0; // FIXME: AMD needs this to be location 0 ? hu ?
     static final int colors0_loc = 5;
-    
+
     @Test
     public void testShaderState01ValidationSP1Linked() throws InterruptedException {
         testShaderState01Validation(true);
@@ -69,20 +71,20 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
     public void testShaderState01ValidationSP1Unlinked() throws InterruptedException {
         testShaderState01Validation(false);
     }
-    
-    private void testShaderState01Validation(boolean linkSP1) throws InterruptedException {
+
+    private void testShaderState01Validation(final boolean linkSP1) throws InterruptedException {
         // preset ..
         final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(
                 new GLCapabilities(GLProfile.getGL2ES2()), 480, 480, true);
         final GLDrawable drawable = winctx.context.getGLDrawable();
         final GL2ES2 gl = winctx.context.getGL().getGL2ES2();
         System.err.println(winctx.context);
-        
+
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
-        // test code ..        
+
+        // test code ..
         final ShaderState st = new ShaderState();
-        
+
         final ShaderCode rsVp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
                 "shader/bin", "RedSquareShader", true);
         final ShaderCode rsFp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
@@ -97,9 +99,9 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
         sp1.add(rsVp0);
         sp1.add(rsFp1);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        Assert.assertTrue(0 == sp1.program());        
+        Assert.assertTrue(0 == sp1.program());
         Assert.assertTrue(sp1.init(gl));
-        Assert.assertTrue(0 != sp1.program()); 
+        Assert.assertTrue(0 != sp1.program());
         Assert.assertTrue(!sp1.inUse());
         Assert.assertTrue(!sp1.linked());
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
@@ -108,134 +110,134 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
             Assert.assertTrue(sp1.linked());
             Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
         }
-        
-        final ShaderProgram sp0 = new ShaderProgram();        
+
+        final ShaderProgram sp0 = new ShaderProgram();
         sp0.add(rsVp0);
         sp0.add(rsFp0);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
-        Assert.assertTrue(0 == sp0.program());        
+
+        Assert.assertTrue(0 == sp0.program());
         Assert.assertTrue(sp0.init(gl));
-        Assert.assertTrue(0 != sp0.program()); 
+        Assert.assertTrue(0 != sp0.program());
         Assert.assertTrue(!sp0.inUse());
         Assert.assertTrue(!sp0.linked());
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());        
-                
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+
         st.attachShaderProgram(gl, sp0, false);
         Assert.assertTrue(!sp0.inUse());
         Assert.assertTrue(!sp0.linked());
-        
+
         // Allocate Vertex Array0
         final GLArrayDataServer vertices0 = GLSLMiscHelper.createVertices(gl, st, 0, vertices0_loc, GLSLMiscHelper.vertices0);
-        System.err.println("vertices0: " + vertices0);        
+        System.err.println("vertices0: " + vertices0);
         vertices0.enableBuffer(gl, false);
         Assert.assertEquals(vertices0_loc, vertices0.getLocation());
-        
+
         // Allocate Color Array0
         final GLArrayDataServer colors0 = GLSLMiscHelper.createColors(gl, st, 0, colors0_loc, GLSLMiscHelper.colors0);
         System.err.println("colors0: " + colors0);
         colors0.enableBuffer(gl, false);
         Assert.assertEquals(colors0_loc, colors0.getLocation());
-                               
+
         Assert.assertTrue(sp0.link(gl, System.err));
         Assert.assertTrue(sp0.linked());
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         Assert.assertEquals(vertices0_loc, vertices0.getLocation());
         Assert.assertEquals(vertices0_loc, st.getAttribLocation(gl, vertices0.getName()));
         Assert.assertEquals(vertices0_loc, gl.glGetAttribLocation(st.shaderProgram().program(), vertices0.getName()));
-        
+
         Assert.assertEquals(colors0_loc, colors0.getLocation());
         Assert.assertEquals(colors0_loc, st.getAttribLocation(gl, colors0.getName()));
         Assert.assertEquals(colors0_loc, gl.glGetAttribLocation(st.shaderProgram().program(), colors0.getName()));
-        
+
         st.useProgram(gl, true);
         Assert.assertTrue(sp0.inUse());
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         // setup mgl_PMVMatrix
         final PMVMatrix pmvMatrix = new PMVMatrix();
         final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
         st.ownUniform(pmvMatrixUniform);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         st.uniform(gl, pmvMatrixUniform);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
         Assert.assertEquals(pmvMatrixUniform, st.getUniform("mgl_PMVMatrix"));
-        
+
         // Allocate Vertex Array1
         final GLArrayDataServer vertices1 = GLSLMiscHelper.createVertices(gl, st, 0, -1, GLSLMiscHelper.vertices1);
         System.err.println("vertices1: " + vertices1);
         vertices1.enableBuffer(gl, false);
-        
+
         // Allocate Color Array1
         final GLArrayDataServer colors1 = GLSLMiscHelper.createColors(gl, st, 0, -1, GLSLMiscHelper.colors1);
         System.err.println("colors1: " + colors1);
         colors1.enableBuffer(gl, false);
-        
+
         // misc GL setup
         gl.glClearColor(0, 0, 0, 1);
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_DEPTH_TEST);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
 
         // reshape
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
-        pmvMatrix.gluPerspective(45.0F, (float) drawable.getWidth() / (float) drawable.getHeight(), 1.0F, 100.0F);
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.gluPerspective(45.0F, (float) drawable.getSurfaceWidth() / (float) drawable.getSurfaceHeight(), 1.0F, 100.0F);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glTranslatef(0, 0, -10);
         st.uniform(gl, pmvMatrixUniform);
-        gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
+        gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         // display #1 vertices0 / colors0 (post-disable)
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 1, durationPerTest);
 
         // display #2 vertices1 / colors1 (post-disable)
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 2, durationPerTest);
-        
+
         // display #3 vertices0 / colors0 (post-disable)
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 3, durationPerTest);
 
         // display #4 vertices1 / colors1 (post-disable)
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 4, durationPerTest);
-        
+
         // SP1
-        st.attachShaderProgram(gl, sp1, true);        
+        st.attachShaderProgram(gl, sp1, true);
         Assert.assertTrue(sp1.inUse());
         Assert.assertTrue(sp1.linked());
-        
+
         if(!linkSP1) {
             // all attribute locations shall be same now, due to impl. glBindAttributeLocation
             Assert.assertEquals(vertices0_loc, vertices0.getLocation());
             Assert.assertEquals(vertices0_loc, st.getAttribLocation(gl, vertices0.getName()));
             Assert.assertEquals(vertices0_loc, gl.glGetAttribLocation(st.shaderProgram().program(), vertices0.getName()));
-            
+
             Assert.assertEquals(colors0_loc, colors0.getLocation());
             Assert.assertEquals(colors0_loc, st.getAttribLocation(gl, colors0.getName()));
             Assert.assertEquals(colors0_loc, gl.glGetAttribLocation(st.shaderProgram().program(), colors0.getName()));
         }
-        
+
         // display #1 vertices0 / colors0 (post-disable)
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 10, durationPerTest);
 
         // display #2 vertices1 / colors1 (post-disable)
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 20, durationPerTest);
-        
+
         // display #3 vertices0 / colors0 (post-disable)
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 30, durationPerTest);
-        
+
         // display #4 vertices1 / colors1 (post-disable)
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 40, durationPerTest);
-        
+
         // cleanup
         st.destroy(gl);
-        
+
         NEWTGLContext.destroyWindow(winctx);
     }
 
-    @Test(timeout=240000)    
+    @Test(timeout=240000)
     public void testShaderState01PerformanceDouble() throws InterruptedException {
         // preset ..
         final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(
@@ -244,12 +246,12 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
         final GL2ES2 gl = winctx.context.getGL().getGL2ES2();
         System.err.println(winctx.context);
         gl.setSwapInterval(0);
-        
+
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
-        // test code ..        
+
+        // test code ..
         final ShaderState st = new ShaderState();
-        
+
         final ShaderCode rsVp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
                 "shader/bin", "RedSquareShader", true);
         final ShaderCode rsFp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
@@ -264,58 +266,58 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
         sp1.add(rsVp0);
         sp1.add(rsFp1);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        Assert.assertTrue(0 == sp1.program());        
+        Assert.assertTrue(0 == sp1.program());
         Assert.assertTrue(sp1.init(gl));
         Assert.assertTrue(0 != sp1.program());
         Assert.assertTrue(sp1.link(gl, System.err));
-        
+
         final ShaderProgram sp0 = new ShaderProgram();
         sp0.add(rsVp0);
         sp0.add(rsFp0);
-        
+
         Assert.assertTrue(sp0.init(gl));
         Assert.assertTrue(sp0.link(gl, System.err));
-        
-        st.attachShaderProgram(gl, sp0, true);        
-        
+
+        st.attachShaderProgram(gl, sp0, true);
+
         // setup mgl_PMVMatrix
         final PMVMatrix pmvMatrix = new PMVMatrix();
         final GLUniformData pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
         st.ownUniform(pmvMatrixUniform);
         st.uniform(gl, pmvMatrixUniform);
-        
+
         // Allocate Vertex Array0
         final GLArrayDataServer vertices0 = GLSLMiscHelper.createVertices(gl, st, 0, -1, GLSLMiscHelper.vertices0);
         vertices0.enableBuffer(gl, false);
-        
+
         // Allocate Vertex Array1
         final GLArrayDataServer vertices1 = GLSLMiscHelper.createVertices(gl, st, 0, -1, GLSLMiscHelper.vertices1);
         vertices1.enableBuffer(gl, false);
-        
+
         // Allocate Color Array0
         final GLArrayDataServer colors0 = GLSLMiscHelper.createColors(gl, st, 0, -1, GLSLMiscHelper.colors0);
         colors0.enableBuffer(gl, false);
-        
+
         // Allocate Color Array1
         final GLArrayDataServer colors1 = GLSLMiscHelper.createColors(gl, st, 0, -1, GLSLMiscHelper.colors1);
         colors1.enableBuffer(gl, false);
-        
+
         // misc GL setup
         gl.glClearColor(0, 0, 0, 1);
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
+        gl.glEnable(GL.GL_DEPTH_TEST);
 
         // reshape
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
-        pmvMatrix.gluPerspective(45.0F, (float) drawable.getWidth() / (float) drawable.getHeight(), 1.0F, 100.0F);
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.gluPerspective(45.0F, (float) drawable.getSurfaceWidth() / (float) drawable.getSurfaceHeight(), 1.0F, 100.0F);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glTranslatef(0, 0, -10);
         st.uniform(gl, pmvMatrixUniform);
-        gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
+        gl.glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
 
         gl.setSwapInterval(0);
-        
+
         // validation ..
         st.attachShaderProgram(gl, sp0, true);
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 1, 0);
@@ -323,8 +325,8 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
         st.attachShaderProgram(gl, sp1, true);
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices0, colors0, true, 1, 0);
         GLSLMiscHelper.displayVCArrays(drawable, gl, st, true, vertices1, colors1, true, 2, 0);
-        
-        // warmup ..        
+
+        // warmup ..
         for(int frames=0; frames<GLSLMiscHelper.frames_warmup; frames+=2) {
             // SP0
             st.attachShaderProgram(gl, sp0, true);
@@ -333,11 +335,11 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
             st.attachShaderProgram(gl, sp1, true);
             GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices1, colors1, true);
         }
-        
+
         // measure ..
-        long t0 = System.currentTimeMillis();
+        final long t0 = System.currentTimeMillis();
         int frames;
-        
+
         for(frames=0; frames<GLSLMiscHelper.frames_perftest; frames+=4) {
             // SP0
             st.attachShaderProgram(gl, sp0, true);
@@ -348,20 +350,20 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
             GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices0, colors0, true);
             GLSLMiscHelper.displayVCArraysNoChecks(drawable, gl, true, vertices1, colors1, true);
         }
-        
+
         final long t1 = System.currentTimeMillis();
-        final long dt = t1 - t0;        
-        final double fps = ( frames * 1000.0 ) / (double) dt;
-        final String fpsS = String.valueOf(fps);        
-        final int fpsSp = fpsS.indexOf('.');        
-        System.err.println("testShaderState01PerformanceDouble: "+dt/1000.0 +"s: "+ frames + "f, " + fpsS.substring(0, fpsSp+2) + " fps, "+dt/frames+" ms/f");        
-        
+        final long dt = t1 - t0;
+        final double fps = ( frames * 1000.0 ) / dt;
+        final String fpsS = String.valueOf(fps);
+        final int fpsSp = fpsS.indexOf('.');
+        System.err.println("testShaderState01PerformanceDouble: "+dt/1000.0 +"s: "+ frames + "f, " + fpsS.substring(0, fpsSp+2) + " fps, "+dt/frames+" ms/f");
+
         // cleanup
         st.destroy(gl);
         NEWTGLContext.destroyWindow(winctx);
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         System.err.println("main - start");
         boolean wait = false;
         for(int i=0; i<args.length; i++) {
@@ -374,16 +376,16 @@ public class TestGLSLShaderState02NEWT extends UITestCase {
         }
         if(wait) {
             while(-1 == System.in.read()) ;
-            TestGLSLShaderState02NEWT tst = new TestGLSLShaderState02NEWT();
+            final TestGLSLShaderState02NEWT tst = new TestGLSLShaderState02NEWT();
             try {
                 tst.testShaderState01PerformanceDouble();
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 e.printStackTrace();
-            }            
+            }
         } else {
-            String tstname = TestGLSLShaderState02NEWT.class.getName();
+            final String tstname = TestGLSLShaderState02NEWT.class.getName();
             org.junit.runner.JUnitCore.main(tstname);
             System.err.println("main - end");
         }
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLSimple01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLSimple01NEWT.java
index 9a70a08..b478fcd 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLSimple01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestGLSLSimple01NEWT.java
@@ -56,19 +56,19 @@ public class TestGLSLSimple01NEWT extends UITestCase {
 
     @Test(timeout=60000)
     public void testGLSLCompilation01() {
-        GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+        final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
         Assert.assertNotNull(glp);
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
 
-        GLWindow window = GLWindow.create(caps);
+        final GLWindow window = GLWindow.create(caps);
         Assert.assertNotNull(window);
         window.setSize(800, 600);
         window.setVisible(true);
         Assert.assertTrue(window.isNativeValid());
 
-        GLContext context = window.getContext();
-        
+        final GLContext context = window.getContext();
+
         // trigger native creation of drawable/context
         window.display();
         Assert.assertTrue(window.isRealized());
@@ -78,8 +78,8 @@ public class TestGLSLSimple01NEWT extends UITestCase {
 
         // given
 
-        GL2ES2 gl = context.getGL().getGL2ES2();
-        GLSLSimpleProgram myShader = GLSLSimpleProgram.create(gl,
+        final GL2ES2 gl = context.getGL().getGL2ES2();
+        final GLSLSimpleProgram myShader = GLSLSimpleProgram.create(gl,
                 RedSquareShader.VERTEX_SHADER_TEXT,
                 RedSquareShader.FRAGMENT_SHADER_TEXT,
                 true);
@@ -91,20 +91,20 @@ public class TestGLSLSimple01NEWT extends UITestCase {
 
     @Test(timeout=60000)
     public void testGLSLUse01() throws InterruptedException {
-        GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
+        final GLProfile glp = GLProfile.get(GLProfile.GL2ES2);
         Assert.assertNotNull(glp);
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
 
-        GLWindow window = GLWindow.create(caps);
+        final GLWindow window = GLWindow.create(caps);
         Assert.assertNotNull(window);
         window.setSize(800, 600);
         window.setVisible(true);
         Assert.assertTrue(window.isNativeValid());
         window.addGLEventListener(new RedSquareES2());
-        
-        Animator animator = new Animator(window);
-        animator.setUpdateFPSFrames(1, null);        
+
+        final Animator animator = new Animator(window);
+        animator.setUpdateFPSFrames(1, null);
         animator.start();
         Assert.assertEquals(true, animator.isAnimating());
         while(animator.isAnimating() && animator.getTotalFPSDuration()<durationPerTest) {
@@ -116,14 +116,14 @@ public class TestGLSLSimple01NEWT extends UITestCase {
         animator.stop();
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         System.err.println("main - start");
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
             }
         }
-        String tstname = TestGLSLSimple01NEWT.class.getName();
+        final String tstname = TestGLSLSimple01NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
         System.err.println("main - end");
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestRulerNEWT01.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestRulerNEWT01.java
index 360f4e8..e20bbef 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestRulerNEWT01.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestRulerNEWT01.java
@@ -28,8 +28,10 @@
 package com.jogamp.opengl.test.junit.jogl.glsl;
 
 import com.jogamp.common.nio.Buffers;
-import com.jogamp.newt.MonitorDevice;
-import com.jogamp.newt.MonitorMode;
+import com.jogamp.newt.Window;
+import com.jogamp.newt.event.KeyAdapter;
+import com.jogamp.newt.event.KeyEvent;
+import com.jogamp.newt.opengl.GLWindow;
 import com.jogamp.opengl.util.GLArrayDataServer;
 import com.jogamp.opengl.util.PMVMatrix;
 import com.jogamp.opengl.util.glsl.ShaderCode;
@@ -37,19 +39,21 @@ import com.jogamp.opengl.util.glsl.ShaderProgram;
 import com.jogamp.opengl.util.glsl.ShaderState;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.RedSquareES2;
 import com.jogamp.opengl.test.junit.util.MiscUtils;
-import com.jogamp.opengl.test.junit.util.NEWTGLContext;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 
 import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
 import java.nio.FloatBuffer;
 
-import javax.media.nativewindow.util.DimensionImmutable;
+import javax.media.nativewindow.ScalableSurface;
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLCapabilities;
-import javax.media.opengl.GLDrawable;
+import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLProfile;
 import javax.media.opengl.GLUniformData;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import org.junit.Assert;
 import org.junit.Test;
@@ -58,135 +62,197 @@ import org.junit.runners.MethodSorters;
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestRulerNEWT01 extends UITestCase {
-    static long durationPerTest = 10; // ms
+    static long durationPerTest = 500; // ms
+    static int[] reqSurfacePixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
+    static boolean manualTest = false;
+
+    private void setTitle(final Window win) {
+        final float[] sDPI = win.getPixelsPerMM(new float[2]);
+        sDPI[0] *= 25.4f;
+        sDPI[1] *= 25.4f;
+        win.setTitle("GLWindow: win: "+win.getBounds()+", pix: "+win.getSurfaceWidth()+"x"+win.getSurfaceHeight()+", sDPI "+sDPI[0]+" x "+sDPI[1]);
+    }
+
+    private void runTestGL() throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(new GLCapabilities(GLProfile.getGL2ES2()));
+        Assert.assertNotNull(glWindow);
+        glWindow.setSurfaceScale(reqSurfacePixelScale);
+        final int[] valReqSurfacePixelScale = glWindow.getRequestedSurfaceScale(new int[2]);
+        glWindow.setSize(640, 480);
+
+        glWindow.addGLEventListener(new GLEventListener() {
+            final ShaderState st = new ShaderState();
+            final PMVMatrix pmvMatrix = new PMVMatrix();
+            final GLUniformData pmvMatrixUniform = new GLUniformData("gcu_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
+            final GLArrayDataServer vertices0 = GLArrayDataServer.createGLSL("gca_Vertices", 3, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
+            final GLUniformData rulerPixFreq = new GLUniformData("gcu_RulerPixFreq", 2, Buffers.newDirectFloatBuffer(2));
+
+            @Override
+            public void init(final GLAutoDrawable drawable) {
+                final GL2ES2 gl = drawable.getGL().getGL2ES2();
+
+                Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+
+                final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
+                        "shader/bin", "default", true);
+                final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
+                        "shader/bin", "ruler", true);
+                vp0.defaultShaderCustomization(gl, true, true);
+                fp0.defaultShaderCustomization(gl, true, true);
+
+                final ShaderProgram sp0 = new ShaderProgram();
+                sp0.add(gl, vp0, System.err);
+                sp0.add(gl, fp0, System.err);
+                Assert.assertTrue(0 != sp0.program());
+                Assert.assertTrue(!sp0.inUse());
+                Assert.assertTrue(!sp0.linked());
+                Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+
+                st.attachShaderProgram(gl, sp0, true);
+
+                Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+                st.ownUniform(pmvMatrixUniform);
+                st.uniform(gl, pmvMatrixUniform);
+                Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+
+                final GLUniformData rulerColor= new GLUniformData("gcu_RulerColor", 3, Buffers.newDirectFloatBuffer(3));
+                final FloatBuffer rulerColorV = (FloatBuffer) rulerColor.getBuffer();
+                rulerColorV.put(0, 0.5f);
+                rulerColorV.put(1, 0.5f);
+                rulerColorV.put(2, 0.5f);
+                st.ownUniform(rulerColor);
+                st.uniform(gl, rulerColor);
+                Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+
+                st.ownUniform(rulerPixFreq);
+
+                vertices0.putf(0); vertices0.putf(1);  vertices0.putf(0);
+                vertices0.putf(1);  vertices0.putf(1);  vertices0.putf(0);
+                vertices0.putf(0); vertices0.putf(0); vertices0.putf(0);
+                vertices0.putf(1);  vertices0.putf(0); vertices0.putf(0);
+                vertices0.seal(gl, true);
+                st.ownAttribute(vertices0, true);
+
+                // misc GL setup
+                gl.glClearColor(1, 1, 1, 1);
+                gl.glEnable(GL.GL_DEPTH_TEST);
+                Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+            }
+
+            @Override
+            public void dispose(final GLAutoDrawable drawable) {
+            }
+
+            @Override
+            public void display(final GLAutoDrawable drawable) {
+                final GL2ES2 gl = drawable.getGL().getGL2ES2();
+                vertices0.enableBuffer(gl, true);
+                gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
+                gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);
+                vertices0.enableBuffer(gl, false);
+            }
+
+            @Override
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+                final GL2ES2 gl = drawable.getGL().getGL2ES2();
+                pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
+                pmvMatrix.glLoadIdentity();
+                pmvMatrix.glOrthof(0f, 1f, 0f, 1f, -10f, 10f);
+                // pmvMatrix.gluPerspective(45.0F, (float) drawable.getWidth() / (float) drawable.getHeight(), 1.0F, 100.0F);
+                pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
+                pmvMatrix.glLoadIdentity();
+                // pmvMatrix.glTranslatef(0, 0, -6);
+                // pmvMatrix.glRotatef(45f, 1f, 0f, 0f);
+                st.uniform(gl, pmvMatrixUniform);
+
+                final float[] ppmmStore = glWindow.getPixelsPerMM(new float[2]);
+                final FloatBuffer rulerPixFreqV = (FloatBuffer) rulerPixFreq.getBuffer();
+                rulerPixFreqV.put(0, ppmmStore[0] * 10.0f);
+                rulerPixFreqV.put(1, ppmmStore[1] * 10.0f);
+                st.uniform(gl, rulerPixFreq);
+                System.err.println("Screen pixel/cm "+rulerPixFreqV.get(0)+", "+rulerPixFreqV.get(1));
+            }
+
+        });
+        final SnapshotGLEventListener snap = new SnapshotGLEventListener();
+        glWindow.addGLEventListener(snap);
+        glWindow.addKeyListener(new KeyAdapter() {
+            @Override
+            public void keyPressed(final KeyEvent e) {
+                if( e.isAutoRepeat() ) {
+                    return;
+                }
+                if(e.getKeyChar()=='x') {
+                    final int[] hadSurfacePixelScale = glWindow.getCurrentSurfaceScale(new int[2]);
+                    final int[] reqSurfacePixelScale;
+                    if( hadSurfacePixelScale[0] == ScalableSurface.IDENTITY_PIXELSCALE ) {
+                        reqSurfacePixelScale = new int[] { ScalableSurface.AUTOMAX_PIXELSCALE, ScalableSurface.AUTOMAX_PIXELSCALE };
+                    } else {
+                        reqSurfacePixelScale = new int[] { ScalableSurface.IDENTITY_PIXELSCALE, ScalableSurface.IDENTITY_PIXELSCALE };
+                    }
+                    System.err.println("[set PixelScale pre]: had "+hadSurfacePixelScale[0]+"x"+hadSurfacePixelScale[1]+" -> req "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]);
+                    snap.setMakeSnapshot();
+                    glWindow.setSurfaceScale(reqSurfacePixelScale);
+                    final int[] valReqSurfacePixelScale = glWindow.getRequestedSurfaceScale(new int[2]);
+                    final int[] hasSurfacePixelScale = glWindow.getCurrentSurfaceScale(new int[2]);
+                    final int[] nativeSurfacePixelScale = glWindow.getNativeSurfaceScale(new int[2]);
+                    System.err.println("[set PixelScale post]: "+hadSurfacePixelScale[0]+"x"+hadSurfacePixelScale[1]+" (had) -> "+
+                                       reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
+                                       valReqSurfacePixelScale[0]+"x"+valReqSurfacePixelScale[1]+" (val) -> "+
+                                       hasSurfacePixelScale[0]+"x"+hasSurfacePixelScale[1]+" (has), "+
+                                       nativeSurfacePixelScale[0]+"x"+nativeSurfacePixelScale[1]+" (native)");
+                    setTitle(glWindow);
+                }
+            }
+        });
+
+        glWindow.setVisible(true);
+
+        final int[] hasSurfacePixelScale1 = glWindow.getCurrentSurfaceScale(new int[2]);
+        System.err.println("HiDPI PixelScale: "+reqSurfacePixelScale[0]+"x"+reqSurfacePixelScale[1]+" (req) -> "+
+                           valReqSurfacePixelScale[0]+"x"+valReqSurfacePixelScale[1]+" (val) -> "+
+                           hasSurfacePixelScale1[0]+"x"+hasSurfacePixelScale1[1]+" (has)");
+        setTitle(glWindow);
+
+        snap.setMakeSnapshot();
+        glWindow.display();
+
+        Thread.sleep(durationPerTest);
+
+        glWindow.destroy();
+
+    }
 
     @Test
-    public void test01() throws InterruptedException {
-        long t0 = System.nanoTime();
-        GLProfile.initSingleton();
-        long t1 = System.nanoTime();
-        // preset ..
-        final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(
-                new GLCapabilities(GLProfile.getGL2ES2()), 640, 480, true);
-        final GLDrawable drawable = winctx.context.getGLDrawable();
-        final GL2ES2 gl = winctx.context.getGL().getGL2ES2();
-        System.err.println(winctx.context);
-
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        // test code ..        
-        final ShaderState st = new ShaderState();
-        
-        final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, RedSquareES2.class, "shader",
-                "shader/bin", "default", true);
-        final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, RedSquareES2.class, "shader",
-                "shader/bin", "ruler", true);
-        vp0.defaultShaderCustomization(gl, true, true);
-        fp0.defaultShaderCustomization(gl, true, true);
-
-        final ShaderProgram sp0 = new ShaderProgram();
-        sp0.add(gl, vp0, System.err);
-        sp0.add(gl, fp0, System.err);       
-        Assert.assertTrue(0 != sp0.program()); 
-        Assert.assertTrue(!sp0.inUse());
-        Assert.assertTrue(!sp0.linked());
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
-        st.attachShaderProgram(gl, sp0, true);
-        
-        final PMVMatrix pmvMatrix = new PMVMatrix();
-        final GLUniformData pmvMatrixUniform = new GLUniformData("gcu_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        st.ownUniform(pmvMatrixUniform);       
-        st.uniform(gl, pmvMatrixUniform);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-         
-        final GLUniformData rulerColor= new GLUniformData("gcu_RulerColor", 3, Buffers.newDirectFloatBuffer(3));
-        final FloatBuffer rulerColorV = (FloatBuffer) rulerColor.getBuffer();
-        rulerColorV.put(0, 0.5f);
-        rulerColorV.put(1, 0.5f);
-        rulerColorV.put(2, 0.5f);
-        st.ownUniform(rulerColor);       
-        st.uniform(gl, rulerColor);        
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
-        Assert.assertNotNull(winctx);
-        Assert.assertNotNull(winctx.window);
-        Assert.assertNotNull(winctx.window.getScreen());
-        final MonitorDevice monitor = winctx.window.getMainMonitor();
-        Assert.assertNotNull(monitor);
-        System.err.println(monitor);
-        final MonitorMode mmode = monitor.getCurrentMode();
-        Assert.assertNotNull(mmode);
-        System.err.println(mmode);
-        final DimensionImmutable sdim = monitor.getSizeMM();
-        final DimensionImmutable spix = mmode.getSurfaceSize().getResolution();   
-        final GLUniformData rulerPixFreq = new GLUniformData("gcu_RulerPixFreq", 2, Buffers.newDirectFloatBuffer(2));
-        final FloatBuffer rulerPixFreqV = (FloatBuffer) rulerPixFreq.getBuffer();
-        rulerPixFreqV.put(0, (float)spix.getWidth() / (float)sdim.getWidth() * 10.0f);
-        rulerPixFreqV.put(1, (float)spix.getHeight() / (float)sdim.getHeight() * 10.0f);
-        st.ownUniform(rulerPixFreq);
-        st.uniform(gl, rulerPixFreq);        
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        System.err.println("Screen dim "+sdim);
-        System.err.println("Screen siz "+spix);
-        System.err.println("Screen pixel/cm "+rulerPixFreqV.get(0)+", "+rulerPixFreqV.get(1));
-
-        final GLArrayDataServer vertices0 = GLArrayDataServer.createGLSL("gca_Vertices", 3, GL.GL_FLOAT, false, 4, GL.GL_STATIC_DRAW);
-        vertices0.putf(0); vertices0.putf(1);  vertices0.putf(0);
-        vertices0.putf(1);  vertices0.putf(1);  vertices0.putf(0);
-        vertices0.putf(0); vertices0.putf(0); vertices0.putf(0);
-        vertices0.putf(1);  vertices0.putf(0); vertices0.putf(0);
-        vertices0.seal(gl, true);
-        st.ownAttribute(vertices0, true);
-        
-        // misc GL setup
-        gl.glClearColor(1, 1, 1, 1);
-        gl.glEnable(GL2ES2.GL_DEPTH_TEST);
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-
-        // reshape
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
-        pmvMatrix.glLoadIdentity();
-        pmvMatrix.glOrthof(0f, 1f, 0f, 1f, -10f, 10f);
-        // pmvMatrix.gluPerspective(45.0F, (float) drawable.getWidth() / (float) drawable.getHeight(), 1.0F, 100.0F);
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
-        pmvMatrix.glLoadIdentity();
-        // pmvMatrix.glTranslatef(0, 0, -6);
-        // pmvMatrix.glRotatef(45f, 1f, 0f, 0f);
-        st.uniform(gl, pmvMatrixUniform);
-        gl.glViewport(0, 0, drawable.getWidth(), drawable.getHeight());        
-        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
-        for(int i=0; i<10; i++) {
-            vertices0.enableBuffer(gl, true);
-            gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
-            gl.glDrawArrays(GL.GL_TRIANGLE_STRIP, 0, 4);        
-            vertices0.enableBuffer(gl, false);
-            drawable.swapBuffers();
-            Thread.sleep(durationPerTest/10);
-        }
-        
-        long t2 = System.nanoTime();
-        
-        NEWTGLContext.destroyWindow(winctx);
-        
-        long t3 = System.nanoTime();
-        
-        System.err.println("t1-t0: "+ (t1-t0)/1e6 +"ms"); 
-        System.err.println("t3-t0: "+ (t3-t0)/1e6 +"ms"); 
-        System.err.println("t3-t2: "+ (t3-t2)/1e6 +"ms"); 
+    public void test01_PSA() throws InterruptedException {
+        runTestGL();
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    @Test
+    public void test99_PS1() throws InterruptedException, InvocationTargetException {
+        if(manualTest) return;
+        reqSurfacePixelScale[0] = ScalableSurface.IDENTITY_PIXELSCALE;
+        reqSurfacePixelScale[1] = ScalableSurface.IDENTITY_PIXELSCALE;
+        runTestGL();
+    }
+
+    public static void main(final String args[]) throws IOException {
         System.err.println("main - start");
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atoi(args[++i], (int)durationPerTest);
+            } else if(args[i].equals("-pixelScale")) {
+                i++;
+                final int pS = MiscUtils.atoi(args[i], reqSurfacePixelScale[0]);
+                reqSurfacePixelScale[0] = pS;
+                reqSurfacePixelScale[1] = pS;
+            } else if(args[i].equals("-manual")) {
+                manualTest = true;
             }
         }
-        String tstname = TestRulerNEWT01.class.getName();
+        final String tstname = TestRulerNEWT01.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
         System.err.println("main - end");
-    }    
+    }
 }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java
index f26927a..e5b2dd2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestShaderCompilationBug459AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -30,6 +30,8 @@ package com.jogamp.opengl.test.junit.jogl.glsl;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.util.Animator;
 
+import javax.media.opengl.GL;
+import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GL2GL3;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLCapabilities;
@@ -37,6 +39,7 @@ import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLException;
 import javax.media.opengl.GLProfile;
 import javax.media.opengl.awt.GLCanvas;
+
 import java.awt.Frame;
 
 import org.junit.Assert;
@@ -70,13 +73,13 @@ public class TestShaderCompilationBug459AWT extends UITestCase {
 
     @Test
     public void compileShader() throws InterruptedException {
-        GLProfile glp = GLProfile.get(GLProfile.GL2GL3);         
-        GLCapabilities caps = new GLCapabilities(glp);   
+        final GLProfile glp = GLProfile.get(GLProfile.GL2GL3);
+        final GLCapabilities caps = new GLCapabilities(glp);
         // commenting out this line makes it work
         caps.setStencilBits(8);
 
         // commenting in this line also makes it work
-        //caps.setSampleBuffers(true); 
+        //caps.setSampleBuffers(true);
 
         final Frame frame = new Frame("Bug 459 shader compilation test");
         Assert.assertNotNull(frame);
@@ -87,62 +90,62 @@ public class TestShaderCompilationBug459AWT extends UITestCase {
 
         glCanvas.addGLEventListener(new GLEventListener() {
             /* @Override */
-            public void init(GLAutoDrawable drawable) {
-                String code = "void main(void){gl_Position = vec4(0,0,0,1);}";         
+            public void init(final GLAutoDrawable drawable) {
+                final String code = "void main(void){gl_Position = vec4(0,0,0,1);}";
 
-                GL2GL3 gl = drawable.getGL().getGL2GL3();         
-                int id = gl.glCreateShader(GL2GL3.GL_VERTEX_SHADER); 
+                final GL2GL3 gl = drawable.getGL().getGL2GL3();
+                final int id = gl.glCreateShader(GL2ES2.GL_VERTEX_SHADER);
 
                 try {
-                    gl.glShaderSource(id, 1, new String[] { code }, (int[])null, 0); 
-                    gl.glCompileShader(id); 
-    
-                    int[] compiled = new int[1]; 
-                    gl.glGetShaderiv(id, GL2GL3.GL_COMPILE_STATUS, compiled, 0); 
-                    if (compiled[0] == GL2GL3.GL_FALSE) { 
-                        int[] logLength = new int[1]; 
-                        gl.glGetShaderiv(id, GL2GL3.GL_INFO_LOG_LENGTH, logLength, 0); 
-                        
-                        byte[] log = new byte[logLength[0]]; 
-                        gl.glGetShaderInfoLog(id, logLength[0], (int[])null, 0, log, 0); 
-                        
-                        System.err.println("Error compiling the shader: " + new String(log)); 
-                            
-                        gl.glDeleteShader(id); 
-                    } 
+                    gl.glShaderSource(id, 1, new String[] { code }, (int[])null, 0);
+                    gl.glCompileShader(id);
+
+                    final int[] compiled = new int[1];
+                    gl.glGetShaderiv(id, GL2ES2.GL_COMPILE_STATUS, compiled, 0);
+                    if (compiled[0] == GL.GL_FALSE) {
+                        final int[] logLength = new int[1];
+                        gl.glGetShaderiv(id, GL2ES2.GL_INFO_LOG_LENGTH, logLength, 0);
+
+                        final byte[] log = new byte[logLength[0]];
+                        gl.glGetShaderInfoLog(id, logLength[0], (int[])null, 0, log, 0);
+
+                        System.err.println("Error compiling the shader: " + new String(log));
+
+                        gl.glDeleteShader(id);
+                    }
                     else {
-                        System.out.println("Shader compiled: id=" + id); 
+                        System.out.println("Shader compiled: id=" + id);
                     }
                 }
-                catch( GLException e ) {
+                catch( final GLException e ) {
                     glexception = e;
                 }
             }
 
             /* @Override */
-            public void dispose(GLAutoDrawable drawable) {
+            public void dispose(final GLAutoDrawable drawable) {
             }
 
             /* @Override */
-            public void display(GLAutoDrawable drawable) {
+            public void display(final GLAutoDrawable drawable) {
             }
 
             /* @Override */
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
             }
         });
 
-        Animator animator = new Animator(glCanvas);
+        final Animator animator = new Animator(glCanvas);
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame.setSize(512, 512);
                     frame.setVisible(true);
                 } } );
-        } catch(Exception ex) {
+        } catch(final Exception ex) {
             throw new RuntimeException(ex);
         }
-        animator.setUpdateFPSFrames(1, null);        
+        animator.setUpdateFPSFrames(1, null);
         animator.start();
 
         while(animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
@@ -163,13 +166,13 @@ public class TestShaderCompilationBug459AWT extends UITestCase {
                     frame.remove(glCanvas);
                     frame.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }        
+        }
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestShaderCompilationBug459AWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java
index bbfe1dd..71b2d48 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glsl/TestTransformFeedbackVaryingsBug407NEWT.java
@@ -8,6 +8,7 @@ import java.io.PrintStream;
 
 import javax.media.opengl.GL;
 import javax.media.opengl.GL2ES2;
+import javax.media.opengl.GL2ES3;
 import javax.media.opengl.GL3;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLException;
@@ -30,7 +31,7 @@ import java.io.IOException;
 public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
 
     private static final boolean debugGL = true;
-    
+
     private static final String VERTEX_SHADER_TEXT =
                   "#version 150                           \n"
                 + "                                       \n"
@@ -40,26 +41,26 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
                 + "  Position = vec4(1.0, 1.0, 1.0, 1.0); \n"
                 + "}                                      \n";
 
-    class MyShader {
+    static class MyShader {
         int shaderProgram;
         int vertShader;
 
-        MyShader(int shaderProgram, int vertShader) {
+        MyShader(final int shaderProgram, final int vertShader) {
             this.shaderProgram = shaderProgram;
             this.vertShader = vertShader;
         }
     }
 
-    private MyShader attachShader(GL3 gl, String text, int type) {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        PrintStream pbaos = new PrintStream(baos);
+    private MyShader attachShader(final GL3 gl, final String text, final int type) {
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final PrintStream pbaos = new PrintStream(baos);
 
-        int shaderProgram = gl.glCreateProgram();
+        final int shaderProgram = gl.glCreateProgram();
 
-        int vertShader = gl.glCreateShader(type);
+        final int vertShader = gl.glCreateShader(type);
 
-        String[] lines = new String[]{text};
-        int[] lengths = new int[]{lines[0].length()};
+        final String[] lines = new String[]{text};
+        final int[] lengths = new int[]{lines[0].length()};
         gl.glShaderSource(vertShader, lines.length, lines, lengths, 0);
         gl.glCompileShader(vertShader);
 
@@ -75,7 +76,7 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
         return new MyShader(shaderProgram, vertShader);
     }
 
-    private void releaseShader(GL3 gl, MyShader myShader) {
+    private void releaseShader(final GL3 gl, final MyShader myShader) {
         if(null!=myShader) {
             gl.glDetachShader(myShader.shaderProgram, myShader.vertShader);
             gl.glDeleteShader(myShader.vertShader);
@@ -85,7 +86,7 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
     }
 
     final static String glps = GLProfile.GL3;
-    
+
     private NEWTGLContext.WindowContext prepareTest() throws GLException, InterruptedException {
         final NEWTGLContext.WindowContext winctx = NEWTGLContext.createOnscreenWindow(
                 new GLCapabilities(GLProfile.getMaxProgrammable(true)), 480, 480, debugGL);
@@ -94,11 +95,11 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
             cleanupTest(winctx);
             return null;
         }
-        Assert.assertEquals(GL.GL_NO_ERROR, winctx.context.getGL().glGetError());        
+        Assert.assertEquals(GL.GL_NO_ERROR, winctx.context.getGL().glGetError());
         return winctx;
     }
 
-    private void cleanupTest(NEWTGLContext.WindowContext winctx) {
+    private void cleanupTest(final NEWTGLContext.WindowContext winctx) {
         if(null!=winctx) {
             NEWTGLContext.destroyWindow(winctx);
         }
@@ -106,27 +107,27 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
 
     @Test(timeout=60000)
     public void testGlTransformFeedbackVaryings_WhenVarNameOK() throws GLException, InterruptedException {
-        NEWTGLContext.WindowContext winctx = prepareTest();
+        final NEWTGLContext.WindowContext winctx = prepareTest();
         if(null == winctx) {
             return;
         }
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        PrintStream pbaos = new PrintStream(baos);
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final PrintStream pbaos = new PrintStream(baos);
 
         // given
 
         final GL3 gl = winctx.context.getGL().getGL3();
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
-        MyShader myShader = attachShader(gl, VERTEX_SHADER_TEXT, GL3.GL_VERTEX_SHADER);
-        String[] vars = new String[]{"Position"};
+
+        final MyShader myShader = attachShader(gl, VERTEX_SHADER_TEXT, GL2ES2.GL_VERTEX_SHADER);
+        final String[] vars = new String[]{"Position"};
 
         // when
 
-        gl.glTransformFeedbackVaryings(myShader.shaderProgram, 1, vars, GL3.GL_SEPARATE_ATTRIBS);
+        gl.glTransformFeedbackVaryings(myShader.shaderProgram, 1, vars, GL2ES3.GL_SEPARATE_ATTRIBS);
         gl.glLinkProgram(myShader.shaderProgram);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        
+
         // then
 
         boolean error = false;
@@ -136,33 +137,33 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
             error = true;
         }
         pbaos.flush(); baos.reset();
-        Assert.assertEquals(GL3.GL_NO_ERROR, gl.glGetError());
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
 
-        releaseShader(gl, myShader);        
+        releaseShader(gl, myShader);
         cleanupTest(winctx);
         Assert.assertFalse(error);
     }
 
     @Test(timeout=60000)
     public void testGlTransformFeedbackVaryings_WhenVarNameWrong() throws GLException, InterruptedException {
-        NEWTGLContext.WindowContext winctx = prepareTest();
+        final NEWTGLContext.WindowContext winctx = prepareTest();
         if(null == winctx) {
             return;
         }
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        PrintStream pbaos = new PrintStream(baos);
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final PrintStream pbaos = new PrintStream(baos);
 
         // given
 
         final GL3 gl = winctx.context.getGL().getGL3();
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
 
-        MyShader myShader = attachShader(gl, VERTEX_SHADER_TEXT, GL3.GL_VERTEX_SHADER);
-        String[] vars = new String[]{"PPPosition"};
+        final MyShader myShader = attachShader(gl, VERTEX_SHADER_TEXT, GL2ES2.GL_VERTEX_SHADER);
+        final String[] vars = new String[]{"PPPosition"};
 
         // when
 
-        gl.glTransformFeedbackVaryings(myShader.shaderProgram, 1, vars, GL3.GL_SEPARATE_ATTRIBS);
+        gl.glTransformFeedbackVaryings(myShader.shaderProgram, 1, vars, GL2ES3.GL_SEPARATE_ATTRIBS);
         gl.glLinkProgram(myShader.shaderProgram);
 
         // then
@@ -173,21 +174,21 @@ public class TestTransformFeedbackVaryingsBug407NEWT extends UITestCase {
             System.out.println("GOOD (expected link error) - testGlTransformFeedbackVaryings_WhenVarNameWrong:postLink: "+baos.toString());
             // should be invalid, due to wrong var name
         } else {
-            // oops 
+            // oops
             System.out.println("Error (unexpected link success) - testGlTransformFeedbackVaryings_WhenVarNameWrong link worked, but it should not");
             error = true;
         }
         pbaos.flush(); baos.reset();
-        Assert.assertEquals(GL3.GL_NO_ERROR, gl.glGetError());
-        
+        Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
+
         releaseShader(gl, myShader);
         cleanupTest(winctx);
 
         Assert.assertFalse(error);
     }
 
-    public static void main(String args[]) throws IOException {
-        String tstname = TestTransformFeedbackVaryingsBug407NEWT.class.getName();
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestTransformFeedbackVaryingsBug407NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug365TextureGenerateMipMaps.java b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug365TextureGenerateMipMaps.java
index b9e64e1..dfa26a0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug365TextureGenerateMipMaps.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug365TextureGenerateMipMaps.java
@@ -2,7 +2,9 @@ package com.jogamp.opengl.test.junit.jogl.glu;
 
 import java.nio.ByteBuffer;
 
+import javax.media.opengl.GL;
 import javax.media.opengl.GL2;
+import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLContext;
 import javax.media.opengl.GLDrawableFactory;
@@ -57,7 +59,7 @@ public class TestBug365TextureGenerateMipMaps extends UITestCase {
 		System.setProperty("jogl.texture.nonpot", "true");
         try {
         	setUpOffscreenAutoDrawable();
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             throw t;
         }
     }
@@ -68,18 +70,18 @@ public class TestBug365TextureGenerateMipMaps extends UITestCase {
     }
 
     private static void setUpOffscreenAutoDrawable() throws Throwable {
-    	GLProfile glp = GLProfile.getDefault();
-		GLCapabilities caps = new GLCapabilities(glp);
+    	final GLProfile glp = GLProfile.getDefault();
+		final GLCapabilities caps = new GLCapabilities(glp);
 
-		GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
+		final GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
 
 		// Make a drawable to get an offscreen context
 	    drawable = factory.createOffscreenAutoDrawable(null, caps, null, 2, 2);
 	    drawable.display(); // trigger context creation
-	    GLContext glContext = drawable.getContext();
+	    final GLContext glContext = drawable.getContext();
 	    try {
 	    	Assert.assertTrue("Could not make context current", GLContext.CONTEXT_NOT_CURRENT < glContext.makeCurrent());
-	    } catch (Throwable t) {
+	    } catch (final Throwable t) {
 	    	tearDownOffscreenAutoDrawable();
             throw t;
         }
@@ -93,17 +95,17 @@ public class TestBug365TextureGenerateMipMaps extends UITestCase {
         }
     }
 
-    private static void testTextureMipMapGeneration(int width, int height, int pixelFormat, int pixelType) {
-		int internalFormat = pixelFormat;
-		int border = 0;
-		boolean mipmap = true;
-		boolean dataIsCompressed = false;
-		boolean mustFlipVertically = false;
+    private static void testTextureMipMapGeneration(final int width, final int height, final int pixelFormat, final int pixelType) {
+		final int internalFormat = pixelFormat;
+		final int border = 0;
+		final boolean mipmap = true;
+		final boolean dataIsCompressed = false;
+		final boolean mustFlipVertically = false;
 
-		int memReq = Mipmap.image_size( width, height, pixelFormat, pixelType );
+		final int memReq = Mipmap.image_size( width, height, pixelFormat, pixelType );
 		ByteBuffer buffer = Buffers.newDirectByteBuffer( memReq );
 
-		TextureData data = new TextureData(drawable.getGLProfile(),
+		final TextureData data = new TextureData(drawable.getGLProfile(),
 				internalFormat,
 				width,
 				height,
@@ -116,7 +118,7 @@ public class TestBug365TextureGenerateMipMaps extends UITestCase {
 				buffer,
 				null);
 
-		Texture texture = TextureIO.newTexture(drawable.getGL(), data);
+		final Texture texture = TextureIO.newTexture(drawable.getGL(), data);
 		// Cleanup
 		texture.destroy(drawable.getGL());
 		data.destroy();
@@ -126,145 +128,145 @@ public class TestBug365TextureGenerateMipMaps extends UITestCase {
 
     @Test
     public void test00_MipMap_ScaleInternal_RGB_UBYTE () {
-    	int width = 1;
-    	int height = 7;
-    	int pixelFormat = GL2.GL_RGB;
-    	int pixelType = GL2.GL_UNSIGNED_BYTE;
+    	final int width = 1;
+    	final int height = 7;
+    	final int pixelFormat = GL.GL_RGB;
+    	final int pixelType = GL.GL_UNSIGNED_BYTE;
 
     	testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
     }
 
     @Test
     public void test01_MipMap_ScaleInternal_RGBA_UBYTE () {
-    	int width = 1;
-    	int height = 7;
-    	int pixelFormat = GL2.GL_RGBA;
-    	int pixelType = GL2.GL_UNSIGNED_BYTE;
+    	final int width = 1;
+    	final int height = 7;
+    	final int pixelFormat = GL.GL_RGBA;
+    	final int pixelType = GL.GL_UNSIGNED_BYTE;
 
     	testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
     }
 
     @Test
     public void test02_MipMap_ScaleInternal_RGB_BYTE () {
-    	int width = 1;
-    	int height = 7;
-    	int pixelFormat = GL2.GL_RGB;
-    	int pixelType = GL2.GL_BYTE;
+    	final int width = 1;
+    	final int height = 7;
+    	final int pixelFormat = GL.GL_RGB;
+    	final int pixelType = GL.GL_BYTE;
 
     	testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
     }
 
     @Test
     public void test03_MipMap_ScaleInternal_RGBA_BYTE () {
-    	int width = 1;
-    	int height = 7;
-    	int pixelFormat = GL2.GL_RGBA;
-    	int pixelType = GL2.GL_BYTE;
+    	final int width = 1;
+    	final int height = 7;
+    	final int pixelFormat = GL.GL_RGBA;
+    	final int pixelType = GL.GL_BYTE;
 
     	testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
     }
 
     @Test
     public void test04_MipMap_ScaleInternal_RGB_USHORT () {
-    	int width = 1;
-    	int height = 7;
-    	int pixelFormat = GL2.GL_RGB;
-    	int pixelType = GL2.GL_UNSIGNED_SHORT;
+    	final int width = 1;
+    	final int height = 7;
+    	final int pixelFormat = GL.GL_RGB;
+    	final int pixelType = GL.GL_UNSIGNED_SHORT;
 
     	testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
     }
 
     @Test
     public void test05_MipMap_ScaleInternal_RGBA_USHORT () {
-    	int width = 1;
-    	int height = 7;
-    	int pixelFormat = GL2.GL_RGBA;
-    	int pixelType = GL2.GL_UNSIGNED_SHORT;
+    	final int width = 1;
+    	final int height = 7;
+    	final int pixelFormat = GL.GL_RGBA;
+    	final int pixelType = GL.GL_UNSIGNED_SHORT;
 
     	testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
     }
 
     @Test
     public void test06_MipMap_ScaleInternal_RGB_SHORT () {
-    	int width = 1;
-    	int height = 7;
-    	int pixelFormat = GL2.GL_RGB;
-    	int pixelType = GL2.GL_SHORT;
+    	final int width = 1;
+    	final int height = 7;
+    	final int pixelFormat = GL.GL_RGB;
+    	final int pixelType = GL.GL_SHORT;
 
     	testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
     }
 
     @Test
     public void test07_MipMap_ScaleInternal_RGBA_SHORT () {
-    	int width = 1;
-    	int height = 7;
-    	int pixelFormat = GL2.GL_RGBA;
-    	int pixelType = GL2.GL_SHORT;
+    	final int width = 1;
+    	final int height = 7;
+    	final int pixelFormat = GL.GL_RGBA;
+    	final int pixelType = GL.GL_SHORT;
 
     	testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
     }
 
     @Test
     public void test08_MipMap_ScaleInternal_RGB_UINT () {
-    	int width = 1;
-    	int height = 7;
-    	int pixelFormat = GL2.GL_RGB;
-    	int pixelType = GL2.GL_UNSIGNED_INT;
+    	final int width = 1;
+    	final int height = 7;
+    	final int pixelFormat = GL.GL_RGB;
+    	final int pixelType = GL.GL_UNSIGNED_INT;
 
     	testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
     }
 
     @Test
     public void test09_MipMap_ScaleInternal_RGBA_UINT () {
-    	int width = 1;
-    	int height = 7;
-    	int pixelFormat = GL2.GL_RGBA;
-    	int pixelType = GL2.GL_UNSIGNED_INT;
+    	final int width = 1;
+    	final int height = 7;
+    	final int pixelFormat = GL.GL_RGBA;
+    	final int pixelType = GL.GL_UNSIGNED_INT;
 
     	testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
     }
 
     @Test
     public void test10_MipMap_ScaleInternal_RGB_INT () {
-    	int width = 1;
-    	int height = 7;
-    	int pixelFormat = GL2.GL_RGB;
-    	int pixelType = GL2.GL_INT;
+    	final int width = 1;
+    	final int height = 7;
+    	final int pixelFormat = GL.GL_RGB;
+    	final int pixelType = GL2ES2.GL_INT;
 
     	testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
     }
 
     @Test
     public void test11_MipMap_ScaleInternal_RGBA_INT () {
-    	int width = 1;
-    	int height = 7;
-    	int pixelFormat = GL2.GL_RGBA;
-    	int pixelType = GL2.GL_INT;
+    	final int width = 1;
+    	final int height = 7;
+    	final int pixelFormat = GL.GL_RGBA;
+    	final int pixelType = GL2ES2.GL_INT;
 
     	testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
     }
 
     @Test
     public void test12_MipMap_ScaleInternal_RGB_FLOAT () {
-    	int width = 1;
-    	int height = 7;
-    	int pixelFormat = GL2.GL_RGB;
-    	int pixelType = GL2.GL_FLOAT;
+    	final int width = 1;
+    	final int height = 7;
+    	final int pixelFormat = GL.GL_RGB;
+    	final int pixelType = GL.GL_FLOAT;
 
     	testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
     }
 
     @Test
     public void test13_MipMap_ScaleInternal_RGBA_FLOAT () {
-    	int width = 1;
-    	int height = 7;
-    	int pixelFormat = GL2.GL_RGBA;
-    	int pixelType = GL2.GL_FLOAT;
+    	final int width = 1;
+    	final int height = 7;
+    	final int pixelFormat = GL.GL_RGBA;
+    	final int pixelType = GL.GL_FLOAT;
 
     	testTextureMipMapGeneration(width, height, pixelFormat, pixelType);
     }
 
-	public static void main(String[] args) {
+	public static void main(final String[] args) {
 		org.junit.runner.JUnitCore.main(TestBug365TextureGenerateMipMaps.class.getName());
 	}
 }
\ No newline at end of file
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug463ScaleImageMemoryAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug463ScaleImageMemoryAWT.java
index e5690a0..5c63b2e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug463ScaleImageMemoryAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug463ScaleImageMemoryAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.glu;
 
 import java.awt.Frame;
@@ -51,33 +51,33 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
  * 4-byte direct buffer objects inside the tight loops of Image.fill_image() and Image.empty_image(). Since
  * the JVM apparently can only allocate direct buffer in 4MB chunks, each 4-byte buffer cost us a million times
  * the memory it should have. Changing the constructor of Type_Widget.java back to non-direct buffer (like it
- * was in JOGL 1) solves the problem.  
+ * was in JOGL 1) solves the problem.
  * @author Wade Walker
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestBug463ScaleImageMemoryAWT extends UITestCase implements GLEventListener {
 
     /* @Override */
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
     }
 
     /* @Override */
-    public void display(GLAutoDrawable drawable) {
-        int widthin = 559;
-        int heightin = 425;
-        
-        int widthout = 1024;
-        int heightout = 512;
-        
-        int textureInLength = widthin * heightin * 4;
-        int textureOutLength = widthout * heightout * 4;
-        
-        byte[] datain = new byte[textureInLength];
-        byte[] dataout = new byte[textureOutLength];
-        
-        ByteBuffer bufferIn  = ByteBuffer.wrap(datain);
-        ByteBuffer bufferOut = ByteBuffer.wrap(dataout);      
-        GLUgl2es1 glu = new GLUgl2es1(); 
+    public void display(final GLAutoDrawable drawable) {
+        final int widthin = 559;
+        final int heightin = 425;
+
+        final int widthout = 1024;
+        final int heightout = 512;
+
+        final int textureInLength = widthin * heightin * 4;
+        final int textureOutLength = widthout * heightout * 4;
+
+        final byte[] datain = new byte[textureInLength];
+        final byte[] dataout = new byte[textureOutLength];
+
+        final ByteBuffer bufferIn  = ByteBuffer.wrap(datain);
+        final ByteBuffer bufferOut = ByteBuffer.wrap(dataout);
+        final GLUgl2es1 glu = new GLUgl2es1();
         // in the failing case, the system would run out of memory in here
         glu.gluScaleImage( GL.GL_RGBA,
                            widthin, heightin, GL.GL_UNSIGNED_BYTE, bufferIn,
@@ -85,24 +85,24 @@ public class TestBug463ScaleImageMemoryAWT extends UITestCase implements GLEvent
     }
 
     /* @Override */
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
     }
 
 
     /* @Override */
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
     }
 
     @Test
     public void test01() throws InterruptedException {
-        GLProfile glprofile = GLProfile.getGL2ES1();
-        GLCapabilities glCapabilities = new GLCapabilities(glprofile);
+        final GLProfile glprofile = GLProfile.getGL2ES1();
+        final GLCapabilities glCapabilities = new GLCapabilities(glprofile);
         final GLCanvas canvas = new GLCanvas(glCapabilities);
         canvas.addGLEventListener( this );
-        
+
         final Frame frame = new Frame("Test");
         frame.add(canvas);
-        frame.setSize(256, 256);        
+        frame.setSize(256, 256);
         frame.validate();
 
         try {
@@ -110,15 +110,15 @@ public class TestBug463ScaleImageMemoryAWT extends UITestCase implements GLEvent
                 public void run() {
                     frame.setVisible(true);
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
-        
+
         canvas.display();
 
         Thread.sleep(200);
-        
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
@@ -126,13 +126,13 @@ public class TestBug463ScaleImageMemoryAWT extends UITestCase implements GLEvent
                     frame.remove(canvas);
                     frame.dispose();
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
-        }        
+        }
    }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestBug463ScaleImageMemoryAWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug694ScaleImageUnpackBufferSizeAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug694ScaleImageUnpackBufferSizeAWT.java
index ca5b089..184dea8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug694ScaleImageUnpackBufferSizeAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/glu/TestBug694ScaleImageUnpackBufferSizeAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.glu;
 
 import java.awt.Frame;
@@ -57,77 +57,78 @@ import com.jogamp.opengl.util.GLPixelStorageModes;
 public class TestBug694ScaleImageUnpackBufferSizeAWT extends UITestCase implements GLEventListener {
 
     /* @Override */
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
     }
 
     /* @Override */
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         if( !testDone ) {
             testDone = true;
-            
+
             final GL gl = drawable.getGL();
-            GLU glu = GLU.createGLU(gl);
+            final GLU glu = GLU.createGLU(gl);
             testGLUScaleImage(gl, glu, 0); // default 4
             testGLUScaleImage(gl, glu, 1);
             testGLUScaleImage(gl, glu, 4);
             testGLUScaleImage(gl, glu, 8);
-            glu.destroy();
         }
     }
-    
+
     boolean testDone = false;
-    
-    private void testGLUScaleImage(GL gl, GLU glu, int unpackAlignment) {
-        final GLPixelStorageModes psm = new GLPixelStorageModes(gl);
+
+    private void testGLUScaleImage(final GL gl, final GLU glu, final int unpackAlignment) {
+        final GLPixelStorageModes psm = new GLPixelStorageModes();
         if(0 < unpackAlignment) {
             psm.setUnpackAlignment(gl, unpackAlignment);
         }
-        
+
         final int widthin = 213;
         final int heightin = 213;
-        
+
         final int widthout = 256;
         final int heightout = 256;
-        
+
         final int glFormat = GL.GL_LUMINANCE;
         final int glType = GL.GL_UNSIGNED_BYTE;
         final int tmp[] = new int[1];
-        
+
         final int unpackSizeInLen = GLBuffers.sizeof(gl, tmp, glFormat, glType, widthin, heightin, 1, false);
         final int unpackSizeOutLen = GLBuffers.sizeof(gl, tmp, glFormat, glType, widthout, heightout, 1, false);
-        
+
         System.err.println("Unpack-Alignment "+unpackAlignment+":  in-size "+unpackSizeInLen);
         System.err.println("Unpack-Alignment "+unpackAlignment+": out-size "+unpackSizeOutLen);
-        
-        ByteBuffer bufferIn  = Buffers.newDirectByteBuffer(unpackSizeInLen);
-        ByteBuffer bufferOut = Buffers.newDirectByteBuffer(unpackSizeOutLen);
-        
+
+        final ByteBuffer bufferIn  = Buffers.newDirectByteBuffer(unpackSizeInLen);
+        final ByteBuffer bufferOut = Buffers.newDirectByteBuffer(unpackSizeOutLen);
+
         glu.gluScaleImage( GL.GL_LUMINANCE,
                            widthin, heightin, GL.GL_UNSIGNED_BYTE, bufferIn,
                            widthout, heightout, GL.GL_UNSIGNED_BYTE, bufferOut );
-        
-        psm.restore(gl);
+
+        if(0 < unpackAlignment) {
+            psm.restore(gl);
+        }
     }
 
     /* @Override */
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
     }
 
 
     /* @Override */
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
     }
 
     @Test
     public void test01() throws InterruptedException {
-        GLProfile glprofile = GLProfile.getDefault();
-        GLCapabilities glCapabilities = new GLCapabilities(glprofile);
+        final GLProfile glprofile = GLProfile.getDefault();
+        final GLCapabilities glCapabilities = new GLCapabilities(glprofile);
         final GLCanvas canvas = new GLCanvas(glCapabilities);
         canvas.addGLEventListener( this );
-        
+
         final Frame frame = new Frame("Test");
         frame.add(canvas);
-        frame.setSize(256, 256);        
+        frame.setSize(256, 256);
         frame.validate();
 
         try {
@@ -135,15 +136,15 @@ public class TestBug694ScaleImageUnpackBufferSizeAWT extends UITestCase implemen
                 public void run() {
                     frame.setVisible(true);
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
         }
-        
+
         canvas.display();
 
         Thread.sleep(200);
-        
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
@@ -151,13 +152,13 @@ public class TestBug694ScaleImageUnpackBufferSizeAWT extends UITestCase implemen
                     frame.remove(canvas);
                     frame.dispose();
                 }});
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             t.printStackTrace();
             Assume.assumeNoException(t);
-        }        
+        }
    }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestBug694ScaleImageUnpackBufferSizeAWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestBinary16NOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestBinary16NOUI.java
index 8f56c13..5e4166a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestBinary16NOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestBinary16NOUI.java
@@ -701,7 +701,7 @@ public final class TestBinary16NOUI extends UITestCase  /* due to hardship on ma
     Assert.assertEquals(r, -1.0, 0.0);
   }
 
-  public static void main(String args[]) {
+  public static void main(final String args[]) {
       for(int i=0; i<args.length; i++) {
         if(args[i].equals("-stepping")) {
             stepping = MiscUtils.atoi(args[++i], stepping);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil01MatrixMatrixMultNOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil01MatrixMatrixMultNOUI.java
deleted file mode 100644
index 3f22fec..0000000
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil01MatrixMatrixMultNOUI.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/**
- * Copyright 2012 JogAmp Community. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification, are
- * permitted provided that the following conditions are met:
- * 
- *    1. Redistributions of source code must retain the above copyright notice, this list of
- *       conditions and the following disclaimer.
- * 
- *    2. Redistributions in binary form must reproduce the above copyright notice, this list
- *       of conditions and the following disclaimer in the documentation and/or other materials
- *       provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
- * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of JogAmp Community.
- */
- 
-package com.jogamp.opengl.test.junit.jogl.math;
-
-import org.junit.Assert;
-import org.junit.Test;
-import org.junit.FixMethodOrder;
-import org.junit.runners.MethodSorters;
-
-import com.jogamp.opengl.math.FloatUtil;
-
- at FixMethodOrder(MethodSorters.NAME_ASCENDING)
-public class TestFloatUtil01MatrixMatrixMultNOUI {
-
-    final float[] m1 = new float[]{    1,    3,    4,    0,
-                                       6,    7,    8,    5,
-                                      98,    7,    6,    9,
-                                      54,    3,    2,    5 };
-
-    final float[] m2 = new float[]{    1,    6,   98,   54,
-                                       3,    7,    7,    3,
-                                       4,    8,    6,    2,
-                                       0,    5,    9,    5 };
-
-    final float[] m1xm2_RM = // m2xm1_CM 
-                       new float[]{   26,   59,  143,   71,
-                                      59,  174,  730,  386,
-                                     143,  730, 9770, 5370,
-                                      71,  386, 5370, 2954 };
-
-    final float[] m2xm1_RM = // m1xm2_CM
-                       new float[]{12557,  893,  748, 1182,
-                                     893,  116,  116,  113,
-                                     748,  116,  120,  104,
-                                    1182,  113,  104,  131 };
-    
-    public static final void multMatrixf_RM(final float[] a, int a_off, final float[] b, int b_off, float[] d, int d_off) {
-     for (int i = 0; i < 4; i++) {
-        final float ai0=a[a_off+i*4+0],  ai1=a[a_off+i*4+1],  ai2=a[a_off+i*4+2],  ai3=a[a_off+i*4+3];
-        d[d_off+i*4+0] = ai0 * b[b_off+0*4+0] + ai1 * b[b_off+1*4+0] + ai2 * b[b_off+2*4+0] + ai3 * b[b_off+3*4+0] ;
-        d[d_off+i*4+1] = ai0 * b[b_off+0*4+1] + ai1 * b[b_off+1*4+1] + ai2 * b[b_off+2*4+1] + ai3 * b[b_off+3*4+1] ;
-        d[d_off+i*4+2] = ai0 * b[b_off+0*4+2] + ai1 * b[b_off+1*4+2] + ai2 * b[b_off+2*4+2] + ai3 * b[b_off+3*4+2] ;
-        d[d_off+i*4+3] = ai0 * b[b_off+0*4+3] + ai1 * b[b_off+1*4+3] + ai2 * b[b_off+2*4+3] + ai3 * b[b_off+3*4+3] ;
-     }
-    }
-
-    @Test
-    public void testCM_m1xm2(){
-        
-        float[] r = new float[16];
-        
-        FloatUtil.multMatrixf(m1, 0, m2, 0, r, 0);
-
-        Assert.assertArrayEquals(m2xm1_RM, r, 0f);
-    }
-    
-    @Test
-    public void testCM_m2xm1(){
-        
-        float[] r = new float[16];
-        
-        FloatUtil.multMatrixf(m2, 0, m1, 0, r, 0);
-
-        Assert.assertArrayEquals(m1xm2_RM, r, 0f);
-    }
-
-    @Test
-    public void testRM_m1xm2(){
-        
-        float[] r = new float[16];
-        
-        multMatrixf_RM(m1, 0, m2, 0, r, 0);
-
-        Assert.assertArrayEquals(m1xm2_RM, r, 0f);
-    }
-    
-    @Test
-    public void testRM_m2xm1(){
-        
-        float[] r = new float[16];
-        
-        multMatrixf_RM(m2, 0, m1, 0, r, 0);
-
-        Assert.assertArrayEquals(m2xm1_RM, r, 0f);
-    }
-    
-    public static void main(String args[]) {
-        org.junit.runner.JUnitCore.main(TestFloatUtil01MatrixMatrixMultNOUI.class.getName());
-    }
-}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil01NOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil01NOUI.java
new file mode 100644
index 0000000..0d156c4
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil01NOUI.java
@@ -0,0 +1,282 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.math;
+
+
+
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.junit.FixMethodOrder;
+import org.junit.runners.MethodSorters;
+
+import com.jogamp.opengl.math.FloatUtil;
+
+ at FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class TestFloatUtil01NOUI {
+    static final float MACH_EPSILON = FloatUtil.getMachineEpsilon();
+
+    static boolean deltaMachEpsLEQEpsilon;
+    static boolean deltaFixedEpsLEQEpsilon;
+
+    @BeforeClass
+    public static void test00Epsilon() {
+        System.err.println();
+        System.err.println("Machine Epsilon: "+MACH_EPSILON);
+        System.err.println("Fixed   Epsilon: "+FloatUtil.EPSILON+", diff "+Math.abs(MACH_EPSILON-FloatUtil.EPSILON));
+        System.err.println("Float MIN:       "+Float.MIN_VALUE);
+
+        final float deltaMachEpsMin = Math.abs(MACH_EPSILON-Float.MIN_VALUE);
+        deltaMachEpsLEQEpsilon = FloatUtil.compare(deltaMachEpsMin, MACH_EPSILON) <= 0;
+
+        final float deltaFixedEpsMin = Math.abs(MACH_EPSILON-Float.MIN_VALUE);
+        deltaFixedEpsLEQEpsilon = FloatUtil.compare(deltaFixedEpsMin, MACH_EPSILON) <= 0;
+
+        System.err.println("deltaMachEpsMin "+deltaMachEpsMin+", deltaMachEpsLEQEpsilon "+deltaMachEpsLEQEpsilon);
+        System.err.println("deltaFixedEpsMin "+deltaFixedEpsMin+", deltaFixedEpsLEQEpsilon "+deltaFixedEpsLEQEpsilon);
+    }
+
+    private void dumpTestWE(final int tstNum, final int expWE, final float a, final float b, final float EPSILON) {
+        final float delta = a-b;
+        final boolean equalWE =  FloatUtil.isEqual(a, b, EPSILON);
+        final int compWE = FloatUtil.compare(a, b, EPSILON);
+        final String msgWE = ( expWE != compWE ) ? "**** mismatch ****" : " OK";
+        System.err.println("Print.WE."+tstNum+": a: "+a+", b: "+b+" -> d "+delta+", exp "+expWE+", equal "+equalWE+", comp "+compWE+" - "+msgWE+", epsilon "+EPSILON);
+    }
+    private void dumpTestNE(final int tstNum, final int exp, final float a, final float b) {
+        final float delta = a-b;
+        final boolean equal =  FloatUtil.isEqual(a, b);
+        final int comp = FloatUtil.compare(a, b);
+        final String msg = ( exp != comp ) ? "**** mismatch ****" : " OK";
+        System.err.println("Print.NE."+tstNum+": a: "+a+", b: "+b+" -> d "+delta+", exp "+exp+", equal "+equal+", comp "+comp+" - "+msg);
+    }
+
+    @Test
+    public void test01aZeroWithFixedEpsilon() {
+        testZeroWithEpsilon(10, FloatUtil.EPSILON);
+    }
+    @Test
+    public void test01bZeroWithMachEpsilon() {
+        testZeroWithEpsilon(100, MACH_EPSILON);
+    }
+    private void testZeroWithEpsilon(int i, final float EPSILON) {
+        System.err.println();
+        testZeroWithEpsilon(i++, true, 0f, EPSILON);
+        testZeroWithEpsilon(i++, true, 0f-EPSILON/2f, EPSILON);
+        testZeroWithEpsilon(i++, true, 0f+EPSILON/2f, EPSILON);
+        testZeroWithEpsilon(i++, true, 0f-Float.MIN_VALUE, EPSILON);
+        testZeroWithEpsilon(i++, true, 0f+Float.MIN_VALUE, EPSILON);
+        testZeroWithEpsilon(i++, true, -0f, EPSILON);
+        testZeroWithEpsilon(i++, true, +0f, EPSILON);
+
+        testZeroWithEpsilon(i++, false, 0f+EPSILON+Float.MIN_VALUE, EPSILON);
+        testZeroWithEpsilon(i++, false, 0f-EPSILON-Float.MIN_VALUE, EPSILON);
+
+        // Unpredicted .. accuracy beyond epsilon, or deltaMachEpsLEQEpsilon or deltaFixedEpsLEQEpsilon;
+        dumpTestWE(i++, 1, 0f, 0f+EPSILON-Float.MIN_VALUE, EPSILON);
+        dumpTestWE(i++, 1, 0f, 0f-EPSILON+Float.MIN_VALUE, EPSILON);
+    }
+    private void testZeroWithEpsilon(final int tstNum, final boolean exp, final float a, final float EPSILON) {
+        final boolean zero =  FloatUtil.isZero(a, EPSILON);
+        final float delta = a-0f;
+        System.err.println("Zero."+tstNum+": a: "+a+", -> d "+delta+", exp "+exp+", zero "+zero+", epsilon "+EPSILON);
+        Assert.assertEquals("Zero failed a: "+a+" within "+EPSILON, exp, zero);
+    }
+
+    @Test
+    public void test02EqualsNoEpsilon() {
+        int i=0;
+        System.err.println();
+        testEqualsNoEpsilon(i++, true, 0f, 0f);
+
+        testEqualsNoEpsilon(i++, true, Float.MAX_VALUE, Float.MAX_VALUE);
+        testEqualsNoEpsilon(i++, true, Float.MIN_VALUE, Float.MIN_VALUE);
+        testEqualsNoEpsilon(i++, true, Float.MIN_NORMAL, Float.MIN_NORMAL);
+        testEqualsNoEpsilon(i++, true, Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY);
+        testEqualsNoEpsilon(i++, true, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY);
+        testEqualsNoEpsilon(i++, true, Float.NaN, Float.NaN);
+        testEqualsNoEpsilon(i++, false,  -0f, 0f);
+        testEqualsNoEpsilon(i++, false, 0f, -0f);
+
+        // Unpredicted .. accuracy beyond epsilon, or deltaMachEpsLEQEpsilon or deltaFixedEpsLEQEpsilon;
+        dumpTestNE(i++, 0, 1f, 1f-MACH_EPSILON/2f);
+        dumpTestNE(i++, 0, 0f, 0f-MACH_EPSILON/2f);
+        dumpTestNE(i++, 0, 1f, 1f+MACH_EPSILON/2f);
+        dumpTestNE(i++, 0, 0f, 0f+MACH_EPSILON/2f);
+        dumpTestNE(i++, 0, 1f, 1f-Float.MIN_VALUE);
+        dumpTestNE(i++, 0, 0f, 0f-Float.MIN_VALUE);
+        dumpTestNE(i++, 0, 1f, 1f+Float.MIN_VALUE);
+        dumpTestNE(i++, 0, 0f, 0f+Float.MIN_VALUE);
+    }
+    private void testEqualsNoEpsilon(final int tstNum, final boolean exp, final float a, final float b) {
+        final boolean equal =  FloatUtil.isEqual(a, b);
+        final int comp = FloatUtil.compare(a, b);
+        final float delta = a-b;
+        System.err.println("Equal.NE."+tstNum+": a: "+a+", b: "+b+" -> d "+delta+", exp "+exp+", equal "+equal+", comp "+comp);
+        Assert.assertEquals("Compare failed a: "+a+", b: "+b, exp, 0==comp);
+        Assert.assertEquals("Equal failed a: "+a+", b: "+b, exp, equal);
+    }
+
+    @Test
+    public void test03aEqualsWithFixedEpsilon() {
+        testEqualsWithEpsilon(10, FloatUtil.EPSILON);
+    }
+    @Test
+    public void test03bEqualsWithMachEpsilon() {
+        testEqualsWithEpsilon(50, MACH_EPSILON);
+    }
+    private void testEqualsWithEpsilon(int i, final float EPSILON) {
+        System.err.println();
+        testEqualsWithEpsilon(i++, true, 0f, 0f, EPSILON);
+        testEqualsWithEpsilon(i++, true, 1f, 1f-EPSILON/2f, EPSILON);
+        testEqualsWithEpsilon(i++, true, 1f, 1f+EPSILON/2f, EPSILON);
+        testEqualsWithEpsilon(i++, true, 1f, 1f-Float.MIN_VALUE, EPSILON);
+        testEqualsWithEpsilon(i++, true, 1f, 1f+Float.MIN_VALUE, EPSILON);
+        testEqualsWithEpsilon(i++, true, Float.MAX_VALUE, Float.MAX_VALUE, EPSILON);
+        testEqualsWithEpsilon(i++, true, Float.MIN_VALUE, Float.MIN_VALUE, EPSILON);
+        testEqualsWithEpsilon(i++, true, Float.MIN_NORMAL, Float.MIN_NORMAL, EPSILON);
+        testEqualsWithEpsilon(i++, true, Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY, EPSILON);
+        testEqualsWithEpsilon(i++, true, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, EPSILON);
+        testEqualsWithEpsilon(i++, true, Float.NaN, Float.NaN, EPSILON);
+        testEqualsWithEpsilon(i++, true, -0f, 0f, EPSILON);
+        testEqualsWithEpsilon(i++, true, 0f, -0f, EPSILON);
+
+        testEqualsWithEpsilon(i++, false, 1f, 1f+EPSILON+Float.MIN_VALUE, EPSILON);
+        testEqualsWithEpsilon(i++, false, 1f, 1f-EPSILON-Float.MIN_VALUE, EPSILON);
+
+        // Unpredicted .. accuracy beyond epsilon, or deltaMachEpsLEQEpsilon or deltaFixedEpsLEQEpsilon;
+        dumpTestWE(i++, 1, 1f, 1f+EPSILON-Float.MIN_VALUE, EPSILON);
+        dumpTestWE(i++, 1, 1f, 1f-EPSILON+Float.MIN_VALUE, EPSILON);
+    }
+    private void testEqualsWithEpsilon(final int tstNum, final boolean exp, final float a, final float b, final float EPSILON) {
+        final boolean equal =  FloatUtil.isEqual(a, b, EPSILON);
+        final int comp = FloatUtil.compare(a, b, EPSILON);
+        final float delta = a-b;
+        System.err.println("Equal.WE."+tstNum+": a: "+a+", b: "+b+" -> d "+delta+", exp "+exp+", equal "+equal+", comp "+comp);
+        Assert.assertEquals("Compare failed a: "+a+", b: "+b+" within "+EPSILON, exp, 0==comp);
+        Assert.assertEquals("Equal failed a: "+a+", b: "+b+" within "+EPSILON, exp, equal);
+    }
+
+    @Test
+    public void test04CompareNoEpsilon() {
+        int i=0;
+        System.err.println();
+        testCompareNoEpsilon(i++,  0, 0f, 0f);
+        testCompareNoEpsilon(i++,  0, Float.MAX_VALUE, Float.MAX_VALUE);
+        testCompareNoEpsilon(i++,  0, Float.MIN_VALUE, Float.MIN_VALUE);
+        testCompareNoEpsilon(i++,  0, Float.MIN_NORMAL, Float.MIN_NORMAL);
+        testCompareNoEpsilon(i++,  0, Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY);
+        testCompareNoEpsilon(i++,  0, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY);
+        testCompareNoEpsilon(i++,  0, Float.NaN, Float.NaN);
+
+        testCompareNoEpsilon(i++,  1,  1f,  0f);
+        testCompareNoEpsilon(i++, -1,  0f,  1f);
+        testCompareNoEpsilon(i++,  1,  0f, -1f);
+        testCompareNoEpsilon(i++, -1, -1f,  0f);
+
+        testCompareNoEpsilon(i++,  1, Float.MAX_VALUE, Float.MIN_VALUE);
+        testCompareNoEpsilon(i++, -1, Float.MIN_VALUE, Float.MAX_VALUE);
+        testCompareNoEpsilon(i++,  1, Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY);
+        testCompareNoEpsilon(i++, -1, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY);
+
+        testCompareNoEpsilon(i++, -1,        0f, Float.NaN);
+        testCompareNoEpsilon(i++,  1, Float.NaN, 0f);
+
+        testCompareNoEpsilon(i++, -1,  -0f, 0f);
+        testCompareNoEpsilon(i++,  1, 0f, -0f);
+
+        // Unpredicted .. accuracy beyond epsilon, or deltaMachEpsLEQEpsilon or deltaFixedEpsLEQEpsilon;
+        dumpTestNE(i++, 0, 1f, 1f-MACH_EPSILON/2f);
+        dumpTestNE(i++, 0, 0f, 0f-MACH_EPSILON/2f);
+        dumpTestNE(i++, 0, 1f, 1f+MACH_EPSILON/2f);
+        dumpTestNE(i++, 0, 0f, 0f+MACH_EPSILON/2f);
+        dumpTestNE(i++, 0, 1f, 1f-Float.MIN_VALUE);
+        dumpTestNE(i++, 0, 0f, 0f-Float.MIN_VALUE);
+        dumpTestNE(i++, 0, 1f, 1f+Float.MIN_VALUE);
+        dumpTestNE(i++, 0, 0f, 0f+Float.MIN_VALUE);
+    }
+    private void testCompareNoEpsilon(final int tstNum, final int exp, final float a, final float b) {
+        final boolean equal =  FloatUtil.isEqual(a, b);
+        final int comp = FloatUtil.compare(a, b);
+        final float delta = a-b;
+        System.err.println("Comp.NE."+tstNum+": a: "+a+", b: "+b+" -> d "+delta+", equal "+equal+", comp: exp "+exp+" has "+comp);
+        Assert.assertEquals("Compare failed a: "+a+", b: "+b, exp, comp);
+    }
+
+    @Test
+    public void test05aCompareWithFixedEpsilon() {
+        test05CompareWithEpsilon(10, FloatUtil.EPSILON);
+    }
+    @Test
+    public void test05bCompareWithMachEpsilon() {
+        test05CompareWithEpsilon(50, MACH_EPSILON);
+    }
+    private void test05CompareWithEpsilon(int i, final float EPSILON) {
+        System.err.println();
+        testCompareWithEpsilon(i++, 0, 0f, 0f, EPSILON);
+        testCompareWithEpsilon(i++, 0, 1f, 1f-EPSILON/2f, EPSILON);
+        testCompareWithEpsilon(i++, 0, 1f, 1f+EPSILON/2f, EPSILON);
+        testCompareWithEpsilon(i++, 0, 1f, 1f-Float.MIN_VALUE, EPSILON);
+        testCompareWithEpsilon(i++, 0, 1f, 1f+Float.MIN_VALUE, EPSILON);
+        testCompareWithEpsilon(i++, 0, Float.MAX_VALUE, Float.MAX_VALUE, EPSILON);
+        testCompareWithEpsilon(i++, 0, Float.MIN_VALUE, Float.MIN_VALUE, EPSILON);
+        testCompareWithEpsilon(i++, 0, Float.MIN_NORMAL, Float.MIN_NORMAL, EPSILON);
+        testCompareWithEpsilon(i++, 0, Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY, EPSILON);
+        testCompareWithEpsilon(i++, 0, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, EPSILON);
+        testCompareWithEpsilon(i++, 0, Float.NaN, Float.NaN, EPSILON);
+
+        testCompareWithEpsilon(i++,  1,  1f,  0f, EPSILON);
+        testCompareWithEpsilon(i++, -1,  0f,  1f, EPSILON);
+        testCompareWithEpsilon(i++,  1,  0f, -1f, EPSILON);
+        testCompareWithEpsilon(i++, -1, -1f,  0f, EPSILON);
+
+        testCompareWithEpsilon(i++,  1, Float.MAX_VALUE, Float.MIN_VALUE, EPSILON);
+        testCompareWithEpsilon(i++, -1, Float.MIN_VALUE, Float.MAX_VALUE, EPSILON);
+        testCompareWithEpsilon(i++,  1, Float.POSITIVE_INFINITY, Float.NEGATIVE_INFINITY, EPSILON);
+        testCompareWithEpsilon(i++, -1, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY, EPSILON);
+
+        testCompareWithEpsilon(i++, -1, 0f,Float.NaN, EPSILON);
+        testCompareWithEpsilon(i++,  1, Float.NaN, 0f, EPSILON);
+
+        testCompareWithEpsilon(i++,  0, -0f, 0f, EPSILON);
+        testCompareWithEpsilon(i++,  0, 0f, -0f, EPSILON);
+    }
+    private void testCompareWithEpsilon(final int tstNum, final int exp, final float a, final float b, final float EPSILON) {
+        final boolean equal =  FloatUtil.isEqual(a, b, EPSILON);
+        final int comp = FloatUtil.compare(a, b, EPSILON);
+        final float delta = a-b;
+        System.err.println("Comp.WE."+tstNum+": a: "+a+", b: "+b+" -> d "+delta+", equal "+equal+", comp: exp "+exp+" has "+comp);
+        Assert.assertEquals("Compare failed a: "+a+", b: "+b+" within "+EPSILON, exp, comp);
+    }
+
+
+    public static void main(final String args[]) {
+        org.junit.runner.JUnitCore.main(TestFloatUtil01NOUI.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil02MatrixMatrixMultNOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil02MatrixMatrixMultNOUI.java
new file mode 100644
index 0000000..13285ac
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil02MatrixMatrixMultNOUI.java
@@ -0,0 +1,116 @@
+/**
+ * Copyright 2012 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.math;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.FixMethodOrder;
+import org.junit.runners.MethodSorters;
+
+import com.jogamp.opengl.math.FloatUtil;
+
+ at FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class TestFloatUtil02MatrixMatrixMultNOUI {
+
+    final float[] m1 = new float[]{    1,    3,    4,    0,
+                                       6,    7,    8,    5,
+                                      98,    7,    6,    9,
+                                      54,    3,    2,    5 };
+
+    final float[] m2 = new float[]{    1,    6,   98,   54,
+                                       3,    7,    7,    3,
+                                       4,    8,    6,    2,
+                                       0,    5,    9,    5 };
+
+    final float[] m1xm2_RM = // m2xm1_CM
+                       new float[]{   26,   59,  143,   71,
+                                      59,  174,  730,  386,
+                                     143,  730, 9770, 5370,
+                                      71,  386, 5370, 2954 };
+
+    final float[] m2xm1_RM = // m1xm2_CM
+                       new float[]{12557,  893,  748, 1182,
+                                     893,  116,  116,  113,
+                                     748,  116,  120,  104,
+                                    1182,  113,  104,  131 };
+
+    public static final void multMatrixf_RM(final float[] a, final int a_off, final float[] b, final int b_off, final float[] d, final int d_off) {
+     for (int i = 0; i < 4; i++) {
+        final float ai0=a[a_off+i*4+0],  ai1=a[a_off+i*4+1],  ai2=a[a_off+i*4+2],  ai3=a[a_off+i*4+3];
+        d[d_off+i*4+0] = ai0 * b[b_off+0*4+0] + ai1 * b[b_off+1*4+0] + ai2 * b[b_off+2*4+0] + ai3 * b[b_off+3*4+0] ;
+        d[d_off+i*4+1] = ai0 * b[b_off+0*4+1] + ai1 * b[b_off+1*4+1] + ai2 * b[b_off+2*4+1] + ai3 * b[b_off+3*4+1] ;
+        d[d_off+i*4+2] = ai0 * b[b_off+0*4+2] + ai1 * b[b_off+1*4+2] + ai2 * b[b_off+2*4+2] + ai3 * b[b_off+3*4+2] ;
+        d[d_off+i*4+3] = ai0 * b[b_off+0*4+3] + ai1 * b[b_off+1*4+3] + ai2 * b[b_off+2*4+3] + ai3 * b[b_off+3*4+3] ;
+     }
+    }
+
+    @Test
+    public void testCM_m1xm2(){
+
+        final float[] r = new float[16];
+
+        FloatUtil.multMatrix(m1, 0, m2, 0, r, 0);
+
+        Assert.assertArrayEquals(m2xm1_RM, r, 0f);
+    }
+
+    @Test
+    public void testCM_m2xm1(){
+
+        final float[] r = new float[16];
+
+        FloatUtil.multMatrix(m2, 0, m1, 0, r, 0);
+
+        Assert.assertArrayEquals(m1xm2_RM, r, 0f);
+    }
+
+    @Test
+    public void testRM_m1xm2(){
+
+        final float[] r = new float[16];
+
+        multMatrixf_RM(m1, 0, m2, 0, r, 0);
+
+        Assert.assertArrayEquals(m1xm2_RM, r, 0f);
+    }
+
+    @Test
+    public void testRM_m2xm1(){
+
+        final float[] r = new float[16];
+
+        multMatrixf_RM(m2, 0, m1, 0, r, 0);
+
+        Assert.assertArrayEquals(m2xm1_RM, r, 0f);
+    }
+
+    public static void main(final String args[]) {
+        org.junit.runner.JUnitCore.main(TestFloatUtil02MatrixMatrixMultNOUI.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil03InversionNOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil03InversionNOUI.java
new file mode 100644
index 0000000..a2aa698
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestFloatUtil03InversionNOUI.java
@@ -0,0 +1,262 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.math;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.FixMethodOrder;
+import org.junit.runners.MethodSorters;
+
+import com.jogamp.common.os.Platform;
+import com.jogamp.opengl.math.FloatUtil;
+
+ at FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class TestFloatUtil03InversionNOUI {
+
+    @Test
+    public void test01Ident(){
+        final float[] res1 = new float[16];
+        final float[] res2 = new float[16];
+        final float[] temp = new float[16];
+
+        final float[] identity = new float[] { 1, 0, 0, 0,
+                                               0, 1, 0, 0,
+                                               0, 0, 1, 0,
+                                               0, 0, 0, 1 };
+
+        FloatUtil.invertMatrix(identity, 0, res1, 0);
+        System.err.println(FloatUtil.matrixToString(null, "inv-1: ", "%10.7f", res1, 0, 4, 4, false /* rowMajorOrder */));
+        invertMatrix(identity, 0, res2, 0, temp);
+        System.err.println(FloatUtil.matrixToString(null, "inv-2: ", "%10.7f", res2, 0, 4, 4, false /* rowMajorOrder */));
+
+        Assert.assertArrayEquals("I1/I2 failure", res1, res2, FloatUtil.INV_DEVIANCE);
+        Assert.assertArrayEquals("I2 failure", identity, res2, FloatUtil.INV_DEVIANCE);
+        Assert.assertArrayEquals("I1 failure", identity, res1, FloatUtil.INV_DEVIANCE);
+    }
+
+    private void testImpl(final float[] matrix) {
+        final float[] inv1_0 = new float[16];
+        final float[] inv1_1 = new float[16];
+        final float[] inv1_2 = new float[16];
+        final float[] inv2_0 = new float[16];
+        final float[] inv2_1 = new float[16];
+        final float[] inv2_2 = new float[16];
+        final float[] temp = new float[16];
+
+        System.err.println(FloatUtil.matrixToString(null, "orig  : ", "%10.7f", matrix, 0, 4, 4, false /* rowMajorOrder */));
+        invertMatrix(matrix, 0, inv1_0, 0, temp);
+        invertMatrix(inv1_0, 0, inv2_0, 0, temp);
+        System.err.println(FloatUtil.matrixToString(null, "inv1_0: ", "%10.7f", inv1_0, 0, 4, 4, false /* rowMajorOrder */));
+        System.err.println(FloatUtil.matrixToString(null, "inv2_0: ", "%10.7f", inv2_0, 0, 4, 4, false /* rowMajorOrder */));
+        FloatUtil.invertMatrix(matrix, 0, inv1_1, 0);
+        FloatUtil.invertMatrix(inv1_1, 0, inv2_1, 0);
+        System.err.println(FloatUtil.matrixToString(null, "inv1_1: ", "%10.7f", inv1_1, 0, 4, 4, false /* rowMajorOrder */));
+        System.err.println(FloatUtil.matrixToString(null, "inv2_1: ", "%10.7f", inv2_1, 0, 4, 4, false /* rowMajorOrder */));
+        FloatUtil.invertMatrix(matrix, inv1_2);
+        FloatUtil.invertMatrix(inv1_2, inv2_2);
+        System.err.println(FloatUtil.matrixToString(null, "inv1_2: ", "%10.7f", inv1_2, 0, 4, 4, false /* rowMajorOrder */));
+        System.err.println(FloatUtil.matrixToString(null, "inv2_2: ", "%10.7f", inv2_2, 0, 4, 4, false /* rowMajorOrder */));
+
+        Assert.assertArrayEquals("I1_1/I1_2 failure", inv1_1, inv1_2, FloatUtil.INV_DEVIANCE);
+        Assert.assertArrayEquals("I2_1/I2_2 failure", inv2_1, inv2_2, FloatUtil.INV_DEVIANCE);
+
+        Assert.assertArrayEquals("I1_0/I1_1 failure", inv1_0, inv1_2, FloatUtil.INV_DEVIANCE);
+        Assert.assertArrayEquals("I2_0/I2_1 failure", inv2_0, inv2_2, FloatUtil.INV_DEVIANCE);
+
+        Assert.assertArrayEquals("I1 failure", matrix, inv2_0, FloatUtil.INV_DEVIANCE);
+        Assert.assertArrayEquals("I2 failure", matrix, inv2_2, FloatUtil.INV_DEVIANCE);
+        Assert.assertArrayEquals("I2 failure", matrix, inv2_1, FloatUtil.INV_DEVIANCE);
+    }
+
+    @Test
+    public void test02(){
+        final float[] p = new float[] { 2.3464675f, 0,          0,        0,
+                                  0,          2.4142134f, 0,        0,
+                                  0,          0,         -1.0002f, -1,
+                                  0,          0,        -20.002f,   0 };
+        testImpl(p);
+    }
+
+    @Test
+    public void test03(){
+        final float[] mv = new float[] { 1, 0,    0, 0,
+                                   0, 1,    0, 0,
+                                   0, 0,    1, 0,
+                                   0, 0, -200, 1 } ;
+        testImpl(mv);
+    }
+
+    @Test
+    public void test04(){
+        final float[] p = new float[] { 2.3464675f, 0,          0,        0,
+                                  0,          2.4142134f, 0,        0,
+                                  0,          0,         -1.0002f, -1,
+                                  0,          0,        -20.002f,   0 };
+
+        testImpl(p);
+    }
+
+    @Test
+    public void test05Perf(){
+        final float[] p1 = new float[] { 2.3464675f, 0,          0,        0,
+                                   0,          2.4142134f, 0,        0,
+                                   0,          0,         -1.0002f, -1,
+                                   0,          0,        -20.002f,   0 };
+
+        final float[] p2 = new float[]{   26,   59,  143,   71,
+                                    59,  174,  730,  386,
+                                   143,  730, 9770, 5370,
+                                    71,  386, 5370, 2954 };
+
+        final float[] res1 = new float[16];
+        final float[] res2 = new float[16];
+        final float[] temp = new float[16];
+
+        final int loops = 1000000;
+        long tI0 = 0;
+        long tI1 = 0;
+        long tI2 = 0;
+
+        // warm-up
+        for(int i=0; i<10; i++) {
+            invertMatrix(p1, 0, res2, 0, temp);
+            FloatUtil.invertMatrix(p1, 0, res1, 0);
+            FloatUtil.invertMatrix(p1, res1);
+
+            invertMatrix(p2, 0, res2, 0, temp);
+            FloatUtil.invertMatrix(p2, 0, res1, 0);
+            FloatUtil.invertMatrix(p2, res1);
+        }
+
+
+        for(int i=0; i<loops; i++) {
+
+            final long t_0 = Platform.currentTimeMillis();
+
+            invertMatrix(p1, 0, res2, 0, temp);
+            final long t_1 = Platform.currentTimeMillis();
+            tI0 += t_1 - t_0;
+
+            FloatUtil.invertMatrix(p1, 0, res1, 0);
+            final long t_2 = Platform.currentTimeMillis();
+            tI1 += t_2 - t_1;
+
+            FloatUtil.invertMatrix(p1, res1);
+            final long t_3 = Platform.currentTimeMillis();
+            tI2 += t_3 - t_2;
+
+            invertMatrix(p2, 0, res2, 0, temp);
+            final long t_4 = Platform.currentTimeMillis();
+            tI0 += t_4 - t_3;
+
+            FloatUtil.invertMatrix(p2, 0, res1, 0);
+            final long t_5 = Platform.currentTimeMillis();
+            tI1 += t_5 - t_4;
+
+            FloatUtil.invertMatrix(p2, res2);
+            final long t_6 = Platform.currentTimeMillis();
+            tI2 += t_6 - t_5;
+        }
+        System.err.printf("Summary loops %6d: I1 %6d ms total, %f ms/inv%n", loops, tI0, (double)tI0/loops);
+        System.err.printf("Summary loops %6d: I2 %6d ms total, %f ms/inv%n", loops, tI1, (double)tI1/loops);
+        System.err.printf("Summary loops %6d: I3 %6d ms total, %f ms/inv%n", loops, tI2, (double)tI2/loops);
+
+    }
+
+    public static float[] invertMatrix(final float[] msrc, final int msrc_offset, final float[] mres, final int mres_offset, final float[/*4*4*/] temp) {
+        int i, j, k, swap;
+        float t;
+        for (i = 0; i < 4; i++) {
+            final int i4 = i*4;
+            for (j = 0; j < 4; j++) {
+                temp[i4+j] = msrc[i4+j+msrc_offset];
+            }
+        }
+        FloatUtil.makeIdentity(mres, mres_offset);
+
+        for (i = 0; i < 4; i++) {
+            final int i4 = i*4;
+
+            //
+            // Look for largest element in column
+            //
+            swap = i;
+            for (j = i + 1; j < 4; j++) {
+                if (Math.abs(temp[j*4+i]) > Math.abs(temp[i4+i])) {
+                    swap = j;
+                }
+            }
+
+            if (swap != i) {
+                final int swap4 = swap*4;
+                //
+                // Swap rows.
+                //
+                for (k = 0; k < 4; k++) {
+                    t = temp[i4+k];
+                    temp[i4+k] = temp[swap4+k];
+                    temp[swap4+k] = t;
+
+                    t = mres[i4+k+mres_offset];
+                    mres[i4+k+mres_offset] = mres[swap4+k+mres_offset];
+                    mres[swap4+k+mres_offset] = t;
+                }
+            }
+
+            if (temp[i4+i] == 0) {
+                //
+                // No non-zero pivot. The matrix is singular, which shouldn't
+                // happen. This means the user gave us a bad matrix.
+                //
+                return null;
+            }
+
+            t = temp[i4+i];
+            for (k = 0; k < 4; k++) {
+                temp[i4+k] /= t;
+                mres[i4+k+mres_offset] /= t;
+            }
+            for (j = 0; j < 4; j++) {
+                if (j != i) {
+                    final int j4 = j*4;
+                    t = temp[j4+i];
+                    for (k = 0; k < 4; k++) {
+                        temp[j4+k] -= temp[i4+k] * t;
+                        mres[j4+k+mres_offset] -= mres[i4+k+mres_offset]*t;
+                    }
+                }
+            }
+        }
+        return mres;
+    }
+
+    public static void main(final String args[]) {
+        org.junit.runner.JUnitCore.main(TestFloatUtil03InversionNOUI.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectDoubleNOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectDoubleNOUI.java
index db40dad..d10a048 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectDoubleNOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectDoubleNOUI.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.math;
 
 import javax.media.opengl.glu.GLU;
@@ -51,10 +51,10 @@ public class TestGluUnprojectDoubleNOUI {
         final int[] viewport = new int[]{0,0,800,600};
         final double[] objCoords = new double[]{Double.NaN,Double.NaN,Double.NaN};
         glu.gluUnProject(pickedPoint[0], pickedPoint[1], pickedPointDepth, sceneModelViewValues, 0, projectionValues, 0, viewport, 0, objCoords, 0);
-        Assert.assertTrue(!Double.isNaN(objCoords[0])&&!Double.isNaN(objCoords[1])&&!Double.isNaN(objCoords[2]));      
+        Assert.assertTrue(!Double.isNaN(objCoords[0])&&!Double.isNaN(objCoords[1])&&!Double.isNaN(objCoords[2]));
     }
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestGluUnprojectDoubleNOUI.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectFloatNOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectFloatNOUI.java
index 0f9a45f..278c245 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectFloatNOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestGluUnprojectFloatNOUI.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.math;
 
 import javax.media.opengl.glu.GLU;
@@ -37,7 +37,7 @@ import org.junit.runners.MethodSorters;
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestGluUnprojectFloatNOUI {
-    
+
     @Test
     public void testNaN(){
         final GLU glu = new GLU();
@@ -48,59 +48,59 @@ public class TestGluUnprojectFloatNOUI {
         final int[] viewport = new int[]{0,0,800,600};
         final float[] objCoords = new float[]{Float.NaN,Float.NaN,Float.NaN};
         glu.gluUnProject(pickedPoint[0], pickedPoint[1], pickedPointDepth, sceneModelViewValues, 0, projectionValues, 0, viewport, 0, objCoords, 0);
-        Assert.assertTrue(!Double.isNaN(objCoords[0])&&!Double.isNaN(objCoords[1])&&!Double.isNaN(objCoords[2]));      
+        Assert.assertTrue(!Double.isNaN(objCoords[0])&&!Double.isNaN(objCoords[1])&&!Double.isNaN(objCoords[2]));
     }
-    
+
     @Test
     public void test01(){
-        float[] mv = new float[] { 1, 0, 0, 0, 
-                                   0, 1, 0, 0, 
-                                   0, 0, 1, 0, 
+        final float[] mv = new float[] { 1, 0, 0, 0,
+                                   0, 1, 0, 0,
+                                   0, 0, 1, 0,
                                    0, 0, 0, 1 };
-        
-        float[] p = new float[] { 2.3464675f, 0,          0,        0, 
-                                  0,          2.4142134f, 0,        0, 
-                                  0,          0,         -1.0002f, -1, 
+
+        final float[] p = new float[] { 2.3464675f, 0,          0,        0,
+                                  0,          2.4142134f, 0,        0,
+                                  0,          0,         -1.0002f, -1,
                                   0,          0,        -20.002f,   0 };
-        
-        int[] v = new int[] { 0, 0, 1000, 1000 };
-        
-        float[] s = new float[] { 250, 250, 0.5f };
-        
-        float[] expected = new float[] { -4.2612f, -4.1417f, -19.9980f };
-        float[] result = new float[] { 0, 0, 0 };
-        
+
+        final int[] v = new int[] { 0, 0, 1000, 1000 };
+
+        final float[] s = new float[] { 250, 250, 0.5f };
+
+        final float[] expected = new float[] { -4.2612f, -4.1417f, -19.9980f };
+        final float[] result = new float[] { 0, 0, 0 };
+
         final GLU glu = new GLU();
         glu.gluUnProject(s[0], s[1], s[2], mv, 0, p, 0, v, 0, result, 0);
-        
+
         Assert.assertArrayEquals(expected, result, 0.0001f);
     }
 
     @Test
     public void test02(){
-        float[] mv = new float[] { 1, 0,    0, 0, 
-                                   0, 1,    0, 0, 
-                                   0, 0,    1, 0, 
+        final float[] mv = new float[] { 1, 0,    0, 0,
+                                   0, 1,    0, 0,
+                                   0, 0,    1, 0,
                                    0, 0, -200, 1 } ;
-        
-        float[] p = new float[] { 2.3464675f, 0,          0,        0, 
-                                  0,          2.4142134f, 0,        0, 
-                                  0,          0,         -1.0002f, -1, 
+
+        final float[] p = new float[] { 2.3464675f, 0,          0,        0,
+                                  0,          2.4142134f, 0,        0,
+                                  0,          0,         -1.0002f, -1,
                                   0,          0,        -20.002f,   0 };
-        
-        int[] v = new int[] { 0, 0, 1000, 1000 };
-        
-        float[] s = new float[] { 250, 250, 0.5f };
-        float[] expected = new float[] { -4.2612f, -4.1417f, 180.002f };
-        float[] result = new float[] { 0, 0, 0 };
-        
+
+        final int[] v = new int[] { 0, 0, 1000, 1000 };
+
+        final float[] s = new float[] { 250, 250, 0.5f };
+        final float[] expected = new float[] { -4.2612f, -4.1417f, 180.002f };
+        final float[] result = new float[] { 0, 0, 0 };
+
         final GLU glu = new GLU();
         glu.gluUnProject(s[0], s[1], s[2], mv, 0, p, 0, v, 0, result, 0);
-        
+
         Assert.assertArrayEquals(expected, result, 0.0001f);
     }
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestGluUnprojectFloatNOUI.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix01NEWT.java
index fa18abd..8c2216f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix01NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.math;
 
 import java.nio.FloatBuffer;
@@ -38,6 +38,8 @@ import javax.media.opengl.GLDrawableFactory;
 import javax.media.opengl.GLProfile;
 import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
+import jogamp.common.os.PlatformPropsImpl;
+
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -54,45 +56,45 @@ import com.jogamp.opengl.util.PMVMatrix;
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestPMVMatrix01NEWT extends UITestCase {
-    
+
     static final float epsilon = 0.00001f;
 
     // matrix 2 rows x 3 columns - In row major order
     static FloatBuffer matrix2x3R = FloatBuffer.wrap( new float[] {  1.0f,  2.0f,  3.0f,
                                                                      4.0f,  5.0f,  6.0f } );
-    
+
     // matrix 2 rows x 3 columns - In column major order
-    static FloatBuffer matrix2x3C = FloatBuffer.wrap( new float[] {  1.0f,  4.0f,  
-                                                                     2.0f,  5.0f,  
+    static FloatBuffer matrix2x3C = FloatBuffer.wrap( new float[] {  1.0f,  4.0f,
+                                                                     2.0f,  5.0f,
                                                                      3.0f,  6.0f } );
-    
+
     // matrix 3 rows x 2 columns - In row major order
     static FloatBuffer matrix3x2R = FloatBuffer.wrap( new float[] {  1.0f,  2.0f,
                                                                      3.0f,  4.0f,
                                                                      5.0f,  6.0f  } );
-    
+
     // matrix 3 rows x 2 columns - In column major order
-    static FloatBuffer matrix3x2C = FloatBuffer.wrap( new float[] {  1.0f,  3.0f, 5.0f,  
+    static FloatBuffer matrix3x2C = FloatBuffer.wrap( new float[] {  1.0f,  3.0f, 5.0f,
                                                                      2.0f,  4.0f, 6.0f  } );
-    
+
     // Translated xyz 123 - Row - In row major order !
     static FloatBuffer translated123R = FloatBuffer.wrap( new float[] {  1.0f,  0.0f,  0.0f,  1.0f,
                                                                          0.0f,  1.0f,  0.0f,  2.0f,
                                                                          0.0f,  0.0f,  1.0f,  3.0f,
                                                                          0.0f,  0.0f,  0.0f,  1.0f } );
-    
+
     // Translated xyz 123 - Column - In column major order !
     static FloatBuffer translated123C = FloatBuffer.wrap( new float[] {  1.0f,  0.0f,  0.0f,  0.0f,
                                                                          0.0f,  1.0f,  0.0f,  0.0f,
                                                                          0.0f,  0.0f,  1.0f,  0.0f,
                                                                          1.0f,  2.0f,  3.0f,  1.0f } );
-    
+
     // Translated xyz 123 - Inverse - In column major order !
     static FloatBuffer translated123I = FloatBuffer.wrap( new float[] {  1.0f,  0.0f,  0.0f,  0.0f,
                                                                          0.0f,  1.0f,  0.0f,  0.0f,
                                                                          0.0f,  0.0f,  1.0f,  0.0f,
                                                                         -1.0f, -2.0f, -3.0f,  1.0f } );
-    
+
     // Translated xyz 123 - Inverse and Transposed - In column major order !
     static FloatBuffer translated123IT = FloatBuffer.wrap( new float[] {  1.0f,  0.0f,  0.0f, -1.0f,
                                                                           0.0f,  1.0f,  0.0f, -2.0f,
@@ -115,7 +117,7 @@ public class TestPMVMatrix01NEWT extends UITestCase {
         System.err.println();
         Assert.assertEquals(s4x4Cpmv, s4x4Cflu);
         Assert.assertEquals(s4x4Cflu, s4x4Rflu);
-        
+
         final String s2x3Rflu = FloatUtil.matrixToString(null, null, "%10.5f", matrix2x3R, 0, 2, 3, true).toString();
         final String s2x3Cflu = FloatUtil.matrixToString(null, null, "%10.5f", matrix2x3C, 0, 2, 3, false).toString();
         System.err.println("FLU-R-O 2x3: ");
@@ -125,7 +127,7 @@ public class TestPMVMatrix01NEWT extends UITestCase {
         System.err.println(s2x3Cflu);
         System.err.println();
         Assert.assertEquals(s2x3Cflu, s2x3Rflu);
-        
+
         final String s3x2Rflu = FloatUtil.matrixToString(null, null, "%10.5f", matrix3x2R, 0, 3, 2, true).toString();
         final String s3x2Cflu = FloatUtil.matrixToString(null, null, "%10.5f", matrix3x2C, 0, 3, 2, false).toString();
         System.err.println("FLU-R-O 3x2: ");
@@ -134,9 +136,9 @@ public class TestPMVMatrix01NEWT extends UITestCase {
         System.err.println("FLU-C-O 3x2: ");
         System.err.println(s3x2Cflu);
         System.err.println();
-        Assert.assertEquals(s3x2Cflu, s3x2Rflu);                
+        Assert.assertEquals(s3x2Cflu, s3x2Rflu);
     }
-    
+
     /**
      * Test using traditional access workflow, i.e. 1) operation 2) get-matrix references
      * <p>
@@ -149,13 +151,13 @@ public class TestPMVMatrix01NEWT extends UITestCase {
         FloatBuffer p, mv, mvi, mvit;
         Frustum frustum;
         boolean b;
-        final PMVMatrix pmv = new PMVMatrix(true);
+        final PMVMatrix pmv = new PMVMatrix();
         // System.err.println("P0: "+pmv.toString());
-        
+
         Assert.assertTrue("Dirty bits clean, "+pmv.toString(), 0 != pmv.getDirtyBits());
         Assert.assertEquals("Remaining dirty bits not Mvi|Mvit|Frustum, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW|PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getDirtyBits());
         Assert.assertEquals("Request bits not zero, "+pmv.toString(), 0, pmv.getRequestMask());
-        
+
         //
         // Action #0
         //
@@ -164,15 +166,15 @@ public class TestPMVMatrix01NEWT extends UITestCase {
             pmv.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
             pmv.glLoadIdentity();
             ident = pmv.glGetPMatrixf();
-            
+
             pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
             pmv.glLoadIdentity();
-        }        
+        }
         Assert.assertTrue("Modified bits zero", 0 != pmv.getModifiedBits(true)); // clear & test
         Assert.assertTrue("Dirty bits clean, "+pmv.toString(), 0 != pmv.getDirtyBits());
         Assert.assertEquals("Remaining dirty bits not Mvi|Mvit|Frustum, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW|PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getDirtyBits());
         Assert.assertEquals("Request bits not zero, "+pmv.toString(), 0, pmv.getRequestMask());
-        
+
         //
         // Action #1
         //
@@ -182,36 +184,36 @@ public class TestPMVMatrix01NEWT extends UITestCase {
         Assert.assertEquals("Remaining dirty bits not Mvi|Mvit|Frustum, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW|PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getDirtyBits());
         Assert.assertEquals("Request bits not zero, "+pmv.toString(), 0, pmv.getRequestMask());
         // System.err.println("P1: "+pmv.toString());
-        
+
         b = pmv.update(); // will not clean dirty bits, since no request has been made -> false
-        Assert.assertEquals("Update has been perfomed, but non requested", false, b);       
+        Assert.assertEquals("Update has been perfomed, but non requested", false, b);
         Assert.assertTrue("Dirty bits clean, "+pmv.toString(), 0 != pmv.getDirtyBits());
         Assert.assertEquals("Remaining dirty bits not Mvi|Mvit|Frustum, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW|PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getDirtyBits());
         Assert.assertEquals("Request bits not zero, "+pmv.toString(), 0, pmv.getRequestMask());
         // System.err.println("P2: "+pmv.toString());
-        
+
         //
         // Get
         //
         p = pmv.glGetPMatrixf();
         MiscUtils.assertFloatBufferEquals("P not identity, "+pmv.toString(), ident, p, epsilon);
         mv = pmv.glGetMvMatrixf();
-        MiscUtils.assertFloatBufferEquals("Mv not translated123, "+pmv.toString(), translated123C, mv, epsilon);        
+        MiscUtils.assertFloatBufferEquals("Mv not translated123, "+pmv.toString(), translated123C, mv, epsilon);
         mvi = pmv.glGetMviMatrixf();
         MiscUtils.assertFloatBufferEquals("Mvi not translated123, "+pmv.toString(), translated123I, mvi, epsilon);
         Assert.assertEquals("Request bit Mvi not set, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW, pmv.getRequestMask());
         Assert.assertEquals("Remaining dirty bits not Mvit|Frustum, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getDirtyBits());
-        
+
         frustum = pmv.glGetFrustum();
         Assert.assertNotNull("Frustum is null"+pmv.toString(), frustum); // FIXME: Test Frustum value!
         Assert.assertEquals("Remaining dirty bits not Mvit, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW, pmv.getDirtyBits());
         Assert.assertEquals("Request bits Mvi|Frustum not set, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getRequestMask());
         // System.err.println("P3: "+pmv.toString());
-        
+
         mvit = pmv.glGetMvitMatrixf();
         MiscUtils.assertFloatBufferEquals("Mvit not translated123, "+pmv.toString()+pmv.toString(), translated123IT, mvit, epsilon);
         Assert.assertTrue("Dirty bits not clean, "+pmv.toString(), 0 == pmv.getDirtyBits());
-        Assert.assertEquals("Request bits Mvi|Mvit|Frustum not set, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW | PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getRequestMask());        
+        Assert.assertEquals("Request bits Mvi|Mvit|Frustum not set, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW | PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getRequestMask());
         // System.err.println("P4: "+pmv.toString());
 
         //
@@ -223,22 +225,22 @@ public class TestPMVMatrix01NEWT extends UITestCase {
         Assert.assertEquals("Remaining dirty bits not Mvi|Mvit|Frustum, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW|PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getDirtyBits());
         Assert.assertEquals("Request bits Mvi|Mvit|Frustum not set, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW | PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getRequestMask());
         MiscUtils.assertFloatBufferEquals("P not identity, "+pmv.toString(), ident, p, epsilon);
-        MiscUtils.assertFloatBufferEquals("Mv not identity, "+pmv.toString(), ident, mv, epsilon);        
+        MiscUtils.assertFloatBufferEquals("Mv not identity, "+pmv.toString(), ident, mv, epsilon);
         MiscUtils.assertFloatBufferNotEqual("Mvi already identity w/o update, "+pmv.toString(), ident, mvi, epsilon);
         MiscUtils.assertFloatBufferNotEqual("Mvit already identity w/o update, "+pmv.toString(), ident, mvit, epsilon);
         MiscUtils.assertFloatBufferEquals("Mvi not translated123, "+pmv.toString()+pmv.toString(), translated123I, mvi, epsilon);
         MiscUtils.assertFloatBufferEquals("Mvit not translated123, "+pmv.toString()+pmv.toString(), translated123IT, mvit, epsilon);
         Assert.assertNotNull("Frustum is null"+pmv.toString(), frustum); // FIXME: Test Frustum value!
-     
+
         b = pmv.update(); // will clean dirty bits, since request has been made -> true
-        Assert.assertEquals("Update has not been perfomed, but requested", true, b);       
+        Assert.assertEquals("Update has not been perfomed, but requested", true, b);
         Assert.assertTrue("Dirty bits not clean, "+pmv.toString(), 0 == pmv.getDirtyBits());
         Assert.assertEquals("Request bits Mvi|Mvit|Frustum not set, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW | PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getRequestMask());
         MiscUtils.assertFloatBufferEquals("Mvi not identity after update, "+pmv.toString(), ident, mvi, epsilon);
         MiscUtils.assertFloatBufferEquals("Mvit not identity after update, "+pmv.toString(), ident, mvit, epsilon);
         Assert.assertNotNull("Frustum is null"+pmv.toString(), frustum); // FIXME: Test Frustum value!
     }
-    
+
     /**
      * Test using shader access workflow, i.e. 1) get-matrix references 2) operations
      * <p>
@@ -251,13 +253,13 @@ public class TestPMVMatrix01NEWT extends UITestCase {
         final FloatBuffer p, mv, mvi, mvit;
         Frustum frustum;
         boolean b;
-        final PMVMatrix pmv = new PMVMatrix(true);
+        final PMVMatrix pmv = new PMVMatrix();
         // System.err.println("P0: "+pmv.toString());
-        
+
         Assert.assertTrue("Dirty bits clean, "+pmv.toString(), 0 != pmv.getDirtyBits());
         Assert.assertEquals("Remaining dirty bits not Mvi|Mvit|Frustum, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW|PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getDirtyBits());
         Assert.assertEquals("Request bits not zero, "+pmv.toString(), 0, pmv.getRequestMask());
-        
+
         //
         // Action #0
         //
@@ -266,17 +268,17 @@ public class TestPMVMatrix01NEWT extends UITestCase {
             pmv.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
             pmv.glLoadIdentity();
             ident = pmv.glGetPMatrixf();
-            
+
             pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
             pmv.glLoadIdentity();
-        }        
+        }
         // System.err.println("P0: "+pmv.toString());
         Assert.assertTrue("Modified bits zero", 0 != pmv.getModifiedBits(true)); // clear & test
         Assert.assertTrue("Dirty bits clean, "+pmv.toString(), 0 != pmv.getDirtyBits());
         Assert.assertEquals("Remaining dirty bits not Mvi|Mvit|Frustum, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW|PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getDirtyBits());
         Assert.assertEquals("Request bits not zero, "+pmv.toString(), 0, pmv.getRequestMask());
         // System.err.println("P1: "+pmv.toString());
-        
+
         //
         // Get
         //
@@ -286,14 +288,14 @@ public class TestPMVMatrix01NEWT extends UITestCase {
         MiscUtils.assertFloatBufferEquals("Mv not identity, "+pmv.toString(), ident, mv, epsilon);
         Assert.assertTrue("Dirty bits clean, "+pmv.toString(), 0 != pmv.getDirtyBits());
         Assert.assertEquals("Request bits not zero, "+pmv.toString(), 0, pmv.getRequestMask());
-        
+
         mvi  = pmv.glGetMviMatrixf();
-        MiscUtils.assertFloatBufferEquals("Mvi not identity, "+pmv.toString(), ident, mvi, epsilon);        
+        MiscUtils.assertFloatBufferEquals("Mvi not identity, "+pmv.toString(), ident, mvi, epsilon);
         Assert.assertEquals("Remaining dirty bits not Mvit|Frustum, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getDirtyBits());
         Assert.assertEquals("Request bit Mvi not set, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW, pmv.getRequestMask());
-        
+
         mvit = pmv.glGetMvitMatrixf();
-        MiscUtils.assertFloatBufferEquals("Mvi not identity, "+pmv.toString(), ident, mvit, epsilon);        
+        MiscUtils.assertFloatBufferEquals("Mvi not identity, "+pmv.toString(), ident, mvit, epsilon);
         Assert.assertEquals("Remaining dirty bits not Frustum, "+pmv.toString(), PMVMatrix.DIRTY_FRUSTUM, pmv.getDirtyBits());
         Assert.assertEquals("Request bits Mvi and Mvit not set, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW | PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW, pmv.getRequestMask());
 
@@ -301,7 +303,7 @@ public class TestPMVMatrix01NEWT extends UITestCase {
         Assert.assertNotNull("Frustum is null"+pmv.toString(), frustum); // FIXME: Test Frustum value!
         Assert.assertTrue("Dirty bits not clean, "+pmv.toString(), 0 == pmv.getDirtyBits());
         Assert.assertEquals("Request bits Mvi|Mvit|Frustum not set, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW | PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getRequestMask());
-        
+
         //
         // Action #1
         //
@@ -316,101 +318,103 @@ public class TestPMVMatrix01NEWT extends UITestCase {
         MiscUtils.assertFloatBufferEquals("Mvi not identity, "+pmv.toString()+pmv.toString(), ident, mvi, epsilon);
         MiscUtils.assertFloatBufferEquals("Mvit not identity, "+pmv.toString()+pmv.toString(), ident, mvit, epsilon);
         Assert.assertNotNull("Frustum is null"+pmv.toString(), frustum); // FIXME: Test Frustum value!
-        
-        b = pmv.update(); // will clean dirty bits, since all requests has been made -> true        
-        Assert.assertEquals("Update has not been perfomed, but requested", true, b);       
+
+        b = pmv.update(); // will clean dirty bits, since all requests has been made -> true
+        Assert.assertEquals("Update has not been perfomed, but requested", true, b);
         Assert.assertTrue("Dirty bits not clean, "+pmv.toString(), 0 == pmv.getDirtyBits());
         Assert.assertEquals("Request bits Mvi|Mvit|Frustum not set, "+pmv.toString(), PMVMatrix.DIRTY_INVERSE_MODELVIEW | PMVMatrix.DIRTY_INVERSE_TRANSPOSED_MODELVIEW | PMVMatrix.DIRTY_FRUSTUM, pmv.getRequestMask());
         MiscUtils.assertFloatBufferEquals("Mvi not translated123, "+pmv.toString()+pmv.toString(), translated123I, mvi, epsilon);
         MiscUtils.assertFloatBufferEquals("Mvit not translated123, "+pmv.toString()+pmv.toString(), translated123IT, mvit, epsilon);
-        // System.err.println("P2: "+pmv.toString());        
+        // System.err.println("P2: "+pmv.toString());
     }
-    
+
     @SuppressWarnings("unused")
     @Test
     public void test03MvTranslate() {
-        final FloatBuffer pmvMv, pmvMvi, pmvMvit;
+        final FloatBuffer pmvMv;
+        // final FloatBuffer pmvMvi, pmvMvit;
         {
-            final PMVMatrix pmv = new PMVMatrix(true);
+            final PMVMatrix pmv = new PMVMatrix();
             pmv.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
             pmv.glLoadIdentity();
             pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
             pmv.glLoadIdentity();
             pmv.glTranslatef(5f, 6f, 7f);
-            
+
             pmvMv = pmv.glGetMvMatrixf();
-            pmvMvi = pmv.glGetMviMatrixf();
-            pmvMvit = pmv.glGetMvitMatrixf();
+            // pmvMvi = pmv.glGetMviMatrixf();
+            // pmvMvit = pmv.glGetMvitMatrixf();
         }
 
         final FloatBuffer glMv = FloatBuffer.allocate(16);
         {
-            GL2ES1 gl = dc.glc.getGL().getGL2ES1();
+            final GL2ES1 gl = dc.glc.getGL().getGL2ES1();
             gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
             gl.glLoadIdentity();
             gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
             gl.glLoadIdentity();
             gl.glTranslatef(5f, 6f, 7f);
-            
+
             gl.glGetFloatv(GLMatrixFunc.GL_MODELVIEW_MATRIX, glMv);
         }
         // System.err.println(PMVMatrix.matrixToString(null, "%10.5f", glMv, pmvMv).toString());
-        
-        MiscUtils.assertFloatBufferEquals("Arrays not equal, expected"+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", glMv).toString()+
-                ", actual"+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMv).toString(),
+
+        MiscUtils.assertFloatBufferEquals("Arrays not equal, expected"+PlatformPropsImpl.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", glMv).toString()+
+                ", actual"+PlatformPropsImpl.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMv).toString(),
                 glMv, pmvMv, epsilon);
-        
+
         // System.err.println("pmvMvi:  "+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMvi));
-        // System.err.println("pmvMvit: "+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMvit));        
+        // System.err.println("pmvMvit: "+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMvit));
     }
-    
+
     @SuppressWarnings("unused")
     @Test
     public void test04MvTranslateRotate() {
-        final FloatBuffer pmvMv, pmvMvi, pmvMvit;
+        final FloatBuffer pmvMv;
+        // final FloatBuffer pmvMvi, pmvMvit;
         {
-            final PMVMatrix pmv = new PMVMatrix(true);
+            final PMVMatrix pmv = new PMVMatrix();
             pmv.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
             pmv.glLoadIdentity();
             pmv.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
             pmv.glLoadIdentity();
             pmv.glTranslatef(5f, 6f, 7f);
             pmv.glRotatef(90f, 1f, 0f, 0f);
-            
+
             pmvMv = pmv.glGetMvMatrixf();
-            pmvMvi = pmv.glGetMviMatrixf();
-            pmvMvit = pmv.glGetMvitMatrixf();
+            // pmvMvi = pmv.glGetMviMatrixf();
+            // pmvMvit = pmv.glGetMvitMatrixf();
         }
 
         final FloatBuffer glMv = FloatBuffer.allocate(16);
         {
-            GL2ES1 gl = dc.glc.getGL().getGL2ES1();
+            final GL2ES1 gl = dc.glc.getGL().getGL2ES1();
             gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
             gl.glLoadIdentity();
             gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
             gl.glLoadIdentity();
             gl.glTranslatef(5f, 6f, 7f);
             gl.glRotatef(90f, 1f, 0f, 0f);
-            
+
             gl.glGetFloatv(GLMatrixFunc.GL_MODELVIEW_MATRIX, glMv);
         }
         // System.err.println(PMVMatrix.matrixToString(null, "%10.5f", glMv, pmvMv).toString());
-        
-        MiscUtils.assertFloatBufferEquals("Arrays not equal, expected"+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", glMv).toString()+
-                ", actual"+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMv).toString(),
+
+        MiscUtils.assertFloatBufferEquals("Arrays not equal, expected"+PlatformPropsImpl.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", glMv).toString()+
+                ", actual"+PlatformPropsImpl.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMv).toString(),
                 glMv, pmvMv, epsilon);
-        
+
         // System.err.println("pmvMvi:  "+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMvi));
-        // System.err.println("pmvMvit: "+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMvit));        
+        // System.err.println("pmvMvit: "+Platform.NEWLINE+PMVMatrix.matrixToString(null, "%10.5f", pmvMvit));
     }
-    
+
     static DrawableContext dc;
-            
+
     @BeforeClass
     public static void setup() throws Throwable {
         try {
             dc = createOffscreenDrawableAndCurrentFFPContext();
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             setTestSupported(false);
             throw t;
         }
@@ -420,30 +424,30 @@ public class TestPMVMatrix01NEWT extends UITestCase {
     public static void cleanup() {
         destroyDrawableContext(dc);
     }
-    
+
     static class DrawableContext {
-        DrawableContext(GLDrawable d, GLContext glc) {
+        DrawableContext(final GLDrawable d, final GLContext glc) {
             this.d = d;
             this.glc = glc;
         }
         GLDrawable d;
         GLContext glc;
     }
-    
+
     private static DrawableContext createOffscreenDrawableAndCurrentFFPContext() throws Throwable {
-        GLProfile glp = GLProfile.getMaxFixedFunc(true);
-        GLCapabilities glCaps = new GLCapabilities(glp);
+        final GLProfile glp = GLProfile.getMaxFixedFunc(true);
+        final GLCapabilities glCaps = new GLCapabilities(glp);
         glCaps.setOnscreen(false);
         glCaps.setPBuffer(true);
-        GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
-        GLDrawable d = factory.createOffscreenDrawable(null, glCaps, null, 64, 64);
+        final GLDrawableFactory factory = GLDrawableFactory.getFactory(glp);
+        final GLDrawable d = factory.createOffscreenDrawable(null, glCaps, null, 64, 64);
         d.setRealized(true);
         GLContext glc = null;
         try {
             glc = d.createContext(null);
             Assert.assertTrue("Context could not be made current", GLContext.CONTEXT_NOT_CURRENT < glc.makeCurrent());
             return new DrawableContext(d, glc);
-        } catch (Throwable t) {
+        } catch (final Throwable t) {
             if(null != glc) {
                 glc.destroy();
             }
@@ -451,8 +455,8 @@ public class TestPMVMatrix01NEWT extends UITestCase {
             throw t;
         }
     }
-    
-    private static void destroyDrawableContext(DrawableContext dc) {
+
+    private static void destroyDrawableContext(final DrawableContext dc) {
         if(null != dc.glc) {
             dc.glc.destroy();
             dc.glc = null;
@@ -462,8 +466,8 @@ public class TestPMVMatrix01NEWT extends UITestCase {
             dc.d = null;
         }
     }
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestPMVMatrix01NEWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix02NOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix02NOUI.java
index 2c3a6f3..7250e43 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix02NOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix02NOUI.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.math;
 
 import org.junit.Before;
@@ -62,8 +62,8 @@ public class TestPMVMatrix02NOUI {
         0, 0, -1,
         0, 1, 0
     );
-    FloatBuffer mvMatrix = fMat.glGetMvMatrixf();
-    float[] mvMatrixArr = new float[16];
+    final FloatBuffer mvMatrix = fMat.glGetMvMatrixf();
+    final float[] mvMatrixArr = new float[16];
     mvMatrix.asReadOnlyBuffer().get(mvMatrixArr);
     assertArrayEquals(
         /**
@@ -88,8 +88,8 @@ public class TestPMVMatrix02NOUI {
         0, 1, 0,
         0, 0, 1
     );
-    FloatBuffer mvMatrix = fMat.glGetMvMatrixf();
-    float[] mvMatrixArr = new float[16];
+    final FloatBuffer mvMatrix = fMat.glGetMvMatrixf();
+    final float[] mvMatrixArr = new float[16];
     mvMatrix.asReadOnlyBuffer().get(mvMatrixArr);
     assertArrayEquals(
         /**
@@ -106,7 +106,7 @@ public class TestPMVMatrix02NOUI {
     );
   }
 
-  public static void main(String args[]) {
+  public static void main(final String args[]) {
       org.junit.runner.JUnitCore.main(TestPMVMatrix02NOUI.class.getName());
   }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix03NOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix03NOUI.java
index df14916..87e7599 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix03NOUI.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestPMVMatrix03NOUI.java
@@ -2,6 +2,8 @@ package com.jogamp.opengl.test.junit.jogl.math;
 
 import java.util.Arrays;
 
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
+
 import jogamp.opengl.ProjectFloat;
 
 import com.jogamp.opengl.math.FloatUtil;
@@ -16,77 +18,98 @@ import org.junit.runners.MethodSorters;
 public class TestPMVMatrix03NOUI {
 
     static final float epsilon = 0.00001f;
-    
+
     // Simple 10 x 10 view port
     static final int[] viewport = new int[] { 0,0,10,10};
-        
+
     @Test
     public void test01() {
-        float[] winA00 = new float[4];
-        float[] winA01 = new float[4];
-        float[] winA10 = new float[4];
-        float[] winA11 = new float[4];
-        PMVMatrix m = new PMVMatrix();
-                
+        final float[] vec4Tmp1 = new float[4];
+        final float[] vec4Tmp2 = new float[4];
+
+        final float[] winA00 = new float[4];
+        final float[] winA01 = new float[4];
+        final float[] winA10 = new float[4];
+        final float[] winA11 = new float[4];
+        final float[] winB00 = new float[4];
+        final float[] winB01 = new float[4];
+        final float[] winB10 = new float[4];
+        final float[] winB11 = new float[4];
+
+        final PMVMatrix m = new PMVMatrix();
+        final float[] mat4PMv = new float[16];
+        m.multPMvMatrixf(mat4PMv, 0);
+        System.err.println(FloatUtil.matrixToString(null, "mat4PMv", "%10.5f", mat4PMv, 0, 4, 4, false /* rowMajorOrder */));
+
         m.gluProject(1f, 0f, 0f, viewport, 0, winA00, 0);
-        System.out.println("A.0.0 - Project 1,0 -->" + Arrays.toString(winA00));
-        
+        System.err.println("A.0.0 - Project 1,0 -->" + Arrays.toString(winA00));
+        FloatUtil.mapObjToWinCoords(1f, 0f, 0f, mat4PMv, viewport, 0, winB00, 0, vec4Tmp1, vec4Tmp2);
+        System.err.println("B.0.0 - Project 1,0 -->" + Arrays.toString(winB00));
+
         m.gluProject(0f, 0f, 0f, viewport, 0, winA01, 0);
-        System.out.println("A.0.1 - Project 0,0 -->" + Arrays.toString(winA01));
-        
-        m.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        System.err.println("A.0.1 - Project 0,0 -->" + Arrays.toString(winA01));
+        FloatUtil.mapObjToWinCoords(0f, 0f, 0f, mat4PMv, viewport, 0, winB01, 0, vec4Tmp1, vec4Tmp2);
+        System.err.println("B.0.1 - Project 0,0 -->" + Arrays.toString(winB01));
+
+        m.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         m.glOrthof(0, 10, 0, 10, 1, -1);
-        System.out.println("MATRIX - Ortho 0,0,10,10 - Locate the origin in the bottom left and scale");
-        System.out.println(m);
-        float[] projMatrixA = new float[16];
-        float[] modelMatrixA = new float[16];
-        m.glGetFloatv(PMVMatrix.GL_PROJECTION, projMatrixA, 0);
-        m.glGetFloatv(PMVMatrix.GL_MODELVIEW, modelMatrixA, 0);
-        
+        System.err.println("MATRIX - Ortho 0,0,10,10 - Locate the origin in the bottom left and scale");
+        System.err.println(m);
+        m.multPMvMatrixf(mat4PMv, 0);
+        System.err.println(FloatUtil.matrixToString(null, "mat4PMv", "%10.5f", mat4PMv, 0, 4, 4, false /* rowMajorOrder */));
+
         m.gluProject(1f, 0f, 0f, viewport, 0, winA10, 0);
-        System.out.println("A.1.0 - Project 1,0 -->" +Arrays.toString(winA10));
-        
+        System.err.println("A.1.0 - Project 1,0 -->" +Arrays.toString(winA10));
+        FloatUtil.mapObjToWinCoords(1f, 0f, 0f, mat4PMv, viewport, 0, winB10, 0, vec4Tmp1, vec4Tmp2);
+        System.err.println("B.1.0 - Project 1,0 -->" +Arrays.toString(winB10));
+
         m.gluProject(0f, 0f, 0f, viewport, 0, winA11, 0);
-        System.out.println("A.1.1 - Project 0,0 -->" +Arrays.toString(winA11));
-        
-        
-        ////////////////////
-        /////////////////////
-        
-        float[] winB00 = new float[4];
-        float[] winB01 = new float[4];
-        float[] winB10 = new float[4];
-        float[] winB11 = new float[4];
-        float[] projMatrixB = new float[16];
-        float[] modelMatrixB = new float[16];
-        FloatUtil.makeIdentityf(projMatrixB, 0);
-        FloatUtil.makeIdentityf(modelMatrixB, 0);        
-        final ProjectFloat projectFloat = new ProjectFloat(true);
-        
-        projectFloat.gluProject(1f, 0f, 0f, modelMatrixB, 0, projMatrixB, 0, viewport, 0, winB00, 0);
-        System.out.println("B.0.0 - Project 1,0 -->" +Arrays.toString(winB00));
-        
-        projectFloat.gluProject(0f, 0f, 0f, modelMatrixB, 0, projMatrixB, 0, viewport, 0, winB01, 0);
-        System.out.println("B.0.1 - Project 0,0 -->" +Arrays.toString(winB01));
-                
-        glOrthof(projMatrixB, 0, 10, 0, 10, 1, -1);
-        System.out.println("FloatUtil - Ortho 0,0,10,10 - Locate the origin in the bottom left and scale");
-        System.out.println("Projection");
-        System.err.println(FloatUtil.matrixToString(null, null, "%10.5f", projMatrixB, 0, 4, 4, false /* rowMajorOrder */));
-        System.out.println("Modelview");
-        System.err.println(FloatUtil.matrixToString(null, null, "%10.5f", modelMatrixB, 0, 4, 4, false /* rowMajorOrder */));
-                
-        projectFloat.gluProject(1f, 0f, 0f, modelMatrixB, 0, projMatrixB, 0, viewport, 0, winB10, 0);
-        System.out.println("B.1.0 - Project 1,0 -->" +Arrays.toString(winB10));
-        
-        projectFloat.gluProject(0f, 0f, 0f, modelMatrixB, 0, projMatrixB, 0, viewport, 0, winB11, 0);
-        System.out.println("B.1.1 - Project 0,0 -->" +Arrays.toString(winB11));
-        
+        System.err.println("A.1.1 - Project 0,0 -->" +Arrays.toString(winA11));
+        FloatUtil.mapObjToWinCoords(0f, 0f, 0f, mat4PMv, viewport, 0, winB11, 0, vec4Tmp1, vec4Tmp2);
+        System.err.println("B.1.1 - Project 0,0 -->" +Arrays.toString(winB11));
+
         Assert.assertArrayEquals("A/B 0.0 Project 1,0 failure", winB00, winA00, epsilon);
         Assert.assertArrayEquals("A/B 0.1 Project 0,0 failure", winB01, winA01, epsilon);
         Assert.assertArrayEquals("A/B 1.0 Project 1,0 failure", winB10, winA10, epsilon);
         Assert.assertArrayEquals("A/B 1.1 Project 0,0 failure", winB11, winA11, epsilon);
-        
+
+        ////////////////////
+        /////////////////////
+
+        final float[] winC00 = new float[4];
+        final float[] winC01 = new float[4];
+        final float[] winC10 = new float[4];
+        final float[] winC11 = new float[4];
+        final float[] projMatrixC = new float[16];
+        final float[] modelMatrixC = new float[16];
+        FloatUtil.makeIdentity(projMatrixC);
+        FloatUtil.makeIdentity(modelMatrixC);
+        final ProjectFloat projectFloat = new ProjectFloat();
+
+        projectFloat.gluProject(1f, 0f, 0f, modelMatrixC, 0, projMatrixC, 0, viewport, 0, winC00, 0);
+        System.err.println("C.0.0 - Project 1,0 -->" +Arrays.toString(winC00));
+
+        projectFloat.gluProject(0f, 0f, 0f, modelMatrixC, 0, projMatrixC, 0, viewport, 0, winC01, 0);
+        System.err.println("C.0.1 - Project 0,0 -->" +Arrays.toString(winC01));
+
+        glOrthof(projMatrixC, 0, 10, 0, 10, 1, -1);
+        System.err.println("FloatUtil - Ortho 0,0,10,10 - Locate the origin in the bottom left and scale");
+        System.err.println("Projection");
+        System.err.println(FloatUtil.matrixToString(null, null, "%10.5f", projMatrixC, 0, 4, 4, false /* rowMajorOrder */));
+        System.err.println("Modelview");
+        System.err.println(FloatUtil.matrixToString(null, null, "%10.5f", modelMatrixC, 0, 4, 4, false /* rowMajorOrder */));
+
+        projectFloat.gluProject(1f, 0f, 0f, modelMatrixC, 0, projMatrixC, 0, viewport, 0, winC10, 0);
+        System.err.println("C.1.0 - Project 1,0 -->" +Arrays.toString(winC10));
+
+        projectFloat.gluProject(0f, 0f, 0f, modelMatrixC, 0, projMatrixC, 0, viewport, 0, winC11, 0);
+        System.err.println("B.1.1 - Project 0,0 -->" +Arrays.toString(winC11));
+
+        Assert.assertArrayEquals("A/C 0.0 Project 1,0 failure", winC00, winA00, epsilon);
+        Assert.assertArrayEquals("A/C 0.1 Project 0,0 failure", winC01, winA01, epsilon);
+        Assert.assertArrayEquals("A/C 1.0 Project 1,0 failure", winC10, winA10, epsilon);
+        Assert.assertArrayEquals("A/C 1.1 Project 0,0 failure", winC11, winA11, epsilon);
+
         Assert.assertEquals("A 0.0 Project 1,0 failure X", 10.0, winA00[0], epsilon);
         Assert.assertEquals("A 0.0 Project 1,0 failure Y",  5.0, winA00[1], epsilon);
         Assert.assertEquals("A.0.1 Project 0,0 failure X",  5.0, winA01[0], epsilon);
@@ -96,9 +119,9 @@ public class TestPMVMatrix03NOUI {
         Assert.assertEquals("A.1.1 Project 0,0 failure X",  0.0, winA11[0], epsilon);
         Assert.assertEquals("A.1.1 Project 0,0 failure Y",  0.0, winA11[1], epsilon);
     }
-    
+
     public final void glOrthof(final float[] m, final float left, final float right, final float bottom, final float top, final float zNear, final float zFar) {
-        // Ortho matrix: 
+        // Ortho matrix:
         //  2/dx  0     0    tx
         //  0     2/dy  0    ty
         //  0     0     2/dz tz
@@ -110,8 +133,8 @@ public class TestPMVMatrix03NOUI {
         final float ty=-1.0f*(top+bottom)/dy;
         final float tz=-1.0f*(zFar+zNear)/dz;
 
-        float[] matrixOrtho = new float[16];
-        FloatUtil.makeIdentityf(matrixOrtho, 0);
+        final float[] matrixOrtho = new float[16];
+        FloatUtil.makeIdentity(matrixOrtho);
         matrixOrtho[0+4*0] =  2.0f/dx;
         matrixOrtho[1+4*1] =  2.0f/dy;
         matrixOrtho[2+4*2] = -2.0f/dz;
@@ -119,10 +142,10 @@ public class TestPMVMatrix03NOUI {
         matrixOrtho[1+4*3] = ty;
         matrixOrtho[2+4*3] = tz;
 
-        FloatUtil.multMatrixf(m, 0, matrixOrtho, 0);
+        FloatUtil.multMatrix(m, 0, matrixOrtho, 0);
     }
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestPMVMatrix03NOUI.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/math/TestQuaternion01NOUI.java b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestQuaternion01NOUI.java
new file mode 100644
index 0000000..d6d7131
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/math/TestQuaternion01NOUI.java
@@ -0,0 +1,817 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+
+package com.jogamp.opengl.test.junit.jogl.math;
+
+import java.util.Arrays;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.FixMethodOrder;
+import org.junit.runners.MethodSorters;
+
+import com.jogamp.opengl.math.FloatUtil;
+import com.jogamp.opengl.math.Quaternion;
+import com.jogamp.opengl.math.VectorUtil;
+
+ at FixMethodOrder(MethodSorters.NAME_ASCENDING)
+public class TestQuaternion01NOUI {
+    static final boolean DEBUG = false;
+
+    static final Quaternion QUAT_IDENT = new Quaternion(0f, 0f, 0f, 1f);
+
+    static final float[] ZERO       = new float[] {  0f,  0f,  0f };
+    static final float[] ONE        = new float[] {  1f,  1f,  1f };
+    static final float[] NEG_ONE    = new float[] { -1f, -1f, -1f };
+    static final float[] UNIT_X     = new float[] {  1f,  0f,  0f };
+    static final float[] UNIT_Y     = new float[] {  0f,  1f,  0f };
+    static final float[] UNIT_Z     = new float[] {  0f,  0f,  1f };
+    static final float[] NEG_UNIT_X = new float[] { -1f,  0f,  0f };
+    static final float[] NEG_UNIT_Y = new float[] {  0f, -1f,  0f };
+    static final float[] NEG_UNIT_Z = new float[] {  0f,  0f, -1f };
+
+    static final float[] NEG_ONE_v4 = new float[] { -1f, -1f, -1f, 0f };
+    static final float[] ONE_v4     = new float[] {  1f,  1f,  1f, 0f };
+
+    static final float MACH_EPSILON = FloatUtil.getMachineEpsilon();
+
+    //
+    // Basic
+    //
+
+    @Test
+    public void test01Normalize() {
+        final Quaternion quat = new Quaternion(0, 1, 2, 3);
+        final Quaternion quat2 = new Quaternion(quat).normalize();
+        // Assert.assertTrue(Math.abs(1 - quat2.magnitude()) <= MACH_EPSILON);
+        Assert.assertEquals(0f, Math.abs(1 - quat2.magnitude()), MACH_EPSILON);
+    }
+
+    @Test
+    public void test02RotateZeroVector() {
+        final Quaternion quat = new Quaternion();
+        final float[] rotVec0 = quat.rotateVector(new float[3], 0, ZERO, 0);
+        Assert.assertArrayEquals(ZERO, rotVec0, FloatUtil.EPSILON);
+    }
+
+    @Test
+    public void test03InvertAndConj() {
+        // inversion check
+        {
+            final Quaternion quat0 = new Quaternion(0, 1, 2, 3);
+            final Quaternion quat0Inv = new Quaternion(quat0).invert();
+            Assert.assertEquals(quat0, quat0Inv.invert());
+        }
+        // conjugate check
+        {
+            final Quaternion quat0 = new Quaternion(-1f, -2f, -3f, 4f);
+            final Quaternion quat0Conj = new Quaternion( 1f,  2f,  3f, 4f).conjugate();
+            Assert.assertEquals(quat0, quat0Conj);
+        }
+    }
+
+    @Test
+    public void test04Dot() {
+        final Quaternion quat = new Quaternion(7f, 2f, 5f, -1f);
+        Assert.assertTrue(35.0f == quat.dot(3f, 1f, 2f, -2f));
+        Assert.assertTrue(-11.0f == quat.dot(new Quaternion(-1f, 1f, -1f, 1f)));
+    }
+
+
+    //
+    // Conversion
+    //
+
+    @Test
+    public void test10AngleAxis() {
+        final float[] tmpV3f = new float[3];
+        final Quaternion quat1 = new Quaternion().setFromAngleAxis(FloatUtil.HALF_PI, new float[] { 2, 0, 0 }, tmpV3f );
+        final Quaternion quat2 = new Quaternion().setFromAngleNormalAxis(FloatUtil.HALF_PI, new float[] { 1, 0, 0 } );
+
+        Assert.assertEquals(quat2, quat1);
+        // System.err.println("M "+quat2.magnitude()+", 1-M "+(1f-quat2.magnitude())+", Eps "+FloatUtil.EPSILON);
+        Assert.assertEquals(0f, 1 - quat2.magnitude(), FloatUtil.EPSILON);
+        Assert.assertTrue(1 - quat1.magnitude() <= FloatUtil.EPSILON);
+
+        final float[] vecOut1 = new float[3];
+        final float[] vecOut2 = new float[3];
+        quat1.rotateVector(vecOut1, 0, ONE, 0);
+        quat2.rotateVector(vecOut2, 0, ONE, 0);
+        Assert.assertArrayEquals(vecOut1, vecOut2, FloatUtil.EPSILON);
+        Assert.assertEquals(0f, Math.abs( VectorUtil.distVec3(vecOut1, vecOut2) ), FloatUtil.EPSILON );
+
+        quat1.rotateVector(vecOut1, 0, UNIT_Z, 0);
+        Assert.assertEquals(0f, Math.abs( VectorUtil.distVec3(NEG_UNIT_Y, vecOut1) ), FloatUtil.EPSILON );
+
+        quat2.setFromAngleAxis(FloatUtil.HALF_PI, ZERO, tmpV3f);
+        Assert.assertEquals(QUAT_IDENT, quat2);
+
+        float angle = quat1.toAngleAxis(vecOut1);
+        quat2.setFromAngleAxis(angle, vecOut1, tmpV3f);
+        Assert.assertEquals(quat1, quat2);
+
+        quat1.set(0, 0, 0, 0);
+        angle = quat1.toAngleAxis(vecOut1);
+        Assert.assertTrue(0.0f == angle);
+        Assert.assertArrayEquals(UNIT_X, vecOut1, FloatUtil.EPSILON);
+    }
+
+    @Test
+    public void test11FromVectorToVector() {
+        final float[] tmp0V3f = new float[3];
+        final float[] tmp1V3f = new float[3];
+        final float[] vecOut = new float[3];
+        final Quaternion quat = new Quaternion();
+        quat.setFromVectors(UNIT_Z, UNIT_X, tmp0V3f, tmp1V3f);
+
+        final Quaternion quat2 = new Quaternion();
+        quat2.setFromNormalVectors(UNIT_Z, UNIT_X, tmp0V3f);
+        Assert.assertEquals(quat, quat2);
+
+        quat2.setFromAngleAxis(FloatUtil.HALF_PI, UNIT_Y, tmp0V3f);
+        Assert.assertEquals(quat2, quat);
+
+        quat.setFromVectors(UNIT_Z, NEG_UNIT_Z, tmp0V3f, tmp1V3f);
+        quat.rotateVector(vecOut, 0, UNIT_Z, 0);
+        // System.err.println("vecOut: "+Arrays.toString(vecOut));
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(NEG_UNIT_Z, vecOut) ), Quaternion.ALLOWED_DEVIANCE );
+
+        quat.setFromVectors(UNIT_X, NEG_UNIT_X, tmp0V3f, tmp1V3f);
+        quat.rotateVector(vecOut, 0, UNIT_X, 0);
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(NEG_UNIT_X, vecOut) ), Quaternion.ALLOWED_DEVIANCE );
+
+        quat.setFromVectors(UNIT_Y, NEG_UNIT_Y, tmp0V3f, tmp1V3f);
+        quat.rotateVector(vecOut, 0, UNIT_Y, 0);
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(NEG_UNIT_Y, vecOut) ), Quaternion.ALLOWED_DEVIANCE );
+
+        quat.setFromVectors(ONE, NEG_ONE, tmp0V3f, tmp1V3f);
+        quat.rotateVector(vecOut, 0, ONE, 0);
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(NEG_ONE, vecOut) ), Quaternion.ALLOWED_DEVIANCE );
+
+        quat.setFromVectors(ZERO, ZERO, tmp0V3f, tmp1V3f);
+        Assert.assertEquals(QUAT_IDENT, quat);
+    }
+
+    @Test
+    public void test12FromAndToEulerAngles() {
+        // Y.Z.X -> X.Y.Z
+        final Quaternion quat = new Quaternion();
+        final float[] angles0Exp = new float[] { 0f, FloatUtil.HALF_PI, 0f};
+        quat.setFromEuler(angles0Exp);
+        Assert.assertEquals(1.0f, quat.magnitude(), FloatUtil.EPSILON);
+
+        final float[] angles0Has = quat.toEuler(new float[3]);
+        // System.err.println("exp0 "+Arrays.toString(angles0Exp));
+        // System.err.println("has0 "+Arrays.toString(angles0Has));
+        Assert.assertArrayEquals(angles0Exp, angles0Has, FloatUtil.EPSILON);
+
+        final Quaternion quat2 = new Quaternion();
+        quat2.setFromEuler(angles0Has);
+        Assert.assertEquals(quat, quat2);
+
+        ///
+
+        final float[] angles1Exp = new float[] { 0f, 0f, -FloatUtil.HALF_PI };
+        quat.setFromEuler(angles1Exp);
+        Assert.assertEquals(1.0f, quat.magnitude(), FloatUtil.EPSILON);
+
+        final float[] angles1Has = quat.toEuler(new float[3]);
+        // System.err.println("exp1 "+Arrays.toString(angles1Exp));
+        // System.err.println("has1 "+Arrays.toString(angles1Has));
+        Assert.assertArrayEquals(angles1Exp, angles1Has, FloatUtil.EPSILON);
+
+        quat2.setFromEuler(angles1Has);
+        Assert.assertEquals(quat, quat2);
+
+        ///
+
+        final float[] angles2Exp = new float[] { FloatUtil.HALF_PI, 0f, 0f };
+        quat.setFromEuler(angles2Exp);
+        Assert.assertEquals(1.0f, quat.magnitude(), FloatUtil.EPSILON);
+
+        final float[] angles2Has = quat.toEuler(new float[3]);
+        // System.err.println("exp2 "+Arrays.toString(angles2Exp));
+        // System.err.println("has2 "+Arrays.toString(angles2Has));
+        Assert.assertArrayEquals(angles2Exp, angles2Has, FloatUtil.EPSILON);
+
+        quat2.setFromEuler(angles2Has);
+        Assert.assertEquals(quat, quat2);
+    }
+
+    @Test
+    public void test13FromEulerAnglesAndRotateVector() {
+        final Quaternion quat = new Quaternion();
+        quat.setFromEuler(0, FloatUtil.HALF_PI, 0); // 90 degrees y-axis
+        Assert.assertEquals(1.0f, quat.magnitude(), FloatUtil.EPSILON);
+
+        final float[] v2 = quat.rotateVector(new float[3], 0, UNIT_X, 0);
+        Assert.assertEquals(0f, Math.abs(VectorUtil.distVec3(NEG_UNIT_Z, v2)), FloatUtil.EPSILON);
+
+        quat.setFromEuler(0, 0, -FloatUtil.HALF_PI);
+        Assert.assertEquals(1.0f, quat.magnitude(), FloatUtil.EPSILON);
+        quat.rotateVector(v2, 0, UNIT_X, 0);
+        Assert.assertEquals(0f, Math.abs(VectorUtil.distVec3(NEG_UNIT_Y, v2)), FloatUtil.EPSILON);
+
+        quat.setFromEuler(FloatUtil.HALF_PI, 0, 0);
+        Assert.assertEquals(1.0f, quat.magnitude(), FloatUtil.EPSILON);
+        quat.rotateVector(v2, 0, UNIT_Y, 0);
+        Assert.assertEquals(0f, Math.abs(VectorUtil.distVec3(UNIT_Z, v2)), FloatUtil.EPSILON);
+    }
+
+    @Test
+    public void test14Matrix() {
+        final float[] vecHas = new float[3];
+        final float[] vecOut2 = new float[4];
+        float[] mat1 = new float[4*4];
+        final float[] mat2 = new float[4*4];
+        final Quaternion quat = new Quaternion();
+
+        //
+        // IDENTITY CHECK
+        //
+        FloatUtil.makeIdentity(mat1);
+        quat.set(0, 0, 0, 0);
+        quat.toMatrix(mat2, 0);
+        Assert.assertArrayEquals(mat1, mat2, FloatUtil.EPSILON);
+
+        //
+        // 90 degrees rotation on X
+        //
+
+        float a = FloatUtil.HALF_PI;
+        mat1 = new float[] { // Column Order
+                1,  0,                 0,                0, //
+                0,  FloatUtil.cos(a),  FloatUtil.sin(a), 0, //
+                0, -FloatUtil.sin(a),  FloatUtil.cos(a), 0,
+                0,  0,                 0,                1  };
+        {
+            // Validate Matrix via Euler rotation on Quaternion!
+            quat.setFromEuler(a, 0f, 0f);
+            quat.toMatrix(mat2, 0);
+            // System.err.println(FloatUtil.matrixToString(null, "quat-rot", "%10.5f", mat1, 0, mat2, 0, 4, 4, false).toString());
+            Assert.assertArrayEquals(mat1, mat2, FloatUtil.EPSILON);
+            quat.rotateVector(vecHas, 0, UNIT_Y, 0);
+            // System.err.println("exp0 "+Arrays.toString(NEG_UNIT_X));
+            // System.err.println("has0 "+Arrays.toString(vecHas));
+            Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(UNIT_Z, vecHas) ), Quaternion.ALLOWED_DEVIANCE );
+        }
+        quat.setFromMatrix(mat1, 0);
+        quat.rotateVector(vecHas, 0, UNIT_Y, 0);
+        // System.err.println("exp0 "+Arrays.toString(UNIT_Z));
+        // System.err.println("has0 "+Arrays.toString(vecHas));
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(UNIT_Z, vecHas) ), Quaternion.ALLOWED_DEVIANCE );
+
+        quat.toMatrix(mat2, 0);
+        // System.err.println(FloatUtil.matrixToString(null, null, "%10.5f", mat1, 0, mat2, 0, 4, 4, false).toString());
+        Assert.assertArrayEquals(mat1, mat2, FloatUtil.EPSILON);
+
+        quat.rotateVector(vecHas, 0, NEG_ONE, 0);
+        FloatUtil.multMatrixVec(mat2, NEG_ONE_v4, vecOut2);
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(vecHas, vecOut2) ), Quaternion.ALLOWED_DEVIANCE );
+
+        //
+        // 180 degrees rotation on X
+        //
+        a = FloatUtil.PI;
+        mat1 = new float[] { // Column Order
+                1,  0,                 0,                0, //
+                0,   FloatUtil.cos(a), FloatUtil.sin(a), 0, //
+                0,  -FloatUtil.sin(a), FloatUtil.cos(a), 0,
+                0,  0,                 0,                1 };
+        {
+            // Validate Matrix via Euler rotation on Quaternion!
+            quat.setFromEuler(a, 0f, 0f);
+            quat.toMatrix(mat2, 0);
+            // System.err.println(FloatUtil.matrixToString(null, "quat-rot", "%10.5f", mat1, 0, mat2, 0, 4, 4, false).toString());
+            Assert.assertArrayEquals(mat1, mat2, FloatUtil.EPSILON);
+            quat.rotateVector(vecHas, 0, UNIT_Y, 0);
+            // System.err.println("exp0 "+Arrays.toString(NEG_UNIT_X));
+            // System.err.println("has0 "+Arrays.toString(vecHas));
+            Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(NEG_UNIT_Y, vecHas) ), Quaternion.ALLOWED_DEVIANCE );
+        }
+        quat.setFromMatrix(mat1, 0);
+        quat.rotateVector(vecHas, 0, UNIT_Y, 0);
+        // System.err.println("exp0 "+Arrays.toString(NEG_UNIT_Y));
+        // System.err.println("has0 "+Arrays.toString(vecHas));
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(NEG_UNIT_Y, vecHas) ), Quaternion.ALLOWED_DEVIANCE );
+
+        quat.toMatrix(mat2, 0);
+        // System.err.println(FloatUtil.matrixToString(null, null, "%10.5f", mat1, 0, mat2, 0, 4, 4, false).toString());
+        Assert.assertArrayEquals(mat1, mat2, FloatUtil.EPSILON);
+
+        quat.rotateVector(vecHas, 0, ONE, 0);
+        FloatUtil.multMatrixVec(mat2, ONE_v4, vecOut2);
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(vecHas, vecOut2) ), Quaternion.ALLOWED_DEVIANCE );
+
+        //
+        // 180 degrees rotation on Y
+        //
+        a = FloatUtil.PI;
+        mat1 = new float[] { // Column Order
+                 FloatUtil.cos(a), 0,  -FloatUtil.sin(a), 0, //
+                 0,                1,   0,                0, //
+                 FloatUtil.sin(a), 0,   FloatUtil.cos(a), 0,
+                 0,                0,   0,                1 };
+        {
+            // Validate Matrix via Euler rotation on Quaternion!
+            quat.setFromEuler(0f, a, 0f);
+            quat.toMatrix(mat2, 0);
+            // System.err.println(FloatUtil.matrixToString(null, "quat-rot", "%10.5f", mat1, 0, mat2, 0, 4, 4, false).toString());
+            Assert.assertArrayEquals(mat1, mat2, FloatUtil.EPSILON);
+            quat.rotateVector(vecHas, 0, UNIT_X, 0);
+            // System.err.println("exp0 "+Arrays.toString(NEG_UNIT_X));
+            // System.err.println("has0 "+Arrays.toString(vecHas));
+            Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(NEG_UNIT_X, vecHas) ), Quaternion.ALLOWED_DEVIANCE );
+        }
+        quat.setFromMatrix(mat1, 0);
+        quat.rotateVector(vecHas, 0, UNIT_X, 0);
+        // System.err.println("exp0 "+Arrays.toString(NEG_UNIT_X));
+        // System.err.println("has0 "+Arrays.toString(vecHas));
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(NEG_UNIT_X, vecHas) ), Quaternion.ALLOWED_DEVIANCE );
+
+        quat.toMatrix(mat2, 0);
+        // System.err.println(FloatUtil.matrixToString(null, "matr-rot", "%10.5f", mat1, 0, mat2, 0, 4, 4, false).toString());
+        Assert.assertArrayEquals(mat1, mat2, FloatUtil.EPSILON);
+
+        quat.rotateVector(vecHas, 0, NEG_ONE, 0);
+        FloatUtil.multMatrixVec(mat2, NEG_ONE_v4, vecOut2);
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(vecHas, vecOut2) ), Quaternion.ALLOWED_DEVIANCE );
+
+        //
+        // 180 degrees rotation on Z
+        //
+        a = FloatUtil.PI;
+        mat1 = new float[] { // Column Order
+                  FloatUtil.cos(a), FloatUtil.sin(a), 0, 0, //
+                 -FloatUtil.sin(a), FloatUtil.cos(a), 0, 0,
+                  0,                0,                1, 0,
+                  0,                0,                0, 1 };
+        {
+            // Validate Matrix via Euler rotation on Quaternion!
+            quat.setFromEuler(0f, 0f, a);
+            quat.toMatrix(mat2, 0);
+            // System.err.println(FloatUtil.matrixToString(null, "quat-rot", "%10.5f", mat1, 0, mat2, 0, 4, 4, false).toString());
+            Assert.assertArrayEquals(mat1, mat2, FloatUtil.EPSILON);
+            quat.rotateVector(vecHas, 0, UNIT_X, 0);
+            // System.err.println("exp0 "+Arrays.toString(NEG_UNIT_X));
+            // System.err.println("has0 "+Arrays.toString(vecHas));
+            Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(NEG_UNIT_X, vecHas) ), Quaternion.ALLOWED_DEVIANCE );
+        }
+        quat.setFromMatrix(mat1, 0);
+        quat.rotateVector(vecHas, 0, UNIT_X, 0);
+        // System.err.println("exp0 "+Arrays.toString(NEG_UNIT_X));
+        // System.err.println("has0 "+Arrays.toString(vecHas));
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(NEG_UNIT_X, vecHas) ), Quaternion.ALLOWED_DEVIANCE );
+
+        quat.toMatrix(mat2, 0);
+        // System.err.println(FloatUtil.matrixToString(null, "matr-rot", "%10.5f", mat1, 0, mat2, 0, 4, 4, false).toString());
+        Assert.assertArrayEquals(mat1, mat2, FloatUtil.EPSILON);
+
+        quat.rotateVector(vecHas, 0, ONE, 0);
+        FloatUtil.multMatrixVec(mat2, ONE_v4, vecOut2);
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(vecHas, vecOut2) ), Quaternion.ALLOWED_DEVIANCE );
+
+        //
+        // Test Matrix-Columns
+        //
+
+        a = FloatUtil.QUARTER_PI;
+        final float[] vecExp = new float[3];
+        final float[] vecCol = new float[3];
+        mat1 = new float[] { // Column Order
+                  FloatUtil.cos(a), FloatUtil.sin(a), 0, 0, //
+                 -FloatUtil.sin(a), FloatUtil.cos(a), 0, 0,
+                  0,                0,                1, 0,
+                  0,                0,                0, 1 };
+        quat.setFromMatrix(mat1, 0);
+        FloatUtil.copyMatrixColumn(mat1, 0, 0, vecExp, 0);
+        quat.copyMatrixColumn(0, vecCol, 0);
+        // System.err.println("exp0 "+Arrays.toString(vecExp));
+        // System.err.println("has0 "+Arrays.toString(vecCol));
+        Assert.assertEquals(0f, Math.abs( VectorUtil.distVec3(vecExp, vecCol)), FloatUtil.EPSILON);
+
+        FloatUtil.copyMatrixColumn(mat1, 0, 1, vecExp, 0);
+        quat.copyMatrixColumn(1, vecCol, 0);
+        // System.err.println("exp1 "+Arrays.toString(vecExp));
+        // System.err.println("has1 "+Arrays.toString(vecCol));
+        Assert.assertEquals(0f, Math.abs( VectorUtil.distVec3(vecExp, vecCol)), FloatUtil.EPSILON);
+
+        FloatUtil.copyMatrixColumn(mat1, 0, 2, vecExp, 0);
+        quat.copyMatrixColumn(2, vecCol, 0);
+        // System.err.println("exp2 "+Arrays.toString(vecExp));
+        // System.err.println("has2 "+Arrays.toString(vecCol));
+        Assert.assertEquals(0f, Math.abs( VectorUtil.distVec3(vecExp, vecCol)), FloatUtil.EPSILON);
+
+        quat.set(0f, 0f, 0f, 0f);
+        Assert.assertArrayEquals(UNIT_X, quat.copyMatrixColumn(0, vecCol, 0), FloatUtil.EPSILON);
+
+    }
+
+    @Test
+    public void test15aAxesAndMatrix() {
+        final float[] eulerExp = new float[] { 0f, FloatUtil.HALF_PI, 0f };
+        final float[] matExp = new float[4*4];
+        FloatUtil.makeRotationEuler(matExp, 0, eulerExp[0], eulerExp[1], eulerExp[2]); // 45 degr on X, 90 degr on Y
+
+        final float[] matHas = new float[4*4];
+        final Quaternion quat1 = new Quaternion();
+        quat1.setFromEuler(eulerExp);
+        quat1.toMatrix(matHas, 0);
+        // System.err.println(FloatUtil.matrixToString(null, "exp-has", "%10.5f", matExp, 0, matHas, 0, 4, 4, false).toString());
+        Assert.assertArrayEquals(matExp, matHas, FloatUtil.EPSILON);
+
+        final float[] eulerHas = new float[3];
+        final Quaternion quat2 = new Quaternion();
+        quat2.setFromMatrix(matExp, 0);
+        quat2.toEuler(eulerHas);
+        // System.err.println("exp-euler "+Arrays.toString(eulerExp));
+        // System.err.println("has-euler "+Arrays.toString(eulerHas));
+        Assert.assertArrayEquals(eulerExp, eulerHas, FloatUtil.EPSILON);
+
+        Assert.assertEquals(quat2, quat1);
+
+        final float[] angles = new float[3];
+        quat2.toEuler(angles);
+        quat1.setFromEuler(angles);
+        Assert.assertEquals(quat2, quat1);
+    }
+
+    @Test
+    public void test15bAxesAndMatrix() {
+        final float[] eulerExp = new float[] { FloatUtil.HALF_PI, 0f, 0f };
+        final float[] matExp = new float[4*4];
+        FloatUtil.makeRotationEuler(matExp, 0, eulerExp[0], eulerExp[1], eulerExp[2]); // 45 degr on X, 90 degr on Y
+
+        final float[] matHas = new float[4*4];
+        final Quaternion quat1 = new Quaternion();
+        quat1.setFromEuler(eulerExp);
+        quat1.toMatrix(matHas, 0);
+        // System.err.println(FloatUtil.matrixToString(null, "exp-has", "%10.5f", matExp, 0, matHas, 0, 4, 4, false).toString());
+        Assert.assertArrayEquals(matExp, matHas, FloatUtil.EPSILON);
+
+        final float[] eulerHas = new float[3];
+        final Quaternion quat2 = new Quaternion();
+        quat2.setFromMatrix(matExp, 0);
+        quat2.toEuler(eulerHas);
+        // System.err.println("exp-euler "+Arrays.toString(eulerExp));
+        // System.err.println("has-euler "+Arrays.toString(eulerHas));
+        Assert.assertArrayEquals(eulerExp, eulerHas, FloatUtil.EPSILON);
+
+        Assert.assertEquals(quat2, quat1);
+
+        final float[] angles = new float[3];
+        quat2.toEuler(angles);
+        quat1.setFromEuler(angles);
+        Assert.assertEquals(quat2, quat1);
+    }
+
+    @Test
+    public void test15cAxesAndMatrix() {
+        final float[] eulerExp = new float[] { FloatUtil.QUARTER_PI, FloatUtil.HALF_PI, 0f };
+        final float[] matExp = new float[4*4];
+        FloatUtil.makeRotationEuler(matExp, 0, eulerExp[0], eulerExp[1], eulerExp[2]); // 45 degr on X, 90 degr on Y
+
+        final float[] matHas = new float[4*4];
+        final Quaternion quat1 = new Quaternion();
+        quat1.setFromEuler(eulerExp);
+        quat1.toMatrix(matHas, 0);
+        // System.err.println(FloatUtil.matrixToString(null, "exp-has", "%10.5f", matExp, 0, matHas, 0, 4, 4, false).toString());
+        Assert.assertArrayEquals(matExp, matHas, FloatUtil.EPSILON);
+
+        final float[] eulerHas = new float[3];
+        final Quaternion quat2 = new Quaternion();
+        quat2.setFromMatrix(matExp, 0);
+        quat2.toEuler(eulerHas);
+        // System.err.println("exp-euler "+Arrays.toString(eulerExp));
+        // System.err.println("has-euler "+Arrays.toString(eulerHas));
+        Assert.assertArrayEquals(eulerExp, eulerHas, FloatUtil.EPSILON);
+
+        Assert.assertEquals(quat2, quat1);
+
+        final float[] angles = new float[3];
+        quat2.toEuler(angles);
+        quat1.setFromEuler(angles);
+        Assert.assertEquals(quat2, quat1);
+    }
+
+    //
+    // Functions
+    //
+
+    @Test
+    public void test20AddSubtract() {
+        final Quaternion quatExp1 = new Quaternion(1, 2, 3, 4);
+        final Quaternion quat1    = new Quaternion(0, 1, 2, 3);
+        final Quaternion quat2    = new Quaternion(1, 1, 1, 1);
+
+        final Quaternion quatHas  = new Quaternion();
+        quatHas.set(quat1);
+        quatHas.add(quat2); // q3 = q1 + q2
+        Assert.assertEquals(quatExp1, quatHas);
+
+        quat1.set(0, 1, 2, 3);
+        quat2.set(1, 1, 1, 1);
+        quatHas.set(quat1);
+        quatHas.subtract(quat2); // q3 = q1 - q2
+        Assert.assertEquals(new Quaternion(-1, 0, 1, 2), quatHas);
+    }
+
+    @Test
+    public void test21Multiply() {
+        final Quaternion quat1 = new Quaternion(0.5f, 1f, 2f, 3f);
+        final Quaternion quat2 = new Quaternion();
+
+        quat2.set(quat1);
+        quat2.scale(2f); // q2 = q1 * 2f
+        Assert.assertEquals(new Quaternion(1, 2, 4, 6), quat2);
+
+        quat2.set(quat1);
+        quat2.scale(4f); // q2 = q1 * 4f
+        Assert.assertEquals(new Quaternion(2, 4, 8, 12), quat2);
+
+        //
+        // mul and cmp rotated vector
+        //
+        quat1.setFromAngleNormalAxis(FloatUtil.QUARTER_PI, UNIT_Y); // 45 degr on Y
+        quat2.set(quat1);
+        quat2.mult(quat1); // q2 = q1 * q1 -> 2 * 45 degr -> 90 degr on Y
+
+        final float[] vecOut = new float[3];
+        quat2.rotateVector(vecOut, 0, UNIT_Z, 0);
+        Assert.assertTrue( Math.abs( VectorUtil.distVec3(UNIT_X, vecOut)) <= Quaternion.ALLOWED_DEVIANCE);
+
+        quat2.setFromAngleNormalAxis(FloatUtil.HALF_PI, UNIT_Y); // 90 degr on Y
+        quat1.mult(quat1); // q1 = q1 * q1 -> 2 * 45 degr ->  90 degr on Y
+        quat1.mult(quat2); // q1 = q1 * q2 -> 2 * 90 degr -> 180 degr on Y
+        quat1.rotateVector(vecOut, 0, UNIT_Z, 0);
+        Assert.assertTrue( Math.abs( VectorUtil.distVec3(NEG_UNIT_Z, vecOut)) <= Quaternion.ALLOWED_DEVIANCE);
+
+        quat2.setFromEuler(0f, FloatUtil.HALF_PI, 0f);
+        quat1.mult(quat2); // q1 = q1 * q2 = q1 * rotMat(0, 90degr, 0)
+        quat1.rotateVector(vecOut, 0, UNIT_Z, 0);
+        Assert.assertTrue( Math.abs( VectorUtil.distVec3(NEG_UNIT_X, vecOut)) <= Quaternion.ALLOWED_DEVIANCE);
+    }
+
+    @Test
+    public void test22InvertMultNormalAndConj() {
+        final Quaternion quat0 = new Quaternion(0, 1, 2, 3);
+        final Quaternion quat1 = new Quaternion(quat0);
+        final Quaternion quat2 = new Quaternion(quat0);
+        quat1.invert();    // q1 = invert(q0)
+        quat2.mult(quat1); // q2 = q0 * q1 = q0 * invert(q0)
+        Assert.assertEquals(QUAT_IDENT, quat2);
+        quat1.invert();
+        Assert.assertEquals(quat0, quat1);
+
+        // normalized version
+        quat0.setFromAngleNormalAxis(FloatUtil.QUARTER_PI, UNIT_Y);
+        quat1.set(quat0);
+        quat1.invert(); // q1 = invert(q0)
+        quat2.set(quat0);
+        quat2.mult(quat1); // q2 = q0 * q1 = q0 * invert(q0)
+        Assert.assertEquals(QUAT_IDENT, quat2);
+        quat1.invert();
+        Assert.assertEquals(quat0, quat1);
+
+        // conjugate check
+        quat0.set(-1f, -2f, -3f, 4f);
+        quat1.set( 1f,  2f,  3f, 4f);
+        quat2.set(quat1);
+        quat2.conjugate();
+        Assert.assertEquals(quat0, quat2);
+    }
+
+    @Test
+    public void test23RotationOrder() {
+        {
+            final Quaternion quat1 = new Quaternion().setFromEuler( -2f*FloatUtil.HALF_PI, 0f, 0f); // -180 degr X
+            final Quaternion quat2 = new Quaternion().rotateByAngleX( -2f * FloatUtil.HALF_PI); // angle: -180 degrees, axis X
+            Assert.assertEquals(quat1, quat2);
+        }
+        {
+            final Quaternion quat1 = new Quaternion().setFromEuler(    FloatUtil.HALF_PI, 0f, 0f); //   90 degr X
+            final Quaternion quat2 = new Quaternion().rotateByAngleX(       FloatUtil.HALF_PI); // angle:   90 degrees, axis X
+            Assert.assertEquals(quat1, quat2);
+        }
+        {
+            final Quaternion quat1 = new Quaternion().setFromEuler( FloatUtil.HALF_PI, FloatUtil.QUARTER_PI, 0f);
+            final Quaternion quat2 = new Quaternion().rotateByAngleY(FloatUtil.QUARTER_PI).rotateByAngleX(FloatUtil.HALF_PI);
+            Assert.assertEquals(quat1, quat2);
+        }
+        {
+            final Quaternion quat1 = new Quaternion().setFromEuler( FloatUtil.PI, FloatUtil.QUARTER_PI, FloatUtil.HALF_PI);
+            final Quaternion quat2 = new Quaternion().rotateByAngleY(FloatUtil.QUARTER_PI).rotateByAngleZ(FloatUtil.HALF_PI).rotateByAngleX(FloatUtil.PI);
+            Assert.assertEquals(quat1, quat2);
+        }
+
+
+        float[] vecExp = new float[3];
+        float[] vecRot = new float[3];
+        final Quaternion quat = new Quaternion();
+
+        // Try a new way with new angles...
+        quat.setFromEuler(FloatUtil.HALF_PI, FloatUtil.QUARTER_PI, FloatUtil.PI);
+        vecRot = new float[] { 1f, 1f, 1f };
+        quat.rotateVector(vecRot, 0, vecRot, 0);
+
+        // expected
+        vecExp = new float[] { 1f, 1f, 1f };
+        final Quaternion worker = new Quaternion();
+        // put together matrix, then apply to vector, so YZX
+        worker.rotateByAngleY(FloatUtil.QUARTER_PI).rotateByAngleZ(FloatUtil.PI).rotateByAngleX(FloatUtil.HALF_PI);
+        quat.rotateVector(vecExp, 0, vecExp, 0);
+        Assert.assertEquals(0f, VectorUtil.distVec3(vecExp, vecRot), FloatUtil.EPSILON);
+
+        // test axis rotation methods against general purpose
+        // X AXIS
+        vecExp = new float[] { 1f, 1f, 1f };
+        vecRot = new float[] { 1f, 1f, 1f };
+        worker.setIdentity().rotateByAngleX(FloatUtil.QUARTER_PI).rotateVector(vecExp, 0, vecExp, 0);
+        worker.setIdentity().rotateByAngleNormalAxis(FloatUtil.QUARTER_PI, 1f, 0f, 0f).rotateVector(vecRot, 0, vecRot, 0);
+        // System.err.println("exp0 "+Arrays.toString(vecExp)+", len "+VectorUtil.length(vecExp));
+        // System.err.println("has0 "+Arrays.toString(vecRot)+", len "+VectorUtil.length(vecRot));
+        Assert.assertEquals(0f, VectorUtil.distVec3(vecExp, vecRot), FloatUtil.EPSILON);
+
+        // Y AXIS
+        vecExp = new float[] { 1f, 1f, 1f };
+        vecRot = new float[] { 1f, 1f, 1f };
+        worker.setIdentity().rotateByAngleY(FloatUtil.QUARTER_PI).rotateVector(vecExp, 0, vecExp, 0);
+        worker.setIdentity().rotateByAngleNormalAxis(FloatUtil.QUARTER_PI, 0f, 1f, 0f).rotateVector(vecRot, 0, vecRot, 0);
+        // System.err.println("exp0 "+Arrays.toString(vecExp));
+        // System.err.println("has0 "+Arrays.toString(vecRot));
+        Assert.assertEquals(0f, VectorUtil.distVec3(vecExp, vecRot), FloatUtil.EPSILON);
+
+        // Z AXIS
+        vecExp = new float[] { 1f, 1f, 1f };
+        vecRot = new float[] { 1f, 1f, 1f };
+        worker.setIdentity().rotateByAngleZ(FloatUtil.QUARTER_PI).rotateVector(vecExp, 0, vecExp, 0);
+        worker.setIdentity().rotateByAngleNormalAxis(FloatUtil.QUARTER_PI, 0f, 0f, 1f).rotateVector(vecRot, 0, vecRot, 0);
+        // System.err.println("exp0 "+Arrays.toString(vecExp));
+        // System.err.println("has0 "+Arrays.toString(vecRot));
+        Assert.assertEquals(0f, VectorUtil.distVec3(vecExp, vecRot), FloatUtil.EPSILON);
+
+        quat.set(worker);
+        worker.rotateByAngleNormalAxis(0f, 0f, 0f, 0f);
+        Assert.assertEquals(quat, worker);
+    }
+
+    @Test
+    public void test24Axes() {
+        final Quaternion quat0 = new Quaternion().rotateByAngleX(FloatUtil.QUARTER_PI).rotateByAngleY(FloatUtil.HALF_PI);
+        final float[] rotMat = new float[4*4];
+        quat0.toMatrix(rotMat, 0);
+        final float[] xAxis = new float[3];
+        final float[] yAxis = new float[3];
+        final float[] zAxis = new float[3];
+        FloatUtil.copyMatrixColumn(rotMat, 0, 0, xAxis, 0);
+        FloatUtil.copyMatrixColumn(rotMat, 0, 1, yAxis, 0);
+        FloatUtil.copyMatrixColumn(rotMat, 0, 2, zAxis, 0);
+
+        final Quaternion quat1 = new Quaternion().setFromAxes(xAxis, yAxis, zAxis);
+        Assert.assertEquals(quat0, quat1);
+        final Quaternion quat2 = new Quaternion().setFromMatrix(rotMat, 0);
+        Assert.assertEquals(quat2, quat1);
+
+        quat1.toAxes(xAxis, yAxis, zAxis, rotMat);
+        quat2.setFromAxes(xAxis, yAxis, zAxis);
+        Assert.assertEquals(quat0, quat2);
+        Assert.assertEquals(quat1, quat2);
+    }
+
+    @Test
+    public void test25Slerp() {
+        final Quaternion quat1 = new Quaternion();     // angle: 0 degrees
+        final Quaternion quat2 = new Quaternion().rotateByAngleY(FloatUtil.HALF_PI); // angle: 90 degrees, axis Y
+
+        float[] vecExp = new float[] { FloatUtil.sin(FloatUtil.QUARTER_PI), 0f, FloatUtil.sin(FloatUtil.QUARTER_PI) };
+        final float[] vecHas = new float[3];
+        final Quaternion quatS = new Quaternion();
+        // System.err.println("Slerp #01: 1/2 * 90 degrees Y");
+        quatS.setSlerp(quat1, quat2, 0.5f);
+        quatS.rotateVector(vecHas, 0, UNIT_Z, 0);
+        // System.err.println("exp0 "+Arrays.toString(vecExp));
+        // System.err.println("has0 "+Arrays.toString(vecHas));
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(vecExp, vecHas)), Quaternion.ALLOWED_DEVIANCE);
+
+        // delta == 100%
+        quat2.setIdentity().rotateByAngleZ(FloatUtil.PI); // angle: 180 degrees, axis Z
+        // System.err.println("Slerp #02: 1 * 180 degrees Z");
+        quatS.setSlerp(quat1, quat2, 1.0f);
+        quatS.rotateVector(vecHas, 0, UNIT_X, 0);
+        // System.err.println("exp0 "+Arrays.toString(NEG_UNIT_X));
+        // System.err.println("has0 "+Arrays.toString(vecHas));
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(NEG_UNIT_X, vecHas)), Quaternion.ALLOWED_DEVIANCE);
+
+        quat2.setIdentity().rotateByAngleZ(FloatUtil.PI); // angle: 180 degrees, axis Z
+        // System.err.println("Slerp #03: 1/2 * 180 degrees Z");
+        quatS.setSlerp(quat1, quat2, 0.5f);
+        quatS.rotateVector(vecHas, 0, UNIT_X, 0);
+        // System.err.println("exp0 "+Arrays.toString(UNIT_Y));
+        // System.err.println("has0 "+Arrays.toString(vecHas));
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(UNIT_Y, vecHas)), Quaternion.ALLOWED_DEVIANCE);
+
+        // delta == 0%
+        quat2.setIdentity().rotateByAngleZ(FloatUtil.PI); // angle: 180 degrees, axis Z
+        // System.err.println("Slerp #04: 0 * 180 degrees Z");
+        quatS.setSlerp(quat1, quat2, 0.0f);
+        quatS.rotateVector(vecHas, 0, UNIT_X, 0);
+        // System.err.println("exp0 "+Arrays.toString(UNIT_X));
+        // System.err.println("has0 "+Arrays.toString(vecHas));
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(UNIT_X, vecHas)), Quaternion.ALLOWED_DEVIANCE);
+
+        // a==b
+        quat2.setIdentity();
+        // System.err.println("Slerp #05: 1/4 * 0 degrees");
+        quatS.setSlerp(quat1, quat2, 0.25f); // 1/4 of identity .. NOP
+        quatS.rotateVector(vecHas, 0, UNIT_X, 0);
+        // System.err.println("exp0 "+Arrays.toString(UNIT_X));
+        // System.err.println("has0 "+Arrays.toString(vecHas));
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(UNIT_X, vecHas)), Quaternion.ALLOWED_DEVIANCE);
+
+        // negative dot product
+        vecExp = new float[] { 0f, -FloatUtil.sin(FloatUtil.QUARTER_PI), FloatUtil.sin(FloatUtil.QUARTER_PI) };
+        quat1.setIdentity().rotateByAngleX( -2f * FloatUtil.HALF_PI); // angle: -180 degrees, axis X
+        quat2.setIdentity().rotateByAngleX(       FloatUtil.HALF_PI); // angle:   90 degrees, axis X
+        // System.err.println("Slerp #06: 1/2 * 270 degrees");
+        quatS.setSlerp(quat1, quat2, 0.5f);
+        quatS.rotateVector(vecHas, 0, UNIT_Y, 0);
+        // System.err.println("exp0 "+Arrays.toString(vecExp));
+        // System.err.println("has0 "+Arrays.toString(vecHas));
+        Assert.assertEquals( 0f, Math.abs( VectorUtil.distVec3(vecExp, vecHas)), Quaternion.ALLOWED_DEVIANCE);
+
+
+    }
+
+    @Test
+    public void test26LookAt() {
+        final float[] direction = new float[3];
+        final float[] xAxis = new float[3];
+        final float[] yAxis = new float[3];
+        final float[] zAxis = new float[3];
+        final float[] vecHas = new float[3];
+
+        if( DEBUG ) System.err.println("LookAt #01");
+        VectorUtil.copyVec3(direction, 0, NEG_UNIT_X, 0);
+        final Quaternion quat = new Quaternion().setLookAt(direction, UNIT_Y, xAxis, yAxis, zAxis);
+        Assert.assertEquals(0f, VectorUtil.distVec3(direction, quat.rotateVector(vecHas, 0, UNIT_Z, 0)), Quaternion.ALLOWED_DEVIANCE);
+
+        if( DEBUG ) System.err.println("LookAt #02");
+        VectorUtil.normalizeVec3(VectorUtil.copyVec3(direction, 0, ONE, 0));
+        quat.setLookAt(direction, UNIT_Y, xAxis, yAxis, zAxis);
+        if( DEBUG )System.err.println("quat0 "+quat);
+        quat.rotateVector(vecHas, 0, UNIT_Z, 0);
+        if( DEBUG ) {
+            System.err.println("xAxis "+Arrays.toString(xAxis)+", len "+VectorUtil.normVec3(xAxis));
+            System.err.println("yAxis "+Arrays.toString(yAxis)+", len "+VectorUtil.normVec3(yAxis));
+            System.err.println("zAxis "+Arrays.toString(zAxis)+", len "+VectorUtil.normVec3(zAxis));
+            System.err.println("exp0 "+Arrays.toString(direction)+", len "+VectorUtil.normVec3(direction));
+            System.err.println("has0 "+Arrays.toString(vecHas)+", len "+VectorUtil.normVec3(vecHas));
+        }
+        // Assert.assertEquals(0f, VectorUtil.distance(direction, quat.rotateVector(vecHas, 0, UNIT_Z, 0)), Quaternion.ALLOWED_DEVIANCE);
+        Assert.assertEquals(0f, VectorUtil.distVec3(direction, vecHas), Quaternion.ALLOWED_DEVIANCE);
+
+        if( DEBUG )System.err.println("LookAt #03");
+        VectorUtil.normalizeVec3(VectorUtil.copyVec3(direction, 0, new float[] { -1f, 2f, -1f }, 0));
+        quat.setLookAt(direction, UNIT_Y, xAxis, yAxis, zAxis);
+        if( DEBUG )System.err.println("quat0 "+quat);
+        quat.rotateVector(vecHas, 0, UNIT_Z, 0);
+        if( DEBUG ) {
+            System.err.println("xAxis "+Arrays.toString(xAxis)+", len "+VectorUtil.normVec3(xAxis));
+            System.err.println("yAxis "+Arrays.toString(yAxis)+", len "+VectorUtil.normVec3(yAxis));
+            System.err.println("zAxis "+Arrays.toString(zAxis)+", len "+VectorUtil.normVec3(zAxis));
+            System.err.println("exp0 "+Arrays.toString(direction)+", len "+VectorUtil.normVec3(direction));
+            System.err.println("has0 "+Arrays.toString(vecHas)+", len "+VectorUtil.normVec3(vecHas));
+        }
+        // Assert.assertEquals(0f, VectorUtil.distance(direction, quat.rotateVector(vecHas, 0, UNIT_Z, 0)), Quaternion.ALLOWED_DEVIANCE);
+        Assert.assertEquals(0f, VectorUtil.distVec3(direction, vecHas), Quaternion.ALLOWED_DEVIANCE);
+    }
+
+    public static void main(final String args[]) {
+        org.junit.runner.JUnitCore.main(TestQuaternion01NOUI.class.getName());
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java b/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
index 2f5fb26..883bf43 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/newt/TestSwingAWTRobotUsageBeforeJOGLInitBug411.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,27 +20,27 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.newt;
 
 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
-
 import com.jogamp.opengl.test.junit.util.*;
 
 import java.lang.reflect.InvocationTargetException;
 
 import javax.media.nativewindow.NativeWindowFactory;
+import javax.media.nativewindow.util.RectangleImmutable;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLProfile;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.awt.GLCanvas;
-import com.jogamp.opengl.util.Animator;
 
+import com.jogamp.opengl.util.Animator;
 import com.jogamp.newt.Screen;
 import com.jogamp.newt.opengl.GLWindow;
 import com.jogamp.newt.awt.NewtCanvasAWT;
@@ -57,6 +57,7 @@ import java.awt.event.MouseAdapter;
 import java.awt.event.MouseEvent;
 import java.awt.event.WindowAdapter;
 import java.awt.event.WindowEvent;
+
 import javax.media.opengl.GLEventListener;
 import javax.swing.JButton;
 import javax.swing.JFrame;
@@ -84,7 +85,7 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
 
     boolean modLightBrighter = true;
 
-    Color modLight(Color c) {
+    Color modLight(final Color c) {
         Color c2;
         if(modLightBrighter) {
             c2 = c.brighter();
@@ -98,18 +99,18 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
     }
 
     class SwingGLAction implements GLEventListener {
-        public void init(GLAutoDrawable glad) {
+        public void init(final GLAutoDrawable glad) {
         }
 
-        public void dispose(GLAutoDrawable glad) {
+        public void dispose(final GLAutoDrawable glad) {
         }
 
-        public void display(GLAutoDrawable glad) {
+        public void display(final GLAutoDrawable glad) {
             colorPanel.setBackground(modLight(colorPanel.getBackground()));
             colorPanel.repaint();
         }
 
-        public void reshape(GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
+        public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
         }
     }
 
@@ -126,21 +127,21 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
 
         button = new JButton("Click me");
         button.addMouseListener(new MouseAdapter() {
-            public void mouseClicked(MouseEvent e) {
+            public void mouseClicked(final MouseEvent e) {
                 System.err.println("Test: "+e);
             }
         });
         panel.add(button, BorderLayout.NORTH);
 
         colorPanel = new JPanel();
-        Dimension size = new Dimension(400,100);
+        final Dimension size = new Dimension(400,100);
         colorPanel.setPreferredSize(size);
         colorPanel.setBorder(border);
         panel.add(colorPanel, BorderLayout.SOUTH);
 
         frame = new JFrame("PRE JOGL");
         frame.addWindowListener( new WindowAdapter() {
-            public void windowClosing(WindowEvent ev) {
+            public void windowClosing(final WindowEvent ev) {
                 windowClosing=true;
             }
         });
@@ -158,7 +159,7 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
                 colorPanel.setBackground(Color.white);
                 colorPanel.repaint();
             }});
-        
+
         robot = new Robot();
         robot.setAutoWaitForIdle(true);
 
@@ -167,12 +168,12 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
             Thread.sleep(AWTRobotUtil.TIME_SLICE);
         }
         Assert.assertEquals(true,  frame.isVisible());
-        
+
         System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.setup(): Before NativeWindow init");
-        
+
         NativeWindowFactory.initSingleton();
-        
-        AWTRobotUtil.clearAWTFocus(robot);        
+
+        AWTRobotUtil.clearAWTFocus(robot);
         AWTRobotUtil.toFrontAndRequestFocus(robot, frame);
         AWTRobotUtil.requestFocus(robot, button);
 
@@ -198,10 +199,10 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
         System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.release(): End");
     }
 
-    protected void runTestGL(final Canvas canvas, GLAutoDrawable drawable) 
+    protected void runTestGL(final Canvas canvas, final GLAutoDrawable drawable)
         throws AWTException, InterruptedException, InvocationTargetException {
 
-        Dimension size = new Dimension(400,400);
+        final Dimension size = new Dimension(400,400);
         canvas.setPreferredSize(size);
 
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -231,7 +232,7 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
         colorPanel.setBackground(Color.blue);
         drawable.addGLEventListener(new SwingGLAction());
 
-        Point p0 = canvas.getLocationOnScreen();
+        final Point p0 = canvas.getLocationOnScreen();
         p0.translate(10,10);
         robot.mouseMove( (int) ( p0.getX() + .5 ) ,
                          (int) ( p0.getY() + .5 ) );
@@ -261,35 +262,36 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
     public void test01NewtCanvasAWT() throws AWTException, InterruptedException, InvocationTargetException {
         System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test01NewtCanvasAWT(): Start");
 
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
 
-        GLWindow win0 = GLWindow.create(caps);
+        final GLWindow win0 = GLWindow.create(caps);
         win0.setSize(100,100);
         win0.setVisible(true);
         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(win0, true));
-        
-        Screen screen = win0.getScreen();
-        win0.setPosition(screen.getWidth()-150, 0);
+
+        final Screen screen = win0.getScreen();
+        final RectangleImmutable screenBoundsInWinU = screen.getViewportInWindowUnits();
+        win0.setPosition(screenBoundsInWinU.getX()-150, 0);
         win0.addGLEventListener(new GearsES2());
-        Animator anim = new Animator(win0);
+        final Animator anim = new Animator(win0);
         anim.start();
 
-        GLWindow win1 = GLWindow.create(caps);
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(win1);
+        final GLWindow win1 = GLWindow.create(caps);
+        final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(win1);
         anim.add(win1);
         runTestGL(newtCanvasAWT, win1);
 
         win0.destroy();
         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(win0, false));
-        Assert.assertEquals(false, win0.isNativeValid());        
+        Assert.assertEquals(false, win0.isNativeValid());
         Assert.assertEquals(true, anim.isAnimating()); // due to newtCanvasAWT/win1
 
         newtCanvasAWT.destroy(); // destroys both newtCanvasAWT/win1
         Assert.assertEquals(false, win1.isNativeValid());
         Assert.assertEquals(false, win0.isNativeValid());
         Assert.assertEquals(true, anim.isAnimating());
-        
+
         Assert.assertEquals(true, anim.stop());
         Assert.assertEquals(false, anim.isAnimating());
 
@@ -299,10 +301,10 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
     @Test
     public void test02GLCanvas() throws AWTException, InterruptedException, InvocationTargetException {
         System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test02GLCanvas(): Start");
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
 
-        Animator anim = new Animator();
+        final Animator anim = new Animator();
         anim.start();
 
         /**
@@ -318,13 +320,13 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
         anim.add(win0);
          */
 
-        GLCanvas glCanvas = new GLCanvas(caps);
+        final GLCanvas glCanvas = new GLCanvas(caps);
         anim.add(glCanvas);
         runTestGL(glCanvas, glCanvas);
-        
+
         anim.remove(glCanvas);
         Assert.assertEquals(false, anim.isAnimating());
-        
+
         /**
         win0.destroy();
         Assert.assertEquals(true, anim.isAnimating());
@@ -333,15 +335,15 @@ public class TestSwingAWTRobotUsageBeforeJOGLInitBug411 extends UITestCase {
         System.err.println("TestSwingAWTRobotUsageBeforeJOGLInitBug411.test02GLCanvas(): End");
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2File.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2File.java
index 9506d00..989bd5e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2File.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2File.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.offscreen;
 
 import java.io.IOException;
@@ -35,12 +35,12 @@ import java.io.File;
 
 public class ReadBuffer2File extends ReadBufferBase {
 
-    public ReadBuffer2File(GLDrawable externalRead) {
+    public ReadBuffer2File(final GLDrawable externalRead) {
         super(externalRead, false);
     }
 
     @Override
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         super.dispose(drawable);
     }
     int shotNum = 0;
@@ -50,18 +50,18 @@ public class ReadBuffer2File extends ReadBufferBase {
             return;
         }
 
-        File file = File.createTempFile("shot" + shotNum + "-", ".png");
+        final File file = File.createTempFile("shot" + shotNum + "-", ".png");
         readBufferUtil.write(file);
         System.out.println("Wrote: " + file.getAbsolutePath() + ", ...");
         shotNum++;
     }
 
     @Override
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         super.display(drawable);
         try {
             copyTextureData2File();
-        } catch (IOException ex) {
+        } catch (final IOException ex) {
             throw new RuntimeException("can not read buffer to file", ex);
         }
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java
index 5bdef28..3f9a64f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBuffer2Screen.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,21 +20,23 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.offscreen;
 
 import java.nio.*;
+
 import javax.media.opengl.*;
 import javax.media.opengl.fixedfunc.*;
 
 import com.jogamp.opengl.util.*;
 
 import javax.media.opengl.fixedfunc.GLPointerFunc;
+
 import com.jogamp.opengl.util.texture.TextureCoords;
 import com.jogamp.opengl.util.GLArrayDataClient;
 import com.jogamp.opengl.util.GLArrayDataServer;
@@ -46,28 +48,28 @@ public class ReadBuffer2Screen extends ReadBufferBase {
     boolean enableBufferAlways = false; // FIXME
     boolean enableBufferVBO    = true; // FIXME
 
-    public ReadBuffer2Screen (GLDrawable externalRead) {
+    public ReadBuffer2Screen (final GLDrawable externalRead) {
         super(externalRead, true);
     }
 
     @Override
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         super.init(drawable);
 
-        GL gl = drawable.getGL();
+        final GL gl = drawable.getGL();
 
         pmvMatrix = new PMVMatrix();
 
-        float f_edge = 1f;
+        final float f_edge = 1f;
         if(null==readTextureVertices) {
-            //readTextureVertices = GLArrayDataClient.createFixed(gl, GLPointerFunc.GL_VERTEX_ARRAY, "mgl_Vertex", 
+            //readTextureVertices = GLArrayDataClient.createFixed(gl, GLPointerFunc.GL_VERTEX_ARRAY, "mgl_Vertex",
             //                                                    2, GL.GL_FLOAT, true, 4);
-            readTextureVertices = GLArrayDataServer.createFixed(GLPointerFunc.GL_VERTEX_ARRAY, 2, 
+            readTextureVertices = GLArrayDataServer.createFixed(GLPointerFunc.GL_VERTEX_ARRAY, 2,
                                                                 GL.GL_FLOAT, true, 4, GL.GL_STATIC_DRAW);
             readTextureVertices.setEnableAlways(enableBufferAlways);
             readTextureVertices.setVBOEnabled(enableBufferVBO);
             {
-                FloatBuffer vb = (FloatBuffer)readTextureVertices.getBuffer();
+                final FloatBuffer vb = (FloatBuffer)readTextureVertices.getBuffer();
                 vb.put(-f_edge); vb.put(-f_edge);
                 vb.put( f_edge); vb.put(-f_edge);
                 vb.put(-f_edge); vb.put( f_edge);
@@ -82,10 +84,10 @@ public class ReadBuffer2Screen extends ReadBufferBase {
     }
 
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
         super.reshape(drawable, x, y, width, height);
 
-        GL gl = drawable.getGL();
+        final GL gl = drawable.getGL();
 
         gl.glViewport(0, 0, width, height);
 
@@ -101,30 +103,30 @@ public class ReadBuffer2Screen extends ReadBufferBase {
         }
 
         // Identity ..
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.glTranslatef(0, 0, -2.5f);
         if(null!=glM) {
-            glM.glMatrixMode(PMVMatrix.GL_MODELVIEW);
+            glM.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
             glM.glLoadMatrixf(pmvMatrix.glGetMvMatrixf());
         }
 
         // Set location in front of camera
-        pmvMatrix.glMatrixMode(PMVMatrix.GL_PROJECTION);
+        pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
         pmvMatrix.gluPerspective(45.0f, (float)width / (float)height, 1.0f, 100.0f);
         if(null!=glM) {
-            glM.glMatrixMode(PMVMatrix.GL_PROJECTION);
+            glM.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
             glM.glLoadMatrixf(pmvMatrix.glGetPMatrixf());
         }
     }
 
     @Override
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         super.dispose(drawable);
     }
 
-    void renderOffscreenTexture(GL gl) {
+    void renderOffscreenTexture(final GL gl) {
       if(!readBufferUtil.isValid()) return;
 
       // Now draw one quad with the texture
@@ -152,15 +154,15 @@ public class ReadBuffer2Screen extends ReadBufferBase {
       readBufferUtil.getTexture().disable(gl);
     }
 
-    void updateTextureCoords(GL gl, boolean force) {
+    void updateTextureCoords(final GL gl, final boolean force) {
         if(force || null==readTextureCoords) {
-            readTextureCoords = GLArrayDataServer.createFixed(GLPointerFunc.GL_TEXTURE_COORD_ARRAY, 2, 
+            readTextureCoords = GLArrayDataServer.createFixed(GLPointerFunc.GL_TEXTURE_COORD_ARRAY, 2,
                                                               GL.GL_FLOAT, true, 4, GL.GL_STATIC_DRAW);
             readTextureCoords.setEnableAlways(enableBufferAlways);
             readTextureCoords.setVBOEnabled(enableBufferVBO);
             {
-                TextureCoords coords = readBufferUtil.getTexture().getImageTexCoords();
-                FloatBuffer cb = (FloatBuffer)readTextureCoords.getBuffer();
+                final TextureCoords coords = readBufferUtil.getTexture().getImageTexCoords();
+                final FloatBuffer cb = (FloatBuffer)readTextureCoords.getBuffer();
                 cb.put(coords.left());  cb.put(coords.bottom());
                 cb.put(coords.right()); cb.put(coords.bottom());
                 cb.put(coords.left());  cb.put(coords.top());
@@ -172,12 +174,12 @@ public class ReadBuffer2Screen extends ReadBufferBase {
     }
 
     @Override
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         super.display(drawable);
 
-        GL gl = drawable.getGL();
+        final GL gl = drawable.getGL();
 
-        gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT);
+        gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT);
         if(gl instanceof GLLightingFunc) {
             ((GLLightingFunc)gl).glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
         }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBufferBase.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBufferBase.java
index f8e064a..e834775 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBufferBase.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/ReadBufferBase.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.offscreen;
 
 import javax.media.opengl.*;
@@ -40,12 +40,12 @@ public class ReadBufferBase implements GLEventListener {
 
     GLReadBufferUtil readBufferUtil;
 
-    public ReadBufferBase (GLDrawable externalRead, boolean write2Texture) {
+    public ReadBufferBase (final GLDrawable externalRead, final boolean write2Texture) {
         this.externalRead = externalRead ;
         this.readBufferUtil = new GLReadBufferUtil(false, write2Texture);
     }
 
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         GL _gl = drawable.getGL();
 
         _gl.glGetError(); // flush error ..
@@ -53,7 +53,7 @@ public class ReadBufferBase implements GLEventListener {
         if(glDebug) {
             try {
                 _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Debug", null, _gl, null) );
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new RuntimeException("can not set debug pipeline", e);
             }
         }
@@ -61,7 +61,7 @@ public class ReadBufferBase implements GLEventListener {
         if(glTrace) {
             try {
                 _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", null, _gl, new Object[] { System.err } ) );
-            } catch (Exception e) {
+            } catch (final Exception e) {
                 throw new RuntimeException("can not set trace pipeline", e);
             }
         }
@@ -77,14 +77,14 @@ public class ReadBufferBase implements GLEventListener {
         System.out.println("---------------------------");
     }
 
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
     }
 
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         readBufferUtil.dispose(drawable.getGL());
     }
 
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         readBufferUtil.readPixels(drawable.getGL(), false);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/Surface2File.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/Surface2File.java
index 974e322..5c2e801 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/Surface2File.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/Surface2File.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.offscreen;
 
 import javax.media.opengl.*;
@@ -46,29 +46,29 @@ public class Surface2File implements SurfaceUpdatedListener {
     final GLReadBufferUtil readBufferUtil;
     int shotNum = 0;
 
-    public Surface2File(String filename, boolean alpha) {
+    public Surface2File(final String filename, final boolean alpha) {
         this.filename = filename;
-        this.alpha = alpha;        
+        this.alpha = alpha;
         this.readBufferUtil = new GLReadBufferUtil(alpha, false);
     }
-    
-    public void dispose(GL gl) {
+
+    public void dispose(final GL gl) {
         readBufferUtil.dispose(gl);
     }
 
-    public void surfaceUpdated(Object updater, NativeSurface ns, long when) {
+    public void surfaceUpdated(final Object updater, final NativeSurface ns, final long when) {
         if (updater instanceof GLDrawable) {
-            GLDrawable drawable = (GLDrawable) updater;
-            GLContext ctx = GLContext.getCurrent();
+            final GLDrawable drawable = (GLDrawable) updater;
+            final GLContext ctx = GLContext.getCurrent();
             if (null != ctx && ctx.getGLDrawable() == drawable) {
-                GL gl = ctx.getGL();
+                final GL gl = ctx.getGL();
                 // FIXME glFinish() is an expensive paranoia sync, should not be necessary due to spec
                 gl.glFinish();
                 if(readBufferUtil.readPixels(gl, false)) {
                     gl.glFinish();
                     try {
                         surface2File();
-                    } catch (IOException ex) {
+                    } catch (final IOException ex) {
                         throw new RuntimeException("can not write survace to file", ex);
                     }
                 }
@@ -85,7 +85,7 @@ public class Surface2File implements SurfaceUpdatedListener {
             final String pfmt = alpha ? "rgba" : "rgb_" ;
             new PrintWriter(sw).printf("%s-I_%s-%04d.png", filename, pfmt, shotNum);
         }
-        File file = new File(sw.toString());
+        final File file = new File(sw.toString());
         readBufferUtil.write(file);
         shotNum++;
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen01GLPBufferNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen01GLPBufferNEWT.java
index 3f0dae6..78224de 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen01GLPBufferNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen01GLPBufferNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.offscreen;
 
 import com.jogamp.newt.Display;
@@ -72,22 +72,22 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
     public void init() {
         capsDefault = new GLCapabilities(glpDefault);
         Assert.assertNotNull(capsDefault);
-        capsDefault.setAlphaBits(1); // req. alpha channel        
+        capsDefault.setAlphaBits(1); // req. alpha channel
     }
 
-    private void do01OffscreenWindowPBuffer(GLCapabilities caps) {
-        Display display = NewtFactory.createDisplay(null); // local display
+    private void do01OffscreenWindowPBuffer(final GLCapabilities caps) {
+        final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
-        Window window = NewtFactory.createWindow(screen, caps);
+        final Window window = NewtFactory.createWindow(screen, caps);
         Assert.assertNotNull(window);
         window.setSize(width, height);
-        GLWindow glWindow = GLWindow.create(window);
+        final GLWindow glWindow = GLWindow.create(window);
         Assert.assertNotNull(glWindow);
         glWindow.setVisible(true);
 
-        GLEventListener demo = new RedSquareES2();
+        final GLEventListener demo = new RedSquareES2();
         WindowUtilNEWT.setDemoFields(demo, window, glWindow, false);
         glWindow.addGLEventListener(demo);
 
@@ -115,7 +115,7 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
             System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
             return;
         }
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+        final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
         do01OffscreenWindowPBuffer(caps2);
     }
 
@@ -125,7 +125,7 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
             System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
             return;
         }
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+        final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
         caps2.setStencilBits(8);
         do01OffscreenWindowPBuffer(caps2);
     }
@@ -136,7 +136,7 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
             System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
             return;
         }
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+        final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
         caps2.setStencilBits(8);
         caps2.setAlphaBits(8);
         do01OffscreenWindowPBuffer(caps2);
@@ -148,7 +148,7 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
             System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
             return;
         }
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+        final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
         caps2.setRedBits(5);
         caps2.setGreenBits(5);
         caps2.setBlueBits(5);
@@ -161,15 +161,16 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
             System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
             return;
         }
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
-        int winnum = 3, i;
-        Window windows[] = new Window[winnum];
-        GLWindow glWindows[] = new GLWindow[winnum];
-        GLEventListener demos[] = new GLEventListener[winnum];
+        final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+        final int winnum = 3;
+        int i;
+        final Window windows[] = new Window[winnum];
+        final GLWindow glWindows[] = new GLWindow[winnum];
+        final GLEventListener demos[] = new GLEventListener[winnum];
 
-        Display display = NewtFactory.createDisplay(null); // local display
+        final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
 
         for(i=0; i<winnum; i++) {
@@ -214,13 +215,14 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
             System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
             return;
         }
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
-        int winnum = 3, i;
-        Display displays[] = new Display[winnum];
-        Screen screens[] = new Screen[winnum];
-        Window windows[] = new Window[winnum];
-        GLWindow glWindows[] = new GLWindow[winnum];
-        GLEventListener demos[] = new GLEventListener[winnum];
+        final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+        final int winnum = 3;
+        int i;
+        final Display displays[] = new Display[winnum];
+        final Screen screens[] = new Screen[winnum];
+        final Window windows[] = new Window[winnum];
+        final GLWindow glWindows[] = new GLWindow[winnum];
+        final GLEventListener demos[] = new GLEventListener[winnum];
 
         for(i=0; i<winnum; i++) {
             System.out.println("Create Window "+i);
@@ -267,21 +269,21 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
             System.out.println("WARNING: PBuffer not supported on this platform - cannot test");
             return;
         }
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
+        final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(capsDefault, false, true, false);
 
         System.out.println("Create Window 1");
-        Display display = NewtFactory.createDisplay(null); // local display
+        final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
-        Window window = NewtFactory.createWindow(screen, caps2);
+        final Window window = NewtFactory.createWindow(screen, caps2);
         Assert.assertNotNull(window);
         window.setSize(width, height);
-        GLWindow glWindow = GLWindow.create(window);
+        final GLWindow glWindow = GLWindow.create(window);
         Assert.assertNotNull(glWindow);
         glWindow.setVisible(true);
 
-        WindowUtilNEWT.run(getSimpleTestName("."), glWindow, new RedSquareES2(), null, null, null, null, 
+        WindowUtilNEWT.run(getSimpleTestName("."), glWindow, new RedSquareES2(), null, null, null, null,
                            2 /* frames */, true /*snapshot*/, false /*debug*/);
 
         if(null!=glWindow) {
@@ -298,8 +300,8 @@ public class TestOffscreen01GLPBufferNEWT extends UITestCase {
         }
     }
 
-    public static void main(String args[]) throws IOException {
-        String tstname = TestOffscreen01GLPBufferNEWT.class.getName();
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestOffscreen01GLPBufferNEWT.class.getName();
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
             "filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen02BitmapNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen02BitmapNEWT.java
index 72cb7a5..2202b75 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen02BitmapNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/TestOffscreen02BitmapNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.offscreen;
 
 
@@ -46,8 +46,8 @@ import com.jogamp.opengl.test.junit.jogl.demos.es1.RedSquareES1;
 import java.io.IOException;
 
 /**
- * Using ES1 GL demo, since pixmap might not be hw accelerated, 
- * hence it is possible to not have GLSL. 
+ * Using ES1 GL demo, since pixmap might not be hw accelerated,
+ * hence it is possible to not have GLSL.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestOffscreen02BitmapNEWT extends UITestCase {
@@ -55,27 +55,27 @@ public class TestOffscreen02BitmapNEWT extends UITestCase {
 
     @Test
     public void test11OffscreenWindowPixmap() {
-        // we need to stay w/ generic profile GL2ES1 
-        // since software rasterizer might be required (pixmap/bitmap) 
-        GLProfile glp = GLProfile.get(GLProfile.GL2ES1);
+        // we need to stay w/ generic profile GL2ES1
+        // since software rasterizer might be required (pixmap/bitmap)
+        final GLProfile glp = GLProfile.get(GLProfile.GL2ES1);
         Assert.assertNotNull(glp);
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
 
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, false, false);
+        final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, false, false);
 
-        Display display = NewtFactory.createDisplay(null); // local display
+        final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
-        Window window = NewtFactory.createWindow(screen, caps2);
+        final Window window = NewtFactory.createWindow(screen, caps2);
         Assert.assertNotNull(window);
         window.setSize(width, height);
-        GLWindow glWindow = GLWindow.create(window);
+        final GLWindow glWindow = GLWindow.create(window);
         Assert.assertNotNull(glWindow);
         glWindow.setVisible(true);
 
-        GLEventListener demo = new RedSquareES1();
+        final GLEventListener demo = new RedSquareES1();
         WindowUtilNEWT.setDemoFields(demo, window, glWindow, false);
         glWindow.addGLEventListener(demo);
 
@@ -99,27 +99,27 @@ public class TestOffscreen02BitmapNEWT extends UITestCase {
 
     @Test
     public void test14OffscreenSnapshotWithDemoPixmap() {
-        // we need to stay w/ generic profile GL2ES1 
-        // since software rasterizer might be required (pixmap/bitmap) 
-        GLProfile glp = GLProfile.get(GLProfile.GL2ES1);
+        // we need to stay w/ generic profile GL2ES1
+        // since software rasterizer might be required (pixmap/bitmap)
+        final GLProfile glp = GLProfile.get(GLProfile.GL2ES1);
         Assert.assertNotNull(glp);
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
 
-        GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, false, false);
+        final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, false, false);
 
-        Display display = NewtFactory.createDisplay(null); // local display
+        final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
-        Window window = NewtFactory.createWindow(screen, caps2);
+        final Window window = NewtFactory.createWindow(screen, caps2);
         Assert.assertNotNull(window);
         window.setSize(width, height);
-        GLWindow glWindow = GLWindow.create(window);
+        final GLWindow glWindow = GLWindow.create(window);
         Assert.assertNotNull(glWindow);
         glWindow.setVisible(true);
 
-        WindowUtilNEWT.run(getSimpleTestName("."), glWindow, new RedSquareES1(), null, null, null, null, 
+        WindowUtilNEWT.run(getSimpleTestName("."), glWindow, new RedSquareES1(), null, null, null, null,
                            2 /* frames */, true /*snapshot*/, false /*debug*/);
 
         if(null!=glWindow) {
@@ -135,8 +135,8 @@ public class TestOffscreen02BitmapNEWT extends UITestCase {
             display.destroy();
         }
     }
-    public static void main(String args[]) throws IOException {
-        String tstname = TestOffscreen02BitmapNEWT.class.getName();
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestOffscreen02BitmapNEWT.class.getName();
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
             "filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/WindowUtilNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/WindowUtilNEWT.java
index efca752..9e66a61 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/WindowUtilNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/offscreen/WindowUtilNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.offscreen;
 
 import com.jogamp.opengl.test.junit.util.*;
@@ -40,15 +40,15 @@ import com.jogamp.newt.opengl.*;
 
 public class WindowUtilNEWT {
 
-    public static GLCapabilities fixCaps(GLCapabilities caps, boolean onscreen, boolean pbuffer, boolean undecorated) {
-        GLCapabilities caps2 = (GLCapabilities) caps.cloneMutable();
+    public static GLCapabilities fixCaps(final GLCapabilities caps, final boolean onscreen, final boolean pbuffer, final boolean undecorated) {
+        final GLCapabilities caps2 = (GLCapabilities) caps.cloneMutable();
         caps2.setOnscreen(onscreen);
         caps2.setPBuffer(!onscreen && pbuffer);
         caps2.setDoubleBuffered(!onscreen);
         return caps2;
     }
 
-    public static void setDemoFields(GLEventListener demo, Window window, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final Window window, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(window);
         if(debug) {
@@ -60,9 +60,9 @@ public class WindowUtilNEWT {
         }
     }
 
-    public static void run(String testName, GLWindow windowOffScreen, GLEventListener demo, 
-                           GLWindow windowOnScreenBlit, WindowListener wl, MouseListener ml, 
-                           SurfaceUpdatedListener ul, int frames, boolean snapshot, boolean debug) {
+    public static void run(final String testName, final GLWindow windowOffScreen, final GLEventListener demo,
+                           final GLWindow windowOnScreenBlit, final WindowListener wl, final MouseListener ml,
+                           final SurfaceUpdatedListener ul, final int frames, final boolean snapshot, final boolean debug) {
         Assert.assertNotNull(windowOffScreen);
         Assert.assertNotNull(demo);
 
@@ -79,14 +79,14 @@ public class WindowUtilNEWT {
             windowOnScreenBlit.setVisible(true);
         }
 
-        GLDrawable readDrawable = windowOffScreen.getContext().getGLDrawable() ;
+        final GLDrawable readDrawable = windowOffScreen.getContext().getGLDrawable() ;
         if ( null != windowOnScreenBlit ) {
-            ReadBuffer2Screen readDemo = new ReadBuffer2Screen( readDrawable ) ;
+            final ReadBuffer2Screen readDemo = new ReadBuffer2Screen( readDrawable ) ;
             windowOnScreenBlit.addGLEventListener(readDemo);
         }
         if(snapshot) {
             final boolean alpha = windowOffScreen.getChosenGLCapabilities().getAlphaBits()>0;
-            Surface2File s2f = new Surface2File(testName, alpha);
+            final Surface2File s2f = new Surface2File(testName, alpha);
             windowOffScreen.addSurfaceUpdatedListener(s2f);
         }
         if(null!=ul) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java
index 0ca84e4..92785ef 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit01AWT.java
@@ -31,6 +31,7 @@ import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.GridLayout;
 import java.lang.reflect.InvocationTargetException;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.media.opengl.GLAnimatorControl;
 import javax.media.opengl.GLAutoDrawable;
@@ -87,7 +88,7 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
             UITestCase.waitForKey("Pre-Init");
         }
         System.err.println("INIT START");
-        initCount = 0;
+        initCount.set(0);
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
@@ -96,15 +97,15 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
                         final GLAutoDrawable glad = useGLJPanel ? createGLJPanel(caps, useGears, animator, eSize) : createGLCanvas(caps, useGears, animator, eSize);
                         glad.addGLEventListener(new GLEventListener() {
                             @Override
-                            public void init(GLAutoDrawable drawable) {
-                                initCount++;
+                            public void init(final GLAutoDrawable drawable) {
+                                initCount.getAndIncrement();
                             }
                             @Override
-                            public void dispose(GLAutoDrawable drawable) {}
+                            public void dispose(final GLAutoDrawable drawable) {}
                             @Override
-                            public void display(GLAutoDrawable drawable) {}
+                            public void display(final GLAutoDrawable drawable) {}
                             @Override
-                            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+                            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
                         });
                         panel.add((Component)glad);
                     }
@@ -116,36 +117,36 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
                     frame.setVisible(true);
                     t[2] = Platform.currentTimeMillis();
                 } } );
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
         final long t0 = System.currentTimeMillis();
         long t1 = t0;
-        while( panelCount > initCount && INIT_TIMEOUT > t1 - t0 ) {
+        while( panelCount > initCount.get() && INIT_TIMEOUT > t1 - t0 ) {
             try {
                 Thread.sleep(100);
-                System.err.println("Sleep initialized: "+initCount+"/"+panelCount);
-            } catch (InterruptedException e1) {
+                System.err.println("Sleep initialized: "+initCount.get()+"/"+panelCount);
+            } catch (final InterruptedException e1) {
                 e1.printStackTrace();
             }
             t1 = System.currentTimeMillis();
         }
         t[3] = Platform.currentTimeMillis();
-        final double panelCountF = initCount;
+        final double panelCountF = initCount.get();
         System.err.printf("P: %d %s:%n\tctor\t%6d/t %6.2f/1%n\tvisible\t%6d/t %6.2f/1%n\tsum-i\t%6d/t %6.2f/1%n",
-                initCount,
+                initCount.get(),
                 useGLJPanel?"GLJPanel":"GLCanvas",
                 t[1]-t[0], (t[1]-t[0])/panelCountF,
                 t[3]-t[1], (t[3]-t[1])/panelCountF,
                 t[3]-t[0], (t[3]-t[0])/panelCountF);
-        System.err.println("INIT END: "+initCount+"/"+panelCount);
+        System.err.println("INIT END: "+initCount.get()+"/"+panelCount);
         if( wait ) {
             UITestCase.waitForKey("Post-Init");
         }
         try {
             Thread.sleep(duration);
-        } catch (InterruptedException e1) {
+        } catch (final InterruptedException e1) {
             e1.printStackTrace();
         }
         t[4] = Platform.currentTimeMillis();
@@ -154,7 +155,7 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
                     public void run() {
                         frame.dispose();
                     } } );
-        } catch (Exception e1) {
+        } catch (final Exception e1) {
             e1.printStackTrace();
         }
         final long ti_net = (t[4]-t[0])-duration;
@@ -165,8 +166,8 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
         System.err.println("Total: "+(t[4]-t[0]));
     }
 
-    private GLAutoDrawable createGLCanvas(GLCapabilitiesImmutable caps, boolean useGears, GLAnimatorControl anim, Dimension size) {
-        GLCanvas canvas = new GLCanvas(caps);
+    private GLAutoDrawable createGLCanvas(final GLCapabilitiesImmutable caps, final boolean useGears, final GLAnimatorControl anim, final Dimension size) {
+        final GLCanvas canvas = new GLCanvas(caps);
         canvas.setSize(size);
         canvas.setPreferredSize(size);
         if( useGears ) {
@@ -177,8 +178,8 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
         }
         return canvas;
     }
-    private GLAutoDrawable createGLJPanel(GLCapabilitiesImmutable caps, boolean useGears, GLAnimatorControl anim, Dimension size) {
-        GLJPanel canvas = new GLJPanel(caps);
+    private GLAutoDrawable createGLJPanel(final GLCapabilitiesImmutable caps, final boolean useGears, final GLAnimatorControl anim, final Dimension size) {
+        final GLJPanel canvas = new GLJPanel(caps);
         canvas.setSize(size);
         canvas.setPreferredSize(size);
         if( useGears ) {
@@ -197,7 +198,7 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
 
     @Test
     public void test02NopGLJPanelBitmap() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(null);
+        final GLCapabilities caps = new GLCapabilities(null);
         caps.setBitmap(true);
         test(caps, false /*useGears*/, width, height, rows, cols, true /* useGLJPanel */, false /*useAnim*/);
     }
@@ -211,9 +212,9 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
     static boolean wait = false;
     static int width = 800, height = 600, rows = 5, cols = 5;
 
-    volatile int initCount = 0;
+    AtomicInteger initCount = new AtomicInteger(0);
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         boolean useGLJPanel = true, useGears = false, manual=false;
         boolean waitMain = false;
 
@@ -248,7 +249,7 @@ public class TestPerf001GLJPanelInit01AWT extends UITestCase {
         }
         if( manual ) {
             GLProfile.initSingleton();
-            TestPerf001GLJPanelInit01AWT demo = new TestPerf001GLJPanelInit01AWT();
+            final TestPerf001GLJPanelInit01AWT demo = new TestPerf001GLJPanelInit01AWT();
             demo.test(null, useGears, width, height, rows, cols, useGLJPanel, false /*useAnim*/);
         } else {
             org.junit.runner.JUnitCore.main(TestPerf001GLJPanelInit01AWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java
index 2b1dc41..c60c395 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLJPanelInit02AWT.java
@@ -32,6 +32,7 @@ import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.Graphics;
 import java.lang.reflect.InvocationTargetException;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.media.opengl.GLAnimatorControl;
 import javax.media.opengl.GLAutoDrawable;
@@ -95,7 +96,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
             UITestCase.waitForKey("Pre-Init");
         }
         System.err.println("INIT START");
-        initCount = 0;
+        initCount.set(0);
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
@@ -120,15 +121,15 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
                         if( null != glad ) {
                             glad.addGLEventListener(new GLEventListener() {
                                 @Override
-                                public void init(GLAutoDrawable drawable) {
-                                    initCount++;
+                                public void init(final GLAutoDrawable drawable) {
+                                    initCount.incrementAndGet();
                                 }
                                 @Override
-                                public void dispose(GLAutoDrawable drawable) {}
+                                public void dispose(final GLAutoDrawable drawable) {}
                                 @Override
-                                public void display(GLAutoDrawable drawable) {}
+                                public void display(final GLAutoDrawable drawable) {}
                                 @Override
-                                public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+                                public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
                             });
                             panel.add((Component)glad);
                         } else {
@@ -143,7 +144,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
                                 }
                                 @SuppressWarnings("deprecation")
                                 @Override
-                                public void reshape(int x, int y, int width, int height) {
+                                public void reshape(final int x, final int y, final int width, final int height) {
                                     super.reshape(x, y, width, height);
                                     reshapeWidth = width; reshapeHeight = height;
                                 }
@@ -152,7 +153,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
                                     super.paintComponent(g);
                                     if( !initialized && added && reshapeWidth > 0 && reshapeHeight > 0 && isDisplayable() ) {
                                         initialized = true;
-                                        initCount++;
+                                        initCount.incrementAndGet();
                                     }
                                 }
                             };
@@ -172,25 +173,25 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
                     }
                     t[2] = Platform.currentTimeMillis();
                 } } );
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
         final long t0 = System.currentTimeMillis();
         long t1 = t0;
-        while( frameCount > initCount && INIT_TIMEOUT > t1 - t0 ) {
+        while( frameCount > initCount.get() && INIT_TIMEOUT > t1 - t0 ) {
             try {
                 Thread.sleep(100);
                 System.err.println("Sleep initialized: "+initCount+"/"+frameCount);
-            } catch (InterruptedException e1) {
+            } catch (final InterruptedException e1) {
                 e1.printStackTrace();
             }
             t1 = System.currentTimeMillis();
         }
         t[3] = Platform.currentTimeMillis();
-        final double panelCountF = initCount;
+        final double panelCountF = initCount.get();
         System.err.printf("P: %d %s%s:%n\tctor\t%6d/t %6.2f/1%n\tvisible\t%6d/t %6.2f/1%n\tsum-i\t%6d/t %6.2f/1%n",
-                initCount,
+                initCount.get(),
                 useGLJPanel?"GLJPanel":(useGLCanvas?"GLCanvas":"No_GL"), initMT?" (mt)":" (01)",
                 t[1]-t[0], (t[1]-t[0])/panelCountF,
                 t[3]-t[1], (t[3]-t[1])/panelCountF,
@@ -202,7 +203,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
         }
         try {
             Thread.sleep(duration);
-        } catch (InterruptedException e1) {
+        } catch (final InterruptedException e1) {
             e1.printStackTrace();
         }
         t[4] = Platform.currentTimeMillis();
@@ -213,7 +214,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
                             frame[i].dispose();
                         }
                     } } );
-        } catch (Exception e1) {
+        } catch (final Exception e1) {
             e1.printStackTrace();
         }
 
@@ -225,8 +226,8 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
         System.err.println("Total: "+(t[4]-t[0]));
     }
 
-    private GLAutoDrawable createGLCanvas(GLCapabilitiesImmutable caps, boolean useGears, GLAnimatorControl anim, Dimension size) {
-        GLCanvas canvas = new GLCanvas(caps);
+    private GLAutoDrawable createGLCanvas(final GLCapabilitiesImmutable caps, final boolean useGears, final GLAnimatorControl anim, final Dimension size) {
+        final GLCanvas canvas = new GLCanvas(caps);
         canvas.setSize(size);
         canvas.setPreferredSize(size);
         if( useGears ) {
@@ -239,8 +240,8 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
         }
         return canvas;
     }
-    private GLAutoDrawable createGLJPanel(boolean initMT, boolean useSwingDoubleBuffer, GLCapabilitiesImmutable caps, boolean useGears, boolean skipGLOrientationVerticalFlip, GLAnimatorControl anim, Dimension size) {
-        GLJPanel canvas = new GLJPanel(caps);
+    private GLAutoDrawable createGLJPanel(final boolean initMT, final boolean useSwingDoubleBuffer, final GLCapabilitiesImmutable caps, final boolean useGears, final boolean skipGLOrientationVerticalFlip, final GLAnimatorControl anim, final Dimension size) {
+        final GLJPanel canvas = new GLJPanel(caps);
         canvas.setSize(size);
         canvas.setPreferredSize(size);
         canvas.setDoubleBuffered(useSwingDoubleBuffer);
@@ -370,7 +371,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
 
     // @Test
     public void testXXNopGLJPanelBitmapGridSingle() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(null);
+        final GLCapabilities caps = new GLCapabilities(null);
         caps.setBitmap(true);
         test(caps, false /*useGears*/, false /*skipGLOrientationVerticalFlip*/, width , height, frameCount, false /* initMT */,
              true /* useGLJPanel */, false /*useSwingDoubleBuffer*/, false /* useGLCanvas */, false /*useAnim*/, false);
@@ -380,9 +381,9 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
     static boolean wait = false;
     static int width = 800, height = 600, frameCount = 25;
 
-    volatile int initCount = 0;
+    AtomicInteger initCount = new AtomicInteger(0);
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         boolean manual=false;
         boolean waitMain = false;
         boolean useGLJPanel = true, initMT = false, useGLCanvas = false, useSwingDoubleBuffer=false;
@@ -435,7 +436,7 @@ public class TestPerf001GLJPanelInit02AWT extends UITestCase {
         }
         if( manual ) {
             GLProfile.initSingleton();
-            TestPerf001GLJPanelInit02AWT demo = new TestPerf001GLJPanelInit02AWT();
+            final TestPerf001GLJPanelInit02AWT demo = new TestPerf001GLJPanelInit02AWT();
             demo.test(null, useGears, skipGLOrientationVerticalFlip, width, height, frameCount,
                       initMT, useGLJPanel, useSwingDoubleBuffer, useGLCanvas, useAnim, overlap);
         } else {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLWindowInit03NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLWindowInit03NEWT.java
index 18b3d54..60e31aa 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLWindowInit03NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001GLWindowInit03NEWT.java
@@ -28,6 +28,7 @@
 package com.jogamp.opengl.test.junit.jogl.perf;
 
 import java.lang.reflect.InvocationTargetException;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLCapabilities;
@@ -60,7 +61,7 @@ public class TestPerf001GLWindowInit03NEWT extends UITestCase {
         GLProfile.initSingleton();
     }
 
-    public void test(final GLCapabilitiesImmutable caps, final boolean useGears, final int width, final int height, final int frameCount, boolean reuseDevice) {
+    public void test(final GLCapabilitiesImmutable caps, final boolean useGears, final int width, final int height, final int frameCount, final boolean reuseDevice) {
         final int cols = (int)Math.round(Math.sqrt(frameCount));
         final int rows = frameCount / cols;
         final int eWidth = width/cols;
@@ -72,7 +73,7 @@ public class TestPerf001GLWindowInit03NEWT extends UITestCase {
             UITestCase.waitForKey("Pre-Init");
         }
         System.err.println("INIT START");
-        initCount = 0;
+        initCount.set(0);
 
         t[0] = Platform.currentTimeMillis();
         int x = 32, y = 32;
@@ -92,15 +93,15 @@ public class TestPerf001GLWindowInit03NEWT extends UITestCase {
             }
             frame[i].addGLEventListener(new GLEventListener() {
                 @Override
-                public void init(GLAutoDrawable drawable) {
-                    initCount++;
+                public void init(final GLAutoDrawable drawable) {
+                    initCount.incrementAndGet();
                 }
                 @Override
-                public void dispose(GLAutoDrawable drawable) {}
+                public void dispose(final GLAutoDrawable drawable) {}
                 @Override
-                public void display(GLAutoDrawable drawable) {}
+                public void display(final GLAutoDrawable drawable) {}
                 @Override
-                public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+                public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
             });
         }
         t[1] = Platform.currentTimeMillis();
@@ -111,19 +112,19 @@ public class TestPerf001GLWindowInit03NEWT extends UITestCase {
 
         final long t0 = System.currentTimeMillis();
         long t1 = t0;
-        while( frameCount > initCount && INIT_TIMEOUT > t1 - t0 ) {
+        while( frameCount > initCount.get() && INIT_TIMEOUT > t1 - t0 ) {
             try {
                 Thread.sleep(100);
                 System.err.println("Sleep initialized: "+initCount+"/"+frameCount);
-            } catch (InterruptedException e1) {
+            } catch (final InterruptedException e1) {
                 e1.printStackTrace();
             }
             t1 = System.currentTimeMillis();
         }
         t[3] = Platform.currentTimeMillis();
-        final double panelCountF = initCount;
+        final double panelCountF = initCount.get();
         System.err.printf("P: %d GLWindow:%n\tctor\t%6d/t %6.2f/1%n\tvisible\t%6d/t %6.2f/1%n\tsum-i\t%6d/t %6.2f/1%n",
-                initCount,
+                initCount.get(),
                 t[1]-t[0], (t[1]-t[0])/panelCountF,
                 t[3]-t[1], (t[3]-t[1])/panelCountF,
                 t[3]-t[0], (t[3]-t[0])/panelCountF);
@@ -134,7 +135,7 @@ public class TestPerf001GLWindowInit03NEWT extends UITestCase {
         }
         try {
             Thread.sleep(duration);
-        } catch (InterruptedException e1) {
+        } catch (final InterruptedException e1) {
             e1.printStackTrace();
         }
         t[4] = Platform.currentTimeMillis();
@@ -169,9 +170,9 @@ public class TestPerf001GLWindowInit03NEWT extends UITestCase {
     static boolean wait = false, mainRun = false;
     static int width = 800, height = 600, frameCount = 25;
 
-    volatile int initCount = 0;
+    AtomicInteger initCount = new AtomicInteger(0);
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         mainRun = true;
         boolean useGears = false, manual=false;
         boolean waitMain = false;
@@ -203,7 +204,7 @@ public class TestPerf001GLWindowInit03NEWT extends UITestCase {
         }
         if( manual ) {
             GLProfile.initSingleton();
-            TestPerf001GLWindowInit03NEWT demo = new TestPerf001GLWindowInit03NEWT();
+            final TestPerf001GLWindowInit03NEWT demo = new TestPerf001GLWindowInit03NEWT();
             demo.test(null, useGears, width, height, frameCount, false /* reuseDevice */);
         } else {
             org.junit.runner.JUnitCore.main(TestPerf001GLWindowInit03NEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001RawInit00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001RawInit00NEWT.java
index 6f7d932..f8b15a8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001RawInit00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/perf/TestPerf001RawInit00NEWT.java
@@ -207,7 +207,7 @@ public class TestPerf001RawInit00NEWT extends UITestCase {
     static int manualTest = 0;
     static int width = 800, height = 600, count = 50;
 
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         boolean waitMain = false;
 
         for(int i=0; i<args.length; i++) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/stereo/StereoDemo01.java b/src/test/com/jogamp/opengl/test/junit/jogl/stereo/StereoDemo01.java
new file mode 100644
index 0000000..142c941
--- /dev/null
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/stereo/StereoDemo01.java
@@ -0,0 +1,366 @@
+/**
+ * Copyright 2014 JogAmp Community. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without modification, are
+ * permitted provided that the following conditions are met:
+ *
+ *    1. Redistributions of source code must retain the above copyright notice, this list of
+ *       conditions and the following disclaimer.
+ *
+ *    2. Redistributions in binary form must reproduce the above copyright notice, this list
+ *       of conditions and the following disclaimer in the documentation and/or other materials
+ *       provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of JogAmp Community.
+ */
+package com.jogamp.opengl.test.junit.jogl.stereo;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Arrays;
+
+import javax.media.nativewindow.util.DimensionImmutable;
+import javax.media.nativewindow.util.PointImmutable;
+import javax.media.opengl.GL;
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLProfile;
+
+import jogamp.opengl.util.stereo.GenericStereoDevice;
+
+import com.jogamp.common.util.IOUtil;
+import com.jogamp.newt.event.KeyAdapter;
+import com.jogamp.newt.event.KeyEvent;
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.math.FovHVHalves;
+import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
+import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSBSStereo;
+import com.jogamp.opengl.test.junit.jogl.demos.es2.av.MovieSimple;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
+import com.jogamp.opengl.test.junit.util.QuitAdapter;
+import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
+import com.jogamp.opengl.util.av.GLMediaPlayer;
+import com.jogamp.opengl.util.stereo.StereoDevice;
+import com.jogamp.opengl.util.stereo.StereoDeviceRenderer;
+import com.jogamp.opengl.util.stereo.StereoDeviceFactory;
+import com.jogamp.opengl.util.stereo.StereoClientRenderer;
+import com.jogamp.opengl.util.stereo.StereoGLEventListener;
+import com.jogamp.opengl.util.stereo.StereoUtil;
+
+/**
+ * All distortions, no multisampling, bilinear filtering, manual-swap and using two FBOs (default, good)
+ * <pre>
+ * java StereoDemo01 -time 10000000
+ * </pre>
+ * All distortions, 8x multisampling, bilinear filtering, manual-swap and using two FBOs (best - slowest)
+ * <pre>
+ * java StereoDemo01 -time 10000000 -samples 8
+ * </pre>
+ * All distortions, 8x multisampling, bilinear filtering, manual-swap and using one a big single FBO (w/ all commandline params)
+ * <pre>
+ * java StereoDemo01 -time 10000000 -vignette true -chromatic true -timewarp false -samples 8 -biLinear true -autoSwap false -singleFBO true -mainScreen false
+ * </pre>
+ * No distortions, no multisampling, no filtering, auto-swap and using a big single FBO (worst and fastest)
+ * <pre>
+ * java StereoDemo01 -time 10000000 -vignette false -chromatic false -timewarp false -samples 0 -biLinear false -autoSwap true -singleFBO true
+ * </pre>
+ * Test on main screen:
+ * <pre>
+ * java StereoDemo01 -time 10000000 -mainScreen true
+ * </pre>
+ * Test a 3D SBS Movie:
+ * <pre>
+ * java StereoDemo01 -time 10000000 -filmFile Some_SBS_3D_Movie.mkv
+ * java StereoDemo01 -time 10000000 -filmURI http://whoknows.not/Some_SBS_3D_Movie.mkv
+ * </pre>
+ * <p>
+ * In case user likes to utilize the {@link StereoDeviceFactory.DeviceType#Generic Generic} software implementation,
+ * which is selected {@link StereoDeviceFactory.DeviceType#Default Default} if no other device is available
+ * or explicit via <code>-device Generic</code>, the user can chose between different <i>generic</i> stereo modes:
+ * <pre>
+ *   mono            : <code>-device Generic -deviceIndex 0</code>
+ *   stereo-sbs      : <code>-device Generic -deviceIndex 1</code>
+ *   stereo-sbs-lense: <code>-device Generic -deviceIndex 2</code>
+ * </pre>
+ * </p>
+ * <p>
+ * Key 'R' enables/disables the VR's sensors, i.e. head rotation ..
+ * </p>
+ *
+ */
+public class StereoDemo01 {
+    static long duration = 10000; // ms
+
+    static boolean useStereoScreen = true;
+
+    static int numSamples = 0;
+    static boolean biLinear = true;
+    static boolean useSingleFBO = false;
+    static boolean useVignette = true;
+    static boolean useChromatic = true;
+    static boolean useTimewarp = true;
+    static boolean useAutoSwap = false;
+    static String useFilmFile = null;
+    static String useFilmURI = null;
+    static StereoDeviceFactory.DeviceType deviceType = StereoDeviceFactory.DeviceType.Default;
+    static int deviceIndex = 0;
+
+    public static void main(final String args[]) throws InterruptedException, URISyntaxException {
+        boolean useRecommendedDistortionBits = true;
+        int posx = -1;
+        int posy = -1;
+
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                i++;
+                duration = MiscUtils.atol(args[i], duration);
+            } else if(args[i].equals("-samples")) {
+                i++;
+                numSamples = MiscUtils.atoi(args[i], numSamples);
+            } else if(args[i].equals("-biLinear")) {
+                i++;
+                biLinear = MiscUtils.atob(args[i], biLinear);
+            } else if(args[i].equals("-singleFBO")) {
+                i++;
+                useSingleFBO = MiscUtils.atob(args[i], useSingleFBO);
+            } else if(args[i].equals("-vignette")) {
+                i++;
+                useVignette = MiscUtils.atob(args[i], useVignette);
+                useRecommendedDistortionBits = false;
+            } else if(args[i].equals("-chromatic")) {
+                i++;
+                useChromatic = MiscUtils.atob(args[i], useChromatic);
+                useRecommendedDistortionBits = false;
+            } else if(args[i].equals("-timewarp")) {
+                i++;
+                useTimewarp = MiscUtils.atob(args[i], useTimewarp);
+                useRecommendedDistortionBits = false;
+            } else if(args[i].equals("-vignette")) {
+                i++;
+                useVignette = MiscUtils.atob(args[i], useVignette);
+                useRecommendedDistortionBits = false;
+            } else if(args[i].equals("-mainScreen")) {
+                i++;
+                useStereoScreen = !MiscUtils.atob(args[i], useStereoScreen);
+            } else if(args[i].equals("-device")) {
+                i++;
+                deviceType = StereoDeviceFactory.DeviceType.valueOf(args[i]);
+            } else if(args[i].equals("-deviceIndex")) {
+                i++;
+                deviceIndex = MiscUtils.atoi(args[i], deviceIndex);
+            } else if(args[i].equals("-posx")) {
+                i++;
+                posx = MiscUtils.atoi(args[i], posx);
+            } else if(args[i].equals("-posy")) {
+                i++;
+                posy = MiscUtils.atoi(args[i], posy);
+            } else if(args[i].equals("-autoSwap")) {
+                i++;
+                useAutoSwap = MiscUtils.atob(args[i], useAutoSwap);
+            } else if(args[i].equals("-filmFile")) {
+                i++;
+                useFilmFile = args[i];
+            } else if(args[i].equals("-filmURI")) {
+                i++;
+                useFilmURI = args[i];
+            }
+        }
+        final StereoGLEventListener upstream;
+        final MovieSBSStereo movieSimple;
+        final URI movieURI;
+        if( null != useFilmFile ) {
+            movieSimple = new MovieSBSStereo();
+            movieURI = IOUtil.toURISimple(new File(useFilmFile));
+            upstream = movieSimple;
+        } else if( null != useFilmURI ) {
+            movieSimple = new MovieSBSStereo();
+            movieURI = new URI(useFilmURI);
+            upstream = movieSimple;
+        } else {
+            final GearsES2 demo = new GearsES2(0);
+            demo.setVerbose(false);
+            upstream = demo;
+            movieSimple = null;
+            movieURI = null;
+        }
+        final StereoDemo01 demo01 = new StereoDemo01();
+        demo01.doIt(deviceType, deviceIndex, posx, posy,
+                    upstream, movieSimple, movieURI, biLinear, numSamples, useSingleFBO,
+                    useRecommendedDistortionBits, useVignette, useChromatic, useTimewarp,
+                    useAutoSwap, true /* useAnimator */, false /* exclusiveContext*/);
+    }
+
+    public void doIt(final StereoDeviceFactory.DeviceType deviceType, final int deviceIndex, final int posx, final int posy,
+                     final StereoGLEventListener upstream, final MovieSBSStereo movieSimple, final URI movieURI,
+                     final boolean biLinear, final int numSamples, final boolean useSingleFBO,
+                     final boolean useRecommendedDistortionBits, final boolean useVignette, final boolean useChromatic, final boolean useTimewarp,
+                     final boolean useAutoSwap, final boolean useAnimator, final boolean exclusiveContext) throws InterruptedException {
+
+        System.err.println("glob duration "+duration);
+        System.err.println("glob useStereoScreen "+useStereoScreen);
+        System.err.println("deviceType "+deviceType);
+        System.err.println("deviceIndex "+deviceIndex);
+        System.err.println("biLinear "+biLinear);
+        System.err.println("numSamples "+numSamples);
+        System.err.println("useSingleFBO "+useSingleFBO);
+        System.err.println("useRecommendedDistortionBits "+useRecommendedDistortionBits);
+        System.err.println("useVignette "+useVignette);
+        System.err.println("useChromatic "+useChromatic);
+        System.err.println("useTimewarp "+useTimewarp);
+        System.err.println("useAutoSwap "+useAutoSwap);
+
+        final StereoDeviceFactory stereoDeviceFactory = StereoDeviceFactory.createFactory(deviceType);
+        if( null == stereoDeviceFactory ) {
+            System.err.println("No StereoDeviceFactory available");
+            return;
+        }
+
+        final StereoDevice stereoDevice = stereoDeviceFactory.createDevice(deviceIndex, null, true /* verbose */);
+        if( null == stereoDevice ) {
+            System.err.println("No StereoDevice.Context available for index "+deviceIndex);
+            return;
+        }
+
+        final boolean isGenericDevice = stereoDevice instanceof GenericStereoDevice;
+
+        if( 0 <= posx && 0 <= posy && isGenericDevice ) {
+            ((GenericStereoDevice)stereoDevice).setSurfacePosition(posx, posy);
+        }
+        System.err.println("StereoDevice "+stereoDevice);
+
+        // Start the sensor which provides the Rift’s pose and motion.
+        if( !stereoDevice.startSensors(true) ) {
+            System.err.println("Could not start sensors on device "+deviceIndex);
+        }
+
+        //
+        //
+        //
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getMaxProgrammable(true /* favorHardwareRasterizer */));
+        final GLWindow window = GLWindow.create(caps);
+
+        final PointImmutable devicePos = stereoDevice.getPosition();
+        final DimensionImmutable deviceRes = stereoDevice.getSurfaceSize();
+        if( useStereoScreen ) {
+            window.setPosition(devicePos.getX(), devicePos.getY());
+        }
+        window.setSurfaceSize(deviceRes.getWidth(), deviceRes.getHeight()); // might be not correct ..
+        window.setAutoSwapBufferMode(useAutoSwap);
+        window.setUndecorated(true);
+
+        final Animator animator = useAnimator ? new Animator() : null;
+        if( useAnimator ) {
+            animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
+            animator.setExclusiveContext(exclusiveContext);
+        }
+
+        //
+        // Stereo Device Setup
+        //
+        // EyePos.y = ovrHmd_GetFloat(HMD, OVR_KEY_EYE_HEIGHT, EyePos.y);
+        final FovHVHalves[] defaultEyeFov = stereoDevice.getDefaultFOV();
+        System.err.println("Default Fov[0]: "+defaultEyeFov[0]);
+        System.err.println("Default Fov[0]: "+defaultEyeFov[0].toStringInDegrees());
+        if( defaultEyeFov.length > 1 ) {
+            System.err.println("Default Fov[1]: "+defaultEyeFov[1]);
+            System.err.println("Default Fov[1]: "+defaultEyeFov[1].toStringInDegrees());
+        }
+
+        final boolean usesLenses = 0 != ( StereoDeviceRenderer.DISTORTION_BARREL & stereoDevice.getMinimumDistortionBits() );
+        final float[] eyePositionOffset = null != movieSimple && usesLenses ? new float[] { 0f, 0.3f, 0f }                // better fixed movie position w/ lenses
+                                                                            : stereoDevice.getDefaultEyePositionOffset(); // default
+        System.err.println("Eye Position Offset: "+Arrays.toString(eyePositionOffset));
+
+        final int textureUnit = 0;
+        final int reqDistortionBits;
+        if( useRecommendedDistortionBits ) {
+            reqDistortionBits = stereoDevice.getRecommendedDistortionBits();
+        } else {
+            reqDistortionBits = ( useVignette ? StereoDeviceRenderer.DISTORTION_VIGNETTE : 0 ) |
+                             ( useChromatic ? StereoDeviceRenderer.DISTORTION_CHROMATIC : 0 ) |
+                             ( useTimewarp ? StereoDeviceRenderer.DISTORTION_TIMEWARP : 0 );
+        }
+        System.err.println("Requesting Distortion Bits: "+StereoUtil.distortionBitsToString(reqDistortionBits));
+
+        final float pixelsPerDisplayPixel = 1f;
+        final StereoDeviceRenderer stereoDeviceRenderer =
+                stereoDevice.createRenderer(reqDistortionBits, useSingleFBO ? 1 : 2, eyePositionOffset,
+                                            defaultEyeFov, pixelsPerDisplayPixel, textureUnit);
+        System.err.println("StereoDeviceRenderer: "+stereoDeviceRenderer);
+
+        final int texFilter = biLinear ? GL.GL_LINEAR : GL.GL_NEAREST;
+        final StereoClientRenderer renderer = new StereoClientRenderer(stereoDeviceRenderer, true /* ownsDist */, texFilter, texFilter, numSamples);
+        if( null != movieSimple && null != movieURI) {
+            movieSimple.setScaleOrig(true);
+            final GLMediaPlayer mp = movieSimple.getGLMediaPlayer();
+            mp.attachObject(MovieSimple.WINDOW_KEY, window);
+            mp.attachObject(MovieSBSStereo.STEREO_RENDERER_KEY, renderer);
+            mp.addEventListener(MovieSBSStereo.stereoGLMediaEventListener);
+            movieSimple.initStream(movieURI, GLMediaPlayer.STREAM_ID_AUTO, GLMediaPlayer.STREAM_ID_AUTO, 3);
+        } else {
+            renderer.addGLEventListener(upstream);
+        }
+        window.addGLEventListener(renderer);
+
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        window.addKeyListener(quitAdapter);
+        window.addWindowListener(quitAdapter);
+
+        window.addKeyListener(new KeyAdapter() {
+            public void keyReleased(final KeyEvent e)  {
+                if( e.isAutoRepeat() ) {
+                    return;
+                }
+                switch(e.getKeySymbol()) {
+                    case KeyEvent.VK_R: {
+                        stereoDevice.startSensors(!stereoDevice.getSensorsStarted());
+                        break;
+                    }
+                }
+            } } );
+
+        if( useAnimator ) {
+            animator.add(window);
+            animator.start();
+        }
+        window.setVisible(true);
+
+        // Correct window size to actual pixel size,
+        // which ration is unknown before window creation when using multiple displays!
+        System.err.println("Window.0.windowSize : "+window.getWidth()+" x "+window.getHeight());
+        System.err.println("Window.0.surfaceSize: "+window.getSurfaceWidth()+" x "+window.getSurfaceHeight());
+        window.setSurfaceSize(deviceRes.getWidth(), deviceRes.getHeight());
+        System.err.println("Window.1.windowSize : "+window.getWidth()+" x "+window.getHeight());
+        System.err.println("Window.1.surfaceSize: "+window.getSurfaceWidth()+" x "+window.getSurfaceHeight());
+
+        if( useAnimator ) {
+            animator.setUpdateFPSFrames(60, System.err);
+        }
+
+        final long t0 = System.currentTimeMillis();
+        long t1 = t0;
+        while(!quitAdapter.shouldQuit() && t1-t0<duration) {
+            Thread.sleep(100);
+            t1 = System.currentTimeMillis();
+        }
+
+        if( useAnimator ) {
+            animator.stop();
+        }
+        window.destroy();
+        stereoDevice.dispose();
+    }
+}
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashForm.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashForm.java
index 4b75376..e6cb487 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashForm.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashForm.java
@@ -44,6 +44,7 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
 import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
 
 import javax.media.nativewindow.util.Dimension;
@@ -136,7 +137,7 @@ public class TestBug672NewtCanvasSWTSashForm extends UITestCase {
                 display.dispose();
                }});
         }
-        catch( Throwable throwable ) {
+        catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -150,7 +151,7 @@ public class TestBug672NewtCanvasSWTSashForm extends UITestCase {
     class WaitAction implements Runnable {
         private final long sleepMS;
 
-        WaitAction(long sleepMS) {
+        WaitAction(final long sleepMS) {
             this.sleepMS = sleepMS;
         }
         public void run() {
@@ -158,41 +159,41 @@ public class TestBug672NewtCanvasSWTSashForm extends UITestCase {
                 // blocks on linux .. display.sleep();
                 try {
                     Thread.sleep(sleepMS);
-                } catch (InterruptedException e) { }
+                } catch (final InterruptedException e) { }
             }
         }
     }
     final WaitAction awtRobotWaitAction = new WaitAction(AWTRobotUtil.TIME_SLICE);
     final WaitAction generalWaitAction = new WaitAction(10);
 
-    protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
-        com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, screenIdx);
+    protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
+        final com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, screenIdx);
         final GLWindow glWindow = GLWindow.create(screen, caps);
         Assert.assertNotNull(glWindow);
 
         final GearsES2 demo = new GearsES2(1);
         glWindow.addGLEventListener(demo);
 
-        Animator animator = new Animator();
-        animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+        final Animator animator = new Animator();
+        animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
 
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
         glWindow.addKeyListener(quitAdapter);
         glWindow.addWindowListener(quitAdapter);
 
         glWindow.addWindowListener(new WindowAdapter() {
-            public void windowResized(WindowEvent e) {
-                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
+            public void windowResized(final WindowEvent e) {
+                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
             }
-            public void windowMoved(WindowEvent e) {
-                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
+            public void windowMoved(final WindowEvent e) {
+                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
             }
         });
 
         glWindow.addKeyListener(new KeyAdapter() {
-            public void keyReleased(KeyEvent e) {
+            public void keyReleased(final KeyEvent e) {
                 if( !e.isPrintableKey() || e.isAutoRepeat() ) {
                     return;
                 }
@@ -200,9 +201,9 @@ public class TestBug672NewtCanvasSWTSashForm extends UITestCase {
                     new Thread() {
                         public void run() {
                             final Thread t = glWindow.setExclusiveContextThread(null);
-                            System.err.println("[set fullscreen  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+                            System.err.println("[set fullscreen  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
                             glWindow.setFullscreen(!glWindow.isFullscreen());
-                            System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+                            System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
                             glWindow.setExclusiveContextThread(t);
                     } }.start();
                 }
@@ -232,7 +233,7 @@ public class TestBug672NewtCanvasSWTSashForm extends UITestCase {
 
         System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
         System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
-        System.err.println("window pos/siz.0: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
+        System.err.println("window pos/siz.0: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
         System.err.println("GLWindow LOS.0: "+glWindow.getLocationOnScreen(null));
         System.err.println("NewtCanvasSWT LOS.0: "+canvas1.getNativeWindow().getLocationOnScreen(null));
 
@@ -245,7 +246,7 @@ public class TestBug672NewtCanvasSWTSashForm extends UITestCase {
                   shell.setSize( rwsize.getWidth(), rwsize.getHeight() );
                }
             });
-            System.err.println("window resize pos/siz.1: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
+            System.err.println("window resize pos/siz.1: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
             System.err.println("GLWindow LOS.1: "+glWindow.getLocationOnScreen(null));
             System.err.println("NewtCanvasSWT LOS.1: "+canvas1.getNativeWindow().getLocationOnScreen(null));
         }
@@ -281,7 +282,7 @@ public class TestBug672NewtCanvasSWTSashForm extends UITestCase {
         runTestGL(caps);
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         int x=0, y=0, w=640, h=480, rw=-1, rh=-1;
         boolean usePos = false;
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashFormComposite.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashFormComposite.java
index 876eafe..944fa10 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashFormComposite.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestBug672NewtCanvasSWTSashFormComposite.java
@@ -44,6 +44,7 @@ import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
 import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.AnimatorBase;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
 
 import javax.media.nativewindow.util.Dimension;
@@ -142,7 +143,7 @@ public class TestBug672NewtCanvasSWTSashFormComposite extends UITestCase {
                 display.dispose();
                }});
         }
-        catch( Throwable throwable ) {
+        catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -157,7 +158,7 @@ public class TestBug672NewtCanvasSWTSashFormComposite extends UITestCase {
     class WaitAction implements Runnable {
         private final long sleepMS;
 
-        WaitAction(long sleepMS) {
+        WaitAction(final long sleepMS) {
             this.sleepMS = sleepMS;
         }
         public void run() {
@@ -165,41 +166,41 @@ public class TestBug672NewtCanvasSWTSashFormComposite extends UITestCase {
                 // blocks on linux .. display.sleep();
                 try {
                     Thread.sleep(sleepMS);
-                } catch (InterruptedException e) { }
+                } catch (final InterruptedException e) { }
             }
         }
     }
     final WaitAction awtRobotWaitAction = new WaitAction(AWTRobotUtil.TIME_SLICE);
     final WaitAction generalWaitAction = new WaitAction(10);
 
-    protected void runTestGL(GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
-        com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, screenIdx);
+    protected void runTestGL(final GLCapabilitiesImmutable caps) throws InterruptedException, InvocationTargetException {
+        final com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, screenIdx);
         final GLWindow glWindow = GLWindow.create(screen, caps);
         Assert.assertNotNull(glWindow);
 
         final GearsES2 demo = new GearsES2(1);
         glWindow.addGLEventListener(demo);
 
-        Animator animator = new Animator();
-        animator.setModeBits(false, Animator.MODE_EXPECT_AWT_RENDERING_THREAD);
+        final Animator animator = new Animator();
+        animator.setModeBits(false, AnimatorBase.MODE_EXPECT_AWT_RENDERING_THREAD);
 
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
         //glWindow.addKeyListener(new TraceKeyAdapter(quitAdapter));
         //glWindow.addWindowListener(new TraceWindowAdapter(quitAdapter));
         glWindow.addKeyListener(quitAdapter);
         glWindow.addWindowListener(quitAdapter);
 
         glWindow.addWindowListener(new WindowAdapter() {
-            public void windowResized(WindowEvent e) {
-                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
+            public void windowResized(final WindowEvent e) {
+                System.err.println("window resized: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
             }
-            public void windowMoved(WindowEvent e) {
-                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight());
+            public void windowMoved(final WindowEvent e) {
+                System.err.println("window moved:   "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight());
             }
         });
 
         glWindow.addKeyListener(new KeyAdapter() {
-            public void keyReleased(KeyEvent e) {
+            public void keyReleased(final KeyEvent e) {
                 if( !e.isPrintableKey() || e.isAutoRepeat() ) {
                     return;
                 }
@@ -207,9 +208,9 @@ public class TestBug672NewtCanvasSWTSashFormComposite extends UITestCase {
                     new Thread() {
                         public void run() {
                             final Thread t = glWindow.setExclusiveContextThread(null);
-                            System.err.println("[set fullscreen  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+                            System.err.println("[set fullscreen  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
                             glWindow.setFullscreen(!glWindow.isFullscreen());
-                            System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+                            System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
                             glWindow.setExclusiveContextThread(t);
                     } }.start();
                 }
@@ -239,7 +240,7 @@ public class TestBug672NewtCanvasSWTSashFormComposite extends UITestCase {
 
         System.err.println("NW chosen: "+glWindow.getDelegatedWindow().getChosenCapabilities());
         System.err.println("GL chosen: "+glWindow.getChosenCapabilities());
-        System.err.println("window pos/siz.0: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
+        System.err.println("window pos/siz.0: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
         System.err.println("GLWindow LOS.0: "+glWindow.getLocationOnScreen(null));
         System.err.println("NewtCanvasSWT LOS.0: "+canvas1.getNativeWindow().getLocationOnScreen(null));
 
@@ -252,7 +253,7 @@ public class TestBug672NewtCanvasSWTSashFormComposite extends UITestCase {
                   shell.setSize( rwsize.getWidth(), rwsize.getHeight() );
                }
             });
-            System.err.println("window resize pos/siz.1: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", "+glWindow.getInsets());
+            System.err.println("window resize pos/siz.1: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", "+glWindow.getInsets());
             System.err.println("GLWindow LOS.1: "+glWindow.getLocationOnScreen(null));
             System.err.println("NewtCanvasSWT LOS.1: "+canvas1.getNativeWindow().getLocationOnScreen(null));
         }
@@ -288,7 +289,7 @@ public class TestBug672NewtCanvasSWTSashFormComposite extends UITestCase {
         runTestGL(caps);
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         int x=0, y=0, w=640, h=480, rw=-1, rh=-1;
         boolean usePos = false;
 
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTBug628ResizeDeadlockAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTBug628ResizeDeadlockAWT.java
index be3a11b..fb563f9 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTBug628ResizeDeadlockAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTBug628ResizeDeadlockAWT.java
@@ -49,6 +49,7 @@ import javax.media.opengl.GLAutoDrawable ;
 import javax.media.opengl.GLCapabilities ;
 import javax.media.opengl.GLEventListener ;
 import javax.media.opengl.GLProfile;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 
 import com.jogamp.nativewindow.swt.SWTAccessor;
 import com.jogamp.newt.NewtFactory;
@@ -72,9 +73,9 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
     {
         float r = 0f, g = 0f, b = 0f;
 
-        public void init( GLAutoDrawable drawable )
+        public void init( final GLAutoDrawable drawable )
         {
-            GL2 gl = drawable.getGL().getGL2() ;
+            final GL2 gl = drawable.getGL().getGL2() ;
 
             gl.glClearColor( 0.0f, 0.0f, 0.0f, 1.0f ) ;
 
@@ -83,32 +84,32 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
             gl.glBlendFunc( GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA ) ;
         }
 
-        public void reshape( GLAutoDrawable drawable, int x, int y, int width, int height )
+        public void reshape( final GLAutoDrawable drawable, final int x, final int y, final int width, final int height )
         {
             // System.err.println( ">>>>>>>> reshape " + x + ", " + y + ", " + width + ", " +height ) ;
-            GL2 gl = drawable.getGL().getGL2() ;
+            final GL2 gl = drawable.getGL().getGL2() ;
 
             gl.glViewport( 0, 0, width, height ) ;
 
-            gl.glMatrixMode( GL2.GL_PROJECTION ) ;
+            gl.glMatrixMode( GLMatrixFunc.GL_PROJECTION ) ;
             gl.glLoadIdentity() ;
             gl.glOrtho( -1.0, 1.0, -1.0, 1.0, -1.0, 1.0 ) ;
 
-            gl.glMatrixMode( GL2.GL_MODELVIEW ) ;
+            gl.glMatrixMode( GLMatrixFunc.GL_MODELVIEW ) ;
             gl.glLoadIdentity() ;
         }
 
-        public void display( GLAutoDrawable drawable )
+        public void display( final GLAutoDrawable drawable )
         {
             // System.err.println( ">>>> display" ) ;
-            GL2 gl = drawable.getGL().getGL2() ;
+            final GL2 gl = drawable.getGL().getGL2() ;
 
             // Sven: I could have been seeing things, but it seemed that if this
             // glClear is in here twice it seems aggravates the problem.  Not
             // sure why other than it just takes longer, but this is pretty
             // fast operation.
-            gl.glClear( GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT ) ;
-            gl.glClear( GL2.GL_COLOR_BUFFER_BIT | GL2.GL_DEPTH_BUFFER_BIT ) ;
+            gl.glClear( GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT ) ;
+            gl.glClear( GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT ) ;
 
             gl.glColor4f( r, g, b, 1.0f ) ;
 
@@ -135,7 +136,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
             }
         }
 
-        public void dispose( GLAutoDrawable drawable )
+        public void dispose( final GLAutoDrawable drawable )
         {
         }
     }
@@ -147,7 +148,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
         private final Shell _shell ;
         private int _n ;
 
-        public ResizeThread( Shell shell )
+        public ResizeThread( final Shell shell )
         {
             super();
             _shell = shell ;
@@ -166,7 +167,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
                     } else {
                         _shell.setSize( 400, 450 ) ;
                     }
-                } catch (Exception e0) {
+                } catch (final Exception e0) {
                     e0.printStackTrace();
                     Assert.assertTrue("Deadlock @ setSize: "+e0, false);
                 }
@@ -196,7 +197,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
                     display.wake();
 
                     Thread.sleep( 50L ) ;
-                } catch( InterruptedException e ) {
+                } catch( final InterruptedException e ) {
                     break ;
                 }
             }
@@ -213,7 +214,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
         Robot _robot;
         int _n = 0;
 
-        public KeyfireThread(Robot robot, Display display)
+        public KeyfireThread(final Robot robot, final Display display)
         {
             _robot = robot;
             _display = display;
@@ -235,7 +236,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
                     if(!_display.isDisposed()) {
                         _display.wake();
                     }
-                } catch( InterruptedException e ) {
+                } catch( final InterruptedException e ) {
                     break ;
                 }
             }
@@ -287,7 +288,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
                     display.dispose();
                    }});
             }
-            catch( Throwable throwable ) {
+            catch( final Throwable throwable ) {
                 throwable.printStackTrace();
                 Assume.assumeNoException( throwable );
             }
@@ -299,7 +300,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
         class WaitAction implements Runnable {
             private final long sleepMS;
 
-            WaitAction(long sleepMS) {
+            WaitAction(final long sleepMS) {
                 this.sleepMS = sleepMS;
             }
             public void run() {
@@ -307,7 +308,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
                     // blocks on linux .. display.sleep();
                     try {
                         Thread.sleep(sleepMS);
-                    } catch (InterruptedException e) { }
+                    } catch (final InterruptedException e) { }
                 }
             }
         }
@@ -325,12 +326,12 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
         {
             final GLProfile gl2Profile = GLProfile.get( GLProfile.GL2 ) ;
             final GLCapabilities caps = new GLCapabilities( gl2Profile ) ;
-            com.jogamp.newt.Screen screen = NewtFactory.createScreen(dsc.swtNewtDisplay, 0);
+            final com.jogamp.newt.Screen screen = NewtFactory.createScreen(dsc.swtNewtDisplay, 0);
             glWindow = GLWindow.create( screen, caps ) ;
             glWindow.addGLEventListener( new BigFlashingX() ) ;
             glWindow.addKeyListener(new KeyAdapter() {
                 @Override
-                public void keyReleased(com.jogamp.newt.event.KeyEvent e) {
+                public void keyReleased(final com.jogamp.newt.event.KeyEvent e) {
                     if( !e.isPrintableKey() || e.isAutoRepeat() ) {
                         return;
                     }
@@ -372,17 +373,17 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
                 public void run() {
                     try {
                         Thread.sleep(duration);
-                    } catch (InterruptedException e) {}
+                    } catch (final InterruptedException e) {}
                     resizer.shallStop = true;
                     keyfire.shallStop = true;
                     try
                     {
                         resizer.join();
-                    } catch( InterruptedException e ) { }
+                    } catch( final InterruptedException e ) { }
                     try
                     {
                         keyfire.join();
-                    } catch( InterruptedException e ) { }
+                    } catch( final InterruptedException e ) { }
                     shallStop = true;
                     if( null != dsc.display && !dsc.display.isDisposed() )  {
                         dsc.display.wake();
@@ -400,11 +401,11 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
                            // blocks on linux .. dsc.display.sleep();
                            try {
                                Thread.sleep(10);
-                           } catch (InterruptedException ie) { ie.printStackTrace(); }
+                           } catch (final InterruptedException ie) { ie.printStackTrace(); }
                        }
                     } } );
             }
-        } catch (Exception e0) {
+        } catch (final Exception e0) {
             e0.printStackTrace();
             Assert.assertTrue("Deadlock @ dispatch: "+e0, false);
         }
@@ -414,7 +415,7 @@ public class TestNewtCanvasSWTBug628ResizeDeadlockAWT extends UITestCase {
         dsc.dispose();
     }
 
-    public static void main( String[] args ) {
+    public static void main( final String[] args ) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 duration = MiscUtils.atoi(args[++i],  duration);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTGLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTGLn.java
index 5426ab7..380bd3f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTGLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestNewtCanvasSWTGLn.java
@@ -128,7 +128,7 @@ public class TestNewtCanvasSWTGLn extends UITestCase {
                 display.dispose();
                }});
         }
-        catch( Throwable throwable ) {
+        catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -141,7 +141,7 @@ public class TestNewtCanvasSWTGLn extends UITestCase {
     class WaitAction implements Runnable {
         private final long sleepMS;
 
-        WaitAction(long sleepMS) {
+        WaitAction(final long sleepMS) {
             this.sleepMS = sleepMS;
         }
         public void run() {
@@ -149,15 +149,15 @@ public class TestNewtCanvasSWTGLn extends UITestCase {
                 // blocks on linux .. display.sleep();
                 try {
                     Thread.sleep(sleepMS);
-                } catch (InterruptedException e) { }
+                } catch (final InterruptedException e) { }
             }
         }
     }
     final WaitAction awtRobotWaitAction = new WaitAction(AWTRobotUtil.TIME_SLICE);
     final WaitAction generalWaitAction = new WaitAction(10);
 
-    protected void runTestAGL( GLCapabilitiesImmutable caps, GLEventListener demo,
-                               boolean postAttach, boolean useAnimator ) throws InterruptedException {
+    protected void runTestAGL( final GLCapabilitiesImmutable caps, final GLEventListener demo,
+                               final boolean postAttach, final boolean useAnimator ) throws InterruptedException {
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(false, false);
 
         final Screen screen = NewtFactory.createScreen(swtNewtDisplay, 0);
@@ -209,13 +209,13 @@ public class TestNewtCanvasSWTGLn extends UITestCase {
             anim = null;
         }
 
-        long lStartTime = System.currentTimeMillis();
-        long lEndTime = lStartTime + duration;
+        final long lStartTime = System.currentTimeMillis();
+        final long lEndTime = lStartTime + duration;
         try {
             while( (System.currentTimeMillis() < lEndTime) && !canvas1.isDisposed() ) {
                 generalWaitAction.run();
             }
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -243,13 +243,13 @@ public class TestNewtCanvasSWTGLn extends UITestCase {
 
     @Test
     public void test_MultisampleAndAlpha() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
         caps.setSampleBuffers(true);
         caps.setNumSamples(2);
         runTestAGL( caps, new MultisampleDemoES2(true), false /* postAttach */, false /* animator */);
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 duration = MiscUtils.atoi(args[++i],  duration);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAccessor03AWTGLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAccessor03AWTGLn.java
index 7cc19a7..f18e10b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAccessor03AWTGLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTAccessor03AWTGLn.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -85,7 +85,7 @@ public class TestSWTAccessor03AWTGLn extends UITestCase {
             UITestCase.setTestSupported(false);
             return;
         }
-        System.out.println( "GLProfile " + GLProfile.glAvailabilityToString() ); 
+        System.out.println( "GLProfile " + GLProfile.glAvailabilityToString() );
         final Frame f0 = new Frame("Test - AWT 1st");
         f0.add(new java.awt.Label("AWT was here 1st"));
         try {
@@ -94,7 +94,7 @@ public class TestSWTAccessor03AWTGLn extends UITestCase {
                     f0.pack();
                     f0.setVisible(true);
                 }});
-        } catch (Exception e) {
+        } catch (final Exception e) {
             throw new RuntimeException(e);
         }
         if(!GLProfile.isAvailable(GLProfile.GL2)) {
@@ -104,7 +104,7 @@ public class TestSWTAccessor03AWTGLn extends UITestCase {
 
     protected void init() throws InterruptedException, InvocationTargetException {
         SWTAccessor.invoke(true, new Runnable() {
-            public void run() {        
+            public void run() {
                 display = new Display();
                 Assert.assertNotNull( display );
                 shell = new Shell( display );
@@ -135,7 +135,7 @@ public class TestSWTAccessor03AWTGLn extends UITestCase {
          // Deadlocks Java7 on Windows
         // javax.swing.SwingUtilities.invokeAndWait( releaseAWT );
         releaseAWT.run();
-        
+
         SWTAccessor.invoke(true, new Runnable() {
             public void run() {
                 composite.dispose();
@@ -148,47 +148,47 @@ public class TestSWTAccessor03AWTGLn extends UITestCase {
             }});
     }
 
-    protected void runTestGL( GLProfile glprofile ) throws InterruptedException, InvocationTargetException {
+    protected void runTestGL( final GLProfile glprofile ) throws InterruptedException, InvocationTargetException {
         init();
         try {
-            GLCapabilities glcapabilities = new GLCapabilities( glprofile );
+            final GLCapabilities glcapabilities = new GLCapabilities( glprofile );
             glcanvas = new GLCanvas( glcapabilities );
             Assert.assertNotNull( glcanvas );
             frame.add( glcanvas );
-    
+
             glcanvas.addGLEventListener( new GLEventListener() {
                 /* @Override */
-                public void init( GLAutoDrawable glautodrawable ) {
+                public void init( final GLAutoDrawable glautodrawable ) {
                 }
-    
+
                 /* @Override */
-                public void dispose( GLAutoDrawable glautodrawable ) {
+                public void dispose( final GLAutoDrawable glautodrawable ) {
                 }
-    
+
                 /* @Override */
-                public void display( GLAutoDrawable glautodrawable ) {
-                    Rectangle rectangle = new Rectangle( 0, 0, glautodrawable.getWidth(), glautodrawable.getHeight() );
-                    GL2ES1 gl = glautodrawable.getGL().getGL2ES1();
+                public void display( final GLAutoDrawable glautodrawable ) {
+                    final Rectangle rectangle = new Rectangle( 0, 0, glautodrawable.getSurfaceWidth(), glautodrawable.getSurfaceHeight() );
+                    final GL2ES1 gl = glautodrawable.getGL().getGL2ES1();
                     OneTriangle.render( gl, rectangle.width, rectangle.height );
                 }
-    
+
                 /* @Override */
-                public void reshape( GLAutoDrawable glautodrawable, int x, int y, int width, int height ) {
-                    Rectangle rectangle = new Rectangle( 0, 0, glautodrawable.getWidth(), glautodrawable.getHeight() );
-                    GL2ES1 gl = glautodrawable.getGL().getGL2ES1();
+                public void reshape( final GLAutoDrawable glautodrawable, final int x, final int y, final int width, final int height ) {
+                    final Rectangle rectangle = new Rectangle( 0, 0, glautodrawable.getSurfaceWidth(), glautodrawable.getSurfaceHeight() );
+                    final GL2ES1 gl = glautodrawable.getGL().getGL2ES1();
                     OneTriangle.setup( gl, rectangle.width, rectangle.height );
                 }
             });
-    
+
             SWTAccessor.invoke(true, new Runnable() {
                 public void run() {
                     shell.setText( getClass().getName() );
                     shell.setSize( 640, 480 );
                     shell.open();
                 }});
-    
-            long lStartTime = System.currentTimeMillis();
-            long lEndTime = lStartTime + duration;
+
+            final long lStartTime = System.currentTimeMillis();
+            final long lEndTime = lStartTime + duration;
             try {
                 while( (System.currentTimeMillis() < lEndTime) && !composite.isDisposed() ) {
                     SWTAccessor.invoke(true, new Runnable() {
@@ -197,12 +197,12 @@ public class TestSWTAccessor03AWTGLn extends UITestCase {
                                 // blocks on linux .. display.sleep();
                                 try {
                                     Thread.sleep(10);
-                                } catch (InterruptedException e) { }
+                                } catch (final InterruptedException e) { }
                             }
                         }});
                 }
             }
-            catch( Throwable throwable ) {
+            catch( final Throwable throwable ) {
                 throwable.printStackTrace();
                 Assume.assumeNoException( throwable );
             }
@@ -213,11 +213,11 @@ public class TestSWTAccessor03AWTGLn extends UITestCase {
 
     @Test
     public void test() throws InterruptedException, InvocationTargetException {
-        GLProfile glprofile = GLProfile.getGL2ES1();
+        final GLProfile glprofile = GLProfile.getGL2ES1();
         runTestGL( glprofile );
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 duration = MiscUtils.atoi(args[++i], duration);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTBug643AsyncExec.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTBug643AsyncExec.java
index fd6d370..7b64838 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTBug643AsyncExec.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTBug643AsyncExec.java
@@ -116,7 +116,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
         private final jogamp.newt.DisplayImpl newtDisplay;
         private int swtN, newtN ;
 
-        public AsyncExecEDTFeederThread( Display swtDisplay, com.jogamp.newt.Display newtDisplay )
+        public AsyncExecEDTFeederThread( final Display swtDisplay, final com.jogamp.newt.Display newtDisplay )
         {
             super();
             this.swtDisplay = swtDisplay ;
@@ -153,7 +153,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
                         newtDisplay.runOnEDTIfAvail(false, newtAsyncAction);
                     }
                     Thread.sleep( 50L ) ;
-                } catch( InterruptedException e ) {
+                } catch( final InterruptedException e ) {
                     break ;
                 }
             }
@@ -203,7 +203,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
                     display.dispose();
                    }});
             }
-            catch( Throwable throwable ) {
+            catch( final Throwable throwable ) {
                 throwable.printStackTrace();
                 Assume.assumeNoException( throwable );
             }
@@ -213,7 +213,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
         }
     }
 
-    private void testImpl(boolean useJOGLGLCanvas, boolean useNewtCanvasSWT, boolean glWindowPreVisible) throws InterruptedException, InvocationTargetException {
+    private void testImpl(final boolean useJOGLGLCanvas, final boolean useNewtCanvasSWT, final boolean glWindowPreVisible) throws InterruptedException, InvocationTargetException {
         resetSWTAndNEWTEDTCounter();
 
         final SWT_DSC dsc = new SWT_DSC();
@@ -235,7 +235,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
                 newtDisplay = null;
             } else if( useNewtCanvasSWT ) {
                 newtDisplay = NewtFactory.createDisplay(null, false); // no-reuse
-                com.jogamp.newt.Screen screen = NewtFactory.createScreen(newtDisplay, 0);
+                final com.jogamp.newt.Screen screen = NewtFactory.createScreen(newtDisplay, 0);
                 final GLWindow glWindow = GLWindow.create( screen, caps ) ;
                 glWindow.addGLEventListener( new GearsES2() ) ;
                 if( glWindowPreVisible ) {
@@ -250,7 +250,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
                 throw new InternalError("XXX");
             }
             if(useAnimator) {
-                Animator animator = new Animator(glad);
+                final Animator animator = new Animator(glad);
                 animator.start();
             }
         }
@@ -280,7 +280,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
                 public void run() {
                     try {
                         Thread.sleep(duration);
-                    } catch (InterruptedException e) {}
+                    } catch (final InterruptedException e) {}
 
                     counterBeforeExit[0] = getSWTCount();
                     counterBeforeExit[1] = getNEWTCount();
@@ -288,7 +288,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
                     try
                     {
                         asyncExecFeeder.join();
-                    } catch( InterruptedException e ) { }
+                    } catch( final InterruptedException e ) { }
                     shallStop = true;
                     dsc.display.wake();
                 } } );
@@ -304,7 +304,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
                     Thread.sleep(10);
                 }
             }
-        } catch (Exception e0) {
+        } catch (final Exception e0) {
             e0.printStackTrace();
             Assert.assertTrue("Deadlock @ dispatch: "+e0, false);
         }
@@ -335,7 +335,7 @@ public class TestSWTBug643AsyncExec extends UITestCase {
         testImpl(false /* useJOGLGLCanvas */, true /* useNewtCanvasSWT */, true /* glWindowPreVisible */);
     }
 
-    public static void main( String[] args ) {
+    public static void main( final String[] args ) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 duration = MiscUtils.atoi(args[++i],  duration);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTEclipseGLCanvas01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTEclipseGLCanvas01GLn.java
index b0acbed..69911c5 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTEclipseGLCanvas01GLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTEclipseGLCanvas01GLn.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.swt;
 
 import javax.media.opengl.GL2ES1;
@@ -61,7 +61,7 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 
 /**
  * Tests that a basic SWT app can open without crashing under different GL profiles.
- * <p> 
+ * <p>
  * Uses the SWT GLCanvas <code>org.eclipse.swt.opengl.GLCanvas</code>.
  * </p>
  * @author Wade Walker, et.al.
@@ -86,7 +86,7 @@ public class TestSWTEclipseGLCanvas01GLn extends UITestCase {
     @Before
     public void init() {
         SWTAccessor.invoke(true, new Runnable() {
-            public void run() {        
+            public void run() {
                 display = new Display();
                 Assert.assertNotNull( display );
                 shell = new Shell( display );
@@ -111,7 +111,7 @@ public class TestSWTEclipseGLCanvas01GLn extends UITestCase {
                 display.dispose();
                }});
         }
-        catch( Throwable throwable ) {
+        catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -120,8 +120,8 @@ public class TestSWTEclipseGLCanvas01GLn extends UITestCase {
         composite = null;
     }
 
-    protected void runTestAGL( GLProfile glprofile ) throws InterruptedException {
-        GLData gldata = new GLData();
+    protected void runTestAGL( final GLProfile glprofile ) throws InterruptedException {
+        final GLData gldata = new GLData();
         gldata.doubleBuffer = true;
         // need SWT.NO_BACKGROUND to prevent SWT from clearing the window
         // at the wrong times (we use glClear for this instead)
@@ -133,11 +133,11 @@ public class TestSWTEclipseGLCanvas01GLn extends UITestCase {
 
         // fix the viewport when the user resizes the window
         glcanvas.addListener( SWT.Resize, new Listener() {
-            public void handleEvent( Event event ) {
-                Rectangle rectangle = glcanvas.getClientArea();
+            public void handleEvent( final Event event ) {
+                final Rectangle rectangle = glcanvas.getClientArea();
                 glcanvas.setCurrent();
                 glcontext.makeCurrent();
-                GL2ES1 gl = glcontext.getGL().getGL2ES1();
+                final GL2ES1 gl = glcontext.getGL().getGL2ES1();
                 OneTriangle.setup( gl, rectangle.width, rectangle.height );
                 glcontext.release();
                 System.err.println("resize");
@@ -146,24 +146,24 @@ public class TestSWTEclipseGLCanvas01GLn extends UITestCase {
 
         // draw the triangle when the OS tells us that any part of the window needs drawing
         glcanvas.addPaintListener( new PaintListener() {
-            public void paintControl( PaintEvent paintevent ) {
-                Rectangle rectangle = glcanvas.getClientArea();
+            public void paintControl( final PaintEvent paintevent ) {
+                final Rectangle rectangle = glcanvas.getClientArea();
                 glcanvas.setCurrent();
                 glcontext.makeCurrent();
-                GL2ES1 gl = glcontext.getGL().getGL2ES1();
+                final GL2ES1 gl = glcontext.getGL().getGL2ES1();
                 OneTriangle.render( gl, rectangle.width, rectangle.height );
                 glcanvas.swapBuffers();
                 glcontext.release();
                 System.err.println("paint");
             }
         });
-        
+
         shell.setText( getClass().getName() );
         shell.setSize( 640, 480 );
         shell.open();
 
-        long lStartTime = System.currentTimeMillis();
-        long lEndTime = lStartTime + duration;
+        final long lStartTime = System.currentTimeMillis();
+        final long lEndTime = lStartTime + duration;
         try {
             while( (System.currentTimeMillis() < lEndTime) && !glcanvas.isDisposed() ) {
                 if( !display.readAndDispatch() ) {
@@ -171,7 +171,7 @@ public class TestSWTEclipseGLCanvas01GLn extends UITestCase {
                     Thread.sleep(10);
                 }
             }
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -180,19 +180,19 @@ public class TestSWTEclipseGLCanvas01GLn extends UITestCase {
 
     @Test
     public void test() throws InterruptedException {
-        GLProfile glprofile = GLProfile.getGL2ES1();
+        final GLProfile glprofile = GLProfile.getGL2ES1();
         runTestAGL( glprofile );
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 duration = atoi(args[++i]);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTJOGLGLCanvas01GLn.java b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTJOGLGLCanvas01GLn.java
index b38bf0c..04ffdcb 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTJOGLGLCanvas01GLn.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/swt/TestSWTJOGLGLCanvas01GLn.java
@@ -123,7 +123,7 @@ public class TestSWTJOGLGLCanvas01GLn extends UITestCase {
                 display.dispose();
                }});
         }
-        catch( Throwable throwable ) {
+        catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -132,7 +132,7 @@ public class TestSWTJOGLGLCanvas01GLn extends UITestCase {
         composite = null;
     }
 
-    protected void runTestAGL( GLCapabilitiesImmutable caps, GLEventListener demo ) throws InterruptedException {
+    protected void runTestAGL( final GLCapabilitiesImmutable caps, final GLEventListener demo ) throws InterruptedException {
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(false, false);
 
         final GLCanvas canvas = GLCanvas.create( composite, 0, caps, null);
@@ -158,14 +158,14 @@ public class TestSWTJOGLGLCanvas01GLn extends UITestCase {
             shell.open();
            } } );
 
-        Animator anim = new Animator();
+        final Animator anim = new Animator();
         if(doAnimation) {
             anim.add(canvas);
             anim.start();
         }
 
-        long lStartTime = System.currentTimeMillis();
-        long lEndTime = lStartTime + duration;
+        final long lStartTime = System.currentTimeMillis();
+        final long lEndTime = lStartTime + duration;
         try {
             while( (System.currentTimeMillis() < lEndTime) && !canvas.isDisposed() ) {
                 if( !display.readAndDispatch() ) {
@@ -173,7 +173,7 @@ public class TestSWTJOGLGLCanvas01GLn extends UITestCase {
                     Thread.sleep(10);
                 }
             }
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -193,21 +193,21 @@ public class TestSWTJOGLGLCanvas01GLn extends UITestCase {
 
     @Test
     public void test_MultisampleAndAlpha() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
+        final GLCapabilities caps = new GLCapabilities(GLProfile.getGL2ES2());
         caps.setSampleBuffers(true);
         caps.setNumSamples(2);
         runTestAGL( caps, new MultisampleDemoES2(true) );
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 duration = atoi(args[++i]);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/OffscreenPrintable.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/OffscreenPrintable.java
index 78fdde3..a59662b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/OffscreenPrintable.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/OffscreenPrintable.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -50,7 +50,7 @@ import com.jogamp.opengl.util.TileRenderer;
 /**
  * {@link Printable} implementation using NIO {@link DirectDataBufferInt} {@link BufferedImage}
  * for offscreen rendered printing.
- *  
+ *
  * @see OnscreenPrintable
  * @see PrintableBase
  */
@@ -58,30 +58,30 @@ public class OffscreenPrintable extends PrintableBase implements Printable {
 
     public final int imageType;
     public final String pngFilename;
-    
+
     /**
-     * 
+     *
      * @param job
      * @param printContainer
      * @param printDPI
      * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
      * @param tileWidth custom tile width for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
      * @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
-     * @param imageType AWT BufferedImage type (must be one of the integer types) 
+     * @param imageType AWT BufferedImage type (must be one of the integer types)
      * @param pngFilename TODO
      */
-    public OffscreenPrintable(PrinterJob job, Container printContainer, int printDPI, int numSamples, int tileWidth, int tileHeight, int imageType, String pngFilename) {
+    public OffscreenPrintable(final PrinterJob job, final Container printContainer, final int printDPI, final int numSamples, final int tileWidth, final int tileHeight, final int imageType, final String pngFilename) {
         super(job, printContainer, printDPI, numSamples, tileWidth, tileHeight);
         this.imageType = imageType;
         this.pngFilename = pngFilename;
     }
-    
+
     @Override
-    public int print(Graphics g, PageFormat pf, int page) throws PrinterException {
+    public int print(final Graphics g, final PageFormat pf, final int page) throws PrinterException {
         if (page > 0) { // We have only one page, and 'page' is zero-based
             return NO_SUCH_PAGE;
         }
-        
+
         lockPrinting.lock();
         try {
             final Paper paper = pf.getPaper();
@@ -93,58 +93,58 @@ public class OffscreenPrintable extends PrintableBase implements Printable {
             final double paperWHeightMM = paperWHeightInch * MM_PER_INCH;
             final double paperIWidthMM = paperIWidthInch * MM_PER_INCH;
             final double paperIHeightMM = paperIHeightInch * MM_PER_INCH;
-            
-            final double pfWWidthInch = pf.getWidth() / 72.0; 
+
+            final double pfWWidthInch = pf.getWidth() / 72.0;
             final double pfWHeightInch = pf.getHeight() / 72.0;
-            final double pfIWidthInch = pf.getImageableWidth() / 72.0; 
+            final double pfIWidthInch = pf.getImageableWidth() / 72.0;
             final double pfIHeightInch = pf.getImageableHeight() / 72.0;
-            final double pfWWidthMM = pfWWidthInch * MM_PER_INCH; 
+            final double pfWWidthMM = pfWWidthInch * MM_PER_INCH;
             final double pfWHeightMM = pfWHeightInch * MM_PER_INCH;
-            final double pfIWidthMM = pfIWidthInch * MM_PER_INCH; 
+            final double pfIWidthMM = pfIWidthInch * MM_PER_INCH;
             final double pfIHeightMM = pfIHeightInch * MM_PER_INCH;
-            
+
             System.err.println("PF: Paper whole size "+
                     Math.round(paperWWidthMM)+" x "+Math.round(paperWHeightMM)+" mm, "+
                     Math.round(paperWWidthInch)+" x "+Math.round(paperWHeightInch)+" inch");
-            
+
             System.err.println("PF: Paper image size "+paper.getImageableX()+" / "+paper.getImageableY()+" "+
                     Math.round(paperIWidthMM)+" x "+Math.round(paperIHeightMM)+" mm, "+
                     Math.round(paperIWidthInch)+" x "+Math.round(paperIHeightInch)+" inch, "+
                     Math.round(paper.getImageableWidth())+"x"+Math.round(paper.getImageableHeight())+" 72dpi dots");
-            
+
             System.err.println("PF: Page  whole size "+
                         Math.round(pfWWidthMM)+" x "+Math.round(pfWHeightMM)+" mm, "+
                         Math.round(pfWWidthInch)+" x "+Math.round(pfWHeightInch)+" inch");
-            
+
             System.err.println("PF: Page  image size "+pf.getImageableX()+" / "+pf.getImageableY()+" "+
                     Math.round(pfIWidthMM)+" x "+Math.round(pfIHeightMM)+" mm, "+
                     Math.round(pfIWidthInch)+" x "+Math.round(pfIHeightInch)+" inch, "+
                     Math.round(pf.getImageableWidth())+"x"+Math.round(pf.getImageableHeight())+" 72dpi dots");
-            
+
             System.err.println("PF: Page orientation "+pf.getOrientation());
-            
+
             /**
              * See: 'Scaling of Frame and GL content' in Class description!
              * Note: Frame size contains the frame border (i.e. insets)!
-             */                
+             */
             final Insets frameInsets = cont.getInsets();
             final int frameWidth = cont.getWidth();
             final int frameHeight= cont.getHeight();
             final double scaleGraphics = dpi / 72.0;
-            final int frameSWidth = (int) ( frameWidth * scaleGraphics ); 
+            final int frameSWidth = (int) ( frameWidth * scaleGraphics );
             final int frameSHeight = (int) ( frameHeight * scaleGraphics );
             final double scaleComp72;
             {
-                final double sx = pf.getImageableWidth() / (double)frameSWidth; 
-                final double sy = pf.getImageableHeight() / (double)frameSHeight;
+                final double sx = pf.getImageableWidth() / frameSWidth;
+                final double sy = pf.getImageableHeight() / frameSHeight;
                 scaleComp72 = Math.min(sx, sy);
             }
-            
+
             System.err.println("PRINT.offscrn thread "+Thread.currentThread().getName());
             System.err.println("PRINT.offscrn DPI: scaleGraphics "+scaleGraphics+", scaleComp72 "+scaleComp72);
             System.err.println("PRINT.offscrn DPI: frame: border "+frameInsets+", size "+frameWidth+"x"+frameHeight+
                     " -> scaled "+frameSWidth+ "x" + frameSHeight);
-                        
+
             final BufferedImage image = DirectDataBufferInt.createBufferedImage(frameSWidth, frameSHeight, imageType, null /* location */, null /* properties */);
             {
                 System.err.println("PRINT.offscrn image "+image);
@@ -163,16 +163,16 @@ public class OffscreenPrintable extends PrintableBase implements Printable {
                 final File fout = new File(pngFilename);
                 try {
                     ImageIO.write(image, "png", fout);
-                } catch (IOException e) {
+                } catch (final IOException e) {
                     e.printStackTrace();
                 }
             }
-            
+
             final Graphics2D g2d = (Graphics2D)g;
             g2d.translate(pf.getImageableX(), pf.getImageableY());
             g2d.scale(scaleComp72, scaleComp72);
             g2d.drawImage(image, 0, 0, image.getWidth(), image.getHeight(), null); // Null ImageObserver since image data is ready.
-                        
+
             /* tell the caller that this page is part of the printed document */
             return PAGE_EXISTS;
         } finally {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/OnscreenPrintable.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/OnscreenPrintable.java
index 6f73ef2..228fa81 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/OnscreenPrintable.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/OnscreenPrintable.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -62,25 +62,25 @@ import com.jogamp.opengl.util.TileRenderer;
 public class OnscreenPrintable extends PrintableBase implements Printable {
 
     /**
-     * 
+     *
      * @param job
      * @param printContainer
      * @param printDPI
-     * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples 
+     * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
      * @param tileWidth custom tile width for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
      * @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
      */
-    public OnscreenPrintable(PrinterJob job, Container printContainer, int printDPI, int numSamples, int tileWidth, int tileHeight) {
+    public OnscreenPrintable(final PrinterJob job, final Container printContainer, final int printDPI, final int numSamples, final int tileWidth, final int tileHeight) {
         super(job, printContainer, printDPI, numSamples, tileWidth, tileHeight);
     }
-    
-    
+
+
     @Override
-    public int print(Graphics g, PageFormat pf, int page) throws PrinterException {
+    public int print(final Graphics g, final PageFormat pf, final int page) throws PrinterException {
         if (page > 0) { // We have only one page, and 'page' is zero-based
             return NO_SUCH_PAGE;
         }
-        
+
         lockPrinting.lock();
         try {
             final Paper paper = pf.getPaper();
@@ -92,70 +92,70 @@ public class OnscreenPrintable extends PrintableBase implements Printable {
             final double paperWHeightMM = paperWHeightInch * MM_PER_INCH;
             final double paperIWidthMM = paperIWidthInch * MM_PER_INCH;
             final double paperIHeightMM = paperIHeightInch * MM_PER_INCH;
-            
-            final double pfWWidthInch = pf.getWidth() / 72.0; 
+
+            final double pfWWidthInch = pf.getWidth() / 72.0;
             final double pfWHeightInch = pf.getHeight() / 72.0;
-            final double pfIWidthInch = pf.getImageableWidth() / 72.0; 
+            final double pfIWidthInch = pf.getImageableWidth() / 72.0;
             final double pfIHeightInch = pf.getImageableHeight() / 72.0;
-            final double pfWWidthMM = pfWWidthInch * MM_PER_INCH; 
+            final double pfWWidthMM = pfWWidthInch * MM_PER_INCH;
             final double pfWHeightMM = pfWHeightInch * MM_PER_INCH;
-            final double pfIWidthMM = pfIWidthInch * MM_PER_INCH; 
+            final double pfIWidthMM = pfIWidthInch * MM_PER_INCH;
             final double pfIHeightMM = pfIHeightInch * MM_PER_INCH;
-            
+
             System.err.println("PF: Paper whole size "+
                     Math.round(paperWWidthMM)+" x "+Math.round(paperWHeightMM)+" mm, "+
                     Math.round(paperWWidthInch)+" x "+Math.round(paperWHeightInch)+" inch");
-            
+
             System.err.println("PF: Paper image size "+paper.getImageableX()+" / "+paper.getImageableY()+" "+
                     Math.round(paperIWidthMM)+" x "+Math.round(paperIHeightMM)+" mm, "+
                     Math.round(paperIWidthInch)+" x "+Math.round(paperIHeightInch)+" inch, "+
                     Math.round(paper.getImageableWidth())+"x"+Math.round(paper.getImageableHeight())+" 72dpi dots");
-            
+
             System.err.println("PF: Page  whole size "+
                         Math.round(pfWWidthMM)+" x "+Math.round(pfWHeightMM)+" mm, "+
                         Math.round(pfWWidthInch)+" x "+Math.round(pfWHeightInch)+" inch");
-            
+
             System.err.println("PF: Page  image size "+pf.getImageableX()+" / "+pf.getImageableY()+" "+
                     Math.round(pfIWidthMM)+" x "+Math.round(pfIHeightMM)+" mm, "+
                     Math.round(pfIWidthInch)+" x "+Math.round(pfIHeightInch)+" inch, "+
                     Math.round(pf.getImageableWidth())+"x"+Math.round(pf.getImageableHeight())+" 72dpi dots");
-            
+
             System.err.println("PF: Page orientation "+pf.getOrientation());
-            
+
             /**
              * See: 'Scaling of Frame and GL content' in Class description!
              * Note: Frame size contains the frame border (i.e. insets)!
-             */                
+             */
             final Insets frameInsets = cont.getInsets();
             final int frameWidth = cont.getWidth();
             final int frameHeight= cont.getHeight();
             final double scaleGraphics = dpi / 72.0;
-            final int frameSWidth = (int) ( frameWidth * scaleGraphics ); 
+            final int frameSWidth = (int) ( frameWidth * scaleGraphics );
             final int frameSHeight = (int) ( frameHeight * scaleGraphics );
             final double scaleComp72;
             {
-                final double sx = pf.getImageableWidth() / (double)frameWidth; 
-                final double sy = pf.getImageableHeight() / (double)frameHeight;
+                final double sx = pf.getImageableWidth() / frameWidth;
+                final double sy = pf.getImageableHeight() / frameHeight;
                 scaleComp72 = Math.min(sx, sy);
-            }            
+            }
             System.err.println("PRINT.onscrn thread "+Thread.currentThread().getName());
             System.err.println("PRINT.onscrn DPI: scaleGraphics "+scaleGraphics+", scaleComp72 "+scaleComp72);
             System.err.println("PRINT.onscrn DPI: frame: border "+frameInsets+", size "+frameWidth+"x"+frameHeight+
                     " -> scaled "+frameSWidth+ "x" + frameSHeight);
-                        
+
             final Graphics2D g2d = (Graphics2D)g;
             System.err.println("PRINT at.pre: "+g2d.getTransform());
             g2d.translate(pf.getImageableX(), pf.getImageableY());
             g2d.scale(scaleComp72, scaleComp72); // WARNING: Produces rounding artifacts due to diff scale-factor of AWT/GL comps !!!
             // g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
             g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
-            
+
             AWTEDTExecutor.singleton.invoke(true, new Runnable() {
                 public void run() {
                     cont.printAll(g2d);
                }
             });
-            
+
             /* tell the caller that this page is part of the printed document */
             return PAGE_EXISTS;
         } finally {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/PrintableBase.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/PrintableBase.java
index dd9de60..39cc4fb 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/PrintableBase.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/PrintableBase.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -37,7 +37,7 @@ import com.jogamp.opengl.util.TileRenderer;
 
 /**
  * Base {@link Printable} implementation class.
- * 
+ *
  * <h5>Virtual printer driver</h5>
  * <p>
  * Note, on OSX you might need to setup a dummy printer, i.e. <i>print to file</i>.<br>
@@ -54,7 +54,7 @@ import com.jogamp.opengl.util.TileRenderer;
 public abstract class PrintableBase implements Printable {
 
     public static final double MM_PER_INCH = 25.4;
-    
+
     public final PrinterJob job;
     public final Container cont;
     public final int dpi;
@@ -63,15 +63,15 @@ public abstract class PrintableBase implements Printable {
     protected final RecursiveLock lockPrinting = LockFactory.createRecursiveLock();
 
     /**
-     * 
+     *
      * @param job
      * @param printContainer
      * @param printDPI
-     * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples 
+     * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
      * @param tileWidth custom tile width for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
      * @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
      */
-    public PrintableBase(PrinterJob job, Container printContainer, int printDPI, int numSamples, int tileWidth, int tileHeight) {
+    public PrintableBase(final PrinterJob job, final Container printContainer, final int printDPI, final int numSamples, final int tileWidth, final int tileHeight) {
         this.job = job;
         this.cont = printContainer;
         this.dpi = printDPI;
@@ -79,10 +79,10 @@ public abstract class PrintableBase implements Printable {
         this.tileWidth = tileWidth;
         this.tileHeight = tileHeight;
     }
-    
+
     /** Wait for idle .. simply acquiring all locks and releasing them. */
     public void waitUntilIdle() {
         lockPrinting.lock();
         lockPrinting.unlock();
-    }    
+    }
 }
\ No newline at end of file
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering2GL2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering2GL2NEWT.java
index 16c1b33..5464200 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering2GL2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering2GL2NEWT.java
@@ -83,7 +83,7 @@ public class TestRandomTiledRendering2GL2NEWT extends UITestCase {
         doTest(8);
     }
 
-    void doTest(int msaaCount) throws IOException, InterruptedException, InvocationTargetException {
+    void doTest(final int msaaCount) throws IOException, InterruptedException, InvocationTargetException {
         final GLCapabilities caps = new GLCapabilities(null);
         caps.setDoubleBuffered(true);
         if( msaaCount > 0 ) {
@@ -115,10 +115,10 @@ public class TestRandomTiledRendering2GL2NEWT extends UITestCase {
 
         final GLEventListener preTileGLEL = new GLEventListener() {
             @Override
-            public void init(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {
                 final GL gl = drawable.getGL();
-                GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
-                GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
+                final GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
+                final GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
                 renderer.setImageBuffer(pixelBuffer);
                 if( drawable.isGLOriented() ) {
                     flipVertically[0] = false;
@@ -127,11 +127,11 @@ public class TestRandomTiledRendering2GL2NEWT extends UITestCase {
                 }
             }
             @Override
-            public void dispose(GLAutoDrawable drawable) {}
+            public void dispose(final GLAutoDrawable drawable) {}
             @Override
-            public void display(GLAutoDrawable drawable) {}
+            public void display(final GLAutoDrawable drawable) {}
             @Override
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
         };
         renderer.setGLEventListener(preTileGLEL, null);
 
@@ -152,9 +152,9 @@ public class TestRandomTiledRendering2GL2NEWT extends UITestCase {
         // .. even though we close the demo, this is for documentation!
         glad.invoke(true, new GLRunnable() {
             @Override
-            public boolean run(GLAutoDrawable drawable) {
-                drawable.getGL().glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
-                gears.reshape(drawable, 0, 0, drawable.getWidth(), drawable.getHeight());
+            public boolean run(final GLAutoDrawable drawable) {
+                drawable.getGL().glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
+                gears.reshape(drawable, 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
                 return false;
             }
         });
@@ -179,13 +179,13 @@ public class TestRandomTiledRendering2GL2NEWT extends UITestCase {
         TextureIO.write(textureData, file);
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         org.junit.runner.JUnitCore.main(TestRandomTiledRendering2GL2NEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering3GL2AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering3GL2AWT.java
index 7d3f1f6..b128f86 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering3GL2AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestRandomTiledRendering3GL2AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -60,21 +60,21 @@ import org.junit.Test;
 import org.junit.runners.MethodSorters;
 
 /**
- * Demos an onscreen AWT {@link GLCanvas} being used for 
+ * Demos an onscreen AWT {@link GLCanvas} being used for
  * {@link RandomTileRenderer} rendering to produce a PNG file.
  * <p>
  * {@link RandomTileRenderer} is being kicked off from the main thread.
  * </p>
  * <p>
  * {@link RandomTileRenderer} setup and finishing is performed
- * within the pre- and post {@link GLEventListener} 
+ * within the pre- and post {@link GLEventListener}
  * set via {@link TileRendererBase#setGLEventListener(GLEventListener, GLEventListener)}
- * on the animation thread. 
+ * on the animation thread.
  * </p>
  * <p>
  * At tile rendering finish, the viewport and
  * and the original {@link GLEventListener}'s PMV matrix as well.
- * The latter is done by calling it's {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape} method. 
+ * The latter is done by calling it's {@link GLEventListener#reshape(GLAutoDrawable, int, int, int, int) reshape} method.
  * </p>
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
@@ -82,7 +82,7 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
     static long duration = 3500; // ms
     static int width  = 512;
     static int height = 512;
-    
+
     @Test
     public void test01_aa0() throws IOException, InterruptedException, InvocationTargetException {
         doTest(0);
@@ -92,7 +92,7 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
         doTest(8);
     }
 
-    void doTest(int msaaCount) throws IOException, InterruptedException, InvocationTargetException {      
+    void doTest(final int msaaCount) throws IOException, InterruptedException, InvocationTargetException {
         final GLCapabilities caps = new GLCapabilities(null);
         if( msaaCount > 0 ) {
             caps.setSampleBuffers(true);
@@ -104,7 +104,7 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
 
         final GLCanvas glad = new GLCanvas(caps);
         Assert.assertNotNull(glad);
-        Dimension glc_sz = new Dimension(width, height);
+        final Dimension glc_sz = new Dimension(width, height);
         glad.setMinimumSize(glc_sz);
         glad.setPreferredSize(glc_sz);
         glad.setSize(glc_sz);
@@ -113,11 +113,9 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
         final Gears gears = new Gears();
         glad.addGLEventListener( gears );
 
-        final Animator animator = new Animator(glad);
         final QuitAdapter quitAdapter = new QuitAdapter();
-
-        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(glad);
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter), glad).addTo(glad);
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glad).addTo(frame);
 
         // Fix the image size for now
         final int maxTileSize = 64;
@@ -134,12 +132,12 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
         final GLEventListener preTileGLEL = new GLEventListener() {
             final int w = maxTileSize, h = maxTileSize;
             int dx = 0, dy = 0;
-            
+
             @Override
-            public void init(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {
                 final GL gl = drawable.getGL();
-                GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
-                GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
+                final GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
+                final GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
                 renderer.setImageBuffer(pixelBuffer);
                 if( drawable.isGLOriented() ) {
                     flipVertically[0] = false;
@@ -149,9 +147,9 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
                 System.err.println("XXX pre-init: "+renderer);
             }
             @Override
-            public void dispose(GLAutoDrawable drawable) {}
+            public void dispose(final GLAutoDrawable drawable) {}
             @Override
-            public void display(GLAutoDrawable drawable) {
+            public void display(final GLAutoDrawable drawable) {
                 if( dx+w <= imageWidth && dy+h <= imageHeight ) {
                     renderer.setTileRect(dx, dy, w, h);
                     dx+=w+w/2;
@@ -165,15 +163,15 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
                 System.err.println("XXX pre-display: "+renderer);
             }
             @Override
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
         };
         final GLEventListener postTileGLEL = new GLEventListener() {
             @Override
-            public void init(GLAutoDrawable drawable) {}
+            public void init(final GLAutoDrawable drawable) {}
             @Override
-            public void dispose(GLAutoDrawable drawable) {}
+            public void dispose(final GLAutoDrawable drawable) {}
             @Override
-            public void display(GLAutoDrawable drawable) {
+            public void display(final GLAutoDrawable drawable) {
                 if( !rendererActive[0] ) {
                     final GLPixelBuffer imageBuffer = renderer.getImageBuffer();
                     imageBuffer.clear(); // full size available
@@ -183,42 +181,44 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
                             caps.getGLProfile(),
                             0 /* internalFormat */,
                             imageWidth, imageHeight,
-                            0, 
+                            0,
                             imageBuffer.pixelAttributes,
-                            false, false, 
+                            false, false,
                             flipVertically[0],
                             imageBuffer.buffer,
                             null /* Flusher */);
                     try {
                         final String filename = getSnapshotFilename(0, "-tile", glad.getChosenGLCapabilities(), imageWidth, imageHeight, false, TextureIO.PNG, null);
-                        final File file = new File(filename);                
+                        final File file = new File(filename);
                         TextureIO.write(textureData, file);
-                    } catch (IOException e) {
+                    } catch (final IOException e) {
                         e.printStackTrace();
                     }
                     renderer.detachAutoDrawable();
                     System.err.println("XXX post-display detached: "+renderer);
-                    drawable.getGL().glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
-                    glad.getGLEventListener(0).reshape(drawable, 0, 0, drawable.getWidth(), drawable.getHeight());
+                    drawable.getGL().glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
+                    glad.getGLEventListener(0).reshape(drawable, 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
                 }
             }
             @Override
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
         };
         renderer.setGLEventListener(preTileGLEL, postTileGLEL);
-        
+
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 frame.pack();
                 frame.setVisible(true);
             }});
-        animator.setUpdateFPSFrames(60, System.err);        
+
+        final Animator animator = new Animator(glad);
+        animator.setUpdateFPSFrames(60, System.err);
         animator.start();
 
         boolean signalTileRenderer = true;
-        
-        while(!quitAdapter.shouldQuit() && animator.isAnimating() && 
-              ( rendererActive[0] || animator.getTotalFPSDuration()<duration ) ) 
+
+        while(!quitAdapter.shouldQuit() && animator.isAnimating() &&
+              ( rendererActive[0] || animator.getTotalFPSDuration()<duration ) )
         {
             if( signalTileRenderer && animator.getTotalFPSDuration() > 90 ) {
                 signalTileRenderer = false;
@@ -244,18 +244,18 @@ public class TestRandomTiledRendering3GL2AWT extends UITestCase {
             public void run() {
                 frame.remove(glad);
                 frame.dispose();
-            }});        
+            }});
     }
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         org.junit.runner.JUnitCore.main(TestRandomTiledRendering3GL2AWT.class.getName());
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsAWT.java
index 30e0ba4..87f1f3e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.tile;
 
 import java.awt.BorderLayout;
@@ -72,7 +72,7 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase  {
     static boolean allow600dpi = false;
     static GLProfile glp;
     static int width, height;
-    
+
     @BeforeClass
     public static void initClass() {
         if(GLProfile.isAvailable(GLProfile.GL2)) {
@@ -90,40 +90,40 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase  {
     @AfterClass
     public static void releaseClass() {
     }
-    
-    protected void runTestGL(GLCapabilities caps) throws InterruptedException, InvocationTargetException {
+
+    protected void runTestGL(final GLCapabilities caps) throws InterruptedException, InvocationTargetException {
         final Dimension glc_sz = new Dimension(width/2, height);
         final GLCanvas glCanvas1 = new GLCanvas(caps);
-        Assert.assertNotNull(glCanvas1);        
+        Assert.assertNotNull(glCanvas1);
         glCanvas1.setMinimumSize(glc_sz);
         glCanvas1.setPreferredSize(glc_sz);
         glCanvas1.setSize(glc_sz);
         glCanvas1.addGLEventListener(new Gears());
-        
+
         final GLCanvas glCanvas2 = new GLCanvas(caps);
-        Assert.assertNotNull(glCanvas2);        
+        Assert.assertNotNull(glCanvas2);
         glCanvas2.setMinimumSize(glc_sz);
         glCanvas2.setPreferredSize(glc_sz);
         glCanvas2.setSize(glc_sz);
         glCanvas2.addGLEventListener(new RedSquareES2());
-        
+
         final Panel demoPanel = new Panel();
         demoPanel.add(glCanvas1);
         demoPanel.add(glCanvas2);
-        
+
         final Frame frame = new Frame("AWT Print");
         Assert.assertNotNull(frame);
-        
+
         final ActionListener print72DPIAction = new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
+            public void actionPerformed(final ActionEvent e) {
                 doPrintManual(frame, 72, 0, -1, -1);
             } };
         final ActionListener print300DPIAction = new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
+            public void actionPerformed(final ActionEvent e) {
                 doPrintManual(frame, 300, -1, -1, -1);
             } };
         final ActionListener print600DPIAction = new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
+            public void actionPerformed(final ActionEvent e) {
                 doPrintManual(frame, 600, -1, -1, -1);
             } };
         final Button print72DPIButton = new Button("72dpi");
@@ -132,17 +132,17 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase  {
         print300DPIButton.addActionListener(print300DPIAction);
         final Button print600DPIButton = new Button("600dpi");
         print600DPIButton.addActionListener(print600DPIAction);
-            
+
         frame.setLayout(new BorderLayout());
-        Panel printPanel = new Panel();
+        final Panel printPanel = new Panel();
         printPanel.add(print72DPIButton);
         printPanel.add(print300DPIButton);
         printPanel.add(print600DPIButton);
-        Panel southPanel = new Panel();
+        final Panel southPanel = new Panel();
         southPanel.add(new Label("South"));
-        Panel eastPanel = new Panel();
+        final Panel eastPanel = new Panel();
         eastPanel.add(new Label("East"));
-        Panel westPanel = new Panel();
+        final Panel westPanel = new Panel();
         westPanel.add(new Label("West"));
         frame.add(printPanel, BorderLayout.NORTH);
         frame.add(demoPanel, BorderLayout.CENTER);
@@ -150,15 +150,15 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase  {
         frame.add(eastPanel, BorderLayout.EAST);
         frame.add(westPanel, BorderLayout.WEST);
         frame.setTitle("Tiles AWT Print Test");
-        
-        Animator animator = new Animator();
+
+        final Animator animator = new Animator();
         animator.add(glCanvas1);
         animator.add(glCanvas2);
-        QuitAdapter quitAdapter = new QuitAdapter();
 
-        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(glCanvas1);
-        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(glCanvas2);
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter), glCanvas1).addTo(glCanvas1);
+        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter), glCanvas2).addTo(glCanvas2);
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glCanvas2).addTo(frame);
 
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
@@ -168,15 +168,15 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase  {
         Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, true));
         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glCanvas1, true));
         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glCanvas2, true));
-        
-        animator.setUpdateFPSFrames(60, System.err);        
+
+        animator.setUpdateFPSFrames(60, System.err);
         animator.start();
 
         boolean printDone = false;
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && ( 0 == duration || animator.getTotalFPSDuration()<duration )) {
             Thread.sleep(200);
             if( !printDone ) {
-                printDone = true;                
+                printDone = true;
                 {
                     final PrintableBase p = doPrintAuto(frame, PageFormat.LANDSCAPE, null, -1 /* offscreen-type */, 72, 0, -1, -1, false /* resizeWithinPrint */);
                     waitUntilPrintJobsIdle(p);
@@ -186,27 +186,27 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase  {
                     waitUntilPrintJobsIdle(p);
                 }
                 {
-                    // No AA needed for 150 dpi and greater :) 
+                    // No AA needed for 150 dpi and greater :)
                     final PrintableBase p = doPrintAuto(frame, PageFormat.LANDSCAPE, null, -1 /* offscreen-type */, 150, -1, -1, -1, false /* resizeWithinPrint */);
                     waitUntilPrintJobsIdle(p);
                 }
                 {
-                    // No AA needed for 150 dpi and greater :) 
+                    // No AA needed for 150 dpi and greater :)
                     final PrintableBase p = doPrintAuto(frame, PageFormat.LANDSCAPE, null, -1 /* offscreen-type */, 150, -1, 2048, 2048, false /* resizeWithinPrint */);
                     waitUntilPrintJobsIdle(p);
                 }
                 {
-                    // No AA needed for 150 dpi and greater :) 
+                    // No AA needed for 150 dpi and greater :)
                     final PrintableBase p = doPrintAuto(frame, PageFormat.LANDSCAPE, null, -1 /* offscreen-type */, 150, -1, -1, -1, true /* resizeWithinPrint */);
                     waitUntilPrintJobsIdle(p);
                 }
                 {
-                    // No AA needed for 150 dpi and greater :) 
+                    // No AA needed for 150 dpi and greater :)
                     final PrintableBase p = doPrintAuto(frame, PageFormat.LANDSCAPE, null, BufferedImage.TYPE_INT_ARGB_PRE /* offscreen-type */, 150, -1, -1, -1, false /* resizeWithinPrint */);
                     waitUntilPrintJobsIdle(p);
                 }
                 {
-                    // No AA needed for 150 dpi and greater :) 
+                    // No AA needed for 150 dpi and greater :)
                     final PrintableBase p = doPrintAuto(frame, PageFormat.LANDSCAPE, null, BufferedImage.TYPE_INT_ARGB_PRE /* offscreen-type */, 150, -1, -1, -1, true/* resizeWithinPrint */);
                     waitUntilPrintJobsIdle(p);
                 }
@@ -217,7 +217,7 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase  {
                 }
             }
         }
-        
+
         Assert.assertNotNull(frame);
         Assert.assertNotNull(glCanvas1);
         Assert.assertNotNull(glCanvas2);
@@ -240,13 +240,13 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase  {
 
     @Test
     public void test01_aa0() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps);
     }
-    
+
     @Test
     public void test02_aa8() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setSampleBuffers(true);
         caps.setNumSamples(8);
         runTestGL(caps);
@@ -254,13 +254,13 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase  {
 
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             } else if(args[i].equals("-600dpi")) {
                 allow600dpi = true;
             } else if(args[i].equals("-wait")) {
@@ -268,11 +268,11 @@ public class TestTiledPrintingGearsAWT extends TiledPrintingAWTBase  {
             }
         }
         if(waitForKey) {
-            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+            final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
             System.err.println("Press enter to continue");
             try {
                 System.err.println(stdin.readLine());
-            } catch (IOException e) { }
+            } catch (final IOException e) { }
         }
         org.junit.runner.JUnitCore.main(TestTiledPrintingGearsAWT.class.getName());
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsNewtAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsNewtAWT.java
index ec1d7b1..274b1ee 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsNewtAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsNewtAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.tile;
 
 import java.awt.BorderLayout;
@@ -73,7 +73,7 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase  {
     static boolean allow600dpi = false;
     static GLProfile glp;
     static int width, height;
-    
+
     @BeforeClass
     public static void initClass() {
         if(GLProfile.isAvailable(GLProfile.GL2)) {
@@ -91,44 +91,44 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase  {
     @AfterClass
     public static void releaseClass() {
     }
-    
-    protected void runTestGL(GLCapabilities caps) throws InterruptedException, InvocationTargetException {
+
+    protected void runTestGL(final GLCapabilities caps) throws InterruptedException, InvocationTargetException {
         final Dimension glc_sz = new Dimension(width/2, height);
         final GLWindow glad1 = GLWindow.create(caps);
-        Assert.assertNotNull(glad1);        
+        Assert.assertNotNull(glad1);
         final NewtCanvasAWT canvas1 = new NewtCanvasAWT(glad1);
         Assert.assertNotNull(canvas1);
         canvas1.setMinimumSize(glc_sz);
         canvas1.setPreferredSize(glc_sz);
         canvas1.setSize(glc_sz);
         glad1.addGLEventListener(new Gears());
-        
+
         final GLWindow glad2 = GLWindow.create(caps);
-        Assert.assertNotNull(glad2);        
+        Assert.assertNotNull(glad2);
         final NewtCanvasAWT canvas2 = new NewtCanvasAWT(glad2);
         Assert.assertNotNull(canvas2);
         canvas2.setMinimumSize(glc_sz);
         canvas2.setPreferredSize(glc_sz);
         canvas2.setSize(glc_sz);
         glad2.addGLEventListener(new RedSquareES2());
-        
+
         final Panel demoPanel = new Panel();
         demoPanel.add(canvas1);
         demoPanel.add(canvas2);
-        
+
         final Frame frame = new Frame("Newt/AWT Print");
         Assert.assertNotNull(frame);
-        
+
         final ActionListener print72DPIAction = new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
+            public void actionPerformed(final ActionEvent e) {
                 doPrintManual(frame, 72, 0, -1, -1);
             } };
         final ActionListener print300DPIAction = new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
+            public void actionPerformed(final ActionEvent e) {
                 doPrintManual(frame, 300, -1, -1, -1);
             } };
         final ActionListener print600DPIAction = new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
+            public void actionPerformed(final ActionEvent e) {
                 doPrintManual(frame, 600, -1, -1, -1);
             } };
         final Button print72DPIButton = new Button("72dpi");
@@ -137,17 +137,17 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase  {
         print300DPIButton.addActionListener(print300DPIAction);
         final Button print600DPIButton = new Button("600dpi");
         print600DPIButton.addActionListener(print600DPIAction);
-            
+
         frame.setLayout(new BorderLayout());
-        Panel printPanel = new Panel();
+        final Panel printPanel = new Panel();
         printPanel.add(print72DPIButton);
         printPanel.add(print300DPIButton);
         printPanel.add(print600DPIButton);
-        Panel southPanel = new Panel();
+        final Panel southPanel = new Panel();
         southPanel.add(new Label("South"));
-        Panel eastPanel = new Panel();
+        final Panel eastPanel = new Panel();
         eastPanel.add(new Label("East"));
-        Panel westPanel = new Panel();
+        final Panel westPanel = new Panel();
         westPanel.add(new Label("West"));
         frame.add(printPanel, BorderLayout.NORTH);
         frame.add(demoPanel, BorderLayout.CENTER);
@@ -155,15 +155,15 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase  {
         frame.add(eastPanel, BorderLayout.EAST);
         frame.add(westPanel, BorderLayout.WEST);
         frame.setTitle("Tiles Newt/AWT Print Test");
-        
-        Animator animator = new Animator();
+
+        final Animator animator = new Animator();
         animator.add(glad1);
         animator.add(glad2);
-        QuitAdapter quitAdapter = new QuitAdapter();
 
-        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(canvas1);
-        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(canvas2);
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter), canvas1.getNEWTChild()).addTo(canvas1);
+        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter), canvas2.getNEWTChild()).addTo(canvas2);
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), canvas2.getNEWTChild()).addTo(frame);
 
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
@@ -173,8 +173,8 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase  {
         Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, true));
         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(canvas1, true));
         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(canvas2, true));
-        
-        animator.setUpdateFPSFrames(60, System.err);        
+
+        animator.setUpdateFPSFrames(60, System.err);
         animator.start();
 
         boolean printDone = false;
@@ -191,27 +191,27 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase  {
                     waitUntilPrintJobsIdle(p);
                 }
                 {
-                    // No AA needed for 150 dpi and greater :) 
+                    // No AA needed for 150 dpi and greater :)
                     final PrintableBase p = doPrintAuto(frame, PageFormat.LANDSCAPE, null, -1 /* offscreen-type */, 150, -1, -1, -1, false /* resizeWithinPrint */);
                     waitUntilPrintJobsIdle(p);
                 }
                 {
-                    // No AA needed for 150 dpi and greater :) 
+                    // No AA needed for 150 dpi and greater :)
                     final PrintableBase p = doPrintAuto(frame, PageFormat.LANDSCAPE, null, -1 /* offscreen-type */, 150, -1, 2048, 2048, false /* resizeWithinPrint */);
                     waitUntilPrintJobsIdle(p);
                 }
                 {
-                    // No AA needed for 150 dpi and greater :) 
+                    // No AA needed for 150 dpi and greater :)
                     final PrintableBase p = doPrintAuto(frame, PageFormat.LANDSCAPE, null, -1 /* offscreen-type */, 150, -1, -1, -1, true /* resizeWithinPrint */);
                     waitUntilPrintJobsIdle(p);
                 }
                 {
-                    // No AA needed for 150 dpi and greater :) 
+                    // No AA needed for 150 dpi and greater :)
                     final PrintableBase p = doPrintAuto(frame, PageFormat.LANDSCAPE, null, BufferedImage.TYPE_INT_ARGB_PRE /* offscreen-type */, 150, -1, -1, -1, false /* resizeWithinPrint */);
                     waitUntilPrintJobsIdle(p);
                 }
                 {
-                    // No AA needed for 150 dpi and greater :) 
+                    // No AA needed for 150 dpi and greater :)
                     final PrintableBase p = doPrintAuto(frame, PageFormat.LANDSCAPE, null, BufferedImage.TYPE_INT_ARGB_PRE /* offscreen-type */, 150, -1, -1, -1, true /* resizeWithinPrint */);
                     waitUntilPrintJobsIdle(p);
                 }
@@ -222,7 +222,7 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase  {
                 }
             }
         }
-        
+
         Assert.assertNotNull(frame);
         Assert.assertNotNull(canvas1);
         Assert.assertNotNull(canvas2);
@@ -247,13 +247,13 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase  {
 
     @Test
     public void test01_aa0() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps);
     }
-    
+
     @Test
     public void test02_aa8() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setSampleBuffers(true);
         caps.setNumSamples(8);
         runTestGL(caps);
@@ -261,13 +261,13 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase  {
 
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             } else if(args[i].equals("-600dpi")) {
                 allow600dpi = true;
             } else if(args[i].equals("-wait")) {
@@ -275,11 +275,11 @@ public class TestTiledPrintingGearsNewtAWT extends TiledPrintingAWTBase  {
             }
         }
         if(waitForKey) {
-            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+            final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
             System.err.println("Press enter to continue");
             try {
                 System.err.println(stdin.readLine());
-            } catch (IOException e) { }
+            } catch (final IOException e) { }
         }
         org.junit.runner.JUnitCore.main(TestTiledPrintingGearsNewtAWT.class.getName());
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java
index 3dd3a83..7c8d65c 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT.java
@@ -100,7 +100,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase  {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilities caps, boolean layered, boolean skipGLOrientationVerticalFlip) throws InterruptedException, InvocationTargetException {
+    protected void runTestGL(final GLCapabilities caps, final boolean layered, final boolean skipGLOrientationVerticalFlip) throws InterruptedException, InvocationTargetException {
         final int layerStepX = width/6, layerStepY = height/6;
         final Dimension glc_sz = new Dimension(layered ? width - 2*layerStepX : width/2, layered ? height - 2*layerStepY : height);
         final GLJPanel glJPanel1 = new GLJPanel(caps);
@@ -160,15 +160,15 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase  {
         Assert.assertNotNull(frame);
 
         final ActionListener print72DPIAction = new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
+            public void actionPerformed(final ActionEvent e) {
                 doPrintManual(frame, 72, 0, -1, -1);
             } };
         final ActionListener print300DPIAction = new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
+            public void actionPerformed(final ActionEvent e) {
                 doPrintManual(frame, 300, -1, -1, -1);
             } };
         final ActionListener print600DPIAction = new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
+            public void actionPerformed(final ActionEvent e) {
                 doPrintManual(frame, 600, -1, -1, -1);
             } };
         final Button print72DPIButton = new Button("72dpi");
@@ -189,14 +189,13 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase  {
         final JPanel westPanel = new JPanel();
         westPanel.add(new Label("West"));
 
-        Animator animator = new Animator();
+        final Animator animator = new Animator();
         animator.add(glJPanel1);
         animator.add(glJPanel2);
-        QuitAdapter quitAdapter = new QuitAdapter();
-
-        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(glJPanel1);
-        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(glJPanel2);
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter), glJPanel1).addTo(glJPanel1);
+        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter), glJPanel2).addTo(glJPanel2);
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glJPanel2).addTo(frame);
 
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
@@ -303,13 +302,13 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase  {
 
     @Test
     public void test01_flip1_aa0() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, false, false);
     }
 
     @Test
     public void test01_flip1_aa0_layered() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setAlphaBits(8);
         runTestGL(caps, true, false);
     }
@@ -317,7 +316,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase  {
     @Test
     public void test01_flip1_aa0_bitmap() throws InterruptedException, InvocationTargetException {
         if( Platform.OSType.WINDOWS == Platform.getOSType() ) {
-            GLCapabilities caps = new GLCapabilities(glp);
+            final GLCapabilities caps = new GLCapabilities(glp);
             caps.setBitmap(true);
             runTestGL(caps, false, false);
         } // issues w/ AMD catalyst driver and pixmap surface ..
@@ -326,7 +325,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase  {
     @Test
     public void test01_flip1_aa0_bitmap_layered() throws InterruptedException, InvocationTargetException {
         if( Platform.OSType.WINDOWS == Platform.getOSType() ) {
-            GLCapabilities caps = new GLCapabilities(glp);
+            final GLCapabilities caps = new GLCapabilities(glp);
             caps.setBitmap(true);
             caps.setAlphaBits(8);
             runTestGL(caps, true, false);
@@ -335,7 +334,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase  {
 
     @Test
     public void test02_flip1_aa8() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setSampleBuffers(true);
         caps.setNumSamples(8);
         runTestGL(caps, false, false);
@@ -343,13 +342,13 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase  {
 
     @Test
     public void test11_flip0_aa0() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, false, true);
     }
 
     @Test
     public void test11_flip0_aa0_layered() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setAlphaBits(8);
         runTestGL(caps, true, true);
     }
@@ -357,7 +356,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase  {
     @Test
     public void test11_flip0_aa0_bitmap() throws InterruptedException, InvocationTargetException {
         if( Platform.OSType.WINDOWS == Platform.getOSType() ) {
-            GLCapabilities caps = new GLCapabilities(glp);
+            final GLCapabilities caps = new GLCapabilities(glp);
             caps.setBitmap(true);
             runTestGL(caps, false, true);
         } // issues w/ AMD catalyst driver and pixmap surface ..
@@ -366,7 +365,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase  {
     @Test
     public void test11_flip0_aa0_bitmap_layered() throws InterruptedException, InvocationTargetException {
         if( Platform.OSType.WINDOWS == Platform.getOSType() ) {
-            GLCapabilities caps = new GLCapabilities(glp);
+            final GLCapabilities caps = new GLCapabilities(glp);
             caps.setBitmap(true);
             caps.setAlphaBits(8);
             runTestGL(caps, true, true);
@@ -375,7 +374,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase  {
 
     @Test
     public void test12_flip0_aa8() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setSampleBuffers(true);
         caps.setNumSamples(8);
         runTestGL(caps, false, true);
@@ -383,7 +382,7 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase  {
 
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
@@ -401,11 +400,11 @@ public class TestTiledPrintingGearsSwingAWT extends TiledPrintingAWTBase  {
             }
         }
         if(waitForKey) {
-            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+            final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
             System.err.println("Press enter to continue");
             try {
                 System.err.println(stdin.readLine());
-            } catch (IOException e) { }
+            } catch (final IOException e) { }
         }
         org.junit.runner.JUnitCore.main(TestTiledPrintingGearsSwingAWT.class.getName());
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT2.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT2.java
index 29bf8a6..060b85a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT2.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingGearsSwingAWT2.java
@@ -96,7 +96,7 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase  {
     public static void releaseClass() {
     }
 
-    protected void runTestGL(GLCapabilities caps, final boolean addLayout, boolean layered, boolean skipGLOrientationVerticalFlip, boolean useAnim) throws InterruptedException, InvocationTargetException {
+    protected void runTestGL(final GLCapabilities caps, final boolean addLayout, final boolean layered, final boolean skipGLOrientationVerticalFlip, final boolean useAnim) throws InterruptedException, InvocationTargetException {
         final Dimension glc_sz = new Dimension(width, height);
         final GLJPanel glJPanel1 = new GLJPanel(caps);
         Assert.assertNotNull(glJPanel1);
@@ -146,15 +146,15 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase  {
         Assert.assertNotNull(frame);
 
         final ActionListener print72DPIAction = new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
+            public void actionPerformed(final ActionEvent e) {
                 doPrintManual(frame, 72, 0, -1, -1);
             } };
         final ActionListener print150DPIAction = new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
+            public void actionPerformed(final ActionEvent e) {
                 doPrintManual(frame, 150, -1, -1, -1);
             } };
         final ActionListener print300DPIAction = new ActionListener() {
-            public void actionPerformed(ActionEvent e) {
+            public void actionPerformed(final ActionEvent e) {
                 doPrintManual(frame, 300, -1, -1, -1);
             } };
         final Button print72DPIButton = new Button("72dpi");
@@ -179,10 +179,9 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase  {
         if( null != animator ) {
             animator.add(glJPanel1);
         }
-        QuitAdapter quitAdapter = new QuitAdapter();
-
-        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter)).addTo(glJPanel1);
-        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter)).addTo(frame);
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new AWTKeyAdapter(new TraceKeyAdapter(quitAdapter), glJPanel1).addTo(glJPanel1);
+        new AWTWindowAdapter(new TraceWindowAdapter(quitAdapter), glJPanel1).addTo(frame);
 
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
@@ -254,25 +253,25 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase  {
 
     @Test
     public void test001_flip1_norm_layout0_layered0() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, false /* addLayout */, false /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
 
     @Test
     public void test002_flip1_norm_layout1_layered0() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, true /* addLayout */, false /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
 
     @Test
     public void test003_flip1_norm_layout0_layered1() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, false /* addLayout */, true /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
 
     @Test
     public void test004_flip1_norm_layout1_layered1() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, true /* addLayout */, true /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
 
@@ -281,7 +280,7 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase  {
         if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setBitmap(true);
         runTestGL(caps, false /* addLayout */, false /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
@@ -291,7 +290,7 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase  {
         if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setBitmap(true);
         runTestGL(caps, true /* addLayout */, false /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
@@ -301,7 +300,7 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase  {
         if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setBitmap(true);
         runTestGL(caps, false /* addLayout */, true /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
@@ -311,32 +310,32 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase  {
         if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setBitmap(true);
         runTestGL(caps, true /* addLayout */, true /* layered */, false /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
 
     @Test
     public void test101_flip1_norm_layout0_layered0() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, false /* addLayout */, false /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
 
     @Test
     public void test102_flip1_norm_layout1_layered0() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, true /* addLayout */, false /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
 
     @Test
     public void test103_flip1_norm_layout0_layered1() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, false /* addLayout */, true /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
 
     @Test
     public void test104_flip1_norm_layout1_layered1() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, true /* addLayout */, true /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
 
@@ -345,7 +344,7 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase  {
         if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setBitmap(true);
         runTestGL(caps, false /* addLayout */, false /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
@@ -355,7 +354,7 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase  {
         if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setBitmap(true);
         runTestGL(caps, true /* addLayout */, false /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
@@ -365,7 +364,7 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase  {
         if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setBitmap(true);
         runTestGL(caps, false /* addLayout */, true /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
@@ -375,14 +374,14 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase  {
         if( Platform.OSType.WINDOWS != Platform.getOSType() ) {
             return;
         }
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setBitmap(true);
         runTestGL(caps, true /* addLayout */, true /* layered */, true /* skipGLOrientationVerticalFlip */, false /* useAnim */);
     }
 
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
@@ -398,11 +397,11 @@ public class TestTiledPrintingGearsSwingAWT2 extends TiledPrintingAWTBase  {
             }
         }
         if(waitForKey) {
-            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+            final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
             System.err.println("Press enter to continue");
             try {
                 System.err.println(stdin.readLine());
-            } catch (IOException e) { }
+            } catch (final IOException e) { }
         }
         org.junit.runner.JUnitCore.main(TestTiledPrintingGearsSwingAWT2.class.getName());
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingNIOImageSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingNIOImageSwingAWT.java
index b51bfae..85edcda 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingNIOImageSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledPrintingNIOImageSwingAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.tile;
 
 import java.awt.BorderLayout;
@@ -80,7 +80,7 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase  {
     static boolean allow600dpi = false;
     static GLProfile glp;
     static int width, height;
-    
+
     @BeforeClass
     public static void initClass() {
         if(GLProfile.isAvailable(GLProfile.GL2)) {
@@ -98,7 +98,7 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase  {
     @AfterClass
     public static void releaseClass() {
     }
-    
+
     protected void printOffscreenToFile(final BufferedImage image, final Frame frame, final GLCapabilities caps, final int num, final String detail) {
         final Insets frameInsets = frame.getInsets();
         final int frameWidth = frame.getWidth();
@@ -108,17 +108,17 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase  {
         final double scaleComp72;
         // Note: Frame size contains the frame border (i.e. insets)!
         {
-            final double sx = (double)imageWidth / frameWidth; 
+            final double sx = (double)imageWidth / frameWidth;
             final double sy = (double)imageHeight / frameHeight;
             scaleComp72 = Math.min(sx, sy);
         }
         System.err.println("PRINT DPI: scaleComp72 "+scaleComp72+", image-size "+imageWidth+"x"+imageHeight+", frame[border "+frameInsets+", size "+frameWidth+"x"+frameHeight+"]");
-        
+
         System.err.println("XXX: image "+image);
         System.err.println("XXX: cm "+image.getColorModel());
         System.err.println("XXX: raster "+image.getRaster());
         System.err.println("XXX: dataBuffer "+image.getRaster().getDataBuffer());
-        
+
         AWTEDTExecutor.singleton.invoke(true, new Runnable() {
             public void run() {
                 final Graphics2D g2d = (Graphics2D) image.getGraphics();
@@ -126,7 +126,7 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase  {
                 g2d.scale(scaleComp72, scaleComp72);
                 // g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                 g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
-                
+
                 // frame.paintAll(g2d);
                 final AWTPrintLifecycle.Context ctx = AWTPrintLifecycle.Context.setupPrint(frame, 1.0/scaleComp72, 1.0/scaleComp72, 0, -1, -1);
                 try {
@@ -137,20 +137,20 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase  {
                 // to file
                 final String fname = getSnapshotFilename(num, detail, caps, image.getWidth(), image.getHeight(), false, TextureIO.PNG, null);
                 System.err.println("XXX file "+fname);
-                final File fout = new File(fname); 
+                final File fout = new File(fname);
                 try {
                     ImageIO.write(image, "png", fout);
-                } catch (IOException e) {
+                } catch (final IOException e) {
                     e.printStackTrace();
                 }
             } });
     }
-    
+
     protected void runTestGL(final GLCapabilities caps, final boolean layered) throws InterruptedException, InvocationTargetException {
         final int layerStepX = width/6, layerStepY = height/6;
         final Dimension glc_sz = new Dimension(layered ? width - 2*layerStepX : width/2, layered ? height - 2*layerStepY : height);
         final GLJPanel glJPanel1 = new GLJPanel(caps);
-        Assert.assertNotNull(glJPanel1);        
+        Assert.assertNotNull(glJPanel1);
         glJPanel1.setMinimumSize(glc_sz);
         glJPanel1.setPreferredSize(glc_sz);
         if( layered ) {
@@ -159,9 +159,9 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase  {
             glJPanel1.setBounds(0, 0, glc_sz.width, glc_sz.height);
         }
         glJPanel1.addGLEventListener(new Gears());
-        
+
         final GLJPanel glJPanel2 = new GLJPanel(caps);
-        Assert.assertNotNull(glJPanel2);        
+        Assert.assertNotNull(glJPanel2);
         glJPanel2.setMinimumSize(glc_sz);
         glJPanel2.setPreferredSize(glc_sz);
         if( layered ) {
@@ -171,7 +171,7 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase  {
         }
         glJPanel2.addGLEventListener(new RedSquareES2());
         // glJPanel2.addGLEventListener(new Gears());
-        
+
         final JComponent demoPanel;
         if( layered ) {
             glJPanel1.setOpaque(true);
@@ -192,14 +192,14 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase  {
             demoPanel.add(glJPanel1);
             demoPanel.add(glJPanel2);
         }
-        
+
         final JFrame frame = new JFrame("Swing Print");
         Assert.assertNotNull(frame);
-        
+
         final Button print72DPIButton = new Button("72dpi"); // dummy
         final Button print300DPIButton = new Button("300dpi"); // dummy
         final Button print600DPIButton = new Button("600dpi"); // dummy
-            
+
         final JPanel printPanel = new JPanel();
         printPanel.add(print72DPIButton);
         printPanel.add(print300DPIButton);
@@ -210,7 +210,7 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase  {
         eastPanel.add(new Label("East"));
         final JPanel westPanel = new JPanel();
         westPanel.add(new Label("West"));
-        
+
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     final Container fcont = frame.getContentPane();
@@ -224,11 +224,11 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase  {
                     frame.pack();
                     frame.setVisible(true);
                 } } ) ;
-        
+
         Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, true));
         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glJPanel1, true));
         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glJPanel2, true));
-        
+
         // paint offscreen: array 72dpi ARGB
         {
             final BufferedImage image = new BufferedImage(frame.getWidth(), frame.getHeight(), BufferedImage.TYPE_INT_ARGB);
@@ -241,29 +241,29 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase  {
         }
         // paint offscreen: NIO 150dpi ARGB
         {
-            final int scale = (int) ( 150.0 / 72.0 + 0.5 ); 
+            final int scale = (int) ( 150.0 / 72.0 + 0.5 );
             final BufferedImage image = DirectDataBufferInt.createBufferedImage(frame.getWidth()*scale, frame.getHeight()*scale, BufferedImage.TYPE_INT_ARGB, null /* location */, null /* properties */);
             printOffscreenToFile(image, frame, caps, 2, "newio_150dpi_argb");
         }
         // paint offscreen: NIO 150dpi ARGB_PRE
         {
-            final int scale = (int) ( 150.0 / 72.0 + 0.5 ); 
+            final int scale = (int) ( 150.0 / 72.0 + 0.5 );
             final BufferedImage image = DirectDataBufferInt.createBufferedImage(frame.getWidth()*scale, frame.getHeight()*scale, BufferedImage.TYPE_INT_ARGB_PRE, null /* location */, null /* properties */);
             printOffscreenToFile(image, frame, caps, 2, "newio_150dpi_argbp");
         }
         // paint offscreen: NIO 150dpi RGB
         {
-            final int scale = (int) ( 150.0 / 72.0 + 0.5 ); 
+            final int scale = (int) ( 150.0 / 72.0 + 0.5 );
             final BufferedImage image = DirectDataBufferInt.createBufferedImage(frame.getWidth()*scale, frame.getHeight()*scale, BufferedImage.TYPE_INT_RGB, null /* location */, null /* properties */);
             printOffscreenToFile(image, frame, caps, 2, "newio_150dpi_rgb");
         }
         // paint offscreen: NIO 150dpi BGR
         {
-            final int scale = (int) ( 150.0 / 72.0 + 0.5 ); 
+            final int scale = (int) ( 150.0 / 72.0 + 0.5 );
             final BufferedImage image = DirectDataBufferInt.createBufferedImage(frame.getWidth()*scale, frame.getHeight()*scale, BufferedImage.TYPE_INT_BGR, null /* location */, null /* properties */);
             printOffscreenToFile(image, frame, caps, 2, "newio_150dpi_bgr");
         }
-        
+
         Assert.assertNotNull(frame);
         Assert.assertNotNull(glJPanel1);
         Assert.assertNotNull(glJPanel2);
@@ -283,25 +283,25 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase  {
 
     @Test
     public void test01_Offscreen_aa0() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, false);
     }
-    
+
     @Test
     public void test01_Offscreen_aa0_layered() throws InterruptedException, InvocationTargetException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         runTestGL(caps, true);
     }
-    
+
     static long duration = 500; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             } else if(args[i].equals("-600dpi")) {
                 allow600dpi = true;
             } else if(args[i].equals("-wait")) {
@@ -309,11 +309,11 @@ public class TestTiledPrintingNIOImageSwingAWT extends UITestCase  {
             }
         }
         if(waitForKey) {
-            BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+            final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
             System.err.println("Press enter to continue");
             try {
                 System.err.println(stdin.readLine());
-            } catch (IOException e) { }
+            } catch (final IOException e) { }
         }
         org.junit.runner.JUnitCore.main(TestTiledPrintingNIOImageSwingAWT.class.getName());
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering1GL2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering1GL2NEWT.java
index e0fabc3..9dee67e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering1GL2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering1GL2NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -57,9 +57,9 @@ import org.junit.runners.MethodSorters;
  * Demos offscreen {@link GLDrawable} being used for
  * {@link TileRenderer} rendering to produce a PNG file.
  * <p>
- * All {@link TileRenderer} operations are 
+ * All {@link TileRenderer} operations are
  * being performed from the main thread sequentially
- * without {@link GLAutoDrawable} or {@link GLEventListener}. 
+ * without {@link GLAutoDrawable} or {@link GLEventListener}.
  * </p>
 */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
@@ -67,25 +67,25 @@ public class TestTiledRendering1GL2NEWT extends UITestCase {
     static long duration = 500; // ms
 
     static class DrawableContext {
-        DrawableContext(GLDrawable d, GLContext glc) {
+        DrawableContext(final GLDrawable d, final GLContext glc) {
             this.d = d;
             this.glc = glc;
         }
         GLDrawable d;
         GLContext glc;
     }
-    
-    private static DrawableContext createDrawableAndCurrentCtx(GLCapabilities glCaps, int width, int height) {
-        GLDrawableFactory factory = GLDrawableFactory.getFactory(glCaps.getGLProfile());
-        GLDrawable d = factory.createOffscreenDrawable(null, glCaps, null, width, height);
+
+    private static DrawableContext createDrawableAndCurrentCtx(final GLCapabilities glCaps, final int width, final int height) {
+        final GLDrawableFactory factory = GLDrawableFactory.getFactory(glCaps.getGLProfile());
+        final GLDrawable d = factory.createOffscreenDrawable(null, glCaps, null, width, height);
         d.setRealized(true);
         GLContext glc = null;
         glc = d.createContext(null);
         Assert.assertTrue("Context could not be made current", GLContext.CONTEXT_NOT_CURRENT < glc.makeCurrent());
         return new DrawableContext(d, glc);
     }
-    
-    private static void destroyDrawableContext(DrawableContext dc) {
+
+    private static void destroyDrawableContext(final DrawableContext dc) {
         if(null != dc.glc) {
             dc.glc.destroy();
             dc.glc = null;
@@ -95,43 +95,43 @@ public class TestTiledRendering1GL2NEWT extends UITestCase {
             dc.d = null;
         }
     }
-    
+
     @Test
     public void test01() throws IOException {
-        GLProfile glp = GLProfile.getMaxFixedFunc(true);
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLProfile glp = GLProfile.getMaxFixedFunc(true);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setOnscreen(false);
-        
+
         final int maxTileSize = 256;
-        DrawableContext dc = createDrawableAndCurrentCtx(caps, maxTileSize, maxTileSize);
+        final DrawableContext dc = createDrawableAndCurrentCtx(caps, maxTileSize, maxTileSize);
         final GL2 gl = dc.glc.getGL().getGL2();
-        
+
         // Fix the image size for now
-        final int imageWidth = dc.d.getWidth() * 6;
-        final int imageHeight = dc.d.getHeight() * 4;
-        
+        final int imageWidth = dc.d.getSurfaceWidth() * 6;
+        final int imageHeight = dc.d.getSurfaceHeight() * 4;
+
         final String filename = this.getSnapshotFilename(0, "-tile", dc.d.getChosenGLCapabilities(), imageWidth, imageHeight, false, TextureIO.PNG, null);
         final File file = new File(filename);
-    
+
         // Initialize the tile rendering library
-        final TileRenderer renderer = new com.jogamp.opengl.util.TileRenderer();        
-        renderer.setTileSize(dc.d.getWidth(), dc.d.getHeight(), 0);
+        final TileRenderer renderer = new com.jogamp.opengl.util.TileRenderer();
+        renderer.setTileSize(dc.d.getSurfaceWidth(), dc.d.getSurfaceHeight(), 0);
         renderer.setImageSize(imageWidth, imageHeight);
-        
+
         final GLPixelBuffer.GLPixelBufferProvider pixelBufferProvider = GLPixelBuffer.defaultProviderWithRowStride;
         final boolean[] flipVertically = { false };
-        
-        GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
-        GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
+
+        final GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
+        final GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
         renderer.setImageBuffer(pixelBuffer);
         flipVertically[0] = false;
-        
+
         final Gears gears = new Gears();
         gears.setVerbose(false);
         gears.init(gl);
 
         gears.addTileRendererNotify(renderer);
-        while( !renderer.eot() ) { 
+        while( !renderer.eot() ) {
             renderer.beginTile(gl);
             gears.reshape(gl,
                     renderer.getParam(TileRendererBase.TR_CURRENT_TILE_X_POS), renderer.getParam(TileRendererBase.TR_CURRENT_TILE_Y_POS),
@@ -143,69 +143,69 @@ public class TestTiledRendering1GL2NEWT extends UITestCase {
         gears.removeTileRendererNotify(renderer);
 
         destroyDrawableContext(dc);
-        
+
         final GLPixelBuffer imageBuffer = renderer.getImageBuffer();
         final TextureData textureData = new TextureData(
                                caps.getGLProfile(),
                                0 /* internalFormat */,
                                imageWidth, imageHeight,
-                               0, 
+                               0,
                                imageBuffer.pixelAttributes,
-                               false, false, 
+                               false, false,
                                flipVertically[0],
                                imageBuffer.buffer,
                                null /* Flusher */);
-        
+
         TextureIO.write(textureData, file);
     }
-    
+
     @Test
     public void test02_EOT_01() throws IOException {
-        GLProfile glp = GLProfile.getMaxFixedFunc(true);
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLProfile glp = GLProfile.getMaxFixedFunc(true);
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setOnscreen(false);
-        
+
         final int maxTileSize = 256;
-        DrawableContext dc = createDrawableAndCurrentCtx(caps, maxTileSize, maxTileSize);
+        final DrawableContext dc = createDrawableAndCurrentCtx(caps, maxTileSize, maxTileSize);
         final GL2 gl = dc.glc.getGL().getGL2();
-        
+
         // Fix the image size for now
-        final int imageWidth = dc.d.getWidth() * 6;
-        final int imageHeight = dc.d.getHeight() * 4;
-        
+        final int imageWidth = dc.d.getSurfaceWidth() * 6;
+        final int imageHeight = dc.d.getSurfaceHeight() * 4;
+
         // Initialize the tile rendering library
         final TileRenderer renderer = new com.jogamp.opengl.util.TileRenderer();
-        renderer.setTileSize(dc.d.getWidth(), dc.d.getHeight(), 0);
-        
+        renderer.setTileSize(dc.d.getSurfaceWidth(), dc.d.getSurfaceHeight(), 0);
+
         IllegalStateException ise = null;
         try {
             renderer.beginTile(gl); // Image size has not been set
-        } catch (IllegalStateException _ise) {
+        } catch (final IllegalStateException _ise) {
             ise = _ise;
             System.err.println("Expected "+ise.getClass().getSimpleName()+": "+ise.getMessage());
         }
         Assert.assertNotNull("TileRenderer.beginTile: Image-size exception missing", ise);
-        
+
         renderer.setImageSize(imageWidth, imageHeight);
-        
+
         renderer.clipImageSize(0, 0);
         try {
             renderer.beginTile(gl); // EOT reached (1)
-        } catch (IllegalStateException _ise) {
+        } catch (final IllegalStateException _ise) {
             ise = _ise;
             System.err.println("Expected "+ise.getClass().getSimpleName()+": "+ise.getMessage());
         }
         Assert.assertNotNull("TileRenderer.beginTile: EOT (1) exception missing", ise);
-        
+
         renderer.clipImageSize(imageWidth, imageHeight); // back to full size
-        
+
         final Gears gears = new Gears();
         gears.setVerbose(false);
         gears.init(gl);
 
         gears.addTileRendererNotify(renderer);
         int numTiles = 0;
-        while( !renderer.eot() ) { 
+        while( !renderer.eot() ) {
             renderer.beginTile(gl);
             gears.reshape(gl,
                     renderer.getParam(TileRendererBase.TR_CURRENT_TILE_X_POS), renderer.getParam(TileRendererBase.TR_CURRENT_TILE_Y_POS),
@@ -217,27 +217,27 @@ public class TestTiledRendering1GL2NEWT extends UITestCase {
         }
         try {
             renderer.beginTile(gl); // EOT reached (2)
-        } catch (IllegalStateException _ise) {
+        } catch (final IllegalStateException _ise) {
             ise = _ise;
             System.err.println("Expected "+ise.getClass().getSimpleName()+": "+ise.getMessage());
         }
         Assert.assertNotNull("TileRenderer.beginTile: EOT (2) exception missing", ise);
         gears.removeTileRendererNotify(renderer);
-        
+
         Assert.assertTrue("TileRenderer not rendered more than one tile but "+numTiles, numTiles > 1);
 
         destroyDrawableContext(dc);
     }
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         org.junit.runner.JUnitCore.main(TestTiledRendering1GL2NEWT.class.getName());
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering2NEWT.java
index 2220c1f..e979ac9 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TestTiledRendering2NEWT.java
@@ -74,7 +74,7 @@ import org.junit.runners.MethodSorters;
 public class TestTiledRendering2NEWT extends UITestCase {
     static long duration = 500; // ms
 
-    static GLProfile getGLProfile(String profile) {
+    static GLProfile getGLProfile(final String profile) {
         if( !GLProfile.isAvailable(profile) )  {
             System.err.println("Profile "+profile+" n/a");
             return null;
@@ -92,7 +92,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
 
     @Test
     public void test001_off_gl2___aa0() throws IOException {
-        GLProfile glp = getGLProfile(GLProfile.GL2);
+        final GLProfile glp = getGLProfile(GLProfile.GL2);
         if( null == glp ) {
             return;
         }
@@ -100,7 +100,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
     }
     @Test
     public void test002_off_gl2___aa8() throws IOException {
-        GLProfile glp = getGLProfile(GLProfile.GL2);
+        final GLProfile glp = getGLProfile(GLProfile.GL2);
         if( null == glp ) {
             return;
         }
@@ -108,7 +108,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
     }
     @Test
     public void test011_off_gl2es3_aa0() throws IOException {
-        GLProfile glp = getGL2ES3();
+        final GLProfile glp = getGL2ES3();
         if( null == glp ) {
             return;
         }
@@ -116,7 +116,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
     }
     @Test
     public void test012_off_gl2es3_aa8() throws IOException {
-        GLProfile glp = getGL2ES3();
+        final GLProfile glp = getGL2ES3();
         if( null == glp ) {
             return;
         }
@@ -124,7 +124,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
     }
     @Test
     public void test101_on__gl2___aa0() throws IOException {
-        GLProfile glp = getGLProfile(GLProfile.GL2);
+        final GLProfile glp = getGLProfile(GLProfile.GL2);
         if( null == glp ) {
             return;
         }
@@ -132,7 +132,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
     }
     @Test
     public void test102_on__gl2___aa8() throws IOException {
-        GLProfile glp = getGLProfile(GLProfile.GL2);
+        final GLProfile glp = getGLProfile(GLProfile.GL2);
         if( null == glp ) {
             return;
         }
@@ -140,7 +140,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
     }
     @Test
     public void test111_on__gl2es3_aa0() throws IOException {
-        GLProfile glp = getGL2ES3();
+        final GLProfile glp = getGL2ES3();
         if( null == glp ) {
             return;
         }
@@ -148,15 +148,15 @@ public class TestTiledRendering2NEWT extends UITestCase {
     }
     @Test
     public void test112_on__gl2es3_aa8() throws IOException {
-        GLProfile glp = getGL2ES3();
+        final GLProfile glp = getGL2ES3();
         if( null == glp ) {
             return;
         }
         doTest(true, new GearsES2(), glp, 8);
     }
 
-    void doTest(boolean onscreen, final GLEventListener demo, GLProfile glp, final int msaaCount) throws IOException {
-        GLCapabilities caps = new GLCapabilities(glp);
+    void doTest(final boolean onscreen, final GLEventListener demo, final GLProfile glp, final int msaaCount) throws IOException {
+        final GLCapabilities caps = new GLCapabilities(glp);
         caps.setDoubleBuffered(onscreen);
         if( msaaCount > 0 ) {
             caps.setSampleBuffers(true);
@@ -178,8 +178,8 @@ public class TestTiledRendering2NEWT extends UITestCase {
         glad.addGLEventListener( demo );
 
         // Fix the image size for now
-        final int imageWidth = glad.getWidth() * 6;
-        final int imageHeight = glad.getHeight() * 4;
+        final int imageWidth = glad.getSurfaceWidth() * 6;
+        final int imageHeight = glad.getSurfaceHeight() * 4;
 
         final String filename = this.getSnapshotFilename(0, "-tile", glad.getChosenGLCapabilities(), imageWidth, imageHeight, false, TextureIO.PNG, null);
         final File file = new File(filename);
@@ -187,7 +187,7 @@ public class TestTiledRendering2NEWT extends UITestCase {
         // Initialize the tile rendering library
         final TileRenderer renderer = new TileRenderer();
         renderer.setImageSize(imageWidth, imageHeight);
-        renderer.setTileSize(glad.getWidth(), glad.getHeight(), 0);
+        renderer.setTileSize(glad.getSurfaceWidth(), glad.getSurfaceHeight(), 0);
         renderer.attachAutoDrawable(glad);
 
         final GLPixelBuffer.GLPixelBufferProvider pixelBufferProvider = GLPixelBuffer.defaultProviderWithRowStride;
@@ -195,10 +195,10 @@ public class TestTiledRendering2NEWT extends UITestCase {
 
         final GLEventListener preTileGLEL = new GLEventListener() {
             @Override
-            public void init(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {
                 final GL gl = drawable.getGL();
-                GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
-                GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
+                final GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(gl, 3);
+                final GLPixelBuffer pixelBuffer = pixelBufferProvider.allocate(gl, pixelAttribs, imageWidth, imageHeight, 1, true, 0);
                 renderer.setImageBuffer(pixelBuffer);
                 if( drawable.isGLOriented() ) {
                     flipVertically[0] = false;
@@ -207,11 +207,11 @@ public class TestTiledRendering2NEWT extends UITestCase {
                 }
             }
             @Override
-            public void dispose(GLAutoDrawable drawable) {}
+            public void dispose(final GLAutoDrawable drawable) {}
             @Override
-            public void display(GLAutoDrawable drawable) {}
+            public void display(final GLAutoDrawable drawable) {}
             @Override
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
         };
         renderer.setGLEventListener(preTileGLEL, null);
 
@@ -225,9 +225,9 @@ public class TestTiledRendering2NEWT extends UITestCase {
         // .. even though we close the demo, this is for documentation!
         glad.invoke(true, new GLRunnable() {
             @Override
-            public boolean run(GLAutoDrawable drawable) {
-                drawable.getGL().glViewport(0, 0, drawable.getWidth(), drawable.getHeight());
-                demo.reshape(drawable, 0, 0, drawable.getWidth(), drawable.getHeight());
+            public boolean run(final GLAutoDrawable drawable) {
+                drawable.getGL().glViewport(0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
+                demo.reshape(drawable, 0, 0, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
                 return false;
             }
         });
@@ -249,13 +249,13 @@ public class TestTiledRendering2NEWT extends UITestCase {
         glad.destroy();
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         org.junit.runner.JUnitCore.main(TestTiledRendering2NEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TiledPrintingAWTBase.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TiledPrintingAWTBase.java
index 4e9d4bd..e84bb4d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TiledPrintingAWTBase.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TiledPrintingAWTBase.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -60,13 +60,13 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.util.TileRenderer;
 
 /**
- * Base unit test class implementing 
+ * Base unit test class implementing
  * issuing {@link PrinterJob#print()} on a {@link Printable} implementation,
  * i.e. {@link OnscreenPrintable} or {@link OffscreenPrintable}.
  */
 public abstract class TiledPrintingAWTBase extends UITestCase {
-    
-    private RecursiveLock lock = LockFactory.createRecursiveLock();
+
+    private final RecursiveLock lock = LockFactory.createRecursiveLock();
     private int printCount = 0;
 
     public TiledPrintingAWTBase() {
@@ -74,19 +74,19 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
     }
 
     /**
-     * 
+     *
      * @param cont
      * @param pOrientation
      * @param paper
      * @param offscrnImageType if < 0 onscreen, otherwise integer BufferedImage type
      * @param dpi
-     * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples 
+     * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
      * @param tileWidth custom tile width for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
      * @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
      * @param resizeWithinPrintTest TODO
      */
-    public PrintableBase doPrintAuto(Container cont, int pOrientation, Paper paper, 
-                                     int offscrnImageType, int dpi, int numSamples, int tileWidth, int tileHeight, boolean resizeWithinPrintTest) {
+    public PrintableBase doPrintAuto(final Container cont, final int pOrientation, final Paper paper,
+                                     final int offscrnImageType, final int dpi, final int numSamples, final int tileWidth, final int tileHeight, final boolean resizeWithinPrintTest) {
         lock.lock();
         try {
             final PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet();
@@ -94,13 +94,13 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
             aset.add(MediaSizeName.ISO_A2); // 420 × 594 mm
             aset.add(MediaSizeName.ISO_A3); // 297 × 420 mm
             aset.add(MediaSizeName.ISO_A4); // 210 × 297 mm
-            
+
             printCount++;
-            
+
             final String psMimeType = "application/postscript";
             final String pdfMimeType = "application/pdf";
             final PrinterJob pj = PrinterJob.getPrinterJob();
-        
+
             StreamPrintServiceFactory[] factories = PrinterJob.lookupStreamPrintServices(pdfMimeType);
             if (factories.length > 0) {
                 final String fname = getPrintFilename(offscrnImageType, dpi, numSamples, tileWidth, tileHeight, "pdf", resizeWithinPrintTest);
@@ -108,14 +108,14 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
                 FileOutputStream outstream;
                 try {
                     outstream = new FileOutputStream(fname);
-                    return doPrintAutoImpl(cont, pj, factories[0].getPrintService(outstream), pOrientation, paper, 
+                    return doPrintAutoImpl(cont, pj, factories[0].getPrintService(outstream), pOrientation, paper,
                             offscrnImageType, dpi, numSamples, tileWidth, tileHeight, resizeWithinPrintTest);
-                } catch (FileNotFoundException e) {
+                } catch (final FileNotFoundException e) {
                     Assert.assertNull("Unexpected exception", e);
                 }
-            }        
+            }
             System.err.println("No PDF");
-            
+
             factories = PrinterJob.lookupStreamPrintServices(psMimeType);
             if (factories.length > 0) {
                 final String fname = getPrintFilename(offscrnImageType, dpi, numSamples, tileWidth, tileHeight, "ps", resizeWithinPrintTest);
@@ -124,29 +124,29 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
                 try {
                     outstream = new FileOutputStream(fname);
                     return doPrintAutoImpl(cont, pj, factories[0].getPrintService(outstream), pOrientation, paper, offscrnImageType, dpi, numSamples, tileWidth, tileHeight, resizeWithinPrintTest);
-                } catch (FileNotFoundException e) {
+                } catch (final FileNotFoundException e) {
                     Assert.assertNull("Unexpected exception", e);
                 }
-            }        
+            }
             System.err.println("No PS");
             return null;
         } finally {
             lock.unlock();
         }
     }
-    private String getPrintFilename(int offscrnImageType, int dpi, int numSamples, int tileWidth, int tileHeight, String suffix, boolean resizeWithinPrintTest) {
+    private String getPrintFilename(final int offscrnImageType, final int dpi, final int numSamples, final int tileWidth, final int tileHeight, final String suffix, final boolean resizeWithinPrintTest) {
         final int maxSimpleTestNameLen = getMaxTestNameLen()+getClass().getSimpleName().length()+1;
         final String simpleTestName = getSimpleTestName(".");
         final String onoffscrn = 0 > offscrnImageType ? "on_screen" : "offscrn_"+offscrnImageType;
         final String aa = 0 <= numSamples ? "aa"+numSamples : "aaN";
-        return String.format("%-"+maxSimpleTestNameLen+"s-n%04d-%s-dpi%03d-%s-tSz%04dx%04d-resize%d.%s", 
+        return String.format("%-"+maxSimpleTestNameLen+"s-n%04d-%s-dpi%03d-%s-tSz%04dx%04d-resize%d.%s",
                 simpleTestName, printCount, onoffscrn, dpi, aa, tileWidth, tileHeight, resizeWithinPrintTest?1:0, suffix).replace(' ', '_');
     }
-    private PrintableBase doPrintAutoImpl(Container cont, PrinterJob job, 
-                                          StreamPrintService ps, int pOrientation, Paper paper, 
-                                          int offscrnImageType, int dpi, int numSamples, int tileWidth, int tileHeight, boolean resizeWithinPrintTest) {
-        try {            
-            PageFormat pageFormat = job.defaultPage();
+    private PrintableBase doPrintAutoImpl(final Container cont, final PrinterJob job,
+                                          final StreamPrintService ps, final int pOrientation, final Paper paper,
+                                          final int offscrnImageType, final int dpi, final int numSamples, final int tileWidth, final int tileHeight, final boolean resizeWithinPrintTest) {
+        try {
+            final PageFormat pageFormat = job.defaultPage();
             if( null != paper ) {
                 /**
                 Paper paper = new Paper();
@@ -165,25 +165,25 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
             printable.job.setPrintable(printable, pageFormat);
             doPrintImpl(printable, resizeWithinPrintTest);
             return printable;
-        } catch (PrinterException pe) {
+        } catch (final PrinterException pe) {
             pe.printStackTrace();
             return null;
-        }        
+        }
     }
 
     /**
      * @param cont
      * @param dpi
-     * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples 
+     * @param numSamples multisampling value: < 0 turns off, == 0 leaves as-is, > 0 enables using given num samples
      * @param tileWidth custom tile width for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
      * @param tileHeight custom tile height for {@link TileRenderer#setTileSize(int, int, int) tile renderer}, pass -1 for default.
      */
-    public PrintableBase doPrintManual(Container cont, int dpi, int numSamples, int tileWidth, int tileHeight) {
+    public PrintableBase doPrintManual(final Container cont, final int dpi, final int numSamples, final int tileWidth, final int tileHeight) {
         lock.lock();
         try {
             final OnscreenPrintable printable = new OnscreenPrintable(PrinterJob.getPrinterJob(), cont, dpi, numSamples, tileWidth, tileHeight);
             printable.job.setPrintable(printable);
-            boolean ok = printable.job.printDialog();
+            final boolean ok = printable.job.printDialog();
             if (ok) {
                doPrintImpl(printable, false);
             }
@@ -192,10 +192,10 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
             lock.unlock();
         }
     }
-    
+
     private final AWTMisc.ComponentAction resizePlusAction = new AWTMisc.ComponentAction() {
         @Override
-        public void run(Component c) {
+        public void run(final Component c) {
             final Rectangle r = c.getBounds();
             r.width += 64;
             r.height += 64;
@@ -203,19 +203,19 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
         } };
     private final AWTMisc.ComponentAction resizeMinusAction = new AWTMisc.ComponentAction() {
         @Override
-        public void run(Component c) {
+        public void run(final Component c) {
             final Rectangle r = c.getBounds();
             r.width -= 64;
             r.height -= 64;
             c.setBounds(r);
         } };
-            
+
     private void doPrintImpl(final PrintableBase printable, final boolean resizeWithinPrintTest) {
        final double scaleGLMatXY = 72.0 / printable.dpi;
        System.err.println("PRINTable: "+printable.getClass().getSimpleName());
        System.err.println("PRINT DPI: "+printable.dpi+", AA "+printable.numSamples+", scaleGL "+scaleGLMatXY);
-       final AWTPrintLifecycle.Context ctx = 
-               AWTPrintLifecycle.Context.setupPrint(printable.cont, scaleGLMatXY, scaleGLMatXY, 
+       final AWTPrintLifecycle.Context ctx =
+               AWTPrintLifecycle.Context.setupPrint(printable.cont, scaleGLMatXY, scaleGLMatXY,
                                                     printable.numSamples, printable.tileWidth, printable.tileHeight);
        System.err.println("PRINT AWTPrintLifecycle.setup.count "+ctx.getCount());
        final int w = printable.cont.getWidth();
@@ -227,14 +227,14 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
                 try {
                     if( resizeWithinPrintTest ) {
                         System.err.println("PRINT resizeWithinPrint size+ "+(w+64)+"x"+(h+64));
-                        AWTMisc.performAction(printable.cont, GLAutoDrawable.class, resizePlusAction);                        
+                        AWTMisc.performAction(printable.cont, GLAutoDrawable.class, resizePlusAction);
                         printable.cont.validate();
                         if( printable.cont instanceof Window ) {
                             ((Window)printable.cont).pack();
                         }
                     }
                     printable.job.print();
-                } catch (PrinterException ex) {
+                } catch (final PrinterException ex) {
                     ex.printStackTrace();
                 }
            } });
@@ -248,7 +248,7 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
                    System.err.println("PRINT resizeWithinPrint repaint");
                    printable.cont.repaint();
                    System.err.println("PRINT resizeWithinPrint size- "+w+"x"+h);
-                   AWTMisc.performAction(printable.cont, GLAutoDrawable.class, resizeMinusAction);                        
+                   AWTMisc.performAction(printable.cont, GLAutoDrawable.class, resizeMinusAction);
                    printable.cont.validate();
                    if( printable.cont instanceof Window ) {
                        ((Window)printable.cont).pack();
@@ -260,7 +260,7 @@ public abstract class TiledPrintingAWTBase extends UITestCase {
     }
 
     /** Wait for idle .. simply acquiring all locks and releasing them. */
-    public void waitUntilPrintJobsIdle(PrintableBase p) {
+    public void waitUntilPrintJobsIdle(final PrintableBase p) {
         lock.lock();
         try {
             if( null != p ) {
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TransparentPanel.java b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TransparentPanel.java
index d68f878..9fc790a 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/tile/TransparentPanel.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/tile/TransparentPanel.java
@@ -11,7 +11,7 @@ public class TransparentPanel extends JPanel {
     }
 
     @Override
-        public void setOpaque(boolean isOpaque) {
+        public void setOpaque(final boolean isOpaque) {
         // Don't let this panel become opaque
     }
 
@@ -31,18 +31,18 @@ public class TransparentPanel extends JPanel {
      * @param c The Component on which to set the cut out shape.
      * @param s The shape to cut out of the given Component.
      */
-    public void setMixingCutoutShape(Shape s) 
+    public void setMixingCutoutShape(final Shape s)
     {
         // Get the cut out shape method
         if (mSetComponentMixing == null) {
             try {
-                Class<?> awtUtilitiesClass = 
+                final Class<?> awtUtilitiesClass =
                     Class.forName("com.sun.awt.AWTUtilities");
-                mSetComponentMixing = 
+                mSetComponentMixing =
                     awtUtilitiesClass.getMethod(
-                        "setComponentMixingCutoutShape", 
+                        "setComponentMixingCutoutShape",
                         Component.class, Shape.class);
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 ex.printStackTrace();
             }
         }
@@ -51,7 +51,7 @@ public class TransparentPanel extends JPanel {
         if (mSetComponentMixing != null) {
             try {
                 mSetComponentMixing.invoke( null, this, s );
-            } catch (Exception ex) {
+            } catch (final Exception ex) {
                 ex.printStackTrace();
             }
         }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1ImmModeSink.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1ImmModeSink.java
index c82e7de..b3f85e8 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1ImmModeSink.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1ImmModeSink.java
@@ -33,6 +33,7 @@ import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLPipelineFactory;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 import javax.media.opengl.glu.GLU;
 import javax.media.opengl.glu.gl2es1.GLUgl2es1;
 
@@ -47,18 +48,18 @@ class DemoGL2ES1ImmModeSink implements GLEventListener {
     private boolean forceFFPEmu = false;
     final ImmModeSink ims;
     final GLU glu;
-    
-    DemoGL2ES1ImmModeSink(boolean useVBO) {
-        ims = ImmModeSink.createFixed(3*3, 
+
+    DemoGL2ES1ImmModeSink(final boolean useVBO) {
+        ims = ImmModeSink.createFixed(3*3,
                                       3, GL.GL_FLOAT, // vertex
                                       3, GL.GL_FLOAT, // color
                                       0, GL.GL_FLOAT, // normal
-                                      0, GL.GL_FLOAT, // texCoords 
+                                      0, GL.GL_FLOAT, // texCoords
                                       useVBO ? GL.GL_STATIC_DRAW : 0);
         glu = new GLUgl2es1();
     }
-    
-    public void setForceFFPEmu(boolean forceFFPEmu, boolean verboseFFPEmu, boolean debugFFPEmu, boolean traceFFPEmu) {
+
+    public void setForceFFPEmu(final boolean forceFFPEmu, final boolean verboseFFPEmu, final boolean debugFFPEmu, final boolean traceFFPEmu) {
         this.forceFFPEmu = forceFFPEmu;
         this.verboseFFPEmu = verboseFFPEmu;
         this.debugFFPEmu = debugFFPEmu;
@@ -66,7 +67,7 @@ class DemoGL2ES1ImmModeSink implements GLEventListener {
     }
 
     @Override
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         GL _gl = drawable.getGL();
         if(debugFFPEmu) {
             // Debug ..
@@ -76,31 +77,31 @@ class DemoGL2ES1ImmModeSink implements GLEventListener {
             // Trace ..
             _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES2.class, _gl, new Object[] { System.err } ) );
         }
-        GL2ES1 gl = FixedFuncUtil.wrapFixedFuncEmul(_gl, ShaderSelectionMode.AUTO, null, forceFFPEmu, verboseFFPEmu);
-        
+        final GL2ES1 gl = FixedFuncUtil.wrapFixedFuncEmul(_gl, ShaderSelectionMode.AUTO, null, forceFFPEmu, verboseFFPEmu);
+
         System.err.println("GL_VENDOR   "+gl.glGetString(GL.GL_VENDOR));
         System.err.println("GL_RENDERER "+gl.glGetString(GL.GL_RENDERER));
         System.err.println("GL_VERSION  "+gl.glGetString(GL.GL_VERSION));
     }
 
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
-        
-        gl.glMatrixMode( GL2ES1.GL_PROJECTION );
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+        final GL2ES1 gl = drawable.getGL().getGL2ES1();
+
+        gl.glMatrixMode( GLMatrixFunc.GL_PROJECTION );
         gl.glLoadIdentity();
 
         // coordinate system origin at lower left with width and height same as the window
         glu.gluOrtho2D( 0.0f, width, 0.0f, height );
 
-        gl.glMatrixMode( GL2ES1.GL_MODELVIEW );
+        gl.glMatrixMode( GLMatrixFunc.GL_MODELVIEW );
         gl.glLoadIdentity();
     }
-    
+
     @Override
-    public void display(GLAutoDrawable drawable) {
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
-        
+    public void display(final GLAutoDrawable drawable) {
+        final GL2ES1 gl = drawable.getGL().getGL2ES1();
+
         gl.glClear( GL.GL_COLOR_BUFFER_BIT );
 
         // draw a triangle filling the window
@@ -108,13 +109,13 @@ class DemoGL2ES1ImmModeSink implements GLEventListener {
         ims.glColor3f( 1, 0, 0 );
         ims.glVertex2f( 0, 0 );
         ims.glColor3f( 0, 1, 0 );
-        ims.glVertex2f( drawable.getWidth(), 0 );
+        ims.glVertex2f( drawable.getSurfaceWidth(), 0 );
         ims.glColor3f( 0, 0, 1 );
-        ims.glVertex2f( drawable.getWidth() / 2, drawable.getHeight() );
+        ims.glVertex2f( drawable.getSurfaceWidth() / 2f, drawable.getSurfaceHeight() );
         ims.glEnd(gl, true);
     }
 
     @Override
-    public void dispose(GLAutoDrawable drawable) {
-    }        
+    public void dispose(final GLAutoDrawable drawable) {
+    }
 }
\ No newline at end of file
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1Plain.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1Plain.java
index 0df3686..c1dd7fb 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1Plain.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1Plain.java
@@ -35,6 +35,7 @@ import javax.media.opengl.GL2ES1;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLException;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 import javax.media.opengl.fixedfunc.GLPointerFunc;
 import javax.media.opengl.glu.GLU;
 import javax.media.opengl.glu.gl2es1.GLUgl2es1;
@@ -47,58 +48,58 @@ class DemoGL2ES1Plain implements GLEventListener {
     final boolean useArrayData;
     final boolean useVBO;
     final GLU glu;
-    
+
     final float[] vertices = new float[] { 0,          0,       0,
                                            TestImmModeSinkES1NEWT.iWidth,     0,       0,
                                            TestImmModeSinkES1NEWT.iWidth / 2, TestImmModeSinkES1NEWT.iHeight, 0 };
-    
-    final float[] colors = new float[] { 1, 0, 0, 
-                                         0, 1, 0, 
+
+    final float[] colors = new float[] { 1, 0, 0,
+                                         0, 1, 0,
                                          0, 0, 1 };
-    
+
     final ByteBuffer bufferAll;
     final int bufferVOffset, bufferCOffset;
     final int bufferVSize, bufferCSize;
     final FloatBuffer bufferC, bufferV;
     final int[] vboName = new int[] { 0 };
     final GLArrayDataWrapper arrayC, arrayV;
-    
-    DemoGL2ES1Plain(boolean useArrayData, boolean useVBO) {
+
+    DemoGL2ES1Plain(final boolean useArrayData, final boolean useVBO) {
         this.useArrayData = useArrayData;
-        this.useVBO = useVBO;            
+        this.useVBO = useVBO;
         this.glu = new GLUgl2es1();
-        
+
         bufferAll = Buffers.newDirectByteBuffer( ( colors.length + vertices.length ) * Buffers.SIZEOF_FLOAT );
-        
+
         bufferVOffset = 0;
         bufferVSize = 3*3*GLBuffers.sizeOfGLType(GL.GL_FLOAT);
         bufferCOffset = bufferVSize;
         bufferCSize = 3*3*GLBuffers.sizeOfGLType(GL.GL_FLOAT);
-        
+
         bufferV = (FloatBuffer) GLBuffers.sliceGLBuffer(bufferAll, bufferVOffset, bufferVSize, GL.GL_FLOAT);
         bufferV.put(vertices, 0, vertices.length).rewind();
         bufferC = (FloatBuffer) GLBuffers.sliceGLBuffer(bufferAll, bufferCOffset, bufferCSize, GL.GL_FLOAT);
         bufferC.put(colors, 0, colors.length).rewind();
-        
+
         System.err.println("bufferAll: "+bufferAll+", byteOffset "+Buffers.getDirectBufferByteOffset(bufferAll));
         System.err.println("bufferV: off "+bufferVOffset+", size "+bufferVSize+": "+bufferV+", byteOffset "+Buffers.getDirectBufferByteOffset(bufferV));
         System.err.println("bufferC: off "+bufferCOffset+", size "+bufferCSize+": "+bufferC+", byteOffset "+Buffers.getDirectBufferByteOffset(bufferC));
-    
-        if(useArrayData) {            
+
+        if(useArrayData) {
             arrayV = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_VERTEX_ARRAY, 3, GL.GL_FLOAT, false, 0,
                                                     bufferV, 0, bufferVOffset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER);
-            
+
             arrayC = GLArrayDataWrapper.createFixed(GLPointerFunc.GL_COLOR_ARRAY, 3, GL.GL_FLOAT, false, 0,
                                                     bufferC, 0, bufferCOffset, GL.GL_STATIC_DRAW, GL.GL_ARRAY_BUFFER);
         } else {
             arrayV = null;
-            arrayC = null;                
+            arrayC = null;
         }
     }
-    
+
     @Override
-    public void init(GLAutoDrawable drawable) {
-        GL gl = drawable.getGL();
+    public void init(final GLAutoDrawable drawable) {
+        final GL gl = drawable.getGL();
         System.err.println("GL_VENDOR   "+gl.glGetString(GL.GL_VENDOR));
         System.err.println("GL_RENDERER "+gl.glGetString(GL.GL_RENDERER));
         System.err.println("GL_VERSION  "+gl.glGetString(GL.GL_VERSION));
@@ -111,25 +112,25 @@ class DemoGL2ES1Plain implements GLEventListener {
     }
 
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
-        
-        gl.glMatrixMode( GL2ES1.GL_PROJECTION );
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+        final GL2ES1 gl = drawable.getGL().getGL2ES1();
+
+        gl.glMatrixMode( GLMatrixFunc.GL_PROJECTION );
         gl.glLoadIdentity();
 
         // coordinate system origin at lower left with width and height same as the window
         glu.gluOrtho2D( 0.0f, width, 0.0f, height );
 
-        gl.glMatrixMode( GL2ES1.GL_MODELVIEW );
+        gl.glMatrixMode( GLMatrixFunc.GL_MODELVIEW );
         gl.glLoadIdentity();
 
-        gl.glViewport( 0, 0, width, height );        
+        gl.glViewport( 0, 0, width, height );
     }
-    
+
     @Override
-    public void display(GLAutoDrawable drawable) {
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
-        
+    public void display(final GLAutoDrawable drawable) {
+        final GL2ES1 gl = drawable.getGL().getGL2ES1();
+
         gl.glClear( GL.GL_COLOR_BUFFER_BIT );
 
         // draw a triangle filling the window
@@ -143,46 +144,46 @@ class DemoGL2ES1Plain implements GLEventListener {
                 arrayC.setVBOName(vboName[0]);
             }
         }
-        
+
         gl.glEnableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
         if(useArrayData) {
             gl.glVertexPointer(arrayV);
         } else {
-            if(useVBO) {            
+            if(useVBO) {
                 gl.glVertexPointer(3, GL.GL_FLOAT, 0, bufferVOffset);
             } else {
                 gl.glVertexPointer(3, GL.GL_FLOAT, 0, bufferV);
             }
         }
-                    
-        gl.glEnableClientState(GLPointerFunc.GL_COLOR_ARRAY);            
+
+        gl.glEnableClientState(GLPointerFunc.GL_COLOR_ARRAY);
         if(useArrayData) {
             gl.glColorPointer(arrayC);
         } else {
-            if(useVBO) {            
+            if(useVBO) {
                 gl.glColorPointer(3, GL.GL_FLOAT, 0, bufferCOffset);
             } else {
                 gl.glColorPointer(3, GL.GL_FLOAT, 0, bufferC);
             }
         }
-                    
+
         if(useVBO) {
             gl.glBindBuffer(GL.GL_ARRAY_BUFFER, 0);
         }
-        
+
         gl.glDrawArrays(GL.GL_TRIANGLES, 0, 3);
         gl.glFlush();
-        
+
         gl.glDisableClientState(GLPointerFunc.GL_COLOR_ARRAY);
         gl.glDisableClientState(GLPointerFunc.GL_VERTEX_ARRAY);
     }
 
     @Override
-    public void dispose(GLAutoDrawable drawable) {
-        GL gl = drawable.getGL();
+    public void dispose(final GLAutoDrawable drawable) {
+        final GL gl = drawable.getGL();
         if(0 != vboName[0]) {
             gl.glDeleteBuffers(1, vboName, 0);
             vboName[0] = 0;
         }
-    }        
+    }
 }
\ No newline at end of file
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1TextureImmModeSink.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1TextureImmModeSink.java
index d776021..d186643 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1TextureImmModeSink.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES1TextureImmModeSink.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -33,6 +33,7 @@ import java.net.URLConnection;
 
 import com.jogamp.common.util.IOUtil;
 import com.jogamp.opengl.test.junit.jogl.demos.TextureDraw01Accessor;
+import com.jogamp.opengl.test.junit.jogl.util.texture.PNGTstFiles;
 import com.jogamp.opengl.util.ImmModeSink;
 import com.jogamp.opengl.util.glsl.fixedfunc.FixedFuncUtil;
 import com.jogamp.opengl.util.glsl.fixedfunc.ShaderSelectionMode;
@@ -47,6 +48,7 @@ import javax.media.opengl.GL2ES2;
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLEventListener;
 import javax.media.opengl.GLPipelineFactory;
+import javax.media.opengl.fixedfunc.GLMatrixFunc;
 import javax.media.opengl.glu.GLU;
 
 public class DemoGL2ES1TextureImmModeSink implements GLEventListener, TextureDraw01Accessor {
@@ -54,8 +56,8 @@ public class DemoGL2ES1TextureImmModeSink implements GLEventListener, TextureDra
     private boolean verboseFFPEmu = false;
     private boolean traceFFPEmu = false;
     private boolean forceFFPEmu = false;
-    private ImmModeSink ims;
-    private GLU      glu = new GLU();
+    private final ImmModeSink ims;
+    private final GLU      glu = new GLU();
     private TextureData textureData;
     private Texture  texture;
     boolean keepTextureBound;
@@ -65,7 +67,7 @@ public class DemoGL2ES1TextureImmModeSink implements GLEventListener, TextureDra
         this.keepTextureBound = false;
     }
 
-    public void setForceFFPEmu(boolean forceFFPEmu, boolean verboseFFPEmu, boolean debugFFPEmu, boolean traceFFPEmu) {
+    public void setForceFFPEmu(final boolean forceFFPEmu, final boolean verboseFFPEmu, final boolean debugFFPEmu, final boolean traceFFPEmu) {
         this.forceFFPEmu = forceFFPEmu;
         this.verboseFFPEmu = verboseFFPEmu;
         this.debugFFPEmu = debugFFPEmu;
@@ -74,16 +76,16 @@ public class DemoGL2ES1TextureImmModeSink implements GLEventListener, TextureDra
 
 
     @Override
-    public void setKeepTextureBound(boolean v) {
+    public void setKeepTextureBound(final boolean v) {
         this.keepTextureBound = v;
     }
     @Override
     public Texture getTexture( ) {
         return this.texture;
     }
-    
+
     @Override
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         GL _gl = drawable.getGL();
         if(debugFFPEmu) {
             // Debug ..
@@ -93,35 +95,35 @@ public class DemoGL2ES1TextureImmModeSink implements GLEventListener, TextureDra
             // Trace ..
             _gl = _gl.getContext().setGL( GLPipelineFactory.create("javax.media.opengl.Trace", GL2ES2.class, _gl, new Object[] { System.err } ) );
         }
-        GL2ES1 gl = FixedFuncUtil.wrapFixedFuncEmul(_gl, ShaderSelectionMode.AUTO, null, forceFFPEmu, verboseFFPEmu);
+        final GL2ES1 gl = FixedFuncUtil.wrapFixedFuncEmul(_gl, ShaderSelectionMode.AUTO, null, forceFFPEmu, verboseFFPEmu);
 
-        URLConnection testTextureUrlConn = IOUtil.getResource("jogl/util/data/av/test-ntsc01-57x32.png", this.getClass().getClassLoader());
+        final URLConnection testTextureUrlConn = IOUtil.getResource(PNGTstFiles.class, "test-ntscP_3-01-160x90.png");
         try {
-            InputStream  testTextureStream = testTextureUrlConn.getInputStream();
+            final InputStream  testTextureStream = testTextureUrlConn.getInputStream();
             textureData = TextureIO.newTextureData(gl.getGLProfile(), testTextureStream , false /* mipmap */, TextureIO.PNG);
             texture = TextureIO.newTexture(gl, textureData);
             if( keepTextureBound && null != texture ) {
                 texture.enable(gl);
                 texture.bind(gl);
             }
-        } catch (Exception e) {
+        } catch (final Exception e) {
             e.printStackTrace();
         }
     }
 
     @Override
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
-        gl.glMatrixMode(GL2ES1.GL_PROJECTION);
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
+        final GL2ES1 gl = drawable.getGL().getGL2ES1();
+        gl.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         gl.glLoadIdentity();
         glu.gluOrtho2D(0, 1, 0, 1);
-        gl.glMatrixMode(GL2ES1.GL_MODELVIEW);
+        gl.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         gl.glLoadIdentity();
     }
 
     @Override
-    public void dispose(GLAutoDrawable drawable) {
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
+    public void dispose(final GLAutoDrawable drawable) {
+        final GL2ES1 gl = drawable.getGL().getGL2ES1();
         if(null!=texture) {
             texture.disable(gl);
             texture.destroy(gl);
@@ -132,8 +134,8 @@ public class DemoGL2ES1TextureImmModeSink implements GLEventListener, TextureDra
     }
 
     @Override
-    public void display(GLAutoDrawable drawable) {
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
+    public void display(final GLAutoDrawable drawable) {
+        final GL2ES1 gl = drawable.getGL().getGL2ES1();
 
         // draw one quad with the texture
         if(null!=texture) {
@@ -142,7 +144,7 @@ public class DemoGL2ES1TextureImmModeSink implements GLEventListener, TextureDra
                 texture.bind(gl);
             }
             // gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL2.GL_TEXTURE_ENV_MODE, GL2.GL_REPLACE);
-            TextureCoords coords = texture.getImageTexCoords();
+            final TextureCoords coords = texture.getImageTexCoords();
             ims.glBegin(ImmModeSink.GL_QUADS);
             ims.glTexCoord2f(coords.left(), coords.bottom());
             ims.glVertex3f(0, 0, 0);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES2ImmModeSink.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES2ImmModeSink.java
index 02f161c..3dc2938 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES2ImmModeSink.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/DemoGL2ES2ImmModeSink.java
@@ -46,12 +46,12 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
 
     private final ShaderState st;
     private final PMVMatrix pmvMatrix;
-    private int glBufferUsage;
+    private final int glBufferUsage;
     private ShaderProgram sp;
     private GLUniformData pmvMatrixUniform;
     private ImmModeSink ims;
 
-    public DemoGL2ES2ImmModeSink(boolean useVBO, boolean useShaderState) {
+    public DemoGL2ES2ImmModeSink(final boolean useVBO, final boolean useShaderState) {
         if(useShaderState) {
             st = new ShaderState();
             st.setVerbose(true);
@@ -59,23 +59,23 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
             st = null;
         }
         glBufferUsage = useVBO ? GL.GL_STATIC_DRAW : 0;
-        pmvMatrix = new PMVMatrix();        
+        pmvMatrix = new PMVMatrix();
     }
 
-    public void init(GLAutoDrawable glad) {
+    public void init(final GLAutoDrawable glad) {
         final GL2ES2 gl = glad.getGL().getGL2ES2();
-                
+
         System.err.println("GL_VENDOR   "+gl.glGetString(GL.GL_VENDOR));
         System.err.println("GL_RENDERER "+gl.glGetString(GL.GL_RENDERER));
         System.err.println("GL_VERSION  "+gl.glGetString(GL.GL_VERSION));
-                
-        final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, DemoGL2ES2ImmModeSink.class, 
+
+        final ShaderCode vp0 = ShaderCode.create(gl, GL2ES2.GL_VERTEX_SHADER, DemoGL2ES2ImmModeSink.class,
                 "../demos/es2/shader", "../demos/es2/shader/bin", "mgl_default_xxx", true);
-        final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, DemoGL2ES2ImmModeSink.class, 
+        final ShaderCode fp0 = ShaderCode.create(gl, GL2ES2.GL_FRAGMENT_SHADER, DemoGL2ES2ImmModeSink.class,
                 "../demos/es2/shader", "../demos/es2/shader/bin", "mgl_default_xxx", true);
         vp0.defaultShaderCustomization(gl, true, true);
         fp0.defaultShaderCustomization(gl, true, true);
-        
+
         sp = new ShaderProgram();
         sp.add(gl, vp0, System.err);
         sp.add(gl, fp0, System.err);
@@ -87,10 +87,10 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
             }
             sp.useProgram(gl, true);
         }
-        
+
         pmvMatrixUniform = new GLUniformData("mgl_PMVMatrix", 4, 4, pmvMatrix.glGetPMvMatrixf());
         if(null != st) {
-            st.ownUniform(pmvMatrixUniform);       
+            st.ownUniform(pmvMatrixUniform);
             st.uniform(gl, pmvMatrixUniform);
         } else {
             if( pmvMatrixUniform.setLocation(gl, sp.program()) < 0 ) {
@@ -98,8 +98,8 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
             }
             gl.glUniform(pmvMatrixUniform);
         }
-        
-        // Using predef array names, see 
+
+        // Using predef array names, see
         //    GLPointerFuncUtil.getPredefinedArrayIndexName(glArrayIndex);
         if( null != st ) {
             ims = ImmModeSink.createGLSL(40,
@@ -114,24 +114,24 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
                                          4, GL.GL_FLOAT,  // color
                                          0, GL.GL_FLOAT,  // normal
                                          0, GL.GL_FLOAT,  // texCoords
-                                         glBufferUsage, sp.program());            
+                                         glBufferUsage, sp.program());
         }
         final int numSteps = 20;
         final double increment = Math.PI / numSteps;
         final double radius = 1;
         ims.glBegin(GL.GL_LINES);
         for (int i = numSteps - 1; i >= 0; i--) {
-            ims.glVertex3f((float) (radius * Math.cos(i * increment)), 
-                                   (float) (radius * Math.sin(i * increment)), 
+            ims.glVertex3f((float) (radius * Math.cos(i * increment)),
+                                   (float) (radius * Math.sin(i * increment)),
                                    0f);
-            ims.glColor4f( 1f, 1f, 1f, 1f ); 
-            ims.glVertex3f((float) (-1.0 * radius * Math.cos(i * increment)), 
-                                   (float) (-1.0 * radius * Math.sin(i * increment)), 
+            ims.glColor4f( 1f, 1f, 1f, 1f );
+            ims.glVertex3f((float) (-1.0 * radius * Math.cos(i * increment)),
+                                   (float) (-1.0 * radius * Math.sin(i * increment)),
                                    0f);
-            ims.glColor4f( 1f, 1f, 1f, 1f ); 
+            ims.glColor4f( 1f, 1f, 1f, 1f );
         }
         ims.glEnd(gl, false);
-        
+
         if(null != st) {
             st.useProgram(gl, false);
         } else {
@@ -139,7 +139,7 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
         }
     }
 
-    public void dispose(GLAutoDrawable glad) {
+    public void dispose(final GLAutoDrawable glad) {
         final GL2ES2 gl = glad.getGL().getGL2ES2();
         ims.destroy(gl);
         ims = null;
@@ -148,35 +148,35 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
         }
     }
 
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         final GL2ES2 gl = drawable.getGL().getGL2ES2();
-        
+
         gl.glClear( GL.GL_COLOR_BUFFER_BIT );
 
-        // draw a triangle filling the window        
+        // draw a triangle filling the window
         ims.glBegin(GL.GL_TRIANGLES);
         ims.glColor3f( 1, 0, 0 );
         ims.glVertex2f( 0, 0 );
         ims.glColor3f( 0, 1, 0 );
-        ims.glVertex2f( drawable.getWidth(), 0 );
+        ims.glVertex2f( drawable.getSurfaceWidth(), 0 );
         ims.glColor3f( 0, 0, 1 );
-        ims.glVertex2f( drawable.getWidth() / 2, drawable.getHeight() );
-        ims.glEnd(gl, true);        
+        ims.glVertex2f( drawable.getSurfaceWidth() / 2f, drawable.getSurfaceHeight() );
+        ims.glEnd(gl, true);
     }
 
     // Unused routines
-    public void reshape(GLAutoDrawable glad, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable glad, final int x, final int y, final int width, final int height) {
         System.err.println("reshape ..");
         final GL2ES2 gl = glad.getGL().getGL2ES2();
         pmvMatrix.glMatrixMode(GLMatrixFunc.GL_PROJECTION);
         pmvMatrix.glLoadIdentity();
-        
+
         // coordinate system origin at lower left with width and height same as the window
         pmvMatrix.glOrthof( 0.0f, width, 0.0f, height, -1, 1 );
 
         pmvMatrix.glMatrixMode(GLMatrixFunc.GL_MODELVIEW);
         pmvMatrix.glLoadIdentity();
-        
+
         if(null != st) {
             st.useProgram(gl, true);
             st.uniform(gl, pmvMatrixUniform);
@@ -188,6 +188,6 @@ public class DemoGL2ES2ImmModeSink implements GLEventListener {
         }
     }
 
-    public void displayChanged(GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged) {
+    public void displayChanged(final GLAutoDrawable drawable, final boolean modeChanged, final boolean deviceChanged) {
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/TestES1FixedFunctionPipelineNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/TestES1FixedFunctionPipelineNEWT.java
index e8e3b12..979c487 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/TestES1FixedFunctionPipelineNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/TestES1FixedFunctionPipelineNEWT.java
@@ -62,8 +62,8 @@ public class TestES1FixedFunctionPipelineNEWT extends UITestCase {
     public static void releaseClass() {
     }
 
-    protected void runTestGL0(GLCapabilities caps, GLEventListener demo) throws InterruptedException {
-        GLWindow glWindow = GLWindow.create(caps);
+    protected void runTestGL0(final GLCapabilities caps, final GLEventListener demo) throws InterruptedException {
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle(getSimpleTestName("."));
 
@@ -72,8 +72,8 @@ public class TestES1FixedFunctionPipelineNEWT extends UITestCase {
         snap.setPostSNDetail(demo.getClass().getSimpleName());
         glWindow.addGLEventListener(snap);
 
-        Animator animator = new Animator(glWindow);
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final Animator animator = new Animator(glWindow);
+        final QuitAdapter quitAdapter = new QuitAdapter();
         glWindow.addKeyListener(quitAdapter);
         glWindow.addWindowListener(quitAdapter);
 
@@ -92,7 +92,7 @@ public class TestES1FixedFunctionPipelineNEWT extends UITestCase {
         glWindow.destroy();
     }
 
-    protected void runTestGL(GLCapabilities caps, boolean forceFFPEmu) throws InterruptedException {
+    protected void runTestGL(final GLCapabilities caps, final boolean forceFFPEmu) throws InterruptedException {
         final RedSquareES1 demo01 = new RedSquareES1();
         demo01.setForceFFPEmu(forceFFPEmu, false, false, false);
         runTestGL0(caps, demo01);
@@ -113,40 +113,40 @@ public class TestES1FixedFunctionPipelineNEWT extends UITestCase {
     @Test
     public void test01GL2Normal() throws InterruptedException {
         if(!GLProfile.isAvailable(GLProfile.GL2)) { System.err.println("GL2 n/a"); return; }
-        GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
+        final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
         runTestGL(caps, false);
     }
 
     @Test
     public void test02GL2FFPEmu() throws InterruptedException {
         if(!GLProfile.isAvailable(GLProfile.GL2)) { System.err.println("GL2 n/a"); return; }
-        GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
+        final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2));
         runTestGL(caps, true);
     }
 
     @Test
     public void test03GL2ES1Normal() throws InterruptedException {
         if(!GLProfile.isAvailable(GLProfile.GL2ES1)) { System.err.println("GL2ES1 n/a"); return; }
-        GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES1));
+        final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GL2ES1));
         runTestGL(caps, false);
     }
 
     @Test
     public void test04ES2FFPEmu() throws InterruptedException {
         if(!GLProfile.isAvailable(GLProfile.GLES2)) { System.err.println("GLES2 n/a"); return; }
-        GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
+        final GLCapabilities caps = new GLCapabilities(GLProfile.get(GLProfile.GLES2));
         runTestGL(caps, false); // should be FFPEmu implicit
     }
 
     static long duration = 1000; // ms
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 try {
                     duration = Integer.parseInt(args[i]);
-                } catch (Exception ex) { ex.printStackTrace(); }
+                } catch (final Exception ex) { ex.printStackTrace(); }
             }
         }
         org.junit.runner.JUnitCore.main(TestES1FixedFunctionPipelineNEWT.class.getName());
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES1NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES1NEWT.java
index 0ac01bc..790f965 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES1NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES1NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.util;
 
 import java.io.IOException;
@@ -52,86 +52,86 @@ public class TestImmModeSinkES1NEWT extends UITestCase {
     static final int iWidth = 400;
     static final int iHeight = 400;
 
-    static GLCapabilities getCaps(String profile) {
+    static GLCapabilities getCaps(final String profile) {
         if( !GLProfile.isAvailable(profile) )  {
             System.err.println("Profile "+profile+" n/a");
             return null;
         }
         return new GLCapabilities(GLProfile.get(profile));
     }
-    
-    void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+
+    void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
         System.out.println("Requested  GL Caps: "+reqGLCaps);
-        
+
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
+        //
         final GLWindow glad = GLWindow.create(reqGLCaps);
         glad.addGLEventListener(demo);
-        
+
         final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
         glad.addGLEventListener(snapshotGLEventListener);
         glad.setSize(iWidth, iHeight);
         glad.setVisible(true);
-        
+
         snapshotGLEventListener.setMakeSnapshot();
         glad.display(); // initial resize/display
-                
+
         Thread.sleep(duration);
-        
+
         glad.destroy();
     }
-    
+
     @Test
     public void test01Plain__GL2ES1_VBOOffUsePlain() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES1);
         if(null == reqGLCaps) return;
         doTest(reqGLCaps, new DemoGL2ES1Plain(false, false));
     }
-    
+
     @Test
     public void test02Plain__GL2ES1_VBOOffUseArrayData() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES1);
         if(null == reqGLCaps) return;
         doTest(reqGLCaps, new DemoGL2ES1Plain(true, false));
     }
-    
+
     @Test
     public void test03Plain__GL2ES1_VBOOnUsePlain() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES1);
         if(null == reqGLCaps) return;
         doTest(reqGLCaps, new DemoGL2ES1Plain(false, true));
     }
-    
+
     @Test
     public void test04Plain__GL2ES1_VBOOnUseArrayData() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES1);
         if(null == reqGLCaps) return;
         doTest(reqGLCaps, new DemoGL2ES1Plain(true, true));
     }
-    
+
     @Test
     public void test05ImmSinkGL2ES1_VBOOff() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES1);
         if(null == reqGLCaps) return;
         doTest(reqGLCaps, new DemoGL2ES1ImmModeSink(false));
     }
-    
+
     @Test
     public void test06ImmSinkGL2ES1_VBOOn() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES1);
         if(null == reqGLCaps) return;
         doTest(reqGLCaps, new DemoGL2ES1ImmModeSink(true));
     }
-        
+
     @Test
     public void test07ImmSinkGL2ES1_VBOOnTexture() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES1);
         if(null == reqGLCaps) return;
         doTest(reqGLCaps, new DemoGL2ES1TextureImmModeSink());
     }
-        
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 duration = MiscUtils.atoi(args[++i], duration);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES2NEWT.java
index de6aef5..9cf39a0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/TestImmModeSinkES2NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.util;
 
 import java.io.IOException;
@@ -52,63 +52,63 @@ public class TestImmModeSinkES2NEWT extends UITestCase {
     static final int iWidth = 400;
     static final int iHeight = 400;
 
-    static GLCapabilities getCaps(String profile) {
+    static GLCapabilities getCaps(final String profile) {
         if( !GLProfile.isAvailable(profile) )  {
             System.err.println("Profile "+profile+" n/a");
             return null;
         }
         return new GLCapabilities(GLProfile.get(profile));
     }
-    
-    void doTest(GLCapabilitiesImmutable reqGLCaps, GLEventListener demo) throws InterruptedException {
+
+    void doTest(final GLCapabilitiesImmutable reqGLCaps, final GLEventListener demo) throws InterruptedException {
         System.out.println("Requested  GL Caps: "+reqGLCaps);
-        
+
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
+        //
         final GLWindow glad = GLWindow.create(reqGLCaps);
         glad.addGLEventListener(demo);
-        
+
         final SnapshotGLEventListener snapshotGLEventListener = new SnapshotGLEventListener();
         glad.addGLEventListener(snapshotGLEventListener);
         glad.setSize(iWidth, iHeight);
         glad.setVisible(true);
-        
+
         snapshotGLEventListener.setMakeSnapshot();
         glad.display(); // initial resize/display
-                
+
         Thread.sleep(duration);
-        
+
         glad.destroy();
     }
-    
+
     @Test
     public void test05ImmSinkGL2ES2_VBOOff_Direct() throws InterruptedException {
         final GLCapabilities reqGLCaps = new GLCapabilities( GLProfile.getMaxFixedFunc(true) );
         doTest(reqGLCaps, new DemoGL2ES2ImmModeSink(false, false));
     }
-    
+
     @Test
     public void test05ImmSinkGL2ES2_VBOOff_ShaderState() throws InterruptedException {
         final GLCapabilities reqGLCaps = new GLCapabilities( GLProfile.getMaxFixedFunc(true) );
         doTest(reqGLCaps, new DemoGL2ES2ImmModeSink(false, true));
     }
-    
+
     @Test
     public void test06ImmSinkGL2ES2_VBOOn_Direct() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
         if(null == reqGLCaps) return;
         doTest(reqGLCaps, new DemoGL2ES2ImmModeSink(true, false));
     }
-        
+
     @Test
     public void test06ImmSinkGL2ES2_VBOOn_ShaderState() throws InterruptedException {
         final GLCapabilities reqGLCaps = getCaps(GLProfile.GL2ES2);
         if(null == reqGLCaps) return;
         doTest(reqGLCaps, new DemoGL2ES2ImmModeSink(true, true));
     }
-        
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 duration = MiscUtils.atoi(args[++i], duration);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug362DDSImageCreateFromData.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug362DDSImageCreateFromData.java
index 4212aba..a585e9e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug362DDSImageCreateFromData.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug362DDSImageCreateFromData.java
@@ -17,13 +17,13 @@ import com.jogamp.opengl.util.texture.spi.DDSImage;
 import com.jogamp.opengl.util.texture.spi.DDSImage.ImageInfo;
 
 /**
- * This test uses the DDSImage class to read a dds image from file, extract the data, 
+ * This test uses the DDSImage class to read a dds image from file, extract the data,
  * and use the class to create a new DDSImage from the extracted data
  * <br></br>
  * Bug Reference: https://jogamp.org/bugzilla/show_bug.cgi?id=362
  * <br></br>
- * The bug pertains to incorrect size calculation for checking validity of data. Compressed DXT1 has min of 8 bytes, DXT5 has min of 16 bytes. 
- * It exists in {@link DDSImage#createFromData(int, int, int, ByteBuffer[])} 
+ * The bug pertains to incorrect size calculation for checking validity of data. Compressed DXT1 has min of 8 bytes, DXT5 has min of 16 bytes.
+ * It exists in {@link DDSImage#createFromData(int, int, int, ByteBuffer[])}
  * where an {@link IllegalArgumentException} is thrown for Mipmap level size mismatch.
  * <br></br>
  * <ul>The following cases are tested:
@@ -31,68 +31,68 @@ import com.jogamp.opengl.util.texture.spi.DDSImage.ImageInfo;
  * <li>DXT1 compressed 64x32 RGB DDS Image with all mipmap levels (64x32 --> 1x1)</li>
  * <li>DXT5 compressed 64x32 RGB DDS Image with all mipmap levels (64x32 --> 1x1)</li>
  * </ul>
- * 
+ *
  * @author Michael Esemplare
  *
  */
 public class TestBug362DDSImageCreateFromData {
-	
+
 	File testDDSImage01Uncompressed;
 	File testDDSImage02DXT1;
 	File testDDSImage03DXT5;
-	
+
 	@Before
     public void setup() throws Throwable {
 		testDDSImage01Uncompressed = initFile("test-64x32_uncompressed.dds");
 		testDDSImage02DXT1 = initFile("test-64x32_DXT1.dds");
 		testDDSImage03DXT5 = initFile("test-64x32_DXT5.dds");
     }
-	
+
     @After
     public void teardown() {
     	testDDSImage01Uncompressed = null;
 		testDDSImage02DXT1 = null;
 		testDDSImage03DXT5 = null;
     }
-    
-    private File initFile(String filename) throws URISyntaxException {
-    	URLConnection connection = IOUtil.getResource(getClass(), filename);
+
+    private File initFile(final String filename) throws URISyntaxException {
+    	final URLConnection connection = IOUtil.getResource(getClass(), filename);
     	Assert.assertNotNull(connection);
-    	URL url = connection.getURL();
-    	File file = new File(url.toURI());
+    	final URL url = connection.getURL();
+    	final File file = new File(url.toURI());
     	Assert.assertTrue(file.exists());
     	return file;
     }
-    
-    private void testImpl(File file) throws IOException {
-    	DDSImage ddsImage = DDSImage.read(file);
+
+    private void testImpl(final File file) throws IOException {
+    	final DDSImage ddsImage = DDSImage.read(file);
     	Assert.assertNotNull(ddsImage);
-    	int numMipMaps = ddsImage.getNumMipMaps();
-		ByteBuffer[] mipMapArray = new ByteBuffer[numMipMaps];
+    	final int numMipMaps = ddsImage.getNumMipMaps();
+		final ByteBuffer[] mipMapArray = new ByteBuffer[numMipMaps];
 		for (int i=0;i<numMipMaps;i++){
-			ImageInfo info = ddsImage.getMipMap(i);
+			final ImageInfo info = ddsImage.getMipMap(i);
 			mipMapArray[i] = info.getData();
 		}
-		DDSImage newImage = DDSImage.createFromData(ddsImage.getPixelFormat(), ddsImage.getWidth(), ddsImage.getHeight(), mipMapArray);
+		final DDSImage newImage = DDSImage.createFromData(ddsImage.getPixelFormat(), ddsImage.getWidth(), ddsImage.getHeight(), mipMapArray);
 		Assert.assertNotNull(newImage);
     }
-    
+
     @Test
     public void test00_DDSImage_CreateFromData_Uncompressed_RGB () throws IOException {
     	testImpl(testDDSImage01Uncompressed);
     }
-    
+
     @Test
     public void test01_DDSImage_CreateFromData_DXT1_RGB () throws IOException {
     	testImpl(testDDSImage02DXT1);
     }
-    
+
     @Test
     public void test02_DDSImage_CreateFromData_DXT5_RGB () throws IOException {
     	testImpl(testDDSImage03DXT5);
     }
-    
-	public static void main(String[] args) {
+
+	public static void main(final String[] args) {
 		org.junit.runner.JUnitCore.main(TestBug362DDSImageCreateFromData.class.getName());
 	}
 }
\ No newline at end of file
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT.java
index 679f069..2eb8b45 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -50,14 +50,14 @@ import com.jogamp.opengl.util.texture.TextureIO;
 public class TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT extends UITestCase {
   static long durationPerTest = 60; // ms
 
-  public static void main(String[] args) {
+  public static void main(final String[] args) {
      for(int i=0; i<args.length; i++) {
         if(args[i].equals("-time")) {
             durationPerTest = MiscUtils.atoi(args[++i], 500);
         }
      }
      System.out.println("durationPerTest: "+durationPerTest);
-     String tstname = TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT.class.getName();
+     final String tstname = TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT.class.getName();
      org.junit.runner.JUnitCore.main(tstname);
   }
 
@@ -95,28 +95,28 @@ public class TestBug817GLReadBufferUtilGLCTXDefFormatTypeES2NEWT extends UITestC
     testImpl(true, true, false, true);
   }
 
-  private void testImpl(final boolean alphaCaps, final boolean readAlpha, boolean pbuffer, boolean fbo) throws InterruptedException {
+  private void testImpl(final boolean alphaCaps, final boolean readAlpha, final boolean pbuffer, final boolean fbo) throws InterruptedException {
     final GLReadBufferUtil screenshot = new GLReadBufferUtil(readAlpha ? true : false, false);
-    GLProfile glp = GLProfile.getGL2ES2();
-    GLCapabilities caps = new GLCapabilities(glp);
+    final GLProfile glp = GLProfile.getGL2ES2();
+    final GLCapabilities caps = new GLCapabilities(glp);
 
-    caps.setAlphaBits( alphaCaps ? 1 : 0 );    
+    caps.setAlphaBits( alphaCaps ? 1 : 0 );
     caps.setPBuffer( pbuffer );
     caps.setFBO( fbo);
-    
+
     final GLWindow window = GLWindow.create(caps);
     window.addGLEventListener(new GearsES2());
     window.addGLEventListener(new GLEventListener() {
         int displayCount = 0;
-        public void init(GLAutoDrawable drawable) {}
-        public void dispose(GLAutoDrawable drawable) {}
-        public void display(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {}
+        public void dispose(final GLAutoDrawable drawable) {}
+        public void display(final GLAutoDrawable drawable) {
             final GLPixelBufferProvider pixelBufferProvider = screenshot.getPixelBufferProvider();
             final GLPixelAttributes pixelAttribs = pixelBufferProvider.getAttributes(drawable.getGL(), readAlpha ? 4 : 3);
             System.err.println("GLPixelAttributes: "+pixelAttribs);
             snapshot(displayCount++, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
         }
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
     });
     window.setSize(512, 512);
     window.setVisible(true);
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01AWT.java
index 21987c5..e3be8ce 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.util.texture;
 
 import java.awt.Dimension;
@@ -71,10 +71,10 @@ public class TestGLReadBufferUtilTextureIOWrite01AWT extends UITestCase {
         height = 256;
     }
 
-    protected void testWritePNG_Impl(boolean offscreenLayer) throws InterruptedException {
+    protected void testWritePNG_Impl(final boolean offscreenLayer) throws InterruptedException {
         final GLReadBufferUtil screenshotRGB = new GLReadBufferUtil(false, false);
         final GLReadBufferUtil screenshotRGBA = new GLReadBufferUtil(true, false);
-        
+
         if(!offscreenLayer && JAWTUtil.isOffscreenLayerRequired()) {
             System.err.println("onscreen layer n/a");
             return;
@@ -82,40 +82,40 @@ public class TestGLReadBufferUtilTextureIOWrite01AWT extends UITestCase {
         if(offscreenLayer && !JAWTUtil.isOffscreenLayerSupported()) {
             System.err.println("offscreen layer n/a");
             return;
-        }        
+        }
         final GLCanvas glc = new GLCanvas(caps);
         glc.setShallUseOffscreenLayer(offscreenLayer); // trigger offscreen layer - if supported
-        Dimension glc_sz = new Dimension(width, height);
+        final Dimension glc_sz = new Dimension(width, height);
         glc.setMinimumSize(glc_sz);
         glc.setPreferredSize(glc_sz);
         final Frame frame = new Frame(getSimpleTestName("."));
         Assert.assertNotNull(frame);
         frame.add(glc);
-        
+
         glc.setSize(width, height);
         glc.addGLEventListener(new GearsES2(1));
         glc.addGLEventListener(new GLEventListener() {
             int f = 0;
-            public void init(GLAutoDrawable drawable) {}
-            public void dispose(GLAutoDrawable drawable) {}
-            public void display(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {}
+            public void dispose(final GLAutoDrawable drawable) {}
+            public void display(final GLAutoDrawable drawable) {
                 snapshot(f, null, drawable.getGL(), screenshotRGBA, TextureIO.PNG, null);
                 snapshot(f, null, drawable.getGL(),  screenshotRGB, TextureIO.PNG, null);
                 f++;
             }
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
-        
-        Animator animator = new Animator(glc);
+
+        final Animator animator = new Animator(glc);
         animator.setUpdateFPSFrames(60, null);
-        
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame.pack();
                     frame.setVisible(true);
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -128,7 +128,7 @@ public class TestGLReadBufferUtilTextureIOWrite01AWT extends UITestCase {
         while(animator.getTotalFPSFrames() < 2) {
             Thread.sleep(60);
         }
-        
+
         animator.stop();
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -137,23 +137,23 @@ public class TestGLReadBufferUtilTextureIOWrite01AWT extends UITestCase {
                     frame.remove(glc);
                     frame.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }        
+        }
     }
 
     @Test
     public void testOnscreenWritePNG() throws InterruptedException {
         testWritePNG_Impl(false);
     }
-    
+
     @Test
     public void testOffscreenWritePNG() throws InterruptedException {
         testWritePNG_Impl(true);
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestGLReadBufferUtilTextureIOWrite01AWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01NEWT.java
index 521e89a..a108706 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite01NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.util.texture;
 
 import com.jogamp.newt.opengl.GLWindow;
@@ -68,56 +68,56 @@ public class TestGLReadBufferUtilTextureIOWrite01NEWT extends UITestCase {
     public void testOnscreenWritePNG_TGA_PAM() throws InterruptedException {
         final GLReadBufferUtil screenshotRGB = new GLReadBufferUtil(false, false);
         final GLReadBufferUtil screenshotRGBA = new GLReadBufferUtil(true, false);
-        GLWindow glWindow = GLWindow.create(caps);
+        final GLWindow glWindow = GLWindow.create(caps);
         Assert.assertNotNull(glWindow);
         glWindow.setTitle("Shared Gears NEWT Test");
         glWindow.setSize(width, height);
         glWindow.addGLEventListener(new GearsES2(1));
         glWindow.addGLEventListener(new GLEventListener() {
             int f = 0;
-            public void init(GLAutoDrawable drawable) {}
-            public void dispose(GLAutoDrawable drawable) {}
-            public void display(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {}
+            public void dispose(final GLAutoDrawable drawable) {}
+            public void display(final GLAutoDrawable drawable) {
                 snapshot(f++, null, drawable.getGL(), screenshotRGBA, TextureIO.PNG, null);
-                snapshot(f++, null, drawable.getGL(),  screenshotRGB, TextureIO.PNG, null);                
+                snapshot(f++, null, drawable.getGL(),  screenshotRGB, TextureIO.PNG, null);
                 snapshot(f++, null, drawable.getGL(), screenshotRGBA, TextureIO.TGA, null);
-                snapshot(f++, null, drawable.getGL(),  screenshotRGB, TextureIO.TGA, null);                
+                snapshot(f++, null, drawable.getGL(),  screenshotRGB, TextureIO.TGA, null);
                 snapshot(f++, null, drawable.getGL(), screenshotRGBA, TextureIO.PAM, null);
-                snapshot(f++, null, drawable.getGL(),  screenshotRGB, TextureIO.PAM, null);                
+                snapshot(f++, null, drawable.getGL(),  screenshotRGB, TextureIO.PAM, null);
             }
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
         glWindow.setVisible(true);
         Thread.sleep(60);
-        glWindow.destroy();        
+        glWindow.destroy();
     }
 
     @Test
     public void testOffscreenWritePNG() throws InterruptedException {
         final GLReadBufferUtil screenshotRGB = new GLReadBufferUtil(false, false);
         final GLReadBufferUtil screenshotRGBA = new GLReadBufferUtil(true, false);
-        final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, true, false);        
-        GLWindow glWindow = GLWindow.create(caps2);
+        final GLCapabilities caps2 = WindowUtilNEWT.fixCaps(caps, false, true, false);
+        final GLWindow glWindow = GLWindow.create(caps2);
         Assert.assertNotNull(glWindow);
         glWindow.setSize(width, height);
         glWindow.addGLEventListener(new GearsES2(1));
         glWindow.addGLEventListener(new GLEventListener() {
             int f = 0;
-            public void init(GLAutoDrawable drawable) {}
-            public void dispose(GLAutoDrawable drawable) {}
-            public void display(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {}
+            public void dispose(final GLAutoDrawable drawable) {}
+            public void display(final GLAutoDrawable drawable) {
                 snapshot(f, null, drawable.getGL(), screenshotRGBA, TextureIO.PNG, null);
                 snapshot(f, null, drawable.getGL(),  screenshotRGB, TextureIO.PNG, null);
                 f++;
             }
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
         glWindow.setVisible(true);
         Thread.sleep(60);
-        glWindow.destroy();        
+        glWindow.destroy();
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestGLReadBufferUtilTextureIOWrite01NEWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02AWT.java
index 3822bff..8be3fb2 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.util.texture;
 
 import java.awt.Dimension;
@@ -72,7 +72,7 @@ public class TestGLReadBufferUtilTextureIOWrite02AWT extends UITestCase {
         height = 64;
     }
 
-    protected void testWritePNGWithResizeImpl(boolean offscreenLayer) throws InterruptedException {
+    protected void testWritePNGWithResizeImpl(final boolean offscreenLayer) throws InterruptedException {
         if(!offscreenLayer && JAWTUtil.isOffscreenLayerRequired()) {
             System.err.println("onscreen layer n/a");
             return;
@@ -80,28 +80,28 @@ public class TestGLReadBufferUtilTextureIOWrite02AWT extends UITestCase {
         if(offscreenLayer && !JAWTUtil.isOffscreenLayerSupported()) {
             System.err.println("offscreen layer n/a");
             return;
-        }        
+        }
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
         final GLCanvas glc = new GLCanvas(caps);
         glc.setShallUseOffscreenLayer(offscreenLayer); // trigger offscreen layer - if supported
-        Dimension glc_sz = new Dimension(width, height);
+        final Dimension glc_sz = new Dimension(width, height);
         glc.setMinimumSize(glc_sz);
         glc.setPreferredSize(glc_sz);
         glc.setSize(glc_sz);
         final Frame frame = new Frame(getSimpleTestName("."));
         Assert.assertNotNull(frame);
         frame.add(glc);
-        
+
         glc.addGLEventListener(new GearsES2(1));
         glc.addGLEventListener(new GLEventListener() {
             int i=0, fw_old=0, dw_old=0, c=0;
-            public void init(GLAutoDrawable drawable) {}
-            public void dispose(GLAutoDrawable drawable) {}
-            public void display(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {}
+            public void dispose(final GLAutoDrawable drawable) {}
+            public void display(final GLAutoDrawable drawable) {
                 final int fw = frame.getWidth();
                 final int fh = frame.getHeight();
-                final int dw = drawable.getWidth();
-                final int dh = drawable.getHeight();
+                final int dw = drawable.getSurfaceWidth();
+                final int dh = drawable.getSurfaceHeight();
                 final boolean sz_changed = fw_old != fw && dw_old != dw && dw <= 512; // need to check both sizes [frame + drawable], due to async resize of AWT!
                 final boolean snap;
                 if(sz_changed) {
@@ -110,7 +110,7 @@ public class TestGLReadBufferUtilTextureIOWrite02AWT extends UITestCase {
                 } else {
                     snap = false;
                 }
-                
+
                 if(snap) {
                     System.err.println("XXX: ["+fw_old+", "+dw_old+"], "+fw+"x"+fh+", "+dw+"x"+dh+", sz_changed "+sz_changed+", snap "+snap);
                     c=0;
@@ -128,19 +128,19 @@ public class TestGLReadBufferUtilTextureIOWrite02AWT extends UITestCase {
                         } }, glc.getTreeLock());
                 }
             }
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
-        
-        Animator animator = new Animator(glc);
+
+        final Animator animator = new Animator(glc);
         animator.setUpdateFPSFrames(60, null);
-        
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame.pack();
                     frame.setVisible(true);
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -153,7 +153,7 @@ public class TestGLReadBufferUtilTextureIOWrite02AWT extends UITestCase {
         while(animator.getTotalFPSFrames() < 30) {
             Thread.sleep(60);
         }
-        
+
         animator.stop();
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -162,23 +162,23 @@ public class TestGLReadBufferUtilTextureIOWrite02AWT extends UITestCase {
                     frame.remove(glc);
                     frame.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }        
+        }
     }
 
     @Test
     public void testOnscreenWritePNGWithResize() throws InterruptedException {
         testWritePNGWithResizeImpl(false);
     }
-    
+
     @Test
     public void testOffscreenWritePNGWithResize() throws InterruptedException {
         testWritePNGWithResizeImpl(true);
     }
-    
-    public static void main(String args[]) {
+
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestGLReadBufferUtilTextureIOWrite02AWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02NEWT.java
index 9615297..cfae6f0 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestGLReadBufferUtilTextureIOWrite02NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.util.texture;
 
 import com.jogamp.newt.opengl.GLWindow;
@@ -66,7 +66,7 @@ public class TestGLReadBufferUtilTextureIOWrite02NEWT extends UITestCase {
         height = 64;
     }
 
-    private void testWritePNGWithResizeImpl(boolean offscreen) throws InterruptedException {
+    private void testWritePNGWithResizeImpl(final boolean offscreen) throws InterruptedException {
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
         final GLCapabilities caps2 = offscreen ? WindowUtilNEWT.fixCaps(caps, false, true, false) : caps;
         final GLWindow glWindow = GLWindow.create(caps2);
@@ -76,15 +76,15 @@ public class TestGLReadBufferUtilTextureIOWrite02NEWT extends UITestCase {
         glWindow.addGLEventListener(new GearsES2(1));
         glWindow.addGLEventListener(new GLEventListener() {
             int i=0, dw_old=0, c=0;
-            public void init(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {
                 System.err.println("XXX: init");
             }
-            public void dispose(GLAutoDrawable drawable) {
+            public void dispose(final GLAutoDrawable drawable) {
                 System.err.println("XXX: dispose");
             }
-            public void display(GLAutoDrawable drawable) {
-                final int dw = drawable.getWidth();
-                final int dh = drawable.getHeight();
+            public void display(final GLAutoDrawable drawable) {
+                final int dw = drawable.getSurfaceWidth();
+                final int dh = drawable.getSurfaceHeight();
                 final boolean sz_changed = dw_old != dw && dw <= 512;
                 final boolean snap;
                 if(sz_changed) {
@@ -93,35 +93,35 @@ public class TestGLReadBufferUtilTextureIOWrite02NEWT extends UITestCase {
                 } else {
                     snap = false;
                 }
-                
+
                 if(snap) {
                     System.err.println("XXX: ["+dw_old+"], "+dw+"x"+dh+", sz_changed "+sz_changed+", snap "+snap);
                     c=0;
                     snapshot(i++, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
                     dw_old = dw;
-                    new Thread() { 
+                    new Thread() {
                         @Override
                         public void run() {
-                            glWindow.setSize(2*dw, 2*dh);                            
+                            glWindow.setSize(2*dw, 2*dh);
                         } }.start();
                 }
             }
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
-        Animator animator = new Animator(glWindow);
+        final Animator animator = new Animator(glWindow);
         animator.setUpdateFPSFrames(60, null);
-        
+
         glWindow.setVisible(true);
         animator.start();
-        
+
         while(animator.getTotalFPSFrames() < 50) {
             Thread.sleep(60);
         }
-        
+
         animator.stop();
-        glWindow.destroy();        
+        glWindow.destroy();
     }
-    
+
     @Test
     public void testOnscreenWritePNGWithResize() throws InterruptedException {
         testWritePNGWithResizeImpl(false);
@@ -132,7 +132,7 @@ public class TestGLReadBufferUtilTextureIOWrite02NEWT extends UITestCase {
         testWritePNGWithResizeImpl(true);
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestGLReadBufferUtilTextureIOWrite02NEWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGImage01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGImage01NEWT.java
index c92174a..156ca20 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGImage01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGImage01NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -65,29 +65,29 @@ import javax.media.opengl.GL;
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestJPEGImage01NEWT extends UITestCase {
-    
+
     static boolean showFPS = false;
     static long duration = 100; // ms
-    
+
     public void testImpl(final InputStream istream) throws InterruptedException, IOException {
         final JPEGImage image = JPEGImage.read(istream);
         Assert.assertNotNull(image);
         final boolean hasAlpha = 4 == image.getBytesPerPixel();
         System.err.println("JPEGImage: "+image+", hasAlpha "+hasAlpha);
-        
+
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
         final GLProfile glp = GLProfile.getGL2ES2();
         final GLCapabilities caps = new GLCapabilities(glp);
         if( hasAlpha ) {
             caps.setAlphaBits(1);
         }
-                
+
         final int internalFormat;
         if(glp.isGL2ES3()) {
             internalFormat = hasAlpha ? GL.GL_RGBA8 : GL.GL_RGB8;
         } else {
             internalFormat = hasAlpha ? GL.GL_RGBA : GL.GL_RGB;
-        }        
+        }
         final TextureData texData = new TextureData(glp, internalFormat,
                                        image.getWidth(),
                                        image.getHeight(),
@@ -99,37 +99,37 @@ public class TestJPEGImage01NEWT extends UITestCase {
                                        image.getData(),
                                        null);
         // final TextureData texData = TextureIO.newTextureData(glp, istream, false /* mipmap */, TextureIO.JPG);
-        System.err.println("TextureData: "+texData);        
-        
+        System.err.println("TextureData: "+texData);
+
         final GLWindow glad = GLWindow.create(caps);
         glad.setTitle("TestJPEGImage01NEWT");
         // Size OpenGL to Video Surface
         glad.setSize(texData.getWidth(), texData.getHeight());
-        
+
         // load texture from file inside current GL context to match the way
         // the bug submitter was doing it
         final GLEventListener gle = new TextureDraw01ES2Listener( texData, 0 ) ;
         glad.addGLEventListener(gle);
-        glad.addGLEventListener(new GLEventListener() {                    
+        glad.addGLEventListener(new GLEventListener() {
             boolean shot = false;
-            
-            @Override public void init(GLAutoDrawable drawable) {}
-            
-            public void display(GLAutoDrawable drawable) {
+
+            @Override public void init(final GLAutoDrawable drawable) {}
+
+            public void display(final GLAutoDrawable drawable) {
                 // 1 snapshot
                 if(null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
                     shot = true;
                     snapshot(0, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
                 }
             }
-            
-            @Override public void dispose(GLAutoDrawable drawable) { }
-            @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+
+            @Override public void dispose(final GLAutoDrawable drawable) { }
+            @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
 
-        Animator animator = new Animator(glad);
+        final Animator animator = new Animator(glad);
         animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
         glad.addKeyListener(quitAdapter);
         glad.addWindowListener(quitAdapter);
         glad.setVisible(true);
@@ -138,11 +138,11 @@ public class TestJPEGImage01NEWT extends UITestCase {
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
             Thread.sleep(100);
         }
-        
+
         animator.stop();
         glad.destroy();
     }
-    
+
     @Test
     public void testReadES2_RGBn() throws InterruptedException, IOException, MalformedURLException {
         final String fname = null == _fname ? "test-ntscN_3-01-160x90-90pct-yuv444-base.jpg" : _fname;
@@ -151,7 +151,7 @@ public class TestJPEGImage01NEWT extends UITestCase {
     }
 
     static String _fname = null;
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTBenchmarkNewtAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTBenchmarkNewtAWT.java
index bd2488e..7c11d72 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTBenchmarkNewtAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTBenchmarkNewtAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.util.texture;
 
 
@@ -60,7 +60,7 @@ public class TestJPEGJoglAWTBenchmarkNewtAWT extends UITestCase {
     public void benchmark() throws IOException {
         benchmarkImpl(100, fname);
     }
-    void benchmarkImpl(int loops, String fname) throws IOException {
+    void benchmarkImpl(final int loops, final String fname) throws IOException {
         {
             final long t0 = System.currentTimeMillis();
             for(int i = 0; i< loops; i++ ) {
@@ -124,15 +124,15 @@ public class TestJPEGJoglAWTBenchmarkNewtAWT extends UITestCase {
                 final InputStream istream = urlConn.getInputStream();
                 Buffer data = null;
                 try {
-                    BufferedImage img = ImageIO.read(istream);
-                    AWTTextureData texData = new AWTTextureData(GLProfile.getGL2ES2(), 0, 0, false, img);
+                    final BufferedImage img = ImageIO.read(istream);
+                    final AWTTextureData texData = new AWTTextureData(GLProfile.getGL2ES2(), 0, 0, false, img);
                     data = texData.getBuffer(); // completes data conversion !!!
                     if(0==i || loops-1==i) {
                         System.err.println(i+": "+texData+", buffer "+data);
                     }
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     System.err.println("AWT ImageIO failure w/ file "+fname+": "+e.getMessage());
-                }        
+                }
                 istream.close();
             }
             final long t1 = System.currentTimeMillis();
@@ -141,14 +141,14 @@ public class TestJPEGJoglAWTBenchmarkNewtAWT extends UITestCase {
             System.err.println("AWT..... Loops "+loops+", dt "+dt+" ms, "+msPl+" ms/l");
         }
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-file")) {
                 i++;
                 fname = args[i];
             }
         }
-        org.junit.runner.JUnitCore.main(TestJPEGJoglAWTBenchmarkNewtAWT.class.getName());        
+        org.junit.runner.JUnitCore.main(TestJPEGJoglAWTBenchmarkNewtAWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTCompareNewtAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTCompareNewtAWT.java
index dbb4002..067ee9d 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTCompareNewtAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGJoglAWTCompareNewtAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.util.texture;
 
 
@@ -66,7 +66,7 @@ import org.junit.runners.MethodSorters;
 public class TestJPEGJoglAWTCompareNewtAWT extends UITestCase {
     static boolean showFPS = false;
     static long duration = 100; // ms
-    
+
     String[] files = { "test-ntscN_3-01-160x90-90pct-yuv444-base.jpg",   // 0
                        "test-ntscN_3-01-160x90-90pct-yuv444-prog.jpg",   // 1
                        "test-ntscN_3-01-160x90-60pct-yuv422h-base.jpg",  // 2
@@ -79,14 +79,14 @@ public class TestJPEGJoglAWTCompareNewtAWT extends UITestCase {
 
     void testImpl(final String fname) throws InterruptedException, IOException {
         final Animator animator = new Animator();
-        
+
         final GLWindow w1 = testJOGLJpeg(fname);
-        final GLWindow w2 = testAWTJpeg(fname, w1.getWidth() + 50);
-        
+        final GLWindow w2 = testAWTJpeg(fname, w1.getSurfaceWidth() + 50);
+
         animator.add(w1);
         animator.add(w2);
         animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
         w1.setVisible(true);
         w2.setVisible(true);
         animator.start();
@@ -94,23 +94,23 @@ public class TestJPEGJoglAWTCompareNewtAWT extends UITestCase {
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
             Thread.sleep(100);
         }
-        
+
         animator.stop();
         w1.destroy();
-        w2.destroy();        
+        w2.destroy();
     }
-    
+
     GLWindow testJOGLJpeg(final String fname) throws InterruptedException, IOException {
-        URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), fname);
+        final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), fname);
         Assert.assertNotNull(testTextureUrlConn);
-        InputStream istream = testTextureUrlConn.getInputStream();
+        final InputStream istream = testTextureUrlConn.getInputStream();
         Assert.assertNotNull(istream);
-        
+
         final JPEGImage image = JPEGImage.read(istream);
         Assert.assertNotNull(image);
         System.err.println("JPEGImage: "+image);
-        
-        GLProfile glp = GLProfile.getGL2ES2();
+
+        final GLProfile glp = GLProfile.getGL2ES2();
         final int internalFormat = (image.getBytesPerPixel()==4)?GL.GL_RGBA:GL.GL_RGB;
         final TextureData texData = new TextureData(glp, internalFormat,
                                        image.getWidth(),
@@ -124,71 +124,71 @@ public class TestJPEGJoglAWTCompareNewtAWT extends UITestCase {
                                        null);
         // final TextureData texData = TextureIO.newTextureData(glp, istream, false /* mipmap */, TextureIO.JPG);
         System.err.println("TextureData: "+texData);
-        
+
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
         final GLCapabilities caps = new GLCapabilities(glp);
         caps.setAlphaBits(1);
-        
+
         final GLWindow glad1 = GLWindow.create(caps);
         glad1.setTitle("JPEG JOGL");
         // Size OpenGL to Video Surface
         glad1.setSize(texData.getWidth(), texData.getHeight());
         glad1.setPosition(0, 0);
-        
+
         // load texture from file inside current GL context to match the way
         // the bug submitter was doing it
         final GLEventListener gle = new TextureDraw01ES2Listener( texData, 0 ) ;
         glad1.addGLEventListener(gle);
-        glad1.addGLEventListener(new GLEventListener() {                    
+        glad1.addGLEventListener(new GLEventListener() {
             boolean shot = false;
-            
-            @Override public void init(GLAutoDrawable drawable) {}
-            
-            public void display(GLAutoDrawable drawable) {
+
+            @Override public void init(final GLAutoDrawable drawable) {}
+
+            public void display(final GLAutoDrawable drawable) {
                 // 1 snapshot
                 if(null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
                     shot = true;
                     snapshot(0, "JoglJPEG", drawable.getGL(), screenshot, TextureIO.PNG, null);
                 }
             }
-            
-            @Override public void dispose(GLAutoDrawable drawable) { }
-            @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+
+            @Override public void dispose(final GLAutoDrawable drawable) { }
+            @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
 
         return glad1;
     }
-    
-    GLWindow testAWTJpeg(final String fname, int xpos) throws InterruptedException, IOException {
-        URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), fname);
+
+    GLWindow testAWTJpeg(final String fname, final int xpos) throws InterruptedException, IOException {
+        final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), fname);
         Assert.assertNotNull(testTextureUrlConn);
-        InputStream istream = testTextureUrlConn.getInputStream();
+        final InputStream istream = testTextureUrlConn.getInputStream();
         Assert.assertNotNull(istream);
-        
-        GLProfile glp = GLProfile.getGL2ES2();
+
+        final GLProfile glp = GLProfile.getGL2ES2();
         TextureData texData = null;
         int w = 300, h = 300;
         try {
-            BufferedImage img = ImageIO.read(istream);
+            final BufferedImage img = ImageIO.read(istream);
             texData = new AWTTextureData(glp, 0, 0, false, img);
             System.err.println("TextureData: "+texData);
             w = texData.getWidth();
             h = texData.getHeight();
-        } catch (Exception e) {
+        } catch (final Exception e) {
             System.err.println("AWT ImageIO failure w/ file "+fname+": "+e.getMessage());
             // e.printStackTrace(); // : CMYK, YCCK -> com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(Unknown Source)
-        }        
-        
+        }
+
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
         final GLCapabilities caps = new GLCapabilities(glp);
         caps.setAlphaBits(1);
-        
+
         final GLWindow glad1 = GLWindow.create(caps);
         glad1.setTitle("JPEG AWT");
         // Size OpenGL to Video Surface
         glad1.setSize(w, h);
         glad1.setPosition(xpos, 0);
-        
+
         // load texture from file inside current GL context to match the way
         // the bug submitter was doing it
         final GLEventListener gle;
@@ -198,73 +198,73 @@ public class TestJPEGJoglAWTCompareNewtAWT extends UITestCase {
         } else {
             gle = null;
         }
-        glad1.addGLEventListener(new GLEventListener() {                    
+        glad1.addGLEventListener(new GLEventListener() {
             boolean shot = false;
-            
-            @Override public void init(GLAutoDrawable drawable) {}
-            
-            public void display(GLAutoDrawable drawable) {
+
+            @Override public void init(final GLAutoDrawable drawable) {}
+
+            public void display(final GLAutoDrawable drawable) {
                 // 1 snapshot
                 if( null!=gle && null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
                     shot = true;
                     snapshot(0, "AWTJPEG", drawable.getGL(), screenshot, TextureIO.PNG, null);
                 }
             }
-            
-            @Override public void dispose(GLAutoDrawable drawable) { }
-            @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+
+            @Override public void dispose(final GLAutoDrawable drawable) { }
+            @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
 
         return glad1;
     }
-    
+
     @Test
     public void test01YUV444Base__ES2() throws InterruptedException, IOException {
-        testImpl(files[0]);        
-    }    
+        testImpl(files[0]);
+    }
     @Test
     public void test01YUV444Prog__ES2() throws InterruptedException, IOException {
-        testImpl(files[1]);        
-    }    
-    
+        testImpl(files[1]);
+    }
+
     @Test
     public void test01YUV422hBase__ES2() throws InterruptedException, IOException {
-        testImpl(files[2]);        
-    }    
+        testImpl(files[2]);
+    }
     @Test
     public void test01YUV422hProg_ES2() throws InterruptedException, IOException {
-        testImpl(files[3]);        
-    }    
-    
+        testImpl(files[3]);
+    }
+
     @Test
     public void test02YUV420Base__ES2() throws InterruptedException, IOException {
-        testImpl(files[4]);        
-    }    
+        testImpl(files[4]);
+    }
     @Test
     public void test02YUV420Prog_ES2() throws InterruptedException, IOException {
-        testImpl(files[5]);        
-    }    
+        testImpl(files[5]);
+    }
     @Test
     public void test02YUV420BaseGray_ES2() throws InterruptedException, IOException {
-        testImpl(files[6]);        
-    }    
+        testImpl(files[6]);
+    }
 
     @Test
     public void test03CMYK_01_ES2() throws InterruptedException, IOException {
-        testImpl(files[7]);        
-    }    
+        testImpl(files[7]);
+    }
     @Test
     public void test03YCCK_01_ES2() throws InterruptedException, IOException {
-        testImpl(files[8]);        
-    }    
-    
-    public static void main(String args[]) throws IOException {
+        testImpl(files[8]);
+    }
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 duration = MiscUtils.atol(args[i], duration);
             }
         }
-        org.junit.runner.JUnitCore.main(TestJPEGJoglAWTCompareNewtAWT.class.getName());        
+        org.junit.runner.JUnitCore.main(TestJPEGJoglAWTCompareNewtAWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGTextureFromFileNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGTextureFromFileNEWT.java
index 60855e5..565434e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGTextureFromFileNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestJPEGTextureFromFileNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.util.texture;
 
 
@@ -63,87 +63,87 @@ import org.junit.runners.MethodSorters;
 public class TestJPEGTextureFromFileNEWT extends UITestCase {
     static boolean showFPS = false;
     static long duration = 100; // ms
-    
+
     InputStream testTextureStream01YUV444_Base;
     InputStream testTextureStream01YUV444_Prog;
-    
+
     InputStream testTextureStream01YUV422h_Base;
     InputStream testTextureStream01YUV422h_Prog;
-    
+
     InputStream testTextureStream02YUV420_Base;
     InputStream testTextureStream02YUV420_Prog;
     InputStream testTextureStream02YUV420_BaseGray;
-    
+
     InputStream testTextureStream03CMYK_01;
     InputStream testTextureStream03YCCK_01;
-    
+
     InputStream testTextureStream04QTTDefPostFrame;
-    
+
     @Before
     public void initTest() throws IOException {
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-90pct-yuv444-base.jpg");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-90pct-yuv444-base.jpg");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStream01YUV444_Base = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStream01YUV444_Base);
         }
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-90pct-yuv444-prog.jpg");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-90pct-yuv444-prog.jpg");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStream01YUV444_Prog = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStream01YUV444_Prog);
-        }        
+        }
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-60pct-yuv422h-base.jpg");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-60pct-yuv422h-base.jpg");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStream01YUV422h_Base = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStream01YUV422h_Base);
         }
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-60pct-yuv422h-prog.jpg");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90-60pct-yuv422h-prog.jpg");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStream01YUV422h_Prog = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStream01YUV422h_Prog);
         }
-        
+
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "j1-baseline.jpg");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "j1-baseline.jpg");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStream02YUV420_Base = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStream02YUV420_Base);
         }
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "j2-progressive.jpg");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "j2-progressive.jpg");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStream02YUV420_Prog = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStream02YUV420_Prog);
         }
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "j3-baseline_gray.jpg");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "j3-baseline_gray.jpg");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStream02YUV420_BaseGray = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStream02YUV420_BaseGray);
         }
-        
+
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-cmyk-01.jpg");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-cmyk-01.jpg");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStream03CMYK_01 = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStream03CMYK_01);
         }
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ycck-01.jpg");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ycck-01.jpg");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStream03YCCK_01 = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStream03YCCK_01);
         }
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "bug745_qttdef_post_frame.jpg");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "bug745_qttdef_post_frame.jpg");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStream04QTTDefPostFrame = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStream04QTTDefPostFrame);
         }
-        
+
     }
 
     @After
@@ -156,11 +156,11 @@ public class TestJPEGTextureFromFileNEWT extends UITestCase {
         testTextureStream02YUV420_Prog = null;
         testTextureStream02YUV420_BaseGray = null;
         testTextureStream03CMYK_01 = null;
-        testTextureStream03YCCK_01 = null;        
+        testTextureStream03YCCK_01 = null;
         testTextureStream04QTTDefPostFrame = null;
     }
 
-    public void testImpl(boolean useFFP, final InputStream istream) throws InterruptedException, IOException {
+    public void testImpl(final boolean useFFP, final InputStream istream) throws InterruptedException, IOException {
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
         GLProfile glp;
         if(useFFP && GLProfile.isAvailable(GLProfile.GL2)) {
@@ -173,39 +173,39 @@ public class TestJPEGTextureFromFileNEWT extends UITestCase {
         }
         final GLCapabilities caps = new GLCapabilities(glp);
         caps.setAlphaBits(1);
-        
+
         final TextureData texData = TextureIO.newTextureData(glp, istream, false /* mipmap */, TextureIO.JPG);
-        System.err.println("TextureData: "+texData);        
-        
+        System.err.println("TextureData: "+texData);
+
         final GLWindow glad = GLWindow.create(caps);
         glad.setTitle("TestPNGTextureGL2FromFileNEWT");
         // Size OpenGL to Video Surface
         glad.setSize(texData.getWidth(), texData.getHeight());
-        
+
         // load texture from file inside current GL context to match the way
         // the bug submitter was doing it
         final GLEventListener gle = useFFP ? new TextureDraw01GL2Listener( texData ) : new TextureDraw01ES2Listener( texData, 0 ) ;
         glad.addGLEventListener(gle);
-        glad.addGLEventListener(new GLEventListener() {                    
+        glad.addGLEventListener(new GLEventListener() {
             boolean shot = false;
-            
-            @Override public void init(GLAutoDrawable drawable) {}
-            
-            public void display(GLAutoDrawable drawable) {
+
+            @Override public void init(final GLAutoDrawable drawable) {}
+
+            public void display(final GLAutoDrawable drawable) {
                 // 1 snapshot
                 if(null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
                     shot = true;
                     snapshot(0, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
                 }
             }
-            
-            @Override public void dispose(GLAutoDrawable drawable) { }
-            @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+
+            @Override public void dispose(final GLAutoDrawable drawable) { }
+            @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
 
-        Animator animator = new Animator(glad);
+        final Animator animator = new Animator(glad);
         animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
         glad.addKeyListener(quitAdapter);
         glad.addWindowListener(quitAdapter);
         glad.setVisible(true);
@@ -214,71 +214,71 @@ public class TestJPEGTextureFromFileNEWT extends UITestCase {
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
             Thread.sleep(100);
         }
-        
+
         animator.stop();
         glad.destroy();
     }
-    
+
     @Test
     public void test01YUV444Base__GL2() throws InterruptedException, IOException {
-        testImpl(true, testTextureStream01YUV444_Base);        
-    }    
+        testImpl(true, testTextureStream01YUV444_Base);
+    }
     @Test
     public void test01YUV444Base__ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStream01YUV444_Base);        
-    }    
+        testImpl(false, testTextureStream01YUV444_Base);
+    }
     @Test
     public void test01YUV444Prog__GL2() throws InterruptedException, IOException {
-        testImpl(true, testTextureStream01YUV444_Prog);        
-    }    
+        testImpl(true, testTextureStream01YUV444_Prog);
+    }
     @Test
     public void test01YUV444Prog__ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStream01YUV444_Prog);        
-    }    
-    
+        testImpl(false, testTextureStream01YUV444_Prog);
+    }
+
     @Test
     public void test01YUV422hBase__ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStream01YUV422h_Base);        
-    }    
+        testImpl(false, testTextureStream01YUV422h_Base);
+    }
     @Test
     public void test01YUV422hProg_ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStream01YUV422h_Prog);        
-    }    
-    
+        testImpl(false, testTextureStream01YUV422h_Prog);
+    }
+
     @Test
     public void test02YUV420Base__ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStream02YUV420_Base);        
-    }    
+        testImpl(false, testTextureStream02YUV420_Base);
+    }
     @Test
     public void test02YUV420Prog_ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStream02YUV420_Prog);        
-    }    
+        testImpl(false, testTextureStream02YUV420_Prog);
+    }
     @Test
     public void test02YUV420BaseGray_ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStream02YUV420_BaseGray);        
+        testImpl(false, testTextureStream02YUV420_BaseGray);
     }
 
     @Test
     public void test03CMYK_01_ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStream03CMYK_01);        
-    }    
+        testImpl(false, testTextureStream03CMYK_01);
+    }
     @Test
     public void test03YCCK_01_ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStream03YCCK_01);        
-    }    
+        testImpl(false, testTextureStream03YCCK_01);
+    }
 
     @Test
     public void test04QTTDefPostFrame_ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStream04QTTDefPostFrame);        
-    }    
-    
-    public static void main(String args[]) throws IOException {
+        testImpl(false, testTextureStream04QTTDefPostFrame);
+    }
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 duration = MiscUtils.atol(args[i], duration);
             }
         }
-        org.junit.runner.JUnitCore.main(TestJPEGTextureFromFileNEWT.class.getName());        
+        org.junit.runner.JUnitCore.main(TestJPEGTextureFromFileNEWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect00NEWT.java
index c2b39f0..8f63a4f 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect00NEWT.java
@@ -128,7 +128,7 @@ public class TestPNGPixelRect00NEWT extends UITestCase {
         final File out2F_f=new File(getSimpleTestName(".")+"-02-"+basename+"-flipped.png");
         final File out2R_f=new File(getSimpleTestName(".")+"-03-"+basename+"-reversed.png");
         final File out2RF_f=new File(getSimpleTestName(".")+"-04-"+basename+"-reversed_flipped.png");
-        URLConnection urlConn = IOUtil.getResource(this.getClass(), pathname+basename+".png");
+        final URLConnection urlConn = IOUtil.getResource(this.getClass(), pathname+basename+".png");
         if( null == urlConn ) {
             throw new IOException("Cannot find "+pathname+basename+".png");
         }
@@ -205,7 +205,7 @@ public class TestPNGPixelRect00NEWT extends UITestCase {
         System.err.println("Test02: "+pathname+basename+".png, destFmt "+destFmt+", destMinStrideInBytes "+destMinStrideInBytes+", destIsGLOriented "+destIsGLOriented);
 
         final File out1_f=new File(getSimpleTestName(".")+"-"+basename+"-orig.png");
-        URLConnection urlConn = IOUtil.getResource(this.getClass(), pathname+basename+".png");
+        final URLConnection urlConn = IOUtil.getResource(this.getClass(), pathname+basename+".png");
 
         final PNGPixelRect image1 = PNGPixelRect.read(urlConn.getInputStream(), destFmt, false /* directBuffer */, destMinStrideInBytes, destIsGLOriented);
         System.err.println("PNGPixelRect - Orig: "+image1);
@@ -220,7 +220,7 @@ public class TestPNGPixelRect00NEWT extends UITestCase {
         }
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestPNGPixelRect00NEWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect01NEWT.java
index 3b1d9fb..4a324f5 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGPixelRect01NEWT.java
@@ -117,12 +117,12 @@ public class TestPNGPixelRect01NEWT extends UITestCase {
         glad.addGLEventListener(new GLEventListener() {
             boolean shot = false;
 
-            @Override public void init(GLAutoDrawable drawable) {
+            @Override public void init(final GLAutoDrawable drawable) {
                 System.err.println("Chosen Caps: " + drawable.getChosenGLCapabilities());
                 System.err.println("GL ctx: " + drawable.getGL().getContext());
             }
 
-            @Override public void display(GLAutoDrawable drawable) {
+            @Override public void display(final GLAutoDrawable drawable) {
                 // 1 snapshot
                 if(null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
                     shot = true;
@@ -130,13 +130,13 @@ public class TestPNGPixelRect01NEWT extends UITestCase {
                 }
             }
 
-            @Override public void dispose(GLAutoDrawable drawable) { }
-            @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+            @Override public void dispose(final GLAutoDrawable drawable) { }
+            @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
 
-        Animator animator = new Animator(glad);
+        final Animator animator = new Animator(glad);
         animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
         glad.addKeyListener(quitAdapter);
         glad.addWindowListener(quitAdapter);
         glad.setVisible(true);
@@ -192,7 +192,7 @@ public class TestPNGPixelRect01NEWT extends UITestCase {
     }
 
     static String _fname = null;
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileAWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileAWT.java
index 191d67d..bbcd044 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.util.texture;
 
 
@@ -51,7 +51,6 @@ import com.jogamp.opengl.util.GLReadBufferUtil;
 
 import java.awt.Dimension;
 import java.awt.Frame;
-
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URLConnection;
@@ -87,7 +86,7 @@ public class TestPNGTextureFromFileAWT extends UITestCase {
         grayTextureStream = TestPNGTextureFromFileAWT.class.getResourceAsStream( "grayscale_texture.png" );
         Assert.assertNotNull(grayTextureStream);
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90.png");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90.png");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStream = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStream);
@@ -100,8 +99,8 @@ public class TestPNGTextureFromFileAWT extends UITestCase {
         testTextureStream = null;
     }
 
-    public void testImpl(boolean useFFP, final InputStream istream, final boolean useAWTIIOP) 
-            throws InterruptedException, IOException 
+    public void testImpl(final boolean useFFP, final InputStream istream, final boolean useAWTIIOP)
+            throws InterruptedException, IOException
     {
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
         GLProfile glp;
@@ -122,9 +121,9 @@ public class TestPNGTextureFromFileAWT extends UITestCase {
             texData = TextureIO.newTextureData(glp, istream, false /* mipmap */, TextureIO.PNG);
         }
         System.err.println("TextureData: "+texData);
-        
+
         final GLCanvas glc = new GLCanvas(caps);
-        Dimension glc_sz = new Dimension(texData.getWidth(), texData.getHeight());
+        final Dimension glc_sz = new Dimension(texData.getWidth(), texData.getHeight());
         glc.setMinimumSize(glc_sz);
         glc.setPreferredSize(glc_sz);
         final Frame frame = new Frame("TestPNGTextureGL2FromFileAWT");
@@ -135,13 +134,13 @@ public class TestPNGTextureFromFileAWT extends UITestCase {
         // the bug submitter was doing it
         final GLEventListener gle = useFFP ? new TextureDraw01GL2Listener( texData ) : new TextureDraw01ES2Listener( texData, 0 ) ;
         glc.addGLEventListener(gle);
-        glc.addGLEventListener(new GLEventListener() {            
+        glc.addGLEventListener(new GLEventListener() {
             boolean shot = false;
-            
-            @Override public void init(GLAutoDrawable drawable) {}
-            
+
+            @Override public void init(final GLAutoDrawable drawable) {}
+
             @Override
-            public void display(GLAutoDrawable drawable) {
+            public void display(final GLAutoDrawable drawable) {
                 // 1 snapshot
                 if(null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
                     shot = true;
@@ -149,31 +148,33 @@ public class TestPNGTextureFromFileAWT extends UITestCase {
                 }
             }
 
-            @Override public void dispose(GLAutoDrawable drawable) { }
-            @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+            @Override public void dispose(final GLAutoDrawable drawable) { }
+            @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
 
-        Animator animator = new Animator(glc);
-        animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
-        QuitAdapter quitAdapter = new QuitAdapter();
-        new com.jogamp.newt.event.awt.AWTKeyAdapter(quitAdapter).addTo(glc);
-        new com.jogamp.newt.event.awt.AWTWindowAdapter(quitAdapter).addTo(glc);
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new com.jogamp.newt.event.awt.AWTKeyAdapter(quitAdapter, glc).addTo(glc);
+        new com.jogamp.newt.event.awt.AWTWindowAdapter(quitAdapter, glc).addTo(glc);
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame.pack();
                     frame.setVisible(true);
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }        
+        }
+
+        final Animator animator = new Animator(glc);
+        animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
         animator.start();
 
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
             Thread.sleep(100);
         }
-        
+
         animator.stop();
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -182,55 +183,55 @@ public class TestPNGTextureFromFileAWT extends UITestCase {
                     frame.remove(glc);
                     frame.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }        
+        }
     }
-    
+
     @Test
     public void testGrayAWTILoaderGL2() throws InterruptedException, IOException {
-        testImpl(true, grayTextureStream, true);        
-    }    
+        testImpl(true, grayTextureStream, true);
+    }
     @Test
     public void testGrayAWTILoaderES2() throws InterruptedException, IOException {
-        testImpl(false, grayTextureStream, true);        
+        testImpl(false, grayTextureStream, true);
     }
-    
+
     @Test
     public void testGrayPNGJLoaderGL2() throws InterruptedException, IOException {
-        testImpl(true, grayTextureStream, false);        
+        testImpl(true, grayTextureStream, false);
     }
     @Test
     public void testGrayPNGJLoaderES2() throws InterruptedException, IOException {
-        testImpl(false, grayTextureStream, false);        
+        testImpl(false, grayTextureStream, false);
     }
-    
+
     @Test
     public void testTestAWTILoaderGL2() throws InterruptedException, IOException {
-        testImpl(true, testTextureStream, true);        
+        testImpl(true, testTextureStream, true);
     }
     @Test
     public void testTestAWTILoaderES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStream, true);        
+        testImpl(false, testTextureStream, true);
     }
-    
+
     @Test
     public void testTestPNGJLoaderGL2() throws InterruptedException, IOException {
-        testImpl(true, testTextureStream, false);        
+        testImpl(true, testTextureStream, false);
     }
     @Test
     public void testTestPNGJLoaderES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStream, false);        
+        testImpl(false, testTextureStream, false);
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 duration = MiscUtils.atol(args[i], duration);
             }
         }
-        org.junit.runner.JUnitCore.main(TestPNGTextureFromFileAWT.class.getName());        
+        org.junit.runner.JUnitCore.main(TestPNGTextureFromFileAWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java
index ce363b6..bbfc290 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPNGTextureFromFileNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.util.texture;
 
 
@@ -64,16 +64,16 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
     static boolean showFPS = false;
     static long duration = 100; // ms
     InputStream grayTextureStream;
-    
+
     InputStream testTextureStreamN_3;
     InputStream testTextureStreamN_4;
     InputStream testTextureStreamNG4;
-    
+
     InputStream testTextureStreamI_3;
     InputStream testTextureStreamIG3;
     InputStream testTextureStreamI_4;
     InputStream testTextureStreamIG4;
-    
+
     InputStream testTextureStreamP_3;
     InputStream testTextureStreamP_4;
 
@@ -82,58 +82,58 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
         grayTextureStream = TestPNGTextureFromFileNEWT.class.getResourceAsStream( "grayscale_texture.png" );
         Assert.assertNotNull(grayTextureStream);
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90.png");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_3-01-160x90.png");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStreamN_3 = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStreamN_3);
         }
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_4-01-160x90.png");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscN_4-01-160x90.png");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStreamN_4 = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStreamN_4);
         }
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscNG4-01-160x90.png");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscNG4-01-160x90.png");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStreamNG4 = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStreamNG4);
         }
-        
+
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscI_3-01-160x90.png");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscI_3-01-160x90.png");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStreamI_3 = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStreamI_3);
         }
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscIG3-01-160x90.png");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscIG3-01-160x90.png");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStreamIG3 = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStreamIG3);
         }
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscI_4-01-160x90.png");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscI_4-01-160x90.png");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStreamI_4 = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStreamI_4);
         }
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscIG4-01-160x90.png");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscIG4-01-160x90.png");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStreamIG4 = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStreamIG4);
         }
-        
-        
+
+
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscP_3-01-160x90.png");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscP_3-01-160x90.png");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStreamP_3 = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStreamP_3);
         }
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscP_4-01-160x90.png");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-ntscP_4-01-160x90.png");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStreamP_4 = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStreamP_4);
@@ -150,7 +150,7 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
         testTextureStreamP_4 = null;
     }
 
-    public void testImpl(boolean useFFP, final InputStream istream) throws InterruptedException, IOException {
+    public void testImpl(final boolean useFFP, final InputStream istream) throws InterruptedException, IOException {
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
         GLProfile glp;
         if(useFFP && GLProfile.isAvailable(GLProfile.GL2)) {
@@ -163,39 +163,39 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
         }
         final GLCapabilities caps = new GLCapabilities(glp);
         caps.setAlphaBits(1);
-        
+
         final TextureData texData = TextureIO.newTextureData(glp, istream, false /* mipmap */, TextureIO.PNG);
-        System.err.println("TextureData: "+texData);        
-        
+        System.err.println("TextureData: "+texData);
+
         final GLWindow glad = GLWindow.create(caps);
         glad.setTitle("TestPNGTextureGL2FromFileNEWT");
         // Size OpenGL to Video Surface
         glad.setSize(texData.getWidth(), texData.getHeight());
-        
+
         // load texture from file inside current GL context to match the way
         // the bug submitter was doing it
         final GLEventListener gle = useFFP ? new TextureDraw01GL2Listener( texData ) : new TextureDraw01ES2Listener( texData, 0 ) ;
         glad.addGLEventListener(gle);
-        glad.addGLEventListener(new GLEventListener() {                    
+        glad.addGLEventListener(new GLEventListener() {
             boolean shot = false;
-            
-            @Override public void init(GLAutoDrawable drawable) {}
-            
-            public void display(GLAutoDrawable drawable) {
+
+            @Override public void init(final GLAutoDrawable drawable) {}
+
+            public void display(final GLAutoDrawable drawable) {
                 // 1 snapshot
                 if(null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
                     shot = true;
                     snapshot(0, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
                 }
             }
-            
-            @Override public void dispose(GLAutoDrawable drawable) { }
-            @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+
+            @Override public void dispose(final GLAutoDrawable drawable) { }
+            @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
 
-        Animator animator = new Animator(glad);
+        final Animator animator = new Animator(glad);
         animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
         glad.addKeyListener(quitAdapter);
         glad.addWindowListener(quitAdapter);
         glad.setVisible(true);
@@ -204,74 +204,74 @@ public class TestPNGTextureFromFileNEWT extends UITestCase {
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
             Thread.sleep(100);
         }
-        
+
         animator.stop();
         glad.destroy();
     }
-    
+
     @Test
     public void testGray__GL2() throws InterruptedException, IOException {
-        testImpl(true, grayTextureStream);        
-    }    
+        testImpl(true, grayTextureStream);
+    }
     @Test
     public void testGray__ES2() throws InterruptedException, IOException {
-        testImpl(false, grayTextureStream);        
+        testImpl(false, grayTextureStream);
     }
-    
+
     @Test
     public void testRGB3__GL2() throws InterruptedException, IOException {
-        testImpl(true, testTextureStreamN_3);        
-    }    
+        testImpl(true, testTextureStreamN_3);
+    }
     @Test
     public void testRGB3__ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStreamN_3);        
-    }    
+        testImpl(false, testTextureStreamN_3);
+    }
     @Test
     public void testRGB4__GL2() throws InterruptedException, IOException {
-        testImpl(true, testTextureStreamN_4);        
-    }    
+        testImpl(true, testTextureStreamN_4);
+    }
     @Test
     public void testRGB4__ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStreamN_4);        
-    }    
+        testImpl(false, testTextureStreamN_4);
+    }
     @Test
     public void testRGB4G_ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStreamNG4);        
+        testImpl(false, testTextureStreamNG4);
     }
-    
+
     @Test
     public void testInterl3__ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStreamI_3);        
-    }    
+        testImpl(false, testTextureStreamI_3);
+    }
     @Test
     public void testInterl4__ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStreamI_4);        
+        testImpl(false, testTextureStreamI_4);
     }
     @Test
     public void testInterl3G_ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStreamIG3);        
-    }    
+        testImpl(false, testTextureStreamIG3);
+    }
     @Test
     public void testInterl4G_ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStreamIG4);        
+        testImpl(false, testTextureStreamIG4);
     }
-    
+
     @Test
     public void testPalette3__ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStreamP_3);        
-    }    
+        testImpl(false, testTextureStreamP_3);
+    }
     @Test
     public void testPalette4__ES2() throws InterruptedException, IOException {
-        testImpl(false, testTextureStreamP_4);        
-    }    
-    
-    public static void main(String args[]) throws IOException {
+        testImpl(false, testTextureStreamP_4);
+    }
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 duration = MiscUtils.atol(args[i], duration);
             }
         }
-        org.junit.runner.JUnitCore.main(TestPNGTextureFromFileNEWT.class.getName());        
+        org.junit.runner.JUnitCore.main(TestPNGTextureFromFileNEWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil00NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil00NEWT.java
index bfcf9c2..1b549fa 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil00NEWT.java
@@ -271,7 +271,7 @@ public class TestPixelFormatUtil00NEWT extends UITestCase {
             }
         }
     }
-    private void dumpComponents(PixelRectangle image, int x1, int y1, int w, int h) {
+    private void dumpComponents(final PixelRectangle image, int x1, int y1, final int w, final int h) {
         if( x1 + w >= image.getSize().getWidth() ) {
             x1 = image.getSize().getWidth() - w;
         }
@@ -311,7 +311,7 @@ public class TestPixelFormatUtil00NEWT extends UITestCase {
         }
         System.err.println();
     }
-    private void testComponents(PixelRectangle image, int x, int y, byte[] components) {
+    private void testComponents(final PixelRectangle image, final int x, final int y, final byte[] components) {
         dumpComponents(image, x, y, 3, 3);
         final ByteBuffer bb = image.getPixels();
         final int bpp = image.getPixelformat().bytesPerPixel();
@@ -329,7 +329,7 @@ public class TestPixelFormatUtil00NEWT extends UITestCase {
                 final byte c1 = bb.get(o++), c2 = bb.get(o++);
                 final boolean equal = c1==components[0] && c2==components[1];
                 System.err.printf("Test [%3d][%3d] exp 0x%02X%02X == has 0x%02X%02X : %b%n",
-                        x, components[1], components[0], c2, c1, equal );
+                        x, y, components[1], components[0], c2, c1, equal );
                 Assert.assertEquals(components[0], c1);
                 Assert.assertEquals(components[1], c2);
               }
@@ -358,7 +358,7 @@ public class TestPixelFormatUtil00NEWT extends UITestCase {
         }
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestPixelFormatUtil00NEWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil01NEWT.java
index f548613..eba9200 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestPixelFormatUtil01NEWT.java
@@ -82,7 +82,7 @@ public class TestPixelFormatUtil01NEWT extends UITestCase {
     {
         System.err.println("Test01: "+pathname+basename+".png, srcFmt "+srcFmt+", destMinStrideInBytes "+destMinStrideInBytes+", destIsGLOriented "+destIsGLOriented);
 
-        URLConnection urlConn = IOUtil.getResource(this.getClass(), pathname+basename+".png");
+        final URLConnection urlConn = IOUtil.getResource(this.getClass(), pathname+basename+".png");
 
         final PNGPixelRect image1 = PNGPixelRect.read(urlConn.getInputStream(), srcFmt, false /* directBuffer */, destMinStrideInBytes, false /* isGLOriented */);
         System.err.println("PNGPixelRect - Orig: "+image1);
@@ -99,7 +99,7 @@ public class TestPixelFormatUtil01NEWT extends UITestCase {
         }
     }
 
-    public static void main(String args[]) {
+    public static void main(final String args[]) {
         org.junit.runner.JUnitCore.main(TestPixelFormatUtil01NEWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTGATextureFromFileNEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTGATextureFromFileNEWT.java
index 859e4e4..ed8339b 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTGATextureFromFileNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTGATextureFromFileNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -61,27 +61,34 @@ import com.jogamp.opengl.util.texture.TextureIO;
 public class TestTGATextureFromFileNEWT extends UITestCase {
     static boolean showFPS = false;
     static long duration = 100; // ms
-    
+
     InputStream testTextureStream01U32;
     InputStream testTextureStream02RLE32;
-    
+    InputStream testTextureStream03RLE32;
+
     @Before
     public void initTest() throws IOException {
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-u32.tga");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "test-u32.tga");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStream01U32 = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStream01U32);
         }
         {
-            URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "bug744-rle32.tga");
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "bug744-rle32.tga");
             Assert.assertNotNull(testTextureUrlConn);
             testTextureStream02RLE32 = testTextureUrlConn.getInputStream();
             Assert.assertNotNull(testTextureStream02RLE32);
         }
+        {
+            final URLConnection testTextureUrlConn = IOUtil.getResource(this.getClass(), "bug982.rle32.256x256.tga");
+            Assert.assertNotNull(testTextureUrlConn);
+            testTextureStream03RLE32 = testTextureUrlConn.getInputStream();
+            Assert.assertNotNull(testTextureStream03RLE32);
+        }
     }
-    
-    public void testImpl(boolean useFFP, final InputStream istream) throws InterruptedException, IOException {
+
+    public void testImpl(final boolean useFFP, final InputStream istream) throws InterruptedException, IOException {
         final GLReadBufferUtil screenshot = new GLReadBufferUtil(true, false);
         GLProfile glp;
         if(useFFP && GLProfile.isAvailable(GLProfile.GL2)) {
@@ -94,39 +101,39 @@ public class TestTGATextureFromFileNEWT extends UITestCase {
         }
         final GLCapabilities caps = new GLCapabilities(glp);
         caps.setAlphaBits(1);
-        
+
         final TextureData texData = TextureIO.newTextureData(glp, istream, false /* mipmap */, TextureIO.TGA);
-        System.err.println("TextureData: "+texData);        
-        
+        System.err.println("TextureData: "+texData);
+
         final GLWindow glad = GLWindow.create(caps);
         glad.setTitle("TestTGATextureGL2FromFileNEWT");
         // Size OpenGL to Video Surface
         glad.setSize(texData.getWidth(), texData.getHeight());
-        
+
         // load texture from file inside current GL context to match the way
         // the bug submitter was doing it
         final GLEventListener gle = useFFP ? new TextureDraw01GL2Listener( texData ) : new TextureDraw01ES2Listener( texData, 0 ) ;
         glad.addGLEventListener(gle);
-        glad.addGLEventListener(new GLEventListener() {                    
+        glad.addGLEventListener(new GLEventListener() {
             boolean shot = false;
-            
-            @Override public void init(GLAutoDrawable drawable) {}
-            
-            public void display(GLAutoDrawable drawable) {
+
+            @Override public void init(final GLAutoDrawable drawable) {}
+
+            public void display(final GLAutoDrawable drawable) {
                 // 1 snapshot
                 if(null!=((TextureDraw01Accessor)gle).getTexture() && !shot) {
                     shot = true;
                     snapshot(0, null, drawable.getGL(), screenshot, TextureIO.PNG, null);
                 }
             }
-            
-            @Override public void dispose(GLAutoDrawable drawable) { }
-            @Override public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }
+
+            @Override public void dispose(final GLAutoDrawable drawable) { }
+            @Override public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
 
-        Animator animator = new Animator(glad);
+        final Animator animator = new Animator(glad);
         animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
         glad.addKeyListener(quitAdapter);
         glad.addWindowListener(quitAdapter);
         glad.setVisible(true);
@@ -135,34 +142,40 @@ public class TestTGATextureFromFileNEWT extends UITestCase {
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
             Thread.sleep(100);
         }
-        
+
         animator.stop();
         glad.destroy();
     }
-    
+
     @Test
     public void test01U32__GL2() throws InterruptedException, IOException {
-        testImpl(true, testTextureStream01U32);        
+        testImpl(true, testTextureStream01U32);
     }
-    
+
     @Test
     public void test02RLE32__GL2() throws InterruptedException, IOException {
-        testImpl(true, testTextureStream02RLE32);        
+        testImpl(true, testTextureStream02RLE32);
     }
-    
+
+    @Test
+    public void test03RLE32__GL2() throws InterruptedException, IOException {
+        testImpl(true, testTextureStream03RLE32);
+    }
+
     @After
     public void cleanupTest() {
         testTextureStream01U32 = null;
         testTextureStream02RLE32 = null;
+        testTextureStream03RLE32 = null;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 duration = MiscUtils.atol(args[i], duration);
             }
         }
-        org.junit.runner.JUnitCore.main(TestTGATextureFromFileNEWT.class.getName());        
+        org.junit.runner.JUnitCore.main(TestTGATextureFromFileNEWT.class.getName());
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture01AWT.java
index 855529f..5a51473 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture01AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.util.texture;
 
 
@@ -67,8 +67,8 @@ import org.junit.runners.MethodSorters;
 /**
  * Demonstrates TextureData w/ AWT usage in both directions,
  * i.e. generating a texture based on an AWT BufferedImage data
- * as well as reading out GL framebuffer and displaying it 
- * as an BufferedImage. 
+ * as well as reading out GL framebuffer and displaying it
+ * as an BufferedImage.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestTexture01AWT extends UITestCase {
@@ -102,7 +102,7 @@ public class TestTexture01AWT extends UITestCase {
         g.dispose();
 
         // create texture image
-        int imageType = BufferedImage.TYPE_3BYTE_BGR;
+        final int imageType = BufferedImage.TYPE_3BYTE_BGR;
         textureImage = new BufferedImage(baseImage.getWidth(),
                                          baseImage.getHeight(),
                                          imageType);
@@ -129,26 +129,26 @@ public class TestTexture01AWT extends UITestCase {
         final Frame frame0 = new Frame("GL -> AWT");
         final Canvas canvas = new Canvas();
         frame0.add(canvas);
-        
+
         final GLCanvas glCanvas = new GLCanvas(caps);
         final Frame frame1 = new Frame("AWT -> Texture");
         Assert.assertNotNull(frame1);
         frame1.add(glCanvas);
 
-        // create texture    
-        TextureData textureData = AWTTextureIO.newTextureData(caps.getGLProfile(), textureImage, false);
+        // create texture
+        final TextureData textureData = AWTTextureIO.newTextureData(caps.getGLProfile(), textureImage, false);
         glCanvas.addGLEventListener(new TextureDraw01GL2Listener(textureData));
         glCanvas.addGLEventListener(new GLEventListener() {
-            
+
             @Override
-            public void init(GLAutoDrawable drawable) { }
+            public void init(final GLAutoDrawable drawable) { }
             @Override
-            public void dispose(GLAutoDrawable drawable) { }
+            public void dispose(final GLAutoDrawable drawable) { }
             @Override
-            public void display(GLAutoDrawable drawable) {
-                BufferedImage outputImage = awtGLReadBufferUtil.readPixelsToBufferedImage(drawable.getGL(), true /* awtOrientation */);
-                ImageIcon imageIcon = new ImageIcon(outputImage);
-                final JLabel imageLabel = new JLabel(imageIcon);        
+            public void display(final GLAutoDrawable drawable) {
+                final BufferedImage outputImage = awtGLReadBufferUtil.readPixelsToBufferedImage(drawable.getGL(), true /* awtOrientation */);
+                final ImageIcon imageIcon = new ImageIcon(outputImage);
+                final JLabel imageLabel = new JLabel(imageIcon);
                 try {
                     AWTEDTExecutor.singleton.invoke(true, new Runnable() {
                         public void run() {
@@ -156,17 +156,17 @@ public class TestTexture01AWT extends UITestCase {
                             frame0.add(imageLabel);
                             frame0.validate();
                         }});
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     e.printStackTrace();
-                }                
+                }
             }
 
             @Override
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
                 frame0.setSize(frame1.getWidth(), frame1.getHeight());
                 frame0.setLocation(frame1.getX()+frame1.getWidth()+32, frame0.getY());
                 frame0.validate();
-            }            
+            }
         });
 
         try {
@@ -179,11 +179,11 @@ public class TestTexture01AWT extends UITestCase {
                     frame0.setLocation(frame1.getX()+frame1.getWidth()+32, frame0.getY());
                     frame0.setVisible(true);
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }                
-        
+        }
+
         Thread.sleep(durationPerTest);
 
         try {
@@ -194,19 +194,19 @@ public class TestTexture01AWT extends UITestCase {
                     frame1.setVisible(false);
                     frame1.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }                
+        }
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
             }
         }
-        String tstname = TestTexture01AWT.class.getName();
+        final String tstname = TestTexture01AWT.class.getName();
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
             "filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture02AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture02AWT.java
index 566ce0f..c54b9b3 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTexture02AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.jogl.util.texture;
 
 
@@ -57,8 +57,8 @@ import org.junit.runners.MethodSorters;
 
 /**
  * Demonstrates TextureData w/ AWT usage,
- * i.e. reading out an animated GL framebuffer and displaying it 
- * as an BufferedImage. 
+ * i.e. reading out an animated GL framebuffer and displaying it
+ * as an BufferedImage.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestTexture02AWT extends UITestCase {
@@ -85,31 +85,31 @@ public class TestTexture02AWT extends UITestCase {
         final ImageIcon imageIcon = new ImageIcon();
         final JLabel imageLabel = new JLabel(imageIcon);
         frame0.add(imageLabel);
-        
+
         final GLCanvas glCanvas = new GLCanvas(caps);
         final Frame frame1 = new Frame("GearsES2");
         Assert.assertNotNull(frame1);
         frame1.add(glCanvas);
 
         glCanvas.addGLEventListener(new GearsES2(1));
-        glCanvas.addGLEventListener(new GLEventListener() {            
+        glCanvas.addGLEventListener(new GLEventListener() {
             @Override
-            public void init(GLAutoDrawable drawable) { }
+            public void init(final GLAutoDrawable drawable) { }
             @Override
-            public void dispose(GLAutoDrawable drawable) { }
+            public void dispose(final GLAutoDrawable drawable) { }
             @Override
-            public void display(GLAutoDrawable drawable) {
-                BufferedImage outputImage = awtGLReadBufferUtil.readPixelsToBufferedImage(drawable.getGL(), true /* awtOrientation */);
+            public void display(final GLAutoDrawable drawable) {
+                final BufferedImage outputImage = awtGLReadBufferUtil.readPixelsToBufferedImage(drawable.getGL(), true /* awtOrientation */);
                 imageIcon.setImage(outputImage);
                 imageLabel.repaint();
             }
 
             @Override
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
                 frame0.setSize(frame1.getWidth(), frame1.getHeight());
                 frame0.setLocation(frame1.getX()+frame1.getWidth()+32, frame0.getY());
                 frame0.validate();
-            }            
+            }
         });
 
         try {
@@ -122,13 +122,13 @@ public class TestTexture02AWT extends UITestCase {
                     frame0.setLocation(frame1.getX()+frame1.getWidth()+32, frame0.getY());
                     frame0.setVisible(true);
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }                
-        FPSAnimator animator = new FPSAnimator(glCanvas, 15); // 15fps
+        }
+        final FPSAnimator animator = new FPSAnimator(glCanvas, 15); // 15fps
         animator.start();
-        
+
         Thread.sleep(durationPerTest);
 
         animator.stop();
@@ -140,19 +140,19 @@ public class TestTexture02AWT extends UITestCase {
                     frame1.setVisible(false);
                     frame1.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }                
+        }
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
             }
         }
-        String tstname = TestTexture02AWT.class.getName();
+        final String tstname = TestTexture02AWT.class.getName();
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
             "filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01AWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01AWT.java
index 2b3ead5..5a294ee 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01AWT.java
@@ -1,6 +1,7 @@
 package com.jogamp.opengl.test.junit.jogl.util.texture;
 
 import java.awt.Frame;
+import java.io.IOException;
 
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLCapabilities;
@@ -15,12 +16,13 @@ import org.junit.Test;
 import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
-import com.jogamp.opengl.test.junit.jogl.demos.TextureSequenceDemo01;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.TextureSequenceCubeES2;
 import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.texture.ImageSequence;
+import com.jogamp.opengl.util.texture.TextureIO;
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestTextureSequence01AWT extends UITestCase {
@@ -31,7 +33,7 @@ public class TestTextureSequence01AWT extends UITestCase {
     static long duration = 500; // ms
     static GLProfile glp;
     static GLCapabilities caps;
-    
+
     @BeforeClass
     public static void initClass() {
         glp = GLProfile.getGL2ES2();
@@ -45,42 +47,49 @@ public class TestTextureSequence01AWT extends UITestCase {
         final Frame frame = new Frame("TestTextureSequence01AWT");
         Assert.assertNotNull(frame);
         frame.add(glc);
-        
-        final TextureSequenceDemo01 texSource = new TextureSequenceDemo01(useBuildInTexLookup);
+
+        final ImageSequence texSource = new ImageSequence(0, useBuildInTexLookup);
         glc.addGLEventListener(new GLEventListener() {
             @Override
-            public void init(GLAutoDrawable drawable) {
-                texSource.initGLResources(drawable.getGL());
+            public void init(final GLAutoDrawable drawable) {
+                try {
+                    texSource.addFrame(drawable.getGL(), TestTextureSequence01AWT.class, "test-ntscP_3-01-160x90.png", TextureIO.PNG);
+                } catch (final IOException e) {
+                    e.printStackTrace();
+                }
             }
             @Override
-            public void dispose(GLAutoDrawable drawable) { }
+            public void dispose(final GLAutoDrawable drawable) { }
             @Override
-            public void display(GLAutoDrawable drawable) { }
+            public void display(final GLAutoDrawable drawable) { }
             @Override
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }            
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
         glc.addGLEventListener(new TextureSequenceCubeES2(texSource, false, -2.3f, 0f, 0f));
-        final Animator animator = new Animator(glc);
-        animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
-        QuitAdapter quitAdapter = new QuitAdapter();
-        new com.jogamp.newt.event.awt.AWTKeyAdapter(quitAdapter).addTo(glc);
-        new com.jogamp.newt.event.awt.AWTWindowAdapter(quitAdapter).addTo(glc);
+
+        final QuitAdapter quitAdapter = new QuitAdapter();
+        new com.jogamp.newt.event.awt.AWTKeyAdapter(quitAdapter, glc).addTo(glc);
+        new com.jogamp.newt.event.awt.AWTWindowAdapter(quitAdapter, glc).addTo(glc);
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame.setSize(width, height);
                     frame.setVisible(true);
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }                
+        }
+
+        final Animator animator = new Animator(glc);
+        animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
         animator.start();
-        
+
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
             Thread.sleep(100);
         }
-        
+
         animator.stop();
         Assert.assertFalse(animator.isAnimating());
         Assert.assertFalse(animator.isStarted());
@@ -91,18 +100,18 @@ public class TestTextureSequence01AWT extends UITestCase {
                     frame.remove(glc);
                     frame.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }                
+        }
     }
-    
+
     @Test
     public void test1() throws InterruptedException {
-        testImpl();        
+        testImpl();
     }
-    
-    public static void main(String[] args) {
+
+    public static void main(final String[] args) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
@@ -117,7 +126,7 @@ public class TestTextureSequence01AWT extends UITestCase {
                 useBuildInTexLookup = true;
             }
         }
-        org.junit.runner.JUnitCore.main(TestTextureSequence01AWT.class.getName());        
+        org.junit.runner.JUnitCore.main(TestTextureSequence01AWT.class.getName());
     }
 
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01NEWT.java b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01NEWT.java
index 5145e10..47b594e 100644
--- a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/TestTextureSequence01NEWT.java
@@ -1,5 +1,7 @@
 package com.jogamp.opengl.test.junit.jogl.util.texture;
 
+import java.io.IOException;
+
 import javax.media.opengl.GLAutoDrawable;
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLEventListener;
@@ -12,12 +14,13 @@ import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
 import com.jogamp.newt.opengl.GLWindow;
-import com.jogamp.opengl.test.junit.jogl.demos.TextureSequenceDemo01;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.TextureSequenceCubeES2;
 import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.QuitAdapter;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.util.Animator;
+import com.jogamp.opengl.util.texture.ImageSequence;
+import com.jogamp.opengl.util.texture.TextureIO;
 
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestTextureSequence01NEWT extends UITestCase {
@@ -28,7 +31,7 @@ public class TestTextureSequence01NEWT extends UITestCase {
     static long duration = 500; // ms
     static GLProfile glp;
     static GLCapabilities caps;
-    
+
     @BeforeClass
     public static void initClass() {
         glp = GLProfile.getGL2ES2();
@@ -42,44 +45,48 @@ public class TestTextureSequence01NEWT extends UITestCase {
         window.setTitle("TestTextureSequence01NEWT");
         // Size OpenGL to Video Surface
         window.setSize(width, height);
-        final TextureSequenceDemo01 texSource = new TextureSequenceDemo01(useBuildInTexLookup);
+        final ImageSequence texSource = new ImageSequence(0, useBuildInTexLookup);
         window.addGLEventListener(new GLEventListener() {
             @Override
-            public void init(GLAutoDrawable drawable) {
-                texSource.initGLResources(drawable.getGL());
+            public void init(final GLAutoDrawable drawable) {
+                try {
+                    texSource.addFrame(drawable.getGL(), TestTextureSequence01NEWT.class, "test-ntscP_3-01-160x90.png", TextureIO.PNG);
+                } catch (final IOException e) {
+                    e.printStackTrace();
+                }
             }
             @Override
-            public void dispose(GLAutoDrawable drawable) { }
+            public void dispose(final GLAutoDrawable drawable) { }
             @Override
-            public void display(GLAutoDrawable drawable) { }
+            public void display(final GLAutoDrawable drawable) { }
             @Override
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) { }            
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) { }
         });
         window.addGLEventListener(new TextureSequenceCubeES2(texSource, false, -2.3f, 0f, 0f));
         final Animator animator = new Animator(window);
         animator.setUpdateFPSFrames(60, showFPS ? System.err : null);
-        QuitAdapter quitAdapter = new QuitAdapter();
+        final QuitAdapter quitAdapter = new QuitAdapter();
         window.addKeyListener(quitAdapter);
         window.addWindowListener(quitAdapter);
         animator.start();
         window.setVisible(true);
-        
+
         while(!quitAdapter.shouldQuit() && animator.isAnimating() && animator.getTotalFPSDuration()<duration) {
             Thread.sleep(100);
         }
-        
+
         animator.stop();
         Assert.assertFalse(animator.isAnimating());
         Assert.assertFalse(animator.isStarted());
         window.destroy();
     }
-    
+
     @Test
     public void test1() throws InterruptedException {
-        testImpl();        
+        testImpl();
     }
-    
-    public static void main(String[] args) {
+
+    public static void main(final String[] args) {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
@@ -94,7 +101,7 @@ public class TestTextureSequence01NEWT extends UITestCase {
                 useBuildInTexLookup = true;
             }
         }
-        org.junit.runner.JUnitCore.main(TestTextureSequence01NEWT.class.getName());        
+        org.junit.runner.JUnitCore.main(TestTextureSequence01NEWT.class.getName());
     }
 
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/bug982.rle32.256x256.tga b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/bug982.rle32.256x256.tga
new file mode 100644
index 0000000..d4affa1
Binary files /dev/null and b/src/test/com/jogamp/opengl/test/junit/jogl/util/texture/bug982.rle32.256x256.tga differ
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/DemoCreateAndDisposeOnCloseNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/DemoCreateAndDisposeOnCloseNEWT.java
index e82204f..9ab81ef 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/DemoCreateAndDisposeOnCloseNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/DemoCreateAndDisposeOnCloseNEWT.java
@@ -50,7 +50,7 @@ import com.jogamp.opengl.util.Animator;
  *
  */
 public class DemoCreateAndDisposeOnCloseNEWT {
-    public static void main(String[] args) {
+    public static void main(final String[] args) {
         int closeMode = 0; // 0 - none, 1 - window, animator, 2 - animator, window, 3 - System.exit
 
         for(int i=0; i<args.length; i++) {
@@ -65,26 +65,26 @@ public class DemoCreateAndDisposeOnCloseNEWT {
         caps.setDoubleBuffered(true);
         caps.setDepthBits(16);
         final Animator animator = new Animator();
-        GLWindow glWindow = GLWindow.create(caps);
+        final GLWindow glWindow = GLWindow.create(caps);
         animator.add(glWindow);
         glWindow.addGLEventListener(new GLEventListener() {
             @Override
-            public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+            public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
                 System.out.println("GLEventListener.reshape");
             }
 
             @Override
-            public void init(GLAutoDrawable drawable) {
+            public void init(final GLAutoDrawable drawable) {
                 System.out.println("GLEventListener.init");
             }
 
             @Override
-            public void dispose(GLAutoDrawable drawable) {
+            public void dispose(final GLAutoDrawable drawable) {
                 System.out.println("GLEventListener.dispose");
             }
 
             @Override
-            public void display(GLAutoDrawable drawable) {
+            public void display(final GLAutoDrawable drawable) {
             }
         });
         glWindow.setTitle("Test");
@@ -96,12 +96,12 @@ public class DemoCreateAndDisposeOnCloseNEWT {
         glWindow.setDefaultCloseOperation(WindowClosingProtocol.WindowClosingMode.DISPOSE_ON_CLOSE);
         glWindow.addWindowListener(new WindowAdapter() {
             @Override
-            public void windowDestroyNotify(WindowEvent e) {
+            public void windowDestroyNotify(final WindowEvent e) {
                 System.out.println("GLWindow.destroyNotify");
             }
 
             @Override
-            public void windowDestroyed(WindowEvent e) {
+            public void windowDestroyed(final WindowEvent e) {
                 System.out.println("GLWindow.destroyed");
                 animator.stop();
             }
@@ -132,7 +132,7 @@ public class DemoCreateAndDisposeOnCloseNEWT {
     static void sleep1s() {
         try {
             Thread.sleep(1000);
-        } catch (InterruptedException e) {
+        } catch (final InterruptedException e) {
             e.printStackTrace();
         }
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java
index 817f414..f9216f0 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestCloseNewtAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -34,9 +34,10 @@ import org.junit.runners.MethodSorters;
 import org.junit.Assert;
 
 import java.lang.reflect.InvocationTargetException;
+
 import javax.swing.JFrame;
 import javax.swing.SwingUtilities;
-
+import javax.swing.WindowConstants;
 import javax.media.nativewindow.NativeWindow;
 import javax.media.nativewindow.util.Point;
 import javax.media.opengl.GLCapabilities;
@@ -58,7 +59,7 @@ public class TestCloseNewtAWT extends UITestCase {
 
     @SuppressWarnings("serial")
     class MyCanvas extends NewtCanvasAWT {
-         public MyCanvas(Window window) {
+         public MyCanvas(final Window window) {
             super(window);
          }
 
@@ -79,10 +80,10 @@ public class TestCloseNewtAWT extends UITestCase {
                                        ", holds AWTTreeLock: "+Thread.holdsLock(MyCanvas.this.getTreeLock()));
 
                     // Critical: Within NEWT EDT, while AWT is locked
-                    NativeWindow nw = MyCanvas.this.getNativeWindow();
+                    final NativeWindow nw = MyCanvas.this.getNativeWindow();
                     if(null != nw) {
-                        Point p = nw.getLocationOnScreen(null);
-                        System.err.println("MyCanvas On NEWT-EDT: position: "+p);                        
+                        final Point p = nw.getLocationOnScreen(null);
+                        System.err.println("MyCanvas On NEWT-EDT: position: "+p);
                     } else {
                         System.err.println("MyCanvas On NEWT-EDT: position n/a, null NativeWindow");
                     }
@@ -104,7 +105,7 @@ public class TestCloseNewtAWT extends UITestCase {
         SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
                 frame = new JFrame("NEWT Close Test");
-                frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+                frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
                 frame.getContentPane().add(newtCanvas);
                 frame.pack();
                 frame.setSize(800, 600);
@@ -118,8 +119,8 @@ public class TestCloseNewtAWT extends UITestCase {
         Assert.assertEquals(true,  AWTRobotUtil.closeWindow(frame, true, closingListener));
     }
 
-    public static void main(String[] args) {
-        String tstname = TestCloseNewtAWT.class.getName();
+    public static void main(final String[] args) {
+        final String tstname = TestCloseNewtAWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java
index b007f57..c334570 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle01NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -62,17 +62,17 @@ public class TestDisplayLifecycle01NEWT extends UITestCase {
         caps = new GLCapabilities(glp);
     }
 
-    static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height)
+    static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final int width, final int height)
         throws InterruptedException
     {
         Assert.assertNotNull(caps);
 
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
+        //
         GLWindow glWindow;
         if(null!=screen) {
-            Window window = NewtFactory.createWindow(screen, caps);
+            final Window window = NewtFactory.createWindow(screen, caps);
             Assert.assertNotNull(window);
             glWindow = GLWindow.create(window);
         } else {
@@ -80,7 +80,7 @@ public class TestDisplayLifecycle01NEWT extends UITestCase {
         }
         glWindow.setUpdateFPSFrames(1, null);
 
-        GLEventListener demo = new GearsES2();
+        final GLEventListener demo = new GearsES2();
         setDemoFields(demo, glWindow);
         glWindow.addGLEventListener(demo);
         glWindow.addWindowListener(new TraceWindowAdapter());
@@ -88,7 +88,7 @@ public class TestDisplayLifecycle01NEWT extends UITestCase {
         return glWindow;
     }
 
-    private void testDisplayCreate01(Display display, Screen screen) throws InterruptedException {
+    private void testDisplayCreate01(final Display display, final Screen screen) throws InterruptedException {
         // start-state == end-state
         Assert.assertEquals(0,Display.getActiveDisplayNumber());
         Assert.assertEquals(0,display.getReferenceCount());
@@ -99,7 +99,7 @@ public class TestDisplayLifecycle01NEWT extends UITestCase {
         Assert.assertEquals(false,screen.isNativeValid());
 
         // Create Window, pending lazy native creation
-        GLWindow window = createWindow(screen, caps, width, height);
+        final GLWindow window = createWindow(screen, caps, width, height);
         Assert.assertEquals(screen,window.getScreen());
         Assert.assertEquals(0,Display.getActiveDisplayNumber());
         Assert.assertEquals(0,display.getReferenceCount());
@@ -209,6 +209,7 @@ public class TestDisplayLifecycle01NEWT extends UITestCase {
             Assert.assertNotNull(edtUtil);
             Assert.assertEquals(false,edtUtil.isRunning());
             edtUtil.start();
+            Assert.assertEquals(true,edtUtil.isRunning());
             edtUtil.invoke(true, null);
             Assert.assertEquals(true,edtUtil.isRunning());
             edtUtil.invokeStop(true, null);
@@ -228,15 +229,15 @@ public class TestDisplayLifecycle01NEWT extends UITestCase {
         Assert.assertEquals(0,Display.getActiveDisplayNumber());
 
         // Create Display/Screen, pending lazy native creation
-        Display display = NewtFactory.createDisplay(null);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final Display display = NewtFactory.createDisplay(null);
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         testDisplayCreate01(display, screen);
         testDisplayCreate01(display, screen);
 
         Assert.assertEquals(0,Display.getActiveDisplayNumber());
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
         if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
@@ -244,22 +245,22 @@ public class TestDisplayLifecycle01NEWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
             }
         }
         System.err.println("durationPerTest: "+durationPerTest);
-        String tstname = TestDisplayLifecycle01NEWT.class.getName();
+        final String tstname = TestDisplayLifecycle01NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java
index 87cb6f0..17a6669 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestDisplayLifecycle02NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -34,11 +34,13 @@ import org.junit.Test;
 import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
+import javax.media.nativewindow.util.RectangleImmutable;
 import javax.media.opengl.*;
 
 import com.jogamp.newt.*;
 import com.jogamp.newt.event.*;
 import com.jogamp.newt.opengl.*;
+
 import java.io.IOException;
 
 import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
@@ -61,18 +63,18 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
         caps = new GLCapabilities(glp);
     }
 
-    static GLWindow createWindow(GLCapabilities caps, int width, int height)
+    static GLWindow createWindow(final GLCapabilities caps, final int width, final int height)
         throws InterruptedException
     {
         Assert.assertNotNull(caps);
 
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
-        GLWindow glWindow = GLWindow.create(caps);
+        //
+        final GLWindow glWindow = GLWindow.create(caps);
         glWindow.setUpdateFPSFrames(1, null);
 
-        GLEventListener demo = new GearsES2();
+        final GLEventListener demo = new GearsES2();
         setDemoFields(demo, glWindow);
         glWindow.addGLEventListener(demo);
         glWindow.addWindowListener(new TraceWindowAdapter());
@@ -85,9 +87,9 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
         Assert.assertEquals(0,Display.getActiveDisplayNumber());
 
         // Create Window, pending lazy native creation
-        GLWindow window = createWindow(caps, width, height);
-        Screen screen = window.getScreen();
-        Display display = screen.getDisplay();
+        final GLWindow window = createWindow(caps, width, height);
+        final Screen screen = window.getScreen();
+        final Display display = screen.getDisplay();
 
         Assert.assertEquals(screen,window.getScreen());
         Assert.assertEquals(0,Display.getActiveDisplayNumber());
@@ -147,7 +149,7 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
         window.destroy();
         Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));
         Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false));
-        
+
         Assert.assertEquals(screen,window.getScreen());
         Assert.assertEquals(0,Display.getActiveDisplayNumber());
         Assert.assertEquals(0,display.getReferenceCount());
@@ -195,7 +197,7 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
         window.destroy();
         Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));
         Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false));
-        
+
         Assert.assertEquals(screen,window.getScreen());
         Assert.assertEquals(false,window.isNativeValid());
         Assert.assertEquals(false,window.isVisible());
@@ -231,15 +233,16 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
         Assert.assertEquals(0,Display.getActiveDisplayNumber());
 
         // Create Window, pending lazy native creation
-        GLWindow window1 = createWindow(caps, width, height);
+        final GLWindow window1 = createWindow(caps, width, height);
         window1.setPosition(0, 0);
-        Screen screen = window1.getScreen();
-        Display display = screen.getDisplay();
+        final Screen screen = window1.getScreen();
+        final Display display = screen.getDisplay();
 
-        GLWindow window2 = createWindow(caps, width, height);
+        final GLWindow window2 = createWindow(caps, width, height);
         Assert.assertSame(screen, window2.getScreen());
         Assert.assertSame(display, window2.getScreen().getDisplay());
-        window2.setPosition(screen.getWidth()-width, 0);
+        final RectangleImmutable screenBoundsInWinU = screen.getViewportInWindowUnits();
+        window2.setPosition(screenBoundsInWinU.getWidth()-width, 0);
 
         Assert.assertEquals(0,Display.getActiveDisplayNumber());
         Assert.assertEquals(0,display.getReferenceCount());
@@ -298,7 +301,7 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
         // destruction ...
         window1.destroy();
         Assert.assertTrue(AWTRobotUtil.waitForRealized(window1, false));
-        
+
         Assert.assertNotNull(window1.getScreen());
         Assert.assertEquals(false,window1.isNativeValid());
         Assert.assertEquals(false,window1.isVisible());
@@ -316,7 +319,7 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
         window2.destroy();
         Assert.assertTrue(AWTRobotUtil.waitForRealized(window2, false));
         Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false));
-        
+
         Assert.assertNotNull(window2.getScreen());
         Assert.assertEquals(false,window2.isNativeValid());
         Assert.assertEquals(false,window2.isVisible());
@@ -331,12 +334,12 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
         Assert.assertEquals(0,screen.getReferenceCount());
         Assert.assertEquals(false,screen.isNativeValid());
 
-        // invalidate (again) .. 
+        // invalidate (again) ..
         window1.destroy();
         Assert.assertEquals(false,window1.isNativeValid());
         Assert.assertEquals(false,window1.isVisible());
 
-        // invalidate (again) .. 
+        // invalidate (again) ..
         window2.destroy();
         Assert.assertEquals(false,window2.isNativeValid());
         Assert.assertEquals(false,window2.isVisible());
@@ -356,7 +359,7 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
         Assert.assertEquals(0,Display.getActiveDisplayNumber());
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
         if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
@@ -364,22 +367,22 @@ public class TestDisplayLifecycle02NEWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
             }
         }
         System.err.println("durationPerTest: "+durationPerTest);
-        String tstname = TestDisplayLifecycle02NEWT.class.getName();
+        final String tstname = TestDisplayLifecycle02NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java b/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java
index a2100cf..eaafd19 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestEventSourceNotAWTBug.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt;
 
 import org.junit.BeforeClass;
@@ -59,7 +59,7 @@ public class TestEventSourceNotAWTBug extends UITestCase {
 
     @Test
     public void testEventSourceNotNewtBug() throws InterruptedException, InvocationTargetException {
-        JFrame jf = new JFrame();
+        final JFrame jf = new JFrame();
 
         jf.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
 
@@ -90,8 +90,8 @@ public class TestEventSourceNotAWTBug extends UITestCase {
         glWindow.destroy();
     }
 
-    public static void main(String args[]) throws IOException {
-        String tstname = TestEventSourceNotAWTBug.class.getName();
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestEventSourceNotAWTBug.class.getName();
         /*
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowInvisiblePointer01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowInvisiblePointer01NEWT.java
index 75a9e87..546b355 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowInvisiblePointer01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowInvisiblePointer01NEWT.java
@@ -33,13 +33,13 @@ public class TestGLWindowInvisiblePointer01NEWT  extends UITestCase {
         glp = GLProfile.getDefault();
     }
 
-    static GLWindow createWindow(Screen screen, GLCapabilitiesImmutable caps)
+    static GLWindow createWindow(final Screen screen, final GLCapabilitiesImmutable caps)
         throws InterruptedException
     {
         Assert.assertNotNull(caps);
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
+        //
         GLWindow glWindow;
         if(null!=screen) {
             glWindow = GLWindow.create(screen, caps);
@@ -48,9 +48,9 @@ public class TestGLWindowInvisiblePointer01NEWT  extends UITestCase {
             glWindow = GLWindow.create(caps);
             Assert.assertNotNull(glWindow);
         }
-        glWindow.setUpdateFPSFrames(1, null);        
+        glWindow.setUpdateFPSFrames(1, null);
 
-        GLEventListener demo = new GearsES1();
+        final GLEventListener demo = new GearsES1();
         glWindow.addGLEventListener(demo);
 
         glWindow.setSize(512, 512);
@@ -61,7 +61,7 @@ public class TestGLWindowInvisiblePointer01NEWT  extends UITestCase {
         return glWindow;
     }
 
-    static void destroyWindow(GLWindow glWindow) {
+    static void destroyWindow(final GLWindow glWindow) {
         if(null!=glWindow) {
             glWindow.destroy();
             Assert.assertEquals(false,glWindow.isNativeValid());
@@ -70,23 +70,23 @@ public class TestGLWindowInvisiblePointer01NEWT  extends UITestCase {
 
     @Test
     public void testWindow00() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
-        GLWindow window1 = createWindow(null, caps); // local
+        final GLWindow window1 = createWindow(null, caps); // local
         Assert.assertEquals(true,window1.isNativeValid());
         Assert.assertEquals(true,window1.isVisible());
-        Animator animator = new Animator();
+        final Animator animator = new Animator();
         animator.setUpdateFPSFrames(1, null);
         animator.add(window1);
         animator.start();
-        AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
+        final AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
 
         System.err.println("GLProfiles window1: "+device1.getConnection()+": "+GLProfile.glAvailabilityToString(device1));
-        
+
         window1.warpPointer(width / 2, height / 2);
         window1.requestFocus();
         while(animator.isAnimating() && animator.getTotalFPSDuration()<durationPerTest) {
-        	boolean pointerVisibleNewVal = (animator.getTotalFPSDuration()/100)%2==0;
+        	final boolean pointerVisibleNewVal = (animator.getTotalFPSDuration()/100)%2==0;
         	window1.setPointerVisible(pointerVisibleNewVal);
         	Assert.assertEquals(pointerVisibleNewVal,window1.isPointerVisible());
             Thread.sleep(100);
@@ -95,22 +95,22 @@ public class TestGLWindowInvisiblePointer01NEWT  extends UITestCase {
         destroyWindow(window1);
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
             }
         }
         System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestGLWindowInvisiblePointer01NEWT.class.getName();
+        final String tstname = TestGLWindowInvisiblePointer01NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowWarpPointer01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowWarpPointer01NEWT.java
index d6b550c..04a27dc 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowWarpPointer01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindowWarpPointer01NEWT.java
@@ -37,13 +37,13 @@ public class TestGLWindowWarpPointer01NEWT  extends UITestCase {
         glp = GLProfile.getDefault();
     }
 
-    static GLWindow createWindow(Screen screen, GLCapabilitiesImmutable caps)
+    static GLWindow createWindow(final Screen screen, final GLCapabilitiesImmutable caps)
         throws InterruptedException
     {
         Assert.assertNotNull(caps);
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
+        //
         GLWindow glWindow;
         if(null!=screen) {
             glWindow = GLWindow.create(screen, caps);
@@ -52,9 +52,9 @@ public class TestGLWindowWarpPointer01NEWT  extends UITestCase {
             glWindow = GLWindow.create(caps);
             Assert.assertNotNull(glWindow);
         }
-        glWindow.setUpdateFPSFrames(1, null);        
+        glWindow.setUpdateFPSFrames(1, null);
 
-        GLEventListener demo = new GearsES2();
+        final GLEventListener demo = new GearsES2();
         glWindow.addGLEventListener(demo);
 
         glWindow.setSize(512, 512);
@@ -65,7 +65,7 @@ public class TestGLWindowWarpPointer01NEWT  extends UITestCase {
         return glWindow;
     }
 
-    static void destroyWindow(GLWindow glWindow) {
+    static void destroyWindow(final GLWindow glWindow) {
         if(null!=glWindow) {
             glWindow.destroy();
             Assert.assertEquals(false,glWindow.isNativeValid());
@@ -76,75 +76,75 @@ public class TestGLWindowWarpPointer01NEWT  extends UITestCase {
     public void testWarp01Center() throws InterruptedException {
         testWarpImpl(false);
     }
-    
+
     @Test
     public void testWarp02Random() throws InterruptedException {
         testWarpImpl(true);
     }
-    
+
     void testWarpImpl(final boolean random) throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
         final GLWindow window1 = createWindow(null, caps); // local
         Assert.assertEquals(true,window1.isNativeValid());
         Assert.assertEquals(true,window1.isVisible());
-        Animator animator = new Animator();
+        final Animator animator = new Animator();
         animator.setUpdateFPSFrames(1, null);
         animator.add(window1);
         animator.start();
-        AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
+        final AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
 
         System.err.println("GLProfiles window1: "+device1.getConnection()+": "+GLProfile.glAvailabilityToString(device1));
-        
+
         window1.warpPointer(width / 2, height / 2);
         window1.requestFocus();
-        
+
         window1.addMouseListener(new MouseAdapter() {
             void warpCenter() {
                 window1.warpPointer(width / 2, height / 2);
             }
-            
+
             @Override
-            public void mouseEntered(MouseEvent e) {
+            public void mouseEntered(final MouseEvent e) {
             }
 
             @Override
-            public void mouseExited(MouseEvent e) {
+            public void mouseExited(final MouseEvent e) {
                 warpCenter();
             }
 
             @Override
-            public void mouseMoved(MouseEvent e) {
+            public void mouseMoved(final MouseEvent e) {
             }
         });
-        
+
         if( random ) {
             window1.addGLEventListener(new GLEventListener() {
                 final Random r = new Random();
-    
-                void warpRandom(int width, int height) {
-                    int x = r.nextInt(width);
-                    int y = r.nextInt(height);
+
+                void warpRandom(final int width, final int height) {
+                    final int x = r.nextInt(width);
+                    final int y = r.nextInt(height);
                     window1.warpPointer(x, y);
                 }
-                
+
                 @Override
-                public void init(GLAutoDrawable drawable) {}
-    
+                public void init(final GLAutoDrawable drawable) {}
+
                 @Override
-                public void dispose(GLAutoDrawable drawable) {}
-    
+                public void dispose(final GLAutoDrawable drawable) {}
+
                 @Override
-                public void display(GLAutoDrawable drawable) {
-                    warpRandom(drawable.getWidth(), drawable.getHeight());
+                public void display(final GLAutoDrawable drawable) {
+                    warpRandom(drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
                 }
-    
+
                 @Override
-                public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {}
-                
+                public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {}
+
             });
         }
-        
+
         while(animator.isAnimating() && animator.getTotalFPSDuration()<durationPerTest) {
             Thread.sleep(100);
         }
@@ -152,22 +152,22 @@ public class TestGLWindowWarpPointer01NEWT  extends UITestCase {
         destroyWindow(window1);
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
             }
         }
         System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestGLWindowWarpPointer01NEWT.class.getName();
+        final String tstname = TestGLWindowWarpPointer01NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java
index 384b680..bd84341 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows00NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt;
 
 import org.junit.Assert;
@@ -58,13 +58,13 @@ public class TestGLWindows00NEWT extends UITestCase {
         glp = GLProfile.getDefault();
     }
 
-    static GLWindow createWindow(Screen screen, GLCapabilitiesImmutable caps)
+    static GLWindow createWindow(final Screen screen, final GLCapabilitiesImmutable caps)
         throws InterruptedException
     {
         Assert.assertNotNull(caps);
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
+        //
         GLWindow glWindow;
         if(null!=screen) {
             glWindow = GLWindow.create(screen, caps);
@@ -73,9 +73,9 @@ public class TestGLWindows00NEWT extends UITestCase {
             glWindow = GLWindow.create(caps);
             Assert.assertNotNull(glWindow);
         }
-        glWindow.setUpdateFPSFrames(1, null);        
+        glWindow.setUpdateFPSFrames(1, null);
 
-        GLEventListener demo = new GearsES2();
+        final GLEventListener demo = new GearsES2();
         glWindow.addGLEventListener(demo);
 
         glWindow.setSize(512, 512);
@@ -86,7 +86,7 @@ public class TestGLWindows00NEWT extends UITestCase {
         return glWindow;
     }
 
-    static void destroyWindow(GLWindow glWindow) {
+    static void destroyWindow(final GLWindow glWindow) {
         if(null!=glWindow) {
             glWindow.destroy();
             Assert.assertEquals(false,glWindow.isNativeValid());
@@ -95,12 +95,12 @@ public class TestGLWindows00NEWT extends UITestCase {
 
     @Test
     public void testWindow00() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
-        GLWindow window1 = createWindow(null, caps); // local
+        final GLWindow window1 = createWindow(null, caps); // local
         Assert.assertEquals(true,window1.isNativeValid());
         Assert.assertEquals(true,window1.isVisible());
-        AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
+        final AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
 
         System.err.println("GLProfiles window1: "+device1.getConnection()+": "+GLProfile.glAvailabilityToString(device1));
 
@@ -111,22 +111,22 @@ public class TestGLWindows00NEWT extends UITestCase {
         destroyWindow(window1);
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
             }
         }
         System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestGLWindows00NEWT.class.getName();
+        final String tstname = TestGLWindows00NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows01NEWT.java
index 2b3e448..ea3e96a 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows01NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt;
 
 import org.junit.Assert;
@@ -58,9 +58,9 @@ public class TestGLWindows01NEWT extends UITestCase {
         glp = GLProfile.getDefault();
     }
 
-    static GLWindow createWindow(Screen screen, GLCapabilities caps,
-                                 int width, int height, boolean onscreen, boolean undecorated,
-                                 boolean addGLEventListenerAfterVisible) 
+    static GLWindow createWindow(final Screen screen, final GLCapabilities caps,
+                                 final int width, final int height, final boolean onscreen, final boolean undecorated,
+                                 final boolean addGLEventListenerAfterVisible)
         throws InterruptedException
     {
         Assert.assertNotNull(caps);
@@ -69,7 +69,7 @@ public class TestGLWindows01NEWT extends UITestCase {
 
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
+        //
         GLWindow glWindow;
         if(null!=screen) {
             glWindow = GLWindow.create(screen, caps);
@@ -83,7 +83,7 @@ public class TestGLWindows01NEWT extends UITestCase {
         Assert.assertEquals(false,glWindow.isVisible());
         Assert.assertEquals(false,glWindow.isNativeValid());
 
-        GLEventListener demo = new GearsES2();
+        final GLEventListener demo = new GearsES2();
         setDemoFields(demo, glWindow);
         if(!addGLEventListenerAfterVisible) {
             glWindow.addGLEventListener(demo);
@@ -100,10 +100,10 @@ public class TestGLWindows01NEWT extends UITestCase {
         Assert.assertTrue(0 < glWindow.getTotalFPSFrames());
 
         //
-        // Create native OpenGL resources .. XGL/WGL/CGL .. 
+        // Create native OpenGL resources .. XGL/WGL/CGL ..
         // equivalent to GLAutoDrawable methods: setVisible(true)
-        // 
-        GLCapabilitiesImmutable caps2 = glWindow.getChosenGLCapabilities();
+        //
+        final GLCapabilitiesImmutable caps2 = glWindow.getChosenGLCapabilities();
         Assert.assertNotNull(caps2);
         Assert.assertTrue(caps2.getGreenBits()>=5);
         Assert.assertTrue(caps2.getBlueBits()>=5);
@@ -118,7 +118,7 @@ public class TestGLWindows01NEWT extends UITestCase {
         return glWindow;
     }
 
-    static void destroyWindow(GLWindow glWindow) {
+    static void destroyWindow(final GLWindow glWindow) {
         if(null!=glWindow) {
             glWindow.destroy();
             Assert.assertEquals(false,glWindow.isNativeValid());
@@ -127,10 +127,10 @@ public class TestGLWindows01NEWT extends UITestCase {
 
     @Test
     public void testWindowNativeRecreate01aSimple() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
-        GLWindow window = createWindow(null, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
+        final GLWindow window = createWindow(null, caps, width, height,
+                                       true /* onscreen */, false /* undecorated */,
                                        false /*addGLEventListenerAfterVisible*/);
 
         Assert.assertEquals(true,window.isNativeValid());
@@ -156,10 +156,10 @@ public class TestGLWindows01NEWT extends UITestCase {
 
     @Test
     public void testWindowNativeRecreate01bSimple() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
-        GLWindow window = createWindow(null, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
+        final GLWindow window = createWindow(null, caps, width, height,
+                                       true /* onscreen */, false /* undecorated */,
                                        true /*addGLEventListenerAfterVisible*/);
 
         Assert.assertEquals(true,window.isNativeValid());
@@ -185,10 +185,10 @@ public class TestGLWindows01NEWT extends UITestCase {
 
     @Test
     public void testWindowDecor01aSimple() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
-        GLWindow window = createWindow(null, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
+        final GLWindow window = createWindow(null, caps, width, height,
+                                       true /* onscreen */, false /* undecorated */,
                                        false /*addGLEventListenerAfterVisible*/);
         System.out.println("Created: "+window);
         int state;
@@ -201,10 +201,10 @@ public class TestGLWindows01NEWT extends UITestCase {
 
     @Test
     public void testWindowDecor01bSimple() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
-        GLWindow window = createWindow(null, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
+        final GLWindow window = createWindow(null, caps, width, height,
+                                       true /* onscreen */, false /* undecorated */,
                                        true /*addGLEventListenerAfterVisible*/);
         System.out.println("Created: "+window);
         int state;
@@ -217,10 +217,10 @@ public class TestGLWindows01NEWT extends UITestCase {
 
     @Test
     public void testWindowDecor02DestroyWinTwiceA() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
-        GLWindow window = createWindow(null, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
+        final GLWindow window = createWindow(null, caps, width, height,
+                                       true /* onscreen */, false /* undecorated */,
                                        false /*addGLEventListenerAfterVisible*/);
         int state;
         for(state=0; state*100<durationPerTest; state++) {
@@ -232,21 +232,21 @@ public class TestGLWindows01NEWT extends UITestCase {
 
     @Test
     public void testWindowDecor03TwoWinOneDisplay() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
 
-        Display display = NewtFactory.createDisplay(null); // local display
+        final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
 
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
-        GLWindow window1 = createWindow(screen, caps, width, height,
-                                       true /* onscreen */, false /* undecorated */, 
+        final GLWindow window1 = createWindow(screen, caps, width, height,
+                                       true /* onscreen */, false /* undecorated */,
                                        false /*addGLEventListenerAfterVisible*/);
         Assert.assertNotNull(window1);
 
-        GLWindow window2 = createWindow(screen, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
+        final GLWindow window2 = createWindow(screen, caps, width, height,
+                                       true /* onscreen */, false /* undecorated */,
                                        false /*addGLEventListenerAfterVisible*/);
         Assert.assertNotNull(window2);
 
@@ -282,26 +282,26 @@ public class TestGLWindows01NEWT extends UITestCase {
 
     @Test
     public void testWindowDecor03TwoWinTwoDisplays() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
 
-        Display display1 = NewtFactory.createDisplay(null, false); // local display
+        final Display display1 = NewtFactory.createDisplay(null, false); // local display
         Assert.assertNotNull(display1);
-        Display display2 = NewtFactory.createDisplay(null, false); // local display
+        final Display display2 = NewtFactory.createDisplay(null, false); // local display
         Assert.assertNotNull(display2);
         Assert.assertNotSame(display1, display2);
 
-        Screen screen1  = NewtFactory.createScreen(display1, 0); // screen 0
+        final Screen screen1  = NewtFactory.createScreen(display1, 0); // screen 0
         Assert.assertNotNull(screen1);
-        GLWindow window1 = createWindow(screen1, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
+        final GLWindow window1 = createWindow(screen1, caps, width, height,
+                                       true /* onscreen */, false /* undecorated */,
                                        false /*addGLEventListenerAfterVisible*/);
         Assert.assertNotNull(window1);
 
-        Screen screen2  = NewtFactory.createScreen(display2, 0); // screen 0
+        final Screen screen2  = NewtFactory.createScreen(display2, 0); // screen 0
         Assert.assertNotNull(screen2);
-        GLWindow window2 = createWindow(screen2, caps, width, height, 
-                                       true /* onscreen */, false /* undecorated */, 
+        final GLWindow window2 = createWindow(screen2, caps, width, height,
+                                       true /* onscreen */, false /* undecorated */,
                                        false /*addGLEventListenerAfterVisible*/);
         Assert.assertNotNull(window2);
 
@@ -351,10 +351,10 @@ public class TestGLWindows01NEWT extends UITestCase {
         Assert.assertNotNull(display2.getEDTUtil());
         Assert.assertEquals(false,display2.getEDTUtil().isRunning());
         Assert.assertEquals(0,screen2.getReferenceCount());
-        Assert.assertEquals(false,screen2.isNativeValid()); 
+        Assert.assertEquals(false,screen2.isNativeValid());
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
         if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
@@ -362,22 +362,22 @@ public class TestGLWindows01NEWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
             }
         }
         System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestGLWindows01NEWT.class.getName();
+        final String tstname = TestGLWindows01NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java
index 86cb533..4969c3b 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows02NEWTAnimated.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt;
 
 
@@ -35,12 +35,15 @@ import org.junit.Test;
 import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 
+import javax.media.nativewindow.util.Rectangle;
+import javax.media.nativewindow.util.RectangleImmutable;
 import javax.media.opengl.*;
 
 import com.jogamp.opengl.util.Animator;
 import com.jogamp.newt.*;
 import com.jogamp.newt.event.*;
 import com.jogamp.newt.opengl.*;
+
 import java.io.IOException;
 
 import com.jogamp.opengl.test.junit.util.UITestCase;
@@ -60,27 +63,27 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
         glp = GLProfile.getDefault();
     }
 
-    static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated, boolean vsync) {
+    static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final int width, final int height, final boolean onscreen, final boolean undecorated, final boolean vsync) {
         Assert.assertNotNull(caps);
         caps.setOnscreen(onscreen);
         // System.out.println("Requested: "+caps);
 
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
+        //
         GLWindow glWindow;
         if(null!=screen) {
-            Window window = NewtFactory.createWindow(screen, caps);
+            final Window window = NewtFactory.createWindow(screen, caps);
             Assert.assertNotNull(window);
             glWindow = GLWindow.create(window);
         } else {
             glWindow = GLWindow.create(caps);
         }
-        glWindow.setUpdateFPSFrames(1, null);        
+        glWindow.setUpdateFPSFrames(1, null);
         Assert.assertNotNull(glWindow);
         glWindow.setUndecorated(onscreen && undecorated);
 
-        GLEventListener demo = new GearsES2(vsync ? 1 : 0);
+        final GLEventListener demo = new GearsES2(vsync ? 1 : 0);
         setDemoFields(demo, glWindow);
         glWindow.addGLEventListener(demo);
         glWindow.addWindowListener(new TraceWindowAdapter());
@@ -96,10 +99,10 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
         // System.out.println("Created: "+glWindow);
 
         //
-        // Create native OpenGL resources .. XGL/WGL/CGL .. 
+        // Create native OpenGL resources .. XGL/WGL/CGL ..
         // equivalent to GLAutoDrawable methods: setVisible(true)
-        // 
-        GLCapabilitiesImmutable caps2 = glWindow.getChosenGLCapabilities();
+        //
+        final GLCapabilitiesImmutable caps2 = glWindow.getChosenGLCapabilities();
         Assert.assertNotNull(caps2);
         Assert.assertTrue(caps2.getGreenBits()>=5);
         Assert.assertTrue(caps2.getBlueBits()>=5);
@@ -109,7 +112,7 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
         return glWindow;
     }
 
-    static void destroyWindow(GLWindow glWindow) {
+    static void destroyWindow(final GLWindow glWindow) {
         if(null!=glWindow) {
             glWindow.destroy();
         }
@@ -117,22 +120,22 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
 
     @Test
     public void testWindowDecor01Simple() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
-        GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */, true /* vsync */);
-        Animator animator = new Animator(window);
-        animator.setUpdateFPSFrames(1, null);        
+        final GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */, true /* vsync */);
+        final Animator animator = new Animator(window);
+        animator.setUpdateFPSFrames(1, null);
         Assert.assertTrue(animator.start());
         while(animator.isAnimating() && animator.getTotalFPSDuration()<durationPerTest) {
             Thread.sleep(100);
         }
-        destroyWindow(window); // destroy - but still in animator        
+        destroyWindow(window); // destroy - but still in animator
         Assert.assertEquals(false, window.isNativeValid());
-        Assert.assertEquals(false, window.isVisible());                
+        Assert.assertEquals(false, window.isVisible());
         Assert.assertEquals(true, animator.isAnimating());
         Assert.assertEquals(false, animator.isPaused());
         Assert.assertEquals(true, animator.isStarted());
-        
+
         animator.remove(window);
         Thread.sleep(250); // give animator a chance to become paused
         Assert.assertEquals(false, animator.isAnimating());
@@ -143,11 +146,11 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
 
     @Test
     public void testWindowDecor02DestroyWinTwiceA() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
-        GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */, true /* vsync */);
-        Animator animator = new Animator();
-        animator.setUpdateFPSFrames(1, null);        
+        final GLWindow window = createWindow(null, caps, width, height, true /* onscreen */, false /* undecorated */, true /* vsync */);
+        final Animator animator = new Animator();
+        animator.setUpdateFPSFrames(1, null);
         Assert.assertTrue(animator.start());
         Thread.sleep(250); // give animator a chance to become paused
         Assert.assertEquals(false, animator.isAnimating()); // zero drawables
@@ -171,24 +174,25 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
 
     @Test
     public void testWindowDecor03TwoWinOneDisplay() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
 
-        Display display = NewtFactory.createDisplay(null); // local display
+        final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
 
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
-        GLWindow window1 = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */, false /* vsync */);
+        final GLWindow window1 = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */, false /* vsync */);
         Assert.assertNotNull(window1);
         window1.setPosition(0, 0);
 
-        GLWindow window2 = createWindow(screen, caps, width-10, height-10, true /* onscreen */, false /* undecorated */, true /* vsync */);
+        final GLWindow window2 = createWindow(screen, caps, width-10, height-10, true /* onscreen */, false /* undecorated */, true /* vsync */);
         Assert.assertNotNull(window2);
-        window2.setPosition(screen.getWidth()-width, 0);
+        final RectangleImmutable screenBoundsInWinU = screen.getViewportInWindowUnits();
+        window2.setPosition(screenBoundsInWinU.getWidth()-width, 0);
 
-        Animator animator = new Animator();
-        animator.setUpdateFPSFrames(1, null);        
+        final Animator animator = new Animator();
+        animator.setUpdateFPSFrames(1, null);
         Assert.assertEquals(false, animator.isStarted());
         Assert.assertEquals(false, animator.isAnimating()); // zero drawables
         Assert.assertEquals(false, animator.isPaused()); // zero drawables, but not started
@@ -232,29 +236,30 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
 
     @Test
     public void testWindowDecor03TwoWinTwoDisplays() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
 
-        Display display1 = NewtFactory.createDisplay(null, false); // local display
+        final Display display1 = NewtFactory.createDisplay(null, false); // local display
         Assert.assertNotNull(display1);
-        Display display2 = NewtFactory.createDisplay(null, false); // local display
+        final Display display2 = NewtFactory.createDisplay(null, false); // local display
         Assert.assertNotNull(display2);
         Assert.assertNotSame(display1, display2);
 
-        Screen screen1  = NewtFactory.createScreen(display1, 0); // screen 0
+        final Screen screen1  = NewtFactory.createScreen(display1, 0); // screen 0
         Assert.assertNotNull(screen1);
-        GLWindow window1 = createWindow(screen1, caps, width, height, true /* onscreen */, false /* undecorated */, false /* vsync */);
+        final GLWindow window1 = createWindow(screen1, caps, width, height, true /* onscreen */, false /* undecorated */, false /* vsync */);
         Assert.assertNotNull(window1);
         window1.setPosition(0, 0);
 
-        Screen screen2  = NewtFactory.createScreen(display2, 0); // screen 0
+        final Screen screen2  = NewtFactory.createScreen(display2, 0); // screen 0
         Assert.assertNotNull(screen2);
-        GLWindow window2 = createWindow(screen2, caps, width-10, height-10, true /* onscreen */, false /* undecorated */, true /* vsync */);
+        final GLWindow window2 = createWindow(screen2, caps, width-10, height-10, true /* onscreen */, false /* undecorated */, true /* vsync */);
         Assert.assertNotNull(window2);
-        window2.setPosition(screen2.getWidth()-width, 0);
+        final RectangleImmutable screen2BoundsInWinU = screen2.getViewportInWindowUnits();
+        window2.setPosition(screen2BoundsInWinU.getWidth()-width, 0);
 
-        Animator animator = new Animator();
-        animator.setUpdateFPSFrames(1, null);        
+        final Animator animator = new Animator();
+        animator.setUpdateFPSFrames(1, null);
         Assert.assertEquals(false, animator.isStarted());
         Assert.assertEquals(false, animator.isAnimating());
         Assert.assertEquals(false, animator.isPaused());
@@ -287,23 +292,23 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
         while(animator.isAnimating() && animator.getTotalFPSDuration()<durationPerTest+durationPerTest/10) {
             Thread.sleep(100);
         }
-        
-        Assert.assertEquals(true, animator.isStarted());                
+
+        Assert.assertEquals(true, animator.isStarted());
         Assert.assertEquals(true, animator.isAnimating());
         Assert.assertEquals(false, animator.isPaused());
-        
+
         Assert.assertEquals(true, animator.pause());
-        
-        Assert.assertEquals(true, animator.isStarted());                
+
+        Assert.assertEquals(true, animator.isStarted());
         Assert.assertEquals(false, animator.isAnimating());
         Assert.assertEquals(true, animator.isPaused());
 
         Assert.assertEquals(true, animator.resume());
-        
+
         Assert.assertEquals(true, animator.isStarted());
         Assert.assertEquals(true, animator.isAnimating());
         Assert.assertEquals(false, animator.isPaused());
-        
+
         destroyWindow(window2);
         animator.remove(window2);
         Assert.assertEquals(true, animator.isStarted());
@@ -317,7 +322,7 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
         Assert.assertEquals(false, animator.isPaused());
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
         if(!MiscUtils.setFieldIfExists(demo, "window", glWindow)) {
@@ -325,21 +330,21 @@ public class TestGLWindows02NEWTAnimated extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
             }
         }
-        String tstname = TestGLWindows02NEWTAnimated.class.getName();
+        final String tstname = TestGLWindows02NEWTAnimated.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows03NEWTAnimResize.java b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows03NEWTAnimResize.java
index 0266566..f7a45c1 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows03NEWTAnimResize.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestGLWindows03NEWTAnimResize.java
@@ -63,7 +63,7 @@ public class TestGLWindows03NEWTAnimResize extends UITestCase {
         glp = GLProfile.getDefault();
     }
 
-    static void test(GLCapabilitiesImmutable caps, boolean undecorated) throws InterruptedException {
+    static void test(final GLCapabilitiesImmutable caps, final boolean undecorated) throws InterruptedException {
         Assert.assertNotNull(caps);
 
         //
@@ -75,7 +75,7 @@ public class TestGLWindows03NEWTAnimResize extends UITestCase {
         Assert.assertNotNull(glWindow);
         glWindow.setUndecorated(undecorated);
 
-        GLEventListener demo = new GearsES2(1);
+        final GLEventListener demo = new GearsES2(1);
         glWindow.addGLEventListener(demo);
         glWindow.addWindowListener(new TraceWindowAdapter());
         Assert.assertEquals(false,glWindow.isNativeValid());
@@ -94,7 +94,7 @@ public class TestGLWindows03NEWTAnimResize extends UITestCase {
         int step_i = 0;
         for(int i=0; i<durationPerTest; i+=50) {
             Thread.sleep(50);
-            int j = (int) ( i / (durationPerTest/step) ) + 1;
+            final int j = (int) ( i / (durationPerTest/step) ) + 1;
             if(j>step_i) {
                 final int w = width/step * j;
                 final int h = height/step * j;
@@ -113,25 +113,25 @@ public class TestGLWindows03NEWTAnimResize extends UITestCase {
 
     @Test
     public void test01WindowDecor() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
         test(caps, false /* undecorated */);
     }
 
     @Test
     public void test02WindowUndecor() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
         test(caps, true /* undecorated */);
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
             }
         }
-        String tstname = TestGLWindows03NEWTAnimResize.class.getName();
+        final String tstname = TestGLWindows03NEWTAnimResize.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java
index 91937c8..588e3cc 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestListenerCom01AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt;
 
 import org.junit.Assert;
@@ -64,19 +64,19 @@ public class TestListenerCom01AWT extends UITestCase {
     @Test
     public void testListenerStringPassingAndOrder() throws InterruptedException, InvocationTargetException {
         // setup NEWT GLWindow ..
-        GLWindow glWindow = GLWindow.create(new GLCapabilities(null));
+        final GLWindow glWindow = GLWindow.create(new GLCapabilities(null));
         Assert.assertNotNull(glWindow);
         glWindow.setTitle("NEWT - CHILD");
 
         System.out.println("durationPerTest "+durationPerTest);
 
-        GLEventListener demo = new GearsES2();
+        final GLEventListener demo = new GearsES2();
         setDemoFields(demo, glWindow, false);
         glWindow.addGLEventListener(demo);
 
-        WindowEventCom1 wl1 = new WindowEventCom1();
-        WindowEventCom2 wl2 = new WindowEventCom2();
-        WindowEventCom3 wl3 = new WindowEventCom3();
+        final WindowEventCom1 wl1 = new WindowEventCom1();
+        final WindowEventCom2 wl2 = new WindowEventCom2();
+        final WindowEventCom3 wl3 = new WindowEventCom3();
 
         // TraceWindowAdapter wlT = new TraceWindowAdapter();
         // glWindow.addWindowListener(0, wlT);
@@ -91,7 +91,7 @@ public class TestListenerCom01AWT extends UITestCase {
         Assert.assertEquals(wl3, glWindow.getWindowListener(2));
 
         // attach NEWT GLWindow to AWT Canvas
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
+        final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
         final Frame frame = new Frame("AWT Parent Frame");
         frame.add(newtCanvasAWT);
         frame.setSize(width, height);
@@ -100,8 +100,8 @@ public class TestListenerCom01AWT extends UITestCase {
                 frame.setVisible(true);
             }});
 
-        Animator animator1 = new Animator(glWindow);
-        animator1.setUpdateFPSFrames(1, null);        
+        final Animator animator1 = new Animator(glWindow);
+        animator1.setUpdateFPSFrames(1, null);
         animator1.start();
         while(animator1.isAnimating() && animator1.getTotalFPSDuration()<durationPerTest) {
             Thread.sleep(100);
@@ -118,10 +118,10 @@ public class TestListenerCom01AWT extends UITestCase {
         glWindow.destroy();
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
-        Window window = glWindow.getDelegatedWindow();
+        final Window window = glWindow.getDelegatedWindow();
         if(debug) {
             MiscUtils.setFieldIfExists(demo, "glDebug", true);
             MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -131,22 +131,22 @@ public class TestListenerCom01AWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         verbose = true;
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
             }
         }
-        String tstname = TestListenerCom01AWT.class.getName();
+        final String tstname = TestListenerCom01AWT.class.getName();
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
             "filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteGLWindows01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteGLWindows01NEWT.java
index d4e8e7e..4d662c4 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteGLWindows01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteGLWindows01NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt;
 
 import org.junit.Assert;
@@ -54,13 +54,13 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
     static long durationPerTest = 100; // ms
     static String remoteDisplay = "localhost:0.0";
 
-    static GLWindow createWindow(Screen screen, GLCapabilities caps, GLEventListener demo)
+    static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final GLEventListener demo)
         throws InterruptedException
     {
         Assert.assertNotNull(caps);
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
+        //
         GLWindow glWindow;
         if(null!=screen) {
             glWindow = GLWindow.create(screen, caps);
@@ -69,7 +69,7 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
             glWindow = GLWindow.create(caps);
             Assert.assertNotNull(glWindow);
         }
-        
+
         glWindow.addGLEventListener(demo);
 
         glWindow.setSize(512, 512);
@@ -80,7 +80,7 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
         return glWindow;
     }
 
-    static void destroyWindow(GLWindow glWindow) {
+    static void destroyWindow(final GLWindow glWindow) {
         if(null!=glWindow) {
             glWindow.destroy();
             Assert.assertEquals(false,glWindow.isNativeValid());
@@ -89,16 +89,16 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
 
     @Test
     public void testRemoteWindow01() throws InterruptedException {
-        Animator animator = new Animator();
-        GLProfile glpLocal = GLProfile.getGL2ES1();
+        final Animator animator = new Animator();
+        final GLProfile glpLocal = GLProfile.getGL2ES1();
         Assert.assertNotNull(glpLocal);
-        GLCapabilities capsLocal = new GLCapabilities(glpLocal);
+        final GLCapabilities capsLocal = new GLCapabilities(glpLocal);
         Assert.assertNotNull(capsLocal);
-        GearsES1 demoLocal = new GearsES1(1);
-        GLWindow windowLocal = createWindow(null, capsLocal, demoLocal); // local with vsync
+        final GearsES1 demoLocal = new GearsES1(1);
+        final GLWindow windowLocal = createWindow(null, capsLocal, demoLocal); // local with vsync
         Assert.assertEquals(true,windowLocal.isNativeValid());
         Assert.assertEquals(true,windowLocal.isVisible());
-        AbstractGraphicsDevice device1 = windowLocal.getScreen().getDisplay().getGraphicsDevice();
+        final AbstractGraphicsDevice device1 = windowLocal.getScreen().getDisplay().getGraphicsDevice();
 
         System.err.println("GLProfiles window1: "+device1.getConnection()+": "+GLProfile.glAvailabilityToString(device1));
 
@@ -120,14 +120,14 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
             GLProfile.initProfiles(deviceRemote); // just to make sure
             System.err.println();
             System.err.println("GLProfiles window2: "+deviceRemote.getConnection()+": "+GLProfile.glAvailabilityToString(deviceRemote));
-            GLProfile glpRemote = GLProfile.get(deviceRemote, GLProfile.GL2ES1);
+            final GLProfile glpRemote = GLProfile.get(deviceRemote, GLProfile.GL2ES1);
             Assert.assertNotNull(glpRemote);
-            GLCapabilities capsRemote = new GLCapabilities(glpRemote);
+            final GLCapabilities capsRemote = new GLCapabilities(glpRemote);
             Assert.assertNotNull(capsRemote);
             screenRemote  = NewtFactory.createScreen(displayRemote, 0); // screen 0
             demoRemote = new GearsES1(0);
             windowRemote = createWindow(screenRemote, capsRemote, demoRemote); // remote, no vsync
-        } catch (NativeWindowException nwe) {
+        } catch (final NativeWindowException nwe) {
             System.err.println(nwe);
             Assume.assumeNoException(nwe);
             destroyWindow(windowLocal);
@@ -138,7 +138,7 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
         Assert.assertEquals(true,windowRemote.isVisible());
 
         animator.add(windowRemote);
-        animator.setUpdateFPSFrames(1, null);        
+        animator.setUpdateFPSFrames(1, null);
         animator.start();
 
         while(animator.getTotalFPSDuration()<durationPerTest) {
@@ -153,15 +153,15 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
         destroyWindow(windowRemote);
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
@@ -171,7 +171,7 @@ public class TestRemoteGLWindows01NEWT extends UITestCase {
         }
         System.out.println("durationPerTest: "+durationPerTest);
         System.out.println("display: "+remoteDisplay);
-        String tstname = TestRemoteGLWindows01NEWT.class.getName();
+        final String tstname = TestRemoteGLWindows01NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteWindow01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteWindow01NEWT.java
index a26b96e..06e55a5 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteWindow01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestRemoteWindow01NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt;
 
 
@@ -55,15 +55,15 @@ public class TestRemoteWindow01NEWT extends UITestCase {
         height = 480;
     }
 
-    static Window createWindow(Screen screen, Capabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
+    static Window createWindow(final Screen screen, final Capabilities caps, final int width, final int height, final boolean onscreen, final boolean undecorated) {
         Assert.assertNotNull(caps);
         caps.setOnscreen(onscreen);
         // System.out.println("Requested: "+caps);
 
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
-        Window window = NewtFactory.createWindow(screen, caps);
+        //
+        final Window window = NewtFactory.createWindow(screen, caps);
         Assert.assertNotNull(window);
         window.setUndecorated(onscreen && undecorated);
         window.setSize(width, height);
@@ -77,10 +77,10 @@ public class TestRemoteWindow01NEWT extends UITestCase {
         // System.out.println("Created: "+window);
 
         //
-        // Create native OpenGL resources .. XGL/WGL/CGL .. 
+        // Create native OpenGL resources .. XGL/WGL/CGL ..
         // equivalent to GLAutoDrawable methods: setVisible(true)
-        // 
-        CapabilitiesImmutable chosenCapabilities = window.getGraphicsConfiguration().getChosenCapabilities();
+        //
+        final CapabilitiesImmutable chosenCapabilities = window.getGraphicsConfiguration().getChosenCapabilities();
         Assert.assertNotNull(chosenCapabilities);
         Assert.assertTrue(chosenCapabilities.getGreenBits()>5);
         Assert.assertTrue(chosenCapabilities.getBlueBits()>5);
@@ -90,7 +90,7 @@ public class TestRemoteWindow01NEWT extends UITestCase {
         return window;
     }
 
-    static void destroyWindow(Display display, Screen screen, Window window) {
+    static void destroyWindow(final Display display, final Screen screen, final Window window) {
         if(null!=window) {
             window.destroy();
         }
@@ -104,10 +104,10 @@ public class TestRemoteWindow01NEWT extends UITestCase {
 
     @Test
     public void testRemoteWindow01() throws InterruptedException {
-        Capabilities caps = new Capabilities();
-        Display display1 = NewtFactory.createDisplay(null); // local display
-        Screen screen1  = NewtFactory.createScreen(display1, 0); // screen 0
-        Window window1 = createWindow(screen1, caps, width, height, true /* onscreen */, false /* undecorated */);
+        final Capabilities caps = new Capabilities();
+        final Display display1 = NewtFactory.createDisplay(null); // local display
+        final Screen screen1  = NewtFactory.createScreen(display1, 0); // screen 0
+        final Window window1 = createWindow(screen1, caps, width, height, true /* onscreen */, false /* undecorated */);
         window1.setVisible(true);
 
         Assert.assertEquals(true,window1.isNativeValid());
@@ -115,16 +115,16 @@ public class TestRemoteWindow01NEWT extends UITestCase {
 
         // Remote Display/Device/Screen/Window ..
         Display display2;
-        AbstractGraphicsDevice device2;
+        final AbstractGraphicsDevice device2;
         Screen screen2;
         Window window2;
         try {
             display2 = NewtFactory.createDisplay(remoteDisplay);
-            display2.createNative(); 
+            display2.createNative();
             screen2  = NewtFactory.createScreen(display2, 0); // screen 0
             window2 = createWindow(screen2, caps, width, height, true /* onscreen */, false /* undecorated */);
             window2.setVisible(true);
-        } catch (NativeWindowException nwe) {
+        } catch (final NativeWindowException nwe) {
             System.err.println(nwe);
             Assume.assumeNoException(nwe);
             destroyWindow(display1, screen1, window1);
@@ -140,14 +140,14 @@ public class TestRemoteWindow01NEWT extends UITestCase {
         destroyWindow(display2, screen2, window2);
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-display")) {
                 remoteDisplay = args[++i];
             }
         }
         System.out.println("display: "+remoteDisplay);
-        String tstname = TestRemoteWindow01NEWT.class.getName();
+        final String tstname = TestRemoteWindow01NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java
index a88b207..40b60ac 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol01AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -35,17 +35,16 @@ import org.junit.Assert;
 
 import java.lang.reflect.InvocationTargetException;
 import java.awt.Frame;
+
 import javax.swing.JFrame;
 import javax.swing.SwingUtilities;
-
+import javax.swing.WindowConstants;
 import javax.media.nativewindow.WindowClosingProtocol.WindowClosingMode;
-
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLProfile;
 import javax.media.opengl.awt.GLCanvas;
 
 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
-
 import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.test.junit.util.AWTRobotUtil.WindowClosingListener;
@@ -57,8 +56,8 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
     public void testCloseFrameGLCanvas() throws InterruptedException, InvocationTargetException {
         final Frame frame = new Frame("testCloseFrameGLCanvas AWT");
         final WindowClosingListener closingListener = AWTRobotUtil.addClosingListener(frame);
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
         final GLCanvas glCanvas = new GLCanvas(caps);
         glCanvas.addGLEventListener(new GearsES2());
         SwingUtilities.invokeAndWait(new Runnable() {
@@ -93,7 +92,7 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
         glCanvas.setDefaultCloseOperation(WindowClosingMode.DISPOSE_ON_CLOSE);
         op = glCanvas.getDefaultCloseOperation();
         Assert.assertEquals(WindowClosingMode.DISPOSE_ON_CLOSE, op);
-        
+
         Thread.sleep(300);
 
         Assert.assertEquals(true,  AWTRobotUtil.closeWindow(frame, false, closingListener)); // no frame close, but GLCanvas's GL resources will be destroyed
@@ -117,9 +116,9 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
     public void testCloseJFrameGLCanvas() throws InterruptedException, InvocationTargetException {
         final JFrame frame = new JFrame("testCloseJFrameGLCanvas AWT");
         final WindowClosingListener closingListener = AWTRobotUtil.addClosingListener(frame);
-        
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
+
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
         final GLCanvas glCanvas = new GLCanvas(caps);
         glCanvas.addGLEventListener(new GearsES2());
         SwingUtilities.invokeAndWait(new Runnable() {
@@ -136,12 +135,12 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
         //
         // close with op: DO_NOTHING_ON_CLOSE -> NOP / HIDE (default)
         //
-        Assert.assertEquals(JFrame.HIDE_ON_CLOSE, frame.getDefaultCloseOperation());
+        Assert.assertEquals(WindowConstants.HIDE_ON_CLOSE, frame.getDefaultCloseOperation());
         WindowClosingMode op = glCanvas.getDefaultCloseOperation();
         Assert.assertEquals(WindowClosingMode.DO_NOTHING_ON_CLOSE, op);
 
         Thread.sleep(300);
-        
+
         Assert.assertEquals(true,  AWTRobotUtil.closeWindow(frame, false, closingListener)); // hide
         Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, false)); // hide -> invisible
         Assert.assertEquals(true,  frame.isDisplayable());
@@ -161,8 +160,8 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
         //
         // close with op (JFrame): DISPOSE_ON_CLOSE -- GLCanvas --> dispose
         //
-        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
-        Assert.assertEquals(JFrame.DISPOSE_ON_CLOSE, frame.getDefaultCloseOperation());
+        frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+        Assert.assertEquals(WindowConstants.DISPOSE_ON_CLOSE, frame.getDefaultCloseOperation());
         op = glCanvas.getDefaultCloseOperation();
         Assert.assertEquals(WindowClosingMode.DISPOSE_ON_CLOSE, op);
 
@@ -174,8 +173,8 @@ public class TestWindowClosingProtocol01AWT extends UITestCase {
         Assert.assertEquals(false, glCanvas.isRealized());
     }
 
-    public static void main(String[] args) {
-        String tstname = TestWindowClosingProtocol01AWT.class.getName();
+    public static void main(final String[] args) {
+        final String tstname = TestWindowClosingProtocol01AWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java
index 020581c..ab57065 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol02NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -52,8 +52,8 @@ public class TestWindowClosingProtocol02NEWT extends UITestCase {
 
     @Test
     public void testCloseGLWindow() throws InterruptedException, InvocationTargetException {
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
         final GLWindow glWindow = GLWindow.create(caps);
         final AWTRobotUtil.WindowClosingListener closingListener = AWTRobotUtil.addClosingListener(glWindow);
 
@@ -72,7 +72,7 @@ public class TestWindowClosingProtocol02NEWT extends UITestCase {
         glWindow.setDefaultCloseOperation(WindowClosingMode.DO_NOTHING_ON_CLOSE);
         op = glWindow.getDefaultCloseOperation();
         Assert.assertEquals(WindowClosingMode.DO_NOTHING_ON_CLOSE, op);
-        
+
         Thread.sleep(300);
 
         Assert.assertEquals(true, AWTRobotUtil.closeWindow(glWindow, false, closingListener)); // nop
@@ -92,8 +92,8 @@ public class TestWindowClosingProtocol02NEWT extends UITestCase {
         Assert.assertEquals(true,  closingListener.isWindowClosing());
     }
 
-    public static void main(String[] args) {
-        String tstname = TestWindowClosingProtocol02NEWT.class.getName();
+    public static void main(final String[] args) {
+        final String tstname = TestWindowClosingProtocol02NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java
index efc833d..e458862 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindowClosingProtocol03NewtAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -30,22 +30,22 @@ package com.jogamp.opengl.test.junit.newt;
 
 import com.jogamp.newt.awt.NewtCanvasAWT;
 import com.jogamp.newt.opengl.GLWindow;
+
 import org.junit.Test;
 import org.junit.FixMethodOrder;
 import org.junit.runners.MethodSorters;
 import org.junit.Assert;
 
 import java.lang.reflect.InvocationTargetException;
+
 import javax.swing.JFrame;
 import javax.swing.SwingUtilities;
-
+import javax.swing.WindowConstants;
 import javax.media.nativewindow.WindowClosingProtocol.WindowClosingMode;
-
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLProfile;
 
 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
-
 import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.test.junit.util.AWTRobotUtil.WindowClosingListener;
@@ -57,9 +57,9 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase {
     public void testCloseJFrameNewtCanvasAWT() throws InterruptedException, InvocationTargetException {
         final JFrame frame = new JFrame("testCloseJFrameNewtCanvasAWT");
         final WindowClosingListener awtClosingListener = AWTRobotUtil.addClosingListener(frame);
-        
-        GLProfile glp = GLProfile.getGL2ES2();
-        GLCapabilities caps = new GLCapabilities(glp);
+
+        final GLProfile glp = GLProfile.getGL2ES2();
+        final GLCapabilities caps = new GLCapabilities(glp);
         final GLWindow glWindow = GLWindow.create(caps);
         final AWTRobotUtil.WindowClosingListener newtClosingListener = AWTRobotUtil.addClosingListener(glWindow);
 
@@ -87,15 +87,15 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase {
         // close with op: DO_NOTHING_ON_CLOSE -> NOP / HIDE (default)
         //
         {
-            Assert.assertEquals(JFrame.HIDE_ON_CLOSE, frame.getDefaultCloseOperation());
-            WindowClosingMode op = newtCanvas.getDefaultCloseOperation();
+            Assert.assertEquals(WindowConstants.HIDE_ON_CLOSE, frame.getDefaultCloseOperation());
+            final WindowClosingMode op = newtCanvas.getDefaultCloseOperation();
             Assert.assertEquals(WindowClosingMode.DO_NOTHING_ON_CLOSE, op);
         }
 
         Thread.sleep(300);
-        
+
         Assert.assertEquals(true,  AWTRobotUtil.closeWindow(frame, false, awtClosingListener)); // hide
-        Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, false)); // hide -> invisible        
+        Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame, false)); // hide -> invisible
         Assert.assertEquals(true,  frame.isDisplayable());
         Assert.assertEquals(false, frame.isVisible());
         Assert.assertEquals(true,  newtCanvas.isValid());
@@ -116,17 +116,17 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase {
         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow, true));
         Assert.assertEquals(true,  frame.isDisplayable());
         Assert.assertEquals(true,  frame.isVisible());
-        
+
         //
         // close with op (JFrame): DISPOSE_ON_CLOSE -- newtCanvas -- glWindow --> dispose
         //
         {
-            frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
-            Assert.assertEquals(JFrame.DISPOSE_ON_CLOSE, frame.getDefaultCloseOperation());
-            WindowClosingMode op = newtCanvas.getDefaultCloseOperation();
+            frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
+            Assert.assertEquals(WindowConstants.DISPOSE_ON_CLOSE, frame.getDefaultCloseOperation());
+            final WindowClosingMode op = newtCanvas.getDefaultCloseOperation();
             Assert.assertEquals(WindowClosingMode.DISPOSE_ON_CLOSE, op);
         }
-        
+
         Thread.sleep(300);
 
         Assert.assertEquals(true,  AWTRobotUtil.closeWindow(frame, true, awtClosingListener));
@@ -142,8 +142,8 @@ public class TestWindowClosingProtocol03NewtAWT extends UITestCase {
         Assert.assertEquals(true,  newtClosingListener.isWindowClosed());
     }
 
-    public static void main(String[] args) {
-        String tstname = TestWindowClosingProtocol03NewtAWT.class.getName();
+    public static void main(final String[] args) {
+        final String tstname = TestWindowClosingProtocol03NewtAWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java
index 6b44a4b..153da26 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/TestWindows01NEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt;
 
 import org.junit.Assert;
@@ -52,20 +52,20 @@ public class TestWindows01NEWT extends UITestCase {
         height = 256;
     }
 
-    static Window createWindow(Capabilities caps, int x, int y, int width, int height, boolean onscreen, boolean undecorated) throws InterruptedException {
+    static Window createWindow(final Capabilities caps, final int x, final int y, final int width, final int height, final boolean onscreen, final boolean undecorated) throws InterruptedException {
         final boolean userPos = x>=0 && y>=0 ; // user has specified a position
-        
+
         Assert.assertNotNull(caps);
         caps.setOnscreen(onscreen);
         // System.out.println("Requested: "+caps);
 
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
-        Window window = NewtFactory.createWindow(caps);
+        //
+        final Window window = NewtFactory.createWindow(caps);
         Assert.assertNotNull(window);
-        Screen screen = window.getScreen();
-        Display display = screen.getDisplay();
+        final Screen screen = window.getScreen();
+        final Display display = screen.getDisplay();
         window.setUndecorated(onscreen && undecorated);
         if(userPos) {
             window.setPosition(x, y);
@@ -75,8 +75,8 @@ public class TestWindows01NEWT extends UITestCase {
         Assert.assertEquals(false,window.isVisible());
         window.setVisible(true);
         // System.err.println("************* Created: "+window);
-        
-        Assert.assertEquals(true,display.isNativeValid());            
+
+        Assert.assertEquals(true,display.isNativeValid());
         Assert.assertEquals(true,screen.isNativeValid());
         Assert.assertEquals(true,window.isVisible());
         Assert.assertEquals(true,window.isNativeValid());
@@ -92,22 +92,22 @@ public class TestWindows01NEWT extends UITestCase {
             Assert.assertEquals(y, window.getY());
         } */
 
-        CapabilitiesImmutable chosenCapabilities = window.getGraphicsConfiguration().getChosenCapabilities();
+        final CapabilitiesImmutable chosenCapabilities = window.getGraphicsConfiguration().getChosenCapabilities();
         Assert.assertNotNull(chosenCapabilities);
         Assert.assertTrue(chosenCapabilities.getGreenBits()>=5);
         Assert.assertTrue(chosenCapabilities.getBlueBits()>=5);
         Assert.assertTrue(chosenCapabilities.getRedBits()>=5);
         Assert.assertEquals(chosenCapabilities.isOnscreen(),onscreen);
-        
+
         return window;
     }
 
-    static void destroyWindow(Window window, boolean last) {
+    static void destroyWindow(final Window window, final boolean last) {
         if(null==window) {
             return;
         }
-        Screen screen = window.getScreen();
-        Display display = screen.getDisplay();
+        final Screen screen = window.getScreen();
+        final Display display = screen.getDisplay();
         window.destroy();
         // System.err.println("************* Destroyed: "+window);
         if(last) {
@@ -115,7 +115,7 @@ public class TestWindows01NEWT extends UITestCase {
             Assert.assertEquals(false,display.isNativeValid());
         } else {
             Assert.assertEquals(true,screen.isNativeValid());
-            Assert.assertEquals(true,display.isNativeValid());            
+            Assert.assertEquals(true,display.isNativeValid());
         }
         Assert.assertEquals(false,window.isNativeValid());
         Assert.assertEquals(false,window.isVisible());
@@ -124,31 +124,31 @@ public class TestWindows01NEWT extends UITestCase {
 
     @Test
     public void testWindowDecorSimpleWMPos() throws InterruptedException {
-        Capabilities caps = new Capabilities();
+        final Capabilities caps = new Capabilities();
         Assert.assertNotNull(caps);
 
-        Window window = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
+        final Window window = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
         destroyWindow(window, true);
     }
 
 
     @Test
     public void testWindowDecorSimpleUserPos() throws InterruptedException {
-        Capabilities caps = new Capabilities();
+        final Capabilities caps = new Capabilities();
         Assert.assertNotNull(caps);
 
-        Window window = createWindow(caps, 100, 100, width, height, true /* onscreen */, false /* undecorated */);
+        final Window window = createWindow(caps, 100, 100, width, height, true /* onscreen */, false /* undecorated */);
         destroyWindow(window, true);
     }
 
     @Test
     public void testWindowNativeRecreate01Simple() throws InterruptedException {
-        Capabilities caps = new Capabilities();
+        final Capabilities caps = new Capabilities();
         Assert.assertNotNull(caps);
 
-        Window window = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
+        final Window window = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
         destroyWindow(window, true);
-        
+
         window.setVisible(true);
         Assert.assertEquals(true,window.isNativeValid());
         Assert.assertEquals(true,window.isVisible());
@@ -157,30 +157,30 @@ public class TestWindows01NEWT extends UITestCase {
 
         destroyWindow(window, true);
     }
-    
+
     @Test
     public void testWindowDecorDestroyWinTwiceA() throws InterruptedException {
-        Capabilities caps = new Capabilities();
+        final Capabilities caps = new Capabilities();
         Assert.assertNotNull(caps);
 
-        Window window = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
+        final Window window = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
         destroyWindow(window, true);
         destroyWindow(window, true);
     }
 
     @Test
     public void testWindowDecorTwoWin() throws InterruptedException {
-        Capabilities caps = new Capabilities();
+        final Capabilities caps = new Capabilities();
         Assert.assertNotNull(caps);
 
-        Window window1 = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
-        Window window2 = createWindow(caps, 100, 100, width, height, true /* onscreen */, false /* undecorated */);
+        final Window window1 = createWindow(caps, -1, -1, width, height, true /* onscreen */, false /* undecorated */);
+        final Window window2 = createWindow(caps, 100, 100, width, height, true /* onscreen */, false /* undecorated */);
         destroyWindow(window2, false);
         destroyWindow(window1, true);
     }
 
-    public static void main(String args[]) throws IOException {
-        String tstname = TestWindows01NEWT.class.getName();
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestWindows01NEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java
index 609d443..2b6356e 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom1.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,23 +20,23 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt;
 
 import com.jogamp.newt.event.*;
 
 class WindowEventCom1 extends WindowAdapter {
 
-    public void windowResized(WindowEvent e) {
-        e.setAttachment(new String("WindowEventCom1.windowResized: "+e));
+    public void windowResized(final WindowEvent e) {
+        e.setAttachment("WindowEventCom1.windowResized: "+e);
     }
-    public void windowMoved(WindowEvent e) {
-        e.setAttachment(new String("WindowEventCom1.windowMoved: "+e));
+    public void windowMoved(final WindowEvent e) {
+        e.setAttachment("WindowEventCom1.windowMoved: "+e);
     }
 }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java
index d15a3cc..bc04157 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom2.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,28 +20,28 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt;
 
 import com.jogamp.newt.event.*;
 
 class WindowEventCom2 extends WindowAdapter {
 
-    public void windowResized(WindowEvent e) {
-        String str = (String) e.getAttachment();
+    public void windowResized(final WindowEvent e) {
+        final String str = (String) e.getAttachment();
         if(null==str) {
-            e.setAttachment(new String("WindowEventCom2.windowResized: "+e));
+            e.setAttachment("WindowEventCom2.windowResized: "+e);
         }
     }
-    public void windowMoved(WindowEvent e) {
-        String str = (String) e.getAttachment();
+    public void windowMoved(final WindowEvent e) {
+        final String str = (String) e.getAttachment();
         if(null==str) {
-            e.setAttachment(new String("WindowEventCom2.windowMoved: "+e));
+            e.setAttachment("WindowEventCom2.windowMoved: "+e);
         }
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom3.java b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom3.java
index 87e5ecc..d3dd6b5 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom3.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/WindowEventCom3.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,24 +20,24 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt;
 
 import com.jogamp.newt.event.*;
 
 class WindowEventCom3 extends WindowAdapter {
 
-    public void windowResized(WindowEvent e) {
-        String str = (String) e.getAttachment();
+    public void windowResized(final WindowEvent e) {
+        final String str = (String) e.getAttachment();
         System.out.println("WindowEventCom3.windowResized: "+str);
     }
-    public void windowMoved(WindowEvent e) {
-        String str = (String) e.getAttachment();
+    public void windowMoved(final WindowEvent e) {
+        final String str = (String) e.getAttachment();
         System.out.println("WindowEventCom3.windowMoved: "+str);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java b/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java
index a46e21b..a2fd7b0 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/BaseNewtEventModifiers.java
@@ -30,6 +30,7 @@ package com.jogamp.opengl.test.junit.newt.event ;
 
 import java.io.PrintStream ;
 import java.util.ArrayList ;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.media.opengl.GLProfile ;
 
@@ -71,7 +72,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
     protected static final int MS_ROBOT_POST_TEST_DELAY = 100;
 
     protected static final boolean _debug = true ;
-    protected static PrintStream _debugPrintStream = System.err ;
+    protected static final PrintStream _debugPrintStream = System.err ;
 
     ////////////////////////////////////////////////////////////////////////////
 
@@ -86,10 +87,10 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
 
         private boolean _modifierCheckEnabled ;
         private int _expectedModifiers;
-        private volatile int _eventCount ;
+        private final AtomicInteger _eventCount = new AtomicInteger(0);
         private ArrayList<String> _failures = new ArrayList<String>() ;
 
-        public synchronized void setModifierCheckEnabled( boolean value ) {
+        public synchronized void setModifierCheckEnabled( final boolean value ) {
             _modifierCheckEnabled = value ;
         }
 
@@ -104,15 +105,15 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
          * in this test code it's probably ok.
          */
 
-        public synchronized void setExpectedModifiers( int value ) {
+        public synchronized void setExpectedModifiers( final int value ) {
             _expectedModifiers = value ;
             clear();
         }
 
         public synchronized ArrayList<String> clear() {
-            ArrayList<String> old = _failures;
+            final ArrayList<String> old = _failures;
 
-            _eventCount = 0;
+            _eventCount.set(0);
 
             // Assume we will have a failure due to no event delivery.
             // If an event is delivered and it's good this assumed
@@ -122,18 +123,18 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
             return old;
         }
 
-        public ArrayList<String> getFailures(int waitEventCount) {
+        public ArrayList<String> getFailures(final int waitEventCount) {
             int j;
-            for(j=0; j < 20 && _eventCount < waitEventCount; j++) { // wait until events are collected
+            for(j=0; j < 20 && _eventCount.get() < waitEventCount; j++) { // wait until events are collected
                 _robot.delay(MS_ROBOT_AUTO_DELAY);
             }
-            if(0 == _eventCount) {
+            if(0 == _eventCount.get()) {
                 _debugPrintStream.println("**** No Event. Waited "+j+" * "+MS_ROBOT_AUTO_DELAY+"ms, eventCount "+_eventCount);
             }
             return clear();
         }
 
-        private synchronized void _checkModifiers( com.jogamp.newt.event.MouseEvent hasEvent ) {
+        private synchronized void _checkModifiers( final com.jogamp.newt.event.MouseEvent hasEvent ) {
             if( _modifierCheckEnabled ) {
 
                 final MouseEvent expEvent = new MouseEvent(hasEvent.getEventType(), hasEvent.getSource(), hasEvent.getWhen(), _expectedModifiers,
@@ -152,7 +153,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
             }
         }
 
-        private synchronized void _checkModifierMask( com.jogamp.newt.event.MouseEvent expEvent, com.jogamp.newt.event.MouseEvent hasEvent, int mask, String maskS ) {
+        private synchronized void _checkModifierMask( final com.jogamp.newt.event.MouseEvent expEvent, final com.jogamp.newt.event.MouseEvent hasEvent, final int mask, final String maskS ) {
 
             // If the "no event delivery" failure is still in the list then
             // get rid of it since that obviously isn't true anymore.  We
@@ -164,7 +165,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
             }
 
             if( ( hasEvent.getModifiers() & mask ) != ( expEvent.getModifiers() & mask ) ) {
-                StringBuilder sb = new StringBuilder();
+                final StringBuilder sb = new StringBuilder();
                 sb.append( com.jogamp.newt.event.MouseEvent.getEventTypeString( hasEvent.getEventType() ) ).append(": mask ").append(maskS).append(" 0x").append(Integer.toHexString(mask));
                 sb.append(", eventCount ").append(_eventCount).append(", expected:");
                 expEvent.getModifiersString(sb);
@@ -176,24 +177,24 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
             }
         }
 
-        public synchronized void mousePressed( com.jogamp.newt.event.MouseEvent event ) {
-            _eventCount++;
+        public synchronized void mousePressed( final com.jogamp.newt.event.MouseEvent event ) {
+            _eventCount.incrementAndGet();
             if( _debug ) {
                 _debugPrintStream.println( "MousePressed     "+_eventCount+": "+event);
             }
             _checkModifiers( event ) ;
         }
 
-        public synchronized void mouseReleased( com.jogamp.newt.event.MouseEvent event ) {
-            _eventCount++;
+        public synchronized void mouseReleased( final com.jogamp.newt.event.MouseEvent event ) {
+            _eventCount.incrementAndGet();
             if( _debug ) {
                 _debugPrintStream.println( "MouseReleased    "+_eventCount+": "+event);
             }
             _checkModifiers( event ) ;
         }
 
-        public synchronized void mouseDragged( com.jogamp.newt.event.MouseEvent event ) {
-            _eventCount++;
+        public synchronized void mouseDragged( final com.jogamp.newt.event.MouseEvent event ) {
+            _eventCount.incrementAndGet();
             if( _debug ) {
                 _debugPrintStream.println( "MouseDragged     "+_eventCount+": "+event);
             }
@@ -204,7 +205,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
         // IGNORED
         //
 
-        public synchronized void mouseMoved( com.jogamp.newt.event.MouseEvent event ) {
+        public synchronized void mouseMoved( final com.jogamp.newt.event.MouseEvent event ) {
             // Ignored, since mouse MOVE doesn't hold mouse button, we look for DRAGGED!
             // _eventCount++;
             if( _debug ) {
@@ -213,7 +214,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
             // _checkModifiers( event ) ;
         }
 
-        public synchronized void mouseClicked( com.jogamp.newt.event.MouseEvent event ) {
+        public synchronized void mouseClicked( final com.jogamp.newt.event.MouseEvent event ) {
             // Ignored, since we look for PRESS/RELEASE only!
             // _eventCount++;
             if( _debug ) {
@@ -222,7 +223,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
             // _checkModifiers( event ) ;
         }
 
-        public synchronized void mouseWheelMoved( com.jogamp.newt.event.MouseEvent event ) {
+        public synchronized void mouseWheelMoved( final com.jogamp.newt.event.MouseEvent event ) {
             // _eventCount++;
             if( _debug ) {
                 _debugPrintStream.println( "MouseWheeleMoved  ignored: "+event);
@@ -230,7 +231,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
             // _checkModifiers( event ) ;
         }
 
-        public synchronized void mouseEntered( com.jogamp.newt.event.MouseEvent event ) {
+        public synchronized void mouseEntered( final com.jogamp.newt.event.MouseEvent event ) {
             // _eventCount++;
             if( _debug ) {
                 _debugPrintStream.println( "MouseEntered      ignored: "+event);
@@ -238,7 +239,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
             // _checkModifiers( event ) ;
         }
 
-        public synchronized void mouseExited( com.jogamp.newt.event.MouseEvent event ) {
+        public synchronized void mouseExited( final com.jogamp.newt.event.MouseEvent event ) {
             // _eventCount++;
             if( _debug ) {
                 _debugPrintStream.println( "MouseExited       ignored: "+event);
@@ -259,7 +260,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
 
     ////////////////////////////////////////////////////////////////////////////
 
-    public static int getAWTButtonMask(int button) {
+    public static int getAWTButtonMask(final int button) {
         // Java7: java.awt.event.InputEvent.getMaskForButton( n + 1 ) ; -> using InputEvent.BUTTON1_DOWN_MASK .. etc
         // Java6: Only use BUTTON1_MASK, ..
         int m;
@@ -331,10 +332,10 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
     protected void eventDispatch() {
         try {
             Thread.sleep(100);
-        } catch (InterruptedException e) { }
+        } catch (final InterruptedException e) { }
     }
 
-    private void execOffThreadWithOnThreadEventDispatch(Runnable testAction) throws Exception {
+    private void execOffThreadWithOnThreadEventDispatch(final Runnable testAction) throws Exception {
         _testMouseListener.setModifierCheckEnabled( false ) ;
         _robot.setAutoDelay( MS_ROBOT_AUTO_DELAY ) ;
         {
@@ -394,7 +395,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
             public void run() {
                 try {
                     _doSingleButtonPressAndRelease( 0, 0 );
-                } catch (Exception e) { throw new RuntimeException(e); }
+                } catch (final Exception e) { throw new RuntimeException(e); }
             } } );
     }
 
@@ -404,7 +405,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
             public void run() {
                 try {
                     _doSingleButtonPressAndRelease( java.awt.event.KeyEvent.VK_SHIFT, java.awt.event.InputEvent.SHIFT_DOWN_MASK ) ;
-                } catch (Exception e) { throw new RuntimeException(e); }
+                } catch (final Exception e) { throw new RuntimeException(e); }
             } } );
     }
 
@@ -414,7 +415,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
             public void run() {
                 try {
                     _doSingleButtonPressAndRelease( java.awt.event.KeyEvent.VK_CONTROL, java.awt.event.InputEvent.CTRL_DOWN_MASK ) ;
-                } catch (Exception e) { throw new RuntimeException(e); }
+                } catch (final Exception e) { throw new RuntimeException(e); }
             } } );
     }
 
@@ -467,7 +468,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
             public void run() {
                 try {
                     _doHoldOneButtonAndPressAnother( 0, 0 ) ;
-                } catch (Exception e) { throw new RuntimeException(e); }
+                } catch (final Exception e) { throw new RuntimeException(e); }
             } } );
     }
 
@@ -477,7 +478,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
             public void run() {
                 try {
                     _doPressAllButtonsInSequence( 0, 0 ) ;
-                } catch (Exception e) { throw new RuntimeException(e); }
+                } catch (final Exception e) { throw new RuntimeException(e); }
             } } );
     }
 
@@ -487,7 +488,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
             public void run() {
                 try {
                     _doSingleButtonClickAndDrag( 0, 0 ) ;
-                } catch (Exception e) { throw new RuntimeException(e); }
+                } catch (final Exception e) { throw new RuntimeException(e); }
             } } );
     }
 
@@ -501,7 +502,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
 
         for (int n = 0 ; n < _numButtonsToTest ; ++n) {
 
-            int awtButtonMask = _awtButtonMasks[n] ;
+            final int awtButtonMask = _awtButtonMasks[n] ;
 
             if( _debug ) { _debugPrintStream.println( "*** pressing button " + ( n + 1 ) ) ; }
             _testMouseListener.setExpectedModifiers( _getNewtModifiersForAwtExtendedModifiers( keyModifierMask | awtButtonMask ) ) ;
@@ -527,7 +528,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
 
         for (int n = 0 ; n < _numButtonsToTest ; ++n) {
 
-            int awtButtonMask = _awtButtonMasks[n] ;
+            final int awtButtonMask = _awtButtonMasks[n] ;
 
             if( _debug ) { _debugPrintStream.println( "*** pressing button " + ( n + 1 ) ) ; }
             _testMouseListener.setExpectedModifiers( _getNewtModifiersForAwtExtendedModifiers( keyModifierMask | awtButtonMask ) ) ;
@@ -606,7 +607,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
 
         for (int n = 0 ; n < _numButtonsToTest ; ++n) {
 
-            int awtButtonMask = _awtButtonMasks[n] ;
+            final int awtButtonMask = _awtButtonMasks[n] ;
 
             if( _debug ) { _debugPrintStream.println( "*** pressing button " + ( n + 1 ) ) ; }
             _testMouseListener.setExpectedModifiers( _getNewtModifiersForAwtExtendedModifiers( keyModifierMask | awtButtonMask ) ) ;
@@ -636,10 +637,10 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
 
     ////////////////////////////////////////////////////////////////////////////
 
-    private void _doKeyPress( int keyCode ) {
+    private void _doKeyPress( final int keyCode ) {
         AWTRobotUtil.validateAWTEDTIsAlive();
         if( keyCode != 0 ) {
-            boolean modifierCheckEnabled = _testMouseListener.modifierCheckEnabled() ;
+            final boolean modifierCheckEnabled = _testMouseListener.modifierCheckEnabled() ;
             _testMouseListener.setModifierCheckEnabled( false ) ;
             _robot.keyPress( keyCode ) ;
             _robot.delay(MS_ROBOT_KEY_PRESS_DELAY);
@@ -649,10 +650,10 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
 
     ////////////////////////////////////////////////////////////////////////////
 
-    private void _doKeyRelease( int keyCode ) {
+    private void _doKeyRelease( final int keyCode ) {
         AWTRobotUtil.validateAWTEDTIsAlive();
         if( keyCode != 0 ) {
-            boolean modifierCheckEnabled = _testMouseListener.modifierCheckEnabled() ;
+            final boolean modifierCheckEnabled = _testMouseListener.modifierCheckEnabled() ;
             _testMouseListener.setModifierCheckEnabled( false ) ;
             _robot.keyRelease( keyCode ) ;
             _robot.delay(MS_ROBOT_KEY_RELEASE_DELAY);
@@ -662,11 +663,11 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
 
     ////////////////////////////////////////////////////////////////////////////
 
-    private void _checkFailures(String descr, int waitEventCount) {
-        ArrayList<String> failures = _testMouseListener.getFailures(waitEventCount) ;
+    private void _checkFailures(final String descr, final int waitEventCount) {
+        final ArrayList<String> failures = _testMouseListener.getFailures(waitEventCount) ;
 
         _debugPrintStream.print(getSimpleTestName(".")+" - "+descr+": ");
-        int numFailures = failures.size() ;
+        final int numFailures = failures.size() ;
         if( numFailures == 0 ) {
             _debugPrintStream.println( " PASSED" ) ;
         } else {
@@ -706,7 +707,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
 
             _robot.setAutoDelay( MS_ROBOT_AUTO_DELAY ) ;
 
-            boolean modifierCheckEnabled = _testMouseListener.modifierCheckEnabled() ;
+            final boolean modifierCheckEnabled = _testMouseListener.modifierCheckEnabled() ;
             _testMouseListener.setModifierCheckEnabled( false ) ;
 
             {
@@ -746,7 +747,7 @@ public abstract class BaseNewtEventModifiers extends UITestCase {
      * The equivalent NEWT modifiers.
      */
 
-    private int _getNewtModifiersForAwtExtendedModifiers( int awtExtendedModifiers ) {
+    private int _getNewtModifiersForAwtExtendedModifiers( final int awtExtendedModifiers ) {
 
         int mask = 0 ;
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersAWTCanvas.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersAWTCanvas.java
index f1906f5..194edbc 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersAWTCanvas.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersAWTCanvas.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.event;
 
 import javax.media.opengl.awt.GLCanvas ;
@@ -61,7 +61,7 @@ public class TestNewtEventModifiersAWTCanvas extends BaseNewtEventModifiers {
 
         final GLCanvas canvas = new GLCanvas() ;
         canvas.addGLEventListener( new RedSquareES2() ) ;
-        new AWTMouseAdapter( _testMouseListener ).addTo( (java.awt.Component)canvas ) ;
+        new AWTMouseAdapter( _testMouseListener, canvas ).addTo( canvas ) ;
 
         _testFrame = new JFrame( "Event Modifier Test AWTCanvas" ) ;
         _testFrame.setDefaultCloseOperation( WindowConstants.EXIT_ON_CLOSE ) ;
@@ -73,10 +73,10 @@ public class TestNewtEventModifiersAWTCanvas extends BaseNewtEventModifiers {
                 _testFrame.setVisible( true ) ;
             }
         }) ;
-        Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(_testFrame, true));        
+        Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(_testFrame, true));
         Assert.assertTrue(AWTRobotUtil.waitForVisible(canvas, true));
         Assert.assertTrue(AWTRobotUtil.waitForRealized(canvas, true));
-        
+
         AWTRobotUtil.assertRequestFocusAndWait(null, canvas, canvas, null, null);  // programmatic
         Assert.assertNotNull(_robot);
         AWTRobotUtil.requestFocus(_robot, canvas, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
@@ -97,8 +97,8 @@ public class TestNewtEventModifiersAWTCanvas extends BaseNewtEventModifiers {
 
     ////////////////////////////////////////////////////////////////////////////
 
-    public static void main(String args[]) throws Exception {
-        String testName = TestNewtEventModifiersAWTCanvas.class.getName() ;
+    public static void main(final String args[]) throws Exception {
+        final String testName = TestNewtEventModifiersAWTCanvas.class.getName() ;
         org.junit.runner.JUnitCore.main( testName ) ;
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNEWTWindowAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNEWTWindowAWT.java
index c4bd3eb..d34c360 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNEWTWindowAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNEWTWindowAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.event;
 
 import javax.media.opengl.GLCapabilities;
@@ -60,10 +60,10 @@ public class TestNewtEventModifiersNEWTWindowAWT extends BaseNewtEventModifiers
         _glWindow.setSize(TEST_FRAME_WIDTH, TEST_FRAME_HEIGHT);
         _glWindow.setPosition(TEST_FRAME_X, TEST_FRAME_Y);
         _glWindow.setVisible(true);
-        
+
         Assert.assertTrue(AWTRobotUtil.waitForVisible(_glWindow, true));
         Assert.assertTrue(AWTRobotUtil.waitForRealized(_glWindow, true));
-        
+
         AWTRobotUtil.assertRequestFocusAndWait(null, _glWindow, _glWindow, null, null);  // programmatic
         Assert.assertNotNull(_robot);
         AWTRobotUtil.requestFocus(_robot, _glWindow, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
@@ -78,8 +78,8 @@ public class TestNewtEventModifiersNEWTWindowAWT extends BaseNewtEventModifiers
 
     ////////////////////////////////////////////////////////////////////////////
 
-    public static void main(String args[]) throws Exception {
-        String testName = TestNewtEventModifiersNEWTWindowAWT.class.getName() ;
+    public static void main(final String args[]) throws Exception {
+        final String testName = TestNewtEventModifiersNEWTWindowAWT.class.getName() ;
         org.junit.runner.JUnitCore.main( testName ) ;
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasAWT.java
index 0abadb0..c916ddc 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.event ;
 
 import java.awt.BorderLayout ;
@@ -70,27 +70,27 @@ public class TestNewtEventModifiersNewtCanvasAWT extends BaseNewtEventModifiers
                 _testFrame.setDefaultCloseOperation( WindowConstants.EXIT_ON_CLOSE ) ;
 
                 {
-                    GLCapabilities caps = new GLCapabilities( GLProfile.getGL2ES2() ) ;
+                    final GLCapabilities caps = new GLCapabilities( GLProfile.getGL2ES2() ) ;
                     _glWindow = GLWindow.create( caps ) ;
 
-                    NewtCanvasAWT canvas = new NewtCanvasAWT( _glWindow ) ;
+                    final NewtCanvasAWT canvas = new NewtCanvasAWT( _glWindow ) ;
                     _testFrame.getContentPane().add( canvas, BorderLayout.CENTER ) ;
 
                     _glWindow.addGLEventListener( new RedSquareES2() ) ;
                 }
 
                 _testFrame.setBounds( TEST_FRAME_X, TEST_FRAME_Y, TEST_FRAME_WIDTH, TEST_FRAME_HEIGHT ) ;
-                _testFrame.setVisible( true ) ;                
+                _testFrame.setVisible( true ) ;
             }
         } ) ;
         Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(_testFrame, true));
         Assert.assertTrue(AWTRobotUtil.waitForVisible(_glWindow, true));
-        Assert.assertTrue(AWTRobotUtil.waitForRealized(_glWindow, true));        
-        
+        Assert.assertTrue(AWTRobotUtil.waitForRealized(_glWindow, true));
+
         AWTRobotUtil.assertRequestFocusAndWait(null, _glWindow, _glWindow, null, null);  // programmatic
         Assert.assertNotNull(_robot);
         AWTRobotUtil.requestFocus(_robot, _glWindow, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
-        
+
         _glWindow.addMouseListener( _testMouseListener ) ;
     }
 
@@ -111,8 +111,8 @@ public class TestNewtEventModifiersNewtCanvasAWT extends BaseNewtEventModifiers
 
     ////////////////////////////////////////////////////////////////////////////
 
-    public static void main(String args[]) throws Exception {
-        String testName = TestNewtEventModifiersNewtCanvasAWT.class.getName() ;
+    public static void main(final String args[]) throws Exception {
+        final String testName = TestNewtEventModifiersNewtCanvasAWT.class.getName() ;
         org.junit.runner.JUnitCore.main( testName ) ;
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasSWTAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasSWTAWT.java
index 2a6b8ba..3e4029c 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasSWTAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtEventModifiersNewtCanvasSWTAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.event;
 
 import org.eclipse.swt.SWT ;
@@ -63,12 +63,12 @@ public class TestNewtEventModifiersNewtCanvasSWTAWT extends BaseNewtEventModifie
     private static GLWindow _glWindow ;
 
     ////////////////////////////////////////////////////////////////////////////
-    
+
     protected static void eventDispatchImpl() {
         final int maxEvents = 10;
         try {
             Thread.sleep(100);
-        } catch (InterruptedException e) { }
+        } catch (final InterruptedException e) { }
         final boolean[] res = { false };
         int i=0;
         do {
@@ -83,29 +83,29 @@ public class TestNewtEventModifiersNewtCanvasSWTAWT extends BaseNewtEventModifie
             i++;
         } while( i<maxEvents && res[0] );
     }
-    
+
     @Override
     protected void eventDispatch() {
         eventDispatchImpl();
     }
-    
+
     ////////////////////////////////////////////////////////////////////////////
 
     @BeforeClass
     public static void beforeClass() throws Exception {
 
-        // FIXME: Hangs .. w/ Java7 .. every now and then! 
+        // FIXME: Hangs .. w/ Java7 .. every now and then!
         setTestSupported(false);
-        
+
         /***
         SWTAccessor.invoke(true, new Runnable() {
-            public void run() {  
+            public void run() {
                 _display = new Display();
             }});
         Assert.assertNotNull( _display );
-        
+
         SWTAccessor.invoke(_display, true, new Runnable() {
-            public void run() {        
+            public void run() {
                 _shell = new Shell( _display );
                 Assert.assertNotNull( _shell );
                 _shell.setText( "Event Modifier Test NewtCanvasSWT" ) ;
@@ -122,24 +122,24 @@ public class TestNewtEventModifiersNewtCanvasSWTAWT extends BaseNewtEventModifie
 
             NewtCanvasSWT.create( _composite, SWT.NO_BACKGROUND, _glWindow ) ;
         }
-        
+
         SWTAccessor.invoke(_display, true, new Runnable() {
            public void run() {
               _shell.setBounds( TEST_FRAME_X, TEST_FRAME_Y, TEST_FRAME_WIDTH, TEST_FRAME_HEIGHT ) ;
               _shell.open();
            }
         });
-        
+
         // no AWT idling, may deadlock on OSX!
         Assert.assertNotNull(_robot);
         _robot.setAutoWaitForIdle( false ) ;
-        
+
         // no waiting for results ..
         AWTRobotUtil.requestFocus(null, _glWindow, false); // programmatic
         eventDispatchImpl();
         AWTRobotUtil.requestFocus(_robot, _glWindow, INITIAL_MOUSE_X, INITIAL_MOUSE_Y);
         eventDispatchImpl();
-        
+
         _glWindow.addMouseListener( _testMouseListener ) ;
         */
     }
@@ -153,7 +153,7 @@ public class TestNewtEventModifiersNewtCanvasSWTAWT extends BaseNewtEventModifie
 
         try {
             SWTAccessor.invoke(_display, true, new Runnable() {
-                public void run() { 
+                public void run() {
                     if( null != _composite ) {
                         _composite.dispose();
                     }
@@ -173,8 +173,8 @@ public class TestNewtEventModifiersNewtCanvasSWTAWT extends BaseNewtEventModifie
 
     ////////////////////////////////////////////////////////////////////////////
 
-    public static void main(String args[]) throws Exception {
-        String testName = TestNewtEventModifiersNewtCanvasSWTAWT.class.getName() ;
+    public static void main(final String args[]) throws Exception {
+        final String testName = TestNewtEventModifiersNewtCanvasSWTAWT.class.getName() ;
         org.junit.runner.JUnitCore.main( testName ) ;
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodeModifiersAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodeModifiersAWT.java
index 2516fc5..eebbe54 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodeModifiersAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodeModifiersAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.event;
 
 import org.junit.After;
@@ -65,7 +65,7 @@ import com.jogamp.opengl.test.junit.util.*;
 
 /**
  * Testing combinations of key code modifiers of key event.
- * 
+ *
  * <p>
  * Due to limitation of AWT Robot, the test machine needs to have US keyboard enabled,
  * even though we do unify VK codes to US keyboard across all layouts.
@@ -89,35 +89,35 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
     @AfterClass
     public static void release() {
     }
-    
+
     @Before
-    public void initTest() {        
+    public void initTest() {
     }
 
     @After
-    public void releaseTest() {        
+    public void releaseTest() {
     }
-    
+
     @Test(timeout=180000) // TO 3 min
     public void test01NEWT() throws AWTException, InterruptedException, InvocationTargetException {
-        GLWindow glWindow = GLWindow.create(glCaps);
+        final GLWindow glWindow = GLWindow.create(glCaps);
         glWindow.setSize(width, height);
         glWindow.setVisible(true);
-        
+
         testImpl(glWindow);
-        
+
         glWindow.destroy();
     }
-        
-    private void testNewtCanvasAWT_Impl(boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
-        GLWindow glWindow = GLWindow.create(glCaps);
-        
+
+    private void testNewtCanvasAWT_Impl(final boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
+        final GLWindow glWindow = GLWindow.create(glCaps);
+
         // Wrap the window in a canvas.
         final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
         if( !onscreen ) {
             newtCanvasAWT.setShallUseOffscreenLayer(true);
         }
-        
+
         // Add the canvas to a frame, and make it all visible.
         final JFrame frame1 = new JFrame("Swing AWT Parent Frame: "+ glWindow.getTitle());
         frame1.getContentPane().add(newtCanvasAWT, BorderLayout.CENTER);
@@ -126,24 +126,24 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
             public void run() {
                 frame1.setVisible(true);
             } } );
-        
+
         Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame1, true));
-        
+
         testImpl(glWindow);
-        
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame1.setVisible(false);
                     frame1.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }        
-        glWindow.destroy();        
+        }
+        glWindow.destroy();
     }
-    
+
     @Test(timeout=180000) // TO 3 min
     public void test02NewtCanvasAWT_Onscreen() throws AWTException, InterruptedException, InvocationTargetException {
         if( JAWTUtil.isOffscreenLayerRequired() ) {
@@ -152,7 +152,7 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
         }
         testNewtCanvasAWT_Impl(true);
     }
-        
+
     @Test(timeout=180000) // TO 3 min
     public void test03NewtCanvasAWT_Offsccreen() throws AWTException, InterruptedException, InvocationTargetException {
         if( !JAWTUtil.isOffscreenLayerSupported() ) {
@@ -161,9 +161,9 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
         }
         testNewtCanvasAWT_Impl(false);
     }
-        
-    static void testKeyCodeModifier(Robot robot, NEWTKeyAdapter keyAdapter, short modifierKey, int modifierMask, short keyCode, 
-                                    char keyCharOnly, char keyCharMod) {        
+
+    static void testKeyCodeModifier(final Robot robot, final NEWTKeyAdapter keyAdapter, final short modifierKey, final int modifierMask, final short keyCode,
+                                    final char keyCharOnly, final char keyCharMod) {
         keyAdapter.reset();
         AWTRobotUtil.waitForIdle(robot);
         AWTRobotUtil.newtKeyPress(0, robot, true, keyCode, 10);   // press keyCode
@@ -172,107 +172,107 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
         for(int j=0; j < 100 && keyAdapter.getQueueSize() < 2; j++) { // wait until events are collected
             robot.delay(100);
         }
-        
+
         AWTRobotUtil.waitForIdle(robot);
         AWTRobotUtil.newtKeyPress(0, robot, true, modifierKey, 10);     // press MOD
         AWTRobotUtil.newtKeyPress(0, robot, true, keyCode, 10);   // press keyCode
-        AWTRobotUtil.newtKeyPress(0, robot, false, keyCode, 10);  // release keyCode 
+        AWTRobotUtil.newtKeyPress(0, robot, false, keyCode, 10);  // release keyCode
         AWTRobotUtil.newtKeyPress(0, robot, false, modifierKey, 100);   // release MOD
         AWTRobotUtil.waitForIdle(robot);
         for(int j=0; j < 100 && keyAdapter.getQueueSize() < 2+4; j++) { // wait until events are collected
             robot.delay(100);
         }
         NEWTKeyUtil.validateKeyAdapterStats(keyAdapter,
-                                            3 /* press-SI */, 3 /* release-SI */, 
+                                            3 /* press-SI */, 3 /* release-SI */,
                                             0 /* press-AR */, 0 /* release-AR */ );
-        
+
         final List<EventObject> queue = keyAdapter.copyQueue();
         int i=0;
         NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED, 0, keyCode, keyCharOnly);
         NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_RELEASED, 0, keyCode, keyCharOnly);
-        
+
         NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED, modifierMask, modifierKey, KeyEvent.NULL_CHAR);
         NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED, modifierMask, keyCode, keyCharMod);
         NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_RELEASED, modifierMask, keyCode, keyCharMod);
-        KeyEvent e = (KeyEvent) queue.get(i++);
+        final KeyEvent e = (KeyEvent) queue.get(i++);
         NEWTKeyUtil.validateKeyEvent(e, KeyEvent.EVENT_KEY_RELEASED, modifierMask, modifierKey, KeyEvent.NULL_CHAR);
     }
-    
-    static void testKeyCodeAllModifierV1(Robot robot, NEWTKeyAdapter keyAdapter) {
+
+    static void testKeyCodeAllModifierV1(final Robot robot, final NEWTKeyAdapter keyAdapter) {
         final short m1k = KeyEvent.VK_ALT;
         final int   m1m = InputEvent.ALT_MASK;
         final short m2k = KeyEvent.VK_CONTROL;
         final int   m2m = InputEvent.CTRL_MASK;
         final short m3k = KeyEvent.VK_SHIFT;
         final int   m3m = InputEvent.SHIFT_MASK;
-        
+
         keyAdapter.reset();
         AWTRobotUtil.waitForIdle(robot);
         AWTRobotUtil.newtKeyPress(0, robot, true, m1k, 10);     // press MOD1
         AWTRobotUtil.newtKeyPress(0, robot, true, m2k, 10);     // press MOD2
         AWTRobotUtil.newtKeyPress(0, robot, true, m3k, 10);     // press MOD3
         AWTRobotUtil.newtKeyPress(0, robot, true, KeyEvent.VK_1, 10);   // press P
-        
-        AWTRobotUtil.newtKeyPress(0, robot, false, KeyEvent.VK_1, 100);  // release P        
+
+        AWTRobotUtil.newtKeyPress(0, robot, false, KeyEvent.VK_1, 100);  // release P
         AWTRobotUtil.newtKeyPress(0, robot, false, m3k, 10);   // release MOD
         AWTRobotUtil.newtKeyPress(0, robot, false, m2k, 10);   // release MOD
-        AWTRobotUtil.newtKeyPress(0, robot, false, m1k, 10);   // release MOD        
+        AWTRobotUtil.newtKeyPress(0, robot, false, m1k, 10);   // release MOD
         AWTRobotUtil.waitForIdle(robot);
-        
+
         for(int j=0; j < 100 && keyAdapter.getQueueSize() < 4+4; j++) { // wait until events are collected
             robot.delay(100);
         }
-        NEWTKeyUtil.validateKeyAdapterStats(keyAdapter, 
-                                            4 /* press-SI */, 4 /* release-SI */, 
+        NEWTKeyUtil.validateKeyAdapterStats(keyAdapter,
+                                            4 /* press-SI */, 4 /* release-SI */,
                                             0 /* press-AR */, 0 /* release-AR */ );
-        
-        final List<EventObject> queue = keyAdapter.copyQueue();        
+
+        final List<EventObject> queue = keyAdapter.copyQueue();
         int i=0;
         NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED,  m1m,         m1k, KeyEvent.NULL_CHAR);
         NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED,  m1m|m2m,     m2k, KeyEvent.NULL_CHAR);
         NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED,  m1m|m2m|m3m, m3k, KeyEvent.NULL_CHAR);
-        
+
         NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_PRESSED,  m1m|m2m|m3m, KeyEvent.VK_1, KeyEvent.NULL_CHAR);
         NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_RELEASED, m1m|m2m|m3m, KeyEvent.VK_1, KeyEvent.NULL_CHAR);
-        KeyEvent e = (KeyEvent) queue.get(i++);
+        final KeyEvent e = (KeyEvent) queue.get(i++);
         NEWTKeyUtil.validateKeyEvent(e, KeyEvent.EVENT_KEY_RELEASED, m1m|m2m|m3m, m3k, KeyEvent.NULL_CHAR);
         NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_RELEASED, m1m|m2m,     m2k, KeyEvent.NULL_CHAR);
         NEWTKeyUtil.validateKeyEvent((KeyEvent) queue.get(i++), KeyEvent.EVENT_KEY_RELEASED, m1m,         m1k, KeyEvent.NULL_CHAR);
     }
-    
-    void testImpl(GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
+
+    void testImpl(final GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
         final Robot robot = new Robot();
         robot.setAutoWaitForIdle(true);
 
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         glWindow.addGLEventListener(demo1);
 
         // NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
         // glWindow.addWindowListener(glWindow1FA);
-        NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+        final NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
         glWindow1KA.setVerbose(false);
         glWindow.addKeyListener(glWindow1KA);
 
-        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow, true));        
+        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow, true));
 
         // Continuous animation ..
-        Animator animator = new Animator(glWindow);
+        final Animator animator = new Animator(glWindow);
         animator.start();
 
         Thread.sleep(durationPerTest); // manual testing
-        
+
         AWTRobotUtil.assertRequestFocusAndWait(null, glWindow, glWindow, null, null);  // programmatic
         AWTRobotUtil.requestFocus(robot, glWindow, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
-        glWindow1KA.reset();        
+        glWindow1KA.reset();
 
         testKeyCodeModifier(robot, glWindow1KA, KeyEvent.VK_SHIFT, InputEvent.SHIFT_MASK, KeyEvent.VK_1, '1', '!');
         testKeyCodeModifier(robot, glWindow1KA, KeyEvent.VK_SHIFT, InputEvent.SHIFT_MASK, KeyEvent.VK_Y, 'y', 'Y'); // US: Y, DE: Z
         testKeyCodeModifier(robot, glWindow1KA, KeyEvent.VK_SHIFT, InputEvent.SHIFT_MASK, KeyEvent.VK_P, 'p', 'P');
         testKeyCodeModifier(robot, glWindow1KA, KeyEvent.VK_CONTROL, InputEvent.CTRL_MASK, KeyEvent.VK_1, '1', KeyEvent.NULL_CHAR);
         testKeyCodeModifier(robot, glWindow1KA, KeyEvent.VK_ALT, InputEvent.ALT_MASK, KeyEvent.VK_1, '1', KeyEvent.NULL_CHAR);
-        
+
         testKeyCodeAllModifierV1(robot, glWindow1KA);
-        
+
         // Remove listeners to avoid logging during dispose/destroy.
         glWindow.removeKeyListener(glWindow1KA);
 
@@ -280,15 +280,15 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
         animator.stop();
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
@@ -297,10 +297,10 @@ public class TestNewtKeyCodeModifiersAWT extends UITestCase {
         /**
         BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         System.err.println("Press enter to continue");
-        System.err.println(stdin.readLine()); 
+        System.err.println(stdin.readLine());
         */
         System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestNewtKeyCodeModifiersAWT.class.getName();
+        final String tstname = TestNewtKeyCodeModifiersAWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java
index 71778c6..eecc35e 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyCodesAWT.java
@@ -95,7 +95,7 @@ public class TestNewtKeyCodesAWT extends UITestCase {
 
     @Test(timeout=180000) // TO 3 min
     public void test01NEWT() throws AWTException, InterruptedException, InvocationTargetException {
-        GLWindow glWindow = GLWindow.create(glCaps);
+        final GLWindow glWindow = GLWindow.create(glCaps);
         glWindow.setSize(width, height);
         glWindow.setVisible(true);
 
@@ -104,8 +104,8 @@ public class TestNewtKeyCodesAWT extends UITestCase {
         glWindow.destroy();
     }
 
-    private void testNewtCanvasAWT_Impl(boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
-        GLWindow glWindow = GLWindow.create(glCaps);
+    private void testNewtCanvasAWT_Impl(final boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
+        final GLWindow glWindow = GLWindow.create(glCaps);
 
         // Wrap the window in a canvas.
         final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
@@ -132,7 +132,7 @@ public class TestNewtKeyCodesAWT extends UITestCase {
                     frame1.setVisible(false);
                     frame1.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -188,7 +188,7 @@ public class TestNewtKeyCodesAWT extends UITestCase {
       // new CodeSeg(KeyEvent.VK_WINDOWS, KeyEvent.VK_HELP, "windows, meta, hlp"),
     };
 
-    static void testKeyCodes(Robot robot, Object obj, NEWTKeyAdapter keyAdapter) throws InterruptedException, InvocationTargetException {
+    static void testKeyCodes(final Robot robot, final Object obj, final NEWTKeyAdapter keyAdapter) throws InterruptedException, InvocationTargetException {
         final List<List<EventObject>> cse = new ArrayList<List<EventObject>>();
 
         keyAdapter.setVerbose(true); // FIXME
@@ -204,14 +204,14 @@ public class TestNewtKeyCodesAWT extends UITestCase {
                 // System.err.println("*** KeyCode 0x"+Integer.toHexString(c));
                 try {
                     AWTRobotUtil.newtKeyPress(0, robot, true, c, 10);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     System.err.println("Exception @ AWT Robot.PRESS "+MiscUtils.toHexString(c)+" - "+e.getMessage());
                     break;
                 }
                 eventCount++;
                 try {
                     AWTRobotUtil.newtKeyPress(0, robot, false, c, 100);
-                } catch (Exception e) {
+                } catch (final Exception e) {
                     System.err.println("Exception @ AWT Robot.RELEASE "+MiscUtils.toHexString(c)+" - "+e.getMessage());
                     break;
                 }
@@ -230,23 +230,23 @@ public class TestNewtKeyCodesAWT extends UITestCase {
         Assert.assertEquals("KeyCode impl. incomplete", true, NEWTKeyUtil.validateKeyCodes(codeSegments, cse, true));
     }
 
-    void testImpl(GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
+    void testImpl(final GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
         final Robot robot = new Robot();
         robot.setAutoWaitForIdle(true);
 
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         glWindow.addGLEventListener(demo1);
 
         // NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
         // glWindow.addWindowListener(glWindow1FA);
-        NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+        final NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
         glWindow1KA.setVerbose(false);
         glWindow.addKeyListener(glWindow1KA);
 
         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow, true));
 
         // Continuous animation ..
-        Animator animator = new Animator(glWindow);
+        final Animator animator = new Animator(glWindow);
         animator.start();
 
         Thread.sleep(durationPerTest); // manual testing
@@ -264,15 +264,15 @@ public class TestNewtKeyCodesAWT extends UITestCase {
         animator.stop();
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
@@ -284,7 +284,7 @@ public class TestNewtKeyCodesAWT extends UITestCase {
         System.err.println(stdin.readLine());
         */
         System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestNewtKeyCodesAWT.class.getName();
+        final String tstname = TestNewtKeyCodesAWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java
index c374f1e..5e78d90 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventAutoRepeatAWT.java
@@ -112,7 +112,7 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
 
     @Test(timeout=180000) // TO 3 min
     public void test01NEWT() throws AWTException, InterruptedException, InvocationTargetException {
-        GLWindow glWindow = GLWindow.create(glCaps);
+        final GLWindow glWindow = GLWindow.create(glCaps);
         glWindow.setSize(width, height);
         glWindow.setVisible(true);
 
@@ -123,7 +123,7 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
 
     @Test(timeout=180000) // TO 3 min
     public void test02NewtCanvasAWT() throws AWTException, InterruptedException, InvocationTargetException {
-        GLWindow glWindow = GLWindow.create(glCaps);
+        final GLWindow glWindow = GLWindow.create(glCaps);
 
         // Wrap the window in a canvas.
         final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
@@ -147,17 +147,17 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
                     frame1.setVisible(false);
                     frame1.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
         glWindow.destroy();
     }
 
-    static void testKeyEventAutoRepeat(Robot robot, NEWTKeyAdapter keyAdapter, int loops, int pressDurationMS) {
+    static void testKeyEventAutoRepeat(final Robot robot, final NEWTKeyAdapter keyAdapter, final int loops, final int pressDurationMS) {
         System.err.println("KEY Event Auto-Repeat Test: "+loops);
-        EventObject[][] first = new EventObject[loops][2];
-        EventObject[][] last = new EventObject[loops][2];
+        final EventObject[][] first = new EventObject[loops][2];
+        final EventObject[][] last = new EventObject[loops][2];
 
         keyAdapter.reset();
         int firstIdx = 0;
@@ -250,21 +250,21 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
         }
     }
 
-    void testImpl(GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
+    void testImpl(final GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
         final Robot robot = new Robot();
         robot.setAutoWaitForIdle(true);
 
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         glWindow.addGLEventListener(demo1);
 
-        NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+        final NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
         glWindow1KA.setVerbose(false);
         glWindow.addKeyListener(glWindow1KA);
 
         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow, true));
 
         // Continuous animation ..
-        Animator animator = new Animator(glWindow);
+        final Animator animator = new Animator(glWindow);
         animator.start();
 
         Thread.sleep(durationPerTest); // manual testing
@@ -291,15 +291,15 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
         animator.stop();
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
@@ -311,7 +311,7 @@ public class TestNewtKeyEventAutoRepeatAWT extends UITestCase {
         System.err.println(stdin.readLine());
         */
         System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestNewtKeyEventAutoRepeatAWT.class.getName();
+        final String tstname = TestNewtKeyEventAutoRepeatAWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventOrderAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventOrderAWT.java
index 8cc4275..3f86c18 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventOrderAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyEventOrderAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.event;
 
 import org.junit.After;
@@ -61,7 +61,7 @@ import com.jogamp.opengl.test.junit.util.*;
 
 /**
  * Testing key event order excl. auto-repeat (Bug 601)
- * 
+ *
  * <p>
  * Note Event order:
  * <ol>
@@ -88,35 +88,35 @@ public class TestNewtKeyEventOrderAWT extends UITestCase {
     @AfterClass
     public static void release() {
     }
-    
+
     @Before
-    public void initTest() {        
+    public void initTest() {
     }
 
     @After
-    public void releaseTest() {        
+    public void releaseTest() {
     }
-    
+
     @Test(timeout=180000) // TO 3 min
     public void test01NEWT() throws AWTException, InterruptedException, InvocationTargetException {
-        GLWindow glWindow = GLWindow.create(glCaps);
+        final GLWindow glWindow = GLWindow.create(glCaps);
         glWindow.setSize(width, height);
         glWindow.setVisible(true);
-        
+
         testImpl(glWindow);
-        
+
         glWindow.destroy();
     }
-        
-    private void testNewtCanvasAWT_Impl(boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
-        GLWindow glWindow = GLWindow.create(glCaps);
-        
+
+    private void testNewtCanvasAWT_Impl(final boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
+        final GLWindow glWindow = GLWindow.create(glCaps);
+
         // Wrap the window in a canvas.
         final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
         if( !onscreen ) {
             newtCanvasAWT.setShallUseOffscreenLayer(true);
         }
-        
+
         // Add the canvas to a frame, and make it all visible.
         final JFrame frame1 = new JFrame("Swing AWT Parent Frame: "+ glWindow.getTitle());
         frame1.getContentPane().add(newtCanvasAWT, BorderLayout.CENTER);
@@ -125,24 +125,24 @@ public class TestNewtKeyEventOrderAWT extends UITestCase {
             public void run() {
                 frame1.setVisible(true);
             } } );
-        
+
         Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame1, true));
-        
+
         testImpl(glWindow);
-        
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame1.setVisible(false);
                     frame1.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }        
+        }
         glWindow.destroy();
     }
-    
+
     @Test(timeout=180000) // TO 3 min
     public void test02NewtCanvasAWT_Onscreen() throws AWTException, InterruptedException, InvocationTargetException {
         if( JAWTUtil.isOffscreenLayerRequired() ) {
@@ -151,7 +151,7 @@ public class TestNewtKeyEventOrderAWT extends UITestCase {
         }
         testNewtCanvasAWT_Impl(true);
     }
-        
+
     @Test(timeout=180000) // TO 3 min
     public void test03NewtCanvasAWT_Offsccreen() throws AWTException, InterruptedException, InvocationTargetException {
         if( !JAWTUtil.isOffscreenLayerSupported() ) {
@@ -160,8 +160,8 @@ public class TestNewtKeyEventOrderAWT extends UITestCase {
         }
         testNewtCanvasAWT_Impl(false);
     }
-    
-    static void testKeyEventOrder(Robot robot, NEWTKeyAdapter keyAdapter, int loops) {
+
+    static void testKeyEventOrder(final Robot robot, final NEWTKeyAdapter keyAdapter, final int loops) {
         System.err.println("KEY Event Order Test: "+loops);
         keyAdapter.reset();
         for(int i=0; i<loops; i++) {
@@ -189,44 +189,44 @@ public class TestNewtKeyEventOrderAWT extends UITestCase {
         AWTRobotUtil.waitForIdle(robot);
         robot.delay(250);
         // dumpKeyEvents(keyAdapter.getQueued());
-        
+
         NEWTKeyUtil.validateKeyEventOrder(keyAdapter.copyQueue());
-        
+
         final int expTotal = 6*loops; // all typed events
-        NEWTKeyUtil.validateKeyAdapterStats(keyAdapter, 
-                                            expTotal /* press-SI */, expTotal /* release-SI */, 
+        NEWTKeyUtil.validateKeyAdapterStats(keyAdapter,
+                                            expTotal /* press-SI */, expTotal /* release-SI */,
                                             0 /* press-AR */, 0 /* release-AR */ );
-        
+
     }
-        
-    void testImpl(GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
+
+    void testImpl(final GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
         final Robot robot = new Robot();
         robot.setAutoWaitForIdle(true);
 
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         glWindow.addGLEventListener(demo1);
 
-        NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+        final NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
         glWindow1KA.setVerbose(false);
         glWindow.addKeyListener(glWindow1KA);
 
-        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow, true));        
+        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow, true));
 
         // Continuous animation ..
-        Animator animator = new Animator(glWindow);
+        final Animator animator = new Animator(glWindow);
         animator.start();
 
         Thread.sleep(durationPerTest); // manual testing
-        
+
         AWTRobotUtil.assertRequestFocusAndWait(null, glWindow, glWindow, null, null);  // programmatic
         AWTRobotUtil.requestFocus(robot, glWindow, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
         glWindow1KA.reset();
 
-        // 
+        //
         // Test the key event order w/o auto-repeat
         //
         testKeyEventOrder(robot, glWindow1KA, 6);
-        
+
         // Remove listeners to avoid logging during dispose/destroy.
         glWindow.removeKeyListener(glWindow1KA);
 
@@ -234,15 +234,15 @@ public class TestNewtKeyEventOrderAWT extends UITestCase {
         animator.stop();
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
@@ -251,10 +251,10 @@ public class TestNewtKeyEventOrderAWT extends UITestCase {
         /**
         BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         System.err.println("Press enter to continue");
-        System.err.println(stdin.readLine()); 
+        System.err.println(stdin.readLine());
         */
         System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestNewtKeyEventOrderAWT.class.getName();
+        final String tstname = TestNewtKeyEventOrderAWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyPressReleaseUnmaskRepeatAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyPressReleaseUnmaskRepeatAWT.java
index f48a07a..faf2399 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyPressReleaseUnmaskRepeatAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestNewtKeyPressReleaseUnmaskRepeatAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.event;
 
 import org.junit.After;
@@ -83,35 +83,35 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
     @AfterClass
     public static void release() {
     }
-    
+
     @Before
-    public void initTest() {        
+    public void initTest() {
     }
 
     @After
-    public void releaseTest() {        
+    public void releaseTest() {
     }
-    
+
     @Test(timeout=180000) // TO 3 min
     public void test01NEWT() throws AWTException, InterruptedException, InvocationTargetException {
-        GLWindow glWindow = GLWindow.create(glCaps);
+        final GLWindow glWindow = GLWindow.create(glCaps);
         glWindow.setSize(width, height);
         glWindow.setVisible(true);
-        
+
         testImpl(glWindow);
-        
+
         glWindow.destroy();
     }
-        
-    private void testNewtCanvasAWT_Impl(boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
-        GLWindow glWindow = GLWindow.create(glCaps);
-        
+
+    private void testNewtCanvasAWT_Impl(final boolean onscreen) throws AWTException, InterruptedException, InvocationTargetException {
+        final GLWindow glWindow = GLWindow.create(glCaps);
+
         // Wrap the window in a canvas.
         final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow);
         if( !onscreen ) {
             newtCanvasAWT.setShallUseOffscreenLayer(true);
         }
-        
+
         // Add the canvas to a frame, and make it all visible.
         final JFrame frame1 = new JFrame("Swing AWT Parent Frame: "+ glWindow.getTitle());
         frame1.getContentPane().add(newtCanvasAWT, BorderLayout.CENTER);
@@ -120,24 +120,24 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
             public void run() {
                 frame1.setVisible(true);
             } } );
-        
+
         Assert.assertEquals(true,  AWTRobotUtil.waitForVisible(frame1, true));
-        
+
         testImpl(glWindow);
-        
+
         try {
             javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     frame1.setVisible(false);
                     frame1.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
-        }        
+        }
         glWindow.destroy();
     }
-    
+
     @Test(timeout=180000) // TO 3 min
     public void test02NewtCanvasAWT_Onscreen() throws AWTException, InterruptedException, InvocationTargetException {
         if( JAWTUtil.isOffscreenLayerRequired() ) {
@@ -146,7 +146,7 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
         }
         testNewtCanvasAWT_Impl(true);
     }
-        
+
     @Test(timeout=180000) // TO 3 min
     public void test03NewtCanvasAWT_Offsccreen() throws AWTException, InterruptedException, InvocationTargetException {
         if( !JAWTUtil.isOffscreenLayerSupported() ) {
@@ -155,25 +155,25 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
         }
         testNewtCanvasAWT_Impl(false);
     }
-    
-    void testImpl(GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
+
+    void testImpl(final GLWindow glWindow) throws AWTException, InterruptedException, InvocationTargetException {
         final Robot robot = new Robot();
         robot.setAutoWaitForIdle(true);
 
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         glWindow.addGLEventListener(demo1);
 
-        SimpleKeyPressRelease simpleKeyPressRelease = new SimpleKeyPressRelease();
+        final SimpleKeyPressRelease simpleKeyPressRelease = new SimpleKeyPressRelease();
         glWindow.addKeyListener(simpleKeyPressRelease);
 
-        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow, true));        
+        Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow, true));
 
         // Continuous animation ..
-        Animator animator = new Animator(glWindow);
+        final Animator animator = new Animator(glWindow);
         animator.start();
 
         Thread.sleep(durationPerTest); // manual testing
-        
+
         AWTRobotUtil.assertRequestFocusAndWait(null, glWindow, glWindow, null, null);  // programmatic
         AWTRobotUtil.requestFocus(robot, glWindow, false); // within unit framework, prev. tests (TestFocus02SwingAWTRobot) 'confuses' Windows keyboard input
 
@@ -184,27 +184,27 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
         animator.stop();
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
-    
+
     static class SimpleKeyPressRelease implements KeyListener {
         int seq;
 
         SimpleKeyPressRelease() {
             reset();
         }
-        
+
         public void reset() {
             seq=0;
         }
-        
+
         @Override
-        public void keyPressed(KeyEvent e) {
+        public void keyPressed(final KeyEvent e) {
             if( 0 == ( InputEvent.AUTOREPEAT_MASK & e.getModifiers() ) ) {
                 seq++;
                 System.err.println(seq+": "+e);
@@ -212,7 +212,7 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
         }
 
         @Override
-        public void keyReleased(KeyEvent e) {
+        public void keyReleased(final KeyEvent e) {
             if( 0 == ( InputEvent.AUTOREPEAT_MASK & e.getModifiers() ) ) {
                 seq++;
                 System.err.println(seq+": "+e);
@@ -220,7 +220,7 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
         }
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
@@ -229,10 +229,10 @@ public class TestNewtKeyPressReleaseUnmaskRepeatAWT extends UITestCase {
         /**
         BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         System.err.println("Press enter to continue");
-        System.err.println(stdin.readLine()); 
+        System.err.println(stdin.readLine());
         */
         System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestNewtKeyPressReleaseUnmaskRepeatAWT.class.getName();
+        final String tstname = TestNewtKeyPressReleaseUnmaskRepeatAWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java
index d3c29cf..586c380 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus01SwingAWTRobot.java
@@ -93,26 +93,26 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase {
 
     @Test
     public void testFocus02RobotFocus() throws AWTException, InterruptedException, InvocationTargetException {
-        Robot robot = new Robot();
+        final Robot robot = new Robot();
         robot.setAutoWaitForIdle(true);
         testFocus01ProgrFocusImpl(robot);
     }
 
-    private void testFocus01ProgrFocusImpl(Robot robot) throws AWTException,
+    private void testFocus01ProgrFocusImpl(final Robot robot) throws AWTException,
             InvocationTargetException, InterruptedException {
-        ArrayList<EventCountAdapter> eventCountAdapters = new ArrayList<EventCountAdapter>();
+        final ArrayList<EventCountAdapter> eventCountAdapters = new ArrayList<EventCountAdapter>();
 
         // Create a window.
-        GLWindow glWindow1 = GLWindow.create(glCaps);
+        final GLWindow glWindow1 = GLWindow.create(glCaps);
         glWindow1.setTitle("testNewtChildFocus");
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         TestListenerCom01AWT.setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
-        NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
+        final NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
         glWindow1.addWindowListener(glWindow1FA);
 
         // Monitor NEWT focus and keyboard events.
-        NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+        final NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
         eventCountAdapters.add(glWindow1KA);
         glWindow1.addKeyListener(glWindow1KA);
 
@@ -121,10 +121,10 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase {
         // newtCanvasAWT.setShallUseOffscreenLayer(true);
 
         // Monitor AWT focus and keyboard events.
-        AWTKeyAdapter newtCanvasAWTKA = new AWTKeyAdapter("NewtCanvasAWT");
+        final AWTKeyAdapter newtCanvasAWTKA = new AWTKeyAdapter("NewtCanvasAWT");
         newtCanvasAWT.addKeyListener(newtCanvasAWTKA);
         eventCountAdapters.add(newtCanvasAWTKA);
-        AWTFocusAdapter newtCanvasAWTFA = new AWTFocusAdapter("NewtCanvasAWT");
+        final AWTFocusAdapter newtCanvasAWTFA = new AWTFocusAdapter("NewtCanvasAWT");
         newtCanvasAWT.addFocusListener(newtCanvasAWTFA);
 
         // Add the canvas to a frame, and make it all visible.
@@ -132,12 +132,12 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase {
                                          + glWindow1.getTitle());
         frame1.getContentPane().add(newtCanvasAWT, BorderLayout.CENTER);
         final Button button = new Button("Click me ..");
-        AWTFocusAdapter buttonFA = new AWTFocusAdapter("Button");
+        final AWTFocusAdapter buttonFA = new AWTFocusAdapter("Button");
         button.addFocusListener(buttonFA);
-        AWTKeyAdapter buttonKA = new AWTKeyAdapter("Button");
+        final AWTKeyAdapter buttonKA = new AWTKeyAdapter("Button");
         button.addKeyListener(buttonKA);
         eventCountAdapters.add(buttonKA);
-        AWTMouseAdapter buttonMA = new AWTMouseAdapter("Button");
+        final AWTMouseAdapter buttonMA = new AWTMouseAdapter("Button");
         button.addMouseListener(buttonMA);
         eventCountAdapters.add(buttonMA);
 
@@ -161,7 +161,7 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase {
         Assert.assertTrue(0 < glWindow1.getTotalFPSFrames());
 
         // Continuous animation ..
-        Animator animator = new Animator(glWindow1);
+        final Animator animator = new Animator(glWindow1);
         animator.start();
 
         // Button Focus
@@ -212,7 +212,7 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase {
                     frame1.setVisible(false);
                     frame1.dispose();
                 }});
-        } catch( Throwable throwable ) {
+        } catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -220,15 +220,15 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase {
         Assert.assertEquals(true,  AWTRobotUtil.waitForRealized(glWindow1, false));
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
@@ -240,7 +240,7 @@ public class TestParentingFocus01SwingAWTRobot extends UITestCase {
         System.err.println(stdin.readLine());
         */
         System.out.println("durationPerTest: "+durationPerTest);
-        String tstname = TestParentingFocus01SwingAWTRobot.class.getName();
+        final String tstname = TestParentingFocus01SwingAWTRobot.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java
index edf82ca..584344e 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus02SwingAWTRobot.java
@@ -42,9 +42,12 @@ import java.awt.Button;
 import java.awt.BorderLayout;
 import java.awt.Container;
 import java.awt.Robot;
+
 import javax.swing.JFrame;
 import javax.swing.JPanel;
 import javax.swing.SwingUtilities;
+import javax.swing.WindowConstants;
+
 import java.util.ArrayList;
 
 import javax.media.opengl.*;
@@ -97,41 +100,41 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase {
     public static void release() {
     }
 
-    private void testFocus01ProgrFocusImpl(Robot robot)
+    private void testFocus01ProgrFocusImpl(final Robot robot)
         throws AWTException, InterruptedException, InvocationTargetException {
 
-        ArrayList<EventCountAdapter> eventCountAdapters = new ArrayList<EventCountAdapter>();
+        final ArrayList<EventCountAdapter> eventCountAdapters = new ArrayList<EventCountAdapter>();
 
-        GLWindow glWindow1 = GLWindow.create(glCaps);
+        final GLWindow glWindow1 = GLWindow.create(glCaps);
         glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
-        GLEventListener demo1 = new GearsES2();
+        final GLEventListener demo1 = new GearsES2();
         glWindow1.addGLEventListener(demo1);
-        NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
+        final NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
         glWindow1.addWindowListener(glWindow1FA);
-        NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+        final NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
         glWindow1.addKeyListener(glWindow1KA);
         eventCountAdapters.add(glWindow1KA);
-        NEWTMouseAdapter glWindow1MA = new NEWTMouseAdapter("GLWindow1");
+        final NEWTMouseAdapter glWindow1MA = new NEWTMouseAdapter("GLWindow1");
         glWindow1.addMouseListener(glWindow1MA);
         eventCountAdapters.add(glWindow1MA);
 
-        NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
-        AWTFocusAdapter newtCanvasAWTFA = new AWTFocusAdapter("NewtCanvasAWT");
+        final NewtCanvasAWT newtCanvasAWT = new NewtCanvasAWT(glWindow1);
+        final AWTFocusAdapter newtCanvasAWTFA = new AWTFocusAdapter("NewtCanvasAWT");
         newtCanvasAWT.addFocusListener(newtCanvasAWTFA);
-        AWTKeyAdapter newtCanvasAWTKA = new AWTKeyAdapter("NewtCanvasAWT");
+        final AWTKeyAdapter newtCanvasAWTKA = new AWTKeyAdapter("NewtCanvasAWT");
         newtCanvasAWT.addKeyListener(newtCanvasAWTKA);
         eventCountAdapters.add(newtCanvasAWTKA);
-        AWTMouseAdapter newtCanvasAWTMA = new AWTMouseAdapter("NewtCanvasAWT");
+        final AWTMouseAdapter newtCanvasAWTMA = new AWTMouseAdapter("NewtCanvasAWT");
         newtCanvasAWT.addMouseListener(newtCanvasAWTMA);
         eventCountAdapters.add(newtCanvasAWTMA);
 
-        Button buttonNorthInner = new Button("north");
-        AWTFocusAdapter buttonNorthInnerFA = new AWTFocusAdapter("ButtonNorthInner");
+        final Button buttonNorthInner = new Button("north");
+        final AWTFocusAdapter buttonNorthInnerFA = new AWTFocusAdapter("ButtonNorthInner");
         buttonNorthInner.addFocusListener(buttonNorthInnerFA);
-        AWTKeyAdapter buttonNorthInnerKA = new AWTKeyAdapter("ButtonNorthInner");
+        final AWTKeyAdapter buttonNorthInnerKA = new AWTKeyAdapter("ButtonNorthInner");
         buttonNorthInner.addKeyListener(buttonNorthInnerKA);
         eventCountAdapters.add(buttonNorthInnerKA);
-        AWTMouseAdapter buttonNorthInnerMA = new AWTMouseAdapter("ButtonNorthInner");
+        final AWTMouseAdapter buttonNorthInnerMA = new AWTMouseAdapter("ButtonNorthInner");
         buttonNorthInner.addMouseListener(buttonNorthInnerMA);
         eventCountAdapters.add(buttonNorthInnerMA);
         final Container container1 = new Container();
@@ -142,13 +145,13 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase {
         container1.add(new Button("west"), BorderLayout.WEST);
         container1.add(newtCanvasAWT, BorderLayout.CENTER);
 
-        Button buttonNorthOuter = new Button("north");
-        AWTFocusAdapter buttonNorthOuterFA = new AWTFocusAdapter("ButtonNorthOuter");
+        final Button buttonNorthOuter = new Button("north");
+        final AWTFocusAdapter buttonNorthOuterFA = new AWTFocusAdapter("ButtonNorthOuter");
         buttonNorthOuter.addFocusListener(buttonNorthOuterFA);
-        AWTKeyAdapter buttonNorthOuterKA = new AWTKeyAdapter("ButtonNorthOuter");
+        final AWTKeyAdapter buttonNorthOuterKA = new AWTKeyAdapter("ButtonNorthOuter");
         buttonNorthOuter.addKeyListener(buttonNorthOuterKA);
         eventCountAdapters.add(buttonNorthOuterKA);
-        AWTMouseAdapter buttonNorthOuterMA = new AWTMouseAdapter("ButtonNorthOuter");
+        final AWTMouseAdapter buttonNorthOuterMA = new AWTMouseAdapter("ButtonNorthOuter");
         buttonNorthOuter.addMouseListener(buttonNorthOuterMA);
         eventCountAdapters.add(buttonNorthOuterMA);
         final JPanel jPanel1 = new JPanel();
@@ -161,7 +164,7 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase {
 
         final JFrame jFrame1 = new JFrame("Swing Parent JFrame");
         // jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-        jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+        jFrame1.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
         jFrame1.setContentPane(jPanel1);
         jFrame1.setSize(width, height);
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
@@ -180,7 +183,7 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase {
         Assert.assertTrue(0 < glWindow1.getTotalFPSFrames());
 
         // Continuous animation ..
-        Animator animator1 = new Animator(glWindow1);
+        final Animator animator1 = new Animator(glWindow1);
         animator1.start();
 
         Thread.sleep(durationPerTest); // manual testing
@@ -287,21 +290,21 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase {
 
     @Test
     public void testFocus02RobotFocus() throws AWTException, InterruptedException, InvocationTargetException {
-        Robot robot = new Robot();
+        final Robot robot = new Robot();
         robot.setAutoWaitForIdle(true);
         testFocus01ProgrFocusImpl(robot);
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
     @SuppressWarnings("unused")
-    public static void main(String args[])
+    public static void main(final String args[])
         throws IOException, AWTException, InterruptedException, InvocationTargetException
     {
         for(int i=0; i<args.length; i++) {
@@ -310,11 +313,11 @@ public class TestParentingFocus02SwingAWTRobot extends UITestCase {
             }
         }
         if(true) {
-            String tstname = TestParentingFocus02SwingAWTRobot.class.getName();
+            final String tstname = TestParentingFocus02SwingAWTRobot.class.getName();
             org.junit.runner.JUnitCore.main(tstname);
         } else {
             TestParentingFocus02SwingAWTRobot.initClass();
-            TestParentingFocus02SwingAWTRobot test = new TestParentingFocus02SwingAWTRobot();
+            final TestParentingFocus02SwingAWTRobot test = new TestParentingFocus02SwingAWTRobot();
             test.testFocus01ProgrFocus();
             test.testFocus02RobotFocus();
             TestParentingFocus02SwingAWTRobot.release();
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus03KeyTraversalAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus03KeyTraversalAWT.java
index 71cc3fc..ace0396 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus03KeyTraversalAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/event/TestParentingFocus03KeyTraversalAWT.java
@@ -97,8 +97,8 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
         testWindowParentingAWTFocusTraversal(false);
     }
 
-    public void testWindowParentingAWTFocusTraversal(boolean onscreen) throws InterruptedException, InvocationTargetException, AWTException {
-        Robot robot = new Robot();
+    public void testWindowParentingAWTFocusTraversal(final boolean onscreen) throws InterruptedException, InvocationTargetException, AWTException {
+        final Robot robot = new Robot();
 
         // Bug 4908075 - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4908075
         // Bug 6463168 - http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6463168
@@ -135,28 +135,28 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
         newtCanvasAWT1.setFocusable(true);
 
         // Test FocusAdapter
-        NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
+        final NEWTFocusAdapter glWindow1FA = new NEWTFocusAdapter("GLWindow1");
         glWindow1.addWindowListener(glWindow1FA);
-        AWTFocusAdapter bWestFA = new AWTFocusAdapter("WEST");
+        final AWTFocusAdapter bWestFA = new AWTFocusAdapter("WEST");
         cWest.addFocusListener(bWestFA);
-        AWTFocusAdapter bEastFA = new AWTFocusAdapter("EAST");
+        final AWTFocusAdapter bEastFA = new AWTFocusAdapter("EAST");
         cEast.addFocusListener(bEastFA);
 
         // Test KeyAdapter
-        NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
+        final NEWTKeyAdapter glWindow1KA = new NEWTKeyAdapter("GLWindow1");
         glWindow1.addKeyListener(glWindow1KA);
-        AWTKeyAdapter bWestKA = new AWTKeyAdapter("West");
+        final AWTKeyAdapter bWestKA = new AWTKeyAdapter("West");
         cWest.addKeyListener(bWestKA);
-        AWTKeyAdapter bEastKA = new AWTKeyAdapter("East");
+        final AWTKeyAdapter bEastKA = new AWTKeyAdapter("East");
         cEast.addKeyListener(bEastKA);
 
         // demo ..
-        GLEventListener demo1 = new GearsES2(1);
+        final GLEventListener demo1 = new GearsES2(1);
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
         glWindow1.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT1, glWindow1, null));
         glWindow1.addKeyListener(new KeyAdapter() {
-            public void keyReleased(KeyEvent e) {
+            public void keyReleased(final KeyEvent e) {
                 if( !e.isPrintableKey() || e.isAutoRepeat() ) {
                     return;
                 }
@@ -173,7 +173,7 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
                                cEast.requestFocusInWindow();
                            }
                         });
-                    } catch (Exception ex) { ex.printStackTrace(); }
+                    } catch (final Exception ex) { ex.printStackTrace(); }
                 } else if(e.getKeyChar()=='w') {
                     System.err.println("Focus West");
                     try {
@@ -182,11 +182,11 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
                                cWest.requestFocusInWindow();
                            }
                         });
-                    } catch (Exception ex) { ex.printStackTrace(); }
+                    } catch (final Exception ex) { ex.printStackTrace(); }
                 }
             }
         });
-        GLAnimatorControl animator1 = new Animator(glWindow1);
+        final GLAnimatorControl animator1 = new Animator(glWindow1);
         animator1.start();
 
         // make frame
@@ -263,7 +263,7 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
                        newtCanvasAWT1.requestFocus();
                    }
                 });
-            } catch (Exception ex) { ex.printStackTrace(); }
+            } catch (final Exception ex) { ex.printStackTrace(); }
             Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(glWindow1, glWindow1FA, bWestFA));
             Assert.assertEquals(true,  glWindow1FA.focusGained());
             Assert.assertEquals(true,  bWestFA.focusLost());
@@ -276,7 +276,7 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
                        cWest.requestFocus();
                    }
                 });
-            } catch (Exception ex) { ex.printStackTrace(); }
+            } catch (final Exception ex) { ex.printStackTrace(); }
             Assert.assertTrue("Did not gain focus", AWTRobotUtil.waitForFocus(cWest, bWestFA, glWindow1FA));
             Assert.assertEquals(true,  bWestFA.focusGained());
             Assert.assertEquals(true,  glWindow1FA.focusLost());
@@ -310,10 +310,10 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
         glWindow1.destroy();
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
-        Window window = glWindow.getDelegatedWindow();
+        final Window window = glWindow.getDelegatedWindow();
         if(debug) {
             MiscUtils.setFieldIfExists(demo, "glDebug", true);
             MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -323,15 +323,15 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
@@ -341,7 +341,7 @@ public class TestParentingFocus03KeyTraversalAWT extends UITestCase {
                 forceGL3 = true;
             }
         }
-        String tstname = TestParentingFocus03KeyTraversalAWT.class.getName();
+        final String tstname = TestParentingFocus03KeyTraversalAWT.class.getName();
         /*
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/ManualScreenMode03aNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/ManualScreenMode03aNEWT.java
index 464efa5..2133f25 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/ManualScreenMode03aNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/ManualScreenMode03aNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.mm;
 
 import java.io.IOException;
@@ -47,17 +47,17 @@ import java.util.List;
 import javax.media.nativewindow.util.Dimension;
 
 /**
- * Manual testing the ScreenImpl shutdown hook, 
+ * Manual testing the ScreenImpl shutdown hook,
  * which shall reset the ScreenMode to it's original state
  * when the application exists (normal or ctrl-c).
  */
 public class ManualScreenMode03aNEWT extends UITestCase {
     static int waitTime = 7000; // 1 sec
-    
-    static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
+
+    static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final int width, final int height, final boolean onscreen, final boolean undecorated) {
         caps.setOnscreen(onscreen);
 
-        GLWindow window = GLWindow.create(screen, caps);
+        final GLWindow window = GLWindow.create(screen, caps);
         window.setSize(width, height);
         window.addGLEventListener(new GearsES2());
         window.setVisible(true);
@@ -65,50 +65,49 @@ public class ManualScreenMode03aNEWT extends UITestCase {
     }
 
     public void run() {
-        int width  = 640;
-        int height = 480;
-        GLProfile glp = GLProfile.getDefault();
-        GLCapabilities caps = new GLCapabilities(glp);
-        Display display = NewtFactory.createDisplay(null); // local display
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+        final int width  = 640;
+        final int height = 480;
+        final GLProfile glp = GLProfile.getDefault();
+        final GLCapabilities caps = new GLCapabilities(glp);
+        final Display display = NewtFactory.createDisplay(null); // local display
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+
+        final Animator animator = new Animator(window);
+        animator.start();
+
+        final MonitorDevice monitor = window.getMainMonitor();
 
-        List<MonitorMode> monitorModes = screen.getMonitorModes();
+        final MonitorMode mmCurrent = monitor.queryCurrentMode();
+        final MonitorMode mmOrig = monitor.getOriginalMode();
+        System.err.println("[0] orig   : "+mmOrig);
+        System.err.println("[0] current: "+mmCurrent);
+        List<MonitorMode> monitorModes = monitor.getSupportedModes();
         if(null==monitorModes) {
             // no support ..
             System.err.println("Your platform has no ScreenMode change support, sorry");
             return;
         }
-        Animator animator = new Animator(window);
-        animator.start();
-
-        MonitorDevice monitor = window.getMainMonitor();
-        MonitorMode mmCurrent = monitor.queryCurrentMode();
-        MonitorMode mmOrig = monitor.getOriginalMode();
-        System.err.println("[0] orig   : "+mmOrig);
-        System.err.println("[0] current: "+mmCurrent);
-
         monitorModes = MonitorModeUtil.filterByFlags(monitorModes, 0); // no interlace, double-scan etc
         monitorModes = MonitorModeUtil.filterByRotation(monitorModes, 0);
         monitorModes = MonitorModeUtil.filterByResolution(monitorModes, new Dimension(801, 601));
         monitorModes = MonitorModeUtil.filterByRate(monitorModes, mmOrig.getRefreshRate());
         monitorModes = MonitorModeUtil.getHighestAvailableBpp(monitorModes);
-
-        MonitorMode mm = (MonitorMode) monitorModes.get(0);
+        final MonitorMode mm = monitorModes.get(0);
         System.err.println("[0] set current: "+mm);
         monitor.setCurrentMode(mm);
 
         System.err.print("[0] post setting .. wait <");
         try {
             Thread.sleep(waitTime);
-        } catch (InterruptedException e) {
+        } catch (final InterruptedException e) {
         }
         System.err.println("done>");
         System.exit(0);
     }
 
-    public static void main(String args[]) throws IOException {
-        ManualScreenMode03aNEWT t = new ManualScreenMode03aNEWT();
+    public static void main(final String args[]) throws IOException {
+        final ManualScreenMode03aNEWT t = new ManualScreenMode03aNEWT();
         t.run();
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java
index 93e005b..68a08b8 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00aNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.mm;
 
 import java.io.IOException;
@@ -68,11 +68,11 @@ import jogamp.newt.MonitorModeProps;
 public class TestScreenMode00aNEWT extends UITestCase {
     static int screenIdx = 0;
     static int width, height;
-    
+
     static int waitTimeShort = 4; //1 sec
     static int waitTimeLong = 6; //6 sec
-    
-    
+
+
 
     @BeforeClass
     public static void initClass() {
@@ -88,38 +88,39 @@ public class TestScreenMode00aNEWT extends UITestCase {
         final DimensionImmutable res = new Dimension(640, 480);
         final SurfaceSize surfsz = new SurfaceSize(res, 32);
         final MonitorMode modeOut = new MonitorMode(surfsz, 60.0f, 0, 0);
-        System.err.println("00 out: "+modeOut);        
-        final MonitorModeProps.Cache cache = new MonitorModeProps.Cache(); 
+        System.err.println("00 out: "+modeOut);
+        final MonitorModeProps.Cache cache = new MonitorModeProps.Cache();
         cache.monitorModes.add(modeOut);
         {
             final int[] props = MonitorModeProps.streamOutMonitorMode(modeOut);
             final MonitorMode modeIn = MonitorModeProps.streamInMonitorMode(null, cache, props, 0);
             System.err.println("00 in : "+modeIn);
-    
+
             Assert.assertEquals(modeOut.getSurfaceSize().getResolution(), modeIn.getSurfaceSize().getResolution());
-    
+
             Assert.assertEquals(modeOut.getSurfaceSize(), modeIn.getSurfaceSize());
-    
+
             Assert.assertEquals(modeOut.hashCode(), modeIn.hashCode());
-            
-            Assert.assertEquals(modeOut, modeIn);    
+
+            Assert.assertEquals(modeOut, modeIn);
         }
-        
+
         final DimensionImmutable sizeMM = new Dimension(50, 50);
         final Rectangle viewport = new Rectangle(0, 0, 1920, 1080);
         final ArrayHashSet<MonitorMode> supportedModes = new ArrayHashSet<MonitorMode>();
         supportedModes.add(modeOut);
-        final MonitorDevice monOut = new MonitorDeviceImpl(null, -1, sizeMM, viewport, modeOut, supportedModes);
+        final MonitorDevice monOut = new MonitorDeviceImpl(null, -1, sizeMM, viewport, viewport, modeOut, supportedModes);
         System.err.println("01 out : "+monOut);
         cache.monitorDevices.add(monOut);
         {
             final int[] props = MonitorModeProps.streamOutMonitorDevice(monOut);
             final MonitorDevice monIn = MonitorModeProps.streamInMonitorDevice(null, cache, null, props, 0);
             System.err.println("01 in : "+monIn);
-            
-            Assert.assertEquals(monOut.getCurrentMode(), monOut.getOriginalMode());            
+
+            Assert.assertEquals(monOut.getCurrentMode(), monOut.getOriginalMode());
             Assert.assertEquals(monOut.getSupportedModes(), monIn.getSupportedModes());
             Assert.assertEquals(monOut.getViewport(), monIn.getViewport());
+            Assert.assertEquals(monOut.getViewportInWindowUnits(), monIn.getViewportInWindowUnits());
             Assert.assertEquals(monOut.getOriginalMode(), monIn.getOriginalMode());
             Assert.assertEquals(monOut.getCurrentMode(), monIn.getCurrentMode());
             Assert.assertEquals(monOut.hashCode(), monIn.hashCode());
@@ -129,18 +130,18 @@ public class TestScreenMode00aNEWT extends UITestCase {
 
     @Test
     public void testScreenModeInfo01() throws InterruptedException {
-        Display dpy = NewtFactory.createDisplay(null);
-        Screen screen = NewtFactory.createScreen(dpy, screenIdx);
+        final Display dpy = NewtFactory.createDisplay(null);
+        final Screen screen = NewtFactory.createScreen(dpy, screenIdx);
         screen.addReference();
         Assert.assertEquals(true,screen.isNativeValid());
         Assert.assertEquals(true,screen.getDisplay().isNativeValid());
         System.err.println("Screen: "+screen.toString());
-        List<MonitorMode> allMonitorModes = screen.getMonitorModes();
+        final List<MonitorMode> allMonitorModes = screen.getMonitorModes();
         Assert.assertTrue(allMonitorModes.size()>0);
         {
             int i=0;
             MonitorMode mmPre = null;
-            for(Iterator<MonitorMode> iMode=allMonitorModes.iterator(); iMode.hasNext(); i++) {
+            for(final Iterator<MonitorMode> iMode=allMonitorModes.iterator(); iMode.hasNext(); i++) {
                 final MonitorMode mm = iMode.next();
                 System.err.println(String.format("All-0[%03d]: %s", i, mm));
                 if( null != mmPre ) {
@@ -153,7 +154,7 @@ public class TestScreenMode00aNEWT extends UITestCase {
         {
             int i=0;
             MonitorMode mmPre = null;
-            for(Iterator<MonitorMode> iMode=allMonitorModes.iterator(); iMode.hasNext(); i++) {
+            for(final Iterator<MonitorMode> iMode=allMonitorModes.iterator(); iMode.hasNext(); i++) {
                 final MonitorMode mm = iMode.next();
                 System.err.println(String.format("All-1[%03d]: %s", i, mm));
                 if( null != mmPre ) {
@@ -162,18 +163,18 @@ public class TestScreenMode00aNEWT extends UITestCase {
                 mmPre = mm;
             }
         }
-        
-        List<MonitorDevice> monitors = screen.getMonitorDevices();
+
+        final List<MonitorDevice> monitors = screen.getMonitorDevices();
         Assert.assertTrue(monitors.size()>0);
         int j=0;
-        for(Iterator<MonitorDevice> iMonitor=monitors.iterator(); iMonitor.hasNext(); j++) {
-            MonitorDevice monitor = iMonitor.next();
+        for(final Iterator<MonitorDevice> iMonitor=monitors.iterator(); iMonitor.hasNext(); j++) {
+            final MonitorDevice monitor = iMonitor.next();
             System.err.println(j+": "+monitor);
-            List<MonitorMode> modes = monitor.getSupportedModes();
+            final List<MonitorMode> modes = monitor.getSupportedModes();
             Assert.assertTrue(modes.size()>0);
             int i=0;
             MonitorMode mmPre = null;
-            for(Iterator<MonitorMode> iMode=modes.iterator(); iMode.hasNext(); i++) {
+            for(final Iterator<MonitorMode> iMode=modes.iterator(); iMode.hasNext(); i++) {
                 final MonitorMode mm = iMode.next();
                 System.err.println(String.format("[%02d][%03d]: %s", j, i, mm));
                 if( null != mmPre ) {
@@ -183,9 +184,9 @@ public class TestScreenMode00aNEWT extends UITestCase {
             }
             Assert.assertTrue(allMonitorModes.containsAll(modes));
 
-            MonitorMode sm_o = monitor.getOriginalMode();
-            Assert.assertNotNull(sm_o);            
-            MonitorMode sm_c = monitor.queryCurrentMode();
+            final MonitorMode sm_o = monitor.getOriginalMode();
+            Assert.assertNotNull(sm_o);
+            final MonitorMode sm_c = monitor.queryCurrentMode();
             System.err.println("[0] orig   : "+sm_o);
             System.err.println("[0] current: "+sm_c);
             Assert.assertNotNull(sm_c);
@@ -198,20 +199,20 @@ public class TestScreenMode00aNEWT extends UITestCase {
         Assert.assertEquals(false,screen.getDisplay().isNativeValid());
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         try {
             return Integer.parseInt(a);
-        } catch (Exception ex) { throw new RuntimeException(ex); }
+        } catch (final Exception ex) { throw new RuntimeException(ex); }
     }
-    
-    public static void main(String args[]) throws IOException {
+
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-screen")) {
                 i++;
                 screenIdx = atoi(args[i]);
             }
         }
-        String tstname = TestScreenMode00aNEWT.class.getName();
+        final String tstname = TestScreenMode00aNEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00bNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00bNEWT.java
index 69f19c2..518dbb8 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00bNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00bNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.mm;
 
 import java.io.IOException;
@@ -55,15 +55,15 @@ import javax.media.opengl.GLCapabilitiesImmutable;
 
 /**
  * Queries the current MonitorMode 50 times,
- * stressing a possible race condition. 
+ * stressing a possible race condition.
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestScreenMode00bNEWT extends UITestCase {
     static int width, height;
-    
+
     static int waitTimeShort = 4; //1 sec
     static int waitTimeLong = 6; //6 sec
-        
+
     @BeforeClass
     public static void initClass() {
         setResetXRandRIfX11AfterClass();
@@ -74,45 +74,45 @@ public class TestScreenMode00bNEWT extends UITestCase {
 
     @Test
     public void testScreenModeInfo01() throws InterruptedException {
-        Display display = NewtFactory.createDisplay(null);
-        Screen screen = NewtFactory.createScreen(display, 0);
+        final Display display = NewtFactory.createDisplay(null);
+        final Screen screen = NewtFactory.createScreen(display, 0);
         // screen.addReference();
-        
+
         // put some load on the screen/display context ..
-        GLCapabilitiesImmutable caps = new GLCapabilities(null); 
-        GLWindow window = GLWindow.create(screen, caps);
+        final GLCapabilitiesImmutable caps = new GLCapabilities(null);
+        final GLWindow window = GLWindow.create(screen, caps);
         window.addGLEventListener(new GearsES2());
         window.setSize(256, 256);
         window.setVisible(true);
-        Animator anim = new Animator(window);
+        final Animator anim = new Animator(window);
         anim.start();
 
         Assert.assertEquals(true,window.isNativeValid());
         Assert.assertEquals(true,screen.isNativeValid());
         Assert.assertEquals(true,display.isNativeValid());
-        
-        List<MonitorMode> screenModes = screen.getMonitorModes();
+
+        final List<MonitorMode> screenModes = screen.getMonitorModes();
         Assert.assertTrue(screenModes.size()>0);
         int i=0;
-        for(Iterator<MonitorMode> iter=screenModes.iterator(); iter.hasNext(); i++) {
+        for(final Iterator<MonitorMode> iter=screenModes.iterator(); iter.hasNext(); i++) {
             System.err.println(i+": "+iter.next());
         }
-        MonitorDevice monitor = window.getMainMonitor();
-        MonitorMode mm_o = monitor.getOriginalMode();
-        
-        Assert.assertNotNull(mm_o);            
+        final MonitorDevice monitor = window.getMainMonitor();
+        final MonitorMode mm_o = monitor.getOriginalMode();
+
+        Assert.assertNotNull(mm_o);
         MonitorMode mm_c = monitor.queryCurrentMode();
         Assert.assertNotNull(mm_c);
         System.err.println("orig: "+mm_o);
         System.err.println("curr: "+mm_c);
-        
+
         for(i=0; i<50; i++) {
             mm_c = monitor.queryCurrentMode();
             Assert.assertNotNull(mm_c);
             System.err.print("."+i);
         }
         System.err.println("!");
-        
+
         // screen.removeReference();
         anim.stop();
         window.destroy();
@@ -124,8 +124,8 @@ public class TestScreenMode00bNEWT extends UITestCase {
         Assert.assertEquals(false,display.isNativeValid());
     }
 
-    public static void main(String args[]) throws IOException {
-        String tstname = TestScreenMode00bNEWT.class.getName();
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestScreenMode00bNEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00cNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00cNEWT.java
index de856e5..6b353f8 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00cNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode00cNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,15 +20,16 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.mm;
 
 import java.io.IOException;
+
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLProfile;
 
@@ -56,6 +57,8 @@ import java.util.List;
 
 import javax.media.nativewindow.NativeWindowFactory;
 import javax.media.nativewindow.util.Dimension;
+import javax.media.nativewindow.util.DimensionImmutable;
+import javax.media.nativewindow.util.Rectangle;
 
 /**
  * Tests X11 XRandR MonitorMode reset via {@link UITestCase#resetXRandRIfX11()}.
@@ -65,10 +68,13 @@ public class TestScreenMode00cNEWT extends UITestCase {
     static boolean manualTest = false;
     static GLProfile glp;
     static int width, height;
-    
+
     static final int waitTimeShort = 2000;
     static long duration = waitTimeShort;
 
+    static int mm_width = 800;
+    static int mm_height = 600;
+
     @BeforeClass
     public static void initClass() {
         setResetXRandRIfX11AfterClass();
@@ -86,11 +92,11 @@ public class TestScreenMode00cNEWT extends UITestCase {
     public static void releaseClass() throws InterruptedException {
         Thread.sleep(waitTimeShort);
     }
-    
-    static Window createWindow(Screen screen, GLCapabilities caps, String name, int x, int y, int width, int height) {
+
+    static Window createWindow(final Screen screen, final GLCapabilities caps, final String name, final int x, final int y, final int width, final int height) {
         Assert.assertNotNull(caps);
 
-        GLWindow window = GLWindow.create(screen, caps);
+        final GLWindow window = GLWindow.create(screen, caps);
         // Window window = NewtFactory.createWindow(screen, caps);
         window.setTitle(name);
         window.setPosition(x, y);
@@ -101,13 +107,13 @@ public class TestScreenMode00cNEWT extends UITestCase {
         return window;
     }
 
-    static void destroyWindow(Window window) throws InterruptedException {
+    static void destroyWindow(final Window window) throws InterruptedException {
         if(null!=window) {
             window.destroy();
             Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));
         }
     }
-    
+
     @Test
     public void testScreenModeChange01() throws InterruptedException {
         Thread.sleep(waitTimeShort);
@@ -119,7 +125,13 @@ public class TestScreenMode00cNEWT extends UITestCase {
         final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
         final Window window0 = createWindow(screen, caps, "win0", 0, 0, width, height);
-        Assert.assertNotNull(window0);        
+        Assert.assertNotNull(window0);
+
+        Rectangle window0WindowBounds = window0.getBounds();
+        DimensionImmutable window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
+        System.err.println("Test.0: Window bounds    : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
+        System.err.println("Test.0: Window size      : "+window0SurfaceSize+" [pixels]");
+        System.err.println("Test.0: Screen viewport  : "+screen.getViewport()+" [pixels]");
 
         final List<MonitorMode> allMonitorModes = screen.getMonitorModes();
         Assert.assertTrue(allMonitorModes.size()>0);
@@ -131,7 +143,6 @@ public class TestScreenMode00cNEWT extends UITestCase {
         }
 
         final MonitorDevice monitor = screen.getMonitorDevices().get(0);
-        
         List<MonitorMode> monitorModes = monitor.getSupportedModes();
         Assert.assertTrue(monitorModes.size()>0);
         if(monitorModes.size()==1) {
@@ -141,7 +152,7 @@ public class TestScreenMode00cNEWT extends UITestCase {
             return;
         }
         Assert.assertTrue(allMonitorModes.containsAll(monitorModes));
-                
+
         final MonitorMode mmSet0 = monitor.queryCurrentMode();
         Assert.assertNotNull(mmSet0);
         final MonitorMode mmOrig = monitor.getOriginalMode();
@@ -149,7 +160,7 @@ public class TestScreenMode00cNEWT extends UITestCase {
         System.err.println("[0] orig   : "+mmOrig);
         System.err.println("[0] current: "+mmSet0);
         Assert.assertEquals(mmSet0, mmOrig);
-        
+
 
         monitorModes = MonitorModeUtil.filterByFlags(monitorModes, 0); // no interlace, double-scan etc
         Assert.assertNotNull(monitorModes);
@@ -157,28 +168,38 @@ public class TestScreenMode00cNEWT extends UITestCase {
         monitorModes = MonitorModeUtil.filterByRotation(monitorModes, 0);
         Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
-        monitorModes = MonitorModeUtil.filterByResolution(monitorModes, new Dimension(801, 601));
+        monitorModes = MonitorModeUtil.filterByResolution(monitorModes, new Dimension(mm_width+1, mm_height+1));
         Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
         monitorModes = MonitorModeUtil.filterByRate(monitorModes, mmOrig.getRefreshRate());
-        Assert.assertNotNull(monitorModes);        
+        Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
-        
+
         monitorModes = MonitorModeUtil.getHighestAvailableBpp(monitorModes);
         Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
 
         // set mode
         {
-            MonitorMode mm = monitorModes.get(0);
-            System.err.println("[0] set current: "+mm);
+            final MonitorMode mm = monitorModes.get(0);
+            System.err.println("[1] set current: "+mm);
             final boolean smOk = monitor.setCurrentMode(mm);
-            MonitorMode mmCurrent = monitor.getCurrentMode();
-            System.err.println("[0] has current: "+mmCurrent+", changeOK "+smOk);
+            final MonitorMode mmCachedCurrent = monitor.getCurrentMode();
+            final MonitorMode mmQueriedCurrent = monitor.queryCurrentMode();
+            final boolean mmCurrentEquals = mmQueriedCurrent.equals(mmCachedCurrent);
+            System.err.println("[1] changeOK             : "+smOk);
+            System.err.println("[1] has current cached   : "+mmCachedCurrent);
+            System.err.println("[1] has current queried  : "+mmQueriedCurrent+", equal "+mmCurrentEquals);
+            window0WindowBounds = window0.getBounds();
+            window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
+            System.err.println("Test.1: Window bounds    : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
+            System.err.println("Test.1: Window size      : "+window0SurfaceSize+" [pixels]");
+            System.err.println("Test.1: Screen viewport  : "+screen.getViewport()+" [pixels]");
+
             Assert.assertTrue(monitor.isModeChangedByUs());
-            Assert.assertEquals(mm, mmCurrent);
-            Assert.assertNotSame(mmOrig, mmCurrent);
-            Assert.assertEquals(mmCurrent, monitor.queryCurrentMode());
+            Assert.assertEquals(mm, mmCachedCurrent);
+            Assert.assertNotSame(mmOrig, mmCachedCurrent);
+            Assert.assertEquals(mmCachedCurrent, mmQueriedCurrent);
             Assert.assertTrue(smOk);
         }
 
@@ -193,13 +214,13 @@ public class TestScreenMode00cNEWT extends UITestCase {
         UITestCase.resetXRandRIfX11();
         System.err.println("XRandR Reset :"+monitor.queryCurrentMode());
         validateScreenModeReset0(mmOrig);
-        
+
         destroyWindow(window0);
 
         Thread.sleep(waitTimeShort);
         validateScreenModeReset(mmOrig);
     }
-    
+
     void validateScreenModeReset0(final MonitorMode mmOrig) {
         final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
@@ -208,10 +229,10 @@ public class TestScreenMode00cNEWT extends UITestCase {
         screen.addReference();
         Assert.assertEquals(true,display.isNativeValid());
         Assert.assertEquals(true,screen.isNativeValid());
-        
+
         final MonitorDevice monitor = screen.getMonitorDevices().get(0);
         Assert.assertEquals(mmOrig, monitor.queryCurrentMode());
-        
+
         screen.removeReference();
     }
     void validateScreenModeReset(final MonitorMode mmOrig) {
@@ -224,24 +245,31 @@ public class TestScreenMode00cNEWT extends UITestCase {
         screen.addReference();
         Assert.assertEquals(true,display.isNativeValid());
         Assert.assertEquals(true,screen.isNativeValid());
-        
+
         final MonitorDevice monitor = screen.getMonitorDevices().get(0);
         Assert.assertEquals(mmOrig, monitor.getCurrentMode());
-        
+
         screen.removeReference();
         Assert.assertEquals(false,display.isNativeValid());
         Assert.assertEquals(false,screen.isNativeValid());
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         manualTest = true;
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 duration = MiscUtils.atol(args[i], duration);
+            } else if(args[i].equals("-mwidth")) {
+                i++;
+                mm_width = MiscUtils.atoi(args[i], mm_width);
+            } else if(args[i].equals("-mheight")) {
+                i++;
+                mm_height = MiscUtils.atoi(args[i], mm_height);
             }
         }
-        String tstname = TestScreenMode00cNEWT.class.getName();
+        System.err.println("Desired mode w/ resolution "+mm_width+"x"+mm_height);
+        final String tstname = TestScreenMode00cNEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java
index 0f3dbee..5ca1333 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01aNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,15 +20,16 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.mm;
 
 import java.io.IOException;
+
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLProfile;
 
@@ -49,10 +50,14 @@ import com.jogamp.newt.opengl.GLWindow;
 import com.jogamp.newt.util.MonitorModeUtil;
 import com.jogamp.opengl.test.junit.jogl.demos.es2.GearsES2;
 import com.jogamp.opengl.test.junit.util.AWTRobotUtil;
+import com.jogamp.opengl.test.junit.util.MiscUtils;
 import com.jogamp.opengl.test.junit.util.UITestCase;
 
 import java.util.List;
+
 import javax.media.nativewindow.util.Dimension;
+import javax.media.nativewindow.util.DimensionImmutable;
+import javax.media.nativewindow.util.Rectangle;
 
 /**
  * <p>
@@ -62,16 +67,19 @@ import javax.media.nativewindow.util.Dimension;
  * <p>
  * Documents remedy B) for NV RANDR/GL bug
  * </p>
- * 
+ *
  * @see TestScreenMode01dNEWT#cleanupGL()
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestScreenMode01aNEWT extends UITestCase {
     static GLProfile glp;
     static int width, height;
-    
-    static int waitTimeShort = 2000;
-    static int waitTimeLong = 2000;
+
+    static long waitTimeShort = 2000;
+    static long duration = 2000;
+
+    static int mm_width = 800;
+    static int mm_height = 600;
 
     @BeforeClass
     public static void initClass() {
@@ -85,11 +93,11 @@ public class TestScreenMode01aNEWT extends UITestCase {
     public static void releaseClass() throws InterruptedException {
         Thread.sleep(waitTimeShort);
     }
-    
-    static Window createWindow(Screen screen, GLCapabilities caps, String name, int x, int y, int width, int height) {
+
+    static Window createWindow(final Screen screen, final GLCapabilities caps, final String name, final int x, final int y, final int width, final int height) {
         Assert.assertNotNull(caps);
 
-        GLWindow window = GLWindow.create(screen, caps);
+        final GLWindow window = GLWindow.create(screen, caps);
         // Window window = NewtFactory.createWindow(screen, caps);
         window.setTitle(name);
         window.setPosition(x, y);
@@ -100,13 +108,13 @@ public class TestScreenMode01aNEWT extends UITestCase {
         return window;
     }
 
-    static void destroyWindow(Window window) throws InterruptedException {
+    static void destroyWindow(final Window window) throws InterruptedException {
         if(null!=window) {
             window.destroy();
             Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));
         }
     }
-    
+
     @Test
     public void testScreenModeChange01() throws InterruptedException {
         Thread.sleep(waitTimeShort);
@@ -118,7 +126,16 @@ public class TestScreenMode01aNEWT extends UITestCase {
         final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
         final Window window0 = createWindow(screen, caps, "win0", 0, 0, width, height);
-        Assert.assertNotNull(window0);        
+        Assert.assertNotNull(window0);
+
+        final MonitorDevice monitor = screen.getMonitorDevices().get(0);
+
+        Rectangle window0WindowBounds = window0.getBounds();
+        DimensionImmutable window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
+        System.err.println("Test.0: Window bounds    : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
+        System.err.println("Test.0: Window size      : "+window0SurfaceSize+" [pixels]");
+        System.err.println("Test.0: Screen viewport  : "+screen.getViewport()+" [pixels], "+screen.getViewportInWindowUnits()+" [wu]");
+        System.err.println("Test.0: Monitor viewport : "+monitor.getViewport()+" [pixels], "+monitor.getViewportInWindowUnits()+" [wu]");
 
         final List<MonitorMode> allMonitorModes = screen.getMonitorModes();
         Assert.assertTrue(allMonitorModes.size()>0);
@@ -129,8 +146,6 @@ public class TestScreenMode01aNEWT extends UITestCase {
             return;
         }
 
-        final MonitorDevice monitor = screen.getMonitorDevices().get(0);
-        
         List<MonitorMode> monitorModes = monitor.getSupportedModes();
         Assert.assertTrue(monitorModes.size()>0);
         if(monitorModes.size()==1) {
@@ -140,7 +155,7 @@ public class TestScreenMode01aNEWT extends UITestCase {
             return;
         }
         Assert.assertTrue(allMonitorModes.containsAll(monitorModes));
-                
+
         final MonitorMode mmSet0 = monitor.queryCurrentMode();
         Assert.assertNotNull(mmSet0);
         final MonitorMode mmOrig = monitor.getOriginalMode();
@@ -148,7 +163,7 @@ public class TestScreenMode01aNEWT extends UITestCase {
         System.err.println("[0] orig   : "+mmOrig);
         System.err.println("[0] current: "+mmSet0);
         Assert.assertEquals(mmSet0, mmOrig);
-        
+
 
         monitorModes = MonitorModeUtil.filterByFlags(monitorModes, 0); // no interlace, double-scan etc
         Assert.assertNotNull(monitorModes);
@@ -156,32 +171,43 @@ public class TestScreenMode01aNEWT extends UITestCase {
         monitorModes = MonitorModeUtil.filterByRotation(monitorModes, 0);
         Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
-        monitorModes = MonitorModeUtil.filterByResolution(monitorModes, new Dimension(801, 601));
+        monitorModes = MonitorModeUtil.filterByResolution(monitorModes, new Dimension(mm_width+1, mm_height+1));
         Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
         monitorModes = MonitorModeUtil.filterByRate(monitorModes, mmOrig.getRefreshRate());
-        Assert.assertNotNull(monitorModes);        
+        Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
-        
+
         monitorModes = MonitorModeUtil.getHighestAvailableBpp(monitorModes);
         Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
 
         // set mode
         {
-            MonitorMode mm = monitorModes.get(0);
-            System.err.println("[0] set current: "+mm);
+            final MonitorMode mm = monitorModes.get(0);
+            System.err.println("[1] set current: "+mm);
             final boolean smOk = monitor.setCurrentMode(mm);
-            MonitorMode mmCurrent = monitor.getCurrentMode();
-            System.err.println("[0] has current: "+mmCurrent+", changeOK "+smOk);
+            final MonitorMode mmCachedCurrent = monitor.getCurrentMode();
+            final MonitorMode mmQueriedCurrent = monitor.queryCurrentMode();
+            final boolean mmCurrentEquals = mmQueriedCurrent.equals(mmCachedCurrent);
+            System.err.println("[1] changeOK             : "+smOk);
+            System.err.println("[1] has current cached   : "+mmCachedCurrent);
+            System.err.println("[1] has current queried  : "+mmQueriedCurrent+", equal "+mmCurrentEquals);
+            window0WindowBounds = window0.getBounds();
+            window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
+            System.err.println("Test.1: Window bounds    : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
+            System.err.println("Test.1: Window size      : "+window0SurfaceSize+" [pixels]");
+            System.err.println("Test.1: Screen viewport  : "+screen.getViewport()+" [pixels], "+screen.getViewportInWindowUnits()+" [wu]");
+            System.err.println("Test.1: Monitor viewport : "+monitor.getViewport()+" [pixels], "+monitor.getViewportInWindowUnits()+" [wu]");
+
             Assert.assertTrue(monitor.isModeChangedByUs());
-            Assert.assertEquals(mm, mmCurrent);
-            Assert.assertNotSame(mmOrig, mmCurrent);
-            Assert.assertEquals(mmCurrent, monitor.queryCurrentMode());
+            Assert.assertEquals(mm, mmCachedCurrent);
+            Assert.assertNotSame(mmOrig, mmCachedCurrent);
+            Assert.assertEquals(mmCachedCurrent, monitor.queryCurrentMode());
             Assert.assertTrue(smOk);
         }
 
-        Thread.sleep(waitTimeShort);
+        Thread.sleep(duration);
 
         Assert.assertEquals(true,display.isNativeValid());
         Assert.assertEquals(true,screen.isNativeValid());
@@ -196,13 +222,13 @@ public class TestScreenMode01aNEWT extends UITestCase {
         Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false));
         Assert.assertEquals(false,screen.isNativeValid());
         Assert.assertEquals(false,display.isNativeValid());
-                
+
         Thread.sleep(waitTimeShort);
-        
+
         validateScreenModeReset(mmOrig, 0);
     }
-    
-    void validateScreenModeReset(final MonitorMode mmOrig, int mmIdx) {
+
+    void validateScreenModeReset(final MonitorMode mmOrig, final int mmIdx) {
         final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
         final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
@@ -212,17 +238,30 @@ public class TestScreenMode01aNEWT extends UITestCase {
         screen.addReference();
         Assert.assertEquals(true,display.isNativeValid());
         Assert.assertEquals(true,screen.isNativeValid());
-        
+
         final MonitorDevice monitor = screen.getMonitorDevices().get(0);
         Assert.assertEquals(mmOrig, monitor.getCurrentMode());
-        
+
         screen.removeReference();
         Assert.assertEquals(false,display.isNativeValid());
         Assert.assertEquals(false,screen.isNativeValid());
     }
 
-    public static void main(String args[]) throws IOException {
-        String tstname = TestScreenMode01aNEWT.class.getName();
+    public static void main(final String args[]) throws IOException {
+        for(int i=0; i<args.length; i++) {
+            if(args[i].equals("-time")) {
+                i++;
+                duration = MiscUtils.atol(args[i], duration);
+            } else if(args[i].equals("-mwidth")) {
+                i++;
+                mm_width = MiscUtils.atoi(args[i], mm_width);
+            } else if(args[i].equals("-mheight")) {
+                i++;
+                mm_height = MiscUtils.atoi(args[i], mm_height);
+            }
+        }
+        System.err.println("Desired mode w/ resolution "+mm_width+"x"+mm_height);
+        final String tstname = TestScreenMode01aNEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java
index 4804a75..bba663a 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01bNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,15 +20,16 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.mm;
 
 import java.io.IOException;
+
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLProfile;
 
@@ -54,7 +55,10 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 import com.jogamp.opengl.util.Animator;
 
 import java.util.List;
+
 import javax.media.nativewindow.util.Dimension;
+import javax.media.nativewindow.util.DimensionImmutable;
+import javax.media.nativewindow.util.Rectangle;
 import javax.media.nativewindow.util.RectangleImmutable;
 
 /**
@@ -64,7 +68,7 @@ import javax.media.nativewindow.util.RectangleImmutable;
 public class TestScreenMode01bNEWT extends UITestCase {
     static GLProfile glp;
     static int width, height;
-    
+
     static long waitTimeShort = 2000;
     static long duration = 6000;
 
@@ -80,14 +84,15 @@ public class TestScreenMode01bNEWT extends UITestCase {
     public static void releaseClass() throws InterruptedException {
         Thread.sleep(waitTimeShort);
     }
-    
-    static GLWindow createWindow(Screen screen, GLCapabilities caps, String name, int x, int y, int width, int height) throws InterruptedException {
+
+    static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final String name, final int screenXPos, final int screenYPos, final int width, final int height) throws InterruptedException {
         Assert.assertNotNull(caps);
 
-        GLWindow window = GLWindow.create(screen, caps);
+        final GLWindow window = GLWindow.create(screen, caps);
         // Window window = NewtFactory.createWindow(screen, caps);
+        final int[] winPos = window.convertToWindowUnits(new int[] { screenXPos, screenYPos });
         window.setTitle(name);
-        window.setPosition(x, y);
+        window.setPosition(winPos[0], winPos[1]);
         window.setSize(width, height);
         window.addGLEventListener(new GearsES2());
         Assert.assertNotNull(window);
@@ -97,13 +102,13 @@ public class TestScreenMode01bNEWT extends UITestCase {
         return window;
     }
 
-    static void destroyWindow(Window window) throws InterruptedException {
+    static void destroyWindow(final Window window) throws InterruptedException {
         if(null!=window) {
             window.destroy();
-            Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));            
+            Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));
         }
     }
-    
+
     @Test
     public void testScreenModeChangeSingleQ1() throws InterruptedException {
         final Display display = NewtFactory.createDisplay(null); // local display
@@ -112,14 +117,14 @@ public class TestScreenMode01bNEWT extends UITestCase {
         Assert.assertNotNull(screen);
         screen.addReference(); // trigger creation
         try {
-            RectangleImmutable monitorVp = screen.getMonitorDevices().get(0).getViewport();
+            final RectangleImmutable monitorVp = screen.getMonitorDevices().get(0).getViewport();
             testScreenModeChangeImpl(screen, monitorVp.getX(), monitorVp.getY());
         } finally {
             screen.removeReference();
             Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false));
         }
     }
-    
+
     @Test
     public void testScreenModeChangeSingleQ2() throws InterruptedException {
         final Display display = NewtFactory.createDisplay(null); // local display
@@ -132,32 +137,35 @@ public class TestScreenMode01bNEWT extends UITestCase {
                 System.err.println("Test Disabled (1): Monitor count < 2: "+screen);
                 return;
             }
-            RectangleImmutable monitorVp = screen.getMonitorDevices().get(1).getViewport();
+            final RectangleImmutable monitorVp = screen.getMonitorDevices().get(1).getViewport();
             testScreenModeChangeImpl(screen, monitorVp.getX(), monitorVp.getY());
         } finally {
             screen.removeReference();
             Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false));
         }
     }
-        
-    void testScreenModeChangeImpl(final Screen screen, int xpos, int ypos) throws InterruptedException {
+
+    void testScreenModeChangeImpl(final Screen screen, final int screenXPos, final int screenYPos) throws InterruptedException {
         Thread.sleep(waitTimeShort);
 
         final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
         final Display display = screen.getDisplay();
         System.err.println("Test.0: Window screen: "+screen);
-        
-        System.err.println("Test.0: Window bounds (pre): "+xpos+"/"+ypos+" "+width+"x"+height+" within "+screen.getViewport());
-        
-        GLWindow window0 = createWindow(screen, caps, "win0", xpos, ypos, width, height);
-        Assert.assertNotNull(window0);        
-        System.err.println("Test.0: Window bounds: "+window0.getX()+"/"+window0.getY()+" "+window0.getWidth()+"x"+window0.getHeight()+" within "+screen.getViewport());
+
+        System.err.println("Test.0: Window bounds (pre): screenPos "+screenXPos+"/"+screenYPos+" [pixels], windowSize "+width+"x"+height+" [wu] within "+screen.getViewport()+" [pixels]");
+
+        final GLWindow window0 = createWindow(screen, caps, "win0", screenXPos, screenYPos, width, height);
+        Assert.assertNotNull(window0);
+        Rectangle window0WindowBounds = window0.getBounds();
+        DimensionImmutable window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
+        System.err.println("Test.0: Window bounds    : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
+        System.err.println("Test.0: Window size      : "+window0SurfaceSize+" [pixels]");
 
         final Animator anim = new Animator(window0);
         anim.start();
-        
-        List<MonitorMode> allMonitorModes = screen.getMonitorModes();
+
+        final List<MonitorMode> allMonitorModes = screen.getMonitorModes();
         Assert.assertTrue(allMonitorModes.size()>0);
         if(allMonitorModes.size()==1) {
             // no support ..
@@ -166,9 +174,9 @@ public class TestScreenMode01bNEWT extends UITestCase {
             return;
         }
 
-        MonitorDevice monitor = window0.getMainMonitor();
+        final MonitorDevice monitor = window0.getMainMonitor();
         System.err.println("Test.0: Window monitor: "+monitor);
-        
+
         List<MonitorMode> monitorModes = monitor.getSupportedModes();
         Assert.assertTrue(monitorModes.size()>0);
         if(monitorModes.size()==1) {
@@ -178,10 +186,10 @@ public class TestScreenMode01bNEWT extends UITestCase {
             return;
         }
         Assert.assertTrue(allMonitorModes.containsAll(monitorModes));
-                
+
         MonitorMode mmCurrent = monitor.getCurrentMode();
         Assert.assertNotNull(mmCurrent);
-        MonitorMode mmOrig = monitor.getOriginalMode();
+        final MonitorMode mmOrig = monitor.getOriginalMode();
         Assert.assertNotNull(mmOrig);
         System.err.println("[0] orig   : "+mmOrig);
         System.err.println("[0] current: "+mmCurrent);
@@ -199,14 +207,14 @@ public class TestScreenMode01bNEWT extends UITestCase {
         monitorModes = MonitorModeUtil.filterByRate(monitorModes, mmOrig.getRefreshRate());
         Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
-        
+
         monitorModes = MonitorModeUtil.getHighestAvailableBpp(monitorModes);
         Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
 
         // set mode
         {
-            MonitorMode mm = monitorModes.get(0);
+            final MonitorMode mm = monitorModes.get(0);
             System.err.println("[0] set current: "+mm);
             final boolean smOk = monitor.setCurrentMode(mm);
             mmCurrent = monitor.getCurrentMode();
@@ -218,10 +226,15 @@ public class TestScreenMode01bNEWT extends UITestCase {
             Assert.assertTrue(smOk);
         }
 
-        System.err.println("Test.1: Window screen: "+screen);
-        System.err.println("Test.1: Window bounds: "+window0.getX()+"/"+window0.getY()+" "+window0.getWidth()+"x"+window0.getHeight()+" within "+screen.getViewport());
-        System.err.println("Test.1: Window monitor: "+window0.getMainMonitor());
-        
+        window0WindowBounds = window0.getBounds();
+        window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
+        System.err.println("Test.1: Screen           : "+screen);
+        System.err.println("Test.1: Window bounds    : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
+        System.err.println("Test.1: Window size      : "+window0SurfaceSize+" [pixels]");
+        System.err.println("Test.1: Screen viewport  : "+screen.getViewport()+" [pixels]");
+        System.err.println("Test.1: Monitor viewport : "+monitor.getViewport()+" [pixels], "+monitor.getViewportInWindowUnits()+" [wu]");
+        System.err.println("Test.1: Window main-mon  : "+window0.getMainMonitor());
+
         Thread.sleep(duration);
 
         Assert.assertEquals(true,display.isNativeValid());
@@ -238,12 +251,17 @@ public class TestScreenMode01bNEWT extends UITestCase {
             Assert.assertFalse(monitor.isModeChangedByUs());
             Assert.assertEquals(mmOrig, mmCurrent);
             Assert.assertTrue(smOk);
-        }        
-        
-        System.err.println("Test.2: Window screen: "+screen);
-        System.err.println("Test.2: Window bounds: "+window0.getX()+"/"+window0.getY()+" "+window0.getWidth()+"x"+window0.getHeight()+" within "+screen.getViewport());
-        System.err.println("Test.2: Window monitor: "+window0.getMainMonitor());
-        
+        }
+
+        window0WindowBounds = window0.getBounds();
+        window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
+        System.err.println("Test.2: Screen           : "+screen);
+        System.err.println("Test.2: Window bounds    : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
+        System.err.println("Test.2: Window size      : "+window0SurfaceSize+" [pixels]");
+        System.err.println("Test.2: Screen viewport  : "+screen.getViewport()+" [pixels]");
+        System.err.println("Test.2: Monitor viewport : "+monitor.getViewport()+" [pixels], "+monitor.getViewportInWindowUnits()+" [wu]");
+        System.err.println("Test.2: Window main-mon  : "+window0.getMainMonitor());
+
         Thread.sleep(duration);
         anim.stop();
         destroyWindow(window0);
@@ -254,14 +272,14 @@ public class TestScreenMode01bNEWT extends UITestCase {
         Assert.assertEquals(true,screen.isNativeValid());
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 duration = MiscUtils.atol(args[i], duration);
             }
         }
-        String tstname = TestScreenMode01bNEWT.class.getName();
+        final String tstname = TestScreenMode01bNEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java
index db6360a..377c35a 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01cNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,15 +20,16 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.mm;
 
 import java.io.IOException;
+
 import javax.media.opengl.GLCapabilities;
 import javax.media.opengl.GLProfile;
 
@@ -54,6 +55,9 @@ import com.jogamp.opengl.util.Animator;
 
 import java.util.ArrayList;
 import java.util.List;
+
+import javax.media.nativewindow.util.Dimension;
+import javax.media.nativewindow.util.DimensionImmutable;
 import javax.media.nativewindow.util.Rectangle;
 import javax.media.nativewindow.util.RectangleImmutable;
 
@@ -64,7 +68,7 @@ import javax.media.nativewindow.util.RectangleImmutable;
 public class TestScreenMode01cNEWT extends UITestCase {
     static GLProfile glp;
     static int width, height;
-    
+
     static long waitTimeShort = 2000;
     static long duration = 4000;
 
@@ -80,14 +84,15 @@ public class TestScreenMode01cNEWT extends UITestCase {
     public static void releaseClass() throws InterruptedException {
         Thread.sleep(waitTimeShort);
     }
-    
-    static GLWindow createWindow(Screen screen, GLCapabilities caps, String name, int x, int y, int width, int height) throws InterruptedException {
+
+    static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final String name, final int screenXPos, final int screenYPos, final int width, final int height) throws InterruptedException {
         Assert.assertNotNull(caps);
 
-        GLWindow window = GLWindow.create(screen, caps);
+        final GLWindow window = GLWindow.create(screen, caps);
         // Window window = NewtFactory.createWindow(screen, caps);
+        final int[] winPos = window.convertToWindowUnits(new int[] { screenXPos, screenYPos });
         window.setTitle(name);
-        window.setPosition(x, y);
+        window.setPosition(winPos[0], winPos[1]);
         window.setSize(width, height);
         window.addGLEventListener(new GearsES2());
         Assert.assertNotNull(window);
@@ -97,13 +102,13 @@ public class TestScreenMode01cNEWT extends UITestCase {
         return window;
     }
 
-    static void destroyWindow(Window window) throws InterruptedException {
+    static void destroyWindow(final Window window) throws InterruptedException {
         if(null!=window) {
             window.destroy();
-            Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));            
+            AWTRobotUtil.waitForRealized(window, false); // don't override a previous assertion failure
         }
     }
-    
+
     @Test
     public void testScreenFullscreenSingleQ1() throws InterruptedException {
         final Display display = NewtFactory.createDisplay(null); // local display
@@ -112,97 +117,101 @@ public class TestScreenMode01cNEWT extends UITestCase {
         Assert.assertNotNull(screen);
         screen.addReference(); // trigger creation
         try {
-            RectangleImmutable monitorVp = screen.getMonitorDevices().get(0).getViewport();
+            final RectangleImmutable monitorVp = screen.getMonitorDevices().get(0).getViewport();
             testScreenFullscreenImpl(screen, monitorVp.getX(), monitorVp.getY(), false, null);
         } finally {
             screen.removeReference();
-            Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false));            
+            AWTRobotUtil.waitForRealized(screen, false); // don't override a previous assertion failure
         }
     }
-    
+
     @Test
     public void testScreenFullscreenSingleQ2() throws InterruptedException {
         final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
         final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
-        screen.addReference(); // trigger creation        
+        screen.addReference(); // trigger creation
         try {
             if( 2 > screen.getMonitorDevices().size() ) {
                 System.err.println("Test Disabled (1): Monitor count < 2: "+screen);
                 return;
             }
-            RectangleImmutable monitorVp = screen.getMonitorDevices().get(1).getViewport();
+            final RectangleImmutable monitorVp = screen.getMonitorDevices().get(1).getViewport();
             testScreenFullscreenImpl(screen, monitorVp.getX(), monitorVp.getY(), false, null);
         } finally {
             screen.removeReference();
-            Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false));            
+            AWTRobotUtil.waitForRealized(screen, false); // don't override a previous assertion failure
         }
     }
-        
+
     @Test
     public void testScreenFullscreenSpanQ1Q2() throws InterruptedException {
         final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
         final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
-        screen.addReference(); // trigger creation        
+        screen.addReference(); // trigger creation
         try {
-            final int crtCount = screen.getMonitorDevices().size();
-            if( 2 >= crtCount ) {
-                System.err.println("Test Disabled (2): Spanning monitor count "+2+" >= screen monitor count: "+screen);
-                return;            
-            }            
+            if( 2 > screen.getMonitorDevices().size() ) {
+                System.err.println("Test Disabled (2): Spanning monitor count < 2: "+screen);
+                return;
+            }
             final ArrayList<MonitorDevice> monitors = new ArrayList<MonitorDevice>();
             monitors.add(screen.getMonitorDevices().get(0)); // Q1
             monitors.add(screen.getMonitorDevices().get(1)); // Q2
-            RectangleImmutable monitorVp = screen.getMonitorDevices().get(0).getViewport();
+            final RectangleImmutable monitorVp = screen.getMonitorDevices().get(0).getViewport();
             testScreenFullscreenImpl(screen, monitorVp.getX()+50, monitorVp.getY()+50, true, monitors);
         } finally {
             screen.removeReference();
-            Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false));            
+            AWTRobotUtil.waitForRealized(screen, false); // don't override a previous assertion failure
         }
     }
-    
+
     @Test
     public void testScreenFullscreenSpanALL() throws InterruptedException {
         final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
         final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
-        screen.addReference(); // trigger creation        
+        screen.addReference(); // trigger creation
         try {
             if( 2 > screen.getMonitorDevices().size() ) {
                 System.err.println("Test Disabled (3): Monitor count < 2: "+screen);
                 return;
             }
-            RectangleImmutable monitorVp = screen.getMonitorDevices().get(1).getViewport();
+            final RectangleImmutable monitorVp = screen.getMonitorDevices().get(1).getViewport();
             testScreenFullscreenImpl(screen, monitorVp.getX()-50, monitorVp.getY()+50, true, null);
         } finally {
             screen.removeReference();
-            Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false));            
+            AWTRobotUtil.waitForRealized(screen, false); // don't override a previous assertion failure
         }
     }
-    
-    void testScreenFullscreenImpl(final Screen screen, int xpos, int ypos, boolean spanAcrossMonitors, List<MonitorDevice> monitors) throws InterruptedException {
+
+    void testScreenFullscreenImpl(final Screen screen, final int screenXPos, final int screenYPos,
+                                  final boolean spanAcrossMonitors, final List<MonitorDevice> monitors) throws InterruptedException {
         Thread.sleep(waitTimeShort);
 
         final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
         final Display display = screen.getDisplay();
-        
+
         System.err.println("Test.0: Window screen: "+screen);
-        
-        System.err.println("Test.0: Window bounds (pre): "+xpos+"/"+ypos+" "+width+"x"+height+" within "+screen.getViewport());
-        
-        GLWindow window0 = createWindow(screen, caps, "win0", xpos, ypos, width, height);
-        Assert.assertNotNull(window0);        
-        System.err.println("Test.0: Window bounds: "+window0.getX()+"/"+window0.getY()+" "+window0.getWidth()+"x"+window0.getHeight()+" within "+screen.getViewport());
+
+        System.err.println("Test.0: Window bounds (pre): screenPos "+screenXPos+"/"+screenYPos+" [pixels], windowSize "+width+"x"+height+" [wu] within "+screen.getViewport()+" [pixels]");
+
+        final GLWindow window0 = createWindow(screen, caps, "win0", screenXPos, screenYPos, width, height);
+        Assert.assertNotNull(window0);
+        Rectangle window0WindowBounds = window0.getBounds();
+        DimensionImmutable window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
+        System.err.println("Test.0: Window bounds    : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
+        System.err.println("Test.0: Window size      : "+window0SurfaceSize+" [pixels]");
+        System.err.println("Test.0: Screen viewport  : "+screen.getViewport()+" [pixels]");
 
         final Animator anim = new Animator(window0);
         anim.start();
-        
-        List<MonitorMode> allMonitorModes = screen.getMonitorModes();
+
+        final List<MonitorMode> allMonitorModes = screen.getMonitorModes();
         Assert.assertTrue(allMonitorModes.size()>0);
 
         MonitorDevice monitor = window0.getMainMonitor();
@@ -214,29 +223,36 @@ public class TestScreenMode01cNEWT extends UITestCase {
         }
 
         monitor = window0.getMainMonitor();
-        System.err.println("Test.1: Window bounds: "+window0.getX()+"/"+window0.getY()+" "+window0.getWidth()+"x"+window0.getHeight()+" within "+screen.getViewport());
-        System.err.println("Test.1: Window monitor: "+monitor.getViewport());
-        Rectangle window0Rect = new Rectangle(window0.getX(), window0.getY(), window0.getWidth(), window0.getHeight());
+        window0WindowBounds = window0.getBounds();
+        window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());
+        System.err.println("Test.1: Window bounds    : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
+        System.err.println("Test.1: Window size      : "+window0SurfaceSize+" [pixels]");
+        System.err.println("Test.1: Screen viewport  : "+screen.getViewport()+" [pixels]");
+        System.err.println("Test.1: Monitor viewport : "+monitor.getViewport()+" [pixels], "+monitor.getViewportInWindowUnits()+" [wu]");
         if( !spanAcrossMonitors ) {
-            Assert.assertEquals(monitor.getViewport(),  window0Rect);
+            Assert.assertEquals(monitor.getViewportInWindowUnits(), window0WindowBounds);
         } else {
             List<MonitorDevice> monitorsUsed = monitors;
             if( null == monitorsUsed ) {
                 monitorsUsed = window0.getScreen().getMonitorDevices();
             }
-            Rectangle monitorsUsedViewport = MonitorDevice.unionOfViewports(new Rectangle(), monitorsUsed);
-            Assert.assertEquals(monitorsUsedViewport,  window0Rect);
+            final Rectangle monitorsUsedViewport = new Rectangle();
+            MonitorDevice.unionOfViewports(null, monitorsUsedViewport, monitorsUsed);
+            Assert.assertEquals(monitorsUsedViewport,  window0WindowBounds);
         }
-        
+
         Thread.sleep(duration);
 
         window0.setFullscreen(false);
-        
-        window0Rect = new Rectangle(window0.getX(), window0.getY(), window0.getWidth(), window0.getHeight());
+
+        window0WindowBounds = window0.getBounds();
+        window0SurfaceSize = new Dimension(window0.getSurfaceWidth(), window0.getSurfaceHeight());;
         monitor = window0.getMainMonitor();
-        System.err.println("Test.2: Window bounds: "+window0.getX()+"/"+window0.getY()+" "+window0.getWidth()+"x"+window0.getHeight()+" within "+screen.getViewport());
-        System.err.println("Test.2: Window monitor: "+monitor.getViewport());        
-                
+        System.err.println("Test.2: Window bounds    : "+window0WindowBounds+" [wu] within "+screen.getViewportInWindowUnits()+" [wu]");
+        System.err.println("Test.2: Window size      : "+window0SurfaceSize+" [pixels]");
+        System.err.println("Test.2: Screen viewport  : "+screen.getViewport()+" [pixels]");
+        System.err.println("Test.2: Monitor viewport : "+monitor.getViewport()+" [pixels], "+monitor.getViewportInWindowUnits()+" [wu]");
+
         Thread.sleep(duration);
         anim.stop();
         destroyWindow(window0);
@@ -246,14 +262,14 @@ public class TestScreenMode01cNEWT extends UITestCase {
         Assert.assertEquals(true,screen.isNativeValid());
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 i++;
                 duration = MiscUtils.atol(args[i], duration);
             }
         }
-        String tstname = TestScreenMode01cNEWT.class.getName();
+        final String tstname = TestScreenMode01cNEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java
index 6158e62..4d109a9 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode01dNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.mm;
 
 import java.io.IOException;
@@ -55,7 +55,6 @@ import com.jogamp.opengl.test.junit.util.UITestCase;
 
 import java.util.List;
 import javax.media.nativewindow.util.Dimension;
-import javax.media.nativewindow.util.Rectangle;
 import javax.media.nativewindow.util.RectangleImmutable;
 
 /**
@@ -66,13 +65,13 @@ import javax.media.nativewindow.util.RectangleImmutable;
  * i.e. the original MonitorMode should get reinstated!
  * </p>
  * <p>
- * Also documents NV RANDR/GL bug, see {@link TestScreenMode01dNEWT#cleanupGL()}.</p> 
+ * Also documents NV RANDR/GL bug, see {@link TestScreenMode01dNEWT#cleanupGL()}.</p>
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestScreenMode01dNEWT extends UITestCase {
     static GLProfile glp;
     static int width, height;
-    
+
     static int waitTimeShort = 2000; // 2 sec
     static int waitTimeLong = 8000; // 8 sec
 
@@ -88,13 +87,13 @@ public class TestScreenMode01dNEWT extends UITestCase {
     public static void releaseClass() throws InterruptedException {
         Thread.sleep(waitTimeShort);
     }
-    
+
     /**
      * Following configurations results in a SIGSEGV:
      * <pre>
      *   Ubuntu 11.04 (natty), NV GTX 460, driver [280.10* - 285.03]
      * </pre>
-     * 
+     *
      * Situation:
      * <pre>
      *   1 - Create Screen, GLWindow (w/ context)
@@ -102,19 +101,19 @@ public class TestScreenMode01dNEWT extends UITestCase {
      *   3 - Destroy GLWindow (w/ context), Screen
      *   4 - Create  Screen, GLWindow (w/ context) (*)
      * </pre>
-     *   
+     *
      * Step 4 causes the exception within 1st 'glXMakeContextCurrent(..)' call
      * on the the created GL context.
-     * 
+     *
      * Remedy:
      * <pre>
      *   A) Releasing all resources before step 4 .. works.
      *   B) Holding the native Display/Screen in NEWT also works (ie screen.addReference()).
      * </pre>
-     * 
+     *
      * Hence there must be some correlations with the screen randr mode
      * and some of the glcontext/gldrawables.
-     * 
+     *
      * <pre>
      * Remedy A) is demonstrated here
      * Remedy B) is shown in {@link TestScreenMode01bNEWT}
@@ -127,12 +126,12 @@ public class TestScreenMode01dNEWT extends UITestCase {
         GLProfile.initSingleton();
         System.err.println("*** cleanupGL.DONE");
     }
-    
-    static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
+
+    static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final int width, final int height, final boolean onscreen, final boolean undecorated) {
         Assert.assertNotNull(caps);
         caps.setOnscreen(onscreen);
 
-        GLWindow window = GLWindow.create(screen, caps);
+        final GLWindow window = GLWindow.create(screen, caps);
         window.setSize(width, height);
         window.addGLEventListener(new GearsES2());
         Assert.assertNotNull(window);
@@ -140,60 +139,60 @@ public class TestScreenMode01dNEWT extends UITestCase {
         return window;
     }
 
-    static void destroyWindow(Window window) throws InterruptedException {
+    static void destroyWindow(final Window window) throws InterruptedException {
         if(null!=window) {
             window.destroy();
-            Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));            
+            Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));
         }
     }
-    
+
     @Test
     public void test01FullscreenChange01() throws InterruptedException {
         Thread.sleep(waitTimeShort);
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
-        Display display = NewtFactory.createDisplay(null); // local display
+        final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
 
-        GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
-        Animator animator = new Animator(window);
+        final GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+        final Animator animator = new Animator(window);
         animator.start();
-        
+
         final MonitorDevice monitor = window.getMainMonitor();
-        
+
         Assert.assertEquals(false, window.isFullscreen());
         Assert.assertEquals(width, window.getWidth());
         Assert.assertEquals(height, window.getHeight());
-        
+
         window.setFullscreen(true);
-        Assert.assertEquals(true, window.isFullscreen());        
-        Assert.assertEquals(monitor.getViewport().getWidth(), window.getWidth());
-        Assert.assertEquals(monitor.getViewport().getHeight(), window.getHeight());
-        
+        Assert.assertEquals(true, window.isFullscreen());
+        Assert.assertEquals(monitor.getViewport().getWidth(), window.getSurfaceWidth());
+        Assert.assertEquals(monitor.getViewport().getHeight(), window.getSurfaceHeight());
+
         Thread.sleep(waitTimeShort);
 
         window.setFullscreen(false);
         Assert.assertEquals(false, window.isFullscreen());
         Assert.assertEquals(width, window.getWidth());
         Assert.assertEquals(height, window.getHeight());
-        
+
         Thread.sleep(waitTimeShort);
 
         animator.stop();
         Assert.assertEquals(false, animator.isAnimating());
         Assert.assertEquals(false, animator.isStarted());
-        
+
         destroyWindow(window);
-        
+
         Assert.assertEquals(false,window.isVisible());
         Assert.assertEquals(false,window.isRealized());
         Assert.assertEquals(false,window.isNativeValid());
         Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false));
         Assert.assertEquals(false,screen.isNativeValid());
         Assert.assertEquals(false,display.isNativeValid());
-        
+
         cleanupGL();
     }
 
@@ -201,18 +200,18 @@ public class TestScreenMode01dNEWT extends UITestCase {
     public void test02ScreenModeChange01() throws InterruptedException {
         Thread.sleep(waitTimeShort);
 
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
-        Display display = NewtFactory.createDisplay(null); // local display
+        final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
-        GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+        final GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
         Assert.assertNotNull(window);
 
-        final RectangleImmutable winRect = new Rectangle(window.getX(), window.getY(), window.getWidth(), window.getHeight());
-        final MonitorDevice monitor = screen.getMainMonitor(winRect);
-        
+        final RectangleImmutable winRect = window.getBounds();
+        final MonitorDevice monitor = screen.getMainMonitor( winRect );
+
         List<MonitorMode> monitorModes = monitor.getSupportedModes();
         Assert.assertTrue(monitorModes.size()>0);
         if(monitorModes.size()==1) {
@@ -222,12 +221,12 @@ public class TestScreenMode01dNEWT extends UITestCase {
             return;
         }
 
-        Animator animator = new Animator(window);
+        final Animator animator = new Animator(window);
         animator.start();
 
         MonitorMode mmCurrent = monitor.queryCurrentMode();
         Assert.assertNotNull(mmCurrent);
-        MonitorMode mmOrig = monitor.getOriginalMode();
+        final MonitorMode mmOrig = monitor.getOriginalMode();
         Assert.assertNotNull(mmOrig);
         System.err.println("[0] orig   : "+mmOrig);
         System.err.println("[0] current: "+mmCurrent);
@@ -245,14 +244,14 @@ public class TestScreenMode01dNEWT extends UITestCase {
         monitorModes = MonitorModeUtil.filterByRate(monitorModes, mmOrig.getRefreshRate());
         Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
-        
+
         monitorModes = MonitorModeUtil.getHighestAvailableBpp(monitorModes);
         Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
 
         // set mode
         {
-            MonitorMode sm = (MonitorMode) monitorModes.get(0);
+            final MonitorMode sm = monitorModes.get(0);
             System.err.println("[0] set current: "+sm);
             final boolean smOk = monitor.setCurrentMode(sm);
             mmCurrent = monitor.getCurrentMode();
@@ -263,7 +262,7 @@ public class TestScreenMode01dNEWT extends UITestCase {
             Assert.assertEquals(mmCurrent, monitor.queryCurrentMode());
             Assert.assertTrue(smOk);
         }
-        
+
         Thread.sleep(waitTimeLong);
 
         Assert.assertEquals(true,display.isNativeValid());
@@ -271,10 +270,10 @@ public class TestScreenMode01dNEWT extends UITestCase {
         Assert.assertEquals(true,window.isNativeValid());
         Assert.assertEquals(true,window.isVisible());
 
-        animator.stop();        
+        animator.stop();
         Assert.assertEquals(false, animator.isAnimating());
         Assert.assertEquals(false, animator.isStarted());
-        
+
         destroyWindow(window);
 
         Assert.assertEquals(false,window.isVisible());
@@ -300,24 +299,24 @@ public class TestScreenMode01dNEWT extends UITestCase {
         testScreenModeChangeWithFS01Impl(true) ;
     }
 
-    protected void testScreenModeChangeWithFS01Impl(boolean preFS) throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
-        Display display = NewtFactory.createDisplay(null); // local display
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
-        GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
-        Animator animator = new Animator(window);
+    protected void testScreenModeChangeWithFS01Impl(final boolean preFS) throws InterruptedException {
+        final GLCapabilities caps = new GLCapabilities(glp);
+        final Display display = NewtFactory.createDisplay(null); // local display
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+        final Animator animator = new Animator(window);
         animator.start();
 
-        final RectangleImmutable winRect = new Rectangle(window.getX(), window.getY(), window.getWidth(), window.getHeight());
+        final RectangleImmutable winRect = window.getBounds();
         final MonitorDevice monitor = screen.getMainMonitor(winRect);
         MonitorMode mmCurrent = monitor.queryCurrentMode();
         Assert.assertNotNull(mmCurrent);
-        MonitorMode mmOrig = monitor.getOriginalMode();
+        final MonitorMode mmOrig = monitor.getOriginalMode();
         Assert.assertNotNull(mmOrig);
         System.err.println("[0] orig   : "+mmOrig);
         System.err.println("[0] current: "+mmCurrent);
         Assert.assertEquals(mmCurrent, mmOrig);
-        
+
         List<MonitorMode> monitorModes = monitor.getSupportedModes();
         if(monitorModes.size()==1) {
             // no support ..
@@ -331,48 +330,48 @@ public class TestScreenMode01dNEWT extends UITestCase {
         monitorModes = MonitorModeUtil.filterByRate(monitorModes, mmOrig.getRefreshRate());
         monitorModes = MonitorModeUtil.getHighestAvailableBpp(monitorModes);
 
-        MonitorMode monitorMode = (MonitorMode) monitorModes.get(0);
+        final MonitorMode monitorMode = monitorModes.get(0);
         Assert.assertNotNull(monitorMode);
-        
+
         if(preFS) {
-            System.err.println("[0] set FS pre 0: "+window.isFullscreen());
+            System.err.println("[1] set FS pre 0: "+window.isFullscreen());
             window.setFullscreen(true);
-            System.err.println("[0] set FS pre 1: "+window.isFullscreen());
+            System.err.println("[1] set FS pre 1: "+window.isFullscreen());
             Assert.assertEquals(true, window.isFullscreen());
-            System.err.println("[0] set FS pre X: "+window.isFullscreen());
+            System.err.println("[1] set FS pre X: "+window.isFullscreen());
         }
         Thread.sleep(waitTimeShort);
-        
+
         // set mode
         {
-            System.err.println("[0] set current: "+monitorMode);
+            System.err.println("[2] set current: "+monitorMode);
             final boolean smOk = monitor.setCurrentMode(monitorMode);
             mmCurrent = monitor.getCurrentMode();
-            System.err.println("[0] has current: "+mmCurrent+", changeOK "+smOk);
+            System.err.println("[2] has current: "+mmCurrent+", changeOK "+smOk);
             Assert.assertTrue(monitor.isModeChangedByUs());
             Assert.assertEquals(monitorMode, mmCurrent);
             Assert.assertNotSame(mmOrig, mmCurrent);
             Assert.assertEquals(mmCurrent, monitor.queryCurrentMode());
             Assert.assertTrue(smOk);
         }
-        
+
         if(!preFS) {
-            System.err.println("[0] set FS post 0: "+window.isFullscreen());
+            System.err.println("[3] set FS post 0: "+window.isFullscreen());
             window.setFullscreen(true);
             Assert.assertEquals(true, window.isFullscreen());
-            System.err.println("[0] set FS post X: "+window.isFullscreen());
+            System.err.println("[3] set FS post X: "+window.isFullscreen());
         }
 
         Thread.sleep(waitTimeLong);
-        
+
         if(!preFS) {
-            System.err.println("[0] set !FS post 0: "+window.isFullscreen());
+            System.err.println("[4] set !FS post 0: "+window.isFullscreen());
             window.setFullscreen(false);
             Assert.assertEquals(false, window.isFullscreen());
-            System.err.println("[0] set !FS post X: "+window.isFullscreen());
+            System.err.println("[4] set !FS post X: "+window.isFullscreen());
             Thread.sleep(waitTimeShort);
         }
-                
+
         Assert.assertEquals(true,display.isNativeValid());
         Assert.assertEquals(true,screen.isNativeValid());
         Assert.assertEquals(true,window.isNativeValid());
@@ -381,7 +380,7 @@ public class TestScreenMode01dNEWT extends UITestCase {
         animator.stop();
         Assert.assertEquals(false, animator.isAnimating());
         Assert.assertEquals(false, animator.isStarted());
-        
+
         destroyWindow(window);
 
         Assert.assertEquals(false,window.isVisible());
@@ -395,6 +394,11 @@ public class TestScreenMode01dNEWT extends UITestCase {
         cleanupGL();
     }
 
+    /**
+     *
+     * @param mmOrig
+     * @param rect in window units
+     */
     void validateScreenModeReset(final MonitorMode mmOrig, final RectangleImmutable rect) {
         final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
@@ -405,17 +409,17 @@ public class TestScreenMode01dNEWT extends UITestCase {
         screen.addReference();
         Assert.assertEquals(true,display.isNativeValid());
         Assert.assertEquals(true,screen.isNativeValid());
-        
+
         final MonitorDevice monitor = screen.getMainMonitor(rect);
         Assert.assertEquals(mmOrig, monitor.getCurrentMode());
-        
+
         screen.removeReference();
         Assert.assertEquals(false,display.isNativeValid());
         Assert.assertEquals(false,screen.isNativeValid());
     }
-    
-    public static void main(String args[]) throws IOException {
-        String tstname = TestScreenMode01dNEWT.class.getName();
+
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestScreenMode01dNEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02aNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02aNEWT.java
index e87194b..c2d769a 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02aNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02aNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.mm;
 
 import java.io.IOException;
@@ -59,14 +59,14 @@ import javax.media.nativewindow.util.Dimension;
  * Tests MonitorMode change w/ changed rotation,
  * w/ and w/o fullscreen, pre and post MonitorMode change.
  * <p>
- * MonitorMode change does not use highest resolution. 
+ * MonitorMode change does not use highest resolution.
  * </p>
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestScreenMode02aNEWT extends UITestCase {
     static GLProfile glp;
     static int width, height;
-    
+
     static int waitTimeShort = 2000; // 2 sec
     static int waitTimeLong = 8000; // 8 sec
 
@@ -78,52 +78,52 @@ public class TestScreenMode02aNEWT extends UITestCase {
         glp = GLProfile.getDefault();
     }
 
-    static GLWindow createWindow(Screen screen, GLCapabilities caps, int width, int height, boolean onscreen, boolean undecorated) {
+    static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final int width, final int height, final boolean onscreen, final boolean undecorated) {
         Assert.assertNotNull(caps);
         caps.setOnscreen(onscreen);
 
-        GLWindow window = GLWindow.create(screen, caps);
+        final GLWindow window = GLWindow.create(screen, caps);
         window.setSize(width, height);
         window.addGLEventListener(new GearsES2(1));
         Assert.assertNotNull(window);
         return window;
     }
 
-    static void destroyWindow(Window window) throws InterruptedException {
+    static void destroyWindow(final Window window) throws InterruptedException {
         if(null!=window) {
             window.destroy();
             Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));
         }
     }
-    
+
     @Test
     public void testScreenRotationChange01_PreWin() throws InterruptedException {
         testScreenRotationChangeImpl(true, true, false);
     }
-    
+
     @Test
     public void testScreenRotationChange02_PreFull() throws InterruptedException {
         testScreenRotationChangeImpl(true, true, true);
     }
-    
+
     @Test
     public void testScreenRotationChange11_PostWin() throws InterruptedException {
         testScreenRotationChangeImpl(true, false, false);
     }
-    
+
     @Test
     public void testScreenRotationChange12_PostFull() throws InterruptedException {
         testScreenRotationChangeImpl(true, false, true);
     }
-    
-    void testScreenRotationChangeImpl(boolean changeMode, boolean preVis, boolean fullscreen) throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+
+    void testScreenRotationChangeImpl(final boolean changeMode, final boolean preVis, final boolean fullscreen) throws InterruptedException {
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
-        Display display = NewtFactory.createDisplay(null); // local display
+        final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
-        GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
+        final GLWindow window = createWindow(screen, caps, width, height, true /* onscreen */, false /* undecorated */);
         Assert.assertNotNull(window);
         if( preVis ) {
             window.setVisible(true);
@@ -136,9 +136,9 @@ public class TestScreenMode02aNEWT extends UITestCase {
             Assert.assertEquals(true,screen.isNativeValid());
         }
 
-        Animator animator = new Animator(window);
+        final Animator animator = new Animator(window);
         animator.start();
-        
+
         final MonitorDevice monitor = window.getMainMonitor();
         final MonitorMode mmOrig = monitor.getOriginalMode();
         Assert.assertNotNull(mmOrig);
@@ -154,13 +154,13 @@ public class TestScreenMode02aNEWT extends UITestCase {
                 return;
             }
             Assert.assertTrue(monitorModes.size()>0);
-    
+
             MonitorMode mmCurrent = monitor.getCurrentMode();
             Assert.assertNotNull(mmCurrent);
             System.err.println("[0] orig   : "+mmOrig);
             System.err.println("[0] current: "+mmCurrent);
             Assert.assertEquals(mmCurrent, mmOrig);
-    
+
             monitorModes = MonitorModeUtil.filterByFlags(monitorModes, 0); // no interlace, double-scan etc
             Assert.assertNotNull(monitorModes);
             Assert.assertTrue(monitorModes.size()>0);
@@ -181,10 +181,10 @@ public class TestScreenMode02aNEWT extends UITestCase {
             monitorModes = MonitorModeUtil.getHighestAvailableBpp(monitorModes);
             Assert.assertNotNull(monitorModes);
             Assert.assertTrue(monitorModes.size()>0);
-    
+
             // set mode
             {
-                MonitorMode mm = monitorModes.get(0);
+                final MonitorMode mm = monitorModes.get(0);
                 System.err.println("[0] set current: "+mm);
                 final boolean smOk = monitor.setCurrentMode(mm);
                 mmCurrent = monitor.getCurrentMode();
@@ -196,40 +196,40 @@ public class TestScreenMode02aNEWT extends UITestCase {
                 Assert.assertTrue(smOk);
             }
         }
-        
+
         if( !preVis ) {
             if( fullscreen ) {
                 window.setFullscreen(true);
             }
             window.setVisible(true);
         }
-        
+
         Thread.sleep(waitTimeLong);
-        
+
         if( !preVis && fullscreen ) {
             window.setFullscreen(false);
         }
-        
+
         if(changeMode) {
             Thread.sleep(waitTimeShort);
-            
+
             // manual restore!
             {
                 System.err.println("[1] set orig: "+mmOrig);
                 final boolean smOk = monitor.setCurrentMode(mmOrig);
-                MonitorMode mmCurrent = monitor.getCurrentMode();
+                final MonitorMode mmCurrent = monitor.getCurrentMode();
                 System.err.println("[1] has orig?: "+mmCurrent+", changeOK "+smOk);
                 Assert.assertFalse(monitor.isModeChangedByUs());
                 Assert.assertEquals(mmOrig, mmCurrent);
                 Assert.assertTrue(smOk);
-            }        
+            }
             Thread.sleep(waitTimeShort);
         }
-            
+
         if( preVis && fullscreen ) {
             window.setFullscreen(false);
         }
-        
+
         Assert.assertEquals(true,display.isNativeValid());
         Assert.assertEquals(true,screen.isNativeValid());
         Assert.assertEquals(true,window.isNativeValid());
@@ -237,7 +237,7 @@ public class TestScreenMode02aNEWT extends UITestCase {
 
         animator.stop();
         destroyWindow(window);
-        
+
         Assert.assertEquals(false,window.isVisible());
         Assert.assertEquals(false,window.isNativeValid());
         Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false));
@@ -245,8 +245,8 @@ public class TestScreenMode02aNEWT extends UITestCase {
         Assert.assertEquals(false,display.isNativeValid());
     }
 
-    public static void main(String args[]) throws IOException {
-        String tstname = TestScreenMode02aNEWT.class.getName();
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestScreenMode02aNEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02bNEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02bNEWT.java
index 2da2abd..47fd53e 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02bNEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/mm/TestScreenMode02bNEWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.mm;
 
 import java.io.IOException;
@@ -59,7 +59,7 @@ import javax.media.nativewindow.util.Dimension;
 /**
  * Tests MonitorMode change w/ changed rotation and fullscreen.
  * <p>
- * MonitorMode change uses highest resolution. 
+ * MonitorMode change uses highest resolution.
  * </p>
  * <p>
  * Bug 734 could not be reproduced, however on tests systems
@@ -69,13 +69,13 @@ import javax.media.nativewindow.util.Dimension;
  * <p>
  * Documents remedy B) for NV RANDR/GL bug
  * </p>
- * 
+ *
  * @see TestScreenMode01NEWT#cleanupGL()
  */
 @FixMethodOrder(MethodSorters.NAME_ASCENDING)
 public class TestScreenMode02bNEWT extends UITestCase {
     static GLProfile glp;
-    
+
     static int waitTimeShort = 2000; // 2 sec
     static int waitTimeLong = 8000; // 8 sec
 
@@ -89,11 +89,11 @@ public class TestScreenMode02bNEWT extends UITestCase {
     public static void releaseClass() throws InterruptedException {
         Thread.sleep(waitTimeShort);
     }
-    
-    static GLWindow createWindow(Screen screen, GLCapabilities caps, String name, int x, int y, int width, int height) {
+
+    static GLWindow createWindow(final Screen screen, final GLCapabilities caps, final String name, final int x, final int y, final int width, final int height) {
         Assert.assertNotNull(caps);
 
-        GLWindow window = GLWindow.create(screen, caps);
+        final GLWindow window = GLWindow.create(screen, caps);
         // Window window = NewtFactory.createWindow(screen, caps);
         window.setTitle(name);
         window.setPosition(x, y);
@@ -103,43 +103,43 @@ public class TestScreenMode02bNEWT extends UITestCase {
         return window;
     }
 
-    static void destroyWindow(Window window) throws InterruptedException {
+    static void destroyWindow(final Window window) throws InterruptedException {
         if(null!=window) {
             window.destroy();
             Assert.assertTrue(AWTRobotUtil.waitForRealized(window, false));
         }
     }
-    
+
     @Test
     public void testScreenModeChange01_PreFull() throws InterruptedException {
         testScreenModeChangeImpl(true);
     }
-    
+
     @Test
     public void testScreenModeChange02_PostFull() throws InterruptedException {
         testScreenModeChangeImpl(false);
     }
-    
-    void testScreenModeChangeImpl(boolean preVis) throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(glp);
+
+    void testScreenModeChangeImpl(final boolean preVis) throws InterruptedException {
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
-        Display display = NewtFactory.createDisplay(null); // local display
+        final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
         screen.createNative(); // instantiate for resolution query and keep it alive !
         final int swidth = screen.getWidth();
         final int sheight = screen.getHeight();
 
-        GLWindow window = createWindow(screen, caps, "win0", 0, 0, 640, 480);
+        final GLWindow window = createWindow(screen, caps, "win0", 0, 0, 640, 480);
         if( preVis ) {
             window.setVisible(true);
             window.setFullscreen(true);
         }
         window.setUndecorated(true);
-        Assert.assertNotNull(window);        
+        Assert.assertNotNull(window);
 
-        List<MonitorMode> allMonitorModes = screen.getMonitorModes();
+        final List<MonitorMode> allMonitorModes = screen.getMonitorModes();
         Assert.assertTrue(allMonitorModes.size()>0);
         if(allMonitorModes.size()==1) {
             // no support ..
@@ -148,7 +148,7 @@ public class TestScreenMode02bNEWT extends UITestCase {
             return;
         }
 
-        MonitorDevice monitor = window.getMainMonitor();        
+        final MonitorDevice monitor = window.getMainMonitor();
         List<MonitorMode> monitorModes = monitor.getSupportedModes();
         Assert.assertTrue(monitorModes.size()>0);
         if(monitorModes.size()==1) {
@@ -158,10 +158,10 @@ public class TestScreenMode02bNEWT extends UITestCase {
             return;
         }
         Assert.assertTrue(allMonitorModes.containsAll(monitorModes));
-                
-        Animator animator = new Animator(window);
+
+        final Animator animator = new Animator(window);
         animator.start();
-        
+
         MonitorMode mmCurrent = monitor.queryCurrentMode();
         Assert.assertNotNull(mmCurrent);
         final MonitorMode mmOrig = monitor.getOriginalMode();
@@ -169,7 +169,7 @@ public class TestScreenMode02bNEWT extends UITestCase {
         System.err.println("[0] orig   : "+mmOrig);
         System.err.println("[0] current: "+mmCurrent);
         Assert.assertEquals(mmCurrent, mmOrig);
-        
+
         monitorModes = MonitorModeUtil.filterByFlags(monitorModes, 0); // no interlace, double-scan etc
         Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
@@ -185,16 +185,16 @@ public class TestScreenMode02bNEWT extends UITestCase {
         Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
         monitorModes = MonitorModeUtil.filterByRate(monitorModes, mmOrig.getRefreshRate());
-        Assert.assertNotNull(monitorModes);        
+        Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
-        
+
         monitorModes = MonitorModeUtil.getHighestAvailableBpp(monitorModes);
         Assert.assertNotNull(monitorModes);
         Assert.assertTrue(monitorModes.size()>0);
 
         // set mode
         {
-            MonitorMode mm = monitorModes.get(0); // highest resolution ..
+            final MonitorMode mm = monitorModes.get(0); // highest resolution ..
             System.err.println("[0] set current: "+mm);
             final boolean smOk = monitor.setCurrentMode(mm);
             mmCurrent = monitor.getCurrentMode();
@@ -216,13 +216,13 @@ public class TestScreenMode02bNEWT extends UITestCase {
             window.setFullscreen(true);
             window.setVisible(true);
         }
-        
+
         Thread.sleep(waitTimeLong);
-        
+
         if( !preVis ) {
             window.setFullscreen(false);
         }
-        
+
         // manual restore!
         {
             System.err.println("[1] set orig: "+mmOrig);
@@ -232,21 +232,21 @@ public class TestScreenMode02bNEWT extends UITestCase {
             Assert.assertFalse(monitor.isModeChangedByUs());
             Assert.assertEquals(mmOrig, mmCurrent);
             Assert.assertTrue(smOk);
-        }        
+        }
         Thread.sleep(waitTimeShort);
 
         if( preVis ) {
             window.setFullscreen(false);
         }
-        
+
         Assert.assertEquals(true,display.isNativeValid());
         Assert.assertEquals(true,screen.isNativeValid());
         Assert.assertEquals(true,window.isNativeValid());
         Assert.assertEquals(true,window.isVisible());
 
-        animator.stop();        
+        animator.stop();
         destroyWindow(window);
-        
+
         Assert.assertEquals(false,window.isVisible());
         Assert.assertEquals(false,window.isNativeValid());
         Assert.assertTrue(AWTRobotUtil.waitForRealized(screen, false));
@@ -254,8 +254,8 @@ public class TestScreenMode02bNEWT extends UITestCase {
         Assert.assertEquals(false,display.isNativeValid());
     }
 
-    public static void main(String args[]) throws IOException {
-        String tstname = TestScreenMode02bNEWT.class.getName();
+    public static void main(final String args[]) throws IOException {
+        final String tstname = TestScreenMode02bNEWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/GLRunnableDummy.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/GLRunnableDummy.java
index 1ca7477..18f2b9b 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/GLRunnableDummy.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/GLRunnableDummy.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.parenting;
 
 import javax.media.opengl.*;
@@ -36,8 +36,8 @@ public class GLRunnableDummy implements GLRunnable {
     float b=0.0f;
     float d=0.1f;
 
-    public boolean run(GLAutoDrawable drawable) {
-        GL2ES1 gl = drawable.getGL().getGL2ES1();
+    public boolean run(final GLAutoDrawable drawable) {
+        final GL2ES1 gl = drawable.getGL().getGL2ES1();
         gl.glClearColor(r, g, b, 1f);
         r+=d;
         if(r>1f) {
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/KeyAction.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/KeyAction.java
index 0ae94d7..64867b0 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/KeyAction.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/KeyAction.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 
 package com.jogamp.opengl.test.junit.newt.parenting;
 
@@ -34,14 +34,14 @@ import com.jogamp.newt.event.*;
 class KeyAction extends KeyAdapter {
     NEWTEventFiFo eventFifo;
 
-    public KeyAction(NEWTEventFiFo eventFifo) { 
-        this.eventFifo = eventFifo; 
+    public KeyAction(final NEWTEventFiFo eventFifo) {
+        this.eventFifo = eventFifo;
     }
 
-    public void keyReleased(KeyEvent e) {
+    public void keyReleased(final KeyEvent e) {
         if( !e.isPrintableKey() || e.isAutoRepeat() ) {
             return;
-        }            
+        }
         eventFifo.put(e);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java
index dc9aac8..75037b6 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/NewtAWTReparentingKeyAdapter.java
@@ -50,20 +50,20 @@ public class NewtAWTReparentingKeyAdapter extends KeyAdapter {
     PointerIcon[] pointerIcons = null;
     int pointerIconIdx = 0;
 
-    public NewtAWTReparentingKeyAdapter(Frame frame, NewtCanvasAWT newtCanvasAWT, GLWindow glWindow, QuitAdapter quitAdapter) {
+    public NewtAWTReparentingKeyAdapter(final Frame frame, final NewtCanvasAWT newtCanvasAWT, final GLWindow glWindow, final QuitAdapter quitAdapter) {
         this.frame = frame;
         this.newtCanvasAWT = newtCanvasAWT;
         this.glWindow = glWindow;
         this.quitAdapter = quitAdapter;
     }
 
-    public void keyReleased(KeyEvent e) {
+    public void keyReleased(final KeyEvent e) {
         if( !e.isPrintableKey() || e.isAutoRepeat() ) {
             return;
         }
         if( e.getKeySymbol() == KeyEvent.VK_L ) {
-            javax.media.nativewindow.util.Point p0 = newtCanvasAWT.getNativeWindow().getLocationOnScreen(null);
-            javax.media.nativewindow.util.Point p1 = glWindow.getLocationOnScreen(null);
+            final javax.media.nativewindow.util.Point p0 = newtCanvasAWT.getNativeWindow().getLocationOnScreen(null);
+            final javax.media.nativewindow.util.Point p1 = glWindow.getLocationOnScreen(null);
             System.err.println("NewtCanvasAWT position: "+p0+", "+p1);
         } else if( e.getKeySymbol() == KeyEvent.VK_D ) {
             glWindow.setUndecorated(!glWindow.isUndecorated());
@@ -82,9 +82,9 @@ public class NewtAWTReparentingKeyAdapter extends KeyAdapter {
             new Thread() {
                 public void run() {
                     final Thread t = glWindow.setExclusiveContextThread(null);
-                    System.err.println("[set fullscreen  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+                    System.err.println("[set fullscreen  pre]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
                     glWindow.setFullscreen(!glWindow.isFullscreen());
-                    System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getWidth()+"x"+glWindow.getHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
+                    System.err.println("[set fullscreen post]: "+glWindow.getX()+"/"+glWindow.getY()+" "+glWindow.getSurfaceWidth()+"x"+glWindow.getSurfaceHeight()+", f "+glWindow.isFullscreen()+", a "+glWindow.isAlwaysOnTop()+", "+glWindow.getInsets());
                     glWindow.setExclusiveContextThread(t);
                     if( null != quitAdapter ) {
                         quitAdapter.clear();
@@ -156,7 +156,7 @@ public class NewtAWTReparentingKeyAdapter extends KeyAdapter {
                         try {
                             _pointerIcon = disp.createPointerIcon(res, 8, 8);
                             System.err.println("Create PointerIcon #01: "+_pointerIcon);
-                        } catch (Exception ex) {
+                        } catch (final Exception ex) {
                             ex.printStackTrace();
                         }
                         pointerIcons[0] = _pointerIcon;
@@ -167,7 +167,7 @@ public class NewtAWTReparentingKeyAdapter extends KeyAdapter {
                         try {
                             _pointerIcon = disp.createPointerIcon(res, 0, 0);
                             System.err.println("Create PointerIcon #02: "+_pointerIcon);
-                        } catch (Exception ex) {
+                        } catch (final Exception ex) {
                             ex.printStackTrace();
                         }
                         pointerIcons[1] = _pointerIcon;
@@ -181,7 +181,7 @@ public class NewtAWTReparentingKeyAdapter extends KeyAdapter {
                             System.err.println("Create PointerIcon #03: "+image);
                             _pointerIcon = disp.createPointerIcon(image, 32, 0);
                             System.err.println("Create PointerIcon #03: "+_pointerIcon);
-                        } catch (Exception ex) {
+                        } catch (final Exception ex) {
                             ex.printStackTrace();
                         }
                         pointerIcons[2] = _pointerIcon;
@@ -226,7 +226,7 @@ public class NewtAWTReparentingKeyAdapter extends KeyAdapter {
             new Thread() {
                public void run() {
                    System.err.println("[set mouse pos pre]");
-                   glWindow.warpPointer(glWindow.getWidth()/2, glWindow.getHeight()/2);
+                   glWindow.warpPointer(glWindow.getSurfaceWidth()/2, glWindow.getSurfaceHeight()/2);
                    System.err.println("[set mouse pos post]");
                } }.start();
         }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java
index 714c397..d6658d8 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01NEWT.java
@@ -67,7 +67,7 @@ public class TestParenting01NEWT extends UITestCase {
         Display display = null;
         Screen screen = null;
 
-        GLWindow glWindow1 = GLWindow.create(glCaps);
+        final GLWindow glWindow1 = GLWindow.create(glCaps);
         Assert.assertNotNull(glWindow1);
         Assert.assertEquals(false, glWindow1.isVisible());
         Assert.assertEquals(false, glWindow1.isNativeValid());
@@ -84,11 +84,11 @@ public class TestParenting01NEWT extends UITestCase {
 
         glWindow1.setTitle("test01CreateVisibleDestroy");
         glWindow1.setSize(640, 480);
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
 
-        GLWindow glWindow2 = GLWindow.create(glWindow1, glCaps);
+        final GLWindow glWindow2 = GLWindow.create(glWindow1, glCaps);
         Assert.assertNotNull(glWindow2);
         Assert.assertEquals(false, glWindow2.isVisible());
         Assert.assertEquals(false, glWindow2.isNativeValid());
@@ -96,7 +96,7 @@ public class TestParenting01NEWT extends UITestCase {
         Assert.assertSame(screen,glWindow2.getScreen());
         Assert.assertSame(display,glWindow2.getScreen().getDisplay());
         glWindow2.setSize(320, 240);
-        GLEventListener demo2 = new GearsES2();
+        final GLEventListener demo2 = new GearsES2();
         setDemoFields(demo2, glWindow2, false);
         glWindow2.addGLEventListener(demo2);
 
@@ -150,13 +150,13 @@ public class TestParenting01NEWT extends UITestCase {
 
         glWindow1.resetFPSCounter();
         glWindow2.resetFPSCounter();
-        Animator animator1 = new Animator(glWindow1);
+        final Animator animator1 = new Animator(glWindow1);
         animator1.setUpdateFPSFrames(1, null);
         animator1.start();
         Assert.assertEquals(true, animator1.isAnimating());
         Assert.assertEquals(false, animator1.isPaused());
         Assert.assertNotNull(animator1.getThread());
-        Animator animator2 = new Animator(glWindow2);
+        final Animator animator2 = new Animator(glWindow2);
         animator2.setUpdateFPSFrames(1, null);
         animator2.start();
         Assert.assertEquals(true, animator2.isAnimating());
@@ -305,10 +305,10 @@ public class TestParenting01NEWT extends UITestCase {
         Display display1 = null;
         Screen screen1 = null;
 
-        GLWindow glWindow1 = GLWindow.create(glCaps);
+        final GLWindow glWindow1 = GLWindow.create(glCaps);
         glWindow1.setTitle("test02ReparentTop2Win");
         glWindow1.setSize(640, 480);
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
         screen1 = glWindow1.getScreen();
@@ -322,9 +322,9 @@ public class TestParenting01NEWT extends UITestCase {
         Assert.assertEquals(false,screen1.isNativeValid());
         Assert.assertEquals(0,Display.getActiveDisplayNumber());
 
-        GLWindow glWindow2 = GLWindow.create(glCaps);
+        final GLWindow glWindow2 = GLWindow.create(glCaps);
         glWindow2.setSize(320, 240);
-        GLEventListener demo2 = new GearsES2();
+        final GLEventListener demo2 = new GearsES2();
         setDemoFields(demo2, glWindow2, false);
         glWindow2.addGLEventListener(demo2);
         Assert.assertSame(screen1, glWindow2.getScreen());
@@ -365,10 +365,10 @@ public class TestParenting01NEWT extends UITestCase {
         System.err.println("Frames for setVisible(true) B1: "+glWindow2.getTotalFPSFrames());
         Assert.assertTrue(0 < glWindow1.getTotalFPSFrames());
 
-        Animator animator1 = new Animator(glWindow1);
+        final Animator animator1 = new Animator(glWindow1);
         animator1.setUpdateFPSFrames(1, null);
         animator1.start();
-        Animator animator2 = new Animator(glWindow2);
+        final Animator animator2 = new Animator(glWindow2);
         animator2.setUpdateFPSFrames(1, null);
         animator2.start();
 
@@ -540,12 +540,12 @@ public class TestParenting01NEWT extends UITestCase {
         Display display2 = null;
         Screen screen2 = null;
 
-        GLWindow glWindow1 = GLWindow.create(glCaps);
+        final GLWindow glWindow1 = GLWindow.create(glCaps);
         screen1 = glWindow1.getScreen();
         display1 = screen1.getDisplay();
         glWindow1.setTitle("test03ReparentWin2Top");
         glWindow1.setSize(640, 480);
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
 
@@ -557,11 +557,11 @@ public class TestParenting01NEWT extends UITestCase {
         Assert.assertEquals(false,screen1.isNativeValid());
         Assert.assertEquals(0,Display.getActiveDisplayNumber());
 
-        GLWindow glWindow2 = GLWindow.create(glWindow1, glCaps);
+        final GLWindow glWindow2 = GLWindow.create(glWindow1, glCaps);
         screen2 = glWindow2.getScreen();
         display2 = screen2.getDisplay();
         glWindow2.setSize(320, 240);
-        GLEventListener demo2 = new GearsES2();
+        final GLEventListener demo2 = new GearsES2();
         setDemoFields(demo2, glWindow2, false);
         glWindow2.addGLEventListener(demo2);
 
@@ -593,10 +593,10 @@ public class TestParenting01NEWT extends UITestCase {
         Assert.assertSame(screen1,glWindow2.getScreen());
         Assert.assertEquals(1,Display.getActiveDisplayNumber());
 
-        Animator animator1 = new Animator(glWindow1);
+        final Animator animator1 = new Animator(glWindow1);
         animator1.setUpdateFPSFrames(1, null);
         animator1.start();
-        Animator animator2 = new Animator(glWindow2);
+        final Animator animator2 = new Animator(glWindow2);
         animator2.setUpdateFPSFrames(1, null);
         animator2.start();
 
@@ -734,7 +734,7 @@ public class TestParenting01NEWT extends UITestCase {
         Assert.assertEquals(0,Display.getActiveDisplayNumber());
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
         if(debug) {
@@ -746,15 +746,15 @@ public class TestParenting01NEWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         boolean asMain = false;
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
@@ -767,14 +767,14 @@ public class TestParenting01NEWT extends UITestCase {
         if( asMain ) {
             try {
                 TestParenting01NEWT.initClass();
-                TestParenting01NEWT m = new TestParenting01NEWT();
+                final TestParenting01NEWT m = new TestParenting01NEWT();
                 m.test02aReparentTop2WinReparentRecreate();
                 m.test01CreateVisibleDestroy();
-            } catch (Throwable t ) {
+            } catch (final Throwable t ) {
                 t.printStackTrace();
             }
         } else {
-            String tstname = TestParenting01NEWT.class.getName();
+            final String tstname = TestParenting01NEWT.class.getName();
             org.junit.runner.JUnitCore.main(tstname);
         }
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java
index 420a39c..6f39985 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aAWT.java
@@ -75,7 +75,7 @@ public class TestParenting01aAWT extends UITestCase {
         Assert.assertEquals(false, glWindow1.isNativeValid());
         Assert.assertNull(glWindow1.getParent());
         glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
 
@@ -165,7 +165,7 @@ public class TestParenting01aAWT extends UITestCase {
         Assert.assertEquals(false, glWindow1.isVisible());
         Assert.assertEquals(false, glWindow1.isNativeValid());
         Assert.assertNull(glWindow1.getParent());
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
 
@@ -194,7 +194,7 @@ public class TestParenting01aAWT extends UITestCase {
         });
         Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
 
-        Animator animator1 = new Animator(glWindow1);
+        final Animator animator1 = new Animator(glWindow1);
         animator1.setUpdateFPSFrames(1, null);
         animator1.start();
         while(animator1.isAnimating() && animator1.getTotalFPSDuration()<durationPerTest) {
@@ -212,8 +212,8 @@ public class TestParenting01aAWT extends UITestCase {
 
     @Test
     public void test03WindowParenting02CreateVisibleDestroy3Odd() throws InterruptedException, InvocationTargetException {
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        GLEventListener demo1 = new RedSquareES2();
+        final GLWindow glWindow1 = GLWindow.create(glCaps);
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
 
@@ -237,7 +237,7 @@ public class TestParenting01aAWT extends UITestCase {
            }
         });
 
-        Animator animator1 = new Animator(glWindow1);
+        final Animator animator1 = new Animator(glWindow1);
         animator1.setUpdateFPSFrames(1, null);
         animator1.start();
         Assert.assertEquals(true, animator1.isStarted());
@@ -257,8 +257,8 @@ public class TestParenting01aAWT extends UITestCase {
 
     @Test
     public void test04WindowParenting03ReparentNewtWin2Top() throws InterruptedException, InvocationTargetException {
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        GLEventListener demo1 = new RedSquareES2();
+        final GLWindow glWindow1 = GLWindow.create(glCaps);
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
 
@@ -282,7 +282,7 @@ public class TestParenting01aAWT extends UITestCase {
 
         Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
 
-        Animator animator1 = new Animator(glWindow1);
+        final Animator animator1 = new Animator(glWindow1);
         animator1.setUpdateFPSFrames(1, null);
         animator1.start();
 
@@ -316,8 +316,8 @@ public class TestParenting01aAWT extends UITestCase {
 
     @Test
     public void test05WindowParenting04ReparentNewtWin2TopLayouted() throws InterruptedException, InvocationTargetException {
-        GLWindow glWindow1 = GLWindow.create(glCaps);
-        GLEventListener demo1 = new RedSquareES2();
+        final GLWindow glWindow1 = GLWindow.create(glCaps);
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
 
@@ -347,7 +347,7 @@ public class TestParenting01aAWT extends UITestCase {
 
         Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
 
-        Animator animator1 = new Animator(glWindow1);
+        final Animator animator1 = new Animator(glWindow1);
         animator1.setUpdateFPSFrames(1, null);
         animator1.start();
 
@@ -381,9 +381,9 @@ public class TestParenting01aAWT extends UITestCase {
 
     @Test
     public void test06WindowParenting05ReparentAWTWinHopFrame2Frame() throws InterruptedException, InvocationTargetException {
-        GLWindow glWindow1 = GLWindow.create(glCaps);
+        final GLWindow glWindow1 = GLWindow.create(glCaps);
         glWindow1.setUndecorated(true);
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
 
@@ -426,7 +426,7 @@ public class TestParenting01aAWT extends UITestCase {
 
         Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
 
-        Animator animator1 = new Animator(glWindow1);
+        final Animator animator1 = new Animator(glWindow1);
         animator1.setUpdateFPSFrames(1, null);
         animator1.start();
 
@@ -469,7 +469,7 @@ public class TestParenting01aAWT extends UITestCase {
         glWindow1.destroy();
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
         if(debug) {
@@ -481,15 +481,15 @@ public class TestParenting01aAWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
@@ -497,7 +497,7 @@ public class TestParenting01aAWT extends UITestCase {
                 waitReparent = atoi(args[++i]);
             }
         }
-        String tstname = TestParenting01aAWT.class.getName();
+        final String tstname = TestParenting01aAWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aSWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aSWT.java
index 4bb64c7..770b7ce 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aSWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01aSWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.parenting;
 
 import java.io.IOException;
@@ -70,7 +70,7 @@ public class TestParenting01aSWT extends UITestCase {
     Shell shell = null;
     Composite composite1 = null;
     com.jogamp.newt.Display swtNewtDisplay = null;
-    
+
     @BeforeClass
     public static void initClass() {
         width  = 640;
@@ -81,7 +81,7 @@ public class TestParenting01aSWT extends UITestCase {
     @Before
     public void init() {
         SWTAccessor.invoke(true, new Runnable() {
-            public void run() {        
+            public void run() {
                 display = new Display();
                 Assert.assertNotNull( display );
                 shell = new Shell( display );
@@ -93,7 +93,7 @@ public class TestParenting01aSWT extends UITestCase {
             }});
         swtNewtDisplay = NewtFactory.createDisplay(null, false); // no-reuse
     }
-    
+
     @After
     public void release() {
         Assert.assertNotNull( display );
@@ -107,7 +107,7 @@ public class TestParenting01aSWT extends UITestCase {
                 display.dispose();
                }});
         }
-        catch( Throwable throwable ) {
+        catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -116,18 +116,18 @@ public class TestParenting01aSWT extends UITestCase {
         shell = null;
         composite1 = null;
     }
-    
+
     @Test
     public void testWindowParenting01CreateVisibleDestroy1() throws InterruptedException, InvocationTargetException {
 
-        com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, 0);
-        GLWindow glWindow1 = GLWindow.create(screen, glCaps);
+        final com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, 0);
+        final GLWindow glWindow1 = GLWindow.create(screen, glCaps);
         Assert.assertNotNull(glWindow1);
         Assert.assertEquals(false, glWindow1.isVisible());
         Assert.assertEquals(false, glWindow1.isNativeValid());
         Assert.assertNull(glWindow1.getParent());
         glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
 
@@ -144,7 +144,7 @@ public class TestParenting01aSWT extends UITestCase {
               shell.open();
            }
         });
-        
+
         // visible test
         Assert.assertEquals(canvas1.getNativeWindow(),glWindow1.getParent());
 
@@ -174,10 +174,10 @@ public class TestParenting01aSWT extends UITestCase {
         Assert.assertEquals(false, glWindow1.isNativeValid());
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
-        Window window = glWindow.getDelegatedWindow();
+        final Window window = glWindow.getDelegatedWindow();
         if(debug) {
             MiscUtils.setFieldIfExists(demo, "glDebug", true);
             MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -187,21 +187,21 @@ public class TestParenting01aSWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
             }
         }
-        String tstname = TestParenting01aSWT.class.getName();
+        final String tstname = TestParenting01aSWT.class.getName();
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
             "filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java
index 598e5f1..49e74dd 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01bAWT.java
@@ -77,10 +77,10 @@ public class TestParenting01bAWT extends UITestCase {
         testAWTWinHopFrame2FrameImpl(0);
     }
 
-    public void testAWTWinHopFrame2FrameImpl(int fps) throws InterruptedException, InvocationTargetException {
-        GLWindow glWindow1 = GLWindow.create(glCaps);
+    public void testAWTWinHopFrame2FrameImpl(final int fps) throws InterruptedException, InvocationTargetException {
+        final GLWindow glWindow1 = GLWindow.create(glCaps);
         glWindow1.setUndecorated(true);
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
 
@@ -173,10 +173,10 @@ public class TestParenting01bAWT extends UITestCase {
         glWindow1.destroy();
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
-        Window window = glWindow.getDelegatedWindow();
+        final Window window = glWindow.getDelegatedWindow();
         if(debug) {
             MiscUtils.setFieldIfExists(demo, "glDebug", true);
             MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -186,15 +186,15 @@ public class TestParenting01bAWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
@@ -202,7 +202,7 @@ public class TestParenting01bAWT extends UITestCase {
                 waitReparent = atoi(args[++i]);
             }
         }
-        String tstname = TestParenting01bAWT.class.getName();
+        final String tstname = TestParenting01bAWT.class.getName();
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
             "filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java
index 1d74017..30be67a 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.parenting;
 
 import org.junit.Assert;
@@ -69,13 +69,13 @@ public class TestParenting01cAWT extends UITestCase {
     public void test01CreateVisibleDestroy1() throws InterruptedException, InvocationTargetException {
         int i;
 
-        GLWindow glWindow1 = GLWindow.create(glCaps);
+        final GLWindow glWindow1 = GLWindow.create(glCaps);
         Assert.assertNotNull(glWindow1);
         Assert.assertEquals(false, glWindow1.isVisible());
         Assert.assertEquals(false, glWindow1.isNativeValid());
         Assert.assertNull(glWindow1.getParent());
         glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
 
@@ -92,7 +92,7 @@ public class TestParenting01cAWT extends UITestCase {
         frame1.add(new Button("East"), BorderLayout.EAST);
         frame1.add(new Button("West"), BorderLayout.WEST);
 
-        Container container1 = new Container();
+        final Container container1 = new Container();
         container1.setLayout(new BorderLayout());
         container1.add(new Button("north"), BorderLayout.NORTH);
         container1.add(new Button("south"), BorderLayout.SOUTH);
@@ -130,7 +130,7 @@ public class TestParenting01cAWT extends UITestCase {
         Assert.assertEquals(true, glWindow1.isNativeValid());
 
         final boolean wasOnscreen = glWindow1.getChosenCapabilities().isOnscreen();
-        
+
         SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
                frame1.remove(newtCanvasAWT);
@@ -155,9 +155,9 @@ public class TestParenting01cAWT extends UITestCase {
 
     @Test
     public void test02AWTWinHopFrame2Frame() throws InterruptedException, InvocationTargetException {
-        GLWindow glWindow1 = GLWindow.create(glCaps);
+        final GLWindow glWindow1 = GLWindow.create(glCaps);
         glWindow1.setUndecorated(true);
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
 
@@ -234,10 +234,10 @@ public class TestParenting01cAWT extends UITestCase {
         glWindow1.destroy();
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
-        Window window = glWindow.getDelegatedWindow();
+        final Window window = glWindow.getDelegatedWindow();
         if(debug) {
             MiscUtils.setFieldIfExists(demo, "glDebug", true);
             MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -247,21 +247,21 @@ public class TestParenting01cAWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
             }
         }
-        String tstname = TestParenting01cAWT.class.getName();
+        final String tstname = TestParenting01cAWT.class.getName();
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
             "filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java
index 4d5c3b2..3726870 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01cSwingAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.parenting;
 
 import java.lang.reflect.*;
@@ -39,10 +39,11 @@ import org.junit.runners.MethodSorters;
 import java.awt.Button;
 import java.awt.BorderLayout;
 import java.awt.Container;
+
 import javax.swing.JFrame;
 import javax.swing.JPanel;
 import javax.swing.SwingUtilities;
-
+import javax.swing.WindowConstants;
 import javax.media.opengl.*;
 
 import com.jogamp.opengl.util.Animator;
@@ -69,38 +70,38 @@ public class TestParenting01cSwingAWT extends UITestCase {
         glCaps = new GLCapabilities(null);
     }
 
-    static class GLDisturbanceAction implements Runnable {        
+    static class GLDisturbanceAction implements Runnable {
         public boolean isRunning = false;
         private volatile boolean shallStop = false;
         private final GLAutoDrawable glad;
         private final GLRunnable glRunnable;
-        
-        public GLDisturbanceAction(GLAutoDrawable glad) {
+
+        public GLDisturbanceAction(final GLAutoDrawable glad) {
             this.glad = glad;
             this.glRunnable = new GLRunnableDummy();
         }
-        
+
         public void waitUntilRunning() {
             synchronized(this) {
                 while(!isRunning) {
                     try {
                         this.wait();
-                    } catch (InterruptedException e) { e.printStackTrace(); }
-                }                
+                    } catch (final InterruptedException e) { e.printStackTrace(); }
+                }
             }
         }
-        
+
         public void stopAndWaitUntilDone() {
             shallStop = true;
             synchronized(this) {
                 while(isRunning) {
                     try {
                         this.wait();
-                    } catch (InterruptedException e) { e.printStackTrace(); }
-                }                
+                    } catch (final InterruptedException e) { e.printStackTrace(); }
+                }
             }
         }
-        
+
         public void run() {
             synchronized(this) {
                 isRunning = true;
@@ -111,7 +112,7 @@ public class TestParenting01cSwingAWT extends UITestCase {
                try {
                    glad.invoke(true, glRunnable);
                    Thread.sleep(100);
-               } catch (Throwable t) {}
+               } catch (final Throwable t) {}
             }
             synchronized(this) {
                 isRunning = false;
@@ -119,25 +120,25 @@ public class TestParenting01cSwingAWT extends UITestCase {
             }
         }
     }
-    
+
     @Test
     public void test01CreateVisibleDestroy1() throws InterruptedException, InvocationTargetException {
         /**
          * JFrame . JPanel . Container . NewtCanvasAWT . GLWindow
          */
-        GLWindow glWindow1 = GLWindow.create(glCaps);
+        final GLWindow glWindow1 = GLWindow.create(glCaps);
         Assert.assertNotNull(glWindow1);
         Assert.assertEquals(false, glWindow1.isVisible());
         Assert.assertEquals(false, glWindow1.isNativeValid());
         Assert.assertNull(glWindow1.getParent());
         glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
-        Animator animator1 = new Animator(glWindow1);
+        final Animator animator1 = new Animator(glWindow1);
         animator1.setUpdateFPSFrames(1, null);
         animator1.start();
-        
+
         final GLDisturbanceAction disturbanceAction = new GLDisturbanceAction(glWindow1);
         new Thread(disturbanceAction).start();
         disturbanceAction.waitUntilRunning();
@@ -166,7 +167,7 @@ public class TestParenting01cSwingAWT extends UITestCase {
 
         final JFrame jFrame1 = new JFrame("Swing Parent JFrame");
         // jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-        jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+        jFrame1.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
         jFrame1.setContentPane(jPanel1);
         System.err.println("Demos: 1 - Visible");
         SwingUtilities.invokeAndWait(new Runnable() {
@@ -204,7 +205,7 @@ public class TestParenting01cSwingAWT extends UITestCase {
         Assert.assertEquals(true, AWTRobotUtil.waitForVisible(glWindow1, true));
 
         final boolean wasOnscreen = glWindow1.getChosenCapabilities().isOnscreen();
-        
+
         // Always recommended to remove our native parented Window
         // from the AWT resources before destruction, since it could lead
         // to a BadMatch X11 error w/o.
@@ -227,11 +228,11 @@ public class TestParenting01cSwingAWT extends UITestCase {
             Assert.assertEquals(true, glWindow1.isNativeValid());
         } // else OK to be destroyed - due to offscreen/onscreen transition
 
-        System.err.println("Demos: 7 - X GLWindow");        
+        System.err.println("Demos: 7 - X GLWindow");
         glWindow1.destroy();
         Assert.assertEquals(false, glWindow1.isNativeValid());
-        
-        System.err.println("Demos: 8 - X DisturbanceThread");        
+
+        System.err.println("Demos: 8 - X DisturbanceThread");
         disturbanceAction.stopAndWaitUntilDone();
     }
 
@@ -240,23 +241,23 @@ public class TestParenting01cSwingAWT extends UITestCase {
         /**
          * JFrame . JPanel . Container . NewtCanvasAWT . GLWindow
          */
-        GLWindow glWindow1 = GLWindow.create(glCaps);
+        final GLWindow glWindow1 = GLWindow.create(glCaps);
         Assert.assertNotNull(glWindow1);
         Assert.assertEquals(false, glWindow1.isVisible());
         Assert.assertEquals(false, glWindow1.isNativeValid());
         Assert.assertNull(glWindow1.getParent());
         glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         /*
         glWindow1.addGLEventListener(new GLEventListener() {
             @Override
             public void init(GLAutoDrawable drawable) {
-                System.err.println("XXX init");                
+                System.err.println("XXX init");
             }
             @Override
             public void dispose(GLAutoDrawable drawable) {
-                System.err.println("XXX dispose");                
+                System.err.println("XXX dispose");
                 // Thread.dumpStack();
             }
             @Override
@@ -265,10 +266,10 @@ public class TestParenting01cSwingAWT extends UITestCase {
             public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
                 System.err.println("XXX reshape");
                 // Thread.dumpStack();
-            }            
+            }
         }); */
         glWindow1.addGLEventListener(demo1);
-        Animator animator1 = new Animator(glWindow1);
+        final Animator animator1 = new Animator(glWindow1);
         animator1.setUpdateFPSFrames(1, null);
         animator1.start();
 
@@ -300,7 +301,7 @@ public class TestParenting01cSwingAWT extends UITestCase {
 
         final JFrame jFrame1 = new JFrame("Swing Parent JFrame");
         // jFrame1.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-        jFrame1.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+        jFrame1.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
         jFrame1.setContentPane(jPanel1);
         SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
@@ -319,7 +320,7 @@ public class TestParenting01cSwingAWT extends UITestCase {
 
         final JFrame jFrame2 = new JFrame("Swing Parent JFrame");
         // jFrame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-        jFrame2.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
+        jFrame2.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); // equivalent to Frame, use windowClosing event!
         jFrame2.setContentPane(jPanel2);
         SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
@@ -333,7 +334,7 @@ public class TestParenting01cSwingAWT extends UITestCase {
         Assert.assertEquals(newtCanvasAWT.getNativeWindow(),glWindow1.getParent());
 
         final boolean wasOnscreen = glWindow1.getChosenCapabilities().isOnscreen();
-        
+
         int state = 0;
         while(animator1.isAnimating() && animator1.getTotalFPSDuration()<3*durationPerTest) {
             Thread.sleep(durationPerTest);
@@ -353,7 +354,7 @@ public class TestParenting01cSwingAWT extends UITestCase {
                                 jPanel2.remove(newtCanvasAWT);
                                 container1.add(newtCanvasAWT, BorderLayout.CENTER);
                                 jFrame1.validate();
-                                jFrame2.validate();                                
+                                jFrame2.validate();
                             } });
                     break;
             }
@@ -376,11 +377,11 @@ public class TestParenting01cSwingAWT extends UITestCase {
                     jFrame1.validate();
                     System.err.println("Demos: 1 - X Container 2");
                     jPanel2.remove(newtCanvasAWT);
-                    jFrame2.validate();                                
+                    jFrame2.validate();
                 } }); */
         /*
          * Invisible X11 windows may also case BadMatch (-> XAWT related)
-         */ 
+         */
         SwingUtilities.invokeAndWait(new Runnable() {
                 public void run() {
                     System.err.println("Demos: 2 - !visible");
@@ -401,18 +402,18 @@ public class TestParenting01cSwingAWT extends UITestCase {
             Assert.assertEquals(true, glWindow1.isNativeValid());
         } // else OK to be destroyed - due to offscreen/onscreen transition
 
-        System.err.println("Demos: 6 - X GLWindow");        
+        System.err.println("Demos: 6 - X GLWindow");
         glWindow1.destroy();
         Assert.assertEquals(false, glWindow1.isNativeValid());
-        
-        System.err.println("Demos: 7 - X DisturbanceThread");        
-        disturbanceAction.stopAndWaitUntilDone();        
+
+        System.err.println("Demos: 7 - X DisturbanceThread");
+        disturbanceAction.stopAndWaitUntilDone();
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
-        Window window = glWindow.getDelegatedWindow();
+        final Window window = glWindow.getDelegatedWindow();
         if(debug) {
             MiscUtils.setFieldIfExists(demo, "glDebug", true);
             MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -422,15 +423,15 @@ public class TestParenting01cSwingAWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01dAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01dAWT.java
index 288918e..ad8a6f5 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01dAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting01dAWT.java
@@ -75,14 +75,14 @@ public class TestParenting01dAWT extends UITestCase {
 
     static class MyGLEventListenerCounter extends GLEventListenerCounter {
         @Override
-        public void init(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {
             super.init(drawable);
             System.err.println("MyGLEventListenerCounter.init: "+this);
             // Thread.dumpStack();
         }
 
         @Override
-        public void dispose(GLAutoDrawable drawable) {
+        public void dispose(final GLAutoDrawable drawable) {
             super.dispose(drawable);
             System.err.println("MyGLEventListenerCounter.dispose: "+this);
             // Thread.dumpStack();
@@ -99,7 +99,7 @@ public class TestParenting01dAWT extends UITestCase {
         testGLWindowInvisibleReparentRecreateImpl(true /* triggerPreserveGLState */);
     }
 
-    private void testGLWindowInvisibleReparentRecreateImpl(boolean triggerPreserveGLState) throws InterruptedException, InvocationTargetException {
+    private void testGLWindowInvisibleReparentRecreateImpl(final boolean triggerPreserveGLState) throws InterruptedException, InvocationTargetException {
         final GLWindow glWindow1 = GLWindow.create(glCaps);
         Assert.assertNotNull(glWindow1);
         Assert.assertEquals(false, glWindow1.isVisible());
@@ -108,7 +108,7 @@ public class TestParenting01dAWT extends UITestCase {
         glWindow1.setTitle("testWindowParenting01CreateVisibleDestroy");
         final MyGLEventListenerCounter glelCounter = new MyGLEventListenerCounter();
         glWindow1.addGLEventListener(glelCounter);
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         glWindow1.addGLEventListener(demo1);
         Assert.assertEquals("Init Counter Invalid "+glelCounter, 0, glelCounter.initCount);
 
@@ -238,13 +238,13 @@ public class TestParenting01dAWT extends UITestCase {
         }
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
             }
         }
-        String tstname = TestParenting01dAWT.class.getName();
+        final String tstname = TestParenting01dAWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java
index b304a2c..ed5c2f8 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02AWT.java
@@ -85,7 +85,7 @@ public class TestParenting02AWT extends UITestCase {
     }
 
     public void runNewtChildOnAWTParent(final boolean useLayout, final boolean deferredPeer) throws InterruptedException, InvocationTargetException {
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+        final NEWTEventFiFo eventFifo = new NEWTEventFiFo();
 
         // setup NEWT GLWindow ..
         final GLWindow glWindow = GLWindow.create(new GLCapabilities(null));
@@ -194,7 +194,7 @@ public class TestParenting02AWT extends UITestCase {
         }
 
         long duration = durationPerTest;
-        long step = 20;
+        final long step = 20;
         NEWTEvent event;
         boolean shouldQuit = false;
 
@@ -204,9 +204,9 @@ public class TestParenting02AWT extends UITestCase {
             duration -= step;
 
             while( null != ( event = eventFifo.get() ) ) {
-                Window source = (Window) event.getSource();
+                final Window source = (Window) event.getSource();
                 if(event instanceof KeyEvent) {
-                    KeyEvent keyEvent = (KeyEvent) event;
+                    final KeyEvent keyEvent = (KeyEvent) event;
                     switch(keyEvent.getKeyChar()) {
                         case 'q':
                             shouldQuit = true;
@@ -237,10 +237,10 @@ public class TestParenting02AWT extends UITestCase {
             } } );
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
-        Window window = glWindow.getDelegatedWindow();
+        final Window window = glWindow.getDelegatedWindow();
         if(debug) {
             MiscUtils.setFieldIfExists(demo, "glDebug", true);
             MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -250,15 +250,15 @@ public class TestParenting02AWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         verbose = true;
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
@@ -267,7 +267,7 @@ public class TestParenting02AWT extends UITestCase {
                 waitReparent = atoi(args[++i]);
             }
         }
-        String tstname = TestParenting02AWT.class.getName();
+        final String tstname = TestParenting02AWT.class.getName();
         org.junit.runner.JUnitCore.main(tstname);
         /*
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java
index 9f56ecd..c9a9686 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting02NEWT.java
@@ -61,22 +61,22 @@ public class TestParenting02NEWT extends UITestCase {
         height = 480;
     }
 
-    static Window createWindow(Screen screen, Capabilities caps) {
+    static Window createWindow(final Screen screen, final Capabilities caps) {
         Assert.assertNotNull(caps);
-        Window window = NewtFactory.createWindow(screen, caps) ;
+        final Window window = NewtFactory.createWindow(screen, caps) ;
         Assert.assertNotNull(window);
         return window;
     }
 
-    static Window createWindow(NativeWindow parent, Capabilities caps) {
+    static Window createWindow(final NativeWindow parent, final Capabilities caps) {
         Assert.assertNotNull(caps);
-        Window window = NewtFactory.createWindow(parent, caps);
+        final Window window = NewtFactory.createWindow(parent, caps);
         window.setUndecorated(true);
         Assert.assertNotNull(window);
         return window;
     }
 
-    static void destroyWindow(Display display, Screen screen, Window window, GLWindow glWindow) {
+    static void destroyWindow(final Display display, final Screen screen, final Window window, final GLWindow glWindow) {
         if(null!=glWindow) {
             glWindow.destroy();
         }
@@ -93,21 +93,21 @@ public class TestParenting02NEWT extends UITestCase {
 
     @Test
     public void test01NewtOnNewtParentChildDraw() throws InterruptedException {
-        GLCapabilities caps = new GLCapabilities(null);
+        final GLCapabilities caps = new GLCapabilities(null);
         Assert.assertNotNull(caps);
-        Display display = NewtFactory.createDisplay(null); // local display
+        final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
 
         int x = 1;
         int y = 1;
 
-        NEWTEventFiFo eventFifo = new NEWTEventFiFo();
+        final NEWTEventFiFo eventFifo = new NEWTEventFiFo();
 
-        Window window1 = createWindow(screen, caps);
+        final Window window1 = createWindow(screen, caps);
         Assert.assertNotNull(window1);
-        GLWindow glWindow1 = GLWindow.create(window1);
+        final GLWindow glWindow1 = GLWindow.create(window1);
         Assert.assertNotNull(glWindow1);
         glWindow1.setSize(width, height);
         Assert.assertEquals(width,glWindow1.getWidth());
@@ -117,7 +117,7 @@ public class TestParenting02NEWT extends UITestCase {
         //glWindow1.addKeyListener(new TraceKeyAdapter(new KeyAction(eventFifo)));
         //glWindow1.addWindowListener(new TraceWindowAdapter());
 
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, window1, glWindow1, false);
         // glWindow1.addGLEventListener(demo1);
 
@@ -126,9 +126,9 @@ public class TestParenting02NEWT extends UITestCase {
         Assert.assertNotNull(capsChosen);
         Assert.assertTrue(capsChosen.isOnscreen()==true);
 
-        Window window2 = createWindow(window1, caps);
+        final Window window2 = createWindow(window1, caps);
         Assert.assertNotNull(window2);
-        GLWindow glWindow2 = GLWindow.create(window2);
+        final GLWindow glWindow2 = GLWindow.create(window2);
         Assert.assertNotNull(glWindow2);
         glWindow2.setSize(width/2, height/2);
         //Assert.assertEquals(width/2,glWindow2.getWidth());
@@ -139,7 +139,7 @@ public class TestParenting02NEWT extends UITestCase {
         //glWindow2.addWindowListener(new TraceWindowAdapter(new WindowAction(eventFifo)));
         // glWindow2.addMouseListener(new TraceMouseAdapter());
 
-        GLEventListener demo2 = new GearsES2();
+        final GLEventListener demo2 = new GearsES2();
         setDemoFields(demo2, window2, glWindow2, false);
         // glWindow2.addGLEventListener(demo2);
 
@@ -153,7 +153,7 @@ public class TestParenting02NEWT extends UITestCase {
 
         boolean shouldQuit = false;
         long duration = durationPerTest;
-        long step = 20;
+        final long step = 20;
         NEWTEvent event;
 
         while (duration>0 && !shouldQuit) {
@@ -167,11 +167,11 @@ public class TestParenting02NEWT extends UITestCase {
             Thread.sleep(step);
 
             while( null != ( event = eventFifo.get() ) ) {
-                Window source = (Window) event.getSource();
+                final Window source = (Window) event.getSource();
                 if(WindowEvent.EVENT_WINDOW_DESTROY_NOTIFY == event.getEventType()) {
                     shouldQuit = true;
                 } else if(event instanceof KeyEvent) {
-                    KeyEvent keyEvent = (KeyEvent) event;
+                    final KeyEvent keyEvent = (KeyEvent) event;
                     switch(keyEvent.getKeyChar()) {
                         case 'q':
                             shouldQuit = true;
@@ -187,7 +187,7 @@ public class TestParenting02NEWT extends UITestCase {
         destroyWindow(display, screen, window1, glWindow1);
     }
 
-    public static void setDemoFields(GLEventListener demo, Window window, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final Window window, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(window);
         if(debug) {
@@ -199,21 +199,21 @@ public class TestParenting02NEWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
             }
         }
-        String tstname = TestParenting02NEWT.class.getName();
+        final String tstname = TestParenting02NEWT.class.getName();
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
             "filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java
index b749719..fde366d 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting03AWT.java
@@ -78,18 +78,18 @@ public class TestParenting03AWT extends UITestCase {
         testImpl(true);
     }
 
-    public void testImpl(boolean use2nd) throws InterruptedException, InvocationTargetException {
+    public void testImpl(final boolean use2nd) throws InterruptedException, InvocationTargetException {
         final Frame frame1 = new Frame("AWT Parent Frame");
-        GLWindow glWindow1 = GLWindow.create(glCaps);
+        final GLWindow glWindow1 = GLWindow.create(glCaps);
         glWindow1.setUpdateFPSFrames(1, null);
         final NewtCanvasAWT newtCanvasAWT1 = new NewtCanvasAWT(glWindow1);
         newtCanvasAWT1.setPreferredSize(glSize);
 
-        GLEventListener demo1 = new GearsES2(1);
+        final GLEventListener demo1 = new GearsES2(1);
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
         glWindow1.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT1, glWindow1, null));
-        GLAnimatorControl animator1 = new Animator(glWindow1);
+        final GLAnimatorControl animator1 = new Animator(glWindow1);
         animator1.start();
 
         GLWindow glWindow2 = null;
@@ -101,7 +101,7 @@ public class TestParenting03AWT extends UITestCase {
             newtCanvasAWT2 = new NewtCanvasAWT(glWindow2);
             newtCanvasAWT2.setPreferredSize(glSize);
 
-            GLEventListener demo2 = new GearsES2(1);
+            final GLEventListener demo2 = new GearsES2(1);
             setDemoFields(demo2, glWindow2, false);
             glWindow2.addGLEventListener(demo2);
             glWindow2.addKeyListener(new NewtAWTReparentingKeyAdapter(frame1, newtCanvasAWT2, glWindow2, null));
@@ -191,10 +191,10 @@ public class TestParenting03AWT extends UITestCase {
         }
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
-        Window window = glWindow.getDelegatedWindow();
+        final Window window = glWindow.getDelegatedWindow();
         if(debug) {
             MiscUtils.setFieldIfExists(demo, "glDebug", true);
             MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -204,15 +204,15 @@ public class TestParenting03AWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
@@ -220,7 +220,7 @@ public class TestParenting03AWT extends UITestCase {
                 waitAdd2nd = atoi(args[++i]);
             }
         }
-        String tstname = TestParenting03AWT.class.getName();
+        final String tstname = TestParenting03AWT.class.getName();
         /*
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04AWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04AWT.java
index 126aaaf..3ff4ecd 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04AWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04AWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.parenting;
 
 import java.awt.BorderLayout;
@@ -74,26 +74,26 @@ public class TestParenting04AWT extends UITestCase {
         // Will produce some artifacts .. resizing etc
         winHopFrame2Frame(false);
     }
-    
+
     @Test
     public void test02WinHopFrame2FrameDetachFirst() throws InterruptedException, InvocationTargetException {
-        // Note: detaching first setNEWTChild(null) is much cleaner visually 
+        // Note: detaching first setNEWTChild(null) is much cleaner visually
         winHopFrame2Frame(true);
     }
-    
+
     protected void winHopFrame2Frame(final boolean detachFirst) throws InterruptedException, InvocationTargetException {
         final GLWindow glWindow1 = GLWindow.create(glCaps);
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
-        Animator anim1 = new Animator(glWindow1);
+        final Animator anim1 = new Animator(glWindow1);
 
         final GLWindow glWindow2 = GLWindow.create(glCaps);
-        GLEventListener demo2 = new GearsES2();
+        final GLEventListener demo2 = new GearsES2();
         setDemoFields(demo2, glWindow2, false);
         glWindow2.addGLEventListener(demo2);
-        Animator anim2 = new Animator(glWindow2);
-        
+        final Animator anim2 = new Animator(glWindow2);
+
         final NewtCanvasAWT canvas1 = new NewtCanvasAWT(glWindow1);
         final NewtCanvasAWT canvas2 = new NewtCanvasAWT(glWindow2);
 
@@ -119,7 +119,7 @@ public class TestParenting04AWT extends UITestCase {
            }
         });
         Assert.assertEquals(canvas1.getNativeWindow(),glWindow1.getParent());
-        
+
         final Frame frame2 = new Frame("AWT Parent Frame");
         frame2.setLayout(new BorderLayout());
         frame2.add(new Button("North"), BorderLayout.NORTH);
@@ -145,7 +145,7 @@ public class TestParenting04AWT extends UITestCase {
 
         anim1.start();
         anim2.start();
-        
+
         int state;
         for(state=0; state<3; state++) {
             Thread.sleep(durationPerTest);
@@ -156,7 +156,7 @@ public class TestParenting04AWT extends UITestCase {
                            // 1 -> 2
                            if(detachFirst) {
                                canvas1.setNEWTChild(null);
-                               canvas2.setNEWTChild(null);                               
+                               canvas2.setNEWTChild(null);
                            } else {
                                canvas2.setNEWTChild(null);  // free g2 of w2
                            }
@@ -175,7 +175,7 @@ public class TestParenting04AWT extends UITestCase {
                            // 2 -> 1
                            if(detachFirst) {
                                canvas1.setNEWTChild(null);
-                               canvas2.setNEWTChild(null);                               
+                               canvas2.setNEWTChild(null);
                            } else {
                                canvas2.setNEWTChild(null);
                            }
@@ -199,13 +199,13 @@ public class TestParenting04AWT extends UITestCase {
         glWindow1.destroy();
         glWindow2.destroy();
         Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertEquals(false, glWindow2.isNativeValid());        
+        Assert.assertEquals(false, glWindow2.isNativeValid());
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
-        Window window = glWindow.getDelegatedWindow();
+        final Window window = glWindow.getDelegatedWindow();
         if(debug) {
             MiscUtils.setFieldIfExists(demo, "glDebug", true);
             MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -215,21 +215,21 @@ public class TestParenting04AWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
             }
         }
-        String tstname = TestParenting04AWT.class.getName();
+        final String tstname = TestParenting04AWT.class.getName();
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
             "filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04SWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04SWT.java
index 586db8a..631d230 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04SWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestParenting04SWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.parenting;
 
 import java.io.IOException;
@@ -74,7 +74,7 @@ public class TestParenting04SWT extends UITestCase {
     Composite composite1 = null;
     Composite composite2 = null;
     com.jogamp.newt.Display swtNewtDisplay = null;
-    
+
     @BeforeClass
     public static void initClass() {
         width  = 400;
@@ -85,17 +85,17 @@ public class TestParenting04SWT extends UITestCase {
     @Before
     public void init() {
         SWTAccessor.invoke(true, new Runnable() {
-            public void run() {        
+            public void run() {
                 display = new Display();
                 Assert.assertNotNull( display );
-                
+
                 shell1 = new Shell( display );
                 Assert.assertNotNull( shell1 );
                 shell1.setLayout( new FillLayout() );
                 composite1 = new Composite( shell1, SWT.NONE );
                 composite1.setLayout( new FillLayout() );
                 Assert.assertNotNull( composite1 );
-                
+
                 shell2 = new Shell( display );
                 Assert.assertNotNull( shell2 );
                 shell2.setLayout( new FillLayout() );
@@ -105,7 +105,7 @@ public class TestParenting04SWT extends UITestCase {
             }});
         swtNewtDisplay = NewtFactory.createDisplay(null, false); // no-reuse
     }
-    
+
     @After
     public void release() {
         Assert.assertNotNull( display );
@@ -123,7 +123,7 @@ public class TestParenting04SWT extends UITestCase {
                 display.dispose();
                }});
         }
-        catch( Throwable throwable ) {
+        catch( final Throwable throwable ) {
             throwable.printStackTrace();
             Assume.assumeNoException( throwable );
         }
@@ -134,37 +134,37 @@ public class TestParenting04SWT extends UITestCase {
         composite1 = null;
         composite2 = null;
     }
-    
+
     @Test
     public void test01WinHopFrame2FrameDirectHop() throws InterruptedException, InvocationTargetException {
         // Will produce some artifacts .. resizing etc
         winHopFrame2Frame(false);
     }
-    
+
     @Test
     public void test02WinHopFrame2FrameDetachFirst() throws InterruptedException, InvocationTargetException {
-        // Note: detaching first setNEWTChild(null) is much cleaner visually 
+        // Note: detaching first setNEWTChild(null) is much cleaner visually
         winHopFrame2Frame(true);
     }
-    
+
     protected void winHopFrame2Frame(final boolean detachFirst) throws InterruptedException, InvocationTargetException {
-        com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, 0);
-        
+        final com.jogamp.newt.Screen screen = NewtFactory.createScreen(swtNewtDisplay, 0);
+
         final GLWindow glWindow1 = GLWindow.create(screen, glCaps);
-        GLEventListener demo1 = new RedSquareES2();
+        final GLEventListener demo1 = new RedSquareES2();
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
-        Animator anim1 = new Animator(glWindow1);
-        
+        final Animator anim1 = new Animator(glWindow1);
+
         final GLWindow glWindow2 = GLWindow.create(screen, glCaps);
-        GLEventListener demo2 = new GearsES2();
+        final GLEventListener demo2 = new GearsES2();
         setDemoFields(demo2, glWindow2, false);
         glWindow2.addGLEventListener(demo2);
-        Animator anim2 = new Animator(glWindow2);
+        final Animator anim2 = new Animator(glWindow2);
 
         final NewtCanvasSWT canvas1 = NewtCanvasSWT.create( composite1, 0, glWindow1 );
         final NewtCanvasSWT canvas2 = NewtCanvasSWT.create( composite2, 0, glWindow2 );
-    
+
         SWTAccessor.invoke(true, new Runnable() {
            public void run() {
               shell1.setText( getSimpleTestName(".")+"-Win1" );
@@ -176,13 +176,13 @@ public class TestParenting04SWT extends UITestCase {
               shell2.setLocation(width + 50, 0);
               shell2.open();
            }
-        });        
+        });
         Assert.assertEquals(canvas1.getNativeWindow(),glWindow1.getParent());
         Assert.assertEquals(canvas2.getNativeWindow(),glWindow2.getParent());
 
         anim1.start();
         anim2.start();
-        
+
         int state;
         for(state=0; state<3; state++) {
             for(int i=0; i*10<durationPerTest; i++) {
@@ -198,7 +198,7 @@ public class TestParenting04SWT extends UITestCase {
                            // 1 -> 2
                            if(detachFirst) {
                                canvas1.setNEWTChild(null);
-                               canvas2.setNEWTChild(null);                               
+                               canvas2.setNEWTChild(null);
                            } else {
                                canvas2.setNEWTChild(null);  // free g2 of w2
                            }
@@ -212,7 +212,7 @@ public class TestParenting04SWT extends UITestCase {
                            // 2 -> 1
                            if(detachFirst) {
                                canvas1.setNEWTChild(null);
-                               canvas2.setNEWTChild(null);                               
+                               canvas2.setNEWTChild(null);
                            } else {
                                canvas2.setNEWTChild(null);
                            }
@@ -226,13 +226,13 @@ public class TestParenting04SWT extends UITestCase {
         canvas1.dispose();
         canvas2.dispose();
         Assert.assertEquals(false, glWindow1.isNativeValid());
-        Assert.assertEquals(false, glWindow2.isNativeValid());        
+        Assert.assertEquals(false, glWindow2.isNativeValid());
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
-        Window window = glWindow.getDelegatedWindow();
+        final Window window = glWindow.getDelegatedWindow();
         if(debug) {
             MiscUtils.setFieldIfExists(demo, "glDebug", true);
             MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -242,21 +242,21 @@ public class TestParenting04SWT extends UITestCase {
         }
     }
 
-    static int atoi(String a) {
+    static int atoi(final String a) {
         int i=0;
         try {
             i = Integer.parseInt(a);
-        } catch (Exception ex) { ex.printStackTrace(); }
+        } catch (final Exception ex) { ex.printStackTrace(); }
         return i;
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = atoi(args[++i]);
             }
         }
-        String tstname = TestParenting04SWT.class.getName();
+        final String tstname = TestParenting04SWT.class.getName();
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
             "filtertrace=true",
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentChildWindowBug632NEWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentChildWindowBug632NEWT.java
index b2286a8..c9390f1 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentChildWindowBug632NEWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentChildWindowBug632NEWT.java
@@ -31,44 +31,44 @@ public class TestTranslucentChildWindowBug632NEWT extends UITestCase {
         glp = GLProfile.getDefault();
         opaque = false;
     }
-    
-    static GLWindow createParentWindow(GLCapabilitiesImmutable caps, int width, int height)
+
+    static GLWindow createParentWindow(final GLCapabilitiesImmutable caps, final int width, final int height)
             throws InterruptedException
         {
             Assert.assertNotNull(caps);
             //
             // Create native windowing resources .. X11/Win/OSX
-            // 
+            //
             GLWindow glWindow;
             glWindow = GLWindow.create(caps);
             Assert.assertNotNull(glWindow);
-            
+
             glWindow.setTitle("NEWT Parenting Window Test");
-            
+
             glWindow.addGLEventListener(new GearsES2(1));
 
             glWindow.setSize(width, height);
             glWindow.setVisible(true);
             Assert.assertEquals(true,glWindow.isVisible());
             Assert.assertEquals(true,glWindow.isNativeValid());
-            
+
             return glWindow;
         }
-    
-    static GLWindow createNestedWindow(NativeWindow nativeParentWindow, GLCapabilitiesImmutable caps, int x, int y, int width, int height)
+
+    static GLWindow createNestedWindow(final NativeWindow nativeParentWindow, final GLCapabilitiesImmutable caps, final int x, final int y, final int width, final int height)
             throws InterruptedException {
-         
+
         Assert.assertNotNull(nativeParentWindow);
         Assert.assertNotNull(caps);
          //
          // Create native windowing resources .. X11/Win/OSX
-         // 
+         //
          GLWindow glWindow;
          glWindow = GLWindow.create(nativeParentWindow, caps);
          Assert.assertNotNull(glWindow);
-         
+
          glWindow.setTitle("NEWT Parenting Window Test");
-         
+
          glWindow.addGLEventListener(new GearsES2(1));
 
          glWindow.setPosition(x, y);
@@ -76,60 +76,60 @@ public class TestTranslucentChildWindowBug632NEWT extends UITestCase {
          glWindow.setVisible(true);
          Assert.assertEquals(true,glWindow.isVisible());
          Assert.assertEquals(true,glWindow.isNativeValid());
-         
+
          return glWindow;
     }
-    
-    static void destroyWindow(GLWindow glWindow) {
+
+    static void destroyWindow(final GLWindow glWindow) {
         if(null!=glWindow) {
             glWindow.destroy();
             Assert.assertEquals(false,glWindow.isNativeValid());
         }
     }
-    
+
     @Test
     public void testWindow00() throws InterruptedException {
         final Animator animator = new Animator();
 
-        GLCapabilities caps = new GLCapabilities(glp);
+        final GLCapabilities caps = new GLCapabilities(glp);
         Assert.assertNotNull(caps);
         caps.setBackgroundOpaque(opaque);
-        GLWindow window1 = createParentWindow(caps, 400, 400);
+        final GLWindow window1 = createParentWindow(caps, 400, 400);
         Assert.assertEquals(true,window1.isNativeValid());
         Assert.assertEquals(true,window1.isVisible());
         animator.add(window1);
-        
-        GLWindow window2 = createNestedWindow(window1, caps, 400-300, 400-300, 300, 300);
+
+        final GLWindow window2 = createNestedWindow(window1, caps, 400-300, 400-300, 300, 300);
         Assert.assertEquals(true,window2.isNativeValid());
         Assert.assertEquals(true,window2.isVisible());
         animator.add(window2);
-        
+
         animator.start();
-        
-        AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
+
+        final AbstractGraphicsDevice device1 = window1.getScreen().getDisplay().getGraphicsDevice();
 
         System.err.println("GLProfiles window1: "+device1.getConnection()+": "+GLProfile.glAvailabilityToString(device1));
 
         Thread.sleep(durationPerTest/2);
-        
+
         window1.setSize(512, 512);
         window2.setPosition(512-300, 512-300);
-        
+
         Thread.sleep(durationPerTest/2);
-        
+
         animator.stop();
-        
+
         destroyWindow(window2);
         destroyWindow(window1);
     }
-    
-    public static void main(String[] args) throws IOException {
+
+    public static void main(final String[] args) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
             }
         }
-        String testName = TestTranslucentChildWindowBug632NEWT.class.getName();
+        final String testName = TestTranslucentChildWindowBug632NEWT.class.getName();
         org.junit.runner.JUnitCore.main(testName);
-    }    
+    }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java
index f273f76..3eb0c13 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/TestTranslucentParentingAWT.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.newt.parenting;
 
 import java.awt.BorderLayout;
@@ -82,23 +82,23 @@ public class TestTranslucentParentingAWT extends UITestCase {
 
     static Frame getTranslucentFrame() {
         GraphicsConfiguration gc=null;
-        GraphicsDevice[] devices= GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
+        final GraphicsDevice[] devices= GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices();
         for (int i = 0; i < devices.length ; i++)
         {
-            GraphicsConfiguration[] configs = devices[i].getConfigurations();
+            final GraphicsConfiguration[] configs = devices[i].getConfigurations();
             for (int j = 0; j < configs.length ; j++) {
-                GraphicsConfiguration config = configs[j];
-                ColorModel tcm = config.getColorModel(Transparency.TRANSLUCENT);
-                boolean capable1 = ( null != tcm ) ? tcm.getTransparency() == Transparency.TRANSLUCENT : false;
+                final GraphicsConfiguration config = configs[j];
+                final ColorModel tcm = config.getColorModel(Transparency.TRANSLUCENT);
+                final boolean capable1 = ( null != tcm ) ? tcm.getTransparency() == Transparency.TRANSLUCENT : false;
                 boolean capable2 = false;
                 try {
                     capable2 = ((Boolean)ReflectionUtil.callStaticMethod(
-                                                "com.sun.awt.AWTUtilities", "isTranslucencyCapable", 
-                                                new Class<?>[] { GraphicsConfiguration.class }, 
-                                                new Object[] { config } , 
+                                                "com.sun.awt.AWTUtilities", "isTranslucencyCapable",
+                                                new Class<?>[] { GraphicsConfiguration.class },
+                                                new Object[] { config } ,
                                                 GraphicsConfiguration.class.getClassLoader())).booleanValue();
                     System.err.println("com.sun.awt.AWTUtilities.isTranslucencyCapable(config) passed: "+capable2);
-                } catch (RuntimeException re) {
+                } catch (final RuntimeException re) {
                     System.err.println("com.sun.awt.AWTUtilities.isTranslucencyCapable(config) failed: "+re.getMessage());
                 }
                 System.err.println(i+":"+j+" "+config+", "+tcm+", capable "+capable1+"/"+capable2);
@@ -117,7 +117,7 @@ public class TestTranslucentParentingAWT extends UITestCase {
         frame.setTitle("AWT Parent Frame (opaque: "+(null==gc)+")");
         return frame;
     }
-    
+
     public void testWindowParenting1AWTOneNewtChild() throws InterruptedException, InvocationTargetException {
         final Frame frame1 = getTranslucentFrame();
         final GLWindow glWindow1 = GLWindow.create(glCaps);
@@ -126,13 +126,13 @@ public class TestTranslucentParentingAWT extends UITestCase {
         final NewtCanvasAWT newtCanvasAWT1 = new NewtCanvasAWT(frame1.getGraphicsConfiguration(), glWindow1);
         newtCanvasAWT1.setPreferredSize(size);
 
-        GLEventListener demo1 = new GearsES2(1);
+        final GLEventListener demo1 = new GearsES2(1);
         setDemoFields(demo1, glWindow1, false);
         glWindow1.addGLEventListener(demo1);
-        GLAnimatorControl animator1 = new Animator(glWindow1);
+        final GLAnimatorControl animator1 = new Animator(glWindow1);
         animator1.start();
 
-        Container cont1 = new Container();
+        final Container cont1 = new Container();
         cont1.setLayout(new BorderLayout());
         cont1.add(newtCanvasAWT1, BorderLayout.CENTER);
         cont1.setVisible(true);
@@ -167,10 +167,10 @@ public class TestTranslucentParentingAWT extends UITestCase {
         glWindow1.destroy();
     }
 
-    public static void setDemoFields(GLEventListener demo, GLWindow glWindow, boolean debug) {
+    public static void setDemoFields(final GLEventListener demo, final GLWindow glWindow, final boolean debug) {
         Assert.assertNotNull(demo);
         Assert.assertNotNull(glWindow);
-        Window window = glWindow.getDelegatedWindow();
+        final Window window = glWindow.getDelegatedWindow();
         if(debug) {
             MiscUtils.setFieldIfExists(demo, "glDebug", true);
             MiscUtils.setFieldIfExists(demo, "glTrace", true);
@@ -180,7 +180,7 @@ public class TestTranslucentParentingAWT extends UITestCase {
         }
     }
 
-    public static void main(String args[]) throws IOException {
+    public static void main(final String args[]) throws IOException {
         for(int i=0; i<args.length; i++) {
             if(args[i].equals("-time")) {
                 durationPerTest = MiscUtils.atol(args[++i], durationPerTest);
@@ -188,7 +188,7 @@ public class TestTranslucentParentingAWT extends UITestCase {
                 waitAdd2nd = MiscUtils.atol(args[++i], waitAdd2nd);
             }
         }
-        String tstname = TestTranslucentParentingAWT.class.getName();
+        final String tstname = TestTranslucentParentingAWT.class.getName();
         /*
         org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(new String[] {
             tstname,
diff --git a/src/test/com/jogamp/opengl/test/junit/newt/parenting/WindowAction.java b/src/test/com/jogamp/opengl/test/junit/newt/parenting/WindowAction.java
index 05793b9..b960103 100644
--- a/src/test/com/jogamp/opengl/test/junit/newt/parenting/WindowAction.java
+++ b/src/test/com/jogamp/opengl/test/junit/newt/parenting/WindowAction.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -33,14 +33,14 @@ import com.jogamp.newt.event.*;
 class WindowAction extends WindowAdapter {
     NEWTEventFiFo eventFifo;
 
-    public WindowAction(NEWTEventFiFo eventFifo) { 
-        this.eventFifo = eventFifo; 
+    public WindowAction(final NEWTEventFiFo eventFifo) {
+        this.eventFifo = eventFifo;
     }
 
-    public void windowDestroyNotify(WindowEvent e) {
+    public void windowDestroyNotify(final WindowEvent e) {
         eventFifo.put(e);
     }
-    public void windowDestroyed(WindowEvent e) {
+    public void windowDestroyed(final WindowEvent e) {
         eventFifo.put(e);
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTFocusAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/AWTFocusAdapter.java
index 32ff602..d574186 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/AWTFocusAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTFocusAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.util;
 
 import java.awt.event.FocusEvent;
@@ -38,21 +38,21 @@ public class AWTFocusAdapter implements FocusEventCountAdapter, FocusListener {
     boolean wasTemporary;
     boolean verbose = true;
 
-    public AWTFocusAdapter(String prefix) {
+    public AWTFocusAdapter(final String prefix) {
         this.prefix = prefix;
         reset();
     }
 
-    public void setVerbose(boolean v) { verbose = false; }
+    public void setVerbose(final boolean v) { verbose = false; }
 
     public boolean focusLost() {
-        return focusCount<0;        
+        return focusCount<0;
     }
-    
+
     public boolean focusGained() {
         return focusCount>0;
     }
-        
+
     public void reset() {
         focusCount = 0;
         wasTemporary = false;
@@ -64,7 +64,7 @@ public class AWTFocusAdapter implements FocusEventCountAdapter, FocusListener {
     }
 
     /* @Override */
-    public void focusGained(FocusEvent e) {
+    public void focusGained(final FocusEvent e) {
         if(focusCount<0) { focusCount=0; }
         focusCount++;
         wasTemporary = e.isTemporary();
@@ -74,7 +74,7 @@ public class AWTFocusAdapter implements FocusEventCountAdapter, FocusListener {
     }
 
     /* @Override */
-    public void focusLost(FocusEvent e) {
+    public void focusLost(final FocusEvent e) {
         if(focusCount>0) { focusCount=0; }
         focusCount--;
         wasTemporary = e.isTemporary();
@@ -82,6 +82,6 @@ public class AWTFocusAdapter implements FocusEventCountAdapter, FocusListener {
             System.err.println("FOCUS AWT  LOST   "+(wasTemporary?"TEMP":"PERM")+" [fc "+focusCount+"]: "+prefix+", "+e);
         }
     }
-    
-    public String toString() { return prefix+"[focusCount "+focusCount +", temp "+wasTemporary+"]"; }    
+
+    public String toString() { return prefix+"[focusCount "+focusCount +", temp "+wasTemporary+"]"; }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTKeyAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/AWTKeyAdapter.java
index 9461af5..84c1961 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/AWTKeyAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTKeyAdapter.java
@@ -42,12 +42,12 @@ public class AWTKeyAdapter extends java.awt.event.KeyAdapter implements KeyEvent
     List<EventObject> queue = new ArrayList<EventObject>();
     boolean verbose = true;
 
-    public AWTKeyAdapter(String prefix) {
+    public AWTKeyAdapter(final String prefix) {
         this.prefix = prefix;
         reset();
     }
 
-    public synchronized void setVerbose(boolean v) { verbose = v; }
+    public synchronized void setVerbose(final boolean v) { verbose = v; }
 
     public synchronized boolean isPressed() {
         return pressed;
@@ -61,11 +61,11 @@ public class AWTKeyAdapter extends java.awt.event.KeyAdapter implements KeyEvent
         return consumed;
     }
 
-    public synchronized int getKeyPressedCount(boolean autoRepeatOnly) {
+    public synchronized int getKeyPressedCount(final boolean autoRepeatOnly) {
         return keyPressed;
     }
 
-    public synchronized int getKeyReleasedCount(boolean autoRepeatOnly) {
+    public synchronized int getKeyReleasedCount(final boolean autoRepeatOnly) {
         return keyReleased;
     }
 
@@ -85,7 +85,7 @@ public class AWTKeyAdapter extends java.awt.event.KeyAdapter implements KeyEvent
         queue.clear();
     }
 
-    public synchronized void keyPressed(KeyEvent e) {
+    public synchronized void keyPressed(final KeyEvent e) {
         pressed = true;
         keyPressed++;
         queue.add(e);
@@ -94,7 +94,7 @@ public class AWTKeyAdapter extends java.awt.event.KeyAdapter implements KeyEvent
         }
     }
 
-    public synchronized void keyReleased(KeyEvent e) {
+    public synchronized void keyReleased(final KeyEvent e) {
         pressed = false;
         keyReleased++;
         if(e.isConsumed()) {
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java
index c1bec79..2a4f7a7 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTMouseAdapter.java
@@ -41,12 +41,12 @@ public class AWTMouseAdapter extends java.awt.event.MouseAdapter implements Inpu
     List<EventObject> queue = new ArrayList<EventObject>();
     boolean verbose = true;
 
-    public AWTMouseAdapter(String prefix) {
+    public AWTMouseAdapter(final String prefix) {
         this.prefix = prefix;
         reset();
     }
 
-    public synchronized void setVerbose(boolean v) { verbose = v; }
+    public synchronized void setVerbose(final boolean v) { verbose = v; }
 
     public synchronized boolean isPressed() {
         return pressed;
@@ -75,7 +75,7 @@ public class AWTMouseAdapter extends java.awt.event.MouseAdapter implements Inpu
         queue.clear();
     }
 
-    public synchronized void mousePressed(MouseEvent e) {
+    public synchronized void mousePressed(final MouseEvent e) {
         pressed = true;
         queue.add(e);
         if( verbose ) {
@@ -83,7 +83,7 @@ public class AWTMouseAdapter extends java.awt.event.MouseAdapter implements Inpu
         }
     }
 
-    public synchronized void mouseReleased(MouseEvent e) {
+    public synchronized void mouseReleased(final MouseEvent e) {
         pressed = false;
         queue.add(e);
         if( verbose ) {
@@ -91,7 +91,7 @@ public class AWTMouseAdapter extends java.awt.event.MouseAdapter implements Inpu
         }
     }
 
-    public synchronized void mouseClicked(java.awt.event.MouseEvent e) {
+    public synchronized void mouseClicked(final java.awt.event.MouseEvent e) {
         mouseClicked+=e.getClickCount();
         if(e.isConsumed()) {
             consumed++;
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
index 599a6dc..31d6b88 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTRobotUtil.java
@@ -33,6 +33,7 @@ import jogamp.newt.awt.event.AWTNewtEventFactory;
 
 import java.lang.Thread.UncaughtExceptionHandler;
 import java.lang.reflect.InvocationTargetException;
+import java.util.concurrent.atomic.AtomicInteger;
 import java.awt.AWTException;
 import java.awt.EventQueue;
 import java.awt.Robot;
@@ -61,7 +62,7 @@ public class AWTRobotUtil {
 
     static class OurUncaughtExceptionHandler implements UncaughtExceptionHandler {
         @Override
-        public void uncaughtException(Thread t, Throwable e) {
+        public void uncaughtException(final Thread t, final Throwable e) {
             System.err.println("*** AWTRobotUtil: UncaughtException (this Thread "+Thread.currentThread().getName()+") : Thread <"+t.getName()+">, "+e.getClass().getName()+": "+e.getMessage());
             e.printStackTrace();
         }
@@ -83,7 +84,7 @@ public class AWTRobotUtil {
             for (int wait=0; wait<POLL_DIVIDER && !awtEDTAliveFlag; wait++) {
                 try {
                     Thread.sleep(TIME_SLICE);
-                } catch (InterruptedException e) {
+                } catch (final InterruptedException e) {
                     e.printStackTrace();
                 }
             }
@@ -102,7 +103,7 @@ public class AWTRobotUtil {
     }
 
     /** Issuing {@link #validateAWTEDTIsAlive()} before calling {@link Robot#waitForIdle()}. */
-    public static void waitForIdle(Robot robot) {
+    public static void waitForIdle(final Robot robot) {
         validateAWTEDTIsAlive();
         robot.waitForIdle();
     }
@@ -121,7 +122,7 @@ public class AWTRobotUtil {
         System.err.println("******** clearAWTFocus.X");
     }
 
-    public static int[] getCenterLocation(Object obj, boolean onTitleBarIfWindow)
+    public static int[] getCenterLocation(final Object obj, final boolean onTitleBarIfWindow)
         throws InterruptedException, InvocationTargetException {
         if(obj instanceof com.jogamp.newt.Window) {
             return getCenterLocationNEWT((com.jogamp.newt.Window)obj, onTitleBarIfWindow);
@@ -131,26 +132,26 @@ public class AWTRobotUtil {
             throw new RuntimeException("Neither AWT nor NEWT: "+obj);
         }
     }
-    private static int[] getCenterLocationNEWT(com.jogamp.newt.Window win, boolean onTitleBarIfWindow)
+    private static int[] getCenterLocationNEWT(final com.jogamp.newt.Window win, final boolean onTitleBarIfWindow)
         throws InterruptedException, InvocationTargetException {
 
-        javax.media.nativewindow.util.Point p0 = win.getLocationOnScreen(null);
+        final javax.media.nativewindow.util.Point p0 = win.getLocationOnScreen(null);
         if( onTitleBarIfWindow ) {
-            javax.media.nativewindow.util.InsetsImmutable insets = win.getInsets();
+            final javax.media.nativewindow.util.InsetsImmutable insets = win.getInsets();
             p0.translate(win.getWidth()/2, insets.getTopHeight()/2);
         } else {
             p0.translate(win.getWidth()/2, win.getHeight()/2);
         }
         return new int[] { p0.getX(), p0.getY() };
     }
-    private static int[] getCenterLocationAWT(java.awt.Component comp, boolean onTitleBarIfWindow)
+    private static int[] getCenterLocationAWT(final java.awt.Component comp, final boolean onTitleBarIfWindow)
         throws InterruptedException, InvocationTargetException {
         int x0, y0;
-        java.awt.Point p0 = comp.getLocationOnScreen();
-        java.awt.Rectangle r0 = comp.getBounds();
+        final java.awt.Point p0 = comp.getLocationOnScreen();
+        final java.awt.Rectangle r0 = comp.getBounds();
         if( onTitleBarIfWindow && comp instanceof java.awt.Window) {
-            java.awt.Window window = (java.awt.Window) comp;
-            java.awt.Insets insets = window.getInsets();
+            final java.awt.Window window = (java.awt.Window) comp;
+            final java.awt.Insets insets = window.getInsets();
             y0 = (int) ( p0.getY() +    insets.top / 2.0 + .5 ) ;
         } else {
             y0 = (int) ( p0.getY() + r0.getHeight() / 2.0 + .5 ) ;
@@ -159,7 +160,7 @@ public class AWTRobotUtil {
         return new int[] { x0, y0 };
     }
 
-    public static int[] getClientLocation(Object obj, int x, int y)
+    public static int[] getClientLocation(final Object obj, final int x, final int y)
         throws InterruptedException, InvocationTargetException {
         if(obj instanceof com.jogamp.newt.Window) {
             return getClientLocationNEWT((com.jogamp.newt.Window)obj, x, y);
@@ -169,18 +170,18 @@ public class AWTRobotUtil {
             throw new RuntimeException("Neither AWT nor NEWT: "+obj);
         }
     }
-    private static int[] getClientLocationNEWT(com.jogamp.newt.Window win, int x, int y)
+    private static int[] getClientLocationNEWT(final com.jogamp.newt.Window win, final int x, final int y)
         throws InterruptedException, InvocationTargetException {
-        javax.media.nativewindow.util.Point p0 = win.getLocationOnScreen(null);
+        final javax.media.nativewindow.util.Point p0 = win.getLocationOnScreen(null);
         return new int[] { p0.getX(), p0.getY() };
     }
-    private static int[] getClientLocationAWT(java.awt.Component comp, int x, int y)
+    private static int[] getClientLocationAWT(final java.awt.Component comp, final int x, final int y)
         throws InterruptedException, InvocationTargetException {
-        java.awt.Point p0 = comp.getLocationOnScreen();
+        final java.awt.Point p0 = comp.getLocationOnScreen();
         return new int[] { (int)p0.getX(), (int)p0.getY() };
     }
 
-    public static void awtRobotMouseMove(Robot robot, int x, int y) {
+    public static void awtRobotMouseMove(final Robot robot, final int x, final int y) {
         robot.mouseMove( x, y );
         robot.delay(ROBOT_DELAY);
     }
@@ -196,14 +197,14 @@ public class AWTRobotUtil {
         throws AWTException, InterruptedException, InvocationTargetException {
 
         // just for event tracing ..
-        AWTWindowFocusAdapter winFA = new AWTWindowFocusAdapter("window");
+        final AWTWindowFocusAdapter winFA = new AWTWindowFocusAdapter("window");
         window.addWindowFocusListener(winFA);
 
         if(null == robot) {
             robot = new Robot();
             robot.setAutoWaitForIdle(true);
         }
-        int[] p0 = getCenterLocation(window, false);
+        final int[] p0 = getCenterLocation(window, false);
         System.err.println("toFront: robot pos: "+p0[0]+"/"+p0[1]);
         awtRobotMouseMove(robot, p0[0], p0[1] );
 
@@ -237,7 +238,7 @@ public class AWTRobotUtil {
      * centerMouse
      * @param onTitleBarIfWindow TODO
      */
-    public static void centerMouse(Robot robot, Object obj, boolean onTitleBarIfWindow)
+    public static void centerMouse(Robot robot, final Object obj, final boolean onTitleBarIfWindow)
         throws AWTException, InterruptedException, InvocationTargetException {
 
         if(null == robot) {
@@ -245,12 +246,12 @@ public class AWTRobotUtil {
             robot.setAutoWaitForIdle(true);
         }
 
-        int[] p0 = getCenterLocation(obj, onTitleBarIfWindow);
+        final int[] p0 = getCenterLocation(obj, onTitleBarIfWindow);
         System.err.println("centerMouse: robot pos: "+p0[0]+"x"+p0[1]+", onTitleBarIfWindow: "+onTitleBarIfWindow);
         awtRobotMouseMove(robot, p0[0], p0[1] );
     }
 
-    public static void setMouseToClientLocation(Robot robot, Object obj, int x, int y)
+    public static void setMouseToClientLocation(Robot robot, final Object obj, final int x, final int y)
         throws AWTException, InterruptedException, InvocationTargetException {
 
         if(null == robot) {
@@ -258,11 +259,11 @@ public class AWTRobotUtil {
             robot.setAutoWaitForIdle(true);
         }
 
-        int[] p0 = getClientLocation(obj, x, y);
+        final int[] p0 = getClientLocation(obj, x, y);
         awtRobotMouseMove(robot, p0[0], p0[1] );
     }
 
-    public static int getClickTimeout(Object obj) {
+    public static int getClickTimeout(final Object obj) {
         if(obj instanceof com.jogamp.newt.Window) {
             return com.jogamp.newt.event.MouseEvent.getClickTimeout();
         } else if(NativeWindowFactory.isAWTAvailable() && obj instanceof java.awt.Component) {
@@ -283,7 +284,7 @@ public class AWTRobotUtil {
      * requestFocus, if robot is valid, use mouse operation,
      * otherwise programmatic, ie call requestFocus
      */
-    public static void requestFocus(Robot robot, Object obj)
+    public static void requestFocus(final Robot robot, final Object obj)
         throws AWTException, InterruptedException, InvocationTargetException {
         requestFocus(robot, obj, true);
     }
@@ -292,7 +293,7 @@ public class AWTRobotUtil {
      * requestFocus, if robot is valid, use mouse operation,
      * otherwise programmatic, ie call requestFocus
      */
-    public static void requestFocus(Robot robot, Object obj, boolean onTitleBarIfWindow)
+    public static void requestFocus(final Robot robot, final Object obj, final boolean onTitleBarIfWindow)
         throws AWTException, InterruptedException, InvocationTargetException {
         if(null != robot) {
             final int mouseButton = java.awt.event.InputEvent.BUTTON1_MASK;
@@ -314,12 +315,12 @@ public class AWTRobotUtil {
             }
         }
     }
-    private static void requestFocusNEWT(com.jogamp.newt.Window win, boolean onTitleBarIfWindow)
+    private static void requestFocusNEWT(final com.jogamp.newt.Window win, final boolean onTitleBarIfWindow)
         throws AWTException, InterruptedException, InvocationTargetException {
         win.requestFocus();
         System.err.println("requestFocus: NEWT Component");
     }
-    private static void requestFocusAWT(final java.awt.Component comp, boolean onTitleBarIfWindow)
+    private static void requestFocusAWT(final java.awt.Component comp, final boolean onTitleBarIfWindow)
         throws AWTException, InterruptedException, InvocationTargetException {
         javax.swing.SwingUtilities.invokeAndWait(new Runnable() {
             public void run() {
@@ -328,7 +329,7 @@ public class AWTRobotUtil {
             }});
     }
 
-    public static void requestFocus(Robot robot, Object obj, int x, int y)
+    public static void requestFocus(final Robot robot, final Object obj, final int x, final int y)
         throws AWTException, InterruptedException, InvocationTargetException {
         validateAWTEDTIsAlive();
 
@@ -338,7 +339,7 @@ public class AWTRobotUtil {
         if( idling ) {
             robot.waitForIdle();
         } else {
-            try { Thread.sleep(50); } catch (InterruptedException e) { }
+            try { Thread.sleep(50); } catch (final InterruptedException e) { }
         }
         robot.mousePress(mouseButton);
         robot.mouseRelease(mouseButton);
@@ -346,7 +347,7 @@ public class AWTRobotUtil {
         robot.delay( d );
     }
 
-    public static boolean hasFocus(Object obj) {
+    public static boolean hasFocus(final Object obj) {
         if(obj instanceof com.jogamp.newt.Window) {
             return ((com.jogamp.newt.Window) obj).hasFocus();
         } else if(NativeWindowFactory.isAWTAvailable() && obj instanceof java.awt.Component) {
@@ -362,7 +363,7 @@ public class AWTRobotUtil {
      *
      * @return True if the Window became the global focused Window within TIME_OUT
      */
-    public static boolean waitForFocus(Object obj) throws InterruptedException {
+    public static boolean waitForFocus(final Object obj) throws InterruptedException {
         int wait;
         if(obj instanceof com.jogamp.newt.Window) {
             final com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
@@ -385,8 +386,8 @@ public class AWTRobotUtil {
      *
      * @return True if the Window became the global focused Window within TIME_OUT
      */
-    public static boolean waitForFocus(FocusEventCountAdapter gain,
-                                       FocusEventCountAdapter lost) throws InterruptedException {
+    public static boolean waitForFocus(final FocusEventCountAdapter gain,
+                                       final FocusEventCountAdapter lost) throws InterruptedException {
         int wait;
         for (wait=0; wait<POLL_DIVIDER; wait++) {
             if( ( null == lost || lost.focusLost() ) && ( null == gain || gain.focusGained() ) ) {
@@ -401,16 +402,16 @@ public class AWTRobotUtil {
      *
      * @return True if the Window became the global focused Window within TIME_OUT
      */
-    public static boolean waitForFocus(Object obj, FocusEventCountAdapter gain,
-                                                   FocusEventCountAdapter lost) throws InterruptedException {
+    public static boolean waitForFocus(final Object obj, final FocusEventCountAdapter gain,
+                                                   final FocusEventCountAdapter lost) throws InterruptedException {
         if(!waitForFocus(obj)) {
             return false;
         }
         return waitForFocus(gain, lost);
     }
 
-    public static void assertRequestFocusAndWait(Robot robot, Object requestFocus, Object waitForFocus,
-                                              FocusEventCountAdapter gain, FocusEventCountAdapter lost)
+    public static void assertRequestFocusAndWait(final Robot robot, final Object requestFocus, final Object waitForFocus,
+                                              final FocusEventCountAdapter gain, final FocusEventCountAdapter lost)
         throws AWTException, InterruptedException, InvocationTargetException {
 
         int i = 0;
@@ -455,8 +456,8 @@ public class AWTRobotUtil {
         robot.delay(msDelay);
     }
 
-    public static int keyType(int i, Robot robot, int keyCode,
-                              Object obj, KeyEventCountAdapter counter) throws InterruptedException, AWTException, InvocationTargetException
+    public static int keyType(final int i, final Robot robot, final int keyCode,
+                              final Object obj, final KeyEventCountAdapter counter) throws InterruptedException, AWTException, InvocationTargetException
     {
         int tc = 0;
         int j;
@@ -489,7 +490,7 @@ public class AWTRobotUtil {
     }
 
     /** No validation is performed .. */
-    public static int keyPress(int i, Robot robot, boolean press, int keyCode, int msDelay) {
+    public static int keyPress(final int i, final Robot robot, final boolean press, final int keyCode, final int msDelay) {
         final long t0 = System.currentTimeMillis();
         if(press) {
             awtRobotKeyPress(robot, keyCode, msDelay);
@@ -501,7 +502,7 @@ public class AWTRobotUtil {
     }
 
     /** No validation is performed .. */
-    public static int newtKeyPress(int i, Robot robot, boolean press, short newtKeyCode, int msDelay) {
+    public static int newtKeyPress(final int i, final Robot robot, final boolean press, final short newtKeyCode, final int msDelay) {
         final int keyCode = AWTNewtEventFactory.newtKeyCode2AWTKeyCode(newtKeyCode);
         final long t0 = System.currentTimeMillis();
         if(press) {
@@ -517,8 +518,8 @@ public class AWTRobotUtil {
      * @param keyCode TODO
      * @param counter shall return the number of keys typed (press + release)
      */
-    public static void assertKeyType(Robot robot, int keyCode, int typeCount,
-                                     Object obj, KeyEventCountAdapter counter)
+    public static void assertKeyType(Robot robot, final int keyCode, final int typeCount,
+                                     final Object obj, final KeyEventCountAdapter counter)
         throws AWTException, InterruptedException, InvocationTargetException {
 
         if(null == robot) {
@@ -549,8 +550,8 @@ public class AWTRobotUtil {
      * @param keyCode TODO
      * @param counter shall return the number of keys typed (press + release)
      */
-    public static void assertKeyPress(Robot robot, int keyCode, int typeCount,
-                                      Object obj, KeyEventCountAdapter counter)
+    public static void assertKeyPress(Robot robot, final int keyCode, final int typeCount,
+                                      final Object obj, final KeyEventCountAdapter counter)
         throws AWTException, InterruptedException, InvocationTargetException {
 
         if(null == robot) {
@@ -577,8 +578,8 @@ public class AWTRobotUtil {
         Assert.assertEquals("Wrong key count", typeCount, counter.getCount()-c0);
     }
 
-    static int mouseClick(int i, Robot robot, int mouseButton,
-                          Object obj, InputEventCountAdapter counter) throws InterruptedException, AWTException, InvocationTargetException
+    static int mouseClick(final int i, final Robot robot, final int mouseButton,
+                          final Object obj, final InputEventCountAdapter counter) throws InterruptedException, AWTException, InvocationTargetException
     {
         int j;
         int tc = 0;
@@ -611,8 +612,8 @@ public class AWTRobotUtil {
      * @param mouseButton ie InputEvent.BUTTON1_MASK
      * @param clickCount ie 1, or 2
      */
-    public static void assertMouseClick(Robot robot, int mouseButton, int clickCount,
-                                        Object obj, InputEventCountAdapter counter)
+    public static void assertMouseClick(Robot robot, final int mouseButton, final int clickCount,
+                                        final Object obj, final InputEventCountAdapter counter)
         throws AWTException, InterruptedException, InvocationTargetException {
 
         if(null == robot) {
@@ -647,15 +648,15 @@ public class AWTRobotUtil {
      *
      * @return True if the Component becomes <code>visible</code> within TIME_OUT
      */
-    public static boolean waitForVisible(Object obj, boolean visible) throws InterruptedException {
+    public static boolean waitForVisible(final Object obj, final boolean visible) throws InterruptedException {
         int wait;
         if(obj instanceof com.jogamp.newt.Window) {
-            com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
+            final com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
             for (wait=0; wait<POLL_DIVIDER && visible != win.isVisible(); wait++) {
                 Thread.sleep(TIME_SLICE);
             }
         } else if(NativeWindowFactory.isAWTAvailable() && obj instanceof java.awt.Component) {
-            java.awt.Component comp = (java.awt.Component) obj;
+            final java.awt.Component comp = (java.awt.Component) obj;
             for (wait=0; wait<POLL_DIVIDER && visible != comp.isShowing(); wait++) {
                 Thread.sleep(TIME_SLICE);
             }
@@ -669,9 +670,9 @@ public class AWTRobotUtil {
      *
      * @return True if the GLDrawable receives the expected size within TIME_OUT
      */
-    public static boolean waitForSize(GLDrawable drawable, int width, int height) throws InterruptedException {
+    public static boolean waitForSize(final GLDrawable drawable, final int width, final int height) throws InterruptedException {
         int wait;
-        for (wait=0; wait<POLL_DIVIDER && ( width != drawable.getWidth() || height != drawable.getHeight() ) ; wait++) {
+        for (wait=0; wait<POLL_DIVIDER && ( width != drawable.getSurfaceWidth() || height != drawable.getSurfaceHeight() ) ; wait++) {
             Thread.sleep(TIME_SLICE);
         }
         return wait<POLL_DIVIDER;
@@ -683,7 +684,7 @@ public class AWTRobotUtil {
      * @return True if the Component becomes realized (not displayable, native invalid) within TIME_OUT
      * @throws InterruptedException
      */
-    public static boolean waitForRealized(Object obj, boolean realized) throws InterruptedException {
+    public static boolean waitForRealized(final Object obj, final boolean realized) throws InterruptedException {
         return waitForRealized(obj, null, realized);
     }
 
@@ -694,11 +695,11 @@ public class AWTRobotUtil {
      * @return True if the Component becomes realized (not displayable, native invalid) within TIME_OUT
      * @throws InterruptedException
      */
-    public static boolean waitForRealized(Object obj, Runnable waitAction, boolean realized) throws InterruptedException {
+    public static boolean waitForRealized(final Object obj, final Runnable waitAction, final boolean realized) throws InterruptedException {
         long t0 = System.currentTimeMillis();
         long t1 = t0;
         if(obj instanceof com.jogamp.newt.Screen) {
-            com.jogamp.newt.Screen screen = (com.jogamp.newt.Screen) obj;
+            final com.jogamp.newt.Screen screen = (com.jogamp.newt.Screen) obj;
             while( (t1-t0) < TIME_OUT && realized != screen.isNativeValid() ) {
                 if( null != waitAction ) {
                     waitAction.run();
@@ -708,7 +709,7 @@ public class AWTRobotUtil {
                 t1 = System.currentTimeMillis();
             }
         } else if(obj instanceof com.jogamp.newt.Window) {
-            com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
+            final com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
             while( (t1-t0) < TIME_OUT && realized != win.isNativeValid() ) {
                 if( null != waitAction ) {
                     waitAction.run();
@@ -718,7 +719,7 @@ public class AWTRobotUtil {
                 t1 = System.currentTimeMillis();
             }
         } else if (NativeWindowFactory.isAWTAvailable() && obj instanceof java.awt.Component) {
-            java.awt.Component comp = (java.awt.Component) obj;
+            final java.awt.Component comp = (java.awt.Component) obj;
             while( (t1-t0) < TIME_OUT && realized != comp.isShowing() ) {
                 if( null != waitAction ) {
                     waitAction.run();
@@ -729,7 +730,7 @@ public class AWTRobotUtil {
             }
             // if GLCanvas, ensure it got also painted -> drawable.setRealized(true);
             if( (t1-t0) < TIME_OUT && comp instanceof GLAutoDrawable) {
-                GLAutoDrawable glad = (GLAutoDrawable) comp;
+                final GLAutoDrawable glad = (GLAutoDrawable) comp;
                 t0 = System.currentTimeMillis();
                 while( (t1-t0) < TIME_OUT && realized != glad.isRealized() ) {
                     if( null != waitAction ) {
@@ -756,7 +757,7 @@ public class AWTRobotUtil {
                 }
             }
         } else if(obj instanceof GLAutoDrawable) {
-            GLAutoDrawable glad = (GLAutoDrawable) obj;
+            final GLAutoDrawable glad = (GLAutoDrawable) obj;
             while( (t1-t0) < TIME_OUT && realized != glad.isRealized() ) {
                 if( null != waitAction ) {
                     waitAction.run();
@@ -775,7 +776,7 @@ public class AWTRobotUtil {
      *
      * @return True if the GLContext becomes created or not within TIME_OUT
      */
-    public static boolean waitForContextCreated(GLAutoDrawable autoDrawable, boolean created) throws InterruptedException {
+    public static boolean waitForContextCreated(final GLAutoDrawable autoDrawable, final boolean created) throws InterruptedException {
         if( null == autoDrawable ) {
             return !created;
         }
@@ -808,18 +809,18 @@ public class AWTRobotUtil {
      * @return True if the Window is closing and closed (if willClose is true), each within TIME_OUT
      * @throws InterruptedException
      */
-    public static boolean closeWindow(Object obj, boolean willClose, WindowClosingListener closingListener) throws InterruptedException {
+    public static boolean closeWindow(final Object obj, final boolean willClose, final WindowClosingListener closingListener) throws InterruptedException {
         closingListener.reset();
         if(obj instanceof java.awt.Window) {
             final java.awt.Window win = (java.awt.Window) obj;
-            java.awt.Toolkit tk = java.awt.Toolkit.getDefaultToolkit();
+            final java.awt.Toolkit tk = java.awt.Toolkit.getDefaultToolkit();
             final java.awt.EventQueue evtQ = tk.getSystemEventQueue();
             AWTEDTExecutor.singleton.invoke(true, new Runnable() {
                 public void run() {
                     evtQ.postEvent(new java.awt.event.WindowEvent(win, java.awt.event.WindowEvent.WINDOW_CLOSING));
                 } });
         } else if(obj instanceof com.jogamp.newt.Window) {
-            com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
+            final com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
             WindowImplAccess.windowDestroyNotify(win);
         }
         int wait;
@@ -834,7 +835,7 @@ public class AWTRobotUtil {
         return wait<POLL_DIVIDER;
     }
 
-    public static WindowClosingListener addClosingListener(Object obj) {
+    public static WindowClosingListener addClosingListener(final Object obj) {
         WindowClosingListener cl = null;
         if(obj instanceof java.awt.Window) {
             final java.awt.Window win = (java.awt.Window) obj;
@@ -845,8 +846,8 @@ public class AWTRobotUtil {
                 } } );
             cl = acl;
         } else if(obj instanceof com.jogamp.newt.Window) {
-            com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
-            NEWTWindowClosingAdapter ncl = new NEWTWindowClosingAdapter();
+            final com.jogamp.newt.Window win = (com.jogamp.newt.Window) obj;
+            final NEWTWindowClosingAdapter ncl = new NEWTWindowClosingAdapter();
             win.addWindowListener(ncl);
             cl = ncl;
         } else {
@@ -864,31 +865,31 @@ public class AWTRobotUtil {
     static class AWTWindowClosingAdapter
             extends java.awt.event.WindowAdapter implements WindowClosingListener
     {
-        volatile int closing = 0;
-        volatile int closed = 0;
+        AtomicInteger closing = new AtomicInteger(0);
+        AtomicInteger closed = new AtomicInteger(0);
 
         public void reset() {
-            closing = 0;
-            closed = 0;
+            closing.set(0);
+            closed.set(0);
         }
         public int getWindowClosingCount() {
-            return closing;
+            return closing.get();
         }
         public int getWindowClosedCount() {
-            return closed;
+            return closed.get();
         }
         public boolean isWindowClosing() {
-            return 0 < closing;
+            return 0 < closing.get();
         }
         public boolean isWindowClosed() {
-            return 0 < closed;
+            return 0 < closed.get();
         }
-        public void windowClosing(java.awt.event.WindowEvent e) {
-            closing++;
+        public void windowClosing(final java.awt.event.WindowEvent e) {
+            closing.incrementAndGet();
             System.err.println("AWTWindowClosingAdapter.windowClosing: "+this);
         }
-        public void windowClosed(java.awt.event.WindowEvent e) {
-            closed++;
+        public void windowClosed(final java.awt.event.WindowEvent e) {
+            closed.incrementAndGet();
             System.err.println("AWTWindowClosingAdapter.windowClosed: "+this);
         }
         public String toString() {
@@ -898,31 +899,31 @@ public class AWTRobotUtil {
     static class NEWTWindowClosingAdapter
             extends com.jogamp.newt.event.WindowAdapter implements WindowClosingListener
     {
-        volatile int closing = 0;
-        volatile int closed = 0;
+        AtomicInteger closing = new AtomicInteger(0);
+        AtomicInteger closed = new AtomicInteger(0);
 
         public void reset() {
-            closing = 0;
-            closed = 0;
+            closing.set(0);
+            closed.set(0);
         }
         public int getWindowClosingCount() {
-            return closing;
+            return closing.get();
         }
         public int getWindowClosedCount() {
-            return closed;
+            return closed.get();
         }
         public boolean isWindowClosing() {
-            return 0 < closing;
+            return 0 < closing.get();
         }
         public boolean isWindowClosed() {
-            return 0 < closed;
+            return 0 < closed.get();
         }
-        public void windowDestroyNotify(WindowEvent e) {
-            closing++;
+        public void windowDestroyNotify(final WindowEvent e) {
+            closing.incrementAndGet();
             System.err.println("NEWTWindowClosingAdapter.windowDestroyNotify: "+this);
         }
-        public void windowDestroyed(WindowEvent e) {
-            closed++;
+        public void windowDestroyed(final WindowEvent e) {
+            closed.incrementAndGet();
             System.err.println("NEWTWindowClosingAdapter.windowDestroyed: "+this);
         }
         public String toString() {
diff --git a/src/test/com/jogamp/opengl/test/junit/util/AWTWindowFocusAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/AWTWindowFocusAdapter.java
index 2e74dfa..e2cafb1 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/AWTWindowFocusAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/AWTWindowFocusAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.util;
 
 import java.awt.event.WindowEvent;
@@ -37,27 +37,27 @@ public class AWTWindowFocusAdapter implements FocusEventCountAdapter, WindowFocu
     int focusCount;
     boolean verbose = true;
 
-    public AWTWindowFocusAdapter(String prefix) {
+    public AWTWindowFocusAdapter(final String prefix) {
         this.prefix = prefix;
         reset();
     }
 
-    public void setVerbose(boolean v) { verbose = false; }
+    public void setVerbose(final boolean v) { verbose = false; }
 
     public boolean focusLost() {
-        return focusCount<0;        
+        return focusCount<0;
     }
-    
+
     public boolean focusGained() {
         return focusCount>0;
     }
-        
+
     public void reset() {
         focusCount = 0;
     }
 
     /* @Override */
-    public void windowGainedFocus(WindowEvent e) {
+    public void windowGainedFocus(final WindowEvent e) {
         if(focusCount<0) { focusCount=0; }
         focusCount++;
         if( verbose ) {
@@ -66,13 +66,13 @@ public class AWTWindowFocusAdapter implements FocusEventCountAdapter, WindowFocu
     }
 
     /* @Override */
-    public void windowLostFocus(WindowEvent e) {
+    public void windowLostFocus(final WindowEvent e) {
         if(focusCount>0) { focusCount=0; }
         focusCount--;
         if( verbose ) {
             System.err.println("FOCUS AWT  LOST   (Window) [fc "+focusCount+"]: "+prefix+", "+e);
         }
     }
-    
+
     public String toString() { return prefix+"[focusCount "+focusCount +"]"; }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/util/DumpGLInfo.java b/src/test/com/jogamp/opengl/test/junit/util/DumpGLInfo.java
index 99db075..ec8276d 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/DumpGLInfo.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/DumpGLInfo.java
@@ -35,17 +35,17 @@ import com.jogamp.opengl.JoglVersion;
 
 public class DumpGLInfo implements GLEventListener {
 
-    public void init(GLAutoDrawable drawable) {
-        GL gl = drawable.getGL();
+    public void init(final GLAutoDrawable drawable) {
+        final GL gl = drawable.getGL();
         System.err.println(JoglVersion.getGLInfo(gl, null, true));
     }
 
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
     }
 
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
     }
 
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
     }
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapter.java
index 906e4a7..804a4ea 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.util;
 
 /**
@@ -36,7 +36,7 @@ package com.jogamp.opengl.test.junit.util;
  */
 public interface EventCountAdapter {
     void reset();
-    
+
     /** Instance starts in verbose mode, call w/ false to disable verbosity. */
     void setVerbose(boolean v);
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapterUtil.java b/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapterUtil.java
index d919d7c..b2db3e0 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapterUtil.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/EventCountAdapterUtil.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.util;
 
 import java.util.List;
@@ -33,15 +33,15 @@ import java.util.Iterator;
 
 public abstract class EventCountAdapterUtil {
 
-    public static void reset(EventCountAdapter[] adapters) {
+    public static void reset(final EventCountAdapter[] adapters) {
         for(int i=0; i<adapters.length; i++) {
             adapters[i].reset();
         }
     }
 
-    public static void reset(List/*<EventCountAdapter>*/ adapters) {
-        for(Iterator i = adapters.iterator(); i.hasNext(); ) {
-            EventCountAdapter adapter = (EventCountAdapter) i.next();
+    public static void reset(final List/*<EventCountAdapter>*/ adapters) {
+        for(final Iterator i = adapters.iterator(); i.hasNext(); ) {
+            final EventCountAdapter adapter = (EventCountAdapter) i.next();
             adapter.reset();
         }
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/util/FocusEventCountAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/FocusEventCountAdapter.java
index 461c726..54b1454 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/FocusEventCountAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/FocusEventCountAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.util;
 
 public interface FocusEventCountAdapter extends EventCountAdapter {
diff --git a/src/test/com/jogamp/opengl/test/junit/util/GLEventListenerCounter.java b/src/test/com/jogamp/opengl/test/junit/util/GLEventListenerCounter.java
index b0f6e2c..981c5c1 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/GLEventListenerCounter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/GLEventListenerCounter.java
@@ -44,22 +44,22 @@ public class GLEventListenerCounter implements GLEventListener {
     }
 
     @Override
-    public void init(GLAutoDrawable drawable) {
+    public void init(final GLAutoDrawable drawable) {
         initCount++;
     }
 
     @Override
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         disposeCount++;
     }
 
     @Override
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         displayCount++;
     }
 
     @Override
-    public void reshape(GLAutoDrawable d, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable d, final int x, final int y, final int width, final int height) {
         reshapeCount++;
     }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java b/src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java
index 926d449..5c2b2c5 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/GLSLSimpleProgram.java
@@ -41,25 +41,25 @@ public class GLSLSimpleProgram {
     private int fragShader;
     private boolean isValid;
 
-    private GLSLSimpleProgram(int shaderProgram, int vertShader, int fragShader) {
+    private GLSLSimpleProgram(final int shaderProgram, final int vertShader, final int fragShader) {
         this.shaderProgram = shaderProgram;
         this.vertShader = vertShader;
         this.fragShader = fragShader;
         this.isValid = true;
     }
 
-    public static GLSLSimpleProgram create(GL2ES2 gl, String vertShaderCode, String fragShaderCode, boolean link) {
-        ByteArrayOutputStream baos = new ByteArrayOutputStream();
-        PrintStream pbaos = new PrintStream(baos);
+    public static GLSLSimpleProgram create(final GL2ES2 gl, final String vertShaderCode, final String fragShaderCode, final boolean link) {
+        final ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        final PrintStream pbaos = new PrintStream(baos);
 
-        int vertShader = gl.glCreateShader(GL2ES2.GL_VERTEX_SHADER);
+        final int vertShader = gl.glCreateShader(GL2ES2.GL_VERTEX_SHADER);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
 
-        int fragShader = gl.glCreateShader(GL2ES2.GL_FRAGMENT_SHADER);
+        final int fragShader = gl.glCreateShader(GL2ES2.GL_FRAGMENT_SHADER);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
 
-        String[] vlines = new String[] { gl.getContext().getGLSLVersionString()+vertShaderCode };
-        int[] vlengths = new int[] { vlines[0].length() };
+        final String[] vlines = new String[] { gl.getContext().getGLSLVersionString()+vertShaderCode };
+        final int[] vlengths = new int[] { vlines[0].length() };
         gl.glShaderSource(vertShader, vlines.length, vlines, vlengths, 0);
         gl.glCompileShader(vertShader);
         if(!ShaderUtil.isShaderStatusValid(gl, vertShader, GL2ES2.GL_COMPILE_STATUS, pbaos)) {
@@ -69,9 +69,9 @@ public class GLSLSimpleProgram {
         pbaos.flush(); baos.reset();
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
 
-        
-        String[] flines = new String[] { gl.getContext().getGLSLVersionString()+fragShaderCode };
-        int[] flengths = new int[] { flines[0].length() };
+
+        final String[] flines = new String[] { gl.getContext().getGLSLVersionString()+fragShaderCode };
+        final int[] flengths = new int[] { flines[0].length() };
         gl.glShaderSource(fragShader, flines.length, flines, flengths, 0);
         gl.glCompileShader(fragShader);
         if(!ShaderUtil.isShaderStatusValid(gl, fragShader, GL2ES2.GL_COMPILE_STATUS, pbaos)) {
@@ -81,7 +81,7 @@ public class GLSLSimpleProgram {
         pbaos.flush(); baos.reset();
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
 
-        int shaderProgram = gl.glCreateProgram();
+        final int shaderProgram = gl.glCreateProgram();
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
         gl.glAttachShader(shaderProgram, vertShader);
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
@@ -96,11 +96,11 @@ public class GLSLSimpleProgram {
             }
         }
         Assert.assertEquals(GL.GL_NO_ERROR, gl.glGetError());
-        GLSLSimpleProgram res = new GLSLSimpleProgram(shaderProgram, vertShader, fragShader);
+        final GLSLSimpleProgram res = new GLSLSimpleProgram(shaderProgram, vertShader, fragShader);
         return res;
     }
 
-    public void release(GL2ES2 gl) {
+    public void release(final GL2ES2 gl) {
         gl.glUseProgram(0);
         gl.glDetachShader(shaderProgram, vertShader);
         gl.glDeleteShader(vertShader);
@@ -124,7 +124,7 @@ public class GLSLSimpleProgram {
     public int getVertShader() {
         return vertShader;
     }
-    
+
     public boolean isValid() {
         return isValid;
     }
diff --git a/src/test/com/jogamp/opengl/test/junit/util/KeyEventCountAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/KeyEventCountAdapter.java
index 1d6d97a..aaafeac 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/KeyEventCountAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/KeyEventCountAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,17 +20,17 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.util;
 
 public interface KeyEventCountAdapter extends  InputEventCountAdapter {
     public int getKeyPressedCount(boolean autoRepeatOnly);
-    
-    public int getKeyReleasedCount(boolean autoRepeatOnly);    
+
+    public int getKeyReleasedCount(boolean autoRepeatOnly);
 }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/util/MiscUtils.java b/src/test/com/jogamp/opengl/test/junit/util/MiscUtils.java
index e5f1364..e401534 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/MiscUtils.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/MiscUtils.java
@@ -44,63 +44,63 @@ import javax.media.opengl.GLContext;
 import com.jogamp.common.os.Platform;
 
 public class MiscUtils {
-    public static boolean atob(String str, boolean def) {
+    public static boolean atob(final String str, final boolean def) {
         try {
             return Boolean.parseBoolean(str);
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             ex.printStackTrace();
         }
         return def;
     }
 
-    public static int atoi(String str, int def) {
+    public static int atoi(final String str, final int def) {
         try {
             return Integer.parseInt(str);
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             ex.printStackTrace();
         }
         return def;
     }
 
-    public static long atol(String str, long def) {
+    public static long atol(final String str, final long def) {
         try {
             return Long.parseLong(str);
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             ex.printStackTrace();
         }
         return def;
     }
 
-    public static float atof(String str, float def) {
+    public static float atof(final String str, final float def) {
         try {
             return Float.parseFloat(str);
-        } catch (Exception ex) {
+        } catch (final Exception ex) {
             ex.printStackTrace();
         }
         return def;
     }
 
-    public static String toHexString(byte hex) {
+    public static String toHexString(final byte hex) {
         return "0x" + Integer.toHexString( hex & 0x000000FF );
     }
 
-    public static String toHexString(short hex) {
+    public static String toHexString(final short hex) {
         return "0x" + Integer.toHexString( hex & 0x0000FFFF );
     }
 
-    public static String toHexString(int hex) {
+    public static String toHexString(final int hex) {
         return "0x" + Integer.toHexString( hex );
     }
 
-    public static String toHexString(long hex) {
+    public static String toHexString(final long hex) {
         return "0x" + Long.toHexString( hex );
     }
 
-    public static void assertFloatBufferEquals(String errmsg, FloatBuffer expected, FloatBuffer actual, float delta) {
+    public static void assertFloatBufferEquals(final String errmsg, final FloatBuffer expected, final FloatBuffer actual, final float delta) {
         if(null == expected && null == actual) {
             return;
         }
-        String msg = null != errmsg ? errmsg + " " : "";
+        final String msg = null != errmsg ? errmsg + " " : "";
         if(null == expected) {
             throw new AssertionError(msg+"; Expected is null, but actual not: "+actual);
         }
@@ -122,14 +122,14 @@ public class MiscUtils {
         }
     }
 
-    public static void assertFloatBufferNotEqual(String errmsg, FloatBuffer expected, FloatBuffer actual, float delta) {
+    public static void assertFloatBufferNotEqual(final String errmsg, final FloatBuffer expected, final FloatBuffer actual, final float delta) {
         if(null == expected || null == actual) {
             return;
         }
         if(expected.remaining() != actual.remaining()) {
             return;
         }
-        String msg = null != errmsg ? errmsg + " " : "";
+        final String msg = null != errmsg ? errmsg + " " : "";
         final int a0 = expected.position();
         final int b0 = actual.position();
         for(int i=0; i<expected.remaining(); i++) {
@@ -143,18 +143,18 @@ public class MiscUtils {
         throw new AssertionError(msg+"; Expected and actual are equal.");
     }
 
-    public static boolean setFieldIfExists(Object instance, String fieldName, Object value) {
+    public static boolean setFieldIfExists(final Object instance, final String fieldName, final Object value) {
         try {
-            Field f = instance.getClass().getField(fieldName);
+            final Field f = instance.getClass().getField(fieldName);
             if(value instanceof Boolean || f.getType().isInstance(value)) {
                 f.set(instance, value);
                 return true;
             } else {
                 System.out.println(instance.getClass()+" '"+fieldName+"' field not assignable with "+value.getClass()+", it's a: "+f.getType());
             }
-        } catch (IllegalAccessException ex) {
+        } catch (final IllegalAccessException ex) {
             throw new RuntimeException(ex);
-        } catch (NoSuchFieldException nsfe) {
+        } catch (final NoSuchFieldException nsfe) {
             // OK - throw new RuntimeException(instance.getClass()+" has no '"+fieldName+"' field", nsfe);
         }
         return false;
@@ -168,14 +168,14 @@ public class MiscUtils {
         final Object sync;
         volatile boolean eos = false;
 
-        public StreamDump(OutputStream out, String prefix, InputStream is, Object sync) {
+        public StreamDump(final OutputStream out, final String prefix, final InputStream is, final Object sync) {
             this.is = is;
             this.outString = null;
             this.outStream = out;
             this.prefix = prefix;
             this.sync = sync;
         }
-        public StreamDump(StringBuilder sb, InputStream is, Object sync) {
+        public StreamDump(final StringBuilder sb, final InputStream is, final Object sync) {
             this.is = is;
             this.outString = sb;
             this.outStream = null;
@@ -203,8 +203,8 @@ public class MiscUtils {
                             outStream.flush();
                         }
                     }
-                } catch (IOException ioe) {
-                    System.err.println("Catched "+ioe.getClass().getName()+": "+ioe.getMessage());
+                } catch (final IOException ioe) {
+                    System.err.println("Caught "+ioe.getClass().getName()+": "+ioe.getMessage());
                     ioe.printStackTrace();
                 } finally {
                     eos = true;
@@ -214,7 +214,7 @@ public class MiscUtils {
         }
     }
 
-    public static void dumpSharedGLContext(GLContext self) {
+    public static void dumpSharedGLContext(final GLContext self) {
       int i = 0, j = 0;
       System.err.println("Myself: hash 0x"+Integer.toHexString(self.hashCode())+", \t(isShared "+self.isShared()+", created "+self.isCreated()+")");
       {
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTFocusAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTFocusAdapter.java
index ccb1bde..23e0817 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/NEWTFocusAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTFocusAdapter.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.util;
 
 import com.jogamp.newt.event.WindowEvent;
@@ -38,26 +38,26 @@ public class NEWTFocusAdapter implements WindowListener, FocusEventCountAdapter
     int focusCount;
     boolean verbose = true;
 
-    public NEWTFocusAdapter(String prefix) {
+    public NEWTFocusAdapter(final String prefix) {
         this.prefix = prefix;
         reset();
     }
 
-    public void setVerbose(boolean v) { verbose = false; }
+    public void setVerbose(final boolean v) { verbose = false; }
 
     public boolean focusLost() {
-        return focusCount<0;        
+        return focusCount<0;
     }
-    
+
     public boolean focusGained() {
         return focusCount>0;
     }
-    
+
     public void reset() {
         focusCount = 0;
     }
 
-    public void windowGainedFocus(WindowEvent e) {
+    public void windowGainedFocus(final WindowEvent e) {
         if(focusCount<0) { focusCount=0; }
         focusCount++;
         if( verbose ) {
@@ -65,7 +65,7 @@ public class NEWTFocusAdapter implements WindowListener, FocusEventCountAdapter
         }
     }
 
-    public void windowLostFocus(WindowEvent e) {
+    public void windowLostFocus(final WindowEvent e) {
         if(focusCount>0) { focusCount=0; }
         focusCount--;
         if( verbose ) {
@@ -73,12 +73,12 @@ public class NEWTFocusAdapter implements WindowListener, FocusEventCountAdapter
         }
     }
 
-    public void windowResized(WindowEvent e) { }
-    public void windowMoved(WindowEvent e) { }
-    public void windowDestroyNotify(WindowEvent e) { }
-    public void windowDestroyed(WindowEvent e) { }
-    public void windowRepaint(WindowUpdateEvent e) { }
-    
-    public String toString() { return prefix+"[focusCount "+focusCount+"]"; }        
+    public void windowResized(final WindowEvent e) { }
+    public void windowMoved(final WindowEvent e) { }
+    public void windowDestroyNotify(final WindowEvent e) { }
+    public void windowDestroyed(final WindowEvent e) { }
+    public void windowRepaint(final WindowUpdateEvent e) { }
+
+    public String toString() { return prefix+"[focusCount "+focusCount+"]"; }
 }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTGLContext.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTGLContext.java
index a76b67d..cd3a1ea 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/NEWTGLContext.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTGLContext.java
@@ -41,102 +41,102 @@ import org.junit.Assert;
 
 public class NEWTGLContext {
 
-    public static class WindowContext {        
+    public static class WindowContext {
         public final Window window;
         public final GLDrawable drawable;
         public final GLContext context;
-        
-        public WindowContext(Window w, GLDrawable d, GLContext c) {
+
+        public WindowContext(final Window w, final GLDrawable d, final GLContext c) {
             window = w;
             drawable = d;
             context = c;
         }
     }
 
-    public static WindowContext createOffscreenWindow(GLCapabilities caps, int width, int height, boolean debugGL) throws InterruptedException {        
+    public static WindowContext createOffscreenWindow(final GLCapabilities caps, final int width, final int height, final boolean debugGL) throws InterruptedException {
         caps.setOnscreen(false);
         caps.setPBuffer(true);
-        
+
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
-        Display display = NewtFactory.createDisplay(null); // local display
+        //
+        final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
-    
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
-    
-        Window window = NewtFactory.createWindow(screen, caps);
+
+        final Window window = NewtFactory.createWindow(screen, caps);
         Assert.assertNotNull(window);
         window.setSize(width, height);
         window.setVisible(true);
         Assert.assertTrue(AWTRobotUtil.waitForVisible(window, true));
         Assert.assertTrue(AWTRobotUtil.waitForRealized(window, true));
-            
-        GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
-        GLDrawable drawable = factory.createGLDrawable(window);
+
+        final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
+        final GLDrawable drawable = factory.createGLDrawable(window);
         Assert.assertNotNull(drawable);
-        
+
         drawable.setRealized(true);
         Assert.assertTrue(drawable.isRealized());
-        
-        GLContext context = drawable.createContext(null);
+
+        final GLContext context = drawable.createContext(null);
         Assert.assertNotNull(context);
-        
+
         context.enableGLDebugMessage(debugGL);
-        
-        int res = context.makeCurrent();
+
+        final int res = context.makeCurrent();
         Assert.assertTrue(GLContext.CONTEXT_CURRENT_NEW==res || GLContext.CONTEXT_CURRENT==res);
-        
+
         return new WindowContext(window, drawable, context);
     }
 
-    public static WindowContext createOnscreenWindow(GLCapabilities caps, int width, int height, boolean debugGL) throws InterruptedException {        
+    public static WindowContext createOnscreenWindow(final GLCapabilities caps, final int width, final int height, final boolean debugGL) throws InterruptedException {
         //
         // Create native windowing resources .. X11/Win/OSX
-        // 
-        Display display = NewtFactory.createDisplay(null); // local display
+        //
+        final Display display = NewtFactory.createDisplay(null); // local display
         Assert.assertNotNull(display);
-    
-        Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
+
+        final Screen screen  = NewtFactory.createScreen(display, 0); // screen 0
         Assert.assertNotNull(screen);
-    
-        Window window = NewtFactory.createWindow(screen, caps);
+
+        final Window window = NewtFactory.createWindow(screen, caps);
         Assert.assertNotNull(window);
         window.setSize(width, height);
         window.setVisible(true);
         Assert.assertTrue(AWTRobotUtil.waitForVisible(window, true));
         Assert.assertTrue(AWTRobotUtil.waitForRealized(window, true));
-            
-        GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
-        GLDrawable drawable = factory.createGLDrawable(window);
+
+        final GLDrawableFactory factory = GLDrawableFactory.getFactory(caps.getGLProfile());
+        final GLDrawable drawable = factory.createGLDrawable(window);
         Assert.assertNotNull(drawable);
-        
+
         drawable.setRealized(true);
         Assert.assertTrue(drawable.isRealized());
-        
-        GLContext context = drawable.createContext(null);
+
+        final GLContext context = drawable.createContext(null);
         Assert.assertNotNull(context);
-        
+
         context.enableGLDebugMessage(debugGL);
-        
-        int res = context.makeCurrent();
+
+        final int res = context.makeCurrent();
         Assert.assertTrue(GLContext.CONTEXT_CURRENT_NEW==res || GLContext.CONTEXT_CURRENT==res);
-        
+
         return new WindowContext(window, drawable, context);
     }
 
-    public static void destroyWindow(WindowContext winctx) {
-        GLDrawable drawable = winctx.context.getGLDrawable();
-        
+    public static void destroyWindow(final WindowContext winctx) {
+        final GLDrawable drawable = winctx.context.getGLDrawable();
+
         Assert.assertNotNull(winctx.context);
         winctx.context.destroy();
-    
+
         Assert.assertNotNull(drawable);
         drawable.setRealized(false);
-    
+
         Assert.assertNotNull(winctx.window);
         winctx.window.destroy();
     }
-   
+
 }
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java
index 0e86afd..95cd0e7 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyAdapter.java
@@ -46,12 +46,12 @@ public class NEWTKeyAdapter extends KeyAdapter implements KeyEventCountAdapter {
     List<EventObject> queue = new ArrayList<EventObject>();
     boolean verbose = true;
 
-    public NEWTKeyAdapter(String prefix) {
+    public NEWTKeyAdapter(final String prefix) {
         this.prefix = prefix;
         reset();
     }
 
-    public synchronized void setVerbose(boolean v) { verbose = v; }
+    public synchronized void setVerbose(final boolean v) { verbose = v; }
 
     public synchronized boolean isPressed() {
         return pressed;
@@ -65,11 +65,11 @@ public class NEWTKeyAdapter extends KeyAdapter implements KeyEventCountAdapter {
         return consumed;
     }
 
-    public synchronized int getKeyPressedCount(boolean autoRepeatOnly) {
+    public synchronized int getKeyPressedCount(final boolean autoRepeatOnly) {
         return autoRepeatOnly ? keyPressedAR: keyPressed;
     }
 
-    public synchronized int getKeyReleasedCount(boolean autoRepeatOnly) {
+    public synchronized int getKeyReleasedCount(final boolean autoRepeatOnly) {
         return autoRepeatOnly ? keyReleasedAR: keyReleased;
     }
 
@@ -91,7 +91,7 @@ public class NEWTKeyAdapter extends KeyAdapter implements KeyEventCountAdapter {
         queue.clear();
     }
 
-    public synchronized void keyPressed(KeyEvent e) {
+    public synchronized void keyPressed(final KeyEvent e) {
         pressed = true;
         keyPressed++;
         if( 0 != ( e.getModifiers() & InputEvent.AUTOREPEAT_MASK ) ) {
@@ -103,7 +103,7 @@ public class NEWTKeyAdapter extends KeyAdapter implements KeyEventCountAdapter {
         }
     }
 
-    public synchronized void keyReleased(KeyEvent e) {
+    public synchronized void keyReleased(final KeyEvent e) {
         pressed = false;
         keyReleased++;
         if(e.isConsumed()) {
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyUtil.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyUtil.java
index 89bafbd..623d182 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyUtil.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTKeyUtil.java
@@ -46,7 +46,7 @@ public class NEWTKeyUtil {
         public final short max;
         public final String description;
 
-        public CodeSeg(int min, int max, String description) {
+        public CodeSeg(final int min, final int max, final String description) {
             this.min = (short)min;
             this.max = (short)max;
             this.description = description;
@@ -57,7 +57,7 @@ public class NEWTKeyUtil {
         public final String description;
         public final KeyEvent event;
 
-        public CodeEvent(short code, String description, KeyEvent event) {
+        public CodeEvent(final short code, final String description, final KeyEvent event) {
             this.code = code;
             this.description = description;
             this.event = event;
@@ -67,13 +67,13 @@ public class NEWTKeyUtil {
         }
     }
 
-    public static void dumpKeyEvents(List<EventObject> keyEvents) {
+    public static void dumpKeyEvents(final List<EventObject> keyEvents) {
         for(int i=0; i<keyEvents.size(); i++) {
             System.err.println(i+": "+keyEvents.get(i));
         }
     }
 
-    public static boolean validateKeyCodes(CodeSeg[] codeSegments, List<List<EventObject>> keyEventsList, boolean verbose) {
+    public static boolean validateKeyCodes(final CodeSeg[] codeSegments, final List<List<EventObject>> keyEventsList, final boolean verbose) {
         final List<CodeEvent> missCodes = new ArrayList<CodeEvent>();
         int totalCodeCount = 0;
         boolean res = true;
@@ -91,7 +91,7 @@ public class NEWTKeyUtil {
         }
         return res;
     }
-    public static boolean validateKeyCodes(List<CodeEvent> missCodes, CodeSeg codeSeg, List<EventObject> keyEvents, boolean verbose) {
+    public static boolean validateKeyCodes(final List<CodeEvent> missCodes, final CodeSeg codeSeg, final List<EventObject> keyEvents, final boolean verbose) {
         final int codeCount = codeSeg.max - codeSeg.min + 1;
         int misses = 0;
         int evtIdx = 0;
@@ -118,7 +118,7 @@ public class NEWTKeyUtil {
         return res;
     }
 
-    public static void validateKeyEvent(KeyEvent e, short eventType, int modifiers, short keyCode, char keyChar) {
+    public static void validateKeyEvent(final KeyEvent e, final short eventType, final int modifiers, final short keyCode, final char keyChar) {
         if(0 <= eventType) {
             Assert.assertTrue("KeyEvent type mismatch, expected 0x"+Integer.toHexString(eventType)+", has "+e, eventType == e.getEventType());
         }
@@ -133,7 +133,7 @@ public class NEWTKeyUtil {
         }
     }
 
-    public static short getNextKeyEventType(KeyEvent e) {
+    public static short getNextKeyEventType(final KeyEvent e) {
         final int et = e.getEventType();
         switch( et ) {
             case KeyEvent.EVENT_KEY_PRESSED:
@@ -146,8 +146,8 @@ public class NEWTKeyUtil {
         }
     }
 
-    public static void validateKeyEventOrder(List<EventObject> keyEvents) {
-        IntIntHashMap keyCode2NextEvent = new IntIntHashMap();
+    public static void validateKeyEventOrder(final List<EventObject> keyEvents) {
+        final IntIntHashMap keyCode2NextEvent = new IntIntHashMap();
         for(int i=0; i<keyEvents.size(); i++) {
             final KeyEvent e = (KeyEvent) keyEvents.get(i);
             int eet = keyCode2NextEvent.get(e.getKeyCode());
@@ -168,9 +168,9 @@ public class NEWTKeyUtil {
      * @param expPressedCountAR number of auto-repeat key press events
      * @param expReleasedCountAR number of auto-repeat key release events
      */
-    public static void validateKeyAdapterStats(NEWTKeyAdapter keyAdapter,
-                                               int expPressedCountSI, int expReleasedCountSI,
-                                               int expPressedCountAR, int expReleasedCountAR) {
+    public static void validateKeyAdapterStats(final NEWTKeyAdapter keyAdapter,
+                                               final int expPressedCountSI, final int expReleasedCountSI,
+                                               final int expPressedCountAR, final int expReleasedCountAR) {
         final int expPressReleaseCountSI = expPressedCountSI + expReleasedCountSI;
         final int expPressReleaseCountAR = expPressedCountAR + expReleasedCountAR;
         final int expPressReleaseCountALL = expPressReleaseCountSI + expPressReleaseCountAR;
diff --git a/src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java
index 22e241f..bd191dd 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/NEWTMouseAdapter.java
@@ -44,12 +44,12 @@ public class NEWTMouseAdapter extends MouseAdapter implements InputEventCountAda
     List<EventObject> queue = new ArrayList<EventObject>();
     boolean verbose = true;
 
-    public NEWTMouseAdapter(String prefix) {
+    public NEWTMouseAdapter(final String prefix) {
         this.prefix = prefix;
         reset();
     }
 
-    public synchronized void setVerbose(boolean v) { verbose = v; }
+    public synchronized void setVerbose(final boolean v) { verbose = v; }
 
     public synchronized boolean isPressed() {
         return pressed;
@@ -78,7 +78,7 @@ public class NEWTMouseAdapter extends MouseAdapter implements InputEventCountAda
         queue.clear();
     }
 
-    public synchronized void mousePressed(MouseEvent e) {
+    public synchronized void mousePressed(final MouseEvent e) {
         pressed = true;
         queue.add(e);
         if( verbose ) {
@@ -86,7 +86,7 @@ public class NEWTMouseAdapter extends MouseAdapter implements InputEventCountAda
         }
     }
 
-    public synchronized void mouseReleased(MouseEvent e) {
+    public synchronized void mouseReleased(final MouseEvent e) {
         pressed = false;
         queue.add(e);
         if( verbose ) {
@@ -94,7 +94,7 @@ public class NEWTMouseAdapter extends MouseAdapter implements InputEventCountAda
         }
     }
 
-    public synchronized void mouseClicked(MouseEvent e) {
+    public synchronized void mouseClicked(final MouseEvent e) {
         mouseClicked+=e.getClickCount();
         if(e.isConsumed()) {
             consumed++;
diff --git a/src/test/com/jogamp/opengl/test/junit/util/QuitAdapter.java b/src/test/com/jogamp/opengl/test/junit/util/QuitAdapter.java
index 467dd7f..b355d51 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/QuitAdapter.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/QuitAdapter.java
@@ -34,21 +34,21 @@ public class QuitAdapter extends WindowAdapter implements WindowListener, KeyLis
     boolean shouldQuit = false;
     boolean enabled = true;
 
-    public void enable(boolean v) { enabled = v; }
+    public void enable(final boolean v) { enabled = v; }
 
     public void clear() { shouldQuit = false; }
 
     public boolean shouldQuit() { return shouldQuit; }
     public void doQuit() { shouldQuit=true; }
 
-    public void windowDestroyNotify(WindowEvent e) {
+    public void windowDestroyNotify(final WindowEvent e) {
         if( enabled ) {
             System.err.println("QUIT Window "+Thread.currentThread());
             shouldQuit = true;
         }
     }
 
-    public void keyReleased(KeyEvent e) {
+    public void keyReleased(final KeyEvent e) {
         if( !e.isPrintableKey() || e.isAutoRepeat() ) {
             return;
         }
@@ -59,6 +59,6 @@ public class QuitAdapter extends WindowAdapter implements WindowListener, KeyLis
             }
         }
     }
-    public void keyPressed(KeyEvent e) {}
+    public void keyPressed(final KeyEvent e) {}
 }
 
diff --git a/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
index a08e9f8..c2b309c 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/UITestCase.java
@@ -39,6 +39,7 @@ import java.util.Arrays;
 import java.util.Iterator;
 import java.util.List;
 import java.util.StringTokenizer;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import javax.media.nativewindow.NativeWindowFactory;
 import javax.media.opengl.GL;
@@ -94,7 +95,7 @@ public abstract class UITestCase {
         return testSupported;
     }
 
-    public static void setTestSupported(boolean v) {
+    public static void setTestSupported(final boolean v) {
         System.err.println("setTestSupported: "+v);
         testSupported = v;
     }
@@ -169,13 +170,13 @@ public abstract class UITestCase {
                         System.err.println("XRandR Reset Error Code "+errorCode);
                     }
                 }
-            } catch (Exception e) {
-                System.err.println("Catched "+e.getClass().getName()+": "+e.getMessage());
+            } catch (final Exception e) {
+                System.err.println("Caught "+e.getClass().getName()+": "+e.getMessage());
                 e.printStackTrace();
             }
         }
     }
-    private static String getFirst(String line) {
+    private static String getFirst(final String line) {
         final StringTokenizer tok = new StringTokenizer(line);
         if( tok.hasMoreTokens() ) {
             final String s = tok.nextToken().trim();
@@ -186,7 +187,7 @@ public abstract class UITestCase {
         return null;
     }
 
-    public static int processCommand(String[] cmdline, OutputStream outstream, String outPrefix) {
+    public static int processCommand(final String[] cmdline, final OutputStream outstream, final String outPrefix) {
         int errorCode = 0;
         final Object ioSync = new Object();
         try {
@@ -202,8 +203,8 @@ public abstract class UITestCase {
                 p.waitFor(); // should be fine by now ..
                 errorCode = p.exitValue();
             }
-        } catch (Exception e) {
-            System.err.println("Catched "+e.getClass().getName()+": "+e.getMessage());
+        } catch (final Exception e) {
+            System.err.println("Caught "+e.getClass().getName()+": "+e.getMessage());
             e.printStackTrace();
             errorCode = Integer.MIN_VALUE;
         }
@@ -215,7 +216,7 @@ public abstract class UITestCase {
             int ml = 0;
             final TestClass tc = new TestClass(getClass());
             final List<FrameworkMethod> testMethods = tc.getAnnotatedMethods(org.junit.Test.class);
-            for(Iterator<FrameworkMethod> iter=testMethods.iterator(); iter.hasNext(); ) {
+            for(final Iterator<FrameworkMethod> iter=testMethods.iterator(); iter.hasNext(); ) {
                 final int l = iter.next().getName().length();
                 if( ml < l ) { ml = l; }
             }
@@ -228,11 +229,11 @@ public abstract class UITestCase {
         return _unitTestName.getMethodName();
     }
 
-    public final String getSimpleTestName(String separator) {
+    public final String getSimpleTestName(final String separator) {
         return getClass().getSimpleName()+separator+getTestMethodName();
     }
 
-    public final String getFullTestName(String separator) {
+    public final String getFullTestName(final String separator) {
         return getClass().getName()+separator+getTestMethodName();
     }
 
@@ -267,17 +268,17 @@ public abstract class UITestCase {
         System.err.println("++++ UITestCase.tearDown: "+getFullTestName(" - "));
     }
 
-    public static void waitForKey(String preMessage) {
-        BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
+    public static void waitForKey(final String preMessage) {
+        final BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
         System.err.println(preMessage+"> Press enter to continue");
         try {
             System.err.println(stdin.readLine());
-        } catch (IOException e) { }
+        } catch (final IOException e) { e.printStackTrace(); }
     }
 
     static final String unsupportedTestMsg = "Test not supported on this platform.";
 
-    public String getSnapshotFilename(int sn, String postSNDetail, GLCapabilitiesImmutable caps, int width, int height, boolean sinkHasAlpha, String fileSuffix, String destPath) {
+    public String getSnapshotFilename(final int sn, String postSNDetail, final GLCapabilitiesImmutable caps, final int width, final int height, final boolean sinkHasAlpha, String fileSuffix, final String destPath) {
         if(null == fileSuffix) {
             fileSuffix = TextureIO.PNG;
         }
@@ -332,13 +333,25 @@ public abstract class UITestCase {
      *                 It shall not end with a directory separator, {@link File#separatorChar}.
      *                 If <code>null</code> the current working directory is being used.
      */
-    public void snapshot(int sn, String postSNDetail, GL gl, GLReadBufferUtil readBufferUtil, String fileSuffix, String destPath) {
+    public void snapshot(final int sn, final String postSNDetail, final GL gl, final GLReadBufferUtil readBufferUtil, final String fileSuffix, final String destPath) {
+
         final GLDrawable drawable = gl.getContext().getGLReadDrawable();
         final String filename = getSnapshotFilename(sn, postSNDetail,
-                                                    drawable.getChosenGLCapabilities(), drawable.getWidth(), drawable.getHeight(),
+                                                    drawable.getChosenGLCapabilities(), drawable.getSurfaceWidth(), drawable.getSurfaceHeight(),
                                                     readBufferUtil.hasAlpha(), fileSuffix, destPath);
         System.err.println(Thread.currentThread().getName()+": ** screenshot: "+filename);
         gl.glFinish(); // just make sure rendering finished ..
+        try {
+            snapshot(gl, readBufferUtil, filename);
+        } catch (final ClassNotFoundException cnfe) {
+            // Texture class belongs to jogl-util.jar which my not be included in test environment!
+            System.err.println("Caught ClassNotFoundException: "+cnfe.getMessage());
+        } catch (final NoClassDefFoundError cnfe) {
+            // Texture class belongs to jogl-util.jar which my not be included in test environment!
+            System.err.println("Caught NoClassDefFoundError: "+cnfe.getMessage());
+        }
+    }
+    private void snapshot(final GL gl, final GLReadBufferUtil readBufferUtil, final String filename) throws ClassNotFoundException, NoClassDefFoundError {
         if(readBufferUtil.readPixels(gl, false)) {
             readBufferUtil.write(new File(filename));
         }
@@ -349,48 +362,48 @@ public abstract class UITestCase {
         private volatile boolean makeShot = false;
         private volatile boolean makeShotAlways = false;
         private volatile boolean verbose = false;
-        private volatile int displayCount=0;
-        private volatile int reshapeCount=0;
+        private final AtomicInteger displayCount = new AtomicInteger(0);
+        private final AtomicInteger reshapeCount = new AtomicInteger(0);
         private volatile String postSNDetail = null;
-        public SnapshotGLEventListener(GLReadBufferUtil screenshot) {
+        public SnapshotGLEventListener(final GLReadBufferUtil screenshot) {
             this.screenshot = screenshot;
         }
         public SnapshotGLEventListener() {
             this.screenshot = new GLReadBufferUtil(false, false);
         }
-        public int getDisplayCount() { return displayCount; }
-        public int getReshapeCount() { return reshapeCount; }
+        public int getDisplayCount() { return displayCount.get(); }
+        public int getReshapeCount() { return reshapeCount.get(); }
         public GLReadBufferUtil getGLReadBufferUtil() { return screenshot; }
-        public void init(GLAutoDrawable drawable) {}
-        public void dispose(GLAutoDrawable drawable) {}
-        public void display(GLAutoDrawable drawable) {
+        public void init(final GLAutoDrawable drawable) {}
+        public void dispose(final GLAutoDrawable drawable) {}
+        public void display(final GLAutoDrawable drawable) {
             final GL gl = drawable.getGL();
             final boolean _makeShot = makeShot || makeShotAlways;
             if(verbose) {
-                System.err.println(Thread.currentThread().getName()+": ** display: "+displayCount+": "+drawable.getWidth()+"x"+drawable.getHeight()+", makeShot "+_makeShot);
+                System.err.println(Thread.currentThread().getName()+": ** display: "+displayCount+": "+drawable.getSurfaceWidth()+"x"+drawable.getSurfaceHeight()+", makeShot "+_makeShot);
             }
             if(_makeShot) {
                 makeShot=false;
-                snapshot(displayCount, postSNDetail, gl, screenshot, TextureIO.PNG, null);
+                snapshot(displayCount.get(), postSNDetail, gl, screenshot, TextureIO.PNG, null);
             }
-            displayCount++;
+            displayCount.incrementAndGet();
         }
-        public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+        public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
             if(verbose) {
-                System.err.println(Thread.currentThread().getName()+": ** reshape: "+reshapeCount+": "+width+"x"+height+" - "+drawable.getWidth()+"x"+drawable.getHeight());
+                System.err.println(Thread.currentThread().getName()+": ** reshape: "+reshapeCount+": "+width+"x"+height+" - "+drawable.getSurfaceWidth()+"x"+drawable.getSurfaceHeight());
             }
-            reshapeCount++;
+            reshapeCount.incrementAndGet();
         }
         public void setMakeSnapshot() {
             makeShot=true;
         }
-        public void setMakeSnapshotAlways(boolean v) {
+        public void setMakeSnapshotAlways(final boolean v) {
             makeShotAlways=v;
         }
-        public void setVerbose(boolean v) {
+        public void setVerbose(final boolean v) {
             verbose=v;
         }
-        public void setPostSNDetail(String v) {
+        public void setPostSNDetail(final String v) {
             postSNDetail = v;
         }
     };
diff --git a/src/test/com/jogamp/opengl/test/junit/util/ValidateLockListener.java b/src/test/com/jogamp/opengl/test/junit/util/ValidateLockListener.java
index 73c1ad7..ceb1715 100644
--- a/src/test/com/jogamp/opengl/test/junit/util/ValidateLockListener.java
+++ b/src/test/com/jogamp/opengl/test/junit/util/ValidateLockListener.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,12 +20,12 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
  */
- 
+
 package com.jogamp.opengl.test.junit.util;
 
 
@@ -36,10 +36,10 @@ import javax.media.opengl.GLEventListener;
 
 public class ValidateLockListener implements GLEventListener {
 
-    private void validateLock(GLAutoDrawable drawable) {
+    private void validateLock(final GLAutoDrawable drawable) {
         final NativeSurface ns = drawable.getNativeSurface();
         ns.getGraphicsConfiguration().getScreen().getDevice().validateLocked();
-        
+
         final Thread current = Thread.currentThread();
         final Thread owner = ns.getSurfaceLockOwner();
         if( ns.isSurfaceLockedByOtherThread() ) {
@@ -49,23 +49,23 @@ public class ValidateLockListener implements GLEventListener {
             if( null == owner ) {
                 throw new RuntimeException(current.getName()+": Not locked: "+ns);
             }
-            throw new RuntimeException(current.getName()+": Locked by another thread(2), owner "+owner+", "+ns);            
+            throw new RuntimeException(current.getName()+": Locked by another thread(2), owner "+owner+", "+ns);
         }
     }
-    
-    public void init(GLAutoDrawable drawable) {
+
+    public void init(final GLAutoDrawable drawable) {
         validateLock(drawable);
     }
 
-    public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height) {
+    public void reshape(final GLAutoDrawable drawable, final int x, final int y, final int width, final int height) {
         validateLock(drawable);
     }
 
-    public void display(GLAutoDrawable drawable) {
+    public void display(final GLAutoDrawable drawable) {
         validateLock(drawable);
     }
 
-    public void dispose(GLAutoDrawable drawable) {
+    public void dispose(final GLAutoDrawable drawable) {
         validateLock(drawable);
     }
 }
diff --git a/src/test/jogamp/newt/WindowImplAccess.java b/src/test/jogamp/newt/WindowImplAccess.java
index 3387a2a..b98835f 100644
--- a/src/test/jogamp/newt/WindowImplAccess.java
+++ b/src/test/jogamp/newt/WindowImplAccess.java
@@ -3,14 +3,14 @@
  *
  * Redistribution and use in source and binary forms, with or without modification, are
  * permitted provided that the following conditions are met:
- * 
+ *
  *    1. Redistributions of source code must retain the above copyright notice, this list of
  *       conditions and the following disclaimer.
- * 
+ *
  *    2. Redistributions in binary form must reproduce the above copyright notice, this list
  *       of conditions and the following disclaimer in the documentation and/or other materials
  *       provided with the distribution.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED BY JogAmp Community ``AS IS'' AND ANY EXPRESS OR IMPLIED
  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL JogAmp Community OR
@@ -20,7 +20,7 @@
  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- * 
+ *
  * The views and conclusions contained in the software and documentation are those of the
  * authors and should not be interpreted as representing official policies, either expressed
  * or implied, of JogAmp Community.
@@ -34,13 +34,13 @@ import com.jogamp.newt.Window;
  * Allows access to protected methods of WindowImpl
  */
 public class WindowImplAccess {
-    public static final void windowDestroyNotify(Window win) {
+    public static final void windowDestroyNotify(final Window win) {
         final WindowImpl winImpl = (WindowImpl) win.getDelegatedWindow();
         winImpl.runOnEDTIfAvail(true, new Runnable() {
             public void run() {
                 winImpl.windowDestroyNotify(false);
             }
-        });        
+        });
     }
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libjogl2-java.git



More information about the pkg-java-commits mailing list